summaryrefslogtreecommitdiff
path: root/packages/gcc/gcc-cross-sdk_3.3.4.bb
blob: 562f67114a281b77e983da629acc5ce52c9347be (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
DESCRIPTION = "The GNU cc and gcc C compilers."
HOMEPAGE = "http://www.gnu.org/software/gcc/"
SECTION = "devel"
LICENSE = "GPL"
MAINTAINER = "Phil Blundell <pb@handhelds.org>"
PR = "r1"

inherit autotools sdk

SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
	   file://arm-gotoff.dpatch;patch=1;pnum=0 \
	   file://arm-ldm.dpatch;patch=1;pnum=0 \
	   file://arm-tune.patch;patch=1;pnum=0 \
	   file://arm-ldm-peephole.patch;patch=1;pnum=0 \
	   file://libibery-crosstool.patch;patch=1;pnum=1 \
	   file://reverse-compare.patch;patch=1 \
	   file://gcc34-15089.patch;patch=1 \
	   file://gcc-uclibc-3.3-100-conf.patch;patch=1 \
	   file://gcc-uclibc-3.3-110-conf.patch;patch=1 \
	   file://gcc-uclibc-3.3-120-softfloat.patch;patch=1 \
	   file://gcc-uclibc-3.3-200-code.patch;patch=1 \
	   file://bash3.patch;patch=1"

SRC_URI += 'file://sdk-libstdc++-includes.patch;patch=1'

MIRRORS_prepend () {
${GNU_MIRROR}/gcc/	http://mirrors.rcn.net/pub/sourceware/gcc/releases/
}

S = "${WORKDIR}/gcc-${PV}"
B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"

FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/gcc-${PV}"

DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc"

export CPPFLAGS = ""
export CXXFLAGS = ""
export CFLAGS = ""
export LDFLAGS = ""

STAGING_TARGET_INCDIR = "${STAGING_DIR}/${TARGET_SYS}/include"
STAGING_TARGET_LIBDIR = "${STAGING_DIR}/${TARGET_SYS}/lib"

EXTRA_OECONF = "--with-gnu-ld \
                --enable-shared \
                --enable-languages=c,c++,f77 \
                --enable-threads=posix \
                --enable-multilib \
                --enable-c99 \
                --enable-long-long \
                --enable-symvers=gnu \
                --program-prefix=${TARGET_PREFIX} \
                ${EXTRA_OECONF_PATHS} \
                ${EXTRA_OECONF_DEP}"

do_configure () {
	(cd ${S} && gnu-configize) || die "failure running gnu-configize"
	(cd ${S}/libstdc++-v3 && autoreconf)
	oe_runconf
	mkdir -p gcc
	ln -sf ${CROSS_DIR}/bin/${TARGET_PREFIX}as gcc/as
	ln -sf ${CROSS_DIR}/bin/${TARGET_PREFIX}ld gcc/ld
	ln -sf ${STAGING_TARGET_INCDIR}/* ${S}/include
	ln -sf ${STAGING_TARGET_LIBDIR}/crt*.o gcc/
}

do_compile () {
	export CC="${BUILD_CC}"
	export AR_FOR_TARGET="${TARGET_SYS}-ar"
	export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib"
	export LD_FOR_TARGET="${TARGET_SYS}-ld"
	export NM_FOR_TARGET="${TARGET_SYS}-nm"
	export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc"
	oe_runmake CFLAGS_FOR_TARGET="-I${STAGING_TARGET_INCDIR}" 
}

do_install () {
	autotools_do_install
}