Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 May 2014 04:21:49 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r265419 - head/share/mk
Message-ID:  <201405060421.s464LnXl065686@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Tue May  6 04:21:48 2014
New Revision: 265419
URL: http://svnweb.freebsd.org/changeset/base/265419

Log:
  Move the /usr/src specific options to src.opts.mk. Move inclusion of
  /etc/src.conf to this file as well. Now, it will only affect builds of
  /usr/src and not others that use the bsd.*.mk files. Specifically
  don't install src.opts.mk so we can catch when it 'leaks' into
  bsd.*.mk again and have there be errors when this happens. Future
  commits will move to including src.opts.mk instead of bsd.own.mk when
  all that's needed is one of the MK_FOO options from src.opts.mk.
  Future options should be placed here, unless they directly affect a
  bsd.*.mk file, in which case they should be placed in bsd.opts.mk.

Added:
  head/share/mk/src.opts.mk
     - copied, changed from r265418, head/share/mk/bsd.own.mk
Modified:
  head/share/mk/Makefile
  head/share/mk/bsd.opts.mk

Modified: head/share/mk/Makefile
==============================================================================
--- head/share/mk/Makefile	Tue May  6 03:42:04 2014	(r265418)
+++ head/share/mk/Makefile	Tue May  6 04:21:48 2014	(r265419)
@@ -42,6 +42,9 @@ FILES=	\
 	sys.mk \
 	version_gen.awk
 
+# Installed for the moment, but not may not be in the future.
+FILES+=	src.opts.mk
+
 NO_OBJ=
 FILESDIR=	${BINDIR}/mk
 

Modified: head/share/mk/bsd.opts.mk
==============================================================================
--- head/share/mk/bsd.opts.mk	Tue May  6 03:42:04 2014	(r265418)
+++ head/share/mk/bsd.opts.mk	Tue May  6 04:21:48 2014	(r265419)
@@ -31,11 +31,6 @@
 __<bsd.opts.mk>__:
 
 .if !defined(_WITHOUT_SRCCONF)
-SRCCONF?=	/etc/src.conf
-.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf"
-.include "${SRCCONF}"
-.endif
-
 #
 # Define MK_* variables (which are either "yes" or "no") for users
 # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
@@ -66,354 +61,12 @@ __DEFAULT_YES_OPTIONS = \
 __DEFAULT_NO_OPTIONS = \
     CTF \
     DEBUG_FILES \
