From 0fc0ee99965ae1657bb212702ba489333fbe193b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 22 Dec 2020 07:44:29 -0800 Subject: configure: relax to C99 for regular users. The code will continue to stick to C90, but requesting C90 compatibility from GCC may break for downstream users in some environments that don't support C90 in their header files. * configure (lang_flags): Remove -ansi option from here. (usage): Help text for maintainer mode updated. (mainline): Add -std=c++98 to the front of lang_flags if compiling as C++, -std=c90 in maintainer mode, else -std=c99. --- configure | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'configure') diff --git a/configure b/configure index c801a86c..75fd7591 100755 --- a/configure +++ b/configure @@ -158,7 +158,7 @@ yacc_given= yacc_is_newer_bison= nm='$(cross)$(tool_prefix)nm' opt_flags='-O2 -fno-stack-protector' -lang_flags='-ansi -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE' +lang_flags='-D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200112 -D_GNU_SOURCE' diag_flags="-Wall -Wextra -Werror=implicit-function-declaration \ -Werror=missing-prototypes -Werror=strict-prototypes \ -Werror=old-style-declaration -Werror=old-style-definition" @@ -323,7 +323,8 @@ maintainer [$maintainer] mode, otherwise the build is configured for user mode. In maintainer mode, the scanner and parser generator tools are expected to be available. In user mode, the shipped parser and scanner are used. Changes to - the parser.l and parser.y files will have no effect. + the parser.l and parser.y files will have no effect. In maintainer mode, + also, c90 is used if compiling the code as C. prefix [$prefix] @@ -779,8 +780,14 @@ if [ $cplusplus ] ; then diag_flags="$diag_flags $flag" done diag_flags=${diag_flags# } + lang_flags="-std=c++98 $lang_flags" else printf "no\n" + if [ $maintainer ] ; then + lang_flags="-std=c90 $lang_flags" + else + lang_flags="-std=c99 $lang_flags" + fi fi gen_config_make() -- cgit v1.2.3