setenv in Windows + phobos and tango

Daniel Keep daniel.keep.lists at gmail.com
Tue Mar 6 10:49:00 PST 2007


Hi all.

I'm currently trying to write a general forwarding program as part of my
attempts to figure out how to install dmd (phobos) and dmd (tango)
side-by-side.  The idea is to copy this forwarding program into the same
directory as, say, my tango dmd.exe and call it dmd-tango.exe.  That
way, whenever you use "dmd-tango", it on-calls the right "dmd".

(At the moment, I have two DMD installs: \bin\dmd-phobos and
\bin\dmd-tango.)

Incidentally, cmd.exe can't execute shortcuts, so I can't use those and
batch files seem to be causing problems with arguments.

Basically, in order to make absolutely 100% "yes, really I mean it" sure
the program I call looks in its' own directory for other executables, I
need to put the target executable's directory on the front of the PATH
environment variable.  Unfortunetly, std.c.stdlib.setenv isn't supported
on Windows.

There's std.process.execve, which you can pass an environment to, but
the problem with that is that there doesn't seem to be any way to
actually *get* the complete environment so I can modify PATH and pass
the rest unaltered.

So, is there:

A) any way to do this, or
B) any other sane way to get tango and phobos to co-exist?  And no,
having to run a "switch" application simply doesn't cut it.

Any suggestions would be welcome.

	-- Daniel

I get a funny feeling all this could be easily avoided if only DMD
didn't insist on always linking phobos.lib...

-- 
Unlike Knuth, I have neither proven or tried the above; it may not even
make sense.

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/


More information about the Digitalmars-d-learn mailing list