-    INSTALL_AS_USER \
-
-.include <bsd.mkopt.mk>
-
-# Note: __DEFAULT_{YES,NO}_OPTIONS unset by bsd.mkopt.mk
-
-# These options are used by src the builds
-
-__DEFAULT_YES_OPTIONS = \
-    ACCT \
-    ACPI \
-    AMD \
-    APM \
-    ARM_EABI \
-    AT \
-    ATM \
-    AUDIT \
-    AUTHPF \
-    BINUTILS \
-    BINUTILS_BOOTSTRAP \
-    BLUETOOTH \
-    BMAKE \
-    BOOT \
-    BSD_CPIO \
-    BSNMP \
-    BZIP2 \
-    CALENDAR \
-    CAPSICUM \
-    CASPER \
-    CDDL \
-    CPP \
-    CROSS_COMPILER \
-    CRYPT \
-    CTM \
-    CXX \
-    DICT \
-    DMAGENT \
-    DYNAMICROOT \
-    ED_CRYPTO \
-    EXAMPLES \
-    FDT \
-    FLOPPY \
-    FMTREE \
-    FORMAT_EXTENSIONS \
-    FORTH \
-    FP_LIBC \
-    FREEBSD_UPDATE \
-    GAMES \
-    GCOV \
-    GDB \
-    GNU \
-    GNU_GREP_COMPAT \
-    GPIB \
-    GPIO \
-    GPL_DTC \
-    GROFF \
-    HTML \
-    ICONV \
-    INET \
-    INET6 \
-    IPFILTER \
-    IPFW \
-    JAIL \
-    KDUMP \
-    KERNEL_SYMBOLS \
-    KVM \
-    LDNS \
-    LDNS_UTILS \
-    LEGACY_CONSOLE \
-    LIB32 \
-    LIBPTHREAD \
-    LIBTHR \
-    LOCALES \
-    LOCATE \
-    LPR \
-    LS_COLORS \
-    LZMA_SUPPORT \
-    MAIL \
-    MAILWRAPPER \
-    MAKE \
-    NCURSESW \
-    NDIS \
-    NETCAT \
-    NETGRAPH \
-    NLS_CATALOGS \
-    NS_CACHING \
-    NTP \
-    OPENSSL \
-    PAM \
-    PC_SYSINSTALL \
-    PF \
-    PKGBOOTSTRAP \
-    PMC \
-    PORTSNAP \
-    PPP \
-    QUOTAS \
-    RCMDS \
-    RCS \
-    RESCUE \
-    ROUTED \
-    SENDMAIL \
-    SETUID_LOGIN \
-    SHAREDOCS \
-    SOURCELESS \
-    SOURCELESS_HOST \
-    SOURCELESS_UCODE \
-    SVNLITE \
-    SYSCALL_COMPAT \
-    SYSCONS \
-    SYSINSTALL \
-    TCSH \
-    TELNET \
-    TEXTPROC \
-    UNBOUND \
-    USB \
-    UTMPX \
-    VI \
-    WIRELESS \
-    WPA_SUPPLICANT_EAPOL \
-    ZFS \
-    ZONEINFO
-
-__DEFAULT_NO_OPTIONS = \
-    BSD_GREP \
-    CLANG_EXTRAS \
-    EISA \
-    HESIOD \
-    LLDB \
-    NAND \
-    OFED \
-    OPENLDAP \
-    OPENSSH_NONE_CIPHER \
-    SHARED_TOOLCHAIN \
-    SORT_THREADS \
-    SVN \
-    TESTS \
-    USB_GADGET_EXAMPLES
-
-#
-# Default behaviour of some options depends on the architecture.  Unfortunately
-# this means that we have to test TARGET_ARCH (the buildworld case) as well
-# as MACHINE_ARCH (the non-buildworld case).  Normally TARGET_ARCH is not
-# used at all in bsd.*.mk, but we have to make an exception here if we want
-# to allow defaults for some things like clang to vary by target architecture.
-# Additional, per-target behavior should be rarely added only after much
-# gnashing of teeth and grinding of gears.
-#
-.if defined(TARGET_ARCH)
-__T=${TARGET_ARCH}
-.else
-__T=${MACHINE_ARCH}
-.endif
-.if defined(TARGET)
-__TT=${TARGET}
-.else
-__TT=${MACHINE}
-.endif
-# Clang is only for x86, powerpc and little-endian arm right now, by default.
-.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
-__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP
-.elif ${__T} == "arm" || ${__T} == "armv6" || ${__T} == "armv6hf"
-__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP
-# GCC is unable to build the full clang on arm, disable it by default.
-__DEFAULT_NO_OPTIONS+=CLANG_FULL
-.else
-__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP
-.endif
-# Clang the default system compiler only on little-endian arm and x86.
-.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
-    ${__T} == "armv6hf" || ${__T} == "i386"
-__DEFAULT_YES_OPTIONS+=CLANG_IS_CC
-__DEFAULT_NO_OPTIONS+=GNUCXX
-# The pc98 bootloader requires gcc to build and so we must leave gcc enabled
-# for pc98 for now.
-.if ${__TT} == "pc98"
-__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP
-.else
-__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP
-.endif
-.else
-# If clang is not cc, then build gcc by default
-__DEFAULT_NO_OPTIONS+=CLANG_IS_CC CLANG CLANG_BOOTSTRAP
-__DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP
-.endif
+    INSTALL_AS_USER
 
 .include <bsd.mkopt.mk>
 
