Junxiao Shi | 2222a61 | 2015-06-06 08:01:38 -0700 | [diff] [blame] | 1 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | top = '../..' |
| 3 | |
Junxiao Shi | 2222a61 | 2015-06-06 08:01:38 -0700 | [diff] [blame] | 4 | def configure(conf): |
Davide Pesavento | 3347eaa | 2019-01-16 18:41:46 -0500 | [diff] [blame] | 5 | conf.check_cfg(package='libpcap', uselib_store='PCAP', |
| 6 | path='pcap-config', args='--libs --cflags') |
Davide Pesavento | 7b9837b | 2019-02-23 19:07:50 -0500 | [diff] [blame] | 7 | 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 Shi | 2222a61 | 2015-06-06 08:01:38 -0700 | [diff] [blame] | 15 | |
| 16 | def build(bld): |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 17 | bld.objects( |
| 18 | target='dump-objects', |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 19 | source=bld.path.ant_glob('*.cpp', excl='main.cpp'), |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 20 | use='core-objects PCAP') |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 21 | |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 22 | bld.program( |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 23 | target='../../bin/ndndump', |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 24 | name='ndndump', |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 25 | source='main.cpp', |
| 26 | use='dump-objects') |