]> www.average.org Git - pam_pcsc_cr.git/blobdiff - configure.ac
autoconf: update to newer autotools
[pam_pcsc_cr.git] / configure.ac
index 6a862273b93c48d94e8437b42f9d8fe2df28c8af..987690c999487beec7243aa6726be466475e4e87 100644 (file)
@@ -1,22 +1,23 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT([pam_pcsc_cr], 0.9.2)
+AC_INIT([pam_pcsc_cr],[0.9.6])
 AC_CONFIG_SRCDIR([pam_pcsc_cr.c])
 AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE
-AM_CONFIG_HEADER([config.h])
-AC_LANG_C
+AC_CONFIG_HEADERS([config.h])
+AC_LANG([C])
 AC_PROG_CC
 
 if test "X$CC" = "Xgcc"; then
-  CFLAGS="$CFLAGS -Wall"
+  CFLAGS="$CFLAGS -Wall -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3"
 fi
+dnl make CFLAGS="-fsanitize=address -fno-omit-frame-pointer -g" LDFLAGS="-static-libasan"
 
 AC_PROG_MAKE_SET
 AC_SUBST(PROGS)dnl
 AC_SUBST(LIBPROGS)dnl
 AC_PROG_INSTALL
-AM_PROG_LIBTOOL
+LT_INIT
 PKG_PROG_PKG_CONFIG
 
 AC_CHECK_HEADERS([security/pam_appl.h], [], [
@@ -28,13 +29,14 @@ AC_CHECK_HEADERS([security/pam_modules.h security/pam_ext.h], [], [], [
 ])
 AC_CHECK_LIB([pam], [pam_start])
 AC_CHECK_FUNCS([pam_get_authtok])
+pamdir=/lib/${host_cpu}-${host_os}/security
 AC_ARG_WITH(pam-dir,
-       [  --with-pam-dir=DIR      path to install the PAM module (/lib/security)],
+       [  --with-pam-dir=DIR      path to install the PAM module (${pamdir})],
        [PAMDIR="$withval"],
        [
 case $prefix in
-*/_inst) PAMDIR='${exec_prefix}/lib/security' ;;
-*)       PAMDIR=/lib/security ;;
+*/_inst) PAMDIR="${prefix}${pamdir}" ;;
+*)       PAMDIR=${pamdir} ;;
 esac
 ])
 AC_SUBST(PAMDIR)
@@ -44,7 +46,13 @@ PKG_CHECK_MODULES([PCSC], [libpcsclite])
 CPPFLAGS="$PCSC_CFLAGS $CPPFLAGS"
 LIBS="$PCSC_LIBS $LIBS"
 
-PKG_CHECK_MODULES([OPENSSL], [libcrypto], [], [:])
+AC_ARG_ENABLE(openssl,
+       [  --disable-openssl       do not use openssl even when it is present],
+       [], [enable_openssl=yes]
+)
+AS_IF([test "x$enable_openssl" = "xyes"], [
+  PKG_CHECK_MODULES([OPENSSL], [libcrypto], [], [:])
+])
 AS_IF([test "x$OPENSSL_CFLAGS" != "x" -o "x$OPENSSL_LIBS" != "x" ], [
   use_openssl=yes
 ])
@@ -96,8 +104,6 @@ AS_IF([test "x$use_gcrypt" = "xyes"], [
 AC_SUBST(CRYPTO_OBJS)
 
 dnl Checks for header files.
-AC_HEADER_STDC
-AC_HEADER_TIME
 
 AC_CHECK_HEADERS([winscard.h reader.h], [],
   [AC_MSG_ERROR([[pcsclite headers not found]])])