-#
-# Supported NO_* options (if defined, MK_* will be forced to "no",
-# regardless of user's setting).
-#
-# These are transitional and will disappaer in the FreeBSD 12.
-#
-.for var in \
-    CTF \
-    DEBUG_FILES \
-    INSTALLLIB \
-    MAN \
-    PROFILE
-.if defined(NO_${var})
-.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead."
-MK_${var}:=no
-.endif
-.endfor
-
-#
-# MK_* options that default to "yes" if the compiler is a C++11 compiler.
-#
-.include <bsd.compiler.mk>
-.for var in \
-    LIBCPLUSPLUS
-.if !defined(MK_${var})
-.if ${COMPILER_FEATURES:Mc++11}
-.if defined(WITHOUT_${var})
-MK_${var}:=	no
-.else
-MK_${var}:=	yes
-.endif
-.else
-.if defined(WITH_${var})
-MK_${var}:=	yes
-.else
-MK_${var}:=	no
-.endif
-.endif
-.endif
-.endfor
-
-#
-# Force some options off if their dependencies are off.
-# Order is somewhat important.
-#
-.if ${MK_LIBPTHREAD} == "no"
-MK_LIBTHR:=	no
-.endif
-
-.if ${MK_LDNS} == "no"
-MK_LDNS_UTILS:=	no
-MK_UNBOUND:= no
-.endif
-
-.if ${MK_SOURCELESS} == "no"
-MK_SOURCELESS_HOST:=	no
-MK_SOURCELESS_UCODE:= no
-.endif
-
-.if ${MK_CDDL} == "no"
-MK_ZFS:=	no
-MK_CTF:=	no
-.endif
-
-.if ${MK_CRYPT} == "no"
-MK_OPENSSL:=	no
-MK_OPENSSH:=	no
-MK_KERBEROS:=	no
-.endif
-
-.if ${MK_CXX} == "no"
-MK_CLANG:=	no
-MK_GROFF:=	no
-.endif
-
-.if ${MK_MAIL} == "no"
-MK_MAILWRAPPER:= no
-MK_SENDMAIL:=	no
-MK_DMAGENT:=	no
-.endif
-
-.if ${MK_NETGRAPH} == "no"
-MK_ATM:=	no
-MK_BLUETOOTH:=	no
-.endif
-
-.if ${MK_OPENSSL} == "no"
-MK_OPENSSH:=	no
-MK_KERBEROS:=	no
-.endif
-
-.if ${MK_PF} == "no"
-MK_AUTHPF:=	no
-.endif
-
-.if ${MK_TEXTPROC} == "no"
-MK_GROFF:=	no
-.endif
-
-.if ${MK_CROSS_COMPILER} == "no"
-MK_BINUTILS_BOOTSTRAP:= no
-MK_CLANG_BOOTSTRAP:= no
-MK_GCC_BOOTSTRAP:= no
-.endif
-
-.if ${MK_TOOLCHAIN} == "no"
-MK_BINUTILS:=	no
-MK_CLANG:=	no
-MK_GCC:=	no
-MK_GDB:=	no
-.endif
-
-.if ${MK_CLANG} == "no"
-MK_CLANG_EXTRAS:= no
-MK_CLANG_FULL:= no
-.endif
-
-#
-# Set defaults for the MK_*_SUPPORT variables.
-#
-
-#
-# MK_*_SUPPORT options which default to "yes" unless their corresponding
-# MK_* variable is set to "no".
-#
-.for var in \
-    BZIP2 \
-    GNU \
-    INET \
-    INET6 \
-    KERBEROS \
-    KVM \
-    NETGRAPH \
-    PAM \
-    WIRELESS
-.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
-MK_${var}_SUPPORT:= no
-.else
-MK_${var}_SUPPORT:= yes
-.endif
-.endfor
-
-#
-# MK_* options whose default value depends on another option.
-#
-.for vv in \
-    GSSAPI/KERBEROS \
-    MAN_UTILS/MAN
-.if defined(WITH_${vv:H})
-MK_${vv:H}:=	yes
-.elif defined(WITHOUT_${vv:H})
-MK_${vv:H}:=	no
-.else
-MK_${vv:H}:=	${MK_${vv:T}}
-.endif
-.endfor
-
-.if !${COMPILER_FEATURES:Mc++11}
-MK_LLDB:=	no
-.endif
-
+# This should be elsewhere, but needs to be here first for now.
+.include <src.opts.mk>
 .endif # !_WITHOUT_SRCCONF
 
 .endif

