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