Bug 35514 - Use the value of hw.machine_arch instead of hw.machine to get the arch of the machine.
Summary: Use the value of hw.machine_arch instead of hw.machine to get the arch of the...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-03 11:40 UTC by Takahashi Yoshihiro
Modified: 2003-02-10 09:15 UTC (History)
0 users

See Also:


Attachments
file.diff (1.70 KB, patch)
2002-03-03 11:40 UTC, Takahashi Yoshihiro
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Takahashi Yoshihiro 2002-03-03 11:40:01 UTC
Currently, we use the value of hw.machine to get the arch of the machine in
bsd.port.mk and bsd.port.subdir.mk. But, we should use the value of
hw.machine_arch instead of hw.machine.

We can use 'uname -p' to get hw.machine_arch because 'uname -p' prints the
value of hw.machine_arch now.
Comment 1 Yoshihiro Takahashi freebsd_committer freebsd_triage 2002-03-03 11:44:16 UTC
Responsible Changed
From-To: freebsd-ports->portmgr

Over to maintainer.
Comment 2 Peter Pentchev 2002-03-14 13:51:44 UTC
On Sun, Mar 03, 2002 at 08:39:09PM +0900, Takahashi Yoshihiro wrote:
> 
> >Number:         35514
> >Category:       ports
> >Synopsis:       Use the value of hw.machine_arch instead of hw.machine to get the arch of the machine.
> >Originator:     Takahashi Yoshihiro
> >Description:
> Currently, we use the value of hw.machine to get the arch of the machine in
> bsd.port.mk and bsd.port.subdir.mk. But, we should use the value of
> hw.machine_arch instead of hw.machine.
> 
> We can use 'uname -p' to get hw.machine_arch because 'uname -p' prints the
> value of hw.machine_arch now.
[snip]
>  .if !defined(ARCH)
> -ARCH!=	${UNAME} -m
> +ARCH!=	${UNAME} -p
>  .endif

Just a minor comment: I think this, as well as the other places ARCH is
set, should be made conditional upon OSVERSION - not all the FreeBSD
versions we support have the uname -p format.

Other than that, this would be a Good Thing(tm).

G'luck,
Peter

-- 
Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
If I were you, who would be reading this sentence?
Comment 3 Takahashi Yoshihiro 2002-03-14 14:28:18 UTC
In article <20020314155144.D362@straylight.oblivion.bg>
Peter Pentchev <roam@ringlet.net> writes:

> >  .if !defined(ARCH)
> > -ARCH!=	${UNAME} -m
> > +ARCH!=	${UNAME} -p
> >  .endif
> 
> Just a minor comment: I think this, as well as the other places ARCH is
> set, should be made conditional upon OSVERSION - not all the FreeBSD
> versions we support have the uname -p format.

Currently, hw.machine_arch is same as hw.machine with all architectures
FreeBSD supports. (pc98 is special case. I may change it.) So, I think
that it does not need to make conditional.

BTW, uname -p option was added at Feb 24 1998 for compatibility. All
versions of 3.x and 4.x (of course 5-current) have uname -p option.

---
TAKAHASHI Yoshihiro
THE CENTER for INFORMATION SCIENCE, Kogakuin Univ.
Comment 4 Peter Pentchev 2002-03-14 14:37:07 UTC
On Thu, Mar 14, 2002 at 11:28:18PM +0900, Takahashi Yoshihiro wrote:
> In article <20020314155144.D362@straylight.oblivion.bg>
> Peter Pentchev <roam@ringlet.net> writes:
> 
> > >  .if !defined(ARCH)
> > > -ARCH!=	${UNAME} -m
> > > +ARCH!=	${UNAME} -p
> > >  .endif
> > 
> > Just a minor comment: I think this, as well as the other places ARCH is
> > set, should be made conditional upon OSVERSION - not all the FreeBSD
> > versions we support have the uname -p format.
> 
> Currently, hw.machine_arch is same as hw.machine with all architectures
> FreeBSD supports. (pc98 is special case. I may change it.) So, I think
> that it does not need to make conditional.

Yep, I was aware of that; my comment arose from the fact that I thought
that uname(1) did not support the -p cmdline argument until recently.

> BTW, uname -p option was added at Feb 24 1998 for compatibility. All
> versions of 3.x and 4.x (of course 5-current) have uname -p option.

Oops; I seem to have confused the change to uname to make -p actually
return the arch with the change to uname to support -p at all.  Thanks
for the clarification!

G'luck,
Peter

-- 
Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
Do you think anybody has ever had *precisely this thought* before?
Comment 5 Kris Kennaway freebsd_committer freebsd_triage 2003-01-25 01:09:29 UTC
State Changed
From-To: open->analyzed

This is being tested and will be committed shortly.
Comment 6 Kris Kennaway freebsd_committer freebsd_triage 2003-02-10 09:15:24 UTC
State Changed
From-To: analyzed->closed

Patch committed, thanks!