summaryrefslogtreecommitdiff
path: root/cross/cross-binutils/files/cross-env
blob: 491eb716b5ed20813978d0ff8bd4d79a51217059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /bin/sh
# $NetBSD: cross-env,v 1.1 2016/06/19 16:18:28 wiz 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 "$@"