diff --git a/configure.ac b/configure.ac index c28441b1..c321335c 100644 --- a/configure.ac +++ b/configure.ac @@ -89,6 +89,11 @@ AC_PROG_CXX LT_INIT AM_SANITY_CHECK +# Verify that the selected compiler actually supports C11 +AS_IF([test "x$ac_cv_prog_cc_c11" = "xno"], [ + CFLAGS="${CFLAGS} -std=gnu99 -Wno-c11-extensions" + ]) + # Checks for library functions #AC_CHECK_FUNCS([strlcpy strlcat]) OCFLAGS=$CFLAGS diff --git a/htp/Makefile.am b/htp/Makefile.am index a3e82456..188f012c 100644 --- a/htp/Makefile.am +++ b/htp/Makefile.am @@ -18,7 +18,7 @@ c_sources = bstr.c bstr_builder.c htp_base64.c htp_config.c htp_connection.c htp library_includedir = $(includedir)/$(GENERIC_LIBRARY_NAME) library_include_HEADERS = $(h_sources) -AM_CFLAGS = -I$(top_srcdir) -I$(top_builddir)/htp -D_GNU_SOURCE -g -Wall -Wextra -std=gnu99 -pedantic \ +AM_CFLAGS = -I$(top_srcdir) -I$(top_builddir)/htp -D_GNU_SOURCE -g -Wall -Wextra -pedantic \ -Wextra -Wno-missing-field-initializers -Wshadow -Wpointer-arith \ -Wstrict-prototypes -Wmissing-prototypes -Wno-unused-parameter diff --git a/htp/lzma/Makefile.am b/htp/lzma/Makefile.am index 5fa3ec50..438f9f76 100644 --- a/htp/lzma/Makefile.am +++ b/htp/lzma/Makefile.am @@ -5,7 +5,7 @@ h_sources_private = LzFind.h LzHash.h Compiler.h Precomp.h c_sources = LzFind.c LzmaDec.c -AM_CFLAGS = -I$(top_srcdir) -D_GNU_SOURCE -g -Wall -Wextra -std=gnu99 -pedantic \ +AM_CFLAGS = -I$(top_srcdir) -D_GNU_SOURCE -g -Wall -Wextra -pedantic \ -Wextra -Wno-missing-field-initializers -Wshadow -Wpointer-arith \ -Wstrict-prototypes -Wmissing-prototypes -Wno-unused-parameter diff --git a/test/Makefile.am b/test/Makefile.am index e2ecf77f..c703f3e6 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,6 +1,6 @@ LDADD = $(top_builddir)/htp/libhtp.la -lz @LIBICONV@ -AM_CFLAGS = -D_GNU_SOURCE -g -Wall -Wextra -std=gnu99 -pedantic \ +AM_CFLAGS = -D_GNU_SOURCE -g -Wall -Wextra -pedantic \ -Wextra -Wno-missing-field-initializers -Wshadow -Wpointer-arith \ -Wstrict-prototypes -Wmissing-prototypes -Wno-unused-parameter