2001-12-22 22:27:20 +00:00
|
|
|
dnl -*- mode: m4; -*-
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
# Require autoconf 2.52
|
|
|
|
AC_PREREQ(2.52)
|
2003-05-26 09:30:48 +00:00
|
|
|
|
2003-07-11 16:31:06 +00:00
|
|
|
AC_INIT(COPYING)
|
2003-07-17 10:59:10 +00:00
|
|
|
AM_INIT_AUTOMAKE(opensc, CVS)
|
2001-12-22 22:27:20 +00:00
|
|
|
AM_CONFIG_HEADER(config.h)
|
2001-11-26 20:14:48 +00:00
|
|
|
|
2003-07-11 16:31:06 +00:00
|
|
|
AC_CONFIG_SRCDIR(src/libopensc/sc.c)
|
|
|
|
|
2003-08-18 14:28:47 +00:00
|
|
|
# LT Version numbers, remember to change them just *before* a release.
|
|
|
|
# (Code changed: REVISION++)
|
|
|
|
# (Interfaces added/removed/changed: CURRENT++, REVISION=0)
|
|
|
|
# (Interfaces added: AGE++)
|
|
|
|
# (Interfaces removed: AGE=0)
|
|
|
|
OPENSC_LT_CURRENT=0
|
|
|
|
OPENSC_LT_REVISION=8
|
|
|
|
OPENSC_LT_AGE=0
|
|
|
|
|
|
|
|
AC_SUBST(OPENSC_LT_CURRENT)
|
|
|
|
AC_SUBST(OPENSC_LT_REVISION)
|
|
|
|
AC_SUBST(OPENSC_LT_AGE)
|
|
|
|
|
2001-12-22 22:27:20 +00:00
|
|
|
AC_CANONICAL_HOST
|
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*)
|
2003-08-12 11:44:18 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED"
|
2001-12-22 22:27:20 +00:00
|
|
|
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_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
|
|
|
|
;;
|
2003-08-12 11:44:18 +00:00
|
|
|
*-*-osf*)
|
|
|
|
CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
|
|
|
|
;;
|
2003-07-28 10:02:23 +00:00
|
|
|
*-*-darwin*)
|
|
|
|
LIBS="$LIBS -lobjc"
|
2003-08-12 11:44:18 +00:00
|
|
|
if test "$GCC" = "yes"; then
|
|
|
|
CFLAGS="$CFLAGS -no-cpp-precomp"
|
|
|
|
fi
|
2003-08-14 11:37:46 +00:00
|
|
|
with_bundles=yes
|
2003-07-28 10:02:23 +00:00
|
|
|
;;
|
2001-12-22 22:27:20 +00:00
|
|
|
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
|
2003-08-12 11:44:18 +00:00
|
|
|
if test ! -z "$commondir" -a ! -d "$commondir/" ; then
|
2001-12-22 22:27:20 +00:00
|
|
|
continue;
|
|
|
|
fi
|
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
|
|
|
|
|
|
if test ! -z "$commondir" -a "x$commondir" != "x/usr"; then
|
2003-08-12 11:44:18 +00:00
|
|
|
LDFLAGS="-L$commondir/lib $saved_LDFLAGS"
|
|
|
|
if test ! -z "$need_dash_r" ; then
|
|
|
|
LDFLAGS="-R$commondir/lib $LDFLAGS"
|
2001-12-22 22:27:20 +00:00
|
|
|
fi
|
2003-08-12 11:44:18 +00:00
|
|
|
CPPFLAGS="-I$commondir/include $saved_CPPFLAGS"
|
2001-12-22 22:27:20 +00:00
|
|
|
fi
|
|
|
|
break;
|
|
|
|
done
|
|
|
|
|
|
|
|
if test -z "$commondir" ; then
|
|
|
|
commondir="(system)"
|
|
|
|
fi
|
|
|
|
ac_cv_commondir=$commondir
|
|
|
|
])
|
|
|
|
|
2002-05-14 19:20:44 +00:00
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AM_PROG_LEX
|
|
|
|
AC_PATH_PROG(TEST_MINUS_S_SH, bash)
|
|
|
|
AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
|
|
|
|
AC_PATH_PROG(TEST_MINUS_S_SH, sh)
|
|
|
|
|
|
|
|
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
|
|
|
|
AC_HEADER_SYS_WAIT
|
2003-08-25 10:21:38 +00:00
|
|
|
AC_CHECK_HEADERS([errno.h fcntl.h malloc.h stdlib.h string.h strings.h sys/time.h unistd.h getopt.h dlfcn.h utmp.h security/pam_appl.h security/_pam_macros.h pam/pam_appl.h pam/_pam_macros.h])
|
2002-05-14 19:20:44 +00:00
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_TYPE_UID_T
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_HEADER_TIME
|
|
|
|
|
|
|
|
dnl Checks for library functions.
|
|
|
|
AC_FUNC_ERROR_AT_LINE
|
|
|
|
AC_FUNC_STAT
|
|
|
|
AC_FUNC_VPRINTF
|
|
|
|
AC_CHECK_FUNCS([getpass gettimeofday memset mkdir strdup strerror setutent])
|
|
|
|
|
|
|
|
dnl C Compiler features
|
|
|
|
AC_C_INLINE
|
|
|
|
if test "$GCC" = "yes"; then
|
|
|
|
CFLAGS="-Wall $CFLAGS"
|
|
|
|
fi
|
|
|
|
|
2002-03-21 14:05:24 +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)
|
|
|
|
|
2003-08-25 10:21:38 +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.])])
|
2003-07-30 12:51:14 +00:00
|
|
|
|
2002-05-14 19:20:44 +00:00
|
|
|
AC_CHECK_HEADERS([readline/readline.h])
|
2002-03-21 14:05:24 +00:00
|
|
|
AC_SUBST(LIBREADLINE)
|
|
|
|
saved_LIBS="$LIBS"
|
2002-03-24 20:30:53 +00:00
|
|
|
# libreadline will also need libtermcap on some OSes
|
2002-03-21 14:05:24 +00:00
|
|
|
for add in "" "-ltermcap"; do
|
2002-03-24 20:30:53 +00:00
|
|
|
if test "x$add" != x; then
|
2002-03-25 11:54:10 +00:00
|
|
|
AC_MSG_CHECKING([for readline with])
|
|
|
|
AC_MSG_RESULT($add)
|
2002-03-21 14:05:24 +00:00
|
|
|
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)
|
2002-03-25 11:54:10 +00:00
|
|
|
test "x$ac_cv_func_readline_lreadline" = xyes && break
|
2002-03-21 14:05:24 +00:00
|
|
|
done
|
|
|
|
LIBS="$LIBS $LIBREADLINE"
|
|
|
|
AC_CHECK_FUNCS(readline)
|
|
|
|
LIBS="$saved_LIBS"
|
|
|
|
|
|
|
|
#
|
|
|
|
# We check for various libraries
|
|
|
|
# - SysVr4 style of "-lsocket" at first (unless in libc)
|
|
|
|
# The hallmark is connect() routine (we presume)
|
|
|
|
#
|
|
|
|
AC_SUBST(LIBSOCKET)dnl
|
|
|
|
ac_cv_libsocket_both=1
|
|
|
|
AC_CHECK_FUNC(connect, ac_cv_libsocket_both=0)
|
|
|
|
AC_CHECK_FUNC(gethostbyname, ac_cv_libsocket_both=0)
|
|
|
|
if test "$ac_cv_libsocket_both" = 1 ; then
|
|
|
|
# Check cache
|
|
|
|
if test "$ac_cv_func_socket_lsocket" = yes ; then
|
|
|
|
AC_MSG_RESULT([need -lsocket library (cached)])
|
|
|
|
LIBSOCKET="-lsocket"
|
|
|
|
if test "$ac_cv_func_gethostbyname_lnsl" = yes ; then
|
|
|
|
LIBSOCKET="-lsocket -lnsl"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
# Well, will this work ? SysVR4, but not Sun Solaris ?
|
|
|
|
AC_CHECK_LIB(socket, connect, [LIBSOCKET="-lsocket"
|
|
|
|
ac_cv_func_socket_lsocket=yes],
|
|
|
|
ac_cv_func_socket_lsocket=no)
|
|
|
|
if test "$ac_cv_func_socket_lsocket" = yes ; then
|
|
|
|
t_oldLibs="$LIBS"
|
|
|
|
LIBS="$LIBS -lsocket $LIBRESOLV"
|
|
|
|
AC_TRY_LINK([],[gethostbyname();], ,[
|
|
|
|
LIBS="$LIBS -lnsl" # Add this Solaris library..
|
|
|
|
AC_TRY_LINK([],[gethostbyname();],[
|
|
|
|
LIBSOCKET="-lsocket -lnsl"
|
|
|
|
ac_cv_func_gethostbyname_lnsl=yes
|
|
|
|
], [
|
|
|
|
AC_MSG_ERROR([Weird, '$LIBS' not enough to find gethostbyname() ?!])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
LIBS="$t_oldLibs"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(LIBRESOLV)dnl
|
|
|
|
if test "x$LIBRESOLV" = "x"; then
|
|
|
|
# Ok, No -lresolv, is this enough for the _res to appear ?
|
|
|
|
t_oldLibs="$LIBS"
|
|
|
|
LIBS="$LIBS $LIBSOCKET"
|
|
|
|
ac_cv_var__res_options=no
|
|
|
|
# This following is for IRIX6.4, and I sincerely hope it
|
|
|
|
# will not fail on other systems... It did! It did!
|
|
|
|
# Many systems don't have idemponent headers, they need specific
|
|
|
|
# includes before latter ones, or the latter ones won't be successful...
|
|
|
|
AC_TRY_LINK([#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <arpa/nameser.h>
|
|
|
|
#include <resolv.h>],
|
|
|
|
[_res.options = RES_INIT;],
|
|
|
|
ac_cv_var__res_options=yes);
|
|
|
|
if test "$ac_cv_var__res_options" != "yes"; then
|
|
|
|
LIBRESOLV="-lresolv"
|
|
|
|
fi
|
|
|
|
LIBS="$t_oldLibs"
|
|
|
|
fi
|
|
|
|
|
2002-03-25 10:19:57 +00:00
|
|
|
if test "x$LIBRESOLV" = "x"; then
|
|
|
|
# glibc 2.2.4 and libresolv is difficult
|
|
|
|
# - gethostbyname won't require lresolv because all
|
|
|
|
# queries are made through the nsswitch
|
|
|
|
# - checking for the variable _res will not require
|
|
|
|
# lresolv because _res is defined somewhere
|
|
|
|
AC_CHECK_LIB(resolv, res_query, [LIBRESOLV=-lresolv])
|
|
|
|
LIBS="$t_oldLibs"
|
|
|
|
fi
|
|
|
|
|
2002-03-21 14:05:24 +00:00
|
|
|
# See about the routines that possibly exist at the libraries..
|
|
|
|
LIBS="$t_oldLibs $LIBSOCKET"
|
|
|
|
AC_CHECK_FUNCS(socket socketpair)
|
|
|
|
LIBS="$t_oldLibs"
|
|
|
|
|
|
|
|
if test "$ac_cv_func_socket" = no -a "$LIBSOCKET" != ""; then
|
|
|
|
LIBS="$LIBS $LIBSOCKET"
|
|
|
|
AC_TRY_LINK([],[socket();], ac_cv_func_socket=yes)
|
|
|
|
if test $ac_cv_func_socket = yes; then
|
|
|
|
AC_DEFINE(HAVE_SOCKET, 1, [Have socket])
|
|
|
|
fi
|
|
|
|
LIBS="$t_oldLibs"
|
|
|
|
fi
|
|
|
|
if test "$ac_cv_func_socketpair" = no -a "$LIBSOCKET" != ""; then
|
|
|
|
LIBS="$LIBS $LIBSOCKET"
|
|
|
|
AC_TRY_LINK([],[socketpair();], ac_cv_func_socketpair=yes)
|
|
|
|
if test $ac_cv_func_socketpair = yes; then
|
|
|
|
AC_DEFINE(HAVE_SOCKETPAIR, 1, [Have socketpair])
|
|
|
|
fi
|
|
|
|
LIBS="$t_oldLibs"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Always link lib{socket,nsl,resolv) if found, sigh.
|
|
|
|
LIBS="$LIBS $LIBSOCKET $LIBRESOLV"
|
|
|
|
|
|
|
|
AC_ARG_WITH(flex-dir,
|
|
|
|
[ --with-flex-dir=PATH Specify path to flex installation],
|
|
|
|
[
|
|
|
|
if test "x$withval" != "xno" ; then
|
|
|
|
tryflexdir=$withval
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
saved_LDFLAGS="$LDFLAGS"
|
|
|
|
saved_CPPFLAGS="$CPPFLAGS"
|
|
|
|
AC_SUBST(LIBFL)
|
|
|
|
AC_CACHE_CHECK([for flex directory], ac_cv_flexdir, [
|
|
|
|
for flexdir in $tryflexdir "" /usr/local/flex /usr/lib/flex /usr/local/flex /usr/lib/flex /usr/local /usr/pkg /opt /opt/flex ; do
|
|
|
|
# Skip directories if they don't exist
|
2003-08-12 11:44:18 +00:00
|
|
|
if test ! -z "$flexdir" -a ! -d "$flexdir/" ; then
|
2002-03-21 14:05:24 +00:00
|
|
|
continue;
|
|
|
|
fi
|
|
|
|
|
|
|
|
LIBFL="-lfl"
|
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
|
|
if test ! -z "$flexdir" -a "x$flexdir" != "x/usr"; then
|
2003-08-12 11:44:18 +00:00
|
|
|
LDFLAGS="-L$flexdir/lib $saved_LDFLAGS"
|
|
|
|
if test ! -z "$need_dash_r" ; then
|
|
|
|
LDFLAGS="-R$flexdir/lib $LDFLAGS"
|
2002-03-21 14:05:24 +00:00
|
|
|
fi
|
2003-08-12 11:44:18 +00:00
|
|
|
CPPFLAGS="-I$flexdir/include $saved_CPPFLAGS"
|
2002-03-21 14:05:24 +00:00
|
|
|
fi
|
|
|
|
break;
|
|
|
|
done
|
|
|
|
|
|
|
|
if test -z "$flexdir" ; then
|
|
|
|
flexdir="(system)"
|
|
|
|
fi
|
|
|
|
ac_cv_flexdir=$flexdir
|
|
|
|
])
|
|
|
|
|
2003-08-11 14:52:13 +00:00
|
|
|
dnl The big mess with OpenSSL
|
2003-08-12 11:44:18 +00:00
|
|
|
AC_ARG_WITH(openssl,
|
2003-08-14 11:37:46 +00:00
|
|
|
[ --with-openssl=PATH use OpenSSL in PATH],
|
2003-08-12 11:44:18 +00:00
|
|
|
[tryssldir=$withval])
|
2001-11-26 20:14:48 +00:00
|
|
|
|
2001-12-23 14:17:07 +00:00
|
|
|
SSL_MSG="no"
|
2003-08-11 14:52:13 +00:00
|
|
|
ENGINE_MSG="no"
|
2001-12-22 22:27:20 +00:00
|
|
|
saved_LIBS="$LIBS"
|
|
|
|
saved_LDFLAGS="$LDFLAGS"
|
|
|
|
saved_CPPFLAGS="$CPPFLAGS"
|
|
|
|
AC_SUBST(LIBCRYPTO)
|
2003-04-22 17:00:38 +00:00
|
|
|
AC_SUBST(LIBCRYPTOA)
|
2001-12-22 22:27:20 +00:00
|
|
|
AC_CACHE_CHECK([for OpenSSL directory], ac_cv_openssldir, [
|
2003-08-08 08:41:25 +00:00
|
|
|
for ssldir in $tryssldir $trycommondir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do
|
2003-08-11 14:52:13 +00:00
|
|
|
# Skip empty variables
|
|
|
|
if test -z "$ssldir"; then
|
|
|
|
continue;
|
|
|
|
fi
|
|
|
|
# Disable OpenSSL support
|
|
|
|
if test "x$ssldir" = "xno" ; then
|
|
|
|
SSL_MSG="no (disabled)"
|
|
|
|
ENGINE_MSG="no (disabled)"
|
|
|
|
break;
|
|
|
|
fi
|
2001-12-22 22:27:20 +00:00
|
|
|
# Skip directories if they don't exist
|
2003-08-12 09:34:26 +00:00
|
|
|
if test ! -d "$ssldir/" ; then
|
2001-12-22 22:27:20 +00:00
|
|
|
continue;
|
|
|
|
fi
|
|
|
|
LIBCRYPTO="-lcrypto"
|
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
|
|
LIBS="$saved_LIBS $LIBCRYPTO"
|
|
|
|
|
2003-08-12 09:34:26 +00:00
|
|
|
if test "x$ssldir" != "x/usr"; then
|
|
|
|
LDFLAGS="-L$ssldir/lib $saved_LDFLAGS"
|
|
|
|
if test ! -z "$need_dash_r" ; then
|
|
|
|
LDFLAGS="-R$ssldir/lib $LDFLAGS"
|
2001-12-22 22:27:20 +00:00
|
|
|
fi
|
2003-08-12 09:34:26 +00:00
|
|
|
CPPFLAGS="-I$ssldir/include $saved_CPPFLAGS"
|
2001-12-22 22:27:20 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2003-08-11 14:52:13 +00:00
|
|
|
SSL_MSG="yes"
|
2001-12-22 22:27:20 +00:00
|
|
|
], []
|
|
|
|
)
|
|
|
|
|
2003-08-11 14:52:13 +00:00
|
|
|
if test "x$SSL_MSG" = "xyes" ; then
|
|
|
|
# openssl with engine support?
|
2003-08-12 09:34:26 +00:00
|
|
|
LIBCRYPTOA="$ssldir/lib/libcrypto.a $LIBDL"
|
2003-04-22 17:00:38 +00:00
|
|
|
LIBS="$saved_LIBS $LIBCRYPTOA"
|
2003-04-17 12:47:48 +00:00
|
|
|
AC_TRY_RUN(
|
|
|
|
[
|
|
|
|
#include <string.h>
|
|
|
|
#include <openssl/opensslv.h>
|
|
|
|
#include <openssl/engine.h>
|
|
|
|
#include <openssl/rand.h>
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
char a[2048];
|
|
|
|
ENGINE *e;
|
|
|
|
|
2003-04-22 17:00:38 +00:00
|
|
|
e = ENGINE_new();
|
|
|
|
ENGINE_load_dynamic();
|
2003-04-17 12:47:48 +00:00
|
|
|
if (!e) return 1;
|
|
|
|
memset(a, 0, sizeof(a));
|
|
|
|
RAND_add(a, sizeof(a), sizeof(a));
|
|
|
|
return(RAND_status() <= 0);
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2003-08-11 14:52:13 +00:00
|
|
|
ENGINE_MSG=yes
|
2003-04-17 12:47:48 +00:00
|
|
|
], []
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
|
2003-08-11 14:52:13 +00:00
|
|
|
if test "x$SSL_MSG" = "xyes" ; then
|
2001-12-22 22:27:20 +00:00
|
|
|
break;
|
|
|
|
fi
|
2003-08-11 14:52:13 +00:00
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
|
|
LIBS="$saved_LIBS"
|
2001-12-22 22:27:20 +00:00
|
|
|
done
|
|
|
|
|
2003-08-11 14:52:13 +00:00
|
|
|
if test "x$SSL_MSG" = "xyes" ; then
|
|
|
|
ac_cv_openssldir="$ssldir"
|
|
|
|
else
|
|
|
|
ac_cv_openssldir="no"
|
2001-12-22 22:27:20 +00:00
|
|
|
fi
|
2003-08-11 14:52:13 +00:00
|
|
|
], [SSL_MSG=yes])
|
2001-12-22 22:27:20 +00:00
|
|
|
LIBS="$saved_LIBS"
|
2003-08-11 14:52:13 +00:00
|
|
|
|
2002-02-25 11:05:25 +00:00
|
|
|
if test "x$SSL_MSG" = "xyes" ; then
|
|
|
|
AC_DEFINE(HAVE_OPENSSL, 1, [Have OpenSSL libraries])
|
2003-08-28 13:08:57 +00:00
|
|
|
else
|
|
|
|
LIBCRYPTO=""
|
|
|
|
LIBCRYPTOA=""
|
2002-02-25 11:05:25 +00:00
|
|
|
fi
|
2001-12-23 14:17:07 +00:00
|
|
|
AM_CONDITIONAL(HAVE_SSL, test "x$SSL_MSG" = "xyes")
|
2003-08-11 14:52:13 +00:00
|
|
|
AM_CONDITIONAL(HAVE_ENGINE, test "x$ENGINE_MSG" = "xyes")
|
2001-12-22 22:27:20 +00:00
|
|
|
|
2003-08-25 10:21:38 +00:00
|
|
|
AC_SUBST(OPENSSL_LDFLAGS)
|
|
|
|
OPENSSL_LDFLAGS=""
|
2003-08-28 13:08:57 +00:00
|
|
|
if test "x$ENGINE_MSG" = "xyes" ; then
|
|
|
|
for openssl_ldflag in "-Wl,-Bsymbolic" "-G -Wl,-Bsymbolic" "-shared -G -Wl,-Bsymbolic" "-Wl,-all_load"; do
|
2003-08-25 10:21:38 +00:00
|
|
|
AC_MSG_CHECKING([whether we can use $openssl_ldflag])
|
|
|
|
saved_CFLAGS=$CFLAGS
|
|
|
|
CFLAGS="$CFLAGS $openssl_ldflag"
|
|
|
|
AC_TRY_LINK(,[return 1],ac_cv_use_openssl_flag="yes",ac_cv_use_openssl_flag="no")
|
|
|
|
CFLAGS=$saved_CFLAGS
|
|
|
|
AC_MSG_RESULT($ac_cv_use_openssl_flag)
|
|
|
|
if test "$ac_cv_use_openssl_flag" = "yes"; then
|
|
|
|
OPENSSL_LDFLAGS="$openssl_ldflag"
|
|
|
|
break;
|
|
|
|
fi
|
2003-08-28 13:08:57 +00:00
|
|
|
done
|
|
|
|
fi
|
2003-08-25 10:21:38 +00:00
|
|
|
|
2002-03-21 14:05:24 +00:00
|
|
|
AC_ARG_WITH(pam-dir,
|
2003-06-15 11:56:10 +00:00
|
|
|
[ --with-pam-dir=PATH Specify path for PAM installation libraries],
|
2002-03-21 14:05:24 +00:00
|
|
|
[
|
|
|
|
if test "x$withval" != "xno" ; then
|
|
|
|
trypamdir=$withval
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
saved_LDFLAGS="$LDFLAGS"
|
|
|
|
saved_CPPFLAGS="$CPPFLAGS"
|
|
|
|
AC_CACHE_CHECK([for pam directory], ac_cv_pamdir, [
|
|
|
|
for pamdir in $trypamdir "" /usr/local /usr/pkg /opt ; do
|
|
|
|
# Skip directories if they don't exist
|
2003-08-12 11:44:18 +00:00
|
|
|
if test ! -z "$pamdir" -a ! -d "$pamdir/" ; then
|
2002-03-21 14:05:24 +00:00
|
|
|
continue;
|
|
|
|
fi
|
|
|
|
|
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
|
|
if test ! -z "$pamdir" -a "x$pamdir" != "x/usr"; then
|
2003-08-12 11:44:18 +00:00
|
|
|
LDFLAGS="-L$pamdir/lib $saved_LDFLAGS"
|
|
|
|
if test ! -z "$need_dash_r" ; then
|
|
|
|
LDFLAGS="-R$pamdir/lib $LDFLAGS"
|
2002-03-21 14:05:24 +00:00
|
|
|
fi
|
2003-08-12 11:44:18 +00:00
|
|
|
CPPFLAGS="-I$pamdir/include $saved_CPPFLAGS"
|
2002-03-21 14:05:24 +00:00
|
|
|
fi
|
|
|
|
break;
|
|
|
|
done
|
|
|
|
|
|
|
|
if test -z "$pamdir" ; then
|
|
|
|
pamdir="(system)"
|
|
|
|
fi
|
|
|
|
ac_cv_pamdir=$pamdir
|
|
|
|
])
|
|
|
|
|
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
|
2003-08-04 15:11:27 +00:00
|
|
|
if test "x$ac_cv_header_security_pam_appl_h" = "xyes" -o "x$ac_cv_header_pam_pam_appl_h" = "xyes"; then
|
2001-12-22 22:27:20 +00:00
|
|
|
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
|
|
|
|
LIBS="$saved_LIBS"
|
2001-12-22 22:55:40 +00:00
|
|
|
AM_CONDITIONAL(HAVE_PAM, test "x$PAM_MSG" = "xyes")
|
2001-12-22 22:27:20 +00:00
|
|
|
|
2002-03-21 14:05:24 +00:00
|
|
|
dnl Check for SIA libs
|
|
|
|
AC_SUBST(LIBSIA)
|
|
|
|
SIA_MSG="no"
|
|
|
|
no_osfsia=""
|
|
|
|
AC_MSG_CHECKING([SIA support])
|
|
|
|
AC_ARG_WITH(osfsia,
|
|
|
|
[ --with-osfsia Enable Digital Unix SIA],
|
|
|
|
[
|
|
|
|
if test "x$withval" = "xno" ; then
|
|
|
|
AC_MSG_RESULT(disabled)
|
|
|
|
no_osfsia=1
|
|
|
|
fi
|
|
|
|
],
|
|
|
|
)
|
|
|
|
if test -z "$no_osfsia" ; then
|
|
|
|
if test -f /etc/sia/matrix.conf; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(HAVE_OSF_SIA, 1, [Have Digital Unix SIA])
|
|
|
|
LIBSIA="$LIBSIA -lsecurity -ldb -lm -laud"
|
|
|
|
SIA_MSG="yes"
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL(HAVE_SIA, test "x$SIA_MSG" = "xyes")
|
|
|
|
|
2003-03-11 10:59:38 +00:00
|
|
|
PCSC_MSG=no
|
|
|
|
pcsc_path=/usr
|
2002-03-23 19:37:40 +00:00
|
|
|
AC_SUBST(CFLAGS_PCSC)
|
|
|
|
AC_SUBST(LIBPCSC)
|
2003-07-28 10:02:23 +00:00
|
|
|
|
2003-07-30 12:51:14 +00:00
|
|
|
case "$host" in
|
2003-08-22 13:44:34 +00:00
|
|
|
*-*-darwin*)
|
2003-07-28 10:02:23 +00:00
|
|
|
PCSC_MSG=yes
|
|
|
|
CFLAGS_PCSC=""
|
|
|
|
LIBPCSC="-Wl,-framework,PCSC"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2002-03-23 19:37:40 +00:00
|
|
|
saved_LIBS="$LIBS"
|
|
|
|
saved_LDFLAGS="$LDFLAGS"
|
|
|
|
saved_CPPFLAGS="$CPPFLAGS"
|
|
|
|
AC_ARG_WITH(pcsclite,
|
|
|
|
[ --with-pcsclite=PATH use PC/SC Lite in PATH],
|
2003-03-11 10:59:38 +00:00
|
|
|
[pcsc_path=$withval])
|
2003-08-22 13:44:34 +00:00
|
|
|
if test "x$pcsc_path" = "xno"; then
|
|
|
|
PCSC_MSG="no"
|
|
|
|
fi
|
|
|
|
if test "x$pcsc_path" != "xno" -a "x$PCSC_MSG" != "xyes"; then
|
2003-03-11 10:59:38 +00:00
|
|
|
AC_MSG_CHECKING(for PC/SC-Lite support)
|
2002-03-23 19:37:40 +00:00
|
|
|
for pcscdir in /pcsc ""; do
|
2003-03-11 10:59:38 +00:00
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
2003-07-17 16:50:02 +00:00
|
|
|
LDFLAGS="$saved_LDFLAGS"
|
2003-03-11 10:59:38 +00:00
|
|
|
LIBS="-lpcsclite $saved_LIBS"
|
2003-07-17 16:50:02 +00:00
|
|
|
CFLAGS_PCSC=""
|
2003-03-11 10:59:38 +00:00
|
|
|
|
2003-03-11 12:41:18 +00:00
|
|
|
for pcsc_libdir in $pcsc_path/lib$pcscdir \
|
2003-03-11 10:59:38 +00:00
|
|
|
$pcsc_path$pcscdir/lib \
|
|
|
|
$pcsc_path$pcscdir; do
|
2003-03-11 12:41:18 +00:00
|
|
|
if test -d $pcsc_libdir; then
|
2003-03-11 10:59:38 +00:00
|
|
|
if test -n "${need_dash_r}"; then
|
2003-03-11 12:41:18 +00:00
|
|
|
LDFLAGS="-R${pcsc_libdir}/ ${LDFLAGS}"
|
2003-03-11 10:59:38 +00:00
|
|
|
fi
|
2003-03-11 12:41:18 +00:00
|
|
|
LDFLAGS="-L${pcsc_libdir} ${LDFLAGS}"
|
2002-03-23 19:37:40 +00:00
|
|
|
fi
|
2003-03-11 10:59:38 +00:00
|
|
|
done
|
|
|
|
|
2003-03-11 12:41:18 +00:00
|
|
|
for pcsc_incdir in $pcsc_path/include$pcscdir \
|
2003-03-11 10:59:38 +00:00
|
|
|
$pcsc_path$pcscdir/include \
|
|
|
|
$pcsc_path$pcscdir; do
|
2003-03-11 12:41:18 +00:00
|
|
|
if test -d $pcsc_incdir; then
|
|
|
|
CFLAGS_PCSC="-I${pcsc_incdir}"
|
2003-03-11 10:59:38 +00:00
|
|
|
break;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
CPPFLAGS="${CFLAGS_PCSC} ${CPPFLAGS}"
|
2002-03-23 19:37:40 +00:00
|
|
|
AC_TRY_LINK([#include <stdlib.h>
|
|
|
|
#include <winscard.h>],[SCardEstablishContext(0, NULL, NULL, NULL);], ac_cv_lib_pcsclite_SCardEstablishContext=yes)
|
|
|
|
if test "x$ac_cv_lib_pcsclite_SCardEstablishContext" = "xyes"; then
|
2003-03-11 10:59:38 +00:00
|
|
|
PCSC_MSG=yes
|
2002-03-23 19:37:40 +00:00
|
|
|
break;
|
|
|
|
fi
|
2003-03-11 10:59:38 +00:00
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
|
|
LIBS="$saved_LIBS"
|
2003-07-17 16:50:02 +00:00
|
|
|
CFLAGS_PCSC=""
|
2002-03-23 19:37:40 +00:00
|
|
|
done
|
2003-03-11 10:59:38 +00:00
|
|
|
AC_MSG_RESULT($PCSC_MSG)
|
2003-07-17 16:50:02 +00:00
|
|
|
if test "x$PCSC_MSG" = "xyes" ; then
|
|
|
|
LIBPCSC="-lpcsclite"
|
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
|
|
LIBS="$saved_LIBS"
|
|
|
|
fi
|
2002-03-23 19:37:40 +00:00
|
|
|
fi
|
2003-07-28 10:02:23 +00:00
|
|
|
AM_CONDITIONAL(HAVE_PCSCLITE, test "x$PCSC_MSG" = "xyes")
|
|
|
|
if test "x$PCSC_MSG" = "xyes"; then
|
|
|
|
AC_DEFINE(HAVE_PCSCLITE, 1, [Have PC/SC Lite])
|
2003-08-22 13:44:34 +00:00
|
|
|
else
|
|
|
|
LIBPCSC=""
|
|
|
|
CFLAGS_PCSC=""
|
2003-07-28 10:02:23 +00:00
|
|
|
fi
|
2002-03-23 19:37:40 +00:00
|
|
|
|
2003-04-11 11:42:12 +00:00
|
|
|
dnl --enable-usbtoken option.
|
|
|
|
AC_ARG_ENABLE(usbtoken, AC_HELP_STRING(
|
2003-07-01 17:34:58 +00:00
|
|
|
[--enable-usbtoken], [enable the usbtoken reader backed. [default=no]]),
|
|
|
|
, enable_usbtoken=no)
|
2003-04-11 11:42:12 +00:00
|
|
|
if test "x$enable_usbtoken" = "xyes"; then
|
|
|
|
AC_DEFINE(HAVE_USBTOKEN, 1, [Enable usbtoken support])
|
|
|
|
USBTOKEN_MSG=yes
|
|
|
|
else
|
|
|
|
USBTOKEN_MSG=no
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(HAVE_USBTOKEN, test "x$USBTOKEN_MSG" = "xyes")
|
|
|
|
|
|
|
|
OPENCT_MSG=no
|
2003-05-24 19:31:12 +00:00
|
|
|
openct_path=/usr
|
|
|
|
AC_SUBST(OPENCT_CFLAGS)
|
|
|
|
AC_SUBST(OPENCT_LDFLAGS)
|
|
|
|
AC_SUBST(OPENCT_LIBS)
|
|
|
|
found_openct=no
|
|
|
|
AC_ARG_WITH(openct,
|
2003-06-15 11:56:10 +00:00
|
|
|
[ --with-openct=PATH use OpenCT in PATH],
|
2003-06-11 10:54:02 +00:00
|
|
|
[with_openct=$withval])
|
2003-05-24 19:31:12 +00:00
|
|
|
|
2003-06-15 11:56:10 +00:00
|
|
|
if test "x$with_openct" != "xno" -a "x$with_openct" != "x"; then
|
2003-06-11 10:54:02 +00:00
|
|
|
if test "x$with_openct" != "xyes"; then
|
|
|
|
openct_path=$with_openct
|
|
|
|
with_openct=yes
|
|
|
|
fi
|
2003-04-11 11:42:12 +00:00
|
|
|
saved_LIBS="$LIBS"
|
|
|
|
saved_LDFLAGS="$LDFLAGS"
|
2003-05-24 19:31:12 +00:00
|
|
|
saved_CFLAGS="$CFLAGS"
|
2003-04-11 11:42:12 +00:00
|
|
|
|
2003-05-24 19:31:12 +00:00
|
|
|
AC_MSG_CHECKING(for OpenCT support)
|
|
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
|
|
|
|
|
|
OPENCT_CFLAGS="-I${openct_path}/include"
|
|
|
|
OPENCT_LIBS="-lopenct"
|
|
|
|
OPENCT_LDFLAGS=
|
|
|
|
if test -n "${need_dash_r}"; then
|
|
|
|
OPENCT_LDFLAGS="-R${openct_path}/lib"
|
2003-04-11 11:42:12 +00:00
|
|
|
fi
|
2003-05-24 19:31:12 +00:00
|
|
|
OPENCT_LDFLAGS="-L${openct_path}/lib $OPENCT_LDFLAGS"
|
|
|
|
|
|
|
|
LIBS="$OPENCT_LIBS $saved_LIBS"
|
|
|
|
LDFLAGS="$OPENCT_LDFLAGS $saved_LDFLAGS"
|
|
|
|
CFLAGS="$OPENCT_CFLAGS $saved_CFLAGS"
|
2003-04-11 11:42:12 +00:00
|
|
|
|
|
|
|
AC_TRY_LINK([#include <openct/openct.h>],
|
|
|
|
[ct_reader_connect(0);],
|
|
|
|
[
|
2003-05-24 19:31:12 +00:00
|
|
|
AC_DEFINE(HAVE_OPENCT, 1,
|
|
|
|
[Have OpenCT libraries and header files])
|
2003-04-11 11:42:12 +00:00
|
|
|
OPENCT_MSG=yes
|
2003-04-11 15:29:29 +00:00
|
|
|
LIBOPENCT="-lopenct"
|
2003-04-11 11:42:12 +00:00
|
|
|
],[
|
2003-06-11 10:54:02 +00:00
|
|
|
if test "x$with_openct" != "xno"; then
|
2003-05-24 19:31:12 +00:00
|
|
|
AC_MSG_ERROR([OpenCT not found in $openct_path!])
|
|
|
|
fi
|
|
|
|
OPENCT_LDFLAGS=
|
|
|
|
OPENCT_LIBS=
|
|
|
|
OPENCT_CFLAGS=
|
2003-04-11 11:42:12 +00:00
|
|
|
])
|
|
|
|
AC_MSG_RESULT($OPENCT_MSG)
|
2003-05-24 19:31:12 +00:00
|
|
|
|
|
|
|
CFLAGS="$saved_CFLAGS"
|
|
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
|
|
LIBS="$saved_LIBS"
|
2003-04-11 11:42:12 +00:00
|
|
|
fi
|
2003-05-24 19:31:12 +00:00
|
|
|
|
2003-04-11 11:42:12 +00:00
|
|
|
AM_CONDITIONAL(HAVE_OPENCT, test "x$OPENCT_MSG" = "xyes")
|
|
|
|
|
2002-03-21 14:05:24 +00:00
|
|
|
# Check for user-specified random device, otherwise check /dev/urandom
|
|
|
|
AC_ARG_WITH(random,
|
|
|
|
[ --with-random=FILE read entropy from FILE (default=/dev/urandom)],
|
|
|
|
[
|
|
|
|
if test "x$withval" != "xno" ; then
|
|
|
|
RANDOM_POOL="$withval";
|
|
|
|
AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL", [Location of random number pool])
|
|
|
|
fi
|
|
|
|
],
|
|
|
|
[
|
|
|
|
# Check for random device
|
|
|
|
AC_CHECK_FILE("/dev/urandom",
|
|
|
|
[
|
|
|
|
RANDOM_POOL="/dev/urandom";
|
|
|
|
AC_SUBST(RANDOM_POOL)
|
|
|
|
AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL", [Location of random number pool])
|
|
|
|
]
|
|
|
|
)
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
# Check for PRNGD/EGD pool file
|
|
|
|
AC_ARG_WITH(prngd-port,
|
|
|
|
[ --with-prngd-port=PORT read entropy from PRNGD/EGD localhost:PORT],
|
|
|
|
[
|
|
|
|
if test ! -z "$withval" -a "x$withval" != "xno" ; then
|
|
|
|
PRNGD_PORT="$withval"
|
|
|
|
AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT, [Port number of PRNGD/EGD random number socket])
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
# Check for PRNGD/EGD pool file
|
|
|
|
AC_ARG_WITH(prngd-socket,
|
|
|
|
[ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
|
|
|
|
[
|
|
|
|
if test "x$withval" != "xno" ; then
|
|
|
|
PRNGD_SOCKET="$withval"
|
|
|
|
AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET", [Location of PRNGD/EGD random number socket])
|
|
|
|
fi
|
|
|
|
],
|
|
|
|
[
|
|
|
|
# Check for existing socket only if we don't have a random device already
|
|
|
|
if test -z "$RANDOM_POOL" ; then
|
|
|
|
AC_MSG_CHECKING(for PRNGD/EGD socket)
|
|
|
|
# Insert other locations here
|
|
|
|
for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy /tmp/entropy; do
|
|
|
|
if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
|
|
|
|
PRNGD_SOCKET="$sock"
|
|
|
|
AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET", [Location of PRNGD/EGD random number socket])
|
|
|
|
break;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test ! -z "$PRNGD_SOCKET" ; then
|
|
|
|
AC_MSG_RESULT($PRNGD_SOCKET)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(not found)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
### BEGIN LDAP SPECIFIC OPTIONS
|
|
|
|
dnl ldap autoconf magic partly taken from pam_ldap
|
|
|
|
|
|
|
|
dnl --enable-ldap option.
|
|
|
|
AC_ARG_ENABLE(ldap,
|
|
|
|
[ --enable-ldap enable use of LDAP for authentication. [default=yes]],
|
|
|
|
, enable_ldap=yes)
|
2003-08-11 14:52:13 +00:00
|
|
|
AC_ARG_ENABLE(ldap-ssl, [ --disable-ldap-ssl disable SSL/TSL support for ldap])
|
2002-03-21 14:05:24 +00:00
|
|
|
AC_ARG_WITH(ldap-lib, [ --with-ldap-lib=type select ldap library [auto|netscape5|netscape4|netscape3|umich|openldap]])
|
|
|
|
AC_ARG_WITH(ldap-dir, [ --with-ldap-dir=DIR base directory of ldap SDK])
|
|
|
|
|
|
|
|
AC_SUBST(LIBLDAP)
|
|
|
|
LDAP_MSG="no"
|
|
|
|
if (test x$enable_ldap = xyes); then
|
|
|
|
if test -n "$with_ldap_dir"; then
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$with_ldap_dir/include"
|
|
|
|
LDFLAGS="$LDFLAGS -L$with_ldap_dir/lib"
|
|
|
|
case "$target_os" in
|
|
|
|
solaris*) LDFLAGS="$LDFLAGS -Wl,-R$with_ldap_dir/lib" ;;
|
|
|
|
*) LDFLAGS="$LDFLAGS -Wl,-rpath,$with_ldap_dir/lib" ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(lber.h ldap.h ldap_ssl.h)
|
|
|
|
|
|
|
|
dnl check which ldap library we have
|
|
|
|
if test -z "$with_ldap_lib"; then
|
|
|
|
with_ldap_lib=auto
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = umich -o $with_ldap_lib = openldap \); then
|
|
|
|
AC_CHECK_LIB(lber, ber_init, LIBLDAP="-llber $LIBLDAP" found_lber_lib=yes)
|
|
|
|
saved_LIBS="$LIBS"
|
|
|
|
LIBS="$LIBS $LIBLDAP"
|
|
|
|
AC_CHECK_LIB(ldap, ldap_search, LIBLDAP="-lldap $LIBLDAP" found_ldap_lib=yes)
|
2002-04-26 06:35:57 +00:00
|
|
|
AC_CHECK_LIB(ldap, ldap_start_tls_s, LIBLDAP="-lssl $LIBLDAP" need_ssl_lib=yes)
|
2002-03-21 14:05:24 +00:00
|
|
|
LIBS="$saved_LIBS"
|
|
|
|
fi
|
|
|
|
if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \); then
|
|
|
|
AC_CHECK_LIB(ldap50, ldap_search, LIBLDAP="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4 $LIBLDAP" found_ldap_lib=yes need_pthread=true,, -lpthread)
|
|
|
|
fi
|
|
|
|
if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape4 \); then
|
|
|
|
AC_CHECK_LIB(ldapssl41, ldap_search, LIBLDAP="-lldapssl41 -lplc3 -lplds3 -lnspr3 $LIBLDAP" found_ldap_lib=yes need_pthread=true,, -lpthread)
|
|
|
|
if test -z "$found_ldap_lib"; then
|
|
|
|
AC_CHECK_LIB(ldapssl40, ldap_search, LIBLDAP="-lldapssl40 $LIBLDAP" found_ldap_lib=yes need_pthread=true,, -lpthread)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape3 \); then
|
|
|
|
AC_CHECK_LIB(ldapssl30, ldap_search, LIBLDAP="-lldapssl30 $LIBLDAP" found_ldap_lib=yes need_pthread=true,, -lpthread)
|
|
|
|
fi
|
|
|
|
|
2002-06-04 09:38:37 +00:00
|
|
|
if test -n "$found_ldap_lib" -a "x$ac_cv_header_ldap_h" = "xyes"; then
|
2002-03-21 14:05:24 +00:00
|
|
|
AC_DEFINE(LDAP_REFERRALS,1,[This is needed for the native Solaris LDAP SDK])
|
|
|
|
AC_DEFINE(HAVE_LDAP, 1, [Use LDAP for authentication etc.])
|
|
|
|
LDAP_MSG="yes"
|
|
|
|
|
|
|
|
saved_LIBS="$LIBS"
|
|
|
|
LIBS="$LIBS $LIBLDAP"
|
|
|
|
AC_CHECK_FUNCS(ldap_init)
|
2003-08-18 12:05:50 +00:00
|
|
|
if test "$enable_ldap_ssl" \!= "no"; then
|
2002-03-21 14:05:24 +00:00
|
|
|
AC_CHECK_FUNCS(ldapssl_init ldap_start_tls_s ldap_pvt_tls_set_option)
|
|
|
|
fi
|
|
|
|
LIBS="$saved_LIBS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(HAVE_LDAP, test "x$LDAP_MSG" = "xyes")
|
|
|
|
### END LDAP SPECIFIC OPTIONS
|
|
|
|
|
2002-04-04 10:40:24 +00:00
|
|
|
### BEGIN ASSUAN SPECIFIC OPTIONS
|
2002-04-04 10:56:37 +00:00
|
|
|
ASSUAN_MSG="no"
|
2002-04-04 10:40:24 +00:00
|
|
|
AC_SUBST(CFLAGS_ASSUAN)
|
|
|
|
AC_SUBST(LIBASSUAN)
|
|
|
|
LIBASSUAN="-lassuan"
|
|
|
|
AC_ARG_WITH(assuan,
|
|
|
|
[ --with-assuan=PATH use Assuan libraries in PATH],
|
|
|
|
[
|
2003-08-12 11:44:18 +00:00
|
|
|
if test -n "${need_dash_r}"; then
|
|
|
|
LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
|
2002-04-04 10:40:24 +00:00
|
|
|
else
|
2003-08-12 11:44:18 +00:00
|
|
|
LDFLAGS="-L${withval}/lib ${LDFLAGS}"
|
2002-04-04 10:40:24 +00:00
|
|
|
fi
|
2003-08-12 11:44:18 +00:00
|
|
|
CFLAGS_ASSUAN="-I${withval}/include ${CFLAGS_ASSUAN}"
|
2002-04-04 10:40:24 +00:00
|
|
|
]
|
|
|
|
)
|
|
|
|
|
2002-04-04 10:56:37 +00:00
|
|
|
AC_CHECK_LIB(assuan, assuan_pipe_connect, ASSUAN_MSG="yes", ASSUAN_MSG="no")
|
|
|
|
if test "x$ASSUAN_MSG" != "xno" ; then
|
|
|
|
saved_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CFLAGS_ASSUAN $CPPFLAGS"
|
|
|
|
AC_CHECK_HEADER(assuan.h, ASSUAN_MSG="yes", ASSUAN_MSG="no")
|
|
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(HAVE_ASSUAN, test "x$ASSUAN_MSG" = "xyes")
|
2002-04-04 10:40:24 +00:00
|
|
|
### END ASSUAN SPECIFIC OPTIONS
|
|
|
|
|
|
|
|
PLUGINDIR="/usr/lib/mozilla/plugins"
|
|
|
|
AC_ARG_WITH(plugin-dir,
|
2003-08-14 11:37:46 +00:00
|
|
|
[ --with-plugin-dir=PATH install Mozilla plugin to PATH [[/usr/lib/mozilla/plugins]]],
|
2002-04-04 10:40:24 +00:00
|
|
|
[
|
|
|
|
PLUGINDIR="$withval"
|
|
|
|
]
|
|
|
|
)
|
|
|
|
AC_SUBST(PLUGINDIR)
|
|
|
|
|
2003-08-14 11:37:46 +00:00
|
|
|
BUNDLEDIR="${libdir}"
|
|
|
|
AC_ARG_WITH(bundle-dir,
|
|
|
|
[ --with-bundle-dir=PATH install MacOS X bundles to PATH [[EPREFIX/lib]]],
|
|
|
|
[
|
|
|
|
BUNDLEDIR="$withval"
|
|
|
|
]
|
|
|
|
)
|
|
|
|
AC_SUBST(BUNDLEDIR)
|
|
|
|
|
2002-04-04 20:49:21 +00:00
|
|
|
# Check for PIN entry program used by OpenSC Signer
|
2002-04-04 10:40:24 +00:00
|
|
|
PIN_ENTRY="/usr/local/bin/gpinentry"
|
|
|
|
AC_ARG_WITH(pin-entry,
|
2002-04-04 20:49:21 +00:00
|
|
|
[ --with-pin-entry=PROG Run PROG as PIN-entry for OpenSC Signer],
|
2002-04-04 10:40:24 +00:00
|
|
|
[
|
|
|
|
if test ! -z "$withval" -a "x$withval" != "xno" ; then
|
|
|
|
PIN_ENTRY="$withval"
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|
2002-04-04 20:49:21 +00:00
|
|
|
AC_DEFINE_UNQUOTED(PIN_ENTRY, "$PIN_ENTRY", [PIN-entry program for OpenSC Signer])
|
2002-04-04 10:40:24 +00:00
|
|
|
|
2003-06-11 10:54:02 +00:00
|
|
|
dnl Check for SGML processor
|
2003-06-15 11:54:40 +00:00
|
|
|
AC_ARG_WITH(docbook,
|
|
|
|
[ --without-docbook do no generate html manual (needs docbook)],
|
|
|
|
with_docbook=$withval)
|
2003-06-11 10:54:02 +00:00
|
|
|
AC_CHECK_PROG(XSLTPROC, xsltproc, xsltproc)
|
2003-06-15 11:54:40 +00:00
|
|
|
if test "x$XSLTPROC" = "x"; then
|
|
|
|
if test "x$with_docbook" = "xyes"; then
|
|
|
|
AC_MSG_ERROR([Docbook support requested, but cannot find xsltproc])
|
|
|
|
fi
|
|
|
|
with_docbook=no
|
|
|
|
fi
|
2003-08-14 11:37:46 +00:00
|
|
|
AM_CONDITIONAL(HAVE_DOCBOOK, test "x$with_docbook" = "xyes")
|
2003-06-11 10:54:02 +00:00
|
|
|
|
2003-08-25 10:21:38 +00:00
|
|
|
if test "x$prefix" = xNONE; then
|
|
|
|
prefix=$ac_default_prefix
|
|
|
|
fi
|
2003-08-26 10:55:02 +00:00
|
|
|
if test "x$exec_prefix" = xNONE; then
|
|
|
|
exec_prefix=$prefix
|
|
|
|
fi
|
2002-03-24 15:41:33 +00:00
|
|
|
|
2003-08-25 10:21:38 +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
|
|
|
|
|
|
|
|
CPPFLAGS="-I\${top_builddir}/src/include $CPPFLAGS"
|
|
|
|
AM_CONDITIONAL(HAVE_BUNDLES, test "x$with_bundles" = "xyes")
|
2002-03-21 14:05:24 +00:00
|
|
|
|
|
|
|
scldap_etc_path=`eval echo ${sysconfdir}` ; scldap_etc_path=`eval echo ${scldap_etc_path}`
|
2002-03-24 15:41:33 +00:00
|
|
|
AC_DEFINE_UNQUOTED(SCLDAP_ETC_PATH, "$scldap_etc_path", [etc path for libscldap])
|
|
|
|
scldap_conf_path=`eval echo ${scldap_etc_path}/scldap.conf`
|
|
|
|
AC_DEFINE_UNQUOTED(SCLDAP_CONF_PATH, "$scldap_conf_path", [default config file for libscldap])
|
|
|
|
|
2002-03-24 14:12:38 +00:00
|
|
|
opensc_etc_path=`eval echo ${sysconfdir}` ; opensc_etc_path=`eval echo ${opensc_etc_path}`
|
|
|
|
AC_DEFINE_UNQUOTED(OPENSC_ETC_PATH, "$opensc_etc_path", [etc path for libopensc])
|
|
|
|
opensc_conf_path=`eval echo ${opensc_etc_path}/opensc.conf`
|
|
|
|
AC_DEFINE_UNQUOTED(OPENSC_CONF_PATH, "$opensc_conf_path", [default config file for libopensc])
|
2002-03-21 14:05:24 +00:00
|
|
|
|
2003-08-25 10:21:38 +00:00
|
|
|
AC_SUBST(LIBSCCONF)
|
|
|
|
LIBSCCONF="\${top_builddir}/src/scconf/libscconf.la"
|
|
|
|
AC_SUBST(LIBSCLDAP)
|
2003-08-28 13:08:57 +00:00
|
|
|
if test "x$LDAP_MSG" = "xyes" ; then
|
|
|
|
LIBSCLDAP="\${top_builddir}/src/scldap/libscldap.la"
|
|
|
|
fi
|
2002-01-06 20:06:00 +00:00
|
|
|
AC_SUBST(LIBOPENSC)
|
2003-03-27 10:20:10 +00:00
|
|
|
LIBOPENSC="\${top_builddir}/src/libopensc/libopensc.la"
|
2002-01-06 20:06:00 +00:00
|
|
|
|
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)
|
|
|
|
|
2002-05-08 06:50:45 +00:00
|
|
|
pkgdata=`eval echo ${datadir}/${PACKAGE}` ; pkgdata=`eval echo ${pkgdata}`
|
|
|
|
AC_SUBST(pkgdata)
|
|
|
|
|
2001-12-22 22:27:20 +00:00
|
|
|
AC_OUTPUT([
|
|
|
|
Makefile
|
|
|
|
aclocal/Makefile
|
2002-03-13 13:21:15 +00:00
|
|
|
docs/Makefile
|
2002-05-08 06:50:45 +00:00
|
|
|
docs/pkcs15-profile.5
|
2002-03-24 15:41:33 +00:00
|
|
|
etc/Makefile
|
2003-08-14 11:37:46 +00:00
|
|
|
macos/Makefile
|
2001-12-22 22:27:20 +00:00
|
|
|
src/Makefile
|
2002-01-02 22:15:31 +00:00
|
|
|
src/common/Makefile
|
2002-04-05 13:48:00 +00:00
|
|
|
src/include/Makefile
|
|
|
|
src/include/opensc/Makefile
|
2002-12-17 12:37:44 +00:00
|
|
|
src/include/opensc/rsaref/Makefile
|
2001-12-22 22:27:20 +00:00
|
|
|
src/libopensc/Makefile
|
2002-01-26 16:03:13 +00:00
|
|
|
src/libopensc/opensc-config
|
2003-03-27 10:20:10 +00:00
|
|
|
src/libopensc/libopensc.pc
|
2003-07-24 10:00:57 +00:00
|
|
|
src/openscd/Makefile
|
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
|
2002-04-02 13:38:57 +00:00
|
|
|
src/pkcs15init/Makefile
|
2002-03-21 14:05:24 +00:00
|
|
|
src/scam/Makefile
|
|
|
|
src/scconf/Makefile
|
2003-09-01 08:43:38 +00:00
|
|
|
src/scdl/Makefile
|
2002-03-21 14:05:24 +00:00
|
|
|
src/scldap/Makefile
|
|
|
|
src/scrandom/Makefile
|
|
|
|
src/sia/Makefile
|
2002-04-04 10:40:24 +00:00
|
|
|
src/signer/Makefile
|
|
|
|
src/signer/npinclude/Makefile
|
2003-05-12 20:18:31 +00:00
|
|
|
src/sslengines/Makefile
|
2001-12-22 22:27:20 +00:00
|
|
|
src/tests/Makefile
|
2003-06-15 22:20:21 +00:00
|
|
|
src/tests/regression/Makefile
|
2001-12-22 22:27:20 +00:00
|
|
|
src/tools/Makefile
|
2003-03-27 10:20:10 +00:00
|
|
|
src/usbtoken/Makefile
|
2003-04-21 15:01:55 +00:00
|
|
|
win32/Makefile
|
2001-12-22 22:27:20 +00:00
|
|
|
])
|
|
|
|
|
2002-03-21 14:05:24 +00:00
|
|
|
if test ! -z "$RANDOM_POOL" ; then
|
|
|
|
RAND_MSG="device ($RANDOM_POOL)"
|
|
|
|
else
|
|
|
|
if test ! -z "$PRNGD_PORT" ; then
|
|
|
|
RAND_MSG="PRNGD/EGD (port localhost:$PRNGD_PORT)"
|
|
|
|
elif test ! -z "$PRNGD_SOCKET" ; then
|
|
|
|
RAND_MSG="PRNGD/EGD (socket $PRNGD_SOCKET)"
|
|
|
|
else
|
|
|
|
RAND_MSG="Builtin kluge"
|
|
|
|
BUILTIN_RNG=1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2001-12-22 22:27:20 +00:00
|
|
|
dnl Someone please show me a better way :)
|
|
|
|
A=`eval echo ${prefix}` ; A=`eval echo ${A}`
|
|
|
|
B=`eval echo ${bindir}` ; B=`eval echo ${B}`
|
2002-03-21 14:05:24 +00:00
|
|
|
C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
|
2001-12-22 22:27:20 +00:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "OpenSC has been configured with the following options"
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "User binaries: ${B}"
|
2002-03-21 14:05:24 +00:00
|
|
|
echo "Configuration files: ${C}"
|
2001-12-22 22:27:20 +00:00
|
|
|
|
|
|
|
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 ""
|
2002-03-21 14:05:24 +00:00
|
|
|
echo "Random number collection: ${RAND_MSG}"
|
|
|
|
echo "OpenSSL support: ${SSL_MSG}"
|
2003-04-17 12:47:48 +00:00
|
|
|
echo " with engine: ${ENGINE_MSG}"
|
2003-03-11 10:59:38 +00:00
|
|
|
echo "PC/SC support: ${PCSC_MSG}"
|
2003-04-11 11:42:12 +00:00
|
|
|
echo "USBToken support: ${USBTOKEN_MSG}"
|
|
|
|
echo "OpenCT support: ${OPENCT_MSG}"
|
2002-04-04 10:56:37 +00:00
|
|
|
echo "Assuan support: ${ASSUAN_MSG}"
|
2002-03-21 14:05:24 +00:00
|
|
|
echo "LDAP support: ${LDAP_MSG}"
|
|
|
|
echo "PAM support: ${PAM_MSG}"
|
2003-08-04 15:11:27 +00:00
|
|
|
case "$host" in
|
2003-08-12 11:44:18 +00:00
|
|
|
*-*-osf*)
|
2003-08-04 15:11:27 +00:00
|
|
|
echo "SIA support: ${SIA_MSG}"
|
|
|
|
;;
|
|
|
|
esac
|
2001-12-22 22:27:20 +00:00
|
|
|
echo ""
|
2002-03-21 14:05:24 +00:00
|
|
|
|
2003-08-25 10:21:38 +00:00
|
|
|
if test "x$ENGINE_MSG" = "xno" -a "x$SSL_MSG" = "xyes"; then
|
|
|
|
echo "OpenSSL was found. But to use the engine you will need"
|
|
|
|
echo "version 0.9.7a or later."
|
2003-04-17 12:47:48 +00:00
|
|
|
fi
|
|
|
|
|
2003-08-25 10:21:38 +00:00
|
|
|
if test ! -z "$BUILTIN_RNG"; then
|
2002-03-21 14:05:24 +00:00
|
|
|
echo "WARNING: you are using the builtin random number service."
|
|
|
|
echo "The random number service is very simple and is only"
|
|
|
|
echo "intended for testing purposes. Please request your OS"
|
|
|
|
echo "vendor to include /dev/random in future versions of"
|
|
|
|
echo "their OS. Or use PRNGD/EGD instead, your choice."
|
|
|
|
fi
|