diff options
Diffstat (limited to 'meta/packages/gcc/gcc3-build.inc')
-rw-r--r-- | meta/packages/gcc/gcc3-build.inc | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/meta/packages/gcc/gcc3-build.inc b/meta/packages/gcc/gcc3-build.inc new file mode 100644 index 0000000000..8048b45fba --- /dev/null +++ b/meta/packages/gcc/gcc3-build.inc | |||
@@ -0,0 +1,95 @@ | |||
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 some architectures | ||
14 | JAVA = ",java" | ||
15 | JAVA_arm = "" | ||
16 | JAVA_armeb = "" | ||
17 | JAVA_mipsel = "" | ||
18 | JAVA_sh3 = "" | ||
19 | # gcc4-build sets this to f95 | ||
20 | FORTRAN ?= "f77" | ||
21 | LANGUAGES ?= "c,c++,${FORTRAN}${JAVA}" | ||
22 | |||
23 | EXTRA_OECONF = "${@['--enable-clocale=generic', ''][bb.data.getVar('USE_NLS', d, 1) != 'no']} \ | ||
24 | --with-gnu-ld \ | ||
25 | --enable-shared \ | ||
26 | --enable-target-optspace \ | ||
27 | --enable-languages=${LANGUAGES} \ | ||
28 | --enable-threads=posix \ | ||
29 | --enable-multilib \ | ||
30 | --enable-c99 \ | ||
31 | --enable-long-long \ | ||
32 | --enable-symvers=gnu \ | ||
33 | --enable-libstdcxx-pch \ | ||
34 | --program-prefix=${TARGET_PREFIX} \ | ||
35 | ${EXTRA_OECONF_PATHS} \ | ||
36 | ${EXTRA_OECONF_DEP}" | ||
37 | |||
38 | EXTRA_OECONF_PATHS = " \ | ||
39 | --with-local-prefix=${prefix}/local \ | ||
40 | --with-gxx-include-dir=${includedir}/c++/${BINV}" | ||
41 | |||
42 | EXTRA_OECONF_DEP = "" | ||
43 | EXTRA_OECONF_uclibc = "--disable-__cxa_atexit" | ||
44 | EXTRA_OECONF_glibc = "--enable-__cxa_atexit" | ||
45 | EXTRA_OECONF += "${@get_gcc_fpu_setting(bb, d)}" | ||
46 | CPPFLAGS = "" | ||
47 | |||
48 | # Used by configure to define additional values for FLAGS_FOR_TARGET - | ||
49 | # passed to all the compilers. | ||
50 | ARCH_FLAGS_FOR_TARGET = "" | ||
51 | #NOTE: not tested on other platforms, the following is probably correct | ||
52 | # everywhere! | ||
53 | ARCH_FLAGS_FOR_TARGET_slugos = "${TARGET_CC_ARCH}" | ||
54 | ARCH_FLAGS_FOR_TARGET_unslung = "${TARGET_CC_ARCH}" | ||
55 | EXTRA_OEMAKE += "ARCH_FLAGS_FOR_TARGET='${ARCH_FLAGS_FOR_TARGET}'" | ||
56 | |||
57 | def get_gcc_fpu_setting(bb, d): | ||
58 | if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: | ||
59 | return "--with-float=soft" | ||
60 | return "" | ||
61 | |||
62 | python __anonymous () { | ||
63 | import bb, re | ||
64 | if (re.match('linux-uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None): | ||
65 | bb.data.setVar('EXTRA_OECONF_DEP', '${EXTRA_OECONF_uclibc}', d) | ||
66 | elif (re.match('linux$', bb.data.getVar('TARGET_OS', d, 1)) != None): | ||
67 | bb.data.setVar('EXTRA_OECONF_DEP', '${EXTRA_OECONF_glibc}', d) | ||
68 | } | ||
69 | |||
70 | do_configure () { | ||
71 | # Setup these vars for cross building only | ||
72 | # ... because foo_FOR_TARGET apparently gets misinterpreted inside the | ||
73 | # gcc build stuff when the build is producing a cross compiler - i.e. | ||
74 | # when the 'current' target is the 'host' system, and the host is not | ||
75 | # the target (because the build is actually making a cross compiler!) | ||
76 | if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then | ||
77 | export CC_FOR_TARGET="${CC}" | ||
78 | export GCC_FOR_TARGET="${CC}" | ||
79 | export CXX_FOR_TARGET="${CXX}" | ||
80 | export AS_FOR_TARGET="${HOST_PREFIX}as" | ||
81 | export LD_FOR_TARGET="${HOST_PREFIX}ld" | ||
82 | export NM_FOR_TARGET="${HOST_PREFIX}nm" | ||
83 | export AR_FOR_TARGET="${HOST_PREFIX}ar" | ||
84 | export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib" | ||
85 | fi | ||
86 | export CC_FOR_BUILD="${BUILD_CC}" | ||
87 | export CXX_FOR_BUILD="${BUILD_CXX}" | ||
88 | export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}" | ||
89 | export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}" | ||
90 | export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}" | ||
91 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" | ||
92 | export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}" | ||
93 | (cd ${S} && gnu-configize) || die "failure running gnu-configize" | ||
94 | oe_runconf | ||
95 | } | ||