bug-automake
[Top][All Lists]
Advanced

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

Re: Substitution of SHELL and CONFIG_SHELL


From: Paul Eggert
Subject: Re: Substitution of SHELL and CONFIG_SHELL
Date: 09 Feb 2004 15:15:06 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

address@hidden (Niels Möller) writes:

> When running configure generated by autoconf-2.59 on Solaris,
> CONFIG_SHELL gets set to /bin/bash, which is ok. But then the value
> somehow leaks over to SHELL, resulting in
> 
>   SHELL=/bin/bash
> 
> being substituted into all my Makefiles. Is there a good reason for
> that? Rules in Makefiles are generally written for /bin/sh, and unlike
> configure, speed and availability of $LINENO doesn't really matter.
> So I would generally feel a lot more comfortable with SHELL=/bin/sh in
> the Makefiles.
> 
> I noticed this because only because one user couldn't got bash errors
> when running make, and it turned out he had a set -u in his .bashrc.
> To me, doing that unconditionally in .bashrc seems like a very broken
> thing to do,

Hmm, wasn't it so broken that it also broke his 'configure' invocations too?

> but the problem would be avoided if make used plain
> SHELL=/bin/sh to execute the rules, the way $DEITY intended it to do.

By $DEITY I assume you mean the GNU Coding Standards, which indeed say
that every makefile should contain "SHELL = /bin/sh"; see
<http://www.gnu.org/prep/standards_51.html>.

The change to Autoconf to use 'address@hidden@' rather than
'SHELL=/bin/sh' was done a long time ago:

        Wed Sep  3 23:00:44 1997  Chris Provenzano  <address@hidden>

                * configure : New configure generated by autoconf.
                * Makefile.in : Set address@hidden@. configure now substiutes
                ${CONFIG_SHELL-/bin/sh} in for @SHELL@ at configure time.

This subject came up a couple of years ago too
<http://mail.gnu.org/archive/html/bug-autoconf/2002-03/msg00074.html>.
At the time I thought that it'd be simpler to use the same SHELL for
both makefiles and configure files, but perhaps the issue needs to be
revisited.

Also, perhaps this is more of an Automake issue rather than an
Autoconf issue?  That is, either the GNU coding standards should be
changed, or Automake should be changed to output "SHELL = /bin/sh"
rather than "SHELL = @SHELL@" into Makefile.in.  (Or perhaps it should
be changed to "SHELL = @MAKE_SHELL@" so that we could distinguish the
two uses of shells.)

I'll CC: this to bug-automake to see whether they have any opinion on
the issue.




reply via email to

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