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 | 003e45a | 2023-04-25 15:25:03 -0400 | [diff] [blame^] | 5 | conf.check_cfg(msg='Checking for libpcap', |
| 6 | path='pcap-config', args='--cflags --libs', |
| 7 | package='', uselib_store='PCAP') |
Davide Pesavento | 7b9837b | 2019-02-23 19:07:50 -0500 | [diff] [blame] | 8 | 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 Shi | 2222a61 | 2015-06-06 08:01:38 -0700 | [diff] [blame] | 16 | |
| 17 | def build(bld): |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 18 | bld.objects( |
| 19 | target='dump-objects', |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 20 | source=bld.path.ant_glob('*.cpp', excl='main.cpp'), |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 21 | use='core-objects PCAP') |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 22 | |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 23 | bld.program( |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 24 | target='../../bin/ndndump', |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 25 | name='ndndump', |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 26 | source='main.cpp', |
| 27 | use='dump-objects') |