Lots of changes from David Mosberger-Tang; see ChangeLog and NOTES for details:
[deliverable/binutils-gdb.git] / configure
index bdc1db82f8bc0a07f2f1769351851402bf680a42..a42b59d73ee19c290b400bdd28b643b119a6d9dc 100755 (executable)
--- a/configure
+++ b/configure
@@ -141,7 +141,7 @@ do
                ;;
 # These options have mandatory values.  Since we didn't find an = sign,
 # the value must be in the next argument
-       --b* | --ex* | --ho* | --pre* | --program-p* | --program-s* | --program-t* | --si* | --sr* | --ta* | --tm* | --x-*)
+       --b* | --cache* | --ex* | --ho* | --pre* | --program-p* | --program-s* | --program-t* | --si* | --sr* | --ta* | --tm* | --x-*)
                optarg=$1
                shift
                ;;
@@ -158,6 +158,9 @@ do
                   ;;
                esac
                ;;
+# Accepted for compatibility with new autoconf; ignored.
+       --cache*)
+               ;;
        --disable-*)
                enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
                eval $enableopt=no
@@ -212,7 +215,7 @@ do
        --program-transform-name* | --program-t*)
                # Double any backslashes or dollar signs in the argument
                program_transform_name="${program_transform_name} -e `echo ${optarg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`"
-               program_transform_nameoption="--program-transform-nameoption='$optarg'"
+               program_transform_nameoption="${program_transform_nameoption} --program-transform-name='$optarg'"
                ;;
        --rm)
                removing=--rm
@@ -328,6 +331,20 @@ case "${fatal}" in
                        guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
                        if host_alias=`${guesssys}`
                        then
+                               # If the string we are going to use for
+                               # the target is a prefix of the string
+                               # we just guessed for the host, then
+                               # assume we are running native, and force
+                               # the same string for both target and host.
+                               case $target_alias in
+                               NOTARGET) ;;
+                               *)
+                                       if expr $host_alias : $target_alias >/dev/null
+                                       then
+                                               host_alias=$target_alias
+                                       fi
+                                       ;;
+                               esac
                                echo "Configuring for a ${host_alias} host." 1>&2
                                arguments="--host=$host_alias $arguments"
                        else
@@ -360,29 +377,29 @@ esac
 
 if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then
        exec 1>&2
-       echo Usage: configure [OPTIONS] HOST
+       echo Usage: configure [OPTIONS] [HOST]
        echo
        echo Options: [defaults in brackets]
-       echo ' --prefix=MYDIR            configure for installation of host independent files into MYDIR. ["/usr/local"]'
-       echo ' --exec-prefix=MYDIR       configure for installation of host dependent files into MYDIR. ["/usr/local"]'
-       echo ' --help                    print this message. [normal config]'
-       echo ' --build=BUILD             configure for building on BUILD [BUILD=HOST]'
-       echo ' --host=HOST               configure for HOST [determined via config.guess]'
-       echo ' --norecursion             configure this directory only. [recurse]'
-       echo ' --program-prefix=FOO      install programs with FOO prepended to their names. [ "" ]'
-       echo ' --program-suffix=FOO      install programs with FOO appended to their names. [ "" ]'
-       echo ' --program-transform-name=FOO install programs with names transformed by sed pattern FOO. [ "" ]'
-       echo ' --site=SITE               configure with site specific makefile for SITE'
-       echo ' --srcdir=DIR              find the sources in DIR. ["." or ".."]'
-       echo ' --target=TARGET   configure for TARGET.  [TARGET = HOST]'
-       echo ' --tmpdir=TMPDIR   create temporary files in TMPDIR.  [ TMPDIR = "/tmp" ]'
-       echo ' --nfp                     configure the compilers default to soft floating point. [hard float]'
+       echo ' --prefix=MYDIR            install into MYDIR [/usr/local]'
+       echo ' --exec-prefix=MYDIR       install host-dependent files into MYDIR [/usr/local]'
+       echo ' --help                    print this message [normal config]'
+       echo ' --build=BUILD             configure for building on BUILD [BUILD=HOST]'
+       echo ' --host=HOST               configure for HOST [determined via config.guess]'
+       echo ' --norecursion             configure this directory only [recurse]'
+       echo ' --program-prefix=FOO      prepend FOO to installed program names [""]'
+       echo ' --program-suffix=FOO      append FOO to installed program names [""]'
+       echo ' --program-transform-name=P transform installed names by sed pattern P [""]'
+       echo ' --site=SITE               configure with site-specific makefile for SITE'
+       echo ' --srcdir=DIR              find the sources in DIR [. or ..]'
+       echo ' --target=TARGET   configure for TARGET [TARGET=HOST]'
+       echo ' --tmpdir=TMPDIR   create temporary files in TMPDIR [/tmp]'
+       echo ' --nfp                     configure for software floating point [hard float]'
        echo ' --with-FOO, --with-FOO=BAR package FOO is available (parameter BAR)'
        echo ' --without-FOO             package FOO is NOT available'
        echo ' --enable-FOO, --enable-FOO=BAR include feature FOO (parameter BAR)'
        echo ' --disable-FOO             do not include feature FOO'
        echo
