ports

zandra's ports tree
git clone git://zandra.org/ports
Log | Files | Refs | README | LICENSE

nginx.mk (1544B)


      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 	mkdir -p "${pcre_dir}"
     16 	printf '#!/bin/sh\ntrue' > "${pcre_dir}/configure"
     17 	chmod 755 "${pcre_dir}/configure"
     18 	printf 'all:\n\ttrue\nlibpcre.la:\n\ttrue\ninstall:\n\ttrue\ndistclean:\n\ttrue\nclean:\n\ttrue' > "${pcre_dir}/Makefile"
     19 	ln -sf "${pcre_libdir}" "${pcre_dir}/.libs"
     20 	# don't rebuild pcre source, use the ports version.
     21 	# See: http://wiki.nginx.org/InstallOptions#Notes
     22 	#   --with-ld-opt="-L${pcre_libdir}"
     23 	#   --with-cc-opt="-I${pcre_includedir}"
     24 	CC="$HOSTCC -static" ./configure \
     25 		--prefix=/etc/nginx \
     26 		--conf-path=/etc/nginx/nginx.conf \
     27 		--sbin-path=${prefix}/bin/nginx \
     28 		--error-log-path=/var/log/nginx/access.log \
     29 		--error-log-path=stderr \
     30 		--pid-path=/run/nginx.pid \
     31 		--lock-path=/run/lock/nginx.lock \
     32 		--user=http \
     33 		--group=http \
     34 		--with-file-aio \
     35 		--with-pcre="${pcre_dir}" \
     36 		--with-zlib="${zlib_libdir}" \
     37 		--with-openssl="${libressl_libdir}" \
     38 		--with-ld-opt="-L${pcre_libdir}" \
     39 		--with-cc-opt="-I${pcre_includedir}"
     40 	make -j$nprocs CC="$BUILDCC -static"
     41 
     42 install:QV:
     43 	$INSTALL -d -m 755 "$ROOT/run/lock"
     44 	make -j$nprocs install CC="$CC -static" DESTDIR="$ROOT"