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