Copied and modified: head/share/mk/src.opts.mk (from r265418, head/share/mk/bsd.own.mk)
==============================================================================
--- head/share/mk/bsd.own.mk	Tue May  6 03:42:04 2014	(r265418, copy source)
+++ head/share/mk/src.opts.mk	Tue May  6 04:21:48 2014	(r265419)
@@ -1,237 +1,392 @@
 # $FreeBSD$
 #
-# The include file <bsd.own.mk> set common variables for owner,
-# group, mode, and directories. Defaults are in brackets.
+# Option file for FreeBSD /usr/src builds.
 #
+# Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf
+# and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no}
+# with sensible (usually) defaults.
 #
-# +++ variables +++
+# Makefiles must include bsd.opts.mk after defining specific MK_FOO options that
+# are applicable for that Makefile (typically there are none, but sometimes there
+# are exceptions). Recursive makes usually add MK_FOO=no for options that they wish
+# to omit from that make.
 #
-# DESTDIR	Change the tree where the file gets installed. [not set]
+# Makefiles must include bsd.srcpot.mk before they test the value of any MK_FOO
+# variable.
 #
-# DISTDIR	Change the tree where the file for a distribution
-# 		gets installed (see /usr/src/release/Makefile). [not set]
+# Makefiles may also assume that this file is included by bsd.own.mk should it
+# need variables defined there prior to the end of the Makefile where
+# bsd.{subdir,lib.bin}.mk is traditionally included.
 #
-# COMPRESS_CMD	Program to compress documents.
-#		Output is to stdout. [gzip -cn]
+# The old-style YES_FOO and NO_FOO are being phased out. No new instances of them
+# should be added. Old instances should be removed since they were just to
+# bridge the gap between FreeBSD 4 and FreeBSD 5.
 #
-# COMPRESS_EXT	File name extension of ${COMPRESS_CMD} command. [.gz]
+# Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an
+# exception is made for _WITHOUT_SRCONF which turns off this mechanism
+# completely).
 #
