1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-05-20 20:46:13 +02:00
build/pkg/tc-gcc2/build
David Oberhollenzer 90b2586ea4 Restructure assembly of root filesystem image
Every package now has or generates a rootfs_files.txt containing a list
of files that should be packed into the rootfs, their permissions and
their owner.

This gives us fine grained controll over the owners and permissions of the
rootfs files (by generating a squashfs pseudo file).

In subsequent steps, this allows us to remove the deploy/devdeploy split and
actually simplifiy most of the build scripts.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-06-17 20:22:10 +02:00

58 lines
1.4 KiB
Plaintext
Executable file

# inherit package details from first stage GCC
source "$SCRIPTDIR/pkg/tc-gcc1/build"
DEPENDS="tc-gcc1 musl linux_headers"
build() {
$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 \
--disable-libmudflap --disable-multilib \
--disable-libmpx --disable-libssp \
--disable-libsanitizer \
--with-arch="$GCC_CPU" $GCC_EXTRACFG \
--with-native-system-header-dir="/include"
make -j $NUMJOBS
}
deploy() {
local SOURCE="$1"
local DEPLOY="$2"
local DEVDEPLOY="$3"
make install
local f dep
for f in $(ls ${TCDIR}/${TARGET}/include); do
for dep in $DEPENDS; do
if [ -e ${PKGDEVDEPLOYDIR}/${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 ${PKGDEVDEPLOYDIR}/${dep}/lib/$f ]; then
rm -rf "$TCDIR/$TARGET/lib/$f"
continue
fi
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} "$DEVDEPLOY"
rm ${DEVDEPLOY}/lib/*.la
mv ${DEVDEPLOY}/lib/*.so* "$DEPLOY/lib"
mv ${DEPLOY}/lib/*.py "$DEVDEPLOY/lib"
strip_files ${DEPLOY}/lib/*
cp "$SCRIPTDIR/pkg/$PKGNAME/rootfs_files.txt" "$DEPLOY"
}