public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Bug in B20.1 make with mixed case environment variables
@ 1999-06-24 13:29 Dennis McCunney
  1999-06-30 22:10 ` Dennis McCunney
  0 siblings, 1 reply; 6+ messages in thread
From: Dennis McCunney @ 1999-06-24 13:29 UTC (permalink / raw)
  To: 'Don Baker'; +Cc: cygwin

> -----Original Message-----
> From: Don Baker [ mailto:dbaker@mcc.com ]
> Sent: Thursday, June 24, 1999 1:14 PM
> To: cygwin@sourceware.cygnus.com
> Cc: dbaker@mcc.com
> Subject: Bug in B20.1 make with mixed case environment variables
> 
> B20.1 uses GNU make 3.75 which seems to have a bug or mis-feature
> where (DOS) environment variable names are converted to upper case
> when made into makefile variables.  (I believe that GNU make 3.77
> fixes this problem, so upgrading may be all that's necessary. 
> Unfortunately, I don't know the exact lineage of the make 3.77
> that I have.)
> 
> From a DOS shell, set an environment variable with lower case
> letters:
> 
> set foo=hello
> 
> Then run make on the following makefile:
> 
> all:
> 	echo $(foo)
> 
> The echo is empty, unless the makefile variable is changed
> to all upper case, where "hello" is printed.  This problem
> does not seem to occur if the environment variable is set
> in bash.  (Bash, however has all of the DOS environement
> variables converted to upper case.)
> 
> Thanks for looking into this problem.

I don't think this is a Cygwin problem.  The issue is that _DOS_
automatically uppercases environment variables, and the trick is getting it
to not do so.  There are some old DOS tricks based on this quirk, like using
the PATH command to upercase something, as in:

: upper.bat
: upper case up to 9 arguments on the command line

if "%1"=="" goto error
set OLDPATH=%PATH%
PATH %1 %2 %3 %4 %5 %6 %7 %8 %9 
set VAR=%PATH%
PATH %OLDPATH%
echo %VAR
goto end
:error
No command line parameter specified!
:end

Placing the above in a batch file called upper.bat and running it will
uppercase up to 9 parameters passed on the command line.

If bash is run as a sub-shell, it inherits the environment from the primary
DOS shell (COMMAND.COM or CMD.EXE) and the variable names it gets are upper
cased when it gets them.
If you set a variable in bash in mixed case or lower case, bash _doesn't_
twiddle the case, so it will appear as you set it.

If you set your variables in bash and run make from there you shouldn't see
an issue.  If you do it from DOS, I'm not sure what kind of a fix is
possible, since there's no good way to know what the case was supposed to be
before DOS twiddled it.

If the 3.77 version of make has an option to ignore case in variables, that
would work, though it would break anything that relied on the same variable
names in different cases being treated as different variables.  (I wouldn't
create variables that relied on that, but someone might have a valid reason
to do it.)

> ------------------------------------------------------------
> Don Baker, Member of the Technical Staff
> MCC, 3500 West Balcones Center Dr., Austin, Texas 78759-6509
> dbaker@mcc.com * Phone: (512) 338-3362 * Fax: (512) 338-3890

______________________
Dennis McCunney
Technical Manager
Manhattan Phone Center
115 E 23 St, 11 Fl
NY NY  10010
212 387 7550 Voice
212 387 8180 Fax
dmccunney@roper.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Bug in B20.1 make with mixed case environment variables
  1999-06-24 13:29 Bug in B20.1 make with mixed case environment variables Dennis McCunney
@ 1999-06-30 22:10 ` Dennis McCunney
  0 siblings, 0 replies; 6+ messages in thread
From: Dennis McCunney @ 1999-06-30 22:10 UTC (permalink / raw)
  To: 'Don Baker'; +Cc: cygwin