-# BINOWN	Binary owner. [root]
-#
-# BINGRP	Binary group. [wheel]
-#
-# BINMODE	Binary mode. [555]
-#
-# NOBINMODE	Mode for non-executable files. [444]
-#
-# LIBDIR	Base path for libraries. [/usr/lib]
-#
-# LIBCOMPATDIR	Base path for compat libraries. [/usr/lib/compat]
-#
-# LIBPRIVATEDIR	Base path for private libraries. [/usr/lib/private]
-#
-# LIBDATADIR	Base path for misc. utility data files. [/usr/libdata]
-#
-# LIBEXECDIR	Base path for system daemons and utilities. [/usr/libexec]
-#
-# LINTLIBDIR	Base path for lint libraries. [/usr/libdata/lint]
-#
-# SHLIBDIR	Base path for shared libraries. [${LIBDIR}]
-#
-# LIBOWN	Library owner. [${BINOWN}]
-#
-# LIBGRP	Library group. [${BINGRP}]
-#
-# LIBMODE	Library mode. [${NOBINMODE}]
-#
-#
-# DEBUGDIR	Base path for standalone debug files. [/usr/lib/debug]
-#
-# DEBUGMODE	Mode for debug files. [${NOBINMODE}]
-#
-#
-# KMODDIR	Base path for loadable kernel modules
-#		(see kld(4)). [/boot/kernel]
-#
-# KMODOWN	Kernel and KLD owner. [${BINOWN}]
-#
-# KMODGRP	Kernel and KLD group. [${BINGRP}]
-#
-# KMODMODE	KLD mode. [${BINMODE}]
-#
-#
-# SHAREDIR	Base path for architecture-independent ascii
-#		text files. [/usr/share]
-#
-# SHAREOWN	ASCII text file owner. [root]
-#
-# SHAREGRP	ASCII text file group. [wheel]
-#
-# SHAREMODE	ASCII text file mode. [${NOBINMODE}]
-#
-#
-# CONFDIR	Base path for configuration files. [/etc]
-#
-# CONFOWN	Configuration file owner. [root]
-#
-# CONFGRP	Configuration file group. [wheel]
-#
-# CONFMODE	Configuration file mode. [644]
-#
-#
-# DOCDIR	Base path for system documentation (e.g. PSD, USD,
-#		handbook, FAQ etc.). [${SHAREDIR}/doc]
-#
-# DOCOWN	Documentation owner. [${SHAREOWN}]
-#
-# DOCGRP	Documentation group. [${SHAREGRP}]
-#
-# DOCMODE	Documentation mode. [${NOBINMODE}]
-#
-#
-# INFODIR	Base path for GNU's hypertext system
-#		called Info (see info(1)). [${SHAREDIR}/info]
-#
-# INFOOWN	Info owner. [${SHAREOWN}]
-#
-# INFOGRP	Info group. [${SHAREGRP}]
-#
-# INFOMODE	Info mode. [${NOBINMODE}]
-#
-#
-# MANDIR	Base path for manual installation. [${SHAREDIR}/man/man]
-#
-# MANOWN	Manual owner. [${SHAREOWN}]
-#
-# MANGRP	Manual group. [${SHAREGRP}]
+
+.if !target(__<src.opts.mk>__)
+__<src.opts.mk>__:
+
+# Allow user to configure things, but in the future this will move
+# elsehwere...
+
+SRCCONF?=	/etc/src.conf
+.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf"
+.include "${SRCCONF}"
+.endif
+
 #
-# MANMODE	Manual mode. [${NOBINMODE}]
+# Define MK_* variables (which are either "yes" or "no") for users
+# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
+# make(1) environment.
+# These should be tested with `== "no"' or `!= "no"' in makefiles.
+# The NO_* variables should only be set by makefiles for variables
+# that haven't been converted over.
+#
+
+# These options are used by src the builds
+
+__DEFAULT_YES_OPTIONS = \
+    ACCT \
+    ACPI \
+    AMD \
+    APM \
+    ARM_EABI \
+    AT \
+    ATM \
+    AUDIT \
+    AUTHPF \
+    BINUTILS \
+    BINUTILS_BOOTSTRAP \
+    BLUETOOTH \
+    BMAKE \
+    BOOT \
+    BSD_CPIO \
+    BSNMP \
+    BZIP2 \
+    CALENDAR \
+    CAPSICUM \
+    CASPER \
+    CDDL \
+    CPP \
+    CROSS_COMPILER \
+    CRYPT \
+    CTM \
+    CXX \
+    DICT \
+    DMAGENT \
+    DYNAMICROOT \
+    ED_CRYPTO \
+    EXAMPLES \
+    FDT \
+    FLOPPY \
+    FMTREE \
+    FORMAT_EXTENSIONS \
+    FORTH \
+    FP_LIBC \
+    FREEBSD_UPDATE \
+    GAMES \
+    GCOV \
+    GDB \
+    GNU \
+    GNU_GREP_COMPAT \
+    GPIB \
+    GPIO \
+    GPL_DTC \
+    GROFF \
+    HTML \
+    ICONV \
+    INET \
+    INET6 \
+    IPFILTER \
+    IPFW \
+    JAIL \
+    KDUMP \
+    KERNEL_SYMBOLS \
+    KVM \
+    LDNS \
+    LDNS_UTILS \
+    LEGACY_CONSOLE \
+    LIB32 \
+    LIBPTHREAD \
+    LIBTHR \
+    LOCALES \
+    LOCATE \
+    LPR \
+    LS_COLORS \
+    LZMA_SUPPORT \
+    MAIL \
+    MAILWRAPPER \
+    MAKE \
+    NCURSESW \
+    NDIS \
+    NETCAT \
+    NETGRAPH \
+    NLS_CATALOGS \
+    NS_CACHING \
+    NTP \
+    OPENSSL \
+    PAM \
+    PC_SYSINSTALL \
+    PF \
+    PKGBOOTSTRAP \
+    PMC \
+    PORTSNAP \
+    PPP \
+    QUOTAS \
+    RCMDS \
+    RCS \
+    RESCUE \
+    ROUTED \
+    SENDMAIL \
+    SETUID_LOGIN \
+    SHAREDOCS \
+    SOURCELESS \
+    SOURCELESS_HOST \
+    SOURCELESS_UCODE \
+    SVNLITE \
+    SYSCALL_COMPAT \
+    SYSCONS \
+    SYSINSTALL \
+    TCSH \
+    TELNET \
+    TEXTPROC \
+    UNBOUND \
+    USB \
+    UTMPX \
+    VI \
+    WIRELESS \
+    WPA_SUPPLICANT_EAPOL \
+    ZFS \
+    ZONEINFO
+
+__DEFAULT_NO_OPTIONS = \
+    BSD_GREP \
+    CLANG_EXTRAS \
+    EISA \
+    HESIOD \
+    LLDB \
+    NAND \
+    OFED \
+    OPENLDAP \
+    OPENSSH_NONE_CIPHER \
+    SHARED_TOOLCHAIN \
+    SORT_THREADS \
+    SVN \
+    TESTS \
+    USB_GADGET_EXAMPLES
+
+#
+# Default behaviour of some options depends on the architecture.  Unfortunately
+# this means that we have to test TARGET_ARCH (the buildworld case) as well
+# as MACHINE_ARCH (the non-buildworld case).  Normally TARGET_ARCH is not
+# used at all in bsd.*.mk, but we have to make an exception here if we want
+# to allow defaults for some things like clang to vary by target architecture.
+# Additional, per-target behavior should be rarely added only after much
+# gnashing of teeth and grinding of gears.
 #
