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/
8 gcclibdir ?= "${libdir}/gcc"
9 S = "${WORKDIR}/gcc-${PV}"
10 B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
13 # gcj doesn't work on arm
18 # gcc4-build sets this to f95
20 LANGUAGES ?= "c,c++,${FORTRAN}${JAVA}"
22 EXTRA_OECONF = "${@['--enable-clocale=generic', ''][bb.data.getVar('USE_NLS', d, 1) != 'no']} \
25 --enable-target-optspace \
26 --enable-languages=${LANGUAGES} \
27 --enable-threads=posix \
31 --enable-symvers=gnu \
32 --enable-libstdcxx-pch \
33 --program-prefix=${TARGET_PREFIX} \
34 ${EXTRA_OECONF_PATHS} \
37 EXTRA_OECONF_PATHS = " \
38 --with-local-prefix=${prefix}/local \
39 --with-gxx-include-dir=${includedir}/c++/${BINV}"
42 EXTRA_OECONF_uclibc = "--disable-__cxa_atexit"
43 EXTRA_OECONF_glibc = "--enable-__cxa_atexit"
44 EXTRA_OECONF += "${@get_gcc_fpu_setting(bb, d)}"
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}'"
53 def get_gcc_fpu_setting(bb, d):
54 if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
55 return "--with-float=soft"
58 python __anonymous () {
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)
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"
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"