tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkgsrc/pkgtools/pkg_install on OpenBSD/amd64

Ryo ONODERA <> writes:

> Hi,
> From: Greg Troxel <>, Date: Thu, 09 Jan 2014 10:14:07 
> -0500
>> Ryo ONODERA <> writes:
>>>> OpenBSD/amd64's "uname -p" and "uname -m" returns "amd64".
>>>> And /usr/include/machine/param.h has following lines.
>>>> #define MACHINE_ARCH    "amd64"
>>>> It results pkg_add command is configured for amd64 not x86_64.
>> I think the real issue is lack of standard values for -p and -m.  As I
>> understand it, -p is for processor, and should be x86_64, whereas -m is
>> for machine and should be amd64, at least in the BSD world.  At least
>> that's what NetBSD does.
>> So I would be inclined to have the code in pkgsrc and tools that obtains
>> "uname -p" output change amd64 to x86_64, and have that be a general
>> subsitution framework.  The other alternative is to put in amd64 as an
>> alias in he code that uses the uname -p values.
> I think that the problem is in /usr/include/machine/param.h, not in output
> of uname.
> It has 
> #define MACHINE_ARCH "amd64"
> MACHINE_ARCH macro is used in bmake and pkg_install.
> Doing sed -e 's/amd64/x86_64/' for output of uname is easy,
> for example,, config.guess etc.
> But it does not effect to MACHINE_ARCH macro.
> How to substitute MACHINE_ARCH macro with another value?

In our compat header:

#if MACHINE_ARCH == "amd64"
#define MACHINE_ARCH "x86_64"

Maybe I'm missing something, but that approach seems straightforward.

Attachment: pgp5rDhU0fcpR.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index