From b12e6fc0b10fcb23f1c2bf5b3a47be7f002821ee Mon Sep 17 00:00:00 2001 From: Vince JV <1276544+vincejv@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:20:04 +0800 Subject: [PATCH] Quickjs build --- Dockerfile | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3ffba76..657f824 100644 --- a/Dockerfile +++ b/Dockerfile @@ -108,6 +108,7 @@ ARG NGINX_USER_UID ARG NGINX_GROUP_GID ARG CONFIG ARG CFLAGS_OPT="-O3 -pipe -fomit-frame-pointer -march=sandybridge" +ARG LDFLAGS_OPT="-O3 -Wl,--strip-all -Wl,--as-needed" ENV VERSION_OPENSSL=openssl-3.4.0 \ SHA256_OPENSSL=e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf \ @@ -115,7 +116,7 @@ ENV VERSION_OPENSSL=openssl-3.4.0 \ CFLAGS="$CFLAGS_OPT" \ CXXFLAGS="$CFLAGS_OPT" \ CPPFLAGS="$CFLAGS_OPT" \ - LDFLAGS="-O3 -Wl,--strip-all -Wl,--as-needed" \ + LDFLAGS="$LDFLAGS_OPT" \ CC=clang-19 \ CXX=clang++-19 @@ -211,15 +212,15 @@ RUN \ && git clone https://github.com/tokers/zstd-nginx-module /usr/src/zstd-nginx-module && cd /usr/src/zstd-nginx-module && git checkout ${ZSTDNGINX_COMMIT} # QuickJS (njs dependency) -# RUN \ -# echo "Cloning and configuring QuickJS ..." \ -# && mkdir /usr/src/quickjs \ -# && cd /usr/src/quickjs \ -# && git init \ -# && git remote add origin https://github.com/bellard/quickjs.git \ -# && git fetch --depth 1 origin ${QUICKJS_COMMIT} \ -# && git checkout -q FETCH_HEAD \ -# && CFLAGS='-fPIC' make libquickjs.a +RUN \ + echo "Cloning and configuring QuickJS ..." \ + && mkdir /usr/src/quickjs \ + && cd /usr/src/quickjs \ + && git init \ + && git remote add origin https://github.com/bellard/quickjs.git \ + && git fetch --depth 1 origin ${QUICKJS_COMMIT} \ + && git checkout -q FETCH_HEAD \ + && CFLAGS='-fPIC' make libquickjs.a RUN \ echo "Cloning and configuring njs ..." \ @@ -229,8 +230,8 @@ RUN \ && git remote add origin https://github.com/nginx/njs.git \ && git fetch --depth 1 origin ${NJS_COMMIT} \ && git checkout -q FETCH_HEAD \ - && ./configure \ - && make njs \ + && ./configure --with-quickjs \ + && CFLAGS="$CFLAGS_OPT -Iquickjs" LDFLAGS="$LDFLAGS_OPT -Lquickjs" make njs \ && mv /usr/src/njs/build/njs /usr/sbin/njs \ && echo "njs v$(njs -v)"