+.if defined(TARGET_ARCH)
+__T=${TARGET_ARCH}
+.else
+__T=${MACHINE_ARCH}
+.endif
+.if defined(TARGET)
+__TT=${TARGET}
+.else
+__TT=${MACHINE}
+.endif
+# Clang is only for x86, powerpc and little-endian arm right now, by default.
+.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
+__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP
+.elif ${__T} == "arm" || ${__T} == "armv6" || ${__T} == "armv6hf"
+__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP
+# GCC is unable to build the full clang on arm, disable it by default.
+__DEFAULT_NO_OPTIONS+=CLANG_FULL
+.else
+__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP
+.endif
+# Clang the default system compiler only on little-endian arm and x86.
+.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
+    ${__T} == "armv6hf" || ${__T} == "i386"
+__DEFAULT_YES_OPTIONS+=CLANG_IS_CC
+__DEFAULT_NO_OPTIONS+=GNUCXX
+# The pc98 bootloader requires gcc to build and so we must leave gcc enabled
+# for pc98 for now.
+.if ${__TT} == "pc98"
+__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP
+.else
+__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP
+.endif
+.else
+# If clang is not cc, then build gcc by default
+__DEFAULT_NO_OPTIONS+=CLANG_IS_CC CLANG CLANG_BOOTSTRAP
+__DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP
+.endif
+
+.include <bsd.mkopt.mk>
+
 #
-# NLSDIR	Base path for National Language Support files
-#		installation. [${SHAREDIR}/nls]
+# Supported NO_* options (if defined, MK_* will be forced to "no",
+# regardless of user's setting).
 #
-# NLSOWN	National Language Support files owner. [${SHAREOWN}]
+# These are transitional and will disappaer in the FreeBSD 12.
 #
