Implement LIBADD

LIBADD will automatically set DPADD and LDADD when needed including their
dependencies, LIBADD automatically handles private and internal libs so that
the end user Makefile does not have to care about it.

This allows to reduce overlinking on the base system leaving the framework get
the dependencies properly.

It also allows to built components binaries statically.

To use it:

Replace:
DPADD=	${LIBARCHIVE} ${LIBSSL}
LDADD=	-larchive -lssl

by:
LIBADD=	archive ssl

Differential Revision:	https://reviews.freebsd.org/D1209
Reviewed by:	brooks imp
Correctly specify -L for internal and private libs
Convert to LIBADD.

Reviewed by:	bapt
Import libgpio.

This is a thin wrapper around the kernel interface which should make
it easier to write GPIO applications.  gpioctl(8) will be converted to
use this library in a separate commit.

Differential Revision:	https://reviews.freebsd.org/D1183
Reviewed by:	adrian, loos
Discussed on:	arm@, embedded@
Relnotes:	yes
Skip L2 addresses lookups for p2p interfaces.

Discussed with:	melifaro
Sponsored by:	Yandex LLC
Convert mandoc to LIBADD

While here remove the ugly LDMANDOC
Convert makefs to LIBADD

Add definition of libnetbsd in src.libnames.mk
Each time something links to sqlite3 it should link to pthread
Avoid code duplication by directly adding _INSTALLLIBS and _PRIVATELIBS into
_LIBRARIES

Reported by:	emaste
Fix dependencies in case of building statically
Fix typo
Forgot to convert demandoc along with mandoc
s/cft/ctf
Define special case for atf which libraries names are different from their
declaration
Fix build.
Do not overwrite any LIBNETBSD or LIBNETBSDDIR if they are already defined
libatf-c++ exposes libatf-c abi hence we need to explicit link to atf-c if
atf-c++ is requested
libevent is an internallib
Fix the fix
Add missing headers needed by write().