summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2015-12-04 03:17:17 +0000
committerbdrewery <bdrewery@FreeBSD.org>2015-12-04 03:17:17 +0000
commitcd8cdf49cbfd4dac1cceb57305a55d800fa76e70 (patch)
tree27657b55fff3da09883350f32c90f96915fd382f
parent4316a3fffdffda5f5444f19a2881b5840d74223a (diff)
downloadFreeBSD-src-cd8cdf49cbfd4dac1cceb57305a55d800fa76e70.zip
FreeBSD-src-cd8cdf49cbfd4dac1cceb57305a55d800fa76e70.tar.gz
For INTERNALLIB always add in the corresponding _DP_ and use LIBADD in
the real build file. This lessens the need to define DPADD_<lib> and LDADD_<lib> to just very special cases. Sponsored by: EMC / Isilon Storage Division
-rw-r--r--sbin/ipf/libipf/Makefile2
-rw-r--r--share/mk/src.libnames.mk22
-rw-r--r--usr.sbin/fifolog/lib/Makefile1
3 files changed, 13 insertions, 12 deletions
diff --git a/sbin/ipf/libipf/Makefile b/sbin/ipf/libipf/Makefile
index 077062f..7a7a011 100644
--- a/sbin/ipf/libipf/Makefile
+++ b/sbin/ipf/libipf/Makefile
@@ -43,4 +43,6 @@ SRCS= addicmp.c addipopt.c alist_free.c alist_new.c allocmbt.c \
tcp_flags.c tcpflags.c tcpoptnames.c v6ionames.c v6optvalue.c \
var.c verbose.c
+LIBADD= kvm
+
.include <bsd.lib.mk>
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index a17bf8b..7c0d3a1 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -271,6 +271,8 @@ _DP_panelw= ncursesw
_DP_rpcsec_gss= gssapi
_DP_smb= kiconv
_DP_ulog= md
+_DP_fifolog= z
+_DP_ipf= kvm
# Define special cases
LDADD_supcplusplus= -lsupc++
@@ -293,7 +295,9 @@ LDADD_${_l}?= -lprivate${_l}
.else
LDADD_${_l}?= ${LDADD_${_l}_L} -l${_l}
.endif
-.if defined(_DP_${_l}) && defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO")
+# Add in all dependencies for static linkage.
+.if defined(_DP_${_l}) && (${_INTERNALLIBS:M${_l}} || \
+ (defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO")))
.for _d in ${_DP_${_l}}
DPADD_${_l}+= ${DPADD_${_d}}
LDADD_${_l}+= ${LDADD_${_d}}
@@ -302,23 +306,17 @@ LDADD_${_l}+= ${LDADD_${_d}}
.endfor
# These are special cases where the library is broken and anything that uses
-# it needs to add more dependencies. Many _INTERNALLIBS fall into this
-# category. Unless the library itself is broken then the proper place to
-# define dependencies is _DP_* above.
+# it needs to add more dependencies. Broken usually means that it has a
+# cyclic dependency and cannot link its own dependencies. This is bad, please
+# fix the library instead.
+# Unless the library itself is broken then the proper place to define
+# dependencies is _DP_* above.
# libatf-c++ exposes libatf-c abi hence we need to explicit link to atf_c for
# atf_cxx
DPADD_atf_cxx+= ${DPADD_atf_c}
LDADD_atf_cxx+= ${LDADD_atf_c}
-# _INTERNALLIBS.
-# XXX: This should likely be reworked to have LIBADD in them and use normal
-# _DP_ lists just to avoid temptation to add more similar entries here.
-DPADD_fifolog+= ${DPADD_z}
-LDADD_fifolog+= ${LDADD_z}
-DPADD_ipf+= ${DPADD_kvm}
-LDADD_ipf+= ${LDADD_kvm}
-
.for _l in ${LIBADD}
DPADD+= ${DPADD_${_l}:Umissing-dpadd_${_l}}
LDADD+= ${LDADD_${_l}}
diff --git a/usr.sbin/fifolog/lib/Makefile b/usr.sbin/fifolog/lib/Makefile
index fc8e6d2..f60529f 100644
--- a/usr.sbin/fifolog/lib/Makefile
+++ b/usr.sbin/fifolog/lib/Makefile
@@ -7,6 +7,7 @@ SRCS= fifolog_int.c fifolog_create.c fifolog_write_poll.c fifolog_reader.c
SRCS+= getdate.y
CFLAGS+= -I${.CURDIR}
+LIBADD= z
NO_WMISSING_VARIABLE_DECLARATIONS=
OpenPOWER on IntegriCloud