~matttbe/ubuntu/precise/alacarte/975299

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-01-19 17:10:20 UTC
  • mto: (2.1.4 squeeze)
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: james.westby@ubuntu.com-20090119171020-btqjh13j7gtey1z5
Tags: upstream-0.11.7
Import upstream version 0.11.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
m4_ifndef([AC_AUTOCONF_VERSION],
15
15
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16
 
m4_if(AC_AUTOCONF_VERSION, [2.62],,
17
 
[m4_warning([this file was generated for autoconf 2.62.
 
16
m4_if(AC_AUTOCONF_VERSION, [2.63],,
 
17
[m4_warning([this file was generated for autoconf 2.63.
18
18
You have another version of autoconf.  It may work, but is not guaranteed to.
19
19
If you have problems, you may need to regenerate the build system entirely.
20
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
21
 
 
22
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
 
23
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
 
24
#
 
25
# This file is free software, distributed under the terms of the GNU
 
26
# General Public License.  As a special exception to the GNU General
 
27
# Public License, this file may be distributed as part of a program
 
28
# that contains a configuration script generated by Autoconf, under
 
29
# the same distribution terms as the rest of that program.
 
30
#
 
31
# This file can be copied and used freely without restrictions.  It can
 
32
# be used in projects which are not available under the GNU Public License
 
33
# but which still want to provide support for the GNU gettext functionality.
 
34
#
 
35
# Macro to add for using GNU gettext.
 
36
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
 
37
#
 
38
# Modified to never use included libintl. 
 
39
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
 
40
#
 
41
# Major rework to remove unused code
 
42
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
 
43
#
 
44
# Added better handling of ALL_LINGUAS from GNU gettext version 
 
45
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
 
46
#
 
47
# Modified to require ngettext
 
48
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
 
49
#
 
50
# We need this here as well, since someone might use autoconf-2.5x
 
51
# to configure GLib then an older version to configure a package
 
52
# using AM_GLIB_GNU_GETTEXT
 
53
AC_PREREQ(2.53)
 
54
 
 
55
dnl
 
56
dnl We go to great lengths to make sure that aclocal won't 
 
57
dnl try to pull in the installed version of these macros
 
58
dnl when running aclocal in the glib directory.
 
59
dnl
 
60
m4_copy([AC_DEFUN],[glib_DEFUN])
 
61
m4_copy([AC_REQUIRE],[glib_REQUIRE])
 
62
dnl
 
63
dnl At the end, if we're not within glib, we'll define the public
 
64
dnl definitions in terms of our private definitions.
 
65
dnl
 
66
 
 
67
# GLIB_LC_MESSAGES
 
68
#--------------------
 
69
glib_DEFUN([GLIB_LC_MESSAGES],
 
70
  [AC_CHECK_HEADERS([locale.h])
 
71
    if test $ac_cv_header_locale_h = yes; then
 
72
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
 
73
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
 
74
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
 
75
    if test $am_cv_val_LC_MESSAGES = yes; then
 
76
      AC_DEFINE(HAVE_LC_MESSAGES, 1,
 
77
        [Define if your <locale.h> file defines LC_MESSAGES.])
 
78
    fi
 
79
  fi])
 
80
 
 
81
# GLIB_PATH_PROG_WITH_TEST
 
82
#----------------------------
 
83
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 
84
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
85
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
 
86
[# Extract the first word of "$2", so it can be a program name with args.
 
87
set dummy $2; ac_word=[$]2
 
88
AC_MSG_CHECKING([for $ac_word])
 
89
AC_CACHE_VAL(ac_cv_path_$1,
 
90
[case "[$]$1" in
 
91
  /*)
 
92
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
93
  ;;
 
94
  *)
 
95
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 
96
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
97
    test -z "$ac_dir" && ac_dir=.
 
98
    if test -f $ac_dir/$ac_word; then
 
99
      if [$3]; then
 
100
        ac_cv_path_$1="$ac_dir/$ac_word"
 
101
        break
 
102
      fi
 
103
    fi
 
104
  done
 
105
  IFS="$ac_save_ifs"
 
106
dnl If no 4th arg is given, leave the cache variable unset,
 
107
dnl so AC_PATH_PROGS will keep looking.
 
108
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
109
])dnl
 
110
  ;;
 
111
esac])dnl
 
112
$1="$ac_cv_path_$1"
 
113
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
 
114
  AC_MSG_RESULT([$]$1)
 
115
else
 
116
  AC_MSG_RESULT(no)
 
117
fi
 
118
AC_SUBST($1)dnl
 
119
])
 
120
 
 
121
# GLIB_WITH_NLS
 
122
#-----------------
 
123
glib_DEFUN([GLIB_WITH_NLS],
 
124
  dnl NLS is obligatory
 
125
  [USE_NLS=yes
 
126
    AC_SUBST(USE_NLS)
 
127
 
 
128
    gt_cv_have_gettext=no
 
129
 
 
130
    CATOBJEXT=NONE
 
131
    XGETTEXT=:
 
132
    INTLLIBS=
 
133
 
 
134
    AC_CHECK_HEADER(libintl.h,
 
135
     [gt_cv_func_dgettext_libintl="no"
 
136
      libintl_extra_libs=""
 
137
 
 
138
      #
 
139
      # First check in libc
 
140
      #
 
141
      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
 
142
        [AC_TRY_LINK([
 
143
#include <libintl.h>
 
144
],
 
145
         [return !ngettext ("","", 1)],
 
146
          gt_cv_func_ngettext_libc=yes,
 
147
          gt_cv_func_ngettext_libc=no)
 
148
        ])
 
149
  
 
150
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
 
151
              AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
 
152
                [AC_TRY_LINK([
 
153
#include <libintl.h>
 
154
],
 
155
                  [return !dgettext ("","")],
 
156
                  gt_cv_func_dgettext_libc=yes,
 
157
                  gt_cv_func_dgettext_libc=no)
 
158
                ])
 
159
      fi
 
160
  
 
161
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
 
162
        AC_CHECK_FUNCS(bind_textdomain_codeset)
 
163
      fi
 
164
 
 
165
      #
 
166
      # If we don't have everything we want, check in libintl
 
167
      #
 
168
      if test "$gt_cv_func_dgettext_libc" != "yes" \
 
169
         || test "$gt_cv_func_ngettext_libc" != "yes" \
 
170
         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
 
171
        
 
172
        AC_CHECK_LIB(intl, bindtextdomain,
 
173
            [AC_CHECK_LIB(intl, ngettext,
 
174
                    [AC_CHECK_LIB(intl, dgettext,
 
175
                                  gt_cv_func_dgettext_libintl=yes)])])
 
176
 
 
177
        if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
 
178
          AC_MSG_CHECKING([if -liconv is needed to use gettext])
 
179
          AC_MSG_RESULT([])
 
180
          AC_CHECK_LIB(intl, ngettext,
 
181
                [AC_CHECK_LIB(intl, dcgettext,
 
182
                       [gt_cv_func_dgettext_libintl=yes
 
183
                        libintl_extra_libs=-liconv],
 
184
                        :,-liconv)],
 
185
                :,-liconv)
 
186
        fi
 
187
 
 
188
        #
 
189
        # If we found libintl, then check in it for bind_textdomain_codeset();
 
190
        # we'll prefer libc if neither have bind_textdomain_codeset(),
 
191
        # and both have dgettext and ngettext
 
192
        #
 
193
        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
 
194
          glib_save_LIBS="$LIBS"
 
195
          LIBS="$LIBS -lintl $libintl_extra_libs"
 
196
          unset ac_cv_func_bind_textdomain_codeset
 
197
          AC_CHECK_FUNCS(bind_textdomain_codeset)
 
198
          LIBS="$glib_save_LIBS"
 
199
 
 
200
          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
 
201
            gt_cv_func_dgettext_libc=no
 
202
          else
 
203
            if test "$gt_cv_func_dgettext_libc" = "yes" \
 
204
                && test "$gt_cv_func_ngettext_libc" = "yes"; then
 
205
              gt_cv_func_dgettext_libintl=no
 
206
            fi
 
207
          fi
 
208
        fi
 
209
      fi
 
210
 
 
211
      if test "$gt_cv_func_dgettext_libc" = "yes" \
 
212
        || test "$gt_cv_func_dgettext_libintl" = "yes"; then
 
213
        gt_cv_have_gettext=yes
 
214
      fi
 
215
  
 
216
      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
 
217
        INTLLIBS="-lintl $libintl_extra_libs"
 
218
      fi
 
219
  
 
220
      if test "$gt_cv_have_gettext" = "yes"; then
 
221
        AC_DEFINE(HAVE_GETTEXT,1,
 
222
          [Define if the GNU gettext() function is already present or preinstalled.])
 
223
        GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
224
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
 
225
        if test "$MSGFMT" != "no"; then
 
226
          glib_save_LIBS="$LIBS"
 
227
          LIBS="$LIBS $INTLLIBS"
 
228
          AC_CHECK_FUNCS(dcgettext)
 
229
          MSGFMT_OPTS=
 
230
          AC_MSG_CHECKING([if msgfmt accepts -c])
 
231
          GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
 
232
msgid ""
 
233
msgstr ""
 
234
"Content-Type: text/plain; charset=UTF-8\n"
 
235
"Project-Id-Version: test 1.0\n"
 
236
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
 
237
"Last-Translator: test <foo@bar.xx>\n"
 
238
"Language-Team: C <LL@li.org>\n"
 
239
"MIME-Version: 1.0\n"
 
240
"Content-Transfer-Encoding: 8bit\n"
 
241
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
 
242
          AC_SUBST(MSGFMT_OPTS)
 
243
          AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
244
          GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
245
            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 
246
          AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
 
247
                         return _nl_msg_cat_cntr],
 
248
            [CATOBJEXT=.gmo 
 
249
             DATADIRNAME=share],
 
250
            [case $host in
 
251
            *-*-solaris*)
 
252
            dnl On Solaris, if bind_textdomain_codeset is in libc,
 
253
            dnl GNU format message catalog is always supported,
 
254
            dnl since both are added to the libc all together.
 
255
            dnl Hence, we'd like to go with DATADIRNAME=share and
 
256
            dnl and CATOBJEXT=.gmo in this case.
 
257
            AC_CHECK_FUNC(bind_textdomain_codeset,
 
258
              [CATOBJEXT=.gmo 
 
259
               DATADIRNAME=share],
 
260
              [CATOBJEXT=.mo
 
261
               DATADIRNAME=lib])
 
262
            ;;
 
263
            *)
 
264
            CATOBJEXT=.mo
 
265
            DATADIRNAME=lib
 
266
            ;;
 
267
            esac])
 
268
          LIBS="$glib_save_LIBS"
 
269
          INSTOBJEXT=.mo
 
270
        else
 
271
          gt_cv_have_gettext=no
 
272
        fi
 
273
      fi
 
274
    ])
 
275
 
 
276
    if test "$gt_cv_have_gettext" = "yes" ; then
 
277
      AC_DEFINE(ENABLE_NLS, 1,
 
278
        [always defined to indicate that i18n is enabled])
 
279
    fi
 
280
 
 
281
    dnl Test whether we really found GNU xgettext.
 
282
    if test "$XGETTEXT" != ":"; then
 
283
      dnl If it is not GNU xgettext we define it as : so that the
 
284
      dnl Makefiles still can work.
 
285
      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
 
286
        : ;
 
287
      else
 
288
        AC_MSG_RESULT(
 
289
          [found xgettext program is not GNU xgettext; ignore it])
 
290
        XGETTEXT=":"
 
291
      fi
 
292
    fi
 
293
 
 
294
    # We need to process the po/ directory.
 
295
    POSUB=po
 
296
 
 
297
    AC_OUTPUT_COMMANDS(
 
298
      [case "$CONFIG_FILES" in *po/Makefile.in*)
 
299
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
 
300
      esac])
 
301
 
 
302
    dnl These rules are solely for the distribution goal.  While doing this
 
303
    dnl we only have to keep exactly one list of the available catalogs
 
304
    dnl in configure.in.
 
305
    for lang in $ALL_LINGUAS; do
 
306
      GMOFILES="$GMOFILES $lang.gmo"
 
307
      POFILES="$POFILES $lang.po"
 
308
    done
 
309
 
 
310
    dnl Make all variables we use known to autoconf.
 
311
    AC_SUBST(CATALOGS)
 
312
    AC_SUBST(CATOBJEXT)
 
313
    AC_SUBST(DATADIRNAME)
 
314
    AC_SUBST(GMOFILES)
 
315
    AC_SUBST(INSTOBJEXT)
 
316
    AC_SUBST(INTLLIBS)
 
317
    AC_SUBST(PO_IN_DATADIR_TRUE)
 
318
    AC_SUBST(PO_IN_DATADIR_FALSE)
 
319
    AC_SUBST(POFILES)
 
320
    AC_SUBST(POSUB)
 
321
  ])
 
322
 
 
323
# AM_GLIB_GNU_GETTEXT
 
324
# -------------------
 
325
# Do checks necessary for use of gettext. If a suitable implementation 
 
326
# of gettext is found in either in libintl or in the C library,
 
327
# it will set INTLLIBS to the libraries needed for use of gettext
 
328
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
 
329
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
 
330
# on various variables needed by the Makefile.in.in installed by 
 
331
# glib-gettextize.
 
332
dnl
 
333
glib_DEFUN([GLIB_GNU_GETTEXT],
 
334
  [AC_REQUIRE([AC_PROG_CC])dnl
 
335
   AC_REQUIRE([AC_HEADER_STDC])dnl
 
336
   
 
337
   GLIB_LC_MESSAGES
 
338
   GLIB_WITH_NLS
 
339
 
 
340
   if test "$gt_cv_have_gettext" = "yes"; then
 
341
     if test "x$ALL_LINGUAS" = "x"; then
 
342
       LINGUAS=
 
343
     else
 
344
       AC_MSG_CHECKING(for catalogs to be installed)
 
345
       NEW_LINGUAS=
 
346
       for presentlang in $ALL_LINGUAS; do
 
347
         useit=no
 
348
         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
 
349
           desiredlanguages="$LINGUAS"
 
350
         else
 
351
           desiredlanguages="$ALL_LINGUAS"
 
352
         fi
 
353
         for desiredlang in $desiredlanguages; do
 
354
           # Use the presentlang catalog if desiredlang is
 
355
           #   a. equal to presentlang, or
 
356
           #   b. a variant of presentlang (because in this case,
 
357
           #      presentlang can be used as a fallback for messages
 
358
           #      which are not translated in the desiredlang catalog).
 
359
           case "$desiredlang" in
 
360
             "$presentlang"*) useit=yes;;
 
361
           esac
 
362
         done
 
363
         if test $useit = yes; then
 
364
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
 
365
         fi
 
366
       done
 
367
       LINGUAS=$NEW_LINGUAS
 
368
       AC_MSG_RESULT($LINGUAS)
 
369
     fi
 
370
 
 
371
     dnl Construct list of names of catalog files to be constructed.
 
372
     if test -n "$LINGUAS"; then
 
373
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
 
374
     fi
 
375
   fi
 
376
 
 
377
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
 
378
   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
 
379
   dnl Try to locate is.
 
380
   MKINSTALLDIRS=
 
381
   if test -n "$ac_aux_dir"; then
 
382
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
 
383
   fi
 
384
   if test -z "$MKINSTALLDIRS"; then
 
385
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
 
386
   fi
 
387
   AC_SUBST(MKINSTALLDIRS)
 
388
 
 
389
   dnl Generate list of files to be processed by xgettext which will
 
390
   dnl be included in po/Makefile.
 
391
   test -d po || mkdir po
 
392
   if test "x$srcdir" != "x."; then
 
393
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
 
394
       posrcprefix="$srcdir/"
 
395
     else
 
396
       posrcprefix="../$srcdir/"
 
397
     fi
 
398
   else
 
399
     posrcprefix="../"
 
400
   fi
 
401
   rm -f po/POTFILES
 
402
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
 
403
        < $srcdir/po/POTFILES.in > po/POTFILES
 
404
  ])
 
405
 
 
406
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
 
407
# -------------------------------
 
408
# Define VARIABLE to the location where catalog files will
 
409
# be installed by po/Makefile.
 
410
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
 
411
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
 
412
glib_save_prefix="$prefix"
 
413
glib_save_exec_prefix="$exec_prefix"
 
414
glib_save_datarootdir="$datarootdir"
 
415
test "x$prefix" = xNONE && prefix=$ac_default_prefix
 
416
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
 
417
datarootdir=`eval echo "${datarootdir}"`
 
418
if test "x$CATOBJEXT" = "x.mo" ; then
 
419
  localedir=`eval echo "${libdir}/locale"`
 
420
else
 
421
  localedir=`eval echo "${datadir}/locale"`
 
422
fi
 
423
prefix="$glib_save_prefix"
 
424
exec_prefix="$glib_save_exec_prefix"
 
425
datarootdir="$glib_save_datarootdir"
 
426
AC_DEFINE_UNQUOTED($1, "$localedir",
 
427
  [Define the location where the catalogs will be installed])
 
428
])
 
429
 
 
430
dnl
 
431
dnl Now the definitions that aclocal will find
 
432
dnl
 
433
ifdef(glib_configure_in,[],[
 
434
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
 
435
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
 
436
])dnl
 
437
 
 
438
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
 
439
 
440
# Create a temporary file with TEST-FILE as its contents and pass the
 
441
# file name to PROGRAM.  Perform ACTION-IF-PASS if PROGRAM exits with
 
442
# 0 and perform ACTION-IF-FAIL for any other exit status.
 
443
AC_DEFUN([GLIB_RUN_PROG],
 
444
[cat >conftest.foo <<_ACEOF
 
445
$2
 
446
_ACEOF
 
447
if AC_RUN_LOG([$1 conftest.foo]); then
 
448
  m4_ifval([$3], [$3], [:])
 
449
m4_ifvaln([$4], [else $4])dnl
 
450
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
 
451
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
 
452
fi])
 
453
 
 
454
 
 
455
 
 
456
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
 
457
# serial 40 IT_PROG_INTLTOOL
 
458
AC_DEFUN([IT_PROG_INTLTOOL], [
 
459
AC_PREREQ([2.50])dnl
 
460
AC_REQUIRE([AM_NLS])dnl
 
461
 
 
462
case "$am__api_version" in
 
463
    1.[01234])
 
464
        AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
 
465
    ;;
 
466
    *)
 
467
    ;;
 
468
esac
 
469
 
 
470
if test -n "$1"; then
 
471
    AC_MSG_CHECKING([for intltool >= $1])
 
472
 
 
473
    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
 
474
    INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
 
475
    [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
 
476
    ]
 
477
    AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
 
478
    test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
 
479
        AC_MSG_ERROR([Your intltool is too old.  You need intltool $1 or later.])
 
480
fi
 
481
 
 
482
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
 
483
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
 
484
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
 
485
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
 
486
    AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
 
487
fi
 
488
 
 
489
  INTLTOOL_DESKTOP_RULE='%.desktop:   %.desktop.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
490
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
491
     INTLTOOL_KEYS_RULE='%.keys:      %.keys.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
492
     INTLTOOL_PROP_RULE='%.prop:      %.prop.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
493
      INTLTOOL_OAF_RULE='%.oaf:       %.oaf.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
 
494
     INTLTOOL_PONG_RULE='%.pong:      %.pong.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
495
   INTLTOOL_SERVER_RULE='%.server:    %.server.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
496
    INTLTOOL_SHEET_RULE='%.sheet:     %.sheet.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
497
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
498
       INTLTOOL_UI_RULE='%.ui:        %.ui.in        $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
499
      INTLTOOL_XML_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
500
      INTLTOOL_XML_NOMERGE_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' 
 
501
      INTLTOOL_XAM_RULE='%.xam:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
502
      INTLTOOL_KBD_RULE='%.kbd:       %.kbd.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
503
    INTLTOOL_CAVES_RULE='%.caves:     %.caves.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
504
  INTLTOOL_SCHEMAS_RULE='%.schemas:   %.schemas.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
505
    INTLTOOL_THEME_RULE='%.theme:     %.theme.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
 
506
    INTLTOOL_SERVICE_RULE='%.service: %.service.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
 
507
   INTLTOOL_POLICY_RULE='%.policy:    %.policy.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
 
508
 
 
509
AC_SUBST(INTLTOOL_DESKTOP_RULE)
 
510
AC_SUBST(INTLTOOL_DIRECTORY_RULE)
 
511
AC_SUBST(INTLTOOL_KEYS_RULE)
 
512
AC_SUBST(INTLTOOL_PROP_RULE)
 
513
AC_SUBST(INTLTOOL_OAF_RULE)
 
514
AC_SUBST(INTLTOOL_PONG_RULE)
 
515
AC_SUBST(INTLTOOL_SERVER_RULE)
 
516
AC_SUBST(INTLTOOL_SHEET_RULE)
 
517
AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
 
518
AC_SUBST(INTLTOOL_UI_RULE)
 
519
AC_SUBST(INTLTOOL_XAM_RULE)
 
520
AC_SUBST(INTLTOOL_KBD_RULE)
 
521
AC_SUBST(INTLTOOL_XML_RULE)
 
522
AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
 
523
AC_SUBST(INTLTOOL_CAVES_RULE)
 
524
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
 
525
AC_SUBST(INTLTOOL_THEME_RULE)
 
526
AC_SUBST(INTLTOOL_SERVICE_RULE)
 
527
AC_SUBST(INTLTOOL_POLICY_RULE)
 
528
 
 
529
# Check the gettext tools to make sure they are GNU
 
530
AC_PATH_PROG(XGETTEXT, xgettext)
 
531
AC_PATH_PROG(MSGMERGE, msgmerge)
 
532
AC_PATH_PROG(MSGFMT, msgfmt)
 
533
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
534
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
 
535
    AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
 
536
fi
 
537
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
 
538
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
 
539
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
 
540
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
 
541
    AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
 
542
fi
 
543
 
 
544
AC_PATH_PROG(INTLTOOL_PERL, [perl])
 
545
if test -z "$INTLTOOL_PERL"; then
 
546
   AC_MSG_ERROR([perl not found; required for intltool])
 
547
fi
 
548
if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
 
549
   AC_MSG_ERROR([perl 5.x required for intltool])
 
550
fi
 
551
if test "x$2" != "xno-xml"; then
 
552
   AC_MSG_CHECKING([for XML::Parser])
 
553
   if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
 
554
       AC_MSG_RESULT([ok])
 
555
   else
 
556
       AC_MSG_ERROR([XML::Parser perl module is required for intltool])
 
557
   fi
 
558
fi
 
559
 
 
560
# Substitute ALL_LINGUAS so we can use it in po/Makefile
 
561
AC_SUBST(ALL_LINGUAS)
 
562
 
 
563
# Set DATADIRNAME correctly if it is not set yet
 
564
# (copied from glib-gettext.m4)
 
565
if test -z "$DATADIRNAME"; then
 
566
  AC_LINK_IFELSE(
 
567
    [AC_LANG_PROGRAM([[]],
 
568
                     [[extern int _nl_msg_cat_cntr;
 
569
                       return _nl_msg_cat_cntr]])],
 
570
    [DATADIRNAME=share],
 
571
    [case $host in
 
572
    *-*-solaris*)
 
573
    dnl On Solaris, if bind_textdomain_codeset is in libc,
 
574
    dnl GNU format message catalog is always supported,
 
575
    dnl since both are added to the libc all together.
 
576
    dnl Hence, we'd like to go with DATADIRNAME=share
 
577
    dnl in this case.
 
578
    AC_CHECK_FUNC(bind_textdomain_codeset,
 
579
      [DATADIRNAME=share], [DATADIRNAME=lib])
 
580
    ;;
 
581
    *)
 
582
    [DATADIRNAME=lib]
 
583
    ;;
 
584
    esac])
 
585
fi
 
586
AC_SUBST(DATADIRNAME)
 
587
 
 
588
IT_PO_SUBDIR([po])
 
589
 
 
590
])
 
591
 
 
592
 
 
593
# IT_PO_SUBDIR(DIRNAME)
 
594
# ---------------------
 
595
# All po subdirs have to be declared with this macro; the subdir "po" is
 
596
# declared by IT_PROG_INTLTOOL.
 
597
#
 
598
AC_DEFUN([IT_PO_SUBDIR],
 
599
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
 
600
dnl
 
601
dnl The following CONFIG_COMMANDS should be exetuted at the very end
 
602
dnl of config.status.
 
603
AC_CONFIG_COMMANDS_PRE([
 
604
  AC_CONFIG_COMMANDS([$1/stamp-it], [
 
605
    if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" ]; then
 
606
       AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
 
607
    fi
 
608
    rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
 
609
    >"$1/stamp-it.tmp"
 
610
    [sed '/^#/d
 
611
         s/^[[].*] *//
 
612
         /^[    ]*$/d
 
613
        '"s|^|  $ac_top_srcdir/|" \
 
614
      "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
 
615
    ]
 
616
    [sed '/^POTFILES =/,/[^\\]$/ {
 
617
                /^POTFILES =/!d
 
618
                r $1/POTFILES
 
619
          }
 
620
         ' "$1/Makefile.in" >"$1/Makefile"]
 
621
    rm -f "$1/Makefile.tmp"
 
622
    mv "$1/stamp-it.tmp" "$1/stamp-it"
 
623
  ])
 
624
])dnl
 
625
])
 
626
 
 
627
# deprecated macros
 
628
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
 
629
# A hint is needed for aclocal from Automake <= 1.9.4:
 
630
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
 
631
 
 
632
 
 
633
# nls.m4 serial 3 (gettext-0.15)
 
634
dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
 
635
dnl This file is free software; the Free Software Foundation
 
636
dnl gives unlimited permission to copy and/or distribute it,
 
637
dnl with or without modifications, as long as this notice is preserved.
 
638
dnl
 
639
dnl This file can can be used in projects which are not available under
 
640
dnl the GNU General Public License or the GNU Library General Public
 
641
dnl License but which still want to provide support for the GNU gettext
 
642
dnl functionality.
 
643
dnl Please note that the actual code of the GNU gettext library is covered
 
644
dnl by the GNU Library General Public License, and the rest of the GNU
 
645
dnl gettext package package is covered by the GNU General Public License.
 
646
dnl They are *not* in the public domain.
 
647
 
 
648
dnl Authors:
 
649
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
650
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
651
 
 
652
AC_PREREQ(2.50)
 
653
 
 
654
AC_DEFUN([AM_NLS],
 
655
[
 
656
  AC_MSG_CHECKING([whether NLS is requested])
 
657
  dnl Default is enabled NLS
 
658
  AC_ARG_ENABLE(nls,
 
659
    [  --disable-nls           do not use Native Language Support],
 
660
    USE_NLS=$enableval, USE_NLS=yes)
 
661
  AC_MSG_RESULT($USE_NLS)
 
662
  AC_SUBST(USE_NLS)
 
663
])
 
664
 
 
665
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
666
 
667
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
 
668
#
 
669
# This program is free software; you can redistribute it and/or modify
 
670
# it under the terms of the GNU General Public License as published by
 
671
# the Free Software Foundation; either version 2 of the License, or
 
672
# (at your option) any later version.
 
673
#
 
674
# This program is distributed in the hope that it will be useful, but
 
675
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
676
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
677
# General Public License for more details.
 
678
#
 
679
# You should have received a copy of the GNU General Public License
 
680
# along with this program; if not, write to the Free Software
 
681
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
682
#
 
683
# As a special exception to the GNU General Public License, if you
 
684
# distribute this file as part of a program that contains a
 
685
# configuration script generated by Autoconf, you may include it under
 
686
# the same distribution terms that you use for the rest of that program.
 
687
 
 
688
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
 
689
# ----------------------------------
 
690
AC_DEFUN([PKG_PROG_PKG_CONFIG],
 
691
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 
692
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
 
693
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
 
694
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 
695
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 
696
fi
 
697
if test -n "$PKG_CONFIG"; then
 
698
        _pkg_min_version=m4_default([$1], [0.9.0])
 
699
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
 
700
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 
701
                AC_MSG_RESULT([yes])
 
702
        else
 
703
                AC_MSG_RESULT([no])
 
704
                PKG_CONFIG=""
 
705
        fi
 
706
                
 
707
fi[]dnl
 
708
])# PKG_PROG_PKG_CONFIG
 
709
 
 
710
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
711
#
 
712
# Check to see whether a particular set of modules exists.  Similar
 
713
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
 
714
#
 
715
#
 
716
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
 
717
# this or PKG_CHECK_MODULES is called, or make sure to call
 
718
# PKG_CHECK_EXISTS manually
 
719
# --------------------------------------------------------------
 
720
AC_DEFUN([PKG_CHECK_EXISTS],
 
721
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
722
if test -n "$PKG_CONFIG" && \
 
723
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
 
724
  m4_ifval([$2], [$2], [:])
 
725
m4_ifvaln([$3], [else
 
726
  $3])dnl
 
727
fi])
 
728
 
 
729
 
 
730
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 
731
# ---------------------------------------------
 
732
m4_define([_PKG_CONFIG],
 
733
[if test -n "$$1"; then
 
734
    pkg_cv_[]$1="$$1"
 
735
 elif test -n "$PKG_CONFIG"; then
 
736
    PKG_CHECK_EXISTS([$3],
 
737
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 
738
                     [pkg_failed=yes])
 
739
 else
 
740
    pkg_failed=untried
 
741
fi[]dnl
 
742
])# _PKG_CONFIG
 
743
 
 
744
# _PKG_SHORT_ERRORS_SUPPORTED
 
745
# -----------------------------
 
746
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 
747
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
748
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 
749
        _pkg_short_errors_supported=yes
 
750
else
 
751
        _pkg_short_errors_supported=no
 
752
fi[]dnl
 
753
])# _PKG_SHORT_ERRORS_SUPPORTED
 
754
 
 
755
 
 
756
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 
757
# [ACTION-IF-NOT-FOUND])
 
758
#
 
759
#
 
760
# Note that if there is a possibility the first call to
 
761
# PKG_CHECK_MODULES might not happen, you should be sure to include an
 
762
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 
763
#
 
764
#
 
765
# --------------------------------------------------------------
 
766
AC_DEFUN([PKG_CHECK_MODULES],
 
767
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
768
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 
769
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
770
 
 
771
pkg_failed=no
 
772
AC_MSG_CHECKING([for $1])
 
773
 
 
774
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 
775
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
776
 
 
777
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 
778
and $1[]_LIBS to avoid the need to call pkg-config.
 
779
See the pkg-config man page for more details.])
 
