Browse Source

added a static target to scons which compiles lighttpd staticly (incl. mod_access as test)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@903 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.11
Jan Kneschke 16 years ago
parent
commit
4c91a14c4d
  1. 11
      src/SConscript
  2. 19
      src/plugin.c

11
src/SConscript

@ -31,6 +31,16 @@ env.Depends(configparser, lemon)
mod_ssi_exprparser = env.Command(['mod_ssi_exprparser.c', 'mod_ssi_exprparser.h'], 'mod_ssi_exprparser.y', '(cd build; ../' + lemon[0].path + ' -q ../$SOURCE ../src/lempar.c; cd ..)')
env.Depends(mod_ssi_exprparser, lemon)
staticenv = env.Copy(CPPFLAGS=[ env['CPPFLAGS'], '-DLIGHTTPD_STATIC', '-DOPENSSL_NO_KRB5'])
## turn all src-files into objects
staticsrc = src + common_src + [ 'mod_access.c' ]
staticobj = []
for cfile in staticsrc:
staticobj += [ staticenv.Object('static-' + cfile.replace('.c', ''), cfile) ]
staticbin = staticenv.Program('lighttpd-static', staticobj, LIBS = [ 'pthread', 'fam', 'pthread', 'krb5', 'crypto', 'ssl', 'crypto', 'ssl', 'krb5', 'k5crypto', 'krb5support', 'com_err', 'resolv', 'pcre' ], LINKFLAGS= ['-static'] )
Alias('static', staticbin)
implib = 'lighttpd.exe.a'
bin_targets = ['lighttpd']
bin_linkflags = [ env['LINKFLAGS'] ]
@ -50,6 +60,7 @@ env.Depends(instbin, configparser)
spawn_fcgi = env.Program("spawn-fcgi", "spawn-fcgi.c")
if env['COMMON_LIB'] == 'bin':
common_lib = instbin[1]

19
src/plugin.c

@ -66,6 +66,7 @@ static void plugin_free(plugin *p) {
/*if (RUNNING_ON_VALGRIND) use_dlclose = 0;*/
#endif
#ifndef LIGHTTPD_STATIC
if (use_dlclose && p->lib) {
#ifdef __WIN32
FreeLibrary(p->lib);
@ -73,6 +74,7 @@ static void plugin_free(plugin *p) {
dlclose(p->lib);
#endif
}
#endif
free(p);
}
@ -100,7 +102,23 @@ static int plugins_register(server *srv, plugin *p) {
*
*/
#ifdef LIGHTTPD_STATIC
int plugins_load(server *srv) {
plugin *p;
#define PLUGIN_INIT(x)\
p = plugin_init(); \
if (x ## _plugin_init(p)) { \
log_error_write(srv, __FILE__, __LINE__, "ss", #x, "plugin init failed" ); \
plugin_free(p); \
return -1;\
}\
plugins_register(srv, p);
PLUGIN_INIT(mod_access);
return 0;
}
#else
int plugins_load(server *srv) {
plugin *p;
int (*init)(plugin *pl);
@ -205,6 +223,7 @@ int plugins_load(server *srv) {
return 0;
}
#endif
#define PLUGIN_TO_SLOT(x, y) \
handler_t plugins_call_##y(server *srv, connection *con) {\

Loading…
Cancel
Save