From nobody@FreeBSD.org  Wed Mar 18 18:22:45 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C27D11065676
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 18 Mar 2009 18:22:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 95E7A8FC1B
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 18 Mar 2009 18:22:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n2IIMjuq027545
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 18 Mar 2009 18:22:45 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n2IIMjI3027544;
	Wed, 18 Mar 2009 18:22:45 GMT
	(envelope-from nobody)
Message-Id: <200903181822.n2IIMjI3027544@www.freebsd.org>
Date: Wed, 18 Mar 2009 18:22:45 GMT
From: Rikiya YONEMOTO <fbsd-send-pr-200903@lackaday.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ports/Mk/bsd.port.mk: ${ARCH} misuse for "--build" option of GNU configure
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         132783
>Category:       ports
>Synopsis:       ports/Mk/bsd.port.mk: ${ARCH} misuse for "--build" option of GNU configure
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 18 18:30:05 UTC 2009
>Closed-Date:    
>Last-Modified:  Wed Mar 18 18:30:44 UTC 2009
>Originator:     Rikiya YONEMOTO
>Release:        
>Organization:
>Environment:
$FreeBSD: ports/Mk/bsd.port.mk,v 1.612 2009/03/05 17:56:23 skv Exp $
>Description:
1. CONFIGURE_TARGET is used as "--build=${CONFIGURE_TARGET}"
  not for "--host="/"--target=" in different than the name.
2. Disregarding CONFIGURE_TARGET is used for "--build",
  CONFIGURE_TARGET is defined as "${ARCH}-portbld-freebsd${OSREL}".
  It should be "${MACHINE_ARCH}-portbld-freebsd${OSREL}" for "--build=".
  in acording to ARCH description in bsd.port.mk.
3. Specifying machine field ("portbld") only for "--build=" can be problem.


1-2:
 This can cause problem if anyone try to build some packages (including 
but not limited to: lang/gcc43) on cross with defining ARCH as target
(e.g. building "packages for FreeBSD/sun4v" on FreeBSD/amd64 box).

3:
  build="i386-portbld-freebsd6.4" (bsd.port.mk specified)
   and
  host="i386-unknown-freebsd6.4" (configure decided)
  can be considered as cross on comparison like:
    if test "${build}" = "${host}"; then
     echo "It is native"
    else
     echo "It is cross"
    fi
  This was the case happened on ports/lang/gcc33. See PR:ports/132379.

>How-To-Repeat:

>Fix:
This would be a design issue of Ports, so, approach decision should be 
decided by Ports Management Team, I guess. Atleast not by me.
Here just an approach example(not sure)(also as a part of problem description):
..
CONFIGURE_BUILD?=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_BUILD:=${CONFIGURE_BUILD:S/--build=//}
CONFIGURE_HOST?=${ARCH}-portbld-freebsd${OSREL}
CONFIGURE_HOST:=${CONFIGURE_BUILD:S/--host=//}
CONFIGURE_TARGET?=${ARCH}-portbld-freebsd${OSREL}
CONFIGURE_TARGET:=${CONFIGURE_BUILD:S/--target=//}
..
# Even for configures generated by autoconf-2.13 ?
  _LATE_CONFIGURE_ARGS="$${_LATE_CONFIGURE_ARGS} --build=${CONFIGURE_BUILD} --host=${CONFIGURE_HOST} --target=${CONFIGURE_TARGET}" ;\
..


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Mar 18 18:30:43 UTC 2009 
Responsible-Changed-Why:  
bsd.port.mk is portmgr territory (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132783 
>Unformatted:
