Index: www/nginx/Makefile.common =================================================================== RCS file: /cvsroot/pkgsrc/www/nginx/Makefile.common,v retrieving revision 1.1 diff -p -u -r1.1 Makefile.common --- www/nginx/Makefile.common 22 Feb 2013 15:37:58 -0000 1.1 +++ www/nginx/Makefile.common 10 May 2013 15:14:21 -0000 @@ -47,6 +47,32 @@ CONFIGURE_ARGS+= --http-client-body-temp CONFIGURE_ARGS+= --http-proxy-temp-path=${NGINX_DATADIR}/proxy_temp CONFIGURE_ARGS+= --http-fastcgi-temp-path=${NGINX_DATADIR}/fstcgi_temp +.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) +CONFIGURE_ARGS+= --crossbuild=${OPSYS}:${OS_VERSION}:${MACHINE_ARCH} + +# XXX This is a horrific kludge to detect sizeof(void *) statically, +# as nginx seems to want. Assume LP32 unless LP64PLATFORMS matches, +# in which case assume LP64. Please find a better way. +NGX_PTR_SIZE= 4 +. for _platform_ in ${LP64PLATFORMS} +. if !empty(MACHINE_PLATFORM:M${_platform_}) +NGX_PTR_SIZE= 8 +. endif +. endfor +CONFIGURE_ENV+= ngx_sizeof_void_p=${NGX_PTR_SIZE} + +. if ${OPSYS} == "NetBSD" +CONFIGURE_ENV+= ngx_sizeof_size_t=${NGX_PTR_SIZE} +CONFIGURE_ENV+= ngx_sizeof_off_t=8 +. if empty(OPSYS:MNetBSD-[0-5].*) +CONFIGURE_ENV+= ngx_sizeof_time_t=8 +. else +CONFIGURE_ENV+= ngx_sizeof_time_t=4 +. endif +CONFIGURE_ENV+= NGX_SYS_NERR=sys_nerr +. endif +.endif + PKG_SYSCONFSUBDIR= nginx .include "../../www/nginx/options.mk" Index: www/nginx/distinfo =================================================================== RCS file: /cvsroot/pkgsrc/www/nginx/distinfo,v retrieving revision 1.29 diff -p -u -r1.29 distinfo --- www/nginx/distinfo 7 May 2013 14:04:47 -0000 1.29 +++ www/nginx/distinfo 10 May 2013 15:14:21 -0000 @@ -14,3 +14,8 @@ RMD160 (nginx_upload_module-2.2.0.tar.gz Size (nginx_upload_module-2.2.0.tar.gz) = 25796 bytes SHA1 (patch-aa) = adf433d1b56a88c6c2ed09c4bd54fdb1a336582f SHA1 (patch-ab) = 6f20ef8ac9a042faf7e22770de7c16b351cb1191 +SHA1 (patch-auto_feature) = 0245e8b0bb3958b65228f936f5e5a400af4d9aac +SHA1 (patch-auto_options) = e476e9d51e262e59d2bac4d6c7f9d9e14e1b9dd1 +SHA1 (patch-auto_types_sizeof) = fc9e78a2f47dffd342edc4816e4cb735707405f6 +SHA1 (patch-auto_types_value) = 5442b1df6d68b946d4e4b7aa7e9756c6dd9efc12 +SHA1 (patch-auto_unix) = e1c40c0e77d940112ffeef4f4a8f6282340501cd Index: www/nginx/patches/patch-auto_feature =================================================================== RCS file: www/nginx/patches/patch-auto_feature diff -N www/nginx/patches/patch-auto_feature --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ www/nginx/patches/patch-auto_feature 10 May 2013 15:14:21 -0000 @@ -0,0 +1,43 @@ +$NetBSD$ + +Allow feature tests to work in cross-compilation without run-tests. + +--- auto/feature.orig 2013-05-06 10:26:49.000000000 +0000 ++++ auto/feature +@@ -53,7 +53,10 @@ if [ -x $NGX_AUTOTEST ]; then + + yes) + # /bin/sh is used to intercept "Killed" or "Abort trap" messages +- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then ++ # XXX Kludge: Assume if it cross-compiles then it's there. ++ # This is an approximation. ++ if [ "x$NGX_CROSS" = xYES ] || ++ /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then + echo " found" + ngx_found=yes + +@@ -68,7 +71,23 @@ if [ -x $NGX_AUTOTEST ]; then + + value) + # /bin/sh is used to intercept "Killed" or "Abort trap" messages +- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then ++ if [ "x$NGX_CROSS" = xYES ]; then ++ if eval '[ "x${'$ngx_feature_name'+set}" = xset ]'; then ++ echo " found" ++ ngx_found=yes ++ ++ eval ngx_feature_value=\$$ngx_feature_name ++ cat << END >> $NGX_AUTO_CONFIG_H ++ ++#ifndef $ngx_feature_name ++#define $ngx_feature_name $ngx_feature_value ++#endif ++ ++END ++ else ++ echo " found but is not supplied for cross-build" ++ fi ++ elif /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then + echo " found" + ngx_found=yes + Index: www/nginx/patches/patch-auto_options =================================================================== RCS file: www/nginx/patches/patch-auto_options diff -N www/nginx/patches/patch-auto_options --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ www/nginx/patches/patch-auto_options 10 May 2013 15:14:21 -0000 @@ -0,0 +1,24 @@ +$NetBSD$ + +New variable NGX_CROSS to identify when we're cross-compiling. + +--- auto/options.orig 2013-05-06 10:26:49.000000000 +0000 ++++ auto/options +@@ -34,6 +34,7 @@ NGX_TEST_BUILD_SOLARIS_SENDFILEV=NO + + NGX_PLATFORM= + NGX_WINE= ++NGX_CROSS=NO + + EVENT_FOUND=NO + +@@ -175,7 +176,8 @@ do + --user=*) NGX_USER="$value" ;; + --group=*) NGX_GROUP="$value" ;; + +- --crossbuild=*) NGX_PLATFORM="$value" ;; ++ --crossbuild=*) NGX_PLATFORM="$value" ++ NGX_CROSS=YES ;; + + --builddir=*) NGX_OBJS="$value" ;; + Index: www/nginx/patches/patch-auto_types_sizeof =================================================================== RCS file: www/nginx/patches/patch-auto_types_sizeof diff -N www/nginx/patches/patch-auto_types_sizeof --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ www/nginx/patches/patch-auto_types_sizeof 10 May 2013 15:14:21 -0000 @@ -0,0 +1,36 @@ +$NetBSD$ + +Let the configure environment specify sizeofs when cross-compiling. + +--- auto/types/sizeof.orig 2013-05-06 10:26:49.000000000 +0000 ++++ auto/types/sizeof +@@ -39,7 +39,16 @@ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLA + eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" + + +-if [ -x $NGX_AUTOTEST ]; then ++if [ "x$NGX_CROSS" = xYES ]; then ++ ngx_sizeof_name=ngx_sizeof_`echo -n "$ngx_type" | tr ' *' '_p'` ++ if eval '[ "x${'$ngx_sizeof_name'+set}" = xset ]'; then ++ eval ngx_size=\$$ngx_sizeof_name ++ echo " $ngx_size bytes" ++ else ++ ngx_size="CROSS UNKNOWN SIZE $ngx_type" ++ echo " unknown for cross-compilation" ++ fi ++elif [ -x $NGX_AUTOTEST ]; then + ngx_size=`$NGX_AUTOTEST` + echo " $ngx_size bytes" + fi +@@ -69,6 +78,11 @@ case $ngx_size in + ngx_max_len='(sizeof("-9223372036854775808") - 1)' + ;; + ++ CROSS*) ++ ngx_max_len="CROSS UNKNOWN MAX LEN $ngx_type" ++ ngx_max_value="CROSS UNKNOWN MAX LEN $ngx_type" ++ ;; ++ + *) + echo + echo "$0: error: can not detect $ngx_type size" Index: www/nginx/patches/patch-auto_types_value =================================================================== RCS file: www/nginx/patches/patch-auto_types_value diff -N www/nginx/patches/patch-auto_types_value --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ www/nginx/patches/patch-auto_types_value 10 May 2013 15:14:21 -0000 @@ -0,0 +1,20 @@ +$NetBSD$ + +Fail if we're cross-compiling and environment didn't specify a value. + +--- auto/types/value.orig 2013-05-06 10:26:49.000000000 +0000 ++++ auto/types/value +@@ -3,6 +3,13 @@ + # Copyright (C) Nginx, Inc. + + ++case $ngx_value in ++ CROSS*) ++ echo ++ echo "$0: error: can not detect $ngx_param for cross-compilation" ++ exit 1 ++esac ++ + cat << END >> $NGX_AUTO_CONFIG_H + + #ifndef $ngx_param Index: www/nginx/patches/patch-auto_unix =================================================================== RCS file: www/nginx/patches/patch-auto_unix diff -N www/nginx/patches/patch-auto_unix --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ www/nginx/patches/patch-auto_unix 10 May 2013 15:14:21 -0000 @@ -0,0 +1,15 @@ +$NetBSD$ + +Nothing uses NGX_SIG_ATOMIC_T_SIZE, so no need to detect it. + +--- auto/unix.orig 2013-05-06 10:26:49.000000000 +0000 ++++ auto/unix +@@ -452,7 +452,7 @@ ngx_type="uint64_t"; ngx_types="u_int64_ + + ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef + . auto/types/sizeof +-ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value ++#ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value + + ngx_type="socklen_t"; ngx_types="int"; . auto/types/typedef +