-# NLSGRP	National Language Support files group. [${SHAREGRP}]
+.for var in \
+    CTF \
+    DEBUG_FILES \
+    INSTALLLIB \
+    MAN \
+    PROFILE
+.if defined(NO_${var})
+.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead."
+MK_${var}:=no
+.endif
+.endfor
+
 #
-# NLSMODE	National Language Support files mode. [${NOBINMODE}]
+# MK_* options that default to "yes" if the compiler is a C++11 compiler.
 #
-# INCLUDEDIR	Base path for standard C include files [/usr/include]
-
-.if !target(__<bsd.own.mk>__)
-__<bsd.own.mk>__:
-
-.include <bsd.opts.mk>
-
-.if !defined(_WITHOUT_SRCCONF)
-
-.if ${MK_CTF} != "no"
-CTFCONVERT_CMD=	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
-.elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300)
-CTFCONVERT_CMD=
+.include <bsd.compiler.mk>
+.for var in \
+    LIBCPLUSPLUS
+.if !defined(MK_${var})
+.if ${COMPILER_FEATURES:Mc++11}
+.if defined(WITHOUT_${var})
+MK_${var}:=	no
 .else
-CTFCONVERT_CMD=	@:
-.endif 
-
-.if ${MK_INSTALL_AS_USER} != "no"
-_uid!=	id -u
-.if ${_uid} != 0
-.if !defined(USER)
-USER!=	id -un
+MK_${var}:=	yes
+.endif
+.else
+.if defined(WITH_${var})
+MK_${var}:=	yes
+.else
+MK_${var}:=	no
+.endif
 .endif
-_gid!=	id -gn
-.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
-$xOWN=	${USER}
-$xGRP=	${_gid}
-.endfor
 .endif
+.endfor
+
+#
+# Force some options off if their dependencies are off.
+# Order is somewhat important.
+#
+.if ${MK_LIBPTHREAD} == "no"
+MK_LIBTHR:=	no
 .endif
 
-.endif # !_WITHOUT_SRCCONF
+.if ${MK_LDNS} == "no"
+MK_LDNS_UTILS:=	no
+MK_UNBOUND:= no
+.endif
 
-# Binaries
-BINOWN?=	root
-BINGRP?=	wheel
-BINMODE?=	555
-NOBINMODE?=	444
+.if ${MK_SOURCELESS} == "no"
+MK_SOURCELESS_HOST:=	no
+MK_SOURCELESS_UCODE:= no
+.endif
 
-.if defined(MODULES_WITH_WORLD)
-KMODDIR?=	/boot/modules
-.else
-KMODDIR?=	/boot/kernel
+.if ${MK_CDDL} == "no"
+MK_ZFS:=	no
+MK_CTF:=	no
 .endif
-KMODOWN?=	${BINOWN}
-KMODGRP?=	${BINGRP}
-KMODMODE?=	${BINMODE}
 
-LIBDIR?=	/usr/lib
-LIBCOMPATDIR?=	/usr/lib/compat
-LIBPRIVATEDIR?=	/usr/lib/private
-LIBDATADIR?=	/usr/libdata
-LIBEXECDIR?=	/usr/libexec
-LINTLIBDIR?=	/usr/libdata/lint
-SHLIBDIR?=	${LIBDIR}
-LIBOWN?=	${BINOWN}
-LIBGRP?=	${BINGRP}
-LIBMODE?=	${NOBINMODE}
+.if ${MK_CRYPT} == "no"
+MK_OPENSSL:=	no
+MK_OPENSSH:=	no
+MK_KERBEROS:=	no
+.endif
 
-DEBUGDIR?=	/usr/lib/debug
-DEBUGMODE?=	${NOBINMODE}
+.if ${MK_CXX} == "no"
+MK_CLANG:=	no
+MK_GROFF:=	no
+.endif
 
+.if ${MK_MAIL} == "no"
+MK_MAILWRAPPER:= no
+MK_SENDMAIL:=	no
+MK_DMAGENT:=	no
+.endif
 
