xref: /lighttpd1.4/src/SConscript (revision 809199f9)
1e95ea21bSJan KneschkeImport('env')
2e95ea21bSJan Kneschke
3*809199f9SmOocommon_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*809199f9SmOo      splaytree.c network_writev.c")
18*809199f9SmOo
19*809199f9SmOosrc = Split("server.c response.c connections.c network.c \
20e95ea21bSJan Kneschke      network_write.c network_linux_sendfile.c \
21*809199f9SmOo      network_freebsd_sendfile.c \
22e95ea21bSJan Kneschke      network_solaris_sendfilev.c network_openssl.c \
23e95ea21bSJan Kneschke      configfile.c configparser.c request.c proc_open.c")
24e95ea21bSJan Kneschke
25e95ea21bSJan Kneschkelemon = env.Program('lemon', 'lemon.c')
26e95ea21bSJan Kneschke
27*809199f9SmOoconfigparser = env.Command(['configparser.c', 'configparser.h'], 'configparser.y', '(cd build; ../' + lemon[0].path + ' -q ../$SOURCE ../src/lempar.c; cd ..)')
28e95ea21bSJan Kneschkeenv.Depends(configparser, lemon)
29e95ea21bSJan Kneschke
30*809199f9SmOomod_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 ..)')
31*809199f9SmOoenv.Depends(mod_ssi_exprparser, lemon)
32*809199f9SmOo
33*809199f9SmOoimplib = 'lighttpd.exe.a'
34*809199f9SmOobin_targets = ['lighttpd']
35*809199f9SmOobin_linkflags = [ env['LINKFLAGS'] ]
36*809199f9SmOoif env['COMMON_LIB'] == 'lib':
37*809199f9SmOo	common_lib = env.SharedLibrary('liblighttpd', common_src, LINKFLAGS = [ env['LINKFLAGS'], '-Wl,--export-dynamic' ])
38*809199f9SmOoelse:
39*809199f9SmOo	src += common_src
40*809199f9SmOo	common_lib = []
41*809199f9SmOo	if env['COMMON_LIB'] == 'bin':
42*809199f9SmOo		bin_linkflags += [ '-Wl,--export-all-symbols', '-Wl,--out-implib=build/' + implib ]
43*809199f9SmOo		bin_targets += [ implib ]
44*809199f9SmOo	else:
45*809199f9SmOo		bin_linkflags += [ '-Wl,--export-dynamic' ]
46*809199f9SmOo
47*809199f9SmOoinstbin = env.Program(bin_targets, src, LINKFLAGS = bin_linkflags, LIBS= [ env['LIBS'], common_lib ])
48*809199f9SmOoenv.Depends(instbin, configparser)
49*809199f9SmOo
50*809199f9SmOoif env['COMMON_LIB'] == 'bin':
51*809199f9SmOo	common_lib = instbin[1]
52e95ea21bSJan Kneschke
53e95ea21bSJan Kneschkeenv['SHLIBPREFIX'] = ''
54e95ea21bSJan Kneschkeinstlib = []
55*809199f9SmOoinstlib += env.SharedLibrary('mod_access', [ 'mod_access.c' ], LIBS= [ common_lib ])
56*809199f9SmOoinstlib += env.SharedLibrary('mod_alias', [ 'mod_alias.c' ], LIBS= [ common_lib ])
57*809199f9SmOoinstlib += env.SharedLibrary('mod_cgi', [ 'mod_cgi.c' ], LIBS= [ common_lib ])
58*809199f9SmOoinstlib += env.SharedLibrary('mod_fastcgi', [ 'mod_fastcgi.c' ], LIBS= [ common_lib ])
59*809199f9SmOoinstlib += env.SharedLibrary('mod_scgi', [ 'mod_scgi.c' ], LIBS= [ common_lib ])
60*809199f9SmOoinstlib += env.SharedLibrary('mod_staticfile', [ 'mod_staticfile.c' ], LIBS= [ common_lib ])
61*809199f9SmOoinstlib += env.SharedLibrary('mod_dirlisting', [ 'mod_dirlisting.c' ], LIBS= [ common_lib, env['LIBPCRE'] ])
62*809199f9SmOoinstlib += env.SharedLibrary('mod_indexfile', [ 'mod_indexfile.c' ], LIBS= [ common_lib ])
63*809199f9SmOoinstlib += env.SharedLibrary('mod_setenv', [ 'mod_setenv.c' ], LIBS= [ common_lib ])
64*809199f9SmOoinstlib += env.SharedLibrary('mod_rrdtool', [ 'mod_rrdtool.c' ], LIBS= [ common_lib ])
65*809199f9SmOoinstlib += env.SharedLibrary('mod_usertrack', [ 'mod_usertrack.c' ], LIBS= [ common_lib ])
66*809199f9SmOoinstlib += env.SharedLibrary('mod_proxy', [ 'mod_proxy.c' ], LIBS= [ common_lib ])
67*809199f9SmOoinstlib += env.SharedLibrary('mod_userdir', [ 'mod_userdir.c' ], LIBS= [ common_lib ])
68*809199f9SmOomod_ssi = env.SharedLibrary('mod_ssi', [ 'mod_ssi_exprparser.c', 'mod_ssi_expr.c', 'mod_ssi.c' ], LIBS= [ common_lib, env['LIBPCRE'] ])
69*809199f9SmOoenv.Depends(mod_ssi, mod_ssi_exprparser)
70*809199f9SmOoinstlib += mod_ssi
71*809199f9SmOoinstlib += env.SharedLibrary('mod_secdownload', [ 'mod_secure_download.c' ], LIBS= [ common_lib ])
72*809199f9SmOoinstlib += env.SharedLibrary('mod_accesslog', [ 'mod_accesslog.c' ], LIBS= [ common_lib ])
73*809199f9SmOoinstlib += env.SharedLibrary('mod_simple_vhost', [ 'mod_simple_vhost.c' ], LIBS= [ common_lib ])
74*809199f9SmOoinstlib += env.SharedLibrary('mod_evhost', [ 'mod_evhost.c' ], LIBS= [ common_lib ])
75*809199f9SmOoinstlib += env.SharedLibrary('mod_expire', [ 'mod_expire.c' ], LIBS= [ common_lib ])
76*809199f9SmOoinstlib += env.SharedLibrary('mod_status', [ 'mod_status.c' ], LIBS= [ common_lib ])
77*809199f9SmOoinstlib += env.SharedLibrary('mod_compress', [ 'mod_compress.c' ], LIBS= [ common_lib, env['LIBZ'], env['LIBBZ2'] ] )
78*809199f9SmOoinstlib += env.SharedLibrary('mod_redirect', [ 'mod_redirect.c' ], LIBS = [ common_lib, env['LIBPCRE'] ] )
79*809199f9SmOoinstlib += env.SharedLibrary('mod_rewrite', [ 'mod_rewrite.c' ], LIBS= [ common_lib, env['LIBPCRE'] ])
80*809199f9SmOoinstlib += env.SharedLibrary('mod_auth', [ Split('mod_auth.c http_auth_digest.c http_auth.c') ], LIBS= [ common_lib, env['LIBCRYPT'] ])
81*809199f9SmOoinstlib += env.SharedLibrary('mod_webdav', [ 'mod_webdav.c' ], LIBS= [ common_lib, env['LIBXML2'], env['LIBSQLITE3'] ])
82*809199f9SmOoinstlib += env.SharedLibrary('mod_mysql_vhost', [ 'mod_mysql_vhost.c' ], LIBS= [ common_lib, env['LIBMYSQL'] ])
83*809199f9SmOoinstlib += env.SharedLibrary('mod_trigger_b4_dl', [ 'mod_trigger_b4_dl.c' ], LIBS= [ common_lib, env['LIBPCRE'] ])
84*809199f9SmOoinstlib += env.SharedLibrary('mod_cml', [ 'mod_cml_lua.c', 'mod_cml.c' ], LIBS= [ common_lib, env['LIBPCRE'] ])
85*809199f9SmOoinstlib += env.SharedLibrary('mod_uploadprogress', [ 'mod_uploadprogress.c' ], LIBS= [ common_lib ])
86e95ea21bSJan Kneschke
87e95ea21bSJan Kneschkeinst = []
88e95ea21bSJan Kneschkeinst += env.Install('${bindir}', instbin)
89*809199f9SmOoif env['COMMON_LIB'] == 'lib':
90*809199f9SmOo	inst += env.Install('${bindir}', common_lib)
91e95ea21bSJan Kneschkeinst += env.Install('${libdir}', instlib)
92e95ea21bSJan Kneschke
93e95ea21bSJan Kneschkeenv.Alias('install', inst)
94e95ea21bSJan Kneschke
95e95ea21bSJan Kneschkepkgdir = '.'
96e95ea21bSJan Kneschketarname = env['package'] + '-' + env['version']
97e95ea21bSJan Kneschke
98