]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/src.libnames.mk
Remove no longer supported mthca driver.
[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                 ifconfig \
24                 ldns \
25                 sqlite3 \
26                 ssh \
27                 ucl \
28                 unbound \
29                 zstd
30
31 _INTERNALLIBS=  \
32                 amu \
33                 bsnmptools \
34                 cron \
35                 elftc \
36                 fifolog \
37                 ipf \
38                 lpr \
39                 netbsd \
40                 ntp \
41                 ntpevent \
42                 openbsd \
43                 opts \
44                 parse \
45                 pe \
46                 pmcstat \
47                 readline \
48                 sl \
49                 sm \
50                 smdb \
51                 smutil \
52                 telnet \
53                 vers
54
55 _LIBRARIES=     \
56                 ${_PRIVATELIBS} \
57                 ${_INTERNALLIBS} \
58                 ${LOCAL_LIBRARIES} \
59                 80211 \
60                 alias \
61                 archive \
62                 asn1 \
63                 auditd \
64                 avl \
65                 begemot \
66                 bluetooth \
67                 bsdxml \
68                 bsm \
69                 bsnmp \
70                 bz2 \
71                 c \
72                 c_pic \
73                 calendar \
74                 cam \
75                 casper \
76                 cap_dns \
77                 cap_grp \
78                 cap_pwd \
79                 cap_random \
80                 cap_sysctl \
81                 com_err \
82                 compiler_rt \
83                 crypt \
84                 crypto \
85                 ctf \
86                 cuse \
87                 cxxrt \
88                 devctl \
89                 devdctl \
90                 devinfo \
91                 devstat \
92                 dialog \
93                 dl \
94                 dpv \
95                 dtrace \
96                 dwarf \
97                 edit \
98                 efivar \
99                 elf \
100                 execinfo \
101                 fetch \
102                 figpar \
103                 geom \
104                 gnuregex \
105                 gpio \
106                 gssapi \
107                 gssapi_krb5 \
108                 hdb \
109                 heimbase \
110                 heimntlm \
111                 heimsqlite \
112                 hx509 \
113                 ipsec \
114                 jail \
115                 kadm5clnt \
116                 kadm5srv \
117                 kafs5 \
118                 kdc \
119                 kiconv \
120                 krb5 \
121                 kvm \
122                 l \
123                 lzma \
124                 m \
125                 magic \
126                 md \
127                 memstat \
128                 mp \
129                 mt \
130                 nandfs \
131                 ncurses \
132                 ncursesw \
133                 netgraph \
134                 ngatm \
135                 nv \
136                 nvpair \
137                 opie \
138                 pam \
139                 panel \
140                 panelw \
141                 pcap \
142                 pcsclite \
143                 pjdlog \
144                 pmc \
145                 proc \
146                 procstat \
147                 pthread \
148                 radius \
149                 readline \
150                 roken \
151                 rpcsec_gss \
152                 rpcsvc \
153                 rt \
154                 rtld_db \
155                 sbuf \
156                 sdp \
157                 sm \
158                 smb \
159                 ssl \
160                 ssp_nonshared \
161                 stdthreads \
162                 supcplusplus \
163                 sysdecode \
164                 tacplus \
165                 termcap \
166                 termcapw \
167                 ufs \
168                 ugidfw \
169                 ulog \
170                 umem \
171                 usb \
172                 usbhid \
173                 util \
174                 uutil \
175                 vmmapi \
176                 wind \
177                 wrap \
178                 xo \
179                 y \
180                 ypclnt \
181                 z \
182                 zfs_core \
183                 zfs \
184                 zpool \
185
186 .if ${MK_BLACKLIST} != "no"
187 _LIBRARIES+= \
188                 blacklist \
189
190 .endif
191
192 .if ${MK_OFED} != "no"
193 _LIBRARIES+= \
194                 cxgb4 \
195                 ibcm \
196                 ibcommon \
197                 ibmad \
198                 ibsdp \
199                 ibumad \
200                 ibverbs \
201                 mlx4 \
202                 opensm \
203                 osmcomp \
204                 osmvendor \
205                 rdmacm \
206
207 .endif
208
209 # Each library's LIBADD needs to be duplicated here for static linkage of
210 # 2nd+ order consumers.  Auto-generating this would be better.
211 _DP_80211=      sbuf bsdxml
212 _DP_archive=    z bz2 lzma bsdxml
213 _DP_zstd=       pthread
214 .if ${MK_BLACKLIST} != "no"
215 _DP_blacklist+= pthread
216 .endif
217 .if ${MK_OPENSSL} != "no"
218 _DP_archive+=   crypto
219 .else
220 _DP_archive+=   md
221 .endif
222 _DP_sqlite3=    pthread
223 _DP_ssl=        crypto
224 _DP_ssh=        crypto crypt z
225 .if ${MK_LDNS} != "no"
226 _DP_ssh+=       ldns
227 .endif
228 _DP_edit=       ncursesw
229 .if ${MK_OPENSSL} != "no"
230 _DP_bsnmp=      crypto
231 .endif
232 _DP_geom=       bsdxml sbuf
233 _DP_cam=        sbuf
234 _DP_kvm=        elf
235 _DP_casper=     nv
236 _DP_cap_dns=    nv
237 _DP_cap_grp=    nv
238 _DP_cap_pwd=    nv
239 _DP_cap_random= nv
240 _DP_cap_sysctl= nv
241 _DP_pjdlog=     util
242 _DP_opie=       md
243 _DP_usb=        pthread
244 _DP_unbound=    ssl crypto pthread
245 _DP_rt= pthread
246 .if ${MK_OPENSSL} == "no"
247 _DP_radius=     md
248 .else
249 _DP_radius=     crypto
250 .endif
251 _DP_rtld_db=    elf procstat
252 _DP_procstat=   kvm util elf
253 .if ${MK_CXX} == "yes"
254 .if ${MK_LIBCPLUSPLUS} != "no"
255 _DP_proc=       cxxrt
256 .else
257 _DP_proc=       supcplusplus
258 .endif
259 .endif
260 .if ${MK_CDDL} != "no"
261 _DP_proc+=      ctf
262 .endif
263 _DP_proc+=      elf procstat rtld_db util
264 _DP_mp= crypto
265 _DP_memstat=    kvm
266 _DP_magic=      z
267 _DP_mt=         sbuf bsdxml
268 _DP_ldns=       crypto
269 .if ${MK_OPENSSL} != "no"
270 _DP_fetch=      ssl crypto
271 .else
272 _DP_fetch=      md
273 .endif
274 _DP_execinfo=   elf
275 _DP_dwarf=      elf
276 _DP_dpv=        dialog figpar util ncursesw
277 _DP_dialog=     ncursesw m
278 _DP_cuse=       pthread
279 _DP_atf_cxx=    atf_c
280 _DP_devstat=    kvm
281 _DP_pam=        radius tacplus opie md util
282 .if ${MK_KERBEROS} != "no"
283 _DP_pam+=       krb5
284 .endif
285 .if ${MK_OPENSSH} != "no"
286 _DP_pam+=       ssh
287 .endif
288 .if ${MK_NIS} != "no"
289 _DP_pam+=       ypclnt
290 .endif
291 _DP_readline=   ncursesw
292 _DP_roken=      crypt
293 _DP_kadm5clnt=  com_err krb5 roken
294 _DP_kadm5srv=   com_err hdb krb5 roken
295 _DP_heimntlm=   crypto com_err krb5 roken
296 _DP_hx509=      asn1 com_err crypto roken wind
297 _DP_hdb=        asn1 com_err krb5 roken sqlite3
298 _DP_asn1=       com_err roken
299 _DP_kdc=        roken hdb hx509 krb5 heimntlm asn1 crypto
300 _DP_wind=       com_err roken
301 _DP_heimbase=   pthread
302 _DP_heimipcc=   heimbase roken pthread
303 _DP_heimipcs=   heimbase roken pthread
304 _DP_kafs5=      asn1 krb5 roken
305 _DP_krb5+=      asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc
306 _DP_gssapi_krb5+=       gssapi krb5 crypto roken asn1 com_err
307 _DP_lzma=       pthread
308 _DP_ucl=        m
309 _DP_vmmapi=     util
310 _DP_ctf=        z
311 _DP_dtrace=     ctf elf proc pthread rtld_db
312 _DP_xo=         util
313 # The libc dependencies are not strictly needed but are defined to make the
314 # assert happy.
315 _DP_c=          compiler_rt
316 .if ${MK_SSP} != "no"
317 _DP_c+=         ssp_nonshared
318 .endif
319 _DP_stdthreads= pthread
320 _DP_tacplus=    md
321 _DP_panel=      ncurses
322 _DP_panelw=     ncursesw
323 _DP_rpcsec_gss= gssapi
324 _DP_smb=        kiconv
325 _DP_ulog=       md
326 _DP_fifolog=    z
327 _DP_ipf=        kvm
328 _DP_zfs=        md pthread umem util uutil m nvpair avl bsdxml geom nvpair z \
329                 zfs_core
330 _DP_zfs_core=   nvpair
331 _DP_zpool=      md pthread z nvpair avl umem
332 .if ${MK_OFED} != "no"
333 _DP_cxgb4=      ibverbs pthread
334 _DP_ibcm=       ibverbs
335 _DP_ibmad=      ibcommon ibumad
336 _DP_ibumad=     ibcommon
337 _DP_mlx4=       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 LIBPMCSTATDIR=  ${OBJTOP}/lib/libpmcstat
468 LIBPMCSTAT?=    ${LIBPMCSTATDIR}/libpmcstat.a
469
470 # Define a directory for each library.  This is useful for adding -L in when
471 # not using a --sysroot or for meta mode bootstrapping when there is no
472 # Makefile.depend.  These are sorted by directory.
473 LIBAVLDIR=      ${OBJTOP}/cddl/lib/libavl
474 LIBCTFDIR=      ${OBJTOP}/cddl/lib/libctf
475 LIBDTRACEDIR=   ${OBJTOP}/cddl/lib/libdtrace
476 LIBNVPAIRDIR=   ${OBJTOP}/cddl/lib/libnvpair
477 LIBUMEMDIR=     ${OBJTOP}/cddl/lib/libumem
478 LIBUUTILDIR=    ${OBJTOP}/cddl/lib/libuutil
479 LIBZFSDIR=      ${OBJTOP}/cddl/lib/libzfs
480 LIBZFS_COREDIR= ${OBJTOP}/cddl/lib/libzfs_core
481 LIBZPOOLDIR=    ${OBJTOP}/cddl/lib/libzpool
482 LIBCXGB4DIR=    ${OBJTOP}/contrib/ofed/usr.lib/libcxgb4
483 LIBIBCMDIR=     ${OBJTOP}/contrib/ofed/usr.lib/libibcm
484 LIBIBCOMMONDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibcommon
485 LIBIBMADDIR=    ${OBJTOP}/contrib/ofed/usr.lib/libibmad
486 LIBIBUMADDIR=   ${OBJTOP}/contrib/ofed/usr.lib/libibumad
487 LIBIBVERBSDIR=  ${OBJTOP}/contrib/ofed/usr.lib/libibverbs
488 LIBMLX4DIR=     ${OBJTOP}/contrib/ofed/usr.lib/libmlx4
489 LIBOPENSMDIR=   ${OBJTOP}/contrib/ofed/usr.lib/libopensm
490 LIBOSMCOMPDIR=  ${OBJTOP}/contrib/ofed/usr.lib/libosmcomp
491 LIBOSMVENDORDIR=        ${OBJTOP}/contrib/ofed/usr.lib/libosmvendor
492 LIBRDMACMDIR=   ${OBJTOP}/contrib/ofed/usr.lib/librdmacm
493 LIBIBSDPDIR=    ${OBJTOP}/contrib/ofed/usr.lib/libsdp
494 LIBDIALOGDIR=   ${OBJTOP}/gnu/lib/libdialog
495 LIBGCOVDIR=     ${OBJTOP}/gnu/lib/libgcov
496 LIBGOMPDIR=     ${OBJTOP}/gnu/lib/libgomp
497 LIBGNUREGEXDIR= ${OBJTOP}/gnu/lib/libregex
498 LIBSSPDIR=      ${OBJTOP}/gnu/lib/libssp
499 LIBSSP_NONSHAREDDIR=    ${OBJTOP}/gnu/lib/libssp/libssp_nonshared
500 LIBSUPCPLUSPLUSDIR=     ${OBJTOP}/gnu/lib/libsupc++
501 LIBASN1DIR=     ${OBJTOP}/kerberos5/lib/libasn1
502 LIBGSSAPI_KRB5DIR=      ${OBJTOP}/kerberos5/lib/libgssapi_krb5
503 LIBGSSAPI_NTLMDIR=      ${OBJTOP}/kerberos5/lib/libgssapi_ntlm
504 LIBGSSAPI_SPNEGODIR=    ${OBJTOP}/kerberos5/lib/libgssapi_spnego
505 LIBHDBDIR=      ${OBJTOP}/kerberos5/lib/libhdb
506 LIBHEIMBASEDIR= ${OBJTOP}/kerberos5/lib/libheimbase
507 LIBHEIMIPCCDIR= ${OBJTOP}/kerberos5/lib/libheimipcc
508 LIBHEIMIPCSDIR= ${OBJTOP}/kerberos5/lib/libheimipcs
509 LIBHEIMNTLMDIR= ${OBJTOP}/kerberos5/lib/libheimntlm
510 LIBHX509DIR=    ${OBJTOP}/kerberos5/lib/libhx509
511 LIBKADM5CLNTDIR=        ${OBJTOP}/kerberos5/lib/libkadm5clnt
512 LIBKADM5SRVDIR= ${OBJTOP}/kerberos5/lib/libkadm5srv
513 LIBKAFS5DIR=    ${OBJTOP}/kerberos5/lib/libkafs5
514 LIBKDCDIR=      ${OBJTOP}/kerberos5/lib/libkdc
515 LIBKRB5DIR=     ${OBJTOP}/kerberos5/lib/libkrb5
516 LIBROKENDIR=    ${OBJTOP}/kerberos5/lib/libroken
517 LIBWINDDIR=     ${OBJTOP}/kerberos5/lib/libwind
518 LIBATF_CDIR=    ${OBJTOP}/lib/atf/libatf-c
519 LIBATF_CXXDIR=  ${OBJTOP}/lib/atf/libatf-c++
520 LIBALIASDIR=    ${OBJTOP}/lib/libalias/libalias
521 LIBBLACKLISTDIR=        ${OBJTOP}/lib/libblacklist
522 LIBBLOCKSRUNTIMEDIR=    ${OBJTOP}/lib/libblocksruntime
523 LIBBSNMPDIR=    ${OBJTOP}/lib/libbsnmp/libbsnmp
524 LIBCASPERDIR=   ${OBJTOP}/lib/libcasper/libcasper
525 LIBCAP_DNSDIR=  ${OBJTOP}/lib/libcasper/services/cap_dns
526 LIBCAP_GRPDIR=  ${OBJTOP}/lib/libcasper/services/cap_grp
527 LIBCAP_PWDDIR=  ${OBJTOP}/lib/libcasper/services/cap_pwd
528 LIBCAP_RANDOMDIR=       ${OBJTOP}/lib/libcasper/services/cap_random
529 LIBCAP_SYSCTLDIR=       ${OBJTOP}/lib/libcasper/services/cap_sysctl
530 LIBBSDXMLDIR=   ${OBJTOP}/lib/libexpat
531 LIBKVMDIR=      ${OBJTOP}/lib/libkvm
532 LIBPTHREADDIR=  ${OBJTOP}/lib/libthr
533 LIBMDIR=        ${OBJTOP}/lib/msun
534 LIBFORMDIR=     ${OBJTOP}/lib/ncurses/form
535 LIBFORMLIBWDIR= ${OBJTOP}/lib/ncurses/formw
536 LIBMENUDIR=     ${OBJTOP}/lib/ncurses/menu
537 LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw
538 LIBNCURSESDIR=  ${OBJTOP}/lib/ncurses/ncurses
539 LIBNCURSESWDIR= ${OBJTOP}/lib/ncurses/ncursesw
540 LIBPANELDIR=    ${OBJTOP}/lib/ncurses/panel
541 LIBPANELWDIR=   ${OBJTOP}/lib/ncurses/panelw
542 LIBCRYPTODIR=   ${OBJTOP}/secure/lib/libcrypto
543 LIBSSHDIR=      ${OBJTOP}/secure/lib/libssh
544 LIBSSLDIR=      ${OBJTOP}/secure/lib/libssl
545 LIBTEKENDIR=    ${OBJTOP}/sys/teken/libteken
546 LIBEGACYDIR=    ${OBJTOP}/tools/build
547 LIBLNDIR=       ${OBJTOP}/usr.bin/lex/lib
548
549 LIBTERMCAPDIR=  ${LIBNCURSESDIR}
550 LIBTERMCAPWDIR= ${LIBNCURSESWDIR}
551
552 # Default other library directories to lib/libNAME.
553 .for lib in ${_LIBRARIES}
554 LIB${lib:tu}DIR?=       ${OBJTOP}/lib/lib${lib}
555 .endfor
556
557 # Validate that listed LIBADD are valid.
558 .for _l in ${LIBADD}
559 .if empty(_LIBRARIES:M${_l})
560 _BADLIBADD+= ${_l}
561 .endif
562 .endfor
563 .if !empty(_BADLIBADD)
564 .error ${.CURDIR}: Invalid LIBADD used which may need to be added to ${_this:T}: ${_BADLIBADD}
565 .endif
566
567 # Sanity check that libraries are defined here properly when building them.
568 .if defined(LIB) && ${_LIBRARIES:M${LIB}} != ""
569 .if !empty(LIBADD) && \
570     (!defined(_DP_${LIB}) || ${LIBADD:O:u} != ${_DP_${LIB}:O:u})
571 .error ${.CURDIR}: Missing or incorrect _DP_${LIB} entry in ${_this:T}.  Should match LIBADD for ${LIB} ('${LIBADD}' vs '${_DP_${LIB}}')
572 .endif
573 # Note that OBJTOP is not yet defined here but for the purpose of the check
574 # it is fine as it resolves to the SRC directory.
575 .if !defined(LIB${LIB:tu}DIR) || !exists(${SRCTOP}/${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,})
576 .error ${.CURDIR}: Missing or incorrect value for LIB${LIB:tu}DIR in ${_this:T}: ${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,}
577 .endif
578 .if ${_INTERNALLIBS:M${LIB}} != "" && !defined(LIB${LIB:tu})
579 .error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}.  Likely should be: LIB${LIB:tu}?= $${LIB${LIB:tu}DIR}/lib${LIB}.a
580 .endif
581 .endif
582
583 .endif  # !target(__<src.libnames.mk>__)