diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-22 09:48:20 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-23 16:20:13 +0100 |
commit | 2eb9c1cc75a0f39390ddfcc3688fa4893fb77991 (patch) | |
tree | 1800e0e4b46dc0e7b45abab49c5ffbb2ea481fde /meta/recipes-devtools/gcc/gcc-cross.inc | |
parent | 0dfc8aabef0fe17bf9c920c30d2ea94fd926cc9d (diff) | |
download | poky-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.inc | 84 |
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 | |||
3 | DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}" | 3 | DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}" |
4 | PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" | 4 | PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++" |
5 | 5 | ||
6 | require gcc-configure-cross.inc | 6 | require gcc-configure-common.inc |
7 | require gcc-package-cross.inc | 7 | |
8 | EXTRA_OECONF += " --enable-poison-system-directories \ | ||
9 | " | ||
10 | |||
11 | INHIBIT_DEFAULT_DEPS = "1" | ||
12 | |||
13 | EXTRA_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 | |||
19 | do_configure_prepend () { | ||
20 | sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure | ||
21 | } | ||
22 | |||
23 | do_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 | |||
36 | LIBGCCS_VAR = "-lgcc_s" | ||
37 | LIBGCCS_VAR_avr32 = "" | ||
8 | 38 | ||
9 | EXTRADEPENDS = "" | 39 | EXTRADEPENDS = "" |
10 | python () { | 40 | python () { |
@@ -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 | |||
122 | ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}" | 151 | ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}" |
152 | |||
153 | INHIBIT_PACKAGE_STRIP = "1" | ||
154 | |||
155 | # Compute how to get from libexecdir to bindir in python (easier than shell) | ||
156 | BINRELPATH = "${@oe.path.relative(d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"), d.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${MULTIMACH_TARGET_SYS}"))}" | ||
157 | |||
158 | do_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 | |||
196 | do_package[noexec] = "1" | ||
197 | do_packagedata[noexec] = "1" | ||
198 | do_package_write_ipk[noexec] = "1" | ||
199 | do_package_write_rpm[noexec] = "1" | ||
200 | do_package_write_deb[noexec] = "1" | ||