aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-09-03 15:06:56 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-09-03 15:14:09 +0900
commit50b18e81295ad2d45975e4d8ea1e0c7e85140b97 (patch)
treef9805193185d023636465b38b8ff81c92622091b /configure.ac
parent3fb255625bba37cd948751163f620a4b2926c394 (diff)
downloadruby-50b18e81295ad2d45975e4d8ea1e0c7e85140b97.tar.gz
configure: detect that there is no g++
AC_PROG_CXX checks for several C++ compilers INCLUDING g++. When none of them were found it sets the CXX variable to be g++. This doesn't make any sense. Absense of g++ has already been made sure. Because we don't want insanity (that's the whole reason we test the environment using autoconf), we need to swipe such insane variable out.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac8
1 files changed, 8 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e4a7542663..cbfce070e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,6 +197,14 @@ AC_CHECK_TOOLS([STRIP], [gstrip strip], [:])
AS_IF([test ! $rb_test_CFLAGS], [AS_UNSET(CFLAGS)]); AS_UNSET(rb_test_CFLAGS)
AS_IF([test ! $rb_test_CXXFLAGS], [AS_UNSET(CXXFLAGS)]); AS_UNSET(rb_save_CXXFLAGS)
+AS_IF([test "${CXX}" = "g++" -a -z "${GXX}"], [
+ # AC_PROG_CXX sets $CXX to "g++" when it purposefully finds that there is
+ # _no_ g++. This brain-damaged design must be worked around. Thankfully,
+ # similar thing doesn't happen for AC_PROG_CC.
+ AC_MSG_NOTICE([C++ features disabled due to lack of a C++ compiler.])
+ AS_UNSET(CXX)
+])
+
test x"$target_alias" = x &&
target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
ac_install_sh='' # unusable for extension libraries.