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