e01ec2f0e03740733a3b7bee5cfd9d080cf49173
[vuplus_openembedded] / gcc / gcc-cross_3.3.3.oe
1 include gcc_${PV}.oe
2 inherit cross
3 FILESDIR = "${@os.path.dirname(oe.data.getVar('FILE',d,1))}/gcc-${PV}"
4
5 DEPENDS := virtual/${TARGET_PREFIX}binutils glibc patcher-native
6 PROVIDES := virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++
7
8 PACKAGES =
9
10 EXTRA_OECONF = '--with-local-prefix=${CROSS_DIR}/${TARGET_SYS} \
11                 --with-gxx-include-dir=${CROSS_DIR}/${TARGET_SYS}/include/c++ \
12                 --with-headers=${CROSS_DIR}/${TARGET_SYS}/include \
13                 --disable-nls \
14                 --enable-threads=posix \
15                 --enable-symvers=gnu \
16                 --enable-__cxa_atexit \
17                 --enable-languages=c,c++ \
18                 --enable-shared \
19                 --enable-c99 \
20                 --enable-long-long \
21                 --program-prefix=${TARGET_PREFIX}'
22
23 export CPPFLAGS =
24 export CXXFLAGS =
25 export CFLAGS =
26 export LDFLAGS =
27
28 do_configure () {
29         export CC="${BUILD_CC}"
30         export AR="${TARGET_SYS}-ar"
31         export RANLIB="${TARGET_SYS}-ranlib"
32         export LD="${TARGET_SYS}-ld"
33         export NM="${TARGET_SYS}-nm"
34         rm -f ${CROSS_DIR}/lib/gcc-lib/${TARGET_SYS}/${PV}/libgcc_eh.a
35         oe_runconf
36 }
37
38 do_compile_prepend () {
39         export CC="${BUILD_CC}"
40         export AR_FOR_TARGET="${TARGET_SYS}-ar"
41         export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib"
42         export LD_FOR_TARGET="${TARGET_SYS}-ld"
43         export NM_FOR_TARGET="${TARGET_SYS}-nm"
44         export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc"
45 }
46
47 do_stage_append () {
48         for d in info man share/doc share/locale ; do
49                 rm -rf ${CROSS_DIR}/$d
50         done
51
52         # These aren't useful on the cross toolchain
53         rm -f ${CROSS_DIR}/bin/*gcov
54         rm -f ${CROSS_DIR}/bin/*gccbug
55
56         # Fix a few include links so cross builds are happier
57         if [ ! -e ${STAGING_DIR}/target/include/c++ ]; then
58                 mkdir -p ${STAGING_DIR}/target/include
59                 ln -s ${CROSS_DIR}/${TARGET_SYS}/include/c++ \
60                         ${STAGING_DIR}/target/include/
61         fi
62
63         # We use libiberty from binutils
64         rm -f ${CROSS_DIR}/lib/libiberty.a
65
66         # We probably don't need these
67         rmdir ${CROSS_DIR}/include || :
68
69         # We don't really need to keep this around
70         rm -rf ${CROSS_DIR}/share
71 }
72
73 # Kill the install so we get no packages (we're the cross compiler)
74 do_install () {
75         :
76 }
77