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