xref: /freebsd/share/mk/src.libnames.mk (revision 5ca34122ecdd5abc62bdae39663fec9ac8523d87)
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.include <src.opts.mk>
11
12.if ${.OBJDIR:S,${.CURDIR},,} != ${.OBJDIR}
13ROOTOBJDIR=	${.OBJDIR:S,${.CURDIR},,}${SRCTOP}
14.elif defined(OBJTOP) && ${.OBJDIR:M${OBJTOP}*} != ""
15ROOTOBJDIR=	${OBJTOP}
16.endif
17
18_PRIVATELIBS=	\
19		atf_c \
20		atf_cxx \
21		bsdstat \
22		event \
23		heimipcc \
24		heimipcs \
25		ldns \
26		sqlite3 \
27		ssh \
28		ucl \
29		unbound
30
31_INTERNALLIBS=	\
32		amu \
33		bsnmptools \
34		cron \
35		elftc \
36		fifolog \
37		ipf \
38		lpr \
39		netbsd \
40		ntp \
41		ntpevent \
42		ohash \
43		opts \
44		parse \
45		readline \
46		sl \
47		sm \
48		smdb \
49		smutil \
50		telnet \
51		vers
52
53_LIBRARIES=	\
54		${_PRIVATELIBS} \
55		${_INTERNALLIBS} \
56		alias \
57		archive \
58		asn1 \
59		auditd \
60		begemot \
61		bluetooth \
62		bsdxml \
63		bsm \
64		bsnmp \
65		bz2 \
66		c \
67		c_pic \
68		calendar \
69		cam \
70		capsicum \
71		casper \
72		com_err \
73		compiler_rt \
74		crypt \
75		crypto \
76		ctf \
77		cuse \
78		cxxrt \
79		devctl \
80		devinfo \
81		devstat \
82		dialog \
83		dpv \
84		dtrace \
85		dwarf \
86		edit \
87		elf \
88		execinfo \
89		fetch \
90		figpar \
91		geom \
92		gnuregex \
93		gpio \
94		gssapi \
95		gssapi_krb5 \
96		hdb \
97		heimbase \
98		heimntlm \
99		heimsqlite \
100		hx509 \
101		ipsec \
102		jail \
103		kadm5clnt \
104		kadm5srv \
105		kafs5 \
106		kdc \
107		kiconv \
108		krb5 \
109		kvm \
110		l \
111		lzma \
112		m \
113		magic \
114		md \
115		memstat \
116		mp \
117		mt \
118		nandfs \
119		ncurses \
120		ncursesw \
121		netgraph \
122		ngatm \
123		nv \
124		opie \
125		pam \
126		panel \
127		panelw \
128		pcap \
129		pcsclite \
130		pjdlog \
131		pmc \
132		proc \
133		procstat \
134		pthread \
135		radius \
136		readline \
137		roken \
138		rpcsec_gss \
139		rpcsvc \
140		rt \
141		rtld_db \
142		sbuf \
143		sdp \
144		sm \
145		smb \
146		ssl \
147		ssp_nonshared \
148		stdthreads \
149		supcplusplus \
150		tacplus \
151		termcapw \
152		ufs \
153		ugidfw \
154		ulog \
155		usb \
156		usbhid \
157		util \
158		vmmapi \
159		wind \
160		wrap \
161		xo \
162		y \
163		ypclnt \
164		z
165
166_DP_archive=	z bz2 lzma bsdxml
167.if ${MK_OPENSSL} != "no"
168_DP_archive+=	crypto
169.else
170_DP_archive+=	md
171.endif
172_DP_ssl=	crypto
173_DP_ssh=	crypto crypt
174.if ${MK_LDNS} != "no"
175_DP_ssh+=	ldns z
176.endif
177_DP_edit=	ncursesw
178.if ${MK_OPENSSL} != "no"
179_DP_bsnmp=	crypto
180.endif
181_DP_geom=	bsdxml sbuf
182_DP_cam=	sbuf
183_DP_casper=	capsicum nv pjdlog
184_DP_capsicum=	nv
185_DP_pjdlog=	util
186_DP_opie=	md
187_DP_usb=	pthread
188_DP_unbound=	pthread
189_DP_rt=	pthread
190.if ${MK_OPENSSL} == "no"
191_DP_radius=	md
192.else
193_DP_radius=	crypto
194.endif
195_DP_procstat=	kvm util elf
196.if ${MK_CXX} == "yes"
197.if ${MK_LIBCPLUSPLUS} != "no"
198_DP_proc=	cxxrt
199.else
200_DP_proc=	supcplusplus
201.endif
202.endif
203.if ${MK_CDDL} != "no"
204_DP_proc+=	ctf
205.endif
206_DP_mp=	crypto
207_DP_memstat=	kvm
208_DP_magic=	z
209_DP_mt=		bsdxml
210_DP_ldns=	crypto
211.if ${MK_OPENSSL} != "no"
212_DP_fetch=	ssl crypto
213.else
214_DP_fetch=	md
215.endif
216_DP_execinfo=	elf
217_DP_dwarf=	elf
218_DP_dpv=	dialog figpar util
219_DP_dialog=	ncursesw m
220_DP_cuse=	pthread
221_DP_atf_cxx=	atf_c
222_DP_devstat=	kvm
223_DP_pam=	radius tacplus opie md util
224.if ${MK_KERBEROS} != "no"
225_DP_pam+=	krb5
226.endif
227.if ${MK_OPENSSH} != "no"
228_DP_pam+=	ssh
229.endif
230.if ${MK_NIS} != "no"
231_DP_pam+=	ypclnt
232.endif
233_DP_krb5+=	asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc \
234		pthread
235_DP_gssapi_krb5+=	gssapi krb5 crypto roken asn1 com_err
236_DP_lzma=	pthread
237_DP_ucl=	m
238_DP_vmmapi=	util
239_DP_ctf=	z
240_DP_proc=	rtld_db util
241_DP_dtrace=	rtld_db pthread
242
243# Define spacial cases
244LDADD_supcplusplus=	-lsupc++
245LIBATF_C=	${DESTDIR}${LIBDIR}/libprivateatf-c.a
246LIBATF_CXX=	${DESTDIR}${LIBDIR}/libprivateatf-c++.a
247LDADD_atf_c=	-lprivateatf-c
248LDADD_atf_cxx=	-lprivateatf-c++
249
250.for _l in ${_PRIVATELIBS}
251LIB${_l:tu}?=	${DESTDIR}${LIBDIR}/libprivate${_l}.a
252.endfor
253
254.for _l in ${_LIBRARIES}
255.if ${_INTERNALLIBS:M${_l}}
256LDADD_${_l}_L+=		-L${LIB${_l:tu}DIR}
257.endif
258DPADD_${_l}?=	${LIB${_l:tu}}
259.if ${_PRIVATELIBS:M${_l}}
260LDADD_${_l}?=	-lprivate${_l}
261.else
262LDADD_${_l}?=	${LDADD_${_l}_L} -l${_l}
263.endif
264.if defined(_DP_${_l}) && defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO")
265.for _d in ${_DP_${_l}}
266DPADD_${_l}+=	${DPADD_${_d}}
267LDADD_${_l}+=	${LDADD_${_d}}
268.endfor
269.endif
270.endfor
271
272DPADD_atf_cxx+=	${DPADD_atf_c}
273LDADD_atf_cxx+=	${LDADD_atf_c}
274
275DPADD_sqlite3+=	${DPADD_pthread}
276LDADD_sqlite3+=	${LDADD_pthread}
277
278DPADD_fifolog+=	${DPADD_z}
279LDADD_fifolog+=	${LDADD_z}
280
281DPADD_ipf+=	${DPADD_kvm}
282LDADD_ipf+=	${LDADD_kvm}
283
284DPADD_mt+=	${DPADD_sbuf}
285LDADD_mt+=	${LDADD_sbuf}
286
287DPADD_dtrace+=	${DPADD_ctf} ${DPADD_elf} ${DPADD_proc}
288LDADD_dtrace+=	${LDADD_ctf} ${LDADD_elf} ${LDADD_proc}
289
290# The following depends on libraries which are using pthread
291DPADD_hdb+=	${DPADD_pthread}
292LDADD_hdb+=	${LDADD_pthread}
293DPADD_kadm5srv+=	${DPADD_pthread}
294LDADD_kadm5srv+=	${LDADD_pthread}
295DPADD_krb5+=	${DPADD_pthread}
296LDADD_krb5+=	${LDADD_pthread}
297DPADD_gssapi_krb5+=	${DPADD_pthread}
298LDADD_gssapi_krb5+=	${LDADD_pthread}
299
300.for _l in ${LIBADD}
301DPADD+=		${DPADD_${_l}:Umissing-dpadd_${_l}}
302LDADD+=		${LDADD_${_l}}
303.endfor
304
305.if defined(DPADD) && ${DPADD:Mmissing-dpadd_*}
306.error Missing ${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/DPADD_/} variable add "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//}" to _LIBRARIES, _INTERNALLIBS, or _PRIVATELIBS and define "${DPADD:Mmissing-dpadd_*:S/missing-dpadd_//:S/^/LIB/:tu}".
307.endif
308
309LIBELFTCDIR=	${ROOTOBJDIR}/lib/libelftc
310LIBELFTC?=	${LIBELFTCDIR}/libelftc.a
311
312LIBREADLINEDIR=	${ROOTOBJDIR}/gnu/lib/libreadline/readline
313LIBREADLINE?=	${LIBREADLINEDIR}/libreadline.a
314
315LIBOHASHDIR=	${ROOTOBJDIR}/lib/libohash
316LIBOHASH?=	${LIBOHASHDIR}/libohash.a
317
318LIBSMDIR=	${ROOTOBJDIR}/lib/libsm
319LIBSM?=		${LIBSMDIR}/libsm.a
320
321LIBSMDBDIR=	${ROOTOBJDIR}/lib/libsmdb
322LIBSMDB?=	${LIBSMDBDIR}/libsmdb.a
323
324LIBSMUTILDIR=	${ROOTOBJDIR}/lib/libsmutil
325LIBSMUTIL?=	${LIBSMDBDIR}/libsmutil.a
326
327LIBNETBSDDIR?=	${ROOTOBJDIR}/lib/libnetbsd
328LIBNETBSD?=	${LIBNETBSDDIR}/libnetbsd.a
329
330LIBVERSDIR?=	${ROOTOBJDIR}/kerberos5/lib/libvers
331LIBVERS?=	${LIBVERSDIR}/libvers.a
332
333LIBSLDIR=	${ROOTOBJDIR}/kerberos5/lib/libsl
334LIBSL?=		${LIBSLDIR}/libsl.a
335
336LIBIPFDIR=	${ROOTOBJDIR}/sbin/ipf/libipf
337LIBIPF?=	${LIBIPFDIR}/libipf.a
338
339LIBTELNETDIR=	${ROOTOBJDIR}/lib/libtelnet
340LIBTELNET?=	${LIBTELNETDIR}/libtelnet.a
341
342LIBCRONDIR=	${ROOTOBJDIR}/usr.sbin/cron/lib
343LIBCRON?=	${LIBCRONDIR}/libcron.a
344
345LIBNTPDIR=	${ROOTOBJDIR}/usr.sbin/ntp/libntp
346LIBNTP?=	${LIBNTPDIR}/libntp.a
347
348LIBNTPEVENTDIR=	${ROOTOBJDIR}/usr.sbin/ntp/libntpevent
349LIBNTPEVENT?=	${LIBNTPEVENTDIR}/libntpevent.a
350
351LIBOPTSDIR=	${ROOTOBJDIR}/usr.sbin/ntp/libopts
352LIBOTPS?=	${LIBOPTSDIR}/libopts.a
353
354LIBPARSEDIR=	${ROOTOBJDIR}/usr.sbin/ntp/libparse
355LIBPARSE?=	${LIBPARSEDIR}/libparse.a
356
357LIBLPRDIR=	${ROOTOBJDIR}/usr.sbin/lpr/common_source
358LIBLPR?=	${LIBOPTSDIR}/liblpr.a
359
360LIBFIFOLOGDIR=	${ROOTOBJDIR}/usr.sbin/fifolog/lib
361LIBFIFOLOG?=	${LIBOPTSDIR}/libfifolog.a
362
363LIBBSNMPTOOLSDIR=	${ROOTOBJDIR}/usr.sbin/bsnmpd/tools/libbsnmptools
364LIBBSNMPTOOLS?=	${LIBBSNMPTOOLSDIR}/libbsnmptools.a
365
366LIBAMUDIR=	${ROOTOBJDIR}/usr.sbin/amd/libamu
367LIBAMU?=	${LIBAMUDIR}/libamu/libamu.a
368
369