Docunext


Customizing NGINX Debian Build

February 4th, 2009

I'm building a more recent version of NGINX to take advantage of its xsl module, and while I'm at it I'm customizing the gcc flags, since the installation target is embedded, low-power systems, where every little bit counts!

The usual:

apt-get source nginx

Then I downloaded the source from the internet manually, copied over the debian/ directory, changed a few version numbers, and then did some internal adjusting:

vim auto/cc/gcc

I added these:

NGX_GCC_OPT="-Os"

CPU_OPT="-march=geode"
I also added "-mtune=geode" to the debian/rules file. In the case that I use a machine with an intel atom (i686 or the like) or a via c7[1] (-march=i686 -mmmx -msse -msse2 -msse3), I would obviously change the -march flag. [2]

I also removed the ssl module from the configure line in debian/rules as I want to use pound as an ssl proxy - it can use specific openssl engines, as described here[3]. I also removed the flv module.

Example resulting command:

gcc -c -Os -pipe -march=geode -Os -W -Wall -Wpointer-arith -Wno-unused-parameter -Wno-unused-function -Wunused-variable -Wunused-value -Werror -g -mtune=geode -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \		-o objs/src/os/unix/ngx_user.o \		src/os/unix/ngx_user.c

References:

  1. http://en.gentoo-wiki.com/wiki/Safe_Cflags

  2. http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html

  3. Via Padlock OCF-Linux Integration

Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022