~ubuntu-branches/ubuntu/raring/gupnp-tools/raring

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson
  • Date: 2013-01-28 23:34:47 UTC
  • mfrom: (1.1.9) (2.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20130128233447-kmbqad0odeox5xdw
Tags: 0.8.5-1
* Bump to debhelper compatibility level 9
* Imported Upstream version 0.8.5
* Bump standards version to 3.9.4
* debian/rules: add list-missing to spot missed files

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
 
1
# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
2
2
 
3
3
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4
 
# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 
4
# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
 
5
# Inc.
5
6
# This file is free software; the Free Software Foundation
6
7
# gives unlimited permission to copy and/or distribute it,
7
8
# with or without modifications, as long as this notice is preserved.
19
20
If you have problems, you may need to regenerate the build system entirely.
20
21
To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
22
 
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
 
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
456
 
# serial 1 (pkg-config-0.24)
457
 
458
 
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
459
 
#
460
 
# This program is free software; you can redistribute it and/or modify
461
 
# it under the terms of the GNU General Public License as published by
462
 
# the Free Software Foundation; either version 2 of the License, or
463
 
# (at your option) any later version.
464
 
#
465
 
# This program is distributed in the hope that it will be useful, but
466
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
467
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
468
 
# General Public License for more details.
469
 
#
470
 
# You should have received a copy of the GNU General Public License
471
 
# along with this program; if not, write to the Free Software
472
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
473
 
#
474
 
# As a special exception to the GNU General Public License, if you
475
 
# distribute this file as part of a program that contains a
476
 
# configuration script generated by Autoconf, you may include it under
477
 
# the same distribution terms that you use for the rest of that program.
478
 
 
479
 
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
480
 
# ----------------------------------
481
 
AC_DEFUN([PKG_PROG_PKG_CONFIG],
482
 
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
483
 
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
484
 
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
485
 
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
486
 
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
487
 
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
488
 
 
489
 
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
490
 
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
491
 
fi
492
 
if test -n "$PKG_CONFIG"; then
493
 
        _pkg_min_version=m4_default([$1], [0.9.0])
494
 
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
495
 
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
496
 
                AC_MSG_RESULT([yes])
497
 
        else
498
 
                AC_MSG_RESULT([no])
499
 
                PKG_CONFIG=""
500
 
        fi
501
 
fi[]dnl
502
 
])# PKG_PROG_PKG_CONFIG
503
 
 
504
 
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
505
 
#
506
 
# Check to see whether a particular set of modules exists.  Similar
507
 
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
508
 
#
509
 
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
510
 
# only at the first occurence in configure.ac, so if the first place
511
 
# it's called might be skipped (such as if it is within an "if", you
512
 
# have to call PKG_CHECK_EXISTS manually
513
 
# --------------------------------------------------------------
514
 
AC_DEFUN([PKG_CHECK_EXISTS],
515
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
516
 
if test -n "$PKG_CONFIG" && \
517
 
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
518
 
  m4_default([$2], [:])
519
 
m4_ifvaln([$3], [else
520
 
  $3])dnl
521
 
fi])
522
 
 
523
 
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
524
 
# ---------------------------------------------
525
 
m4_define([_PKG_CONFIG],
526
 
[if test -n "$$1"; then
527
 
    pkg_cv_[]$1="$$1"
528
 
 elif test -n "$PKG_CONFIG"; then
529
 
    PKG_CHECK_EXISTS([$3],
530
 
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
531
 
                      test "x$?" != "x0" && pkg_failed=yes ],
532
 
                     [pkg_failed=yes])
533
 
 else
534
 
    pkg_failed=untried
535
 
fi[]dnl
536
 
])# _PKG_CONFIG
537
 
 
538
 
# _PKG_SHORT_ERRORS_SUPPORTED
539
 
# -----------------------------
540
 
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
541
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
542
 
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
543
 
        _pkg_short_errors_supported=yes
544
 
else
545
 
        _pkg_short_errors_supported=no
546
 
fi[]dnl
547
 
])# _PKG_SHORT_ERRORS_SUPPORTED
548
 
 
549
 
 
550
 
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
551
 
# [ACTION-IF-NOT-FOUND])
552
 
#
553
 
#
554
 
# Note that if there is a possibility the first call to
555
 
# PKG_CHECK_MODULES might not happen, you should be sure to include an
556
 
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
557
 
#
558
 
#
559
 
# --------------------------------------------------------------
560
 
AC_DEFUN([PKG_CHECK_MODULES],
561
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
562
 
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
563
 
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
564
 
 
565
 
pkg_failed=no
566
 
AC_MSG_CHECKING([for $1])
567
 
 
568
 
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
569
 
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
570
 
 
571
 
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
572
 
and $1[]_LIBS to avoid the need to call pkg-config.
573
 
See the pkg-config man page for more details.])
574
 
 
575
 
if test $pkg_failed = yes; then
576
 
        AC_MSG_RESULT([no])
577
 
        _PKG_SHORT_ERRORS_SUPPORTED
578
 
        if test $_pkg_short_errors_supported = yes; then
579
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
580
 
        else 
581
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
582
 
        fi
583
 
        # Put the nasty error message in config.log where it belongs
