[oe-commits] Richard Purdie : gcc-pacpake-cross.inc: Clean up do_install function massively (from Poky)

git version control git at git.openembedded.org
Wed May 5 11:10:25 UTC 2010


Module: openembedded.git
Branch: rpurdie/work-in-progress
Commit: aaeafb2254cf269d2bf089ec04e4170dfcdd5fc1
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=aaeafb2254cf269d2bf089ec04e4170dfcdd5fc1

Author: Richard Purdie <rpurdie at linux.intel.com>
Date:   Thu Dec 17 21:07:31 2009 +0000

gcc-pacpake-cross.inc: Clean up do_install function massively (from Poky)

Signed-off-by: Richard Purdie <rpurdie at linux.intel.com>

---

 recipes/gcc/gcc-package-cross.inc |   89 +++++++++++++------------------------
 1 files changed, 31 insertions(+), 58 deletions(-)

diff --git a/recipes/gcc/gcc-package-cross.inc b/recipes/gcc/gcc-package-cross.inc
index f23d7fd..5236928 100644
--- a/recipes/gcc/gcc-package-cross.inc
+++ b/recipes/gcc/gcc-package-cross.inc
@@ -18,63 +18,36 @@ 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
-                # Look for .../${TARGET_SYS}/lib/libgcc_s*
-                # (or /lib64/, on x86_64)
-                mv -f ${D}${prefix}/*/${target_base_libdir}/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
-           # Look for .../${TARGET_SYS}/lib/lib* (or /lib64/ on x86_64)
-           mv -f ${D}${prefix}/*/${target_base_libdir}/libstdc++.so* ${D}${target_libdir} || true
-           mv -f ${D}${prefix}/*/${target_base_libdir}/libg2c.so* ${D}${target_libdir} || true
-           mv -f ${D}${prefix}/*/${target_base_libdir}/libgfortran*.so* ${D}${target_libdir} || true
-           mv -f ${D}${prefix}/*/${target_base_libdir}/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_PACKAGE_STRIP}" != "xno" ]; then
-               ${TARGET_PREFIX}strip ${D}${target_libdir}/libstdc++.so.* || true
-               ${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
+	install -d ${D}${target_base_libdir}
+	install -d ${D}${target_libdir}
+
+	for d in ${TARGET_SYS}/lib/nof ${TARGET_SYS}/lib64 ${TARGET_SYS}/lib; do
+		if [ -d ${D}${prefix}/$d/ ]; then
+			mv -f ${D}${prefix}/$d/libgcc* ${D}${target_base_libdir} || true
+			mv -f ${D}${prefix}/$d/* ${D}${target_libdir} || true
+		fi
+	done
+
+	# 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.* || true
+		${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 ${D}${CROSS_DIR}/bin/${TARGET_PREFIX}gfortran ]; then
-              currdir="$PWD"
-              cd ${D}${CROSS_DIR}/bin/
-              ln -sf ${TARGET_PREFIX}gfortran ${TARGET_PREFIX}g77 || true
-              if [ -d ${CROSS_DIR}/${TARGET_SYS}/bin/ ] ; then 
-                  cd ${CROSS_DIR}/${TARGET_SYS}/bin/
-                  ln -sf gfortran g77 || true
-              fi
-              cd $currdir
-        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 ${D}${CROSS_DIR}/bin/${TARGET_PREFIX}gfortran ]; then
+		currdir="$PWD"
+		cd ${D}${CROSS_DIR}/bin/
+		ln -sf ${TARGET_PREFIX}gfortran ${TARGET_PREFIX}g77 || true
+		if [ -d ${CROSS_DIR}/${TARGET_SYS}/bin/ ] ; then 
+			cd ${CROSS_DIR}/${TARGET_SYS}/bin/
+			ln -sf gfortran g77 || true
+		fi
+		cd $currdir
+	fi
 }
+





More information about the Openembedded-commits mailing list