780
 
 
781
if test $pkg_failed = yes; then
 
782
        _PKG_SHORT_ERRORS_SUPPORTED
 
783
        if test $_pkg_short_errors_supported = yes; then
 
784
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
 
785
        else 
 
786
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
 
787
        fi
 
788
        # Put the nasty error message in config.log where it belongs
 
789
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
790
 
 
791
        ifelse([$4], , [AC_MSG_ERROR(dnl
 
792
[Package requirements ($2) were not met:
 
793
 
 
794
$$1_PKG_ERRORS
 
795
 
 
796
Consider adjusting the PKG_CONFIG_PATH environment variable if you
 
797
installed software in a non-standard prefix.
 
798
 
 
799
_PKG_TEXT
 
800
])],
 
801
                [AC_MSG_RESULT([no])
 
802
                $4])
 
803
elif test $pkg_failed = untried; then
 
804
        ifelse([$4], , [AC_MSG_FAILURE(dnl
 
805
[The pkg-config script could not be found or is too old.  Make sure it
 
806
is in your PATH or set the PKG_CONFIG environment variable to the full
 
807
path to pkg-config.
 
808
 
 
809
_PKG_TEXT
 
810
 
 
811
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
 
812
                [$4])
 
813
else
 
814
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 
815
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 
816
        AC_MSG_RESULT([yes])
 
817
        ifelse([$3], , :, [$3])
 
818
fi[]dnl
 
819
])# PKG_CHECK_MODULES
 
820
 
22
821
# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
23
822
#
24
823
# This file is free software; the Free Software Foundation
1076
1875
AC_SUBST([am__untar])
1077
1876
]) # _AM_PROG_TAR
1078
1877
 
