1# $FreeBSD$ 2# 3# Common code to marry kernel config(8) goo and module building goo. 4# 5 6# Generate options files that otherwise would be built 7# in substantially similar ways through the tree. Move 8# the code here when they all produce identical results 9# (or should) 10.if !defined(KERNBUILDDIR) 11opt_global.h: 12 touch ${.TARGET} 13.if ${MACHINE} != "mips" 14 @echo "#define SMP 1" >> ${.TARGET} 15 @echo "#define MAC 1" >> ${.TARGET} 16 @echo "#define VIMAGE 1" >> ${.TARGET} 17.endif 18.if ${MK_BHYVE_SNAPSHOT} != "no" 19opt_bhyve_snapshot.h: 20 @echo "#define BHYVE_SNAPSHOT 1" > ${.TARGET} 21.endif 22opt_bpf.h: 23 echo "#define DEV_BPF 1" > ${.TARGET} 24.if ${MK_INET_SUPPORT} != "no" 25opt_inet.h: 26 @echo "#define INET 1" > ${.TARGET} 27 @echo "#define TCP_OFFLOAD 1" >> ${.TARGET} 28.endif 29.if ${MK_INET6_SUPPORT} != "no" 30opt_inet6.h: 31 @echo "#define INET6 1" > ${.TARGET} 32.endif 33.if ${MK_RATELIMIT} != "no" 34opt_ratelimit.h: 35 @echo "#define RATELIMIT 1" > ${.TARGET} 36.endif 37opt_mrouting.h: 38 echo "#define MROUTING 1" > ${.TARGET} 39opt_printf.h: 40 echo "#define PRINTF_BUFR_SIZE 128" > ${.TARGET} 41opt_scsi.h: 42 echo "#define SCSI_DELAY 15000" > ${.TARGET} 43opt_wlan.h: 44 echo "#define IEEE80211_DEBUG 1" > ${.TARGET} 45 echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET} 46KERN_OPTS.i386=NEW_PCIB DEV_PCI 47KERN_OPTS.amd64=NEW_PCIB DEV_PCI 48KERN_OPTS.powerpc=NEW_PCIB DEV_PCI 49KERN_OPTS=MROUTING IEEE80211_DEBUG \ 50 IEEE80211_SUPPORT_MESH DEV_BPF \ 51 ${KERN_OPTS.${MACHINE}} ${KERN_OPTS_EXTRA} 52.if ${MK_BHYVE_SNAPSHOT} != "no" 53KERN_OPTS+= BHYVE_SNAPSHOT 54.endif 55.if ${MK_INET_SUPPORT} != "no" 56KERN_OPTS+= INET TCP_OFFLOAD 57.endif 58.if ${MK_INET6_SUPPORT} != "no" 59KERN_OPTS+= INET6 60.endif 61.elif !defined(KERN_OPTS) 62# Add all the options that are mentioned in any opt_*.h file when we 63# have a kernel build directory to pull them from. 64KERN_OPTS!=cat ${KERNBUILDDIR}/opt*.h | awk '{print $$2;}' | sort -u 65.export KERN_OPTS 66.endif 67 68.if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) && \ 69 (empty(.MAKEFLAGS:M-V) || defined(NO_SKIP_MPATH)) 70__MPATH!=find ${SYSDIR:tA}/ -name \*_if.m 71.export __MPATH 72.endif 73