gcc: Convert cross recipes to stage in do_install. Also moves stdc++ and other libs into the sysroot
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
parent
977b3fe554
commit
ec22e232d4
|
@ -19,33 +19,4 @@ do_compile_prepend () {
|
|||
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"
|
||||
|
|
|
@ -17,7 +17,3 @@ EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
|
|||
--with-sysroot=${STAGING_DIR_TARGET} \
|
||||
--with-build-sysroot=${STAGING_DIR_TARGET} \
|
||||
${@get_gcc_fpu_setting(bb, d)}"
|
||||
|
||||
do_install () {
|
||||
:
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ EXTRA_OECONF += " --disable-libmudflap \
|
|||
--disable-libssp"
|
||||
|
||||
# Hack till we fix *libc properly
|
||||
do_stage_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
do_install_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${D}${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ EXTRA_OECONF += " --disable-libmudflap \
|
|||
--disable-libssp"
|
||||
|
||||
# Hack till we fix *libc properly
|
||||
do_stage_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
do_install_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${D}${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ EXTRA_OECONF += " --disable-libmudflap \
|
|||
--disable-libssp"
|
||||
|
||||
# Hack till we fix *libc properly
|
||||
do_stage_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
do_install_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${D}${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ S = "${WORKDIR}/gcc-4.2"
|
|||
EXTRA_OECONF += "--disable-libssp --disable-bootstrap --disable-libgomp --disable-libmudflap "
|
||||
|
||||
# Hack till we fix *libc properly
|
||||
do_stage_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
do_install_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${D}${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ S = "${WORKDIR}/gcc-4.2"
|
|||
EXTRA_OECONF += "--disable-libssp --disable-bootstrap --disable-libgomp --disable-libmudflap "
|
||||
|
||||
# Hack till we fix *libc properly
|
||||
do_stage_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
do_install_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${D}${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
}
|
||||
|
||||
|
|
|
@ -17,5 +17,5 @@ EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
|
|||
${@get_gcc_fpu_setting(bb, d)}"
|
||||
|
||||
do_install () {
|
||||
:
|
||||
oe_runmake 'DESTDIR=${D}' install
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ EXTRA_OECONF += " --disable-libmudflap \
|
|||
--disable-libssp"
|
||||
|
||||
# Hack till we fix *libc properly
|
||||
do_stage_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
do_install_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${D}${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ EXTRA_OECONF += " --disable-libmudflap \
|
|||
--disable-libssp"
|
||||
|
||||
# Hack till we fix *libc properly
|
||||
do_stage_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
do_install_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${D}${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ EXTRA_OECONF += " --disable-libmudflap \
|
|||
--disable-libssp"
|
||||
|
||||
# Hack till we fix *libc properly
|
||||
do_stage_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
do_install_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${D}${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ S = "${WORKDIR}/gcc-4.2"
|
|||
EXTRA_OECONF += "--disable-libssp --disable-bootstrap --disable-libgomp --disable-libmudflap "
|
||||
|
||||
# Hack till we fix *libc properly
|
||||
do_stage_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
do_install_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${D}${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ S = "${WORKDIR}/gcc-4.2"
|
|||
EXTRA_OECONF += "--disable-libssp --disable-bootstrap --disable-libgomp --disable-libmudflap "
|
||||
|
||||
# Hack till we fix *libc properly
|
||||
do_stage_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
do_install_append() {
|
||||
ln -sf ${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include-fixed/* ${D}${CROSS_DIR}/lib/gcc/${TARGET_SYS}/${BINV}/include/
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
PROVIDES = "virtual/${TARGET_PREFIX}gcc-${PV}"
|
||||
|
||||
do_install () {
|
||||
:
|
||||
cd gcc
|
||||
oe_runmake 'DESTDIR=${D}' install-common install-headers install-libgcc
|
||||
install -m 0755 xgcc ${D}${CROSS_DIR}/bin/${TARGET_PREFIX}gcc-${PV}
|
||||
}
|
||||
|
||||
do_stage () {
|
||||
cd gcc
|
||||
oe_runmake install-common install-headers install-libgcc
|
||||
install -m 0755 xgcc ${CROSS_DIR}/bin/${TARGET_PREFIX}gcc-${PV}
|
||||
}
|
||||
use_do_install_for_stage
|
||||
}
|
|
@ -1,13 +1,8 @@
|
|||
# Path mangling needed by the cross packaging
|
||||
# Note that we use := here, and require that this is included at the correct
|
||||
# point (before inheriting cross) to ensure that libdir and includedir are
|
||||
# target paths, not CROSS_DIR paths.
|
||||
target_libdir := "${libdir}"
|
||||
target_includedir := "${includedir}"
|
||||
target_base_libdir := "${base_libdir}"
|
||||
target_prefix := "${prefix}"
|
||||
|
||||
inherit cross
|
||||
|
||||
DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc"
|
||||
PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
|
||||
|
||||
do_stage () {
|
||||
use_do_install_for_stage
|
||||
}
|
||||
|
|
|
@ -18,55 +18,41 @@ 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}
|
||||
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
|
||||
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
|
||||
|
||||
|
||||
# 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
|
||||
# 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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue