1#!/bin/sh
2if grep -q "m_drops" /usr/include/sys/mbuf.h; then
3    echo "#define HAS_MBUF_MDROPS	1"
4else
5    echo "#undef HAS_MBUF_MDROPS"
6fi
7if grep -q "sf_allocfail" /usr/include/sys/mbuf.h; then
8    echo "#define HAS_MBUF_SFALLOCFAIL	1"
9else
10    echo "#undef HAS_MBUF_SFALLOCFAIL"
11fi
12if ! grep -q "VM_TOTAL" /usr/include/vm/vm_param.h; then
13    echo "#define VM_TOTAL VM_METER"
14fi
15if grep -q "struct xswdev" /usr/include/vm/vm_param.h; then
16    echo "#define HAS_XSWDEV		1"
17else
18    echo "#undef HAS_XSWDEV"
19fi
20if [ -f /usr/include/net/pfvar.h ]; then
21    echo "#define HAS_PFVAR_H		1"
22else
23    echo "#undef HAS_PFVAR_H"
24fi
25if grep -q "ki_paddr" /usr/include/sys/user.h; then
26    echo "#define HAS_KI_PADDR		1"
27else
28    echo "#undef HAS_KI_PADDR"
29fi
30if grep -q "struct rusage_ext" /usr/include/sys/proc.h; then
31    echo "#define HAS_RUSAGE_EXT	1"
32else
33    echo "#undef HAS_RUSAGE_EXT"
34fi
35if grep -q "CPUSTATES" /usr/include/sys/resource.h; then
36    echo "#define HAS_RESOURCE_CPUSTATE	1"
37else
38    echo "#undef HAS_RESOURCE_CPUSTATE"
39fi
40if grep -q "IOCATAREQUEST" /usr/include/sys/ata.h; then
41    echo "#define HAS_IOCATAREQUEST	1"
42else
43    echo "#undef HAS_IOCATAREQUEST"
44fi
45if grep -q "ATA_SMART_CMD" /usr/include/sys/ata.h; then
46    echo "#define HAS_ATA_SMART_CMD	1"
47else
48    echo "#undef HAS_ATA_SMART_CMD"
49fi
50if sysctl kern.cp_times >/dev/null 2>&1; then
51    echo "#define HAS_CP_TIMES		1"
52else
53    echo "#undef HAS_CP_TIMES"
54fi
55