delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/06/12/06:15:05

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Environment variables, and command line option's.
Date: 12 Jun 2002 09:06:12 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 52
Message-ID: <ae72u4$h4o$1@nets3.rz.RWTH-Aachen.DE>
References: <tYvN8.184242$9F5 DOT 9825507 AT typhoon DOT austin DOT rr DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1023872772 17560 137.226.32.75 (12 Jun 2002 09:06:12 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 12 Jun 2002 09:06:12 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Stratis Aftousmis <lsdguru78 AT hotmail DOT com> wrote:
> Hello all, first question i have i think alot of people have asked before
> but i have yet to find an answer. Can i set up environment variable's for my
> input and output directories? Yes i did RTFM on enviorment variable's but i
> saw nothing on what i want to do. Below is an example, everything between %
> and % is an environment variable:

> c:\djgpp\bin>gcc %input% -o %output%

You can set up environment variables to you heart's content.  But that's
not the real issue.  That would be how you can make the tools *use* the
values of those variables.

At this point, one rather stupid limitation of raw DOS would bite you:
it doesn't expand environment variables at all in interactive use.  I.e.
if you typed these commands at the command.com prompt

	set INPUT=d:\some\strange\place
	set OUTPUT=E:\an\even\stranger\location
	gcc %INPUT%/foo.c -o %OUTPUT%/foo.o

gcc would _not_ refer to file d:\some\strange\place\foo.c, because
%INPUT% didn't get replaced by the value of that variable.
COMMAND.COM in raw DOS only does that while running .bat files.
	
The usual method to deal with this, and lots of other problems, is to
use a Makefile.  Or, if you must, use a .bat file to drive GCC, which
will have environment variables expanded.

Note that you won't notice this effect in the DOS prompt of a Windows
9x system, and also not on an NT-family box, I guess.

> Second question, which version of gcc support's the

> -mwindows

> command line option?

That's not a question of "version of GCC", strictly spoken.  It's a
question of what target platform you have GCC built for.  The
-mwindows option only exists in the MinGW and Cygwin ports of GCC.








-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019