Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 68 lines (60 sloc) 1.783 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from waflib import Utils, Options
from waflib.Build import BuildContext
from waflib.Scripting import Dist

APPNAME='zerogw'
VERSION='0.5.9'

top = '.'
out = 'build'

def options(opt):
    opt.load('compiler_c')
    opt.recurse('libwebsite')
    opt.recurse('coyaml')

def configure(conf):
    conf.load('compiler_c')
    conf.recurse('libwebsite')
    conf.recurse('coyaml')

def build(bld):
    bld.recurse('libwebsite')
    bld.recurse('coyaml')
    bld.add_group()
    bld(
        features = ['c', 'cprogram'],
        source = [
            'src/config.c',
            'src/main.c',
            'src/log.c',
            'src/websocket.c',
            'src/sieve.c',
            'src/zutils.c',
            'src/http.c',
            'src/resolve.c',
            'src/uidgen.c',
            'src/request.c',
            'src/polling.c',
            'src/disk.c',
            'src/commands.c',
            'src/pool.c',
            'src/msgqueue.c',
            ],
        target = 'zerogw',
        includes = ['src', 'libev', 'libwebsite/include', 'libyaml/include', 'coyaml/include'],
        libpath = ['libyaml', 'libwebsite'],
        defines = [
            'LOG_STRIP_PATH="../src/"',
            ],
        cflags = ['-std=c99'],
        lib = ['zmq', 'ssl', 'coyaml', 'website', 'ev', 'yaml'],
        )

    if bld.env['PREFIX'] == '/usr':
        bld.install_files('/etc', ['examples/zerogw.yaml'])
    else:
        bld.install_files('${PREFIX}/etc', ['examples/zerogw.yaml'])

def dist(ctx):
    ctx.excl = [
        'doc/_build/**',
        '.waf*', '*.tar.bz2', '*.zip', 'build',
        '.git*', '.lock*', '**/*.pyc', '**/*.swp', '**/*~'
        ]
    ctx.algo = 'tar.bz2'
Something went wrong with that request. Please try again.