summaryrefslogtreecommitdiffstats
path: root/openembedded/packages/gcc/gcc3-build.inc
diff options
context:
space:
mode:
Diffstat (limited to 'openembedded/packages/gcc/gcc3-build.inc')
-rw-r--r--openembedded/packages/gcc/gcc3-build.inc91
1 files changed, 91 insertions, 0 deletions
diff --git a/openembedded/packages/gcc/gcc3-build.inc b/openembedded/packages/gcc/gcc3-build.inc
new file mode 100644
index 0000000000..a09c6cf1f5
--- /dev/null
+++ b/openembedded/packages/gcc/gcc3-build.inc
@@ -0,0 +1,91 @@
1MIRRORS_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
8gcclibdir ?= "${libdir}/gcc"
9S = "${WORKDIR}/gcc-${PV}"
10B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
11BINV ?= "${PV}"
12
13# gcj doesn't work on arm
14JAVA = ",java"
15JAVA_arm = ""
16JAVA_armeb = ""
17JAVA_mipsel = ""
18# gcc4-build sets this to f95
19FORTRAN ?= "f77"
20LANGUAGES ?= "c,c++,${FORTRAN}${JAVA}"
21
22EXTRA_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
37EXTRA_OECONF_PATHS = " \
38 --with-local-prefix=${prefix}/local \
39 --with-gxx-include-dir=${includedir}/c++/${BINV}"
40
41EXTRA_OECONF_DEP = ""
42EXTRA_OECONF_uclibc = "--disable-__cxa_atexit"
43EXTRA_OECONF_glibc = "--enable-__cxa_atexit"
44EXTRA_OECONF += "${@get_gcc_fpu_setting(bb, d)}"
45CPPFLAGS = ""
46
47# Used by configure to define additional values for FLAGS_FOR_TARGET -
48# passed to all the compilers.
49ARCH_FLAGS_FOR_TARGET = ""
50ARCH_FLAGS_FOR_TARGET_nslu2 = "${TARGET_CC_ARCH}"
51EXTRA_OEMAKE += "ARCH_FLAGS_FOR_TARGET='${ARCH_FLAGS_FOR_TARGET}'"
52
53def 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
58python __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
66do_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}