584
 
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
585
 
 
586
 
        m4_default([$4], [AC_MSG_ERROR(
587
 
[Package requirements ($2) were not met:
588
 
 
589
 
$$1_PKG_ERRORS
590
 
 
591
 
Consider adjusting the PKG_CONFIG_PATH environment variable if you
592
 
installed software in a non-standard prefix.
593
 
 
594
 
_PKG_TEXT])[]dnl
595
 
        ])
596
 
elif test $pkg_failed = untried; then
597
 
        AC_MSG_RESULT([no])
598
 
        m4_default([$4], [AC_MSG_FAILURE(
599
 
[The pkg-config script could not be found or is too old.  Make sure it
600
 
is in your PATH or set the PKG_CONFIG environment variable to the full
601
 
path to pkg-config.
602
 
 
603
 
_PKG_TEXT
604
 
 
605
 
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
606
 
        ])
607
 
else
608
 
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
609
 
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
610
 
        AC_MSG_RESULT([yes])
611
 
        $3
612
 
fi[]dnl
613
 
])# PKG_CHECK_MODULES
614
 
 
615
 
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 
23
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
 
24
# Foundation, Inc.
616
25
#
617
26
# This file is free software; the Free Software Foundation
618
27
# gives unlimited permission to copy and/or distribute it,
619
28
# with or without modifications, as long as this notice is preserved.
620
29
 
 
30
# serial 1
 
31
 
621
32
# AM_AUTOMAKE_VERSION(VERSION)
622
33
# ----------------------------
623
34
# Automake X.Y traces this macro to ensure aclocal.m4 has been
627
38
[am__api_version='1.11'
628
39
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
629
40
dnl require some minimum version.  Point them to the right macro.
630
 
m4_if([$1], [1.11.1], [],
 
41
m4_if([$1], [1.11.3], [],
631
42
      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
632
43
])
633
44
 
643
54
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
644
55
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
645
56
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
646
 
[AM_AUTOMAKE_VERSION([1.11.1])dnl
 
57
[AM_AUTOMAKE_VERSION([1.11.3])dnl
647
58
m4_ifndef([AC_AUTOCONF_VERSION],
648
59
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
649
60
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
650
61
 
651
62
# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
652
63
 
653
 
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
64
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
654
65
#
655
66
# This file is free software; the Free Software Foundation
656
67
# gives unlimited permission to copy and/or distribute it,
657
68
# with or without modifications, as long as this notice is preserved.
658
69
 
 
70
# serial 1
 
71
 
659
72
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
660
73
# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
661
74
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
737
150
Usually this means the macro was only invoked conditionally.]])
738
151
fi])])
739
152
 
740
 
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
741
 
# Free Software Foundation, Inc.
 
153
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
 
154
# 2010, 2011 Free Software Foundation, Inc.
742
155
#
743
156
# This file is free software; the Free Software Foundation
744
157
# gives unlimited permission to copy and/or distribute it,
745
158
# with or without modifications, as long as this notice is preserved.
746
159
 
747
 
# serial 10
 
160
# serial 12
748
161
 
749
162
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
750
163
# written in clear, in which case automake, when reading aclocal.m4,
784
197
  # instance it was reported that on HP-UX the gcc test will end up
785
198
  # making a dummy file named `D' -- because `-MD' means `put the output
786
199
  # in D'.
 
200
  rm -rf conftest.dir
787
201
  mkdir conftest.dir
788
202
  # Copy depcomp to subdir because otherwise we won't find it if we're
789
203
  # using a relative directory.
848
262
        break
849
263
      fi
850
264
      ;;
851
 
    msvisualcpp | msvcmsys)
 
265
    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
852
266
      # This compiler won't grok `-c -o', but also, the minuso test has
853
267
      # not run yet.  These depmodes are late enough in the game, and
854
268
      # so weak that their functioning should not be impacted.
913
327
if test "x$enable_dependency_tracking" != xno; then
914
328
  am_depcomp="$ac_aux_dir/depcomp"
915
329
  AMDEPBACKSLASH='\'
 
330
  am__nodep='_no'
916
331
fi
917
332
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
918
333
AC_SUBST([AMDEPBACKSLASH])dnl
919
334
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 
335
AC_SUBST([am__nodep])dnl
 
336
_AM_SUBST_NOTMAKE([am__nodep])dnl
920
337
])
921
338
 
922
339
# Generate code to set up dependency tracking.              -*- Autoconf -*-
1138
555
done
1139
556
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1140
557
 
1141
 
# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
 
558
# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
 
559
# Inc.
1142
560
#
1143
561
# This file is free software; the Free Software Foundation
1144
562
# gives unlimited permission to copy and/or distribute it,
1145
563
# with or without modifications, as long as this notice is preserved.
1146
564
 
 
565
# serial 1
 
566
 
1147
567
# AM_PROG_INSTALL_SH
1148
568
# ------------------
1149
569
# Define $install_sh.
1183
603
# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
1184
604
# From Jim Meyering
1185
605
 
1186
 
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1187
 
# Free Software Foundation, Inc.
 
606
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
 
607
# 2011 Free Software Foundation, Inc.
1188
608
#
1189
609
# This file is free software; the Free Software Foundation
1190
610
# gives unlimited permission to copy and/or distribute it,
1204
624
       [disable], [m4_define([am_maintainer_other], [enable])],
