From: Stef Walter Date: Sun, 10 Mar 2013 20:42:49 +0000 (+0100) Subject: Fix up the system anchors/certificates configure arguments X-Git-Tag: 0.17.1~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3177cbccb237bfef66721eeb773b574f1d8ba076;p=p11-kit Fix up the system anchors/certificates configure arguments 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. --- diff --git a/configure.ac b/configure.ac index 22bfbaf..66fcff9 100644 --- a/configure.ac +++ b/configure.ac @@ -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