merge of '7393275c6ccce67cadeb49d4afb3459e56edf8a9'
[vuplus_openembedded] / packages / gcc / gcc-configure-common.inc
1 #
2 # Build the list of lanaguages to build.
3 #
4 # These can be overridden by the version specific .inc file.
5
6 # Java (gcj doesn't work on all architectures)
7 JAVA ?= ",java"
8 JAVA_arm ?= ""
9 JAVA_armeb ?= ""
10 JAVA_mipsel ?= ""
11 JAVA_sh3 ?= ""
12 # gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'
13 FORTRAN ?= ",f77"
14 LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
15
16 EXTRA_OECONF = "${@['--enable-clocale=generic', ''][bb.data.getVar('USE_NLS', d, 1) != 'no']} \
17                 --with-gnu-ld \
18                 --enable-shared \
19                 --enable-target-optspace \
20                 --enable-languages=${LANGUAGES} \
21                 --enable-threads=posix \
22                 --enable-multilib \
23                 --enable-c99 \
24                 --enable-long-long \
25                 --enable-symvers=gnu \
26                 --enable-libstdcxx-pch \
27                 --program-prefix=${TARGET_PREFIX} \
28                 ${EXTRA_OECONF_PATHS}"
29
30 # Build uclibc compilers without cxa_atexit support
31 EXTRA_OECONF_append_linux               = " --enable-__cxa_atexit"
32 EXTRA_OECONF_append_linux-gnueabi       = " --enable-__cxa_atexit"
33 EXTRA_OECONF_append_linux-uclibc        = " --disable-__cxa_atexit"
34 EXTRA_OECONF_append_linux-uclibcgnueabi = " --disable-__cxa_atexit"
35 EXTRA_OECONF += "${@get_gcc_fpu_setting(bb, d)}"
36 CPPFLAGS = ""
37
38 # Used by configure to define additional values for FLAGS_FOR_TARGET -
39 # passed to all the compilers.
40 ARCH_FLAGS_FOR_TARGET = ""
41 #NOTE: not tested on other platforms, the following is probably correct
42 # everywhere!
43 ARCH_FLAGS_FOR_TARGET_slugos = "${TARGET_CC_ARCH}"
44 ARCH_FLAGS_FOR_TARGET_unslung = "${TARGET_CC_ARCH}"
45 EXTRA_OEMAKE += "ARCH_FLAGS_FOR_TARGET='${ARCH_FLAGS_FOR_TARGET}'"
46
47 do_configure () {
48         # Setup these vars for cross building only
49         # ... because foo_FOR_TARGET apparently gets misinterpreted inside the
50         # gcc build stuff when the build is producing a cross compiler - i.e.
51         # when the 'current' target is the 'host' system, and the host is not
52         # the target (because the build is actually making a cross compiler!)
53         if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
54                 export CC_FOR_TARGET="${CC}"
55                 export GCC_FOR_TARGET="${CC}"
56                 export CXX_FOR_TARGET="${CXX}"
57                 export AS_FOR_TARGET="${HOST_PREFIX}as"
58                 export LD_FOR_TARGET="${HOST_PREFIX}ld"
59                 export NM_FOR_TARGET="${HOST_PREFIX}nm"
60                 export AR_FOR_TARGET="${HOST_PREFIX}ar"
61                 export GFORTRAN_FOR_TARGET="gfortran"
62                 export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib"
63         fi
64         export CC_FOR_BUILD="${BUILD_CC}"
65         export CXX_FOR_BUILD="${BUILD_CXX}"
66         export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
67         export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}"
68         export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
69         export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}"
70         export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}"
71         (cd ${S} && gnu-configize) || die "failure running gnu-configize"
72         oe_runconf
73 }
74