Skip to content

Commit 88a1005

Browse files
committed
Skip brotli module entirely for non-64bit archs
1 parent 34baebf commit 88a1005

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

scripts/build-brotli

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ echo -e "${BLUE}❯ ${CYAN}Building brotli ${YELLOW}${LUA_VERSION}...${RESET}"
1111
# Determine the correct binary file for the architecture given
1212
M64="-m64"
1313
if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then
14-
M64=
15-
fi
16-
17-
cd /tmp
18-
git clone --recurse-submodules -j8 "https://github.com/google/ngx_brotli"
19-
cd /tmp/ngx_brotli/deps/brotli
14+
echo -e "${BLUE}${YELLOW}Skipping brotli for non-64bit arch${RESET}"
15+
else
16+
cd /tmp
17+
git clone --recurse-submodules -j8 "https://github.com/google/ngx_brotli"
18+
cd /tmp/ngx_brotli/deps/brotli
2019

21-
mkdir -p /tmp/ngx_brotli/deps/brotli/out
22-
cd /tmp/ngx_brotli/deps/brotli/out
20+
mkdir -p /tmp/ngx_brotli/deps/brotli/out
21+
cd /tmp/ngx_brotli/deps/brotli/out
2322

24-
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS="-Ofast $M64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_INSTALL_PREFIX=./installed ..
25-
cmake --build . --config Release --target brotlienc
23+
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_INSTALL_PREFIX=./installed ..
24+
cmake --build . --config Release --target brotlienc
2625

27-
echo -e "${BLUE}${GREEN}brotli build completed${RESET}"
26+
echo -e "${BLUE}${GREEN}brotli build completed${RESET}"
27+
fi

scripts/build-openresty

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ git clone https://github.com/leev/ngx_http_geoip2_module.git
1717
mv /tmp/ngx_http_geoip2_module /tmp/openresty/ngx_http_geoip2_module
1818
cd /tmp/openresty
1919

20+
BROTI_MODULE="--add-module=/tmp/ngx_brotli"
21+
if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then
22+
BROTI_MODULE=
23+
fi
24+
2025
./configure \
2126
--prefix=/etc/nginx \
2227
--sbin-path=/usr/sbin/nginx \
@@ -57,7 +62,7 @@ cd /tmp/openresty
5762
--with-stream_ssl_module \
5863
--with-stream_ssl_preread_module \
5964
--add-dynamic-module=/tmp/openresty/ngx_http_geoip2_module \
60-
--add-module=/tmp/ngx_brotli
65+
${BROTI_MODULE}
6166

6267
make -j2
6368

0 commit comments

Comments
 (0)