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



Hi,

From: Greg Troxel <gdt%ir.bbn.com@localhost>, Date: Fri, 10 Jan 2014 14:22:49 
-0500

> 
> 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.

#if MACHINE_ARCH == "amd64"
does not work for me. 
See http://c-faq.com/cpp/ifstrcmp.html
"How can I construct preprocessor #if expressions which compare strings?"

But I may misunderstand something...

--
Ryo ONODERA // ryo_on%yk.rim.or.jp@localhost
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Home | Main Index | Thread Index | Old Index