Deleted Added
full compact
dpadd.mk (319884) dpadd.mk (331246)
1# $Id: dpadd.mk,v 1.23 2017/02/13 16:46:01 sjg Exp $
1# $Id: dpadd.mk,v 1.26 2018/02/12 21:54:26 sjg Exp $
2#
3# @(#) Copyright (c) 2004, Simon J. Gerraty
4#
5# This file is provided in the hope that it will
6# be of use. There is absolutely NO WARRANTY.
7# Permission to copy, redistribute or otherwise
8# use this file is hereby granted provided that
9# the above copyright notice and this notice are

--- 45 unchanged lines hidden (view full) ---

55.else
56LDADD += ${LDADD_${__lib:T:R}:U${__lib:T:R:S/lib/-l/:C/\.so.*//}}
57.endif
58.endfor
59
60# DPADD can contain things other than libs
61__dpadd_libs := ${DPADD:M*/lib*}
62
2#
3# @(#) Copyright (c) 2004, Simon J. Gerraty
4#
5# This file is provided in the hope that it will
6# be of use. There is absolutely NO WARRANTY.
7# Permission to copy, redistribute or otherwise
8# use this file is hereby granted provided that
9# the above copyright notice and this notice are

--- 45 unchanged lines hidden (view full) ---

55.else
56LDADD += ${LDADD_${__lib:T:R}:U${__lib:T:R:S/lib/-l/:C/\.so.*//}}
57.endif
58.endfor
59
60# DPADD can contain things other than libs
61__dpadd_libs := ${DPADD:M*/lib*}
62
63.if defined(PROG) && ${MK_PROG_LDORDER_MK:Uno} != "no"
63# some libs have dependencies...
64# DPLIBS_* allows bsd.libnames.mk to flag libs which must be included
65# in DPADD for a given library.
66# Gather all such dependencies into __ldadd_all_xtras
67# dups will be dealt with later.
68# Note: libfoo_pic uses DPLIBS_libfoo
69__ldadd_all_xtras=
70.for __lib in ${__dpadd_libs:@d@${DPLIBS_${d:T:R:S,_pic,,}}@}
71__ldadd_all_xtras+= ${LDADD_${__lib}:U${__lib:T:R:S/lib/-l/:C/\.so.*//}}
72.if "${DPADD:M${__lib}}" == ""
73DPADD+= ${__lib}
74.endif
75.endfor
64# some libs have dependencies...
65# DPLIBS_* allows bsd.libnames.mk to flag libs which must be included
66# in DPADD for a given library.
67# Gather all such dependencies into __ldadd_all_xtras
68# dups will be dealt with later.
69# Note: libfoo_pic uses DPLIBS_libfoo
70__ldadd_all_xtras=
71.for __lib in ${__dpadd_libs:@d@${DPLIBS_${d:T:R:S,_pic,,}}@}
72__ldadd_all_xtras+= ${LDADD_${__lib}:U${__lib:T:R:S/lib/-l/:C/\.so.*//}}
73.if "${DPADD:M${__lib}}" == ""
74DPADD+= ${__lib}
75.endif
76.endfor
77.endif
76# Last of all... for libc and libgcc
77DPADD+= ${DPADD_LAST}
78
79# de-dupuplicate __ldadd_all_xtras into __ldadd_xtras
80# in reverse order so that libs end up listed after all that needed them.
81__ldadd_xtras=
82.for __lib in ${__ldadd_all_xtras:[-1..1]}
83.if "${__ldadd_xtras:M${__lib}}" == "" || ${NEED_IMPLICIT_LDADD:tl:Uno} != "no"

--- 36 unchanged lines hidden (view full) ---

120# set if it cannot be correctly derrived from ${LIBFOO}
121# Note that SRC_libfoo and INCLUDES_libfoo should be named for the
122# actual library name not the variable name that might refer to it.
123# 99% of the time the two are the same, but the DPADD logic
124# only has the library name available, so stick to that.
125#
126
127SRC_LIBS?=
78# Last of all... for libc and libgcc
79DPADD+= ${DPADD_LAST}
80
81# de-dupuplicate __ldadd_all_xtras into __ldadd_xtras
82# in reverse order so that libs end up listed after all that needed them.
83__ldadd_xtras=
84.for __lib in ${__ldadd_all_xtras:[-1..1]}
85.if "${__ldadd_xtras:M${__lib}}" == "" || ${NEED_IMPLICIT_LDADD:tl:Uno} != "no"

--- 36 unchanged lines hidden (view full) ---

122# set if it cannot be correctly derrived from ${LIBFOO}
123# Note that SRC_libfoo and INCLUDES_libfoo should be named for the
124# actual library name not the variable name that might refer to it.
125# 99% of the time the two are the same, but the DPADD logic
126# only has the library name available, so stick to that.
127#
128
129SRC_LIBS?=
128__dpadd_libs += ${SRC_LIBS}
129DPMAGIC_LIBS += ${__dpadd_libs} \
130 ${__dpadd_libs:@d@${DPMAGIC_LIBS_${d:T:R}}@}
130# magic_libs includes those we want to link with
131# as well as those we might look at
132__dpadd_magic_libs += ${__dpadd_libs} ${SRC_LIBS}
133DPMAGIC_LIBS += ${__dpadd_magic_libs} \
134 ${__dpadd_magic_libs:@d@${DPMAGIC_LIBS_${d:T:R}}@}
131
132# we skip this for staged libs
133.for __lib in ${DPMAGIC_LIBS:O:u:N${STAGE_OBJTOP:Unot}*/lib/*}
134#
135# if SRC_libfoo is not set, then we assume that the srcdir corresponding
136# to where we found the library is correct.
137#
138SRC_${__lib:T:R} ?= ${__lib:H:S,${OBJTOP},${RELSRCTOP},}

--- 45 unchanged lines hidden (view full) ---

184__ldadd=-l${__lib:T:R:S,lib,,}
185LDADD := ${LDADD:S,^${__ldadd}$,${__ldadd}_p,g}
186.endif
187.endfor
188
189#
190# We take care of duplicate suppression later.
191# don't apply :T:R too early
135
136# we skip this for staged libs
137.for __lib in ${DPMAGIC_LIBS:O:u:N${STAGE_OBJTOP:Unot}*/lib/*}
138#
139# if SRC_libfoo is not set, then we assume that the srcdir corresponding
140# to where we found the library is correct.
141#
142SRC_${__lib:T:R} ?= ${__lib:H:S,${OBJTOP},${RELSRCTOP},}

--- 45 unchanged lines hidden (view full) ---

188__ldadd=-l${__lib:T:R:S,lib,,}
189LDADD := ${LDADD:S,^${__ldadd}$,${__ldadd}_p,g}
190.endif
191.endfor
192
193#
194# We take care of duplicate suppression later.
195# don't apply :T:R too early
192__dpadd_incs += ${__dpadd_libs:u:@x@${INCLUDES_${x:T:R}}@}
193__dpadd_incs += ${__dpadd_libs:O:u:@s@${SRC_LIBS_${s:T:R}:U}@:@x@${INCLUDES_${x:T:R}}@}
196__dpadd_incs += ${__dpadd_magic_libs:u:@x@${INCLUDES_${x:T:R}}@}
197__dpadd_incs += ${__dpadd_magic_libs:O:u:@s@${SRC_LIBS_${s:T:R}:U}@:@x@${INCLUDES_${x:T:R}}@}
194
198
195__dpadd_last_incs += ${__dpadd_libs:u:@x@${INCLUDES_LAST_${x:T:R}}@}
196__dpadd_last_incs += ${__dpadd_libs:O:u:@s@${SRC_LIBS_${s:T:R}:U}@:@x@${INCLUDES_LAST_${x:T:R}}@}
199__dpadd_last_incs += ${__dpadd_magic_libs:u:@x@${INCLUDES_LAST_${x:T:R}}@}
200__dpadd_last_incs += ${__dpadd_magic_libs:O:u:@s@${SRC_LIBS_${s:T:R}:U}@:@x@${INCLUDES_LAST_${x:T:R}}@}
197
201
198.if defined(HOSTPROG) || ${MACHINE} == "host"
202.if defined(HOSTPROG) || ${MACHINE:Nhost*} == ""
199# we want any -I/usr/* last
200__dpadd_last_incs := \
201 ${__dpadd_last_incs:N-I/usr/*} \
202 ${__dpadd_incs:M-I/usr/*} \
203 ${__dpadd_last_incs:M-I/usr/*}
204__dpadd_incs := ${__dpadd_incs:N-I/usr/*}
205.endif
206

--- 66 unchanged lines hidden ---
203# we want any -I/usr/* last
204__dpadd_last_incs := \
205 ${__dpadd_last_incs:N-I/usr/*} \
206 ${__dpadd_incs:M-I/usr/*} \
207 ${__dpadd_last_incs:M-I/usr/*}
208__dpadd_incs := ${__dpadd_incs:N-I/usr/*}
209.endif
210

--- 66 unchanged lines hidden ---