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