1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.
This commit is contained in:
卜部昌平 2020-09-03 15:06:56 +09:00
parent 3fb255625b
commit 50b18e8129

View file

@ -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.