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 07:18:45 GMT
On Mon, 29 Mar 1999 09:04:16 +0200, Ralf S. Engelschall wrote:

>
>In article <199903290649.QAA07919@silk.apana.org.au> you wrote:
>> On Fri, 26 Mar 1999 23:53:49 +0100, Ralf S. Engelschall wrote:
>> 
>>[..]
>> Ok, but just in case here's a slight variation that will ensure /bin/sh is
>> used if it exists.
>
>>  ##
>> +##  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
>>  ##
>
>Good idea, but for this case I would accept to hard-code the test in order to
>speed-up the processing a little bit (APACI is already slow enough and running
>PrintPath in a sub-shell just to get the conditional /bin/sh case is a little
>bit overkill, IMHO). 

Ok, I was worrying (probably too much) about the $test_exec_flag stuff in
PrintPath. I guess if /bin/sh exists it's pretty safe to assume that it's
executable.



>Additionally the fiddling with two variables isn't really
>necessary IMHO and just confuses a little bit. So I personally would prefer
>the following construct:
>
>SHELL=/bin/sh
>if [ ! -f "$SHELL" ]; then
>    SHELL="`$aux/PrintPath sh`"
>    if [ "x$SHELL" = "x" ]; then
>        echo "configure:Error: Cannot determine path to Bourne-Shell" 1>&2
>        exit 1
>    fi
>fi

Sure, works for me.



>But, BTW: When /bin/sh doesn't exists on OS/2 why does calling $aux/PrintPath
>(which has a shebang of '#!/bin/sh') work?

The shell I use (pdksh) special cases #! lines. If it didn't, lots of stuff
wouldn't work.

--
 ______________________________________________________________________________
 |  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