808 lines
20 KiB
Plaintext
808 lines
20 KiB
Plaintext
dnl -*- mode: m4; -*-
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
# Require autoconf 2.52
|
|
AC_PREREQ(2.52)
|
|
|
|
AC_INIT(opensc, WIP)
|
|
AM_INIT_AUTOMAKE
|
|
AM_CONFIG_HEADER(config.h)
|
|
|
|
AC_CONFIG_SRCDIR(src/libopensc/sc.c)
|
|
|
|
# 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=1
|
|
OPENSC_LT_REVISION=0
|
|
OPENSC_LT_AGE=0
|
|
|
|
AC_SUBST(OPENSC_LT_CURRENT)
|
|
AC_SUBST(OPENSC_LT_REVISION)
|
|
AC_SUBST(OPENSC_LT_AGE)
|
|
|
|
AC_CANONICAL_HOST
|
|
AC_PROG_CC
|
|
AC_C_BIGENDIAN
|
|
|
|
dnl Check for some target-specific stuff
|
|
case "$host" in
|
|
*-*-hpux*)
|
|
CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED"
|
|
;;
|
|
*-*-solaris*)
|
|
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
|
|
LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
|
|
need_dash_r=1
|
|
;;
|
|
*-*-sunos4*)
|
|
CPPFLAGS="$CPPFLAGS -DSUNOS4"
|
|
;;
|
|
*-*-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
|
|
;;
|
|
*-*-osf*)
|
|
CPPFLAGS="$CPPFLAGS -D_POSIX_PII_SOCKET"
|
|
;;
|
|
*-*-darwin*)
|
|
LIBS="$LIBS -Wl,-framework,CoreFoundation"
|
|
if test "$GCC" = "yes"; then
|
|
CFLAGS="$CFLAGS -no-cpp-precomp"
|
|
fi
|
|
with_bundles=yes
|
|
;;
|
|
esac
|
|
|
|
AC_ARG_WITH(common-dir,
|
|
AC_HELP_STRING([--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
|
|
LDFLAGS="-L$commondir/lib $saved_LDFLAGS"
|
|
if test ! -z "$need_dash_r" ; then
|
|
LDFLAGS="-R$commondir/lib $LDFLAGS"
|
|
fi
|
|
CPPFLAGS="-I$commondir/include $saved_CPPFLAGS"
|
|
fi
|
|
break;
|
|
done
|
|
|
|
if test -z "$commondir" ; then
|
|
commondir="(system)"
|
|
fi
|
|
ac_cv_commondir=$commondir
|
|
])
|
|
|
|
dnl Options
|
|
AM_MAINTAINER_MODE
|
|
|
|
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
|
|
AC_CHECK_HEADERS([errno.h fcntl.h malloc.h stdlib.h inttypes.h string.h strings.h sys/time.h unistd.h locale.h getopt.h dlfcn.h utmp.h])
|
|
|
|
AC_CHECK_HEADERS([zlib.h],[LIBS="$LIBS -lz"])
|
|
|
|
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 vsyslog setlocale])
|
|
|
|
dnl C Compiler features
|
|
AC_C_INLINE
|
|
if test "$GCC" = "yes"; then
|
|
CFLAGS="-Wall -fno-strict-aliasing $CFLAGS"
|
|
fi
|
|
|
|
AC_SUBST(LIBDL)
|
|
AC_CHECK_LIB(dl, dlopen, [LIBDL="$LIBDL -ldl" ac_cv_func_dlopen_ldl=yes], ac_cv_func_dlopen_ldl=no)
|
|
|
|
dnl See if socket() is found from libsocket
|
|
AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket" ac_cv_func_socket_in_lsocket=yes], ac_cv_func_socket_in_lsocket=no)
|
|
|
|
ac_cv_func_res_query_in_lresolv=no
|
|
if test x$ac_cv_func_socket_in_lsocket = xyes; then
|
|
AC_CHECK_LIB(resolv, res_query, [LIBS="$LIBS -lresolv" ac_cv_func_res_query_in_lresolv=yes])
|
|
fi
|
|
|
|
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.])])
|
|
|
|
AC_CHECK_HEADERS([readline/readline.h])
|
|
AC_SUBST(LIBREADLINE)
|
|
saved_LIBS="$LIBS"
|
|
# libreadline will also need libtermcap on some OSes
|
|
for add in "" "-ltermcap"; do
|
|
if test "x$add" != x; then
|
|
AC_MSG_CHECKING([for readline with])
|
|
AC_MSG_RESULT($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 "x$ac_cv_func_readline_lreadline" = xyes && break
|
|
done
|
|
LIBS="$LIBS $LIBREADLINE"
|
|
AC_CHECK_FUNCS(readline)
|
|
LIBS="$saved_LIBS"
|
|
|
|
AC_ARG_WITH(flex-dir,
|
|
AC_HELP_STRING([--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
|
|
if test ! -z "$flexdir" -a ! -d "$flexdir/" ; then
|
|
continue;
|
|
fi
|
|
|
|
LIBFL="-lfl"
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
if test ! -z "$flexdir" -a "x$flexdir" != "x/usr"; then
|
|
LDFLAGS="-L$flexdir/lib $saved_LDFLAGS"
|
|
if test ! -z "$need_dash_r" ; then
|
|
LDFLAGS="-R$flexdir/lib $LDFLAGS"
|
|
fi
|
|
CPPFLAGS="-I$flexdir/include $saved_CPPFLAGS"
|
|
fi
|
|
break;
|
|
done
|
|
|
|
if test -z "$flexdir" ; then
|
|
flexdir="(system)"
|
|
fi
|
|
ac_cv_flexdir=$flexdir
|
|
])
|
|
|
|
|
|
dnl The big mess with OpenSSL
|
|
saved_LIBS="$LIBS"
|
|
saved_LDFLAGS="$LDFLAGS"
|
|
saved_CPPFLAGS="$CPPFLAGS"
|
|
|
|
SSL_MSG="no"
|
|
ssldir=""
|
|
|
|
AC_ARG_WITH(openssl,
|
|
AC_HELP_STRING([--with-openssl=PATH], [use OpenSSL in PATH]),
|
|
[
|
|
# Disable OpenSSL support
|
|
if test "x$withval" = "xno" ; then
|
|
SSL_MSG="no (disabled)"
|
|
break;
|
|
fi
|
|
|
|
# ok we got a directory, so only check in that dir.
|
|
LIBCRYPTO="-lcrypto"
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
LIBS="$LIBCRYPTO $saved_LIBS"
|
|
LDFLAGS="-L$withval/lib $saved_LDFLAGS"
|
|
if test ! -z "$need_dash_r" ; then
|
|
LDFLAGS="-R$withval/lib $LDFLAGS"
|
|
fi
|
|
CPPFLAGS="-I$withval/include $saved_CPPFLAGS"
|
|
|
|
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);
|
|
}
|
|
],
|
|
[
|
|
SSL_MSG="yes"
|
|
ssldir="$withval"
|
|
break
|
|
])
|
|
],[
|
|
|
|
# we didn't get a directory, so we start searching for openssl
|
|
for tryssldir in $commondir /usr /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 ! -d "$tryssldir/" ; then
|
|
continue;
|
|
fi
|
|
|
|
LIBCRYPTO="-lcrypto"
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
LIBS="$saved_LIBS $LIBCRYPTO"
|
|
|
|
if test "x$tryssldir" != "x/usr"; then
|
|
LDFLAGS="-L$tryssldir/lib $saved_LDFLAGS"
|
|
if test ! -z "$need_dash_r" ; then
|
|
LDFLAGS="-R$tryssldir/lib $LDFLAGS"
|
|
fi
|
|
CPPFLAGS="-I$tryssldir/include $saved_CPPFLAGS"
|
|
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);
|
|
}
|
|
],
|
|
[
|
|
SSL_MSG="yes"
|
|
ssldir=$tryssldir
|
|
break;
|
|
],
|
|
[
|
|
SSL_MSG="no"
|
|
LIBS="$saved_LIBS"
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
])
|
|
done
|
|
])
|
|
LIBS="$saved_LIBS"
|
|
AC_SUBST(LIBCRYPTO)
|
|
AM_CONDITIONAL(HAVE_SSL, test "x$SSL_MSG" = "xyes")
|
|
|
|
if test "x$SSL_MSG" = "xyes" ; then
|
|
AC_DEFINE(HAVE_OPENSSL, 1, [Have OpenSSL libraries])
|
|
else
|
|
LIBCRYPTO=""
|
|
fi
|
|
|
|
# ok, we checked for basic ssl support.
|
|
# if it is not available, we can skip the rest of
|
|
# the test. also we have $ssldir set to the location
|
|
# of the openssl libs.
|
|
|
|
ENGINE_MSG="no"
|
|
if test "x$SSL_MSG" = "xyes"; then
|
|
# engine has to be there and working
|
|
LIBS="$saved_LIBS $LIBCRYPTO $LIBDL"
|
|
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;
|
|
|
|
e = ENGINE_new();
|
|
ENGINE_load_dynamic();
|
|
if (!e) return 1;
|
|
memset(a, 0, sizeof(a));
|
|
RAND_add(a, sizeof(a), sizeof(a));
|
|
return(RAND_status() <= 0);
|
|
}
|
|
],
|
|
[
|
|
ENGINE_MSG=yes
|
|
ENGINE_LINK="$LIBCRYPTO"
|
|
],
|
|
[
|
|
ENGINE_MSG=no
|
|
]);
|
|
fi
|
|
LIBS="$saved_LIBS"
|
|
AC_SUBST(ENGINE_LINK)
|
|
AM_CONDITIONAL(HAVE_ENGINE, test "x$ENGINE_MSG" = "xyes")
|
|
|
|
# ok, now we might (or not) have ssl and an engine.
|
|
# still room for "improvements", i.e. hacks to work
|
|
# with old engines.
|
|
|
|
SSLHACK_MSG=no
|
|
if test "x$SSL_MSG" = "xyes" -a "x$ENGINE_MSG" = "xyes"; then
|
|
# latest openssl version with engine
|
|
# properly integrated?
|
|
AC_MSG_CHECKING([for openssl version])
|
|
AC_TRY_RUN(
|
|
[
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <openssl/opensslv.h>
|
|
|
|
int main(void)
|
|
{
|
|
if(OPENSSL_VERSION_NUMBER >= 0x0090704fL) {
|
|
exit(0);
|
|
} else {
|
|
exit(1);
|
|
}
|
|
}
|
|
],
|
|
[
|
|
AC_MSG_RESULT([good, 0.9.7d or later])
|
|
OLD_OPENSSL=no
|
|
],
|
|
[
|
|
AC_MSG_RESULT([not so good, 0.9.7d or later would be better])
|
|
OLD_OPENSSL=yes
|
|
])
|
|
|
|
if test "x$OLD_OPENSSL" = "xyes"; then
|
|
# openssl found, but version less than 0.9.7d
|
|
# linking libcrypto.a statically possible?
|
|
|
|
LIBS="$saved_LIBS $ssldir/lib/libcrypto.a $LIBDL"
|
|
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;
|
|
|
|
e = ENGINE_new();
|
|
ENGINE_load_dynamic();
|
|
if (!e) return 1;
|
|
memset(a, 0, sizeof(a));
|
|
RAND_add(a, sizeof(a), sizeof(a));
|
|
return(RAND_status() <= 0);
|
|
}
|
|
],
|
|
[
|
|
SSLHACK_MSG=yes
|
|
ENGINE_LINK="$ssldir/lib/libcrypto.a"
|
|
])
|
|
LIBS="$saved_LIBS"
|
|
fi
|
|
fi
|
|
|
|
# now - last part to do: check if we gain anything from
|
|
# funny parameters to link openssl with.
|
|
|
|
saved_LDFLAGS="$LDFLAGS"
|
|
if test "x$ENGINE_MSG" = "xyes" ; then
|
|
for openssl_ldflag in "-Wl,-Bsymbolic" "-G -Wl,-Bsymbolic" "-shared -G -Wl,-Bsymbolic" "-Wl,-all_load"; do
|
|
AC_MSG_CHECKING([whether we can use $openssl_ldflag])
|
|
LDFLAGS="$saved_LDFLAGS $openssl_ldflag"
|
|
AC_TRY_LINK(,[return 1],ac_cv_use_openssl_flag="yes",ac_cv_use_openssl_flag="no")
|
|
AC_MSG_RESULT($ac_cv_use_openssl_flag)
|
|
if test "$ac_cv_use_openssl_flag" = "yes"; then
|
|
OPENSSL_LDFLAGS="$openssl_ldflag"
|
|
break;
|
|
fi
|
|
done
|
|
fi
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
AC_SUBST(OPENSSL_LDFLAGS)
|
|
|
|
PCSC_MSG=no
|
|
pcsc_path=/usr
|
|
AC_SUBST(PCSC_CFLAGS)
|
|
AC_SUBST(PCSC_LIBS)
|
|
|
|
case "$host" in
|
|
*-*-darwin*)
|
|
PCSC_MSG=yes
|
|
PCSC_CFLAGS=""
|
|
PCSC_LIBS="-Wl,-framework,PCSC"
|
|
;;
|
|
esac
|
|
|
|
saved_LIBS="$LIBS"
|
|
saved_CFLAGS="$CFLAGS"
|
|
saved_LDFLAGS="$LDFLAGS"
|
|
saved_CPPFLAGS="$CPPFLAGS"
|
|
AC_ARG_WITH(pcsclite,
|
|
AC_HELP_STRING([--with-pcsclite=PATH], [use PC/SC Lite in PATH]),
|
|
[pcsc_path=$withval])
|
|
if test "x$pcsc_path" = "xno"; then
|
|
PCSC_MSG="no"
|
|
fi
|
|
if test "x$pcsc_path" != "xno" -a "x$PCSC_MSG" != "xyes"; then
|
|
PKG_CHECK_MODULES(PCSC, libpcsclite, [
|
|
PCSC_MSG="yes"
|
|
AC_MSG_RESULT($PCSC_MSG)
|
|
],[
|
|
AC_MSG_CHECKING(for PC/SC Lite support (old style))
|
|
for pcscdir in "" /pcsc /PCSC; do
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
LIBS="-lpcsclite $saved_LIBS"
|
|
PCSC_CFLAGS=""
|
|
|
|
for pcsc_libdir in $pcsc_path/lib$pcscdir \
|
|
$pcsc_path$pcscdir/lib \
|
|
$pcsc_path$pcscdir; do
|
|
if test -d $pcsc_libdir; then
|
|
if test -n "${need_dash_r}"; then
|
|
LDFLAGS="-R${pcsc_libdir}/ ${LDFLAGS}"
|
|
fi
|
|
LDFLAGS="-L${pcsc_libdir} ${LDFLAGS}"
|
|
fi
|
|
done
|
|
|
|
for pcsc_incdir in $pcsc_path/include$pcscdir \
|
|
$pcsc_path$pcscdir/include \
|
|
$pcsc_path$pcscdir; do
|
|
if test -d $pcsc_incdir; then
|
|
PCSC_CFLAGS="-I${pcsc_incdir}"
|
|
break;
|
|
fi
|
|
done
|
|
|
|
CPPFLAGS="${PCSC_CFLAGS} ${CPPFLAGS}"
|
|
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
|
|
PCSC_MSG=yes
|
|
break;
|
|
fi
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
LIBS="$saved_LIBS"
|
|
PCSC_CFLAGS=""
|
|
done
|
|
AC_MSG_RESULT($PCSC_MSG)
|
|
if test "x$PCSC_MSG" = "xyes" ; then
|
|
PCSC_LIBS="-lpcsclite"
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
LIBS="$saved_LIBS"
|
|
fi
|
|
])
|
|
fi
|
|
AM_CONDITIONAL(HAVE_PCSC, test "x$PCSC_MSG" = "xyes")
|
|
if test "x$PCSC_MSG" = "xyes"; then
|
|
AC_DEFINE(HAVE_PCSC, 1, [Have PC/SC implementation])
|
|
else
|
|
PCSC_LIBS=""
|
|
PCSC_CFLAGS=""
|
|
fi
|
|
|
|
if test "x$PCSC_MSG" = "xyes"; then
|
|
CPPFLAGS="${PCSC_CFLAGS} $saved_CPPFLAGS"
|
|
CFLAGS="$PCSC_CFLAGS $saved_CFLAGS"
|
|
LIBS="$PCSC_LIBS $saved_LIBS"
|
|
AC_TRY_LINK([
|
|
#include <stdlib.h>
|
|
#ifdef __APPLE__
|
|
#include <PCSC/wintypes.h>
|
|
#include <PCSC/winscard.h>
|
|
#else
|
|
#include <winscard.h>
|
|
#endif
|
|
], [
|
|
SCardControl(NULL, NULL, 0, NULL, NULL);
|
|
], [
|
|
AC_DEFINE(HAVE_PCSC_OLD, 1, [old version of pc/sc-lite])
|
|
])
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
CFLAGS="$saved_CFLAGS"
|
|
LIBS="$saved_LIBS"
|
|
fi
|
|
|
|
# check for reader.h
|
|
saved_CFLAGS="$CFLAGS"
|
|
CFLAGS="$CFLAGS $PCSC_CFLAGS"
|
|
AC_CHECK_HEADER(reader.h,
|
|
[AC_DEFINE([HAVE_READER_H], 1, [Define if pcsc-lite with reader.h exists])],
|
|
[AC_MSG_WARN([reader.h not found, install pcsc-lite 1.2.9-beta8 or later, or use CFLAGS=... ./configure])],
|
|
[ #include <reader.h>])
|
|
CFLAGS="$saved_CFLAGS"
|
|
|
|
OPENCT_MSG=no
|
|
openct_path=/usr
|
|
AC_SUBST(OPENCT_CFLAGS)
|
|
AC_SUBST(OPENCT_LDFLAGS)
|
|
AC_SUBST(OPENCT_LIBS)
|
|
|
|
saved_LIBS="$LIBS"
|
|
saved_CFLAGS="$CFLAGS"
|
|
saved_LDFLAGS="$LDFLAGS"
|
|
saved_CPPFLAGS="$CPPFLAGS"
|
|
AC_ARG_WITH(openct,
|
|
AC_HELP_STRING([--with-openct=PATH], [use OpenCT in PATH]),
|
|
[openct_path=$withval])
|
|
if test "x$openct_path" = "xno"; then
|
|
OPENCT_MSG="no"
|
|
fi
|
|
if test "x$openct_path" != "xno" -a "x$OPENCT_MSG" != "xyes"; then
|
|
PKG_CHECK_MODULES(OPENCT, libopenct, [
|
|
OPENCT_MSG="yes"
|
|
AC_MSG_RESULT($OPENCT_MSG)
|
|
],[
|
|
AC_MSG_CHECKING(for OpenCT support (old style))
|
|
CPPFLAGS="$saved_CPPFLAGS"
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
LIBS="$saved_LIBS"
|
|
|
|
OPENCT_CFLAGS="-I${openct_path}/include"
|
|
OPENCT_LIBS="-lopenct"
|
|
OPENCT_LDFLAGS=""
|
|
if test -n "${need_dash_r}"; then
|
|
OPENCT_LDFLAGS="-R${openct_path}/lib"
|
|
fi
|
|
OPENCT_LDFLAGS="-L${openct_path}/lib $OPENCT_LDFLAGS"
|
|
|
|
LIBS="$OPENCT_LIBS $saved_LIBS"
|
|
LDFLAGS="$OPENCT_LDFLAGS $saved_LDFLAGS"
|
|
CFLAGS="$OPENCT_CFLAGS $saved_CFLAGS"
|
|
|
|
AC_TRY_LINK([#include <openct/openct.h>],[ct_reader_connect(0);],OPENCT_MSG=yes,OPENCT_MSG=no)
|
|
AC_MSG_RESULT($OPENCT_MSG)
|
|
|
|
CFLAGS="$saved_CFLAGS"
|
|
LDFLAGS="$saved_LDFLAGS"
|
|
LIBS="$saved_LIBS"
|
|
])
|
|
fi
|
|
|
|
AM_CONDITIONAL(HAVE_OPENCT, test "x$OPENCT_MSG" = "xyes")
|
|
if test "x$OPENCT_MSG" = "xyes"; then
|
|
AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files])
|
|
else
|
|
OPENCT_LDFLAGS=""
|
|
OPENCT_LIBS=""
|
|
OPENCT_CFLAGS=""
|
|
fi
|
|
|
|
dnl enable/disable logging of sensitive apdu data
|
|
AC_ARG_ENABLE(sensitive-logging,
|
|
AC_HELP_STRING([--disable-sensitive-logging], [disable logging of sensitive APDU data [default=no]]),
|
|
AC_DEFINE(OPENSC_DONT_LOG_SENSITIVE,1,[Disable logging of sensitive APDU data]))
|
|
|
|
### BEGIN ASSUAN SPECIFIC OPTIONS
|
|
ASSUAN_MSG="no"
|
|
AC_SUBST(CFLAGS_ASSUAN)
|
|
AC_SUBST(LIBASSUAN)
|
|
LIBASSUAN="-lassuan"
|
|
AC_ARG_WITH(assuan,
|
|
AC_HELP_STRING([--with-assuan=PATH], [use Assuan libraries in PATH]),
|
|
[
|
|
if test -n "${need_dash_r}"; then
|
|
LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
|
|
else
|
|
LDFLAGS="-L${withval}/lib ${LDFLAGS}"
|
|
fi
|
|
CFLAGS_ASSUAN="-I${withval}/include ${CFLAGS_ASSUAN}"
|
|
]
|
|
)
|
|
|
|
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")
|
|
### END ASSUAN SPECIFIC OPTIONS
|
|
|
|
PLUGINDIR="/usr/lib/mozilla/plugins"
|
|
AC_ARG_WITH(plugin-dir,
|
|
AC_HELP_STRING([--with-plugin-dir=PATH], [install Mozilla plugin to PATH [[/usr/lib/mozilla/plugins]]]),
|
|
[
|
|
PLUGINDIR="$withval"
|
|
]
|
|
)
|
|
AC_SUBST(PLUGINDIR)
|
|
|
|
BUNDLEDIR="${libdir}"
|
|
AC_ARG_WITH(bundle-dir,
|
|
AC_HELP_STRING([--with-bundle-dir=PATH], [install MacOS X bundles to PATH [[EPREFIX/lib]]]),
|
|
[
|
|
BUNDLEDIR="$withval"
|
|
]
|
|
)
|
|
AC_SUBST(BUNDLEDIR)
|
|
|
|
# Check for PIN entry program used by OpenSC Signer
|
|
PIN_ENTRY="/usr/local/bin/gpinentry"
|
|
AC_ARG_WITH(pin-entry,
|
|
AC_HELP_STRING([--with-pin-entry=PROG],[Run PROG as PIN-entry for OpenSC Signer]),
|
|
[
|
|
if test ! -z "$withval" -a "x$withval" != "xno" ; then
|
|
PIN_ENTRY="$withval"
|
|
fi
|
|
]
|
|
)
|
|
AC_DEFINE_UNQUOTED(PIN_ENTRY, "$PIN_ENTRY", [PIN-entry program for OpenSC Signer])
|
|
|
|
dnl Check for SGML processor
|
|
AC_ARG_WITH(docbook,
|
|
AC_HELP_STRING([--without-docbook], [do no generate html manual (needs docbook)]),
|
|
with_docbook=$withval)
|
|
AC_CHECK_PROG(XSLTPROC, xsltproc, xsltproc)
|
|
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
|
|
AM_CONDITIONAL(HAVE_DOCBOOK, test "x$with_docbook" = "xyes")
|
|
|
|
if test "x$prefix" = xNONE; then
|
|
prefix=$ac_default_prefix
|
|
fi
|
|
if test "x$exec_prefix" = xNONE; then
|
|
exec_prefix='${prefix}'
|
|
fi
|
|
|
|
dnl Enable/disable debugging messages.
|
|
AC_ARG_ENABLE(debug,
|
|
AC_HELP_STRING([--enable-debug], [enable debug messages. [[default=no]]]),
|
|
AC_DEFINE(DEBUG, 1, [Enable debug messages.]))
|
|
|
|
CPPFLAGS="-I\${top_builddir}/src/include $CPPFLAGS"
|
|
AM_CONDITIONAL(HAVE_BUNDLES, test "x$with_bundles" = "xyes")
|
|
|
|
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])
|
|
|
|
AC_SUBST(LIBSCCONF)
|
|
LIBSCCONF="\${top_builddir}/src/scconf/libscconf.la"
|
|
AC_SUBST(LIBOPENSC)
|
|
LIBOPENSC="\${top_builddir}/src/libopensc/libopensc.la"
|
|
|
|
# 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)
|
|
|
|
pkgdata=`eval echo ${datadir}/${PACKAGE}` ; pkgdata=`eval echo ${pkgdata}`
|
|
AC_SUBST(pkgdata)
|
|
|
|
AC_OUTPUT([
|
|
Makefile
|
|
aclocal/Makefile
|
|
doc/Makefile
|
|
doc/old/Makefile
|
|
doc/src/Makefile
|
|
etc/Makefile
|
|
macos/Makefile
|
|
man/Makefile
|
|
man/pkcs15-profile.5
|
|
src/Makefile
|
|
src/common/Makefile
|
|
src/include/Makefile
|
|
src/include/opensc/Makefile
|
|
src/include/opensc/rsaref/Makefile
|
|
src/libopensc/Makefile
|
|
src/libopensc/opensc-config
|
|
src/libopensc/libopensc.pc
|
|
src/libopensc/libpkcs15init.pc
|
|
src/libopensc/libscconf.pc
|
|
src/openssh/Makefile
|
|
src/pkcs11/Makefile
|
|
src/pkcs11/rsaref/Makefile
|
|
src/pkcs15init/Makefile
|
|
src/scconf/Makefile
|
|
src/scdl/Makefile
|
|
src/signer/Makefile
|
|
src/signer/npinclude/Makefile
|
|
src/libp11/Makefile
|
|
src/libp11/libp11.pc
|
|
src/sslengines/Makefile
|
|
src/tests/Makefile
|
|
src/tests/regression/Makefile
|
|
src/tools/Makefile
|
|
win32/Makefile
|
|
])
|
|
|
|
A=`eval echo ${prefix}` ; A=`eval echo ${A}`
|
|
B=`eval echo ${bindir}` ; B=`eval echo ${B}`
|
|
C=`eval echo ${sysconfdir}` ; C=`eval echo ${C}`
|
|
|
|
echo ""
|
|
echo "OpenSC has been configured with the following options"
|
|
|
|
echo ""
|
|
echo "Version: ${PACKAGE_VERSION}"
|
|
echo "User binaries: ${B}"
|
|
echo "Configuration files: ${C}"
|
|
|
|
echo ""
|
|
echo "Host: ${host}"
|
|
echo "Compiler: ${CC}"
|
|
echo "Compiler flags: ${CFLAGS}"
|
|
echo "Preprocessor flags: ${CPPFLAGS}"
|
|
echo "Linker flags: ${LDFLAGS}"
|
|
echo "Libraries: ${LIBS}"
|
|
|
|
echo ""
|
|
echo "OpenSSL support: ${SSL_MSG}"
|
|
echo " with engine: ${ENGINE_MSG}"
|
|
echo " with sslhack: ${SSLHACK_MSG}"
|
|
echo "PC/SC support: ${PCSC_MSG}"
|
|
echo "OpenCT support: ${OPENCT_MSG}"
|
|
echo "Assuan support: ${ASSUAN_MSG}"
|
|
echo ""
|
|
|
|
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."
|
|
fi
|