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