From 3f67f0304f2138a38cf2695afec163b12db02d2c Mon Sep 17 00:00:00 2001 From: onefang Date: Mon, 16 Mar 2020 20:22:12 +1000 Subject: Finally add the sledjchisl C & Lua maanger, and friends. --- src/BuildIt.sh | 140 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 120 insertions(+), 20 deletions(-) (limited to 'src/BuildIt.sh') diff --git a/src/BuildIt.sh b/src/BuildIt.sh index d199e95..2feb6f4 100755 --- a/src/BuildIt.sh +++ b/src/BuildIt.sh @@ -1,33 +1,133 @@ #!/bin/bash +mkdir -p build + + # Poor mans git sub modules / subtrees, coz otherwise it gets complex. +if [ ! -d git-sub-modules/fcgi2 ]; then + pushd git-sub-modules >/dev/null + git clone https://github.com/FastCGI-Archives/fcgi2.git + popd >/dev/null +else + pushd git-sub-modules/fcgi2 >/dev/null + echo "Updating fcgi2." + git pull | grep "Already up-to-date." && rm -fr build/fcgi2 + popd >/dev/null +fi + +if [ ! -d build/fcgi2 ]; then + cp -r git-sub-modules/fcgi2 build/ + pushd build/fcgi2 >/dev/null + make distclean + ./autogen.sh + ./configure + sed -e "s/#define PACKAGE/#define FCGI_PACKAGE/g" -i fcgi_config.h + sed -e "s/#define VERSION /#define FCGI_VERSION /g" -i fcgi_config.h + make + popd >/dev/null +fi + +echo "" +echo "" +echo "" + +if [ ! -d git-sub-modules/luajit ]; then + pushd git-sub-modules >/dev/null + git clone https://luajit.org/git/luajit-2.0.git + mv luajit-2.0 luajit + pushd luajit >/dev/null + git checkout v2.1 + popd >/dev/null + popd >/dev/null +else + pushd git-sub-modules/luajit >/dev/null + echo "Updating LuaJIT." + git pull | grep "Already up-to-date." && rm -fr build/luajit + popd >/dev/null +fi + +if [ ! -d build/luajit ]; then + rm -fr build/luajit + cp -r git-sub-modules/luajit build/ + + pushd build/luajit >/dev/null + make clean + make amalg + popd >/dev/null +fi + +echo "" +echo "" +echo "" + +if [ ! -d git-sub-modules/qlibc ]; then + pushd git-sub-modules >/dev/null + git clone https://github.com/wolkykim/qlibc.git + popd >/dev/null +else + pushd git-sub-modules/qlibc >/dev/null + echo "Updating qlibc." + git pull | grep "Already up-to-date." && rm -fr build/qlibc + popd >/dev/null +fi + +if [ ! -d build/qlibc ]; then + rm -fr build/qlibc + cp -r git-sub-modules/qlibc build/ + + pushd build/qlibc >/dev/null + make clean + ./configure + make + popd >/dev/null +fi + +echo "" +echo "" +echo "" + if [ ! -d git-sub-modules/toybox ]; then - pushd git-sub-modules + pushd git-sub-modules >/dev/null git clone https://github.com/landley/toybox.git - popd + popd >/dev/null else - pushd git-sub-modules/toybox - git pull - popd + pushd git-sub-modules/toybox >/dev/null + echo "Updating toybox." + git pull | grep "Already up-to-date." && rm -fr build/toybox + popd >/dev/null fi -pushd git-sub-modules/toybox -#git stash save -#git pull -#git stash pop -popd +if [ ! -d build/toybox ]; then + rm -fr build/toybox + cp -r git-sub-modules/toybox build/ + ln -fs ../../../boxes build/toybox/toys/boxes + ln -fs ../../../sledjchisl build/toybox/toys/sledjchisl + ln -fs ../toys/sledjchisl/fcgi_SC.c build/toybox/lib + ln -fs ../toys/sledjchisl/fcgi_SC.h build/toybox/lib + ln -fs ../toys/boxes/handlekeys.c build/toybox/lib + ln -fs ../toys/boxes/handlekeys.h build/toybox/lib -mkdir -p build -rm -fr build/toybox -cp -r git-sub-modules/toybox build/ -ln -fs ../../../boxes build/toybox/toys/boxes -ln -fs ../toys/boxes/handlekeys.c build/toybox/lib -ln -fs ../toys/boxes/handlekeys.h build/toybox/lib + pushd build/toybox >/dev/null + sed -e "s/strend(/tb_strend(/g" -i lib/lib.h + find ./ -type f -name "*.c" -exec sed -e "s/strend(/tb_strend(/g" -i {} \; + make clean + #make defconfig + #make menuconfig + make allnoconfig KCONFIG_ALLCONFIG=../../miniconfig || exit 1 + popd >/dev/null +fi + +echo "" +echo "" +echo "" pushd build/toybox >/dev/null -make clean -#make defconfig -##make menuconfig -make allnoconfig KCONFIG_ALLCONFIG=../../miniconfig || exit 1 +export CFLAGS="-I../luajit/src -I../fcgi2 -I../fcgi2/include -I../qlibc/include/qlibc $(mysql_config --cflags) -g3" +export LDFLAGS="-L../luajit/src -L../fcgi2/libfcgi/.libs -L../qlibc/lib $(mysql_config --libs) -Wl,-E -l:libluajit.a -l:libqlibcext.a -l:libfcgi.a -l:libqlibc.a -lcrypto -luuid" make || exit 1 popd >/dev/null + + +sudo rm -f /opt/opensim_SC/caches/sledjchisl.socket +sudo spawn-fcgi -n -u opensimsc -s /opt/opensim_SC/caches/sledjchisl.socket -M 0660 -G www-data -- /usr/bin/valgrind build/toybox/generated/unstripped/toybox sledjchisl +#sudo spawn-fcgi -n -u opensimsc -s /opt/opensim_SC/caches/sledjchisl.socket -M 0660 -G www-data -- /usr/bin/ddd build/toybox/generated/unstripped/toybox sledjchisl -- cgit v1.1