# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
top = '../..'

ATTRIBUTE_CHECK='''
#include <stdlib.h>

static void foo(void) __attribute__ ((noreturn));

static void
foo(void)
{
  exit(1);
}

int
main(int argc, char** argv)
{
  foo();
}
'''

def configure(conf):
    conf.check(header_name="inttypes.h", mandatory=False)
    conf.check(header_name="stdint.h", mandatory=False)
    conf.check(header_name="sys/bitypes.h", mandatory=False)
    conf.check(fragment=ATTRIBUTE_CHECK, msg="Checking for __attribute__", mandatory=False)

    conf.check(header_name=["sys/types.h", "sys/time.h", "time.h"],
               define="TIME_WITH_SYS_TIME", mandatory=False)

    conf.check_cfg(path='pcap-config',
                   package="libpcap", args=['--libs', '--cflags'],
                   uselib_store='PCAP', mandatory=True)

def build(bld):
    bld(features='cxx',
        name='dump-objects',
        source=bld.path.ant_glob('*.cpp', excl='main.cpp'),
        includes='.',
        export_includes='.',
        use='core-objects BOOST PCAP')

    bld(features='cxx cxxprogram',
        target='../../bin/ndndump',
        source='main.cpp',
        use='dump-objects')
