From: Andres Mejia Date: Sun, 3 Feb 2013 04:46:44 +0000 (-0500) Subject: Make POSIX regex checks cleaner. X-Git-Tag: v3.1.2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9797fb4e49a0ce9fad6f011571cc04417d053516;p=thirdparty%2Flibarchive.git Make POSIX regex checks cleaner. --- diff --git a/configure.ac b/configure.ac index c44d3001f..7f405d76e 100644 --- a/configure.ac +++ b/configure.ac @@ -359,12 +359,23 @@ posix_regex_lib_found= if test "$enable_posix_regex_lib" = "auto" || test "$enable_posix_regex_lib" = "libc" || test "$enable_posix_regex_lib" = "libregex"; then AC_CHECK_HEADERS([regex.h]) if test "x$ac_cv_header_regex_h" != "xno"; then - AC_CHECK_FUNC(regcomp, posix_regex_lib_found=1, [AC_CHECK_LIB(regex,regcomp,posix_regex_lib_found=1;LIBS="-lregex $LIBS";AC_DEFINE([HAVE_LIBREGEX], [1], [Define to 1 if you have the `regex' library (-lregex).]))]) + AC_CHECK_FUNC(regcomp) + if test "x$ac_cv_func_regcomp" = xyes; then + posix_regex_lib_found=1 + else + AC_CHECK_LIB(regex,regcomp) + if test "x$ac_cv_lib_regex_regcomp" = xyes; then + posix_regex_lib_found=1 + fi + fi fi fi if test -z $posix_regex_lib_found && (test "$enable_posix_regex_lib" = "auto" || test "$enable_posix_regex_lib" = "libpcreposix"); then AC_CHECK_HEADERS([pcreposix.h]) - AC_CHECK_LIB(pcreposix,regcomp,posix_regex_lib_found=1;LIBS="-lpcreposix $LIBS";AC_DEFINE([HAVE_LIBPCREPOSIX], [1], [Define to 1 if you have the `pcreposix' library (-lpcreposix).])) + AC_CHECK_LIB(pcreposix,regcomp) + if test "x$ac_cv_lib_pcreposix_regcomp" = xyes; then + posix_regex_lib_found=1 + fi fi # TODO: Give the user the option of using a pre-existing system