NetBSD/external
riastradh 40ca0b4614 lib: Handle various external lib directories with build_install.
This way, update builds track shlib major bumps correctly.

For example, suppose you had built Heimdal's libkrb5.so.27 and
libgssapi.so.11 linked against it, and then you updated past the recent
shlib major bump raising them to libkrb5.so.28 and libgssapi.so.12.

Without this change, the build will make the following sequence of
targets (interleaved with some others):

1. make dependall in libkrb5
2. make dependall in libgssapi
3. make install in libkrb5
4. make install in libgssapi

The existing .WAIT tags in SUBDIR ensure that (1) happens before (2)
and (3) happens before (4).  Unfortunately, this sequence is wrong,
because it will produce the following effect:

1. make dependall in libkrb5 builds libkrb5.so.28
2. make dependall in libgssapi builds libgssapi.so.12, linked against
   libkrb5.so.27
3. make install in libkrb5 installs libkrb5.so.28
4. make install in libgssapi installs libgssapi.so.12

Why the out-of-date libkrb5.so.27 in step (2)?  Because we just pass
-L${DESTDIR}/usr/lib -lkrb5 to the linker (or the equivalent with
--sysroot and implied -L/usr/lib), and ${DESTDIR}/usr/lib still has
only libkrb5.so.27 by the time of step (2), not libkrb5.so.28.

Now any applications that link against libkrb5.so _and_ libgssapi.so
will get libkrb5.so.28 and libgssapi.so.12 -- but transitively, via
libgssapi.so.12, they will also get libkrb5.so.27, which is a recipe
for disaster.

Splicing the Heimdal library subdirectories into lib/Makefile, as
this does, ensures that we run make dependall _and_ make install in
libkrb5 _before_ make dependall in libgssapi, giving the following
correct sequence:

1. make dependall in libkrb5 builds libkrb5.so.28
2. make install in libkrb5 installs libkrb5.so.28
3. make dependall in libgssapi builds libgssapi.so.12, linked against
   libkrb5.so.28
4. make install in libgssapi installs libgssapi.so.12

Note that LIBDPLIBS isn't enough here, as implemented.  LIBDPLIBS
ensures that the incremental build will remake libgssapi.so.  But it
doesn't ensure that the new libkrb5.so.28 is available before then,
so it doesn't prevent this problem.

We use the same mechanism for crypto/external/bsd/openssl/lib
already; this just extends it to other external library collections.

As an alternative, in principle perhaps we could teach LIBDPLIBS to
ensure that libkrb5.so comes out of the libkrb5 objdir, and not out
of ${DESTDIR}/usr/lib.  But that requires some work to make happen,
and make it reliable, whereas this approach we've already confirmed
works without other adverse consequences (besides leaving
grody-looking mechanism lying around) for the libcrypto major bump
already.  We need to get this pulled up to the branch so all the
other major bumps it required are handled correctly by update builds.

XXX pullup-10
2023-09-06 23:44:42 +00:00
..
amdgpu-firmware
apache2 mDNSPosix.c: free very large struct on error path 2023-08-15 00:02:16 +00:00
atheros
broadcom
bsd lib: Handle various external lib directories with build_install. 2023-09-06 23:44:42 +00:00
cddl fix uninitialised variable usage. 2023-08-03 08:04:07 +00:00
gpl2 mdoc.local: fix libbsdmalloc string name 2023-07-04 23:52:44 +00:00
gpl3 "make release" has included sanitizers with GCC 12 for a while. 2023-09-04 23:40:05 +00:00
historical
ibm-public
intel-fw-eula
intel-fw-public
lgpl3
mit */shlib_version: Ensure a boring line between RCS id and all else. 2023-09-06 12:48:15 +00:00
mpl Recursively revbump all dependents of libcrypto. 2023-09-04 18:12:44 +00:00
nvidia-firmware
ofl
public-domain fix the vax build. we could do better by choosing larger exponents. 2023-09-04 23:55:53 +00:00
realtek
zlib/pigz
Makefile
README add missing 2023-08-15 22:02:36 +00:00

README

$NetBSD: README,v 1.19 2023/08/15 22:02:36 christos Exp $

Organization of Sources:

This directory hierarchy is using an organization that separates
source for programs that we have obtained from external third
parties (where NetBSD is not the primary maintainer) from the
system source.

The hierarchy is grouped by license, and then package per license,
and is organized as follows:

	external/

	    Makefile
			Descend into the license sub-directories.

	    <license>/
			Per-license sub-directories.

		Makefile
			Descend into the package sub-directories.

		<package>/
			Per-package sub-directories.

		    Makefile
			Build the package.

		    dist/
			The third-party source for a given package.

		    bin/
		    lib/
		    sbin/
			BSD makefiles "reach over" from these into
			"../dist/".

This arrangement allows for packages to be easily disabled or
excised as necessary, either on a per-license or per-package basis.

The licenses currently used are:

	apache2		Apache 2.0 license.
			http://www.opensource.org/licenses/apache2.0.php

	atheros		Atheros License.

	broadcom	Broadcom licenses for rpi firmware and bfwm. See
			*/dist/LICENSE.broadcom*

	bsd		BSD (or equivalent) licensed software, possibly with
			the "advertising clause".
			http://www.opensource.org/licenses/bsd-license.php

	cddl		Common Development and Distribution License (the sun
			license which is based on the Mozilla Public License
			version 1.1).
			http://www.opensource.org/licenses/cddl1.php

	gpl2		GNU Public License, version 2 (or earlier).
			http://www.opensource.org/licenses/gpl-2.0.php

	gpl3		GNU Public License, version 3.
			http://www.opensource.org/licenses/gpl-3.0.html

	historical	Lucent's old license:
			http://www.opensource.org/licenses/historical.php

	ibm-public	IBM's public license:
			http://www.opensource.org/licenses/ibmpl.php

	intel-fw-eula	Intel firmware license with redistribution
			restricted to OEM.

	intel-fw-public	Intel firmware license permitting redistribution with
			terms similar to BSD licensed software.

	intel-public	Intel license permitting redistribution with
			terms similar to BSD licensed software.

	lgpl2		GNU Lesser General Public License, version 2 (or earlier).
			https://opensource.org/license/lgpl-2-1/

	lgpl3		GNU Lesser General Public License, version 3 (or earlier).
			https://opensource.org/license/lgpl-3-0/

	mit		MIT (X11) style license.
			http://www.opensource.org/licenses/mit-license.php

	mpl		Mozilla Public license.
			https://opensource.org/licenses/MPL-2.0

	nvidia-firmware	NVIDIA firmware license permitting redistribution for
			use on operating systems distributed under the terms
			of an OSI-approved open source license.

	ofl		SIL Open Font License
			https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL

	public-domain	Non-license for code that has been explicitly put
			into the Public Domain.

	realtek		RealTek license.

	zlib		Zlib (BSD-like) license.
			http://www.zlib.net/zlib_license.html

If a package has components covered by different licenses
(for example, GPL2 and the LGPL), use the <license> subdirectory
for the more restrictive license.

If a package allows the choice of a license to use, we'll
generally use the less restrictive license.

If in doubt about where a package should be located, please
contact <core@NetBSD.org> for advice.


Migration Strategy:


Eventually src/dist (and associated framework in other base source
directories) and src/gnu will be migrated to this hierarchy.


Maintenance Strategy:

The sources under src/external/<license>/<package>/dist/ are
generally a combination of a published distribution plus changes
that we submit to the maintainers and that are not yet published
by them.

Make sure all changes made to the external sources are submitted
to the appropriate maintainer, but only after coordinating with
the NetBSD maintainers.