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