diff options
author | rlar <rlar> | 2016-03-29 13:59:39 +0200 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2016-03-31 07:11:51 -0400 |
commit | f1ce47684c73c71bc32bfb07372229f7f9876a97 (patch) | |
tree | 1212627e10741c3cdc5531f92941e9496bdcfd6e /configure.ac | |
parent | babe9a1e8eeb5497756d4d7998dd1ca82c62a189 (diff) |
configure option `--enable-warnings' and `WARNINGFLAGS'
`WARNINGFLAGS' can be passed when invoking `configure'
and when invoking `make'
if configure switch `--enable-warnings' was given
then default to something useful if we have `GCC'
`WARNINGFLAGS' is not used when compiling `stage1flex'
to avoid unnecessary clutter
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 2bfdd1e..14dfea1 100644 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,18 @@ AC_PROG_LN_S AC_PROG_AWK AC_PROG_INSTALL +# allow passing a variable `WARNINGFLAGS', +# either when invoking `configure', or when invoking `make' +# default to something useful if GCC was detected + +AC_ARG_ENABLE([warnings], + [AS_HELP_STRING([--enable-warnings], + [enable a bunch of compiler warning flags (defaults to GCC warning flags).])], + [AS_IF([test "x$GCC" == xyes], + [ : ${WARNINGFLAGS="-Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wconversion -Wno-unused-but-set-variable"} ])]) + +AC_SUBST([WARNINGFLAGS]) + AC_PATH_PROG([BISON], bison, no) AS_IF([test "$BISON" != no],[], [ AC_SUBST([BISON], [\${top_srcdir}/build-aux/missing bison]) |