diff options
author | Ian Lance Taylor <ian@airs.com> | 1996-02-15 22:43:59 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1996-02-15 22:43:59 +0000 |
commit | 0e47ce975175eb4ebd425e14adf9b43e18b3dd6a (patch) | |
tree | a1d7321e0a46d39599e442cd20f35546209a1432 /configure.in | |
parent | c99fbc42b519a2983c5ae50f9b0cfd6e669ff695 (diff) | |
download | gdb-0e47ce975175eb4ebd425e14adf9b43e18b3dd6a.zip gdb-0e47ce975175eb4ebd425e14adf9b43e18b3dd6a.tar.gz gdb-0e47ce975175eb4ebd425e14adf9b43e18b3dd6a.tar.bz2 |
* 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.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 71 |
1 files changed, 41 insertions, 30 deletions
diff --git a/configure.in b/configure.in index 54b350f..0d5cbb2 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 |