|
# Process this file with autoconf to produce a configure script.
|
|
|
|
AC_PREREQ(2.60)
|
|
AC_INIT
|
|
AC_CANONICAL_BUILD
|
|
AC_CANONICAL_HOST
|
|
AC_CONFIG_SRCDIR([chipcard-config.in.in])
|
|
AC_CONFIG_HEADER([config.h])
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
#
|
|
# versions
|
|
#
|
|
|
|
CHIPCARD_VERSION_MAJOR=4
|
|
CHIPCARD_VERSION_MINOR=2
|
|
CHIPCARD_VERSION_PATCHLEVEL=6
|
|
CHIPCARD_VERSION_BUILD=0
|
|
CHIPCARD_VERSION_TAG="stable"
|
|
|
|
CHIPCARD_VERSION_FULL_STRING="$CHIPCARD_VERSION_MAJOR.$CHIPCARD_VERSION_MINOR.$CHIPCARD_VERSION_PATCHLEVEL.$CHIPCARD_VERSION_BUILD${CHIPCARD_VERSION_TAG}"
|
|
CHIPCARD_VERSION_STRING="$CHIPCARD_VERSION_MAJOR.$CHIPCARD_VERSION_MINOR.$CHIPCARD_VERSION_PATCHLEVEL"
|
|
|
|
#
|
|
# SO version
|
|
#
|
|
LIBCHIPCARD_SO_CURRENT=4
|
|
LIBCHIPCARD_SO_AGE=2
|
|
LIBCHIPCARD_SO_REVISION=6
|
|
LIBCHIPCARD_SO_EFFECTIVE="`echo \$(($LIBCHIPCARD_SO_CURRENT-$LIBCHIPCARD_SO_AGE))`"
|
|
|
|
#
|
|
# Create release string
|
|
#
|
|
|
|
case "$CHIPCARD_VERSION_TAG" in
|
|
svn)
|
|
rev=`LC_ALL="C" $SVN info|grep 'Last Changed Rev'|cut -d' ' -f4`
|
|
if test "x$rev" != "x" ; then
|
|
CHIPCARD_VERSION_RELEASE_STRING="$CHIPCARD_VERSION_MAJOR.$CHIPCARD_VERSION_MINOR.${CHIPCARD_VERSION_PATCHLEVEL}${CHIPCARD_VERSION_TAG}-r${rev}"
|
|
else
|
|
CHIPCARD_VERSION_RELEASE_STRING="$CHIPCARD_VERSION_FULL_STRING"
|
|
fi
|
|
;;
|
|
git|cvs)
|
|
CHIPCARD_VERSION_RELEASE_STRING="$CHIPCARD_VERSION_MAJOR.$CHIPCARD_VERSION_MINOR.${CHIPCARD_VERSION_PATCHLEVEL}${CHIPCARD_VERSION_TAG}-b${CHIPCARD_VERSION_BUILD}"
|
|
;;
|
|
stable)
|
|
CHIPCARD_VERSION_RELEASE_STRING="$CHIPCARD_VERSION_STRING"
|
|
;;
|
|
*)
|
|
CHIPCARD_VERSION_RELEASE_STRING="$CHIPCARD_VERSION_MAJOR.$CHIPCARD_VERSION_MINOR.${CHIPCARD_VERSION_PATCHLEVEL}${CHIPCARD_VERSION_TAG}"
|
|
;;
|
|
esac
|
|
|
|
|
|
|
|
AC_SUBST(CHIPCARD_VERSION_MAJOR)
|
|
AC_SUBST(CHIPCARD_VERSION_MINOR)
|
|
AC_SUBST(CHIPCARD_VERSION_PATCHLEVEL)
|
|
AC_SUBST(CHIPCARD_VERSION_BUILD)
|
|
AC_SUBST(CHIPCARD_VERSION_TAG)
|
|
AC_SUBST(CHIPCARD_VERSION_FULL_STRING)
|
|
AC_SUBST(CHIPCARD_VERSION_STRING)
|
|
AC_SUBST(CHIPCARD_VERSION_RELEASE_STRING)
|
|
|
|
AC_DEFINE_UNQUOTED(CHIPCARD_VERSION_MAJOR,$CHIPCARD_VERSION_MAJOR,
|
|
[major version])
|
|
AC_DEFINE_UNQUOTED(CHIPCARD_VERSION_MINOR,$CHIPCARD_VERSION_MINOR,
|
|
[minor version])
|
|
AC_DEFINE_UNQUOTED(CHIPCARD_VERSION_PATCHLEVEL,$CHIPCARD_VERSION_PATCHLEVEL,
|
|
[patchlevel])
|
|
AC_DEFINE_UNQUOTED(CHIPCARD_VERSION_BUILD,$CHIPCARD_VERSION_BUILD, [build])
|
|
AC_DEFINE_UNQUOTED(CHIPCARD_VERSION_STRING,"$CHIPCARD_VERSION_STRING",
|
|
[version string])
|
|
AC_DEFINE_UNQUOTED(CHIPCARD_VERSION_FULL_STRING,"$CHIPCARD_VERSION_FULL_STRING",
|
|
[full version string])
|
|
AC_DEFINE_UNQUOTED(CHIPCARD_VERSION_RELEASE_STRING,"$CHIPCARD_VERSION_RELEASE_STRING",
|
|
[release string])
|
|
AC_DEFINE_UNQUOTED(CHIPCARD_VERSION_TAG,$CHIPCARD_VERSION_TAG, [tag])
|
|
|
|
AC_SUBST(LIBCHIPCARD_SO_CURRENT)
|
|
AC_SUBST(LIBCHIPCARD_SO_REVISION)
|
|
AC_SUBST(LIBCHIPCARD_SO_AGE)
|
|
AC_SUBST(LIBCHIPCARD_SO_EFFECTIVE)
|
|
|
|
|
|
AM_INIT_AUTOMAKE(libchipcard, $CHIPCARD_VERSION_RELEASE_STRING)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# check for OS
|
|
#
|
|
|
|
AQ_CHECK_OS
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# prefix handling
|
|
#
|
|
|
|
AC_MSG_CHECKING(for installation prefix)
|
|
AC_PREFIX_DEFAULT(/usr)
|
|
if test "x$prefix" = "xNONE"; then
|
|
prefix=$ac_default_prefix
|
|
ac_configure_args="$ac_configure_args --prefix $prefix"
|
|
fi
|
|
AC_MSG_RESULT($prefix)
|
|
AC_SUBST(prefix)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# /etc/init.d cannot be written by ordinary users, but Martin wants to have
|
|
# this as default even for prefix != /usr (e.g. /usr/local), so we need an
|
|
# option to override it
|
|
#
|
|
AC_MSG_CHECKING(for init script directory)
|
|
AC_ARG_WITH(init-script-dir,
|
|
[ --with-init-script-dir=DIR directory to use instead of /etc/init.d (esp. for non-root installs)],
|
|
[lc_init_script_dir="$withval"],
|
|
[lc_init_script_dir="/etc/init.d"])
|
|
AC_SUBST(lc_init_script_dir)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
#
|
|
# static/shared handling
|
|
#
|
|
AC_ENABLE_STATIC(yes)
|
|
AC_ENABLE_SHARED(yes)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# Checks for programs.
|
|
AC_PROG_CC
|
|
AC_PROG_CXX
|
|
AC_PROG_INSTALL
|
|
AC_PROG_MAKE_SET
|
|
AC_LIBTOOL_WIN32_DLL
|
|
AC_LIBTOOL_RC
|
|
AC_PROG_LIBTOOL
|
|
AC_CHECK_PROG(SED,sed,sed)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# Checks for libraries.
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# Checks for header files.
|
|
|
|
AC_CHECK_HEADERS([unistd.h])
|
|
AC_CHECK_HEADERS([dlfcn.h])
|
|
AC_CHECK_HEADERS([signal.h])
|
|
AC_CHECK_HEADERS([time.h])
|
|
AC_CHECK_HEADERS([syslog.h])
|
|
AC_CHECK_HEADERS([sys/stat.h])
|
|
AC_CHECK_HEADERS([arpa/inet.h])
|
|
AC_CHECK_HEADERS([sys/types.h])
|
|
AC_CHECK_HEADERS([sys/wait.h])
|
|
AC_CHECK_HEADERS([sys/time.h])
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# Checks for library functions.
|
|
|
|
AC_CHECK_FUNCS(snprintf)
|
|
AC_CHECK_FUNCS(strcasecmp strncasecmp)
|
|
AC_CHECK_FUNCS(fork)
|
|
AC_CHECK_FUNCS(time)
|
|
AC_CHECK_FUNCS(getpid)
|
|
AC_CHECK_FUNCS(sigaction)
|
|
AC_CHECK_FUNCS(random)
|
|
AC_CHECK_FUNCS(wait)
|
|
AC_CHECK_FUNCS(chmod)
|
|
AC_CHECK_FUNCS(symlink)
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# check for endianness
|
|
#
|
|
|
|
AC_C_BIGENDIAN([aq_endian="big"], [aq_endian="little"])
|
|
if test "x$aq_endian" == "xlittle"; then
|
|
AC_DEFINE(LC_ENDIAN_LITTLE, 1, [if system is little endian])
|
|
elif test "x$aq_endian" == "xbig"; then
|
|
AC_DEFINE(LC_ENDIAN_BIG, 1, [if system is big endian])
|
|
elif test "x$aq_endian" == "xuniversal"; then
|
|
AC_DEFINE(LC_ENDIAN_BIG, 1, [if system is big endian])
|
|
else
|
|
AC_MSG_ERROR([Unknown endian type $aq_endian])
|
|
fi
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# check for Distribution
|
|
|
|
AQ_DISTRIBUTION
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
#
|
|
# HAL
|
|
#
|
|
|
|
AC_MSG_CHECKING(whether HAL support is wanted)
|
|
AC_ARG_ENABLE(hal,
|
|
[ --enable-hal add support for libHAL (default=auto)],
|
|
enable_hal="$enableval",
|
|
enable_hal="auto")
|
|
AC_MSG_RESULT($enable_hal)
|
|
|
|
if test "${enable_hal}" != "no"; then
|
|
pkg_modules="hal >= 0.5.0"
|
|
PKG_CHECK_MODULES(hal, [$pkg_modules], [have_hal="yes"], [have_hal="no"])
|
|
if test "$have_hal" = "yes"; then
|
|
AC_DEFINE(USE_HAL, 1, [if HAL is available])
|
|
hal_includes="$hal_CFLAGS"
|
|
hal_libs="$hal_LIBS"
|
|
enable_hal="yes"
|
|
else
|
|
if test "$enable_hal" == "yes"; then
|
|
AC_MSG_ERROR([
|
|
*** HAL not found even though it was requested.
|
|
*** Please install libhal and libhal-dev (or libhal-devel on some systems)
|
|
*** or don't use --enable-hal.])
|
|
else
|
|
enable_hal="no"
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
AC_SUBST(hal_libs)
|
|
AC_SUBST(hal_includes)
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# check for libsysfs as a fallback if HAL is not available
|
|
#
|
|
|
|
if test "${enable_hal}" != "yes"; then
|
|
AC_LIBSYSFS
|
|
if test "$have_libsysfs" == "yes" ; then
|
|
all_includes="$all_includes $libsysfs_includes"
|
|
all_libraries="$all_libraries $libsysfs_libs"
|
|
AC_DEFINE(USE_LIBSYSFS, 1, [whether libsysfs is to be used])
|
|
else
|
|
AC_MSG_WARN([
|
|
*** LibSysFS not found, and HAL support is not enabled.
|
|
*** Autoconfiguration of PCMCIA and UsbTTY devices will not be available.
|
|
*** If you are using those devices under Linux you really should consider
|
|
*** installing libSysFS or even better libHAL.])
|
|
fi
|
|
else
|
|
have_libsysfs="no"
|
|
fi
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# check for Gwenhywfar
|
|
#
|
|
|
|
AC_GWENHYWFAR(3,5,0,0)
|
|
|
|
all_includes="$all_includes $gwenhywfar_includes"
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# OS dependent settings
|
|
#
|
|
|
|
libchipcard_includes="-I\${prefix}/include"
|
|
libchipcardc_libs="-L\${libdir} -lchipcardc"
|
|
libchipcardi_libs="-L\${libdir} -lchipcardi"
|
|
|
|
case "$OS_TYPE" in
|
|
posix)
|
|
lc_sys_is_windows=0
|
|
|
|
lc_client_config_dir="\${sysconfdir}/chipcard/client"
|
|
lc_client_config_file="chipcardc.conf"
|
|
lc_client_def_cert_dir="\${sysconfdir}/chipcard/client/certs"
|
|
lc_client_def_newcert_dir="~/.libchipcard/certs"
|
|
lc_client_def_cert_file="~/.libchipcard/user.cert"
|
|
lc_client_xml_dir="\${datadir}/chipcard/client"
|
|
|
|
lc_server_config_dir="\${sysconfdir}/chipcard/server"
|
|
lc_server_data_dir="\${datadir}/chipcard/server"
|
|
lc_server_lowlevel_driver_dir="\${libdir}/chipcard/server/lowlevel"
|
|
lc_server_def_cert_dir="\${sysconfdir}/chipcard/server/certs"
|
|
lc_server_def_newcert_dir="\${localstatedir}/lib/chipcardd/newcerts"
|
|
lc_server_driver_dir="\${libdir}/chipcard/server/drivers"
|
|
lc_server_service_dir="\${libdir}/chipcard/server/services"
|
|
lc_server_log_dir="\${localstatedir}/log/chipcard"
|
|
lc_server_pid_dir="\${localstatedir}/run"
|
|
lc_server_def_dh_dir="\${sysconfdir}/chipcard/server/dh"
|
|
|
|
|
|
lc_dir_nonwindows_src="drivers services"
|
|
lc_dir_nonwindows_tools="chipcardd"
|
|
|
|
lc_os_driver_dir="posix"
|
|
;;
|
|
windows)
|
|
AC_DEFINE_UNQUOTED(BUILDING_LIBCHIPCARD2_DLL,1, [Define if DLL is built])
|
|
lc_sys_is_windows=1
|
|
|
|
lc_client_config_dir="\${sysconfdir}/chipcard/client"
|
|
lc_client_config_file="chipcardc.conf"
|
|
lc_client_def_cert_dir="\${sysconfdir}/chipcard/client/certs"
|
|
lc_client_def_newcert_dir="~/.libchipcard/certs"
|
|
lc_client_def_cert_file="~/.libchipcard/user.cert"
|
|
lc_client_xml_dir="\${datadir}/chipcard/client"
|
|
|
|
lc_server_config_dir="\${sysconfdir}/chipcard/server"
|
|
lc_server_data_dir="\${datadir}/chipcard/server"
|
|
lc_server_lowlevel_driver_dir="\${libdir}/chipcard/server/lowlevel"
|
|
lc_server_def_cert_dir="\${sysconfdir}/chipcard/server/certs"
|
|
lc_server_def_newcert_dir="\${localstatedir}/lib/chipcardd/newcerts"
|
|
lc_server_driver_dir="\${libdir}/chipcard/server/drivers"
|
|
lc_server_service_dir="\${libdir}/chipcard/server/services"
|
|
lc_server_log_dir="\${localstatedir}/log/chipcard"
|
|
lc_server_pid_dir="\${localstatedir}/run"
|
|
lc_server_def_dh_dir="\${sysconfdir}/chipcard/server/dh"
|
|
|
|
lc_os_driver_dir="win32"
|
|
;;
|
|
esac
|
|
|
|
AM_CONDITIONAL(IS_WINDOWS, [test "$OS_TYPE" = "windows"])
|
|
AC_SUBST(lc_sys_is_windows)
|
|
|
|
AC_SUBST(lc_client_config_dir)
|
|
AC_SUBST(lc_client_config_file)
|
|
AC_SUBST(lc_client_def_cert_dir)
|
|
AC_SUBST(lc_client_def_newcert_dir)
|
|
AC_SUBST(lc_client_def_cert_file)
|
|
AC_SUBST(lc_client_xml_dir)
|
|
|
|
AC_SUBST(lc_server_config_dir)
|
|
AC_SUBST(lc_server_data_dir)
|
|
AC_SUBST(lc_server_lowlevel_driver_dir)
|
|
AC_SUBST(lc_server_def_cert_dir)
|
|
AC_SUBST(lc_server_def_newcert_dir)
|
|
AC_SUBST(lc_server_driver_dir)
|
|
AC_SUBST(lc_server_service_dir)
|
|
|
|
AC_SUBST(lc_server_log_dir)
|
|
AC_SUBST(lc_server_pid_dir)
|
|
AC_SUBST(lc_server_def_dh_dir)
|
|
|
|
AC_SUBST(libchipcardd_libs)
|
|
AC_SUBST(libchipcardc_libs)
|
|
AC_SUBST(libchipcard_includes)
|
|
|
|
AC_SUBST(lc_dir_nonwindows_src)
|
|
AC_SUBST(lc_dir_nonwindows_tools)
|
|
|
|
AC_SUBST(lc_os_driver_dir)
|
|
|
|
AC_SUBST(all_includes)
|
|
AC_SUBST(all_libraries)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
#
|
|
# check whether local installation mode is enabled
|
|
#
|
|
|
|
AC_MSG_CHECKING(whether local installation mode is wanted)
|
|
AC_ARG_ENABLE(local-install,
|
|
[ --enable-local-install allow local installation mode (default=no)],
|
|
enable_local_install="$enableval",
|
|
enable_local_install="no")
|
|
AC_MSG_RESULT($enable_local_install)
|
|
|
|
if test "$enable_local_install" != "no"; then
|
|
AC_DEFINE(ENABLE_LOCAL_INSTALL, 1, [whether local install is wanted])
|
|
fi
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
#
|
|
# check whether lcc is a subproject to another one
|
|
#
|
|
|
|
AC_MSG_CHECKING(if lcc is a subproject)
|
|
AC_ARG_ENABLE(lcc-subproject,
|
|
[ --enable-lcc-subproject make libchipcard only a subproject (default=no)],
|
|
enable_lcc_subproject="$enableval",
|
|
enable_lcc_subproject="no")
|
|
AC_MSG_RESULT($enable_lcc_subproject)
|
|
|
|
if test "$enable_lcc_subproject" != "no"; then
|
|
AC_DEFINE(LIBCHIPCARD_IS_SUBPROJECT, 1, [whether lcc is a subproject])
|
|
fi
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
#
|
|
# check for plugin init
|
|
#
|
|
AC_MSG_CHECKING(if plugin init is wanted)
|
|
AC_ARG_ENABLE(init-plugins,
|
|
[ --enable-init-plugins enable plugin init (default=yes)],
|
|
enable_init_plugins="$enableval",
|
|
enable_init_plugins="yes")
|
|
AC_MSG_RESULT($enable_init_plugins)
|
|
|
|
if test "$enable_init_plugins" != "no"; then
|
|
AC_DEFINE(LC_ENABLE_INIT_PLUGINS, 1, [if plugin init is wanted])
|
|
fi
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
#
|
|
# check data search dir
|
|
#
|
|
AC_MSG_CHECKING(data search dir)
|
|
AC_ARG_WITH(data-searchdir, [ --with-data-searchdir=DIR where to search for data files],
|
|
[lc_data_searchdir="$withval"],
|
|
[lc_data_searchdir=""])
|
|
|
|
if test -z "${lc_data_searchdir}"; then
|
|
if test "$OSYSTEM" = "windows"; then
|
|
lc_data_searchdir="share/chipcard/client"
|
|
else
|
|
if test "$enable_local_install" != "no"; then
|
|
lc_data_searchdir="share/chipcard/client"
|
|
else
|
|
lc_data_searchdir="$lc_client_xml_dir"
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
AC_SUBST(lc_data_searchdir)
|
|
AC_MSG_RESULT($lc_data_searchdir)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
#
|
|
# check locale search dir
|
|
#
|
|
AC_MSG_CHECKING(locale search dir)
|
|
AC_ARG_WITH(locale-searchdir, [ --with-locale-searchdir=DIR where to search for locale files],
|
|
[lc_locale_searchdir="$withval"],
|
|
[lc_locale_searchdir=""])
|
|
|
|
if test -z "${lc_locale_searchdir}"; then
|
|
if test "$OSYSTEM" = "windows"; then
|
|
lc_locale_searchdir="share/locale"
|
|
else
|
|
if test "$enable_local_install" != "no"; then
|
|
lc_locale_searchdir="share/locale"
|
|
else
|
|
lc_locale_searchdir="\$(localedir)"
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
AC_SUBST(lc_locale_searchdir)
|
|
AC_MSG_RESULT($lc_locale_searchdir)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
#
|
|
# check cfg search dir
|
|
#
|
|
AC_MSG_CHECKING(cfg search dir)
|
|
AC_ARG_WITH(cfg-searchdir, [ --with-cfg-searchdir=DIR where to search for cfg files],
|
|
[lc_cfg_searchdir="$withval"],
|
|
[lc_cfg_searchdir=""])
|
|
|
|
if test -z "$lc_cfg_searchdir"; then
|
|
if test "$OSYSTEM" = "windows"; then
|
|
lc_cfg_searchdir="etc/chipcard/client"
|
|
else
|
|
if test "$enable_local_install" != "no"; then
|
|
lc_cfg_searchdir="etc/chipcard/client"
|
|
else
|
|
lc_cfg_searchdir="$lc_client_config_dir"
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
|
|
AC_SUBST(lc_cfg_searchdir)
|
|
AC_MSG_RESULT($lc_cfg_searchdir)
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# check for PC/SC
|
|
#
|
|
|
|
if test "$OS_TYPE" != "windows"; then
|
|
AC_CHECK_LIB(pcsclite, SCardDisconnect, [pcsc_libs="-lpcsclite"])
|
|
AC_MSG_CHECKING(whether PC/SC is to be used)
|
|
if test -z "$pcsc_libs"; then
|
|
AC_MSG_WARN(No pcsc libraries found, SCard driver will not be available.)
|
|
lc_pcsc_io_dir=""
|
|
have_pcsc="no"
|
|
else
|
|
AC_DEFINE(HAVE_PCSC, 1, [whether PC/SC is to be used])
|
|
lc_pcsc_io_dir="pcsc"
|
|
have_pcsc="yes"
|
|
AC_MSG_RESULT(yes)
|
|
fi
|
|
else
|
|
AC_MSG_CHECKING(whether PC/SC is to be used)
|
|
AC_DEFINE(HAVE_PCSC, 1, [whether PC/SC is to be used])
|
|
lc_pcsc_io_dir="pcsc"
|
|
have_pcsc="yes"
|
|
AC_MSG_RESULT([yes, using SCard])
|
|
fi
|
|
AM_CONDITIONAL(USE_PCSC, [test "$have_pcsc" = "yes"])
|
|
AC_SUBST(lc_pcsc_io_dir)
|
|
AC_SUBST(pcsc_libs)
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# check for zlib
|
|
# (actually we assume that it is present)
|
|
#
|
|
zlib_libs="-lz"
|
|
AC_SUBST(zlib_libs)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# check for release
|
|
#
|
|
AC_MSG_CHECKING(whether this is an official release)
|
|
AC_ARG_ENABLE(release,
|
|
[ --enable-release make this an official release (default=no)],
|
|
[ case "${enableval}" in
|
|
yes) enable_release="yes";;
|
|
no) enable_release="no";;
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-release);;
|
|
esac
|
|
],
|
|
enable_release="no")
|
|
|
|
if test "$enable_release" = "yes"; then
|
|
STRIPALL="-s"
|
|
else
|
|
STRIPALL=""
|
|
fi
|
|
AC_SUBST(STRIPALL)
|
|
AC_MSG_RESULT($enable_release)
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
#
|
|
# check docpath
|
|
#
|
|
AC_MSG_CHECKING(docpath)
|
|
AC_ARG_WITH(docpath, [ --with-docpath=DIR where to store the apidoc],
|
|
[docpath="$withval"],
|
|
[docpath="${HOME}/apidoc"])
|
|
AC_SUBST(docpath)
|
|
AC_MSG_RESULT($docpath)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# check for doc type
|
|
#
|
|
AC_MSG_CHECKING(if full docu should be created)
|
|
AC_ARG_ENABLE(full-doc,
|
|
[ --enable-full-doc enable creating full apidoc (default=no)],
|
|
[ case "${enableval}" in
|
|
yes) enable_fulldoc="yes";;
|
|
no) enable_fulldoc="no";;
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-full-doc);;
|
|
esac
|
|
],
|
|
enable_fulldoc="no")
|
|
|
|
if test "$enable_fulldoc" = "yes"; then
|
|
DOXYGEN_INPUT="src/lib"
|
|
DOXYGEN_DEFINE=""
|
|
else
|
|
DOXYGEN_INPUT="chipcard"
|
|
DOXYGEN_DEFINE="DOXYGEN_HIDE"
|
|
fi
|
|
AC_SUBST(DOXYGEN_INPUT)
|
|
AC_SUBST(DOXYGEN_DEFINE)
|
|
AC_MSG_RESULT($enable_fulldoc)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# GCC version (check for usability)
|
|
#
|
|
|
|
AC_MSG_CHECKING(if symbol visibility is supported)
|
|
visibility_cflags=""
|
|
case `basename $CC` in
|
|
gcc*)
|
|
dnl Determine version number (watch out: the outside square
|
|
dnl parenteses are vitally important here!)
|
|
gccversion=["` ${CC} --version | head -1 | ${SED} 's/.*\([0-9]\.[0-9]\.[0-9]*\).*/\1/' `"]
|
|
case $gccversion in
|
|
4.*)
|
|
# Activate -fvisibility=hidden only for explicit 4.x gcc
|
|
# versions. We never now what future gcc's might do with
|
|
# that argument, and we also can't be sure that other
|
|
# gcc's happen to show very weird version
|
|
# numbers. Therefore leave the default at non-activated.
|
|
visibility_supported="yes, gcc-${gccversion}"
|
|
AC_DEFINE(GCC_WITH_VISIBILITY_ATTRIBUTE, 1, [visibility])
|
|
visibility_cflags="-fvisibility=hidden"
|
|
;;
|
|
*)
|
|
# Default: -fvisibility=hidden not activated.
|
|
visibility_supported="no (needs gcc >=4.0, you have gcc-${gccversion})"
|
|
;;
|
|
esac
|
|
;;
|
|
*)
|
|
visibility_supported="no (needs gcc >=4.0, you use $CC)"
|
|
;;
|
|
esac
|
|
|
|
# -fvisibility is at least not available on MinGW/gcc-3.4.4 (will
|
|
# give an "unrecognized cmdline option"). Also, unfortunately I
|
|
# don't know an easy way to ask the compiler here. Maybe
|
|
# http://autoconf-archive.cryp.to/ax_cflags_gcc_option.html
|
|
case "$OS_TYPE" in
|
|
windows)
|
|
visibility_supported="no (not yet on MinGW/Windows)"
|
|
visibility_cflags=""
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|
|
|
|
AC_MSG_RESULT(${visibility_supported})
|
|
AC_SUBST(visibility_cflags)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# search for tag files
|
|
#
|
|
|
|
AC_MSG_CHECKING(doxygen tag files)
|
|
DOXYGEN_TAGFILES=""
|
|
if test -d "${docpath}"; then
|
|
DOXYGEN_TAGFILES="`cd ${docpath} && ls *.tag`"
|
|
if test -n "${DOXYGEN_TAGFILES}"; then
|
|
DOXYGEN_TAGFILES="`echo ${DOXYGEN_TAGFILES} | ${SED} -e s/${PACKAGE}.tag//`"
|
|
fi
|
|
realfiles=""
|
|
for ff in ${DOXYGEN_TAGFILES}; do
|
|
realfiles="${realfiles} ${docpath}/${ff}"
|
|
done
|
|
DOXYGEN_TAGFILES="${realfiles}"
|
|
fi
|
|
if test -z "${DOXYGEN_TAGFILES}"; then
|
|
AC_MSG_RESULT(none)
|
|
else
|
|
AC_MSG_RESULT(found)
|
|
fi
|
|
AC_SUBST(DOXYGEN_TAGFILES)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# Search for gettext
|
|
#
|
|
|
|
AC_CHECK_HEADERS([libintl.h],[have_libintl_h=yes],[have_libintl_h=no])
|
|
LIBS=""
|
|
I18N_CATALOG=""
|
|
AC_CHECK_PROGS(XGETTEXT, xgettext, missing)
|
|
if test "$XGETTEXT" != "missing"; then
|
|
AC_SEARCH_LIBS(gettext,intl c,[have_gettext_fn=yes], [have_gettext_fn=no])
|
|
i18n_library=$LIBS
|
|
LIBS=""
|
|
AC_MSG_CHECKING(for working i18n environment)
|
|
if test "$have_libintl_h" = "yes" -a "$have_gettext_fn" = "yes" -a "$XGETTEXT" != "missing"; then
|
|
I18N_PATH="`eval echo $prefix/share`/locale"
|
|
AC_DEFINE_UNQUOTED(I18N_PATH,"$I18N_PATH",[Path for locales])
|
|
AC_DEFINE(HAVE_GETTEXT_ENVIRONMENT,1,[if gettext is available])
|
|
I18N_CATALOG="catalog"
|
|
AC_MSG_RESULT(yes)
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
fi
|
|
fi
|
|
AC_SUBST(I18N_CATALOG)
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# check for MEMTRACE
|
|
#
|
|
|
|
AC_MSG_CHECKING(if MEMTRACE is wanted)
|
|
AC_ARG_ENABLE(memtrace,
|
|
[ --enable-memtrace enable memory trace (default=no)],
|
|
enable_memtrace="$enableval",
|
|
enable_memtrace="no")
|
|
AC_MSG_RESULT($enable_memtrace)
|
|
|
|
if test "$enable_memtrace" != "no"; then
|
|
AC_DEFINE(GWEN_MEMORY_DEBUG, 1, [if memory debugging is wanted])
|
|
fi
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# Create output files
|
|
#
|
|
|
|
AC_CONFIG_FILES([Makefile
|
|
chipcard-config.in
|
|
Doxyfile
|
|
libchipcard.spec
|
|
bin/Makefile
|
|
data/Makefile
|
|
data/drivers/Makefile
|
|
data/drivers/posix/Makefile
|
|
data/drivers/posix/ccid_ifd/Makefile
|
|
data/drivers/posix/ccid_serial_ifd/Makefile
|
|
data/drivers/posix/cherry_ctapi/Makefile
|
|
data/drivers/posix/cyberjack_ctapi/Makefile
|
|
data/drivers/posix/kobil_ctapi/Makefile
|
|
data/drivers/posix/omnikey_ifd/Makefile
|
|
data/drivers/posix/omnikey_ifd/cm_2020_ifd/Makefile
|
|
data/drivers/posix/omnikey_ifd/cm_4000_ifd/Makefile
|
|
data/drivers/posix/orga_ctapi/Makefile
|
|
data/drivers/posix/scmx32_ifd/Makefile
|
|
data/drivers/posix/scm33x_ifd/Makefile
|
|
data/drivers/posix/tow_ctapi/Makefile
|
|
data/drivers/posix/o2micro_ctapi/Makefile
|
|
data/drivers/posix/celectronic_ctapi/Makefile
|
|
data/drivers/win32/Makefile
|
|
data/drivers/win32/cyberjack_ctapi/Makefile
|
|
doc/Makefile
|
|
etc/Makefile
|
|
src/Makefile
|
|
src/lib/Makefile
|
|
src/lib/version.h
|
|
src/lib/chipcard.h
|
|
src/lib/sharedstuff/Makefile
|
|
src/lib/client/Makefile
|
|
src/lib/client/ressource.rc
|
|
src/lib/client/base/Makefile
|
|
src/lib/client/io/Makefile
|
|
src/lib/client/io/lcc/Makefile
|
|
src/lib/client/io/pcsc/Makefile
|
|
src/lib/client/cards/Makefile
|
|
src/lib/client/cards/ddvcard/Makefile
|
|
src/lib/client/cards/egkcard/Makefile
|
|
src/lib/client/cards/geldkarte/Makefile
|
|
src/lib/client/cards/memorycard/Makefile
|
|
src/lib/client/cards/kvkcard/Makefile
|
|
src/lib/client/cards/processorcard/Makefile
|
|
src/lib/client/cards/starcos/Makefile
|
|
src/lib/client/mon/Makefile
|
|
src/lib/client/ct/Makefile
|
|
src/lib/client/service/Makefile
|
|
src/lib/server/Makefile
|
|
src/lib/server/ressource.rc
|
|
src/lib/server/common/Makefile
|
|
src/lib/server/driver/Makefile
|
|
src/lib/server/server/Makefile
|
|
src/lib/server/server/devicemanager/Makefile
|
|
src/lib/server/server/cardmanager/Makefile
|
|
src/lib/server/server/clientmanager/Makefile
|
|
src/lib/server/server/servicemanager/Makefile
|
|
src/lib/server/server/slavemanager/Makefile
|
|
src/ct/Makefile
|
|
src/ct/ddvcard/Makefile
|
|
src/ct/ddvcard/ddvcard.xml
|
|
src/ct/starcoscard/Makefile
|
|
src/ct/starcoscard/starcoscard.xml
|
|
src/drivers/Makefile
|
|
src/drivers/ctapi/Makefile
|
|
src/drivers/ctapi/ctapi.xml
|
|
src/drivers/ifd/Makefile
|
|
src/drivers/ifd/ifd.xml
|
|
src/drivers/skeleton/Makefile
|
|
src/drivers/skeleton/SKEL1.xml
|
|
src/fake_ctapi/Makefile
|
|
src/fake_ctapi/ressource.rc
|
|
src/tools/Makefile
|
|
src/tools/chipcardd/Makefile
|
|
src/tools/geldkarte/Makefile
|
|
src/tools/memcard/Makefile
|
|
src/tools/chipcard-tool/Makefile
|
|
src/tools/kvkcard/Makefile
|
|
src/tools/cardcommander/Makefile
|
|
src/services/Makefile
|
|
src/services/kvks/Makefile
|
|
src/services/kvks/kvks.xml
|
|
tutorials/Makefile
|
|
m4/Makefile
|
|
])
|
|
AC_OUTPUT
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# create header directory for all, make symlinks
|
|
#
|
|
|
|
rm -Rf chipcard
|
|
mkdir chipcard
|
|
|
|
# These two headers here are generated and hence reside in builddir,
|
|
# not in srcdir!
|
|
lprefix=`pwd`
|
|
AQ_HEADER_FILES="${lprefix}/src/lib/version.h ${lprefix}/src/lib/chipcard.h"
|
|
ln -s "${lprefix}/src/lib/version.h" chipcard/version.h
|
|
ln -s "${lprefix}/src/lib/chipcard.h" chipcard/chipcard.h
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# create header directory for server, make symlinks
|
|
#
|
|
|
|
lprefix="${srcdir}"
|
|
lprefix=`( cd ${lprefix} ; pwd )`
|
|
|
|
# symlink all headers from src/lib/sharedstuff/*
|
|
mkdir chipcard/sharedstuff
|
|
hfiles=`( cd "${srcdir}/src/lib/sharedstuff" && ls *.h 2>/dev/null )`
|
|
for f in ${hfiles}; do
|
|
AQ_HEADER_FILES="${AQ_HEADER_FILES} ${lprefix}/src/lib/sharedstuff/${f}"
|
|
case ${f} in
|
|
*_p.h)
|
|
;;
|
|
*_l.h)
|
|
;;
|
|
*)
|
|
ln -s "${lprefix}/src/lib//sharedstuff/${f}" "chipcard/sharedstuff/${f}"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# create header directory for client, make symlinks
|
|
#
|
|
|
|
lc_modules="io cards ct mon service"
|
|
#client cards mon fs
|
|
lc_client_io_modules="lcc pcsc"
|
|
|
|
lc_client_card_modules="ddvcard egkcard geldkarte kvkcard starcos memorycard processorcard"
|
|
|
|
|
|
lprefix="${srcdir}"
|
|
lprefix=`( cd ${lprefix} ; pwd )`
|
|
|
|
rm -Rf chipcard/client
|
|
mkdir chipcard/client
|
|
|
|
# symlink all headers from src/lib/client
|
|
hfiles=`( cd "${srcdir}/src/lib/client" && ls *.h 2>/dev/null )`
|
|
for f in ${hfiles}; do
|
|
AQ_HEADER_FILES="${AQ_HEADER_FILES} ${lprefix}/src/lib/client/${f}"
|
|
case ${f} in
|
|
*_p.h | *version.h | *chipcard.h)
|
|
;;
|
|
*)
|
|
ln -s "${lprefix}/src/lib/client/${f}" "chipcard/client/${f}"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
|
|
# symlink all headers from src/lib/client/base
|
|
hfiles=`( cd "${srcdir}/src/lib/client/base" && ls *.h 2>/dev/null )`
|
|
for f in ${hfiles}; do
|
|
AQ_HEADER_FILES="${AQ_HEADER_FILES} ${lprefix}/src/lib/client/base/${f}"
|
|
case ${f} in
|
|
*_p.h | *_l.h)
|
|
;;
|
|
*)
|
|
ln -s "${lprefix}/src/lib/client/base/${f}" "chipcard/client/${f}"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
|
|
# symlink all headers from src/lib/client/*
|
|
for sm in $lc_modules; do
|
|
mkdir chipcard/client/${sm}
|
|
hfiles=`( cd "${srcdir}/src/lib/client/${sm}" && ls *.h 2>/dev/null )`
|
|
for f in ${hfiles}; do
|
|
AQ_HEADER_FILES="${AQ_HEADER_FILES} ${lprefix}/src/lib/client/${sm}/${f}"
|
|
case ${f} in
|
|
*_p.h | *_l.h)
|
|
;;
|
|
*)
|
|
ln -s "${lprefix}/src/lib/client/${sm}/${f}" "chipcard/client/${sm}/${f}"
|
|
;;
|
|
esac
|
|
done
|
|
done
|
|
|
|
|
|
# symlink all headers from src/lib/client/io/*
|
|
for sm in $lc_client_io_modules; do
|
|
mkdir chipcard/client/io/${sm}
|
|
hfiles=`( cd "${srcdir}/src/lib/client/io/${sm}" && ls *.h 2>/dev/null )`
|
|
for f in ${hfiles}; do
|
|
AQ_HEADER_FILES="${AQ_HEADER_FILES} ${lprefix}/src/lib/client/io/${sm}/${f}"
|
|
case ${f} in
|
|
*_p.h | *_l.h)
|
|
;;
|
|
*)
|
|
ln -s "${lprefix}/src/lib/client/io/${sm}/${f}" "chipcard/client/io/${sm}/${f}"
|
|
;;
|
|
esac
|
|
done
|
|
done
|
|
|
|
|
|
# symlink all headers from src/lib/client/cards/*
|
|
for sm in $lc_client_card_modules; do
|
|
hfiles=`( cd "${srcdir}/src/lib/client/cards/${sm}" && ls *.h 2>/dev/null )`
|
|
for f in ${hfiles}; do
|
|
AQ_HEADER_FILES="${AQ_HEADER_FILES} ${lprefix}/src/lib/client/cards/${f}"
|
|
case ${f} in
|
|
*_p.h | *_l.h)
|
|
;;
|
|
*)
|
|
ln -s "${lprefix}/src/lib/client/cards/${sm}/${f}" "chipcard/client/cards/${f}"
|
|
;;
|
|
esac
|
|
done
|
|
done
|
|
|
|
|
|
# symlink all headers from src/lib/server/driver/*
|
|
mkdir -p chipcard/server/driver
|
|
hfiles=`( cd "${srcdir}/src/lib/server/driver" && ls *.h 2>/dev/null )`
|
|
for f in ${hfiles}; do
|
|
AQ_HEADER_FILES="${AQ_HEADER_FILES} ${lprefix}/src/lib/server/driver/${f}"
|
|
case ${f} in
|
|
*_p.h | *_l.h)
|
|
;;
|
|
*)
|
|
ln -s "${lprefix}/src/lib/server/driver/${f}" "chipcard/server/driver/${f}"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
|
|
|
|
###-------------------------------------------------------------------------
|
|
# Summary
|
|
#
|
|
|
|
echo
|
|
echo "Summary:"
|
|
echo "================================="
|
|
echo "Libchipcard version : $CHIPCARD_VERSION_FULL_STRING"
|
|
echo "System : $OSYSTEM"
|
|
echo "Support for LibSysFS : $have_libsysfs"
|
|
echo "Support for HAL : $have_hal"
|
|
echo "Cfg Installation Folder : $lc_client_config_dir"
|
|
echo "Cfg Search Folder : $lc_cfg_searchdir"
|
|
echo "Data Installation Folder: $lc_client_xml_dir"
|
|
echo "Data Search Folder : $lc_data_searchdir"
|
|
echo "Local Installation Mode : $enable_local_install"
|
|
if test "$OS_TYPE" != "windows"; then
|
|
if test "$have_hal" != "yes" ; then
|
|
echo ""
|
|
echo "HINT: You really should install libhal (including"
|
|
echo "development packages), this will make Libchipcard much more usefull."
|
|
echo "Otherwise autodetection of readers is not fully available."
|
|
fi
|
|
fi
|
|
echo ""
|
|
echo "You can now build Libchipcard with 'make' (on *BSD use 'gmake')."
|
|
|
|
|