1205
625
       [m4_define([am_maintainer_other], [enable])
1206
626
        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
1207
 
AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
 
627
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1208
628
  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
1209
629
  AC_ARG_ENABLE([maintainer-mode],
1210
630
[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
1315
735
fi
1316
736
])
1317
737
 
1318
 
# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
 
738
# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
 
739
# Inc.
1319
740
#
1320
741
# This file is free software; the Free Software Foundation
1321
742
# gives unlimited permission to copy and/or distribute it,
1322
743
# with or without modifications, as long as this notice is preserved.
1323
744
 
 
745
# serial 1
 
746
 
1324
747
# AM_PROG_MKDIR_P
1325
748
# ---------------
1326
749
# Check for `mkdir -p'.
1343
766
 
1344
767
# Helper functions for option handling.                     -*- Autoconf -*-
1345
768
 
1346
 
# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
 
769
# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
 
770
# Foundation, Inc.
1347
771
#
1348
772
# This file is free software; the Free Software Foundation
1349
773
# gives unlimited permission to copy and/or distribute it,
1350
774
# with or without modifications, as long as this notice is preserved.
1351
775
 
1352
 
# serial 4
 
776
# serial 5
1353
777
 
1354
778
# _AM_MANGLE_OPTION(NAME)
1355
779
# -----------------------
1357
781
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1358
782
 
1359
783
# _AM_SET_OPTION(NAME)
1360
 
# ------------------------------
 
784
# --------------------
1361
785
# Set option NAME.  Presently that only means defining a flag for this option.
1362
786
AC_DEFUN([_AM_SET_OPTION],
1363
787
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1364
788
 
1365
789
# _AM_SET_OPTIONS(OPTIONS)
1366
 
# ----------------------------------
 
790
# ------------------------
1367
791
# OPTIONS is a space-separated list of Automake options.
1368
792
AC_DEFUN([_AM_SET_OPTIONS],
1369
793
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1374
798
AC_DEFUN([_AM_IF_OPTION],
1375
799
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1376
800
 
1377
 
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
801
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
1378
802
#
1379
803
# This file is free software; the Free Software Foundation
1380
804
# gives unlimited permission to copy and/or distribute it,
1381
805
# with or without modifications, as long as this notice is preserved.
1382
806
 
 
807
# serial 1
 
808
 
1383
809
# AM_RUN_LOG(COMMAND)
1384
810
# -------------------
1385
811
# Run COMMAND, save the exit status in ac_status, and log it.
1456
882
fi
1457
883
AC_MSG_RESULT(yes)])
1458
884
 
1459
 
# Copyright (C) 2009  Free Software Foundation, Inc.
 
885
# Copyright (C) 2009, 2011  Free Software Foundation, Inc.
1460
886
#
1461
887
# This file is free software; the Free Software Foundation
1462
888
# gives unlimited permission to copy and/or distribute it,
1463
889
# with or without modifications, as long as this notice is preserved.
1464
890
 
1465
 
# serial 1
 
891
# serial 2
1466
892
 
1467
893
# AM_SILENT_RULES([DEFAULT])
1468
894
# --------------------------
1477
903
no)  AM_DEFAULT_VERBOSITY=1;;
1478
904
*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1479
905
esac
 
906
dnl
 
907
dnl A few `make' implementations (e.g., NonStop OS and NextStep)
 
908
dnl do not support nested variable expansions.
 
909
dnl See automake bug#9928 and bug#10237.
 
910
am_make=${MAKE-make}
 
911
AC_CACHE_CHECK([whether $am_make supports nested variables],
 
912
   [am_cv_make_support_nested_variables],
 
913
   [if AS_ECHO([['TRUE=$(BAR$(V))
 
914
BAR0=false
 
915
BAR1=true
 
916
V=1
 
917
am__doit:
 
918
        @$(TRUE)
 
919
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
 
920
  am_cv_make_support_nested_variables=yes
 
921
else
 
922
  am_cv_make_support_nested_variables=no
 
923
fi])
 
924
if test $am_cv_make_support_nested_variables = yes; then
 
925
  dnl Using `$V' instead of `$(V)' breaks IRIX make.
 
926
  AM_V='$(V)'
 
927
  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
 
928
else
 
929
  AM_V=$AM_DEFAULT_VERBOSITY
 
930
  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
 
931
fi
 
932
AC_SUBST([AM_V])dnl
 
933
AM_SUBST_NOTMAKE([AM_V])dnl
 
934
AC_SUBST([AM_DEFAULT_V])dnl
 
935
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1480
936
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1481
937
AM_BACKSLASH='\'
1482
938
AC_SUBST([AM_BACKSLASH])dnl
1483
939
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1484
940
])
1485
941
 
1486
 
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
942
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
1487
943
#
1488
944
# This file is free software; the Free Software Foundation
1489
945
# gives unlimited permission to copy and/or distribute it,
1490
946
# with or without modifications, as long as this notice is preserved.
1491
947
 
 
948
# serial 1
 
949
 
1492
950
# AM_PROG_INSTALL_STRIP
1493
951
# ---------------------
1494
952
# One issue with vendor `install' (even GNU) is that you can't
1511
969
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1512
970
AC_SUBST([INSTALL_STRIP_PROGRAM])])
1513
971
 
1514
 
# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
 
972
# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
1515
973
#
1516
974
# This file is free software; the Free Software Foundation
1517
975
# gives unlimited permission to copy and/or distribute it,
1518
976
# with or without modifications, as long as this notice is preserved.
1519
977
 
