This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: another specs language question


On 14 May 2005, Arturas Moskvinas stipulated:
>> i want to use path which starts with user home `~'.
>> how to do it?
> 
> There is global variable PATH in *nix (at least linix), so you can
> change it to your likings.

I don't think that has anything to do with the question. (And $PATH is
not a global variable; it's an environment variable, which is a quite
different entity and not `global' in any meaningful sense; it's
per-process. It's been present in Unix pretty much forever: I can't say
how long because it's probably older than I am.)


gumbold, do you mean that you want to use a path in a specs file which
is relative to a user's home directory, or that you want GCC to look for
its specs file somewhere underneath a user's home directory?

The latter is trivial: `gcc -specs=${HOME}/somewhere/....' and the shell
does the work of variable expansion before GCC ever gets involved.


For the former, I think you're stuck: there is no mechanism in the specs
language to substitute environment variables (although adding one to GCC
wouldn't be hard). The closest you can get without adding such a
mechanism is a wrapper around GCC which preprocesses a pre-specs file,
substituting some variables, and then runs the GCC driver with the
-specs= argument on the resulting file.

I'd think it would probably be easier to add the feature to GCC: if
you're modifying the specs file, you can probably do that too (and
submit the patch :) )

-- 
`End users are just test loads for verifying that the system works, kind of
 like resistors in an electrical circuit.' - Kaz Kylheku in c.o.l.d.s


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]