nginx: enable cross-compilation

This commit is contained in:
Christian Neukirchen 2014-07-26 16:44:06 +02:00
parent 6d86efda20
commit 1dd8c04073
2 changed files with 506 additions and 3 deletions

View file

@ -0,0 +1,490 @@
#define NGX_CONFIGURE " --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin/nginx --pid-path=/run/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/tmp/nginx/client-body --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-scgi-temp-path=/var/tmp/nginx/scgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-imap --with-imap_ssl_module --with-ipv6 --with-pcre-jit --with-file-aio --with-http_gunzip_module --with-http_spdy_module --with-http_dav_module --with-http_gzip_static_module --with-http_realip_module --with-http_ssl_module --with-http_stub_status_module"
#ifndef NGX_HAVE_GCC_ATOMIC
#define NGX_HAVE_GCC_ATOMIC 1
#endif
#ifndef NGX_HAVE_C99_VARIADIC_MACROS
#define NGX_HAVE_C99_VARIADIC_MACROS 1
#endif
#ifndef NGX_HAVE_GCC_VARIADIC_MACROS
#define NGX_HAVE_GCC_VARIADIC_MACROS 1
#endif
#ifndef NGX_HAVE_EPOLL
#define NGX_HAVE_EPOLL 1
#endif
#ifndef NGX_HAVE_CLEAR_EVENT
#define NGX_HAVE_CLEAR_EVENT 1
#endif
#ifndef NGX_HAVE_EPOLLRDHUP
#define NGX_HAVE_EPOLLRDHUP 1
#endif
#ifndef NGX_HAVE_O_PATH
#define NGX_HAVE_O_PATH 1
#endif
#ifndef NGX_HAVE_SENDFILE
#define NGX_HAVE_SENDFILE 1
#endif
#ifndef NGX_HAVE_SENDFILE64
#define NGX_HAVE_SENDFILE64 1
#endif
#ifndef NGX_HAVE_PR_SET_DUMPABLE
#define NGX_HAVE_PR_SET_DUMPABLE 1
#endif
#ifndef NGX_HAVE_SCHED_SETAFFINITY
#define NGX_HAVE_SCHED_SETAFFINITY 1
#endif
#ifndef NGX_HAVE_GNU_CRYPT_R
#define NGX_HAVE_GNU_CRYPT_R 1
#endif
#ifndef NGX_ALIGNMENT
#define NGX_ALIGNMENT 16
#endif
#ifndef NGX_CPU_CACHE_LINE
#define NGX_CPU_CACHE_LINE 32
#endif
#define NGX_KQUEUE_UDATA_T (void *)
#ifndef NGX_HAVE_POSIX_FADVISE
#define NGX_HAVE_POSIX_FADVISE 1
#endif
#ifndef NGX_HAVE_O_DIRECT
#define NGX_HAVE_O_DIRECT 1
#endif
#ifndef NGX_HAVE_ALIGNED_DIRECTIO
#define NGX_HAVE_ALIGNED_DIRECTIO 1
#endif
#ifndef NGX_HAVE_STATFS
#define NGX_HAVE_STATFS 1
#endif
#ifndef NGX_HAVE_STATVFS
#define NGX_HAVE_STATVFS 1
#endif
#ifndef NGX_HAVE_SCHED_YIELD
#define NGX_HAVE_SCHED_YIELD 1
#endif
#ifndef NGX_HAVE_DEFERRED_ACCEPT
#define NGX_HAVE_DEFERRED_ACCEPT 1
#endif
#ifndef NGX_HAVE_KEEPALIVE_TUNABLE
#define NGX_HAVE_KEEPALIVE_TUNABLE 1
#endif
#ifndef NGX_HAVE_TCP_FASTOPEN
#define NGX_HAVE_TCP_FASTOPEN 1
#endif
#ifndef NGX_HAVE_TCP_INFO
#define NGX_HAVE_TCP_INFO 1
#endif
#ifndef NGX_HAVE_ACCEPT4
#define NGX_HAVE_ACCEPT4 1
#endif
#ifndef NGX_HAVE_FILE_AIO
#define NGX_HAVE_FILE_AIO 1
#endif
#ifndef NGX_HAVE_EVENTFD
#define NGX_HAVE_EVENTFD 1
#endif
#ifndef NGX_HAVE_UNIX_DOMAIN
#define NGX_HAVE_UNIX_DOMAIN 1
#endif
#ifndef NGX_PTR_SIZE
#define NGX_PTR_SIZE 4
#endif
#ifndef NGX_SIG_ATOMIC_T_SIZE
#define NGX_SIG_ATOMIC_T_SIZE 4
#endif
#ifndef NGX_HAVE_LITTLE_ENDIAN
#define NGX_HAVE_LITTLE_ENDIAN 1
#endif
#ifndef NGX_MAX_SIZE_T_VALUE
#define NGX_MAX_SIZE_T_VALUE 2147483647L
#endif
#ifndef NGX_SIZE_T_LEN
#define NGX_SIZE_T_LEN (sizeof("-2147483648") - 1)
#endif
#ifndef NGX_MAX_OFF_T_VALUE
#define NGX_MAX_OFF_T_VALUE 9223372036854775807LL
#endif
#ifndef NGX_OFF_T_LEN
#define NGX_OFF_T_LEN (sizeof("-9223372036854775808") - 1)
#endif
#ifndef NGX_TIME_T_SIZE
#define NGX_TIME_T_SIZE 4
#endif
#ifndef NGX_TIME_T_LEN
#define NGX_TIME_T_LEN (sizeof("-2147483648") - 1)
#endif
#ifndef NGX_HAVE_INET6
#define NGX_HAVE_INET6 1
#endif
#ifndef NGX_HAVE_PREAD
#define NGX_HAVE_PREAD 1
#endif
#ifndef NGX_HAVE_PWRITE
#define NGX_HAVE_PWRITE 1
#endif
#ifndef NGX_SYS_NERR
#define NGX_SYS_NERR 135
#endif
#ifndef NGX_HAVE_LOCALTIME_R
#define NGX_HAVE_LOCALTIME_R 1
#endif
#ifndef NGX_HAVE_POSIX_MEMALIGN
#define NGX_HAVE_POSIX_MEMALIGN 1
#endif
#ifndef NGX_HAVE_MEMALIGN
#define NGX_HAVE_MEMALIGN 1
#endif
#ifndef NGX_HAVE_MAP_ANON
#define NGX_HAVE_MAP_ANON 1
#endif
#ifndef NGX_HAVE_MAP_DEVZERO
#define NGX_HAVE_MAP_DEVZERO 1
#endif
#ifndef NGX_HAVE_SYSVSHM
#define NGX_HAVE_SYSVSHM 1
#endif
#ifndef NGX_HAVE_POSIX_SEM
#define NGX_HAVE_POSIX_SEM 1
#endif
#ifndef NGX_HAVE_MSGHDR_MSG_CONTROL
#define NGX_HAVE_MSGHDR_MSG_CONTROL 1
#endif
#ifndef NGX_HAVE_FIONBIO
#define NGX_HAVE_FIONBIO 1
#endif
#ifndef NGX_HAVE_GMTOFF
#define NGX_HAVE_GMTOFF 1
#endif
#ifndef NGX_HAVE_D_TYPE
#define NGX_HAVE_D_TYPE 1
#endif
#ifndef NGX_HAVE_SC_NPROCESSORS_ONLN
#define NGX_HAVE_SC_NPROCESSORS_ONLN 1
#endif
#ifndef NGX_HAVE_OPENAT
#define NGX_HAVE_OPENAT 1
#endif
#ifndef NGX_HAVE_GETADDRINFO
#define NGX_HAVE_GETADDRINFO 1
#endif
#ifndef NGX_HTTP_CACHE
#define NGX_HTTP_CACHE 1
#endif
#ifndef NGX_HTTP_GZIP
#define NGX_HTTP_GZIP 1
#endif
#ifndef NGX_HTTP_SSI
#define NGX_HTTP_SSI 1
#endif
#ifndef NGX_HTTP_GZIP
#define NGX_HTTP_GZIP 1
#endif
#ifndef NGX_HTTP_SPDY
#define NGX_HTTP_SPDY 1
#endif
#ifndef NGX_HTTP_GZIP
#define NGX_HTTP_GZIP 1
#endif
#ifndef NGX_HTTP_DAV
#define NGX_HTTP_DAV 1
#endif
#ifndef NGX_CRYPT
#define NGX_CRYPT 1
#endif
#ifndef NGX_HTTP_REALIP
#define NGX_HTTP_REALIP 1
#endif
#ifndef NGX_HTTP_X_FORWARDED_FOR
#define NGX_HTTP_X_FORWARDED_FOR 1
#endif
#ifndef NGX_HTTP_X_FORWARDED_FOR
#define NGX_HTTP_X_FORWARDED_FOR 1
#endif
#ifndef NGX_HTTP_SSL
#define NGX_HTTP_SSL 1
#endif
#ifndef NGX_HTTP_X_FORWARDED_FOR
#define NGX_HTTP_X_FORWARDED_FOR 1
#endif
#ifndef NGX_STAT_STUB
#define NGX_STAT_STUB 1
#endif
#ifndef NGX_MAIL_SSL
#define NGX_MAIL_SSL 1
#endif
#ifndef NGX_PCRE
#define NGX_PCRE 1
#endif
#ifndef NGX_HAVE_PCRE_JIT
#define NGX_HAVE_PCRE_JIT 1
#endif
#ifndef NGX_OPENSSL
#define NGX_OPENSSL 1
#endif
#ifndef NGX_SSL
#define NGX_SSL 1
#endif
#ifndef NGX_HAVE_OPENSSL_MD5_H
#define NGX_HAVE_OPENSSL_MD5_H 1
#endif
#ifndef NGX_OPENSSL_MD5
#define NGX_OPENSSL_MD5 1
#endif
#ifndef NGX_HAVE_MD5
#define NGX_HAVE_MD5 1
#endif
#ifndef NGX_HAVE_OPENSSL_SHA1_H
#define NGX_HAVE_OPENSSL_SHA1_H 1
#endif
#ifndef NGX_HAVE_SHA1
#define NGX_HAVE_SHA1 1
#endif
#ifndef NGX_ZLIB
#define NGX_ZLIB 1
#endif
#ifndef NGX_PREFIX
#define NGX_PREFIX "/etc/nginx/"
#endif
#ifndef NGX_CONF_PREFIX
#define NGX_CONF_PREFIX "/etc/nginx/"
#endif
#ifndef NGX_SBIN_PATH
#define NGX_SBIN_PATH "/usr/sbin/nginx"
#endif
#ifndef NGX_CONF_PATH
#define NGX_CONF_PATH "/etc/nginx/nginx.conf"
#endif
#ifndef NGX_PID_PATH
#define NGX_PID_PATH "/run/nginx.pid"
#endif
#ifndef NGX_LOCK_PATH
#define NGX_LOCK_PATH "/var/lock/nginx.lock"
#endif
#ifndef NGX_ERROR_LOG_PATH
#define NGX_ERROR_LOG_PATH "/var/log/nginx/error.log"
#endif
#ifndef NGX_HTTP_LOG_PATH
#define NGX_HTTP_LOG_PATH "/var/log/nginx/access.log"
#endif
#ifndef NGX_HTTP_CLIENT_TEMP_PATH
#define NGX_HTTP_CLIENT_TEMP_PATH "/var/tmp/nginx/client-body"
#endif
#ifndef NGX_HTTP_PROXY_TEMP_PATH
#define NGX_HTTP_PROXY_TEMP_PATH "/var/tmp/nginx/proxy"
#endif
#ifndef NGX_HTTP_FASTCGI_TEMP_PATH
#define NGX_HTTP_FASTCGI_TEMP_PATH "/var/tmp/nginx/fastcgi"
#endif
#ifndef NGX_HTTP_UWSGI_TEMP_PATH
#define NGX_HTTP_UWSGI_TEMP_PATH "/var/tmp/nginx/uwsgi"
#endif
#ifndef NGX_HTTP_SCGI_TEMP_PATH
#define NGX_HTTP_SCGI_TEMP_PATH "/var/tmp/nginx/scgi"
#endif
#ifndef NGX_SUPPRESS_WARN
#define NGX_SUPPRESS_WARN 1
#endif
#ifndef NGX_SMP
#define NGX_SMP 1
#endif
#ifndef NGX_USER
#define NGX_USER "nginx"
#endif
#ifndef NGX_GROUP
#define NGX_GROUP "nginx"
#endif

