Skip to content

Commit c184860

Browse files
committed
bpo-33483: Correctly handle finding the C compiler
Instead of passing configure args such as --without-gcc or --with-icc, instead prefer to rely on the native way of finding the compiler: passing CC (or CPP or CXX depending). This allows configure to find the correct compiler instead of having to be explicitly told. It also more correctly builds on both macOS and FreeBSD since the system compiler is used by default (cc)
1 parent 046d311 commit c184860

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

configure.ac

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -555,43 +555,6 @@ EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
555555
# when running configure or make. The build should not break if they do.
556556
# BASECFLAGS should generally not be messed with, however.
557557

558-
# XXX shouldn't some/most/all of this code be merged with the stuff later
559-
# on that fiddles with OPT and BASECFLAGS?
560-
AC_MSG_CHECKING(for --without-gcc)
561-
AC_ARG_WITH(gcc,
562-
AS_HELP_STRING([--without-gcc], [never use gcc]),
563-
[
564-
case $withval in
565-
no) CC=${CC:-cc}
566-
without_gcc=yes;;
567-
yes) CC=gcc
568-
without_gcc=no;;
569-
*) CC=$withval
570-
without_gcc=$withval;;
571-
esac], [
572-
case $ac_sys_system in
573-
AIX*) CC=${CC:-xlc_r}
574-
without_gcc=;;
575-
*) without_gcc=no;;
576-
esac])
577-
AC_MSG_RESULT($without_gcc)
578-
579-
AC_MSG_CHECKING(for --with-icc)
580-
AC_ARG_WITH(icc,
581-
AS_HELP_STRING([--with-icc], [build with icc]),
582-
[
583-
case $withval in
584-
no) CC=${CC:-cc}
585-
with_icc=no;;
586-
yes) CC=icc
587-
CXX=icpc
588-
with_icc=yes;;
589-
*) CC=$withval
590-
with_icc=$withval;;
591-
esac], [
592-
with_icc=no])
593-
AC_MSG_RESULT($with_icc)
594-
595558
# If the user switches compilers, we can't believe the cache
596559
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
597560
then
@@ -1749,7 +1712,6 @@ yes)
17491712
BASECFLAGS="$BASECFLAGS -m486 -DSCO5"
17501713
;;
17511714

1752-
# is there any other compiler on Darwin besides gcc?
17531715
Darwin*)
17541716
# -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
17551717
# used to be here, but non-Apple gcc doesn't accept them.

0 commit comments

Comments
 (0)