summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-cross.inc
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-22 09:48:20 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-23 16:20:13 +0100
commit2eb9c1cc75a0f39390ddfcc3688fa4893fb77991 (patch)
tree1800e0e4b46dc0e7b45abab49c5ffbb2ea481fde /meta/recipes-devtools/gcc/gcc-cross.inc
parent0dfc8aabef0fe17bf9c920c30d2ea94fd926cc9d (diff)
downloadpoky-2eb9c1cc75a0f39390ddfcc3688fa4893fb77991.tar.gz
gcc-*-cross.inc: Fold common configuration into gcc-cross.inc
(From OE-Core rev: 8f6df85ca90c038316ca1ed22e9c54f937f21406) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-cross.inc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross.inc84
1 files changed, 81 insertions, 3 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index c3542e297c..bf22101807 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -3,8 +3,38 @@ inherit cross
3DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}" 3DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}"
4PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" 4PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
5 5
6require gcc-configure-cross.inc 6require gcc-configure-common.inc
7require gcc-package-cross.inc 7
8EXTRA_OECONF += " --enable-poison-system-directories \
9 "
10
11INHIBIT_DEFAULT_DEPS = "1"
12
13EXTRA_OECONF_PATHS = " \
14 --with-headers=${STAGING_DIR_TARGET}${SYSTEMHEADERS} \
15 --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++ \
16 --with-sysroot=${STAGING_DIR_TARGET} \
17 --with-build-sysroot=${STAGING_DIR_TARGET}"
18
19do_configure_prepend () {
20 sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure
21}
22
23do_compile_prepend () {
24 export CC="${BUILD_CC}"
25 export AR_FOR_TARGET="${TARGET_SYS}-ar"
26 export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib"
27 export LD_FOR_TARGET="${TARGET_SYS}-ld"
28 export NM_FOR_TARGET="${TARGET_SYS}-nm"
29 export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc ${TARGET_CC_ARCH}"
30 export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
31 export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
32 export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
33 export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
34}
35
36LIBGCCS_VAR = "-lgcc_s"
37LIBGCCS_VAR_avr32 = ""
8 38
9EXTRADEPENDS = "" 39EXTRADEPENDS = ""
10python () { 40python () {
@@ -118,5 +148,53 @@ EXTRA_OECONF_PATHS = " \
118 --with-sysroot=${STAGING_DIR_TARGET} \ 148 --with-sysroot=${STAGING_DIR_TARGET} \
119 --with-build-sysroot=${STAGING_DIR_TARGET}" 149 --with-build-sysroot=${STAGING_DIR_TARGET}"
120 150
121
122ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}" 151ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
152
153INHIBIT_PACKAGE_STRIP = "1"
154
155# Compute how to get from libexecdir to bindir in python (easier than shell)
156BINRELPATH = "${@oe.path.relative(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${MULTIMACH_TARGET_SYS}"))}"
157
158do_install () {
159 oe_runmake 'DESTDIR=${D}' install-host
160
161 install -d ${D}${target_base_libdir}
162 install -d ${D}${target_libdir}
163
164 # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77
165 # gfortran is fully backwards compatible. This is a safe and practical solution.
166 ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true
167
168
169 # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
170 # found. These need to be relative paths so they work in different locations.
171 dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
172 install -d $dest
173 for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
174 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
175 ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
176 done
177
178 # Remove things we don't need but keep share/java
179 for d in info man share/doc share/locale share/man share/info; do
180 rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/$d
181 done
182
183 # We use libiberty from binutils
184 find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
185 find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
186
187 # gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build
188 case ${PN} in
189 *gcc-cross|*gcc-crosssdk)
190 dest=${D}/${includedir}/gcc-build-internal-${MULTIMACH_TARGET_SYS}
191 cp -fpPR . $dest
192 ;;
193 esac
194}
195
196do_package[noexec] = "1"
197do_packagedata[noexec] = "1"
198do_package_write_ipk[noexec] = "1"
199do_package_write_rpm[noexec] = "1"
200do_package_write_deb[noexec] = "1"