summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Mejia <amejia004@gmail.com>2013-02-02 23:46:44 -0500
committerAndres Mejia <amejia004@gmail.com>2013-02-02 23:46:44 -0500
commit9797fb4e49a0ce9fad6f011571cc04417d053516 (patch)
tree9fb44994cc46337eb792d0c2666e1db2f64ed1e4
parent1a0f8974bd3092e1f313e301d1ccc352b6b60118 (diff)
downloadlibarchive-9797fb4e49a0ce9fad6f011571cc04417d053516.tar.gz
Make POSIX regex checks cleaner.
-rw-r--r--configure.ac15
1 files changed, 13 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index c44d3001..7f405d76 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