-       echo 'Where HOST and TARGET are something like "sun4", "decstation", "encore", etc.'
+       echo 'Where HOST and TARGET are something like "sparc-sunos", "mips-sgi-irix5", etc.'
        echo
        if [ -r config.status ] ; then
                cat config.status
@@ -439,7 +456,7 @@ case "${srcdir}" in
 esac
 
 # default exec_prefix
-case "${exec_prefix}" in
+case "${exec_prefixoption}" in
 "") exec_prefix="\$(prefix)" ;;
 *) ;;
 esac
@@ -468,6 +485,7 @@ esac
 
 # keep this filename short for &%*%$*# 14 char file names
 tmpfile=${TMPDIR}/cONf$$
+trap "rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos; exit 1" 1 2 15
 trap "rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos" 0
 
 # split ${srcdir}/configure.in into common, per-host, per-target,
@@ -657,8 +675,8 @@ for subdir in . ${subdirs} ; do
                 .) ;;
                 *) cat > ${subdir}/.gdbinit <<EOF
 # ${NO_EDIT}
-dir .
 dir ${makesrcdir}
+dir .
 source ${makesrcdir}/.gdbinit
 EOF
                         ;;
@@ -743,6 +761,7 @@ EOF
                       fi
                       if [ -f ${package_makefile_frag} ] ; then
                               sed -e "/^####/  r ${package_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile}
+                             rm -f ${subdir}/Makefile.tem
                       else
                               echo '***' Expected package makefile fragment \"${package_makefile_frag}\" 1>&2
                               echo '***' is missing in ${PWD=`pwd`}. 1>&2
@@ -755,11 +774,6 @@ EOF
 
             # real copy now in ${subdir}/Makefile.tem
 
-            # Remove patch suffixes from host name.
-            # See similar code in configure.in.
-            # Example: 'sparc-sun-sunos4.1.3_U1'
-            host_osnop=`echo ${host_os} | sed '/sunos/s/_U1//'`
-
             # prepend warning about editting, and a bunch of variables.
             rm -f ${Makefile}
             cat > ${Makefile} <<EOF
@@ -770,7 +784,7 @@ host_alias = ${host_alias}
 host_cpu = ${host_cpu}
 host_vendor = ${host_vendor}
 host_os = ${host_os}
-host_canonical = ${host_cpu}-${host_vendor}-${host_osnop}
+host_canonical = ${host_cpu}-${host_vendor}-${host_os}
 target_alias = ${target_alias}
 target_cpu = ${target_cpu}
 target_vendor = ${target_vendor}
@@ -779,13 +793,12 @@ target_canonical = ${target_cpu}-${target_vendor}-${target_os}
 EOF
            case "${build}" in
              "") ;;
-             *) build_osnop=`echo ${build_os} | sed '/sunos/s/_U1//'` 
-                 cat >> ${Makefile} << EOF
+             *)  cat >> ${Makefile} << EOF
 build_alias = ${build_alias}
 build_cpu = ${build_cpu}
 build_vendor = ${build_vendor}
 build_os = ${build_os}
-build_canonical = ${build_cpu}-${build_vendor}-${build_osnop}
+build_canonical = ${build_cpu}-${build_vendor}-${build_os}
 EOF
            esac
 
This page took 0.027539 seconds and 4 git commands to generate.