1520
 
# serial 2
 
978
# serial 3
1521
979
 
1522
980
# _AM_SUBST_NOTMAKE(VARIABLE)
1523
981
# ---------------------------
1526
984
AC_DEFUN([_AM_SUBST_NOTMAKE])
1527
985
 
1528
986
# AM_SUBST_NOTMAKE(VARIABLE)
1529
 
# ---------------------------
 
987
# --------------------------
1530
988
# Public sister of _AM_SUBST_NOTMAKE.
1531
989
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1532
990
 
1533
991
# Check how to create a tarball.                            -*- Autoconf -*-
1534
992
 
1535
 
# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
 
993
# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
1536
994
#
1537
995
# This file is free software; the Free Software Foundation
1538
996
# gives unlimited permission to copy and/or distribute it,
1554
1012
# a tarball read from stdin.
1555
1013
#     $(am__untar) < result.tar
1556
1014
AC_DEFUN([_AM_PROG_TAR],
1557
 
[# Always define AMTAR for backward compatibility.
1558
 
AM_MISSING_PROG([AMTAR], [tar])
 
1015
[# Always define AMTAR for backward compatibility.  Yes, it's still used
 
1016
# in the wild :-(  We should find a proper way to deprecate it ...
 
1017
AC_SUBST([AMTAR], ['$${TAR-tar}'])
1559
1018
m4_if([$1], [v7],
1560
 
     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
 
1019
     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1561
1020
     [m4_case([$1], [ustar],, [pax],,
1562
1021
              [m4_fatal([Unknown tar format])])
1563
1022
AC_MSG_CHECKING([how to create a $1 tar archive])
1626
1085
AC_SUBST([am__untar])
1627
1086
]) # _AM_PROG_TAR
1628
1087
 
 
1088
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
1089
# serial 1 (pkg-config-0.24)
 
1090
 
1091
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
 
1092
#
 
1093
# This program is free software; you can redistribute it and/or modify
 
1094
# it under the terms of the GNU General Public License as published by
 
1095
# the Free Software Foundation; either version 2 of the License, or
 
1096
# (at your option) any later version.
 
1097
#
 
1098
# This program is distributed in the hope that it will be useful, but
 
1099
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
1100
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
1101
# General Public License for more details.
 
1102
#
 
1103
# You should have received a copy of the GNU General Public License
 
1104
# along with this program; if not, write to the Free Software
 
1105
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
1106
#
 
1107
# As a special exception to the GNU General Public License, if you
 
1108
# distribute this file as part of a program that contains a
 
1109
# configuration script generated by Autoconf, you may include it under
 
1110
# the same distribution terms that you use for the rest of that program.
 
1111
 
 
1112
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
 
1113
# ----------------------------------
 
1114
AC_DEFUN([PKG_PROG_PKG_CONFIG],
 
1115
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 
1116
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
 
1117
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
 
1118
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 
1119
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 
1120
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
 
1121
 
 
1122
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 
1123
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 
1124
fi
 
1125
if test -n "$PKG_CONFIG"; then
 
1126
        _pkg_min_version=m4_default([$1], [0.9.0])
 
1127
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
 
1128
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 
1129
                AC_MSG_RESULT([yes])
 
1130
        else
 
1131
                AC_MSG_RESULT([no])
 
1132
                PKG_CONFIG=""
 
1133
        fi
 
1134
fi[]dnl
 
1135
])# PKG_PROG_PKG_CONFIG
 
1136
 
 
1137
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
1138
#
 
1139
# Check to see whether a particular set of modules exists.  Similar
 
1140
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
 
1141
#
 
1142
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1143
# only at the first occurence in configure.ac, so if the first place
 
1144
# it's called might be skipped (such as if it is within an "if", you
 
1145
# have to call PKG_CHECK_EXISTS manually
 
1146
# --------------------------------------------------------------
 
1147
AC_DEFUN([PKG_CHECK_EXISTS],
 
1148
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
1149
if test -n "$PKG_CONFIG" && \
 
1150
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
 
1151
  m4_default([$2], [:])
 
1152
m4_ifvaln([$3], [else
 
1153
  $3])dnl
 
1154
fi])
 
1155
 
 
1156
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 
1157
# ---------------------------------------------
 
1158
m4_define([_PKG_CONFIG],
 
1159
[if test -n "$$1"; then
 
1160
    pkg_cv_[]$1="$$1"
 
1161
 elif test -n "$PKG_CONFIG"; then
 
1162
    PKG_CHECK_EXISTS([$3],
 
1163
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
 
1164
                      test "x$?" != "x0" && pkg_failed=yes ],
 
1165
                     [pkg_failed=yes])
 
1166
 else
 
1167
    pkg_failed=untried
 
1168
fi[]dnl
 
1169
])# _PKG_CONFIG
 
1170
 
 
1171
# _PKG_SHORT_ERRORS_SUPPORTED
 
1172
# -----------------------------
 
1173
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 
1174
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1175
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 
1176
        _pkg_short_errors_supported=yes
 
1177
else
 
1178
        _pkg_short_errors_supported=no
 
1179
fi[]dnl
 
1180
])# _PKG_SHORT_ERRORS_SUPPORTED
 
1181
 
 
1182
 
 
1183
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 
1184
# [ACTION-IF-NOT-FOUND])
 
