Improve gcc detection in configure script (#2897)
Improve gcc detection in configure script We have been detecting gcc by the CC variable but this fails under ubuntu for example where you might specify CC='gcc-8' to ./configure. Also consider clang impersonator to be gcc. Related to #2890
This commit is contained in:
parent
3cb41850fa
commit
b6627956b6
|
@ -4610,7 +4610,13 @@ SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} AR_FLAGS="'"'"${ARFLAGS}"'"'
|
|||
is_gmake=`make -v no-such-target-we-hope 2>&1 | grep "GNU Make"`
|
||||
|
||||
# If using gcc, we want all warnings:
|
||||
if test "$CC" = "gcc" ; then
|
||||
is_gcc=`$CC -v 2>&1 | tail -n 1 | grep -E '^gcc version [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ \([^\)]+\)[[:space:]]*$'`
|
||||
|
||||
# We also need to test if $CC is gcc itself because on mac,
|
||||
# where clang impersonates gcc, although is_gcc is false, we want
|
||||
# to use it as if it was gcc.
|
||||
# See https://github.com/racket/racket/pull/2897#pullrequestreview-314906673
|
||||
if test "$is_gcc" != "" || test "`basename $CC`" = "gcc"; then
|
||||
COMPFLAGS="$COMPFLAGS -Wall"
|
||||
|
||||
# Use -MMD when we have gcc and gnumake:
|
||||
|
|
|
@ -463,7 +463,15 @@ SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} AR_FLAGS="'"'"${ARFLAGS}"'"'
|
|||
is_gmake=`make -v no-such-target-we-hope 2>&1 | grep "GNU Make"`
|
||||
|
||||
# If using gcc, we want all warnings:
|
||||
if test "$CC" = "gcc" ; then
|
||||
changequote(<<, >>)dnl
|
||||
is_gcc=`$CC -v 2>&1 | tail -n 1 | grep -E '^gcc version [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ \([^\)]+\)[[:space:]]*$'`
|
||||
changequote([, ])dnl
|
||||
|
||||
# We also need to test if $CC is gcc itself because on mac,
|
||||
# where clang impersonates gcc, although is_gcc is false, we want
|
||||
# to use it as if it was gcc.
|
||||
# See https://github.com/racket/racket/pull/2897#pullrequestreview-314906673
|
||||
if test "$is_gcc" != "" || test "`basename $CC`" = "gcc"; then
|
||||
COMPFLAGS="$COMPFLAGS -Wall"
|
||||
|
||||
# Use -MMD when we have gcc and gnumake:
|
||||
|
|
Loading…
Reference in New Issue
Block a user