introduce configure --with-sysroot

Daniel Jacobowitz drow@mvista.com
Fri Oct 25 12:13:00 GMT 2002


On Fri, Oct 25, 2002 at 02:55:36PM -0400, Daniel Jacobowitz wrote:
> The only problem is, cppdefault.c still has the original prefix
> hardcoded.  It doesn't get translated for just the reason you said it
> wouldn't:
> (gdb) p specd_prefix 
> $1 = 0xbffff5cd "/opt/hardhat/foo/mips/fp_le/bibtest/bin/../lib/gcc-lib/mipsel-hardhat-linux/3.4-bi/"
> (gdb) p default_prefix
> $4 = 0xbffff1b0 "/opt/hardhat/devkit/mips/fp_le/bibtest/lib/gcc-lib/mipsel-hardhat-linux/3.4-bi/"
> 
> There's a couple of easy ways to fix this:
> 1- move make_relative_prefix into some common place (preferably libiberty
>    eventually, so that I can use it in binutils!) and call it to
>    translate includes.
> 2- Pass some other option to serve the same purpose in a simpler
>    fashion, keeping all the logic in the driver.
> 
> 2) is easier, but not sufficient, because $prefix/include and
> $sysroot/usr/include are both in the includes list.  $prefix/include
> isn't relocated at the moment no matter what you do.  So I spent a
> little time hacking on 1).

Upon thinking a little more... I'd rather do #1.  What do you think of
removing PREFIX_INCLUDE_DIR if --with-sysroot is specified?  The
assumption being that $sysroot/usr/include is where all normal include
files will go, so we don't need it.

At the same time, a sysrooted compiler won't search
$sysroot/usr/local/include.  Should it?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gcc-patches mailing list