Chan, Lawson | 30 Jan 2008 23:26

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

Hi Eric,

1)  actually, I use the following commands to start the execution.  So I am in the bash shell.
    Bash
    ./configure
    make
    Even though I am in the bash shell, running the 'env | grep SHELL' gives SHELL=/usr/bin/ksh
2)  $echo $- returns bhimCBH
3)  I normally don't run set -u.  I still don't know why it is set initially.
4)  I run ./configure in a fresh location and it behaves the same.
5)  The output of 'grep SHELL Makefile config.log' is attached in this email.
6)  I am using make 3.81.

Thanks,

Lawson

-----Original Message-----
From: Eric Blake [mailto:ebb9 <at> byu.net]
Sent: Wednesday, January 30, 2008 4:24 PM
To: Chan, Lawson
Cc: bug-m4 <at> gnu.org; gary <at> gnu.org; bug-automake <at> gnu.org
Subject: Re: 'set -u' and $SHELL in makefiles [was: GNU M4]

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

According to Chan, Lawson on 1/30/2008 1:19 PM:
| Hi Eric,
|
(Continue reading)

Eric Blake | 31 Jan 2008 00:18
Gravatar

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


According to Chan, Lawson on 1/30/2008 3:26 PM:
| Hi Eric,
|
| 1)  actually, I use the following commands to start the execution.  So I
am in the bash shell.
|     Bash
|     ./configure
|     make
|     Even though I am in the bash shell, running the 'env | grep SHELL'
gives SHELL=/usr/bin/ksh

Makes sense - bash doesn't overwrite SHELL if it was already set when bash
started.  But there's no need to start bash before running ./configure; it
should run just fine from ksh (or even the hideous Solaris 8 /bin/sh),
since the first part of ./configure is all about discovering a decent
shell if the current shell was not good enough.

| 2)  $echo $- returns bhimCBH
| 3)  I normally don't run set -u.  I still don't know why it is set
initially.

It's not.  Since $- doesn't contain u, 'set -u' is not active.

| 4)  I run ./configure in a fresh location and it behaves the same.
| 5)  The output of 'grep SHELL Makefile config.log' is attached in this
email.

And it shows merely "SHELL = /bin/bash".  No hint of -u, but configure did
decide that /bin/bash was a better choice than /bin/sh.
(Continue reading)

Ralf Wildenhues | 31 Jan 2008 00:46
Picon
Picon

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

Hello,

I don't either know what the root cause of your problem is, but it seems
to me it could not hurt if checks/Makefile.in used the same shell and
$(MAKE) initialization as did all the automake-generated Makefiles.

Cheers,
Ralf

2008-01-31  Ralf Wildenhues  <Ralf.Wildenhues <at> gmx.de>

	* checks/Makefile.in: Use  <at> SET_MAKE <at> , and use  <at> SHELL <at>  rather
	than hard-coding /bin/sh.
	Report by Lawson Chan.

diff --git a/checks/Makefile.in b/checks/Makefile.in
index 6d93144..b9d384e 100644
--- a/checks/Makefile.in
+++ b/checks/Makefile.in
 <at>  <at>  -1,7 +1,7  <at>  <at> 
 ## Makefile.in - template for building Makefile for M4 testsuite.
 ##
-## Copyright (C) 1992, 1993, 1994, 2006, 2007 Free Software Foundation, Inc.
-##
+## Copyright (C) 1992, 1993, 1994, 2006, 2007, 2008  Free Software
+## Foundation, Inc.
 ## This file is part of GNU M4.
 ##
 ## GNU M4 is free software: you can redistribute it and/or modify
 <at>  <at>  -17,10 +17,11  <at>  <at> 
(Continue reading)

Eric Blake | 31 Jan 2008 00:53
Gravatar

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


According to Ralf Wildenhues on 1/30/2008 4:46 PM:
| Hello,
|
| I don't either know what the root cause of your problem is, but it seems
| to me it could not hurt if checks/Makefile.in used the same shell and
| $(MAKE) initialization as did all the automake-generated Makefiles.

Thanks for catching that, Ralf; I'll apply it shortly.  I agree that this
is not the root of the problem, since the failure message comes from a
reference to the $$fail variable expansion which is not present in the
checks directory; but it is also worth fixing.  Fortunately, it is not a
problem on the master branch, where we use automake across the entire project.

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

Eric Blake             ebb9 <at> byu.net

Gmane