From: Ian Lance Taylor Date: Thu, 15 Feb 1996 22:43:59 +0000 (+0000) Subject: * configure.in: Don't get CC from the host Makefile fragment if we X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0e47ce975175eb4ebd425e14adf9b43e18b3dd6a;p=binutils-gdb.git * configure.in: Don't get CC from the host Makefile fragment if we can find gcc in PATH, or if this is a Canadian Cross. Move the Solaris test for /usr/ucb/cc to the post target script, just after the compiler sanity test. --- diff --git a/ChangeLog b/ChangeLog index 738d2f6dbdf..be850cab9d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Feb 15 17:42:25 1996 Ian Lance Taylor + + * configure.in: Don't get CC from the host Makefile fragment if we + can find gcc in PATH, or if this is a Canadian Cross. Move the + Solaris test for /usr/ucb/cc to the post target script, just after + the compiler sanity test. + Wed Feb 14 16:57:40 1996 Ian Lance Taylor * config.sub: Merge with FSF. diff --git a/configure.in b/configure.in index 54b350f5f9b..0d5cbb28069 100644 --- a/configure.in +++ b/configure.in @@ -128,9 +128,20 @@ case "${host}" in esac fi -# See if we can extract a definition of CC from the fragment. -if [ -z "${CC}" ]; then - if [ -n "${host_makefile_frag}" -a -f "${srcdir}/${host_makefile_frag}" ]; then +# If we aren't going to be using gcc, see if we can extract a definition +# of CC from the fragment. +if [ -z "${CC}" -a "${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 [ -z "${found}" -a -n "${host_makefile_frag}" -a -f "${srcdir}/${host_makefile_frag}" ]; then xx=`sed -n -e 's/^[ ]*CC[ ]*=[ ]*\(.*\)$/\1/p' < ${srcdir}/${host_makefile_frag}` if [ -n "${xx}" ] ; then CC=$xx @@ -138,33 +149,6 @@ if [ -z "${CC}" ]; then fi fi -# The Solaris /usr/ucb/cc compiler does not appear to work. -case "${host}" in - sparc-sun-solaris2*) - if [ "`/usr/bin/which ${CC-cc}`" = "/usr/ucb/cc" ] ; then - could_use= - [ -d /opt/SUNWspro/bin ] && could_use="/opt/SUNWspro/bin" - if [ -d /opt/cygnus/bin ] ; then - if [ "$could_use" = "" ] ; then - could_use="/opt/cygnus/bin" - else - could_use="$could_use or /opt/cygnus/bin" - fi - fi - if [ "$could_use" = "" ] ; then - echo "Warning: compilation may fail because you're using" - echo "/usr/ucb/cc. You should change your PATH or CC " - echo "variable and rerun configure." - else - echo "Warning: compilation may fail because you're using" - echo "/usr/ucb/cc, when you should use the C compiler from" - echo "$could_use. You should change your" - echo "PATH or CC variable and rerun configure." - fi - fi - ;; -esac - # We default to --with-shared on platforms where -fpic is meaningless. # Well, we don't yet, but we will. if false && [ "${host}" = "${target}" ] && [ x${enable_shared} = x ]; then @@ -710,6 +694,33 @@ else fi rm -f conftest* +# The Solaris /usr/ucb/cc compiler does not appear to work. +case "${host}" in + sparc-sun-solaris2*) + if [ "`/usr/bin/which ${CC-cc}`" = "/usr/ucb/cc" ] ; then + could_use= + [ -d /opt/SUNWspro/bin ] && could_use="/opt/SUNWspro/bin" + if [ -d /opt/cygnus/bin ] ; then + if [ "$could_use" = "" ] ; then + could_use="/opt/cygnus/bin" + else + could_use="$could_use or /opt/cygnus/bin" + fi + fi + if [ "$could_use" = "" ] ; then + echo "Warning: compilation may fail because you're using" + echo "/usr/ucb/cc. You should change your PATH or CC " + echo "variable and rerun configure." + else + echo "Warning: compilation may fail because you're using" + echo "/usr/ucb/cc, when you should use the C compiler from" + echo "$could_use. You should change your" + echo "PATH or CC variable and rerun configure." + fi + fi + ;; +esac + # If --enable-shared was set, we must set LD_LIBRARY_PATH so that the # binutils tools will find libbfd.so. if [ "${enable_shared}" = "yes" ]; then