summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-03-25 22:26:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-03-25 22:26:30 -0700
commitc8e900e93eec18331e861b4e2babb4f2ac1ee519 (patch)
tree75e00f70383d84ef2885316c8ab98265c95342ac /configure
parentc01dfd73c6aa7daabf5093ae14247ecff93cda66 (diff)
downloadtxr-c8e900e93eec18331e861b4e2babb4f2ac1ee519.tar.gz
txr-c8e900e93eec18331e861b4e2babb4f2ac1ee519.tar.bz2
txr-c8e900e93eec18331e861b4e2babb4f2ac1ee519.zip
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.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure34
1 files changed, 34 insertions, 0 deletions
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 <<!