Lines Matching +full:auto +full:- +full:detect

3 Date: Mon, 30 Aug 2021 13:28:13 -0400
4 Subject: [PATCH] Allow forcing of endianness for cross-compilation
6 Upstream-status: Invalid (upstream doesn't support cross-compilation)
9 Signed-off-by: Nevo Hed <nhed+buildroot@starry.com>
10 ---
11 auto/endianness | 61 ++++++++++++++++++++++++++++++++-----------------
12 auto/options | 6 +++++
13 2 files changed, 46 insertions(+), 21 deletions(-)
15 diff --git a/auto/endianness b/auto/endianness
17 --- a/auto/endianness
18 +++ b/auto/endianness
19 @@ -26,25 +26,44 @@ int main(void) {
23 -ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
24 - -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
25 -
26 -eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
27 -
28 -if [ -x $NGX_AUTOTEST ]; then
29 - if $NGX_AUTOTEST >/dev/null 2>&1; then
30 - echo " little endian"
34 have=NGX_HAVE_LITTLE_ENDIAN . auto/have
35 - else
36 - echo " big endian"
37 - fi
38 -
39 - rm -rf $NGX_AUTOTEST*
40 -
41 -else
42 - rm -rf $NGX_AUTOTEST*
43 -
44 - echo
45 - echo "$0: error: cannot detect system byte ordering"
46 - exit 1
47 -fi
56 + -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
60 + if [ -x $NGX_AUTOTEST ]; then
63 + have=NGX_HAVE_LITTLE_ENDIAN . auto/have
68 + rm -rf $NGX_AUTOTEST*
71 + rm -rf $NGX_AUTOTEST*
74 + echo "$0: error: cannot detect system byte ordering"
81 + echo "$0: error: invalid \"--force-endianness=${NGX_FORCE_ENDIANNESS}\""
85 diff --git a/auto/options b/auto/options
87 --- a/auto/options
88 +++ b/auto/options
89 @@ -17,6 +17,8 @@ NGX_USER=
95 CC=${CC:-cc}
98 @@ -196,6 +198,8 @@ do
99 --user=*) NGX_USER="$value" ;;
100 --group=*) NGX_GROUP="$value" ;;
102 + --force-endianness=*) NGX_FORCE_ENDIANNESS="$value" ;;
104 --crossbuild=*) NGX_PLATFORM="$value" ;;
106 --build=*) NGX_BUILD="$value" ;;
107 @@ -432,6 +436,8 @@ cat << END
108 --build=NAME set build name
109 --builddir=DIR set build directory
111 + --force-endianness=<big>|<little> force endianness
113 --with-select_module enable select module
114 --without-select_module disable select module
115 --with-poll_module enable poll module
116 --