Update build scripts

This commit is contained in:
Tindy X
2021-03-27 11:29:04 +08:00
parent 3afe9986be
commit aac10ddffa
2 changed files with 23 additions and 35 deletions

View File

@@ -1,20 +0,0 @@
#!/bin/bash
mkdir obj
set -xe
c++ -std=c++17 -Wall -fexceptions -c src/interfaces.cpp -o obj/interfaces.o
c++ -std=c++17 -Wall -fexceptions -c src/logger.cpp -o obj/logger.o
c++ -std=c++17 -Wall -fexceptions -c src/main.cpp -o obj/main.o
c++ -std=c++17 -Wall -fexceptions -c src/misc.cpp -o obj/misc.o
c++ -std=c++17 -Wall -fexceptions -c src/multithread.cpp -o obj/multithread.o
c++ -std=c++17 -Wall -fexceptions -c src/nodemanip.cpp -o obj/nodemanip.o
c++ -std=c++17 -Wall -fexceptions -c src/speedtestutil.cpp -o obj/speedtestutil.o
c++ -std=c++17 -Wall -fexceptions -c src/subexport.cpp -o obj/subexport.o
c++ -std=c++17 -Wall -fexceptions -c src/upload.cpp -o obj/upload.o
c++ -std=c++17 -Wall -fexceptions -c src/templates.cpp -o obj/templates.o
c++ -std=c++17 -Wall -fexceptions -c src/webget.cpp -o obj/webget.o
c++ -std=c++17 -Wall -fexceptions -c src/webserver_libevent.cpp -o obj/webserver_libevent.o
c++ -o subconverter obj/*.o -lpcre2-8 -levent -lpthread -lyaml-cpp -lcurl -lssl -lcrypto -lz -O3 -s -lduktape -lduktape_module
chmod +x subconverter

View File

@@ -7,25 +7,33 @@ apt install -y libevent libcurl openssl pcre2 python2
git clone https://github.com/jbeder/yaml-cpp --depth=1
cd yaml-cpp
cmake -DCMAKE_INSTALL_PREFIX=/data/data/com.termux/files/usr -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOOLS=OFF .
cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOOLS=OFF .
make install -j3
cd ..
git clone https://github.com/tencent/rapidjson --depth=1
cd rapidjson
cp -r include/* /data/data/com.termux/files/usr/include/
cp -r include/* $PREFIX/include/
cd ..
git clone https://github.com/svaarala/duktape --depth=1
cd duktape
pip2 install PyYAML
python2 util/dist.py
cd dist/src
cc -c -O3 -o duktape.o duktape.c
cc -c -O3 -o duk_module_node.o -I. ../extras/module-node/duk_module_node.c
ar cr libduktape.a duktape.o
ar cr libduktape_module.a duk_module_node.o
install -m0644 ./*.a /data/data/com.termux/files/usr/lib
install -m0644 duk*.h /data/data/com.termux/files/usr/include
install -m0644 ../extras/module-node/duk_module_node.h /data/data/com.termux/files/usr/include
cd ../../..
git clone https://github.com/ftk/quickjspp --depth=1
cd quickjspp
cmake -DCMAKE_BUILD_TYPE=Release .
make quickjs -j3
install -m644 quickjs/libquickjs.a $PREFIX/lib/
install -d $PREFIX/include/quickjs/
install -m644 quickjs/quickjs.h quickjs/quickjs-libc.h $PREFIX/include/quickjs/
install -m644 quickjspp.hpp $PREFIX/include/
cd ..
git clone https://github.com/PerMalmberg/libcron --depth=1
cd libcron
git submodule update --init
cmake -DCMAKE_BUILD_TYPE=Release .
make libcron -j3
install -m644 libcron/out/Release/liblibcron.a $PREFIX/lib/
install -d $PREFIX/include/libcron/
install -m644 libcron/include/libcron/* $PREFIX/include/libcron/
install -d $PREFIX/include/date/
install -m644 libcron/externals/date/include/date/* $PREFIX/include/date/
cd ..