apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1389169 - /apr/apr/trunk/build/crypto.m4
Date Sun, 23 Sep 2012 23:22:43 GMT
Author: trawick
Date: Sun Sep 23 23:22:42 2012
New Revision: 1389169

URL: http://svn.apache.org/viewvc?rev=1389169&view=rev
Log:
fix AC_CHECK_HEADER() usage with APU_CHECK_CRYPTO_NSS

The action-if-found is executed if *any* of the headers listed
are found, so only equivalent headers should be searched
with one invocation if action-if-found is used to flag success.

This catches an error such as missing prerror.h at at configure
time instead of at build time.

Modified:
    apr/apr/trunk/build/crypto.m4

Modified: apr/apr/trunk/build/crypto.m4
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/crypto.m4?rev=1389169&r1=1389168&r2=1389169&view=diff
==============================================================================
--- apr/apr/trunk/build/crypto.m4 (original)
+++ apr/apr/trunk/build/crypto.m4 Sun Sep 23 23:22:42 2012
@@ -164,7 +164,6 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [
 ])
 
 AC_DEFUN([APU_CHECK_CRYPTO_NSS], [
-  nss_have_headers=0
   nss_have_libs=0
 
   old_libs="$LIBS"
@@ -174,7 +173,6 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [
   AC_ARG_WITH([nss], 
   [APR_HELP_STRING([--with-nss=DIR], [specify location of NSS])],
   [
-
     if test "$withval" = "yes"; then
       AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
       if test -n "$PKG_CONFIG"; then
@@ -183,9 +181,15 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [
         APR_ADDTO(CPPFLAGS, [$nss_CPPFLAGS])
         APR_ADDTO(LDFLAGS, [$nss_LDFLAGS])
       fi
-      AC_CHECK_HEADERS(prerror.h nss/nss.h nss.h nss/pk11pub.h pk11pub.h, [nss_have_headers=1])
+      nss_have_prerrorh=0
+      nss_have_nssh=0
+      nss_have_pk11pubh=0
+      AC_CHECK_HEADERS(prerror.h, [nss_have_prerrorh=1])
+      AC_CHECK_HEADERS(nss/nss.h nss.h, [nss_have_nssh=1])
+      AC_CHECK_HEADERS(nss/pk11pub.h pk11pub.h, [nss_have_pk11pubh=1])
+      nss_have_headers=${nss_have_prerrorh}${nss_have_nssh}${nss_have_pk11pubh}
       AC_CHECK_LIB(nspr4, PR_Initialize, AC_CHECK_LIB(nss3, PK11_CreatePBEV2AlgorithmID,
[nss_have_libs=1],,-lnspr4))
-      if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then
+      if test "$nss_have_headers" = "111" && test "$nss_have_libs" != "0"; then
         apu_have_nss=1
       fi
     elif test "$withval" = "no"; then
@@ -199,9 +203,15 @@ AC_DEFUN([APU_CHECK_CRYPTO_NSS], [
       APR_ADDTO(LDFLAGS, [$nss_LDFLAGS])
 
       AC_MSG_NOTICE(checking for nss in $withval)
-      AC_CHECK_HEADERS(prerror.h nss/nss.h nss.h nss/pk11pub.h pk11pub.h, [nss_have_headers=1])
+      nss_have_prerrorh=0
+      nss_have_nssh=0
+      nss_have_pk11pubh=0
+      AC_CHECK_HEADERS(prerror.h, [nss_have_prerrorh=1])
+      AC_CHECK_HEADERS(nss/nss.h nss.h, [nss_have_nssh=1])
+      AC_CHECK_HEADERS(nss/pk11pub.h pk11pub.h, [nss_have_pk11pubh=1])
+      nss_have_headers=${nss_have_prerrorh}${nss_have_nssh}${nss_have_pk11pubh}
       AC_CHECK_LIB(nspr4, PR_Initialize, AC_CHECK_LIB(nss3, PK11_CreatePBEV2AlgorithmID,
[nss_have_libs=1],,-lnspr4))
-      if test "$nss_have_headers" != "0" && test "$nss_have_libs" != "0"; then
+      if test "$nss_have_headers" = "111" && test "$nss_have_libs" != "0"; then
         apu_have_nss=1
       fi
 



Mime
View raw message