public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* CPP include functionality;  am I dreaming or could this work?
@ 2003-12-16  0:17 Mario Nigrovic; RVVK40
  0 siblings, 0 replies; only message in thread
From: Mario Nigrovic; RVVK40 @ 2003-12-16  0:17 UTC (permalink / raw)
  To: gcc-help

Hi -

    I really prefer to build all my binaries from read-only source trees, so
I can be absolutely certain of reproducable behavior.  To this end, I take
advantage of VPATH with modern GNU make and configure.

    But sometimes packages have problems with this -- either they're broken
or they like to create alternate text files for internationalization -- so
I also sometimes bodily copy the "read only" tree onto /tmp (where I'm
building) so that I can do a ./configure and again not disturb the source.

    Ok, enough background.  Sometimes copying the whole source takes a lot
of time and I think why bother if only one or two files needs updating.  It
sort of makes sense that if I copy those files into the /tmp hierarchy that
make/gcc would find them there instead.  This works, unless the file is a
header file, because gcc finds the file at $VPATH rather than the one in
/tmp.

    So what I'm asking is, is there some way to let cpp know that it's
working in this funky VPATH-driven mode, and that it needs to consider the
current directory for included files before the directory the file is
actually found in?  While conceptually simple, there is acutally some
challenge involved if the file would not be in ".".  In my current setup
(where I'm having the problem of different .c files see different versions
of the .h file), I've verified that the only difference between the two
gcc commands is the path to the file.  The files are identical.  I think
that the trick would be to substitute $VPATH in the .c file's path with
"." and see if the included file is there.

					Mario
-- 
Whoever fights monsters should see  |            Mario.Nigrovic@Motorola.Com
to it that in the process he does   | EL518/2100 E. Elliot Rd/Tempe AZ 85284
not become a monster.  -- Nietzsche |     desk:480/413-3578 pgr:602/261-9454

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-12-16  0:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-16  0:17 CPP include functionality; am I dreaming or could this work? Mario Nigrovic; RVVK40

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