## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-

srcdir = '.'
blddir = 'build'

from heapq import merge

def set_options(opt):
    opt.tool_options('compiler_cc')

def configure(conf):
    conf.check_tool('compiler_cc')

def build(bld):
    # Build the OpenFlow C static library from the software implementation distribution
    of = bld.new_task_gen('cc', 'cstaticlib')
    of.source = list(merge(bld.glob('/switch/*.c'), bld.glob('/lib/*.c')))
    of.includes = [
	'.',
	'..',
	'include/.',
	'include/openflow/.',
	'lib/.',
	'switch/.',
	'/usr/include/libxml2',
    ]
    of.env.append_value('CCFLAGS', '-fPIC')
    of.target = 'openflow'