Subject: cross ELF compiler package available
To: None <port-i386@netbsd.org>
From: matthew green <mrg@eterna.com.au>
List: port-i386
Date: 02/14/1999 21:26:59
hi folks.


i've just imported a cross-i386-netbsdelf compiler to pkgsrc/cross.
this will allow you to install an ELF compiler in a cross-compile
environment (ie, without touching the install, working a.out tools).

check the next sup!

please report problems via send-pr(1) as i do not read this mailing
list.  thanks!


.mrg.

ps, install this script as 'i386elf' and you can use it to run commands
like 'i386elf make' to build using the cross tools!  see other names
available in the script itself.  send problems with this to me at
<mrg@eterna.com.au>.


#! /bin/sh
#
#	$eterna: cross.sh,v 1.1 1999/02/14 10:25:51 mrg Exp $

LOCAL=/usr/pkg
BINDIR=$LOCAL/cross/bin

case $0 in
	*i386elf*)		# NetBSD/i386 ELF
				MACHINE_ARCH=i386 export MACHINE_ARCH
				MACHINE=i386 export MACHINE
				WHICH=i386-netbsdelf
				;;

	*sparc64*)		# NetBSD/sparc64 64-bit ELF
				MACHINE_ARCH=sparc64 export MACHINE_ARCH
				MACHINE=sparc64 export MACHINE
				WHICH=sparc64-netbsd
				;;

	*sparcelfv9*)		# NetBSD/sparc64 32-bit ELF
				MACHINE_ARCH=sparc export MACHINE_ARCH
				MACHINE=sparc64 export MACHINE
				WHICH=sparc-netbsdelf
				;;

	*sparcelf*)		# NetBSD/sparc 32-bit ELF
				MACHINE_ARCH=sparc export MACHINE_ARCH
				MACHINE=sparc export MACHINE
				WHICH=sparc-netbsdelf
				;;

	*)			# bzzt!
				echo "$0: no such support yet.  fix me."
				exit 1
				;;
esac

while test $# -gt 0
do
	case "$1" in
	-n)	
		WHICH=$2
		shift
		shift
		;;
	-m)
		MACHINE=$2
		shift
		shift
		;;
	-a)
		MACHINE_ARCH=$2
		shift
		shift
		;;
	*)	
		break
		;;
	esac
done


PATH=$BINDIR:$LOCAL/cross/$WHICH/bin:$PATH:$LOCAL/cross/bin export PATH

GCC_EXEC_PREFIX=$WHICH

AR=$BINDIR/$WHICH-ar export AR
AS=$BINDIR/$WHICH-as export AS
CC=$BINDIR/$WHICH-gcc export CC
CPP=`$CC -print-prog-name=cpp` export CPP
CXX=$BINDIR/$WHICH-c++ export CXX
FC=$BINDIR/$WHICH-f77 export FC
LD=$BINDIR/$WHICH-ld export LD
NM=$BINDIR/$WHICH-nm export NM
RANLIB=$BINDIR/$WHICH-ranlib export RANLIB
SIZE=$BINDIR/$WHICH-size export SIZE
ADDR2LINE=$BINDIR/$WHICH-addr2line export ADDR2LINE
GASP=$BINDIR/$WHICH-gasp export GASP
OBJCOPY=$BINDIR/$WHICH-objcopy export OBJCOPY
OBJDUMP=$BINDIR/$WHICH-objdump export OBJDUMP
STRINGS=$BINDIR/$WHICH-strings export STRINGS
STRIP=$BINDIR/$WHICH-strip export STRIP

if [ $# -eq 0 ]; then
	exec ${SHELL-/bin/sh}
else
	exec "$@"
fi