dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) AC_INIT AC_PREFIX_DEFAULT(/usr/local) AC_CANONICAL_TARGET([]) AC_DEFINE_UNQUOTED(T_CPU, "$target_cpu", [CPU name]) AC_DEFINE_UNQUOTED(T_VENDOR, "$target_vendor", [Vendor name]) AC_DEFINE_UNQUOTED(T_OS, "$target_os", [OS name]) dnl Gnutls Version GNUTLS_MAJOR_VERSION=0 GNUTLS_MINOR_VERSION=9 GNUTLS_MICRO_VERSION=1 GNUTLS_VERSION=$GNUTLS_MAJOR_VERSION.$GNUTLS_MINOR_VERSION.$GNUTLS_MICRO_VERSION AC_DEFINE_UNQUOTED(GNUTLS_VERSION, "$GNUTLS_VERSION", [version of gnutls]) AM_INIT_AUTOMAKE(gnutls, $GNUTLS_VERSION, [version of gnutls]) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE dnl This is the library version GNUTLS_MOST_RECENT_INTERFACE=6 GNUTLS_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER=$GNUTLS_MICRO_VERSION GNUTLS_OLDEST_INTERFACE=6 AC_SUBST(GNUTLS_MAJOR_VERSION) AC_SUBST(GNUTLS_MINOR_VERSION) AC_SUBST(GNUTLS_MICRO_VERSION) AC_SUBST(GNUTLS_VERSION) AC_SUBST(GNUTLS_MOST_RECENT_INTERFACE) AC_SUBST(GNUTLS_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER) AC_SUBST(GNUTLS_OLDEST_INTERFACE) LT_CURRENT=$GNUTLS_MOST_RECENT_INTERFACE LT_REVISION=$GNUTLS_CURRENT_INTERFACE_IMPLEMENTATION_NUMBER LT_AGE=`expr $GNUTLS_MOST_RECENT_INTERFACE - $GNUTLS_OLDEST_INTERFACE` AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) opt_dmalloc_mode=no AC_MSG_CHECKING([whether in dmalloc mode]) AC_ARG_ENABLE(dmalloc-mode, [ --enable-dmalloc-mode enable dmalloc mode], opt_dmalloc_mode=$enableval) AC_MSG_RESULT($opt_dmalloc_mode) opt_efence_mode=no AC_MSG_CHECKING([whether in electric fence mode]) AC_ARG_ENABLE(efence-mode, [ --enable-efence-mode enable electric fence mode], opt_efence_mode=$enableval) AC_MSG_RESULT($opt_efence_mode) opt_developer_mode=no AC_MSG_CHECKING([whether in maintanance mode]) AC_ARG_ENABLE(developer-mode, [ --enable-developer-mode enable developer mode], opt_developer_mode=$enableval) AC_MSG_RESULT($opt_developer_mode) opt_profiler_mode=no AC_MSG_CHECKING([whether in profile mode]) AC_ARG_ENABLE(profile-mode, [ --enable-profile-mode enable profiler], opt_profiler_mode=$enableval) AC_MSG_RESULT($opt_profiler_mode) AC_MSG_RESULT([*** *** Checking for compilation programs... ]) AC_PROG_CC AC_PROG_LN_S dnl Checks for programs. AC_PROG_INSTALL dnl AC_PROG_MAKE_SET AC_MSG_RESULT([*** *** Detecting compiler options... ]) AC_C_CONST AC_C_INLINE AC_MSG_CHECKING([whether C99 macros are supported]) AC_TRY_COMPILE(,[ #define test_mac(...) int z,y,x; test_mac(x,y,z); return 0; ], dnl ***** OK AC_DEFINE(C99_MACROS, 1, [C99 macros are supported]) AC_MSG_RESULT(yes), dnl ***** NOT FOUND AC_MSG_RESULT(no) AC_MSG_WARN([C99 macros are not supported by your compiler. This may affect compiling.]) ) if test $ac_cv_c_compiler_gnu != no; then if test x$opt_developer_mode = xyes; then CFLAGS="${CFLAGS} -Wall -Wcast-align -W -Wpointer-arith -Wchar-subscripts -Wformat-security -Wmissing-braces -Wsign-compare -Winline -Wstrict-prototypes" else CFLAGS="${CFLAGS} -O2 -finline-functions" fi if test x$opt_dmalloc_mode = xyes; then AC_CHECK_LIB( dmalloc, main) AC_DEFINE(USE_DMALLOC, 1, [enable the use of dmalloc]) else if test x$opt_efence_mode = xyes; then AC_CHECK_LIB( efence, main) AC_DEFINE(USE_EFENCE, 1, [use electric fence]) fi fi AC_MSG_CHECKING([whether we have GNU assembler]) GAS=`as --version < /dev/null 2>/dev/null | grep GNU` if test "$GAS"; then CFLAGS="${CFLAGS} -pipe" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi fi AC_MSG_RESULT([*** *** Detecting C library capabilities... ]) AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS(unistd.h pwd.h strings.h stdarg.h) AC_CHECK_HEADERS(sys/stat.h sys/types.h sys/socket.h) AC_CHECK_HEADERS(errno.h sys/time.h time.h) AC_CHECK_FUNCS(bzero memset memmove bcopy strnstr memcmp memcpy mmap,,) AC_FUNC_ALLOCA AC_MSG_RESULT([*** *** Detecting system's parameters... ]) AC_CHECK_SIZEOF(unsigned long, 4) AC_CHECK_SIZEOF(unsigned int, 4) AC_CHECK_SIZEOF(unsigned short, 2) AC_CHECK_SIZEOF(unsigned char, 1) AC_CHECK_SIZEOF(unsigned char*, 4) AC_CHECK_TYPES(ptrdiff_t,,, [ # include ]) AC_CHECK_TYPES(uint,,, [ # include ]) AC_CHECK_TYPE(size_t, DEFINE_SIZE_T="#include " AC_SUBST( DEFINE_SIZE_T) , AC_DEFINE(NO_SIZE_T, 1, [no size_t type was found]) DEFINE_SIZE_T="typedef unsigned int size_t; typedef int ssize_t;" AC_SUBST( DEFINE_SIZE_T) ,[ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif ]) AC_CHECK_TYPE(time_t, DEFINE_TIME_T="#include " AC_SUBST( DEFINE_TIME_T) , AC_CHECK_TYPE(time_t, DEFINE_TIME_T="#include " AC_SUBST( DEFINE_TIME_T) , DEFINE_TIME_T="typedef unsigned int time_t;" AC_SUBST( DEFINE_TIME_T) AC_DEFINE(NO_TIME_T, 1, [no time_t type was found]), [ #include ] ) , [ #include ] ) AC_C_BIGENDIAN AC_MSG_RESULT([*** *** Checking for external libraries... ]) AM_PATH_LIBGCRYPT(1.1.12,, AC_MSG_ERROR([[ *** *** libgcrypt was not found. You may want to get it from *** ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/ *** ]])) dnl Can't disable - gnutls depends on gcrypt AC_DEFINE(USE_GCRYPT, 1, [use gcrypt]) AC_MSG_CHECKING([whether to disable SRP authentication support]) AC_ARG_ENABLE( srp-authentication, [ --disable-srp-authentication disable the SRP authentication support], ac_enable_srp=no ) if test x$ac_enable_srp != xno; then AC_MSG_RESULT(no) AC_DEFINE(ENABLE_SRP, 1, [enable SRP authentication]) else AC_MSG_RESULT(yes) fi AC_MSG_CHECKING([whether to disable anonymous authentication support]) AC_ARG_ENABLE( anon-authentication, [ --disable-anon-authentication disable the anonymous authentication support], ac_enable_anon=no ) if test x$ac_enable_anon != xno; then AC_MSG_RESULT(no) AC_DEFINE(ENABLE_ANON, 1, [enable anonymous authentication]) else AC_MSG_RESULT(yes) fi AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support]) AC_ARG_ENABLE( openpgp-authentication, [ --disable-openpgp-authentication disable the OpenPGP authentication support], ac_enable_openpgp=no ) if test x$ac_enable_openpgp != xno; then AC_MSG_RESULT(no) AM_PATH_LIBOPENCDK( 0.4.0, AC_DEFINE(HAVE_LIBOPENCDK, 1, [have libopencdk]), AC_MSG_WARN([[ *** *** libopencdk 0.4.0 was not found. You will not be able to use OpenPGP keys with gnutls. ]])) else AC_MSG_RESULT(yes) fi AC_ARG_WITH(included-libtasn1, [ --with-included-libtasn1 Use the included libtasn1], minitasn1_enabled=$withval, minitasn1_enabled=no dnl We now need libtasn1 0.2.x dnl AC_CHECK_LIB( tasn1, asn1_read_tag,:, minitasn1_enabled=yes AC_MSG_WARN([[ *** *** LibtASN1 0.2.x was not found. Will use the included one.]]))) if test x$opt_developer_mode = xyes; then minitasn1_enabled=yes fi AC_MSG_CHECKING([whether to use the included minitasn1]) AC_MSG_RESULT($minitasn1_enabled) dnl CHECK FOR ZLIB SUPPORT dnl AC_MSG_CHECKING([whether to include zlib compression support]) AC_ARG_WITH( zlib, [ --without-zlib disable zlib compression support], ac_zlib=$withval, ac_zlib=yes ) if test x$ac_zlib != xno; then AC_MSG_RESULT(yes) AC_CHECK_LIB(z, compress,,AC_MSG_WARN( *** *** ZLIB was not found. You will not be able to use ZLIB compression.)) else AC_MSG_RESULT(no) fi dnl CHECK FOR LZO SUPPORT (whether to use the included one) dnl if test x$opt_developer_mode = xyes; then minilzo_enabled=yes fi AC_ARG_WITH(included-lzo, [ --with-included-lzo include minilzo in libgnutls-extra], minilzo_enabled=$withval, minilzo_enabled=no ) AC_MSG_CHECKING([whether to use the included lzo compression library]) AC_MSG_RESULT($minilzo_enabled) if test x$minilzo_enabled = xno; then AC_CHECK_LIB( lzo, lzo1x_1_compress, minilzo_enabled=no, minilzo_enabled=yes AC_MSG_WARN( *** *** Liblzo was not found. Will use the included minilzo.)) fi if test x"$minilzo_enabled" = xyes; then AC_DEFINE(USE_MINILZO, 1, [whether to use the included minilzo]) LZO_OBJECTS="minilzo.lo" else LZO_LINK=-llzo fi AC_SUBST(LZO_OBJECTS) AC_SUBST(LZO_LINK) dnl CHECK FOR THE LIBTASN1 LIBRARY or use the included one dnl if test x"$minitasn1_enabled" = xyes; then MINITASN1_OBJECTS="minitasn1/coding.lo minitasn1/decoding.lo minitasn1/element.lo \ minitasn1/errors.lo minitasn1/gstr.lo minitasn1/parser_aux.lo minitasn1/structure.lo" MINITASN1_DIR=minitasn1 else LIBASN1_LINK=-ltasn1 fi AC_SUBST(MINITASN1_OBJECTS) AC_SUBST(MINITASN1_DIR) AC_SUBST(LIBASN1_LINK) AC_MSG_RESULT([*** *** Detecting options for shared libraries... ]) AM_PROG_LIBTOOL LIBGNUTLS_LIBS="$LIBS -L${libdir} -lgnutls $LIBASN1_LINK $LIBGCRYPT_LIBS" LIBGNUTLS_CFLAGS="$LIBGCRYPT_CFLAGS -I${includedir}" CFLAGS="${CFLAGS} ${LIBGCRYPT_CFLAGS}" AC_SUBST(LIBGNUTLS_LIBS) AC_SUBST(LIBGNUTLS_CFLAGS) SERV_LIBS="$LIBS $SERV_LIBS" AC_SUBST(SERV_LIBS) LIBGNUTLS_EXTRA_LIBS="-L${libdir} -lgnutls-extra -lgnutls $LIBOPENCDK_LIBS $LZO_LINK" LIBGNUTLS_EXTRA_CFLAGS="$LIBOPENCDK_CFLAGS -I${includedir}" AC_SUBST(LIBGNUTLS_EXTRA_LIBS) AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS) if test $ac_cv_c_compiler_gnu != no; then if test x$opt_profiler_mode = xyes; then AC_CHECK_PROG(FC_OK, fc-config, yes, no) if test x$FC_OK = xyes; then CFLAGS="${CFLAGS} `fc-config --cflags`" LIBS="$LIBS `fc-config --libs`" else AC_MSG_WARN(*** *** You must install libfc in order to enable profiling. http://www710.univ-lyon1.fr/~yperret/fnccheck/profiler.html ) fi fi fi AC_CONFIG_FILES(lib/gnutls.h.in) AC_CONFIG_COMMANDS([includes/gnutls/gnutls.h],[[ test -f lib/gnutls.h.in || (echo "Could not generate includes/gnutls/gnutls.h" && exit 1) cat lib/gnutls.h.in > includes/gnutls/gnutls.h cat lib/gnutls_ui.h >> includes/gnutls/gnutls.h echo "" >> includes/gnutls/gnutls.h cat lib/gnutls_errors_int.h | grep -v _INT_ >> includes/gnutls/gnutls.h echo "" >> includes/gnutls/gnutls.h echo "#ifdef __cplusplus" >> includes/gnutls/gnutls.h echo "}" >> includes/gnutls/gnutls.h echo "#endif" >> includes/gnutls/gnutls.h echo "#endif /* GNUTLS_H */" >> includes/gnutls/gnutls.h echo "" >> includes/gnutls/gnutls.h chmod +x lib/libgnutls-config chmod +x libextra/libgnutls-extra-config ]],[[]]) AC_CONFIG_FILES([Makefile src/Makefile libextra/Makefile lib/Makefile \ lib/libgnutls-config libextra/libgnutls-extra-config \ doc/Makefile src/x509/Makefile src/srp/Makefile src/openpgp/Makefile \ doc/tex/Makefile doc/tex/cover.tex doc/scripts/Makefile \ doc/examples/Makefile lib/minitasn1/Makefile lib/x509/Makefile \ includes/Makefile includes/gnutls/Makefile]) AC_OUTPUT