# HG changeset patch # User John W. Eaton # Date 1233187095 18000 # Node ID f1534e248260a381532327971464701cf78fba8a # Parent a2dd2ffc504dd4b7b3322722fc376a4725936f73 configure.in: check for pcre_compile, don't check for other regex functions if pcre library is found diff -r a2dd2ffc504d -r f1534e248260 ChangeLog --- a/ChangeLog Wed Jan 28 11:25:07 2009 -0500 +++ b/ChangeLog Wed Jan 28 18:58:15 2009 -0500 @@ -1,10 +1,15 @@ 2009-01-28 John W. Eaton + * configure.in: Check to see that pcre library has pcre_compile + function. Don't check for other regex functions is pcre library + is found. + * configure.in (SHLLIBPRE, SHLBINPRE): New variables. AC_SUBST them. (*-*-cygwin*): Set LIBPRE and SHLBINPRE to cyg and SHLLIBPRE to lib. Use SHLLIBPRE and SHLLIB in definition of SONAME_FLAGS. (*-*-msdosmsvc): Make SHLBINPRE and SHLLIBPRE empty. Adjust definition of SONAME_FLAGS for SHLLIBPRE. + * Makeconf.in (SHLLIBPRE, SHLBINPRE): Substitute new variables here. From Marco Atzeri . diff -r a2dd2ffc504d -r f1534e248260 configure.in --- a/configure.in Wed Jan 28 11:25:07 2009 -0500 +++ b/configure.in Wed Jan 28 18:58:15 2009 -0500 @@ -457,30 +457,37 @@ WITH_PCRE="$ac_cv_pcre_h_macros_present" REGEX_LIBS= -if test $WITH_PCRE = yes; then - AC_DEFINE(HAVE_PCRE, 1, [Define if PCRE is available.]) - if test $WITH_PCRE_CONFIG = yes; then +using_pcre=no +using_regex=no +if test "$WITH_PCRE" = yes; then + if test "$WITH_PCRE_CONFIG" = yes; then REGEX_LIBS=$(pcre-config --libs) else REGEX_LIBS=-lpcre fi + save_LIBS="$LIBS" + LIBS="$REGEX_LIBS $LIBS" + AC_CHECK_FUNCS(pcre_compile, [using_pcre=yes + AC_DEFINE(HAVE_PCRE, 1, [Define if PCRE library is available.])], [ + REGEX_LIBS= + warn_pcre="PCRE library not found. This will result in some loss of functionality for the regular expression matching functions." + AC_MSG_WARN($warn_pcre)]) + LIBS="$save_LIBS" else warn_pcre="PCRE library not found. This will result in some loss of functionality for the regular expression matching functions." AC_MSG_WARN($warn_pcre) fi -AC_CHECK_FUNCS(regexec, WITH_REGEX=yes , [ - AC_CHECK_LIB(regex, regexec, WITH_REGEX=yes, WITH_REGEX=no)]) -if test $WITH_REGEX = yes ; then - AC_DEFINE(HAVE_REGEX, 1, [Define if regex is available.]) - AC_CHECK_FUNCS(regexec, REGEX_LIBS= , [ - AC_CHECK_LIB(regex, regexec, REGEX_LIBS="$REGEX_LIBS -lregex")]) +if test "$using_pcre" = no; then + AC_CHECK_FUNCS(regexec, [using_regex=yes], [ + AC_CHECK_LIB(regex, regexec, [using_regex=yes + REGEX_LIBS="-lregex"], [ + warn_regex="regular expression functions not found. The regular expression matching functions will be disabled." + AC_MSG_WARN($warn_regex)])]) + if test "$using_regex" = yes; then + AC_DEFINE(HAVE_REGEX, 1, [Define if regex library is available.]) + fi fi -if test $WITH_REGEX = no; then - warn_regex="regular expression functions not found. The regular expression matching functions will be disabled." - AC_MSG_WARN($warn_regex) -fi - AC_SUBST(REGEX_LIBS) ### Check for ZLIB library.