Version 0.3.3.
[libtasn1.git] / configure.in
blobf7dc0474e1909848023ff1f2b0876863bfc61b1d
1 dnl Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2002, 2003, 2004, 2005, 2006 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.
20 AC_PREREQ(2.59)
21 AC_INIT([libtasn1], [0.3.3], [bug-gnutls@gnu.org])
22 AM_INIT_AUTOMAKE([1.9 gnits])
23 AM_CONFIG_HEADER(config.h)
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, 3)
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 AM_PROG_LIBTOOL
47 AC_MSG_NOTICE([Detecting compiler options])
48 AC_C_CONST
50 dnl In order to use the reentrant libc functions.
51 dnl I hope it is portable enough.
52 CFLAGS="${CFLAGS} -D_REENTRANT -D_THREAD_SAFE"
54 if test "$GCC" = "yes"; then
55         CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wstrict-prototypes -Wno-pointer-sign"
57         AC_MSG_CHECKING([whether we have GNU assembler])
58         
59         GAS=`as --version < /dev/null 2>/dev/null|grep GNU`
60         if test "$GAS"; then
61           CFLAGS="${CFLAGS} -pipe"
62           AC_MSG_RESULT(yes)
63         else
64           AC_MSG_RESULT(no)
65         fi
69 AC_MSG_NOTICE([Detecting C library capabilities])
71 AC_CHECK_HEADERS(getopt.h strings.h inttypes.h stdint.h)
72 AC_CHECK_FUNCS(getopt_long)
73 AC_FUNC_ALLOCA
75 AC_MSG_NOTICE([Detecting system's parameters])
77 AC_CHECK_SIZEOF(unsigned long int, 4)
78 AC_CHECK_SIZEOF(unsigned int, 4)
80 # For some systems we know that we have ld_version scripts.
81 # Use it then as default.
82 have_ld_version_script=no
83 case "${host}" in
84     *-*-linux*)
85         have_ld_version_script=yes
86         ;;
87     *-*-gnu*)
88         have_ld_version_script=yes
89         ;;
90 esac
91 AC_ARG_ENABLE([ld-version-script],
92               AC_HELP_STRING([--enable-ld-version-script],
93                              [enable/disable use of linker version script.
94                               (default is system dependent)]),
95               [have_ld_version_script=$enableval],
96               [ : ] )
97 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
99 # For gnulib compatibility modules in gl/.
100 gl_INIT
102 # For libtasn1-config.
103 LIBTASN1_LIBS="-L${libdir} -ltasn1 $LIBS"
104 LIBTASN1_CFLAGS="-I${includedir}"
105 AC_SUBST(LIBTASN1_LIBS)
106 AC_SUBST(LIBTASN1_CFLAGS)
107 AC_CONFIG_COMMANDS([chmod],[[
108  chmod +x lib/libtasn1-config
109 ]],[[]])
111 # Check for gtk-doc.
112 GTK_DOC_CHECK(1.2)
114 # Update version number in lib/libtasn1.h.
115 if ! sed 's/_VERSION ".*"/_VERSION "'$PACKAGE_VERSION'"/' \
116      $srcdir/lib/libtasn1.h > fixhdr.tmp; then
117   AC_MSG_ERROR([[*** Failed to update version number in lib/libtasn1.h...]])
119 if cmp -s $srcdir/lib/libtasn1.h fixhdr.tmp 2>/dev/null; then
120   rm -f fixhdr.tmp
121 elif ! mv fixhdr.tmp $srcdir/lib/libtasn1.h; then
122   AC_MSG_ERROR([[*** Failed to move fixhdr.tmp to lib/libtasn1.h...]])
125 AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile lib/Makefile \
126         lib/libtasn1.pc lib/libtasn1-config doc/Makefile \
127         doc/reference/Makefile])
128 AC_OUTPUT