1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-14 15:37:11 +01:00
build/pkg/tc-gcc2/build
David Oberhollenzer 1a697b336f Fix sysroot directory
Use a seperate sysroot directory (stored in variable SYSROOT)
instead of installing everything into the toolchain directory.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2020-04-07 03:28:21 +02:00

45 lines
1.3 KiB
Text
Executable file

# 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="$SYSROOT" \
--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/lib" "$PKGDEPLOYDIR"
mkdir -p "$TCDIR/$TARGET/lib"
mv "$PKGDEPLOYDIR/lib/ldscripts" "$TCDIR/$TARGET/lib"
cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$PKGDEPLOYDIR"
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
}