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