You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lighttpd2/src/wscript

126 lines
2.9 KiB

#!/usr/bin/env python
14 years ago
# encoding: utf-8
"""
waf build script for Lighttpd 2.x
License and Copyright: see COPYING file
"""
14 years ago
import Options, sys
14 years ago
common_uselib = ['glib', 'gthread', 'gmodule']
common_ccflags = [
'-std=gnu99', '-Wall', '-g', '-Wshadow', '-W', '-pedantic'
]
common_src = '''
14 years ago
actions.c
angel.c
angel_fake.c
14 years ago
base.c
chunk.c
chunk_parser.c
collect.c
14 years ago
condition.c
condition_parsers.rl
14 years ago
config_parser.rl
connection.c
encoding.c
environment.c
14 years ago
etag.c
filter_chunked.c
http_headers.c
http_request_parser.rl
http_response_parser.rl
14 years ago
log.c
module.c
network.c
network_write.c network_writev.c
network_sendfile.c
14 years ago
options.c
plugin.c
plugin_core.c
profiler.c
request.c
response.c
server.c
stat_cache.c
14 years ago
sys-files.c
14 years ago
sys-socket.c
throttle.c
url_parser.rl
utils.c
value.c
virtualrequest.c
waitqueue.c
worker.c
14 years ago
'''
common_src_lua = '''
actions_lua.c
condition_lua.c
config_lua.c
value_lua.c
14 years ago
'''
main_src = '''
lighttpd.c
'''
14 years ago
lighty_common_ccflags = [
'-fPIC',
'-DHAVE_CONFIG_H', '-D_GNU_SOURCE',
'-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_LARGE_FILES',
# '-fno-strict-aliasing',
]
14 years ago
def lighty_mod(bld, target, src, uselib = [], option = ''):
if option and not getattr(Options.options, option):
return
mod = bld.new_task_gen('cc', 'shlib')
14 years ago
mod.target = target
mod.source = src
mod.uselib = ['lightymod'] + common_uselib + uselib
mod.ccflags = common_ccflags
14 years ago
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 + lighty_common_ccflags
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']
14 years ago
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'
14 years ago
lighty_mod(bld, 'mod_accesslog', 'modules/mod_accesslog.c')
lighty_mod(bld, 'mod_balancer', 'modules/mod_balancer.c')
lighty_mod(bld, 'mod_cache_disk_etag', 'modules/mod_cache_disk_etag.c')
lighty_mod(bld, 'mod_debug', 'modules/mod_debug.c')
14 years ago
lighty_mod(bld, 'mod_dirlist', 'modules/mod_dirlist.c')
lighty_mod(bld, 'mod_fastcgi', 'modules/mod_fastcgi.c')
14 years ago
lighty_mod(bld, 'mod_fortune', 'modules/mod_fortune.c')
lighty_mod(bld, 'mod_status', 'modules/mod_status.c')
lighty_mod(bld, 'mod_vhost', 'modules/mod_vhost.c')