a project i was recently introduced to uses, quite heavily, the
notion of overlaying header file directories with the now-obsolete gcc
"-I-" option, and i'm curious if there are equivalent solutions that
don't use that feature.
summary: sizable C (and possibly, not sure, some C++) code base
contains numerous, quote-surrounded header file includes of the form:
... etc etc ...
where the header file "h2.h" is frequently in the same directory as
"h1.h" *but* it may not be the one that should be included.
instead, the build system is currently replete with gcc build
commands of the form:
$ gcc -I- -Id1/ -Id2/ -Id3/ ... and so on and so on ...
and "-I-" is used to force the preprocessor to resolve references to
"headerfile.h" not by looking in the current directory first, but by
scanning a list of "overlay" directories to see if someone has
registered a "higher-priority" header file by that name. it's not the
most intuitive build structure i've ever seen but it's been around for
quite some time and it works and its users really don't want to have
to mess with it.
[SIDE NOTE: the current usage of "-I-" in this project is not so much
to "split" the header file search path as that option is used right at
the *beginning* of all the "-I" options, so its use is to simply
refuse to look locally for header files and immediately start scanning
the "-I" directories. but that doesn't really change the problem to be
predictably, now that gcc 5 has obsoleted the "-I-" option, one
would like to find an alternative that doesn't require a wholesale
reworking of the build system. since the build system runs on centos,
my current thought is to use "funionfs" to unionize those overlay
directories in the same priority sequence.
i just tried a trivial funionfs example and it seems to work, but is
there a simpler solution? the gcc folks, in deprecating, then
obsoleting, the "-I-" option, insist that one can use "-iquote"
instead, but that is clearly incorrect -- the requirement here is that
resolving a preprocessor include of the form:
*must* *not* look in the current directory first. if there is some way
to get that effect without "-I-" and without some sort of unionfs, i'd
like to know what it is.
thank you kindly.
Robert P. J. Day Ottawa, Ontario, CANADA