-# Share files
-SHAREDIR?=	/usr/share
-SHAREOWN?=	root
-SHAREGRP?=	wheel
-SHAREMODE?=	${NOBINMODE}
+.if ${MK_NETGRAPH} == "no"
+MK_ATM:=	no
+MK_BLUETOOTH:=	no
+.endif
 
-CONFDIR?=	/etc
-CONFOWN?=	root
-CONFGRP?=	wheel
-CONFMODE?=	644
+.if ${MK_OPENSSL} == "no"
+MK_OPENSSH:=	no
+MK_KERBEROS:=	no
+.endif
 
-MANDIR?=	${SHAREDIR}/man/man
-MANOWN?=	${SHAREOWN}
-MANGRP?=	${SHAREGRP}
-MANMODE?=	${NOBINMODE}
+.if ${MK_PF} == "no"
+MK_AUTHPF:=	no
+.endif
 
-DOCDIR?=	${SHAREDIR}/doc
-DOCOWN?=	${SHAREOWN}
-DOCGRP?=	${SHAREGRP}
-DOCMODE?=	${NOBINMODE}
+.if ${MK_TEXTPROC} == "no"
+MK_GROFF:=	no
+.endif
 
-INFODIR?=	${SHAREDIR}/info
-INFOOWN?=	${SHAREOWN}
-INFOGRP?=	${SHAREGRP}
-INFOMODE?=	${NOBINMODE}
+.if ${MK_CROSS_COMPILER} == "no"
+MK_BINUTILS_BOOTSTRAP:= no
+MK_CLANG_BOOTSTRAP:= no
+MK_GCC_BOOTSTRAP:= no
+.endif
 
-NLSDIR?=	${SHAREDIR}/nls
-NLSOWN?=	${SHAREOWN}
-NLSGRP?=	${SHAREGRP}
-NLSMODE?=	${NOBINMODE}
+.if ${MK_TOOLCHAIN} == "no"
+MK_BINUTILS:=	no
+MK_CLANG:=	no
+MK_GCC:=	no
+MK_GDB:=	no
+.endif
 
-INCLUDEDIR?=	/usr/include
+.if ${MK_CLANG} == "no"
+MK_CLANG_EXTRAS:= no
+MK_CLANG_FULL:= no
+.endif
 
 #
-# install(1) parameters.
+# Set defaults for the MK_*_SUPPORT variables.
 #
-HRDLINK?=	-l h
-SYMLINK?=	-l s
-
-INSTALL_LINK?=		${INSTALL} ${HRDLINK}
-INSTALL_SYMLINK?=	${INSTALL} ${SYMLINK}
 
-# Common variables
-.if !defined(DEBUG_FLAGS)
-STRIP?=		-s
+#
+# MK_*_SUPPORT options which default to "yes" unless their corresponding
+# MK_* variable is set to "no".
+#
+.for var in \
+    BZIP2 \
+    GNU \
+    INET \
+    INET6 \
+    KERBEROS \
+    KVM \
+    NETGRAPH \
+    PAM \
+    WIRELESS
+.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
+MK_${var}_SUPPORT:= no
+.else
+MK_${var}_SUPPORT:= yes
 .endif
+.endfor
 
-COMPRESS_CMD?=	gzip -cn
-COMPRESS_EXT?=	.gz
+#
+# MK_* options whose default value depends on another option.
+#
+.for vv in \
+    GSSAPI/KERBEROS \
+    MAN_UTILS/MAN
+.if defined(WITH_${vv:H})
+MK_${vv:H}:=	yes
+.elif defined(WITHOUT_${vv:H})
+MK_${vv:H}:=	no
+.else
+MK_${vv:H}:=	${MK_${vv:T}}
+.endif
+.endfor
 
-# Pointer to the top directory into which tests are installed.  Should not be
-# overriden by Makefiles, but the user may choose to set this in src.conf(5).
-TESTSBASE?= /usr/tests
+.if !${COMPILER_FEATURES:Mc++11}
+MK_LLDB:=	no
+.endif
 
-.endif	# !target(__<bsd.own.mk>__)
+.endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405060421.s464LnXl065686>