Permalink
Browse files

[waf] Reenable waf and update to 1.5.8

  • Loading branch information...
1 parent 96123d0 commit 8b7ea63cf9710f25ae9d93b21ad7efc2871dd925 Thomas Porzelt committed Aug 18, 2009
Showing with 217 additions and 10 deletions.
  1. +35 −0 src/angel/wscript
  2. +34 −0 src/common/wscript
  3. +77 −0 src/main/wscript
  4. +42 −0 src/modules/wscript
  5. BIN waf
  6. +29 −10 wscript
View
@@ -0,0 +1,35 @@
+
+#!/usr/bin/env python
+# encoding: utf-8
+
+"""
+waf build script for Lighttpd 2.x
+License and Copyright: see COPYING file
+"""
+
+import Options, sys
+
+source = '''
+ angel_config_parser.rl
+ angel_log.c
+ angel_main.c
+ angel_plugin.c
+ angel_plugin_core.c
+ angel_proc.c
+ angel_server.c
+ angel_value.c
+'''
+
+def configure(conf):
+ opts = Options.options
+ pass
+
+
+def build(bld):
+ libcommon = bld.new_task_gen(
+ features = 'cc cprogram',
+ source = source,
+ defines = ['HAVE_CONFIG_H=1'],
+ uselib = ['glib', 'gthread', 'gmodule', 'ev'],
+ uselib_local = ['common'],
+ target = 'lighttpd-angel')
View
@@ -0,0 +1,34 @@
+
+#!/usr/bin/env python
+# encoding: utf-8
+
+"""
+waf build script for Lighttpd 2.x
+License and Copyright: see COPYING file
+"""
+
+import Options, sys, Utils
+
+source = '''
+ angel_connection.c
+ angel_data.c
+ encoding.c
+ idlist.c
+ ip_parsers.rl
+ module.c
+ radix.c
+ utils.c
+ waitqueue.c
+'''
+
+def configure(conf):
+ opts = Options.options
+ pass
+
+
+def build(bld):
+ libcommon = bld.new_task_gen(
+ features = 'cc cstaticlib',
+ source = source,
+ uselib = ['glib', 'gthread', 'gmodule', 'ev'],
+ target = 'common')
View
@@ -0,0 +1,77 @@
+
+#!/usr/bin/env python
+# encoding: utf-8
+
+"""
+waf build script for Lighttpd 2.x
+License and Copyright: see COPYING file
+"""
+
+import Options, sys
+
+source = '''
+ actions.c
+ angel.c
+ angel_fake.c
+ chunk.c
+ chunk_parser.c
+ collect.c
+ condition.c
+ config_parser.rl
+ connection.c
+ environment.c
+ etag.c
+ filter_chunked.c
+ http_headers.c
+ http_request_parser.rl
+ http_response_parser.rl
+ lighttpd-glue.c
+ lighttpd.c
+ log.c
+ network.c
+ network_sendfile.c
+ network_write.c
+ network_writev.c
+ options.c
+ plugin.c
+ plugin_core.c
+ profiler.c
+ request.c
+ response.c
+ server.c
+ stat_cache.c
+ throttle.c
+ url_parser.rl
+ value.c
+ virtualrequest.c
+ worker.c
+'''
+
+def configure(conf):
+ global source
+
+ opts = Options.options
+
+ if opts.lua:
+ source += '''
+ actions_lua.c
+ condition_lua.c
+ config_lua.c
+ value_lua.c
+ '''
+
+
+def build(bld):
+ opts = Options.options
+ libs = ['glib', 'gthread', 'gmodule', 'ev']
+
+ if opts.lua:
+ libs += ['lua']
+
+ libcommon = bld.new_task_gen(
+ features = 'cc cprogram',
+ source = source,
+ defines = ['HAVE_CONFIG_H=1'],
+ uselib = libs,
+ uselib_local = ['common'],
+ target = 'lighttpd')
View
@@ -0,0 +1,42 @@
+
+#!/usr/bin/env python
+# encoding: utf-8
+
+"""
+waf build script for Lighttpd 2.x
+License and Copyright: see COPYING file
+"""
+
+import Options, sys
+
+def lighty_mod(bld, target, src, uselib = [], option = ''):
+ if option and not getattr(Options.options, option):
+ return
+
+ mod = bld.new_task_gen(
+ features = 'cc cshlib',
+ target = target,
+ source = src,
+ defines = ['HAVE_CONFIG_H=1'],
+ uselib = ['glib', 'gthread', 'gmodule', 'ev', 'lighty_mod'],
+ uselib_local = ['common'])
+
+
+def configure(conf):
+ pass
+
+
+def build(bld):
+ lighty_mod(bld, 'mod_access', 'mod_access.c')
+ lighty_mod(bld, 'mod_accesslog', 'mod_accesslog.c')
+ lighty_mod(bld, 'mod_balancer', 'mod_balancer.c')
+ lighty_mod(bld, 'mod_cache_disk_etag', 'mod_cache_disk_etag.c')
+ lighty_mod(bld, 'mod_debug', 'mod_debug.c')
+ lighty_mod(bld, 'mod_dirlist', 'mod_dirlist.c')
+ lighty_mod(bld, 'mod_expire', 'mod_expire.c')
+ lighty_mod(bld, 'mod_fastcgi', 'mod_fastcgi.c')
+ lighty_mod(bld, 'mod_fortune', 'mod_fortune.c')
+ lighty_mod(bld, 'mod_redirect', 'mod_redirect.c')
+ lighty_mod(bld, 'mod_rewrite', 'mod_rewrite.c')
+ lighty_mod(bld, 'mod_status', 'mod_status.c')
+ lighty_mod(bld, 'mod_vhost', 'mod_vhost.c')
View
BIN waf
Binary file not shown.
View
39 wscript
@@ -31,11 +31,12 @@ def set_options(opt):
opt.add_option('--debug', action='store_true', help='Do not compile with -O2', dest = 'debug', default = False)
opt.add_option('--extra-warnings', action='store_true', help='show more warnings while compiling', dest='extra_warnings', default=False)
+
def configure(conf):
opts = Options.options
- conf.check_message_2('The waf build system has been disabled, please use cmake for the time being.', 'RED')
- sys.exit(1)
+ #conf.check_message_2('The waf build system has been disabled, please use cmake for the time being.', 'RED')
+ #sys.exit(1)
conf.define('APPNAME', APPNAME)
conf.define('VERSION', VERSION)
@@ -44,6 +45,21 @@ def configure(conf):
conf.check_tool('ragel', tooldir = '.')
conf.env['CCFLAGS'] = tolist(conf.env['CCFLAGS'])
+ conf.env['CCFLAGS'] += [
+ '-std=gnu99', '-Wall', '-Wshadow', '-W', '-pedantic', '-fPIC',
+ '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_LARGE_FILES',
+# '-fno-strict-aliasing',
+ ]
+
+ if sys.platform != 'darwin':
+ conf.env['LINKFLAGS'] += [ '-export-dynamic' ]
+ conf.env['LINKFLAGS_lighty_mod'] += [ '-module', '-avoid-version', '-W,l-no-undefined' ]
+ else:
+ # OSX aka darwin needs special treatment
+ conf.env['shlib_PATTERN'] = 'lib%s.so'
+ conf.env['LINKFLAGS'] += ['-flat_namespace']
+ conf.env['LINKFLAGS_lighty_mod'] += ['-undefined', 'dynamic_lookup']
+
# check for available libraries
conf.check_cfg(package='glib-2.0', uselib_store='glib', atleast_version='2.16', args='--cflags --libs', mandatory=True)
@@ -60,7 +76,7 @@ def configure(conf):
if opts.extra_warnings:
conf.env['CCFLAGS'] += [
- '-g', '-g2', '-Wall', '-Wmissing-declarations',
+ '-g', '-g2', '-Wmissing-declarations',
'-Wdeclaration-after-statement', '-Wno-pointer-sign', '-Wcast-align', '-Winline', '-Wsign-compare',
'-Wnested-externs', '-Wpointer-arith'#, '-Werror', '-Wbad-function-cast', '-Wmissing-prototypes'
]
@@ -106,11 +122,12 @@ def configure(conf):
conf.check(function_name='pathconf', header_name='unistd.h', define_name='HAVE_PATHCONF')
conf.check(function_name='dirfd', header_name=['sys/types.h', 'dirent.h'], define_name='HAVE_DIRFD')
- conf.env['CPPPATH_lighty'] += [ '../include' ]
+ conf.env['CPPPATH'] += [ '../include' ]
- conf.env['CPPPATH_lightymod'] += [ '../include' ]
-
- conf.sub_config('src')
+ conf.sub_config('src/common')
+ conf.sub_config('src/angel')
+ conf.sub_config('src/main')
+ conf.sub_config('src/modules')
conf.define('LIGHTTPD_VERSION_ID', 20000)
conf.define('PACKAGE_NAME', APPNAME)
@@ -127,7 +144,7 @@ def configure(conf):
Utils.pprint('WHITE', '----------------------------------------')
Utils.pprint('BLUE', 'Summary:')
- print_summary(conf, 'Install Lighttpd/' + VERSION + ' in', conf.env['PREFIX'])
+ print_summary(conf, 'Install lighttpd/' + VERSION + ' in', conf.env['PREFIX'])
if revno:
print_summary(conf, 'Revision', revno)
print_summary(conf, 'Using glib version', glib_version)
@@ -138,8 +155,10 @@ def configure(conf):
def build(bld):
- bld.add_subdirs('src')
-
+ bld.add_subdirs('src/common')
+ bld.add_subdirs('src/angel')
+ bld.add_subdirs('src/main')
+ bld.add_subdirs('src/modules')
def print_summary(conf, msg, result, color = 'GREEN'):
conf.check_message_1(msg)

0 comments on commit 8b7ea63

Please sign in to comment.