nginx.mk (1625B)
1 TARG = nginx 2 DEPS = libressl pcre zlib 3 4 <$mkbuild/mk.common-noinst 5 6 nginx:QV: 7 export CFLAGS="$CFLAGS $DEPS_CFLAGS" 8 export LDFLAGS="$LDFLAGS $DEPS_LDFLAGS" 9 # nginx incorrectly detects GNU crypt so set: -DNGX_HAVE_GNU_CRYPT_R=0" 10 export CFLAGS="$CFLAGS -DNGX_HAVE_GNU_CRYPT_R=0" 11 export BUILDCC="${CC}" 12 export CC="${CC} -static" 13 # make nginx believe we are building pcre, but actually we 14 # use the prebuilt pcre from ports. 15 export pcre_localdir="`pwd`/pcre" 16 mkdir -p "${pcre_localdir}" 17 printf '#!/bin/sh\ntrue' > "${pcre_localdir}/configure" 18 chmod 755 "${pcre_localdir}/configure" 19 printf 'all:\n\ttrue\nlibpcre.la:\n\ttrue\ninstall:\n\ttrue\ndistclean:\n\ttrue\nclean:\n\ttrue' > "${pcre_localdir}/Makefile" 20 ln -sf "${pcre_libdir}" "${pcre_localdir}/.libs" 21 # don't rebuild pcre source, use the ports version. 22 # See: http://wiki.nginx.org/InstallOptions#Notes 23 # --with-ld-opt="-L${pcre_libdir}" 24 # --with-cc-opt="-I${pcre_includedir}" 25 CC="$HOSTCC -static" ./configure \ 26 --prefix=/etc/nginx \ 27 --conf-path=/etc/nginx/nginx.conf \ 28 --sbin-path=${prefix}/bin/nginx \ 29 --error-log-path=/var/log/nginx/access.log \ 30 --error-log-path=stderr \ 31 --pid-path=/run/nginx.pid \ 32 --lock-path=/run/lock/nginx.lock \ 33 --user=http \ 34 --group=http \ 35 --with-file-aio \ 36 --with-pcre="${pcre_localdir}" \ 37 --with-zlib="${zlib_libdir}" \ 38 --with-openssl="${libressl_libdir}" \ 39 --with-ipv6 \ 40 --with-ld-opt="-L${pcre_libdir}" \ 41 --with-cc-opt="-I${pcre_includedir}" 42 make -j$nprocs CC="$BUILDCC -static" 43 44 install:QV: 45 $INSTALL -d -m 755 "$ROOT/run/lock" 46 make -j$nprocs install CC="$CC -static" DESTDIR="$ROOT"