Tue Aug 19 08:59:12 1997 Fred Fish <fnf@cygnus.com>
[deliverable/binutils-gdb.git] / configure
index 9096df2a5ad1762fd5eda6b0e50a3a1a19781c82..0185f0e719c11e5a82252171399fcfd0169b65d6 100755 (executable)
--- a/configure
+++ b/configure
@@ -85,7 +85,38 @@ version="$Revision$"
 x11=default
 
 ### we might need to use some other shell than /bin/sh for running subshells
-#
+
+### If we are on Windows, search for the shell.  This will permit people
+### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
+### without also having to set CONFIG_SHELL.  This code will work when
+### using bash, which sets OSTYPE.
+case "${OSTYPE}" in
+*win32*)
+  if [ x${CONFIG_SHELL} = x ]; then
+    if [ ! -f /bin/sh ]; then
+      if [ x${SHELL} != x ] && [ -f ${SHELL} ]; then
+       CONFIG_SHELL=${SHELL}
+       export CONFIG_SHELL
+      else
+       for prog in sh sh.exe bash bash.exe; do
+         IFS="${IFS=   }"; save_ifs="$IFS"; IFS="${IFS}:"
+         for dir in $PATH; do
+           test -z "$dir" && dir=.
+           if test -f $dir/$prog; then
+             CONFIG_SHELL=$dir/$prog
+             export CONFIG_SHELL
+             break
+           fi
+         done
+         IFS="$save_ifs"
+         test -n "${CONFIG_SHELL}" && break
+       done
+      fi
+    fi
+  fi
+  ;;
+esac
+
 config_shell=${CONFIG_SHELL-/bin/sh}
 
 NO_EDIT="This file was generated automatically by configure.  Do not edit."
@@ -738,7 +769,7 @@ if [ "${build}" != "${host}" ]; then
   tools="${tools} DLLTOOL DLLTOOL_FOR_TARGET GCC_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"
-  tools="${tools} WINDRES WINDRES_FOR_TARGET"
+  tools="${tools} WINDRES WINDRES_FOR_TARGET YACC"
 
   for var in ${tools}; do
     if [ -z "`eval 'echo $'"${var}"`" -a -r Makefile ]; then
@@ -760,6 +791,7 @@ t loop
   AR_FOR_TARGET=${AR_FOR_TARGET-${target_alias}-ar}
   AS=${AS-${host_alias}-as}
   AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as}
+  BISON=${BISON-bison}
   CC=${CC-${host_alias}-gcc}
   CFLAGS=${CFLAGS-"-g -O2"}
   CXX=${CXX-${host_alias}-c++}
@@ -782,25 +814,27 @@ t loop
   WINDRES=${WINDRES-${host_alias}-windres}
   WINDRES_FOR_TARGET=${WINDRES_FOR_TARGET-${target_alias}-windres}
 
-  if [ -z "${BISON}" ]; then
+  if [ -z "${YACC}" ]; then
     IFS="${IFS=        }"; save_ifs="$IFS"; IFS="${IFS}:"
     for dir in $PATH; do
       test -z "$dir" && dir=.
-      if test -f $dir/byacc; then
-       BISON=byacc
+      if test -f $dir/bison; then
+       YACC="bison -y"
        break
       fi
-      if test -f $dir/bison; then
-       BISON=bison
+      if test -f $dir/byacc; then
+       YACC=byacc
        break
       fi
       if test -f $dir/yacc; then
-       BISON=yacc
+       YACC=yacc
        break
       fi
     done
     IFS="$save_ifs"
-    BISON=${BISON-bison}
+    if [ -z "${YACC}" ]; then
+      YACC="bison -y"
+    fi
   fi
 
   if [ -z "${LEX}" ]; then
@@ -863,13 +897,17 @@ export CXX
 export CFLAGS
 export CXXFLAGS
 
+# FIXME: This should be in configure.in, not configure
 case "$host" in
        *go32*)
            enable_gdbtk=no ;;
+       *msdosdjgpp*)
+           enable_gdbtk=no ;;
        *cygwin32*)
            enable_gdbtk=no ;;
 esac
 
+# FIXME: This should be in configure.in, not configure
 # Determine whether gdb needs tk/tcl or not.
 if [ "$enable_gdbtk" != "no" ]; then
        GDB_TK="all-tcl all-tk all-itcl all-tix"
@@ -1117,12 +1155,12 @@ EOF
             # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS,
             # remove any form feeds.
             if [ -z "${subdirs}" ]; then
-                rm -f ${subdir}/Makefile.tem2
+                rm -f ${subdir}/Makefile.tm2
                 sed -e "s:^SUBDIRS[    ]*=.*$:SUBDIRS = ${configdirs}:" \
                     -e "s:^NONSUBDIRS[         ]*=.*$:NONSUBDIRS = ${noconfigdirs}:" \
-                    ${subdir}/Makefile.tem > ${subdir}/Makefile.tem2
+                    ${subdir}/Makefile.tem > ${subdir}/Makefile.tm2
                 rm -f ${subdir}/Makefile.tem
-                mv ${subdir}/Makefile.tem2 ${subdir}/Makefile.tem
+                mv ${subdir}/Makefile.tm2 ${subdir}/Makefile.tem
            fi
            sed     -e "s|^prefix[      ]*=.*$|prefix = ${prefix}|" \
                     -e "s|^exec_prefix[        ]*=.*$|exec_prefix = ${exec_prefix}|" \
@@ -1154,7 +1192,7 @@ EOF
                        t loop4
                        s%^CXXFLAGS[    ]*=.*$%CXXFLAGS = ${CXXFLAGS}%
                        }" \
-                   -e "s:^SHELL[        ]*=.*$:SHELL = ${config_shell}:" \
+                   -e "s|^SHELL[        ]*=.*$|SHELL = ${config_shell}|" \
                    -e "s:^GDB_TK[       ]*=.*$:GDB_TK = ${GDB_TK}:" \
                     -e "s|^srcdir[     ]*=.*$|srcdir = ${makesrcdir}|" \
                     -e "s/\f//" \
This page took 0.024476 seconds and 4 git commands to generate.