]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/src.libnames.mk
Update the GNU DTS file from Linux 4.11
[FreeBSD/FreeBSD.git] / share / mk / src.libnames.mk
1 # $FreeBSD$
2 #
3 # The include file <src.libnames.mk> define library names suitable
4 # for INTERNALLIB and PRIVATELIB definition
5
6 .if !target(__<bsd.init.mk>__)
7 .error src.libnames.mk cannot be included directly.
8 .endif
9
10 .if !target(__<src.libnames.mk>__)
11 __<src.libnames.mk>__:
12
13 .include <src.opts.mk>
14
15 _PRIVATELIBS=   \
16                 atf_c \
17                 atf_cxx \
18                 bsdstat \
19                 devdctl \
20                 event \
21                 heimipcc \
22                 heimipcs \
23                 ldns \
24                 sqlite3 \
25                 ssh \
26                 ucl \
27                 unbound \
28                 zstd
29
30 _INTERNALLIBS=  \
31                 amu \
32                 bsnmptools \
33                 cron \
34                 elftc \
35                 fifolog \
36                 ipf \
37                 lpr \
38                 netbsd \
39                 ntp \
40                 ntpevent \
41                 openbsd \
42                 opts \
43                 parse \
44                 pe \
45                 readline \
46                 sl \
47                 sm \
48                 smdb \
49                 smutil \
50                 telnet \
51                 vers
52
53 _LIBRARIES=     \
54                 ${_PRIVATELIBS} \
55                 ${_INTERNALLIBS} \
56                 ${LOCAL_LIBRARIES} \
57                 80211 \
58                 alias \
59                 archive \
60                 asn1 \
61                 auditd \
62                 avl \
63                 begemot \
64                 bluetooth \
65                 bsdxml \
66                 bsm \
67                 bsnmp \
68                 bz2 \
69                 c \
70                 c_pic \
71                 calendar \
72                 cam \
73                 casper \
74                 cap_dns \
75                 cap_grp \
76                 cap_pwd \
77                 cap_random \
78                 cap_sysctl \
79                 com_err \
80                 compiler_rt \
81                 crypt \
82                 crypto \
83                 ctf \
84                 cuse \
85                 cxxrt \
86                 devctl \
87                 devdctl \
88                 devinfo \
89                 devstat \
90                 dialog \
91                 dpv \
92                 dtrace \
93                 dwarf \
94                 edit \
95                 efivar \
96                 elf \
97                 execinfo \
98                 fetch \
99                 figpar \
100                 geom \
101                 gnuregex \
102                 gpio \
103                 gssapi \
104                 gssapi_krb5 \
105                 hdb \
106                 heimbase \
107                 heimntlm \
108                 heimsqlite \
109                 hx509 \
110                 ifconfig \
111                 ipsec \
112                 jail \
113                 kadm5clnt \
114                 kadm5srv \
115                 kafs5 \
116                 kdc \
117                 kiconv \
118                 krb5 \
119                 kvm \
120                 l \
121                 lzma \
122                 m \
123                 magic \
124                 md \
125                 memstat \
126                 mp \
127                 mt \
128                 nandfs \
129                 ncurses \
130                 ncursesw \
131                 netgraph \
132                 ngatm \
133                 nv \
134                 nvpair \
135                 opie \
136                 pam \
137                 panel \
138                 panelw \
139                 pcap \
140                 pcsclite \
141                 pjdlog \
142                 pmc \
143                 proc \
144                 procstat \
145                 pthread \
146                 radius \
147                 readline \
148                 roken \
149                 rpcsec_gss \
150                 rpcsvc \
151                 rt \
152                 rtld_db \
153                 sbuf \
154                 sdp \
155                 sm \
156                 smb \
157                 ssl \
158                 ssp_nonshared \
159                 stdthreads \
160                 supcplusplus \
161                 sysdecode \
162                 tacplus \
163                 termcap \
164                 termcapw \
165                 ufs \
166                 ugidfw \
167                 ulog \
168                 umem \
169                 usb \
170                 usbhid \
171                 util \
172                 uutil \
173                 vmmapi \
174                 wind \
175                 wrap \
176                 xo \
177                 y \
178                 ypclnt \
179                 z \
180                 zfs_core \
181                 zfs \
182                 zpool \
183
184 .if ${MK_BLACKLIST} != "no"
185 _LIBRARIES+= \
186                 blacklist \
187
188 .endif
189
190 .if ${MK_OFED} != "no"
191 _LIBRARIES+= \
192                 cxgb4 \
193                 ibcm \
194                 ibcommon \
195                 ibmad \
196                 ibsdp \
197                 ibumad \
198                 ibverbs \
199                 mlx4 \
200                 mthca \
201                 opensm \
202                 osmcomp \
203                 osmvendor \
204                 rdmacm \
205
206 .endif
207
208 # Each library's LIBADD needs to be duplicated here for static linkage of
209 # 2nd+ order consumers.  Auto-generating this would be better.
210 _DP_80211=      sbuf bsdxml
211 _DP_archive=    z bz2 lzma bsdxml
212 _DP_zstd=       pthread
213 .if ${MK_BLACKLIST} != "no"
214 _DP_blacklist+= pthread
215 .endif
216 .if ${MK_OPENSSL} != "no"
217 _DP_archive+=   crypto
218 .else
219 _DP_archive+=   md
220 .endif
221 _DP_sqlite3=    pthread
222 _DP_ssl=        crypto
223 _DP_ssh=        crypto crypt z
224 .if ${MK_LDNS} != "no"
225 _DP_ssh+=       ldns
226 .endif
227 _DP_edit=       ncursesw
228 .if ${MK_OPENSSL} != "no"
229 _DP_bsnmp=      crypto
230 .endif
231 _DP_geom=       bsdxml sbuf
232 _DP_cam=        sbuf
233 _DP_kvm=        elf
234 _DP_casper=     nv
235 _DP_cap_dns=    nv
236 _DP_cap_grp=    nv
237 _DP_cap_pwd=    nv
238 _DP_cap_random= nv
239 _DP_cap_sysctl= nv
240 _DP_pjdlog=     util
241 _DP_opie=       md
242 _DP_usb=        pthread
243 _DP_unbound=    ssl crypto pthread
244 _DP_rt= pthread
245 .if ${MK_OPENSSL} == "no"
246 _DP_radius=     md
247 .else
248 _DP_radius=     crypto
249 .endif
250 _DP_rtld_db=    elf procstat
251 _DP_procstat=   kvm util elf
252 .if ${MK_CXX} == "yes"
253 .if ${MK_LIBCPLUSPLUS} != "no"
254 _DP_proc=       cxxrt
255 .else
256 _DP_proc=       supcplusplus
257 .endif
258 .endif
259 .if ${MK_CDDL} != "no"
260 _DP_proc+=      ctf
261 .endif
262 _DP_proc+=      elf procstat rtld_db util
263 _DP_mp= crypto
264 _DP_memstat=    kvm
265 _DP_magic=      z
266 _DP_mt=         sbuf bsdxml
267 _DP_ldns=       crypto
268 .if ${MK_OPENSSL} != "no"
269 _DP_fetch=      ssl crypto
270 .else
271 _DP_fetch=      md
272 .endif
273 _DP_execinfo=   elf
274 _DP_dwarf=      elf
275 _DP_dpv=        dialog figpar util ncursesw
276 _DP_dialog=     ncursesw m
277 _DP_cuse=       pthread
278 _DP_atf_cxx=    atf_c
279 _DP_devstat=    kvm
280 _DP_pam=        radius tacplus opie md util
281 .if ${MK_KERBEROS} != "no"
282 _DP_pam+=       krb5
283 .endif
284 .if ${MK_OPENSSH} != "no"
285 _DP_pam+=       ssh
286 .endif
287 .if ${MK_NIS} != "no"
288 _DP_pam+=       ypclnt
289 .endif
290 _DP_readline=   ncursesw
291 _DP_roken=      crypt
292 _DP_kadm5clnt=  com_err krb5 roken
293 _DP_kadm5srv=   com_err hdb krb5 roken
294 _DP_heimntlm=   crypto com_err krb5 roken
295 _DP_hx509=      asn1 com_err crypto roken wind
296 _DP_hdb=        asn1 com_err krb5 roken sqlite3
297 _DP_asn1=       com_err roken
298 _DP_kdc=        roken hdb hx509 krb5 heimntlm asn1 crypto
299 _DP_wind=       com_err roken
300 _DP_heimbase=   pthread
301 _DP_heimipcc=   heimbase roken pthread
302 _DP_heimipcs=   heimbase roken pthread
303 _DP_kafs5=      asn1 krb5 roken
304 _DP_krb5+=      asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc
305 _DP_gssapi_krb5+=       gssapi krb5 crypto roken asn1 com_err
306 _DP_lzma=       pthread
307 _DP_ucl=        m
308 _DP_vmmapi=     util
309 _DP_ctf=        z
310 _DP_dtrace=     ctf elf proc pthread rtld_db
311 _DP_xo=         util
312 # The libc dependencies are not strictly needed but are defined to make the
313 # assert happy.
314 _DP_c=          compiler_rt
315 .if ${MK_SSP} != "no"
316 _DP_c+=         ssp_nonshared
317 .endif
318 _DP_stdthreads= pthread
319 _DP_tacplus=    md
320 _DP_panel=      ncurses
321 _DP_panelw=     ncursesw
322 _DP_rpcsec_gss= gssapi
323 _DP_smb=        kiconv
324 _DP_ulog=       md
325 _DP_fifolog=    z
326 _DP_ipf=        kvm
327 _DP_zfs=        md pthread umem util uutil m nvpair avl bsdxml geom nvpair z \
328                 zfs_core
329 _DP_zfs_core=   nvpair
330 _DP_zpool=      md pthread z nvpair avl umem
331 .if ${MK_OFED} != "no"
332 _DP_cxgb4=      ibverbs pthread
333 _DP_ibcm=       ibverbs
334 _DP_ibmad=      ibcommon ibumad
335 _DP_ibumad=     ibcommon
336 _DP_mlx4=       ibverbs pthread
337 _DP_mthca=      ibverbs pthread
338 _DP_opensm=     pthread
339 _DP_osmcomp=    pthread
340 _DP_osmvendor=  ibumad opensm osmcomp pthread
341 _DP_rdmacm=     ibverbs
342 .endif
343
344 # Define special cases
345 LDADD_supcplusplus=     -lsupc++
346 LIBATF_C=       ${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf-c.a
347 LIBATF_CXX=     ${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf-c++.a
348 LDADD_atf_c=    -lprivateatf-c
349 LDADD_atf_cxx=  -lprivateatf-c++
350
351 .for _l in ${_PRIVATELIBS}
352 LIB${_l:tu}?=   ${LIBDESTDIR}${LIBDIR_BASE}/libprivate${_l}.a
353 .endfor
354
355 .for _l in ${_LIBRARIES}
356 .if ${_INTERNALLIBS:M${_l}}
357 LDADD_${_l}_L+=         -L${LIB${_l:tu}DIR}
358 .endif
359 DPADD_${_l}?=   ${LIB${_l:tu}}
360 .if ${_PRIVATELIBS:M${_l}}
361 LDADD_${_l}?=   -lprivate${_l}
362 .else
363 LDADD_${_l}?=   ${LDADD_${_l}_L} -l${_l}
364 .endif
365 # Add in all dependencies for static linkage.
366 .if defined(_DP_${_l}) && (${_INTERNALLIBS:M${_l}} || \
367     (defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO")))
368 .for _d in ${_DP_${_l}}
369 DPADD_${_l}+=   ${DPADD_${_d}}
370 LDADD_${_l}+=   ${LDADD_${_d}}
371 .endfor
372 .endif
373 .endfor
374
375 # These are special cases where the library is broken and anything that uses
376 # it needs to add more dependencies.  Broken usually means that it has a
377 # cyclic dependency and cannot link its own dependencies.  This is bad, please
378 # fix the library instead.
379 # Unless the library itself is broken then the proper place to define
380 # dependencies is _DP_* above.
381
382 # libatf-c++ exposes libatf-c abi hence we need to explicit link to atf_c for
383 # atf_cxx
384 DPADD_atf_cxx+= ${DPADD_atf_c}
385 LDADD_atf_cxx+= ${LDADD_atf_c}
386
387 # Detect LDADD/DPADD that should be LIBADD, before modifying LDADD here.
388 _BADLDADD=
389 .for _l in ${LDADD:M-l*:N-l*/*:C,^-l,,}
390 .if ${_LIBRARIES:M${_l}} && !${_PRIVATELIBS:M${_l}}
391 _BADLDADD+=     ${_l}
392 .endif
393 .endfor
394 .if !empty(_BADLDADD)
395 .error ${.CURDIR}: These libraries should be LIBADD+=foo rather than DPADD/LDADD+=-lfoo: ${_BADLDADD}
396 .endif
397
398 .for _l in ${LIBADD}
399 DPADD+=         ${DPADD_${_l}}
400 LDADD+=         ${LDADD_${_l}}
401 .endfor
402
403 # INTERNALLIB definitions.
404 LIBELFTCDIR=    ${OBJTOP}/lib/libelftc
405 LIBELFTC?=      ${LIBELFTCDIR}/libelftc.a
406
407 LIBPEDIR=       ${OBJTOP}/lib/libpe
408 LIBPE?=         ${LIBPEDIR}/libpe.a
409
410 LIBREADLINEDIR= ${OBJTOP}/gnu/lib/libreadline/readline
411 LIBREADLINE?=   ${LIBREADLINEDIR}/libreadline.a
412
413 LIBOPENBSDDIR=  ${OBJTOP}/lib/libopenbsd
414 LIBOPENBSD?=    ${LIBOPENBSDDIR}/libopenbsd.a
415
416 LIBSMDIR=       ${OBJTOP}/lib/libsm
417 LIBSM?=         ${LIBSMDIR}/libsm.a
418
419 LIBSMDBDIR=     ${OBJTOP}/lib/libsmdb
420 LIBSMDB?=       ${LIBSMDBDIR}/libsmdb.a
421
422 LIBSMUTILDIR=   ${OBJTOP}/lib/libsmutil
423 LIBSMUTIL?=     ${LIBSMUTILDIR}/libsmutil.a
424
425 LIBNETBSDDIR?=  ${OBJTOP}/lib/libnetbsd
426 LIBNETBSD?=     ${LIBNETBSDDIR}/libnetbsd.a
427
428 LIBVERSDIR?=    ${OBJTOP}/kerberos5/lib/libvers
429 LIBVERS?=       ${LIBVERSDIR}/libvers.a
430
431 LIBSLDIR=       ${OBJTOP}/kerberos5/lib/libsl
432 LIBSL?=         ${LIBSLDIR}/libsl.a
433
434 LIBIPFDIR=      ${OBJTOP}/sbin/ipf/libipf
435 LIBIPF?=        ${LIBIPFDIR}/libipf.a
436
437 LIBTELNETDIR=   ${OBJTOP}/lib/libtelnet
438 LIBTELNET?=     ${LIBTELNETDIR}/libtelnet.a
439
440 LIBCRONDIR=     ${OBJTOP}/usr.sbin/cron/lib
441 LIBCRON?=       ${LIBCRONDIR}/libcron.a
442
443 LIBNTPDIR=      ${OBJTOP}/usr.sbin/ntp/libntp
444 LIBNTP?=        ${LIBNTPDIR}/libntp.a
445
446 LIBNTPEVENTDIR= ${OBJTOP}/usr.sbin/ntp/libntpevent
447 LIBNTPEVENT?=   ${LIBNTPEVENTDIR}/libntpevent.a
448
449 LIBOPTSDIR=     ${OBJTOP}/usr.sbin/ntp/libopts
450 LIBOPTS?=       ${LIBOPTSDIR}/libopts.a
451
452 LIBPARSEDIR=    ${OBJTOP}/usr.sbin/ntp/libparse
453 LIBPARSE?=      ${LIBPARSEDIR}/libparse.a
454
455 LIBLPRDIR=      ${OBJTOP}/usr.sbin/lpr/common_source
456 LIBLPR?=        ${LIBLPRDIR}/liblpr.a
457
458 LIBFIFOLOGDIR=  ${OBJTOP}/usr.sbin/fifolog/lib
459 LIBFIFOLOG?=    ${LIBFIFOLOGDIR}/libfifolog.a
460
461 LIBBSNMPTOOLSDIR=       ${OBJTOP}/usr.sbin/bsnmpd/tools/libbsnmptools
462 LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a
463
464 LIBAMUDIR=      ${OBJTOP}/usr.sbin/amd/libamu
465 LIBAMU?=        ${LIBAMUDIR}/libamu.a
466
467 # Define a directory for each library.  This is useful for adding -L in when
468 # not using a --sysroot or for meta mode bootstrapping when there is no
469 # Makefile.depend.  These are sorted by directory.
470 LIBAVLDIR=      ${OBJTOP}/cddl/lib/libavl
471 LIBCTFDIR=      ${OBJTOP}/cddl/lib/libctf
472 LIBDTRACEDIR=   ${OBJTOP}/cddl/lib/libdtrace
473 LIBNVPAIRDIR=   ${OBJTOP}/cddl/lib/libnvpair
474 LIBUMEMDIR=     ${OBJTOP}/cddl/lib/libumem
475 LIBUUTILDIR=    ${OBJTOP}/cddl/lib/libuutil
476 LIBZFSDIR=      ${OBJTOP}/cddl/lib/libzfs
477 LIBZFS_COREDIR= ${OBJTOP}/cddl/lib/libzfs_core
478 LIBZPOOLDIR=    ${OBJTOP}/cddl/lib/libzpool
479 LIBCXGB4DIR=    ${OBJTOP}/contrib/ofed/usr.lib/libcxgb4
480 LIBIBCMDIR=     ${OBJTOP}/contrib/ofed/usr.lib/libibcm
481 LIBIBCOMMONDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibcommon
482 LIBIBMADDIR=    ${OBJTOP}/contrib/ofed/usr.lib/libibmad
483 LIBIBUMADDIR=   ${OBJTOP}/contrib/ofed/usr.lib/libibumad
484 LIBIBVERBSDIR=  ${OBJTOP}/contrib/ofed/usr.lib/libibverbs
485 LIBMLX4DIR=     ${OBJTOP}/contrib/ofed/usr.lib/libmlx4
486 LIBMTHCADIR=    ${OBJTOP}/contrib/ofed/usr.lib/libmthca
487 LIBOPENSMDIR=   ${OBJTOP}/contrib/ofed/usr.lib/libopensm
488 LIBOSMCOMPDIR=  ${OBJTOP}/contrib/ofed/usr.lib/libosmcomp
489 LIBOSMVENDORDIR=        ${OBJTOP}/contrib/ofed/usr.lib/libosmvendor
490 LIBRDMACMDIR=   ${OBJTOP}/contrib/ofed/usr.lib/librdmacm
491 LIBIBSDPDIR=    ${OBJTOP}/contrib/ofed/usr.lib/libsdp
492 LIBDIALOGDIR=   ${OBJTOP}/gnu/lib/libdialog
493 LIBGCOVDIR=     ${OBJTOP}/gnu/lib/libgcov
494 LIBGOMPDIR=     ${OBJTOP}/gnu/lib/libgomp
495 LIBGNUREGEXDIR= ${OBJTOP}/gnu/lib/libregex
496 LIBSSPDIR=      ${OBJTOP}/gnu/lib/libssp
497 LIBSSP_NONSHAREDDIR=    ${OBJTOP}/gnu/lib/libssp/libssp_nonshared
498 LIBSUPCPLUSPLUSDIR=     ${OBJTOP}/gnu/lib/libsupc++
499 LIBASN1DIR=     ${OBJTOP}/kerberos5/lib/libasn1
500 LIBGSSAPI_KRB5DIR=      ${OBJTOP}/kerberos5/lib/libgssapi_krb5
501 LIBGSSAPI_NTLMDIR=      ${OBJTOP}/kerberos5/lib/libgssapi_ntlm
502 LIBGSSAPI_SPNEGODIR=    ${OBJTOP}/kerberos5/lib/libgssapi_spnego
503 LIBHDBDIR=      ${OBJTOP}/kerberos5/lib/libhdb
504 LIBHEIMBASEDIR= ${OBJTOP}/kerberos5/lib/libheimbase
505 LIBHEIMIPCCDIR= ${OBJTOP}/kerberos5/lib/libheimipcc
506 LIBHEIMIPCSDIR= ${OBJTOP}/kerberos5/lib/libheimipcs
507 LIBHEIMNTLMDIR= ${OBJTOP}/kerberos5/lib/libheimntlm
508 LIBHX509DIR=    ${OBJTOP}/kerberos5/lib/libhx509
509 LIBKADM5CLNTDIR=        ${OBJTOP}/kerberos5/lib/libkadm5clnt
510 LIBKADM5SRVDIR= ${OBJTOP}/kerberos5/lib/libkadm5srv
511 LIBKAFS5DIR=    ${OBJTOP}/kerberos5/lib/libkafs5
512 LIBKDCDIR=      ${OBJTOP}/kerberos5/lib/libkdc
513 LIBKRB5DIR=     ${OBJTOP}/kerberos5/lib/libkrb5
514 LIBROKENDIR=    ${OBJTOP}/kerberos5/lib/libroken
515 LIBWINDDIR=     ${OBJTOP}/kerberos5/lib/libwind
516 LIBATF_CDIR=    ${OBJTOP}/lib/atf/libatf-c
517 LIBATF_CXXDIR=  ${OBJTOP}/lib/atf/libatf-c++
518 LIBALIASDIR=    ${OBJTOP}/lib/libalias/libalias
519 LIBBLACKLISTDIR=        ${OBJTOP}/lib/libblacklist
520 LIBBLOCKSRUNTIMEDIR=    ${OBJTOP}/lib/libblocksruntime
521 LIBBSNMPDIR=    ${OBJTOP}/lib/libbsnmp/libbsnmp
522 LIBCASPERDIR=   ${OBJTOP}/lib/libcasper/libcasper
523 LIBCAP_DNSDIR=  ${OBJTOP}/lib/libcasper/services/cap_dns
524 LIBCAP_GRPDIR=  ${OBJTOP}/lib/libcasper/services/cap_grp
525 LIBCAP_PWDDIR=  ${OBJTOP}/lib/libcasper/services/cap_pwd
526 LIBCAP_RANDOMDIR=       ${OBJTOP}/lib/libcasper/services/cap_random
527 LIBCAP_SYSCTLDIR=       ${OBJTOP}/lib/libcasper/services/cap_sysctl
528 LIBBSDXMLDIR=   ${OBJTOP}/lib/libexpat
529 LIBKVMDIR=      ${OBJTOP}/lib/libkvm
530 LIBPTHREADDIR=  ${OBJTOP}/lib/libthr
531 LIBMDIR=        ${OBJTOP}/lib/msun
532 LIBFORMDIR=     ${OBJTOP}/lib/ncurses/form
533 LIBFORMLIBWDIR= ${OBJTOP}/lib/ncurses/formw
534 LIBMENUDIR=     ${OBJTOP}/lib/ncurses/menu
535 LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw
536 LIBNCURSESDIR=  ${OBJTOP}/lib/ncurses/ncurses
537 LIBNCURSESWDIR= ${OBJTOP}/lib/ncurses/ncursesw
538 LIBPANELDIR=    ${OBJTOP}/lib/ncurses/panel
539 LIBPANELWDIR=   ${OBJTOP}/lib/ncurses/panelw
540 LIBCRYPTODIR=   ${OBJTOP}/secure/lib/libcrypto
541 LIBSSHDIR=      ${OBJTOP}/secure/lib/libssh
542 LIBSSLDIR=      ${OBJTOP}/secure/lib/libssl
543 LIBTEKENDIR=    ${OBJTOP}/sys/teken/libteken
544 LIBEGACYDIR=    ${OBJTOP}/tools/build
545 LIBLNDIR=       ${OBJTOP}/usr.bin/lex/lib
546
547 LIBTERMCAPDIR=  ${LIBNCURSESDIR}
548 LIBTERMCAPWDIR= ${LIBNCURSESWDIR}
549
550 # Default other library directories to lib/libNAME.
551 .for lib in ${_LIBRARIES}
552 LIB${lib:tu}DIR?=       ${OBJTOP}/lib/lib${lib}
553 .endfor
554
555 # Validate that listed LIBADD are valid.
556 .for _l in ${LIBADD}
557 .if empty(_LIBRARIES:M${_l})
558 _BADLIBADD+= ${_l}
559 .endif
560 .endfor
561 .if !empty(_BADLIBADD)
562 .error ${.CURDIR}: Invalid LIBADD used which may need to be added to ${_this:T}: ${_BADLIBADD}
563 .endif
564
565 # Sanity check that libraries are defined here properly when building them.
566 .if defined(LIB) && ${_LIBRARIES:M${LIB}} != ""
567 .if !empty(LIBADD) && \
568     (!defined(_DP_${LIB}) || ${LIBADD:O:u} != ${_DP_${LIB}:O:u})
569 .error ${.CURDIR}: Missing or incorrect _DP_${LIB} entry in ${_this:T}.  Should match LIBADD for ${LIB} ('${LIBADD}' vs '${_DP_${LIB}}')
570 .endif
571 # Note that OBJTOP is not yet defined here but for the purpose of the check
572 # it is fine as it resolves to the SRC directory.
573 .if !defined(LIB${LIB:tu}DIR) || !exists(${SRCTOP}/${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,})
574 .error ${.CURDIR}: Missing or incorrect value for LIB${LIB:tu}DIR in ${_this:T}: ${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,}
575 .endif
576 .if ${_INTERNALLIBS:M${LIB}} != "" && !defined(LIB${LIB:tu})
577 .error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}.  Likely should be: LIB${LIB:tu}?= $${LIB${LIB:tu}DIR}/lib${LIB}.a
578 .endif
579 .endif
580
581 .endif  # !target(__<src.libnames.mk>__)