* Fix a bug in runcmd() - the argv[] list was not NULL terminated.
[dragonfly.git] / test / debug / chkincludes
blobe41c4d2fcc00724f9d1cba1e5ab2382681d96426
1 #!/bin/csh
3 # check that all major header files can be #include'd
4 # singly with various combinations of _KERNEL, _KERNEL_STRUCTURES, and
5 # userland access.
7 # The goal is that the only error reported should be a specific #error
8 # indicating that particular support is not available.
10 # $DragonFly: src/test/debug/chkincludes,v 1.2 2006/10/24 17:09:46 swildner Exp $
12 cd /usr/src/sys
13 set files = ( sys/*.h vm/*.h net*/*.h ddb/*.h i386/include/*.h )
14 rm -rf /tmp/chkdir
15 mkdir /tmp/chkdir
16 cd /tmp/chkdir
18 awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/kern/device_if.m
19 awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/kern/bus_if.m
20 awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/dev/netif/mii_layer/miibus_if.m
21 awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/ppbus/ppbus_if.m
22 awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/pccard/card_if.m
23 awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/pccard/power_if.m
24 awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/dev/agp/agp_if.m
25 awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/pci/pci_if.m
26 awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/pci/pcib_if.m
27 awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/usb/usb_if.m
28 awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/isa/isa_if.m
30 echo -n > opt_cam.h
31 echo -n > opt_scsi.h
32 echo -n > opt_ktr.h
33 echo -n > opt_icmp_bandlim.h
34 echo "#define INET 1" > opt_inet.h
36 ln -s /usr/src/sys/arch/i386/include machine
38 foreach i ( $files )
39 if ( "$i" == "sys/syscall-hide.h" ) then
40 continue
41 endif
42 if ( "$i" == "sys/sysunion.h" ) then
43 continue
44 endif
46 cat > chkincl.c << EOF
47 #include <$i>
48 EOF
49 echo "TRY $i (_KERNEL)"
50 cc -D_KERNEL -DKLD_MODULE -fno-builtin -I/usr/src/sys -I. -Wall -Wstrict-prototypes -c chkincl.c -o chkincl.o
51 end
52 foreach i ( $files )
53 if ( "$i" == "sys/syscall-hide.h" ) then
54 continue
55 endif
56 if ( "$i" == "sys/sysunion.h" ) then
57 continue
58 endif
60 cat > chkincl.c << EOF
61 #include <$i>
62 EOF
63 echo "TRY $i (_KERNEL_STRUCTURES)"
64 cc -D_KERNEL_STRUCTURES -fno-builtin -I/usr/src/sys -I. -Wall -Wstrict-prototypes -c chkincl.c -o chkincl.o
65 end
67 foreach i ( $files )
68 if ( "$i" == "sys/syscall-hide.h" ) then
69 continue
70 endif
71 if ( "$i" == "sys/sysunion.h" ) then
72 continue
73 endif
75 cat > chkincl.c << EOF
76 #include <$i>
77 EOF
78 echo "TRY $i (USER)"
79 cc -fno-builtin -I/usr/src/sys -I. -Wall -Wstrict-prototypes -c chkincl.c -o chkincl.o
80 end