diff --git a/racket/src/configure b/racket/src/configure index 6d95e527d4..63bd11a103 100755 --- a/racket/src/configure +++ b/racket/src/configure @@ -3268,7 +3268,16 @@ if test "${enable_ios}" != "" ; then SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} LDFLAGS="'"'"${LDFLAGS}"'"' fi + if test "${enable_oskit}" = "no" ; then + # Auto-set CC, CPP, etc. + + if test "${CFLAGS}${CC}${CPP}" = "" ; then + starts_out_default=yes + else + starts_out_default=no + fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4195,6 +4204,18 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + + if test "$starts_out_default" = "yes" ; then + if test "$GCC" = "yes" ; then + # Auto selection of C compiler picked GCC, so we + # assume it also picked the GNU preprocessor; move + # auto-picked CFLAGS to PREFLAGS so that compilation + # and preprocessing are in sync (e.g., for optimization flags) + PREFLAGS="${CFLAGS} ${PREFLAGS}" + CPPFLAGS="${CFLAGS} ${CPPFLAGS}" + CFLAGS="" + fi + fi if test "$AS" = '' ; then AS="${ac_tool_prefix}as" as_was_set=no diff --git a/racket/src/racket/configure.ac b/racket/src/racket/configure.ac index 48766f53d7..f7f19853a9 100644 --- a/racket/src/racket/configure.ac +++ b/racket/src/racket/configure.ac @@ -539,10 +539,31 @@ if test "${enable_ios}" != "" ; then SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} CPPFLAGS="'"'"${PREFLAGS}"'"' SUB_CONFIGURE_EXTRAS="${SUB_CONFIGURE_EXTRAS} LDFLAGS="'"'"${LDFLAGS}"'"' fi - + + if test "${enable_oskit}" = "no" ; then + # Auto-set CC, CPP, etc. + + if test "${CFLAGS}${CC}${CPP}" = "" ; then + starts_out_default=yes + else + starts_out_default=no + fi + AC_PROG_CC AC_PROG_CPP + + if test "$starts_out_default" = "yes" ; then + if test "$GCC" = "yes" ; then + # Auto selection of C compiler picked GCC, so we + # assume it also picked the GNU preprocessor; move + # auto-picked CFLAGS to PREFLAGS so that compilation + # and preprocessing are in sync (e.g., for optimization flags) + PREFLAGS="${CFLAGS} ${PREFLAGS}" + CPPFLAGS="${CFLAGS} ${CPPFLAGS}" + CFLAGS="" + fi + fi if test "$AS" = '' ; then AS="${ac_tool_prefix}as" as_was_set=no