135c4406dSWarner Losh# $FreeBSD$ 235c4406dSWarner Losh# 335c4406dSWarner Losh# Common code to marry kernel config(8) goo and module building goo. 435c4406dSWarner Losh# 535c4406dSWarner Losh 635c4406dSWarner Losh# Generate options files that otherwise would be built 735c4406dSWarner Losh# in substantially similar ways through the tree. Move 835c4406dSWarner Losh# the code here when they all produce identical results 935c4406dSWarner Losh# (or should) 1035c4406dSWarner Losh.if !defined(KERNBUILDDIR) 110c4c5948SKyle Evansopt_global.h: 12*861526b5SKyle Evans touch ${.TARGET} 130c4c5948SKyle Evans.if ${MACHINE} != "mips" 14*861526b5SKyle Evans @echo "#define VIMAGE 1" >> ${.TARGET} 150c4c5948SKyle Evans.endif 1635c4406dSWarner Loshopt_bpf.h: 1735c4406dSWarner Losh echo "#define DEV_BPF 1" > ${.TARGET} 1835c4406dSWarner Losh.if ${MK_INET_SUPPORT} != "no" 1935c4406dSWarner Loshopt_inet.h: 2035c4406dSWarner Losh @echo "#define INET 1" > ${.TARGET} 2135c4406dSWarner Losh @echo "#define TCP_OFFLOAD 1" >> ${.TARGET} 2235c4406dSWarner Losh.endif 2335c4406dSWarner Losh.if ${MK_INET6_SUPPORT} != "no" 2435c4406dSWarner Loshopt_inet6.h: 2535c4406dSWarner Losh @echo "#define INET6 1" > ${.TARGET} 2635c4406dSWarner Losh.endif 27f3e7afe2SHans Petter Selasky.if ${MK_RATELIMIT} != "no" 28f3e7afe2SHans Petter Selaskyopt_ratelimit.h: 29f3e7afe2SHans Petter Selasky @echo "#define RATELIMIT 1" > ${.TARGET} 30f3e7afe2SHans Petter Selasky.endif 3135c4406dSWarner Loshopt_mrouting.h: 3235c4406dSWarner Losh echo "#define MROUTING 1" > ${.TARGET} 332379d1d6SWarner Loshopt_printf.h: 342379d1d6SWarner Losh echo "#define PRINTF_BUFR_SIZE 128" > ${.TARGET} 3535c4406dSWarner Loshopt_scsi.h: 3635c4406dSWarner Losh echo "#define SCSI_DELAY 15000" > ${.TARGET} 3735c4406dSWarner Loshopt_wlan.h: 3835c4406dSWarner Losh echo "#define IEEE80211_DEBUG 1" > ${.TARGET} 3935c4406dSWarner Losh echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET} 4035c4406dSWarner LoshKERN_OPTS.i386=NEW_PCIB DEV_PCI 4135c4406dSWarner LoshKERN_OPTS.amd64=NEW_PCIB DEV_PCI 4235c4406dSWarner LoshKERN_OPTS.powerpc=NEW_PCIB DEV_PCI 43a7dc3128SBrooks DavisKERN_OPTS=MROUTING IEEE80211_DEBUG \ 444945f79aSAndriy Voskoboinyk IEEE80211_SUPPORT_MESH DEV_BPF \ 4535c4406dSWarner Losh ${KERN_OPTS.${MACHINE}} ${KERN_OPTS_EXTRA} 4635c4406dSWarner Losh.if ${MK_INET_SUPPORT} != "no" 4735c4406dSWarner LoshKERN_OPTS+= INET TCP_OFFLOAD 4835c4406dSWarner Losh.endif 4935c4406dSWarner Losh.if ${MK_INET6_SUPPORT} != "no" 5035c4406dSWarner LoshKERN_OPTS+= INET6 5135c4406dSWarner Losh.endif 52ebf5587eSBryan Drewery.elif !defined(KERN_OPTS) 53eec0e91eSWarner Losh# Add all the options that are mentioned in any opt_*.h file when we 54eec0e91eSWarner Losh# have a kernel build directory to pull them from. 5535c4406dSWarner LoshKERN_OPTS!=cat ${KERNBUILDDIR}/opt*.h | awk '{print $$2;}' | sort -u 56ebf5587eSBryan Drewery.export KERN_OPTS 5735c4406dSWarner Losh.endif 58ec4047adSBryan Drewery 59d395e093SBryan Drewery.if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) && \ 60d395e093SBryan Drewery (empty(.MAKEFLAGS:M-V) || defined(NO_SKIP_MPATH)) 61ec4047adSBryan Drewery__MPATH!=find ${SYSDIR:tA}/ -name \*_if.m 62ec4047adSBryan Drewery.export __MPATH 63ec4047adSBryan Drewery.endif 64