clighttpdautoconfautomakelibtool

how to compile lighttpd modules statically


I have currently complied lighttpd from source

./configure --prefix=/home/lighttpd \
--without-pcre \
--without-zlib \
--without-bzip2

I also tried -enable-static --disable-shared option, but modules still loading from lib directory

I want to compile all lighttpd module in single binary instead of loading from lib directory, how to do that ?


Solution

  • Cross-posted to https://redmine.lighttpd.net/boards/3/topics/6615

    Lighttpd can be built statically using SCons or using make. Briefly:

    SCons:
    $ scons -j 4 build_static=1 build_dynamic=0 prefix=/custom/inst/path install

    make:

    # edit src/Makefile.am and in the section under 'if LIGHTTPD_STATIC', update lighttpd_SOURCES with each module to be included in the static build or just use the entire list that is already there

    $ LIGHTTPD_STATIC=yes ./configure -C --enable-static=yes
    $ make

    More details in https://redmine.lighttpd.net/boards/3/topics/5912

    [edit] To build statically using 'make', use lighttpd git master branch or lighttpd 1.4.40+