1079
 
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
1080
 
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
1081
 
#
1082
 
# This file is free software, distributed under the terms of the GNU
1083
 
# General Public License.  As a special exception to the GNU General
1084
 
# Public License, this file may be distributed as part of a program
1085
 
# that contains a configuration script generated by Autoconf, under
1086
 
# the same distribution terms as the rest of that program.
1087
 
#
1088
 
# This file can be copied and used freely without restrictions.  It can
1089
 
# be used in projects which are not available under the GNU Public License
1090
 
# but which still want to provide support for the GNU gettext functionality.
1091
 
#
1092
 
# Macro to add for using GNU gettext.
1093
 
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
1094
 
#
1095
 
# Modified to never use included libintl. 
1096
 
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
1097
 
#
1098
 
# Major rework to remove unused code
1099
 
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
1100
 
#
1101
 
# Added better handling of ALL_LINGUAS from GNU gettext version 
1102
 
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
1103
 
#
1104
 
# Modified to require ngettext
1105
 
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
1106
 
#
1107
 
# We need this here as well, since someone might use autoconf-2.5x
1108
 
# to configure GLib then an older version to configure a package
1109
 
# using AM_GLIB_GNU_GETTEXT
1110
 
AC_PREREQ(2.53)
1111
 
 
1112
 
