2
0
Fork 0
lighttpd2/src/wscript

113 lines
2.5 KiB
Plaintext
Raw Normal View History

2008-11-20 23:31:44 +00:00
#!/usr/bin/env python
2008-06-24 19:19:20 +00:00
# encoding: utf-8
2008-11-20 23:31:44 +00:00
"""
waf build script for Lighttpd 2.x
License and Copyright: see COPYING file
"""
2008-06-24 19:19:20 +00:00
2008-11-20 23:31:44 +00:00
import Options, sys
2008-06-24 19:19:20 +00:00
2008-11-20 23:31:44 +00:00
common_uselib = ['glib', 'gthread', 'gmodule']
common_ccflags = [
'-std=gnu99', '-Wall', '-g', '-Wshadow', '-W', '-pedantic'
]
common_src = '''
2008-06-30 10:25:01 +00:00
actions.c
angel.c
angel_fake.c
2008-06-28 18:37:28 +00:00
base.c
chunk.c
chunk_parser.c
collect.c
2008-06-29 15:48:28 +00:00
condition.c
2008-07-25 20:38:42 +00:00
condition_parsers.rl
2008-07-08 16:51:03 +00:00
config_parser.rl
2008-08-05 15:08:32 +00:00
connection.c
filter_chunked.c
http_headers.c
2008-06-30 14:24:29 +00:00
http_request_parser.rl
2008-06-24 19:19:20 +00:00
log.c
2008-10-22 14:54:44 +00:00
module.c
2008-08-05 15:08:32 +00:00
network.c
network_write.c network_writev.c
network_sendfile.c
2008-06-28 18:37:28 +00:00
options.c
2008-07-08 19:29:02 +00:00
plugin.c
2008-11-20 23:31:44 +00:00
plugin_core.c
profiler.c
request.c
2008-08-06 18:46:42 +00:00
response.c
server.c
2008-06-24 19:19:20 +00:00
sys-files.c
2008-06-28 18:37:28 +00:00
sys-socket.c
url_parser.rl
2008-08-05 15:08:32 +00:00
utils.c
2008-09-26 16:06:07 +00:00
value.c
virtualrequest.c
2008-11-17 09:26:25 +00:00
waitqueue.c
worker.c
2008-06-24 19:19:20 +00:00
'''
2008-11-20 23:31:44 +00:00
common_src_lua = '''
actions_lua.c
condition_lua.c
config_lua.c
2008-09-26 16:06:07 +00:00
value_lua.c
2008-06-29 15:48:28 +00:00
'''
2008-11-20 23:31:44 +00:00
main_src = '''
lighttpd.c
2008-11-20 23:31:44 +00:00
'''
2008-07-08 16:51:03 +00:00
2008-11-20 23:31:44 +00:00
lighty_common_ccflags = [
'-fPIC',
'-DHAVE_CONFIG_H', '-D_GNU_SOURCE',
'-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_LARGE_FILES',
# '-fno-strict-aliasing',
]
2008-06-24 19:19:20 +00:00
2008-11-20 23:31:44 +00:00
def lighty_mod(bld, target, src, uselib = [], option = ''):
if option and not getattr(Options.options, option):
return
2008-10-22 14:54:44 +00:00
mod = bld.new_task_gen('cc', 'shlib')
2008-06-24 19:19:20 +00:00
mod.target = target
mod.source = src
2008-11-20 23:31:44 +00:00
mod.uselib = ['lightymod'] + common_uselib + uselib
#mod.ccflags = common_ccflags
2008-07-08 16:51:03 +00:00
2008-11-20 23:31:44 +00:00
def configure(conf):
opts = Options.options
conf.env['CCFLAGS_lighty'] = conf.env['CCFLAGS'] + common_ccflags + lighty_common_ccflags
conf.env['CCFLAGS_lightymod'] = conf.env['CCFLAGS'] + common_ccflags + [ '-DHAVE_CONFIG_H' ]
if not opts.debug:
conf.env['CCFLAGS'] += ['-O2']
if opts.static:
conf.env['LINKFLAGS_lighty'] += ['-static']
if sys.platform != 'darwin':
conf.env['LINKFLAGS_lighty'] += [ '-export-dynamic' ]
conf.env['LINKFLAGS_lightymod'] += [ '-module', '-export-dynamic', '-avoid-version', '-W,l-no-undefined' ]
else:
# OSX aka darwin needs special treatment
conf.env['shlib_PATTERN'] = 'lib%s.so'
conf.env['LINKFLAGS_lighty'] += ['-flat_namespace']
conf.env['LINKFLAGS_lightymod'] += ['-flat_namespace', '-undefined dynamic_lookup']
2008-07-08 16:51:03 +00:00
2008-11-20 23:31:44 +00:00
def build(bld):
env = bld.env
opts = Options.options
lighty = bld.new_task_gen('cc', 'program')
lighty.source = main_src + common_src
lighty.target = 'lighttpd' + opts.append
lighty.includes = '.'
lighty.uselib = common_uselib + ['ev', 'lighty']
#lighty.install_path = '${SOME_PATH}/bin'
lighty_mod(bld, 'mod_fortune', 'modules/mod_fortune.c')
lighty_mod(bld, 'mod_status', 'modules/mod_status.c')
lighty_mod(bld, 'mod_accesslog', 'modules/mod_accesslog.c')