1e95ea21bSJan KneschkeImport('env') 2e95ea21bSJan Kneschke 3809199f9SmOocommon_src = Split("buffer.c log.c \ 4e95ea21bSJan Kneschke keyvalue.c chunk.c \ 5e95ea21bSJan Kneschke http_chunk.c stream.c fdevent.c \ 6e95ea21bSJan Kneschke stat_cache.c plugin.c joblist.c etag.c array.c \ 7e95ea21bSJan Kneschke data_string.c data_count.c data_array.c \ 8e95ea21bSJan Kneschke data_integer.c md5.c data_fastcgi.c \ 9e95ea21bSJan Kneschke fdevent_select.c fdevent_linux_rtsig.c \ 10e95ea21bSJan Kneschke fdevent_poll.c fdevent_linux_sysepoll.c \ 11e95ea21bSJan Kneschke fdevent_solaris_devpoll.c fdevent_freebsd_kqueue.c \ 12e95ea21bSJan Kneschke data_config.c bitset.c \ 13e95ea21bSJan Kneschke inet_ntop_cache.c crc32.c \ 14e95ea21bSJan Kneschke connections-glue.c \ 15e95ea21bSJan Kneschke configfile-glue.c \ 16e95ea21bSJan Kneschke http-header-glue.c \ 17*ff0ec137SJan Kneschke splaytree.c network_writev.c \ 18e95ea21bSJan Kneschke network_write.c network_linux_sendfile.c \ 19809199f9SmOo network_freebsd_sendfile.c \ 20e95ea21bSJan Kneschke network_solaris_sendfilev.c network_openssl.c \ 21*ff0ec137SJan Kneschke") 22*ff0ec137SJan Kneschke 23*ff0ec137SJan Kneschkesrc = Split("server.c response.c connections.c network.c \ 24e95ea21bSJan Kneschke configfile.c configparser.c request.c proc_open.c") 25e95ea21bSJan Kneschke 26e95ea21bSJan Kneschkelemon = env.Program('lemon', 'lemon.c') 27e95ea21bSJan Kneschke 28809199f9SmOoconfigparser = env.Command(['configparser.c', 'configparser.h'], 'configparser.y', '(cd build; ../' + lemon[0].path + ' -q ../$SOURCE ../src/lempar.c; cd ..)') 29e95ea21bSJan Kneschkeenv.Depends(configparser, lemon) 30e95ea21bSJan Kneschke 31809199f9SmOomod_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 ..)') 32809199f9SmOoenv.Depends(mod_ssi_exprparser, lemon) 33809199f9SmOo 34809199f9SmOoimplib = 'lighttpd.exe.a' 35809199f9SmOobin_targets = ['lighttpd'] 36809199f9SmOobin_linkflags = [ env['LINKFLAGS'] ] 37809199f9SmOoif env['COMMON_LIB'] == 'lib': 38809199f9SmOo common_lib = env.SharedLibrary('liblighttpd', common_src, LINKFLAGS = [ env['LINKFLAGS'], '-Wl,--export-dynamic' ]) 39809199f9SmOoelse: 40809199f9SmOo src += common_src 41809199f9SmOo common_lib = [] 42809199f9SmOo if env['COMMON_LIB'] == 'bin': 43809199f9SmOo bin_linkflags += [ '-Wl,--export-all-symbols', '-Wl,--out-implib=build/' + implib ] 44809199f9SmOo bin_targets += [ implib ] 45809199f9SmOo else: 46809199f9SmOo bin_linkflags += [ '-Wl,--export-dynamic' ] 47809199f9SmOo 48809199f9SmOoinstbin = env.Program(bin_targets, src, LINKFLAGS = bin_linkflags, LIBS= [ env['LIBS'], common_lib ]) 49809199f9SmOoenv.Depends(instbin, configparser) 50809199f9SmOo 51578e68e2SmOospawn_fcgi = env.Program("spawn-fcgi", "spawn-fcgi.c") 52578e68e2SmOo 53809199f9SmOoif env['COMMON_LIB'] == 'bin': 54809199f9SmOo common_lib = instbin[1] 55e95ea21bSJan Kneschke 56e95ea21bSJan Kneschkeenv['SHLIBPREFIX'] = '' 57e95ea21bSJan Kneschkeinstlib = [] 58809199f9SmOoinstlib += env.SharedLibrary('mod_access', [ 'mod_access.c' ], LIBS= [ common_lib ]) 59809199f9SmOoinstlib += env.SharedLibrary('mod_alias', [ 'mod_alias.c' ], LIBS= [ common_lib ]) 60809199f9SmOoinstlib += env.SharedLibrary('mod_cgi', [ 'mod_cgi.c' ], LIBS= [ common_lib ]) 61809199f9SmOoinstlib += env.SharedLibrary('mod_fastcgi', [ 'mod_fastcgi.c' ], LIBS= [ common_lib ]) 62809199f9SmOoinstlib += env.SharedLibrary('mod_scgi', [ 'mod_scgi.c' ], LIBS= [ common_lib ]) 63809199f9SmOoinstlib += env.SharedLibrary('mod_staticfile', [ 'mod_staticfile.c' ], LIBS= [ common_lib ]) 64809199f9SmOoinstlib += env.SharedLibrary('mod_dirlisting', [ 'mod_dirlisting.c' ], LIBS= [ common_lib, env['LIBPCRE'] ]) 65809199f9SmOoinstlib += env.SharedLibrary('mod_indexfile', [ 'mod_indexfile.c' ], LIBS= [ common_lib ]) 66809199f9SmOoinstlib += env.SharedLibrary('mod_setenv', [ 'mod_setenv.c' ], LIBS= [ common_lib ]) 67809199f9SmOoinstlib += env.SharedLibrary('mod_rrdtool', [ 'mod_rrdtool.c' ], LIBS= [ common_lib ]) 68809199f9SmOoinstlib += env.SharedLibrary('mod_usertrack', [ 'mod_usertrack.c' ], LIBS= [ common_lib ]) 69809199f9SmOoinstlib += env.SharedLibrary('mod_proxy', [ 'mod_proxy.c' ], LIBS= [ common_lib ]) 70809199f9SmOoinstlib += env.SharedLibrary('mod_userdir', [ 'mod_userdir.c' ], LIBS= [ common_lib ]) 71809199f9SmOomod_ssi = env.SharedLibrary('mod_ssi', [ 'mod_ssi_exprparser.c', 'mod_ssi_expr.c', 'mod_ssi.c' ], LIBS= [ common_lib, env['LIBPCRE'] ]) 72809199f9SmOoenv.Depends(mod_ssi, mod_ssi_exprparser) 73809199f9SmOoinstlib += mod_ssi 74809199f9SmOoinstlib += env.SharedLibrary('mod_secdownload', [ 'mod_secure_download.c' ], LIBS= [ common_lib ]) 75809199f9SmOoinstlib += env.SharedLibrary('mod_accesslog', [ 'mod_accesslog.c' ], LIBS= [ common_lib ]) 76809199f9SmOoinstlib += env.SharedLibrary('mod_simple_vhost', [ 'mod_simple_vhost.c' ], LIBS= [ common_lib ]) 77809199f9SmOoinstlib += env.SharedLibrary('mod_evhost', [ 'mod_evhost.c' ], LIBS= [ common_lib ]) 78809199f9SmOoinstlib += env.SharedLibrary('mod_expire', [ 'mod_expire.c' ], LIBS= [ common_lib ]) 79809199f9SmOoinstlib += env.SharedLibrary('mod_status', [ 'mod_status.c' ], LIBS= [ common_lib ]) 80809199f9SmOoinstlib += env.SharedLibrary('mod_compress', [ 'mod_compress.c' ], LIBS= [ common_lib, env['LIBZ'], env['LIBBZ2'] ] ) 81809199f9SmOoinstlib += env.SharedLibrary('mod_redirect', [ 'mod_redirect.c' ], LIBS = [ common_lib, env['LIBPCRE'] ] ) 82809199f9SmOoinstlib += env.SharedLibrary('mod_rewrite', [ 'mod_rewrite.c' ], LIBS= [ common_lib, env['LIBPCRE'] ]) 83809199f9SmOoinstlib += env.SharedLibrary('mod_auth', [ Split('mod_auth.c http_auth_digest.c http_auth.c') ], LIBS= [ common_lib, env['LIBCRYPT'] ]) 84809199f9SmOoinstlib += env.SharedLibrary('mod_webdav', [ 'mod_webdav.c' ], LIBS= [ common_lib, env['LIBXML2'], env['LIBSQLITE3'] ]) 85809199f9SmOoinstlib += env.SharedLibrary('mod_mysql_vhost', [ 'mod_mysql_vhost.c' ], LIBS= [ common_lib, env['LIBMYSQL'] ]) 86809199f9SmOoinstlib += env.SharedLibrary('mod_trigger_b4_dl', [ 'mod_trigger_b4_dl.c' ], LIBS= [ common_lib, env['LIBPCRE'] ]) 8770110bebSmOoinstlib += env.SharedLibrary('mod_cml', [ 'mod_cml_lua.c', 'mod_cml.c' ], LIBS= [ common_lib, env['LIBPCRE'], env['LIBMEMCACHE'] ]) 88809199f9SmOoinstlib += env.SharedLibrary('mod_uploadprogress', [ 'mod_uploadprogress.c' ], LIBS= [ common_lib ]) 89e95ea21bSJan Kneschke 90e95ea21bSJan Kneschkeinst = [] 91578e68e2SmOoinst += env.Install('${bindir}', instbin[0]) 92578e68e2SmOoinst += env.Install('${bindir}', spawn_fcgi) 93809199f9SmOoif env['COMMON_LIB'] == 'lib': 94809199f9SmOo inst += env.Install('${bindir}', common_lib) 95e95ea21bSJan Kneschkeinst += env.Install('${libdir}', instlib) 96e95ea21bSJan Kneschke 97e95ea21bSJan Kneschkeenv.Alias('install', inst) 98e95ea21bSJan Kneschke 99e95ea21bSJan Kneschkepkgdir = '.' 100e95ea21bSJan Kneschketarname = env['package'] + '-' + env['version'] 101e95ea21bSJan Kneschke 102