xref: /freebsd/share/mk/src.libnames.mk (revision dd21556857e8d40f66bf5ad54754d9d52669ebf7)
1#
2# The include file <src.libnames.mk> define library names suitable
3# for INTERNALLIB and PRIVATELIB definition
4
5.if !target(__<bsd.init.mk>__)
6.error src.libnames.mk cannot be included directly.
7.endif
8
9.if !target(__<src.libnames.mk>__)
10__<src.libnames.mk>__:
11
12.include <src.opts.mk>
13
14_PRIVATELIBS=	\
15		atf_c \
16		atf_cxx \
17		auditd \
18		bsddialog \
19		bsdstat \
20		cbor \
21		devdctl \
22		event1 \
23		fido2 \
24		gmock \
25		gtest \
26		gmock_main \
27		gtest_main \
28		heimipcc \
29		heimipcs \
30		kldelf \
31		ldns \
32		sqlite3 \
33		ssh \
34		ucl \
35		unbound \
36		zstd
37
38# Let projects based on FreeBSD append to _PRIVATELIBS
39# by maintaining their own LOCAL_PRIVATELIBS list.
40_PRIVATELIBS+=	${LOCAL_PRIVATELIBS}
41
42_INTERNALLIBS=	\
43		amu \
44		bsnmptools \
45		c_nossp_pic \
46		cron \
47		der \
48		diff \
49		elftc \
50		fdt \
51		fifolog \
52		ifconfig \
53		ipf \
54		iscsiutil \
55		lpr \
56		lua \
57		lutok \
58		netbsd \
59		ntp \
60		ntpevent \
61		nvmf \
62		openbsd \
63		opts \
64		parse \
65		pe \
66		pfctl \
67		pkgecc \
68		pmcstat \
69		sl \
70		sm \
71		smdb \
72		smutil \
73		telnet \
74		vers \
75		wpaap \
76		wpacommon \
77		wpacrypto \
78		wpadrivers \
79		wpaeap_common \
80		wpaeap_peer \
81		wpaeap_server \
82		wpaeapol_auth \
83		wpaeapol_supp \
84		wpal2_packet \
85		wpapasn \
86		wparadius \
87		wparsn_supp \
88		wpatls \
89		wpautils \
90		wpawps
91
92# Let projects based on FreeBSD append to _INTERNALLIBS
93# by maintaining their own LOCAL_INTERNALLIBS list.
94_INTERNALLIBS+=	${LOCAL_INTERNALLIBS}
95
96_LIBRARIES=	\
97		${_PRIVATELIBS} \
98		${_INTERNALLIBS} \
99		${LOCAL_LIBRARIES} \
100		80211 \
101		9p \
102		alias \
103		archive \
104		asn1 \
105		avl \
106		BlocksRuntime \
107		be \
108		begemot \
109		bluetooth \
110		bsdxml \
111		bsm \
112		bsnmp \
113		bz2 \
114		c \
115		c_pic \
116		calendar \
117		cam \
118		casper \
119		cap_dns \
120		cap_fileargs \
121		cap_grp \
122		cap_net \
123		cap_netdb \
124		cap_pwd \
125		cap_sysctl \
126		cap_syslog \
127		com_err \
128		compiler_rt \
129		crypt \
130		crypto \
131		ctf \
132		cuse \
133		cxxrt \
134		devctl \
135		devdctl \
136		devinfo \
137		devstat \
138		dialog \
139		dl \
140		dpv \
141		dtrace \
142		dwarf \
143		edit \
144		efivar \
145		elf \
146		execinfo \
147		fetch \
148		figpar \
149		formw \
150		geom \
151		gpio \
152		gssapi \
153		gssapi_krb5 \
154		hdb \
155		heimbase \
156		heimntlm \
157		heimsqlite \
158		hx509 \
159		icp \
160		ipsec \
161		ipt \
162		jail \
163		kadm5clnt \
164		kadm5srv \
165		kafs5 \
166		kdc \
167		kiconv \
168		krb5 \
169		kvm \
170		l \
171		lzma \
172		m \
173		magic \
174		md \
175		memstat \
176		mp \
177		mt \
178		ncursesw \
179		netgraph \
180		netmap \
181		ngatm \
182		nv \
183		nvpair \
184		opencsd \
185		pam \
186		panel \
187		panelw \
188		pcap \
189		pcsclite \
190		pjdlog \
191		pmc \
192		proc \
193		procstat \
194		pthread \
195		radius \
196		regex \
197		roken \
198		rpcsec_gss \
199		rpcsvc \
200		rt \
201		rtld_db \
202		sbuf \
203		sdp \
204		sm \
205		smb \
206		spl \
207		ssl \
208		ssp_nonshared \
209		stats \
210		stdthreads \
211		supcplusplus \
212		sys \
213		sysdecode \
214		tacplus \
215		termcapw \
216		tinfow \
217		tpool \
218		ufs \
219		ugidfw \
220		ulog \
221		umem \
222		usb \
223		usbhid \
224		util \
225		uutil \
226		vmmapi \
227		wind \
228		wrap \
229		xo \
230		y \
231		ypclnt \
232		z \
233		zdb \
234		zfs_core \
235		zfs \
236		zfsbootenv \
237		zpool \
238		zutil
239
240.if ${MK_BLACKLIST} != "no"
241_LIBRARIES+= \
242		blacklist \
243
244.endif
245
246.if ${MK_OFED} != "no"
247_LIBRARIES+= \
248		cxgb4 \
249		ibcm \
250		ibmad \
251		ibnetdisc \
252		ibumad \
253		ibverbs \
254		irdma \
255		mlx4 \
256		mlx5 \
257		rdmacm \
258		osmcomp \
259		opensm \
260		osmvendor
261.endif
262
263.if ${MK_BEARSSL} == "yes"
264_LIBRARIES+= \
265		bearssl \
266		secureboot \
267
268LIBBEARSSL?=	${LIBBEARSSLDIR}/libbearssl.a
269LIBSECUREBOOT?=	${LIBSECUREBOOTDIR}/libsecureboot.a
270.endif
271
272.if ${MK_VERIEXEC} == "yes"
273_LIBRARIES+= veriexec
274
275LIBVERIEXEC?=	${LIBVERIEXECDIR}/libveriexec.a
276.endif
277
278# Each library's LIBADD needs to be duplicated here for static linkage of
279# 2nd+ order consumers.  Auto-generating this would be better.
280_DP_80211=	sbuf bsdxml
281_DP_9p=		sbuf
282.if ${MK_CASPER} != "no"
283_DP_9p+=	casper cap_pwd cap_grp
284.endif
285
286# XXX: Not bootstrapped so uses host version on non-FreeBSD, so don't use a
287# FreeBSD-specific dependency list
288.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING)
289_DP_archive=	z bz2 lzma bsdxml zstd
290.endif
291_DP_avl=	spl
292_DP_bsddialog=	ncursesw tinfow
293_DP_zstd=	pthread
294.if ${MK_BLACKLIST} != "no"
295_DP_blacklist+=	pthread
296.endif
297_DP_crypto=	pthread
298# See comment by _DP_archive above
299.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING)
300.if ${MK_OPENSSL} != "no"
301_DP_archive+=	crypto
302.else
303_DP_archive+=	md
304.endif
305.endif
306_DP_sqlite3=	pthread
307_DP_ssl=	crypto
308_DP_ssh=	crypto crypt z
309.if ${MK_LDNS} != "no"
310_DP_ssh+=	ldns
311.endif
312_DP_edit=	tinfow
313.if ${MK_OPENSSL} != "no"
314_DP_bsnmp=	crypto
315.endif
316_DP_geom=	bsdxml sbuf
317_DP_cam=	sbuf
318_DP_kldelf=	elf
319_DP_kvm=	elf
320_DP_casper=	nv
321_DP_cap_dns=	nv
322_DP_cap_fileargs=	nv
323_DP_cap_grp=	nv
324_DP_cap_pwd=	nv
325_DP_cap_sysctl=	nv
326_DP_cap_syslog=	nv
327_DP_crypt=	md
328.if ${MK_OFED} != "no"
329_DP_pcap=	ibverbs mlx5
330.endif
331_DP_pjdlog=	util
332_DP_usb=	pthread
333_DP_unbound=	ssl crypto pthread
334_DP_rt=	pthread
335.if ${MK_OPENSSL} == "no"
336_DP_radius=	md
337.else
338_DP_radius=	crypto
339.endif
340_DP_rtld_db=	elf procstat
341_DP_procstat=	kvm util elf
342_DP_proc=	cxxrt
343.if ${MK_CDDL} != "no"
344_DP_proc+=	ctf
345.endif
346_DP_proc+=	elf procstat rtld_db util z
347_DP_mp=	crypto
348_DP_memstat=	kvm
349_DP_magic=	z
350_DP_mt=		sbuf bsdxml
351_DP_nvmf=	nv
352_DP_ldns=	ssl crypto
353_DP_lua=	m
354_DP_lutok=	lua
355.if ${MK_OPENSSL} != "no"
356_DP_fetch=	ssl crypto
357.else
358_DP_fetch=	md
359.endif
360_DP_execinfo=	elf
361_DP_dwarf=	elf z
362_DP_dpv=	dialog figpar util tinfow ncursesw
363_DP_dialog=	tinfow ncursesw m
364_DP_cuse=	pthread
365_DP_atf_cxx=	atf_c
366_DP_gtest=	pthread regex
367_DP_gmock=	gtest
368_DP_gmock_main=	gmock
369_DP_gtest_main=	gtest
370_DP_devstat=	kvm
371_DP_pam=	radius tacplus md util
372.if ${MK_KERBEROS} != "no"
373_DP_pam+=	krb5
374.endif
375.if ${MK_OPENSSH} != "no"
376_DP_fido2+=	crypto z
377_DP_pam+=	ssh
378.endif
379.if ${MK_NIS} != "no"
380_DP_pam+=	ypclnt
381.endif
382_DP_roken=	crypt
383_DP_kadm5clnt=	com_err krb5 roken
384_DP_kadm5srv=	com_err hdb krb5 roken
385_DP_heimntlm=	crypto com_err krb5 roken
386_DP_hx509=	asn1 com_err crypto roken wind
387_DP_hdb=	asn1 com_err krb5 roken sqlite3
388_DP_asn1=	com_err roken
389_DP_kdc=	roken hdb hx509 krb5 heimntlm asn1 crypto
390_DP_wind=	com_err roken
391_DP_heimbase=	pthread
392_DP_heimipcc=	heimbase roken pthread
393_DP_heimipcs=	heimbase roken pthread
394_DP_kafs5=	asn1 krb5 roken
395_DP_krb5=	asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc
396_DP_gssapi_krb5=	gssapi krb5 crypto roken asn1 com_err
397_DP_lzma=	md pthread
398_DP_ucl=	m
399_DP_vmmapi=	util
400_DP_opencsd=	cxxrt
401_DP_ctf=	spl z
402_DP_dtrace=	ctf elf proc pthread rtld_db xo
403_DP_xo=		util
404_DP_ztest=	geom m nvpair umem zpool pthread avl zfs_core spl zutil zfs uutil icp
405# The libc dependencies are not strictly needed but are defined to make the
406# assert happy.
407_DP_c=		compiler_rt sys
408# Use libssp_nonshared only on i386 and power*.  Other archs emit direct calls
409# to __stack_chk_fail, not __stack_chk_fail_local provided by libssp_nonshared.
410.if ${MK_SSP} != "no" && \
411    (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH:Mpower*} != "")
412_DP_c+=		ssp_nonshared
413.endif
414_DP_stats=	sbuf pthread
415_DP_stdthreads=	pthread
416_DP_sys=	compiler_rt
417# Use libssp_nonshared only on i386 and power*.  Other archs emit direct calls
418# to __stack_chk_fail, not __stack_chk_fail_local provided by libssp_nonshared.
419.if ${MK_SSP} != "no" && \
420    (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH:Mpower*} != "")
421_DP_sys+=	ssp_nonshared
422.endif
423.if !defined(BOOTSTRAPPING)
424_DP_thr=	c sys
425_DP_pthread=	${_DP_thr}
426.endif
427_DP_tacplus=	md pam
428_DP_ncursesw=	tinfow
429_DP_formw=	ncursesw
430_DP_nvpair=	spl
431_DP_panelw=	ncursesw
432_DP_rpcsec_gss=	gssapi
433_DP_smb=	kiconv
434_DP_ulog=	md
435_DP_fifolog=	z
436_DP_ipf=	kvm
437_DP_tpool=	spl
438_DP_uutil=	avl spl
439_DP_zfs=	md pthread rt umem util uutil m avl bsdxml crypto geom nvpair \
440	z zfs_core zutil
441_DP_zfsbootenv= zfs nvpair
442_DP_zfs_core=	nvpair spl zutil
443_DP_zpool=	md pthread z icp spl nvpair avl umem
444_DP_zutil=	avl geom m tpool
445_DP_be=		zfs spl nvpair zfsbootenv
446_DP_netmap=
447_DP_ifconfig=	m
448_DP_pfctl=	nv
449
450# OFED support
451.if ${MK_OFED} != "no"
452_DP_cxgb4=	ibverbs pthread
453_DP_ibcm=	ibverbs
454_DP_ibmad=	ibumad
455_DP_ibnetdisc=	osmcomp ibmad ibumad
456_DP_ibumad=
457_DP_ibverbs=
458_DP_irdma=	ibverbs pthread
459_DP_mlx4=	ibverbs pthread
460_DP_mlx5=	ibverbs pthread
461_DP_rdmacm=	ibverbs
462_DP_osmcomp=	pthread
463_DP_opensm=	pthread
464_DP_osmvendor=	ibumad pthread
465.endif
466
467# Define special cases
468LDADD_supcplusplus=	-lsupc++
469LIBATF_C=	${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf-c.a
470LIBATF_CXX=	${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf-c++.a
471LDADD_atf_c=	-lprivateatf-c
472LDADD_atf_cxx=	-lprivateatf-c++
473
474LIBGMOCK=	${LIBDESTDIR}${LIBDIR_BASE}/libprivategmock.a
475LIBGMOCK_MAIN=	${LIBDESTDIR}${LIBDIR_BASE}/libprivategmock_main.a
476LIBGTEST=	${LIBDESTDIR}${LIBDIR_BASE}/libprivategtest.a
477LIBGTEST_MAIN=	${LIBDESTDIR}${LIBDIR_BASE}/libprivategtest_main.a
478LDADD_gmock=	-lprivategmock
479LDADD_gtest=	-lprivategtest
480LDADD_gmock_main= -lprivategmock_main
481LDADD_gtest_main= -lprivategtest_main
482
483.for _l in ${_PRIVATELIBS}
484LIB${_l:tu}?=	${LIBDESTDIR}${LIBDIR_BASE}/libprivate${_l}.a
485.endfor
486
487.if ${MK_PIE} != "no"
488PIE_SUFFIX=	_pie
489.endif
490
491.for _l in ${_LIBRARIES}
492.if ${_INTERNALLIBS:M${_l}} || !defined(SYSROOT)
493LDADD_${_l}_L+=		-L${LIB${_l:tu}DIR}
494.endif
495DPADD_${_l}?=	${LIB${_l:tu}}
496.if ${_PRIVATELIBS:M${_l}}
497LDADD_${_l}?=	-lprivate${_l}
498.elif ${_INTERNALLIBS:M${_l}}
499LDADD_${_l}?=	${LDADD_${_l}_L} -l${_l:S/${PIE_SUFFIX}//}${PIE_SUFFIX}
500.else
501LDADD_${_l}?=	${LDADD_${_l}_L} -l${_l}
502.endif
503# Add in all dependencies for static linkage.
504# Bootstrapping from non-FreeBSD needs special handling, since it overrides
505# NO_SHARED back to yes despite only building static versions of bootstrap
506# libraries (see tools/build/mk/Makefile.boot.pre).
507.if defined(_DP_${_l}) && (${_INTERNALLIBS:M${_l}} || \
508    (defined(NO_SHARED) && ${NO_SHARED:tl} != "no") || \
509    (defined(BOOTSTRAPPING) && ${.MAKE.OS} != "FreeBSD"))
510.for _d in ${_DP_${_l}}
511DPADD_${_l}+=	${DPADD_${_d}}
512LDADD_${_l}+=	${LDADD_${_d}}
513.endfor
514.endif
515.endfor
516
517# These are special cases where the library is broken and anything that uses
518# it needs to add more dependencies.  Broken usually means that it has a
519# cyclic dependency and cannot link its own dependencies.  This is bad, please
520# fix the library instead.
521# Unless the library itself is broken then the proper place to define
522# dependencies is _DP_* above.
523
524# libatf-c++ exposes libatf-c abi hence we need to explicit link to atf_c for
525# atf_cxx
526DPADD_atf_cxx+=	${DPADD_atf_c}
527LDADD_atf_cxx+=	${LDADD_atf_c}
528
529DPADD_gmock+=	${DPADD_gtest}
530LDADD_gmock+=	${LDADD_gtest}
531
532DPADD_gmock_main+=	${DPADD_gmock}
533LDADD_gmock_main+=	${LDADD_gmock}
534
535DPADD_gtest_main+=	${DPADD_gtest}
536LDADD_gtest_main+=	${LDADD_gtest}
537
538# Detect LDADD/DPADD that should be LIBADD, before modifying LDADD here.
539_BADLDADD=
540.for _l in ${LDADD:M-l*:N-l*/*:C,^-l,,}
541.if ${_LIBRARIES:M${_l}} && !${_PRIVATELIBS:M${_l}}
542_BADLDADD+=	${_l}
543.endif
544.endfor
545.if !empty(_BADLDADD)
546.error ${.CURDIR}: These libraries should be LIBADD+=foo rather than DPADD/LDADD+=-lfoo: ${_BADLDADD}
547.endif
548
549.for _l in ${LIBADD}
550DPADD+=		${DPADD_${_l}}
551LDADD+=		${LDADD_${_l}}
552.endfor
553
554_LIB_OBJTOP?=	${OBJTOP}
555# INTERNALLIB definitions.
556LIBDIFFDIR=	${_LIB_OBJTOP}/lib/libdiff
557LIBDIFF?=	${LIBDIFFDIR}/libdiff${PIE_SUFFIX}.a
558
559LIBELFTCDIR=	${_LIB_OBJTOP}/lib/libelftc
560LIBELFTC?=	${LIBELFTCDIR}/libelftc${PIE_SUFFIX}.a
561
562LIBFDTDIR=	${_LIB_OBJTOP}/lib/libfdt
563LIBFDT?=	${LIBFDTDIR}/libfdt${PIE_SUFFIX}.a
564
565LIBLUADIR=	${_LIB_OBJTOP}/lib/liblua
566LIBLUA?=	${LIBLUADIR}/liblua${PIE_SUFFIX}.a
567
568LIBLUTOKDIR=	${_LIB_OBJTOP}/lib/liblutok
569LIBLUTOK?=	${LIBLUTOKDIR}/liblutok${PIE_SUFFIX}.a
570
571LIBPEDIR=	${_LIB_OBJTOP}/lib/libpe
572LIBPE?=		${LIBPEDIR}/libpe${PIE_SUFFIX}.a
573
574LIBOPENBSDDIR=	${_LIB_OBJTOP}/lib/libopenbsd
575LIBOPENBSD?=	${LIBOPENBSDDIR}/libopenbsd${PIE_SUFFIX}.a
576
577LIBSMDIR=	${_LIB_OBJTOP}/lib/libsm
578LIBSM?=		${LIBSMDIR}/libsm${PIE_SUFFIX}.a
579
580LIBSMDBDIR=	${_LIB_OBJTOP}/lib/libsmdb
581LIBSMDB?=	${LIBSMDBDIR}/libsmdb${PIE_SUFFIX}.a
582
583LIBSMUTILDIR=	${_LIB_OBJTOP}/lib/libsmutil
584LIBSMUTIL?=	${LIBSMUTILDIR}/libsmutil${PIE_SUFFIX}.a
585
586LIBSYSDIR=	${_LIB_OBJTOP}/lib/libsys
587LIBSYS?=	${LIBSYSDIR}/libsys${PIE_SUFFIX}.a
588
589LIBNETBSDDIR?=	${_LIB_OBJTOP}/lib/libnetbsd
590LIBNETBSD?=	${LIBNETBSDDIR}/libnetbsd${PIE_SUFFIX}.a
591
592LIBVERSDIR?=	${_LIB_OBJTOP}/kerberos5/lib/libvers
593LIBVERS?=	${LIBVERSDIR}/libvers${PIE_SUFFIX}.a
594
595LIBSLDIR=	${_LIB_OBJTOP}/kerberos5/lib/libsl
596LIBSL?=		${LIBSLDIR}/libsl${PIE_SUFFIX}.a
597
598LIBIFCONFIGDIR=	${_LIB_OBJTOP}/lib/libifconfig
599LIBIFCONFIG?=	${LIBIFCONFIGDIR}/libifconfig${PIE_SUFFIX}.a
600
601LIBIPFDIR=	${_LIB_OBJTOP}/sbin/ipf/libipf
602LIBIPF?=	${LIBIPFDIR}/libipf${PIE_SUFFIX}.a
603
604LIBNVDIR=	${_LIB_OBJTOP}/lib/libnv
605LIBNV?=		${LIBNVDIR}/libnv${PIE_SUFFIX}.a
606
607LIBISCSIUTILDIR=	${_LIB_OBJTOP}/lib/libiscsiutil
608LIBISCSIUTIL?=	${LIBISCSIUTILDIR}/libiscsiutil${PIE_SUFFIX}.a
609
610LIBNVMFDIR=	${_LIB_OBJTOP}/lib/libnvmf
611LIBNVMF?=	${LIBNVMFDIR}/libnvmf${PIE_SUFFIX}.a
612
613LIBTELNETDIR=	${_LIB_OBJTOP}/lib/libtelnet
614LIBTELNET?=	${LIBTELNETDIR}/libtelnet${PIE_SUFFIX}.a
615
616LIBCRONDIR=	${_LIB_OBJTOP}/usr.sbin/cron/lib
617LIBCRON?=	${LIBCRONDIR}/libcron${PIE_SUFFIX}.a
618
619LIBDERDIR=	${_LIB_OBJTOP}/lib/libder
620LIBDER?=	${LIBDERDIR}/libder${PIE_SUFFIX}.a
621
622LIBNTPDIR=	${_LIB_OBJTOP}/usr.sbin/ntp/libntp
623LIBNTP?=	${LIBNTPDIR}/libntp${PIE_SUFFIX}.a
624
625LIBNTPEVENTDIR=	${_LIB_OBJTOP}/usr.sbin/ntp/libntpevent
626LIBNTPEVENT?=	${LIBNTPEVENTDIR}/libntpevent${PIE_SUFFIX}.a
627
628LIBOPTSDIR=	${_LIB_OBJTOP}/usr.sbin/ntp/libopts
629LIBOPTS?=	${LIBOPTSDIR}/libopts${PIE_SUFFIX}.a
630
631LIBPARSEDIR=	${_LIB_OBJTOP}/usr.sbin/ntp/libparse
632LIBPARSE?=	${LIBPARSEDIR}/libparse${PIE_SUFFIX}.a
633
634LIBPFCTLDIR=	${_LIB_OBJTOP}/lib/libpfctl
635LIBPFCTL?=	${LIBPFCTLDIR}/libpfctl${PIE_SUFFIX}.a
636
637LIBLPRDIR=	${_LIB_OBJTOP}/usr.sbin/lpr/common_source
638LIBLPR?=	${LIBLPRDIR}/liblpr${PIE_SUFFIX}.a
639
640LIBFIFOLOGDIR=	${_LIB_OBJTOP}/usr.sbin/fifolog/lib
641LIBFIFOLOG?=	${LIBFIFOLOGDIR}/libfifolog${PIE_SUFFIX}.a
642
643LIBBSNMPTOOLSDIR=	${_LIB_OBJTOP}/usr.sbin/bsnmpd/tools/libbsnmptools
644LIBBSNMPTOOLS?=	${LIBBSNMPTOOLSDIR}/libbsnmptools${PIE_SUFFIX}.a
645
646LIBBE?=		${LIBBEDIR}/libbe${PIE_SUFFIX}.a
647
648LIBPKGECCDIR=	${_LIB_OBJTOP}/secure/lib/libpkgecc
649LIBPKGECC?=	${LIBPKGECCDIR}/libpkgecc${PIE_SUFFIX}.a
650
651LIBPMCSTATDIR=	${_LIB_OBJTOP}/lib/libpmcstat
652LIBPMCSTAT?=	${LIBPMCSTATDIR}/libpmcstat${PIE_SUFFIX}.a
653
654LIBWPAAPDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/ap
655LIBWPAAP?=	${LIBWPAAPDIR}/libwpaap${PIE_SUFFIX}.a
656
657LIBWPACOMMONDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/common
658LIBWPACOMMON?=	${LIBWPACOMMONDIR}/libwpacommon${PIE_SUFFIX}.a
659
660LIBWPACRYPTODIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/crypto
661LIBWPACRYPTO?=	${LIBWPACRYPTODIR}/libwpacrypto${PIE_SUFFIX}.a
662
663LIBWPADRIVERSDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/drivers
664LIBWPADRIVERS?=	${LIBWPADRIVERSDIR}/libwpadrivers${PIE_SUFFIX}.a
665
666LIBWPAEAP_COMMONDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/eap_common
667LIBWPAEAP_COMMON?=	${LIBWPAEAP_COMMONDIR}/libwpaeap_common${PIE_SUFFIX}.a
668
669LIBWPAEAP_PEERDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/eap_peer
670LIBWPAEAP_PEER?=	${LIBWPAEAP_PEERDIR}/libwpaeap_peer${PIE_SUFFIX}.a
671
672LIBWPAEAP_SERVERDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/eap_server
673LIBWPAEAP_SERVER?=	${LIBWPAEAP_SERVERDIR}/libwpaeap_server${PIE_SUFFIX}.a
674
675LIBWPAEAPOL_AUTHDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/eapol_auth
676LIBWPAEAPOL_AUTH?=	${LIBWPAEAPOL_AUTHDIR}/libwpaeapol_auth${PIE_SUFFIX}.a
677
678LIBWPAEAPOL_SUPPDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/eapol_supp
679LIBWPAEAPOL_SUPP?=	${LIBWPAEAPOL_SUPPDIR}/libwpaeapol_supp${PIE_SUFFIX}.a
680
681LIBWPAL2_PACKETDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/l2_packet
682LIBWPAL2_PACKET?=	${LIBWPAL2_PACKETDIR}/libwpal2_packet${PIE_SUFFIX}.a
683
684LIBWPAPASNDIR=		${_LIB_OBJTOP}/usr.sbin/wpa/src/pasn
685LIBWPAPASN?=		${LIBWPAPASNDIR}/libwpapasn${PIE_SUFFIX}.a
686
687LIBWPARADIUSDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/radius
688LIBWPARADIUS?=	${LIBWPARADIUSDIR}/libwparadius${PIE_SUFFIX}.a
689
690LIBWPARSN_SUPPDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/rsn_supp
691LIBWPARSN_SUPP?=	${LIBWPARSN_SUPPDIR}/libwparsn_supp${PIE_SUFFIX}.a
692
693LIBWPATLSDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/tls
694LIBWPATLS?=	${LIBWPATLSDIR}/libwpatls${PIE_SUFFIX}.a
695
696LIBWPAUTILSDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/utils
697LIBWPAUTILS?=	${LIBWPAUTILSDIR}/libwpautils${PIE_SUFFIX}.a
698
699LIBWPAWPSDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/wps
700LIBWPAWPS?=	${LIBWPAWPSDIR}/libwpawps${PIE_SUFFIX}.a
701
702LIBC_NOSSP_PICDIR=	${_LIB_OBJTOP}/lib/libc
703LIBC_NOSSP_PIC?=	${LIBC_NOSSP_PICDIR}/libc_nossp_pic.a
704
705# Define a directory for each library.  This is useful for adding -L in when
706# not using a --sysroot or for meta mode bootstrapping when there is no
707# Makefile.depend.  These are sorted by directory.
708LIBAVLDIR=	${_LIB_OBJTOP}/cddl/lib/libavl
709LIBCTFDIR=	${_LIB_OBJTOP}/cddl/lib/libctf
710LIBDTRACEDIR=	${_LIB_OBJTOP}/cddl/lib/libdtrace
711LIBICPDIR=	${_LIB_OBJTOP}/cddl/lib/libicp
712LIBICP?=	${LIBICPDIR}/libicp${PIE_SUFFIX}.a
713LIBICP_RESCUEDIR=	${_LIB_OBJTOP}/cddl/lib/libicp_rescue
714LIBICP_RESCUE?=	${LIBICP_RESCUEDIR}/libicp_rescue${PIE_SUFFIX}.a
715LIBNVPAIRDIR=	${_LIB_OBJTOP}/cddl/lib/libnvpair
716LIBNVPAIR?=	${LIBNVPAIRDIR}/libnvpair${PIE_SUFFIX}.a
717LIBUMEMDIR=	${_LIB_OBJTOP}/cddl/lib/libumem
718LIBUUTILDIR=	${_LIB_OBJTOP}/cddl/lib/libuutil
719LIBZDBDIR=	${_LIB_OBJTOP}/cddl/lib/libzdb
720LIBZDB?=	${LIBZDBDIR}/libzdb${PIE_SUFFIX}.a
721LIBZFSDIR=	${_LIB_OBJTOP}/cddl/lib/libzfs
722LIBZFS?=	${LIBZFSDIR}/libzfs${PIE_SUFFIX}.a
723LIBZFS_COREDIR=	${_LIB_OBJTOP}/cddl/lib/libzfs_core
724LIBZFS_CORE?=	${LIBZFS_COREDIR}/libzfs_core${PIE_SUFFIX}.a
725LIBZFSBOOTENVDIR=	${_LIB_OBJTOP}/cddl/lib/libzfsbootenv
726LIBZFSBOOTENV?=	${LIBZFSBOOTENVDIR}/libzfsbootenv${PIE_SUFFIX}.a
727LIBZPOOLDIR=	${_LIB_OBJTOP}/cddl/lib/libzpool
728LIBZPOOL?=	${LIBZPOOLDIR}/libzpool${PIE_SUFFIX}.a
729LIBZUTILDIR=	${_LIB_OBJTOP}/cddl/lib/libzutil
730LIBZUTIL?=	${LIBZUTILDIR}/libzutil${PIE_SUFFIX}.a
731LIBTPOOLDIR=	${_LIB_OBJTOP}/cddl/lib/libtpool
732
733# OFED support
734LIBCXGB4DIR=	${_LIB_OBJTOP}/lib/ofed/libcxgb4
735LIBIBCMDIR=	${_LIB_OBJTOP}/lib/ofed/libibcm
736LIBIBMADDIR=	${_LIB_OBJTOP}/lib/ofed/libibmad
737LIBIBNETDISCDIR=${_LIB_OBJTOP}/lib/ofed/libibnetdisc
738LIBIBUMADDIR=	${_LIB_OBJTOP}/lib/ofed/libibumad
739LIBIBVERBSDIR=	${_LIB_OBJTOP}/lib/ofed/libibverbs
740LIBIRDMADIR=	${_LIB_OBJTOP}/lib/ofed/libirdma
741LIBMLX4DIR=	${_LIB_OBJTOP}/lib/ofed/libmlx4
742LIBMLX5DIR=	${_LIB_OBJTOP}/lib/ofed/libmlx5
743LIBRDMACMDIR=	${_LIB_OBJTOP}/lib/ofed/librdmacm
744LIBOSMCOMPDIR=	${_LIB_OBJTOP}/lib/ofed/complib
745LIBOPENSMDIR=	${_LIB_OBJTOP}/lib/ofed/libopensm
746LIBOSMVENDORDIR=${_LIB_OBJTOP}/lib/ofed/libvendor
747
748LIBDIALOGDIR=	${_LIB_OBJTOP}/gnu/lib/libdialog
749LIBSSPDIR=	${_LIB_OBJTOP}/lib/libssp
750LIBSSP_NONSHAREDDIR=	${_LIB_OBJTOP}/lib/libssp_nonshared
751LIBASN1DIR=	${_LIB_OBJTOP}/kerberos5/lib/libasn1
752LIBGSSAPI_KRB5DIR=	${_LIB_OBJTOP}/kerberos5/lib/libgssapi_krb5
753LIBGSSAPI_NTLMDIR=	${_LIB_OBJTOP}/kerberos5/lib/libgssapi_ntlm
754LIBGSSAPI_SPNEGODIR=	${_LIB_OBJTOP}/kerberos5/lib/libgssapi_spnego
755LIBHDBDIR=	${_LIB_OBJTOP}/kerberos5/lib/libhdb
756LIBHEIMBASEDIR=	${_LIB_OBJTOP}/kerberos5/lib/libheimbase
757LIBHEIMIPCCDIR=	${_LIB_OBJTOP}/kerberos5/lib/libheimipcc
758LIBHEIMIPCSDIR=	${_LIB_OBJTOP}/kerberos5/lib/libheimipcs
759LIBHEIMNTLMDIR=	${_LIB_OBJTOP}/kerberos5/lib/libheimntlm
760LIBHX509DIR=	${_LIB_OBJTOP}/kerberos5/lib/libhx509
761LIBKADM5CLNTDIR=	${_LIB_OBJTOP}/kerberos5/lib/libkadm5clnt
762LIBKADM5SRVDIR=	${_LIB_OBJTOP}/kerberos5/lib/libkadm5srv
763LIBKAFS5DIR=	${_LIB_OBJTOP}/kerberos5/lib/libkafs5
764LIBKDCDIR=	${_LIB_OBJTOP}/kerberos5/lib/libkdc
765LIBKRB5DIR=	${_LIB_OBJTOP}/kerberos5/lib/libkrb5
766LIBROKENDIR=	${_LIB_OBJTOP}/kerberos5/lib/libroken
767LIBWINDDIR=	${_LIB_OBJTOP}/kerberos5/lib/libwind
768LIBATF_CDIR=	${_LIB_OBJTOP}/lib/atf/libatf-c
769LIBATF_CXXDIR=	${_LIB_OBJTOP}/lib/atf/libatf-c++
770LIBGMOCKDIR=	${_LIB_OBJTOP}/lib/googletest/gmock
771LIBGMOCK_MAINDIR=	${_LIB_OBJTOP}/lib/googletest/gmock_main
772LIBGTESTDIR=	${_LIB_OBJTOP}/lib/googletest/gtest
773LIBGTEST_MAINDIR=	${_LIB_OBJTOP}/lib/googletest/gtest_main
774LIBALIASDIR=	${_LIB_OBJTOP}/lib/libalias/libalias
775LIBBLACKLISTDIR=	${_LIB_OBJTOP}/lib/libblacklist
776LIBBLOCKSRUNTIMEDIR=	${_LIB_OBJTOP}/lib/libblocksruntime
777LIBBSNMPDIR=	${_LIB_OBJTOP}/lib/libbsnmp/libbsnmp
778LIBCASPERDIR=	${_LIB_OBJTOP}/lib/libcasper/libcasper
779LIBCAP_DNSDIR=	${_LIB_OBJTOP}/lib/libcasper/services/cap_dns
780LIBCAP_GRPDIR=	${_LIB_OBJTOP}/lib/libcasper/services/cap_grp
781LIBCAP_NETDIR=	${_LIB_OBJTOP}/lib/libcasper/services/cap_net
782LIBCAP_PWDDIR=	${_LIB_OBJTOP}/lib/libcasper/services/cap_pwd
783LIBCAP_SYSCTLDIR=	${_LIB_OBJTOP}/lib/libcasper/services/cap_sysctl
784LIBCAP_SYSLOGDIR=	${_LIB_OBJTOP}/lib/libcasper/services/cap_syslog
785LIBCBORDIR=	${_LIB_OBJTOP}/lib/libcbor
786LIBBSDXMLDIR=	${_LIB_OBJTOP}/lib/libexpat
787LIBFIDO2DIR=	${_LIB_OBJTOP}/lib/libfido2
788LIBKVMDIR=	${_LIB_OBJTOP}/lib/libkvm
789LIBPTHREADDIR=	${_LIB_OBJTOP}/lib/libthr
790LIBMDIR=	${_LIB_OBJTOP}/lib/msun
791LIBFORMWDIR=	${_LIB_OBJTOP}/lib/ncurses/form
792LIBMENUWDIR=	${_LIB_OBJTOP}/lib/ncurses/menu
793LIBNCURSESWDIR=	${_LIB_OBJTOP}/lib/ncurses/ncurses
794LIBTINFOWDIR=	${_LIB_OBJTOP}/lib/ncurses/tinfo
795LIBPANELWDIR=	${_LIB_OBJTOP}/lib/ncurses/panel
796LIBCRYPTODIR=	${_LIB_OBJTOP}/secure/lib/libcrypto
797LIBSPLDIR=	${_LIB_OBJTOP}/cddl/lib/libspl
798LIBSSHDIR=	${_LIB_OBJTOP}/secure/lib/libssh
799LIBSSLDIR=	${_LIB_OBJTOP}/secure/lib/libssl
800LIBTEKENDIR=	${_LIB_OBJTOP}/sys/teken/libteken
801LIBEGACYDIR=	${_LIB_OBJTOP}/tools/build
802LIBLNDIR=	${_LIB_OBJTOP}/usr.bin/lex/lib
803
804LIBTERMCAPWDIR=	${LIBTINFOWDIR}
805
806.-include <site.src.libnames.mk>
807
808# Default other library directories to lib/libNAME.
809.for lib in ${_LIBRARIES}
810LIB${lib:tu}DIR?=	${OBJTOP}/lib/lib${lib}
811.endfor
812
813# Validate that listed LIBADD are valid.
814.for _l in ${LIBADD}
815.if empty(_LIBRARIES:M${_l})
816_BADLIBADD+= ${_l}
817.endif
818.endfor
819.if !empty(_BADLIBADD)
820.error ${.CURDIR}: Invalid LIBADD used which may need to be added to ${_this:T}: ${_BADLIBADD}
821.endif
822
823# Sanity check that libraries are defined here properly when building them.
824.if defined(LIB) && ${_LIBRARIES:M${LIB}} != ""
825.if !empty(LIBADD) && \
826    (!defined(_DP_${LIB}) || ${LIBADD:O:u} != ${_DP_${LIB}:O:u})
827.error ${.CURDIR}: Missing or incorrect _DP_${LIB} entry in ${_this:T}.  Should match LIBADD for ${LIB} ('${LIBADD}' vs '${_DP_${LIB}}')
828.endif
829# Note that OBJTOP is not yet defined here but for the purpose of the check
830# it is fine as it resolves to the SRC directory.
831.if !defined(LIB${LIB:tu}DIR) || !exists(${SRCTOP}/${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,})
832.error ${.CURDIR}: Missing or incorrect value for LIB${LIB:tu}DIR in ${_this:T}: ${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,}
833.endif
834.if ${_INTERNALLIBS:M${LIB}} != "" && !defined(LIB${LIB:tu})
835.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}.  Likely should be: LIB${LIB:tu}?= $${LIB${LIB:tu}DIR}/lib${LIB}.a
836.endif
837.endif
838
839.endif	# !target(__<src.libnames.mk>__)
840