diff options
author | abs <abs@pkgsrc.org> | 2001-01-29 10:25:07 +0000 |
---|---|---|
committer | abs <abs@pkgsrc.org> | 2001-01-29 10:25:07 +0000 |
commit | 5ce93eed9a2032d2e7691aeb6de65f4fb8c0c9d0 (patch) | |
tree | 508046d31410a1714b8dd502771e3e0c7ba9e6e6 /cross/binutils/files | |
parent | 3b8258c28a2f49a5b951f13788d52ba2bd6f854b (diff) | |
download | pkgsrc-5ce93eed9a2032d2e7691aeb6de65f4fb8c0c9d0.tar.gz |
Add a 'cross-env' script which helps set up the environment for cross
compiling or similar. Based on various postings and notes from the site.
Diffstat (limited to 'cross/binutils/files')
-rwxr-xr-x | cross/binutils/files/cross-env | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/cross/binutils/files/cross-env b/cross/binutils/files/cross-env new file mode 100755 index 00000000000..6dd4ced2152 --- /dev/null +++ b/cross/binutils/files/cross-env @@ -0,0 +1,61 @@ +#! /bin/sh +# $NetBSD: cross-env,v 1.1 2001/01/29 10:25:07 abs Exp $ + +PREFIX=@@PREFIX@@ + +if [ -z "$CROSS_PKG" ] ;then + cat <<END +You should set 'CROSS_PKG' to the name of the cross compile package, eg: +'sparc-netbsdelf'. If MACHINE_ARCH is not already set it will be set to +the part before the '-' (eg: 'sparc'). You may find it useful to also set +MACHINE. +END +exit 1 +fi + +if [ -z "$MACHINE_ARCH" ];then + export MACHINE_ARCH=`echo $CROSS_PKG| sed 's:-.*::'` +fi + +BINDIR=$PREFIX/$CROSS_PKG/bin +echo $BINDIR + +if [ ! -d $BINDIR ];then + echo "Unable to locate $MACHINE_ARCH cross compiler in $BINDIR" + echo "Have you installed the appropriate pkgsrc/cross/$CROSS_PKG package?" + exit 3 +fi + +export PATH=$BINDIR:$PATH + +GCC_EXEC_PREFIX=$CROSS_PKG + +export ADDR2LINE=$BINDIR/addr2line +export AR=$BINDIR/ar +export AS=$BINDIR/as +export CC=$BINDIR/gcc +export CPP=`$CC -print-prog-name=cpp` +export CXX=$BINDIR/c++ +export FC=$BINDIR/f77 +export GASP=$BINDIR/gasp +export LD=$BINDIR/ld +export NM=$BINDIR/nm +export OBJCOPY=$BINDIR/objcopy +export OBJDUMP=$BINDIR/objdump +export RANLIB=$BINDIR/ranlib +export SIZE=$BINDIR/size +export STRINGS=$BINDIR/strings +export STRIP=$BINDIR/strip + +export MKPROFILE=no +export MKLINT=no +#export MKMAN=no + +export HOSTED_CC=cc + +export MAKE=make +#export MAKE="make -f ${DESTDIR}/usr/share/mk/sys.mk -f Makefile" +#export MAKEFLAGS="-I ${DESTDIR}/usr/share/mk" + +set -x +exec $@ |