1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 19:19:46 +01:00
build/pkg/tc-gcc2/build

52 lines
1.6 KiB
Text
Raw Normal View History

# inherit package details from first stage GCC
source "$SCRIPTDIR/pkg/tc-gcc1/build"
DEPENDS="tc-gcc1 libc-dev linux-dev"
SUBPKG="crt libstdc++ libstdc++-dev libgcc libgcc-dev crt-dev"
build() {
local extra="--disable-libssp"
if [ "x$TC_HARDENING" = "xyes" ]; then
extra="$extra --enable-default-pie"
extra="$extra --enable-default-ssp"
fi
$1/configure --prefix="$TCDIR" --target="$TARGET" \
--build="$HOSTTUPLE" --host="$HOSTTUPLE" \
--with-sysroot="$TCDIR/$TARGET" \
--disable-nls --enable-languages=c,c++ \
--enable-c99 --enable-long-long \
--enable-libmudflap --disable-multilib \
--disable-libsanitizer --disable-libquadmath \
--with-as="$TCDIR/bin/$TARGET-as" \
--with-ld="$TCDIR/bin/$TARGET-ld" \
--with-arch="$GCC_CPU" $extra $GCC_EXTRACFG \
--with-native-system-header-dir="/include"
make -j $NUMJOBS
}
deploy() {
make install
mkdir -p "$PKGDEPLOYDIR/lib"
mv ${TCDIR}/${TARGET}/{include,lib} "$PKGDEPLOYDIR"
cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$PKGDEPLOYDIR"
find -H "$PKGDEPLOYDIR/include/c++" -type d -printf "dir %p 0%m 0 0\\n" |\
tail -n +2 | sed "s#$PKGDEPLOYDIR/##g" >> "$PKGDEPLOYDIR/libstdc++-dev.files"
find -H "$PKGDEPLOYDIR/include/c++" -type l -printf "slink %p 0%m 0 0 %l\\n" |\
sed "s#$PKGDEPLOYDIR/##g" >> "$PKGDEPLOYDIR/libstdc++-dev.files"
find -H "$PKGDEPLOYDIR/include/c++" -type f -printf "file %p 0%m 0 0\\n" |\
sed "s#$PKGDEPLOYDIR/##g" >> "$PKGDEPLOYDIR/libstdc++-dev.files"
if [ -f "$PKGDEPLOYDIR/lib/libmpx.a" ]; then
cat >> "$PKGDEPLOYDIR/libgcc-dev.files" <<_EOF
file lib/libmpx.a 0644 0 0
file lib/libmpxwrappers.a 0644 0 0
_EOF
fi
}