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