[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 'set -u' and $SHELL in makefiles [was: GNU M4]
From: |
Eric Blake |
Subject: |
Re: 'set -u' and $SHELL in makefiles [was: GNU M4] |
Date: |
Wed, 30 Jan 2008 16:18:07 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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.
| 6) I am using make 3.81.
Obviously GNU make, and not Solaris' version. GNU make doesn't add -u, so
I'm a bit stumped.
|
| What about in a temporary directory (and use TAB for indenting):
|
| $ cat <<\EOF > Makefile
| all:
| echo - $(SHELL) - $(MAKE) - $(MAKEFLAGS) - $$MAKEFLAGS - EOF $ make
|
| Then repeat, but with adding the same 'SHELL = ...' line at the
beginning that was in m4/Makefile?
You didn't run this test.
Also, could there be some other environment variables interfering? At
this point, the output of 'env' might prove helpful. Anyone else have ideas?
- --
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
iD8DBQFHoQWv84KuGfSFAYARAiqJAJ916IwJa1YFS5J2REF8817FIhMczQCdFhHV
/Wk+EUKwiblvAJml5PBOTq0=
=Zx4p
-----END PGP SIGNATURE-----