]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/gcc/gcc3-build.inc
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / gcc / gcc3-build.inc
1 MIRRORS_prepend () {
2 ${GNU_MIRROR}/gcc/releases/    ftp://gcc.gnu.org/pub/gcc/releases/
3 ${GNU_MIRROR}/gcc/      http://mirrors.rcn.net/pub/sourceware/gcc/releases/
4 ${GNU_MIRROR}/gcc/releases/    http://gcc.get-software.com/releases/
5 ${GNU_MIRROR}/gcc/      http://gcc.get-software.com/releases/
6 }
7
8 gcclibdir ?= "${libdir}/gcc"
9 S = "${WORKDIR}/gcc-${PV}"
10 B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
11 BINV ?= "${PV}"
12
13 # gcj doesn't work on arm
14 JAVA = ",java"
15 JAVA_arm = ""
16 JAVA_armeb = ""
17 JAVA_mipsel = ""
18 # gcc4-build sets this to f95
19 FORTRAN ?= "f77"
20 LANGUAGES ?= "c,c++,${FORTRAN}${JAVA}"
21
22 EXTRA_OECONF = "${@['--enable-clocale=generic', ''][bb.data.getVar('USE_NLS', d, 1) != 'no']} \
23                 --with-gnu-ld \
24                 --enable-shared \
25                 --enable-target-optspace \
26                 --enable-languages=${LANGUAGES} \
27                 --enable-threads=posix \
28                 --enable-multilib \
29                 --enable-c99 \
30                 --enable-long-long \
31                 --enable-symvers=gnu \
32                 --enable-libstdcxx-pch \
33                 --program-prefix=${TARGET_PREFIX} \
34                 ${EXTRA_OECONF_PATHS} \
35                 ${EXTRA_OECONF_DEP}"
36
37 EXTRA_OECONF_PATHS = " \
38                       --with-local-prefix=${prefix}/local \
39                       --with-gxx-include-dir=${includedir}/c++/${BINV}"
40
41 EXTRA_OECONF_DEP = ""
42 EXTRA_OECONF_uclibc = "--disable-__cxa_atexit"
43 EXTRA_OECONF_glibc = "--enable-__cxa_atexit"
44 EXTRA_OECONF += "${@get_gcc_fpu_setting(bb, d)}"
45 CPPFLAGS = ""
46
47 # Used by configure to define additional values for FLAGS_FOR_TARGET -
48 # passed to all the compilers.
49 ARCH_FLAGS_FOR_TARGET = ""
50 ARCH_FLAGS_FOR_TARGET_nslu2 = "${TARGET_CC_ARCH}"
51 EXTRA_OEMAKE += "ARCH_FLAGS_FOR_TARGET='${ARCH_FLAGS_FOR_TARGET}'"
52
53 def get_gcc_fpu_setting(bb, d):
54         if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
55                 return "--with-float=soft"
56         return ""
57
58 python __anonymous () {
59     import bb, re
60     if (re.match('linux-uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None):
61         bb.data.setVar('EXTRA_OECONF_DEP', '${EXTRA_OECONF_uclibc}', d)
62     elif (re.match('linux$', bb.data.getVar('TARGET_OS', d, 1)) != None):
63         bb.data.setVar('EXTRA_OECONF_DEP', '${EXTRA_OECONF_glibc}', d)
64 }
65
66 do_configure () {
67         # Setup these vars for cross building only
68         # ... because foo_FOR_TARGET apparently gets misinterpreted inside the
69         # gcc build stuff when the build is producing a cross compiler - i.e.
70         # when the 'current' target is the 'host' system, and the host is not
71         # the target (because the build is actually making a cross compiler!)
72         if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
73                 export CC_FOR_TARGET="${CC}"
74                 export GCC_FOR_TARGET="${CC}"
75                 export CXX_FOR_TARGET="${CXX}"
76                 export AS_FOR_TARGET="${HOST_PREFIX}as"
77                 export LD_FOR_TARGET="${HOST_PREFIX}ld"
78                 export NM_FOR_TARGET="${HOST_PREFIX}nm"
79                 export AR_FOR_TARGET="${HOST_PREFIX}ar"
80                 export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib"
81         fi
82         export CC_FOR_BUILD="${BUILD_CC}"
83         export CXX_FOR_BUILD="${BUILD_CXX}"
84         export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
85         export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}"
86         export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
87         export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}"
88         export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}"
89         (cd ${S} && gnu-configize) || die "failure running gnu-configize"
90         oe_runconf
91 }