Skip to content

Commit

Permalink
[waf] Reenable waf and update to 1.5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Porzelt committed Aug 18, 2009
1 parent 96123d0 commit 8b7ea63
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 10 deletions.
35 changes: 35 additions & 0 deletions src/angel/wscript
@@ -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')
34 changes: 34 additions & 0 deletions src/common/wscript
@@ -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')
77 changes: 77 additions & 0 deletions src/main/wscript
@@ -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')
42 changes: 42 additions & 0 deletions src/modules/wscript
@@ -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')
Binary file modified waf
Binary file not shown.
39 changes: 29 additions & 10 deletions wscript
Expand Up @@ -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('--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) opt.add_option('--extra-warnings', action='store_true', help='show more warnings while compiling', dest='extra_warnings', default=False)



def configure(conf): def configure(conf):
opts = Options.options opts = Options.options


conf.check_message_2('The waf build system has been disabled, please use cmake for the time being.', 'RED') #conf.check_message_2('The waf build system has been disabled, please use cmake for the time being.', 'RED')
sys.exit(1) #sys.exit(1)


conf.define('APPNAME', APPNAME) conf.define('APPNAME', APPNAME)
conf.define('VERSION', VERSION) conf.define('VERSION', VERSION)
Expand All @@ -44,6 +45,21 @@ def configure(conf):
conf.check_tool('ragel', tooldir = '.') conf.check_tool('ragel', tooldir = '.')


conf.env['CCFLAGS'] = tolist(conf.env['CCFLAGS']) 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 # check for available libraries
conf.check_cfg(package='glib-2.0', uselib_store='glib', atleast_version='2.16', args='--cflags --libs', mandatory=True) conf.check_cfg(package='glib-2.0', uselib_store='glib', atleast_version='2.16', args='--cflags --libs', mandatory=True)
Expand All @@ -60,7 +76,7 @@ def configure(conf):


if opts.extra_warnings: if opts.extra_warnings:
conf.env['CCFLAGS'] += [ conf.env['CCFLAGS'] += [
'-g', '-g2', '-Wall', '-Wmissing-declarations', '-g', '-g2', '-Wmissing-declarations',
'-Wdeclaration-after-statement', '-Wno-pointer-sign', '-Wcast-align', '-Winline', '-Wsign-compare', '-Wdeclaration-after-statement', '-Wno-pointer-sign', '-Wcast-align', '-Winline', '-Wsign-compare',
'-Wnested-externs', '-Wpointer-arith'#, '-Werror', '-Wbad-function-cast', '-Wmissing-prototypes' '-Wnested-externs', '-Wpointer-arith'#, '-Werror', '-Wbad-function-cast', '-Wmissing-prototypes'
] ]
Expand Down Expand Up @@ -106,11 +122,12 @@ def configure(conf):
conf.check(function_name='pathconf', header_name='unistd.h', define_name='HAVE_PATHCONF') 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.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/common')

conf.sub_config('src/angel')
conf.sub_config('src') conf.sub_config('src/main')
conf.sub_config('src/modules')


conf.define('LIGHTTPD_VERSION_ID', 20000) conf.define('LIGHTTPD_VERSION_ID', 20000)
conf.define('PACKAGE_NAME', APPNAME) conf.define('PACKAGE_NAME', APPNAME)
Expand All @@ -127,7 +144,7 @@ def configure(conf):


Utils.pprint('WHITE', '----------------------------------------') Utils.pprint('WHITE', '----------------------------------------')
Utils.pprint('BLUE', 'Summary:') 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: if revno:
print_summary(conf, 'Revision', revno) print_summary(conf, 'Revision', revno)
print_summary(conf, 'Using glib version', glib_version) print_summary(conf, 'Using glib version', glib_version)
Expand All @@ -138,8 +155,10 @@ def configure(conf):




def build(bld): 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'): def print_summary(conf, msg, result, color = 'GREEN'):
conf.check_message_1(msg) conf.check_message_1(msg)
Expand Down

0 comments on commit 8b7ea63

Please sign in to comment.