public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Gnu-win32 beta release 18: make bug - 'export' has no effect
@ 1997-10-14 13:01 Ross Casley
  0 siblings, 0 replies; 3+ messages in thread
From: Ross Casley @ 1997-10-14 13:01 UTC (permalink / raw)
  To: gnu-win32; +Cc: 'annakam@lmc.com', casley

annakam@lmc.com noticed in the last week that the export command in make
doesn't do what it should.  I had the same problem.  

Here's the deal.

make expects to change a process's environment by assigning to the global
variable environ.  Specifically, it constructs a new environment in envp
and starts off a new program using this code:

	environ = envp;
	execvp(argv[0], argv);

Unfortunately, that doesn't work in gnu-win32.  Assigning to environ does
not change the environment seen after an execvp() (or the environment used
by getenv() and putenv()).

One obvious fix is to replace execvp() with execve() so as to set the
environment explicitly.  But a nice thing about execvp() is that it
searches the path itself to find argv[0].  With execve() you have to
search the path yourself.

Can anybody point me to either

	- A good way to set the current environment to be envp, or
	- A good way to search for a program on PATH?

[Note that it is not really correct just to use putenv() to change the
 current environmant, since an 'unexport' command may require you to
 remove variables from the environment.]

Many thanks in advance,

-Ross Casley
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

* RE: Gnu-win32 beta release 18: make bug - 'export' has no effect
@ 1997-10-15  0:10 Sergey Okhapkin
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Okhapkin @ 1997-10-15  0:10 UTC (permalink / raw)
  To: gnu-win32, 'Ross Casley'

Ross Casley wrote:
> 	environ = envp;
> 	execvp(argv[0], argv);
> 
> Unfortunately, that doesn't work in gnu-win32.  Assigning to environ does
> not change the environment seen after an execvp() (or the environment used
> by getenv() and putenv()).
> 

It should work with cygwin.dll provided on my web page.

-- 
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
Looking for a job.


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

* Gnu-win32 beta release 18: make bug - 'export' has no effect
@ 1997-10-09 15:49 Ross Casley
  0 siblings, 0 replies; 3+ messages in thread
From: Ross Casley @ 1997-10-09 15:49 UTC (permalink / raw)
  To: gnu-win32; +Cc: casley

I've recently installed b18, and I'm having problems because
the 'export' command in make seems to do nothing.

That is, following

	FOO = bar baz
	export FOO

any sub-make's expand $(FOO) to null.  It doesn't work this way
on Solaris, and I don't see what I could be doing wrong.

Any tips would be appreciated.

-Ross Casley
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

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

end of thread, other threads:[~1997-10-15  0:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-14 13:01 Gnu-win32 beta release 18: make bug - 'export' has no effect Ross Casley
  -- strict thread matches above, loose matches on Subject: below --
1997-10-15  0:10 Sergey Okhapkin
1997-10-09 15:49 Ross Casley

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).