summaryrefslogtreecommitdiff
path: root/recipes/gcc/gcc-package-cross.inc
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/gcc/gcc-package-cross.inc
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/gcc/gcc-package-cross.inc')
-rw-r--r--recipes/gcc/gcc-package-cross.inc75
1 files changed, 75 insertions, 0 deletions
diff --git a/recipes/gcc/gcc-package-cross.inc b/recipes/gcc/gcc-package-cross.inc
new file mode 100644
index 0000000000..77da3fe3fa
--- /dev/null
+++ b/recipes/gcc/gcc-package-cross.inc
@@ -0,0 +1,75 @@
+INHIBIT_PACKAGE_STRIP ?= ""
+OLD_INHIBIT_PACKAGE_STRIP := "${INHIBIT_PACKAGE_STRIP}"
+INHIBIT_PACKAGE_STRIP = "1"
+
+PACKAGES = "libgcc libssp libstdc++ libg2c libgfortran"
+
+# Called from within gcc-cross, so libdir is set wrong
+FILES_libg2c = "${target_libdir}/libg2c.so.*"
+
+FILES_libssp = "${target_libdir}/libssp.so.*"
+
+FILES_libgfortran = "${target_libdir}/libgfortran.so.*"
+
+FILES_libgcc = "${target_base_libdir}/libgcc_s.so.1"
+
+FILES_libstdc++ = "${target_libdir}/libstdc++.so.*"
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' install
+
+ # Move libgcc_s into /lib
+ mkdir -p ${D}${target_base_libdir}
+ if [ -f ${D}${target_base_libdir}/libgcc_s.so.? ]; then
+ # Already in the right location
+ :
+ elif [ -f ${D}${prefix}/lib/libgcc_s.so.? ]; then
+ mv -f ${D}${prefix}/lib/libgcc_s.so* ${D}${target_base_libdir} || true
+
+ elif [ -f ${D}${prefix}/*/lib/nof/libgcc_s.so.? ]; then
+ mv -f ${D}${prefix}/*/lib/nof/libgcc_s.so* ${D}${target_base_libdir}
+ else
+ mv -f ${D}${prefix}/*/lib/libgcc_s.so* ${D}${target_base_libdir} || true
+ fi
+
+
+
+ # Move libstdc++ and libg2c into libdir (resetting our prefix to /usr
+ mkdir -p ${D}${target_libdir}
+
+ if [ -f ${D}${prefix}/*/lib/nof/libstdc++.so ]; then
+
+ mv -f ${D}${prefix}/*/lib/nof/libstdc++.so* ${D}${target_libdir} || true
+ mv -f ${D}${prefix}/*/lib/nof/libg2c.so* ${D}${target_libdir} || true
+ mv -f ${D}${prefix}/*/lib/nof/libgfortran*.so* ${D}${target_libdir} || true
+ mv -f ${D}${prefix}/*/lib/nof/libssp*.so* ${D}${target_libdir} || true
+
+ else
+ mv -f ${D}${prefix}/*/lib/libstdc++.so* ${D}${target_libdir} || true
+ mv -f ${D}${prefix}/*/lib/libg2c.so* ${D}${target_libdir} || true
+ mv -f ${D}${prefix}/*/lib/libgfortran*.so* ${D}${target_libdir} || true
+ mv -f ${D}${prefix}/*/lib/libssp*.so* ${D}${target_libdir} || true
+ fi
+
+
+
+ # Manually run the target stripper since we won't get it run by
+ # the packaging.
+ if [ "x${OLD_INHIBIT_PACKAGE_STRIP}" != "x1" ]; then
+ ${TARGET_PREFIX}strip ${D}${target_libdir}/libstdc++.so.*
+ ${TARGET_PREFIX}strip ${D}${target_libdir}/libg2c.so.* || true
+ ${TARGET_PREFIX}strip ${D}${target_base_libdir}/libgcc_s.so.* || true
+ ${TARGET_PREFIX}strip ${D}${target_libdir}/libgfortran*.so* || true
+ fi
+
+ # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77
+ # gfortran is fully backwards compatible. This is a safe and practical solution.
+ if [ -f ${CROSS_DIR}/bin/${TARGET_PREFIX}gfortran ]; then
+ currdir="$PWD"
+ cd ${CROSS_DIR}/bin/
+ ln -sf ${TARGET_PREFIX}gfortran ${TARGET_PREFIX}g77 || true
+ cd ${CROSS_DIR}/${TARGET_SYS}/bin/
+ ln -sf gfortran g77 || true
+ cd $currdir
+ fi
+}