On Wed, Feb 14, 2018 at 7:10 PM, Ian Zimmerman <[email protected]> wrote:
> I am trying to package software whose build process (autotools based)
> depends on a variable "ABI" to determine (on x86 and amd64 arch at least)
> whether to build as 64 bit or 32 bit. If it is not set externally, the
> configure script sets it by inspecting the native pointer size of the C
> compiler, to either "64" or "32".
>
> Naturally, I thought the cleanest way for a package was to leave it
> unset and let configure choose the native value. But somehow it ends up
> with a setting "amd64" and then complains that it is not one of the
> expected values. I am stuck determining where that value comes from.
> Is it portage? If so, how to change or disable it? Is it safe to just
> do the following?
>
> ABI='' ./configure
ABI is a profile variable. On an amd64 system it is defined in
profiles/arch/amd64/make.defaults.
The ABI variable is used by functions in multilib.eclass,
toolchain-funcs.eclass, and the econf function to determine the
correct libdir (lib, lib32, lib64, etc).
For an autotools build, you will probably want to call the econf
function, so unsetting ABI is a bad idea. Instead, you probably want
to "unexport" it (export -n). This will allow econf to see it, but the
value will not be inherited by configure.
src_configure() {
export -n ABI
econf
}