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 program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 AC_INIT([libtasn1],[1.0],[bug-gnutls@gnu.org])
21 AC_CONFIG_AUX_DIR([build-aux])
22 AC_CONFIG_HEADERS(config.h)
23 AM_INIT_AUTOMAKE([1.10])
26 # Library code modified: REVISION++
27 # Interfaces changed/added/removed: CURRENT++ REVISION=0
28 # Interfaces added: AGE++
29 # Interfaces removed: AGE=0
30 AC_SUBST(LT_CURRENT, 3)
31 AC_SUBST(LT_REVISION, 11)
39 dnl Checks for programs.
41 AM_MISSING_PROG(PERL,perl,$missing_dir)
42 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
44 AC_MSG_NOTICE([Detecting options for shared libraries])
48 AC_MSG_NOTICE([Detecting compiler options])
51 dnl In order to use the reentrant libc functions.
52 dnl I hope it is portable enough.
53 CFLAGS="${CFLAGS} -D_REENTRANT -D_THREAD_SAFE"
55 if test "$GCC" = "yes"; then
56 CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wstrict-prototypes"
58 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
59 _gcc_cflags_save="$CFLAGS"
60 CFLAGS="${CFLAGS} -Wno-pointer-sign"
61 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), _gcc_psign=yes, _gcc_psign=no)
62 AC_MSG_RESULT($_gcc_psign)
63 if test "$_gcc_psign" != "yes"; then
64 CFLAGS="$_gcc_cflags_save"
67 AC_MSG_CHECKING([whether we have GNU assembler])
68 GAS=`as --version < /dev/null 2>/dev/null|grep GNU`
70 CFLAGS="${CFLAGS} -pipe"
78 AC_MSG_NOTICE([Detecting C library capabilities])
80 AC_CHECK_HEADERS(strings.h inttypes.h stdint.h)
83 AC_MSG_NOTICE([Detecting system's parameters])
85 # Run self-tests under valgrind?
86 if test "$cross_compiling" = no; then
87 AC_CHECK_PROGS(VALGRIND, valgrind)
89 if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
90 opt_valgrind_tests=yes
95 AC_MSG_CHECKING([whether self tests are run under valgrind])
96 AC_ARG_ENABLE(valgrind-tests,
97 AS_HELP_STRING([--enable-valgrind-tests],
98 [run self tests under valgrind]),
99 opt_valgrind_tests=$enableval)
100 AC_MSG_RESULT($opt_valgrind_tests)
102 AC_CHECK_SIZEOF(unsigned long int, 4)
103 AC_CHECK_SIZEOF(unsigned int, 4)
105 # For some systems we know that we have ld_version scripts.
106 # Use it then as default.
107 have_ld_version_script=no
110 have_ld_version_script=yes
113 have_ld_version_script=yes
116 AC_ARG_ENABLE([ld-version-script],
117 AS_HELP_STRING([--enable-ld-version-script],[enable/disable use of linker version script.
118 (default is system dependent)]),
119 [have_ld_version_script=$enableval],
121 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
123 # For gnulib compatibility modules in gl/.
126 # For libtasn1-config.
127 LIBTASN1_LIBS="-L${libdir} -ltasn1 $LIBS"
128 LIBTASN1_CFLAGS="-I${includedir}"
129 AC_SUBST(LIBTASN1_LIBS)
130 AC_SUBST(LIBTASN1_CFLAGS)
131 AC_CONFIG_COMMANDS([chmod],[[
132 chmod +x lib/libtasn1-config
138 # Update version number in lib/libtasn1.h.
139 if ! sed 's/_VERSION ".*"/_VERSION "'$PACKAGE_VERSION'"/' \
140 $srcdir/lib/libtasn1.h > fixhdr.tmp; then
141 AC_MSG_ERROR([[*** Failed to update version number in lib/libtasn1.h...]])
143 if cmp -s $srcdir/lib/libtasn1.h fixhdr.tmp 2>/dev/null; then
145 elif ! mv fixhdr.tmp $srcdir/lib/libtasn1.h; then
146 AC_MSG_ERROR([[*** Failed to move fixhdr.tmp to lib/libtasn1.h...]])
149 AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile lib/Makefile \
150 gl/Makefile lib/libtasn1.pc lib/libtasn1-config doc/Makefile \
151 doc/reference/Makefile])