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],
34 if test "$gl_gcc_warnings" = yes; then
35 gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
36 AC_SUBST([WERROR_CFLAGS])
38 # Add many warnings, except some...
39 nw="$nw -Wdeclaration-after-statement" # too useful to forbid
40 nw="$nw -Waggregate-return" # anachronistic
41 nw="$nw -Wc++-compat" # We don't care about C++ compilers
42 nw="$nw -Wundef" # Warns on '#if GNULIB_FOO' etc in gnulib
43 nw="$nw -Wtraditional" # Warns on #elif which we use often
44 nw="$nw -Wcast-qual" # Too many warnings for now
45 nw="$nw -Wconversion" # Too many warnings for now
46 nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
47 nw="$nw -Wsign-conversion" # Too many warnings for now
48 nw="$nw -Wtraditional-conversion" # Too many warnings for now
49 nw="$nw -Wunreachable-code" # Too many false positives
50 nw="$nw -Wpadded" # Our structs are not padded
51 nw="$nw -Wredundant-decls" # warnings in flex-generated code (isatty)
52 nw="$nw -Wlogical-op" # any use of fwrite provokes this
53 nw="$nw -Wvla" # warnings in gettext.h
54 nw="$nw -Wswitch-default" # Too many warnings for now
55 nw="$nw -Wformat-y2k" # Too many warnings for now
56 nw="$nw -Wunused-macros" # warnings in flex-generated code
57 nw="$nw -Wstrict-prototypes" # warnings in gperf-generated code
58 nw="$nw -Wmissing-noreturn" # warning in flex-generated code yy_fatal_error
59 gl_MANYWARN_ALL_GCC([ws])
60 gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw])
64 gl_WARN_ADD([-Wno-missing-field-initializers]) # We need this one
65 gl_WARN_ADD([-Wno-sign-compare]) # Too many warnings for now
66 gl_WARN_ADD([-Wno-pointer-sign]) # Too many warnings for now
67 gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
68 gl_WARN_ADD([-fdiagnostics-show-option])
70 AC_SUBST([WARN_CFLAGS])
72 AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
73 AC_DEFINE([_FORTIFY_SOURCE], [2],
74 [enable compile-time and run-time bounds-checking, and some warnings])
75 AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
82 AM_GNU_GETTEXT([external])
83 AM_GNU_GETTEXT_VERSION([0.15])