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 # progtest.m4 from gettext 0.32
15 # Search path for a program which passes the given test.
16 # Ulrich Drepper <drepper@cygnus.com>, 1996.
18 # This file file be copied and used freely without restrictions. It can
19 # be used in projects which are not available under the GNU Public License
20 # but which still want to provide support for the GNU gettext functionality.
21 # Please note that the actual code is *not* freely available.
25 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
26 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
27 AC_DEFUN(AM_PATH_PROG_WITH_TEST,
28 [# Extract the first word of "$2", so it can be a program name with args.
29 set dummy $2; ac_word=[$]2
30 AC_MSG_CHECKING([for $ac_word])
31 AC_CACHE_VAL(ac_cv_path_$1,
34 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
37 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
38 for ac_dir in ifelse([$5], , $PATH, [$5]); do
39 test -z "$ac_dir" && ac_dir=.
40 if test -f $ac_dir/$ac_word; then
42 ac_cv_path_$1="$ac_dir/$ac_word"
48 dnl If no 4th arg is given, leave the cache variable unset,
49 dnl so AC_PATH_PROGS will keep looking.
50 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
55 if test -n "[$]$1"; then
64 # lcmessage.m4 from gettext 0.32
65 # Check whether LC_MESSAGES is available in <locale.h>.
66 # Ulrich Drepper <drepper@cygnus.com>, 1995.
68 # This file file be copied and used freely without restrictions. It can
69 # be used in projects which are not available under the GNU Public License
70 # but which still want to provide support for the GNU gettext functionality.
71 # Please note that the actual code is *not* freely available.
75 AC_DEFUN(AM_LC_MESSAGES,
76 [if test $ac_cv_header_locale_h = yes; then
77 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
78 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
79 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
80 if test $am_cv_val_LC_MESSAGES = yes; then
81 AC_DEFINE(HAVE_LC_MESSAGES)
87 # gettext.m4 from gettext 0.32
88 # Macro to add for using GNU gettext.
89 # Ulrich Drepper <drepper@cygnus.com>, 1995.
91 # This file file be copied and used freely without restrictions. It can
92 # be used in projects which are not available under the GNU Public License
93 # but which still want to provide support for the GNU gettext functionality.
94 # Please note that the actual code is *not* freely available.
99 [AC_MSG_CHECKING([whether NLS is requested])
100 dnl Default is enabled NLS
102 [ --disable-nls do not use Native Language Support],
103 USE_NLS=$enableval, USE_NLS=yes)
104 AC_MSG_RESULT($USE_NLS)
107 USE_INCLUDED_LIBINTL=no
109 dnl If we use NLS figure out what method
110 if test "$USE_NLS" = "yes"; then
111 AC_DEFINE(ENABLE_NLS)
112 AC_MSG_CHECKING([whether included gettext is requested])
113 AC_ARG_WITH(included-gettext,
114 [ --with-included-gettext use the GNU gettext library included here],
115 nls_cv_force_use_gnu_gettext=$withval,
116 nls_cv_force_use_gnu_gettext=no)
117 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
119 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
120 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
121 dnl User does not insist on using GNU NLS library. Figure out what
122 dnl to use. If gettext or catgets are available (in this order) we
123 dnl use this. Else we have to fall back to GNU NLS library.
124 dnl catgets is only used if permitted by option --with-catgets.
129 AC_CHECK_HEADER(libintl.h,
130 [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
131 [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
132 gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
134 if test "$gt_cv_func_gettext_libc" != "yes"; then
135 AC_CHECK_LIB(intl, bindtextdomain,
136 [AC_CACHE_CHECK([for gettext in libintl],
137 gt_cv_func_gettext_libintl,
138 [AC_TRY_LINK([], [return (int) gettext ("")],
139 gt_cv_func_gettext_libintl=yes,
140 gt_cv_func_gettext_libintl=no)])])
143 if test "$gt_cv_func_gettext_libc" = "yes" \
144 || test "$gt_cv_func_gettext_libintl" = "yes"; then
145 AC_DEFINE(HAVE_GETTEXT)
146 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
147 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
148 if test "$MSGFMT" != "no"; then
149 AC_CHECK_FUNCS(dcgettext)
150 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
151 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
152 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
153 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
154 return _nl_msg_cat_cntr],
164 if test "$CATOBJEXT" = "NONE"; then
165 AC_MSG_CHECKING([whether catgets can be used])
167 [ --with-catgets use catgets functions if available],
168 nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
169 AC_MSG_RESULT($nls_cv_use_catgets)
171 if test "$nls_cv_use_catgets" = "yes"; then
172 dnl No gettext in C library. Try catgets next.
173 AC_CHECK_LIB(i, main)
174 AC_CHECK_FUNC(catgets,
175 [AC_DEFINE(HAVE_CATGETS)
176 INTLOBJS="\$(CATOBJS)"
177 AC_PATH_PROG(GENCAT, gencat, no)dnl
178 if test "$GENCAT" != "no"; then
179 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
180 if test "$GMSGFMT" = "no"; then
181 AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
182 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
184 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
185 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
186 USE_INCLUDED_LIBINTL=yes
190 INTLDEPS='$(top_builddir)/intl/libintl.a'
192 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
193 nls_cv_header_intl=intl/libintl.h
194 nls_cv_header_libgt=intl/libgettext.h
199 if test "$CATOBJEXT" = "NONE"; then
200 dnl Neither gettext nor catgets in included in the C library.
201 dnl Fall back on GNU gettext library.
202 nls_cv_use_gnu_gettext=yes
206 if test "$nls_cv_use_gnu_gettext" = "yes"; then
207 dnl Mark actions used to generate GNU NLS library.
208 INTLOBJS="\$(GETTOBJS)"
209 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
210 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
211 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
212 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
213 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
215 USE_INCLUDED_LIBINTL=yes
219 INTLDEPS='$(top_builddir)/intl/libintl.a'
221 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
222 nls_cv_header_intl=intl/libintl.h
223 nls_cv_header_libgt=intl/libgettext.h
226 dnl Test whether we really found GNU xgettext.
227 if test "$XGETTEXT" != ":"; then
228 dnl If it is no GNU xgettext we define it as : so that the
229 dnl Makefiles still can work.
230 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
234 [found xgettext programs is not GNU xgettext; ignore it])
239 # We need to process the po/ directory.
243 nls_cv_header_intl=intl/libintl.h
244 nls_cv_header_libgt=intl/libgettext.h
247 # If this is used in GNU gettext we have to set USE_NLS to `yes'
248 # because some of the sources are only built for this goal.
249 if test "$PACKAGE" = gettext; then
251 USE_INCLUDED_LIBINTL=yes
254 dnl These rules are solely for the distribution goal. While doing this
255 dnl we only have to keep exactly one list of the available catalogs
257 for lang in $ALL_LINGUAS; do
258 GMOFILES="$GMOFILES $lang.gmo"
259 POFILES="$POFILES $lang.po"
262 dnl Make all variables we use known to autoconf.
263 AC_SUBST(USE_INCLUDED_LIBINTL)
266 AC_SUBST(DATADIRNAME)
276 AC_DEFUN(AM_GNU_GETTEXT,
277 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
278 AC_REQUIRE([AC_PROG_CC])dnl
279 AC_REQUIRE([AC_PROG_RANLIB])dnl
280 AC_REQUIRE([AC_ISC_POSIX])dnl
281 AC_REQUIRE([AC_HEADER_STDC])dnl
282 AC_REQUIRE([AC_C_CONST])dnl
283 AC_REQUIRE([AC_C_INLINE])dnl
284 AC_REQUIRE([AC_TYPE_OFF_T])dnl
285 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
286 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
287 AC_REQUIRE([AC_FUNC_MMAP])dnl
289 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
290 unistd.h values.h sys/param.h])
291 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
292 __argz_count __argz_stringify __argz_next])
294 if test "${ac_cv_func_stpcpy+set}" != "set"; then
295 AC_CHECK_FUNCS(stpcpy)
297 if test "${ac_cv_func_stpcpy}" = "yes"; then
298 AC_DEFINE(HAVE_STPCPY)
304 if test "x$CATOBJEXT" != "x"; then
305 if test "x$ALL_LINGUAS" = "x"; then
308 AC_MSG_CHECKING(for catalogs to be installed)
310 for lang in ${LINGUAS=$ALL_LINGUAS}; do
311 case "$ALL_LINGUAS" in
312 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
316 AC_MSG_RESULT($LINGUAS)
319 dnl Construct list of names of catalog files to be constructed.
320 if test -n "$LINGUAS"; then
321 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
325 dnl The reference to <locale.h> in the installed <libintl.h> file
326 dnl must be resolved because we cannot expect the users of this
327 dnl to define HAVE_LOCALE_H.
328 if test $ac_cv_header_locale_h = yes; then
329 INCLUDE_LOCALE_H="#include <locale.h>"
332 /* The system does not provide the header <locale.h>. Take care yourself. */"
334 AC_SUBST(INCLUDE_LOCALE_H)
336 dnl Determine which catalog format we have (if any is needed)
337 dnl For now we know about two different formats:
338 dnl Linux libc-5 and the normal X/Open format
339 test -d intl || mkdir intl
340 if test "$CATOBJEXT" = ".cat"; then
341 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
343 dnl Transform the SED scripts while copying because some dumb SEDs
344 dnl cannot handle comments.
345 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
347 dnl po2tbl.sed is always needed.
348 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
349 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
351 dnl In the intl/Makefile.in we have a special dependency which makes
352 dnl only sense for gettext. We comment this out for non-gettext
354 if test "$PACKAGE" = "gettext"; then
364 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
365 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
366 dnl Try to locate is.
368 if test -n "$ac_aux_dir"; then
369 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
371 if test -z "$MKINSTALLDIRS"; then
372 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
374 AC_SUBST(MKINSTALLDIRS)
376 dnl *** For now the libtool support in intl/Makefile is not for real.
380 dnl Generate list of files to be processed by xgettext which will
381 dnl be included in po/Makefile.
382 test -d po || mkdir po
383 if test "x$srcdir" != "x."; then
384 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
385 posrcprefix="$srcdir/"
387 posrcprefix="../$srcdir/"
393 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
394 < $srcdir/po/POTFILES.in > po/POTFILES
398 # This test replaces the one in autoconf.
399 # Currently this macro should have the same name as the autoconf macro
400 # because gettext's gettext.m4 (distributed in the automake package)
401 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
402 # give these diagnostics:
403 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
404 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
406 undefine([AC_ISC_POSIX])
408 AC_DEFUN([AC_ISC_POSIX],
410 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
411 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
415 # Do all the work for Automake. This macro actually does too much --
416 # some checks are only needed if your package does certain things.
417 # But this isn't really a big deal.
422 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
424 AC_DEFUN([AM_INIT_AUTOMAKE],
425 [AC_REQUIRE([AC_PROG_INSTALL])
430 dnl test to see if srcdir already configured
431 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
432 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
435 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
436 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
437 AC_REQUIRE([AM_SANITY_CHECK])
438 AC_REQUIRE([AC_ARG_PROGRAM])
439 dnl FIXME This is truly gross.
440 missing_dir=`cd $ac_aux_dir && pwd`
441 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
442 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
443 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
444 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
445 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
446 AC_REQUIRE([AC_PROG_MAKE_SET])])
449 # Check to make sure that the build environment is sane.
452 AC_DEFUN([AM_SANITY_CHECK],
453 [AC_MSG_CHECKING([whether build environment is sane])
456 echo timestamp > conftestfile
457 # Do `set' in a subshell so we don't clobber the current shell's
458 # arguments. Must try -L first in case configure is actually a
459 # symlink; some systems play weird games with the mod time of symlinks
460 # (eg FreeBSD returns the mod time of the symlink's containing
463 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
464 if test "[$]*" = "X"; then
466 set X `ls -t $srcdir/configure conftestfile`
468 if test "[$]*" != "X $srcdir/configure conftestfile" \
469 && test "[$]*" != "X conftestfile $srcdir/configure"; then
471 # If neither matched, then we have a broken ls. This can happen
472 # if, for instance, CONFIG_SHELL is bash and it inherits a
473 # broken ls alias from the environment. This has actually
474 # happened. Such a system could not be considered "sane".
475 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
476 alias in your environment])
479 test "[$]2" = conftestfile
485 AC_MSG_ERROR([newly created file is older than distributed files!
486 Check your system clock])
491 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
492 dnl The program must properly implement --version.
493 AC_DEFUN([AM_MISSING_PROG],
494 [AC_MSG_CHECKING(for working $2)
495 # Run test in a subshell; some versions of sh will print an error if
496 # an executable is not found, even if stderr is redirected.
497 # Redirect stdin to placate older versions of autoconf. Sigh.
498 if ($2 --version) < /dev/null > /dev/null 2>&1; then
503 AC_MSG_RESULT(missing)
507 # Add --enable-maintainer-mode option to configure.
512 AC_DEFUN([AM_MAINTAINER_MODE],
513 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
514 dnl maintainer-mode is disabled by default
515 AC_ARG_ENABLE(maintainer-mode,
516 [ --enable-maintainer-mode enable make rules and dependencies not useful
517 (and sometimes confusing) to the casual installer],
518 USE_MAINTAINER_MODE=$enableval,
519 USE_MAINTAINER_MODE=no)
520 AC_MSG_RESULT($USE_MAINTAINER_MODE)
521 AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
522 MAINT=$MAINTAINER_MODE_TRUE
527 # Define a conditional.
529 AC_DEFUN([AM_CONDITIONAL],
540 # Like AC_CONFIG_HEADER, but automatically create stamp file.
542 AC_DEFUN([AM_CONFIG_HEADER],
544 AC_CONFIG_HEADER([$1])
545 dnl When config.status generates a header, we must update the stamp-h file.
546 dnl This file resides in the same directory as the config header
547 dnl that is generated. We must strip everything past the first ":",
548 dnl and everything past the last "/".
549 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
550 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
551 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
553 for am_file in <<$1>>; do
554 case " <<$>>CONFIG_HEADERS " in
555 *" <<$>>am_file "*<<)>>
556 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
559 am_indx=`expr "<<$>>am_indx" + 1`
564 dnl AC_PROG_INTLTOOL([MINIMUM-VERSION])
565 # serial 1 AC_PROG_INTLTOOL
566 AC_DEFUN(AC_PROG_INTLTOOL,
569 if test -n "$1"; then
570 AC_MSG_CHECKING(for intltool >= $1)
572 INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ printf "%d", $[1] * 100 + $[2]; }'`
573 INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { printf $[2]; }' < ${srcdir}/intltool-update.in`
575 INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split(${{2}}, VERSION, "."); printf "%d\n", VERSION[1] * 100 + VERSION[2];}' < ${srcdir}/intltool-update.in`
578 if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT"; then
579 AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
581 AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found. Your intltool is too old. You need intltool $1 or later.])
586 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'
587 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'
588 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'
589 INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -o -p'
590 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'
591 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'
592 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'
593 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'
594 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'
595 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'
596 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'
597 INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< [$]@ -s -u -c $(top_builddir)/po/.intltool-merge-cache'
599 AC_SUBST(INTLTOOL_DESKTOP_RULE)
600 AC_SUBST(INTLTOOL_DIRECTORY_RULE)
601 AC_SUBST(INTLTOOL_KEYS_RULE)
602 AC_SUBST(INTLTOOL_OAF_RULE)
603 AC_SUBST(INTLTOOL_PONG_RULE)
604 AC_SUBST(INTLTOOL_SERVER_RULE)
605 AC_SUBST(INTLTOOL_SHEET_RULE)
606 AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
607 AC_SUBST(INTLTOOL_UI_RULE)
608 AC_SUBST(INTLTOOL_XML_RULE)
609 AC_SUBST(INTLTOOL_CAVES_RULE)
610 AC_SUBST(INTLTOOL_SCHEMAS_RULE)
612 # Use the tools built into the package, not the ones that are installed.
614 INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract'
615 INTLTOOL_MERGE='$(top_builddir)/intltool-merge'
616 INTLTOOL_UPDATE='$(top_builddir)/intltool-update'
618 AC_SUBST(INTLTOOL_EXTRACT)
619 AC_SUBST(INTLTOOL_MERGE)
620 AC_SUBST(INTLTOOL_UPDATE)
622 AC_PATH_PROG(INTLTOOL_PERL, perl)
623 if test -z "$INTLTOOL_PERL"; then
624 AC_MSG_ERROR([perl not found; required for intltool])
626 if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
627 AC_MSG_ERROR([perl 5.x required for intltool])
630 # Remove file type tags (using []) from po/POTFILES.
632 ifdef([AC_DIVERSION_ICMDS],[
633 AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)
635 mv -f po/POTFILES po/POTFILES.tmp
636 sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
637 rm -f po/POTFILES.tmp
641 ifdef([AC_CONFIG_COMMANDS_PRE],[
642 AC_CONFIG_COMMANDS_PRE([
644 mv -f po/POTFILES po/POTFILES.tmp
645 sed -e 's/\[.*\] *//' < po/POTFILES.tmp > po/POTFILES
646 rm -f po/POTFILES.tmp
652 # Manually sed perl in so people don't have to put the intltool scripts in AC_OUTPUT.
656 sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/intltool-extract.in > intltool-extract.out
657 if cmp -s intltool-extract intltool-extract.out 2>/dev/null; then
658 rm -f intltool-extract.out
660 mv -f intltool-extract.out intltool-extract
662 chmod ugo+x intltool-extract
663 chmod u+w intltool-extract
665 sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/intltool-merge.in > intltool-merge.out
666 if cmp -s intltool-merge intltool-merge.out 2>/dev/null; then
667 rm -f intltool-merge.out
669 mv -f intltool-merge.out intltool-merge
671 chmod ugo+x intltool-merge
672 chmod u+w intltool-merge
674 sed -e "s:@INTLTOOL_PERL@:${INTLTOOL_PERL}:;" < ${srcdir}/intltool-update.in > intltool-update.out
675 if cmp -s intltool-update intltool-update.out 2>/dev/null; then
676 rm -f intltool-update.out
678 mv -f intltool-update.out intltool-update
680 chmod ugo+x intltool-update
681 chmod u+w intltool-update
683 ], INTLTOOL_PERL=${INTLTOOL_PERL})
688 dnl GNOME_PLATFORM_GNOME_2(default, [force])
690 dnl If the first parameter is `yes', then the default is
691 dnl the GNOME 2.x platform, otherwise the GNOME 1.x one.
693 dnl If the optional second parameter is `force', then use
694 dnl the default value without command line argument.
697 AC_DEFUN([GNOME_PLATFORM_GNOME_2],[
698 AC_REQUIRE([GNOME_REQUIRE_PKGCONFIG])
700 if test x$1 = xyes ; then
701 platform_gnome_2_default=yes
703 platform_gnome_2_default=no
705 if test x$2 = xforce ; then
706 platform_gnome_2="$platform_gnome_2_default";
708 AC_ARG_ENABLE(platform-gnome-2, [ --enable-platform-gnome-2 enable GNOME 2.x platform [default=no]],[platform_gnome_2="$enableval"],[platform_gnome_2="$platform_gnome_2_default"])
711 AM_CONDITIONAL(PLATFORM_GNOME_2, test $platform_gnome_2 = yes)
713 AC_MSG_CHECKING(for GNOME Platform)
714 if test $platform_gnome_2 = yes; then
715 AC_MSG_RESULT(GNOME 2.x)
716 GNOME_INTERFACE_VERSION=2
717 GNOME_REQUIRE_PKGCONFIG
719 AC_MSG_RESULT(GNOME 1.x)
720 GNOME_INTERFACE_VERSION=1
722 AC_SUBST(GNOME_INTERFACE_VERSION)
726 dnl GNOME_CHECK_PKGCONFIG (script-if-enabled, [failflag])
728 AC_DEFUN([GNOME_CHECK_PKGCONFIG],[
729 AC_PATH_PROG(PKG_CONFIG, pkg-config)
731 if test -x "$PKG_CONFIG" ; then
736 AC_MSG_CHECKING(for pkg-config)
737 pkgconfig_required_version=0.8.0
738 if test x$have_pkgconfig = xyes ; then
739 if ! $PKG_CONFIG --atleast-pkgconfig-version $pkgconfig_required_version; then
740 echo "*** Your version of pkg-config is too old. You need version $pkgconfig_required_version or newer."
741 echo "*** See http://www.freedesktop.org/software/pkgconfig"
745 if test x$have_pkgconfig = xyes ; then
749 AC_MSG_RESULT(not found)
750 if test x$2 = xfail; then
752 *** You need the latest pkg-config (at least $pkgconfig_required_version).
753 *** Get the latest version of pkg-config from
754 *** http://www.freedesktop.org/software/pkgconfig.])
759 AC_PROVIDE([GNOME_REQUIRE_PKGCONFIG])
763 dnl GNOME_REQUIRE_PKGCONFIG
765 AC_DEFUN([GNOME_REQUIRE_PKGCONFIG],[
766 GNOME_CHECK_PKGCONFIG([], fail)
772 dnl GNOME_COMMON_INIT
774 AC_DEFUN([GNOME_COMMON_INIT],
776 AC_CACHE_VAL(ac_cv_gnome_aclocal_dir,
777 [ac_cv_gnome_aclocal_dir="$GNOME_COMMON_MACROS_DIR"])
778 AC_CACHE_VAL(ac_cv_gnome_aclocal_flags,
779 [ac_cv_gnome_aclocal_flags="$ACLOCAL_FLAGS"])
780 GNOME_ACLOCAL_DIR="$ac_cv_gnome_aclocal_dir"
781 GNOME_ACLOCAL_FLAGS="$ac_cv_gnome_aclocal_flags"
782 AC_SUBST(GNOME_ACLOCAL_DIR)
783 AC_SUBST(GNOME_ACLOCAL_FLAGS)
785 ACLOCAL="$ACLOCAL $GNOME_ACLOCAL_FLAGS"
787 AM_CONDITIONAL(INSIDE_GNOME_DOCU, false)
790 AC_DEFUN([GNOME_GTKDOC_CHECK],
792 AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
793 AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC)
794 AC_SUBST(HAVE_GTK_DOC)
796 dnl Let people disable the gtk-doc stuff.
797 AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
799 if test x$enable_gtk_doc = xauto ; then
800 if test x$GTKDOC = xtrue ; then
807 dnl NOTE: We need to use a separate automake conditional for this
808 dnl to make this work with the tarballs.
809 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
812 AC_DEFUN([GNOME_DEBUG_CHECK],
814 AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]], enable_debug="$enableval", enable_debug=no)
816 if test x$enable_debug = xyes ; then
817 AC_DEFINE(GNOME_ENABLE_DEBUG)
824 # @defmac AC_PROG_CC_STDC
825 # @maindex PROG_CC_STDC
827 # If the C compiler in not in ANSI C mode by default, try to add an option
828 # to output variable @code{CC} to make it so. This macro tries various
829 # options that select ANSI C on some system or another. It considers the
830 # compiler to be in ANSI C mode if it handles function prototypes correctly.
832 # If you use this macro, you should check after calling it whether the C
833 # compiler has been set to accept ANSI C; if not, the shell variable
834 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
835 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
836 # program @code{ansi2knr}, which comes with Ghostscript.
839 AC_DEFUN([AM_PROG_CC_STDC],
840 [AC_REQUIRE([AC_PROG_CC])
841 AC_BEFORE([$0], [AC_C_INLINE])
842 AC_BEFORE([$0], [AC_C_CONST])
843 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
844 dnl a magic option to avoid problems with ANSI preprocessor commands
846 dnl FIXME: can't do this because then AC_AIX won't work due to a
847 dnl circular dependency.
848 dnl AC_BEFORE([$0], [AC_PROG_CPP])
849 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
850 AC_CACHE_VAL(am_cv_prog_cc_stdc,
851 [am_cv_prog_cc_stdc=no
853 # Don't try gcc -ansi; that turns off useful extensions and
854 # breaks some systems' header files.
856 # Ultrix and OSF/1 -std1
857 # HP-UX -Aa -D_HPUX_SOURCE
858 # SVR4 -Xc -D__EXTENSIONS__
859 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
861 CC="$ac_save_CC $ac_arg"
865 #include <sys/types.h>
866 #include <sys/stat.h>
867 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
868 struct buf { int x; };
869 FILE * (*rcsopen) (struct buf *, struct stat *, int);
870 static char *e (p, i)
876 static char *f (char * (*g) (char **, int), char **p, ...)
881 s = g (p, va_arg (v,int));
885 int test (int i, double x);
886 struct s1 {int (*f) (int a);};
887 struct s2 {int (*f) (double a);};
888 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
892 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
894 [am_cv_prog_cc_stdc="$ac_arg"; break])
898 if test -z "$am_cv_prog_cc_stdc"; then
899 AC_MSG_RESULT([none needed])
901 AC_MSG_RESULT($am_cv_prog_cc_stdc)
903 case "x$am_cv_prog_cc_stdc" in
905 *) CC="$CC $am_cv_prog_cc_stdc" ;;
909 dnl GNOME_COMPILE_WARNINGS
910 dnl Turn on many useful compiler warnings
911 dnl For now, only works on GCC
912 AC_DEFUN([GNOME_COMPILE_WARNINGS],[
913 dnl ******************************
914 dnl More compiler warnings
915 dnl ******************************
917 if test -z "$1" ; then
918 default_compile_warnings=no
920 default_compile_warnings="$1"
923 AC_ARG_ENABLE(compile-warnings,
924 [ --enable-compile-warnings=[no/minimum/yes/maximum/error] Turn on compiler warnings.], [enable_compile_warnings="$enableval"],[enable_compile_warnings="$default_compile_warnings"])
927 if test "x$GCC" != xyes; then
928 enable_compile_warnings=no
932 realsave_CFLAGS="$CFLAGS"
934 case "$enable_compile_warnings" in
939 warning_flags="-Wall -Wunused"
942 warning_flags="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations"
945 warning_flags="-Wall -Wunused -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
946 CFLAGS="$warning_flags $CFLAGS"
947 for option in -Wsign-promo -Wno-sign-compare; do
948 SAVE_CFLAGS="$CFLAGS"
949 CFLAGS="$CFLAGS $option"
950 AC_MSG_CHECKING([whether gcc understands $option])
951 AC_TRY_COMPILE([], [],
954 CFLAGS="$SAVE_CFLAGS"
955 AC_MSG_RESULT($has_option)
956 if test $has_option = yes; then
957 warning_flags="$warning_flags $option"
963 if test "$enable_compile_warnings" = "error" ; then
964 warning_flags="$warning_flags -Werror"
968 AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
971 CFLAGS="$realsave_CFLAGS"
972 AC_MSG_CHECKING(what warning flags to pass to the C compiler)
973 AC_MSG_RESULT($warning_flags)
976 [ --enable-iso-c Try to warn if code is not ISO C ],,
979 AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
981 if test "x$enable_iso_c" != "xno"; then
982 if test "x$GCC" = "xyes"; then
984 *[\ \ ]-ansi[\ \ ]*) ;;
985 *) complCFLAGS="$complCFLAGS -ansi" ;;
988 *[\ \ ]-pedantic[\ \ ]*) ;;
989 *) complCFLAGS="$complCFLAGS -pedantic" ;;
993 AC_MSG_RESULT($complCFLAGS)
995 WARN_CFLAGS="$warning_flags $complCFLAGS"
996 AC_SUBST(WARN_CFLAGS)
999 dnl For C++, do basically the same thing.
1001 AC_DEFUN([GNOME_CXX_WARNINGS],[
1002 AC_ARG_ENABLE(cxx-warnings,
1003 [ --enable-cxx-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_cxx_warnings=minimum)
1005 AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
1007 if test "x$GCC" != xyes; then
1008 enable_compile_warnings=no
1010 if test "x$enable_cxx_warnings" != "xno"; then
1011 if test "x$GCC" = "xyes"; then
1012 case " $CXXFLAGS " in
1013 *[\ \ ]-Wall[\ \ ]*) ;;
1014 *) warnCXXFLAGS="-Wall -Wno-unused" ;;
1017 ## -W is not all that useful. And it cannot be controlled
1018 ## with individual -Wno-xxx flags, unlike -Wall
1019 if test "x$enable_cxx_warnings" = "xyes"; then
1020 warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wmissing-declarations -Wshadow -Woverloaded-virtual"
1024 AC_MSG_RESULT($warnCXXFLAGS)
1026 AC_ARG_ENABLE(iso-cxx,
1027 [ --enable-iso-cxx Try to warn if code is not ISO C++ ],,
1030 AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
1032 if test "x$enable_iso_cxx" != "xno"; then
1033 if test "x$GCC" = "xyes"; then
1034 case " $CXXFLAGS " in
1035 *[\ \ ]-ansi[\ \ ]*) ;;
1036 *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
1039 case " $CXXFLAGS " in
1040 *[\ \ ]-pedantic[\ \ ]*) ;;
1041 *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
1045 AC_MSG_RESULT($complCXXFLAGS)
1046 if test "x$cxxflags_set" != "xyes"; then
1047 CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
1049 AC_SUBST(cxxflags_set)
1054 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
1055 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
1056 dnl also defines GSTUFF_PKG_ERRORS on error
1057 AC_DEFUN(PKG_CHECK_MODULES, [
1060 if test -z "$PKG_CONFIG"; then
1061 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1064 if test "$PKG_CONFIG" = "no" ; then
1065 echo "*** The pkg-config script could not be found. Make sure it is"
1066 echo "*** in your path, or set the PKG_CONFIG environment variable"
1067 echo "*** to the full path to pkg-config."
1068 echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
1070 PKG_CONFIG_MIN_VERSION=0.9.0
1071 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
1072 AC_MSG_CHECKING(for $2)
1074 if $PKG_CONFIG --exists "$2" ; then
1078 AC_MSG_CHECKING($1_CFLAGS)
1079 $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
1080 AC_MSG_RESULT($$1_CFLAGS)
1082 AC_MSG_CHECKING($1_LIBS)
1083 $1_LIBS=`$PKG_CONFIG --libs "$2"`
1084 AC_MSG_RESULT($$1_LIBS)
1088 ## If we have a custom action on failure, don't print errors, but
1089 ## do set a variable so people can do so.
1090 $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1091 ifelse([$4], ,echo $$1_PKG_ERRORS,)
1097 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
1098 echo "*** See http://www.freedesktop.org/software/pkgconfig"
1102 if test $succeeded = yes; then
1103 ifelse([$3], , :, [$3])
1105 ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
1111 # Macro to add for using GNU gettext.
1112 # Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
1114 # Modified to never use included libintl.
1115 # Owen Taylor <otaylor@redhat.com>, 12/15/1998
1118 # This file can be copied and used freely without restrictions. It can
1119 # be used in projects which are not available under the GNU Public License
1120 # but which still want to provide support for the GNU gettext functionality.
1121 # Please note that the actual code is *not* freely available.
1124 # If you make changes to this file, you MUST update the copy in
1125 # acinclude.m4. [ aclocal dies on duplicate macros, so if
1126 # we run 'aclocal -I macros/' then we'll run into problems
1127 # once we've installed glib-gettext.m4 :-( ]
1130 AC_DEFUN([AM_GLIB_LC_MESSAGES],
1131 [if test $ac_cv_header_locale_h = yes; then
1132 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1133 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1134 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1135 if test $am_cv_val_LC_MESSAGES = yes; then
1136 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1137 [Define if your <locale.h> file defines LC_MESSAGES.])
1141 dnl AM_GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1142 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1143 AC_DEFUN([AM_GLIB_PATH_PROG_WITH_TEST],
1144 [# Extract the first word of "$2", so it can be a program name with args.
1145 set dummy $2; ac_word=[$]2
1146 AC_MSG_CHECKING([for $ac_word])
1147 AC_CACHE_VAL(ac_cv_path_$1,
1150 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1153 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1154 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1155 test -z "$ac_dir" && ac_dir=.
1156 if test -f $ac_dir/$ac_word; then
1158 ac_cv_path_$1="$ac_dir/$ac_word"
1164 dnl If no 4th arg is given, leave the cache variable unset,
1165 dnl so AC_PATH_PROGS will keep looking.
1166 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1171 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1172 AC_MSG_RESULT([$]$1)
1181 AC_DEFUN(AM_GLIB_WITH_NLS,
1182 dnl NLS is obligatory
1186 dnl Figure out what method
1187 nls_cv_force_use_gnu_gettext="no"
1189 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1190 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1191 dnl User does not insist on using GNU NLS library. Figure out what
1192 dnl to use. If gettext or catgets are available (in this order) we
1193 dnl use this. Else we have to fall back to GNU NLS library.
1194 dnl catgets is only used if permitted by option --with-catgets.
1196 nls_cv_header_libgt=
1200 AC_CHECK_HEADER(libintl.h,
1201 [AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1202 [AC_TRY_LINK([#include <libintl.h>], [return (int) dgettext ("","")],
1203 gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no)])
1205 gt_cv_func_dgettext_libintl="no"
1206 libintl_extra_libs=""
1208 if test "$gt_cv_func_dgettext_libc" != "yes" ; then
1209 AC_CHECK_LIB(intl, bindtextdomain,
1210 [AC_CHECK_LIB(intl, dgettext,
1211 gt_cv_func_dgettext_libintl=yes)])
1213 if test "$gt_cv_func_dgettext_libc" != "yes" ; then
1214 AC_MSG_CHECKING([if -liconv is needed to use gettext])
1216 AC_CHECK_LIB(intl, dcgettext,
1217 [gt_cv_func_dgettext_libintl=yes
1218 libintl_extra_libs=-liconv],
1223 if test "$gt_cv_func_dgettext_libintl" = "yes"; then
1224 LIBS="$LIBS -lintl $libintl_extra_libs";
1227 if test "$gt_cv_func_dgettext_libc" = "yes" \
1228 || test "$gt_cv_func_dgettext_libintl" = "yes"; then
1229 AC_DEFINE(HAVE_GETTEXT,1,
1230 [Define if the GNU gettext() function is already present or preinstalled.])
1231 AM_GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1232 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1233 if test "$MSGFMT" != "no"; then
1234 AC_CHECK_FUNCS(dcgettext)
1235 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1236 AM_GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1237 [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1238 AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1239 return _nl_msg_cat_cntr],
1248 # Added by Martin Baulig 12/15/98 for libc5 systems
1249 if test "$gt_cv_func_dgettext_libc" != "yes" \
1250 && test "$gt_cv_func_dgettext_libintl" = "yes"; then
1251 INTLLIBS="-lintl $libintl_extra_libs"
1252 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
1256 if test "$CATOBJEXT" = "NONE"; then
1257 dnl Neither gettext nor catgets in included in the C library.
1258 dnl Fall back on GNU gettext library.
1259 nls_cv_use_gnu_gettext=yes
1263 if test "$nls_cv_use_gnu_gettext" != "yes"; then
1264 AC_DEFINE(ENABLE_NLS, 1,
1265 [always defined to indicate that i18n is enabled])
1267 dnl Unset this variable since we use the non-zero value as a flag.
1271 dnl Test whether we really found GNU xgettext.
1272 if test "$XGETTEXT" != ":"; then
1273 dnl If it is no GNU xgettext we define it as : so that the
1274 dnl Makefiles still can work.
1275 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1279 [found xgettext program is not GNU xgettext; ignore it])
1284 # We need to process the po/ directory.
1288 [case "$CONFIG_FILES" in *po/Makefile.in*)
1289 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1292 dnl These rules are solely for the distribution goal. While doing this
1293 dnl we only have to keep exactly one list of the available catalogs
1294 dnl in configure.in.
1295 for lang in $ALL_LINGUAS; do
1296 GMOFILES="$GMOFILES $lang.gmo"
1297 POFILES="$POFILES $lang.po"
1300 dnl Make all variables we use known to autoconf.
1303 AC_SUBST(DATADIRNAME)
1305 AC_SUBST(INSTOBJEXT)
1313 AC_DEFUN(AM_GLIB_GNU_GETTEXT,
1314 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1315 AC_REQUIRE([AC_PROG_CC])dnl
1316 AC_REQUIRE([AC_PROG_RANLIB])dnl
1317 AC_REQUIRE([AC_HEADER_STDC])dnl
1318 AC_REQUIRE([AC_C_CONST])dnl
1319 AC_REQUIRE([AC_C_INLINE])dnl
1320 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1321 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1322 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1323 AC_REQUIRE([AC_FUNC_MMAP])dnl
1325 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
1326 unistd.h sys/param.h])
1327 AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
1328 strdup __argz_count __argz_stringify __argz_next])
1333 if test "x$CATOBJEXT" != "x"; then
1334 if test "x$ALL_LINGUAS" = "x"; then
1337 AC_MSG_CHECKING(for catalogs to be installed)
1339 for lang in ${LINGUAS=$ALL_LINGUAS}; do
1340 case "$ALL_LINGUAS" in
1341 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
1344 LINGUAS=$NEW_LINGUAS
1345 AC_MSG_RESULT($LINGUAS)
1348 dnl Construct list of names of catalog files to be constructed.
1349 if test -n "$LINGUAS"; then
1350 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1354 dnl Determine which catalog format we have (if any is needed)
1355 dnl For now we know about two different formats:
1356 dnl Linux libc-5 and the normal X/Open format
1357 test -d po || mkdir po
1358 if test "$CATOBJEXT" = ".cat"; then
1359 AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
1361 dnl Transform the SED scripts while copying because some dumb SEDs
1362 dnl cannot handle comments.
1363 sed -e '/^#/d' $srcdir/po/$msgformat-msg.sed > po/po2msg.sed
1366 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1367 dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1368 dnl Try to locate is.
1370 if test -n "$ac_aux_dir"; then
1371 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1373 if test -z "$MKINSTALLDIRS"; then
1374 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1376 AC_SUBST(MKINSTALLDIRS)
1378 dnl Generate list of files to be processed by xgettext which will
1379 dnl be included in po/Makefile.
1380 test -d po || mkdir po
1381 if test "x$srcdir" != "x."; then
1382 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1383 posrcprefix="$srcdir/"
1385 posrcprefix="../$srcdir/"
1391 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1392 < $srcdir/po/POTFILES.in > po/POTFILES