autoconf-patches
[Top][All Lists]
Advanced

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

Re: stronger docs on @SHELL@ usage in Makefile


From: Eric Blake
Subject: Re: stronger docs on @SHELL@ usage in Makefile
Date: Wed, 20 Aug 2008 07:10:20 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 4/9/2008 8:11 PM:
> According to Ralf Wildenhues on 4/9/2008 12:27 PM:
> |> * doc/autoconf.texi (The Make Macro SHELL): Stronger wording on
> |> the importance of proper SHELL settings.
> |> Reported by Bruno Haible, in
> |> http://lists.gnu.org/archive/html/bug-libtool/2008-04/msg00029.html.
> |
> | These parts are probably ok, but the discussion will still take longer
> | (I need to check a few things first), so I would appreciate if you could
> | wait a little bit.
> 
> No problem waiting.  I'm also thinking about rewording the section a bit
> more.

Ping.  Meanwhile, I've updated the series, available now as:

$ git pull git://repo.or.cz/autoconf/ericb.git make-shell

or browseable at
http://repo.or.cz/w/autoconf/ericb.git?a=shortlog;h=refs/heads/make-shell

I'm not sure whether more rewording is necessary.  Thoughts?

  Basically, there are multiple problems:
> 
> if SHELL is not set explicitly in the Makefile, POSIX make is supposed to
> provide a default containing the value of a POSIX-style sh; but some
> makes, like Tru64, fail to set a default SHELL.  Workaround - always set
> SHELL explicitly
> 
> if SHELL is explicitly set in the Makefile, POSIX make is supposed to use
> it to invoke make commands, but some makes, like Tru64, blindly execute
> /bin/sh.  No direct workaround - commands written in make cannot assume
> the fixes that would be available by using a better $SHELL; but the advice
> of autoconf was to stick to simple commands in Makefile and factor out
> complex ones into separate shell scripts anyway, then invoke those scripts
> using $(SHELL) with address@hidden@
> 
> if make is run with set -e, POSIX make is supposed to ignore any SHELL in
> the environment, but some makes, like Tru64, override an explicit setting.
> ~ No direct workaround - merely document that users on Tru64 must not run
> 'make -e' if SHELL is not a POSIX-style sh, or that they should upgrade to
> gmake instead
> 
> setting SHELL to /bin/sh is not portable; autoconf clients should use
> @SHELL@ instead (and automake does this automatically)
> 
> In the case of Bruno's problem, I think what happened is:
> 
> configure ran, noticed /bin/sh was inadequate, and set @SHELL@ to /bin/ksh.
> libtool subtitutes this as address@hidden@ at the start of the script.
> But make ran $(SHELL) libtool, with SHELL hard-coded as /bin/sh by Bruno,
> and ignored the #! line since it was invoked as an argument to SHELL
> rather than as an independent program.
> Finally, the generated libtool lacked the _AS_DETECT_BETTER_SHELL logic
> that configure had used earlier when setting SHELL.
> 
> Telling libtool clients who use autoconf to set 'SHELL = @SHELL@' in their
> makefiles (manually, or via Automake) is one thing, but does libtool
> intend to be used independently of autoconf, in which case @SHELL@ is not
> available?  How do we (or do we even try to) document that in autoconf?
> 

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkisF7wACgkQ84KuGfSFAYA3oQCdHN3oS0O95t2Y8NZkxylncsO5
B6wAn0yD75FFL7F3c6gfyZRMRGU2uzCD
=T8hu
-----END PGP SIGNATURE-----




reply via email to

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