1 dnl Process this file with autoconf to produce a configure script.
2 # Copyright (C) 2002-2022 Free Software Foundation, Inc.
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_INIT([GNU Libtasn1],
20 m4_esyscmd([build-aux/git-version-gen .tarball-version]),
21 [help-libtasn1@gnu.org])
23 # Library code modified: REVISION++
24 # Interfaces changed/added/removed: CURRENT++ REVISION=0
25 # Interfaces added: AGE++
26 # Interfaces removed: AGE=0
27 AC_SUBST(LT_CURRENT, 12)
28 AC_SUBST(LT_REVISION, 3)
31 AC_SUBST([MAJOR_VERSION], [`echo $PACKAGE_VERSION|cut -d'.' -f1`])
32 AC_SUBST([MINOR_VERSION], [`echo $PACKAGE_VERSION|cut -d'.' -f2`])
33 AC_SUBST([PATCH_VERSION], [`echo $PACKAGE_VERSION.0|cut -d. -f3|cut -d- -f1`])
34 AC_SUBST([NUMBER_VERSION], [`printf '0x%02x%02x%02x' $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`])
36 AC_MSG_NOTICE([$PACKAGE_NAME $PACKAGE_VERSION $PACKAGE_TARNAME $MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION $NUMBER_VERSION $LT_CURRENT:$LT_REVISION:$LT_AGE $DLL_VERSION])
38 AC_CONFIG_AUX_DIR([build-aux])
39 AC_CONFIG_MACRO_DIR([m4])
40 AC_CONFIG_HEADERS(config.h)
42 AM_INIT_AUTOMAKE([-Wall -Wno-portability])
43 AM_SILENT_RULES([yes])
51 AS_HELP_STRING([--disable-doc], [don't generate any documentation]),
52 enable_doc=$enableval, enable_doc=yes)
53 AM_CONDITIONAL(ENABLE_DOC, test "$enable_doc" != "no")
55 AC_CHECK_FUNCS([clock_gettime fmemopen])
57 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
61 AC_CHECK_SIZEOF(unsigned long int, 4)
62 AC_CHECK_SIZEOF(unsigned int, 4)
69 AC_ARG_ENABLE([gcc-warnings],
70 [AS_HELP_STRING([--disable-gcc-warnings],
71 [disable GCC warnings (for developers)])],
74 *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
76 gl_gcc_warnings=$enableval],
80 if test "$gl_gcc_warnings" = yes; then
81 gl_MANYWARN_ALL_GCC([warnings])
83 nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
84 nw="$nw -Wc++-compat" # We don't care strongly about C++ compilers
85 nw="$nw -Wundef" # All compiler preprocessors support #if UNDEF
86 nw="$nw -Wtraditional" # All compilers nowadays support ANSI C
87 nw="$nw -Wconversion" # These warnings usually don't point to mistakes.
88 nw="$nw -Wpadded" # Padding internal structs doesn't help.
89 nw="$nw -Wunused-macros" # Lot's of warnings in ASN1.y
90 nw="$nw -Woverlength-strings" # Modern compilers handle strings > 4096 gracefully
91 nw="$nw -Wsuggest-attribute=pure" # Asked for several nodes handling functions
93 gl_MANYWARN_COMPLEMENT([warnings], [$warnings], [$nw])
94 for w in $warnings; do
98 gl_WARN_ADD([-Wno-type-limits]) # Too many warnings from gnulib macros
99 gl_WARN_ADD([-Wformat-truncation=1])
100 gl_WARN_ADD([-Wimplicit-fallthrough=2])
101 gl_WARN_ADD([-Wno-unused-parameter])
102 gl_WARN_ADD([-fdiagnostics-show-option])
103 gl_WARN_ADD([-fdiagnostics-color=always]) # colors even when using ccache
106 AC_ARG_ENABLE([fuzzing],
107 [AS_HELP_STRING([--enable-fuzzing], [Turn on fuzzing build (for developers)])],
108 [enable_fuzzing=yes; AC_SUBST([LIB_FUZZING_ENGINE])], [enable_fuzzing=no; LIB_FUZZING_ENGINE=""])
109 AM_CONDITIONAL([FUZZING], [test "$enable_fuzzing" = "yes"])
112 AC_SEARCH_LIBS([dlsym], [dl dld])
115 AC_SUBST([FUZZ_LIBS])
120 doc/reference/Makefile
125 lib/includes/libtasn1.h
133 AC_MSG_NOTICE([Summary of build options:
136 Libtool version $LT_CURRENT:$LT_REVISION:$LT_AGE
137 DLL version: $DLL_VERSION
138 Header version: major $MAJOR_VERSION minor $MINOR_VERSION patch $PATCH_VERSION number $NUMBER_VERSION
139 Build/host system: ${build} / ${host}
140 Install prefix: ${prefix}
142 Warning flags: ${WARN_CFLAGS}
143 CFLAGS: ${CFLAGS} ${CPPFLAGS}
145 Documentation: ${enable_doc}
146 Library types: Shared=${enable_shared}, Static=${enable_static}
147 Valgrind: $gl_cv_prog_valgrind_works ${VALGRIND}
148 Version script: $have_ld_version_script
149 Fuzzing build: $enable_fuzzing $LIB_FUZZING_ENGINE