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