2 # Common code to marry kernel config(8) goo and module building goo.
5 # Generate options files that otherwise would be built
6 # in substantially similar ways through the tree. Move
7 # the code here when they all produce identical results
9 .if !defined(KERNBUILDDIR)
12 @echo "#define SMP 1" >> ${.TARGET}
13 @echo "#define MAC 1" >> ${.TARGET}
14 @echo "#define VIMAGE 1" >> ${.TARGET}
15 # Note: Define 'options' in DEFAULTS to 1. For simplicity, no check if the
16 # option is in opt_global.h. Nearly all the options in DEFAUlTS today are in
17 # opt_global.h with GEOM_* being the main exceptions. Move any options from
18 # GENERIC or std.* files to DEFAULTS to get this treatment for untied builds.
19 @awk '$$1 == "options" && $$2 !~ "GEOM_" { print "#define ", $$2, " 1"; }' \
20 < ${SYSDIR}/${MACHINE}/conf/DEFAULTS \
22 .if ${MK_BHYVE_SNAPSHOT} != "no"
24 @echo "#define BHYVE_SNAPSHOT 1" > ${.TARGET}
27 echo "#define DEV_BPF 1" > ${.TARGET}
28 .if ${MK_INET_SUPPORT} != "no"
30 @echo "#define INET 1" > ${.TARGET}
31 @echo "#define TCP_OFFLOAD 1" >> ${.TARGET}
33 .if ${MK_INET6_SUPPORT} != "no"
35 @echo "#define INET6 1" > ${.TARGET}
37 .if ${MK_IPSEC_SUPPORT} != "no"
39 @echo "#define IPSEC_SUPPORT 1" > ${.TARGET}
41 .if ${MK_RATELIMIT} != "no"
43 @echo "#define RATELIMIT 1" > ${.TARGET}
46 @echo "#define MROUTING 1" > ${.TARGET}
49 @echo "#define FDT 1" > ${.TARGET}
52 echo "#define PRINTF_BUFR_SIZE 128" > ${.TARGET}
54 echo "#define SCSI_DELAY 15000" > ${.TARGET}
55 .if ${MK_SCTP_SUPPORT} != "no"
57 @echo "#define SCTP_SUPPORT 1" > ${.TARGET}
60 echo "#define IEEE80211_DEBUG 1" > ${.TARGET}
61 echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET}
62 KERN_OPTS.i386=NEW_PCIB DEV_PCI
63 KERN_OPTS.amd64=NEW_PCIB DEV_PCI
64 KERN_OPTS.powerpc=NEW_PCIB DEV_PCI
65 KERN_OPTS=MROUTING IEEE80211_DEBUG \
66 IEEE80211_SUPPORT_MESH DEV_BPF \
67 ${KERN_OPTS.${MACHINE}} ${KERN_OPTS_EXTRA}
68 .if ${MK_BHYVE_SNAPSHOT} != "no"
69 KERN_OPTS+= BHYVE_SNAPSHOT
71 .if ${MK_INET_SUPPORT} != "no"
72 KERN_OPTS+= INET TCP_OFFLOAD
74 .if ${MK_INET6_SUPPORT} != "no"
77 .if ${MK_IPSEC_SUPPORT} != "no"
78 KERN_OPTS+= IPSEC_SUPPORT
80 .if ${MK_SCTP_SUPPORT} != "no"
81 KERN_OPTS+= SCTP_SUPPORT
83 .elif !defined(KERN_OPTS)
84 # Add all the options that are mentioned in any opt_*.h file when we
85 # have a kernel build directory to pull them from.
86 KERN_OPTS!=cat ${KERNBUILDDIR}/opt*.h | awk '{print $$2;}' | sort -u
90 .if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) && \
91 (empty(.MAKEFLAGS:M-V) || defined(NO_SKIP_MPATH))
92 __MPATH!=find ${SYSDIR:tA}/ -name \*_if.m