customcc: Fix the setup of the /usr/include path to use.
authorSascha Wildner <saw@online.de>
Thu, 2 Aug 2012 17:16:08 +0000 (19:16 +0200)
committerSascha Wildner <saw@online.de>
Thu, 2 Aug 2012 17:16:08 +0000 (19:16 +0200)
commitc7c26905e41d70fe0ea9d02c5af1fc0a688408d4
treee6a55679a202492c1ac8398907b3325d7ebeef63
parent23f6ffe406ec5a64dd1f3da023c5de5d5b50fca4
customcc: Fix the setup of the /usr/include path to use.

With the recent O_DIRECTORY addition, this apparent bug in the script was
exposed. Using -isysroot/-isystem doesn't seem to cut it for what we want
here (which is to completely override the /usr/include path).

I didn't verify in 100% detail, but all evidence looks like the reason is
that when -I is present on the command line, the paths of the headers
which are included by headers from this directory are not prefixed with
-isysroot's argument.

So for now, use -iprefix and -iwithbeforeprefix for /usr/include, which
seem to do what we want.

While here, add our copyright.

Reported-by: marino
libexec/customcc/cc.sh