Fixed lua and nweb bundle

This commit is contained in:
bauen1 2017-07-05 20:53:25 +02:00
parent 06ada0b0dc
commit ddf7d8031f
4 changed files with 23 additions and 40 deletions

View File

@ -8,6 +8,7 @@ cd work
echo "Cleaning existing sysroot. This may take a while..." echo "Cleaning existing sysroot. This may take a while..."
rm -rf sysroot rm -rf sysroot
rm -rf sysroot.specs
echo "Preparing glibc. This may take a while..." echo "Preparing glibc. This may take a while..."
cp -r glibc/glibc_installed sysroot cp -r glibc/glibc_installed sysroot

View File

@ -2,10 +2,7 @@
SRC_DIR=$(pwd) SRC_DIR=$(pwd)
# Find the main source directory . ../../common.sh
cd ../../..
MAIN_SRC_DIR=$(pwd)
cd $SRC_DIR
# Grab everything after the '=' character. # Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i LUA_SOURCE_URL $MAIN_SRC_DIR/.config | cut -f2 -d'=') DOWNLOAD_URL=$(grep -i LUA_SOURCE_URL $MAIN_SRC_DIR/.config | cut -f2 -d'=')
@ -33,11 +30,11 @@ fi
# Delete folder with previously extracted Lua. # Delete folder with previously extracted Lua.
echo "Removing Lua work area. This may take a while..." echo "Removing Lua work area. This may take a while..."
rm -rf ../../work/overlay/lua rm -rf $WORK_DIR/overlay/lua
mkdir ../../work/overlay/lua mkdir $WORK_DIR/overlay/lua
# Extract lua to folder 'work/overlay/lua'. # Extract lua to folder 'work/overlay/lua'.
# Full path will be something like 'work/overlay/lua/lua-5.3.4'. # Full path will be something like 'work/overlay/lua/lua-5.3.4'.
tar -xvf $ARCHIVE_FILE -C ../../work/overlay/lua tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/lua
cd $SRC_DIR cd $SRC_DIR

View File

@ -4,42 +4,32 @@
SRC_DIR=$(pwd) SRC_DIR=$(pwd)
# Find the main source directory . ../../common.sh
cd ../../..
MAIN_SRC_DIR=$(pwd)
cd $SRC_DIR
# Read the 'JOB_FACTOR' property from '.config' cd $WORK_DIR/overlay/lua
JOB_FACTOR="$(grep -i ^JOB_FACTOR $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
# Read the 'CFLAGS' property from '.config' DESTDIR="$PWD/lua_installed"
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))
cd $MAIN_SRC_DIR/work/overlay/lua
# Change to the Lua source directory which ls finds, e.g. 'lua-5.3.4'. # Change to the Lua source directory which ls finds, e.g. 'lua-5.3.4'.
cd $(ls -d lua-*) cd $(ls -d lua-*)
echo "Preparing Lua work area. This may take a while..." echo "Preparing Lua work area. This may take a while..."
make clean -j $NUM_JOBS 2>/dev/null # we install lua to /usr and not to /usr/local so we need to fix luaconf.h so lua can find modules, etc ...
rm -rf ../lua_installed sed -i 's/#define LUA_ROOT.*/#define LUA_ROOT \"\/usr\/\"/' src/luaconf.h
make -j $NUM_JOBS clean
rm -rf $DESTDIR
echo "Building Lua..." echo "Building Lua..."
make posix -j $NUM_JOBS CFLAGS="$CFLAGS --sysroot=$MAIN_SRC_DIR/work/glibc/glibc_prepared/" make -j $NUM_JOBS posix CC="$CC" CFLAGS="$CFLAGS"
make install -j $NUM_JOBS INSTALL_TOP=../../lua_installed/usr make -j $NUM_JOBS install INSTALL_TOP="$DESTDIR/usr"
echo "Reducing Lua size..." echo "Reducing Lua size..."
strip -g ../lua_installed/bin/* 2>/dev/null strip -g $DESTDIR/usr/bin/* 2>/dev/null
mkdir -p $MAIN_SRC_DIR/work/src/minimal_overlay/rootfs/usr/ ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs"
cp -r ../lua_installed/usr/* $MAIN_SRC_DIR/work/src/minimal_overlay/rootfs/usr mkdir -p $ROOTFS/usr/
cp -r $DESTDIR/usr/* $ROOTFS/usr/
echo "Lua has been installed." echo "Lua has been installed."

View File

@ -4,21 +4,16 @@ SRC_DIR=$(pwd)
. ../../common.sh . ../../common.sh
# Find the main source directory
cd ../../..
MAIN_SRC_DIR=$(pwd)
cd $SRC_DIR
echo "removing previous work area" echo "removing previous work area"
rm -rf $MAIN_SRC_DIR/work/overlay/nweb rm -rf $WORK_DIR/overlay/nweb
mkdir -p $MAIN_SRC_DIR/work/overlay/nweb mkdir -p $WORK_DIR/overlay/nweb
cd $MAIN_SRC_DIR/work/overlay/nweb cd $WORK_DIR/overlay/nweb
# nweb # nweb
${CC-gcc} $CFLAGS $SRC_DIR/nweb23.c -o nweb $CC $CFLAGS $LDFLAGS $SRC_DIR/nweb23.c -o nweb
# client # client
#${CC-gcc} $CFLAGS $SRC_DIR/client.c -o client #$CC $CFLAGS $LDFLAGS $SRC_DIR/client.c -o client
echo "nweb has been build." echo "nweb has been build."