[PATCH 1 of 8] Set configure vars for crossbuild and avoid some platform tests
Per Olav Høydahl Ohme
phoydahl at cisco.com
Fri Jul 18 12:05:47 UTC 2014
# HG changeset patch
# User Per Olav Hoydahl Ohme <phoydahl at cisco.com>
# Date 1405683324 -7200
# Fri Jul 18 13:35:24 2014 +0200
# Node ID 6368ecc92be2d8e851686d7fb02163c600b5b843
# Parent 70a0408cca7b733fc408223e13b1c0c79cf55e32
Set configure vars for crossbuild and avoid some platform tests.
Platform info from avoided tests are instead set via cmd options.
diff -r 70a0408cca7b -r 6368ecc92be2 auto/options
--- a/auto/options Wed Jul 16 10:21:28 2014 +0400
+++ b/auto/options Fri Jul 18 13:35:24 2014 +0200
@@ -33,6 +33,7 @@
NGX_TEST_BUILD_RTSIG=NO
NGX_TEST_BUILD_SOLARIS_SENDFILEV=NO
+NGX_CROSSBUILD=NO
NGX_PLATFORM=
NGX_WINE=
@@ -154,6 +155,15 @@
NGX_POST_CONF_MSG=
+# MUST BE SPECIFIED FOR CROSSBUILD
+NGX_PTR_SIZE=
+NGX_MAX_SIZE_T_VALUE=
+NGX_SIZE_T_LEN=
+NGX_MAX_OFF_T_VALUE=
+NGX_OFF_T_LEN=
+NGX_TIME_T_LEN=
+NGX_SYS_NERR=
+
opt=
for option
@@ -178,7 +188,16 @@
--user=*) NGX_USER="$value" ;;
--group=*) NGX_GROUP="$value" ;;
- --crossbuild=*) NGX_PLATFORM="$value" ;;
+ --crossbuild=*) NGX_CROSSBUILD=YES
+ NGX_PLATFORM="$value" ;;
+ --ptr-size=*) NGX_PTR_SIZE="$value" ;;
+ --max-size-t-value=*) NGX_MAX_SIZE_T_VALUE="$value" ;;
+ --size-t-len=*) NGX_SIZE_T_LEN="$value" ;;
+ --max-off-t-value=*) NGX_MAX_OFF_T_VALUE="$value" ;;
+ --off-t-len=*) NGX_OFF_T_LEN="$value" ;;
+ --time-t-len=*) NGX_TIME_T_LEN="$value" ;;
+ --sys-nerr=*) NGX_SYS_NERR="$value" ;;
+ --with-root-prefixes=*) NGX_ROOT_PREFIXES="$value" ;;
--build=*) NGX_BUILD="$value" ;;
--builddir=*) NGX_OBJS="$value" ;;
@@ -345,6 +364,8 @@
--group=GROUP set non-privileged group for
worker processes
+ --crossbuild=PLATFORM set target platform for crossbuild
+
--build=NAME set build name
--builddir=DIR set build directory
diff -r 70a0408cca7b -r 6368ecc92be2 auto/unix
--- a/auto/unix Wed Jul 16 10:21:28 2014 +0400
+++ b/auto/unix Fri Jul 18 13:35:24 2014 +0200
@@ -460,6 +460,8 @@
# C types
+if [ $NGX_CROSSBUILD = NO ]; then
+
ngx_type="int"; . auto/types/sizeof
ngx_type="long"; . auto/types/sizeof
@@ -469,9 +471,16 @@
ngx_type="void *"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
ngx_param=NGX_PTR_SIZE; ngx_value=$ngx_size; . auto/types/value
+else
+
+ngx_param=NGX_PTR_SIZE; ngx_value=$NGX_PTR_SIZE; . auto/types/value
+
+fi
# POSIX types
+if [ $NGX_CROSSBUILD = NO ]; then
+
case "$NGX_AUTO_CONFIG_H" in
/*)
NGX_INCLUDE_AUTO_CONFIG_H="#include \"$NGX_AUTO_CONFIG_H\""
@@ -511,6 +520,22 @@
ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
+else
+
+ngx_type="in_port_t"; ngx_types="u_short";
+echo "typedef $ngx_types $ngx_type;" >> $NGX_AUTO_CONFIG_H
+
+ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$NGX_MAX_SIZE_T_VALUE
+. auto/types/value
+ngx_param=NGX_SIZE_T_LEN; ngx_value=$NGX_SIZE_T_LEN; . auto/types/value
+
+ngx_param=NGX_MAX_OFF_T_VALUE; ngx_value=$NGX_MAX_OFF_T_VALUE
+. auto/types/value
+ngx_param=NGX_OFF_T_LEN; ngx_value=$NGX_OFF_T_LEN; . auto/types/value
+
+ngx_param=NGX_TIME_T_LEN; ngx_value=$NGX_TIME_T_LEN; . auto/types/value
+
+fi
# syscalls, libc calls and some features
@@ -825,3 +850,10 @@
if (getaddrinfo("localhost", NULL, NULL, &res) != 0) return 1;
freeaddrinfo(res)'
. auto/feature
+
+
+if [ $NGX_CROSSBUILD = YES ]; then
+
+ngx_param=NGX_SYS_NERR; ngx_value=$NGX_SYS_NERR; . auto/types/value
+
+fi
More information about the nginx-devel
mailing list