Bump versions.
[platform/upstream/libtasn1.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
3 # Free Software Foundation, Inc.
4 #
5 # This file is part of LIBTASN1.
6 #
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20 AC_PREREQ(2.61)
21 AC_INIT([GNU Libtasn1], [2.6], [bug-gnutls@gnu.org])
22 AC_CONFIG_AUX_DIR([build-aux])
23 AC_CONFIG_MACRO_DIR([m4])
24 AC_CONFIG_HEADERS(config.h)
25 AM_INIT_AUTOMAKE([1.10 -Wall -Werror -Wno-override])
26
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, 4)
32 AC_SUBST(LT_REVISION, 9)
33 AC_SUBST(LT_AGE, 1)
34
35 AC_PROG_CC
36 gl_EARLY
37 lgl_EARLY
38 AC_PROG_YACC
39 AC_PROG_LN_S
40
41 dnl Checks for programs.
42 AC_PROG_INSTALL
43 AM_MISSING_PROG(PERL, perl, $missing_dir)
44 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
45
46 AC_LIBTOOL_WIN32_DLL
47 AM_PROG_LIBTOOL
48
49 AC_CHECK_SIZEOF(unsigned long int, 4)
50 AC_CHECK_SIZEOF(unsigned int, 4)
51
52 sj_VALGRIND
53 sj_UPDATE_HEADER_VERSION([$srcdir/lib/libtasn1.h])
54
55 # Check for gtk-doc.
56 GTK_DOC_CHECK(1.2)
57
58 # For gnulib compatibility modules.
59 gl_INIT
60 lgl_INIT
61
62
63 AC_ARG_ENABLE([gcc-warnings],
64   [AS_HELP_STRING([--enable-gcc-warnings],
65                   [turn on lots of GCC warnings (for developers)])],
66   [case $enableval in
67      yes|no) ;;
68      *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
69    esac
70    gl_gcc_warnings=$enableval],
71   [gl_gcc_warnings=no]
72 )
73
74 if test "$gl_gcc_warnings" = yes; then
75   gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
76
77   nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
78   nw="$nw -Wc++-compat"             # We don't care strongly about C++ compilers
79   nw="$nw -Wtraditional"            # Warns on #elif which we use often
80   nw="$nw -Wtraditional-conversion" # Too many warnings for now
81   nw="$nw -Wconversion"             # Too many warnings for now
82   nw="$nw -Wsign-conversion"        # Too many warnings for now
83   nw="$nw -Wold-style-definition"   # 
84   nw="$nw -Wpadded"                 # Our structs are not padded
85   nw="$nw -Wundef"                  # 
86   nw="$nw -Wunreachable-code"       # Too many false positives
87   nw="$nw -Wunused-macros"          # Breaks on bison generated ASN1.c
88   nw="$nw -Wunsafe-loop-optimizations"
89   nw="$nw -Wstrict-overflow"
90
91   gl_MANYWARN_ALL_GCC([ws])
92   gl_MANYWARN_COMPLEMENT(ws, [$ws], [$nw])
93   for w in $ws; do
94     gl_WARN_ADD([$w])
95   done
96
97   gl_WARN_ADD([-Wno-missing-field-initializers])
98   gl_WARN_ADD([-Wno-sign-compare])
99   gl_WARN_ADD([-Wno-pointer-sign])
100   gl_WARN_ADD([-Wno-unused-parameter])
101   gl_WARN_ADD([-Wno-stack-protector])            # Some functions cannot be protected
102   gl_WARN_ADD([-fdiagnostics-show-option])
103 fi
104
105 AC_CONFIG_FILES([
106   Makefile
107   doc/Makefile
108   doc/cyclo/Makefile
109   doc/reference/Makefile
110   examples/Makefile
111   gl/Makefile
112   lib/Makefile
113   lib/gllib/Makefile
114   lib/libtasn1.pc
115   src/Makefile
116   tests/Makefile
117 ])
118 AC_OUTPUT
119
120 AC_MSG_NOTICE([summary of build options:
121
122   version:          ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE
123   Host type:        ${host}
124   Install prefix:   ${prefix}
125   Compiler:         ${CC}
126   Warning flags:    errors: ${WERROR_CFLAGS} warnings: ${WARN_CFLAGS}
127   Library types:    Shared=${enable_shared}, Static=${enable_static}
128   Valgrind:         ${VALGRIND}
129   Version script:   $have_ld_version_script
130 ])