You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Michael Mounteney <ga...@landcroft.co.uk> on 2001/11/27 10:04:05 UTC

autogen

May I make some suggestions about the `autogen.sh' script ?

1.  The first line is #!/bin/sh but in fact it uses the Korn shell 
construction $( ... ).  Was the script developed on a system on which the 
Korn shell is default ?  The first line should be #!/bin/ksh

2.  The script uses constructions of the form

	$(which gsometool sometool 2>/dev/null) | head -1

to find what tools are available.  On Solaris 8, if a tool be not found, 
`which' generates a line of the form

	no gsometool in path1 path2 ....

so it seems that the `search' construction should be

	$(which gsometool sometool 2>/dev/null | grep -v '^no ' | head -1

in order to eliminate the report from `which'.

-- 
_______________________________________
Michael Mounteney, technical director.
Mobile 07932 106754.
Landcroft Computing Ltd., 01743 360155.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: autogen

Posted by Max Okumoto <ok...@ucsd.edu>.
Karl Fogel <kf...@newton.ch.collab.net> writes:

> Michael Mounteney <ga...@landcroft.co.uk> writes:
> > May I make some suggestions about the `autogen.sh' script ?
> > 
> > 1.  The first line is #!/bin/sh but in fact it uses the Korn shell 
> > construction $( ... ).  Was the script developed on a system on which the 
> > Korn shell is default ?  The first line should be #!/bin/ksh
> 
> No, the script is intended to be Bourne, not Korn, for maximum
> portability.
> 
> Is the construction illegal under Bourne?  (I'm wondering why we
> haven't gotten bug reports about this yet, considering that Subversion
> builds are tested on many different Unix platforms...)

I ran into the same problem... but I didn't report it yet. :-)
The same thing happens in buildcheck.sh on line 23.

I also ran into another problem with autogen.sh.  When
the script tries to find libtool.m4 it breaks if --prefix and
--exec-prefix are not the same when you build libtool.

    libtool-1.4.2 % ./configure \
	             --prefix=/usr/home/okumoto/Tools \
		--exec-prefix=/usr/home/okumoto/Tools/sparc

The problem lines are:
	ltpath=`dirname $libtoolize`
	ltfile=`cd $ltpath/../share/aclocal ; pwd`/libtool.m4


				Max Okumoto






---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: autogen

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Russ Allbery <rr...@stanford.edu> writes:
> It's not illegal under POSIX, but $(...) isn't supported by Solaris
> /bin/sh (which predates POSIX and is not POSIX-compliant).  You have to
> use backticks instead.

Mmmm.  Hmmm.

Can you think of a way to rewrite the test so it works under all
/bin/sh, including Solaris 8?

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: autogen

Posted by Russ Allbery <rr...@stanford.edu>.
Karl Fogel <kf...@newton.ch.collab.net> writes:
> Michael Mounteney <ga...@landcroft.co.uk> writes:

>> May I make some suggestions about the `autogen.sh' script ?

>> 1.  The first line is #!/bin/sh but in fact it uses the Korn shell
>> construction $( ... ).  Was the script developed on a system on which
>> the Korn shell is default ?  The first line should be #!/bin/ksh

> No, the script is intended to be Bourne, not Korn, for maximum
> portability.

> Is the construction illegal under Bourne?  (I'm wondering why we haven't
> gotten bug reports about this yet, considering that Subversion builds
> are tested on many different Unix platforms...)

It's not illegal under POSIX, but $(...) isn't supported by Solaris
/bin/sh (which predates POSIX and is not POSIX-compliant).  You have to
use backticks instead.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: autogen

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Michael Mounteney <ga...@landcroft.co.uk> writes:
> May I make some suggestions about the `autogen.sh' script ?
> 
> 1.  The first line is #!/bin/sh but in fact it uses the Korn shell 
> construction $( ... ).  Was the script developed on a system on which the 
> Korn shell is default ?  The first line should be #!/bin/ksh

No, the script is intended to be Bourne, not Korn, for maximum
portability.

Is the construction illegal under Bourne?  (I'm wondering why we
haven't gotten bug reports about this yet, considering that Subversion
builds are tested on many different Unix platforms...)

> 2.  The script uses constructions of the form
> 
> 	$(which gsometool sometool 2>/dev/null) | head -1
> 
> to find what tools are available.  On Solaris 8, if a tool be not found, 
> `which' generates a line of the form
> 
> 	no gsometool in path1 path2 ....
> 
> so it seems that the `search' construction should be
> 
> 	$(which gsometool sometool 2>/dev/null | grep -v '^no ' | head -1
> 
> in order to eliminate the report from `which'.

Thanks!  This seems like a safe improvement, because it wouldn't hurt
on systems where `which' is silent when the target is not found.  I've
committed the change.

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org