From owner-freebsd-qa Mon Sep 3 17: 0:22 2001 Delivered-To: freebsd-qa@freebsd.org Received: from kayak.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by hub.freebsd.org (Postfix) with ESMTP id 69A9737B408; Mon, 3 Sep 2001 16:59:58 -0700 (PDT) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by kayak.xcllnt.net (8.11.4/8.11.4) with ESMTP id f83Nxv601061; Mon, 3 Sep 2001 16:59:57 -0700 (PDT) (envelope-from marcel@kayak.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.11.6/8.11.3) id f83NxvU03029; Mon, 3 Sep 2001 16:59:57 -0700 (PDT) (envelope-from marcel) Date: Mon, 3 Sep 2001 16:59:57 -0700 From: Marcel Moolenaar To: Kris Kennaway Cc: Eric Masson , Larry Rosenman , John Baldwin , freebsd-stable@FreeBSD.ORG, qa@FreeBSD.ORG Subject: Re: cputype=486 Message-ID: <20010903165956.A2872@dhcp01.pn.xcllnt.net> References: <20010901114903.D11062@athlon.pn.xcllnt.net> <20010901161054.B13047@athlon.pn.xcllnt.net> <20010902084832.B2510@lerami.lerctr.org> <20010902111131.B478@dhcp01.pn.xcllnt.net> <20010902163046.A26933@lerami.lerctr.org> <20010902144728.A41762@dhcp01.pn.xcllnt.net> <86elppyxhp.fsf@notbsdems.nantes.kisoft-services.com> <20010903094702.A554@dhcp01.pn.xcllnt.net> <20010903141538.A36786@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010903141538.A36786@xor.obsecurity.org> User-Agent: Mutt/1.3.21i Sender: owner-freebsd-qa@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Sep 03, 2001 at 02:15:38PM -0700, Kris Kennaway wrote: > > > > I think it would be better to keep the definition of architecture > > as it is but decorate it with model for build purposes. This means > > that you need a simple way to extract the arch+model string from > > the runtime environment so that you can use it in make(1). A build > > is then started by saying something like: > > > > make buildworld HOST_MACH=i386-p3 > > ${CPUTYPE} on the host system would do it. Perhaps we need to make a > new variable akin to the other cross-compiling variables to tell it > what CPUTYPE to cross-compile for. CPUTYPE can indeed be used for that, provided we stop using MACHINE_ARCH for cross-build purposes. If we use HOST_MACH, then make(1) can provide a default value based on MACHINE_ARCH and CPUTYPE, otherwise the user has specified a cross-build and MACHINE_ARCH and CPUTYPE are ignored. If we handle the case where CPUTYPE is undefined, and also the case where users define MACHINE_ARCH without the CPUTYPE portion, it will look to most users as if we just changed the name of the variable from MACHINE_ARCH to HOST_MACH, without breaking backward compatibility. We can probably also throw in a test that avoids constructing HOST_MACH with a MACHINE_ARCH different from the native machine but with the local CPUTYPE, to avoid mixing an i386 CPUTYPE with a non-i386 MACHINE_ARCH. The complete picture can be something like: \begin{pseudo code} # Construct BUILD_MACH - A description of the build machine. # Avoid using MACHINE_ARCH for backward compatibility. BUILD_MACH=`uname -m` if (defined(CPUTYPE)) then BUILD_MACH=${BUILD_MACH}-${CPUTYPE} fi # Construct HOST_MACH - A description of the machine we're # building for. if (!defined(HOST_MACH)) then if (${MACHINE_ARCH} != `uname -m`) then HOST_MACH=${MACHINE_ARCH} # XXX - reset MACHINE_ARCH? else HOST_MACH=${BUILD_MACH} fi fi if (${BUILD_MACH} != ${HOST_MACH}) then echo "Cross-building!" fi \end{pseudo code} -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-qa" in the body of the message