View file

@ -1,8 +1,12 @@
# Template file for 'nginx'
pkgname=nginx
version=1.6.0
revision=2
revision=3
makedepends="pcre-devel>=8.30 libressl-devel"
if [ "$CROSS_BUILD" ]; then
# fake configure run on host
hostmakedepends=$makedepends
fi
conf_files="
/etc/nginx/fastcgi.conf
/etc/nginx/fastcgi_params
@ -26,12 +30,15 @@ license="Simplified BSD"
homepage="http://nginx.org"
distfiles="http://nginx.org/download/nginx-$version.tar.gz"
checksum=943ad757a1c3e8b3df2d5c4ddacc508861922e36fa10ea6f8e3a348fc9abfc1a
only_for_archs="x86_64 i686"
do_configure() {
local cfgdir=/etc/nginx
local tmpdir=/var/tmp/nginx
if [ "$CROSS_BUILD" ]; then
unset CC CPP LD CFLAGS CPPFLAGS LDFLAGS
fi
./configure --prefix=${cfgdir} \
--conf-path=${cfgdir}/nginx.conf \
--sbin-path=/usr/sbin/nginx \
@ -55,10 +62,16 @@ do_configure() {
--with-http_realip_module \
--with-http_ssl_module \
--with-http_stub_status_module
if [ "$CROSS_BUILD" ]; then
case "$XBPS_TARGET_MACHINE" in
arm*) cp ${FILESDIR}/ngx_auto_config.h.armv6l objs/ngx_auto_config.h;;
esac
fi
}
do_build() {
make ${makejobs}
make ${makejobs} CC="${CC}" LD="${LD}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
}
do_install() {