diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/recipes-devtools/gcc/gcc-configure-common.inc | |
download | poky-daisy-140929.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-configure-common.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-configure-common.inc | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc new file mode 100644 index 0000000000..dc44cc9f08 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc | |||
@@ -0,0 +1,133 @@ | |||
1 | require gcc-multilib-config.inc | ||
2 | # | ||
3 | # Build the list of lanaguages to build. | ||
4 | # | ||
5 | # These can be overridden by the version specific .inc file. | ||
6 | |||
7 | # Java (gcj doesn't work on all architectures) | ||
8 | JAVA ?= ",java" | ||
9 | JAVA_arm ?= "" | ||
10 | JAVA_armeb ?= "" | ||
11 | JAVA_mipsel ?= "" | ||
12 | JAVA_sh3 ?= "" | ||
13 | # gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran' | ||
14 | FORTRAN ?= ",f77" | ||
15 | LANGUAGES ?= "c,c++${FORTRAN}${JAVA}" | ||
16 | # disable --enable-target-optspace for powerpc SPE | ||
17 | # at -Os libgcc.so.1 creates references into | ||
18 | # hidden symbols in libgcc.a which linker complains | ||
19 | # when linking shared libraries further in the build like (gnutls) | ||
20 | |||
21 | SPECIAL_ARCH_LIST = "powerpc" | ||
22 | OPTSPACE = '${@base_contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}", "", "--enable-target-optspace",d)}' | ||
23 | |||
24 | EXTRA_OECONF_BASE ?= "" | ||
25 | EXTRA_OECONF_PATHS ?= "" | ||
26 | EXTRA_OECONF_INITIAL ?= "" | ||
27 | EXTRA_OECONF_INTERMEDIATE ?= "" | ||
28 | |||
29 | GCCMULTILIB ?= "--disable-multilib" | ||
30 | GCCTHREADS ?= "posix" | ||
31 | |||
32 | EXTRA_OECONF = "${@['--enable-clocale=generic', ''][d.getVar('USE_NLS', True) != 'no']} \ | ||
33 | --with-gnu-ld \ | ||
34 | --enable-shared \ | ||
35 | --enable-languages=${LANGUAGES} \ | ||
36 | --enable-threads=${GCCTHREADS} \ | ||
37 | ${GCCMULTILIB} \ | ||
38 | --enable-c99 \ | ||
39 | --enable-long-long \ | ||
40 | --enable-symvers=gnu \ | ||
41 | --enable-libstdcxx-pch \ | ||
42 | --program-prefix=${TARGET_PREFIX} \ | ||
43 | --without-local-prefix \ | ||
44 | ${OPTSPACE} \ | ||
45 | ${EXTRA_OECONF_BASE} \ | ||
46 | ${EXTRA_OECONF_FPU} \ | ||
47 | ${EXTRA_OECONF_PATHS} \ | ||
48 | ${@get_gcc_mips_plt_setting(bb, d)} \ | ||
49 | ${@get_gcc_multiarch_setting(bb, d)}" | ||
50 | |||
51 | export ac_cv_path_SED = 'sed' | ||
52 | export gcc_cv_collect2_libs = 'none required' | ||
53 | # We need to set gcc_cv_collect2_libs else there is cross-compilation badness | ||
54 | # in the config.log files (which might not get generated until do_compile | ||
55 | # hence being missed by the insane do_configure check). | ||
56 | |||
57 | # Build uclibc compilers without cxa_atexit support | ||
58 | EXTRA_OECONF_append_linux = " --enable-__cxa_atexit" | ||
59 | EXTRA_OECONF_append_libc-uclibc = " --enable-__cxa_atexit" | ||
60 | |||
61 | EXTRA_OECONF_append_mips64 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64" | ||
62 | EXTRA_OECONF_append_mips64el = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64" | ||
63 | |||
64 | EXTRA_OECONF_FPU = "${@get_gcc_fpu_setting(bb, d)}" | ||
65 | CPPFLAGS = "" | ||
66 | |||
67 | # powerpc needs this to comply with the ABI | ||
68 | EXTRA_OECONF_append_powerpc = " --with-long-double-128" | ||
69 | EXTRA_OECONF_append_powerpc64 = " --with-long-double-128" | ||
70 | |||
71 | # Used by configure to define additional values for FLAGS_FOR_TARGET - | ||
72 | # passed to all the compilers. | ||
73 | ARCH_FLAGS_FOR_TARGET = "${TARGET_CC_ARCH}" | ||
74 | EXTRA_OEMAKE += "ARCH_FLAGS_FOR_TARGET='${ARCH_FLAGS_FOR_TARGET}'" | ||
75 | |||
76 | SYSTEMHEADERS = "${target_includedir}" | ||
77 | SYSTEMLIBS = "${target_base_libdir}/" | ||
78 | SYSTEMLIBS1 = "${target_libdir}/" | ||
79 | |||
80 | do_configure_prepend () { | ||
81 | # teach gcc to find correct target includedir when checking libc ssp support | ||
82 | mkdir -p ${B}/gcc | ||
83 | echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${B}/gcc/t-oe | ||
84 | cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${B}/gcc/defaults.h.new | ||
85 | cat >>${B}/gcc/defaults.h.new <<_EOF | ||
86 | #ifndef STANDARD_INCLUDE_DIR | ||
87 | #define STANDARD_INCLUDE_DIR "${SYSTEMHEADERS}" | ||
88 | #endif | ||
89 | #ifndef STANDARD_STARTFILE_PREFIX_1 | ||
90 | #define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}" | ||
91 | #endif | ||
92 | #ifndef STANDARD_STARTFILE_PREFIX_2 | ||
93 | #define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}" | ||
94 | #endif | ||
95 | #define SYSTEMLIBS_DIR "${SYSTEMLIBS}" | ||
96 | #endif /* ! GCC_DEFAULTS_H */ | ||
97 | _EOF | ||
98 | mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h | ||
99 | } | ||
100 | |||
101 | do_configure () { | ||
102 | # Setup these vars for cross building only | ||
103 | # ... because foo_FOR_TARGET apparently gets misinterpreted inside the | ||
104 | # gcc build stuff when the build is producing a cross compiler - i.e. | ||
105 | # when the 'current' target is the 'host' system, and the host is not | ||
106 | # the target (because the build is actually making a cross compiler!) | ||
107 | if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then | ||
108 | export CC_FOR_TARGET="${CC}" | ||
109 | export GCC_FOR_TARGET="${CC}" | ||
110 | export CXX_FOR_TARGET="${CXX}" | ||
111 | export AS_FOR_TARGET="${HOST_PREFIX}as" | ||
112 | export LD_FOR_TARGET="${HOST_PREFIX}ld" | ||
113 | export NM_FOR_TARGET="${HOST_PREFIX}nm" | ||
114 | export AR_FOR_TARGET="${HOST_PREFIX}ar" | ||
115 | export GFORTRAN_FOR_TARGET="gfortran" | ||
116 | export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib" | ||
117 | fi | ||
118 | export CC_FOR_BUILD="${BUILD_CC}" | ||
119 | export CXX_FOR_BUILD="${BUILD_CXX}" | ||
120 | export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}" | ||
121 | export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}" | ||
122 | export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}" | ||
123 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" | ||
124 | export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}" | ||
125 | export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}" | ||
126 | export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}" | ||
127 | export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}" | ||
128 | export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}" | ||
129 | (cd ${S} && gnu-configize) || die "failure running gnu-configize" | ||
130 | |||
131 | oe_runconf | ||
132 | } | ||
133 | |||