1 We do not have capability to run binaries when cross compiling
3 Upstream-Status: Pending
6 diff -uraN nginx-1.0.11.orig/auto/feature nginx-1.0.11/auto/feature
7 --- nginx-1.0.11.orig/auto/feature 2011-05-11 06:50:19.000000000 -0500
8 +++ nginx-1.0.11/auto/feature 2011-12-27 13:56:42.323370040 -0600
11 if [ -x $NGX_AUTOTEST ]; then
13 + if [ ".$NGX_CROSS_COMPILE" = ".yes" ]; then
14 + NGX_AUTOTEST_EXEC="true"
15 + NGX_FOUND_MSG=" (not tested, cross compiling)"
17 + NGX_AUTOTEST_EXEC="$NGX_AUTOTEST"
21 case "$ngx_feature_run" in
24 # /bin/sh is used to intercept "Killed" or "Abort trap" messages
25 - if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
27 + if /bin/sh -c $NGX_AUTOTEST_EXEC >> $NGX_AUTOCONF_ERR 2>&1; then
28 + echo " found$NGX_FOUND_MSG"
31 if test -n "$ngx_feature_name"; then
35 # /bin/sh is used to intercept "Killed" or "Abort trap" messages
36 - if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
38 + if /bin/sh -c $NGX_AUTOTEST_EXEC >> $NGX_AUTOCONF_ERR 2>&1; then
39 + echo " found$NGX_FOUND_MSG"
42 - cat << END >> $NGX_AUTO_CONFIG_H
43 + if [ ".$NGX_CROSS_COMPILE" = ".yes" ]; then
44 + cat << END >> $NGX_AUTO_CONFIG_H
46 #ifndef $ngx_feature_name
47 -#define $ngx_feature_name `$NGX_AUTOTEST`
48 +#define $ngx_feature_name $(eval "echo \$NGX_WITH_${ngx_feature_name}")
53 + cat << END >> $NGX_AUTO_CONFIG_H
55 +#ifndef $ngx_feature_name
56 +#define $ngx_feature_name `$NGX_AUTOTEST_EXEC`
62 echo " found but is not working"
67 # /bin/sh is used to intercept "Killed" or "Abort trap" messages
68 - if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
69 + if /bin/sh -c $NGX_AUTOTEST_EXEC >> $NGX_AUTOCONF_ERR 2>&1; then
73 diff -uraN nginx-1.0.11.orig/auto/options nginx-1.0.11/auto/options
74 --- nginx-1.0.11.orig/auto/options 2011-12-14 07:34:16.000000000 -0600
75 +++ nginx-1.0.11/auto/options 2011-12-27 13:56:42.323370040 -0600
77 --test-build-rtsig) NGX_TEST_BUILD_RTSIG=YES ;;
78 --test-build-solaris-sendfilev) NGX_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;
80 + # cross compile support
81 + --with-int=*) NGX_WITH_INT="$value" ;;
82 + --with-long=*) NGX_WITH_LONG="$value" ;;
83 + --with-long-long=*) NGX_WITH_LONG_LONG="$value" ;;
84 + --with-ptr-size=*) NGX_WITH_PTR_SIZE="$value" ;;
85 + --with-sig-atomic-t=*) NGX_WITH_SIG_ATOMIC_T="$value" ;;
86 + --with-size-t=*) NGX_WITH_SIZE_T="$value" ;;
87 + --with-off-t=*) NGX_WITH_OFF_T="$value" ;;
88 + --with-time-t=*) NGX_WITH_TIME_T="$value" ;;
89 + --with-sys-nerr=*) NGX_WITH_NGX_SYS_NERR="$value" ;;
90 + --with-endian=*) NGX_WITH_ENDIAN="$value" ;;
93 echo "$0: error: invalid option \"$option\""
97 --with-debug enable debug logging
99 + --with-int=VALUE force int size
100 + --with-long=VALUE force long size
101 + --with-long-long=VALUE force long long size
102 + --with-ptr-size=VALUE force pointer size
103 + --with-sig-atomic-t=VALUE force sig_atomic_t size
104 + --with-size-t=VALUE force size_t size
105 + --with-off-t=VALUE force off_t size
106 + --with-time-t=VALUE force time_t size
107 + --with-sys-nerr=VALUE force sys_nerr value
108 + --with-endian=VALUE force system endianess
115 if [ ".$NGX_PLATFORM" = ".win32" ]; then
117 +elif [ ! -z "$NGX_PLATFORM" ]; then
118 + NGX_CROSS_COMPILE="yes"
122 diff -uraN nginx-1.0.11.orig/auto/types/sizeof nginx-1.0.11/auto/types/sizeof
123 --- nginx-1.0.11.orig/auto/types/sizeof 2006-06-28 11:00:26.000000000 -0500
124 +++ nginx-1.0.11/auto/types/sizeof 2011-12-27 13:56:42.323370040 -0600
130 +ngx_size=$(eval "echo \$NGX_WITH_${ngx_param}")
132 -cat << END > $NGX_AUTOTEST.c
133 +if [ ".$ngx_size" != "." ]; then
134 + echo " $ngx_size bytes"
136 + cat << END > $NGX_AUTOTEST.c
138 #include <sys/types.h>
139 #include <sys/time.h>
144 -ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
145 - -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
146 + ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
147 + -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
149 -eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
150 + eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
153 -if [ -x $NGX_AUTOTEST ]; then
154 - ngx_size=`$NGX_AUTOTEST`
155 - echo " $ngx_size bytes"
157 + if [ -x $NGX_AUTOTEST ]; then
158 + ngx_size=`$NGX_AUTOTEST`
159 + echo " $ngx_size bytes"
163 -rm -rf $NGX_AUTOTEST*
165 + rm -rf $NGX_AUTOTEST*
170 diff -uraN nginx-1.0.11.orig/auto/unix nginx-1.0.11/auto/unix
171 --- nginx-1.0.11.orig/auto/unix 2011-12-14 07:34:16.000000000 -0600
172 +++ nginx-1.0.11/auto/unix 2011-12-27 13:56:42.327370060 -0600
173 @@ -393,13 +393,13 @@
177 -ngx_type="int"; . auto/types/sizeof
178 +ngx_type="int"; ngx_param="INT"; . auto/types/sizeof
180 -ngx_type="long"; . auto/types/sizeof
181 +ngx_type="long"; ngx_param="LONG"; . auto/types/sizeof
183 -ngx_type="long long"; . auto/types/sizeof
184 +ngx_type="long long"; ngx_param="LONG_LONG"; . auto/types/sizeof
186 -ngx_type="void *"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
187 +ngx_type="void *"; ngx_param="PTR_SIZE"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
188 ngx_param=NGX_PTR_SIZE; ngx_value=$ngx_size; . auto/types/value
193 ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef
195 -ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
196 +ngx_type="sig_atomic_t"; ngx_param="SIG_ATOMIC_T"; ngx_types="int"; . auto/types/typedef
198 ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
200 @@ -432,15 +432,15 @@
204 -ngx_type="size_t"; . auto/types/sizeof
205 +ngx_type="size_t"; ngx_param="SIZE_T"; . auto/types/sizeof
206 ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
207 ngx_param=NGX_SIZE_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
209 -ngx_type="off_t"; . auto/types/sizeof
210 +ngx_type="off_t"; ngx_param="OFF_T"; . auto/types/sizeof
211 ngx_param=NGX_MAX_OFF_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
212 ngx_param=NGX_OFF_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
214 -ngx_type="time_t"; . auto/types/sizeof
215 +ngx_type="time_t"; ngx_param="TIME_T"; . auto/types/sizeof
216 ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
217 ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value