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 | |
| 4 | ATTRIBUTE_CHECK=''' |
| 5 | #include <stdlib.h> |
| 6 | |
| 7 | static void foo(void) __attribute__ ((noreturn)); |
| 8 | |
| 9 | static void |
| 10 | foo(void) |
| 11 | { |
| 12 | exit(1); |
| 13 | } |
| 14 | |
| 15 | int |
| 16 | main(int argc, char** argv) |
| 17 | { |
| 18 | foo(); |
| 19 | } |
| 20 | ''' |
| 21 | |
| 22 | def configure(conf): |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 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) |
Junxiao Shi | 2222a61 | 2015-06-06 08:01:38 -0700 | [diff] [blame] | 27 | |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 28 | conf.check(header_name=['sys/types.h', 'sys/time.h', 'time.h'], |
| 29 | define='TIME_WITH_SYS_TIME', mandatory=False) |
Junxiao Shi | 2222a61 | 2015-06-06 08:01:38 -0700 | [diff] [blame] | 30 | |
| 31 | conf.check_cfg(path='pcap-config', |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 32 | package='libpcap', args=['--libs', '--cflags'], |
Junxiao Shi | 2222a61 | 2015-06-06 08:01:38 -0700 | [diff] [blame] | 33 | uselib_store='PCAP', mandatory=True) |
| 34 | |
| 35 | def build(bld): |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 36 | bld.objects( |
| 37 | target='dump-objects', |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 38 | source=bld.path.ant_glob('*.cpp', excl='main.cpp'), |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 39 | use='core-objects PCAP') |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 40 | |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 41 | bld.program( |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 42 | target='../../bin/ndndump', |
Alexander Afanasyev | 20c85cb | 2018-03-09 17:50:14 -0500 | [diff] [blame] | 43 | name='ndndump', |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 44 | source='main.cpp', |
| 45 | use='dump-objects') |