* Makefile.in (install): Depend upon installdirs. Use
[deliverable/binutils-gdb.git] / configure
index ee6880e552d8a53bd2ac9d83c2e5af1acad9b4c3..83a3bf9d908dcc5d6e0db554d4d9187d338116df 100755 (executable)
--- a/configure
+++ b/configure
@@ -141,11 +141,14 @@ do
                ;;
 # These options have mandatory values.  Since we didn't find an = sign,
 # the value must be in the next argument
-       --b* | --cache* | --ex* | --ho* | --pre* | --program-p* | --program-s* | --program-t* | --si* | --sr* | --ta* | --tm* | --x-*)
+       --bu* | --cache* | --ex* | --ho* | --pre* | --program-p* | --program-s* | --program-t* | --si* | --sr* | --ta* | --tm* | --x-* | --bi* | --sb* | --li* | --da* | --sy* | --sh* | --lo* | --in* | --ol* | --ma*)
                optarg=$1
                shift
                arguments="$arguments $option=$optarg"
                ;;
+       --v)
+               arguments="$arguments -v"
+               ;;
        --*)
                arguments="$arguments $option"
                ;;
@@ -154,7 +157,7 @@ do
 # Now, process the options
        case $option in
 
-       --build* | --b*)
+       --build* | --bu*)
                case "$build_alias" in
                "") build_alias=$optarg ;;
                *) echo '***' Can only configure for one build machine at a time.  1>&2
@@ -177,8 +180,8 @@ do
                esac
 
                enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
-               eval $enableopt="$optarg"
-               enableoptions="$enableoptions $option"
+               eval "$enableopt='$optarg'"
+               enableoptions="$enableoptions '$option'"
                ;;
        --exec-prefix* | --ex*)
                exec_prefix=$optarg
@@ -200,6 +203,7 @@ do
                ;;
        --nfp | --nf*)
                floating_point=no
+               floating_pointoption="--nfp"
                ;;
        --norecursion | --no*)
                norecursion=yes
@@ -282,6 +286,9 @@ do
                ;;
        --x-i* | --x-l*) other_options="$other_options $orig_option"
                ;;
+       --bi* | --sb* | --li* | --da* | --sy* | --sh* | --lo* | --in* | --ol* | --ma*)
+               # These options were added to autoconf for emacs.
+               ;;
        --*)
                echo "configure: Unrecognized option: \"$orig_option\"; use --help for usage." >&2
                exit 1
@@ -333,7 +340,7 @@ case "${fatal}" in
                        # Neither --host option nor undefs were present.
                        # Call config.guess.
                        guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
-                       if host_alias=`${guesssys}`
+                       if host_alias=`${config_shell} ${guesssys}`
                        then
                                # If the string we are going to use for
                                # the target is a prefix of the string
@@ -419,7 +426,7 @@ configsub=`echo ${progname} | sed 's/configure$/config.sub/'`
 moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'`
 
 # this is a hack.  sun4 must always be a valid host alias or this will fail.
-if ${configsub} sun4 >/dev/null 2>&1 ; then
+if ${config_shell} ${configsub} sun4 >/dev/null 2>&1 ; then
         true
 else
         echo '***' cannot find config.sub.  1>&2
@@ -427,7 +434,7 @@ else
 fi
 
 touch config.junk
-if ${moveifchange} config.junk config.trash ; then
+if ${config_shell} ${moveifchange} config.junk config.trash ; then
         true
 else
         echo '***' cannot find move-if-change.  1>&2
@@ -505,7 +512,7 @@ case "`grep '^# per\-host:' ${srcdir}/configure.in`" in
                ${program_prefixoption} ${program_suffixoption} \
                ${program_transform_nameoption} ${site_option} \
                ${withoptions} ${withoutoptions} \
-               ${enableoptions} ${disableoptions} \
+               ${enableoptions} ${disableoptions} ${floating_pointoption} \
                ${cache_file_option} ${removing} ${other_options} ${redirect}
          else
            echo '***' There is no configure script present though. 1>&2
@@ -566,9 +573,9 @@ esac
 case "${build_alias}" in
 "")
        if result=`${config_shell} ${configsub} ${host_alias}` ; then
-           build_cpu=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
-           build_vendor=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
-           build_os=`echo $result | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
+           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}
            build_alias=${host_alias}
        fi
@@ -576,9 +583,9 @@ case "${build_alias}" in
 *)
        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_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
@@ -593,9 +600,9 @@ 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/'`
+host_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 host=${host_cpu}-${host_vendor}-${host_os}
 
 . ${tmpfile}.hst
@@ -606,9 +613,9 @@ 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/'`
+target_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 target=${target_cpu}-${target_vendor}-${target_os}
 
 . ${tmpfile}.tgt
@@ -666,8 +673,8 @@ fi
 if [ -z "${CC}" -a -r Makefile ]; then
   sed -n -e ':loop
 /\\$/ N
-/\\$/ b loop
 s/\\\n//g
+t loop
 /^CC[  ]*=/ s/CC[      ]*=[    ]*\(.*\)/\1/p' < Makefile > Makefile.cc
   CC=`tail -1 Makefile.cc`
   rm -f Makefile.cc
@@ -676,19 +683,58 @@ fi
 if [ -z "${CXX}" -a -r Makefile ]; then
   sed -n -e ':loop
 /\\$/ N
-/\\$/ b loop
 s/\\\n//g
+t loop
 /^CXX[         ]*=/ s/CXX[     ]*=[    ]*\(.*\)/\1/p' < Makefile > Makefile.cc
   CXX=`tail -1 Makefile.cc`
   rm -f Makefile.cc
 fi
 
