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