Subject: Re: pkg/19789: MACHINE_ARCH is i686, but Makefiles check for i386
To: grant beattie <grant@netbsd.org>
From: Jan Schaumann <jschauma@netbsd.org>
List: tech-pkg
Date: 01/11/2003 13:12:02
--fdj2RfSjLxBAspz7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

grant beattie <grant@netbsd.org> wrote:
> On Sat, Jan 11, 2003 at 08:33:03AM -0800, reed@reedmedia.net wrote:
> 
> > I just don't know where the LOWER_ARCH and MACHINE_ARCH are set.
> > 
> > I think the fix is to use
> > 
> > sed -e 's/[456]86/386/'
> 
> I was also thinking about how to handle to Linux stuff.
> 
> Perhaps we should globally squash i[3-6]86 into i386.

Yes, I think so.  At least, I can't think of any reason why or when we'd
do i[456]86 stuff differently form i386.

Since MACHINE_ARCH is determined at compile-time for bmake, we can
choose to either change it right then, or compile in the specific
version and override it in bsd.prefs.mk.  If nobody can think of a
reason why we'd want to keep it in the binary, I think we should change
it there (as attached).

> Kernel versions could also be truncated eg. 2.4.10 -> 2.4, as binaries
> should be compatible (I'm guessing, someone please correct me I am
> wrong).

I think that binaries are supposed to be compatible, but we still might
want to keep OS_VERSION accurate.  It's conceivable that one kernel
version has some terrible flaw that would prevent a package from being
usable or secure, and I think we rarely check for OS_VERSION anyway, so
that it won't have a big impact one way or the other.

-Jan

-- 
This one's tricky. You have to use imaginary numbers, like eleventeen...

--fdj2RfSjLxBAspz7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: machine.sh
===================================================================
RCS file: /cvsroot/othersrc/bootstrap-pkgsrc/bmake/machine.sh,v
retrieving revision 1.2
diff -b -u -r1.2 machine.sh
--- machine.sh	2002/11/17 09:17:59	1.2
+++ machine.sh	2003/01/11 18:05:41
@@ -57,6 +57,9 @@
 IRIX)
 	MACHINE_ARCH=`uname -p 2>/dev/null`
 	;;
+Linux)
+	MACHINE_ARCH=`echo $machine | sed -e 's/[456]86/386/'`
+	;;
 esac
 
 MACHINE=${MACHINE:-$OS$OSMAJOR}

--fdj2RfSjLxBAspz7--