summaryrefslogtreecommitdiffstats
path: root/share/mk
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2015-12-15 02:51:05 +0000
committerbdrewery <bdrewery@FreeBSD.org>2015-12-15 02:51:05 +0000
commit0c7aaa9581b501985f743f2945e2a36b7c09f871 (patch)
tree266951b6788fd5b0a44b1cc51f52170044a64894 /share/mk
parente66dbae40be9305c6d77c0c3f285be4c946558f8 (diff)
downloadFreeBSD-src-0c7aaa9581b501985f743f2945e2a36b7c09f871.zip
FreeBSD-src-0c7aaa9581b501985f743f2945e2a36b7c09f871.tar.gz
DIRDEPS_BUILD: Support bootstrapping from PROGS.(DPADD|LIBADD).
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'share/mk')
-rw-r--r--share/mk/local.dirdeps.mk21
1 files changed, 18 insertions, 3 deletions
diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk
index 0f093b6..ae2c00a6 100644
--- a/share/mk/local.dirdeps.mk
+++ b/share/mk/local.dirdeps.mk
@@ -129,14 +129,28 @@ DIRDEPS+= lib/msun
.if !empty(SRCS:M*.y)
DIRDEPS+= usr.bin/yacc.host
.endif
+# Gather PROGS dependencies
+.if !empty(PROGS)
+_PROGS_LIBADD=
+_PROGS_DPADD=
+.for _prog in ${PROGS}
+.if !empty(LIBADD.${_prog})
+_PROGS_LIBADD+= ${LIBADD.${_prog}}
+.endif
+.if !empty(DPADD.${_prog})
+_PROGS_DPADD+= ${DPADD.${_prog}}
+.endif
+.endfor
+.endif # !empty(PROGS)
.if !empty(DPADD)
# Taken from meta.autodep.mk (where it only does something with
# BUILD_AT_LEVEL0, which we don't use).
# This only works for DPADD with full OBJ/SRC paths, which is mostly just
# _INTERNALLIBS.
+_DPADD= ${DPADD} ${_PROGS_DPADD}
_DP_DIRDEPS= \
- ${DPADD:M${OBJTOP}*:H:N.:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \
- ${DPADD:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u}
+ ${_DPADD:O:u:M${OBJTOP}*:H:N.:tA:C,${OBJTOP}[^/]*/,,:N.:O:u} \
+ ${_DPADD:O:u:M${OBJROOT}*:N${OBJTOP}*:N${STAGE_ROOT}/*:H:S,${OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u}
# Resolve the paths to RELDIRs
.if !empty(_DP_DIRDEPS)
DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,:tA:C,^${SRCTOP}/,,}
@@ -144,7 +158,8 @@ DIRDEPS+= ${_DP_DIRDEPS:C,^,${SRCTOP}/,:tA:C,^${SRCTOP}/,,}
.endif # !empty(DPADD)
.if !empty(LIBADD)
# Also handle LIBADD for non-internal libraries.
-.for _lib in ${LIBADD}
+_ALL_LIBADD= ${LIBADD} ${_PROGS_LIBADD}
+.for _lib in ${_ALL_LIBADD:O:u}
_lib${_lib}reldir= ${LIB${_lib:tu}DIR:C,${OBJTOP}/,,}
.if defined(LIB${_lib:tu}DIR) && ${DIRDEPS:M${_lib${_lib}reldir}} == "" && \
exists(${SRCTOP}/${_lib${_lib}reldir})
OpenPOWER on IntegriCloud