blob: 819de352a5f087185cb2509fa7c3679b5621007c [file] [log] [blame]
AC_INIT(openssl-pkcs11, 0.3.0, <James.Bottomley@HansenPartnership.com>)
AM_INIT_AUTOMAKE([foreign 1.6])
AC_DISABLE_STATIC
AC_PROG_CC_STDC
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_PROG_LIBTOOL
AC_PROG_LN_S
PKG_CHECK_MODULES([CRYPTO], [libcrypto >= 1.0.2])
# OAEP definitions are missing from earlier p11-kit
PKG_CHECK_MODULES([P11KIT], [p11-kit-1 >= 0.23.3])
AC_ARG_WITH(
[pkcs11-dir],
[AS_HELP_STRING([--with-pkcs11-dir], [default PKCS11 module directory])],
[pkcs11_dir="${withval}"],
[PKG_CHECK_VAR([pkcs11_dir], [p11-kit-1], [p11_module_path])])
if test -z "$pkcs11_dir"; then
AC_MSG_ERROR([no pkcs11 directory: either install p11-kit-devel or specify --with-pkcs11-dir])
fi
PKG_CHECK_VAR([pkcs11_configs], [p11-kit-1], [p11_module_configs])
LIBRARY_VERSION_MAJOR=`echo $PACKAGE_VERSION|cut -d. -f1`
AC_DEFINE_UNQUOTED(LIBRARY_VERSION_MAJOR, $LIBRARY_VERSION_MAJOR)
LIBRARY_VERSION_MINOR=`echo $PACKAGE_VERSION|cut -d. -f2`
AC_DEFINE_UNQUOTED(LIBRARY_VERSION_MINOR, $LIBRARY_VERSION_MINOR)
AC_CHECK_FUNCS(reallocarray)
AC_SUBST(pkcs11_dir)
AC_SUBST(pkcs11_configs)
AC_OUTPUT([Makefile tests/Makefile])
cat <<EOF
Library Version: ${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}
pkcs11 module directory: ${pkcs11_dir}
EOF