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