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