diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-01-17 14:51:50 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-01-17 14:51:50 +0000 |
commit | 245d838636173d69992fb9a99710896c6a610616 (patch) | |
tree | 01d65b8218d8fd4c07dd95a8887ecfa66b123070 | |
parent | e2ea7c3e55bbc6b80e9ed17cf760594348f25ec2 (diff) | |
download | pcre-245d838636173d69992fb9a99710896c6a610616.tar.gz |
More portable way of linking pcretest with -lreadline.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@889 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | configure.ac | 31 |
2 files changed, 31 insertions, 3 deletions
@@ -48,6 +48,9 @@ Version 8.30 12. Stephen Kelly's patch to CMakeLists.txt allows it to parse the version information out of configure.ac instead of relying on pcre.h.generic, which is not stored in the repository. + +13. Applied Dmitry V. Levin's patch for a more portable method for linking with + -lreadline. Version 8.21 12-Dec-2011 diff --git a/configure.ac b/configure.ac index a22db99..d9c4860 100644 --- a/configure.ac +++ b/configure.ac @@ -536,7 +536,30 @@ LIBS="$OLD_LIBS" AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1]) AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1]) -AC_CHECK_LIB([readline], [readline], [HAVE_LIB_READLINE=1]) +AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lreadline"], + [unset ac_cv_lib_readline_readline; + AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltinfo"], + [unset ac_cv_lib_readline_readline; + AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lcurses"], + [unset ac_cv_lib_readline_readline; + AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncurses"], + [unset ac_cv_lib_readline_readline; + AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-lncursesw"], + [unset ac_cv_lib_readline_readline; + AC_CHECK_LIB([readline], [readline], [LIBREADLINE="-ltermcap"], + [LIBREADLINE=""], + [-ltermcap])], + [-lncursesw])], + [-lncurses])], + [-lcurses])], + [-ltinfo])]) +AC_SUBST(LIBREADLINE) +if test -n "$LIBREADLINE"; then + if test "$LIBREADLINE" != "-lreadline"; then + echo "-lreadline needs $LIBREADLINE" + LIBREADLINE="-lreadline $LIBREADLINE" + fi +fi # This facilitates -ansi builds under Linux dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc]) @@ -795,9 +818,11 @@ if test "$enable_pcretest_libreadline" = "yes"; then echo "** Cannot --enable-pcretest-readline because readline/history.h was not found." exit 1 fi - LIBREADLINE="-lreadline" + if test -z "$LIBREADLINE"; then + echo "** Cannot --enable-pcretest-readline because readline library was not found." + exit 1 + fi fi -AC_SUBST(LIBREADLINE) # Produce these files, in addition to config.h. AC_CONFIG_FILES( |