diff --git a/tools/build/test-includes/Makefile b/tools/build/test-includes/Makefile index 2c25e0fb32ce..5c45fd7daa4f 100644 --- a/tools/build/test-includes/Makefile +++ b/tools/build/test-includes/Makefile @@ -1,58 +1,61 @@ # # A number of header files in sys/* have, going back to 7th Edition Unix in # 1979, reqiured other files (like sys/types.h) to compile. Likewise the 4BSD # networking code has had prerequisites. However, going back to around the turn # of the century, other systems have made them be independently includable # (wide-spread header include protection post-dates 7th edition Unix by maybe 4 # or 5 years judging from netnews sources). Start down the path of making them # all independently includable by creating this test that fails buildworld when # they are not. # # The _foo.h files are excluded as they are internal-only headers and/or have # special requirements. Since the purpose of this is to allow autoconfig # programs to detect FreeBSD has different headers, omitting internal # headers cuts down on the noise w/o causing problems for the goal. # LIB= test-includes INTERNALLIB= This is a compile-only test MAN= HDRS!= (cd ${SRCTOP}/sys; ls sys/[!_]*.h | sort ; ls net*/[!_]*.h | sort) NO_PIC= yes # Some files have to be clean for extra defines too... CFLAGS.event.c= -D_WANT_KEVENT32 -D_WANT_FREEBSD11_KEVENT # We currently support C89 and newer compilers. Catch the odd little fussy # details like __inline that the header files must follow to support C89. CFLAGS+=-ansi +# Make sure we're pulling in headers from the src tree. +CFLAGS+=-I${SRCTOP}/sys + .include "badfiles.inc" .for h c in ${HDRS:@x@$x ${x:S,/,_,g:R}.c@} .if !${BADHDRS:M${h}} SRCS+= $c CLEANFILES+=$c $c: echo "#include <$h>" > ${.TARGET} .endif .endfor test-includes: lib${LIB}.a .PHONY # # Target to make the current known bad list. In general, this list should only # ever shrink and never grow. # .PHONY: badfiles.inc badfiles.inc: @(cd ${SRCTOP}/sys; \ echo "# DO NOT EDIT-- this file is automatically @""generated."; \ echo "BADHDRS= \\"; \ for i in ${HDRS}; do \ echo "#include <$$i>" | \ ${CC} ${CFLAGS} -xc - -c -o /dev/null 2> /dev/null || \ echo " $$i \\"; \ done; \ echo) > ${.CURDIR}/badfiles.inc .include diff --git a/tools/build/test-includes/badfiles.inc b/tools/build/test-includes/badfiles.inc index 1e5182e40911..2ed61c32aa4e 100644 --- a/tools/build/test-includes/badfiles.inc +++ b/tools/build/test-includes/badfiles.inc @@ -1,323 +1,306 @@ # DO NOT EDIT-- this file is automatically @generated. BADHDRS= \ sys/aac_ioctl.h \ sys/agpio.h \ sys/atomic_common.h \ sys/atomic_san.h \ sys/bio.h \ sys/bitstring.h \ sys/blist.h \ sys/buf.h \ sys/buf_ring.h \ sys/bus.h \ sys/bus_dma.h \ sys/bus_dma_internal.h \ sys/bus_san.h \ sys/busdma_bufalloc.h \ sys/caprights.h \ sys/cdrio.h \ sys/cfictl.h \ sys/conf.h \ sys/cons.h \ sys/copyright.h \ sys/counter.h \ sys/coverage.h \ sys/cpu.h \ sys/cpuctl.h \ sys/cpuset.h \ sys/devmap.h \ sys/disk_zone.h \ sys/domain.h \ sys/domainset.h \ sys/dtrace_bsd.h \ sys/dvdio.h \ sys/elf32.h \ sys/elf64.h \ sys/elf_common.h \ sys/elf_generic.h \ sys/eui64.h \ sys/eventhandler.h \ sys/eventvar.h \ sys/exec.h \ sys/extattr.h \ sys/fail.h \ sys/firmware.h \ sys/fnv_hash.h \ sys/font.h \ sys/gmon.h \ sys/gpio.h \ sys/gtaskqueue.h \ sys/hhook.h \ sys/iconv.h \ sys/imgact.h \ sys/imgact_aout.h \ sys/imgact_elf.h \ sys/interrupt.h \ sys/intr.h \ sys/ioctl_compat.h \ sys/iov.h \ sys/iov_schema.h \ sys/ipmi.h \ sys/jail.h \ sys/kdb.h \ sys/kernel.h \ sys/khelp.h \ sys/kobj.h \ sys/ksem.h \ sys/ktls.h \ - sys/ktrace.h \ sys/libkern.h \ sys/link_aout.h \ - sys/linker.h \ - sys/linker_set.h \ sys/lock.h \ sys/lock_profile.h \ sys/lockf.h \ sys/lockmgr.h \ sys/loginclass.h \ sys/mbuf.h \ sys/md4.h \ - sys/md5.h \ sys/mdioctl.h \ sys/memdesc.h \ sys/memrange.h \ sys/module.h \ sys/module_khelp.h \ sys/mpt_ioctl.h \ sys/msgbuf.h \ - sys/mutex.h \ sys/namei.h \ sys/osd.h \ sys/pciio.h \ sys/pctrie.h \ sys/physmem.h \ sys/pipe.h \ sys/pmckern.h \ sys/posix4.h \ sys/power.h \ sys/priority.h \ sys/prng.h \ sys/qmath.h \ sys/racct.h \ sys/resourcevar.h \ sys/rman.h \ sys/rmlock.h \ sys/rtprio.h \ sys/runq.h \ sys/rwlock.h \ sys/sbuf.h \ - sys/sema.h \ sys/sf_buf.h \ sys/sglist.h \ sys/sigio.h \ sys/signalvar.h \ sys/smr.h \ sys/smr_types.h \ sys/socketvar.h \ sys/sockopt.h \ sys/stack.h \ sys/stats.h \ - sys/sx.h \ sys/syscallsubr.h \ sys/syslimits.h \ - sys/systm.h \ sys/taskqueue.h \ sys/terminal.h \ sys/termios.h \ sys/tiio.h \ sys/timeb.h \ sys/timeet.h \ sys/timeffc.h \ sys/timepps.h \ sys/timetc.h \ sys/ttydevsw.h \ sys/ttydisc.h \ sys/ttyhook.h \ sys/ttyqueue.h \ sys/umtx.h \ sys/unpcb.h \ sys/user.h \ sys/vdso.h \ sys/vmmeter.h \ sys/vnode.h \ net/bpf.h \ net/bpf_buffer.h \ net/bpf_jitter.h \ net/bpf_zerocopy.h \ net/bpfdesc.h \ net/debugnet_int.h \ net/firewire.h \ net/if_arp.h \ net/if_dl.h \ net/if_enc.h \ net/if_lagg.h \ net/if_llatbl.h \ net/if_llc.h \ net/if_media.h \ net/if_mib.h \ - net/if_pfsync.h \ net/if_tap.h \ net/if_tun.h \ net/if_var.h \ net/if_vlan_var.h \ net/iflib.h \ - net/iflib_private.h \ net/ifq.h \ net/mp_ring.h \ net/mppc.h \ net/netisr.h \ net/netisr_internal.h \ net/netmap.h \ net/netmap_legacy.h \ net/paravirt.h \ net/pfil.h \ net/pfkeyv2.h \ - net/pfvar.h \ net/radix.h \ - net/raw_cb.h \ net/rndis.h \ net/route.h \ net/rss_config.h \ net/slcompress.h \ net/toeplitz.h \ net80211/ieee80211.h \ net80211/ieee80211_action.h \ net80211/ieee80211_adhoc.h \ net80211/ieee80211_ageq.h \ net80211/ieee80211_alq.h \ net80211/ieee80211_amrr.h \ net80211/ieee80211_crypto.h \ net80211/ieee80211_dfs.h \ net80211/ieee80211_freebsd.h \ net80211/ieee80211_hostap.h \ net80211/ieee80211_ht.h \ net80211/ieee80211_input.h \ net80211/ieee80211_ioctl.h \ net80211/ieee80211_mesh.h \ net80211/ieee80211_monitor.h \ net80211/ieee80211_node.h \ net80211/ieee80211_power.h \ net80211/ieee80211_proto.h \ net80211/ieee80211_radiotap.h \ net80211/ieee80211_ratectl.h \ net80211/ieee80211_rssadapt.h \ net80211/ieee80211_scan.h \ net80211/ieee80211_scan_sw.h \ net80211/ieee80211_sta.h \ net80211/ieee80211_superg.h \ net80211/ieee80211_tdma.h \ net80211/ieee80211_var.h \ net80211/ieee80211_vht.h \ net80211/ieee80211_wds.h \ netgraph/netgraph.h \ netgraph/ng_async.h \ netgraph/ng_bpf.h \ netgraph/ng_bridge.h \ netgraph/ng_car.h \ netgraph/ng_checksum.h \ netgraph/ng_cisco.h \ netgraph/ng_deflate.h \ netgraph/ng_etf.h \ netgraph/ng_hole.h \ netgraph/ng_ksocket.h \ netgraph/ng_l2tp.h \ netgraph/ng_lmi.h \ netgraph/ng_macfilter.h \ netgraph/ng_message.h \ netgraph/ng_mppc.h \ netgraph/ng_nat.h \ netgraph/ng_one2many.h \ netgraph/ng_parse.h \ netgraph/ng_patch.h \ netgraph/ng_pipe.h \ netgraph/ng_ppp.h \ netgraph/ng_pppoe.h \ netgraph/ng_pptpgre.h \ netgraph/ng_pred1.h \ netgraph/ng_sample.h \ netgraph/ng_socket.h \ netgraph/ng_socketvar.h \ netgraph/ng_source.h \ netgraph/ng_tag.h \ netgraph/ng_tcpmss.h \ netgraph/ng_tee.h \ netgraph/ng_vjc.h \ netgraph/ng_vlan.h \ netgraph/ng_vlan_rotate.h \ netgraph/qos.h \ netinet/dccp.h \ netinet/icmp6.h \ netinet/icmp_var.h \ netinet/if_ether.h \ netinet/igmp.h \ netinet/igmp_var.h \ netinet/in_fib.h \ netinet/in_kdtrace.h \ netinet/in_pcb.h \ netinet/in_pcb_var.h \ netinet/in_rss.h \ netinet/in_systm.h \ netinet/in_var.h \ - netinet/ip.h \ netinet/ip6.h \ netinet/ip_carp.h \ netinet/ip_dummynet.h \ netinet/ip_fw.h \ netinet/ip_icmp.h \ netinet/ip_mroute.h \ netinet/ip_options.h \ netinet/pim_var.h \ netinet/sctp_auth.h \ netinet/sctp_bsd_addr.h \ netinet/sctp_kdtrace.h \ netinet/sctp_os.h \ netinet/sctp_os_bsd.h \ netinet/sctp_pcb.h \ netinet/sctp_structs.h \ netinet/sctp_sysctl.h \ - netinet/tcp_debug.h \ netinet/tcp_hpts.h \ netinet/tcp_log_buf.h \ netinet/tcp_lro.h \ netinet/tcp_offload.h \ netinet/tcp_ratelimit.h \ - netinet/tcp_var.h \ netinet/tcpip.h \ netinet/toecore.h \ netinet/udplite.h \ netinet6/icmp6.h \ netinet6/in6.h \ netinet6/in6_fib.h \ netinet6/in6_rss.h \ netinet6/in6_var.h \ netinet6/ip6.h \ netinet6/ip6_mroute.h \ netinet6/ip6_var.h \ - netinet6/ip6protosw.h \ netinet6/ip_fw_nat64.h \ netinet6/ip_fw_nptv6.h \ netinet6/mld6.h \ netinet6/mld6_var.h \ netinet6/nd6.h \ netinet6/pim6.h \ netinet6/pim6_var.h \ netinet6/raw_ip6.h \ netinet6/send.h \ netipsec/ah.h \ netipsec/ah_var.h \ netipsec/esp.h \ netipsec/esp_var.h \ netipsec/ipcomp.h \ netipsec/ipcomp_var.h \ netipsec/ipsec.h \ netipsec/ipsec6.h \ netipsec/key_debug.h \ netipsec/keysock.h \ - netipsec/xform.h \ netsmb/netbios.h \ netsmb/smb.h \ netsmb/smb_conn.h \ netsmb/smb_rq.h \ netsmb/smb_subr.h \ netsmb/smb_tran.h \