Moving sources (base/ports) from /usr
Ede Wolf
listac at nebelschwaden.de
Fri May 15 05:47:23 UTC 2020
> 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
More information about the freebsd-questions
mailing list