summaryrefslogtreecommitdiffstats
path: root/net/nginx/patches/nginx-mod-njs/104-endianness_fix.patch
blob: ddd309f01579d4ec8001285361a09bba94d7ba68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--- a/nginx-mod-njs/auto/endianness
+++ b/nginx-mod-njs/auto/endianness
@@ -2,6 +2,15 @@
 # Copyright (C) Dmitry Volyntsev
 # Copyright (C) NGINX, Inc.
 
+if [ "${CONFIG_BIG_ENDIAN}" != "y" ]; then
+    njs_define=NJS_HAVE_BIG_ENDIAN . auto/define
+
+else
+    njs_define=NJS_HAVE_LITTLE_ENDIAN . auto/define
+fi
+
+return
+
 njs_found=no
 
 njs_feature="system byte ordering"
@@ -26,10 +35,4 @@ if [ $njs_found = no ]; then
     exit 1;
 fi
 
-if [ $njs_feature_value = big ]; then
-    njs_define=NJS_HAVE_BIG_ENDIAN . auto/define
-
-else
-    njs_define=NJS_HAVE_LITTLE_ENDIAN . auto/define
 
-fi
--- a/nginx-mod-njs/nginx/config.make
+++ b/nginx-mod-njs/nginx/config.make
@@ -3,15 +3,15 @@ cat << END
 $ngx_addon_dir/../build/libnjs.a: $NGX_MAKEFILE
 	cd $ngx_addon_dir/.. \\
 	&& if [ -f build/Makefile ]; then \$(MAKE) clean; fi \\
-	&& CFLAGS="\$(CFLAGS)" CC="\$(CC)" ./configure --no-openssl \\
-		--no-libxml2 --no-zlib --no-pcre --no-quickjs \\
+	&& CFLAGS="\$(CFLAGS)" CC="\$(CC)" CONFIG_BIG_ENDIAN=\$(CONFIG_BIG_ENDIAN) \\
+		./configure --no-openssl --no-libxml2 --no-zlib --no-pcre --no-quickjs \\
 	&& \$(MAKE) libnjs
 
 $ngx_addon_dir/../build/libqjs.a: $NGX_MAKEFILE
 	cd $ngx_addon_dir/.. \\
 	&& if [ -f build/Makefile ]; then \$(MAKE) clean; fi \\
-	&& CFLAGS="\$(CFLAGS)" CC="\$(CC)" ./configure --no-openssl \\
-		--no-libxml2 --no-zlib --no-pcre \\
+	&& CFLAGS="\$(CFLAGS)" CC="\$(CC)" CONFIG_BIG_ENDIAN=\$(CONFIG_BIG_ENDIAN) \\
+		./configure --no-openssl --no-libxml2 --no-zlib --no-pcre \\
 	&& \$(MAKE) libnjs libqjs
 
 END