1 dnl aclocal.m4 generated automatically by aclocal 1.4-p5
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
14 dnl AC_PROG_INTLTOOL([MINIMUM-VERSION])
15 # serial 1 AC_PROG_INTLTOOL
16 AC_DEFUN(AC_PROG_INTLTOOL,
20 AC_MSG_CHECKING(for intltool >= $1)
22 INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ printf "%d", $[1] * 100 + $[2]; }'`
23 INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { printf $[2]; }' < intltool-update.in`
25 INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split(${{2}}, VERSION, "."); printf "%d\n", VERSION[1] * 100 + VERSION[2];}' < intltool-update.in`
28 if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"; then
29 AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
31 AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found. Your intltool is too old. You need intltool $1 or later.])
36 INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u -c $(top_builddir)/po/.intltool-merge-cache'
37 INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u -c $(top_builddir)/po/.intltool-merge-cache'
38 INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -k -u -c $(top_builddir)/po/.intltool-merge-cache'
39 INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -o -p'
40 INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -x -u -c $(top_builddir)/po/.intltool-merge-cache'
41 INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -o -u -c $(top_builddir)/po/.intltool-merge-cache'
42 INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -x -u -c $(top_builddir)/po/.intltool-merge-cache'
43 INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u -c $(top_builddir)/po/.intltool-merge-cache'
44 INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -x -u -c $(top_builddir)/po/.intltool-merge-cache'
45 INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -x -u -c $(top_builddir)/po/.intltool-merge-cache'
46 INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -d -u -c $(top_builddir)/po/.intltool-merge-cache'
48 AC_SUBST(INTLTOOL_DESKTOP_RULE)
49 AC_SUBST(INTLTOOL_DIRECTORY_RULE)
50 AC_SUBST(INTLTOOL_KEYS_RULE)
51 AC_SUBST(INTLTOOL_OAF_RULE)
52 AC_SUBST(INTLTOOL_PONG_RULE)
53 AC_SUBST(INTLTOOL_SERVER_RULE)
54 AC_SUBST(INTLTOOL_SHEET_RULE)
55 AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
56 AC_SUBST(INTLTOOL_UI_RULE)
57 AC_SUBST(INTLTOOL_XML_RULE)
58 AC_SUBST(INTLTOOL_CAVES_RULE)
60 # Use the tools built into the package, not the ones that are installed.
62 INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract'
63 INTLTOOL_MERGE='$(top_builddir)/intltool-merge'
64 INTLTOOL_UPDATE='$(top_builddir)/intltool-update'
66 AC_SUBST(INTLTOOL_EXTRACT)
67 AC_SUBST(INTLTOOL_MERGE)
68 AC_SUBST(INTLTOOL_UPDATE)
70 AC_PATH_PROG(INTLTOOL_PERL, perl)
71 if test -z "$INTLTOOL_PERL"; then
72 AC_MSG_ERROR([perl not found; required for intltool])
74 if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
75 AC_MSG_ERROR([perl 5.x required for intltool])
78 # Remove file type tags (using []) from po/POTFILES.
80 ifdef([AC_DIVERSION_ICMDS],[
81 AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)
83 mv -f po/POTFILES po/POTFILES.tmp
84 sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
89 ifdef([AC_CONFIG_COMMANDS_PRE],[
90 AC_CONFIG_COMMANDS_PRE([
92 mv -f po/POTFILES po/POTFILES.tmp
93 sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
100 # Manually sed perl in so people don't have to put the intltool scripts in AC_OUTPUT.
104 sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/intltool-extract.in > intltool-extract.out
105 if cmp -s intltool-extract intltool-extract.out 2>/dev/null; then
106 rm -f intltool-extract.out
108 mv -f intltool-extract.out intltool-extract
110 chmod ugo+x intltool-extract
111 chmod u+w intltool-extract
113 sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/intltool-merge.in > intltool-merge.out
114 if cmp -s intltool-merge intltool-merge.out 2>/dev/null; then
115 rm -f intltool-merge.out
117 mv -f intltool-merge.out intltool-merge
119 chmod ugo+x intltool-merge
120 chmod u+w intltool-merge
122 sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/intltool-update.in > intltool-update.out
123 if cmp -s intltool-update intltool-update.out 2>/dev/null; then
124 rm -f intltool-update.out
126 mv -f intltool-update.out intltool-update
128 chmod ugo+x intltool-update
129 chmod u+w intltool-update
131 ], INTLTOOL_PERL=${INTLTOOL_PERL})
135 # Macro to add for using GNU gettext.
136 # Ulrich Drepper <drepper@cygnus.com>, 1995.
138 # Modified to never use included libintl.
139 # Owen Taylor <otaylor@redhat.com>, 12/15/1998
142 # This file can be copied and used freely without restrictions. It can
143 # be used in projects which are not available under the GNU Public License
144 # but which still want to provide support for the GNU gettext functionality.
145 # Please note that the actual code is *not* freely available.
148 # If you make changes to this file, you MUST update the copy in
149 # acinclude.m4. [ aclocal dies on duplicate macros, so if
150 # we run 'aclocal -I macros/' then we'll run into problems
151 # once we've installed glib-gettext.m4 :-( ]
156 AC_DEFUN(AM_GLIB_WITH_NLS,
157 dnl NLS is obligatory
161 dnl Figure out what method
162 nls_cv_force_use_gnu_gettext="no"
164 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
165 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
166 dnl User does not insist on using GNU NLS library. Figure out what
167 dnl to use. If gettext or catgets are available (in this order) we
168 dnl use this. Else we have to fall back to GNU NLS library.
169 dnl catgets is only used if permitted by option --with-catgets.
174 AC_CHECK_HEADER(libintl.h,
175 [AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
176 [AC_TRY_LINK([#include <libintl.h>], [return (int) dgettext ("","")],
177 gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no)])
179 if test "$gt_cv_func_dgettext_libc" != "yes"; then
180 AC_CHECK_LIB(intl, bindtextdomain,
181 [AC_CACHE_CHECK([for dgettext in libintl],
182 gt_cv_func_dgettext_libintl,
183 [AC_CHECK_LIB(intl, dgettext,
184 gt_cv_func_dgettext_libintl=yes,
185 gt_cv_func_dgettext_libintl=no)],
186 gt_cv_func_dgettext_libintl=no)])
189 if test "$gt_cv_func_dgettext_libintl" = "yes"; then
193 if test "$gt_cv_func_dgettext_libc" = "yes" \
194 || test "$gt_cv_func_dgettext_libintl" = "yes"; then
195 AC_DEFINE(HAVE_GETTEXT,1,
196 [Define if the GNU gettext() function is already present or preinstalled.])
197 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
198 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
199 if test "$MSGFMT" != "no"; then
200 AC_CHECK_FUNCS(dcgettext)
201 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
202 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
203 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
204 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
205 return _nl_msg_cat_cntr],
214 # Added by Martin Baulig 12/15/98 for libc5 systems
215 if test "$gt_cv_func_dgettext_libc" != "yes" \
216 && test "$gt_cv_func_dgettext_libintl" = "yes"; then
218 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
222 if test "$CATOBJEXT" = "NONE"; then
223 dnl Neither gettext nor catgets in included in the C library.
224 dnl Fall back on GNU gettext library.
225 nls_cv_use_gnu_gettext=yes
229 if test "$nls_cv_use_gnu_gettext" != "yes"; then
230 AC_DEFINE(ENABLE_NLS, 1,
231 [always defined to indicate that i18n is enabled])
233 dnl Unset this variable since we use the non-zero value as a flag.
237 dnl Test whether we really found GNU xgettext.
238 if test "$XGETTEXT" != ":"; then
239 dnl If it is no GNU xgettext we define it as : so that the
240 dnl Makefiles still can work.
241 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
245 [found xgettext program is not GNU xgettext; ignore it])
250 # We need to process the po/ directory.
254 [case "$CONFIG_FILES" in *po/Makefile.in*)
255 rm -f po/stamp-it po/stamp-it.tmp
257 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
258 mv po/stamp-it.tmp po/stamp-it
261 dnl These rules are solely for the distribution goal. While doing this
262 dnl we only have to keep exactly one list of the available catalogs
264 for lang in $ALL_LINGUAS; do
265 GMOFILES="$GMOFILES $lang.gmo"
266 POFILES="$POFILES $lang.po"
269 dnl Make all variables we use known to autoconf.
272 AC_SUBST(DATADIRNAME)
282 AC_DEFUN(AM_GLIB_GNU_GETTEXT,
283 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
284 AC_REQUIRE([AC_PROG_CC])dnl
285 AC_REQUIRE([AC_PROG_RANLIB])dnl
286 AC_REQUIRE([AC_HEADER_STDC])dnl
287 AC_REQUIRE([AC_C_CONST])dnl
288 AC_REQUIRE([AC_C_INLINE])dnl
289 AC_REQUIRE([AC_TYPE_OFF_T])dnl
290 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
291 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
292 AC_REQUIRE([AC_FUNC_MMAP])dnl
294 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
295 unistd.h sys/param.h])
296 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
297 strdup __argz_count __argz_stringify __argz_next])
302 if test "x$CATOBJEXT" != "x"; then
303 if test "x$ALL_LINGUAS" = "x"; then
306 AC_MSG_CHECKING(for catalogs to be installed)
308 for lang in ${LINGUAS=$ALL_LINGUAS}; do
309 case "$ALL_LINGUAS" in
310 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
314 AC_MSG_RESULT($LINGUAS)
317 dnl Construct list of names of catalog files to be constructed.
318 if test -n "$LINGUAS"; then
319 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
323 dnl Determine which catalog format we have (if any is needed)
324 dnl For now we know about two different formats:
325 dnl Linux libc-5 and the normal X/Open format
326 test -d po || mkdir po
327 if test "$CATOBJEXT" = ".cat"; then
328 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
330 dnl Transform the SED scripts while copying because some dumb SEDs
331 dnl cannot handle comments.
332 sed -e '/^#/d' $srcdir/po/$msgformat-msg.sed > po/po2msg.sed
335 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
336 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
337 dnl Try to locate is.
340 # jwz: fuck this! it puts hardcoded pathnames into the generated Makefiles!
342 # if test -n "$ac_aux_dir"; then
343 # MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
345 if test -z "$MKINSTALLDIRS"; then
346 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
349 # jwz: you know what, screw it. Let's just use the version that I
350 # already computed in configure.in, instead of this version that came
351 # with the i18n crud, ok?
352 MKINSTALLDIRS="$INSTALL_DIRS"
355 AC_SUBST(MKINSTALLDIRS)
357 dnl Generate list of files to be processed by xgettext which will
358 dnl be included in po/Makefile.
359 test -d po || mkdir po
360 if test "x$srcdir" != "x."; then
361 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
362 posrcprefix="$srcdir/"
364 posrcprefix="../$srcdir/"
370 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
371 < $srcdir/po/POTFILES.in > po/POTFILES
375 # Search path for a program which passes the given test.
376 # Ulrich Drepper <drepper@cygnus.com>, 1996.
378 # This file can be copied and used freely without restrictions. It can
379 # be used in projects which are not available under the GNU Public License
380 # but which still want to provide support for the GNU gettext functionality.
381 # Please note that the actual code is *not* freely available.
385 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
386 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
387 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
388 [# Extract the first word of "$2", so it can be a program name with args.
389 set dummy $2; ac_word=[$]2
390 AC_MSG_CHECKING([for $ac_word])
391 AC_CACHE_VAL(ac_cv_path_$1,
394 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
397 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
398 for ac_dir in ifelse([$5], , $PATH, [$5]); do
399 test -z "$ac_dir" && ac_dir=.
400 if test -f $ac_dir/$ac_word; then
402 ac_cv_path_$1="$ac_dir/$ac_word"
408 dnl If no 4th arg is given, leave the cache variable unset,
409 dnl so AC_PATH_PROGS will keep looking.
410 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
415 if test -n "[$]$1"; then
423 # Check whether LC_MESSAGES is available in <locale.h>.
424 # Ulrich Drepper <drepper@cygnus.com>, 1995.
426 # This file can be copied and used freely without restrictions. It can
427 # be used in projects which are not available under the GNU Public License
428 # but which still want to provide support for the GNU gettext functionality.
429 # Please note that the actual code is *not* freely available.
433 AC_DEFUN([AM_LC_MESSAGES],
434 [if test $ac_cv_header_locale_h = yes; then
435 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
436 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
437 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
438 if test $am_cv_val_LC_MESSAGES = yes; then
439 AC_DEFINE(HAVE_LC_MESSAGES, 1,
440 [Define if your <locale.h> file defines LC_MESSAGES.])