> -----Original Message-----
> From: Don Baker [ mailto:dbaker@mcc.com ]
> Sent: Thursday, June 24, 1999 1:14 PM
> To: cygwin@sourceware.cygnus.com
> Cc: dbaker@mcc.com
> Subject: Bug in B20.1 make with mixed case environment variables
> 
> B20.1 uses GNU make 3.75 which seems to have a bug or mis-feature
> where (DOS) environment variable names are converted to upper case
> when made into makefile variables.  (I believe that GNU make 3.77
> fixes this problem, so upgrading may be all that's necessary. 
> Unfortunately, I don't know the exact lineage of the make 3.77
> that I have.)
> 
> From a DOS shell, set an environment variable with lower case
> letters:
> 
> set foo=hello
> 
> Then run make on the following makefile:
> 
> all:
> 	echo $(foo)
> 
> The echo is empty, unless the makefile variable is changed
> to all upper case, where "hello" is printed.  This problem
> does not seem to occur if the environment variable is set
> in bash.  (Bash, however has all of the DOS environement
> variables converted to upper case.)
> 
> Thanks for looking into this problem.

I don't think this is a Cygwin problem.  The issue is that _DOS_
automatically uppercases environment variables, and the trick is getting it
to not do so.  There are some old DOS tricks based on this quirk, like using
the PATH command to upercase something, as in:

: upper.bat
: upper case up to 9 arguments on the command line

if "%1"=="" goto error
set OLDPATH=%PATH%
PATH %1 %2 %3 %4 %5 %6 %7 %8 %9 
set VAR=%PATH%
PATH %OLDPATH%
echo %VAR
goto end
:error
No command line parameter specified!
:end

Placing the above in a batch file called upper.bat and running it will
uppercase up to 9 parameters passed on the command line.

If bash is run as a sub-shell, it inherits the environment from the primary
DOS shell (COMMAND.COM or CMD.EXE) and the variable names it gets are upper
cased when it gets them.
If you set a variable in bash in mixed case or lower case, bash _doesn't_
twiddle the case, so it will appear as you set it.

If you set your variables in bash and run make from there you shouldn't see
an issue.  If you do it from DOS, I'm not sure what kind of a fix is
possible, since there's no good way to know what the case was supposed to be
before DOS twiddled it.

If the 3.77 version of make has an option to ignore case in variables, that
would work, though it would break anything that relied on the same variable
names in different cases being treated as different variables.  (I wouldn't
create variables that relied on that, but someone might have a valid reason
to do it.)

> ------------------------------------------------------------
> Don Baker, Member of the Technical Staff
> MCC, 3500 West Balcones Center Dr., Austin, Texas 78759-6509
> dbaker@mcc.com * Phone: (512) 338-3362 * Fax: (512) 338-3890

______________________
Dennis McCunney
Technical Manager
Manhattan Phone Center
115 E 23 St, 11 Fl
NY NY  10010
212 387 7550 Voice
212 387 8180 Fax
dmccunney@roper.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug in B20.1 make with mixed case environment variables
  1999-06-24 10:39 Earnie Boyd
@ 1999-06-30 22:10 ` Earnie Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Earnie Boyd @ 1999-06-30 22:10 UTC (permalink / raw)
  To: Don Baker, cygwin; +Cc: dbaker

--- Don Baker <dbaker@mcc.com> wrote:
> B20.1 uses GNU make 3.75 which seems to have a bug or mis-feature
> where (DOS) environment variable names are converted to upper case
> when made into makefile variables.  (I believe that GNU make 3.77

This is not a "mis-feature" of make but a feature of the cygwin1.dll when
converting from DOS to POSIX.

> fixes this problem, so upgrading may be all that's necessary. 
> Unfortunately, I don't know the exact lineage of the make 3.77
> that I have.)
> 

Not likely as it isn't make's problem.

> From a DOS shell, set an environment variable with lower case
> letters:
> 
> set foo=hello
> 
> Then run make on the following makefile:
> 
> all:
> 	echo $(foo)
> 
> The echo is empty, unless the makefile variable is changed
> to all upper case, where "hello" is printed.  This problem
> does not seem to occur if the environment variable is set
> in bash.  (Bash, however has all of the DOS environement
> variables converted to upper case.)
> 

If you wish to keep the lower case then

DOS> bash
$ export foo=bar
$ make

> Thanks for looking into this problem.

You're welcome.
===
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't cc me)
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Bug in B20.1 make with mixed case environment variables
  1999-06-24 10:14 Don Baker
@ 1999-06-30 22:10 ` Don Baker
  0 siblings, 0 replies; 6+ messages in thread
From: Don Baker @ 1999-06-30 22:10 UTC (permalink / raw)
  To: cygwin; +Cc: dbaker

