From 9ccafea592133ac51a3c5fd8462d972e6929f515 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Wed, 26 Nov 2014 09:38:13 +0100 Subject: [PATCH] Use proper readline detection --- README.macos.md | 5 +---- m4/readline.m4 | 18 +++++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/README.macos.md b/README.macos.md index c4723f29d..cfe0a40a9 100644 --- a/README.macos.md +++ b/README.macos.md @@ -112,10 +112,7 @@ The libvpx build isn't able to produce dual architecture files. To workaround th If you got the source code from git, run `./autogen.sh` first. Then or otherwise, : - # HomeBrew - PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/opt/local --disable-x11 --with-srtp=/opt/local --with-gsm=/opt/local --enable-zrtp --disable-strict --with-readline=/usr/local && make - # MacPorts - PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/opt/local --disable-x11 --with-srtp=/opt/local --with-gsm=/opt/local --enable-zrtp --disable-strict --with-readline=/opt/local && make + PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/opt/local --disable-x11 --with-srtp=/opt/local --with-gsm=/opt/local --enable-zrtp --disable-strict && make * Install on the system diff --git a/m4/readline.m4 b/m4/readline.m4 index ebb7656cd..16065e348 100644 --- a/m4/readline.m4 +++ b/m4/readline.m4 @@ -5,8 +5,12 @@ AC_DEFUN([LP_CHECK_READLINE],[ AC_ARG_WITH( readline, - [ --with-readline Set prefix where gnu readline headers and libs can be found (ex:/usr, /usr/local, none) [default=/usr] ], - [ readline_prefix=${withval}],[ readline_prefix="/usr" ]) + [ --with-readline Set prefix where gnu readline headers and libs can be found (ex:/usr, /usr/local, none) [default=/usr] ], + [ readline_prefix=${withval} ], + [ readline_prefix="/usr/local" ], + [ readline_prefix="/opt/local" ], + [ readline_prefix="/usr" ] +) if test "$readline_prefix" != "none"; then @@ -14,14 +18,14 @@ if test "$readline_prefix" != "none"; then READLINE_CFLAGS="-I$readline_prefix/include" READLINE_LIBS="-L$readline_prefix/lib" fi - + CPPFLAGS_save=$CPPFLAGS LIBS_save=$LIBS CPPFLAGS="$CPPFLAGS $READLINE_CFLAGS" LIBS="$LIBS $READLINE_LIBS" AC_CHECK_HEADERS(readline.h readline/readline.h, readline_h_found=yes) AC_CHECK_HEADERS(history.h readline/history.h) - + for termcap_lib in "" -ltermcap -lcurses -lncurses; do unset ac_cv_lib_readline_readline AC_CHECK_LIB(readline, readline, [readline_libs_found=yes],[],[$termcap_lib]) @@ -33,14 +37,14 @@ if test "$readline_prefix" != "none"; then LIBS=$LIBS_save CPPFLAGS=$CPPFLAGS_save - + if test "$readline_libs_found$readline_h_found" != "yesyes" ; then AC_MSG_WARN([Could not find libreadline headers or library, linphonec will have limited prompt features]) else AC_DEFINE([HAVE_READLINE],1,[defined when compiling with readline support]) fi - - + + AC_SUBST(READLINE_CFLAGS) AC_SUBST(READLINE_LIBS)