>From: "Marc Kealy" <marc@...>
>Subject: [Mingw-users] Re: Command line options from file
>Date: Tue, 22 Oct 2002 22:19:43 +0100
>"Oscar Fuentes" <ofv@...> wrote in message
> > "Marc Kealy" <marc@...> writes:
> > > Can anyone tell me how I can use a file to specify command line
> > > without using the -specs option. Eg:-
> > >
> > > g++ $(CCFLAG) -File-Options $(OBJECT) -o$(EXECFILE)
> > >
> > > where -File-Options will read extra options from a given file.
> > This normally is accomplished with makefiles.
> > > I have looked in the docs but I can't see anything relevant appart
> > > from -specs (which I don't want to use).
> > Well, you know that it is possible to override the -specs file with a
> > local one, but if you really don't want -specs, the way is either some
> > build system (i.e. makefiles) or a shell script.
>Basically, I want to write a program to generate the options during the
>procedure and then have those options included on the gcc command line.
>Using a specs file over-rides the default specs (which I don't want to do).
>It also means I'd have to sort through the options to determine where they
>belong in the specs, which is, quite frankly, making a musical out of a
>I think the easiest way of doing it is by creating an environmental
>and including that on the command line. I'm sure there must be a better
As far as I know there is no GCC option like that, but you seem to have
overlooked Oscar's suggestion of using makefiles. Your program can generate
a makefile or part of one, and you can use that when building. If this is
won't work for you then please explain why so that we can better understand
your problem. Also, if your program were to put the options in an
environment variable it would only be visible to child processes, so your
program would need to invoke either "make" or "gcc" directly, but in that
case you could simply pass the options directly on the command line to
"make" or "gcc".
Broadband? Dial-up? Get reliable MSN Internet Access.