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