1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-06-03 02:38:44 +02:00
build/pkg/tc-gcc2/build
David Oberhollenzer c8d01f966a Use pkgtool to resolve and manage dependencies, add sub package support
Been working on this for too long, don't remember the specifics, will add
documentation.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-03 17:47:02 +01:00

56 lines
1.3 KiB
Plaintext
Executable file

# inherit package details from first stage GCC
source "$SCRIPTDIR/pkg/tc-gcc1/build"
DEPENDS="tc-gcc1 libc-dev linux-dev"
SUBPKG="crt 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-arch="$GCC_CPU" $extra $GCC_EXTRACFG \
--with-native-system-header-dir="/include"
make -j $NUMJOBS
}
deploy() {
local SOURCE="$1"
local DEPLOY="$2"
make install
local f dep
for f in $(ls ${TCDIR}/${TARGET}/include); do
for dep in $DEPENDS; do
if [ -e ${PKGDEPLOYDIR}/${dep}/include/$f ]; then
rm -rf "$TCDIR/$TARGET/include/$f"
fi
done
done
for f in $(ls ${TCDIR}/${TARGET}/lib); do
for dep in $DEPENDS; do
if [ -e ${PKGDEPLOYDIR}/${dep}/lib/$f ]; then
rm -rf "$TCDIR/$TARGET/lib/$f"
fi
done
done
mkdir -p "$DEPLOY/lib"
mv ${TCDIR}/${TARGET}/{include,lib} "$DEPLOY"
rm ${DEPLOY}/lib/*.la
cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$DEPLOY"
}