Fixed lua and nweb bundle
This commit is contained in:
parent
06ada0b0dc
commit
ddf7d8031f
@ -8,6 +8,7 @@ cd work
|
||||
|
||||
echo "Cleaning existing sysroot. This may take a while..."
|
||||
rm -rf sysroot
|
||||
rm -rf sysroot.specs
|
||||
|
||||
echo "Preparing glibc. This may take a while..."
|
||||
cp -r glibc/glibc_installed sysroot
|
||||
|
@ -2,10 +2,7 @@
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
. ../../common.sh
|
||||
|
||||
# Grab everything after the '=' character.
|
||||
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.
|
||||
echo "Removing Lua work area. This may take a while..."
|
||||
rm -rf ../../work/overlay/lua
|
||||
mkdir ../../work/overlay/lua
|
||||
rm -rf $WORK_DIR/overlay/lua
|
||||
mkdir $WORK_DIR/overlay/lua
|
||||
|
||||
# Extract lua to folder 'work/overlay/lua'.
|
||||
# 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
|
||||
|
@ -4,42 +4,32 @@
|
||||
|
||||
SRC_DIR=$(pwd)
|
||||
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
. ../../common.sh
|
||||
|
||||
# Read the 'JOB_FACTOR' property from '.config'
|
||||
JOB_FACTOR="$(grep -i ^JOB_FACTOR $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
|
||||
cd $WORK_DIR/overlay/lua
|
||||
|
||||
# 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))
|
||||
|
||||
cd $MAIN_SRC_DIR/work/overlay/lua
|
||||
DESTDIR="$PWD/lua_installed"
|
||||
|
||||
# Change to the Lua source directory which ls finds, e.g. 'lua-5.3.4'.
|
||||
cd $(ls -d lua-*)
|
||||
|
||||
echo "Preparing Lua work area. This may take a while..."
|
||||
make clean -j $NUM_JOBS 2>/dev/null
|
||||
rm -rf ../lua_installed
|
||||
# we install lua to /usr and not to /usr/local so we need to fix luaconf.h so lua can find modules, etc ...
|
||||
sed -i 's/#define LUA_ROOT.*/#define LUA_ROOT \"\/usr\/\"/' src/luaconf.h
|
||||
make -j $NUM_JOBS clean
|
||||
rm -rf $DESTDIR
|
||||
|
||||
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..."
|
||||
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/
|
||||
cp -r ../lua_installed/usr/* $MAIN_SRC_DIR/work/src/minimal_overlay/rootfs/usr
|
||||
ROOTFS="$WORK_DIR/src/minimal_overlay/rootfs"
|
||||
mkdir -p $ROOTFS/usr/
|
||||
cp -r $DESTDIR/usr/* $ROOTFS/usr/
|
||||
|
||||
echo "Lua has been installed."
|
||||
|
||||
|
@ -4,21 +4,16 @@ SRC_DIR=$(pwd)
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
# Find the main source directory
|
||||
cd ../../..
|
||||
MAIN_SRC_DIR=$(pwd)
|
||||
cd $SRC_DIR
|
||||
|
||||
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
|
||||
rm -rf $WORK_DIR/overlay/nweb
|
||||
mkdir -p $WORK_DIR/overlay/nweb
|
||||
cd $WORK_DIR/overlay/nweb
|
||||
|
||||
# nweb
|
||||
${CC-gcc} $CFLAGS $SRC_DIR/nweb23.c -o nweb
|
||||
$CC $CFLAGS $LDFLAGS $SRC_DIR/nweb23.c -o nweb
|
||||
|
||||
# client
|
||||
#${CC-gcc} $CFLAGS $SRC_DIR/client.c -o client
|
||||
#$CC $CFLAGS $LDFLAGS $SRC_DIR/client.c -o client
|
||||
|
||||
echo "nweb has been build."
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user