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