B20.1 uses GNU make 3.75 which seems to have a bug or mis-feature
where (DOS) environment variable names are converted to upper case
when made into makefile variables.  (I believe that GNU make 3.77
fixes this problem, so upgrading may be all that's necessary. 
Unfortunately, I don't know the exact lineage of the make 3.77
that I have.)

From a DOS shell, set an environment variable with lower case
letters:

set foo=hello

Then run make on the following makefile:

all:
	echo $(foo)

The echo is empty, unless the makefile variable is changed
to all upper case, where "hello" is printed.  This problem
does not seem to occur if the environment variable is set
in bash.  (Bash, however has all of the DOS environement
variables converted to upper case.)

Thanks for looking into this problem.

------------------------------------------------------------
Don Baker, Member of the Technical Staff
MCC, 3500 West Balcones Center Dr., Austin, Texas 78759-6509
dbaker@mcc.com * Phone: (512) 338-3362 * Fax: (512) 338-3890

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug in B20.1 make with mixed case environment variables
@ 1999-06-24 10:39 Earnie Boyd
  1999-06-30 22:10 ` Earnie Boyd
  0 siblings, 1 reply; 6+ messages in thread
From: Earnie Boyd @ 1999-06-24 10:39 UTC (permalink / raw)
  To: Don Baker, cygwin; +Cc: dbaker

--- Don Baker <dbaker@mcc.com> wrote:
> B20.1 uses GNU make 3.75 which seems to have a bug or mis-feature
> where (DOS) environment variable names are converted to upper case
> when made into makefile variables.  (I believe that GNU make 3.77

This is not a "mis-feature" of make but a feature of the cygwin1.dll when
converting from DOS to POSIX.

> fixes this problem, so upgrading may be all that's necessary. 
> Unfortunately, I don't know the exact lineage of the make 3.77
> that I have.)
> 

Not likely as it isn't make's problem.

> From a DOS shell, set an environment variable with lower case
> letters:
> 
> set foo=hello
> 
> Then run make on the following makefile:
> 
> all:
> 	echo $(foo)
> 
> The echo is empty, unless the makefile variable is changed
> to all upper case, where "hello" is printed.  This problem
> does not seem to occur if the environment variable is set
> in bash.  (Bash, however has all of the DOS environement
> variables converted to upper case.)
> 

If you wish to keep the lower case then

DOS> bash
$ export foo=bar
$ make

> Thanks for looking into this problem.

You're welcome.
===
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't cc me)
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Bug in B20.1 make with mixed case environment variables
@ 1999-06-24 10:14 Don Baker
  1999-06-30 22:10 ` Don Baker
  0 siblings, 1 reply; 6+ messages in thread
From: Don Baker @ 1999-06-24 10:14 UTC (permalink / raw)
  To: cygwin; +Cc: dbaker

B20.1 uses GNU make 3.75 which seems to have a bug or mis-feature
where (DOS) environment variable names are converted to upper case
when made into makefile variables.  (I believe that GNU make 3.77
fixes this problem, so upgrading may be all that's necessary. 
Unfortunately, I don't know the exact lineage of the make 3.77
that I have.)

From a DOS shell, set an environment variable with lower case
letters:

set foo=hello

Then run make on the following makefile:

all:
	echo $(foo)

The echo is empty, unless the makefile variable is changed
to all upper case, where "hello" is printed.  This problem
does not seem to occur if the environment variable is set
in bash.  (Bash, however has all of the DOS environement
variables converted to upper case.)

Thanks for looking into this problem.

------------------------------------------------------------
Don Baker, Member of the Technical Staff
MCC, 3500 West Balcones Center Dr., Austin, Texas 78759-6509
dbaker@mcc.com * Phone: (512) 338-3362 * Fax: (512) 338-3890

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-06-30 22:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-24 13:29 Bug in B20.1 make with mixed case environment variables Dennis McCunney
1999-06-30 22:10 ` Dennis McCunney
  -- strict thread matches above, loose matches on Subject: below --
1999-06-24 10:39 Earnie Boyd
1999-06-30 22:10 ` Earnie Boyd
1999-06-24 10:14 Don Baker
1999-06-30 22:10 ` Don Baker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).