blob: df23de9be409e6a1b06d53d0da05c7441fb2ca26 [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
Junxiao Shi2222a612015-06-06 08:01:38 -07004def configure(conf):
Davide Pesavento3347eaa2019-01-16 18:41:46 -05005 conf.check_cfg(package='libpcap', uselib_store='PCAP',
6 path='pcap-config', args='--libs --cflags')
Davide Pesavento7b9837b2019-02-23 19:07:50 -05007 conf.check_cxx(msg='Checking if struct tcphdr has member th_off ',
8 define_name='HAVE_BSD_TCPHDR', mandatory=False,
9 fragment='''#include <netinet/tcp.h>
10 int main() { tcphdr th; th.th_off; }''')
11 conf.check_cxx(msg='Checking if struct udphdr has member uh_ulen',
12 define_name='HAVE_BSD_UDPHDR', mandatory=False,
13 fragment='''#include <netinet/udp.h>
14 int main() { udphdr uh; uh.uh_ulen; }''')
Junxiao Shi2222a612015-06-06 08:01:38 -070015
16def build(bld):
Alexander Afanasyev20c85cb2018-03-09 17:50:14 -050017 bld.objects(
18 target='dump-objects',
Junxiao Shi2713a3b2015-06-22 16:19:05 -070019 source=bld.path.ant_glob('*.cpp', excl='main.cpp'),
Alexander Afanasyev20c85cb2018-03-09 17:50:14 -050020 use='core-objects PCAP')
Junxiao Shi2713a3b2015-06-22 16:19:05 -070021
Alexander Afanasyev20c85cb2018-03-09 17:50:14 -050022 bld.program(
Junxiao Shi2713a3b2015-06-22 16:19:05 -070023 target='../../bin/ndndump',
Alexander Afanasyev20c85cb2018-03-09 17:50:14 -050024 name='ndndump',
Junxiao Shi2713a3b2015-06-22 16:19:05 -070025 source='main.cpp',
26 use='dump-objects')