]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Make POSIX regex checks cleaner.
authorAndres Mejia <amejia004@gmail.com>
Sun, 3 Feb 2013 04:46:44 +0000 (23:46 -0500)
committerAndres Mejia <amejia004@gmail.com>
Sun, 3 Feb 2013 04:46:44 +0000 (23:46 -0500)
configure.ac

index c44d3001f1038f6e6eb9c98a378cc8afd71c85c6..7f405d76e42f5ea7a5cd672fc3fc3db64a87af96 100644 (file)
@@ -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