Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 May 2020 07:47:16 +0200
From:      Ede Wolf <listac@nebelschwaden.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: Moving sources (base/ports) from /usr
Message-ID:  <ce990166-98b9-e9b2-ebe7-c21251ffd0fc@nebelschwaden.de>
In-Reply-To: <20200513201932.8dd2cc135c50d54dc8daff0c@sohara.org>
References:  <20200508210444.7945f4ba@kaperfahrt.nebelschwaden.de> <20200513201932.8dd2cc135c50d54dc8daff0c@sohara.org>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help

> 	SRCDIR you can leave alone, just move /usr/src anywhere you like
> and so long as you change into that directory to build all should be good
> because the Makefile sets everything up based on CURDIR. 

Basically you are right. For makebuild[world|kernel] that is correct, it 
is just that setting SOURCEDIR saves a question during mergemaster:

# mergemaster -Ui

*** /usr/src was not found.
     Found Makefile.inc1 in the current directory.
     Would you like to set SOURCEDIR to /clutter/src? [no and exit]

Since mergemaster is most of the time interactive anyway, you really do 
not lose very much, if unset.

But if one decides to define it, it has to be in the shell environment 
(export SOURCEDIR...), as src-env.conf or make.conf do not seem to work, 
unless I've missed something.

Verdict: So far for base only  setting MAKEOBJDIRPREFIX?= is required. 
Nice. Way easier than anticipated.

Side note: The use of "?=" seems a little counter intuitive, as one 
would suspect, that any predefined value of MAKEOBJDIRPREFIX will point 
to /usr/obj and thus render our setting useless, but in reality it does 
somehow work.
Having completely removed /usr/obj and /usr/src beforehand, no /usr/obj 
is being created (until installworld, that is) and the build still 
finishes cleanly.
It also does work with just "=", this choice just generates a whole 
bunch of warning of the kind:

make[1]: "/clutter/src/share/mk/src.sys.env.mk" line 50: warning: 
/etc/src-env.conf: Ignoring MAKEOBJDIRPREFIX entry in sub-make.  Use 
'?=' to avoid this warning.

Some information on this (mostly way above my level of understanding):

https://www.mail-archive.com/svn-src-head@freebsd.org/msg95545.html
https://lists.freebsd.org/pipermail/freebsd-current/2015-December/058823.html

And I figured, build(7) is a little outdated, as the recommended 
WITH_UNIFIED_OBJDIR has been removed with 12, there just is an 
WITHOUT_UNIFIED_OBJDIR now. See "20171101" in src/UPDATING

On to ports now.

Thanks again to all



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?ce990166-98b9-e9b2-ebe7-c21251ffd0fc>