History log of /freebsd-current/share/mk/src.sys.mk
Revision Date Author Comments
# 030af1b6 13-Nov-2023 Baptiste Daroussin <bapt@FreeBSD.org>

pkgbase: set the prefix of debug files and macros to /usr/src

When the macro PACKAGE_BUILDING is set, then consider we are building package
for pkgbase, this has already been used in Makefile.inc1 and reuse the
PACKAGE_BUILDING macros already used for that purpose in the ports tree

In the future this should be tied to REPRODUCIBLE_BUILD

MFC After: 3 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D42569


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# fe815331 18-Sep-2020 Kyle Evans <kevans@FreeBSD.org>

build: provide a default WARNS for all in-tree builds

The current default is provided in various Makefile.inc in some top-level
directories and covers a good portion of the tree, but doesn't cover parts
of the build a little deeper (e.g. libcasper).

Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that
variable is defined. This lets us relatively cleanly provide a default WARNS
no matter where you're building in the src tree without breaking things
outside of the tree.

Crunchgen has been updated as a bootstrap tool to work on this change
because it needs r365605 at a minimum to succeed. The cleanup necessary to
successfully walk over this change on WITHOUT_CLEAN builds has been added.

There is a supplemental project to this to list all of the warnings that are
encountered when the environment has WARNS=6 NO_WERROR=yes:
https://warns.kevans.dev -- this project will hopefully eventually go away
in favor of CI doing a much better job than it.

Reviewed by: emaste, brooks, ngie (all earlier version)
Reviewed by: emaste, arichardson (depend-cleanup.sh change)
Differential Revision: https://reviews.freebsd.org/D26455


# 879ce458 10-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

userland build: replace -fno-common with ${CFCOMMONFLAG}

This change allows any downstream or otherwise consumer to easily override
the new -fno-common default on a temporary basis without having to hack into
src.sys.mk, and also makes it a bit easier to search for these specific
cases where -fno-common must be overridden with -fcommon or else the build
will fail.

The gdb build, the only program requiring -fcommon on head/, is switched
over as an example usage. It will need it on all branches, so this does not
harm future mergability.

MFC after: 3 days


# 8eb1a0ce 07-Apr-2020 Kyle Evans <kevans@FreeBSD.org>

Add -fno-common to all userland/kernel src builds

-fno-common will become the default in GCC10/LLVM11. Plenty of work has been
put in to make sure our world builds are no -fno-common clean, so let's slap
the build with this until it becomes the compiler default to ensure we don't
regress.

At this time, we will not be enforcing -fno-common on ports builds. I
suspect most ports will be or quickly become -fno-common clean as they're
naturally built against compilers that default to it, so this will hopefully
become a non-issue in due time. The exception to this, which is actually the
status quo, is that kmods built from ports will continue to build with
-fno-common.

As of the time of writing, I intend to also make stable/12 -fno-common
clean. What's been done will be MFC'd to stable/11 if it's easily applicable
and/or not much work to massage it into being functional, but I anticipate
adding -fcommon to stable/11 builds to maintain its ability to be built with
newer compilers for the rest of its lifetime instead of putting in a third
branch's worth of effort.


# 615a1e70 02-Nov-2017 Bryan Drewery <bdrewery@FreeBSD.org>

Enable AUTO_OBJ by default if the OBJDIR is writable, only for in-tree builds.

This can be disabled by putting WITHOUT_AUTO_OBJ=yes in /etc/src-env.conf, not
/etc/src.conf, or passing it in the environment.

The purpose of this rather than simply flipping the default of AUTO_OBJ to yes
is to avoid hassling users with auto.obj.mk failures if the wanted OBJDIR is
not writable. It will fallback to writing to the source directory like it does
today if MAKEOBJDIRPREFIX is not writable.

The act of enabling MK_AUTO_OBJ disables all 'make obj' treewalks since
previous work has made those not run if MK_AUTO_OBJ==yes in Makefile.inc1.

Relnotes: yes
Reviewed by: sjg
Discussed at: https://lists.freebsd.org/pipermail/freebsd-arch/2016-May/017805.html
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12841


# f19c33ee 22-Apr-2016 Bryan Drewery <bdrewery@FreeBSD.org>

Fix error when SRCCONF is empty.

Sponsored by: EMC / Isilon Storage Division


# 945ceaaf 01-Dec-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Only include src.conf if _WITHOUT_SRCCONF not defined.

This does not really fix anything currently since _WITHOUT_SRCCONF must be
defined in the environment or local.sys.*.mk, but is proper and needed for
downstream fixes. I am working towards reworking src.conf inclusion still.

Sponsored by: EMC / Isilon Storage Division


# 7356a030 17-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Trim space


# cc922274 17-Sep-2015 Bryan Drewery <bdrewery@FreeBSD.org>

Add a check to ensure that the env-only mkopts are not set via src.conf.

Sponsored by: EMC / Isilon Storage Division


# daf514d0 19-Jun-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Move include of make.conf back to its old position.

This means moving include of local.sys.mk and src.sys.mk too.
Introduce new includes to take the early slot, for the purpose
of being able to influence toolchains and the like.

Differential Revision: D2860
Reviewed by: imp


# 883e6bfb 30-May-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Define SRCTOP in src.sys.mk

Because src.sys.mk should only ever be found in the src tree
we can use its position (.PARSEDIR) to set SRCTOP.

Reviewed by: bapt, imp


# ae3019ca 26-May-2015 Simon J. Gerraty <sjg@FreeBSD.org>

Define SRCTOP in src.sys.mk

Use SRCTOP to replace .../ in MAKSYSPATH (avoid extra :tA)
Use SRCTOP rather than ROOTSRCDIR in src.libnames.mk
Merge from head


# 2ad46929 24-Feb-2015 Simon J. Gerraty <sjg@FreeBSD.org>

If sys.mk were found via the magic path .../share/mk
replace it with the absolute path of .PARSEDIR, so that sub-makes
launched from objdirs (eg kernel) can still find the correct mk files.

Reviewed by: obrien


# faa8fa90 28-Jul-2014 Simon J. Gerraty <sjg@FreeBSD.org>

We do not ever want _srcconf_included_ as MAIN target.


# 1f4e0ed9 17-May-2014 Warner Losh <imp@FreeBSD.org>

The time is not yet ripe to break the lack of dependencies between
src/sys and the rest of the tree for builds.
o eliminate including bsd.mkopts.mk for the moment in kern.opts.mk
o No need to include src.opts.mk at all anymore. The reasons for it
are now coverted in sys.mk and src.sys.mk.


# 6b14aaa4 16-May-2014 Warner Losh <imp@FreeBSD.org>

Read in SRCCONF early and consistently, if src.sys.mk exists, which is
should for all normal builds. Read /etc/make.conf earlier than before,
but consistently before SRCCONF and local.sys.mk.