Project

General

Profile

[Solved] problem with static compile

Added by bwalker@musings.com about 10 years ago

When I statically compile lighttpd, it looks like src/SConscript is not creating a plugin-static.h file. Matter of fact, it looks like SConscript is not being called at all.

Here is my configure line..
./configure --host=arm-uclinuxeabi --includedir=/home/bwalker/src/uCLinux/linux-K70-1.11.0/linux-cortexm-1.11.0/A2F/root/usr/include --libdir=/home/bwalker/src/uCLinux/linux-K70-1.11.0/linux-cortexm-1.11.0/A2F/root/usr/lib --enable-static --without-zlib --without-bzip2 --without-pcre --without-pic --disable-shared --disable-ipv6

But, yet there is not plugin-static.h file created..

Or better yet, can someone explain to me how to create a statically built lighttpd? One that is built using -DLIGHTTPD_STATIC

Thanks.

-brad w.


Replies (7)

RE: problem with static compile - Added by Anonymous almost 8 years ago

Hello brad,

I hope able to build it statically with all modules, please post here
I also need to build statically with all modules in single binary

RE: problem with static compile - Added by gstrauss almost 8 years ago

See also related forum entry https://redmine.lighttpd.net/boards/3/topics/6615

SCons supports static lighttpd build.

If using make, you might try the following and report back if it works:
LIGHTTPD_STATIC=yes CPPFLAGS=-DLIGHTTPD_STATIC ./configure ...

RE: problem with static compile - Added by Anonymous almost 8 years ago

Getting this error
plugin.c:112:27: fatal error: plugin-static.h: No such file or directory

RE: problem with static compile - Added by gstrauss almost 8 years ago

Create src/plugin-static.h with the modules that you want to include in your build. The following list is incomplete.

PLUGIN_INIT(mod_auth)
PLUGIN_INIT(mod_redirect)
PLUGIN_INIT(mod_rewrite)
PLUGIN_INIT(mod_cgi)
PLUGIN_INIT(mod_fastcgi)
PLUGIN_INIT(mod_scgi)
PLUGIN_INIT(mod_ssi)
PLUGIN_INIT(mod_proxy)
PLUGIN_INIT(mod_indexfile)
PLUGIN_INIT(mod_dirlisting)
PLUGIN_INIT(mod_staticfile)

RE: problem with static compile - Added by Anonymous almost 8 years ago

plugin.o:(.rodata+0x8): undefined reference to `mod_auth_plugin_init'
plugin.o:(.rodata+0x18): undefined reference to `mod_redirect_plugin_init'
plugin.o:(.rodata+0x28): undefined reference to `mod_rewrite_plugin_init'
plugin.o:(.rodata+0x38): undefined reference to `mod_cgi_plugin_init'
plugin.o:(.rodata+0x48): undefined reference to `mod_fastcgi_plugin_init'
plugin.o:(.rodata+0x58): undefined reference to `mod_scgi_plugin_init'
plugin.o:(.rodata+0x68): undefined reference to `mod_ssi_plugin_init'
plugin.o:(.rodata+0x78): undefined reference to `mod_proxy_plugin_init'
plugin.o:(.rodata+0x88): undefined reference to `mod_indexfile_plugin_init'
plugin.o:(.rodata+0x98): undefined reference to `mod_dirlisting_plugin_init'
plugin.o:(.rodata+0xa8): undefined reference to `mod_staticfile_plugin_init'
collect2: error: ld returned 1 exit status
Makefile:1158: recipe for target 'lighttpd' failed
make3: * [lighttpd] Error 1
make3: Leaving directory '/home/lighttpd-1.4.39/src'
Makefile:927: recipe for target 'all' failed
make2:
[all] Error 2
make2: Leaving directory '/home/lighttpd-1.4.39/src'
Makefile:436: recipe for target 'all-recursive' failed
make1:
[all-recursive] Error 1
make1: Leaving directory '/home/lighttpd-1.4.39'
Makefile:366: recipe for target 'all' failed
make: *
[all] Error 2
root@ubuntu:/home/lighttpd-1.4.39#

RE: problem with static compile - Added by gstrauss almost 8 years ago

Seems like you don't want to use SCons?

If using make, you'll need to edit src/Makefile.am (and fix the misspelled lighttpd_CCPFLAGS -> lighttpd_CPPFLAGS), e.g.

lighttpd_SOURCES = $(src) \
  mod_auth.c \
  mod_redirect.c \
  mod_rewrite.c \
  mod_cgi.c \
  mod_fastcgi.c \
  mod_scgi.c \
  mod_ssi.c \
  mod_proxy.c \
  mod_indexfile.c \
  mod_dirlisting.c \
  mod_staticfile.c
lighttpd_LDADD = $(PCRE_LIB) $(DL_LIB) $(SENDFILE_LIB) $(ATTR_LIB) $(common_libadd) $(FAM_LIBS) $(LIBEV_LIBS) $(LIBUNWIND_LIBS) \
  $(CRYPT_LIB) $(SSL_LIB) $(LDAP_LIB) $(LBER_LIB) \
  $(LUA_LIBS) -lm \
  $(MYSQL_LIBS) \
  $(MEMCACHED_LIB) \
  $(GDBM_LIB) \
  $(XML_LIBS) $(SQLITE_LIBS) $(UUID_LIBS) \
  $(Z_LIB) $(BZ_LIB)
lighttpd_LDFLAGS = -export-dynamic
lighttpd_CPPFLAGS = $(FAM_CFLAGS) $(LIBEV_CFLAGS) \
  -DLIGHTTPD_STATIC \
  $(LUA_CFLAGS) \
  $(MYSQL_INCLUDE) \
  $(MEMCACHED_CFLAGS) \
  $(XML_CFLAGS) $(SQLITE_CFLAGS) \
  $(LIBUNWIND_CFLAGS) 

RE: problem with static compile - Added by Anonymous almost 8 years ago

finally I learnt how to use SCons and now all good (all modules statically compiled)

    (1-7/7)