X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=configure;h=ccfcdc9fe44d1b2aafa691ae8a9a83129253d5cb;hb=7ec658304ad3bd40e5ae60c10c5c06cb80796a73;hp=833a17864b4e4f98f33fcf34eb76075f334d2de2;hpb=1be96eebd818371393c5e4e62b6bdb6afc07a12e;p=deliverable%2Fbinutils-gdb.git diff --git a/configure b/configure index 833a17864b..ccfcdc9fe4 100755 --- a/configure +++ b/configure @@ -19,8 +19,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# Please email any bugs, comments, and/or additions to this file to: +# Please report any problems running this configure script to # configure@cygnus.com +# Please do not send reports about other problems to this address. See +# gdb/README, gas/README, etc., for info on where and how to report +# problems about particular tools. # This file was written by K. Richard Pixley. @@ -50,6 +53,8 @@ Makefile=Makefile Makefile_in=Makefile.in arguments=$* build_alias= +cache_file= +cache_file_option= configdirs= exec_prefix= exec_prefixoption= @@ -141,7 +146,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 +163,9 @@ do ;; esac ;; + --cache*) + cache_file=$optarg + ;; --disable-*) enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'` eval $enableopt=no @@ -390,13 +398,13 @@ if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then 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 soft floating point [hard float]' + 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 "sparc-sunos", "mips-ultrix", etc.' + echo 'Where HOST and TARGET are something like "sparc-sunos", "mips-sgi-irix5", etc.' echo if [ -r config.status ] ; then cat config.status @@ -462,6 +470,34 @@ esac case "`grep '^# per\-host:' ${srcdir}/configure.in`" in "") echo '***' ${srcdir}/configure.in has no \"per-host:\" line. 1>&2 + # Check for a directory that's been converted to use autoconf since + # it was last configured. + if grep AC_OUTPUT ${srcdir}/configure.in >/dev/null ; then + echo '***' Hmm, looks like this directory has been autoconfiscated. 1>&2 + if [ -r ${srcdir}/configure ] ; then + echo '***' Running the local configure script. 1>&2 + case "${cache_file}" in + "") cache_file_option= ;; + *) cache_file_option="--cache-file=${cache_file}" ;; + esac + srcdiroption="--srcdir=${srcdir}" + case "${build_alias}" in + "") buildopt= ;; + *) buildopt="--build=${build_alias}" ;; + esac + eval exec ${config_shell} ${srcdir}/configure ${verbose} \ + ${buildopt} --host=${host_alias} --target=${target_alias} \ + ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \ + ${srcdiroption} \ + ${program_prefixoption} ${program_suffixoption} \ + ${program_transform_nameoption} ${site_option} \ + ${withoptions} ${withoutoptions} \ + ${enableoptions} ${disableoptions} \ + ${cache_file_option} ${removing} ${other_options} ${redirect} + else + echo '***' There is no configure script present though. 1>&2 + fi + fi exit 1 ;; *) ;; @@ -482,8 +518,12 @@ 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 +# Note that under many versions of sh a trap handler for 0 will *override* any +# exit status you explicitly specify! At this point, the only non-error exit +# is at the end of the script; these actions are duplicated there, minus +# the "exit 1". Don't use "exit 0" anywhere after this without resetting the +# trap handler, or you'll lose. +trap "rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos; exit 1" 0 1 2 15 # split ${srcdir}/configure.in into common, per-host, per-target, # and post-target parts. Post-target is optional. @@ -513,16 +553,25 @@ esac case "${build_alias}" in "") ;; *) - result=`${configsub} ${build_alias}` - buildopt="--build=${build_alias}" - build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` - build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` - build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` - build=${build_cpu}-${build_vendor}-${build_os} + if result=`${config_shell} ${configsub} ${build_alias}` ; then + buildopt="--build=${build_alias}" + build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` + build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` + build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` + build=${build_cpu}-${build_vendor}-${build_os} + else + echo "Unrecognized build system name ${build_alias}." 1>&2 + exit 1 + fi ;; esac -result=`${configsub} ${host_alias}` +if result=`${config_shell} ${configsub} ${host_alias}` ; then + true +else + echo "Unrecognized host system name ${host_alias}." 1>&2 + exit 1 +fi host_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` host_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` host_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` @@ -530,7 +579,12 @@ host=${host_cpu}-${host_vendor}-${host_os} . ${tmpfile}.hst -result=`${configsub} ${target_alias}` +if result=`${config_shell} ${configsub} ${target_alias}` ; then + true +else + echo "Unrecognized target system name ${target_alias}." 1>&2 + exit 1 +fi target_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` target_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` target_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'` @@ -574,10 +628,11 @@ if [ "${host_alias}" != "${target_alias}" ] ; then fi fi -# Merge program_prefix and program_suffix onto program_transform_name -# Use a double $ so that make ignores it +# Merge program_prefix and program_suffix onto program_transform_name. +# (program_suffix used to use $, but it's hard to preserve $ through both +# make and sh.) if [ "${program_suffix}" != "" ] ; then - program_transform_name="-e s,\$\$,${program_suffix}, ${program_transform_name}" + program_transform_name="-e s,\\\\(.*\\\\),\\\\1${program_suffix}, ${program_transform_name}" fi if [ "${program_prefix}" != "" ] ; then @@ -946,6 +1001,18 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then ;; esac + # Handle --cache-file=../XXX + case "${cache_file}" in + "") # empty + ;; + /*) # absolute path + cache_file_option="--cache-file=${cache_file}" + ;; + *) # relative path + cache_file_option="--cache-file=../${cache_file}" + ;; + esac + ### check for guested configure, otherwise fix possibly relative progname if [ -f ${newsrcdir}/configure ] ; then recprog=${newsrcdir}/configure @@ -963,7 +1030,7 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then if [ ! -z "${recprog}" ] ; then if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${target_alias} \ ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \ - ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${removing} ${other_options} ${redirect} ; then + ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${cache_file_option} ${removing} ${other_options} ${redirect} ; then true else echo Configure in `pwd` failed, exiting. 1>&2 @@ -976,6 +1043,11 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then done fi +# Perform the same cleanup as the trap handler, minus the "exit 1" of course, +# and reset the trap handler. +rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos +trap 0 + exit 0 #