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 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
258 dnl These rules are solely for the distribution goal. While doing this
259 dnl we only have to keep exactly one list of the available catalogs
261 for lang in $ALL_LINGUAS; do
262 GMOFILES="$GMOFILES $lang.gmo"
263 POFILES="$POFILES $lang.po"
266 dnl Make all variables we use known to autoconf.
269 AC_SUBST(DATADIRNAME)
279 AC_DEFUN(AM_GLIB_GNU_GETTEXT,
280 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
281 AC_REQUIRE([AC_PROG_CC])dnl
282 AC_REQUIRE([AC_PROG_RANLIB])dnl
283 AC_REQUIRE([AC_HEADER_STDC])dnl
284 AC_REQUIRE([AC_C_CONST])dnl
285 AC_REQUIRE([AC_C_INLINE])dnl
286 AC_REQUIRE([AC_TYPE_OFF_T])dnl
287 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
288 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
289 AC_REQUIRE([AC_FUNC_MMAP])dnl
291 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
292 unistd.h sys/param.h])
293 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
294 strdup __argz_count __argz_stringify __argz_next])
299 if test "x$CATOBJEXT" != "x"; then
300 if test "x$ALL_LINGUAS" = "x"; then
303 AC_MSG_CHECKING(for catalogs to be installed)
305 for lang in ${LINGUAS=$ALL_LINGUAS}; do
306 case "$ALL_LINGUAS" in
307 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
311 AC_MSG_RESULT($LINGUAS)
314 dnl Construct list of names of catalog files to be constructed.
315 if test -n "$LINGUAS"; then
316 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
320 dnl Determine which catalog format we have (if any is needed)
321 dnl For now we know about two different formats:
322 dnl Linux libc-5 and the normal X/Open format
323 test -d po || mkdir po
324 if test "$CATOBJEXT" = ".cat"; then
325 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
327 dnl Transform the SED scripts while copying because some dumb SEDs
328 dnl cannot handle comments.
329 sed -e '/^#/d' $srcdir/po/$msgformat-msg.sed > po/po2msg.sed
332 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
333 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
334 dnl Try to locate is.
337 # jwz: fuck this! it puts hardcoded pathnames into the generated Makefiles!
339 # if test -n "$ac_aux_dir"; then
340 # MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
342 if test -z "$MKINSTALLDIRS"; then
343 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
346 # jwz: you know what, screw it. Let's just use the version that I
347 # already computed in configure.in, instead of this version that came
348 # with the i18n crud, ok?
349 MKINSTALLDIRS="$INSTALL_DIRS"
352 AC_SUBST(MKINSTALLDIRS)
354 dnl Generate list of files to be processed by xgettext which will
355 dnl be included in po/Makefile.
356 test -d po || mkdir po
357 if test "x$srcdir" != "x."; then
358 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
359 posrcprefix="$srcdir/"
361 posrcprefix="../$srcdir/"
367 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
368 < $srcdir/po/POTFILES.in > po/POTFILES
372 # Search path for a program which passes the given test.
373 # Ulrich Drepper <drepper@cygnus.com>, 1996.
375 # This file can be copied and used freely without restrictions. It can
376 # be used in projects which are not available under the GNU Public License
377 # but which still want to provide support for the GNU gettext functionality.
378 # Please note that the actual code is *not* freely available.
382 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
383 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
384 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
385 [# Extract the first word of "$2", so it can be a program name with args.
386 set dummy $2; ac_word=[$]2
387 AC_MSG_CHECKING([for $ac_word])
388 AC_CACHE_VAL(ac_cv_path_$1,
391 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
394 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
395 for ac_dir in ifelse([$5], , $PATH, [$5]); do
396 test -z "$ac_dir" && ac_dir=.
397 if test -f $ac_dir/$ac_word; then
399 ac_cv_path_$1="$ac_dir/$ac_word"
405 dnl If no 4th arg is given, leave the cache variable unset,
406 dnl so AC_PATH_PROGS will keep looking.
407 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
412 if test -n "[$]$1"; then
420 # Check whether LC_MESSAGES is available in <locale.h>.
421 # Ulrich Drepper <drepper@cygnus.com>, 1995.
423 # This file can be copied and used freely without restrictions. It can
424 # be used in projects which are not available under the GNU Public License
425 # but which still want to provide support for the GNU gettext functionality.
426 # Please note that the actual code is *not* freely available.
430 AC_DEFUN([AM_LC_MESSAGES],
431 [if test $ac_cv_header_locale_h = yes; then
432 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
433 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
434 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
435 if test $am_cv_val_LC_MESSAGES = yes; then
436 AC_DEFINE(HAVE_LC_MESSAGES, 1,
437 [Define if your <locale.h> file defines LC_MESSAGES.])