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