]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/conf/config.mk
kmod build: start generating opt_global.h, include it
[FreeBSD/FreeBSD.git] / sys / conf / config.mk
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)
11 opt_global.h:
12 .if ${MACHINE} != "mips"
13         @echo "#define VIMAGE 1" > ${.TARGET}
14 .endif
15 opt_bpf.h:
16         echo "#define DEV_BPF 1" > ${.TARGET}
17 .if ${MK_INET_SUPPORT} != "no"
18 opt_inet.h:
19         @echo "#define INET 1" > ${.TARGET}
20         @echo "#define TCP_OFFLOAD 1" >> ${.TARGET}
21 .endif
22 .if ${MK_INET6_SUPPORT} != "no"
23 opt_inet6.h:
24         @echo "#define INET6 1" > ${.TARGET}
25 .endif
26 .if ${MK_RATELIMIT} != "no"
27 opt_ratelimit.h:
28         @echo "#define RATELIMIT 1" > ${.TARGET}
29 .endif
30 opt_mrouting.h:
31         echo "#define MROUTING 1" > ${.TARGET}
32 opt_printf.h:
33         echo "#define PRINTF_BUFR_SIZE 128" > ${.TARGET}
34 opt_scsi.h:
35         echo "#define SCSI_DELAY 15000" > ${.TARGET}
36 opt_wlan.h:
37         echo "#define IEEE80211_DEBUG 1" > ${.TARGET}
38         echo "#define IEEE80211_SUPPORT_MESH 1" >> ${.TARGET}
39 KERN_OPTS.i386=NEW_PCIB DEV_PCI
40 KERN_OPTS.amd64=NEW_PCIB DEV_PCI
41 KERN_OPTS.powerpc=NEW_PCIB DEV_PCI
42 KERN_OPTS=MROUTING IEEE80211_DEBUG \
43         IEEE80211_SUPPORT_MESH DEV_BPF \
44         ${KERN_OPTS.${MACHINE}} ${KERN_OPTS_EXTRA}
45 .if ${MK_INET_SUPPORT} != "no"
46 KERN_OPTS+= INET TCP_OFFLOAD
47 .endif
48 .if ${MK_INET6_SUPPORT} != "no"
49 KERN_OPTS+= INET6
50 .endif
51 .elif !defined(KERN_OPTS)
52 # Add all the options that are mentioned in any opt_*.h file when we
53 # have a kernel build directory to pull them from.
54 KERN_OPTS!=cat ${KERNBUILDDIR}/opt*.h | awk '{print $$2;}' | sort -u
55 .export KERN_OPTS
56 .endif
57
58 .if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) && \
59     (empty(.MAKEFLAGS:M-V) || defined(NO_SKIP_MPATH))
60 __MPATH!=find ${SYSDIR:tA}/ -name \*_if.m
61 .export __MPATH
62 .endif