commit a20cf6d459ed983f6eb561d8cecb93b91d461cbc
parent 7aa6256191f7aab92b9da87c2dd59e9df5f84ec0
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 12 Jul 2014 16:11:31 +0000
cross-compile nginx and fastcgi
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat:
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/fastcgi/fastcgi.mk b/fastcgi/fastcgi.mk
@@ -6,6 +6,8 @@ fastcgi:QV:
export CFLAGS="$CFLAGS $DEPS_CFLAGS"
export LDFLAGS="$LDFLAGS $DEPS_LDFLAGS"
CC="$CC -static" ./configure \
+ --build="${TOOLCHAIN_TRIPLET}" \
+ --host="${HOST_TOOLCHAIN_TRIPLET}" \
--prefix="$PREFIX" \
--mandir="$ROOT/share/man" \
--disable-shared \
diff --git a/nginx/nginx.mk b/nginx/nginx.mk
@@ -9,11 +9,19 @@ nginx:QV:
# nginx incorrectly detects GNU crypt so set: -DNGX_HAVE_GNU_CRYPT_R=0"
export CFLAGS="$CFLAGS -DNGX_HAVE_GNU_CRYPT_R=0"
export CC="${CC} -static"
+ # make nginx believe we are building pcre, but actually we
+ # use the prebuilt pcre from ports.
+ export pcre_localdir="`pwd`/pcre"
+ mkdir -p "${pcre_localdir}"
+ printf '#!/bin/sh\ntrue' > "${pcre_localdir}/configure"
+ chmod 755 "${pcre_localdir}/configure"
+ printf 'all:\n\ttrue\nlibpcre.la:\n\ttrue\ninstall:\n\ttrue\ndistclean:\n\ttrue\nclean:\n\ttrue' > "${pcre_localdir}/Makefile"
+ ln -sf "${pcre_libdir}" "${pcre_localdir}/.libs"
# don't rebuild pcre source, use the ports version.
# See: http://wiki.nginx.org/InstallOptions#Notes
# --with-ld-opt="-L${pcre_libdir}"
# --with-cc-opt="-I${pcre_includedir}"
- ./configure \
+ CC="$HOSTCC -static" ./configure \
--prefix=/etc/nginx \
--conf-path=/etc/nginx/nginx.conf \
--sbin-path=${prefix}/bin/nginx \
@@ -24,13 +32,13 @@ nginx:QV:
--user=http \
--group=http \
--with-file-aio \
- --with-pcre \
- --with-zlib=${zlib_libdir} \
- --with-openssl=${openssl_libdir} \
+ --with-pcre="${pcre_localdir}" \
+ --with-zlib="${zlib_libdir}" \
+ --with-openssl="${openssl_libdir}" \
--with-ipv6 \
--with-ld-opt="-L${pcre_libdir}" \
--with-cc-opt="-I${pcre_includedir}"
- make -j$nprocs
+ make -j$nprocs CC="$CC -static"
install:QV:
$INSTALL -d -m 755 "$ROOT/run/lock"