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