Posts

Showing posts from February, 2010

Lighttpd with static modules

For the Nexus OS I need a version of lighttpd that is statically linked. Even when you build lighty as a static library, it by defaults expects to load its modules (access, dirlisting, staticfile, cgi, ...) at runtime. The following trick makes lightly include modules in the statically linked binary. It has been tested against version 1.4.25. CFLAGS Compile with the debug flag -DLIGHTTPD_STATIC set. I noticed that my gcc (4.4.1) also complained about syntax, so I had to force gcc to interpret as the C99 standard: make CFLAGS=-DLIGHTTPD_STATIC -std=c99 src/Makefile.in changes In src/Makefile.in (from which configure generates src/Makefile), add the modules you want to include (say, mod_access and mod_staticfile) to all lists of input to target lighttpd. Specifically, add to am__liblightcomp_la_SOURCE_DIST, am__lighttpd_SOURCES_DIST and common_src: mod_access.c mod_staticfile.c And also add the objects. To am__objects_1 and am__objects_2 mod_access.$(OBJEXT) mod_staticfile.$