Update gnulib files.
[libtasn1.git] / configure.in
blobba0de0b3533302c437b00caf87ed3bbe2d095b92
1 dnl Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 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/>.
19 AC_PREREQ(2.61)
20 AC_INIT([libtasn1], [1.4], [bug-gnutls@gnu.org])
21 AC_CONFIG_AUX_DIR([build-aux])
22 AC_CONFIG_HEADERS(config.h)
23 AM_INIT_AUTOMAKE([1.10])
24 AB_INIT
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, 15)
32 AC_SUBST(LT_AGE, 0)
34 AC_PROG_CC
35 gl_EARLY
36 AC_PROG_YACC
37 AC_PROG_LN_S
39 dnl Checks for programs.
40 AC_PROG_INSTALL
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])
45 AC_LIBTOOL_WIN32_DLL
46 AM_PROG_LIBTOOL
48 AC_MSG_NOTICE([Detecting compiler options])
49 AC_C_CONST
51 if test "$GCC" = "yes"; then
52         CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wstrict-prototypes"
54         AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
55         _gcc_cflags_save="$CFLAGS"
56         CFLAGS="${CFLAGS} -Wno-pointer-sign"
57         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), _gcc_psign=yes, _gcc_psign=no)
58         AC_MSG_RESULT($_gcc_psign)
59         if test "$_gcc_psign" != "yes"; then
60           CFLAGS="$_gcc_cflags_save"
61         fi
65 AC_MSG_NOTICE([Detecting C library capabilities])
67 AC_FUNC_ALLOCA
69 AC_MSG_NOTICE([Detecting system's parameters])
71 # Run self-tests under valgrind?
72 if test "$cross_compiling" = no; then
73   AC_CHECK_PROGS(VALGRIND, valgrind)
75 if test -n "$VALGRIND" && $VALGRIND true > /dev/null 2>&1; then
76   opt_valgrind_tests=yes
77 else
78   opt_valgrind_tests=no
79   VALGRIND=
80 fi 
81 AC_MSG_CHECKING([whether self tests are run under valgrind])
82 AC_ARG_ENABLE(valgrind-tests,
83         AS_HELP_STRING([--enable-valgrind-tests],
84                        [run self tests under valgrind]),
85   opt_valgrind_tests=$enableval)
86 AC_MSG_RESULT($opt_valgrind_tests)
88 AC_CHECK_SIZEOF(unsigned long int, 4)
89 AC_CHECK_SIZEOF(unsigned int, 4)
91 # For some systems we know that we have ld_version scripts.
92 # Use it then as default.
93 have_ld_version_script=no
94 case "${host}" in
95     *-*-linux*)
96         have_ld_version_script=yes
97         ;;
98     *-*-gnu*)
99         have_ld_version_script=yes
100         ;;
101 esac
102 AC_ARG_ENABLE([ld-version-script],
103               AS_HELP_STRING([--enable-ld-version-script],[enable/disable use of linker version script.
104                               (default is system dependent)]),
105               [have_ld_version_script=$enableval],
106               [ : ] )
107 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
109 # For gnulib compatibility modules in gl/.
110 gl_INIT
112 # For libtasn1-config.
113 LIBTASN1_LIBS="-L${libdir} -ltasn1 $LIBS"
114 LIBTASN1_CFLAGS="-I${includedir}"
115 AC_SUBST(LIBTASN1_LIBS)
116 AC_SUBST(LIBTASN1_CFLAGS)
117 AC_CONFIG_COMMANDS([chmod],[[
118  chmod +x lib/libtasn1-config
119 ]],[[]])
121 # Check for gtk-doc.
122 GTK_DOC_CHECK(1.2)
124 # Update version number in lib/libtasn1.h.
125 if ! sed 's/_VERSION ".*"/_VERSION "'$PACKAGE_VERSION'"/' \
126      $srcdir/lib/libtasn1.h > fixhdr.tmp; then
127   AC_MSG_ERROR([[*** Failed to update version number in lib/libtasn1.h...]])
129 if cmp -s $srcdir/lib/libtasn1.h fixhdr.tmp 2>/dev/null; then
130   rm -f fixhdr.tmp
131 elif ! mv fixhdr.tmp $srcdir/lib/libtasn1.h; then
132   AC_MSG_ERROR([[*** Failed to move fixhdr.tmp to lib/libtasn1.h...]])
135 AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile lib/Makefile \
136         gl/Makefile lib/libtasn1.pc lib/libtasn1-config doc/Makefile \
137         doc/reference/Makefile examples/Makefile])
138 AC_OUTPUT