From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John David Anglin" To: dave@hiauly1.hia.nrc.ca (John David Anglin) Cc: law@cygnus.com, egcs-bugs@egcs.cygnus.com, gcc-patches@gcc.gnu.org Subject: Re: VAX Ultrix bootstrap failure: cc: -o would overwrite Date: Mon, 22 May 2000 09:45:00 -0000 Message-id: <200005221645.MAA10697@hiauly1.hia.nrc.ca> References: X-SW-Source: 2000-05/msg01257.html The following patch corrects configure.in so that the proper compiler variable is tested when checking whether to set NO_MINUS_C_MINUS_O to yes. Note that the ${ac_cc} substition has to be done first. It also adds a test to see if ${CC-cc} supports -Wno-long-long. If gcc is being used for stage1, the stage1_warn_cflags are set to " -W -Wall -Wtraditional -pedantic -Wwrite-strings" when gcc doesn't support -Wno-long-long, and to $(WARN_CFLAGS) when it does. Please review. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605) 2000-05-22 J. David Anglin * configure.in: Evaluate the correct variable to test and check for -Wno-long-long support. --- configure.in.orig Thu May 18 19:41:11 2000 +++ configure.in Mon May 22 12:07:32 2000 @@ -322,18 +322,32 @@ # Find the native compiler AC_PROG_CC AC_PROG_CC_C_O -if test $ac_cv_prog_cc_${ac_cc}_c_o = no; then +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then NO_MINUS_C_MINUS_O=yes fi AC_SUBST(NO_MINUS_C_MINUS_O) gcc_AC_C_LONG_DOUBLE +AC_MSG_CHECKING(whether ${CC-cc} accepts -Wno-long-long) +echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -Wno-long-long -c conftest.c 2>&1`"; then + ac_cv_prog_cc_no_long_long=yes +else + ac_cv_prog_cc_no_long_long=no +fi +rm -f conftest* +echo "$ac_t"$ac_cv_prog_cc_no_long_long 1>&6 + # If the native compiler is GCC, we can enable warnings even in stage1. # That's useful for people building cross-compilers, or just running a # quick `make'. if test "x$GCC" = "xyes"; then - stage1_warn_cflags='$(WARN_CFLAGS)' + if test $ac_cv_prog_cc_no_long_long = yes; then + stage1_warn_cflags='$(WARN_CFLAGS)' + else + stage1_warn_cflags=" -W -Wall -Wtraditional -pedantic -Wwrite-strings" + fi else stage1_warn_cflags="" fi