1#!/bin/csh 2# 3# check that all major header files can be #include'd 4# singly with various combinations of _KERNEL, _KERNEL_STRUCTURES, and 5# userland access. 6# 7# The goal is that the only error reported should be a specific #error 8# indicating that particular support is not available. 9# 10# $DragonFly: src/test/debug/chkincludes,v 1.2 2006/10/24 17:09:46 swildner Exp $ 11 12cd /usr/src/sys 13set files = ( sys/*.h vm/*.h net*/*.h ddb/*.h i386/include/*.h ) 14rm -rf /tmp/chkdir 15mkdir /tmp/chkdir 16cd /tmp/chkdir 17 18awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/kern/device_if.m 19awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/kern/bus_if.m 20awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/dev/netif/mii_layer/miibus_if.m 21awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/ppbus/ppbus_if.m 22awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/pccard/card_if.m 23awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/pccard/power_if.m 24awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/dev/agp/agp_if.m 25awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/pci/pci_if.m 26awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/pci/pcib_if.m 27awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/usb/usb_if.m 28awk -f /usr/src/sys/tools/makeobjops.awk -- -h /usr/src/sys/bus/isa/isa_if.m 29 30echo -n > opt_cam.h 31echo -n > opt_scsi.h 32echo -n > opt_ktr.h 33echo -n > opt_icmp_bandlim.h 34echo "#define INET 1" > opt_inet.h 35 36ln -s /usr/src/sys/arch/i386/include machine 37 38foreach 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 45 46 cat > chkincl.c << EOF 47#include <$i> 48EOF 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 51end 52foreach 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 59 60 cat > chkincl.c << EOF 61#include <$i> 62EOF 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 65end 66 67foreach 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 74 75 cat > chkincl.c << EOF 76#include <$i> 77EOF 78 echo "TRY $i (USER)" 79 cc -fno-builtin -I/usr/src/sys -I. -Wall -Wstrict-prototypes -c chkincl.c -o chkincl.o 80end 81 82