1185
#
 
1186
#
 
1187
# Note that if there is a possibility the first call to
 
1188
# PKG_CHECK_MODULES might not happen, you should be sure to include an
 
1189
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 
1190
#
 
1191
#
 
1192
# --------------------------------------------------------------
 
1193
AC_DEFUN([PKG_CHECK_MODULES],
 
1194
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
1195
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 
1196
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
1197
 
 
1198
pkg_failed=no
 
1199
AC_MSG_CHECKING([for $1])
 
1200
 
 
1201
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 
1202
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
1203
 
 
1204
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 
1205
and $1[]_LIBS to avoid the need to call pkg-config.
 
1206
See the pkg-config man page for more details.])
 
1207
 
 
1208
if test $pkg_failed = yes; then
 
1209
        AC_MSG_RESULT([no])
 
1210
        _PKG_SHORT_ERRORS_SUPPORTED
 
1211
        if test $_pkg_short_errors_supported = yes; then
 
1212
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
 
1213
        else 
 
1214
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
 
1215
        fi
 
1216
        # Put the nasty error message in config.log where it belongs
 
1217
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
1218
 
 
1219
        m4_default([$4], [AC_MSG_ERROR(
 
1220
[Package requirements ($2) were not met:
 
1221
 
 
1222
$$1_PKG_ERRORS
 
1223
 
 
1224
Consider adjusting the PKG_CONFIG_PATH environment variable if you
 
1225
installed software in a non-standard prefix.
 
1226
 
 
1227
_PKG_TEXT])[]dnl
 
1228
        ])
 
1229
elif test $pkg_failed = untried; then
 
1230
        AC_MSG_RESULT([no])
 
1231
        m4_default([$4], [AC_MSG_FAILURE(
 
1232
[The pkg-config script could not be found or is too old.  Make sure it
 
1233
is in your PATH or set the PKG_CONFIG environment variable to the full
 
1234
path to pkg-config.
 
1235
 
 
1236
_PKG_TEXT
 
1237
 
 
1238
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
 
1239
        ])
 
1240
else
 
1241
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 
1242
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 
1243
        AC_MSG_RESULT([yes])
 
1244
        $3
 
1245
fi[]dnl
 
1246
])# PKG_CHECK_MODULES
 
1247
 
 
1248
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
 
1249
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
 
1250
#
 
1251
# This file is free software, distributed under the terms of the GNU
 
1252
# General Public License.  As a special exception to the GNU General
 
1253
# Public License, this file may be distributed as part of a program
 
1254
# that contains a configuration script generated by Autoconf, under
 
1255
# the same distribution terms as the rest of that program.
 
1256
#
 
1257
# This file can be copied and used freely without restrictions.  It can
 
1258
# be used in projects which are not available under the GNU Public License
 
1259
# but which still want to provide support for the GNU gettext functionality.
 
1260
#
 
1261
# Macro to add for using GNU gettext.
 
1262
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
 
1263
#
 
1264
# Modified to never use included libintl. 
 
1265
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
 
1266
#
 
1267
# Major rework to remove unused code
 
1268
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
 
1269
#
 
1270
# Added better handling of ALL_LINGUAS from GNU gettext version 
 
1271
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
 
1272
#
 
1273
# Modified to require ngettext
 
1274
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
 
1275
#
 
1276
# We need this here as well, since someone might use autoconf-2.5x
 
1277
# to configure GLib then an older version to configure a package
 
1278
# using AM_GLIB_GNU_GETTEXT
 
1279
AC_PREREQ(2.53)
 
1280
 
 
1281
dnl
 
1282
dnl We go to great lengths to make sure that aclocal won't 
 
1283
dnl try to pull in the installed version of these macros
 
1284
dnl when running aclocal in the glib directory.
 
1285
dnl
 
1286
m4_copy([AC_DEFUN],[glib_DEFUN])
 
1287
m4_copy([AC_REQUIRE],[glib_REQUIRE])
 
1288
dnl
 
1289
dnl At the end, if we're not within glib, we'll define the public
 
1290
dnl definitions in terms of our private definitions.
 
1291
dnl
 
1292
 
 
1293
# GLIB_LC_MESSAGES
 
1294
#--------------------
 
1295
glib_DEFUN([GLIB_LC_MESSAGES],
 
1296
  [AC_CHECK_HEADERS([locale.h])
 
1297
    if test $ac_cv_header_locale_h = yes; then
 
1298
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
 
1299
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
 
1300
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
 
1301
    if test $am_cv_val_LC_MESSAGES = yes; then
 
1302
      AC_DEFINE(HAVE_LC_MESSAGES, 1,
 
1303
        [Define if your <locale.h> file defines LC_MESSAGES.])
 
1304
    fi
 
1305
  fi])
 
1306
 
 
1307
# GLIB_PATH_PROG_WITH_TEST
 
1308
#----------------------------
 
1309
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 
1310
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
1311
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
 
