autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH CVS] OS/2 CONFIG_SHELL


From: Ilya Zakharevich
Subject: [PATCH CVS] OS/2 CONFIG_SHELL
Date: Thu, 30 Jan 2003 15:15:53 -0800
User-agent: Mutt/1.4i

The number of bugs of autoconf'ed configure scripts on OS/2 rapidly
going down, it makes sense to fix the remaining problems one by one in
the autoconf sources.  [Usually I just run my convert_configure script
which finds the bugs and fixes them "alive" in the configure script.]

The fix below is for a kinda cosmetic bug: configure scripts assume
that /bin/sh is present, thus won't work; this may be fixed by setting
CONFIG_SHELL=sh.  The chunk below is modelled by the
_AS_LINENO_PREPARE, but fixes a bug in _AS_LINENO_PREPARE.  It sets
CONFIG_SHELL automatically if needed.

  [The bug in _AS_LINENO_PREPARE is that pdksh sets $LINENO to 0 for what
  is given as -c-argument; thus the test in _AS_LINENO_PREPARE will
  not detect sh if it is actually pdksh.  I fix it in the chunk below
  (but not in _AS_LINENO_PREPARE chunk!) by writing the test script to
  conf$$.sh - instead of giving it as -c argument.]

I do not know how to patch autoconf source, so the patch below is
against configure (of autoconf itself).  Probably one can append it to
_AS_LINENO_PREPARE?

Enjoy,
Ilya

--- ./configure-pre-os2 Tue Dec  3 00:03:06 2002
+++ ./configure Thu Jan 30 00:58:02 2003
@@ -185,6 +211,42 @@ done
   exit
 }
 
+if test -z "$CONFIG_SHELL"; then
+  # Test whether /bin/sh exists on this system
+  if ! /bin/sh -c "exit 0" 2>/dev/null; then
+    # Try without path
+    echo 'as_lineno_1=$LINENO'                                 > conf$$.sh
+    echo 'as_lineno_2=$LINENO'                                 >> conf$$.sh
+    echo 'as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`'   >> conf$$.sh
+    echo 'test "x$as_lineno_1" != "x$as_lineno_2" &&'          >> conf$$.sh
+    echo 'test "x$as_lineno_3"  = "x$as_lineno_2" '            >> conf$$.sh
+    for as_base in sh bash ksh sh5; do
+      if (test -z "$as_CONFIG_SHELL" && $as_base ./conf$$.sh) 2>/dev/null; then
+        # Use as is (we could try to find it on path too)
+       as_CONFIG_SHELL=$as_base
+      fi
+    done
+    if test -n "$as_CONFIG_SHELL"; then
+      # Now find it on path
+      as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+      for as_dir in $PATH
+      do
+        IFS=$as_save_IFS
+        test -z "$as_dir" && as_dir=.
+       test "X$as_dir" = X. && as_dir=`pwd`
+        if (test -z "$CONFIG_SHELL" && "$as_dir/$as_CONFIG_SHELL" ./conf$$.sh) 
2>/dev/null; then
+          CONFIG_SHELL="$as_dir/$as_CONFIG_SHELL"
+        fi
+      done
+      if test -z "$CONFIG_SHELL"; then
+        # Last resort: without path
+        CONFIG_SHELL="$as_CONFIG_SHELL"
+      fi
+      export CONFIG_SHELL
+    fi
+    rm -f conf$$.sh
+  fi
+fi
 
 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
   *c*,-n*) ECHO_N= ECHO_C='




reply via email to

[Prev in Thread] Current Thread [Next in Thread]