dnl Process this file with autoconf to produce a configure script. # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation # # This file is part of LIBTASN1. # # This program 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 3 of the License, or # (at your option) any later version. # # This program 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 this program. If not, see . AC_PREREQ(2.61) AC_INIT([libtasn1], [2.0], [bug-gnutls@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS(config.h) AM_INIT_AUTOMAKE([1.10]) # Library code modified: REVISION++ # Interfaces changed/added/removed: CURRENT++ REVISION=0 # Interfaces added: AGE++ # Interfaces removed: AGE=0 AC_SUBST(LT_CURRENT, 4) AC_SUBST(LT_REVISION, 0) AC_SUBST(LT_AGE, 1) AC_PROG_CC gl_EARLY AC_PROG_YACC AC_PROG_LN_S dnl Checks for programs. AC_PROG_INSTALL AM_MISSING_PROG(PERL,perl,$missing_dir) AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir) AC_MSG_NOTICE([Detecting options for shared libraries]) AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL AC_MSG_NOTICE([Detecting compiler options]) AC_C_CONST if test "$GCC" = "yes"; then CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wstrict-prototypes" AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign]) _gcc_cflags_save="$CFLAGS" CFLAGS="${CFLAGS} -Wno-pointer-sign" AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), _gcc_psign=yes, _gcc_psign=no) AC_MSG_RESULT($_gcc_psign) if test "$_gcc_psign" != "yes"; then CFLAGS="$_gcc_cflags_save" fi fi AC_MSG_NOTICE([Detecting system's parameters]) # Run self-tests under valgrind? if test "$cross_compiling" = no; then AC_CHECK_PROGS(VALGRIND, valgrind) fi if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then opt_valgrind_tests=yes else opt_valgrind_tests=no VALGRIND= fi AC_MSG_CHECKING([whether self tests are run under valgrind]) AC_ARG_ENABLE(valgrind-tests, AS_HELP_STRING([--enable-valgrind-tests], [run self tests under valgrind]), opt_valgrind_tests=$enableval) AC_MSG_RESULT($opt_valgrind_tests) AC_CHECK_SIZEOF(unsigned long int, 4) AC_CHECK_SIZEOF(unsigned int, 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], AS_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") # For gnulib compatibility modules in gl/. AC_MSG_NOTICE([Running gnulib checks]) gl_INIT # For libtasn1-config. LIBTASN1_LIBS="-L${libdir} -ltasn1 $LIBS" LIBTASN1_CFLAGS="-I${includedir}" AC_SUBST(LIBTASN1_LIBS) AC_SUBST(LIBTASN1_CFLAGS) AC_CONFIG_COMMANDS([chmod],[[ chmod +x lib/libtasn1-config ]],[[]]) # Check for gtk-doc. GTK_DOC_CHECK(1.2) # Update version number in lib/libtasn1.h. if ! sed 's/_VERSION ".*"/_VERSION "'$PACKAGE_VERSION'"/' \ $srcdir/lib/libtasn1.h > fixhdr.tmp; then AC_MSG_ERROR([[*** Failed to update version number in lib/libtasn1.h...]]) fi if cmp -s $srcdir/lib/libtasn1.h fixhdr.tmp 2>/dev/null; then rm -f fixhdr.tmp elif ! mv fixhdr.tmp $srcdir/lib/libtasn1.h; then AC_MSG_ERROR([[*** Failed to move fixhdr.tmp to lib/libtasn1.h...]]) fi # Make it possible to pass -Werror when building relevant parts of # the library. Normally, -Werror breaks when running autoconf tests. AC_ARG_VAR(WARN_CFLAGS, [Flags to enable compiler warnings]) AC_MSG_CHECKING([what compiler warning flags we will use]) AC_MSG_RESULT($WARN_CFLAGS) AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile lib/Makefile \ gl/Makefile lib/libtasn1.pc lib/libtasn1-config doc/Makefile \ doc/reference/Makefile examples/Makefile]) AC_OUTPUT