dnl
1113
 
dnl We go to great lengths to make sure that aclocal won't 
1114
 
dnl try to pull in the installed version of these macros
1115
 
dnl when running aclocal in the glib directory.
1116
 
dnl
1117
 
m4_copy([AC_DEFUN],[glib_DEFUN])
1118
 
m4_copy([AC_REQUIRE],[glib_REQUIRE])
1119
 
dnl
1120
 
dnl At the end, if we're not within glib, we'll define the public
1121
 
dnl definitions in terms of our private definitions.
1122
 
dnl
1123
 
 
1124
 
# GLIB_LC_MESSAGES
1125
 
#--------------------
1126
 
glib_DEFUN([GLIB_LC_MESSAGES],
1127
 
  [AC_CHECK_HEADERS([locale.h])
1128
 
    if test $ac_cv_header_locale_h = yes; then
1129
 
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1130
 
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1131
 
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1132
 
    if test $am_cv_val_LC_MESSAGES = yes; then
1133
 
      AC_DEFINE(HAVE_LC_MESSAGES, 1,
1134
 
        [Define if your <locale.h> file defines LC_MESSAGES.])
1135
 
    fi
1136
 
  fi])
1137
 
 
1138
 
# GLIB_PATH_PROG_WITH_TEST
1139
 
