and add a new helper target and script, "show-buildlink3", that outputs
a listing of the buildlink3.mk files included as well as the depth at
which they are included.
For example, "make show-buildlink3" in fonts/Xft2 displays:
zlib
fontconfig
iconv
zlib
freetype2
expat
freetype2
Xrender
renderproto
is included by packages that use dlopen(), and dlopen.builtin.mk,
which checks for the presence of built-in dl*() functions. On Darwin,
including dlopen.buildlink3.mk will cause the devel/dlcompat package
to be used if the base system lacks a dlcompat library.
or linking code that uses dl*() functions. Also re-structure a bit to
pave the way for a future dlopen.builtin.mk that handles -ldl on some
platforms and dlcompat on Darwin.
load shared objects. Some platforms require pthreads to be linked
into the application if it uses dlopen() or else the applications will
core dump when they dlopen a shared module that _is_ linked with
pthread support. Including dlopen.buildlink3.mk in a package Makefile
will cause pthread.buildlink3.mk to also be included.
It is up to the package to ensure that PTHREAD_{CFLAGS,LDFLAGS,LIBS}
(defined by pthread.buildlink3.mk) are passed to the compiler when
building/linking the applications, possibly by setting PTHREAD_AUTO_VARS
to "yes" in the package Makefile.