#! /usr/bin/env python2
# encoding: utf-8

def configure(conf):
    conf.env.LIB_BOOST = [
        'pthread',
        'boost_system',
        'boost_program_options',
        'boost_log_setup',
        'boost_log',
        'boost_thread',
        'boost_timer',
        'boost_filesystem',
    ]
    conf.env.LIB_UDNS = ['udns']
    conf.env.LIB_SYSTEMD = ['systemd']
    conf.env.LINKFLAGS_UNBOUND = '-Wl,-Bstatic'
    conf.env.LIB_RT = ['rt']
    conf.env.LIBPATH_BOOST = ['/usr/lib/x86_64-linux-gnu']

def build(bld):
    # 1. A simple c++ program
    bld(
        features='cxx cprogram',
        source='fastproxy.cpp channel.cpp session.cpp resolver.cpp proxy.cpp statistics.cpp stat_sess.cpp signal.cpp',
        target='fastproxy',
        uselib='BOOST UDNS RT SYSTEMD',
    )
    bld.install_dir('/var/log/fastproxy')
