]> granicus.if.org Git - p11-kit/commitdiff
Don't require explictly disabling trust module if --without-libtasn1
authorAndreas Metzler <ametzler@downhill.at.eu.org>
Thu, 7 Feb 2013 20:32:58 +0000 (21:32 +0100)
committerStef Walter <stefw@gnome.org>
Thu, 7 Feb 2013 22:17:20 +0000 (23:17 +0100)
And provide more intelligent error messages about why to build
with libtasn1

Tweaked by Stef Walter

configure.ac

index 67bf5de7ce4a54ba3c335cf0df617bd0128f25e2..5b85b5498a437b7a464687ab4b26b759f5150369 100644 (file)
@@ -58,7 +58,6 @@ AC_MSG_RESULT([$os_win32])
 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
 
 AC_C_BIGENDIAN
-AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
 # ------------------------------------------------------------------------------
 # Checks for libraries and headers
@@ -130,13 +129,15 @@ AC_ARG_WITH([libtasn1],
                            [Disable dependency on libtasn1])
 )
 
-if test "$with_libtasn1" != "no"; then
-       PKG_CHECK_MODULES(LIBTASN1, libtasn1 >= 2.14)
+AS_IF([test "$with_libtasn1" != "no"], [
+       PKG_CHECK_MODULES([LIBTASN1], [libtasn1 >= 2.14], [],
+               [AC_MSG_ERROR([libtasn1 not found. Building without it results in significant loss of functionality. To proceed use --without-libtasn1])]
+       )
        AC_SUBST(LIBTASN1_CFLAGS)
        AC_SUBST(LIBTASN1_LIBS)
        with_libtasn1="yes"
        AC_DEFINE_UNQUOTED(WITH_ASN1, 1, [Build with libtasn1 and certificate support])
-fi
+])
 
 AM_CONDITIONAL(WITH_ASN1, test "$with_libtasn1" = "yes")
 
@@ -149,16 +150,19 @@ AC_ARG_ENABLE([trust-module],
 )
 
 AC_MSG_CHECKING([if trust module is enabled])
+AS_IF([test "$with_libtasn1" != "yes"], [
+       AS_IF([test "$enable_trust_module" = "yes"], [
+               AC_MSG_ERROR([--with-libtasn1 is needed in order to build the trust module])
+       ])
+       AS_IF([test "$enable_trust_module" != "no"], [
+               AC_MSG_WARN([--with-libtasn1 is needed in order to build the trust module, disabling])
+       ])
+       enable_trust_module="no"
+])
 
-if test "$enable_trust_module" != "no"; then
-       if test "$with_libtasn1" != "yes"; then
-               AC_MSG_ERROR([need --with-libtasn1 in order to use the trust module.])
-       fi
-       enable_trust_module="yes"
-fi
-
-AC_MSG_RESULT([$enable_trust_module])
+AS_IF(test "$enable_trust_module" != "no"], [enable_trust_module="yes"])
 AM_CONDITIONAL(WITH_TRUST_MODULE, test "$enable_trust_module" = "yes")
+AC_MSG_RESULT([$enable_trust_module])
 
 AC_ARG_WITH([system-anchors],
             AS_HELP_STRING([--with-system-anchors=@<:@path@:>@]: