xref: /freebsd/sys/conf/config.mk (revision dd41de95a84d979615a2ef11df6850622bf6184e)
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_IPSEC_SUPPORT} != "no"
34opt_ipsec.h:
35	@echo "#define IPSEC_SUPPORT 1" > ${.TARGET}
36.endif
37.if ${MK_RATELIMIT} != "no"
38opt_ratelimit.h:
39	@echo "#define RATELIMIT 1" > ${.TARGET}
40.endif
41opt_mrouting.h:
42	echo "#define MROUTING 1" > ${.TARGET}
43opt_printf.h:
44	echo "#define PRINTF_BUFR_SIZE 128" > ${.TARGET}
45opt_scsi.h:
46	echo "#define SCSI_DELAY 15000" > ${.TARGET}
47.if ${MK_SCTP_SUPPORT} != "no"
48opt_sctp.h:
49	@echo "#define SCTP_SUPPORT 1" > ${.TARGET}
50.endif
51opt_wlan.h:
52	echo "#define IEEE80211_DEBUG 1" > ${.TARGET}
53	echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET}
54KERN_OPTS.i386=NEW_PCIB DEV_PCI
55KERN_OPTS.amd64=NEW_PCIB DEV_PCI
56KERN_OPTS.powerpc=NEW_PCIB DEV_PCI
57KERN_OPTS=MROUTING IEEE80211_DEBUG \
58	IEEE80211_SUPPORT_MESH DEV_BPF \
59	${KERN_OPTS.${MACHINE}} ${KERN_OPTS_EXTRA}
60.if ${MK_BHYVE_SNAPSHOT} != "no"
61KERN_OPTS+= BHYVE_SNAPSHOT
62.endif
63.if ${MK_INET_SUPPORT} != "no"
64KERN_OPTS+= INET TCP_OFFLOAD
65.endif
66.if ${MK_INET6_SUPPORT} != "no"
67KERN_OPTS+= INET6
68.endif
69.if ${MK_IPSEC_SUPPORT} != "no"
70KERN_OPTS+= IPSEC_SUPPORT
71.endif
72.if ${MK_SCTP_SUPPORT} != "no"
73KERN_OPTS+= SCTP_SUPPORT
74.endif
75.elif !defined(KERN_OPTS)
76# Add all the options that are mentioned in any opt_*.h file when we
77# have a kernel build directory to pull them from.
78KERN_OPTS!=cat ${KERNBUILDDIR}/opt*.h | awk '{print $$2;}' | sort -u
79.export KERN_OPTS
80.endif
81
82.if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) && \
83    (empty(.MAKEFLAGS:M-V) || defined(NO_SKIP_MPATH))
84__MPATH!=find ${SYSDIR:tA}/ -name \*_if.m
85.export __MPATH
86.endif
87