1 # Process this file with autoconf to produce a configure script.
3 AC_INIT([GNU cppi], m4_esyscmd([build-aux/git-version-gen .tarball-version]),
5 AC_CONFIG_SRCDIR(src/cppi.l)
7 AC_CONFIG_AUX_DIR([build-aux])
8 AC_CONFIG_HEADERS([lib/config.h:config.hin])
10 AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz color-tests parallel-tests])
11 AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
13 AM_MISSING_PROG([HELP2MAN], [help2man])
23 AC_ARG_ENABLE([gcc-warnings],
24 [AS_HELP_STRING([--enable-gcc-warnings],
25 [turn on lots of GCC warnings (for developers)])],
28 *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
30 gl_gcc_warnings=$enableval],
31 [if test -d "$srcdir"/.git; then
38 if test "$gl_gcc_warnings" = yes; then
39 gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
40 AC_SUBST([WERROR_CFLAGS])
42 # Add many warnings, except some...
43 nw="$nw -Wdeclaration-after-statement" # too useful to forbid
44 nw="$nw -Waggregate-return" # anachronistic
45 nw="$nw -Wlong-long" # C90 is anachronistic
46 nw="$nw -Wc++-compat" # We don't care about C++ compilers
47 nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
48 nw="$nw -Wtraditional" # Warns on #elif which we use often
49 nw="$nw -Wcast-qual" # Too many warnings for now
50 nw="$nw -Wconversion" # Too many warnings for now
51 nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
52 nw="$nw -Wsign-conversion" # Too many warnings for now
53 nw="$nw -Wtraditional-conversion" # Too many warnings for now
54 nw="$nw -Wunreachable-code" # Too many false positives
55 nw="$nw -Wpadded" # Our structs are not padded
56 nw="$nw -Wredundant-decls" # warnings in flex-generated code (isatty)
57 nw="$nw -Wlogical-op" # any use of fwrite provokes this
58 nw="$nw -Wvla" # warnings in gettext.h
59 nw="$nw -Wswitch-default" # Too many warnings for now
60 nw="$nw -Wformat-y2k" # Too many warnings for now
61 nw="$nw -Wunused-macros" # warnings in flex-generated code
62 nw="$nw -Wstrict-prototypes" # warnings in gperf-generated code
63 nw="$nw -Wmissing-noreturn" # warning in flex-generated code yy_fatal_error
64 gl_MANYWARN_ALL_GCC([ws])
65 gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
69 gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
70 gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now
71 gl_WARN_ADD([-Wno-pointer-sign]) # Too many warnings for now
72 gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
73 gl_WARN_ADD([-fdiagnostics-show-option])
75 AC_SUBST([WARN_CFLAGS])
77 AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
78 AH_VERBATIM([FORTIFY_SOURCE],
79 [/* Enable compile-time and run-time bounds-checking, and some warnings,
80 without upsetting glibc 2.15+. */
81 #if defined __OPTIMIZE__ && __OPTIMIZE__
82 # define _FORTIFY_SOURCE 2
85 AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
92 AM_GNU_GETTEXT([external])
93 AM_GNU_GETTEXT_VERSION([0.18.1])
95 # Now that configure no longer creates src/ or man/, create them here.
96 # Doing it this way is more maintainable that adding to each individual
97 # Makefile rule that creates a file in one of those sub-directories.
100 AC_CONFIG_FILES([Makefile po/Makefile.in])