summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-configure-common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-configure-common.inc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-configure-common.inc133
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 0000000..dc44cc9
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -0,0 +1,133 @@
1require 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)
8JAVA ?= ",java"
9JAVA_arm ?= ""
10JAVA_armeb ?= ""
11JAVA_mipsel ?= ""
12JAVA_sh3 ?= ""
13# gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'
14FORTRAN ?= ",f77"
15LANGUAGES ?= "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
21SPECIAL_ARCH_LIST = "powerpc"
22OPTSPACE = '${@base_contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}", "", "--enable-target-optspace",d)}'
23
24EXTRA_OECONF_BASE ?= ""
25EXTRA_OECONF_PATHS ?= ""
26EXTRA_OECONF_INITIAL ?= ""
27EXTRA_OECONF_INTERMEDIATE ?= ""
28
29GCCMULTILIB ?= "--disable-multilib"
30GCCTHREADS ?= "posix"
31
32EXTRA_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
51export ac_cv_path_SED = 'sed'
52export 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
58EXTRA_OECONF_append_linux = " --enable-__cxa_atexit"
59EXTRA_OECONF_append_libc-uclibc = " --enable-__cxa_atexit"
60
61EXTRA_OECONF_append_mips64 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
62EXTRA_OECONF_append_mips64el = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
63
64EXTRA_OECONF_FPU = "${@get_gcc_fpu_setting(bb, d)}"
65CPPFLAGS = ""
66
67# powerpc needs this to comply with the ABI
68EXTRA_OECONF_append_powerpc = " --with-long-double-128"
69EXTRA_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.
73ARCH_FLAGS_FOR_TARGET = "${TARGET_CC_ARCH}"
74EXTRA_OEMAKE += "ARCH_FLAGS_FOR_TARGET='${ARCH_FLAGS_FOR_TARGET}'"
75
76SYSTEMHEADERS = "${target_includedir}"
77SYSTEMLIBS = "${target_base_libdir}/"
78SYSTEMLIBS1 = "${target_libdir}/"
79
80do_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
101do_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