* target.h: Add enum target_waitkind, enum target_signal, and
[deliverable/binutils-gdb.git] / configure
index dd63ab3b32f076aef7efc60ca62616a6014d44b3..20e2d56413444f3779de67e0c7e42103f49fb49f 100755 (executable)
--- a/configure
+++ b/configure
@@ -88,6 +88,10 @@ undefinedargs=
 version="$Revision$"
 x11=default
 
+### we might need to use some other shell than /bin/sh for running subshells
+#
+config_shell=${CONFIG_SHELL-/bin/sh}
+
 NO_EDIT="This file was generated automatically by configure.  Do not edit."
 
 ## this is a little touchy and won't always work, but...
@@ -111,7 +115,7 @@ case "${progname}" in
         ;;
 esac
 
-for arg in $*;
+for arg in $*
 do
         # handle things that might have args following as separate words
         if [ -n "${next_prefix}" ] ; then prefix=${arg} ; prefixoption="-prefix=${prefix}" ; next_prefix=
@@ -148,6 +152,17 @@ do
                         fatal=yes
                         ;;
                 esac
+        elif [ -n "${next_host}" ] ; then
+                next_host=
+                case "${host_alias}" in
+                "")
+                        host_alias="${arg}"
+                        ;;
+                *)
+                        echo '***' Can only configure for one host at a time.  1>&2
+                        fatal=yes
+                        ;;
+                esac
         elif [ -n "${next_tmpdir}" ] ; then
                 next_tmpdir=
                 tmpdiroption="--tmpdir=${arg}"
@@ -179,6 +194,17 @@ do
                                 ;;
                         esac
                         ;;
+                -host=* | --host | --hos | --ho)
+                        case "${host_alias}" in
+                        "")
+                                next_host=yes
+                                ;;
+                        *)
+                                echo '***' Can only configure for one host at a time.  1>&2
+                                fatal=yes
+                                ;;
+                        esac
+                        ;;
                 -nfp | --nf*)
                         floating_point=no
                         ;;
@@ -313,21 +339,21 @@ case "${fatal}" in
 
 ### This is a bit twisted.
 ### * if all three are specified, this is an error.
-### * if we have neither hosts, nor unadorned args, this is an error.
+### * if we have neither hosts, nor unadorned args, guess with config.guess.
 ### * if no hosts are specified, then the unadorned args are hosts, but if
 ### there were none, this is an error.
 ### * if no targets are specified, then the unadorned args are targets, but if
 ### there were no unadorned args, then the hosts are also targets.
 
-        if [ -n "${host_alias}" -a -n "${target_alias}" -a -n "${undefs}" ] ; then
+        if [ -n "${host_alias}" -a -n "${target_alias}" -a -n "${undefs}" ]
+       then
                 echo '***' Can only configure for one host and one target at a time.  1>&2
                 fatal=yes
-        elif [ -z "${host_alias}" -a -z "${undefs}" ] ; then
-                echo '- You did not tell me what kind of host system you want to configure.
-- I will attempt to guess the kind of system this is.' 1>&2
+        elif [ -z "${host_alias}" -a -z "${target_alias}" -a -z "${undefs}" ]
+       then
                 guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
                 if tmp_alias=`${guesssys}` ; then
-                        echo "- Looks like this is a ${tmp_alias}" 1>&2
+                        echo "Configuring for a ${tmp_alias} host." 1>&2
                         host_alias=${tmp_alias}
                        case "${target_alias}" in
                        "") target_alias=${tmp_alias} ;;
@@ -335,12 +361,17 @@ case "${fatal}" in
                        esac
                        arguments="--host=${host_alias} ${arguments}"
                 else
-                        echo '- Failed to guess the system type.  You need to tell me.' 1>&2
+                        echo 'Config.guess failed to determine the host type.  You need to specify one.' 1>&2
                         fatal=yes
                 fi
         else
                 case "${host_alias}" in
-                "") host_alias=${undefs} ;;
+                "")
+                        case "${undefs}" in
+                        "")     host_alias=${target_alias} ;;
+                        *)      host_alias=${undefs} ;;
+                        esac
+                        ;;
                 *) ;;
                 esac
 
