From a2a17186c282d670a41da8cdf38ccf0fb1222a4e Mon Sep 17 00:00:00 2001 From: Viktor Tarasov Date: Fri, 3 Jun 2016 11:06:14 +0200 Subject: [PATCH] autoconf: option to disable -Werror=declaration-after-statement old GCCs (distributed with RedHat 5) do not understand this option --- configure.ac | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 80f51cb7..1ae54545 100644 --- a/configure.ac +++ b/configure.ac @@ -224,6 +224,13 @@ AC_ARG_ENABLE( [enable_dnie_ui="no"] ) +AC_ARG_ENABLE( + [werror-declaration-after-statement], + [AS_HELP_STRING([--disable-werror-declaration-after-statement],[disable -Werror 'declaration-after-statement' @<:@enabled@:>@])], + , + [werror_declaration_after_statement="yes"] +) + AC_ARG_WITH( [xsl-stylesheetsdir], [AS_HELP_STRING([--with-xsl-stylesheetsdir=PATH],[docbook xsl-stylesheets for svn build @<:@detect@:>@])], @@ -244,6 +251,7 @@ AC_ARG_WITH( , [with_pkcs11_provider="detect"] ) + dnl ./configure check reader_count="" for rdriver in "${enable_pcsc}" "${enable_openct}" "${enable_ctapi}"; do @@ -775,7 +783,9 @@ if test "$GCC" = "yes"; then CFLAGS="-fno-strict-aliasing ${CFLAGS}" fi -CFLAGS="${CFLAGS} -Werror=declaration-after-statement" +if test "${werror_declaration_after_statement}" = "yes"; then + CFLAGS="${CFLAGS} -Werror=declaration-after-statement" +fi AC_CONFIG_FILES([ Makefile