[waf] Add mod_deflate along with --with-zlib and --with-bzip options

Thomas Porzelt 13 years ago
parent 50d5c7af88
commit c73bb4cd85
  1. 14
  2. 19

@ -28,18 +28,28 @@ def configure(conf):
def build(bld):
env = bld.env
lighty_mod(bld, 'mod_access', 'mod_access.c')
lighty_mod(bld, 'mod_accesslog', 'mod_accesslog.c')
lighty_mod(bld, 'mod_auth', 'mod_auth.c')
lighty_mod(bld, 'mod_balancer', 'mod_balancer.c')
lighty_mod(bld, 'mod_cache_disk_etag', 'mod_cache_disk_etag.c')
uselib = []
if env['HAVE_ZLIB'] == 1:
uselib += ['z']
if env['HAVE_BZIP'] == 1:
uselib += ['bz2']
if len(uselib) != 0:
lighty_mod(bld, 'mod_deflate', 'mod_deflate.c', uselib)
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')
if bld.env['USE_OPENSSL'] == 1:
lighty_mod(bld, 'mod_openssl', 'mod_openssl.c', uselib=['ssl','crypto'])
if env['USE_OPENSSL'] == 1:
uselib = ['ssl','crypto']
lighty_mod(bld, 'mod_openssl', 'mod_openssl.c', uselib)
lighty_mod(bld, 'mod_redirect', 'mod_redirect.c')
lighty_mod(bld, 'mod_rewrite', 'mod_rewrite.c')
lighty_mod(bld, 'mod_status', 'mod_status.c')

@ -29,6 +29,8 @@ def set_options(opt):
# ./waf configure options
opt.add_option('--with-lua', action='store_true', help='with lua 5.1 for mod_magnet', dest = 'lua', default = False)
opt.add_option('--with-openssl', action='store_true', help='with openssl-support [default: off]', dest='openssl', default=False)
opt.add_option('--with-zlib', action='store_true', help='with deflate/gzip-support [default: off]', dest='zlib', default=False)
opt.add_option('--with-bzip', action='store_true', help='with bzip2-support [default: off]', dest='bzip', default=False)
opt.add_option('--with-all', action='store_true', help='Enable all features', dest = 'all', default = False)
opt.add_option('--static', action='store_true', help='build a static lighttpd with all modules added', dest = 'static', default = False)
opt.add_option('--append', action='store', help='Append string to binary names / library dir', dest = 'append', default = '')
@ -84,6 +86,8 @@ def configure(conf):
if opts.all:
opts.lua = True
opts.openssl = True
opts.zlib = True
opts.bzip = True
if not opts.debug:
conf.env['CCFLAGS'] += ['-O2']
@ -126,6 +130,18 @@ def configure(conf):
conf.check(function_name='SSL_new', header_name='openssl/ssl.h', uselib='ssl', mandatory=True)
conf.define('USE_OPENSSL', 1)
if opts.zlib:
conf.check(lib='z', uselib_store='z', mandatory=True)
conf.check(header_name='zlib.h', uselib='z', mandatory=True)
conf.check(function_name='deflate', header_name='zlib.h', uselib='z', mandatory=True)
conf.define('HAVE_ZLIB', 1)
if opts.bzip:
conf.check(lib='bz2', uselib_store='bz2', mandatory=True)
conf.check(header_name='bzlib.h', uselib='bz2', mandatory=True)
conf.check(function_name='BZ2_bzCompressInit', header_name='bzlib.h', uselib='bz2', mandatory=True)
conf.define('HAVE_BZIP', 1)
if not opts.static:
conf.check(lib='dl', uselib_store='dl')
@ -176,7 +192,8 @@ def configure(conf):
print_summary(conf, 'Build static binary', 'yes' if opts.static else 'no', 'YELLOW' if opts.static else 'GREEN')
print_summary(conf, 'Build debug binary', 'yes' if opts.debug else 'no', 'YELLOW' if opts.debug else 'GREEN')
print_summary(conf, 'With lua support', 'yes' if opts.lua else 'no', 'GREEN' if opts.lua else 'YELLOW')
print_summary(conf, 'With ssl support', 'yes' if opts.openssl else 'no', 'GREEN' if opts.openssl else 'YELLOW')
print_summary(conf, 'With deflate/gzip support', 'yes' if opts.zlib else 'no', 'GREEN' if opts.zlib else 'YELLOW')
print_summary(conf, 'With bzip2 support', 'yes' if opts.bzip else 'no', 'GREEN' if opts.bzip else 'YELLOW')
def build(bld):