#----------------------------
1140
 
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1141
 
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1142
 
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
1143
 
[# Extract the first word of "$2", so it can be a program name with args.
1144
 
set dummy $2; ac_word=[$]2
1145
 
AC_MSG_CHECKING([for $ac_word])
1146
 
AC_CACHE_VAL(ac_cv_path_$1,
1147
 
[case "[$]$1" in
1148
 
  /*)
1149
 
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1150
 
  ;;
1151
 
  *)
1152
 
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1153
 
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
1154
 
    test -z "$ac_dir" && ac_dir=.
1155
 
    if test -f $ac_dir/$ac_word; then
1156
 
      if [$3]; then
1157
 
        ac_cv_path_$1="$ac_dir/$ac_word"
1158
 
        break
1159
 
      fi
1160
 
    fi
1161
 
  done
1162
 
  IFS="$ac_save_ifs"
1163
 
dnl If no 4th arg is given, leave the cache variable unset,
1164
 
dnl so AC_PATH_PROGS will keep looking.
1165
 
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1166
 
])dnl
1167
 
  ;;
1168
 
esac])dnl
1169
 
$1="$ac_cv_path_$1"
1170
 
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1171
 
  AC_MSG_RESULT([$]$1)
1172
 
else
1173
 
  AC_MSG_RESULT(no)
1174
 
fi
1175
 
AC_SUBST($1)dnl
1176
 
])
1177
 
 
1178
 
# GLIB_WITH_NLS
1179
 
#-----------------
1180
 
glib_DEFUN([GLIB_WITH_NLS],
1181
 
  dnl NLS is obligatory
1182
 
  [USE_NLS=yes
1183
 
    AC_SUBST(USE_NLS)
1184
 
 
1185
 
    gt_cv_have_gettext=no
1186
 
 
1187
 
    CATOBJEXT=NONE
1188
 
    XGETTEXT=:
1189
 
    INTLLIBS=
1190
 
 
1191
 
    AC_CHECK_HEADER(libintl.h,
1192
 
     [gt_cv_func_dgettext_libintl="no"
1193
 
      libintl_extra_libs=""
1194
 
 
1195
 
      #
1196
 
      # First check in libc
1197
 
      #
1198
 
      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
1199
 
        [AC_TRY_LINK([
1200
 
#include <libintl.h>
1201
 
],
1202
 
         [return !ngettext ("","", 1)],
1203
 
          gt_cv_func_ngettext_libc=yes,
1204
 
          gt_cv_func_ngettext_libc=no)
1205
 
        ])
1206
 
  
1207
 
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1208
 
              AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1209
 
                [AC_TRY_LINK([
1210
 
#include <libintl.h>
1211
 
],
1212
 
                  [return !dgettext ("","")],
1213
 
                  gt_cv_func_dgettext_libc=yes,
1214
 
                  gt_cv_func_dgettext_libc=no)
1215
 
                ])
1216
 
      fi
1217
 
  
1218
 
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1219
 
        AC_CHECK_FUNCS(bind_textdomain_codeset)
1220
 
      fi
1221
 
 
1222
 
      #
1223
 
      # If we don't have everything we want, check in libintl
1224
 
      #
1225
 
      if test "$gt_cv_func_dgettext_libc" != "yes" \
1226
 
         || test "$gt_cv_func_ngettext_libc" != "yes" \
1227
 
         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
1228
 
        
1229
 
        AC_CHECK_LIB(intl, bindtextdomain,
1230
 
            [AC_CHECK_LIB(intl, ngettext,
1231
 
                    [AC_CHECK_LIB(intl, dgettext,
1232
 
                                  gt_cv_func_dgettext_libintl=yes)])])
1233
 
 
1234
 
        if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
1235
 
          AC_MSG_CHECKING([if -liconv is needed to use gettext])
1236
 
          AC_MSG_RESULT([])
1237
 
          AC_CHECK_LIB(intl, ngettext,
1238
 
                [AC_CHECK_LIB(intl, dcgettext,
1239
 
                       [gt_cv_func_dgettext_libintl=yes
1240
 
                        libintl_extra_libs=-liconv],
1241
 
                        :,-liconv)],
1242
 
                :,-liconv)
1243
 
        fi
1244
 
 
1245
 
        #
1246
 
        # If we found libintl, then check in it for bind_textdomain_codeset();
1247
 
        # we'll prefer libc if neither have bind_textdomain_codeset(),
1248
 
        # and both have dgettext and ngettext
1249
 
        #
1250
 
        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
1251
 
          glib_save_LIBS="$LIBS"
1252
 
          LIBS="$LIBS -lintl $libintl_extra_libs"
1253
 
          unset ac_cv_func_bind_textdomain_codeset
1254
 
          AC_CHECK_FUNCS(bind_textdomain_codeset)
1255
 
          LIBS="$glib_save_LIBS"
1256
 
 
1257
 
          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
1258
 
            gt_cv_func_dgettext_libc=no
1259
 
          else
1260
 
            if test "$gt_cv_func_dgettext_libc" = "yes" \
1261
 
                && test "$gt_cv_func_ngettext_libc" = "yes"; then
1262
 
              gt_cv_func_dgettext_libintl=no
1263
 
            fi
1264
 
          fi
1265
 
        fi
1266
 
      fi
1267
 
 
1268
 
      if test "$gt_cv_func_dgettext_libc" = "yes" \
1269
 
        || test "$gt_cv_func_dgettext_libintl" = "yes"; then
1270
 
        gt_cv_have_gettext=yes
1271
 
      fi
1272
 
  
1273
 
      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
1274
 
        INTLLIBS="-lintl $libintl_extra_libs"
1275
 
      fi
1276
 
  
1277
 
      if test "$gt_cv_have_gettext" = "yes"; then
1278
 
        AC_DEFINE(HAVE_GETTEXT,1,
1279
 
          [Define if the GNU gettext() function is already present or preinstalled.])
1280
 
        GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1281
 
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1282
 
        if test "$MSGFMT" != "no"; then
1283
 
          glib_save_LIBS="$LIBS"
1284
 
          LIBS="$LIBS $INTLLIBS"
1285
 
          AC_CHECK_FUNCS(dcgettext)
1286
 
          MSGFMT_OPTS=
1287
 
          AC_MSG_CHECKING([if msgfmt accepts -c])
1288
 
          GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
1289
 
msgid ""
1290
 
msgstr ""
1291
 
"Content-Type: text/plain; charset=UTF-8\n"
1292
 
"Project-Id-Version: test 1.0\n"
1293
 
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
1294
 
"Last-Translator: test <foo@bar.xx>\n"
1295
 
"Language-Team: C <LL@li.org>\n"
1296
 
"MIME-Version: 1.0\n"
1297
 
"Content-Transfer-Encoding: 8bit\n"
1298
 
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
1299
 
          AC_SUBST(MSGFMT_OPTS)
1300
 
          AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1301
 
          GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1302
 
            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1303
 
          AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1304
 
                         return _nl_msg_cat_cntr],
1305
 
            [CATOBJEXT=.gmo 
1306
 
             DATADIRNAME=share],
1307
 
            [case $host in
1308
 
            *-*-solaris*)
1309
 
            dnl On Solaris, if bind_textdomain_codeset is in libc,
1310
 
            dnl GNU format message catalog is always supported,
1311
 
            dnl since both are added to the libc all together.
1312
 
            dnl Hence, we'd like to go with DATADIRNAME=share and
1313
 
            dnl and CATOBJEXT=.gmo in this case.
1314
 
            AC_CHECK_FUNC(bind_textdomain_codeset,
1315
 
              [CATOBJEXT=.gmo 
1316
 
               DATADIRNAME=share],
1317
 
              [CATOBJEXT=.mo
1318
 
               DATADIRNAME=lib])
1319
 
            ;;
1320
 
            *)
1321
 
            CATOBJEXT=.mo
1322
 
            DATADIRNAME=lib
1323
 
            ;;
1324
 
            esac])
1325
 
          LIBS="$glib_save_LIBS"
1326
 
          INSTOBJEXT=.mo
1327
 
        else
1328
 
          gt_cv_have_gettext=no
1329
 
        fi
1330
 
      fi
1331
 
    ])
1332
 
 
1333
 
    if test "$gt_cv_have_gettext" = "yes" ; then
1334
 
      AC_DEFINE(ENABLE_NLS, 1,
1335
 
        [always defined to indicate that i18n is enabled])
1336
 
    fi
1337
 
 
1338
 
    dnl Test whether we really found GNU xgettext.
1339
 
    if test "$XGETTEXT" != ":"; then
1340
 
      dnl If it is not GNU xgettext we define it as : so that the
1341
 
      dnl Makefiles still can work.
1342
 
      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1343
 
        : ;
1344
 
      else
1345
 
        AC_MSG_RESULT(
1346
 
          [found xgettext program is not GNU xgettext; ignore it])
1347
 
        XGETTEXT=":"
1348
 
      fi
1349
 
    fi
1350
 
 
1351
 
    # We need to process the po/ directory.
1352
 
    POSUB=po
1353
 
 
1354
 
    AC_OUTPUT_COMMANDS(
1355
 
      [case "$CONFIG_FILES" in *po/Makefile.in*)
1356
 
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1357
 
      esac])
1358
 
 
1359
 
    dnl These rules are solely for the distribution goal.  While doing this
1360
 
    dnl we only have to keep exactly one list of the available catalogs
1361
 
    dnl in configure.in.
1362
 
    for lang in $ALL_LINGUAS; do
1363
 
      GMOFILES="$GMOFILES $lang.gmo"
1364
 
      POFILES="$POFILES $lang.po"
1365
 
    done
1366
 
 
1367
 
    dnl Make all variables we use known to autoconf.
1368
 
    AC_SUBST(CATALOGS)
1369
 
    AC_SUBST(CATOBJEXT)
1370
 
    AC_SUBST(DATADIRNAME)
1371
 
    AC_SUBST(GMOFILES)
1372
 
    AC_SUBST(INSTOBJEXT)
1373
 
    AC_SUBST(INTLLIBS)
1374
 
    AC_SUBST(PO_IN_DATADIR_TRUE)
1375
 
    AC_SUBST(PO_IN_DATADIR_FALSE)
1376
 
    AC_SUBST(POFILES)
1377
 
    AC_SUBST(POSUB)
1378
 
  ])
1379
 
 
1380
 
# AM_GLIB_GNU_GETTEXT
1381
 
# -------------------
1382
 
# Do checks necessary for use of gettext. If a suitable implementation 
1383
 
# of gettext is found in either in libintl or in the C library,
1384
 
# it will set INTLLIBS to the libraries needed for use of gettext
1385
 
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
1386
 
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
1387
 
# on various variables needed by the Makefile.in.in installed by 
1388
 
# glib-gettextize.
1389
 
dnl
1390
 
glib_DEFUN([GLIB_GNU_GETTEXT],
1391
 
  [AC_REQUIRE([AC_PROG_CC])dnl
1392
 
   AC_REQUIRE([AC_HEADER_STDC])dnl
1393
 
   
1394
 
   GLIB_LC_MESSAGES
1395
 
   GLIB_WITH_NLS
1396
 
 
1397
 
   if test "$gt_cv_have_gettext" = "yes"; then
1398
 
     if test "x$ALL_LINGUAS" = "x"; then
1399
 
       LINGUAS=
1400
 
     else
1401
 
       AC_MSG_CHECKING(for catalogs to be installed)
1402
 
       NEW_LINGUAS=
1403
 
       for presentlang in $ALL_LINGUAS; do
1404
 
         useit=no
1405
 
         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
1406
 
           desiredlanguages="$LINGUAS"
1407
 
         else
1408
 
           desiredlanguages="$ALL_LINGUAS"
1409
 
         fi
1410
 
         for desiredlang in $desiredlanguages; do
1411
 
           # Use the presentlang catalog if desiredlang is
1412
 
           #   a. equal to presentlang, or
1413
 
           #   b. a variant of presentlang (because in this case,
1414
 
           #      presentlang can be used as a fallback for messages
1415
 
           #      which are not translated in the desiredlang catalog).
1416
 
           case "$desiredlang" in
1417
 
             "$presentlang"*) useit=yes;;
1418
 
           esac
1419
 
         done
1420
 
         if test $useit = yes; then
1421
 
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1422
 
         fi
1423
 
       done
1424
 
       LINGUAS=$NEW_LINGUAS
1425
 
       AC_MSG_RESULT($LINGUAS)
1426
 
     fi
1427
 
 
1428
 
     dnl Construct list of names of catalog files to be constructed.
1429
 
     if test -n "$LINGUAS"; then
1430
 
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1431
 
     fi
1432
 
   fi
1433
 
 
1434
 
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1435
 
   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1436
 
   dnl Try to locate is.
1437
 
   MKINSTALLDIRS=
1438
 
   if test -n "$ac_aux_dir"; then
1439
 
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1440
 
   fi
1441
 
   if test -z "$MKINSTALLDIRS"; then
1442
 
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1443
 
   fi
1444
 
   AC_SUBST(MKINSTALLDIRS)
1445
 
 
1446
 
   dnl Generate list of files to be processed by xgettext which will
1447
 
   dnl be included in po/Makefile.
1448
 
   test -d po || mkdir po
1449
 
   if test "x$srcdir" != "x."; then
1450
 
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1451
 
       posrcprefix="$srcdir/"
1452
 
     else
1453
 
       posrcprefix="../$srcdir/"
1454
 
     fi
1455
 
   else
1456
 
     posrcprefix="../"
1457
 
   fi
1458
 
   rm -f po/POTFILES
1459
 
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1460
 
        < $srcdir/po/POTFILES.in > po/POTFILES
1461
 
  ])
1462
 
 
1463
 
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
1464
 
# -------------------------------
1465
 
# Define VARIABLE to the location where catalog files will
1466
 
# be installed by po/Makefile.
1467
 
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
1468
 
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
1469
 
glib_save_prefix="$prefix"
1470
 
glib_save_exec_prefix="$exec_prefix"
1471
 
glib_save_datarootdir="$datarootdir"
1472
 
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1473
 
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1474
 
datarootdir=`eval echo "${datarootdir}"`
1475
 
if test "x$CATOBJEXT" = "x.mo" ; then
1476
 
  localedir=`eval echo "${libdir}/locale"`
1477
 
else
1478
 
  localedir=`eval echo "${datadir}/locale"`
1479
 
fi
1480
 
prefix="$glib_save_prefix"
1481
 
exec_prefix="$glib_save_exec_prefix"
1482
 
datarootdir="$glib_save_datarootdir"
1483
 
AC_DEFINE_UNQUOTED($1, "$localedir",
1484
 
  [Define the location where the catalogs will be installed])
1485
 
])
1486
 
 
1487
 
dnl
1488
 
dnl Now the definitions that aclocal will find
1489
 
dnl
1490
 
ifdef(glib_configure_in,[],[
1491
 
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
1492
 
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
1493
 
])dnl
1494
 
 
1495
 
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
1496
 
1497
 
# Create a temporary file with TEST-FILE as its contents and pass the
1498
 
# file name to PROGRAM.  Perform ACTION-IF-PASS if PROGRAM exits with
1499
 
# 0 and perform ACTION-IF-FAIL for any other exit status.
1500
 
AC_DEFUN([GLIB_RUN_PROG],
1501
 
[cat >conftest.foo <<_ACEOF
1502
 
$2
1503
 
_ACEOF
1504
 
if AC_RUN_LOG([$1 conftest.foo]); then
1505
 
  m4_ifval([$3], [$3], [:])
1506
 
m4_ifvaln([$4], [else $4])dnl
1507
 
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
1508
 
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
1509
 
fi])
1510
 
 
1511
 
 
1512
 
 
1513
 
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
1514
 
# serial 40 IT_PROG_INTLTOOL
1515
 
AC_DEFUN([IT_PROG_INTLTOOL],
1516
 
[AC_PREREQ([2.50])dnl
1517
 
 
1518
 
case "$am__api_version" in
1519
 
    1.[01234])
1520
 
        AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
1521
 
    ;;
1522
 
    *)
1523
 
    ;;
1524
 
esac
1525
 
 
1526
 
if test -n "$1"; then
1527
 
    AC_MSG_CHECKING([for intltool >= $1])
1528
 
 
1529
 
    INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
1530
 
    INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
1531
 
    [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
1532
 
    ]
1533
 
    AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
1534
 
    test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
1535
 
        AC_MSG_ERROR([Your intltool is too old.  You need intltool $1 or later.])
1536
 
fi
1537
 
 
1538
 
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
1539
 
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
1540
 
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
1541
 
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
1542
 
    AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
1543
 
fi
1544
 
 
1545
 
  INTLTOOL_DESKTOP_RULE='%.desktop:   %.desktop.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1546
 
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1547
 
     INTLTOOL_KEYS_RULE='%.keys:      %.keys.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1548
 
     INTLTOOL_PROP_RULE='%.prop:      %.prop.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1549
 
      INTLTOOL_OAF_RULE='%.oaf:       %.oaf.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
1550
 
     INTLTOOL_PONG_RULE='%.pong:      %.pong.in      $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1551
 
   INTLTOOL_SERVER_RULE='%.server:    %.server.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1552
 
    INTLTOOL_SHEET_RULE='%.sheet:     %.sheet.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1553
 
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1554
 
       INTLTOOL_UI_RULE='%.ui:        %.ui.in        $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1555
 
      INTLTOOL_XML_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1556
 
      INTLTOOL_XML_NOMERGE_RULE='%.xml:       %.xml.in       $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@' 
1557
 
      INTLTOOL_XAM_RULE='%.xam:       %.xml.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1558
 
      INTLTOOL_KBD_RULE='%.kbd:       %.kbd.in       $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1559
 
    INTLTOOL_CAVES_RULE='%.caves:     %.caves.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1560
 
  INTLTOOL_SCHEMAS_RULE='%.schemas:   %.schemas.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1561
 
    INTLTOOL_THEME_RULE='%.theme:     %.theme.in     $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' 
1562
 
    INTLTOOL_SERVICE_RULE='%.service: %.service.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1563
 
   INTLTOOL_POLICY_RULE='%.policy:    %.policy.in    $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
1564
 
 
1565
 
AC_SUBST(INTLTOOL_DESKTOP_RULE)
1566
 
AC_SUBST(INTLTOOL_DIRECTORY_RULE)
1567
 
AC_SUBST(INTLTOOL_KEYS_RULE)
1568
 
AC_SUBST(INTLTOOL_PROP_RULE)
1569
 
AC_SUBST(INTLTOOL_OAF_RULE)
1570
 
AC_SUBST(INTLTOOL_PONG_RULE)
1571
 
AC_SUBST(INTLTOOL_SERVER_RULE)
1572
 
AC_SUBST(INTLTOOL_SHEET_RULE)
1573
 
AC_SUBST(INTLTOOL_SOUNDLIST_RULE)
1574
 
AC_SUBST(INTLTOOL_UI_RULE)
1575
 
AC_SUBST(INTLTOOL_XAM_RULE)
1576
 
AC_SUBST(INTLTOOL_KBD_RULE)
1577
 
AC_SUBST(INTLTOOL_XML_RULE)
1578
 
AC_SUBST(INTLTOOL_XML_NOMERGE_RULE)
1579
 
AC_SUBST(INTLTOOL_CAVES_RULE)
1580
 
AC_SUBST(INTLTOOL_SCHEMAS_RULE)
1581
 
AC_SUBST(INTLTOOL_THEME_RULE)
1582
 
AC_SUBST(INTLTOOL_SERVICE_RULE)
1583
 
AC_SUBST(INTLTOOL_POLICY_RULE)
1584
 
 
1585
 
# Check the gettext tools to make sure they are GNU
1586
 
AC_PATH_PROG(XGETTEXT, xgettext)
1587
 
AC_PATH_PROG(MSGMERGE, msgmerge)
1588
 
AC_PATH_PROG(MSGFMT, msgfmt)
1589
 
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
1590
 
    AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
1591
 
fi
1592
 
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
1593
 
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
1594
 
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
1595
 
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
1596
 
    AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
1597
 
fi
1598
 
 
1599
 
AC_PATH_PROG(INTLTOOL_PERL, [perl])
1600
 
if test -z "$INTLTOOL_PERL"; then
1601
 
   AC_MSG_ERROR([perl not found; required for intltool])
1602
 
fi
1603
 
if test -z "`$INTLTOOL_PERL -v | fgrep '5.' 2> /dev/null`"; then
1604
 
   AC_MSG_ERROR([perl 5.x required for intltool])
1605
 
fi
1606
 
if test "x$2" != "xno-xml"; then
1607
 
   AC_MSG_CHECKING([for XML::Parser])
1608
 
   if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
1609
 
       AC_MSG_RESULT([ok])
1610
 
   else
1611
 
       AC_MSG_ERROR([XML::Parser perl module is required for intltool])
1612
 
   fi
1613
 
fi
1614
 
 
1615
 
# Substitute ALL_LINGUAS so we can use it in po/Makefile
1616
 
AC_SUBST(ALL_LINGUAS)
1617
 
 
1618
 
# Set DATADIRNAME correctly if it is not set yet
1619
 
# (copied from glib-gettext.m4)
1620
 
if test -z "$DATADIRNAME"; then
1621
 
  AC_LINK_IFELSE(
1622
 
    [AC_LANG_PROGRAM([[]],
1623
 
                     [[extern int _nl_msg_cat_cntr;
1624
 
                       return _nl_msg_cat_cntr]])],
1625
 
    [DATADIRNAME=share],
1626
 
    [case $host in
1627
 
    *-*-solaris*)
1628
 
    dnl On Solaris, if bind_textdomain_codeset is in libc,
1629
 
    dnl GNU format message catalog is always supported,
1630
 
    dnl since both are added to the libc all together.
1631
 
    dnl Hence, we'd like to go with DATADIRNAME=share
1632
 
    dnl in this case.
1633
 
    AC_CHECK_FUNC(bind_textdomain_codeset,
1634
 
      [DATADIRNAME=share], [DATADIRNAME=lib])
1635
 
    ;;
1636
 
    *)
1637
 
    [DATADIRNAME=lib]
1638
 
    ;;
1639
 
    esac])
1640
 
fi
1641
 
AC_SUBST(DATADIRNAME)
1642
 
 
1643
 
IT_PO_SUBDIR([po])
1644
 
 
1645
 
])
1646
 
 
1647
 
 
1648
 
# IT_PO_SUBDIR(DIRNAME)
1649
 
# ---------------------
1650
 
# All po subdirs have to be declared with this macro; the subdir "po" is
1651
 
# declared by IT_PROG_INTLTOOL.
1652
 
#
1653
 
AC_DEFUN([IT_PO_SUBDIR],
1654
 
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
1655
 
dnl
1656
 
dnl The following CONFIG_COMMANDS should be exetuted at the very end
1657
 
dnl of config.status.
1658
 
AC_CONFIG_COMMANDS_PRE([
1659
 
  AC_CONFIG_COMMANDS([$1/stamp-it], [
1660
 
    rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
1661
 
    >"$1/stamp-it.tmp"
1662
 
    [sed '/^#/d
1663
 
         s/^[[].*] *//
1664
 
         /^[    ]*$/d
1665
 
        '"s|^|  $ac_top_srcdir/|" \
1666
 
      "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
1667
 
    ]
1668
 
    if test ! -f "$1/Makefile"; then
1669
 
      AC_MSG_ERROR([$1/Makefile is not ready.])
1670
 
    fi
1671
 
    mv "$1/Makefile" "$1/Makefile.tmp"
1672
 
    [sed '/^POTFILES =/,/[^\\]$/ {
1673
 
                /^POTFILES =/!d
1674
 
                r $1/POTFILES
1675
 
          }
1676
 
         ' "$1/Makefile.tmp" >"$1/Makefile"]
1677
 
    rm -f "$1/Makefile.tmp"
1678
 
    mv "$1/stamp-it.tmp" "$1/stamp-it"
1679
 
  ])
