diff options
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-package-cross.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-package-cross.inc | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-package-cross.inc b/meta/recipes-devtools/gcc/gcc-package-cross.inc new file mode 100644 index 0000000000..4f902fa149 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-package-cross.inc | |||
@@ -0,0 +1,47 @@ | |||
1 | INHIBIT_PACKAGE_STRIP = "1" | ||
2 | |||
3 | # Compute how to get from libexecdir to bindir in python (easier than shell) | ||
4 | BINRELPATH = "${@oe.path.relative(bb.data.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}", d), bb.data.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${MULTIMACH_TARGET_SYS}", d))}" | ||
5 | |||
6 | do_install () { | ||
7 | oe_runmake 'DESTDIR=${D}' install-host | ||
8 | |||
9 | install -d ${D}${target_base_libdir} | ||
10 | install -d ${D}${target_libdir} | ||
11 | |||
12 | # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77 | ||
13 | # gfortran is fully backwards compatible. This is a safe and practical solution. | ||
14 | ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true | ||
15 | |||
16 | |||
17 | # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are | ||
18 | # found. These need to be relative paths so they work in different locations. | ||
19 | dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/ | ||
20 | install -d $dest | ||
21 | for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do | ||
22 | ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t | ||
23 | done | ||
24 | |||
25 | # Remove things we don't need but keep share/java | ||
26 | for d in info man share/doc share/locale share/man share/info; do | ||
27 | rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/$d | ||
28 | done | ||
29 | |||
30 | # gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build | ||
31 | if [ "${PN}" == "gcc-cross" -o "${PN}" == "gcc-crosssdk" ]; then | ||
32 | dest=${D}/${includedir}/gcc-build-internal-${MULTIMACH_TARGET_SYS} | ||
33 | oe_runmake "DESTDIR=$dest" libdir=${target_libdir} base_libdir=${target_base_libdir} prefix=${target_prefix} exec_prefix=${target_exec_prefix} install-target-libgcc | ||
34 | |||
35 | # Ideally here we'd override the libgcc Makefile's idea of slibdir but | ||
36 | # for now, we just move the files to the correct location | ||
37 | |||
38 | install -d $dest${target_base_libdir} | ||
39 | mv $dest${target_exec_prefix}/${TARGET_SYS}/lib*/* $dest${target_base_libdir} | ||
40 | rm -rf $dest${target_exec_prefix}/${TARGET_SYS} | ||
41 | |||
42 | # Also need to move gcc from /usr/lib/gcc/* to /usr/lib/ else the search paths won't find the crt*.o files | ||
43 | |||
44 | mv $dest${target_libdir}/gcc/* $dest${target_libdir}/ | ||
45 | rmdir $dest${target_libdir}/gcc | ||
46 | fi | ||
47 | } | ||