Add.
[libtasn1.git] / configure.in
blobb4970408bac84c4a07d84c2ed0e8ec0969bfb01b
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.5], [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, 5)
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 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="-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 x"$_gcc_psign" != xyes ; then
64           CFLAGS=$_gcc_cflags_save;
65         fi
67         AC_MSG_CHECKING([whether we have GNU assembler])
68         GAS=`as --version < /dev/null 2>/dev/null|grep GNU`
69         if test "$GAS"; then
70           CFLAGS="${CFLAGS} -pipe"
71           AC_MSG_RESULT(yes)
72         else
73           AC_MSG_RESULT(no)
74         fi
78 AC_MSG_NOTICE([Detecting C library capabilities])
80 AC_CHECK_HEADERS(getopt.h strings.h inttypes.h stdint.h)
81 AC_CHECK_FUNCS(getopt_long)
82 AC_FUNC_ALLOCA
84 AC_MSG_NOTICE([Detecting system's parameters])
86 AC_CHECK_SIZEOF(unsigned long int, 4)
87 AC_CHECK_SIZEOF(unsigned int, 4)
89 # For some systems we know that we have ld_version scripts.
90 # Use it then as default.
91 have_ld_version_script=no
92 case "${host}" in
93     *-*-linux*)
94         have_ld_version_script=yes
95         ;;
96     *-*-gnu*)
97         have_ld_version_script=yes
98         ;;
99 esac
100 AC_ARG_ENABLE([ld-version-script],
101               AC_HELP_STRING([--enable-ld-version-script],
102                              [enable/disable use of linker version script.
103                               (default is system dependent)]),
104               [have_ld_version_script=$enableval],
105               [ : ] )
106 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
108 # For gnulib compatibility modules in gl/.
109 gl_INIT
111 # For libtasn1-config.
112 LIBTASN1_LIBS="-L${libdir} -ltasn1 $LIBS"
113 LIBTASN1_CFLAGS="-I${includedir}"
114 AC_SUBST(LIBTASN1_LIBS)
115 AC_SUBST(LIBTASN1_CFLAGS)
116 AC_CONFIG_COMMANDS([chmod],[[
117  chmod +x lib/libtasn1-config
118 ]],[[]])
120 # Check for gtk-doc.
121 GTK_DOC_CHECK(1.2)
123 # Update version number in lib/libtasn1.h.
124 if ! sed 's/_VERSION ".*"/_VERSION "'$PACKAGE_VERSION'"/' \
125      $srcdir/lib/libtasn1.h > fixhdr.tmp; then
126   AC_MSG_ERROR([[*** Failed to update version number in lib/libtasn1.h...]])
128 if cmp -s $srcdir/lib/libtasn1.h fixhdr.tmp 2>/dev/null; then
129   rm -f fixhdr.tmp
130 elif ! mv fixhdr.tmp $srcdir/lib/libtasn1.h; then
131   AC_MSG_ERROR([[*** Failed to move fixhdr.tmp to lib/libtasn1.h...]])
134 AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile lib/Makefile \
135         lib/libtasn1.pc lib/libtasn1-config doc/Makefile \
136         doc/reference/Makefile])
137 AC_OUTPUT