1680
 
])dnl
1681
 
])
1682
 
 
1683
 
 
1684
 
# deprecated macros
1685
 
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
1686
 
# A hint is needed for aclocal from Automake <= 1.9.4:
1687
 
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
1688
 
 
1689
 
 
1690
 
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1691
 
1692
 
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1693
 
#
1694
 
# This program is free software; you can redistribute it and/or modify
1695
 
# it under the terms of the GNU General Public License as published by
1696
 
# the Free Software Foundation; either version 2 of the License, or
1697
 
# (at your option) any later version.
1698
 
#
1699
 
# This program is distributed in the hope that it will be useful, but
1700
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
1701
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1702
 
# General Public License for more details.
1703
 
#
1704
 
# You should have received a copy of the GNU General Public License
1705
 
# along with this program; if not, write to the Free Software
1706
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1707
 
#
1708
 
# As a special exception to the GNU General Public License, if you
1709
 
# distribute this file as part of a program that contains a
1710
 
# configuration script generated by Autoconf, you may include it under
1711
 
# the same distribution terms that you use for the rest of that program.
1712
 
 
1713
 
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1714
 
# ----------------------------------
1715
 
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1716
 
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1717
 
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1718
 
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1719
 
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1720
 
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1721
 
fi
1722
 
if test -n "$PKG_CONFIG"; then
1723
 
        _pkg_min_version=m4_default([$1], [0.9.0])
