blob: 397a0761ed0e625db6a0d2272af498a81aa5d9c9 [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 Pesavento003e45a2023-04-25 15:25:03 -04005 conf.check_cfg(msg='Checking for libpcap',
6 path='pcap-config', args='--cflags --libs',
7 package='', uselib_store='PCAP')
Davide Pesavento7b9837b2019-02-23 19:07:50 -05008 conf.check_cxx(msg='Checking if struct tcphdr has member th_off ',
9 define_name='HAVE_BSD_TCPHDR', mandatory=False,
10 fragment='''#include <netinet/tcp.h>
11 int main() { tcphdr th; th.th_off; }''')
12 conf.check_cxx(msg='Checking if struct udphdr has member uh_ulen',
13 define_name='HAVE_BSD_UDPHDR', mandatory=False,
14 fragment='''#include <netinet/udp.h>
15 int main() { udphdr uh; uh.uh_ulen; }''')
Junxiao Shi2222a612015-06-06 08:01:38 -070016
17def build(bld):
Alexander Afanasyev20c85cb2018-03-09 17:50:14 -050018 bld.objects(
19 target='dump-objects',
Junxiao Shi2713a3b2015-06-22 16:19:05 -070020 source=bld.path.ant_glob('*.cpp', excl='main.cpp'),
Alexander Afanasyev20c85cb2018-03-09 17:50:14 -050021 use='core-objects PCAP')
Junxiao Shi2713a3b2015-06-22 16:19:05 -070022
Alexander Afanasyev20c85cb2018-03-09 17:50:14 -050023 bld.program(
Junxiao Shi2713a3b2015-06-22 16:19:05 -070024 target='../../bin/ndndump',
Alexander Afanasyev20c85cb2018-03-09 17:50:14 -050025 name='ndndump',
Junxiao Shi2713a3b2015-06-22 16:19:05 -070026 source='main.cpp',
27 use='dump-objects')