~ubuntu-branches/debian/sid/gsettings-desktop-schemas/sid

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2011-02-08 22:39:11 UTC
  • mfrom: (2.1.5 experimental)
  • Revision ID: james.westby@ubuntu.com-20110208223911-qrspp4erxcrgv378
New upstream release.

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(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17
 
[m4_warning([this file was generated for autoconf 2.68.
 
16
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
 
17
[m4_warning([this file was generated for autoconf 2.65.
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.ac.
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_ac,[],[
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
 
dnl GLIB_GSETTINGS
456
 
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
457
 
dnl the schema should be compiled
458
 
dnl
459
 
 
460
 
AC_DEFUN([GLIB_GSETTINGS],
461
 
[
462
 
  m4_pattern_allow([AM_V_GEN])
463
 
  AC_ARG_ENABLE(schemas-compile,
464
 
                AC_HELP_STRING([--disable-schemas-compile],
465
 
                               [Disable regeneration of gschemas.compiled on install]),
466
 
                [case ${enableval} in
467
 
                  yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE=""  ;;
468
 
                  no)  GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
469
 
                  *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
470
 
                 esac])
471
 
  AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
472
 
  PKG_PROG_PKG_CONFIG([0.16])
473
 
  AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
474
 
  if test x$cross_compiling != xyes; then
475
 
    GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
476
 
  else
477
 
    AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
478
 
  fi
479
 
  AC_SUBST(GLIB_COMPILE_SCHEMAS)
480
 
  if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
481
 
    ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
482
 
  else
483
 
    ifelse([$1],,[:],[$1])
484
 
  fi
485
 
 
486
 
  GSETTINGS_RULES='
487
 
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
488
 
 
489
 
mostlyclean-am: clean-gsettings-schemas
490
 
 
491
 
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
492
 
 
493
 
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
494
 
        $(AM_V_GEN) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${d}$< && touch [$]@
495
 
 
496
 
all-am: $(gsettings_SCHEMAS:.xml=.valid)
497
 
uninstall-am: uninstall-gsettings-schemas
498
 
install-data-am: install-gsettings-schemas
499
 
 
500
 
.SECONDARY: $(gsettings_SCHEMAS)
501
 
 
502
 
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
503
 
        @$(NORMAL_INSTALL)
504
 
        if test -n "$^"; then \
505
 
                test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
506
 
                $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
507
 
                test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
508
 
        fi
509
 
 
510
 
uninstall-gsettings-schemas:
511
 
        @$(NORMAL_UNINSTALL)
512
 
        @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
513
 
        files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
514
 
        test -n "$$files" || exit 0; \
515
 
        echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
516
 
        cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
517
 
        test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
518
 
 
519
 
clean-gsettings-schemas:
520
 
        rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
521
 
 
522
 
ifdef gsettings_ENUM_NAMESPACE
523
 
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
524
 
        $(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead "  <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod "    <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail "  </@type@>" --ftail "</schemalist>" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@
525
 
endif
526
 
'
527
 
  _GSETTINGS_SUBST(GSETTINGS_RULES)
528
 
])
529
 
 
530
 
dnl _GSETTINGS_SUBST(VARIABLE)
531
 
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
532
 
AC_DEFUN([_GSETTINGS_SUBST],
533
 
[
534
 
AC_SUBST([$1])
535
 
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
536
 
]
537
 
)
538
 
 
539
 
# nls.m4 serial 5 (gettext-0.18)
540
 
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
541
 
dnl Inc.
542
 
dnl This file is free software; the Free Software Foundation
543
 
dnl gives unlimited permission to copy and/or distribute it,
544
 
dnl with or without modifications, as long as this notice is preserved.
545
 
dnl
546
 
dnl This file can can be used in projects which are not available under
547
 
dnl the GNU General Public License or the GNU Library General Public
548
 
dnl License but which still want to provide support for the GNU gettext
549
 
dnl functionality.
550
 
dnl Please note that the actual code of the GNU gettext library is covered
551
 
dnl by the GNU Library General Public License, and the rest of the GNU
552
 
dnl gettext package package is covered by the GNU General Public License.
553
 
dnl They are *not* in the public domain.
554
 
 
555
 
dnl Authors:
556
 
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
557
 
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
558
 
 
559
 
AC_PREREQ([2.50])
560
 
 
561
 
AC_DEFUN([AM_NLS],
562
 
[
563
 
  AC_MSG_CHECKING([whether NLS is requested])
564
 
  dnl Default is enabled NLS
565
 
  AC_ARG_ENABLE([nls],
566
 
    [  --disable-nls           do not use Native Language Support],
567
 
    USE_NLS=$enableval, USE_NLS=yes)
568
 
  AC_MSG_RESULT([$USE_NLS])
569
 
  AC_SUBST([USE_NLS])
570
 
])
571
 
 
572
 
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
573
 
# serial 1 (pkg-config-0.24)
574
 
575
 
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
576
 
#
577
 
# This program is free software; you can redistribute it and/or modify
578
 
# it under the terms of the GNU General Public License as published by
579
 
# the Free Software Foundation; either version 2 of the License, or
580
 
# (at your option) any later version.
581
 
#
582
 
# This program is distributed in the hope that it will be useful, but
583
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
584
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
585
 
# General Public License for more details.
586
 
#
587
 
# You should have received a copy of the GNU General Public License
588
 
# along with this program; if not, write to the Free Software
589
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
590
 
#
591
 
# As a special exception to the GNU General Public License, if you
592
 
# distribute this file as part of a program that contains a
593
 
# configuration script generated by Autoconf, you may include it under
594
 
# the same distribution terms that you use for the rest of that program.
595
 
 
596
 
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
597
 
# ----------------------------------
598
 
AC_DEFUN([PKG_PROG_PKG_CONFIG],
599
 
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
600
 
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
601
 
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
602
 
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
603
 
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
604
 
 
605
 
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
606
 
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
607
 
fi
608
 
if test -n "$PKG_CONFIG"; then
609
 
        _pkg_min_version=m4_default([$1], [0.9.0])
610
 
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
611
 
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
612
 
                AC_MSG_RESULT([yes])
613
 
        else
614
 
                AC_MSG_RESULT([no])
615
 
                PKG_CONFIG=""
616
 
        fi
617
 
fi[]dnl
618
 
])# PKG_PROG_PKG_CONFIG
619
 
 
620
 
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
621
 
#
622
 
# Check to see whether a particular set of modules exists.  Similar
623
 
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
624
 
#
625
 
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
626
 
# only at the first occurence in configure.ac, so if the first place
627
 
# it's called might be skipped (such as if it is within an "if", you
628
 
# have to call PKG_CHECK_EXISTS manually
629
 
# --------------------------------------------------------------
630
 
AC_DEFUN([PKG_CHECK_EXISTS],
631
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
632
 
if test -n "$PKG_CONFIG" && \
633
 
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
634
 
  m4_default([$2], [:])
635
 
m4_ifvaln([$3], [else
636
 
  $3])dnl
637
 
fi])
638
 
 
639
 
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
640
 
# ---------------------------------------------
641
 
m4_define([_PKG_CONFIG],
642
 
[if test -n "$$1"; then
643
 
    pkg_cv_[]$1="$$1"
644
 
 elif test -n "$PKG_CONFIG"; then
645
 
    PKG_CHECK_EXISTS([$3],
646
 
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
647
 
                     [pkg_failed=yes])
648
 
 else
649
 
    pkg_failed=untried
650
 
fi[]dnl
651
 
])# _PKG_CONFIG
652
 
 
653
 
# _PKG_SHORT_ERRORS_SUPPORTED
654
 
# -----------------------------
655
 
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
656
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
657
 
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
658
 
        _pkg_short_errors_supported=yes
659
 
else
660
 
        _pkg_short_errors_supported=no
661
 
fi[]dnl
662
 
])# _PKG_SHORT_ERRORS_SUPPORTED
663
 
 
664
 
 
665
 
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
666
 
# [ACTION-IF-NOT-FOUND])
667
 
#
668
 
#
669
 
# Note that if there is a possibility the first call to
670
 
# PKG_CHECK_MODULES might not happen, you should be sure to include an
671
 
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
672
 
#
673
 
#
674
 
# --------------------------------------------------------------
675
 
AC_DEFUN([PKG_CHECK_MODULES],
676
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
677
 
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
678
 
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
679
 
 
680
 
pkg_failed=no
681
 
AC_MSG_CHECKING([for $1])
682
 
 
683
 
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
684
 
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
685
 
 
686
 
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
687
 
and $1[]_LIBS to avoid the need to call pkg-config.
688
 
See the pkg-config man page for more details.])
689
 
 
690
 
if test $pkg_failed = yes; then
691
 
        AC_MSG_RESULT([no])
692
 
        _PKG_SHORT_ERRORS_SUPPORTED
693
 
        if test $_pkg_short_errors_supported = yes; then
694
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
695
 
        else 
696
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
697
 
        fi
698
 
        # Put the nasty error message in config.log where it belongs
699
 
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
700
 
 
701
 
        m4_default([$4], [AC_MSG_ERROR(
702
 
[Package requirements ($2) were not met:
703
 
 
704
 
$$1_PKG_ERRORS
705
 
 
706
 
Consider adjusting the PKG_CONFIG_PATH environment variable if you
707
 
installed software in a non-standard prefix.
708
 
 
709
 
_PKG_TEXT])
710
 
        ])
711
 
elif test $pkg_failed = untried; then
712
 
        AC_MSG_RESULT([no])
713
 
        m4_default([$4], [AC_MSG_FAILURE(
714
 
[The pkg-config script could not be found or is too old.  Make sure it
715
 
is in your PATH or set the PKG_CONFIG environment variable to the full
716
 
path to pkg-config.
717
 
 
718
 
_PKG_TEXT
719
 
 
720
 
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
721
 
        ])
722
 
else
723
 
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
724
 
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
725
 
        AC_MSG_RESULT([yes])
726
 
        $3
727
 
fi[]dnl
728
 
])# PKG_CHECK_MODULES
729
 
 
730
22
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
731
23
#
732
24
# This file is free software; the Free Software Foundation
1724
1016
AC_SUBST([am__untar])
1725
1017
]) # _AM_PROG_TAR
1726
1018
 
 
1019
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
 
1020
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
 
1021
#
 
1022
# This file is free software, distributed under the terms of the GNU
 
1023
# General Public License.  As a special exception to the GNU General
 
1024
# Public License, this file may be distributed as part of a program
 
1025
# that contains a configuration script generated by Autoconf, under
 
1026
# the same distribution terms as the rest of that program.
 
1027
#
 
1028
# This file can be copied and used freely without restrictions.  It can
 
1029
# be used in projects which are not available under the GNU Public License
 
1030
# but which still want to provide support for the GNU gettext functionality.
 
1031
#
 
1032
# Macro to add for using GNU gettext.
 
1033
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
 
1034
#
 
1035
# Modified to never use included libintl. 
 
1036
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
 
1037
#
 
1038
# Major rework to remove unused code
 
1039
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
 
1040
#
 
1041
# Added better handling of ALL_LINGUAS from GNU gettext version 
 
1042
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
 
1043
#
 
1044
# Modified to require ngettext
 
1045
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
 
1046
#
 
1047
# We need this here as well, since someone might use autoconf-2.5x
 
1048
# to configure GLib then an older version to configure a package
 
1049
# using AM_GLIB_GNU_GETTEXT
 
1050
AC_PREREQ(2.53)
 
1051
 
 
1052
dnl
 
1053
dnl We go to great lengths to make sure that aclocal won't 
 
1054
dnl try to pull in the installed version of these macros
 
1055
dnl when running aclocal in the glib directory.
 
1056
dnl
 
1057
m4_copy([AC_DEFUN],[glib_DEFUN])
 
1058
m4_copy([AC_REQUIRE],[glib_REQUIRE])
 
1059
dnl
 
1060
dnl At the end, if we're not within glib, we'll define the public
 
1061
dnl definitions in terms of our private definitions.
 
1062
dnl
 
1063
 
 
1064
# GLIB_LC_MESSAGES
 
1065
#--------------------
 
1066
glib_DEFUN([GLIB_LC_MESSAGES],
 
1067
  [AC_CHECK_HEADERS([locale.h])
 
1068
    if test $ac_cv_header_locale_h = yes; then
 
1069
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
 
1070
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
 
1071
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
 
1072
    if test $am_cv_val_LC_MESSAGES = yes; then
 
1073
      AC_DEFINE(HAVE_LC_MESSAGES, 1,
 
1074
        [Define if your <locale.h> file defines LC_MESSAGES.])
 
1075
    fi
 
1076
  fi])
 
1077
 
 
1078
# GLIB_PATH_PROG_WITH_TEST
 
1079
#----------------------------
 
1080
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 
1081
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
1082
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
 
1083
[# Extract the first word of "$2", so it can be a program name with args.
 
1084
set dummy $2; ac_word=[$]2
 
1085
AC_MSG_CHECKING([for $ac_word])
 
1086
AC_CACHE_VAL(ac_cv_path_$1,
 
1087
[case "[$]$1" in
 
1088
  /*)
 
1089
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
1090
  ;;
 
1091
  *)
 
1092
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 
1093
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
1094
    test -z "$ac_dir" && ac_dir=.
 
1095
    if test -f $ac_dir/$ac_word; then
 
1096
      if [$3]; then
 
1097
        ac_cv_path_$1="$ac_dir/$ac_word"
 
1098
        break
 
1099
      fi
 
1100
    fi
 
1101
  done
 
1102
  IFS="$ac_save_ifs"
 
1103
dnl If no 4th arg is given, leave the cache variable unset,
 
1104
dnl so AC_PATH_PROGS will keep looking.
 
1105
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
1106
])dnl
 
1107
  ;;
 
1108
esac])dnl
 
1109
$1="$ac_cv_path_$1"
 
1110
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
 
1111
  AC_MSG_RESULT([$]$1)
 
1112
else
 
1113
  AC_MSG_RESULT(no)
 
1114
fi
 
1115
AC_SUBST($1)dnl
 
1116
])
 
1117
 
 
1118
# GLIB_WITH_NLS
 
1119
#-----------------
 
1120
glib_DEFUN([GLIB_WITH_NLS],
 
1121
  dnl NLS is obligatory
 
1122
  [USE_NLS=yes
 
1123
    AC_SUBST(USE_NLS)
 
1124
 
 
1125
    gt_cv_have_gettext=no
 
1126
 
 
1127
    CATOBJEXT=NONE
 
1128
    XGETTEXT=:
 
1129
    INTLLIBS=
 
1130
 
 
1131
    AC_CHECK_HEADER(libintl.h,
 
1132
     [gt_cv_func_dgettext_libintl="no"
 
1133
      libintl_extra_libs=""
 
1134
 
 
1135
      #
 
1136
      # First check in libc
 
1137
      #
 
1138
      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
 
1139
        [AC_TRY_LINK([
 
1140
#include <libintl.h>
 
1141
],
 
1142
         [return !ngettext ("","", 1)],
 
1143
          gt_cv_func_ngettext_libc=yes,
 
1144
          gt_cv_func_ngettext_libc=no)
 
1145
        ])
 
1146
  
 
1147
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
 
1148
              AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
 
1149
                [AC_TRY_LINK([
 
1150
#include <libintl.h>
 
1151
],
 
1152
                  [return !dgettext ("","")],
 
1153
                  gt_cv_func_dgettext_libc=yes,
 
1154
                  gt_cv_func_dgettext_libc=no)
 
1155
                ])
 
1156
      fi
 
1157
  
 
1158
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
 
1159
        AC_CHECK_FUNCS(bind_textdomain_codeset)
 
1160
      fi
 
1161
 
 
1162
      #
 
1163
      # If we don't have everything we want, check in libintl
 
1164
      #
 
1165
      if test "$gt_cv_func_dgettext_libc" != "yes" \
 
1166
         || test "$gt_cv_func_ngettext_libc" != "yes" \
 
1167
         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
 
1168
        
 
1169
        AC_CHECK_LIB(intl, bindtextdomain,
 
1170
            [AC_CHECK_LIB(intl, ngettext,
 
1171
                    [AC_CHECK_LIB(intl, dgettext,
 
1172
                                  gt_cv_func_dgettext_libintl=yes)])])
 
1173
 
 
1174
        if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
 
1175
          AC_MSG_CHECKING([if -liconv is needed to use gettext])
 
1176
          AC_MSG_RESULT([])
 
1177
          AC_CHECK_LIB(intl, ngettext,
 
1178
                [AC_CHECK_LIB(intl, dcgettext,
 
1179
                       [gt_cv_func_dgettext_libintl=yes
 
1180
                        libintl_extra_libs=-liconv],
 
1181
                        :,-liconv)],
 
1182
                :,-liconv)
 
1183
        fi
 
1184
 
 
1185
        #
 
1186
        # If we found libintl, then check in it for bind_textdomain_codeset();
 
1187
        # we'll prefer libc if neither have bind_textdomain_codeset(),
 
1188
        # and both have dgettext and ngettext
 
1189
        #
 
1190
        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
 
1191
          glib_save_LIBS="$LIBS"
 
1192
          LIBS="$LIBS -lintl $libintl_extra_libs"
 
1193
          unset ac_cv_func_bind_textdomain_codeset
 
1194
          AC_CHECK_FUNCS(bind_textdomain_codeset)
 
1195
          LIBS="$glib_save_LIBS"
 
1196
 
 
1197
          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
 
1198
            gt_cv_func_dgettext_libc=no
 
1199
          else
 
1200
            if test "$gt_cv_func_dgettext_libc" = "yes" \
 
1201
                && test "$gt_cv_func_ngettext_libc" = "yes"; then
 
1202
              gt_cv_func_dgettext_libintl=no
 
1203
            fi
 
1204
          fi
 
1205
        fi
 
1206
      fi
 
1207
 
 
1208
      if test "$gt_cv_func_dgettext_libc" = "yes" \
 
1209
        || test "$gt_cv_func_dgettext_libintl" = "yes"; then
 
1210
        gt_cv_have_gettext=yes
 
1211
      fi
 
1212
  
 
1213
      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
 
1214
        INTLLIBS="-lintl $libintl_extra_libs"
 
1215
      fi
 
1216
  
 
1217
      if test "$gt_cv_have_gettext" = "yes"; then
 
1218
        AC_DEFINE(HAVE_GETTEXT,1,
 
1219
          [Define if the GNU gettext() function is already present or preinstalled.])
 
1220
        GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
1221
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
 
1222
        if test "$MSGFMT" != "no"; then
 
1223
          glib_save_LIBS="$LIBS"
 
1224
          LIBS="$LIBS $INTLLIBS"
 
1225
          AC_CHECK_FUNCS(dcgettext)
 
1226
          MSGFMT_OPTS=
 
1227
          AC_MSG_CHECKING([if msgfmt accepts -c])
 
1228
          GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
 
1229
msgid ""
 
1230
msgstr ""
 
1231
"Content-Type: text/plain; charset=UTF-8\n"
 
1232
"Project-Id-Version: test 1.0\n"
 
1233
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
 
1234
"Last-Translator: test <foo@bar.xx>\n"
 
1235
"Language-Team: C <LL@li.org>\n"
 
1236
"MIME-Version: 1.0\n"
 
1237
"Content-Transfer-Encoding: 8bit\n"
 
1238
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
 
1239
          AC_SUBST(MSGFMT_OPTS)
 
1240
          AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
1241
          GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
1242
            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 
1243
          AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
 
1244
                         return _nl_msg_cat_cntr],
 
1245
            [CATOBJEXT=.gmo 
 
1246
             DATADIRNAME=share],
 
1247
            [case $host in
 
1248
            *-*-solaris*)
 
1249
            dnl On Solaris, if bind_textdomain_codeset is in libc,
 
1250
            dnl GNU format message catalog is always supported,
 
1251
            dnl since both are added to the libc all together.
 
1252
            dnl Hence, we'd like to go with DATADIRNAME=share and
 
1253
            dnl and CATOBJEXT=.gmo in this case.
 
1254
            AC_CHECK_FUNC(bind_textdomain_codeset,
 
1255
              [CATOBJEXT=.gmo 
 
1256
               DATADIRNAME=share],
 
1257
              [CATOBJEXT=.mo
 
1258
               DATADIRNAME=lib])
 
1259
            ;;
 
1260
            *)
 
1261
            CATOBJEXT=.mo
 
1262
            DATADIRNAME=lib
 
1263
            ;;
 
1264
            esac])
 
1265
          LIBS="$glib_save_LIBS"
 
1266
          INSTOBJEXT=.mo
 
1267
        else
 
1268
          gt_cv_have_gettext=no
 
1269
        fi
 
1270
      fi
 
1271
    ])
 
1272
 
 
1273
    if test "$gt_cv_have_gettext" = "yes" ; then
 
1274
      AC_DEFINE(ENABLE_NLS, 1,
 
1275
        [always defined to indicate that i18n is enabled])
 
1276
    fi
 
1277
 
 
1278
    dnl Test whether we really found GNU xgettext.
 
1279
    if test "$XGETTEXT" != ":"; then
 
1280
      dnl If it is not GNU xgettext we define it as : so that the
 
1281
      dnl Makefiles still can work.
 
1282
      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
 
1283
        : ;
 
1284
      else
 
1285
        AC_MSG_RESULT(
 
1286
          [found xgettext program is not GNU xgettext; ignore it])
 
1287
        XGETTEXT=":"
 
1288
      fi
 
1289
    fi
 
1290
 
 
1291
    # We need to process the po/ directory.
 
1292
    POSUB=po
 
1293
 
 
1294
    AC_OUTPUT_COMMANDS(
 
1295
      [case "$CONFIG_FILES" in *po/Makefile.in*)
 
1296
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
 
1297
      esac])
 
1298
 
 
1299
    dnl These rules are solely for the distribution goal.  While doing this
 
1300
    dnl we only have to keep exactly one list of the available catalogs
 
1301
    dnl in configure.ac.
 
1302
    for lang in $ALL_LINGUAS; do
 
1303
      GMOFILES="$GMOFILES $lang.gmo"
 
1304
      POFILES="$POFILES $lang.po"
 
1305
    done
 
1306
 
 
1307
    dnl Make all variables we use known to autoconf.
 
1308
    AC_SUBST(CATALOGS)
 
1309
    AC_SUBST(CATOBJEXT)
 
1310
    AC_SUBST(DATADIRNAME)
 
1311
    AC_SUBST(GMOFILES)
 
1312
    AC_SUBST(INSTOBJEXT)
 
1313
    AC_SUBST(INTLLIBS)
 
1314
    AC_SUBST(PO_IN_DATADIR_TRUE)
 
1315
    AC_SUBST(PO_IN_DATADIR_FALSE)
 
1316
    AC_SUBST(POFILES)
 
1317
    AC_SUBST(POSUB)
 
1318
  ])
 
1319
 
 
1320
# AM_GLIB_GNU_GETTEXT
 
1321
# -------------------
 
1322
# Do checks necessary for use of gettext. If a suitable implementation 
 
1323
# of gettext is found in either in libintl or in the C library,
 
1324
# it will set INTLLIBS to the libraries needed for use of gettext
 
1325
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
 
1326
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
 
1327
# on various variables needed by the Makefile.in.in installed by 
 
1328
# glib-gettextize.
 
1329
dnl
 
1330
glib_DEFUN([GLIB_GNU_GETTEXT],
 
1331
  [AC_REQUIRE([AC_PROG_CC])dnl
 
1332
   AC_REQUIRE([AC_HEADER_STDC])dnl
 
1333
   
 
1334
   GLIB_LC_MESSAGES
 
1335
   GLIB_WITH_NLS
 
1336
 
 
1337
   if test "$gt_cv_have_gettext" = "yes"; then
 
1338
     if test "x$ALL_LINGUAS" = "x"; then
 
1339
       LINGUAS=
 
1340
     else
 
1341
       AC_MSG_CHECKING(for catalogs to be installed)
 
1342
       NEW_LINGUAS=
 
1343
       for presentlang in $ALL_LINGUAS; do
 
1344
         useit=no
 
1345
         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
 
1346
           desiredlanguages="$LINGUAS"
 
1347
         else
 
1348
           desiredlanguages="$ALL_LINGUAS"
 
1349
         fi
 
1350
         for desiredlang in $desiredlanguages; do
 
1351
           # Use the presentlang catalog if desiredlang is
 
1352
           #   a. equal to presentlang, or
 
1353
           #   b. a variant of presentlang (because in this case,
 
1354
           #      presentlang can be used as a fallback for messages
 
1355
           #      which are not translated in the desiredlang catalog).
 
1356
           case "$desiredlang" in
 
1357
             "$presentlang"*) useit=yes;;
 
1358
           esac
 
1359
         done
 
1360
         if test $useit = yes; then
 
1361
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
 
1362
         fi
 
1363
       done
 
1364
       LINGUAS=$NEW_LINGUAS
 
1365
       AC_MSG_RESULT($LINGUAS)
 
1366
     fi
 
1367
 
 
1368
     dnl Construct list of names of catalog files to be constructed.
 
1369
     if test -n "$LINGUAS"; then
 
1370
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
 
1371
     fi
 
1372
   fi
 
1373
 
 
1374
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
 
1375
   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
 
1376
   dnl Try to locate is.
 
1377
   MKINSTALLDIRS=
 
1378
   if test -n "$ac_aux_dir"; then
 
1379
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
 
1380
   fi
 
1381
   if test -z "$MKINSTALLDIRS"; then
 
1382
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
 
1383
   fi
 
1384
   AC_SUBST(MKINSTALLDIRS)
 
1385
 
 
1386
   dnl Generate list of files to be processed by xgettext which will
 
1387
   dnl be included in po/Makefile.
 
1388
   test -d po || mkdir po
 
1389
   if test "x$srcdir" != "x."; then
 
1390
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
 
1391
       posrcprefix="$srcdir/"
 
1392
     else
 
1393
       posrcprefix="../$srcdir/"
 
1394
     fi
 
1395
   else
 
1396
     posrcprefix="../"
 
1397
   fi
 
1398
   rm -f po/POTFILES
 
1399
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
 
1400
        < $srcdir/po/POTFILES.in > po/POTFILES
 
1401
  ])
 
1402
 
 
1403
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
 
1404
# -------------------------------
 
1405
# Define VARIABLE to the location where catalog files will
 
1406
# be installed by po/Makefile.
 
1407
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
 
1408
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
 
1409
glib_save_prefix="$prefix"
 
1410
glib_save_exec_prefix="$exec_prefix"
 
1411
glib_save_datarootdir="$datarootdir"
 
1412
test "x$prefix" = xNONE && prefix=$ac_default_prefix
 
1413
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
 
1414
datarootdir=`eval echo "${datarootdir}"`
 
1415
if test "x$CATOBJEXT" = "x.mo" ; then
 
1416
  localedir=`eval echo "${libdir}/locale"`
 
1417
else
 
1418
  localedir=`eval echo "${datadir}/locale"`
 
1419
fi
 
1420
prefix="$glib_save_prefix"
 
1421
exec_prefix="$glib_save_exec_prefix"
 
1422
datarootdir="$glib_save_datarootdir"
 
1423
AC_DEFINE_UNQUOTED($1, "$localedir",
 
1424
  [Define the location where the catalogs will be installed])
 
1425
])
 
1426
 
 
1427
dnl
 
1428
dnl Now the definitions that aclocal will find
 
1429
dnl
 
1430
ifdef(glib_configure_ac,[],[
 
1431
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
 
1432
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
 
1433
])dnl
 
1434
 
 
1435
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
 
1436
 
1437
# Create a temporary file with TEST-FILE as its contents and pass the
 
1438
# file name to PROGRAM.  Perform ACTION-IF-PASS if PROGRAM exits with
 
1439
# 0 and perform ACTION-IF-FAIL for any other exit status.
 
1440
AC_DEFUN([GLIB_RUN_PROG],
 
1441
[cat >conftest.foo <<_ACEOF
 
1442
$2
 
1443
_ACEOF
 
1444
if AC_RUN_LOG([$1 conftest.foo]); then
 
1445
  m4_ifval([$3], [$3], [:])
 
1446
m4_ifvaln([$4], [else $4])dnl
 
1447
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
 
1448
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
 
1449
fi])
 
1450
 
 
1451
 
 
1452
dnl GLIB_GSETTINGS
 
1453
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
 
1454
dnl the schema should be compiled
 
1455
dnl
 
1456
 
 
1457
AC_DEFUN([GLIB_GSETTINGS],
 
1458
[
 
1459
  m4_pattern_allow([AM_V_GEN])
 
1460
  AC_ARG_ENABLE(schemas-compile,
 
1461
                AC_HELP_STRING([--disable-schemas-compile],
 
1462
                               [Disable regeneration of gschemas.compiled on install]),
 
1463
                [case ${enableval} in
 
1464
                  yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE=""  ;;
 
1465
                  no)  GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
 
1466
                  *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
 
1467
                 esac])
 
1468
  AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
 
1469
  PKG_PROG_PKG_CONFIG([0.16])
 
1470
  AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
 
1471
  if test x$cross_compiling != xyes; then
 
1472
    GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
 
1473
  else
 
1474
    AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
 
1475
  fi
 
1476
  AC_SUBST(GLIB_COMPILE_SCHEMAS)
 
1477
  if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
 
1478
    ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
 
1479
  else
 
1480
    ifelse([$1],,[:],[$1])
 
1481
  fi
 
1482
 
 
1483
  GSETTINGS_RULES='
 
1484
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
 
1485
 
 
1486
mostlyclean-am: clean-gsettings-schemas
 
1487
 
 
1488
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
 
1489
 
 
1490
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
 
1491
        $(AM_V_GEN) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${d}$< && touch [$]@
 
1492
 
 
1493
all-am: $(gsettings_SCHEMAS:.xml=.valid)
 
1494
uninstall-am: uninstall-gsettings-schemas
 
1495
install-data-am: install-gsettings-schemas
 
1496
 
 
1497
.SECONDARY: $(gsettings_SCHEMAS)
 
1498
 
 
1499
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
 
1500
        @$(NORMAL_INSTALL)
 
1501
        if test -n "$^"; then \
 
1502
                test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
 
1503
                $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
 
1504
                test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
 
1505
        fi
 
1506
 
 
1507
uninstall-gsettings-schemas:
 
1508
        @$(NORMAL_UNINSTALL)
 
1509
        @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
 
1510
        files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
 
1511
        test -n "$$files" || exit 0; \
 
1512
        echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
 
1513
        cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
 
1514
        test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
 
1515
 
 
1516
clean-gsettings-schemas:
 
1517
        rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
 
1518
 
 
1519
ifdef gsettings_ENUM_NAMESPACE
 
1520
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
 
1521
        $(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead "  <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod "    <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail "  </@type@>" --ftail "</schemalist>" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@
 
1522
endif
 
1523
'
 
1524
  _GSETTINGS_SUBST(GSETTINGS_RULES)
 
1525
])
 
1526
 
 
1527
dnl _GSETTINGS_SUBST(VARIABLE)
 
1528
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
 
1529
AC_DEFUN([_GSETTINGS_SUBST],
 
1530
[
 
1531
AC_SUBST([$1])
 
1532
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
 
1533
]
 
1534
)
 
1535
 
 
1536
# nls.m4 serial 5 (gettext-0.18)
 
1537
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
 
1538
dnl Inc.
 
1539
dnl This file is free software; the Free Software Foundation
 
1540
dnl gives unlimited permission to copy and/or distribute it,
 
1541
dnl with or without modifications, as long as this notice is preserved.
 
1542
dnl
 
1543
dnl This file can can be used in projects which are not available under
 
1544
dnl the GNU General Public License or the GNU Library General Public
 
1545
dnl License but which still want to provide support for the GNU gettext
 
1546
dnl functionality.
 
1547
dnl Please note that the actual code of the GNU gettext library is covered
 
1548
dnl by the GNU Library General Public License, and the rest of the GNU
 
1549
dnl gettext package package is covered by the GNU General Public License.
 
1550
dnl They are *not* in the public domain.
 
1551
 
 
1552
dnl Authors:
 
1553
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
1554
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
1555
 
 
1556
AC_PREREQ([2.50])
 
1557
 
 
1558
AC_DEFUN([AM_NLS],
 
1559
[
 
1560
  AC_MSG_CHECKING([whether NLS is requested])
 
1561
  dnl Default is enabled NLS
 
1562
  AC_ARG_ENABLE([nls],
 
1563
    [  --disable-nls           do not use Native Language Support],
 
1564
    USE_NLS=$enableval, USE_NLS=yes)
 
1565
  AC_MSG_RESULT([$USE_NLS])
 
1566
  AC_SUBST([USE_NLS])
 
1567
])
 
1568
 
 
1569
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
1570
# serial 1 (pkg-config-0.24)
 
1571
 
1572
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
 
1573
#
 
1574
# This program is free software; you can redistribute it and/or modify
 
1575
# it under the terms of the GNU General Public License as published by
 
1576
# the Free Software Foundation; either version 2 of the License, or
 
1577
# (at your option) any later version.
 
1578
#
 
1579
# This program is distributed in the hope that it will be useful, but
 
1580
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
1581
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
1582
# General Public License for more details.
 
1583
#
 
1584
# You should have received a copy of the GNU General Public License
 
1585
# along with this program; if not, write to the Free Software
 
1586
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
1587
#
 
1588
# As a special exception to the GNU General Public License, if you
 
1589
# distribute this file as part of a program that contains a
 
1590
# configuration script generated by Autoconf, you may include it under
 
1591
# the same distribution terms that you use for the rest of that program.
 
1592
 
 
1593
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
 
1594
# ----------------------------------
 
1595
AC_DEFUN([PKG_PROG_PKG_CONFIG],
 
1596
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 
1597
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
 
1598
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 
1599
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 
1600
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
 
1601
 
 
1602
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 
1603
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 
1604
fi
 
1605
if test -n "$PKG_CONFIG"; then
 
1606
        _pkg_min_version=m4_default([$1], [0.9.0])
 
1607
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
 
1608
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 
1609
                AC_MSG_RESULT([yes])
 
1610
        else
 
1611
                AC_MSG_RESULT([no])
 
1612
                PKG_CONFIG=""
 
1613
        fi
 
1614
fi[]dnl
 
1615
])# PKG_PROG_PKG_CONFIG
 
1616
 
 
1617
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
1618
#
 
1619
# Check to see whether a particular set of modules exists.  Similar
 
1620
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
 
1621
#
 
1622
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1623
# only at the first occurence in configure.ac, so if the first place
 
1624
# it's called might be skipped (such as if it is within an "if", you
 
1625
# have to call PKG_CHECK_EXISTS manually
 
1626
# --------------------------------------------------------------
 
1627
AC_DEFUN([PKG_CHECK_EXISTS],
 
1628
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
1629
if test -n "$PKG_CONFIG" && \
 
1630
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
 
1631
  m4_default([$2], [:])
 
1632
m4_ifvaln([$3], [else
 
1633
  $3])dnl
 
1634
fi])
 
1635
 
 
1636
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 
1637
# ---------------------------------------------
 
1638
m4_define([_PKG_CONFIG],
 
1639
[if test -n "$$1"; then
 
1640
    pkg_cv_[]$1="$$1"
 
1641
 elif test -n "$PKG_CONFIG"; then
 
1642
    PKG_CHECK_EXISTS([$3],
 
1643
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 
1644
                     [pkg_failed=yes])
 
1645
 else
 
1646
    pkg_failed=untried
 
1647
fi[]dnl
 
1648
])# _PKG_CONFIG
 
1649
 
 
1650
# _PKG_SHORT_ERRORS_SUPPORTED
 
1651
# -----------------------------
 
1652
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 
1653
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1654
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 
1655
        _pkg_short_errors_supported=yes
 
1656
else
 
1657
        _pkg_short_errors_supported=no
 
1658
fi[]dnl
 
1659
])# _PKG_SHORT_ERRORS_SUPPORTED
 
1660
 
 
1661
 
 
1662
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 
1663
# [ACTION-IF-NOT-FOUND])
 
1664
#
 
1665
#
 
1666
# Note that if there is a possibility the first call to
 
1667
# PKG_CHECK_MODULES might not happen, you should be sure to include an
 
1668
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 
1669
#
 
1670
#
 
1671
# --------------------------------------------------------------
 
1672
AC_DEFUN([PKG_CHECK_MODULES],
 
1673
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
1674
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 
1675
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
1676
 
 
1677
pkg_failed=no
 
1678
AC_MSG_CHECKING([for $1])
 
1679
 
 
1680
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 
1681
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
1682
 
 
1683
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 
1684
and $1[]_LIBS to avoid the need to call pkg-config.
 
1685
See the pkg-config man page for more details.])
 
1686
 
 
1687
if test $pkg_failed = yes; then
 
1688
        AC_MSG_RESULT([no])
 
1689
        _PKG_SHORT_ERRORS_SUPPORTED
 
1690
        if test $_pkg_short_errors_supported = yes; then
 
1691
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
 
1692
        else 
 
1693
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
 
1694
        fi
 
1695
        # Put the nasty error message in config.log where it belongs
 
1696
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
1697
 
 
1698
        m4_default([$4], [AC_MSG_ERROR(
 
1699
[Package requirements ($2) were not met:
 
1700
 
 
1701
$$1_PKG_ERRORS
 
1702
 
 
1703
Consider adjusting the PKG_CONFIG_PATH environment variable if you
 
1704
installed software in a non-standard prefix.
 
1705
 
 
1706
_PKG_TEXT])dnl
 
1707
        ])
 
1708
elif test $pkg_failed = untried; then
 
1709
        AC_MSG_RESULT([no])
 
1710
        m4_default([$4], [AC_MSG_FAILURE(
 
1711
[The pkg-config script could not be found or is too old.  Make sure it
 
1712
is in your PATH or set the PKG_CONFIG environment variable to the full
 
1713
path to pkg-config.
 
1714
 
 
1715
_PKG_TEXT
 
1716
 
 
1717
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
 
1718
        ])
 
1719
else
 
1720
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 
1721
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 
1722
        AC_MSG_RESULT([yes])
 
1723
        $3
 
1724
fi[]dnl
 
1725
])# PKG_CHECK_MODULES
 
1726
 
1727
1727
m4_include([m4/intltool.m4])