Patchwork [toplevel] remove tentative_cc

login
register
mail settings
Submitter Paolo Bonzini
Date March 24, 2011, 4:59 p.m.
Message ID <4D8B788C.8090603@redhat.com>
Download mbox | patch
Permalink /patch/88246/
State New
Headers show

Comments

Paolo Bonzini - March 24, 2011, 4:59 p.m.
As Joseph pointed out in his mail, its time has come.

Paolo

2011-03-24  Paolo Bonzini  <bonzini@gnu.org>

        * configure.ac: Remove all mentions of tentative_cc.
        * configure: Regenerate.
Joseph S. Myers - April 1, 2011, 5:04 p.m.
I see there's more than just tentative_cc that tries to deal with compiler 
settings in ways that should be the responsibility of autoconf.  There's 
the

# Make sure that the compiler is able to generate an executable.  If it
# can't, we are probably in trouble.  We don't care whether we can run the
# executable--we might be using a cross compiler--we only care whether it
# can be created.  At this point the main configure script has set CC.

code - and there's probably a better autoconf-native way of testing that 
the compiler can link an executable than the shell code here.  And that's 
immediately followed by

# The Solaris /usr/ucb/cc compiler does not appear to work.

which is surely outside what the script ought to be doing.  I don't think 
the

# hpux11 in 64bit mode has libraries in a weird place.  Arrange to find
# them automatically.

code makes any sense now either; autoconf knows about /usr/X11R6/include 
if you use the right macros, while GCC appears to have known to search in 
/usr/lib/pa20_64 for this target since at least 2004.
Ralf Wildenhues - April 1, 2011, 6:19 p.m.
* Joseph S. Myers wrote on Fri, Apr 01, 2011 at 07:04:30PM CEST:
> I see there's more than just tentative_cc that tries to deal with compiler 
> settings in ways that should be the responsibility of autoconf.  There's 
> the
> 
> # Make sure that the compiler is able to generate an executable.  If it
> # can't, we are probably in trouble.  We don't care whether we can run the
> # executable--we might be using a cross compiler--we only care whether it
> # can be created.  At this point the main configure script has set CC.

The first macro invoked out of the set AC_PROG_{CC,CXX,F77,FC,OBJC} will
ensure that compiling and linking a small program of the given language
works.

So this code seems unneeded.

Thanks,
Ralf

Patch

Index: configure.ac
===================================================================
--- configure.ac	(revision 171414)
+++ configure.ac	(working copy)
@@ -1034,7 +1034,6 @@  case "${noconfigdirs}" in
 esac
 
 # Work in distributions that contain no compiler tools, like Autoconf.
-tentative_cc=""
 host_makefile_frag=/dev/null
 if test -d ${srcdir}/config ; then
 case "${host}" in
@@ -1058,18 +1057,15 @@  case "${host}" in
     host_makefile_frag="config/mh-solaris"
     ;;
   hppa*-hp-hpux10*)
-    tentative_cc="cc -Wp,-H256000"
     host_makefile_frag="config/mh-pa-hpux10"
     ;;
   hppa*-hp-hpux*)
-    tentative_cc="cc -Wp,-H256000"
     host_makefile_frag="config/mh-pa"
     ;;
   hppa*-*)	
     host_makefile_frag="config/mh-pa"
     ;;
   *-hp-hpux*)
-    tentative_cc="cc -Wp,-H256000"
     ;;
   *-*-darwin*)
     host_makefile_frag="config/mh-darwin"
@@ -1081,8 +1077,6 @@  case "${host}" in
     host_makefile_frag="config/mh-ppc-aix"
     ;;
   *-*-lynxos*)
-    # /bin/cc is less than useful for our purposes.  Always use GCC
-    tentative_cc="/bin/gcc"
     ;;
   # This is placed last to prevent interfering with the cases above.
   i[[3456789]]86-*-*)
@@ -1092,25 +1086,6 @@  case "${host}" in
 esac
 fi
 
-# If we aren't going to be using gcc, see if we can extract a definition
-# of CC from the fragment.
-# Actually, use the 'pre-extracted' version above.
-if test -z "${CC}" && test "${build}" = "${host}" ; then
-  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
-  found=
-  for dir in $PATH; do
-    test -z "$dir" && dir=.
-    if test -f $dir/gcc; then
-      found=yes
-      break
-    fi
-  done
-  IFS="$save_ifs"
-  if test -z "${found}" && test -n "${tentative_cc}" ; then
-    CC=$tentative_cc
-  fi
-fi
-
 if test "${build}" != "${host}" ; then
   AR_FOR_BUILD=${AR_FOR_BUILD-ar}
   AS_FOR_BUILD=${AS_FOR_BUILD-as}