* configure: If OSTYPE matches *win32*, try to find a good value for
authorIan Lance Taylor <ian@airs.com>
Wed, 13 Aug 1997 02:40:46 +0000 (02:40 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 13 Aug 1997 02:40:46 +0000 (02:40 +0000)
CONFIG_SHELL.

ChangeLog
configure

index 175307ccee79fb939f554b4dc681a372eae6350f..cfe5762fb5336a9cda0eaa24b585bff4248d063f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Aug 12 22:33:08 1997  Ian Lance Taylor  <ian@cygnus.com>
+
+       * configure: If OSTYPE matches *win32*, try to find a good value for
+       CONFIG_SHELL.
+
 start-sanitize-ide
 Mon Aug 11 13:49:46 1997  Ian Lance Taylor  <ian@cygnus.com>
 
index 3ce76c64e5865e56a6585d474f6cdc432aae6aa8..20c00484a3d4cdcffc0c94175b533e04b693158e 100755 (executable)
--- a/configure
+++ b/configure
@@ -85,7 +85,36 @@ 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}
+      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
+             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."
@@ -791,7 +820,7 @@ t loop
        break
       fi
       if test -f $dir/bison; then
-       BISON=bison
+       BISON="bison -y"
        break
       fi
       if test -f $dir/yacc; then
@@ -800,7 +829,9 @@ t loop
       fi
     done
     IFS="$save_ifs"
-    BISON=${BISON-bison}
+    if [ -z "${BISON}" ]; then
+      BISON="bison -y"
+    fi
   fi
 
   if [ -z "${LEX}" ]; then
@@ -1158,7 +1189,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//" \