2 # Build the list of lanaguages to build.
4 # These can be overridden by the version specific .inc file.
6 # Java (gcj doesn't work on all architectures)
12 OBJC_linux-uclibceabi ?= ""
13 OBJC_linux-uclibc ?= ""
19 # disable --enable-target-optspace for powerpc SPE
20 # at -Os libgcc.so.1 creates references into
21 # hidden symbols in libgcc.a which linker complains
22 # when linking shared libraries further in the build like (gnutls)
24 OPTSPACE_linux-gnuspe ?= ""
25 OPTSPACE_linux-uclibcspe ?= ""
26 OPTSPACE ?= "--enable-target-optspace"
28 # gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'
30 LANGUAGES ?= "c,c++${OBJC}${FORTRAN}${JAVA}"
32 EXTRA_OECONF_BASE ?= ""
33 EXTRA_OECONF_PATHS ?= ""
35 EXTRA_OECONF = "${@['--enable-clocale=generic', ''][bb.data.getVar('USE_NLS', d, 1) != 'no']} \
38 --enable-languages=${LANGUAGES} \
39 --enable-threads=posix \
43 --enable-symvers=gnu \
44 --enable-libstdcxx-pch \
45 --program-prefix=${TARGET_PREFIX} \
47 ${EXTRA_OECONF_BASE} \
49 ${EXTRA_OECONF_PATHS} \
50 ${@get_gcc_mips_plt_setting(bb, d)}"
52 # Build uclibc compilers without cxa_atexit support
53 EXTRA_OECONF_append_linux = " --enable-__cxa_atexit"
54 EXTRA_OECONF_append_linux-gnueabi = " --enable-__cxa_atexit"
55 EXTRA_OECONF_append_linux-uclibc = " --disable-__cxa_atexit"
56 EXTRA_OECONF_append_linux-uclibceabi = " --disable-__cxa_atexit"
57 EXTRA_OECONF_FPU = "${@get_gcc_fpu_setting(bb, d)}"
60 # Used by configure to define additional values for FLAGS_FOR_TARGET -
61 # passed to all the compilers.
62 ARCH_FLAGS_FOR_TARGET = "${TARGET_CC_ARCH}"
63 EXTRA_OEMAKE += "ARCH_FLAGS_FOR_TARGET='${ARCH_FLAGS_FOR_TARGET}'"
66 # Setup these vars for cross building only
67 # ... because foo_FOR_TARGET apparently gets misinterpreted inside the
68 # gcc build stuff when the build is producing a cross compiler - i.e.
69 # when the 'current' target is the 'host' system, and the host is not
70 # the target (because the build is actually making a cross compiler!)
71 if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
72 export CC_FOR_TARGET="${CC}"
73 export GCC_FOR_TARGET="${CC}"
74 export CXX_FOR_TARGET="${CXX}"
75 export AS_FOR_TARGET="${HOST_PREFIX}as"
76 export LD_FOR_TARGET="${HOST_PREFIX}ld"
77 export NM_FOR_TARGET="${HOST_PREFIX}nm"
78 export AR_FOR_TARGET="${HOST_PREFIX}ar"
79 export GFORTRAN_FOR_TARGET="gfortran"
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}"
90 # Make sure LDFLAGS are honored.
91 sed -i 's/^LDFLAGS = $/LDFLAGS = @LDFLAGS@/' ${S}/Makefile.in
92 sed -i 's/^LDFLAGS = $/LDFLAGS = @LDFLAGS@/' ${S}/Makefile.tpl
94 (cd ${S} && gnu-configize) || die "failure running gnu-configize"
96 if [ "${HOST_SYS}" != "${TARGET_SYS}" ]; then
97 # splice our idea of where the headers live into gcc's world
98 echo "NATIVE_SYSTEM_HEADER_DIR = ${target_includedir}" > ${T}/t-oe
99 sed 's%^tmake_file=.*$%& ${T}/t-oe%' < ${S}/gcc/Makefile.in >${S}/gcc/Makefile.in.new
100 mv ${S}/gcc/Makefile.in.new ${S}/gcc/Makefile.in
101 cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${S}/gcc/defaults.h.new
102 echo "#ifndef STANDARD_INCLUDE_DIR" >> ${S}/gcc/defaults.h.new
103 echo "#define STANDARD_INCLUDE_DIR \"${target_includedir}\"" >> ${S}/gcc/defaults.h.new
104 echo "#endif" >> ${S}/gcc/defaults.h.new
105 echo "#endif /* ! GCC_DEFAULTS_H */" >> ${S}/gcc/defaults.h.new
106 mv ${S}/gcc/defaults.h.new ${S}/gcc/defaults.h
111 # make sure that no @LDFLAG@ is left in the generated Makefile
112 sed -i "s/@LDFLAGS@//g" ${B}/Makefile