1724
 
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1725
 
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1726
 
                AC_MSG_RESULT([yes])
1727
 
        else
1728
 
                AC_MSG_RESULT([no])
1729
 
                PKG_CONFIG=""
1730
 
        fi
1731
 
                
1732
 
fi[]dnl
1733
 
])# PKG_PROG_PKG_CONFIG
1734
 
 
1735
 
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1736
 
#
1737
 
# Check to see whether a particular set of modules exists.  Similar
1738
 
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1739
 
#
1740
 
#
1741
 
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1742
 
# this or PKG_CHECK_MODULES is called, or make sure to call
1743
 
# PKG_CHECK_EXISTS manually
1744
 
# --------------------------------------------------------------
1745
 
AC_DEFUN([PKG_CHECK_EXISTS],
1746
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1747
 
if test -n "$PKG_CONFIG" && \
1748
 
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1749
 
  m4_ifval([$2], [$2], [:])
1750
 
m4_ifvaln([$3], [else
1751
 
  $3])dnl
1752
 
fi])
1753
 
 
1754
 
 
1755
 
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1756
 
# ---------------------------------------------
1757
 
m4_define([_PKG_CONFIG],
1758
 
[if test -n "$$1"; then
1759
 
    pkg_cv_[]$1="$$1"
1760
 
 elif test -n "$PKG_CONFIG"; then
1761
 
    PKG_CHECK_EXISTS([$3],
1762
 
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1763
 
                     [pkg_failed=yes])
1764
 
 else
1765
 
    pkg_failed=untried
1766
 
fi[]dnl
1767
 
])# _PKG_CONFIG
1768
 
 
1769
 