+# Generate a default definition for YACC.  This is used if the makefile can't
+# locate bison or byacc in objdir.
+
+for prog in 'bison -y' byacc yacc
+do
+  set dummy $prog; tmp=$2
+  IFS="${IFS=  }"; save_ifs="$IFS"; IFS="${IFS}:"
+  for dir in $PATH; do
+    test -z "$dir" && dir=.
+    if test -f $dir/$tmp; then
+      DEFAULT_YACC="$prog"
+      break
+    fi
+  done
+  IFS="$save_ifs"
+
+  test -n "$DEFAULT_YACC" && break
+done
+
+# Generate a default definition for LEX.  This is used if the makefile can't
+# locate flex in objdir.
+
+for prog in flex lex
+do
+  set dummy $prog; tmp=$2
+  IFS="${IFS=  }"; save_ifs="$IFS"; IFS="${IFS}:"
+  for dir in $PATH; do
+    test -z "$dir" && dir=.
+    if test -f $dir/$tmp; then
+      DEFAULT_LEX="$prog"
+      break
+    fi
+  done
+  IFS="$save_ifs"
+
+  test -n "$DEFAULT_LEX" && break
+done
+
 if [ "${build}" != "${host}" ]; then
   # If we are doing a Canadian Cross, in which the host and build systems
   # are not the same, we set reasonable default values for the tools.
 
   tools="AR AR_FOR_TARGET AS AS_FOR_TARGET BISON CC_FOR_BUILD"
-  tools="${tools} CC_FOR_TARGET CXX_FOR_TARGET HOST_PREFIX"
+  tools="${tools} CC_FOR_TARGET CXX_FOR_TARGET"
+  tools="${tools} DLLTOOL DLLTOOL_FOR_TARGET HOST_PREFIX"
   tools="${tools} HOST_PREFIX_1 LD LD_FOR_TARGET LEX MAKEINFO NM"
   tools="${tools} NM_FOR_TARGET RANLIB RANLIB_FOR_TARGET"
 
@@ -696,8 +742,8 @@ if [ "${build}" != "${host}" ]; then
     if [ -z "`eval 'echo $'"${var}"`" -a -r Makefile ]; then
       sed -n -e ':loop
 /\\$/ N
-/\\$/ b loop
 s/\\\n//g
+t loop
 /^'"${var}"'[  ]*=/ s/'"${var}"'[      ]*=[    ]*\(.*\)/\1/p' \
        < Makefile > Makefile.v
       t=`tail -1 Makefile.v`
@@ -717,6 +763,8 @@ s/\\\n//g
   CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
   CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc}
   CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-gcc}
+  DLLTOOL=${DLLTOOL-${host_alias}-dlltool}
+  DLLTOOL_FOR_TARGET=${DLLTOOL_FOR_TARGET-${target_alias}-dlltool}
   HOST_PREFIX=${build_alias}-
   HOST_PREFIX_1=${build_alias}-
   LD=${LD-${host_alias}-ld}
@@ -769,6 +817,7 @@ s/\\\n//g
   export AS
   export AR
   export CC_FOR_BUILD
+  export DLLTOOL
   export LD
   export NM
   export RANLIB
@@ -793,6 +842,20 @@ fi
 export CC
 export CXX
 
+case "$host" in
+       *go32*)
+           enable_gdbtk=no ;;
+       *cygwin32*)
+           enable_gdbtk=no ;;
+esac
+
+# Determine whether gdb needs tk/tcl or not.
+if [ "$enable_gdbtk" != "no" ]; then
+       GDB_TK="all-tcl all-tk"
+else
+       GDB_TK=""
+fi
+
 for subdir in . ${subdirs} ; do
 
     # ${subdir} is relative path from . to the directory we're currently
@@ -1045,24 +1108,27 @@ EOF
                    -e "/^CC[   ]*=/{
                        :loop1
                        /\\\\$/ N
-                       /\\\\$/ b loop1
                        s/\\\\\\n//g
+                       t loop1
                        s%^CC[  ]*=.*$%CC = ${CC}%
                        }" \
                    -e "/^CXX[  ]*=/{
                        :loop2
                        /\\\\$/ N
-                       /\\\\$/ b loop2
                        s/\\\\\\n//g
+                       t loop2
                        s%^CXX[         ]*=.*$%CXX = ${CXX}%
                        }" \
                    -e "s:^SHELL[        ]*=.*$:SHELL = ${config_shell}:" \
+                   -e "s:^GDB_TK[       ]*=.*$:GDB_TK = ${GDB_TK}:" \
                     -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:^tooldir[    ]*=.*$:tooldir = ${tooldir}:" \
+                   -e "s:^DEFAULT_YACC[         ]*=.*$:DEFAULT_YACC = ${DEFAULT_YACC}:" \
+                   -e "s:^DEFAULT_LEX[  ]*=.*$:DEFAULT_LEX = ${DEFAULT_LEX}:" \
                     ${subdir}/Makefile.tem >> ${Makefile}
 
            # If this is a Canadian Cross, preset the values of many more
@@ -1210,7 +1276,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} ${cache_file_option} ${removing} ${other_options} ${redirect} ; then
+                                       ${srcdiroption} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${floating_pointoption} ${cache_file_option} ${removing} ${other_options} ${redirect} ; then
                                        true
                                else
                                        echo Configure in `pwd` failed, exiting. 1>&2
This page took 0.047628 seconds and 4 git commands to generate.