Overhaul of bundles building

nweb
This commit is contained in:
bauen1 2017-07-04 23:49:57 +02:00
parent ede7b8d701
commit 430ed90eaf
3 changed files with 42 additions and 5 deletions

View File

@ -41,6 +41,19 @@ ln -s ../../kernel/kernel_installed/include/asm include/asm
ln -s ../../kernel/kernel_installed/include/asm-generic include/asm-generic
ln -s ../../kernel/kernel_installed/include/mtd include/mtd
cd ..
echo "generating sysroot.specs"
SYSROOT="$PWD/sysroot"
# gcc has a "internal" path that needs to be added to find the static versions of libgcc_*
GCC_INTERNAL_PATH=$(dirname $(gcc -print-libgcc-file-name))
cat << CEOF > sysroot.specs
*link_libgcc
-L$SYSROOT/lib -L$SYSROOT/lib64 -L$SYSROOT/usr/lib -L$SYSROOT/usr/lib64 -L$SYSROOT/usr/local/lib -L$SYSROOT/usr/local/lib64 -L$GCC_INTERNAL_PATH
CEOF
cd $SRC_DIR
echo "*** PREPARE SYSROOT END ***"

View File

@ -1,24 +1,24 @@
#!/bin/sh
SRC_DIR=$(pwd)
. ../common.sh
# Find the main source directory
cd ../../..
MAIN_SRC_DIR=$(pwd)
cd $SRC_DIR
# Read the 'CFLAGS' property from '.config'
CFLAGS="$(grep -i ^CFLAGS $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
echo "removing previous work area"
rm -rf $MAIN_SRC_DIR/work/overlay/nweb
mkdir -p $MAIN_SRC_DIR/work/overlay/nweb
cd $MAIN_SRC_DIR/work/overlay/nweb
# nweb
cc $CFLAGS $SRC_DIR/nweb23.c -o nweb
${CC-gcc} $CFLAGS $SRC_DIR/nweb23.c -o nweb
# client
#cc $CFLAGS $SRC_DIR/client.c -o client
#${CC-gcc} $CFLAGS $SRC_DIR/client.c -o client
echo "nweb has been build."

24
src/minimal_overlay/common.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# common code use by almost all bundles
# this should be sourced in bundle.sh of every bundle
# Read the 'JOB_FACTOR' property from '.config'
JOB_FACTOR="$(grep -i ^JOB_FACTOR $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
# Read the 'CFLAGS' property from '.config'
CFLAGS="$(grep -i ^CFLAGS $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
# Find the number of available CPU cores.
NUM_CORES=$(grep ^processor /proc/cpuinfo | wc -l)
# Calculate the number of 'make' jobs to be used later.
NUM_JOBS=$((NUM_CORES * JOB_FACTOR))
# sysroot
# some of these are duplicate, but there are always bad packages that ignore one of these
SPECS=$PWD/../../../work/sysroot.specs
CC="gcc -specs=$SPECS -static-libgcc -Wl,-nostdlib"
CFLAGSC="-specs=$SPECS -static-libgcc $CFLAGS -Wl,-nostdlib"
CPPFLAGS="-specs=$SPECS -static-libgcc $CPPFLAGS -Wl,-nostdlib"
LDFLAGS="-Wl,-nostdlib $(grep -- \"-L\" $SPECS)"