3 # The include file <bsd.own.mk> set common variables for owner,
4 # group, mode, and directories. Defaults are in brackets.
9 # DESTDIR Change the tree where the file gets installed. [not set]
11 # DISTDIR Change the tree where the file for a distribution
12 # gets installed (see /usr/src/release/Makefile). [not set]
14 # COMPRESS_CMD Program to compress documents.
15 # Output is to stdout. [gzip -cn]
17 # COMPRESS_EXT File name extension of ${COMPRESS_CMD} command. [.gz]
19 # BINOWN Binary owner. [root]
21 # BINGRP Binary group. [wheel]
23 # BINMODE Binary mode. [555]
25 # NOBINMODE Mode for non-executable files. [444]
27 # LIBDIR Base path for libraries. [/usr/lib]
29 # LIBCOMPATDIR Base path for compat libraries. [/usr/lib/compat]
31 # LIBDATADIR Base path for misc. utility data files. [/usr/libdata]
33 # LIBEXECDIR Base path for system daemons and utilities. [/usr/libexec]
35 # LINTLIBDIR Base path for lint libraries. [/usr/libdata/lint]
37 # SHLIBDIR Base path for shared libraries. [${LIBDIR}]
39 # LIBOWN Library owner. [${BINOWN}]
41 # LIBGRP Library group. [${BINGRP}]
43 # LIBMODE Library mode. [${NOBINMODE}]
46 # DEBUGDIR Base path for standalone debug files. [/usr/lib/debug]
48 # DEBUGMODE Mode for debug files. [${NOBINMODE}]
51 # KMODDIR Base path for loadable kernel modules
52 # (see kld(4)). [/boot/kernel]
54 # KMODOWN Kernel and KLD owner. [${BINOWN}]
56 # KMODGRP Kernel and KLD group. [${BINGRP}]
58 # KMODMODE KLD mode. [${BINMODE}]
61 # SHAREDIR Base path for architecture-independent ascii
62 # text files. [/usr/share]
64 # SHAREOWN ASCII text file owner. [root]
66 # SHAREGRP ASCII text file group. [wheel]
68 # SHAREMODE ASCII text file mode. [${NOBINMODE}]
71 # CONFDIR Base path for configuration files. [/etc]
73 # CONFOWN Configuration file owner. [root]
75 # CONFGRP Configuration file group. [wheel]
77 # CONFMODE Configuration file mode. [644]
80 # DOCDIR Base path for system documentation (e.g. PSD, USD,
81 # handbook, FAQ etc.). [${SHAREDIR}/doc]
83 # DOCOWN Documentation owner. [${SHAREOWN}]
85 # DOCGRP Documentation group. [${SHAREGRP}]
87 # DOCMODE Documentation mode. [${NOBINMODE}]
90 # INFODIR Base path for GNU's hypertext system
91 # called Info (see info(1)). [${SHAREDIR}/info]
93 # INFOOWN Info owner. [${SHAREOWN}]
95 # INFOGRP Info group. [${SHAREGRP}]
97 # INFOMODE Info mode. [${NOBINMODE}]
100 # MANDIR Base path for manual installation. [${SHAREDIR}/man/man]
102 # MANOWN Manual owner. [${SHAREOWN}]
104 # MANGRP Manual group. [${SHAREGRP}]
106 # MANMODE Manual mode. [${NOBINMODE}]
109 # NLSDIR Base path for National Language Support files
110 # installation. [${SHAREDIR}/nls]
112 # NLSOWN National Language Support files owner. [${SHAREOWN}]
114 # NLSGRP National Language Support files group. [${SHAREGRP}]
116 # NLSMODE National Language Support files mode. [${NOBINMODE}]
118 # INCLUDEDIR Base path for standard C include files [/usr/include]
120 .if !target(__<bsd.own.mk>__)
123 .if !defined(_WITHOUT_SRCCONF)
124 SRCCONF?= /etc/src.conf
125 .if exists(${SRCCONF})
126 .include "${SRCCONF}"
136 .if defined(MODULES_WITH_WORLD)
137 KMODDIR?= /boot/modules
139 KMODDIR?= /boot/kernel
143 KMODMODE?= ${BINMODE}
146 LIBCOMPATDIR?= /usr/lib/compat
147 LIBDATADIR?= /usr/libdata
148 LIBEXECDIR?= /usr/libexec
149 LINTLIBDIR?= /usr/libdata/lint
153 LIBMODE?= ${NOBINMODE}
155 DEBUGDIR?= /usr/lib/debug
156 DEBUGMODE?= ${NOBINMODE}
160 SHAREDIR?= /usr/share
163 SHAREMODE?= ${NOBINMODE}
170 MANDIR?= ${SHAREDIR}/man/man
173 MANMODE?= ${NOBINMODE}
175 DOCDIR?= ${SHAREDIR}/doc
178 DOCMODE?= ${NOBINMODE}
180 INFODIR?= ${SHAREDIR}/info
181 INFOOWN?= ${SHAREOWN}
182 INFOGRP?= ${SHAREGRP}
183 INFOMODE?= ${NOBINMODE}
185 NLSDIR?= ${SHAREDIR}/nls
188 NLSMODE?= ${NOBINMODE}
190 INCLUDEDIR?= /usr/include
193 # install(1) parameters.
198 INSTALL_LINK?= ${INSTALL} ${HRDLINK}
199 INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK}
202 .if !defined(DEBUG_FLAGS)
206 COMPRESS_CMD?= gzip -cn
209 .if !defined(_WITHOUT_SRCCONF)
211 # Define MK_* variables (which are either "yes" or "no") for users
212 # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
213 # make(1) environment.
214 # These should be tested with `== "no"' or `!= "no"' in makefiles.
215 # The NO_* variables should only be set by makefiles.
219 # Supported NO_* options (if defined, MK_* will be forced to "no",
220 # regardless of user's setting).
228 .if defined(NO_${var})
229 .if defined(WITH_${var})
230 .warning unsetting WITH_${var}
232 .if defined(WITH_${var})
241 # Compat NO_* options (same as above, except their use is deprecated).
243 .if !defined(BURN_BRIDGES)
306 .if defined(NO_${var})
307 #.warning NO_${var} is deprecated in favour of WITHOUT_${var}=
311 .endif # !defined(BURN_BRIDGES)
314 # Older-style variables that enabled behaviour when set.
316 .if defined(YES_HESIOD)
319 .if defined(MAKE_IDEA)
323 __DEFAULT_YES_OPTIONS = \
432 WPA_SUPPLICANT_EAPOL \
436 __DEFAULT_NO_OPTIONS = \
452 OPENSSH_NONE_CIPHER \
456 # Default behaviour of some options depends on the architecture. Unfortunately
457 # this means that we have to test TARGET_ARCH (the buildworld case) as well
458 # as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not
459 # used at all in bsd.*.mk, but we have to make an exception here if we want
460 # to allow defaults for some things like clang and fdt to vary by target
463 .if defined(TARGET_ARCH)
468 # Clang is only for x86 and powerpc right now, by default.
469 .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
470 __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL
472 __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL
474 # FDT is needed only for arm and powerpc
475 .if ${__T:Marm*} || ${__T:Mpowerpc*}
476 __DEFAULT_YES_OPTIONS+=FDT
478 __DEFAULT_NO_OPTIONS+=FDT
483 # MK_* options which default to "yes".
485 .for var in ${__DEFAULT_YES_OPTIONS}
486 .if defined(WITH_${var}) && defined(WITHOUT_${var})
487 .error WITH_${var} and WITHOUT_${var} can't both be set.
489 .if defined(MK_${var})
490 .error MK_${var} can't be set by a user.
492 .if defined(WITHOUT_${var})
498 .undef __DEFAULT_YES_OPTIONS
501 # MK_* options which default to "no".
503 .for var in ${__DEFAULT_NO_OPTIONS}
504 .if defined(WITH_${var}) && defined(WITHOUT_${var})
505 .error WITH_${var} and WITHOUT_${var} can't both be set.
507 .if defined(MK_${var})
508 .error MK_${var} can't be set by a user.
510 .if defined(WITH_${var})
516 .undef __DEFAULT_NO_OPTIONS
519 # Force some options off if their dependencies are off.
520 # Order is somewhat important.
522 .if ${MK_LIBPTHREAD} == "no"
526 .if ${MK_LIBTHR} == "no"
530 .if ${MK_BIND} == "no"
534 MK_BIND_LIBS_LWRES:= no
540 .if ${MK_BIND_MTREE} == "no"
544 .if ${MK_SOURCELESS} == "no"
545 MK_SOURCELESS_HOST:= no
546 MK_SOURCELESS_UCODE:= no
549 .if ${MK_CDDL} == "no"
554 .if ${MK_CRYPT} == "no"
560 .if ${MK_CXX} == "no"
565 .if ${MK_IPX} == "no"
569 .if ${MK_MAIL} == "no"
574 .if ${MK_NETGRAPH} == "no"
579 .if ${MK_OPENSSL} == "no"
588 .if ${MK_TEXTPROC} == "no"
592 .if ${MK_TOOLCHAIN} == "no"
599 .if ${MK_CLANG} == "no"
606 # Set defaults for the MK_*_SUPPORT variables.
610 # MK_*_SUPPORT options which default to "yes" unless their corresponding
611 # MK_* variable is set to "no".
624 .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
625 .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
627 .if defined(MK_${var}_SUPPORT)
628 .error MK_${var}_SUPPORT can't be set by a user.
630 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
631 MK_${var}_SUPPORT:= no
633 MK_${var}_SUPPORT:= yes
638 # MK_* options whose default value depends on another option.
643 .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
644 .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
646 .if defined(MK_${vv:H})
647 .error MK_${vv:H} can't be set by a user.
649 .if defined(WITH_${vv:H})
651 .elif defined(WITHOUT_${vv:H})
654 MK_${vv:H}:= ${MK_${vv:T}}
659 # MK_* options that default to "yes" if the compiler is a C++11 compiler.
661 .include <bsd.compiler.mk>
664 .if defined(WITH_${var}) && defined(WITHOUT_${var})
665 .error WITH_${var} and WITHOUT_${var} can't both be set.
667 .if defined(MK_${var})
668 .error MK_${var} can't be set by a user.
670 .if ${COMPILER_FEATURES:Mc++11}
671 .if defined(WITHOUT_${var})
677 .if defined(WITH_${var})
685 .if ${MK_CTF} != "no"
686 CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
687 .elif defined(.PARSEDIR) || ${MAKE_VERSION} >= 9201210220
693 .endif # !_WITHOUT_SRCCONF
695 .endif # !target(__<bsd.own.mk>__)