bug-m4
[Top][All Lists]
Advanced

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

RE: 'set -u' and $SHELL in makefiles [was: GNU M4]


From: Chan, Lawson
Subject: RE: 'set -u' and $SHELL in makefiles [was: GNU M4]
Date: Wed, 30 Jan 2008 15:19:13 -0500

Hi Eric,

1)  I am sorry that I couldn't use a free webmail account at work.
2)  Running the 'env | grep SHELL' gives SHELL=/usr/bin/ksh
3)  I use the following commands to start the execution
    ./configure
    make
4)  I tried to use the command " set +u" to disable the u option before running 
the ./configure and it gives me exactly the same result.
5)  I tried using make -k to build M4 and it gives me the same error.

Do you know where should I investigate on this issue?

Thanks,

Lawson

-----Original Message-----
From: Eric Blake [mailto:address@hidden
Sent: Wednesday, January 30, 2008 3:07 PM
To: Chan, Lawson
Cc: address@hidden; address@hidden; address@hidden
Subject: 'set -u' and $SHELL in makefiles [was: GNU M4]

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

[adding bug-automake; this is
http://thread.gmane.org/gmane.comp.gnu.m4.bugs/2388]

According to Chan, Lawson on 1/30/2008 12:46 PM:
|  Hi Eric,
|
| Thanks for your reply.  I am sorry that I have difficulties in
| removing
the disclaimer because it is out of my control.

Nothing prevents you from using a free webmail account, or finding a newsreader 
gateway that won't add a disclaimer (I personally like gmane).

|  I am running the make in both shell (bash or Korn) and they have
exactly the same behaviour.

It doesn't matter what shell you ran make from; what mattered is what shell 
make was running as it spawned commands.  What does 'env | grep SHELL' say?  
Your log shows that you are running bash 2.03, which is rather old, but I don't 
think that's an issue.  I personally know that M4 builds just fine on Solaris 
8, so it is something about your environment that caused your failure, and not 
a flaw in the M4 package.

|
| /M4/m4-1.4.10/checks
|  bash: fail: unbound variable
|  *** Error code 1
|  make:  Fatal error: Command failed for target 'all-recursive'
|
| Here is the attached configure and make output file for your reference.

You still didn't show me the command lines that you typed.

|
| Yes, the ./configure is successfully executed.  Any thought about this?

It looks like an automake issue to me.  It looks like you have somehow enabled 
the 'set -u' option of bash.

Looking at what automake outputs for $(RECURSIVE_TARGETS) in each Makefile, I 
see:

$(RECURSIVE_TARGETS):
~        @failcom='exit 1'; \
~        for f in x $$MAKEFLAGS; do \
~          case $$f in \
~            *=* | --[!k]*);; \
~            *k*) failcom='fail=yes';; \
...
~          || eval $$failcom; \
~        done; \
~        if test "$$dot_seen" = "no"; then \
~          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
~        fi; test -z "$$fail"

In other words, if you did NOT use 'make -k', then eval $$failcom never 
initialized $fail, and test -z "$$fail" ends up expanding an undefined $fail, 
explaining the bash warning.  I've never seen a make implementation use 'set 
-u' (although I do know that some make use an implicit 'set -e'), and since 
POSIX requires make to ignore $SHELL from the environment, I'm not quite sure 
whether the user had a posix-compliant setup to begin with.
~ Then again, POSIX states that it is not portable to assign SHELL within a 
makefile, while autoconf recommends doing exactly that via address@hidden@, and 
'set -u' _is_ posix-compliant.  So should automake cater to this weird SHELL 
setting by doing failcom='fail=; exit 1' as the default value for $failcom (and 
audit for any other potentially unset variables)?  Or is it better to figure 
out how this user got 'set -u' enabled in your SHELL in the first place, and 
add workarounds (perhaps in autoconf, rather than
automake?) to avoid such an awkward setup?

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

Eric Blake             address@hidden

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

iD8DBQFHoNjV84KuGfSFAYARAj2lAJoCjxFaHdSDoREq7AHBJg+EGzniCQCeK4TL
VcOy9V5e618/oxh/ZycO59Q=
=neTy
-----END PGP SIGNATURE-----


********************
NOTICE OF CONFIDENTIALITY
This communication including any information transmitted with it is 
intended only for the use of the addressees and is confidential. 
If you are not an intended recipient or responsible for delivering 
the message to an intended recipient, any review, disclosure, 
conversion to hard copy, dissemination, reproduction or other use 
of any part of this communication is strictly prohibited, as is the 
taking or omitting of any action in reliance upon this communication. 
If you receive this communication in error or without authorization 
please notify us immediately by return e-mail or otherwise and 
permanently delete the entire communication from any computer, 
disk drive, or other storage medium.

If the above disclaimer is not properly readable, it can be found at 
www.td.com/legal
                                                           
AVERTISSEMENT DE CONFIDENTIALITE                   
Ce courriel, ainsi que tout renseignement ci-inclus, destiné uniquement 
aux destinataires susmentionnés,  est confidentiel.  Si vous 
n’êtes pas le destinataire prévu ou un agent responsable de la 
livraison de ce courriel, tout examen, divulgation, copie, impression, 
reproduction, distribution, ou autre utilisation d’une partie de ce 
courriel est strictement interdit de même que toute intervention ou 
abstraction à cet égard.  Si vous avez reçu ce message par erreur ou 
sans autorisation, veuillez en aviser immédiatement l’expéditeur par 
retour de courriel ou par un autre moyen et supprimer immédiatement 
cette communication entière de tout système électronique.

Si l'avis de non-responsabilité ci-dessus n'est pas lisible, vous 
pouvez le consulter à www.td.com/francais/legale

reply via email to

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