2001-12-22 22:27:20 +00:00
|
|
|
dnl -*- mode: m4; -*-
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
dnl $Id$
|
|
|
|
|
|
|
|
# Require autoconf 2.52
|
|
|
|
AC_PREREQ(2.52)
|
2001-11-26 20:14:48 +00:00
|
|
|
|
2001-12-22 22:27:20 +00:00
|
|
|
AC_INIT(src/libopensc/sc.c)
|
2002-03-12 13:00:57 +00:00
|
|
|
AM_INIT_AUTOMAKE(opensc, 0.6.0)
|
2001-12-22 22:27:20 +00:00
|
|
|
AM_CONFIG_HEADER(config.h)
|
2001-11-26 20:14:48 +00:00
|
|
|
|
2001-12-22 22:27:20 +00:00
|
|
|
AC_CANONICAL_HOST
|
|
|
|
case $host in
|
|
|
|
darwin* | rhapsody*)
|
|
|
|
AC_DEFINE(OS_MACOSX,1,[MacOS X])
|
|
|
|
;;
|
|
|
|
beos*)
|
|
|
|
AC_DEFINE(OS_BEOS,1,[BeOS])
|
|
|
|
;;
|
|
|
|
cygwin* | mingw* | pw32*)
|
|
|
|
AC_DEFINE(OS_CYGWIN,1,[Cywin32 and friends])
|
|
|
|
;;
|
|
|
|
*irix*)
|
|
|
|
AC_DEFINE(OS_IRIX,1,[SGI IRIX])
|
|
|
|
;;
|
|
|
|
*hpux*)
|
|
|
|
AC_DEFINE(OS_HPUX,1,[HP-UX])
|
|
|
|
;;
|
|
|
|
*solaris* | *sunos*)
|
|
|
|
AC_DEFINE(OS_SOLARIS,1,[Sun Solaris])
|
|
|
|
;;
|
|
|
|
*osf*)
|
|
|
|
AC_DEFINE(OS_DUNIX,1,[Digital UNIX])
|
|
|
|
;;
|
|
|
|
*aix*)
|
|
|
|
AC_DEFINE(OS_AIX,1,[IBM AIX])
|
|
|
|
;;
|
|
|
|
*freebsd*)
|
|
|
|
AC_DEFINE(OS_FREEBSD,1,[FreeBSD])
|
|
|
|
;;
|
|
|
|
*netbsd*)
|
|
|
|
AC_DEFINE(OS_NETBSD,1,[NetBSD])
|
|
|
|
;;
|
|
|
|
*openbsd*)
|
|
|
|
AC_DEFINE(OS_OPENBSD,1,[OpenBSD])
|
|
|
|
;;
|
|
|
|
*linux*)
|
|
|
|
AC_DEFINE(OS_LINUX,1,[Linux])
|
|
|
|
;;
|
|
|
|
esac
|
2001-11-26 20:14:48 +00:00
|
|
|
AC_PROG_CC
|
2001-12-22 22:27:20 +00:00
|
|
|
AC_C_BIGENDIAN
|
|
|
|
|
|
|
|
dnl Check for some target-specific stuff
|
|
|
|
case "$host" in
|
|
|
|
*-*-hpux*)
|
|
|
|
CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
|
|
|
|
AC_DEFINE(PAM_SUN_CODEBASE, 1, [PAM based on SUN codebase])
|
|
|
|
;;
|
|
|
|
*-*-solaris*)
|
|
|
|
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
|
|
|
|
LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
|
|
|
|
need_dash_r=1
|
|
|
|
AC_DEFINE(PAM_SUN_CODEBASE, 1, [PAM based on SUN codebase])
|
|
|
|
;;
|
|
|
|
*-*-sunos4*)
|
|
|
|
CPPFLAGS="$CPPFLAGS -DSUNOS4"
|
|
|
|
AC_CHECK_FUNCS(getpwanam)
|
|
|
|
AC_DEFINE(PAM_SUN_CODEBASE, 1, [PAM based on SUN codebase])
|
|
|
|
;;
|
|
|
|
*-*-aix*)
|
|
|
|
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
|
|
|
|
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
|
|
|
if (test "$LD" != "gcc" && test -z "$blibpath"); then
|
|
|
|
blibpath="/usr/lib:/lib:/usr/local/lib"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*-*-linux*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
dnl Allow user to specify flags
|
|
|
|
AC_ARG_WITH(cflags,
|
|
|
|
[ --with-cflags Specify additional flags to pass to compiler],
|
|
|
|
[
|
|
|
|
if test "x$withval" != "xno" ; then
|
|
|
|
CFLAGS="$CFLAGS $withval"
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
AC_ARG_WITH(cppflags,
|
|
|
|
[ --with-cppflags Specify additional flags to pass to preprocessor] ,
|
|
|
|
[
|
|
|
|
if test "x$withval" != "xno"; then
|
|
|
|
CPPFLAGS="$CPPFLAGS $withval"
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
AC_ARG_WITH(ldflags,
|
|
|
|
[ --with-ldflags Specify additional flags to pass to linker],
|
|
|
|
[
|
|
|
|
if test "x$withval" != "xno" ; then
|
|
|
|
LDFLAGS="$LDFLAGS $withval"
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
AC_ARG_WITH(libs,
|
|
|
|
[ --with-libs Specify additional libraries to link with],
|
|
|
|
[
|
|
|
|
if test "x$withval" != "xno" ; then
|
|
|
|
LIBS="$LIBS $withval"
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
|
|
|
|
dnl Special check for pthread support.
|
|
|
|
ACX_PTHREAD(
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_PTHREAD,1,
|
|
|
|
[Define if you have POSIX threads libraries and header files.])
|
|
|
|
], [
|
|
|
|
AC_MSG_ERROR([POSIX thread support required])
|
|
|
|
])
|
|
|
|
LIBS="$PTHREAD_LIBS $LIBS"
|
|
|
|
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
|
|
|
CC="$PTHREAD_CC"
|
|
|
|
|
|
|
|
dnl Add libtool support.
|
|
|
|
AM_PROG_LIBTOOL
|
|
|
|
dnl Automatically update the libtool script if it becomes out-of-date.
|
|
|
|
#AC_SUBST(LIBTOOL_DEPS)
|
|
|
|
|
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2002-02-25 18:43:16 +00:00
|
|
|
AC_CHECK_HEADERS([errno.h fcntl.h malloc.h stdlib.h string.h sys/time.h unistd.h syslog.h getopt.h security/pam_appl.h security/_pam_macros.h readline/readline.h])
|
2001-12-22 22:27:20 +00:00
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_HEADER_TIME
|
|
|
|
|
2002-01-03 07:32:36 +00:00
|
|
|
AC_SUBST(GETOPTSRC)
|
|
|
|
AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG, 1, [Define if you have the `getopt_long' function.]),
|
|
|
|
[GETOPTSRC="$GETOPTSRC \$(top_srcdir)/src/common/getopt.c \$(top_srcdir)/src/common/getopt1.c"
|
|
|
|
CPPFLAGS="-I\$(top_srcdir)/src/common $CPPFLAGS"
|
|
|
|
AC_DEFINE(HAVE_GETOPT_H, 1, [Define if you have the <getopt.h> header file.])])
|
|
|
|
|
2001-12-22 22:27:20 +00:00
|
|
|
dnl Checks for library functions.
|
|
|
|
AC_FUNC_ERROR_AT_LINE
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_FUNC_MEMCMP
|
|
|
|
AC_FUNC_STAT
|
|
|
|
AC_FUNC_VPRINTF
|
2002-01-03 07:32:36 +00:00
|
|
|
AC_CHECK_FUNCS([getpass gettimeofday memset mkdir strdup strerror])
|
2001-12-22 22:27:20 +00:00
|
|
|
|
|
|
|
dnl C Compiler features
|
|
|
|
AC_C_INLINE
|
|
|
|
if test "$GCC" = "yes"; then
|
2001-12-29 12:26:21 +00:00
|
|
|
CFLAGS="$CFLAGS -Wall -Werror"
|
2001-12-22 22:27:20 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
dnl OS specific options
|
|
|
|
case "$host_os" in
|
|
|
|
hpux*)
|
|
|
|
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
|
|
|
|
;;
|
|
|
|
osf*)
|
|
|
|
CFLAGS="$CFLAGS -D_POSIX_PII_SOCKET"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
AC_ARG_WITH(common-dir,
|
|
|
|
[ --with-common-dir=PATH Specify path for common installation libraries],
|
|
|
|
[
|
|
|
|
if test "x$withval" != "xno" ; then
|
|
|
|
trycommondir=$withval
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
saved_LDFLAGS="$LDFLAGS"
|
|
|
|
saved_CPPFLAGS="$CPPFLAGS"
|
|
|
|
AC_CACHE_CHECK([for common directory], ac_cv_commondir, [
|
|
|
|
for commondir in $trycommondir "" /usr/local /usr/pkg /opt ; do
|
|
|
|
# Skip directories if they don't exist
|
|
|
|
if test ! -z "$commondir" -a ! -d "$commondir" ; then
|
|
|
|
continue;
|
|
|
|
fi
|
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
|
|
|
|
|
|
if test ! -z "$commondir" -a "x$commondir" != "x/usr"; then
|
|
|
|
# Try to use $commondir/lib if it exists, otherwise
|
|
|
|
# $commondir
|
|
|
|
if test -d "$commondir/lib" ; then
|
|
|
|
LDFLAGS="-L$commondir/lib $saved_LDFLAGS"
|
|
|
|
if test ! -z "$need_dash_r" ; then
|
|
|
|
LDFLAGS="-R$commondir/lib $LDFLAGS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
LDFLAGS="-L$commondir $saved_LDFLAGS"
|
|
|
|
if test ! -z "$need_dash_r" ; then
|
|
|
|
LDFLAGS="-R$commondir $LDFLAGS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
# Try to use $commondir/include if it exists, otherwise
|
|
|
|
# $commondir
|
|
|
|
if test -d "$commondir/include" ; then
|
|
|
|
CPPFLAGS="-I$commondir/include $saved_CPPFLAGS"
|
|
|
|
else
|
|
|
|
CPPFLAGS="-I$commondir $saved_CPPFLAGS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
break;
|
|
|
|
done
|
|
|
|
|
|
|
|
if test -z "$commondir" ; then
|
|
|
|
commondir="(system)"
|
|
|
|
fi
|
2001-11-26 20:14:48 +00:00
|
|
|
|
2001-12-22 22:27:20 +00:00
|
|
|
ac_cv_commondir=$commondir
|
|
|
|
])
|
|
|
|
|
|
|
|
if (test ! -z "$ac_cv_commondir" && test "x$ac_cv_commondir" != "x(system)") ; then
|
|
|
|
dnl Need to recover commondir - test above runs in subshell
|
|
|
|
commondir=$ac_cv_commondir
|
|
|
|
if test ! -z "$commondir" -a "x$commondir" != "x/usr"; then
|
|
|
|
# Try to use $commondir/lib if it exists, otherwise
|
|
|
|
# $commondir
|
|
|
|
if test -d "$commondir/lib" ; then
|
|
|
|
LDFLAGS="-L$commondir/lib $saved_LDFLAGS"
|
|
|
|
if test ! -z "$need_dash_r" ; then
|
|
|
|
LDFLAGS="-R$commondir/lib $LDFLAGS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
LDFLAGS="-L$commondir $saved_LDFLAGS"
|
|
|
|
if test ! -z "$need_dash_r" ; then
|
|
|
|
LDFLAGS="-R$commondir $LDFLAGS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
# Try to use $commondir/include if it exists, otherwise
|
|
|
|
# $commondir
|
|
|
|
if test -d "$commondir/include" ; then
|
|
|
|
CPPFLAGS="-I$commondir/include $saved_CPPFLAGS"
|
|
|
|
else
|
|
|
|
CPPFLAGS="-I$commondir $saved_CPPFLAGS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2002-01-07 16:24:45 +00:00
|
|
|
AC_SUBST(CFLAGS_PCSC)
|
|
|
|
AC_SUBST(LIBPCSC)
|
|
|
|
LIBPCSC="-lpcsclite"
|
|
|
|
found_pcsclite=no
|
|
|
|
saved_LIBS="$LIBS"
|
|
|
|
saved_LDFLAGS="$LDFLAGS"
|
|
|
|
saved_CPPFLAGS="$CPPFLAGS"
|
2002-01-09 22:15:26 +00:00
|
|
|
LIBS="$LIBPCSC $saved_LIBS"
|
2002-01-07 16:24:45 +00:00
|
|
|
AC_ARG_WITH(pcsclite,
|
|
|
|
[ --with-pcsclite=PATH use PC/SC Lite in PATH],
|
|
|
|
[
|
2002-01-09 22:15:26 +00:00
|
|
|
AC_MSG_CHECKING([for SCardEstablishContext])
|
2002-01-07 16:24:45 +00:00
|
|
|
for pcscdir in /pcsc ""; do
|
|
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
|
|
|
|
|
|
if test -d "$withval/lib$pcscdir"; then
|
|
|
|
if test -n "${need_dash_r}"; then
|
|
|
|
LDFLAGS="-L${withval}/lib${pcscdir}/ -R${withval}/lib${pcscdir}/ ${LDFLAGS}"
|
|
|
|
else
|
|
|
|
LDFLAGS="-L${withval}/lib${pcscdir} ${LDFLAGS}"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if test -n "${need_dash_r}"; then
|
|
|
|
LDFLAGS="-L${withval}${pcscdir} -R${withval}${pcscdir} ${LDFLAGS}"
|
|
|
|
else
|
|
|
|
LDFLAGS="-L${withval}${pcscdir} ${LDFLAGS}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test -d "$withval/include"; then
|
|
|
|
CFLAGS_PCSC="-I${withval}/include${pcscdir} ${CFLAGS_PCSC}"
|
|
|
|
else
|
|
|
|
CFLAGS_PCSC="-I${withval}${pcscdir} ${CFLAGS_PCSC}"
|
|
|
|
fi
|
2002-01-09 22:15:26 +00:00
|
|
|
CPPFLAGS="$CFLAGS_PCSC $saved_CPPFLAGS"
|
|
|
|
AC_TRY_LINK([#include <stdlib.h>
|
|
|
|
#include <winscard.h>],[SCardEstablishContext(0, NULL, NULL, NULL);], ac_cv_lib_pcsclite_SCardEstablishContext=yes)
|
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
|
|
if test "x$ac_cv_lib_pcsclite_SCardEstablishContext" = "xyes"; then
|
2002-03-05 13:16:54 +00:00
|
|
|
AC_DEFINE(HAVE_LIBPCSCLITE)
|
2002-01-09 22:15:26 +00:00
|
|
|
found_pcsclite=yes
|
2002-01-07 16:24:45 +00:00
|
|
|
break;
|
|
|
|
fi
|
|
|
|
done
|
2002-01-09 22:15:26 +00:00
|
|
|
if test "x$found_pcsclite" != "xyes" ; then
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
fi
|
2002-01-07 16:24:45 +00:00
|
|
|
]
|
|
|
|
)
|
|
|
|
if test "x$found_pcsclite" != "xyes" ; then
|
|
|
|
AC_CHECK_LIB(pcsclite, SCardEstablishContext, , AC_MSG_ERROR([*** PC/SC Lite missing - please install first]))
|
|
|
|
fi
|
|
|
|
LIBS="$saved_LIBS"
|
2002-02-25 15:40:43 +00:00
|
|
|
AM_CONDITIONAL(HAVE_PCSCLITE, test "x$ac_cv_lib_pcsclite_SCardEstablishContext" = "xyes")
|
2001-11-26 20:14:48 +00:00
|
|
|
|
2001-12-22 22:27:20 +00:00
|
|
|
AC_SUBST(LIBDL)
|
|
|
|
AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)
|
2001-11-26 20:14:48 +00:00
|
|
|
|
2002-02-25 16:30:38 +00:00
|
|
|
AC_SUBST(LIBREADLINE)
|
2002-02-26 21:15:18 +00:00
|
|
|
# libreadline will also need libtermcap on some OSes
|
2002-02-25 16:30:38 +00:00
|
|
|
saved_LIBS="$LIBS"
|
2002-02-26 21:15:18 +00:00
|
|
|
for add in "" "-ltermcap"; do
|
|
|
|
if test "X$add" != "X"; then
|
|
|
|
AC_MSG_CHECKING([whether -lreadline requires $add])
|
|
|
|
fi
|
|
|
|
LIBS="$saved_LIBS $add"
|
|
|
|
unset ac_cv_lib_readline_readline
|
|
|
|
AC_CHECK_LIB(readline, readline, [
|
|
|
|
LIBREADLINE="-lreadline $add"
|
|
|
|
ac_cv_func_readline_lreadline=yes
|
|
|
|
], ac_cv_func_readline_lreadline=no)
|
|
|
|
test "$ac_cv_func_readline_lreadline" = yes && break
|
|
|
|
done
|
|
|
|
|
2002-02-25 16:30:38 +00:00
|
|
|
LIBS="$LIBS $LIBREADLINE"
|
|
|
|
AC_CHECK_FUNCS(readline)
|
|
|
|
LIBS="$saved_LIBS"
|
|
|
|
|
2001-12-22 22:27:20 +00:00
|
|
|
dnl The big search for OpenSSL
|
|
|
|
AC_ARG_WITH(ssl-dir,
|
|
|
|
[ --with-ssl-dir=PATH Specify path to OpenSSL installation],
|
|
|
|
[
|
|
|
|
if test "x$withval" != "xno" ; then
|
|
|
|
tryssldir=$withval
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
2001-11-26 20:14:48 +00:00
|
|
|
|
2001-12-23 14:17:07 +00:00
|
|
|
SSL_MSG="no"
|
2001-12-22 22:27:20 +00:00
|
|
|
saved_LIBS="$LIBS"
|
|
|
|
saved_LDFLAGS="$LDFLAGS"
|
|
|
|
saved_CPPFLAGS="$CPPFLAGS"
|
|
|
|
AC_SUBST(LIBCRYPTO)
|
|
|
|
AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
|
|
|
|
for ssldir in $tryssldir "" /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
|
|
|
|
# Skip directories if they don't exist
|
|
|
|
if test ! -z "$ssldir" -a ! -d "$ssldir" ; then
|
|
|
|
continue;
|
|
|
|
fi
|
|
|
|
LIBCRYPTO="-lcrypto"
|
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
|
|
LIBS="$saved_LIBS $LIBCRYPTO"
|
|
|
|
|
|
|
|
if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
|
|
|
|
# Try to use $ssldir/lib if it exists, otherwise
|
|
|
|
# $ssldir
|
|
|
|
if test -d "$ssldir/lib" ; then
|
|
|
|
LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
|
|
|
|
if test ! -z "$need_dash_r" ; then
|
|
|
|
LDFLAGS="-R$ssldir/lib $LDFLAGS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
LDFLAGS="-L$ssldir $saved_LDFLAGS"
|
|
|
|
if test ! -z "$need_dash_r" ; then
|
|
|
|
LDFLAGS="-R$ssldir $LDFLAGS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
# Try to use $ssldir/include if it exists, otherwise
|
|
|
|
# $ssldir
|
|
|
|
if test -d "$ssldir/include" ; then
|
|
|
|
CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
|
|
|
|
else
|
|
|
|
CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Basic test to check for compatible version and correct linking
|
|
|
|
# *does not* test for RSA - that comes later.
|
|
|
|
AC_TRY_RUN(
|
|
|
|
[
|
|
|
|
#include <string.h>
|
|
|
|
#include <openssl/rand.h>
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
char a[2048];
|
|
|
|
memset(a, 0, sizeof(a));
|
|
|
|
RAND_add(a, sizeof(a), sizeof(a));
|
|
|
|
return(RAND_status() <= 0);
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
|
|
|
found_crypto=1
|
|
|
|
break;
|
|
|
|
], []
|
|
|
|
)
|
|
|
|
|
|
|
|
if test ! -z "$found_crypto" ; then
|
|
|
|
break;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2002-02-25 11:05:25 +00:00
|
|
|
# if test -z "$found_crypto" ; then
|
|
|
|
# AC_MSG_ERROR([Could not find working OpenSSL library, please install or check config.log])
|
|
|
|
# fi
|
2001-12-22 22:27:20 +00:00
|
|
|
if test -n "$found_crypto" ; then
|
2001-12-23 14:17:07 +00:00
|
|
|
if test -z "$ssldir" ; then
|
|
|
|
ssldir="(system)"
|
|
|
|
fi
|
2001-12-22 22:27:20 +00:00
|
|
|
ac_cv_openssldir=$ssldir
|
2001-12-23 14:17:07 +00:00
|
|
|
SSL_MSG="yes"
|
2001-12-22 22:27:20 +00:00
|
|
|
fi
|
2002-03-05 13:26:00 +00:00
|
|
|
], [SSL_MSG=yes])
|
2001-12-22 22:27:20 +00:00
|
|
|
|
|
|
|
if (test ! -z "$ac_cv_openssldir" && test "x$ac_cv_openssldir" != "x(system)") ; then
|
|
|
|
dnl Need to recover ssldir - test above runs in subshell
|
|
|
|
ssldir=$ac_cv_openssldir
|
|
|
|
if test ! -z "$ssldir" -a "x$ssldir" != "x/usr"; then
|
|
|
|
# Try to use $ssldir/lib if it exists, otherwise
|
|
|
|
# $ssldir
|
|
|
|
if test -d "$ssldir/lib" ; then
|
|
|
|
LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
|
|
|
|
if test ! -z "$need_dash_r" ; then
|
|
|
|
LDFLAGS="-R$ssldir/lib $LDFLAGS"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
LDFLAGS="-L$ssldir $saved_LDFLAGS"
|
|
|
|
if test ! -z "$need_dash_r" ; then
|
|
|
|
LDFLAGS="-R$ssldir $LDFLAGS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
# Try to use $ssldir/include if it exists, otherwise
|
|
|
|
# $ssldir
|
|
|
|
if test -d "$ssldir/include" ; then
|
|
|
|
CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
|
|
|
|
else
|
|
|
|
CPPFLAGS="-I$ssldir $saved_CPPFLAGS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
LIBS="$saved_LIBS"
|
2002-02-25 11:05:25 +00:00
|
|
|
if test "x$SSL_MSG" = "xyes" ; then
|
|
|
|
AC_DEFINE(HAVE_OPENSSL, 1, [Have OpenSSL libraries])
|
|
|
|
fi
|
2001-12-23 14:17:07 +00:00
|
|
|
AM_CONDITIONAL(HAVE_SSL, test "x$SSL_MSG" = "xyes")
|
2001-12-22 22:27:20 +00:00
|
|
|
|
|
|
|
dnl Check for PAM libs
|
|
|
|
PAM_MSG="no"
|
|
|
|
no_pam=""
|
|
|
|
AC_SUBST(LIBPAM)
|
|
|
|
saved_LIBS="$LIBS"
|
|
|
|
AC_MSG_CHECKING([PAM support])
|
|
|
|
AC_ARG_WITH(pam,
|
|
|
|
[ --with-pam Enable PAM support],
|
|
|
|
[
|
|
|
|
if test "x$withval" = "xno" ; then
|
|
|
|
AC_MSG_RESULT(disabled)
|
|
|
|
no_pam=1
|
|
|
|
fi
|
|
|
|
],
|
|
|
|
)
|
|
|
|
if test -z "$no_pam" ; then
|
|
|
|
if test "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
PAM_MSG="yes"
|
|
|
|
AC_CHECK_LIB(pam, pam_set_item, [LIBPAM="$LIBPAM -lpam"], AC_MSG_ERROR([*** libpam missing]))
|
|
|
|
LIBS="$LIBS $LIBPAM"
|
|
|
|
AC_CHECK_FUNCS(pam_getenvlist)
|
|
|
|
AC_CHECK_FUNCS(pam_putenv)
|
|
|
|
disable_shadow=yes
|
|
|
|
AC_DEFINE(HAVE_PAM, 1, [Have Pluggable Authentication Modules])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl Check for older PAM
|
|
|
|
if test "x$PAM_MSG" = "xyes" ; then
|
|
|
|
# Check PAM strerror arguments (old PAM)
|
|
|
|
AC_MSG_CHECKING([whether pam_strerror takes only one argument])
|
|
|
|
AC_TRY_COMPILE(
|
|
|
|
[
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <security/pam_appl.h>
|
|
|
|
],
|
|
|
|
[(void)pam_strerror((pam_handle_t *)NULL, -1);],
|
|
|
|
[AC_MSG_RESULT(no)],
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_OLD_PAM, 1, [Have OLD Pluggable Authentication Modules])
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
PAM_MSG="yes (old library)"
|
|
|
|
]
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
LIBS="$saved_LIBS"
|
2001-12-22 22:55:40 +00:00
|
|
|
AM_CONDITIONAL(HAVE_PAM, test "x$PAM_MSG" = "xyes")
|
2001-12-23 14:17:07 +00:00
|
|
|
AM_CONDITIONAL(HAVE_PAM_AND_SSL, test "x$PAM_MSG" = "xyes" -a "x$SSL_MSG" = "xyes")
|
2001-12-22 22:27:20 +00:00
|
|
|
|
|
|
|
dnl Enable/disable debugging messages.
|
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
[ --enable-debug enable debug messages. [default=no]],
|
|
|
|
, enable_debug=no)
|
|
|
|
if (test x$enable_debug = xyes); then
|
|
|
|
AC_DEFINE(DEBUG, 1, [Enable debug messages.])
|
|
|
|
fi
|
|
|
|
|
2002-01-06 20:06:00 +00:00
|
|
|
AC_SUBST(CFLAGS_OPENSC)
|
|
|
|
CFLAGS_OPENSC="-I\${top_srcdir}/src/libopensc"
|
|
|
|
AC_SUBST(LIBOPENSC)
|
|
|
|
LIBOPENSC="\${top_srcdir}/src/libopensc/libopensc.la"
|
|
|
|
|
2002-01-26 16:03:13 +00:00
|
|
|
# Pass information about installed OpenSC requirements, so that
|
|
|
|
# a proper opensc-config file will be build.
|
|
|
|
OPENSC_LIBS="-L${libdir} -lopensc"
|
|
|
|
OPENSC_CFLAGS=""
|
|
|
|
AC_SUBST(OPENSC_LIBS)
|
|
|
|
AC_SUBST(OPENSC_CFLAGS)
|
|
|
|
|
2001-12-22 22:27:20 +00:00
|
|
|
AC_OUTPUT([
|
|
|
|
Makefile
|
|
|
|
aclocal/Makefile
|
|
|
|
src/Makefile
|
2002-01-02 22:15:31 +00:00
|
|
|
src/common/Makefile
|
2001-12-22 22:27:20 +00:00
|
|
|
src/libopensc/Makefile
|
2002-01-26 16:03:13 +00:00
|
|
|
src/libopensc/opensc-config
|
2001-12-22 22:27:20 +00:00
|
|
|
src/openssh/Makefile
|
|
|
|
src/pam/Makefile
|
|
|
|
src/pkcs11/Makefile
|
2002-01-16 22:52:39 +00:00
|
|
|
src/pkcs11/rsaref/Makefile
|
2001-12-22 22:27:20 +00:00
|
|
|
src/tests/Makefile
|
|
|
|
src/tools/Makefile
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Someone please show me a better way :)
|
|
|
|
A=`eval echo ${prefix}` ; A=`eval echo ${A}`
|
|
|
|
B=`eval echo ${bindir}` ; B=`eval echo ${B}`
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "OpenSC has been configured with the following options"
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "User binaries: ${B}"
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Host: ${host}"
|
|
|
|
echo "Compiler: ${CC}"
|
|
|
|
echo "Compiler flags: ${CFLAGS}"
|
|
|
|
echo "Preprocessor flags: ${CPPFLAGS}"
|
|
|
|
echo "Linker flags: ${LDFLAGS}"
|
|
|
|
echo "Libraries: ${LIBS}"
|
2001-11-26 20:14:48 +00:00
|
|
|
|
2001-12-22 22:27:20 +00:00
|
|
|
echo ""
|
2001-12-23 14:17:07 +00:00
|
|
|
echo "OpenSSL support: ${SSL_MSG}"
|
2001-12-22 22:27:20 +00:00
|
|
|
echo "PAM support: ${PAM_MSG}"
|
2001-12-02 19:21:46 +00:00
|
|
|
|
2001-12-22 22:27:20 +00:00
|
|
|
echo ""
|