From leeym@utopia.leeym.com  Sat Feb 21 10:59:22 2004
Return-Path: <leeym@utopia.leeym.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6536316A4DB
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 21 Feb 2004 10:59:22 -0800 (PST)
Received: from utopia.leeym.com (utopia.leeym.com [61.218.64.93])
	by mx1.FreeBSD.org (Postfix) with ESMTP id F38A443D1D
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 21 Feb 2004 10:59:21 -0800 (PST)
	(envelope-from leeym@utopia.leeym.com)
Received: from localhost (localhost [127.0.0.1])
	by utopia.leeym.com (Postfix) with ESMTP id D6F123EAB44
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 22 Feb 2004 02:59:20 +0800 (CST)
Received: from utopia.leeym.com ([127.0.0.1])
 by localhost (utopia.leeym.com [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 90681-10 for <FreeBSD-gnats-submit@freebsd.org>;
 Sun, 22 Feb 2004 02:59:18 +0800 (CST)
Received: by utopia.leeym.com (Postfix, from userid 1000)
	id B2D213EAB43; Sun, 22 Feb 2004 02:59:18 +0800 (CST)
Message-Id: <20040221185918.B2D213EAB43@utopia.leeym.com>
Date: Sun, 22 Feb 2004 02:59:18 +0800 (CST)
From: Yen-Ming Lee <leeym@utopia.leeym.com>
Reply-To: Yen-Ming Lee <leeym@utopia.leeym.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: set MACHINE_ARCH to ARCH
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         63181
>Category:       ports
>Synopsis:       set MACHINE_ARCH to ARCH
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 21 11:00:43 PST 2004
>Closed-Date:    Sun Feb 22 03:01:54 PST 2004
>Last-Modified:  Sun Feb 22 03:10:13 PST 2004
>Originator:     Yen-Ming Lee
>Release:        FreeBSD 5.2.1-RC2 i386
>Organization:
>Environment:
System: FreeBSD utopia.leeym.com 5.2.1-RC2 FreeBSD 5.2.1-RC2 #5: Tue Feb 17 05:19:23 CST 2004 root@utopia.leeym.com:/usr/obj/usr/src/sys/UTOPIA i386


	
>Description:

MACHINE_ARCH is hardcoded as "i386" in bsd.port.mk
ARCH is the result of "uname -p"

CONFIGURE_TARGET is defined as ${MACHINE_ARCH}-portbld-freebsd${OSREL},
so it will always be i386-portbld-freebsdX.Y. Therefore, it will mislead
the configure script in some ports, such as lang/gauche, while building
on non-i386 platforms. By the way, the hardcoded MACHINE_ARCH will confuse
ONLY_FOR_ARCHS and NOT_FOR_ARCHS, too.

However, this patch may break something on pre-3.0 systems.
Need further discussions.

>How-To-Repeat:
	
>Fix:

	

--- bsd.port.mk.diff begins here ---
? bsd.port.mk.diff
Index: bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.484
diff -u -r1.484 bsd.port.mk
--- bsd.port.mk	4 Feb 2004 04:27:04 -0000	1.484
+++ bsd.port.mk	21 Feb 2004 18:50:36 -0000
@@ -975,7 +975,7 @@
 .endif
 
 # Kludge for pre-3.0 systems
-MACHINE_ARCH?=	i386
+MACHINE_ARCH?=	${ARCH}
 
 # Get the operating system type
 .if !defined(OPSYS)
--- bsd.port.mk.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr  
Responsible-Changed-By: krion 
Responsible-Changed-When: Sat Feb 21 11:23:22 PST 2004 
Responsible-Changed-Why:  
portmgr territory 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63181 

From: Kris Kennaway <kris@obsecurity.org>
To: Yen-Ming Lee <leeym@utopia.leeym.com>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/63181: set MACHINE_ARCH to ARCH
Date: Sat, 21 Feb 2004 11:42:43 -0800

 On Sun, Feb 22, 2004 at 02:59:18AM +0800, Yen-Ming Lee wrote:
 > 
 > >Number:         63181
 > >Category:       ports
 > >Synopsis:       set MACHINE_ARCH to ARCH
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       medium
 > >Responsible:    freebsd-ports-bugs
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          change-request
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Sat Feb 21 11:00:43 PST 2004
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Yen-Ming Lee
 > >Release:        FreeBSD 5.2.1-RC2 i386
 > >Organization:
 > >Environment:
 > System: FreeBSD utopia.leeym.com 5.2.1-RC2 FreeBSD 5.2.1-RC2 #5: Tue Feb 17 05:19:23 CST 2004 root@utopia.leeym.com:/usr/obj/usr/src/sys/UTOPIA i386
 > 
 > 
 > 	
 > >Description:
 > 
 > MACHINE_ARCH is hardcoded as "i386" in bsd.port.mk
 > ARCH is the result of "uname -p"
 > 
 > CONFIGURE_TARGET is defined as ${MACHINE_ARCH}-portbld-freebsd${OSREL},
 > so it will always be i386-portbld-freebsdX.Y. Therefore, it will mislead
 > the configure script in some ports, such as lang/gauche, while building
 > on non-i386 platforms. By the way, the hardcoded MACHINE_ARCH will confuse
 > ONLY_FOR_ARCHS and NOT_FOR_ARCHS, too.
 > 
 > However, this patch may break something on pre-3.0 systems.
 > Need further discussions.
 
 I think something is wrong here..MACHINE_ARCH is only set to i386 if
 not already set ("?="), and (after 3.0) the make binary sets the
 variable by default.  Furthermore, I set MACHINE_ARCH explicitly on
 bento, so I don't think this is the cause of those port failures.  I
 can confirm that most ports do not think they're being build on an
 i386 on bento :-)
 
 Kris

From: Yen-Ming Lee <leeym@FreeBSD.org>
To: Kris Kennaway <kris@obsecurity.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/63181: set MACHINE_ARCH to ARCH
Date: Sun, 22 Feb 2004 13:19:40 +0800

 --W/nzBZO5zC0uMSeA
 Content-Type: text/plain; charset=big5
 Content-Disposition: inline
 Content-Transfer-Encoding: 8bit
 
 Does it mean that if we install FreeBSD on a non-i386 platform, we need to
 set MACHINE_ARCH explicitly in /etc/make.conf or somewhere else, otherwise
 the ports will think they're being building on an i386 system?
 
 Since we already have the correct ARCH, why we still need to do it by ourselves?
 
 --
 Yen-Ming Lee [۩] KeyID: 0x5EB52E51 : www.leeym.com : Taipei, Taiwan
 
 --W/nzBZO5zC0uMSeA
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (FreeBSD)
 
 iQCVAwUBQDg77MnMx0NetS5RAQHkGAP9Gxb5SnpLZxKHoiFjrW0YCiLK8aCNhfEI
 7ummMZlyCA4s6eOZsXtYWC69JjUWSBZ3Mtdcxm/6rNF4A1fFFG2PW8q5nIXcB1Zu
 n+VlLQ27l5/EUUiV7cqZUjtOYCKvi0L+UZYoYwndyWmhsYJacA3HVVuhvyFF5Yrt
 1e69uZ6GD9k=
 =UMZ/
 -----END PGP SIGNATURE-----
 
 --W/nzBZO5zC0uMSeA--

From: Kris Kennaway <kris@obsecurity.org>
To: Yen-Ming Lee <leeym@FreeBSD.org>
Cc: Kris Kennaway <kris@obsecurity.org>,
	FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/63181: set MACHINE_ARCH to ARCH
Date: Sat, 21 Feb 2004 21:24:18 -0800

 --AqsLC8rIMeq19msA
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Sun, Feb 22, 2004 at 01:19:40PM +0800, Yen-Ming Lee wrote:
 > Does it mean that if we install FreeBSD on a non-i386 platform, we need to
 > set MACHINE_ARCH explicitly in /etc/make.conf or somewhere else, otherwise
 > the ports will think they're being building on an i386 system?
 >=20
 > Since we already have the correct ARCH, why we still need to do it by our=
 selves?
 
 Nope, make(1) knows the correct value and exports it to the makefile enviro=
 nment.
 
 Kris
 
 --AqsLC8rIMeq19msA
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (FreeBSD)
 
 iD8DBQFAOD0CWry0BWjoQKURAschAJ9s80dQIO8VBZ9n1bLvZbQNPIn6rQCfW5Yu
 Dcm+v5V/l7R+g+KbTqJuuHg=
 =O/6g
 -----END PGP SIGNATURE-----
 
 --AqsLC8rIMeq19msA--

From: Yen-Ming Lee <leeym@FreeBSD.org>
To: Kris Kennaway <kris@obsecurity.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/63181: set MACHINE_ARCH to ARCH
Date: Sun, 22 Feb 2004 13:45:16 +0800

 --LQksG6bCIzRHxTLp
 Content-Type: text/plain; charset=big5
 Content-Disposition: inline
 Content-Transfer-Encoding: 8bit
 
 Well, when I tested it on beast.FreeBSD.org (alpha), I got the wrong answers.
 
 $ uname -p
 alpha
 $ cd /usr/ports && make -V MACHINE_ARCH
 i386
 $ env | grep ARCH
 MACHINE_ARCH=i386
 
 and on panther.FreeBSD.org (sparc64) and sledge.FreeBSD.org (amd64),
 they told me the values, too.
 
 If the setting on beast is wrong, please correct and document it,
 and then close this PR. We should remind users to set the correct
 MACHINE_ARCH explicitly for make(1).
 
 If the setting on beast is right (use all default value), but still
 cause the wrong MACHINE_ARCH, please figure out an automatic solution.
 
 -- 
 Yen-Ming Lee [۩] KeyID: 0x5EB52E51 : www.leeym.com : Taipei, Taiwan
 
 --LQksG6bCIzRHxTLp
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (FreeBSD)
 
 iQCVAwUBQDhB7MnMx0NetS5RAQGSnwP/QnXWG/wMMRHCTUTurhYfAOsMQYFi/e9w
 Nf0YX/55DNbzKx57m7lcKlfsUvK/X/uiYv0r82fkh/E8Q4kBWbzr5HAkwQjVtBx8
 KtuYhyWsOcQ00dLK/78g8KXEc6iYUBiVWTq3PffHD/9J2Ywn2rTFSNnSrx3URJp+
 nsmzf3dKlnM=
 =IxB+
 -----END PGP SIGNATURE-----
 
 --LQksG6bCIzRHxTLp--

From: Kris Kennaway <kris@obsecurity.org>
To: Yen-Ming Lee <leeym@FreeBSD.org>
Cc: Kris Kennaway <kris@obsecurity.org>,
	FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/63181: set MACHINE_ARCH to ARCH
Date: Sat, 21 Feb 2004 21:58:34 -0800

 --O5XBE6gyVG5Rl6Rj
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Sun, Feb 22, 2004 at 01:45:16PM +0800, Yen-Ming Lee wrote:
 > Well, when I tested it on beast.FreeBSD.org (alpha), I got the wrong answ=
 ers.
 >=20
 > $ uname -p
 > alpha
 > $ cd /usr/ports && make -V MACHINE_ARCH
 > i386
 > $ env | grep ARCH
 > MACHINE_ARCH=3Di386
 
 kkenn@enigma:~ env | grep ARCH
 kkenn@enigma:~
 
 There's your problem..you seem to have MACHINE_ARCH explicitly in your
 environment.
 
 kris
 
 --O5XBE6gyVG5Rl6Rj
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (FreeBSD)
 
 iD8DBQFAOEUKWry0BWjoQKURAjw+AJ0V/8LHGMjWQwANhowKVsXGd/7roACgppEV
 JDg3EOMnOnUAoySAHM1OD48=
 =pH1q
 -----END PGP SIGNATURE-----
 
 --O5XBE6gyVG5Rl6Rj--
State-Changed-From-To: open->closed 
State-Changed-By: leeym 
State-Changed-When: Sun Feb 22 03:01:52 PST 2004 
State-Changed-Why:  
It is my mistake, Sorry for bothering. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63181 

From: Yen-Ming Lee <leeym@FreeBSD.org>
To: Kris Kennaway <kris@obsecurity.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/63181: set MACHINE_ARCH to ARCH
Date: Sun, 22 Feb 2004 19:00:27 +0800

 --EeQfGwPcQSOJBaQU
 Content-Type: text/plain; charset=big5
 Content-Disposition: inline
 Content-Transfer-Encoding: 8bit
 
 On Sat, Feb 21, 2004 at 09:58:34PM -0800, Kris Kennaway wrote:
 > On Sun, Feb 22, 2004 at 01:45:16PM +0800, Yen-Ming Lee wrote:
 > > Well, when I tested it on beast.FreeBSD.org (alpha), I got the wrong answers.
 > >
 > > $ uname -p
 > > alpha
 > > $ cd /usr/ports && make -V MACHINE_ARCH
 > > i386
 > > $ env | grep ARCH
 > > MACHINE_ARCH=i386
 >
 > kkenn@enigma:~ env | grep ARCH
 > kkenn@enigma:~
 >
 > There's your problem..you seem to have MACHINE_ARCH explicitly in your
 > environment.
 >
 > kris
 
 Oops, I forget that I hardcoded it in my .cshrc files. :(
 Sorry for bothering..
 
 --
 Yen-Ming Lee [۩] KeyID: 0x5EB52E51 : www.leeym.com : Taipei, Taiwan
 
 --EeQfGwPcQSOJBaQU
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (FreeBSD)
 
 iQCVAwUBQDiLy8nMx0NetS5RAQEDcwP/etZmIvNcbij5M/idH1oBxbOQYImhEMC2
 FUFgVUbvGbWRj06fO8NB8EGhyg37dI8PkUFR21+sIabihqF/ccnUomgA/pN9VLWc
 ub3K3NEgCw0ZPHIvL+oHr06Uvwhc5bNAeRf9ImD99Ivi2jrtLIKmwV0z69OClKBR
 dL4AIZJJBwI=
 =GCuL
 -----END PGP SIGNATURE-----
 
 --EeQfGwPcQSOJBaQU--
>Unformatted:
