blob: 946b296755541a2a508c65e752d71118892c4e7b [file] [log] [blame]
Junxiao Shi2222a612015-06-06 08:01:38 -07001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2top = '../..'
3
4ATTRIBUTE_CHECK='''
5#include <stdlib.h>
6
7static void foo(void) __attribute__ ((noreturn));
8
9static void
10foo(void)
11{
12 exit(1);
13}
14
15int
16main(int argc, char** argv)
17{
18 foo();
19}
20'''
21
22def configure(conf):
23 conf.check(header_name="inttypes.h", mandatory=False)
24 conf.check(header_name="stdint.h", mandatory=False)
25 conf.check(header_name="sys/bitypes.h", mandatory=False)
26 conf.check(fragment=ATTRIBUTE_CHECK, msg="Checking for __attribute__", mandatory=False)
27
Davide Pesavento89d91752016-08-14 11:34:09 +020028 conf.check(header_name=["sys/types.h", "sys/time.h", "time.h"],
29 define="TIME_WITH_SYS_TIME", mandatory=False)
Junxiao Shi2222a612015-06-06 08:01:38 -070030
31 conf.check_cfg(path='pcap-config',
32 package="libpcap", args=['--libs', '--cflags'],
33 uselib_store='PCAP', mandatory=True)
34
35def build(bld):
Junxiao Shi2713a3b2015-06-22 16:19:05 -070036 bld(features='cxx',
37 name='dump-objects',
38 source=bld.path.ant_glob('*.cpp', excl='main.cpp'),
Junxiao Shi2222a612015-06-06 08:01:38 -070039 includes='.',
Junxiao Shi2713a3b2015-06-22 16:19:05 -070040 export_includes='.',
Davide Pesavento89d91752016-08-14 11:34:09 +020041 use='core-objects BOOST PCAP')
Junxiao Shi2713a3b2015-06-22 16:19:05 -070042
43 bld(features='cxx cxxprogram',
44 target='../../bin/ndndump',
45 source='main.cpp',
46 use='dump-objects')