Ryo ONODERA <ryo_on%yk.rim.or.jp@localhost> writes: > Hi, > > From: Greg Troxel <gdt%ir.bbn.com@localhost>, Date: Thu, 09 Jan 2014 10:14:07 > -0500 > >> >> Ryo ONODERA <ryo_on%yk.rim.or.jp@localhost> 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 os.sh, machine.sh, 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" #undef MACHINE_ARCH #define MACHINE_ARCH "x86_64" #endif Maybe I'm missing something, but that approach seems straightforward.
Description: PGP signature