~ubuntu-branches/ubuntu/raring/rygel/raring

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson
  • Date: 2012-09-26 22:34:15 UTC
  • mfrom: (1.3.2)
  • mto: (14.1.10 sid)
  • mto: This revision was merged to the branch mainline in revision 27.
  • Revision ID: package-import@ubuntu.com-20120926223415-mem27auv86jjrj9k
ImportedĀ UpstreamĀ versionĀ 0.16.0

Show diffs side-by-side

added added

removed removed

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