summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-12-22 07:44:29 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-12-22 07:44:29 -0800
commit0fc0ee99965ae1657bb212702ba489333fbe193b (patch)
treedba820a35d1e90efec479d45fc5d98d489402375 /configure
parent806f1cbfee655871344f8fa4a0cf8a4336e49e1e (diff)
downloadtxr-0fc0ee99965ae1657bb212702ba489333fbe193b.tar.gz
txr-0fc0ee99965ae1657bb212702ba489333fbe193b.tar.bz2
txr-0fc0ee99965ae1657bb212702ba489333fbe193b.zip
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.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure11
1 files changed, 9 insertions, 2 deletions
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()