A user asked this on IRC, Hello, the PHP ebuild uses EPREFIX for econf. I have ROOT set to something other than /, but EPREFIX is empty so it configures against my real root. How should I get EPREFIX set to the proper ROOT ? The reason we're using EPREFIX is because the PHP build system looks for things in exactly the location that you specify through, for example, --with-foo=${EPREFIX}/usr/foo. However, if the user has $ROOT set to something non-standard, I believe EROOT is more appropriate than EPREFIX, since (as the devmanual says), EROOT is shorthand for ${ROOT%/}${EPREFIX}/.
ROOT and EROOT have undefined values in src_* functions. They should be used in pkg_* functions only.
(In reply to Mike Gilbert from comment #1) > ROOT and EROOT have undefined values in src_* functions. They should be used > in pkg_* functions only. So much for that idea then. The user left IRC before I could respond, but I guess he's using ROOT to try to install a separate system in some other directory. Setting ROOT specifies where the built packages get installed, and I presume he wants to build PHP against the things in his new ROOT, and not against the things in "/". Is there a better way to do that (so that I can tell people what to do in the future)? Or something else we should be doing in the ebuild?
I'd still like to know if there's a good solution for what he was trying to do, but I'm going to close this as (now) obviously not the right way.
(In reply to Michael Orlitzky from comment #3) > I'd still like to know if there's a good solution for what he was trying to > do, but I'm going to close this as (now) obviously not the right way. I don't think there is a "good" solution, but I have seen the "SYSROOT" variable used in cross-compile chroot environments. I think this is a candidate for some future EAPI as well. See bug 317337.