@@ -443,7 +474,7 @@ esac
 ### break up ${srcdir}/configure.in.
 case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
 "")
-        echo '***' ${srcdir}/configure.in has no "per-host:" line. 1>&2
+        echo '***' ${srcdir}/configure.in has no \"per-host:\" line. 1>&2
         exit 1
         ;;
 *) ;;
@@ -451,7 +482,7 @@ esac
 
 case "`grep '^# per\-target:' ${srcdir}/configure.in`" in
 "")
-        echo '***' ${srcdir}/configure.in has no "per-target:" line. 1>&2
+        echo '***' ${srcdir}/configure.in has no \"per-target:\" line. 1>&2
         exit 1
         ;;
 *) ;;
@@ -772,17 +803,10 @@ EOF
                 echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile}
             fi 
 
-            # fixme: this shouldn't be in configure.
-            # Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
-            case "${host_alias}" in
-              "${target_alias}")
-                      echo "ALL=all.internal" >> ${Makefile}
-                      ;;
-              *)
-                      echo "CROSS=-DCROSS_COMPILE" >> ${Makefile}
-                      echo "ALL=all.cross" >> ${Makefile}
-                      ;;
-            esac
+           # make sure that some sort of reasonable default exists for these 
+           # two variables
+           CXX=${CXX-"g++ -O"}
+           CC=${CC-cc}
 
             # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
             # remove any form feeds.
@@ -796,17 +820,18 @@ EOF
             fi
             sed -e "s:^prefix[         ]*=.*$:prefix = ${prefix}:" \
                     -e "s:^exec_prefix[        ]*=.*$:exec_prefix = ${exec_prefix}:" \
+                   -e "s:^SHELL[        ]*=.*$:SHELL = ${config_shell}:" \
                     -e "s:^srcdir[     ]*=.*$:srcdir = ${makesrcdir}:" \
                     -e "s/\f//" \
                     -e "s:^program_prefix[     ]*=.*$:program_prefix = ${program_prefix}:" \
                     -e "s:^program_suffix[     ]*=.*$:program_suffix = ${program_suffix}:" \
-                    -e "s:^program_transform_name[     ]*=.*$:program_transform_name = \"${program_transform_name}\":" \
+                    -e "s:^program_transform_name[     ]*=.*$:program_transform_name = ${program_transform_name}:" \
                     -e "s:^tooldir[    ]*=.*$:tooldir = ${tooldir}:" \
                     ${subdir}/Makefile.tem >> ${Makefile}
             # final copy now in ${Makefile}
 
         else
-           echo "No Makefile.in found in ${srcdir}, unable to configure" 1>&2
+           echo "No Makefile.in found in ${srcdir}/${subdir}, unable to configure" 1>&2
         fi
 
         rm -f ${subdir}/Makefile.tem
@@ -906,21 +931,26 @@ if [ -z "${norecursion}" -a -n "${configdirs}" ] ; then
 ### check for guested configure, otherwise fix possibly relative progname
                         if [ -f ${newsrcdir}/configure ] ; then
                                 recprog=${newsrcdir}/configure
-                        else
+                        elif [ -f ${newsrcdir}/configure.in ] ; then
                                 case "${progname}" in
                                 /*)     recprog=${progname} ;;
                                 *)      recprog=../${progname} ;;
                                 esac
+                       else
+                               eval echo No configuration information in ${configdir} ${redirect}
+                               recprog=
                         fi
 
 ### The recursion line is here.
-                        if eval ${recprog} ${verbose} --host=${host_alias} --target=${target_alias} \
-                                ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
-                                ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${removing} ${redirect} ; then
-                                true
-                        else
-                                exit 1
-                        fi
+                       if [ ! -z "${recprog}" ] ; then
+                               if eval ${config_shell} ${recprog} ${verbose} --host=${host_alias} --target=${target_alias} \
+                                       ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \
+                                       ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${removing} ${redirect} ; then
+                                       true
+                               else
+                                       exit 1
+                               fi
+                       fi
 
                         cd ${POPDIR}
                 fi
This page took 0.036013 seconds and 4 git commands to generate.