# $Id$ # # BEGIN COPYRIGHT BLOCK # Copyright (C) 2005 Red Hat, Inc. # All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation version # 2.1 of the License. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # END COPYRIGHT BLOCK # Require autoconf 2.52 AC_PREREQ(2.52) # Process this file with autoconf to produce a configure script. AC_INIT(coolkey,"1.1.0") AC_CONFIG_SRCDIR([src/coolkey/coolkey.cpp]) AC_CANONICAL_TARGET([]) AM_INIT_AUTOMAKE(coolkey, "1.1.0") AC_CONFIG_HEADERS([config.h]) AM_MAINTAINER_MODE # Add argument for debuging AC_ARG_ENABLE(debug, [ --enable-debug add debugging code (default=yes)]) if test "$enable_debug" = "no" -o "$enable_debug" = "false" then AC_MSG_WARN([Debugging support is completely disabled!]) else AC_DEFINE(DEBUG, 1, [Define to 1 if you want to include debugging code.]) fi # # ./config does a poor job of dealing with native OS stuff other than # unix, detect Windows and mac and do something a little more OS # friendly WINDOWS=0 MAC=0 UNIX=0 AC_MSG_CHECKING([platform type: ]) case "$host" in *-*-win*|*-*-cygwin*) AC_MSG_RESULT([Windows]) WINDOWS=1 ZLIB_CFLAGS=-I${ZLIB_INCLUDE} ZLIB_LIBS=${ZLIB_LIB}/zdll.dll #OS_FLAGS=`echo $INCLUDE | tr '[[:upper:]]' '[[:lower:]]' | sed -e 's;\\\\;/;g' -e 's;.:;/cygdrive/&/;g' -e 's;:;;g' -e 's;//;/;g' -e 's/;/\" -I\"/g' -e 's;^;-I\";' -e 's;$;\";'` CPPFLAGS="$CPPFLAGS $OS_FLAGS -DWIN32" LDFLAGS="$LDFLAGS" AC_MSG_WARN([changing CPPFLAGS = $CPPFLAGS ] ); SCARD_LIB_NAME="winscard.dll" # override config defaults for windows CC=cl CXX=cl CXXFLAGS="$CXXFLAGS /EHsc" # # Sigh, prevents us from overriding it with --libdir= in the config * line, but we can still override it in the make line. # libdir=`cygpath ${WINDIR}/system32` ;; *-*-darwin*) AC_MSG_RESULT([MAC]) MAC=1 SCARD_LIB_NAME="PCSC.Framework/PCSC" PCSC_MSG=yes PCSC_CFLAGS="-I/System/Library/Frameworks/PCSC.framework/Versions/Current/Headers" PCSC_LIBS="-Wl,-framework,PCSC" CFLAGS="-DMAC -I/System/Library/Frameworks/Security.framework/Versions/Current/Headers -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386" LDFLAGS="-L/System/Library/Frameworks/Security.framework/Versions/Current/Security -arch ppc -arch i386" CXXFLAGS="-DMAC -I/System/Library/Frameworks/Security.framework/Versions/Current/Headers -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386" ;; *) AC_MSG_RESULT([UNIX/LINUX]) UNIX=1 # should look it up on the local system SCARD_LIB_NAME="libpcsclite.so.1" ;; esac # Checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_LIBTOOL AC_PROG_INSTALL AC_PROG_LN_S # Checks for libraries. if test $WINDOWS -ne 1; then AC_CHECK_LIB(z, uncompress, , AC_MSG_ERROR(could not locate libz compression library)) AC_CHECK_LIB(dl, dlopen, , AC_MSG_ERROR(could not locate dynamic library services library)) fi # add our compiled static libraries AC_SUBST(LIBCKYAPPLET) LIBCKYAPPLET="\${top_builddir}/src/libckyapplet/libckyapplet.la" PKG_CHECK_MODULES(PCSC, libpcsclite, true, [ if $UNIX -eq 1 ; then AC_MSG_ERROR([could not find pcsc-lite libraries]) else AC_MSG_WARN([pcsc-lite not found]) fi ]) # Add argument for pk11install AC_ARG_ENABLE(pk11install, [ --enable-pk11install build an installer for legacy user apps(default=no)]) if test "$enable_pk11install" = "yes" -o "$enable_pk11install" = "true" then if test $WINDOWS -ne 1; then PKG_CHECK_MODULES(NSS, nss, true, [ AC_MSG_ERROR(could not find NSS Crypto libraries) ]) fi enable_pk11install="yes" else enable_pk11install="no" AC_MSG_WARN([skipping pk11install]) fi AC_SUBST(NSS_CFLAGS) AC_SUBST(ZLIB_CFLAGS) AC_SUBST(ZLIB_LIBS) AC_SUBST(PCSC_CFLAGS) AC_SUBST(PCSC_LIBS) AC_SUBST(SCARD_LIB_NAME) AM_CONDITIONAL(HAVE_PCSC, test x$with_pcsclite = xyes) AM_CONDITIONAL(BUILD_PK11INSTALL, test x$enable_pk11install = xyes) AM_CONDITIONAL(IS_WINDOWS, test $WINDOWS -eq 1) AC_DEFINE(DEBUG, 1, [Define to 1 if you want to include debugging code.]) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([string.h syslog.h fcntl.h unistd.h]) AC_CHECK_HEADERS([zlib.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC AC_FUNC_STAT AC_FUNC_VPRINTF AC_CHECK_FUNCS([memset strdup strerror]) AC_CONFIG_FILES([ Makefile src/libckyapplet/Makefile src/libckyapplet/libckyapplet.pc src/coolkey/Makefile src/install/Makefile ]) AC_OUTPUT