From c8e900e93eec18331e861b4e2babb4f2ac1ee519 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 25 Mar 2020 22:26:30 -0700 Subject: configure: remove C diagnostic options under C++. * configure (cplusplus): New variable. Check ccname and cc for signs of C++; if so, set the new variable to 'y'. If the variable is set, then filter C-specific options out of diag_flags. --- configure | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/configure b/configure index aaf8217b..cc6d44a8 100755 --- a/configure +++ b/configure @@ -118,6 +118,7 @@ cross= compiler_prefix= ccname='$(CC)' cc='$(cross)$(compiler_prefix)$(ccname)' +cplusplus= intptr= exe= tool_prefix= @@ -698,6 +699,39 @@ else build_in_srcdir=y fi +printf "Are we using a C++ compiler ..." + +case $ccname in +*'++' | *'$(CXX)' ) + cplusplus=y + ;; +esac + +case $cc in +*'++' | '$(CXX)' ) + cplusplus=y + ;; +esac + +if [ $cplusplus ] ; then + printf "yes\n" + set -- $diag_flags + diag_flags='' + for flag in "$@" ; do + case $flag in + *=implicit-function-declaration | \ + *=missing-prototypes | \ + *=strict-prototypes ) + continue + ;; + esac + diag_flags="$diag_flags $flag" + done + diag_flags=${diag_flags# } +else + printf "no\n" +fi + gen_config_make() { cat > config.make <