Allow a NULL value in asn1_read_value() for all types.
[platform/upstream/libtasn1.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2002-2014 Free Software Foundation, Inc.
3 #
4 # This file is part of LIBTASN1.
5 #
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.
10 #
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.
15 #
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/>.
18
19 AC_PREREQ([2.61])
20 AC_INIT([GNU Libtasn1],[3.6],[help-libtasn1@gnu.org])
21 AC_CONFIG_AUX_DIR([build-aux])
22 AC_CONFIG_MACRO_DIR([m4])
23 AC_CONFIG_HEADERS(config.h)
24 AM_INIT_AUTOMAKE([1.10 -Wall -Werror -Wno-override])
25 AM_SILENT_RULES([yes])
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, 8)
32 AC_SUBST(LT_REVISION, 2)
33 AC_SUBST(LT_AGE, 2)
34
35 AC_PROG_CC
36 gl_EARLY
37 lgl_EARLY
38 AC_PROG_YACC
39
40 dnl Checks for programs.
41 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
42 AC_LIBTOOL_WIN32_DLL
43 AM_PROG_AR
44 AM_PROG_LIBTOOL
45 GTK_DOC_CHECK(1.2)
46
47 AC_CHECK_SIZEOF(unsigned long int, 4)
48 AC_CHECK_SIZEOF(unsigned int, 4)
49
50 sj_UPDATE_HEADER_VERSION([$srcdir/lib/libtasn1.h])
51
52 # For gnulib compatibility modules.
53 gl_INIT
54 lgl_INIT
55
56 AC_ARG_ENABLE([gcc-warnings],
57   [AS_HELP_STRING([--enable-gcc-warnings],
58                   [turn on lots of GCC warnings (for developers)])],
59   [case $enableval in
60      yes|no) ;;
61      *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
62    esac
63    gl_gcc_warnings=$enableval],
64   [gl_gcc_warnings=no]
65 )
66
67 if test "$gl_gcc_warnings" = yes; then
68   gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
69
70   nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
71   nw="$nw -Wc++-compat"             # We don't care strongly about C++ compilers
72   nw="$nw -Wtraditional"            # Warns on #elif which we use often
73   nw="$nw -Wtraditional-conversion" # Too many warnings for now
74   nw="$nw -Wconversion"             # Too many warnings for now
75   nw="$nw -Wsign-conversion"        # Too many warnings for now
76   nw="$nw -Wold-style-definition"   #
77   nw="$nw -Wpadded"                 # Our structs are not padded
78   nw="$nw -Wundef"                  #
79   nw="$nw -Wunreachable-code"       # Too many false positives
80   nw="$nw -Wunused-macros"          # Breaks on bison generated ASN1.c
81   nw="$nw -Wswitch-default"         # Breaks on bison generated ASN1.c
82   nw="$nw -Wunsafe-loop-optimizations"
83   nw="$nw -Wstrict-overflow"
84   nw="$nw -Wsuggest-attribute=pure" # Is it worth using pure attributes?
85
86   gl_MANYWARN_ALL_GCC([ws])
87   gl_MANYWARN_COMPLEMENT(ws, [$ws], [$nw])
88   for w in $ws; do
89     gl_WARN_ADD([$w])
90   done
91
92   gl_WARN_ADD([-Wno-type-limits])
93   gl_WARN_ADD([-Wno-missing-field-initializers])
94   gl_WARN_ADD([-Wno-unused-parameter])
95   gl_WARN_ADD([-Wno-stack-protector])            # Some functions cannot be protected
96   gl_WARN_ADD([-fdiagnostics-show-option])
97 fi
98
99 AC_CONFIG_FILES([
100   Makefile
101   doc/Makefile
102   doc/cyclo/Makefile
103   doc/reference/Makefile
104   doc/reference/version.xml
105   examples/Makefile
106   gl/Makefile
107   lib/Makefile
108   lib/gllib/Makefile
109   lib/libtasn1.pc
110   src/Makefile
111   tests/Makefile
112 ])
113 AC_OUTPUT
114
115 AC_MSG_NOTICE([summary of build options:
116
117   version:          ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE
118   Host type:        ${host}
119   Install prefix:   ${prefix}
120   Compiler:         ${CC}
121   Warning flags:    errors: ${WERROR_CFLAGS} warnings: ${WARN_CFLAGS}
122   Library types:    Shared=${enable_shared}, Static=${enable_static}
123   Valgrind:         ${VALGRIND}
124   Version script:   $have_ld_version_script
125 ])