httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <bri...@kheldar.apana.org.au>
Subject Re: Removing hard coded /bin/sh from top level Makefile
Date Mon, 29 Mar 1999 06:49:09 GMT
On Fri, 26 Mar 1999 23:53:49 +0100, Ralf S. Engelschall wrote:

>> I tried using APACI configure on OS/2 and to my surprise it actually works
>> without any changes. The only problem is that the top level Makefile contains
>> a hard coded SHELL=/bin/sh which isn't the case on OS/2 so I'd like to make
>> the following change if it looks ok to everyone.
>
>The patch is fine, +1. 
>
>But a little bit of background: The reason why there is a hard-coded
>SHELL=/bin/sh (and not just a SHELL=sh or no SHELL definition at all, etc.) is
>because one has to make sure the commands are really run with the Bourne-Shell
>and not with the shell of the user (perhaps a C-Shell). Because some Make
>derivates try to run the commands with the shell of the current user. That's
>why one usually hard-codes a SHELL=/bin/sh because that exists really on all
>Unix platforms.  But ok, for OS/2 we should smooth the stuff and so your patch
>is ok, because unless the users $PATH is totally messed up it still results in
>a SHELL=/bin/sh on Unix.

Ok, but just in case here's a slight variation that will ensure /bin/sh is
used if it exists.


Index: configure
===================================================================
RCS file: /home/cvs/apache-1.3/configure,v
retrieving revision 1.77
diff -u -r1.77 configure
--- configure	1999/03/23 16:25:38	1.77
+++ configure	1999/03/29 06:38:11
@@ -178,6 +178,20 @@
 esac
 
 ##
+##  determine path to sh, it's not /bin/sh on ALL systems
+##
+SHELL=/bin/sh
+shellpath="`$aux/PrintPath sh -p/bin`"
+
+if [ "x$shellpath" = "x" ]; then
+  shellpath="`$aux/PrintPath sh`"
+fi
+
+if [ "x$shellpath" != "x" ]; then
+    SHELL="$shellpath"
+fi
+
+##
 ##  determine default parameters
 ##
 
@@ -1115,7 +1129,8 @@
 -e "s%@build_support@%$build_support%g" \
 -e "s%@install_support@%$install_support%g" \
 -e "s%@clean_support@%$clean_support%g" \
--e "s%@distclean_support@%$distclean_support%g"
+-e "s%@distclean_support@%$distclean_support%g" \
+-e "s%@SHELL@%$SHELL%g"
 
 ##
 ##  override default paths in $src/include/httpd.h
Index: Makefile.tmpl
===================================================================
RCS file: /home/cvs/apache-1.3/Makefile.tmpl,v
retrieving revision 1.68
diff -u -r1.68 Makefile.tmpl
--- Makefile.tmpl	1999/03/25 19:56:56	1.68
+++ Makefile.tmpl	1999/03/29 06:38:11
@@ -67,7 +67,7 @@
 ## ==================================================================
 
 #   safe environment
-SHELL           = /bin/sh
+SHELL           = @SHELL@
 
 #   paths to the source tree parts
 TOP             = .

--
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Mime
View raw message