xref: /freebsd/share/mk/src.libnames.mk (revision d5b0e70f7e04d971691517ce1304d86a1e367e2e)
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		BlocksRuntime \
101		be \
102		begemot \
103		bluetooth \
104		bsdxml \
105		bsm \
106		bsnmp \
107		bz2 \
108		c \
109		c_pic \
110		calendar \
111		cam \
112		casper \
113		cap_dns \
114		cap_fileargs \
115		cap_grp \
116		cap_net \
117		cap_netdb \
118		cap_pwd \
119		cap_sysctl \
120		cap_syslog \
121		com_err \
122		compiler_rt \
123		crypt \
124		crypto \
125		ctf \
126		cuse \
127		cxxrt \
128		devctl \
129		devdctl \
130		devinfo \
131		devstat \
132		dialog \
133		dl \
134		dpv \
135		dtrace \
136		dwarf \
137		edit \
138		efivar \
139		elf \
140		execinfo \
141		fetch \
142		figpar \
143		formw \
144		geom \
145		gpio \
146		gssapi \
147		gssapi_krb5 \
148		hdb \
149		heimbase \
150		heimntlm \
151		heimsqlite \
152		hx509 \
153		icp \
154		ipsec \
155		ipt \
156		jail \
157		kadm5clnt \
158		kadm5srv \
159		kafs5 \
160		kdc \
161		kiconv \
162		krb5 \
163		kvm \
164		l \
165		lzma \
166		m \
167		magic \
168		md \
169		memstat \
170		mp \
171		mt \
172		ncursesw \
173		netgraph \
174		netmap \
175		ngatm \
176		nv \
177		nvpair \
178		opencsd \
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_usb=	pthread
319_DP_unbound=	ssl crypto pthread
320_DP_rt=	pthread
321.if ${MK_OPENSSL} == "no"
322_DP_radius=	md
323.else
324_DP_radius=	crypto
325.endif
326_DP_rtld_db=	elf procstat
327_DP_procstat=	kvm util elf
328.if ${MK_CXX} == "yes"
329_DP_proc=	cxxrt
330.endif
331.if ${MK_CDDL} != "no"
332_DP_proc+=	ctf
333.endif
334_DP_proc+=	elf procstat rtld_db util z
335_DP_mp=	crypto
336_DP_memstat=	kvm
337_DP_magic=	z
338_DP_mt=		sbuf bsdxml
339_DP_ldns=	ssl crypto
340_DP_lua=	m
341_DP_lutok=	lua
342.if ${MK_OPENSSL} != "no"
343_DP_fetch=	ssl crypto
344.else
345_DP_fetch=	md
346.endif
347_DP_execinfo=	elf
348_DP_dwarf=	elf z
349_DP_dpv=	dialog figpar util tinfow ncursesw
350_DP_dialog=	tinfow ncursesw m
351_DP_cuse=	pthread
352_DP_atf_cxx=	atf_c
353_DP_gtest=	pthread regex
354_DP_gmock=	gtest
355_DP_gmock_main=	gmock
356_DP_gtest_main=	gtest
357_DP_devstat=	kvm
358_DP_pam=	radius tacplus md util
359.if ${MK_KERBEROS} != "no"
360_DP_pam+=	krb5
361.endif
362.if ${MK_OPENSSH} != "no"
363_DP_fido2+=	crypto z
364_DP_pam+=	ssh
365.endif
366.if ${MK_NIS} != "no"
367_DP_pam+=	ypclnt
368.endif
369_DP_roken=	crypt
370_DP_kadm5clnt=	com_err krb5 roken
371_DP_kadm5srv=	com_err hdb krb5 roken
372_DP_heimntlm=	crypto com_err krb5 roken
373_DP_hx509=	asn1 com_err crypto roken wind
374_DP_hdb=	asn1 com_err krb5 roken sqlite3
375_DP_asn1=	com_err roken
376_DP_kdc=	roken hdb hx509 krb5 heimntlm asn1 crypto
377_DP_wind=	com_err roken
378_DP_heimbase=	pthread
379_DP_heimipcc=	heimbase roken pthread
380_DP_heimipcs=	heimbase roken pthread
381_DP_kafs5=	asn1 krb5 roken
382_DP_krb5=	asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc
383_DP_gssapi_krb5=	gssapi krb5 crypto roken asn1 com_err
384_DP_lzma=	md pthread
385_DP_ucl=	m
386_DP_vmmapi=	util
387_DP_opencsd=	cxxrt
388_DP_ctf=	spl z
389_DP_dtrace=	ctf elf proc pthread rtld_db
390_DP_xo=		util
391_DP_ztest=	geom m nvpair umem zpool pthread avl zfs_core spl zutil zfs uutil icp
392# The libc dependencies are not strictly needed but are defined to make the
393# assert happy.
394_DP_c=		compiler_rt
395# Use libssp_nonshared only on i386 and power*.  Other archs emit direct calls
396# to __stack_chk_fail, not __stack_chk_fail_local provided by libssp_nonshared.
397.if ${MK_SSP} != "no" && \
398    (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH:Mpower*} != "")
399_DP_c+=		ssp_nonshared
400.endif
401_DP_stats=	sbuf pthread
402_DP_stdthreads=	pthread
403_DP_tacplus=	md
404_DP_ncursesw=	tinfow
405_DP_formw=	ncursesw
406_DP_nvpair=	spl
407_DP_panelw=	ncursesw
408_DP_rpcsec_gss=	gssapi
409_DP_smb=	kiconv
410_DP_ulog=	md
411_DP_fifolog=	z
412_DP_ipf=	kvm
413_DP_tpool=	spl
414_DP_uutil=	avl spl
415_DP_zfs=	md pthread umem util uutil m avl bsdxml crypto geom nvpair \
416	z zfs_core zutil
417_DP_zfsbootenv= zfs nvpair
418_DP_zfs_core=	nvpair spl zutil
419_DP_zpool=	md pthread z icp spl nvpair avl umem
420_DP_zutil=	avl geom m tpool
421_DP_be=		zfs spl nvpair zfsbootenv
422_DP_netmap=
423_DP_ifconfig=	m
424_DP_pfctl=	nv
425
426# OFED support
427.if ${MK_OFED} != "no"
428_DP_cxgb4=	ibverbs pthread
429_DP_ibcm=	ibverbs
430_DP_ibmad=	ibumad
431_DP_ibnetdisc=	osmcomp ibmad ibumad
432_DP_ibumad=
433_DP_ibverbs=
434_DP_irdma=	ibverbs pthread
435_DP_mlx4=	ibverbs pthread
436_DP_mlx5=	ibverbs pthread
437_DP_rdmacm=	ibverbs
438_DP_osmcomp=	pthread
439_DP_opensm=	pthread
440_DP_osmvendor=	ibumad pthread
441.endif
442
443# Define special cases
444LDADD_supcplusplus=	-lsupc++
445LIBATF_C=	${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf-c.a
446LIBATF_CXX=	${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf-c++.a
447LDADD_atf_c=	-lprivateatf-c
448LDADD_atf_cxx=	-lprivateatf-c++
449
450LIBGMOCK=	${LIBDESTDIR}${LIBDIR_BASE}/libprivategmock.a
451LIBGMOCK_MAIN=	${LIBDESTDIR}${LIBDIR_BASE}/libprivategmock_main.a
452LIBGTEST=	${LIBDESTDIR}${LIBDIR_BASE}/libprivategtest.a
453LIBGTEST_MAIN=	${LIBDESTDIR}${LIBDIR_BASE}/libprivategtest_main.a
454LDADD_gmock=	-lprivategmock
455LDADD_gtest=	-lprivategtest
456LDADD_gmock_main= -lprivategmock_main
457LDADD_gtest_main= -lprivategtest_main
458
459.for _l in ${_PRIVATELIBS}
460LIB${_l:tu}?=	${LIBDESTDIR}${LIBDIR_BASE}/libprivate${_l}.a
461.endfor
462
463.if ${MK_PIE} != "no"
464PIE_SUFFIX=	_pie
465.endif
466
467.for _l in ${_LIBRARIES}
468.if ${_INTERNALLIBS:M${_l}} || !defined(SYSROOT)
469LDADD_${_l}_L+=		-L${LIB${_l:tu}DIR}
470.endif
471DPADD_${_l}?=	${LIB${_l:tu}}
472.if ${_PRIVATELIBS:M${_l}}
473LDADD_${_l}?=	-lprivate${_l}
474.elif ${_INTERNALLIBS:M${_l}}
475LDADD_${_l}?=	${LDADD_${_l}_L} -l${_l:S/${PIE_SUFFIX}//}${PIE_SUFFIX}
476.else
477LDADD_${_l}?=	${LDADD_${_l}_L} -l${_l}
478.endif
479# Add in all dependencies for static linkage.
480# Bootstrapping from non-FreeBSD needs special handling, since it overrides
481# NO_SHARED back to yes despite only building static versions of bootstrap
482# libraries (see tools/build/mk/Makefile.boot.pre).
483.if defined(_DP_${_l}) && (${_INTERNALLIBS:M${_l}} || \
484    (defined(NO_SHARED) && ${NO_SHARED:tl} != "no") || \
485    (defined(BOOTSTRAPPING) && ${.MAKE.OS} != "FreeBSD"))
486.for _d in ${_DP_${_l}}
487DPADD_${_l}+=	${DPADD_${_d}}
488LDADD_${_l}+=	${LDADD_${_d}}
489.endfor
490.endif
491.endfor
492
493# These are special cases where the library is broken and anything that uses
494# it needs to add more dependencies.  Broken usually means that it has a
495# cyclic dependency and cannot link its own dependencies.  This is bad, please
496# fix the library instead.
497# Unless the library itself is broken then the proper place to define
498# dependencies is _DP_* above.
499
500# libatf-c++ exposes libatf-c abi hence we need to explicit link to atf_c for
501# atf_cxx
502DPADD_atf_cxx+=	${DPADD_atf_c}
503LDADD_atf_cxx+=	${LDADD_atf_c}
504
505DPADD_gmock+=	${DPADD_gtest}
506LDADD_gmock+=	${LDADD_gtest}
507
508DPADD_gmock_main+=	${DPADD_gmock}
509LDADD_gmock_main+=	${LDADD_gmock}
510
511DPADD_gtest_main+=	${DPADD_gtest}
512LDADD_gtest_main+=	${LDADD_gtest}
513
514# Detect LDADD/DPADD that should be LIBADD, before modifying LDADD here.
515_BADLDADD=
516.for _l in ${LDADD:M-l*:N-l*/*:C,^-l,,}
517.if ${_LIBRARIES:M${_l}} && !${_PRIVATELIBS:M${_l}}
518_BADLDADD+=	${_l}
519.endif
520.endfor
521.if !empty(_BADLDADD)
522.error ${.CURDIR}: These libraries should be LIBADD+=foo rather than DPADD/LDADD+=-lfoo: ${_BADLDADD}
523.endif
524
525.for _l in ${LIBADD}
526DPADD+=		${DPADD_${_l}}
527LDADD+=		${LDADD_${_l}}
528.endfor
529
530_LIB_OBJTOP?=	${OBJTOP}
531# INTERNALLIB definitions.
532LIBELFTCDIR=	${_LIB_OBJTOP}/lib/libelftc
533LIBELFTC?=	${LIBELFTCDIR}/libelftc${PIE_SUFFIX}.a
534
535LIBLUADIR=	${_LIB_OBJTOP}/lib/liblua
536LIBLUA?=	${LIBLUADIR}/liblua${PIE_SUFFIX}.a
537
538LIBLUTOKDIR=	${_LIB_OBJTOP}/lib/liblutok
539LIBLUTOK?=	${LIBLUTOKDIR}/liblutok${PIE_SUFFIX}.a
540
541LIBPEDIR=	${_LIB_OBJTOP}/lib/libpe
542LIBPE?=		${LIBPEDIR}/libpe${PIE_SUFFIX}.a
543
544LIBOPENBSDDIR=	${_LIB_OBJTOP}/lib/libopenbsd
545LIBOPENBSD?=	${LIBOPENBSDDIR}/libopenbsd${PIE_SUFFIX}.a
546
547LIBSMDIR=	${_LIB_OBJTOP}/lib/libsm
548LIBSM?=		${LIBSMDIR}/libsm${PIE_SUFFIX}.a
549
550LIBSMDBDIR=	${_LIB_OBJTOP}/lib/libsmdb
551LIBSMDB?=	${LIBSMDBDIR}/libsmdb${PIE_SUFFIX}.a
552
553LIBSMUTILDIR=	${_LIB_OBJTOP}/lib/libsmutil
554LIBSMUTIL?=	${LIBSMUTILDIR}/libsmutil${PIE_SUFFIX}.a
555
556LIBNETBSDDIR?=	${_LIB_OBJTOP}/lib/libnetbsd
557LIBNETBSD?=	${LIBNETBSDDIR}/libnetbsd${PIE_SUFFIX}.a
558
559LIBVERSDIR?=	${_LIB_OBJTOP}/kerberos5/lib/libvers
560LIBVERS?=	${LIBVERSDIR}/libvers${PIE_SUFFIX}.a
561
562LIBSLDIR=	${_LIB_OBJTOP}/kerberos5/lib/libsl
563LIBSL?=		${LIBSLDIR}/libsl${PIE_SUFFIX}.a
564
565LIBIFCONFIGDIR=	${_LIB_OBJTOP}/lib/libifconfig
566LIBIFCONFIG?=	${LIBIFCONFIGDIR}/libifconfig${PIE_SUFFIX}.a
567
568LIBIPFDIR=	${_LIB_OBJTOP}/sbin/ipf/libipf
569LIBIPF?=	${LIBIPFDIR}/libipf${PIE_SUFFIX}.a
570
571LIBNVDIR=	${_LIB_OBJTOP}/lib/libnv
572LIBNV?=		${LIBNVDIR}/libnv${PIE_SUFFIX}.a
573
574LIBISCSIUTILDIR=	${_LIB_OBJTOP}/lib/libiscsiutil
575LIBISCSIUTIL?=	${LIBISCSIUTILDIR}/libiscsiutil${PIE_SUFFIX}.a
576
577LIBTELNETDIR=	${_LIB_OBJTOP}/lib/libtelnet
578LIBTELNET?=	${LIBTELNETDIR}/libtelnet${PIE_SUFFIX}.a
579
580LIBCRONDIR=	${_LIB_OBJTOP}/usr.sbin/cron/lib
581LIBCRON?=	${LIBCRONDIR}/libcron${PIE_SUFFIX}.a
582
583LIBNTPDIR=	${_LIB_OBJTOP}/usr.sbin/ntp/libntp
584LIBNTP?=	${LIBNTPDIR}/libntp${PIE_SUFFIX}.a
585
586LIBNTPEVENTDIR=	${_LIB_OBJTOP}/usr.sbin/ntp/libntpevent
587LIBNTPEVENT?=	${LIBNTPEVENTDIR}/libntpevent${PIE_SUFFIX}.a
588
589LIBOPTSDIR=	${_LIB_OBJTOP}/usr.sbin/ntp/libopts
590LIBOPTS?=	${LIBOPTSDIR}/libopts${PIE_SUFFIX}.a
591
592LIBPARSEDIR=	${_LIB_OBJTOP}/usr.sbin/ntp/libparse
593LIBPARSE?=	${LIBPARSEDIR}/libparse${PIE_SUFFIX}.a
594
595LIBPFCTL=	${_LIB_OBJTOP}/lib/libpfctl
596LIBPFCTL?=	${LIBPFCTLDIR}/libpfctl${PIE_SUFFIX}.a
597
598LIBLPRDIR=	${_LIB_OBJTOP}/usr.sbin/lpr/common_source
599LIBLPR?=	${LIBLPRDIR}/liblpr${PIE_SUFFIX}.a
600
601LIBFIFOLOGDIR=	${_LIB_OBJTOP}/usr.sbin/fifolog/lib
602LIBFIFOLOG?=	${LIBFIFOLOGDIR}/libfifolog${PIE_SUFFIX}.a
603
604LIBBSNMPTOOLSDIR=	${_LIB_OBJTOP}/usr.sbin/bsnmpd/tools/libbsnmptools
605LIBBSNMPTOOLS?=	${LIBBSNMPTOOLSDIR}/libbsnmptools${PIE_SUFFIX}.a
606
607LIBBE?=		${LIBBEDIR}/libbe${PIE_SUFFIX}.a
608
609LIBPMCSTATDIR=	${_LIB_OBJTOP}/lib/libpmcstat
610LIBPMCSTAT?=	${LIBPMCSTATDIR}/libpmcstat${PIE_SUFFIX}.a
611
612LIBWPAAPDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/ap
613LIBWPAAP?=	${LIBWPAAPDIR}/libwpaap${PIE_SUFFIX}.a
614
615LIBWPACOMMONDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/common
616LIBWPACOMMON?=	${LIBWPACOMMONDIR}/libwpacommon${PIE_SUFFIX}.a
617
618LIBWPACRYPTODIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/crypto
619LIBWPACRYPTO?=	${LIBWPACRYPTODIR}/libwpacrypto${PIE_SUFFIX}.a
620
621LIBWPADRIVERSDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/drivers
622LIBWPADRIVERS?=	${LIBWPADRIVERSDIR}/libwpadrivers${PIE_SUFFIX}.a
623
624LIBWPAEAP_COMMONDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/eap_common
625LIBWPAEAP_COMMON?=	${LIBWPAEAP_COMMONDIR}/libwpaeap_common${PIE_SUFFIX}.a
626
627LIBWPAEAP_PEERDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/eap_peer
628LIBWPAEAP_PEER?=	${LIBWPAEAP_PEERDIR}/libwpaeap_peer${PIE_SUFFIX}.a
629
630LIBWPAEAP_SERVERDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/eap_server
631LIBWPAEAP_SERVER?=	${LIBWPAEAP_SERVERDIR}/libwpaeap_server${PIE_SUFFIX}.a
632
633LIBWPAEAPOL_AUTHDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/eapol_auth
634LIBWPAEAPOL_AUTH?=	${LIBWPAEAPOL_AUTHDIR}/libwpaeapol_auth${PIE_SUFFIX}.a
635
636LIBWPAEAPOL_SUPPDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/eapol_supp
637LIBWPAEAPOL_SUPP?=	${LIBWPAEAPOL_SUPPDIR}/libwpaeapol_supp${PIE_SUFFIX}.a
638
639LIBWPAL2_PACKETDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/l2_packet
640LIBWPAL2_PACKET?=	${LIBWPAL2_PACKETDIR}/libwpal2_packet${PIE_SUFFIX}.a
641
642LIBWPARADIUSDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/radius
643LIBWPARADIUS?=	${LIBWPARADIUSDIR}/libwparadius${PIE_SUFFIX}.a
644
645LIBWPARSN_SUPPDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/rsn_supp
646LIBWPARSN_SUPP?=	${LIBWPARSN_SUPPDIR}/libwparsn_supp${PIE_SUFFIX}.a
647
648LIBWPATLSDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/tls
649LIBWPATLS?=	${LIBWPATLSDIR}/libwpatls${PIE_SUFFIX}.a
650
651LIBWPAUTILSDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/utils
652LIBWPAUTILS?=	${LIBWPAUTILSDIR}/libwpautils${PIE_SUFFIX}.a
653
654LIBWPAWPSDIR=	${_LIB_OBJTOP}/usr.sbin/wpa/src/wps
655LIBWPAWPS?=	${LIBWPAWPSDIR}/libwpawps${PIE_SUFFIX}.a
656
657LIBC_NOSSP_PICDIR=	${_LIB_OBJTOP}/lib/libc
658LIBC_NOSSP_PIC?=	${LIBC_NOSSP_PICDIR}/libc_nossp_pic.a
659
660# Define a directory for each library.  This is useful for adding -L in when
661# not using a --sysroot or for meta mode bootstrapping when there is no
662# Makefile.depend.  These are sorted by directory.
663LIBAVLDIR=	${_LIB_OBJTOP}/cddl/lib/libavl
664LIBCTFDIR=	${_LIB_OBJTOP}/cddl/lib/libctf
665LIBDTRACEDIR=	${_LIB_OBJTOP}/cddl/lib/libdtrace
666LIBICPDIR=	${_LIB_OBJTOP}/cddl/lib/libicp
667LIBICP?=	${LIBICPDIR}/libicp${PIE_SUFFIX}.a
668LIBICP_RESCUEDIR=	${_LIB_OBJTOP}/cddl/lib/libicp_rescue
669LIBICP_RESCUE?=	${LIBICP_RESCUEDIR}/libicp_rescue${PIE_SUFFIX}.a
670LIBNVPAIRDIR=	${_LIB_OBJTOP}/cddl/lib/libnvpair
671LIBNVPAIR?=	${LIBNVPAIRDIR}/libnvpair${PIE_SUFFIX}.a
672LIBUMEMDIR=	${_LIB_OBJTOP}/cddl/lib/libumem
673LIBUUTILDIR=	${_LIB_OBJTOP}/cddl/lib/libuutil
674LIBZFSDIR=	${_LIB_OBJTOP}/cddl/lib/libzfs
675LIBZFS?=	${LIBZFSDIR}/libzfs${PIE_SUFFIX}.a
676LIBZFS_COREDIR=	${_LIB_OBJTOP}/cddl/lib/libzfs_core
677LIBZFS_CORE?=	${LIBZFS_COREDIR}/libzfs_core${PIE_SUFFIX}.a
678LIBZFSBOOTENVDIR=	${_LIB_OBJTOP}/cddl/lib/libzfsbootenv
679LIBZFSBOOTENV?=	${LIBZFSBOOTENVDIR}/libzfsbootenv${PIE_SUFFIX}.a
680LIBZPOOLDIR=	${_LIB_OBJTOP}/cddl/lib/libzpool
681LIBZPOOL?=	${LIBZPOOLDIR}/libzpool${PIE_SUFFIX}.a
682LIBZUTILDIR=	${_LIB_OBJTOP}/cddl/lib/libzutil
683LIBZUTIL?=	${LIBZUTILDIR}/libzutil${PIE_SUFFIX}.a
684LIBTPOOLDIR=	${_LIB_OBJTOP}/cddl/lib/libtpool
685
686# OFED support
687LIBCXGB4DIR=	${_LIB_OBJTOP}/lib/ofed/libcxgb4
688LIBIBCMDIR=	${_LIB_OBJTOP}/lib/ofed/libibcm
689LIBIBMADDIR=	${_LIB_OBJTOP}/lib/ofed/libibmad
690LIBIBNETDISCDIR=${_LIB_OBJTOP}/lib/ofed/libibnetdisc
691LIBIBUMADDIR=	${_LIB_OBJTOP}/lib/ofed/libibumad
692LIBIBVERBSDIR=	${_LIB_OBJTOP}/lib/ofed/libibverbs
693LIBIRDMADIR=	${_LIB_OBJTOP}/lib/ofed/libirdma
694LIBMLX4DIR=	${_LIB_OBJTOP}/lib/ofed/libmlx4
695LIBMLX5DIR=	${_LIB_OBJTOP}/lib/ofed/libmlx5
696LIBRDMACMDIR=	${_LIB_OBJTOP}/lib/ofed/librdmacm
697LIBOSMCOMPDIR=	${_LIB_OBJTOP}/lib/ofed/complib
698LIBOPENSMDIR=	${_LIB_OBJTOP}/lib/ofed/libopensm
699LIBOSMVENDORDIR=${_LIB_OBJTOP}/lib/ofed/libvendor
700
701LIBDIALOGDIR=	${_LIB_OBJTOP}/gnu/lib/libdialog
702LIBSSPDIR=	${_LIB_OBJTOP}/lib/libssp
703LIBSSP_NONSHAREDDIR=	${_LIB_OBJTOP}/lib/libssp_nonshared
704LIBASN1DIR=	${_LIB_OBJTOP}/kerberos5/lib/libasn1
705LIBGSSAPI_KRB5DIR=	${_LIB_OBJTOP}/kerberos5/lib/libgssapi_krb5
706LIBGSSAPI_NTLMDIR=	${_LIB_OBJTOP}/kerberos5/lib/libgssapi_ntlm
707LIBGSSAPI_SPNEGODIR=	${_LIB_OBJTOP}/kerberos5/lib/libgssapi_spnego
708LIBHDBDIR=	${_LIB_OBJTOP}/kerberos5/lib/libhdb
709LIBHEIMBASEDIR=	${_LIB_OBJTOP}/kerberos5/lib/libheimbase
710LIBHEIMIPCCDIR=	${_LIB_OBJTOP}/kerberos5/lib/libheimipcc
711LIBHEIMIPCSDIR=	${_LIB_OBJTOP}/kerberos5/lib/libheimipcs
712LIBHEIMNTLMDIR=	${_LIB_OBJTOP}/kerberos5/lib/libheimntlm
713LIBHX509DIR=	${_LIB_OBJTOP}/kerberos5/lib/libhx509
714LIBKADM5CLNTDIR=	${_LIB_OBJTOP}/kerberos5/lib/libkadm5clnt
715LIBKADM5SRVDIR=	${_LIB_OBJTOP}/kerberos5/lib/libkadm5srv
716LIBKAFS5DIR=	${_LIB_OBJTOP}/kerberos5/lib/libkafs5
717LIBKDCDIR=	${_LIB_OBJTOP}/kerberos5/lib/libkdc
718LIBKRB5DIR=	${_LIB_OBJTOP}/kerberos5/lib/libkrb5
719LIBROKENDIR=	${_LIB_OBJTOP}/kerberos5/lib/libroken
720LIBWINDDIR=	${_LIB_OBJTOP}/kerberos5/lib/libwind
721LIBATF_CDIR=	${_LIB_OBJTOP}/lib/atf/libatf-c
722LIBATF_CXXDIR=	${_LIB_OBJTOP}/lib/atf/libatf-c++
723LIBGMOCKDIR=	${_LIB_OBJTOP}/lib/googletest/gmock
724LIBGMOCK_MAINDIR=	${_LIB_OBJTOP}/lib/googletest/gmock_main
725LIBGTESTDIR=	${_LIB_OBJTOP}/lib/googletest/gtest
726LIBGTEST_MAINDIR=	${_LIB_OBJTOP}/lib/googletest/gtest_main
727LIBALIASDIR=	${_LIB_OBJTOP}/lib/libalias/libalias
728LIBBLACKLISTDIR=	${_LIB_OBJTOP}/lib/libblacklist
729LIBBLOCKSRUNTIMEDIR=	${_LIB_OBJTOP}/lib/libblocksruntime
730LIBBSNMPDIR=	${_LIB_OBJTOP}/lib/libbsnmp/libbsnmp
731LIBCASPERDIR=	${_LIB_OBJTOP}/lib/libcasper/libcasper
732LIBCAP_DNSDIR=	${_LIB_OBJTOP}/lib/libcasper/services/cap_dns
733LIBCAP_GRPDIR=	${_LIB_OBJTOP}/lib/libcasper/services/cap_grp
734LIBCAP_NETDIR=	${_LIB_OBJTOP}/lib/libcasper/services/cap_net
735LIBCAP_PWDDIR=	${_LIB_OBJTOP}/lib/libcasper/services/cap_pwd
736LIBCAP_SYSCTLDIR=	${_LIB_OBJTOP}/lib/libcasper/services/cap_sysctl
737LIBCAP_SYSLOGDIR=	${_LIB_OBJTOP}/lib/libcasper/services/cap_syslog
738LIBCBORDIR=	${_LIB_OBJTOP}/lib/libcbor
739LIBBSDXMLDIR=	${_LIB_OBJTOP}/lib/libexpat
740LIBFIDO2DIR=	${_LIB_OBJTOP}/lib/libfido2
741LIBKVMDIR=	${_LIB_OBJTOP}/lib/libkvm
742LIBPTHREADDIR=	${_LIB_OBJTOP}/lib/libthr
743LIBMDIR=	${_LIB_OBJTOP}/lib/msun
744LIBFORMWDIR=	${_LIB_OBJTOP}/lib/ncurses/form
745LIBMENUWDIR=	${_LIB_OBJTOP}/lib/ncurses/menu
746LIBNCURSESWDIR=	${_LIB_OBJTOP}/lib/ncurses/ncurses
747LIBTINFOWDIR=	${_LIB_OBJTOP}/lib/ncurses/tinfo
748LIBPANELWDIR=	${_LIB_OBJTOP}/lib/ncurses/panel
749LIBCRYPTODIR=	${_LIB_OBJTOP}/secure/lib/libcrypto
750LIBSPLDIR=	${_LIB_OBJTOP}/cddl/lib/libspl
751LIBSSHDIR=	${_LIB_OBJTOP}/secure/lib/libssh
752LIBSSLDIR=	${_LIB_OBJTOP}/secure/lib/libssl
753LIBTEKENDIR=	${_LIB_OBJTOP}/sys/teken/libteken
754LIBEGACYDIR=	${_LIB_OBJTOP}/tools/build
755LIBLNDIR=	${_LIB_OBJTOP}/usr.bin/lex/lib
756
757LIBTERMCAPWDIR=	${LIBTINFOWDIR}
758
759# Default other library directories to lib/libNAME.
760.for lib in ${_LIBRARIES}
761LIB${lib:tu}DIR?=	${OBJTOP}/lib/lib${lib}
762.endfor
763
764# Validate that listed LIBADD are valid.
765.for _l in ${LIBADD}
766.if empty(_LIBRARIES:M${_l})
767_BADLIBADD+= ${_l}
768.endif
769.endfor
770.if !empty(_BADLIBADD)
771.error ${.CURDIR}: Invalid LIBADD used which may need to be added to ${_this:T}: ${_BADLIBADD}
772.endif
773
774# Sanity check that libraries are defined here properly when building them.
775.if defined(LIB) && ${_LIBRARIES:M${LIB}} != ""
776.if !empty(LIBADD) && \
777    (!defined(_DP_${LIB}) || ${LIBADD:O:u} != ${_DP_${LIB}:O:u})
778.error ${.CURDIR}: Missing or incorrect _DP_${LIB} entry in ${_this:T}.  Should match LIBADD for ${LIB} ('${LIBADD}' vs '${_DP_${LIB}}')
779.endif
780# Note that OBJTOP is not yet defined here but for the purpose of the check
781# it is fine as it resolves to the SRC directory.
782.if !defined(LIB${LIB:tu}DIR) || !exists(${SRCTOP}/${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,})
783.error ${.CURDIR}: Missing or incorrect value for LIB${LIB:tu}DIR in ${_this:T}: ${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,}
784.endif
785.if ${_INTERNALLIBS:M${LIB}} != "" && !defined(LIB${LIB:tu})
786.error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}.  Likely should be: LIB${LIB:tu}?= $${LIB${LIB:tu}DIR}/lib${LIB}.a
787.endif
788.endif
789
790.endif	# !target(__<src.libnames.mk>__)
791