# _PKG_SHORT_ERRORS_SUPPORTED
1770
 
# -----------------------------
1771
 
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1772
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1773
 
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1774
 
        _pkg_short_errors_supported=yes
1775
 
else
1776
 
        _pkg_short_errors_supported=no
1777
 
fi[]dnl
1778
 
])# _PKG_SHORT_ERRORS_SUPPORTED
1779
 
 
1780
 
 
1781
 
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1782
 
# [ACTION-IF-NOT-FOUND])
1783
 
#
1784
 
#
1785
 
# Note that if there is a possibility the first call to
1786
 
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1787
 
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1788
 
#
1789
 
#
1790
 
# --------------------------------------------------------------
1791
 
AC_DEFUN([PKG_CHECK_MODULES],
1792
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1793
 
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1794
 
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1795
 
 
1796
 
pkg_failed=no
1797
 
AC_MSG_CHECKING([for $1])
1798
 
 
1799
 
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1800
 
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1801
 
 
1802
 
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1803
 
and $1[]_LIBS to avoid the need to call pkg-config.
1804
 
See the pkg-config man page for more details.])
1805
 
 
1806
 
if test $pkg_failed = yes; then
1807
 
        _PKG_SHORT_ERRORS_SUPPORTED
1808
 
        if test $_pkg_short_errors_supported = yes; then
1809
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1810
 
        else 
1811
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1812
 
        fi
1813
 
        # Put the nasty error message in config.log where it belongs
1814
 
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1815
 
 
1816
 
        ifelse([$4], , [AC_MSG_ERROR(dnl
1817
 
[Package requirements ($2) were not met:
1818
 
 
1819
 
$$1_PKG_ERRORS
1820
 
 
1821
 
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1822
 
installed software in a non-standard prefix.
1823
 
 
1824
 
_PKG_TEXT
1825
 
])],
1826
 
                [AC_MSG_RESULT([no])
1827
 
                $4])
1828
 
elif test $pkg_failed = untried; then
1829
 
        ifelse([$4], , [AC_MSG_FAILURE(dnl
1830
 
[The pkg-config script could not be found or is too old.  Make sure it
1831
 
is in your PATH or set the PKG_CONFIG environment variable to the full
1832
 
path to pkg-config.
1833
 
 
1834
 
_PKG_TEXT
1835
 
 
1836
 
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1837
 
                [$4])
1838
 
else
1839
 
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1840
 
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1841
 
        AC_MSG_RESULT([yes])
1842
 
        ifelse([$3], , :, [$3])
1843
 
fi[]dnl
1844
 
])# PKG_CHECK_MODULES
1845
 
 
1846
1878
m4_include([acinclude.m4])