LIBGCCS_VAR = "-lgcc_s"
LIBGCCS_VAR_avr32 = ""
-do_stage_append () {
- for d in info man share/doc share/locale ; do
- rm -rf ${CROSS_DIR}/$d
- done
-
- # We use libiberty from binutils
- rm -f ${CROSS_DIR}/lib/libiberty.a
-
- # We probably don't need these
- rmdir ${CROSS_DIR}/include || :
-
- # Move libssp into staging
- install -d ${STAGING_DIR_TARGET}${target_base_libdir}/
- mv ${CROSS_DIR}/${TARGET_SYS}/lib/libssp* ${STAGING_DIR_TARGET}${target_base_libdir}/ || true
-
- # We don't really need to keep this around
- # rm -rf ${CROSS_DIR}/share but leave java there
- for d in share/man share/info;
- do
- rm -rf ${CROSS_DIR}/$d
- done
-
- #fix up libsupc++ and libstdc++ la files
- for d in lib lib/nof; do
- sed -i "s|dependency_libs\s*=\s*.*|dependency_libs='-L${CROSS_DIR}/${TARGET_SYS}/$d ${LIBGCCS_VAR} -lc -lm '|" ${CROSS_DIR}/${TARGET_SYS}/$d/libsupc++.la || true
- sed -i "s|dependency_libs\s*=\s*.*|dependency_libs='-L${CROSS_DIR}/${TARGET_SYS}/$d ${LIBGCCS_VAR} -lc -lm '|" ${CROSS_DIR}/${TARGET_SYS}/$d/libstdc++.la || true
- done
-}
-
do_package_write_ipk[depends] += "virtual/libc:do_package"
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}
- elif [ -f ${D}${prefix}/*/lib64/libgcc_s.so.? ]; then
- mv -f ${D}${prefix}/*/lib64/libgcc_s.so* ${D}${target_base_libdir} || true
- 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
- elif [ -f ${D}${prefix}/*/lib64/libstdc++.so ]; then
- mv -f ${D}${prefix}/*/lib64/libstdc++.so* ${D}${target_libdir} || true
- mv -f ${D}${prefix}/*/lib64/libg2c.so* ${D}${target_libdir} || true
- mv -f ${D}${prefix}/*/lib64/libgfortran*.so* ${D}${target_libdir} || true
- mv -f ${D}${prefix}/*/lib64/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
+ 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.
- ln -sf ${CROSS_DIR}/bin/${TARGET_PREFIX}gfortran ${CROSS_DIR}/bin/${TARGET_PREFIX}g77 || true
- ln -sf ${CROSS_DIR}/${TARGET_SYS}/bin/gfortran ${CROSS_DIR}/${TARGET_SYS}/bin/g77 || true
+ # 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.
+ ln -sf ${CROSS_DIR}/bin/${TARGET_PREFIX}gfortran ${CROSS_DIR}/bin/${TARGET_PREFIX}g77 || true
+ ln -sf ${CROSS_DIR}/${TARGET_SYS}/bin/gfortran ${CROSS_DIR}/${TARGET_SYS}/bin/g77 || true
+
+ # Remove things we don't need but keep share/java
+ for d in info man share/doc share/locale share/man share/info; do
+ rm -rf ${D}${CROSS_DIR}/$d
+ done
+
+ #fix up libsupc++ and libstdc++ la files
+ for f in libssp.la libssp_nonshared.la libsupc++.la libstdc++.la ; do
+ # Remove any -L options from dependency_libs - we should never need them as the
+ # files are in the sysroot
+ sed -i "s|\(dependency_libs\s*=.*\)-L\s*[^ ]*\(.*\)|\1\2|g" ${D}${target_libdir}/$f || true
+ # Set libdir correctly
+ sed -i "s|libdir\s*=.*|libdir='${target_libdir}'|g" ${D}${target_libdir}/$f || true
+ done
}