]> granicus.if.org Git - p11-kit/commitdiff
Fix up the system anchors/certificates configure arguments
authorStef Walter <stefw@gnome.org>
Sun, 10 Mar 2013 20:42:49 +0000 (21:42 +0100)
committerStef Walter <stefw@gnome.org>
Thu, 14 Mar 2013 06:02:21 +0000 (07:02 +0100)
Double check various combinations, and make sure we don't fail
needlessly when --disable-trust-module. Also check that actual
paths are passed into the arguments.

configure.ac

index 22bfbafef191c08675e18eef9e96ae26f9f58dc6..66fcff90d4c87af590ae516f105338fd09760844 100644 (file)
@@ -185,20 +185,21 @@ AC_ARG_WITH([system-anchors],
 
 AC_MSG_CHECKING([location of system CA anchors])
 
-if test "$enable_trust_module" != "yes"; then
+# This option was disabled, no anchors
+if test "$with_system_anchors" = "no"; then
+       with_system_anchors=""
+       AC_MSG_RESULT([disabled])
+
+elif test "$enable_trust_module" != "yes"; then
        if test "$with_system_anchors" != ""; then
                AC_MSG_ERROR([need --enable-trust-module in order to use system anchors.])
        fi
-       with_system_anchors="no"
-fi
-
-# This option was disabled, no anchors
-if test "$with_system_anchors" = "no"; then
        with_system_anchors=""
        AC_MSG_RESULT([disabled])
 
 # Option was not set, try to detect
-elif test "$with_system_anchors" = ""; then
+elif test "$with_system_anchors" = "" -o "$with_system_anchors" = "yes"; then
+       with_system_anchors=""
        for f in /etc/pki/tls/certs/ca-bundle.crt \
                /etc/ssl/certs/ca-certificates.crt \
                /etc/ssl/ca-bundle.pem \
@@ -214,7 +215,9 @@ elif test "$with_system_anchors" = ""; then
        fi
 
        AC_MSG_RESULT($with_system_anchors)
+
 else
+       # Anchors explicitly set
        AC_MSG_RESULT($with_system_anchors)
 fi
 
@@ -228,21 +231,23 @@ AC_ARG_WITH([system-certificates],
 
 AC_MSG_CHECKING([location of additional system certificates])
 
-if test "$enable_trust_module" != "yes"; then
+# This option was disabled, no additional certificates
+if test "$with_system_certificates" = "no"; then
+       with_system_certificates=""
+       AC_MSG_RESULT([disabled])
+
+elif test "$enable_trust_module" != "yes"; then
        if test "$with_system_certificates" != ""; then
                AC_MSG_ERROR([need --enable-trust-module in order to use additional system certificates.])
        fi
        with_system_certificates=""
-fi
+       AC_MSG_RESULT([disabled])
 
-# This option was disabled, no additional certificates
-if test "$with_system_certificates" = "no"; then
-       with_system_certificates=""
-fi
+elif test "$with_system_certificates" = "yes"; then
+       AC_MSG_ERROR([--with-system-certificates requires paths as an argument])
 
-if test "$with_system_certificates" = ""; then
-       AC_MSG_RESULT([disabled])
 else
+       # Anchors explicitly set
        AC_MSG_RESULT($with_system_certificates)
 fi