dnl Process this file with autoconf to produce a configure script. # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation # # Author: Nikos Mavroyanopoulos # # This file is part of GNUTLS. # # GNUTLS is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # GNUTLS 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNUTLS; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. AC_INIT(gnutls, [1.3.1], [bug-gnutls@gnu.org]) AC_PREREQ(2.59) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([1.9 gnits dist-bzip2]) AM_CONFIG_HEADER(config.h) AB_INIT # Library code modified: REVISION++ # Interfaces changed/added/removed: CURRENT++ REVISION=0 # Interfaces added: AGE++ # Interfaces removed: AGE=0 AC_SUBST(LT_CURRENT, 13) AC_SUBST(LT_REVISION, 0) AC_SUBST(LT_AGE, 0) ac_full=1 GNUTLS_GCRYPT_VERSION=1:1.2.2 GNUTLS_LIBTASN1_VERSION=0.2.11 AC_DEFINE_UNQUOTED(GNUTLS_GCRYPT_VERSION, "$GNUTLS_GCRYPT_VERSION", [version of gcrypt]) AC_DEFINE_UNQUOTED(GNUTLS_LIBTASN1_VERSION, "$GNUTLS_LIBTASN1_VERSION", [version of libtasn1]) # Compute numeric versions, used in includes/gnutls/gnutls.h.in. AC_SUBST(MAJOR_VERSION, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`) AC_SUBST(MINOR_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`) AC_SUBST(PATCH_VERSION, `echo $PACKAGE_VERSION | sed 's/.*\..*\.\(.*\)/\1/g'`) AC_SUBST(NUMBER_VERSION, `printf "0x%02x%02x%02x" $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`) case "${target}" in *-*-mingw32*) LIBS="$LIBS -lwsock32" ;; *) ;; esac dnl In order to use the reentrant libc functions. dnl I hope it is portable enough. CFLAGS="${CFLAGS} -D_REENTRANT -D_THREAD_SAFE" opt_dmalloc_mode=no AC_MSG_CHECKING([whether in dmalloc mode]) AC_ARG_ENABLE(dmalloc-mode, AS_HELP_STRING([--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, AS_HELP_STRING([--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 developer mode]) AC_ARG_ENABLE(developer-mode, AS_HELP_STRING([--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, AS_HELP_STRING([--enable-profile-mode], [enable profiler]), opt_profiler_mode=$enableval) AC_MSG_RESULT($opt_profiler_mode) AC_MSG_RESULT([*** *** Checking for compilation programs... ]) dnl Checks for programs. AC_PROG_CC AC_PROG_LN_S GTK_DOC_CHECK(1.1) AC_MSG_RESULT([*** *** Detecting compiler options... ]) gl_EARLY 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 not supported. This may affect compiling.])) if test $ac_cv_c_compiler_gnu != no; then if test x$opt_developer_mode = xyes; then CFLAGS="${CFLAGS} -g -Wall -Wcast-align -W -Wpointer-arith -Wchar-subscripts -Wformat-security -Wno-format-y2k -Wmissing-braces -Winline -Wstrict-prototypes -Wno-unused-parameter" # CFLAGS="${CFLAGS} -g -W -Wall -Wcast-align -Wpointer-arith -Wchar-subscripts -Wformat-security -Wno-format-y2k -Wmissing-braces -Winline -Wstrict-prototypes -Wshadow -Wno-unused-parameter -Wimplicit -fno-common -Wno-sign-compare -Wbad-function-cast -Wendif-labels -Wmissing-declarations -Wno-missing-format-attribute -Wmissing-prototypes -Wnested-externs -Wpointer-arith -pedantic -Wlong-long -Wcast-qual -Wcast-align -Winline -Wredundant-decls -Wstrict-prototypes -Wwrite-strings -Wparentheses -Wsequence-point -Wpacked -Waggregate-return -Wfloat-equal -Wmultichar -Wunknown-pragmas -Wtrigraphs -Wswitch -Wreturn-type -Wmain -Wchar-subscripts -Wcomment -Wno-missing-noreturn" 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 strings.h stddef.h alloca.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_HEADERS(math.h limits.h float.h stdarg.h ctype.h) dnl opencdk AC_CHECK_HEADERS(netdb.h) AC_CHECK_FUNCS(umask vasprintf isascii memmove memmem mmap gmtime_r,,) 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) # For some systems we know that we have ld_version scripts. # Use it then as default. have_ld_version_script=no case "${host}" in *-*-linux*) have_ld_version_script=yes ;; *-*-gnu*) have_ld_version_script=yes ;; esac AC_ARG_ENABLE([ld-version-script], AC_HELP_STRING([--enable-ld-version-script], [enable/disable use of linker version script. (default is system dependent)]), [have_ld_version_script=$enableval], [ : ] ) AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") AC_CHECK_TYPES(uint,,, [ # include ]) AC_CHECK_TYPE(ssize_t, DEFINE_SSIZE_T="#include " AC_SUBST(DEFINE_SSIZE_T) , AC_DEFINE(NO_SSIZE_T, 1, [no ssize_t type was found]) DEFINE_SSIZE_T="typedef int ssize_t;" AC_SUBST(DEFINE_SSIZE_T) ,[ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_UNISTD_H # include #endif ]) AC_C_BIGENDIAN AC_MSG_RESULT([*** *** Checking for external libraries... ]) AM_PATH_LIBGCRYPT($GNUTLS_GCRYPT_VERSION,, dnl Can't disable - gnutls depends on gcrypt AC_MSG_ERROR([[ *** *** libgcrypt was not found. You may want to get it from *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/ *** ]])) libgcrypt=yes # Hard-wire the gl/m4/gc.m4 test. AC_ARG_WITH(builtin-crypto, AS_HELP_STRING([--with-builtin-crypto], [use internal crypto instead of libgcrypt (EXPERIMENTAL)]), ac_cv_libgcrypt=no, ac_cv_libgcrypt=yes) AC_MSG_CHECKING([whether to disable SRP authentication support]) AC_ARG_ENABLE(srp-authentication, AS_HELP_STRING([--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_full=0 AC_MSG_RESULT(yes) fi AC_MSG_CHECKING([whether to disable PSK authentication support]) AC_ARG_ENABLE(psk-authentication, AS_HELP_STRING([--disable-psk-authentication], [disable the PSK authentication support]), ac_enable_srp=no) if test x$ac_enable_srp != xno; then AC_MSG_RESULT(no) AC_DEFINE(ENABLE_PSK, 1, [enable PSK authentication]) else ac_full=0 AC_MSG_RESULT(yes) fi AM_CONDITIONAL(ENABLE_SRP, test "$ac_enable_srp" != "no") AC_MSG_CHECKING([whether to disable anonymous authentication support]) AC_ARG_ENABLE(anon-authentication, AS_HELP_STRING([--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_full=0 AC_MSG_RESULT(yes) fi AC_MSG_CHECKING([whether to disable extra PKI stuff]) AC_ARG_ENABLE(extra-pki, AS_HELP_STRING([--disable-extra-pki], [only enable the basic PKI stuff]), ac_enable_pki=no) if test x$ac_enable_pki != xno; then AC_MSG_RESULT(no) AC_DEFINE(ENABLE_PKI, 1, [whether to include all the PKCS #x stuff and other PKI stuff]) else ac_full=0 AC_MSG_RESULT(yes) fi dnl Check whether to disable OpenPGP authentication completely dnl from libgnutls-extra. ac_enable_openpgp=yes AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support]) AC_ARG_ENABLE(openpgp-authentication, AS_HELP_STRING([--disable-openpgp-authentication], [disable the OpenPGP authentication support]), ac_enable_openpgp=no) if test x$ac_enable_openpgp = xno; then AC_MSG_RESULT(yes) ac_full=0 else AC_DEFINE(ENABLE_OPENPGP, 1, [use openpgp authentication]) AC_MSG_RESULT(no) fi AM_CONDITIONAL(ENABLE_OPENPGP, test "$ac_enable_openpgp" = "yes") dnl Test whether to use the included opencdk library dnl if test x$ac_enable_openpgp = xyes; then AC_ARG_WITH(included-opencdk, AS_HELP_STRING([--with-included-opencdk], [use the included opencdk]), ac_enable_included_opencdk=$withval, ac_enable_included_opencdk=no) if test x$ac_enable_included_opencdk = xno;then AM_PATH_LIBOPENCDK(0.5.5, , ac_enable_included_opencdk=yes AC_MSG_WARN([[ *** *** libopencdk 0.5.5 was not found. You may want to get it from *** ftp://ftp.gnutls.org/pub/gnutls/opencdk/ *** *** Will use the included opencdk. *** ]])) fi AC_MSG_CHECKING([whether to use the included opencdk]) AC_MSG_RESULT($ac_enable_included_opencdk) fi AM_CONDITIONAL(ENABLE_INCLUDED_OPENCDK, test "$ac_enable_included_opencdk" = "yes") ac_enable_openssl=yes AC_MSG_CHECKING([whether to disable OpenSSL compatibility layer]) AC_ARG_ENABLE(openssl-compatibility, AS_HELP_STRING([--disable-openssl-compatibility], [disable the OpenSSL compatibility support]), ac_enable_openssl=no) if test x$ac_enable_openssl != xno; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) fi AM_CONDITIONAL(ENABLE_OPENSSL, test "$ac_enable_openssl" = "yes") AC_ARG_WITH(included-libtasn1, AS_HELP_STRING([--with-included-libtasn1], [use the included libtasn1]), minitasn1_enabled=yes, minitasn1_enabled=no) if test x$minitasn1_enabled = xno; then AM_PATH_LIBTASN1($GNUTLS_LIBTASN1_VERSION,, minitasn1_enabled=yes AC_MSG_WARN([[ *** *** LibtASN1 ${GNUTLS_LIBTASN1_VERSION} was not found. Will use the included one. ]])) fi SAVED_LIBS=$LIBS AC_MSG_CHECKING([whether to use the included minitasn1]) AC_MSG_RESULT($minitasn1_enabled) dnl CHECK FOR THE LIBTASN1 LIBRARY or use the included one dnl AM_CONDITIONAL(ENABLE_MINITASN1, test "$minitasn1_enabled" = "yes") dnl Check for libcfg+ AC_ARG_WITH(included-libcfg, AS_HELP_STRING([--with-included-libcfg], [use the included libcfg+ (certtool only)]), libcfg_enabled=$withval, libcfg_enabled=no dnl We search for libcfg+ which is used by certtool dnl AC_CHECK_LIB(cfg+, cfg_get_context,:, libcfg_enabled=yes AC_MSG_WARN([[ *** *** Libcfg+ was not found. Will use the included one.]]))) AM_CONDITIONAL(HAVE_LIBCFG, test "$libcfg_enabled" = "no") LIBS=$SAVED_LIBS AC_MSG_CHECKING([whether to use the included libcfg]) AC_MSG_RESULT($libcfg_enabled) dnl CHECK FOR ZLIB SUPPORT dnl AC_MSG_CHECKING([whether to include zlib compression support]) AC_ARG_WITH(zlib, AS_HELP_STRING([--without-zlib], [disable zlib compression support]), ac_zlib=$withval, ac_zlib=yes) if test x$ac_zlib != xno; then AC_MSG_RESULT(yes) AC_LIB_HAVE_LINKFLAGS(z,, [#include ], [compress (0, 0, 0, 0);]) if test "$ac_cv_libz" != yes; then AC_MSG_WARN( *** *** ZLIB was not found. You will not be able to use ZLIB compression.) fi else AC_MSG_RESULT(no) fi dnl CHECK FOR LZO SUPPORT (whether to use the included one) dnl minilzo_enabled=no use_lzo=yes AC_ARG_WITH(lzo, AS_HELP_STRING([--without-lzo], [do not use lzo compression]), use_lzo=$withval, use_lzo=yes) AC_MSG_CHECKING([whether to include lzo compression support]) AC_MSG_RESULT($use_lzo) if test x$use_lzo = xyes; then AC_DEFINE(USE_LZO, 1, [whether to use the lzo compression]) AC_ARG_WITH(included-lzo, AS_HELP_STRING([--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) LZO_LIBS= if test "$minilzo_enabled" != "yes"; then AC_CHECK_LIB(lzo2, lzo1x_1_compress, LZO_LIBS=-llzo2) if test "$LZO_LIBS" = ""; then AC_CHECK_LIB(lzo, lzo1x_1_compress, LZO_LIBS=-llzo, [ minilzo_enabled=yes AC_MSG_WARN( *** *** Could not find liblzo or liblzo2. Will use the included minilzo. ) ]) fi fi AC_SUBST(LZO_LIBS) if test "$LZO_LIBS" = "-llzo"; then AC_CHECK_HEADERS(lzo1x.h) elif test "$LZO_LIBS" = "-llzo2"; then AC_CHECK_HEADERS(lzo/lzo1x.h) fi if test "$minilzo_enabled" = "yes"; then AC_DEFINE(USE_MINILZO, 1, [whether to use the included minilzo]) fi fi AM_CONDITIONAL(USE_LZO, test "$use_lzo" = "yes") AM_CONDITIONAL(ENABLE_INCLUDED_LZO, test "$minilzo_enabled" = "yes") AC_MSG_RESULT([*** *** Setting up gnulib compatibility files... ]) gl_INIT AC_MSG_RESULT([*** *** Detecting options for shared libraries... ]) AM_PROG_LIBTOOL LIBGNUTLS_LIBS="-L${libdir} -lgnutls $LIBTASN1_LIBS $LIBGCRYPT_LIBS $LIBS" LIBGNUTLS_CFLAGS="$LIBGCRYPT_CFLAGS $LIBTASN1_CFLAGS -I${includedir}" AC_SUBST(LIBGNUTLS_LIBS) AC_SUBST(LIBGNUTLS_CFLAGS) LIBGNUTLS_EXTRA_LIBS="-L${libdir} -lgnutls-extra $LIBOPENCDK_LIBS $LZO_LIBS $LIBGNUTLS_LIBS" LIBGNUTLS_EXTRA_CFLAGS="$LIBOPENCDK_CFLAGS -I${includedir}" AC_SUBST(LIBGNUTLS_EXTRA_LIBS) AC_SUBST(LIBGNUTLS_EXTRA_CFLAGS) export ac_full CFLAGS="${CFLAGS} ${LIBGCRYPT_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 if test $ac_full -eq 0; then AC_SUBST(POSSIBLY_WARN_ABOUT_MISSING_FEATURES, [[ #ifdef __GNUC__ #warning This is not the official GnuTLS library. Several features were disabled at compilation. #endif /* __GNUC__ */]]) fi AC_CONFIG_COMMANDS([chmod-config],[[ chmod +x lib/libgnutls-config chmod +x libextra/libgnutls-extra-config ]],[[]]) AC_CONFIG_FILES([Makefile \ doc/Makefile doc/examples/Makefile doc/scripts/Makefile \ doc/manpages/Makefile doc/reference/Makefile \ gl/Makefile tests/Makefile \ includes/Makefile includes/gnutls/gnutls.h \ lib/Makefile lib/minitasn1/Makefile lib/x509/Makefile \ libextra/Makefile libextra/openpgp/Makefile libextra/opencdk/Makefile \ libextra/minilzo/Makefile \ src/Makefile src/x509/Makefile src/srp/Makefile src/openpgp/Makefile \ src/cfg/Makefile src/cfg/platon/Makefile src/cfg/platon/str/Makefile \ lib/libgnutls-config libextra/libgnutls-extra-config \ lib/gnutls.pc libextra/gnutls-extra.pc]) AC_OUTPUT