This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
lsts_glued/rules/gcc/cross.bash

69 lines
1.6 KiB
Bash
Raw Normal View History

source $pkg_common
2013-07-13 17:19:22 +01:00
requires=\
(
2015-02-05 13:48:29 +00:00
'glibc/cross'
2013-07-13 17:19:22 +01:00
)
configure()
{
MAKEINFO='/bin/true' \
"../gcc-$version/configure" $cfg_target_gcc_configure_flags \
--target="$cfg_target_canonical" \
--prefix="$cfg_dir_toolchain" \
2015-02-05 13:43:52 +00:00
--with-build-sysroot="$cfg_dir_toolchain_sysroot" \
2013-07-13 17:19:22 +01:00
--with-sysroot="$cfg_dir_toolchain_sysroot" \
--with-mpfr="$cfg_dir_toolchain" \
--with-gmp="$cfg_dir_toolchain" \
--with-mpc="$cfg_dir_toolchain" \
--enable-__cxa_atexit \
--disable-libssp \
--disable-libgomp \
--disable-libmudflap \
--disable-nls \
--disable-multilib \
--enable-languages=c,c++
}
build()
{
$cmd_make
}
host_install()
{
2015-12-28 10:38:14 +00:00
libdir=lib
if [ -d "$cfg_dir_toolchain/$cfg_target_canonical/lib64" ]; then
libdir=lib64
fi
2013-07-13 17:19:22 +01:00
$cmd_make install &&
2015-12-28 10:38:14 +00:00
cp -d \
"$cfg_dir_toolchain/$cfg_target_canonical/$libdir"/libgcc_s.so* \
"$cfg_dir_toolchain_sysroot/lib" &&
cp -d \
"$cfg_dir_toolchain/$cfg_target_canonical/$libdir"/libstdc++.so* \
"$cfg_dir_toolchain_sysroot/usr/lib"
2013-07-13 17:19:22 +01:00
}
target_install()
{
$cmd_mkdir \
"$cfg_dir_rootfs/usr/lib" &&
for f in "$cfg_dir_toolchain/$cfg_target_canonical/lib/"{libgcc_s,libstdc++}.so*; do
base="$(basename $f)"
if [ $(echo "$base" | grep '\.py' 2> /dev/null) ]; then
continue
fi
if [ -L "$f" ]; then
cp -vd "$f" "$cfg_dir_rootfs/usr/lib/$base"
elif [ -f "$f" ]; then
$cmd_target_strip -v --strip-unneeded -o "$cfg_dir_rootfs/usr/lib/$base" "$f"
fi
done
}