1312
[# Extract the first word of "$2", so it can be a program name with args.
 
1313
set dummy $2; ac_word=[$]2
 
1314
AC_MSG_CHECKING([for $ac_word])
 
1315
AC_CACHE_VAL(ac_cv_path_$1,
 
1316
[case "[$]$1" in
 
1317
  /*)
 
1318
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
1319
  ;;
 
1320
  *)
 
1321
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 
1322
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
1323
    test -z "$ac_dir" && ac_dir=.
 
1324
    if test -f $ac_dir/$ac_word; then
 
1325
      if [$3]; then
 
1326
        ac_cv_path_$1="$ac_dir/$ac_word"
 
1327
        break
 
1328
      fi
 
1329
    fi
 
1330
  done
 
1331
  IFS="$ac_save_ifs"
 
1332
dnl If no 4th arg is given, leave the cache variable unset,
 
1333
dnl so AC_PATH_PROGS will keep looking.
 
1334
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
1335
])dnl
 
1336
  ;;
 
1337
esac])dnl
 
1338
$1="$ac_cv_path_$1"
 
1339
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
 
1340
  AC_MSG_RESULT([$]$1)
 
1341
else
 
1342
  AC_MSG_RESULT(no)
 
1343
fi
 
1344
AC_SUBST($1)dnl
 
1345
])
 
1346
 
 
1347
# GLIB_WITH_NLS
 
1348
#-----------------
 
1349
glib_DEFUN([GLIB_WITH_NLS],
 
1350
  dnl NLS is obligatory
 
1351
  [USE_NLS=yes
 
1352
    AC_SUBST(USE_NLS)
 
1353
 
 
1354
    gt_cv_have_gettext=no
 
1355
 
 
1356
    CATOBJEXT=NONE
 
1357
    XGETTEXT=:
 
1358
    INTLLIBS=
 
1359
 
 
1360
    AC_CHECK_HEADER(libintl.h,
 
1361
     [gt_cv_func_dgettext_libintl="no"
 
1362
      libintl_extra_libs=""
 
1363
 
 
1364
      #
 
1365
      # First check in libc
 
1366
      #
 
1367
      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
 
1368
        [AC_TRY_LINK([
 
1369
#include <libintl.h>
 
1370
],
 
1371
         [return !ngettext ("","", 1)],
 
1372
          gt_cv_func_ngettext_libc=yes,
 
1373
          gt_cv_func_ngettext_libc=no)
 
1374
        ])
 
1375
  
 
1376
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
 
1377
              AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
 
1378
                [AC_TRY_LINK([
 
1379
#include <libintl.h>
 
1380
],
 
1381
                  [return !dgettext ("","")],
 
1382
                  gt_cv_func_dgettext_libc=yes,
 
1383
                  gt_cv_func_dgettext_libc=no)
 
1384
                ])
 
1385
      fi
 
1386
  
 
1387
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
 
1388
        AC_CHECK_FUNCS(bind_textdomain_codeset)
 
1389
      fi
 
1390
 
 
1391
      #
 
1392
      # If we don't have everything we want, check in libintl
 
1393
      #
 
1394
      if test "$gt_cv_func_dgettext_libc" != "yes" \
 
1395
         || test "$gt_cv_func_ngettext_libc" != "yes" \
 
1396
         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
 
1397
        
 
1398
        AC_CHECK_LIB(intl, bindtextdomain,
 
1399
            [AC_CHECK_LIB(intl, ngettext,
 
1400
                    [AC_CHECK_LIB(intl, dgettext,
 
1401
                                  gt_cv_func_dgettext_libintl=yes)])])
 
1402
 
 
1403
        if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
 
1404
          AC_MSG_CHECKING([if -liconv is needed to use gettext])
 
1405
          AC_MSG_RESULT([])
 
1406
          AC_CHECK_LIB(intl, ngettext,
 
1407
                [AC_CHECK_LIB(intl, dcgettext,
 
1408
                       [gt_cv_func_dgettext_libintl=yes
 
1409
                        libintl_extra_libs=-liconv],
 
1410
                        :,-liconv)],
 
1411
                :,-liconv)
 
1412
        fi
 
1413
 
 
1414
        #
 
1415
        # If we found libintl, then check in it for bind_textdomain_codeset();
 
1416
        # we'll prefer libc if neither have bind_textdomain_codeset(),
 
1417
        # and both have dgettext and ngettext
 
1418
        #
 
1419
        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
 
1420
          glib_save_LIBS="$LIBS"
 
1421
          LIBS="$LIBS -lintl $libintl_extra_libs"
 
1422
          unset ac_cv_func_bind_textdomain_codeset
 
1423
          AC_CHECK_FUNCS(bind_textdomain_codeset)
 
1424
          LIBS="$glib_save_LIBS"
 
1425
 
 
1426
          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
 
1427
            gt_cv_func_dgettext_libc=no
 
1428
          else
 
1429
            if test "$gt_cv_func_dgettext_libc" = "yes" \
 
1430
                && test "$gt_cv_func_ngettext_libc" = "yes"; then
 
1431
              gt_cv_func_dgettext_libintl=no
 
1432
            fi
 
1433
          fi
 
1434
        fi
 
1435
      fi
 
1436
 
 
1437
      if test "$gt_cv_func_dgettext_libc" = "yes" \
 
1438
        || test "$gt_cv_func_dgettext_libintl" = "yes"; then
 
1439
        gt_cv_have_gettext=yes
 
1440
      fi
 
1441
  
 
1442
      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
 
1443
        INTLLIBS="-lintl $libintl_extra_libs"
 
1444
      fi
 
1445
  
 
1446
      if test "$gt_cv_have_gettext" = "yes"; then
 
1447
        AC_DEFINE(HAVE_GETTEXT,1,
 
1448
          [Define if the GNU gettext() function is already present or preinstalled.])
 
1449
        GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
1450
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
 
1451
        if test "$MSGFMT" != "no"; then
 
1452
          glib_save_LIBS="$LIBS"
 
1453
          LIBS="$LIBS $INTLLIBS"
 
1454
          AC_CHECK_FUNCS(dcgettext)
 
1455
          MSGFMT_OPTS=
 
1456
          AC_MSG_CHECKING([if msgfmt accepts -c])
 
1457
          GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
 
1458
msgid ""
 
1459
msgstr ""
 
1460
"Content-Type: text/plain; charset=UTF-8\n"
 
1461
"Project-Id-Version: test 1.0\n"
 
1462
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
 
1463
"Last-Translator: test <foo@bar.xx>\n"
 
1464
"Language-Team: C <LL@li.org>\n"
 
1465
"MIME-Version: 1.0\n"
 
1466
"Content-Transfer-Encoding: 8bit\n"
 
1467
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
 
1468
          AC_SUBST(MSGFMT_OPTS)
 
1469
          AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
1470
          GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
1471
            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 
1472
          AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
 
1473
                         return _nl_msg_cat_cntr],
 
1474
            [CATOBJEXT=.gmo 
 
1475
             DATADIRNAME=share],
 
1476
            [case $host in
 
1477
            *-*-solaris*)
 
1478
            dnl On Solaris, if bind_textdomain_codeset is in libc,
 
1479
            dnl GNU format message catalog is always supported,
 
1480
            dnl since both are added to the libc all together.
 
1481
            dnl Hence, we'd like to go with DATADIRNAME=share and
 
1482
            dnl and CATOBJEXT=.gmo in this case.
 
1483
            AC_CHECK_FUNC(bind_textdomain_codeset,
 
1484
              [CATOBJEXT=.gmo 
 
1485
               DATADIRNAME=share],
 
1486
              [CATOBJEXT=.mo
 
1487
               DATADIRNAME=lib])
 
1488
            ;;
 
1489
            *-*-openbsd*)
 
1490
            CATOBJEXT=.mo
 
1491
            DATADIRNAME=share
 
1492
            ;;
 
1493
            *)
 
1494
            CATOBJEXT=.mo
 
1495
            DATADIRNAME=lib
 
1496
            ;;
 
1497
            esac])
 
1498
          LIBS="$glib_save_LIBS"
 
1499
          INSTOBJEXT=.mo
 
1500
        else
 
1501
          gt_cv_have_gettext=no
 
1502
        fi
 
1503
      fi
 
1504
    ])
 
1505
 
 
1506
    if test "$gt_cv_have_gettext" = "yes" ; then
 
1507
      AC_DEFINE(ENABLE_NLS, 1,
 
1508
        [always defined to indicate that i18n is enabled])
 
1509
    fi
 
1510
 
 
1511
    dnl Test whether we really found GNU xgettext.
 
1512
    if test "$XGETTEXT" != ":"; then
 
1513
      dnl If it is not GNU xgettext we define it as : so that the
 
1514
      dnl Makefiles still can work.
 
1515
      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
 
1516
        : ;
 
1517
      else
 
1518
        AC_MSG_RESULT(
 
1519
          [found xgettext program is not GNU xgettext; ignore it])
 
1520
        XGETTEXT=":"
 
1521
      fi
 
1522
    fi
 
1523
 
 
1524
    # We need to process the po/ directory.
 
1525
    POSUB=po
 
1526
 
 
1527
    AC_OUTPUT_COMMANDS(
 
1528
      [case "$CONFIG_FILES" in *po/Makefile.in*)
 
1529
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
 
1530
      esac])
 
1531
 
 
1532
    dnl These rules are solely for the distribution goal.  While doing this
 
1533
    dnl we only have to keep exactly one list of the available catalogs
 
1534
    dnl in configure.ac.
 
1535
    for lang in $ALL_LINGUAS; do
 
1536
      GMOFILES="$GMOFILES $lang.gmo"
 
1537
      POFILES="$POFILES $lang.po"
 
1538
    done
 
1539
 
 
1540
    dnl Make all variables we use known to autoconf.
 
1541
    AC_SUBST(CATALOGS)
 
1542
    AC_SUBST(CATOBJEXT)
 
1543
    AC_SUBST(DATADIRNAME)
 
1544
    AC_SUBST(GMOFILES)
 
1545
    AC_SUBST(INSTOBJEXT)
 
1546
    AC_SUBST(INTLLIBS)
 
1547
    AC_SUBST(PO_IN_DATADIR_TRUE)
 
1548
    AC_SUBST(PO_IN_DATADIR_FALSE)
 
1549
    AC_SUBST(POFILES)
 
1550
    AC_SUBST(POSUB)
 
1551
  ])
 
1552
 
 
1553
# AM_GLIB_GNU_GETTEXT
 
1554
# -------------------
 
1555
# Do checks necessary for use of gettext. If a suitable implementation 
 
1556
# of gettext is found in either in libintl or in the C library,
 
1557
# it will set INTLLIBS to the libraries needed for use of gettext
 
1558
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
 
1559
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
 
1560
# on various variables needed by the Makefile.in.in installed by 
 
1561
# glib-gettextize.
 
1562
dnl
 
1563
glib_DEFUN([GLIB_GNU_GETTEXT],
 
1564
  [AC_REQUIRE([AC_PROG_CC])dnl
 
1565
   AC_REQUIRE([AC_HEADER_STDC])dnl
 
1566
   
 
1567
   GLIB_LC_MESSAGES
 
1568
   GLIB_WITH_NLS
 
1569
 
 
1570
   if test "$gt_cv_have_gettext" = "yes"; then
 
1571
     if test "x$ALL_LINGUAS" = "x"; then
 
1572
       LINGUAS=
 
1573
     else
 
1574
       AC_MSG_CHECKING(for catalogs to be installed)
 
1575
       NEW_LINGUAS=
 
1576
       for presentlang in $ALL_LINGUAS; do
 
1577
         useit=no
 
1578
         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
 
1579
           desiredlanguages="$LINGUAS"
 
1580
         else
 
1581
           desiredlanguages="$ALL_LINGUAS"
 
1582
         fi
 
1583
         for desiredlang in $desiredlanguages; do
 
1584
           # Use the presentlang catalog if desiredlang is
 
1585
           #   a. equal to presentlang, or
 
1586
           #   b. a variant of presentlang (because in this case,
 
1587
           #      presentlang can be used as a fallback for messages
 
1588
           #      which are not translated in the desiredlang catalog).
 
1589
           case "$desiredlang" in
 
1590
             "$presentlang"*) useit=yes;;
 
1591
           esac
 
1592
         done
 
1593
         if test $useit = yes; then
 
1594
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
 
1595
         fi
 
1596
       done
 
1597
       LINGUAS=$NEW_LINGUAS
 
1598
       AC_MSG_RESULT($LINGUAS)
 
1599
     fi
 
1600
 
 
1601
     dnl Construct list of names of catalog files to be constructed.
 
1602
     if test -n "$LINGUAS"; then
 
1603
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
 
1604
     fi
 
1605
   fi
 
1606
 
 
1607
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
 
1608
   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
 
1609
   dnl Try to locate is.
 
1610
   MKINSTALLDIRS=
 
1611
   if test -n "$ac_aux_dir"; then
 
1612
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
 
1613
   fi
 
1614
   if test -z "$MKINSTALLDIRS"; then
 
1615
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
 
1616
   fi
 
1617
   AC_SUBST(MKINSTALLDIRS)
 
1618
 
 
1619
   dnl Generate list of files to be processed by xgettext which will
 
1620
   dnl be included in po/Makefile.
 
1621
   test -d po || mkdir po
 
1622
   if test "x$srcdir" != "x."; then
 
1623
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
 
1624
       posrcprefix="$srcdir/"
 
1625
     else
 
1626
       posrcprefix="../$srcdir/"
 
1627
     fi
 
1628
   else
 
1629
     posrcprefix="../"
 
1630
   fi
 
1631
   rm -f po/POTFILES
 
1632
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
 
1633
        < $srcdir/po/POTFILES.in > po/POTFILES
 
1634
  ])
 
1635
 
 
1636
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
 
1637
# -------------------------------
 
1638
# Define VARIABLE to the location where catalog files will
 
1639
# be installed by po/Makefile.
 
1640
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
 
1641
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
 
1642
glib_save_prefix="$prefix"
 
1643
glib_save_exec_prefix="$exec_prefix"
 
1644
glib_save_datarootdir="$datarootdir"
 
1645
test "x$prefix" = xNONE && prefix=$ac_default_prefix
 
1646
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
 
1647
datarootdir=`eval echo "${datarootdir}"`
 
1648
if test "x$CATOBJEXT" = "x.mo" ; then
 
1649
  localedir=`eval echo "${libdir}/locale"`
 
1650
else
 
1651
  localedir=`eval echo "${datadir}/locale"`
 
1652
fi
 
1653
prefix="$glib_save_prefix"
 
1654
exec_prefix="$glib_save_exec_prefix"
 
1655
datarootdir="$glib_save_datarootdir"
 
1656
AC_DEFINE_UNQUOTED($1, "$localedir",
 
1657
  [Define the location where the catalogs will be installed])
 
1658
])
 
1659
 
 
1660
dnl
 
1661
dnl Now the definitions that aclocal will find
 
1662
dnl
 
1663
ifdef(glib_configure_ac,[],[
 
1664
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
 
1665
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
 
1666
])dnl
 
1667
 
 
1668
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
 
1669
 
1670
# Create a temporary file with TEST-FILE as its contents and pass the
 
1671
# file name to PROGRAM.  Perform ACTION-IF-PASS if PROGRAM exits with
 
1672
# 0 and perform ACTION-IF-FAIL for any other exit status.
 
1673
AC_DEFUN([GLIB_RUN_PROG],
 
1674
[cat >conftest.foo <<_ACEOF
 
1675
$2
 
1676
_ACEOF
 
1677
if AC_RUN_LOG([$1 conftest.foo]); then
 
1678
  m4_ifval([$3], [$3], [:])
 
1679
m4_ifvaln([$4], [else $4])dnl
 
1680
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
 
1681
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
 
1682
fi])
 
1683
 
 
1684
 
1629
1685
m4_include([m4/libtool.m4])
1630
1686
m4_include([m4/ltoptions.m4])
1631
1687
m4_include([m4/ltsugar.m4])