Use AC_ARG_WITH instead of AC_ARG_ENABLE for pkcs11 support flag for ./configure script. This will avoid confusion about inclusion of PKCS#11 data management tools, by enforcing it's inclusion per default (and aborting in case the header can't be found).
Signed-off-by: Klaus Heinrich Kiwi <[email protected]> --- configure.in | 28 ++++++++++++++++------------ dist/tpm-tools-nopkcs11.spec | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/configure.in b/configure.in index 918ea8e..e3921e8 100644 --- a/configure.in +++ b/configure.in @@ -108,19 +108,23 @@ AC_CHECK_HEADER(trousers/tss.h, [TSS_INC="1"], [AC_MSG_ERROR([tss header not fou AC_CHECK_LIB(crypto, PEM_read_X509, [OPENSSL_LIB="1"], [AC_MSG_ERROR([openssl lib not found: libcrypto.so])]) AC_CHECK_HEADER(openssl/evp.h, [OPENSSL_INC="1"], [AC_MSG_ERROR([openssl header not found: openssl/evp.h])]) -OPENCRYPTOKI="0" -AC_ARG_ENABLE(pkcs11_support, - AC_HELP_STRING([--disable-pkcs11-support], [don't build data_mgmt commands [[default=no]]]), - [disable_pkcs11_support="yes" - AC_MSG_RESULT([*** Not building data_mgmt at user request ***])],) - -if test "x$disable_pkcs11_support" != "xyes"; then - AC_CHECK_HEADER(opencryptoki/pkcs11.h, [OPENCRYPTOKI_INC="1"], [OPENCRYPTOKI_INC="0"]) - if test "$OPENCRYPTOKI_INC" = "1"; then - OPENCRYPTOKI="1" - fi +AC_ARG_WITH([pkcs11], + AS_HELP_STRING([--with-pkcs11], + [Build PKCS11 token commands (default is yes)]), + [], + [with_pkcs11=yes]) + +dnl test pkcs11 support +if test "x$with_pkcs11" != "xno"; then + AC_CHECK_HEADER(opencryptoki/pkcs11.h, + [with_pkcs11=yes], + [if test "x$with_pkcs11" = "xyes"; then + AC_MSG_ERROR([opencryptoki header not found: opencryptoki/pkcs11.h]) + fi + with_pkcs11=no + ]) fi -AM_CONDITIONAL([P11_SUPPORT], [test "$OPENCRYPTOKI" = "1"]) +AM_CONDITIONAL([P11_SUPPORT], [test "x$with_pkcs11" = "xyes"]) AC_HEADER_STDC diff --git a/dist/tpm-tools-nopkcs11.spec b/dist/tpm-tools-nopkcs11.spec index 92f1640..deef3bf 100644 --- a/dist/tpm-tools-nopkcs11.spec +++ b/dist/tpm-tools-nopkcs11.spec @@ -34,7 +34,7 @@ necessary for developing tpm-tools applications. %build autoreconf --force --install -%configure --disable-static --disable-pkcs11-support +%configure --disable-static --without-pkcs11 make -- 1.6.2.5 ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ TrouSerS-tech mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/trousers-tech
