diff --git a/build.sh b/build.sh index 7f9c469c..c6074659 100755 --- a/build.sh +++ b/build.sh @@ -17,6 +17,9 @@ echo ' --[ [*] use option 8 for publishing ]--' echo ' --\ /--' echo ' ' + +JS_ENABLE=0 + gen_conf() { ./autogen.sh } @@ -33,17 +36,17 @@ configure() { # Update: Thanks to JF for this solution for solving # crashes using pthread # -Wl,--whole-archive -lpthread -Wl,--no-whole-archive - time \ - CC=$1 \ - LD=$2 \ - LDFLAGS=$4 \ + BUILD_CMD="time \ + CC='$1' \ + LD='$2' \ + LDFLAGS='$4' \ CXX=$CXX_CUST \ - CFLAGS="-O2 -I/usr/local/include $6" \ - LIBS=$5 \ - CXXFLAGS=$6 \ - PKG_CONFIG="./pkg-config.sh" \ + CFLAGS='$6' \ + LIBS='$5' \ + CXXFLAGS='$6' \ + PKG_CONFIG='./pkg-config.sh' \ ./configure -C \ - --host=$3 \ + --host='$3' \ --prefix=/usr \ --enable-256-colors \ --enable-fastmem \ @@ -75,7 +78,12 @@ configure() { --without-terminfo \ --without-zlib \ --without-zstd \ - --without-x + --without-x" + if [ $JS_ENABLE == 1 ]; then + BUILD_CMD="${BUILD_CMD/without-quickjs/with-quickjs}" + fi + echo "$BUILD_CMD" + bash -c "$BUILD_CMD" if [ $? -eq 0 ]; then echo "--[ Configuration Sucessfull ]--" # turn off warnings @@ -222,8 +230,8 @@ set_arch() { LD="ld" MAKE_HOST="" BIN_SUFFIX="" - CXXFLAGS="" - LDFLAGS="" + CXXFLAGS="-I/usr/local/include" + LDFLAGS="-L/usr/local/lib" LIBS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive" fi } @@ -264,6 +272,7 @@ arch_menu() { } # MAIN LOOP +CMDACT=$1 ARCHIT="" BIN_SUFFIX="" ARCHS="lin32 lin64 win32 win64 arm32 arm64 djgpp native" @@ -274,8 +283,28 @@ info \ build_all \ exit" set_arch native +# command line action +if [ ! -z $CMDACT ]; then + if [ $CMDACT == "build" ]; then + JS_ENABLE=1 + CC=g++ + ./autogen.sh + configure "$CC" "$LD" "$MAKE_HOST" "$LDFLAGS" "$LIBS" "$CXXFLAGS" + if [ $? -eq 1 ]; then + exit + fi + sed -i 's/^LIBS = .*/LIBS = -ltre -lssl -lcrypto -ldl -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -lidn -lexpat \/usr\/local\/lib\/quickjs\/libquickjs.a \/usr\/local\/lib\/libxml++-5.0.a -lxml2 -lz -licui18n -llzma -lsqlite3 -licuuc -licudata/g' Makefile.config + build + if [ $? -eq 1 ]; then + exit + fi + exit + fi +fi +# user mode action select SEL in $CC_SEL; do if [ "$SEL" = "arch" ]; then + set_arch native arch_menu elif [ "$SEL" = "build" ]; then configure "$CC" "$LD" "$MAKE_HOST" "$LDFLAGS" "$LIBS" "$CXXFLAGS" diff --git a/configure.ac b/configure.ac index d9b7032f..0ad6b7db 100644 --- a/configure.ac +++ b/configure.ac @@ -682,7 +682,7 @@ if test "x$CONFIG_QUICKJS" = x; then CFLAGS="$CFLAGS $DB_LOCALSTORAGE_CFLAGS $XMLPLUSPLUS_CFLAGS" - LIBS="$LIBS $DB_LOCALSTORAGE_LIBS $XMLPLUSPLUS_LIBS /usr/lib/quickjs/libquickjs.a" + LIBS="$LIBS $DB_LOCALSTORAGE_LIBS $XMLPLUSPLUS_LIBS /usr/local/lib/quickjs/libquickjs.a" else AC_MSG_RESULT([no]) fi diff --git a/docker/lin64/Dockerfile b/docker/lin64/Dockerfile new file mode 100644 index 00000000..ffd4bcc6 --- /dev/null +++ b/docker/lin64/Dockerfile @@ -0,0 +1,33 @@ +# +# [ lin64 ] elinks docker development environment v0.1d +# +# with quickjs support +# + +# [*] base system + +# get latest debian +FROM debian:latest + +# prepare system - commond base for all platforms +RUN apt-get update && apt-get -y install bash \ + rsync vim screen git make automake + +# [*] get sources and req libs +RUN cd /root && git clone https://github.com/bellard/quickjs && cd /root && git clone https://github.com/libxmlplusplus/libxmlplusplus && cd /root && apt-get install -y libxml2-dev g++ + +# [*] build quickjs +RUN cd /root/quickjs && make && make install + +# [*] build libxmlplusplus +RUN apt-get install -y mm-common && cd /root/libxmlplusplus && ./autogen.sh && ./configure --enable-static --prefix=/usr/local && make && make install + +RUN ln -s /usr/local/include/libxml++-5.0/libxml++ /usr/local/include/libxml++ && ln -s /usr/local/lib/libxml++-5.0/include/libxml++config.h /usr/local/include/libxml++config.h && ln -s /usr/include/libxml2/libxml /usr/include/libxml + +# [*] prepare openssl library and javascript preqreqs +RUN apt-get -y install libssl-dev libsqlite3-dev zlib1g-dev liblzma-dev libtre-dev libidn11-dev libexpat1-dev + +# disable caching for this step to get the newest elinks sources +ARG NOCACHE=1 +RUN cd /root && git clone https://github.com/rkd77/elinks + diff --git a/docker/lin64/build.sh b/docker/lin64/build.sh new file mode 100755 index 00000000..7516f85f --- /dev/null +++ b/docker/lin64/build.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker build --build-arg NOCACHE=0 -t "elinks-lin64-dev:latest" . diff --git a/docker/lin64/cleanup.sh b/docker/lin64/cleanup.sh new file mode 100755 index 00000000..91bd9b58 --- /dev/null +++ b/docker/lin64/cleanup.sh @@ -0,0 +1,4 @@ +#!/bin/bash +docker container stop elinks-lin64-dev +docker container rm elinks-lin64-dev +#docker image rm elinks-lin64-dev diff --git a/docker/lin64/run.sh b/docker/lin64/run.sh new file mode 100755 index 00000000..84a80ecb --- /dev/null +++ b/docker/lin64/run.sh @@ -0,0 +1,6 @@ +#!/bin/bash +docker run -it \ + --name=elinks-lin64-dev \ + -v /tmp:/tmp/host \ + elinks-lin64-dev:latest \ + /bin/bash diff --git a/docker/lin64/shell.sh b/docker/lin64/shell.sh new file mode 100755 index 00000000..d61216cc --- /dev/null +++ b/docker/lin64/shell.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker start elinks-lin64-dev +docker exec -it elinks-lin64-dev bash