1 dnl Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
4 # This file is part of LIBTASN1.
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This file is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this file; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 AC_INIT([libtasn1],[0.3.10],[bug-gnutls@gnu.org])
22 AC_CONFIG_AUX_DIR([build-aux])
23 AC_CONFIG_HEADERS(config.h)
24 AM_INIT_AUTOMAKE([1.10 gnits])
27 # Library code modified: REVISION++
28 # Interfaces changed/added/removed: CURRENT++ REVISION=0
29 # Interfaces added: AGE++
30 # Interfaces removed: AGE=0
31 AC_SUBST(LT_CURRENT, 3)
32 AC_SUBST(LT_REVISION, 10)
40 dnl Checks for programs.
42 AM_MISSING_PROG(PERL,perl,$missing_dir)
43 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
45 AC_MSG_NOTICE([Detecting options for shared libraries])
49 AC_MSG_NOTICE([Detecting compiler options])
52 dnl In order to use the reentrant libc functions.
53 dnl I hope it is portable enough.
54 CFLAGS="${CFLAGS} -D_REENTRANT -D_THREAD_SAFE"
56 if test "$GCC" = "yes"; then
57 CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wstrict-prototypes"
59 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
60 _gcc_cflags_save="$CFLAGS"
61 CFLAGS="${CFLAGS} -Wno-pointer-sign"
62 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), _gcc_psign=yes, _gcc_psign=no)
63 AC_MSG_RESULT($_gcc_psign)
64 if test "$_gcc_psign" != "yes"; then
65 CFLAGS="$_gcc_cflags_save"
68 AC_MSG_CHECKING([whether we have GNU assembler])
69 GAS=`as --version < /dev/null 2>/dev/null|grep GNU`
71 CFLAGS="${CFLAGS} -pipe"
79 AC_MSG_NOTICE([Detecting C library capabilities])
81 AC_CHECK_HEADERS(strings.h inttypes.h stdint.h)
84 AC_MSG_NOTICE([Detecting system's parameters])
86 # Run self-tests under valgrind?
87 if test "$cross_compiling" = no; then
88 AC_CHECK_PROGS(VALGRIND, valgrind)
90 if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
91 opt_valgrind_tests=yes
96 AC_MSG_CHECKING([whether self tests are run under valgrind])
97 AC_ARG_ENABLE(valgrind-tests,
98 AS_HELP_STRING([--enable-valgrind-tests],
99 [run self tests under valgrind]),
100 opt_valgrind_tests=$enableval)
101 AC_MSG_RESULT($opt_valgrind_tests)
103 AC_CHECK_SIZEOF(unsigned long int, 4)
104 AC_CHECK_SIZEOF(unsigned int, 4)
106 # For some systems we know that we have ld_version scripts.
107 # Use it then as default.
108 have_ld_version_script=no
111 have_ld_version_script=yes
114 have_ld_version_script=yes
117 AC_ARG_ENABLE([ld-version-script],
118 AS_HELP_STRING([--enable-ld-version-script],[enable/disable use of linker version script.
119 (default is system dependent)]),
120 [have_ld_version_script=$enableval],
122 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
124 # For gnulib compatibility modules in gl/.
127 # For libtasn1-config.
128 LIBTASN1_LIBS="-L${libdir} -ltasn1 $LIBS"
129 LIBTASN1_CFLAGS="-I${includedir}"
130 AC_SUBST(LIBTASN1_LIBS)
131 AC_SUBST(LIBTASN1_CFLAGS)
132 AC_CONFIG_COMMANDS([chmod],[[
133 chmod +x lib/libtasn1-config
139 # Update version number in lib/libtasn1.h.
140 if ! sed 's/_VERSION ".*"/_VERSION "'$PACKAGE_VERSION'"/' \
141 $srcdir/lib/libtasn1.h > fixhdr.tmp; then
142 AC_MSG_ERROR([[*** Failed to update version number in lib/libtasn1.h...]])
144 if cmp -s $srcdir/lib/libtasn1.h fixhdr.tmp 2>/dev/null; then
146 elif ! mv fixhdr.tmp $srcdir/lib/libtasn1.h; then
147 AC_MSG_ERROR([[*** Failed to move fixhdr.tmp to lib/libtasn1.h...]])
150 AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile lib/Makefile \
151 gl/Makefile lib/libtasn1.pc lib/libtasn1-config doc/Makefile \
152 doc/reference/Makefile])