Fix some build warnings.
[platform/upstream/ibus.git] / configure.ac
1 # vim:set et ts=4:
2 #
3 # ibus - The Input Bus
4 #
5 # Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
6 # Copyright (c) 2007-2010 Red Hat, Inc.
7 #
8 # This library is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public
10 # License as published by the Free Software Foundation; either
11 # version 2 of the License, or (at your option) any later version.
12 #
13 # This library is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU Lesser General Public License for more details.
17 #
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with this program; if not, write to the
20 # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
21 # Boston, MA  02111-1307  USA
22
23
24 # If ibus_released is 0, append datestamp to the version number.
25 m4_define([ibus_released], [0])
26
27 m4_define([ibus_major_version], [1])
28 m4_define([ibus_minor_version], [4])
29 m4_define([ibus_micro_version], [99])
30 m4_define([ibus_abi_current], [5])
31 m4_define([ibus_abi_revision],
32           [m4_eval(100 * ibus_minor_version + ibus_micro_version)])
33 m4_define([ibus_abi_age], [0])
34 m4_define([ibus_maybe_datestamp],
35     m4_esyscmd([test x]ibus_released[ != x1 && date +.%Y%m%d | tr -d '\n\r']))
36 m4_define([ibus_version],
37     ibus_major_version.ibus_minor_version.ibus_micro_version[]ibus_maybe_datestamp)
38 m4_define([ibus_api_version], [ibus_major_version.0])
39
40 AC_PREFEQ([2.62])
41 AC_INIT([ibus], [ibus_version],
42         [http://code.google.com/p/ibus/issues/entry],
43         [ibus])
44
45 AC_CONFIG_HEADERS([config.h])
46 AC_CONFIG_MACRO_DIR([m4])
47
48 m4_define([ibus_abi_current_minus_age],
49           [m4_eval(ibus_abi_current - ibus_abi_age)])
50 m4_define([ibus_binary_version],
51           [ibus_major_version.ibus_abi_current_minus_age.ibus_abi_age.ibus_abi_revision])
52
53 # Required versions of other packages.
54 m4_define([glib_required_version], [2.26.0])
55
56
57 # Init automake.
58 AM_INIT_AUTOMAKE([1.10])
59 AM_MAINTAINER_MODE([enable])
60 AC_GNU_SOURCE
61
62 # Support silent build rules. Disable
63 # by either passing --disable-silent-rules to configure or passing V=1
64 # to make
65 AM_SILENT_RULES([yes])
66
67 # Define sustituted variables:
68 IBUS_MAJOR_VERSION=ibus_major_version
69 IBUS_MINOR_VERSION=ibus_minor_version
70 IBUS_MICRO_VERSION=ibus_micro_version
71 IBUS_ABI_CURRENT=ibus_abi_current
72 IBUS_ABI_REVISION=ibus_abi_revision
73 IBUS_ABI_AGE=ibus_abi_age
74 IBUS_VERSION=ibus_version
75 IBUS_API_VERSION=ibus_api_version
76 IBUS_BINARY_VERSION=ibus_binary_version
77 AC_SUBST(IBUS_MAJOR_VERSION)
78 AC_SUBST(IBUS_MINOR_VERSION)
79 AC_SUBST(IBUS_MICRO_VERSION)
80 AC_SUBST(IBUS_ABI_CURRENT)
81 AC_SUBST(IBUS_ABI_REVISION)
82 AC_SUBST(IBUS_ABI_AGE)
83 AC_SUBST(IBUS_API_VERSION)
84 AC_SUBST(IBUS_VERSION)
85 AC_SUBST(IBUS_BINARY_VERSION)
86
87 # libtool versioning
88 #
89 # If LT_VERSION_INFO="lt_current:lt_revision:lt_age", libibus is
90 # libibus-ibus_api_version.so.(lt_current - lt_age).lt_age.lt_revision
91 # If the abi is changed, but it is compatible with last version,
92 # ibus_abi_current++, ibus_abi_age++;
93 # If the abi is not compatible with last version,
94 # ibus_abi_current++, ibus_abi_age = 0;
95 m4_define([lt_current], [ibus_abi_current])
96 m4_define([lt_revision], [ibus_abi_revision])
97 m4_define([lt_age], [ibus_abi_age])
98 LT_VERSION_INFO="lt_current:lt_revision:lt_age"
99 LT_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age)
100 AC_SUBST(LT_VERSION_INFO)
101 AC_SUBST(LT_CURRENT_MINUS_AGE)
102
103 # Define GETTEXT_* variables.
104 GETTEXT_PACKAGE=ibus10
105 AC_SUBST(GETTEXT_PACKAGE)
106 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
107                    [The prefix for out gettext translation domains.])
108 GLIB_DEFINE_LOCALEDIR(GLIB_LOCALE_DIR)
109 GLIB_LOCALE_DIR=$localedir
110 AC_SUBST(GLIB_LOCALE_DIR)
111
112 # For dislpay date.
113 m4_define(ibus_datedisplay,
114     m4_esyscmd(date '+%a %b %d %Y' | tr -d '\n\r'))
115 DATE_DISPLAY="ibus_datedisplay"
116 AC_SUBST(DATE_DISPLAY)
117
118
119 # Check for programs.
120 AC_PROG_CC
121 AM_PROG_CC_C_O
122 AC_PROG_CC_STDC
123 AM_PROG_VALAC([0.14])
124 AC_PROG_INSTALL
125 AC_PROG_MAKE_SET
126
127 # i18n stuff
128 AM_GLIB_GNU_GETTEXT
129
130 # Define PACKAGE_VERSION_* variables.
131 AM_DISABLE_STATIC
132 AC_ISC_POSIX
133 AC_HEADER_STDC
134 AM_PROG_LIBTOOL
135 IT_PROG_INTLTOOL([0.35.0])
136
137 # Check functions.
138 AC_CHECK_FUNCS(daemon)
139
140 # Check packages.
141 # Check glib2.
142 AM_PATH_GLIB_2_0
143 PKG_CHECK_MODULES(GLIB2, [
144     glib-2.0 >= glib_required_version
145 ])
146 PKG_CHECK_MODULES(GOBJECT2, [
147     gobject-2.0 >= glib_required_version
148 ])
149 PKG_CHECK_MODULES(GIO2, [
150     gio-2.0 >= glib_required_version
151 ])
152 PKG_CHECK_MODULES(GTHREAD2, [
153     gthread-2.0 >= glib_required_version
154 ])
155
156 # --disable-tests option.
157 AC_ARG_ENABLE(tests,
158     AS_HELP_STRING([--disable-tests],
159                    [Do not run tests]),
160     [enable_tests=$enableval],
161     [enable_tests=yes]
162 )
163 AM_CONDITIONAL([ENABLE_TESTS], [test x"$enable_tests" = x"yes"])
164 if test x"$enable_tests" != x"yes"; then
165     enable_tests="no (disabled, use --enable-tests to enable)"
166 fi
167
168 # --disable-gtk2 option.
169 AC_ARG_ENABLE(gtk2,
170     AS_HELP_STRING([--disable-gtk2],
171                    [Do not build gtk2 im module]),
172     [enable_gtk2=$enableval],
173     [enable_gtk2=yes]
174 )
175 AM_CONDITIONAL([ENABLE_GTK2], [test x"$enable_gtk2" = x"yes"])
176
177 # --disable-gtk3 option.
178 AC_ARG_ENABLE(gtk3,
179     AS_HELP_STRING([--disable-gtk3],
180                    [Do not build gtk3 im module]),
181     [enable_gtk3=$enableval],
182     [enable_gtk3=yes]
183 )
184 AM_CONDITIONAL([ENABLE_GTK3], [test x"$enable_gtk3" = x"yes"])
185
186 # --disable-xim option.
187 AC_ARG_ENABLE(xim,
188     AS_HELP_STRING([--disable-xim],
189                    [Do not build xim server]),
190     [enable_xim=$enableval],
191     [enable_xim=yes]
192 )
193 AM_CONDITIONAL([ENABLE_XIM], [test x"$enable_xim" = x"yes"])
194
195 # --disable-vala option.
196 AC_ARG_ENABLE(vala,
197     AS_HELP_STRING([--disable-vala],
198                    [Do not build ibus vala binding]),
199     [enable_vala=$enableval],
200     [enable_vala=yes]
201 )
202 if test x"$enable_vala" = x"yes"; then
203     AC_PATH_PROG([VAPIGEN], [vapigen], [false])
204 fi
205 AM_CONDITIONAL([ENABLE_VALA], [test x"$enable_vala" = x"yes"])
206 if test x"$enable_vala" != x"yes"; then
207     enable_vala="no (disabled, use --enable-vala to enable)"
208 fi
209
210 if test x"$enable_gtk2" = x"yes" -o x"$enable_xim" = x"yes" ; then
211     # check for gtk2
212     PKG_CHECK_MODULES(GTK2, [
213         gtk+-2.0
214     ])
215 fi
216
217 if test x"$enable_gtk2" = x"yes"; then
218     # check for gdk2
219     gtk2_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
220     GTK2_IM_MODULEDIR="$libdir"/gtk-2.0/$gtk2_binary_version/immodules
221
222     PKG_CHECK_MODULES(GDK2, [
223         gdk-2.0
224     ])
225 else
226     enable_gtk2="no (disabled, use --enable-gtk2 to enable)"
227 fi
228
229 if test x"$enable_gtk3" = x"yes"; then
230     # check for gtk3, gdk3
231     PKG_CHECK_MODULES(GTK3, [
232         gtk+-3.0
233     ])
234
235     gtk3_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
236     GTK3_IM_MODULEDIR="$libdir"/gtk-3.0/$gtk3_binary_version/immodules
237
238     PKG_CHECK_MODULES(GDK3, [
239         gdk-3.0
240     ])
241 else
242     enable_gtk3="no (disabled, use --enable-gtk3 to enable)"
243 fi
244
245 if test x"$enable_xim" = x"yes"; then
246     # Check for x11
247     PKG_CHECK_MODULES(X11, [
248         x11
249     ])
250     AC_CHECK_HEADERS([X11/XKBlib.h])
251 else
252     enable_xim="no (disabled, use --enable-xim to enable)"
253 fi
254
255 # GObject introspection
256 GOBJECT_INTROSPECTION_CHECK([0.6.8])
257
258 IBUS_GIR_SCANNERFLAGS=
259 if test x"$found_introspection" = x"yes" ; then
260     IBUS_GIR_SCANNERFLAGS="--identifier-prefix=IBus --symbol-prefix=ibus"
261     PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 0.9.6],
262                      [gir_symbol_prefix=yes],
263                      [gir_symbol_prefix=no])
264     if test x"$gir_symbol_prefix" = x"no" ; then
265         IBUS_GIR_SCANNERFLAGS="--strip-prefix=IBus"
266     fi
267 fi
268 AC_SUBST(IBUS_GIR_SCANNERFLAGS)
269
270 # Check for gtk-doc.
271 GTK_DOC_CHECK(1.9)
272 if test x"$enable_gtk_doc" = x"no"; then
273     enable_gtk_doc="no (disabled, use --enable-gtk-doc to enable)"
274 fi
275
276 # Check for dbus.
277 PKG_CHECK_MODULES(DBUS, [
278     dbus-1
279 ])
280
281 # --disable-gconf option.
282 AC_ARG_ENABLE(gconf,
283     AS_HELP_STRING([--disable-gconf],
284                    [Do not use GConf code]),
285     [enable_gconf=$enableval],
286     [enable_gconf=yes]
287 )
288 AM_CONDITIONAL([ENABLE_GCONF], [test x"$enable_gconf" = x"yes"])
289
290 if test x"$enable_gconf" = x"yes"; then
291     # check gconf
292     PKG_CHECK_MODULES(GCONF,
293         [gconf-2.0 >= 2.12],
294     )
295
296     AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
297     if test x"$GCONFTOOL" = xno; then
298         AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
299     fi
300
301     AM_GCONF_SOURCE_2
302     # GCONF_SCHEMAS_INSTALL should be set in macro AM_GCONF_SOURCE_2
303 else
304     AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [false])
305     enable_gconf="no (disabled, use --enable-gconf to enable)"
306 fi
307
308 # --enable-memconf option.
309 AC_ARG_ENABLE(memconf,
310     AS_HELP_STRING([--enable-memconf],
311                    [Enable configure base on memory]),
312     [enable_memconf=$enableval],
313     [enable_memconf=no]
314 )
315 AM_CONDITIONAL([ENABLE_MEMCONF], [test "x$enable_memconf" = "xyes"])
316
317 AC_ARG_ENABLE(dconf,
318     AS_HELP_STRING([--enable-dconf],
319                    [Enable configure base on dconf]),
320     [enable_dconf=$enableval],
321     [enable_dconf=no]
322 )
323
324 if test x"$enable_dconf" = x"yes"; then
325     # check dconf
326     PKG_CHECK_MODULES(DCONF,
327         [dconf >= 0.7.5], ,
328         enable_dconf=no
329     )
330     PKG_CHECK_EXISTS([dconf >= 0.13.4],
331         [AC_DEFINE(DCONF_0_13_4, TRUE, [dconf is 0.13.4 or later])],
332         [])
333     # check glib-compile-schemas
334     GLIB_GSETTINGS
335 fi
336 AM_CONDITIONAL([ENABLE_DCONF], [test x"$enable_dconf" = x"yes"])
337
338 # Check env.
339 AC_PATH_PROG(ENV_IBUS_TEST, env)
340 AC_SUBST(ENV_IBUS_TEST)
341
342 AC_ARG_ENABLE(python-library,
343     AS_HELP_STRING([--enable-python-library],
344                    [Use ibus python library]),
345     [enable_python_library=$enableval],
346     [enable_python_library=no]
347 )
348
349 AC_ARG_ENABLE(setup,
350     AS_HELP_STRING([--disable-setup],
351                    [Do not use setup ui.]),
352     [enable_setup=$enableval],
353     [enable_setup=yes]
354 )
355
356 AM_CONDITIONAL([ENABLE_PYTHON_LIBRARY], [test x"$enable_python_library" = x"yes"])
357 AM_CONDITIONAL([ENABLE_SETUP], [test x"$enable_setup" = x"yes"])
358 AM_CONDITIONAL([ENABLE_DAEMON], [true])
359
360 AM_PATH_PYTHON([2.5])
361
362 if test x"$enable_python_library" = x"yes"; then
363     # Check python.
364     AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
365     if test x"$PYTHON_CONFIG" = x""; then
366         AC_PATH_PROG(PYTHON_CONFIG, python-config)
367     fi
368     if test x"$PYTHON_CONFIG" != x""; then
369         PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
370         PYTHON_LIBS=`$PYTHON_CONFIG --libs`
371     else
372         PYTHON_CFLAGS=`$PYTHON $srcdir/python-config.py --includes`
373         PYTHON_LIBS=`$PYTHON $srcdir/python-config.py --libs`
374     fi
375     PYTHON_INCLUDES="$PYTHON_CFLAGS"
376     AC_SUBST(PYTHON_CFLAGS)
377     AC_SUBST(PYTHON_INCLUDES)
378     AC_SUBST(PYTHON_LIBS)
379 else
380     enable_python_library="no (disabled, use --enable-python-library to enable)"
381 fi
382
383 # Define gtk2 immodule dir.
384 AC_ARG_WITH(gtk2-im-module-dir,
385     AS_HELP_STRING([--with-gtk2-im-module-dir[=DIR]],
386         [Select gtk2 immodule dir]),
387     GTK2_IM_MODULEDIR=$with_gtk2_im_module_dir
388 )
389 AC_SUBST(GTK2_IM_MODULEDIR)
390
391 # Define gtk3 immodule dir.
392 AC_ARG_WITH(gtk3-im-module-dir,
393     AS_HELP_STRING([--with-gtk3-im-module-dir[=DIR]],
394         [Select gtk3 immodule dir]),
395     GTK3_IM_MODULEDIR=$with_gtk3_im_module_dir
396 )
397 AC_SUBST(GTK3_IM_MODULEDIR)
398
399 if test x"$enable_python" = x"yes"; then
400     # Check for dbus-python.
401     AC_ARG_ENABLE(dbus-python-check,
402         AS_HELP_STRING([--disable-dbus-python-check],
403             [Do not check dbus-python]),
404         [enable_dbus_python_check=$enableval],
405         [enable_dbus_python_check=yes]
406     )
407     PKG_CHECK_MODULES(DBUS_PYTHON,
408         [dbus-python >= 0.83.0],
409         [IBUS_HAS_DBUS_PYTHON=yes],
410         [IBUS_HAS_DBUS_PYTHON=no]
411     )
412     if test x"$IBUS_HAS_DBUS_PYTHON" != x"yes"; then
413         if test x"$enable_dbus_python_check" != x"no"; then
414             AC_MSG_ERROR([can not find dbus-python >= 0.83.0. Please install or update dbus-python.])
415         else
416             AC_MSG_WARN([can not find dbus-python >= 0.83.0. It is required.])
417         fi
418     fi
419 fi
420
421 # Option for always disable snooper applications.
422 AC_ARG_ENABLE(key-snooper,
423     AS_HELP_STRING([--disable-key-snooper],
424         [Always disable key snooper in gtk im module]),
425     [enable_key_snooper=$enableval],
426     [enable_key_snooper=yes]
427 )
428 if test x"$enable_key_snooper" = x"yes"; then
429     AC_DEFINE(ENABLE_SNOOPER, TRUE, [Enable key snooper])
430 else
431     AC_DEFINE(ENABLE_SNOOPER, FALSE, [Enable key snooper])
432     enable_key_snooper="no (disabled, use --enable-key-snooper to enable)"
433 fi
434
435 # Option for no snooper applications.
436 AC_ARG_WITH(no-snooper-apps,
437     AS_HELP_STRING([--with-no-snooper-apps[=regex1,regex2]],
438         [Does not enable keyboard snooper in those applications (like: .*chrome.*,firefox.*)]),
439     NO_SNOOPER_APPS=$with_no_snooper_apps,
440     NO_SNOOPER_APPS=[.*chrome.*,.*chromium.*,firefox.*,Do.*]
441 )
442 AC_DEFINE_UNQUOTED(NO_SNOOPER_APPS, "$NO_SNOOPER_APPS",
443     [Does not enbale keyboard snooper in those applications])
444
445 # GNOME 3 uses the theme's icon.
446 AC_ARG_WITH(panel-icon-keyboard,
447     AS_HELP_STRING([--with-panel-icon-keyboard[=icon_name]],
448         [Set the default panel icon (default: "input-keyboard-symbolic")]),
449     [if test x"$with_panel_icon_keyboard" = x"yes" -o \
450              x"$with_panel_icon_keyboard" = x; then
451          with_panel_icon_keyboard="input-keyboard-symbolic"
452      fi
453      if test x"$with_panel_icon_keyboard" = x"legacy"; then
454          with_panel_icon_keyboard="ibus-keyboard"
455      fi
456      IBUS_ICON_KEYBOARD=$with_panel_icon_keyboard
457     ],
458     IBUS_ICON_KEYBOARD="input-keyboard-symbolic"
459 )
460 AC_SUBST(IBUS_ICON_KEYBOARD)
461
462 # --disable-surrounding-text option.
463 AC_ARG_ENABLE(surrounding-text,
464     AS_HELP_STRING([--disable-surrounding-text],
465         [Enable surrounding-text support]),
466     [enable_surrounding_text=$enableval],
467     [enable_surrounding_text=yes]
468 )
469 if test x"$enable_surrounding_text" = x"yes"; then
470     AC_DEFINE(ENABLE_SURROUNDING, TRUE, [Enable surrounding-text support])
471 else
472     enable_surrounding_text="no (disabled, use --enable-surrounding-text to enable)"
473 fi
474
475 # --disable-ui
476 AC_ARG_ENABLE(ui,
477     AS_HELP_STRING([--disable-ui],
478                    [Disable ibus default user interface]),
479     [enable_ui=$enableval],
480     [enable_ui=yes]
481 )
482 AM_CONDITIONAL([ENABLE_UI], [test x"$enable_ui" = x"yes"])
483 if test x"$enable_ui" = x"yes"; then
484     enable_ui="yes (enabled, use --disable-ui to disable)"
485 fi
486
487 # --disable-engine
488 AC_ARG_ENABLE(engine,
489     AS_HELP_STRING([--disable-engine],
490                    [Disable ibus simple engine]),
491     [enable_engine=$enableval],
492     [enable_engine=yes]
493 )
494 AM_CONDITIONAL([ENABLE_ENGINE], [test x"$enable_engine" = x"yes"])
495 if test x"$enable_engine" = x"yes"; then
496     enable_engine="yes (enabled, use --disable-engine to disable)"
497 fi
498
499 # Check iso-codes.
500 PKG_CHECK_MODULES(ISOCODES, [
501     iso-codes
502 ])
503 ISOCODES_PREFIX=`pkg-config iso-codes --variable=prefix`
504 AC_SUBST(ISOCODES_PREFIX)
505
506 # OUTPUT files
507 AC_CONFIG_FILES([ po/Makefile.in
508 Makefile
509 ibus-1.0.pc
510 ibus.spec
511 client/Makefile
512 client/gtk2/Makefile
513 client/gtk3/Makefile
514 client/x11/Makefile
515 src/Makefile
516 src/ibusversion.h
517 src/tests/Makefile
518 bus/Makefile
519 engine/Makefile
520 engine/simple.xml.in
521 util/Makefile
522 util/IMdkit/Makefile
523 data/Makefile
524 data/icons/Makefile
525 data/keymaps/Makefile
526 data/dconf/Makefile
527 docs/Makefile
528 docs/reference/Makefile
529 docs/reference/ibus/ibus-docs.sgml
530 docs/reference/ibus/Makefile
531 m4/Makefile
532 ibus/_config.py
533 ibus/Makefile
534 ibus/interface/Makefile
535 ui/Makefile
536 ui/gtk3/Makefile
537 ui/gtk3/gtkpanel.xml.in
538 setup/Makefile
539 setup/ibus-setup
540 bindings/Makefile
541 bindings/vala/Makefile
542 conf/Makefile
543 conf/gconf/Makefile
544 conf/gconf/gconf.xml.in
545 conf/dconf/Makefile
546 conf/dconf/dconf.xml.in
547 conf/memconf/Makefile
548 conf/memconf/memconf.xml.in
549 tools/Makefile
550 ])
551
552 AC_OUTPUT
553 AC_MSG_RESULT([
554 Build options:
555   Version                   $IBUS_VERSION
556   Install prefix            $prefix
557   Build shared libs         $enable_shared
558   Build static libs         $enable_static
559   CFLAGS                    $CFLAGS
560   Gtk2 immodule dir         $GTK2_IM_MODULEDIR
561   Gtk3 immodule dir         $GTK3_IM_MODULEDIR
562   Build gtk2 immodule       $enable_gtk2
563   Build gtk3 immodule       $enable_gtk3
564   Build XIM agent server    $enable_xim
565   Build python library      $enable_python_library
566   Build gconf modules       $enable_gconf
567   Build memconf modules     $enable_memconf
568   Build dconf modules       $enable_dconf
569   Build introspection       $found_introspection
570   IBus-1.0.gir scannerflags "$IBUS_GIR_SCANNERFLAGS"
571   Build vala binding        $enable_vala
572   Build document            $enable_gtk_doc
573   Build UI                  $enable_ui
574   Build engine              $enable_engine
575   Enable key snooper        $enable_key_snooper
576   No snooper regexes        "$NO_SNOOPER_APPS"
577   Panel icon                "$IBUS_ICON_KEYBOARD"
578   Enable surrounding-text   $enable_surrounding_text
579   Run test cases            $enable_tests
580 ])
581