~ubuntu-branches/ubuntu/raring/gnome-session/raring

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2012-06-11 12:11:00 UTC
  • mfrom: (1.1.77)
  • Revision ID: package-import@ubuntu.com-20120611121100-4v8ck97j20kykbbp
Tags: 3.5.2-0ubuntu1
* debian/watch: Track unstable versions 
* New upstream release (LP: #1011555).
  + Fail softer in the face of spotty session bus
  + Consider that required component that exits with 1 has crashed
* Refresh patches to apply cleanly 

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) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 
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
# gnome-common.m4
 
461
#
 
462
# serial 3
 
463
 
464
 
 
465
dnl GNOME_COMMON_INIT
 
466
 
 
467
AU_DEFUN([GNOME_COMMON_INIT],
 
468
[
 
469
  dnl this macro should come after AC_CONFIG_MACRO_DIR
 
470
  AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
 
471
 
 
472
  dnl ensure that when the Automake generated makefile calls aclocal,
 
473
  dnl it honours the $ACLOCAL_FLAGS environment variable
 
474
  ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
 
475
  if test -n "$ac_macro_dir"; then
 
476
    ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
 
477
  fi
 
478
 
 
479
  AC_SUBST([ACLOCAL_AMFLAGS])
 
480
],
 
481
[[$0: This macro is deprecated. You should set put "ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}"
 
482
in your top-level Makefile.am, instead, where "m4" is the macro directory set
 
483
with AC_CONFIG_MACRO_DIR() in your configure.ac]])
 
484
 
 
485
AC_DEFUN([GNOME_DEBUG_CHECK],
 
486
[
 
487
        AC_ARG_ENABLE([debug],
 
488
                      AC_HELP_STRING([--enable-debug],
 
489
                                     [turn on debugging]),,
 
490
                      [enable_debug=no])
 
491
 
 
492
        if test x$enable_debug = xyes ; then
 
493
            AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
 
494
                [Enable additional debugging at the expense of performance and size])
 
495
        fi
 
496
])
 
497
 
 
498
dnl GNOME_MAINTAINER_MODE_DEFINES ()
 
499
dnl define DISABLE_DEPRECATED
 
500
dnl
 
501
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
 
502
[
 
503
        AC_REQUIRE([AM_MAINTAINER_MODE])
 
504
 
 
505
        DISABLE_DEPRECATED=""
 
506
        if test $USE_MAINTAINER_MODE = yes; then
 
507
                DOMAINS="GCONF BONOBO BONOBO_UI GNOME LIBGLADE GNOME_VFS WNCK LIBSOUP"
 
508
                for DOMAIN in $DOMAINS; do
 
509
                       DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
 
510
                done
 
511
        fi
 
512
 
 
513
        AC_SUBST(DISABLE_DEPRECATED)
 
514
])
 
515
 
 
516
dnl GNOME_COMPILE_WARNINGS
 
517
dnl Turn on many useful compiler warnings
 
518
dnl For now, only works on GCC
 
519
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
 
520
    dnl ******************************
 
521
    dnl More compiler warnings
 
522
    dnl ******************************
 
523
 
 
524
    AC_ARG_ENABLE(compile-warnings, 
 
525
                  AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
 
526
                                 [Turn on compiler warnings]),,
 
527
                  [enable_compile_warnings="m4_default([$1],[yes])"])
 
528
 
 
529
    warnCFLAGS=
 
530
    if test "x$GCC" != xyes; then
 
531
        enable_compile_warnings=no
 
532
    fi
 
533
 
 
534
    warning_flags=
 
535
    realsave_CFLAGS="$CFLAGS"
 
536
 
 
537
    case "$enable_compile_warnings" in
 
538
    no)
 
539
        warning_flags=
 
540
        ;;
 
541
    minimum)
 
542
        warning_flags="-Wall"
 
543
        ;;
 
544
    yes)
 
545
        warning_flags="-Wall -Wmissing-prototypes"
 
546
        ;;
 
547
    maximum|error)
 
548
        warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
 
549
        CFLAGS="$warning_flags $CFLAGS"
 
550
        for option in -Wno-sign-compare; do
 
551
                SAVE_CFLAGS="$CFLAGS"
 
552
                CFLAGS="$CFLAGS $option"
 
553
                AC_MSG_CHECKING([whether gcc understands $option])
 
554
                AC_TRY_COMPILE([], [],
 
555
                        has_option=yes,
 
556
                        has_option=no,)
 
557
                CFLAGS="$SAVE_CFLAGS"
 
558
                AC_MSG_RESULT($has_option)
 
559
                if test $has_option = yes; then
 
560
                  warning_flags="$warning_flags $option"
 
561
                fi
 
562
                unset has_option
 
563
                unset SAVE_CFLAGS
 
564
        done
 
565
        unset option
 
566
        if test "$enable_compile_warnings" = "error" ; then
 
567
            warning_flags="$warning_flags -Werror"
 
568
        fi
 
569
        ;;
 
570
    *)
 
571
        AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
 
572
        ;;
 
573
    esac
 
574
    CFLAGS="$realsave_CFLAGS"
 
575
    AC_MSG_CHECKING(what warning flags to pass to the C compiler)
 
576
    AC_MSG_RESULT($warning_flags)
 
577
 
 
578
    AC_ARG_ENABLE(iso-c,
 
579
                  AC_HELP_STRING([--enable-iso-c],
 
580
                                 [Try to warn if code is not ISO C ]),,
 
581
                  [enable_iso_c=no])
 
582
 
 
583
    AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
 
584
    complCFLAGS=
 
585
    if test "x$enable_iso_c" != "xno"; then
 
586
        if test "x$GCC" = "xyes"; then
 
587
        case " $CFLAGS " in
 
588
            *[\ \       ]-ansi[\ \      ]*) ;;
 
589
            *) complCFLAGS="$complCFLAGS -ansi" ;;
 
590
        esac
 
591
        case " $CFLAGS " in
 
592
            *[\ \       ]-pedantic[\ \  ]*) ;;
 
593
            *) complCFLAGS="$complCFLAGS -pedantic" ;;
 
594
        esac
 
595
        fi
 
596
    fi
 
597
    AC_MSG_RESULT($complCFLAGS)
 
598
 
 
599
    WARN_CFLAGS="$warning_flags $complCFLAGS"
 
600
    AC_SUBST(WARN_CFLAGS)
 
601
])
 
602
 
 
603
dnl For C++, do basically the same thing.
 
604
 
 
605
AC_DEFUN([GNOME_CXX_WARNINGS],[
 
606
  AC_ARG_ENABLE(cxx-warnings,
 
607
                AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
 
608
                               [Turn on compiler warnings.]),,
 
609
                [enable_cxx_warnings="m4_default([$1],[minimum])"])
 
610
 
 
611
  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
 
612
  warnCXXFLAGS=
 
613
  if test "x$GXX" != xyes; then
 
614
    enable_cxx_warnings=no
 
615
  fi
 
616
  if test "x$enable_cxx_warnings" != "xno"; then
 
617
    if test "x$GXX" = "xyes"; then
 
618
      case " $CXXFLAGS " in
 
619
      *[\ \     ]-Wall[\ \      ]*) ;;
 
620
      *) warnCXXFLAGS="-Wall -Wno-unused" ;;
 
621
      esac
 
622
 
 
623
      ## -W is not all that useful.  And it cannot be controlled
 
624
      ## with individual -Wno-xxx flags, unlike -Wall
 
625
      if test "x$enable_cxx_warnings" = "xyes"; then
 
626
        warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
 
627
      fi
 
628
    fi
 
629
  fi
 
630
  AC_MSG_RESULT($warnCXXFLAGS)
 
631
 
 
632
   AC_ARG_ENABLE(iso-cxx,
 
633
                 AC_HELP_STRING([--enable-iso-cxx],
 
634
                                [Try to warn if code is not ISO C++ ]),,
 
635
                 [enable_iso_cxx=no])
 
636
 
 
637
   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
 
638
   complCXXFLAGS=
 
639
   if test "x$enable_iso_cxx" != "xno"; then
 
640
     if test "x$GXX" = "xyes"; then
 
641
      case " $CXXFLAGS " in
 
642
      *[\ \     ]-ansi[\ \      ]*) ;;
 
643
      *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
 
644
      esac
 
645
 
 
646
      case " $CXXFLAGS " in
 
647
      *[\ \     ]-pedantic[\ \  ]*) ;;
 
648
      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
 
649
      esac
 
650
     fi
 
651
   fi
 
652
  AC_MSG_RESULT($complCXXFLAGS)
 
653
 
 
654
  WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
 
655
  AC_SUBST(WARN_CXXFLAGS)
 
656
])
 
657
 
 
658
dnl GLIB_GSETTINGS
 
659
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
 
660
dnl the schema should be compiled
 
661
dnl
 
662
 
 
663
AC_DEFUN([GLIB_GSETTINGS],
 
664
[
 
665
  m4_pattern_allow([AM_V_GEN])
 
666
  AC_ARG_ENABLE(schemas-compile,
 
667
                AS_HELP_STRING([--disable-schemas-compile],
 
668
                               [Disable regeneration of gschemas.compiled on install]),
 
669
                [case ${enableval} in
 
670
                  yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE=""  ;;
 
671
                  no)  GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
 
672
                  *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
 
673
                 esac])
 
674
  AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
 
675
  PKG_PROG_PKG_CONFIG([0.16])
 
676
  AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
 
677
  if test x$cross_compiling != xyes; then
 
678
    GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
 
679
  else
 
680
    AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
 
681
  fi
 
682
  AC_SUBST(GLIB_COMPILE_SCHEMAS)
 
683
  if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
 
684
    ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
 
685
  else
 
686
    ifelse([$1],,[:],[$1])
 
687
  fi
 
688
 
 
689
  GSETTINGS_RULES='
 
690
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
 
691
 
 
692
mostlyclean-am: clean-gsettings-schemas
 
693
 
 
694
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
 
695
 
 
696
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
 
697
        $(AM_V_GEN) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${d}$< && touch [$]@
 
698
 
 
699
all-am: $(gsettings_SCHEMAS:.xml=.valid)
 
700
uninstall-am: uninstall-gsettings-schemas
 
701
install-data-am: install-gsettings-schemas
 
702
 
 
703
.SECONDARY: $(gsettings_SCHEMAS)
 
704
 
 
705
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
 
706
        @$(NORMAL_INSTALL)
 
707
        if test -n "$^"; then \
 
708
                test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
 
709
                $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
 
710
                test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
 
711
        fi
 
712
 
 
713
uninstall-gsettings-schemas:
 
714
        @$(NORMAL_UNINSTALL)
 
715
        @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
 
716
        files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
 
717
        test -n "$$files" || exit 0; \
 
718
        echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
 
719
        cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
 
720
        test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
 
721
 
 
722
clean-gsettings-schemas:
 
723
        rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
 
724
 
 
725
ifdef gsettings_ENUM_NAMESPACE
 
726
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
 
727
        $(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead "  <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod "    <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail "  </@type@>" --ftail "</schemalist>" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@
 
728
endif
 
729
'
 
730
  _GSETTINGS_SUBST(GSETTINGS_RULES)
 
731
])
 
732
 
 
733
dnl _GSETTINGS_SUBST(VARIABLE)
 
734
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
 
735
AC_DEFUN([_GSETTINGS_SUBST],
 
736
[
 
737
AC_SUBST([$1])
 
738
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
 
739
]
 
740
)
 
741
 
 
742
# nls.m4 serial 5 (gettext-0.18)
 
743
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
 
744
dnl Inc.
 
745
dnl This file is free software; the Free Software Foundation
 
746
dnl gives unlimited permission to copy and/or distribute it,
 
747
dnl with or without modifications, as long as this notice is preserved.
 
748
dnl
 
749
dnl This file can can be used in projects which are not available under
 
750
dnl the GNU General Public License or the GNU Library General Public
 
751
dnl License but which still want to provide support for the GNU gettext
 
752
dnl functionality.
 
753
dnl Please note that the actual code of the GNU gettext library is covered
 
754
dnl by the GNU Library General Public License, and the rest of the GNU
 
755
dnl gettext package package is covered by the GNU General Public License.
 
756
dnl They are *not* in the public domain.
 
757
 
 
758
dnl Authors:
 
759
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
760
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
761
 
 
762
AC_PREREQ([2.50])
 
763
 
 
764
AC_DEFUN([AM_NLS],
 
765
[
 
766
  AC_MSG_CHECKING([whether NLS is requested])
 
767
  dnl Default is enabled NLS
 
768
  AC_ARG_ENABLE([nls],
 
769
    [  --disable-nls           do not use Native Language Support],
 
770
    USE_NLS=$enableval, USE_NLS=yes)
 
771
  AC_MSG_RESULT([$USE_NLS])
 
772
  AC_SUBST([USE_NLS])
 
773
])
 
774
 
 
775
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
776
# serial 1 (pkg-config-0.24)
 
777
 
778
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
 
779
#
 
780
# This program is free software; you can redistribute it and/or modify
 
781
# it under the terms of the GNU General Public License as published by
 
782
# the Free Software Foundation; either version 2 of the License, or
 
783
# (at your option) any later version.
 
784
#
 
785
# This program is distributed in the hope that it will be useful, but
 
786
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
787
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
788
# General Public License for more details.
 
789
#
 
790
# You should have received a copy of the GNU General Public License
 
791
# along with this program; if not, write to the Free Software
 
792
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
793
#
 
794
# As a special exception to the GNU General Public License, if you
 
795
# distribute this file as part of a program that contains a
 
796
# configuration script generated by Autoconf, you may include it under
 
797
# the same distribution terms that you use for the rest of that program.
 
798
 
 
799
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
 
800
# ----------------------------------
 
801
AC_DEFUN([PKG_PROG_PKG_CONFIG],
 
802
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 
803
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
 
804
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 
805
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 
806
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
 
807
 
 
808
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 
809
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 
810
fi
 
811
if test -n "$PKG_CONFIG"; then
 
812
        _pkg_min_version=m4_default([$1], [0.9.0])
 
813
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
 
814
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 
815
                AC_MSG_RESULT([yes])
 
816
        else
 
817
                AC_MSG_RESULT([no])
 
818
                PKG_CONFIG=""
 
819
        fi
 
820
fi[]dnl
 
821
])# PKG_PROG_PKG_CONFIG
 
822
 
 
823
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
824
#
 
825
# Check to see whether a particular set of modules exists.  Similar
 
826
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
 
827
#
 
828
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
829
# only at the first occurence in configure.ac, so if the first place
 
830
# it's called might be skipped (such as if it is within an "if", you
 
831
# have to call PKG_CHECK_EXISTS manually
 
832
# --------------------------------------------------------------
 
833
AC_DEFUN([PKG_CHECK_EXISTS],
 
834
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
835
if test -n "$PKG_CONFIG" && \
 
836
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
 
837
  m4_default([$2], [:])
 
838
m4_ifvaln([$3], [else
 
839
  $3])dnl
 
840
fi])
 
841
 
 
842
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 
843
# ---------------------------------------------
 
844
m4_define([_PKG_CONFIG],
 
845
[if test -n "$$1"; then
 
846
    pkg_cv_[]$1="$$1"
 
847
 elif test -n "$PKG_CONFIG"; then
 
848
    PKG_CHECK_EXISTS([$3],
 
849
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 
850
                     [pkg_failed=yes])
 
851
 else
 
852
    pkg_failed=untried
 
853
fi[]dnl
 
854
])# _PKG_CONFIG
 
855
 
 
856
# _PKG_SHORT_ERRORS_SUPPORTED
 
857
# -----------------------------
 
858
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 
859
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
860
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 
861
        _pkg_short_errors_supported=yes
 
862
else
 
863
        _pkg_short_errors_supported=no
 
864
fi[]dnl
 
865
])# _PKG_SHORT_ERRORS_SUPPORTED
 
866
 
 
867
 
 
868
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 
869
# [ACTION-IF-NOT-FOUND])
 
870
#
 
871
#
 
872
# Note that if there is a possibility the first call to
 
873
# PKG_CHECK_MODULES might not happen, you should be sure to include an
 
874
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 
875
#
 
876
#
 
877
# --------------------------------------------------------------
 
878
AC_DEFUN([PKG_CHECK_MODULES],
 
879
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
880
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 
881
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
882
 
 
883
pkg_failed=no
 
884
AC_MSG_CHECKING([for $1])
 
885
 
 
886
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 
887
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
888
 
 
889
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 
890
and $1[]_LIBS to avoid the need to call pkg-config.
 
891
See the pkg-config man page for more details.])
 
892
 
 
893
if test $pkg_failed = yes; then
 
894
        AC_MSG_RESULT([no])
 
895
        _PKG_SHORT_ERRORS_SUPPORTED
 
896
        if test $_pkg_short_errors_supported = yes; then
 
897
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
 
898
        else 
 
899
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
 
900
        fi
 
901
        # Put the nasty error message in config.log where it belongs
 
902
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
903
 
 
904
        m4_default([$4], [AC_MSG_ERROR(
 
905
[Package requirements ($2) were not met:
 
906
 
 
907
$$1_PKG_ERRORS
 
908
 
 
909
Consider adjusting the PKG_CONFIG_PATH environment variable if you
 
910
installed software in a non-standard prefix.
 
911
 
 
912
_PKG_TEXT])
 
913
        ])
 
914
elif test $pkg_failed = untried; then
 
915
        AC_MSG_RESULT([no])
 
916
        m4_default([$4], [AC_MSG_FAILURE(
 
917
[The pkg-config script could not be found or is too old.  Make sure it
 
918
is in your PATH or set the PKG_CONFIG environment variable to the full
 
919
path to pkg-config.
 
920
 
 
921
_PKG_TEXT
 
922
 
 
923
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
 
924
        ])
 
925
else
 
926
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 
927
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 
928
        AC_MSG_RESULT([yes])
 
929
        $3
 
930
fi[]dnl
 
931
])# PKG_CHECK_MODULES
 
932
 
 
933
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
 
934
# Foundation, Inc.
23
935
#
24
936
# This file is free software; the Free Software Foundation
25
937
# gives unlimited permission to copy and/or distribute it,
26
938
# with or without modifications, as long as this notice is preserved.
27
939
 
 
940
# serial 1
 
941
 
28
942
# AM_AUTOMAKE_VERSION(VERSION)
29
943
# ----------------------------
30
944
# Automake X.Y traces this macro to ensure aclocal.m4 has been
34
948
[am__api_version='1.11'
35
949
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36
950
dnl require some minimum version.  Point them to the right macro.
37
 
m4_if([$1], [1.11.1], [],
 
951
m4_if([$1], [1.11.3], [],
38
952
      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39
953
])
40
954
 
50
964
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51
965
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52
966
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53
 
[AM_AUTOMAKE_VERSION([1.11.1])dnl
 
967
[AM_AUTOMAKE_VERSION([1.11.3])dnl
54
968
m4_ifndef([AC_AUTOCONF_VERSION],
55
969
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56
970
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57
971
 
58
972
# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59
973
 
60
 
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
974
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
61
975
#
62
976
# This file is free software; the Free Software Foundation
63
977
# gives unlimited permission to copy and/or distribute it,
64
978
# with or without modifications, as long as this notice is preserved.
65
979
 
 
980
# serial 1
 
981
 
66
982
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67
983
# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68
984
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
144
1060
Usually this means the macro was only invoked conditionally.]])
145
1061
fi])])
146
1062
 
147
 
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148
 
# Free Software Foundation, Inc.
 
1063
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
 
1064
# 2010, 2011 Free Software Foundation, Inc.
149
1065
#
150
1066
# This file is free software; the Free Software Foundation
151
1067
# gives unlimited permission to copy and/or distribute it,
152
1068
# with or without modifications, as long as this notice is preserved.
153
1069
 
154
 
# serial 10
 
1070
# serial 12
155
1071
 
156
1072
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157
1073
# written in clear, in which case automake, when reading aclocal.m4,
191
1107
  # instance it was reported that on HP-UX the gcc test will end up
192
1108
  # making a dummy file named `D' -- because `-MD' means `put the output
193
1109
  # in D'.
 
1110
  rm -rf conftest.dir
194
1111
  mkdir conftest.dir
195
1112
  # Copy depcomp to subdir because otherwise we won't find it if we're
196
1113
  # using a relative directory.
255
1172
        break
256
1173
      fi
257
1174
      ;;
258
 
    msvisualcpp | msvcmsys)
 
1175
    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
259
1176
      # This compiler won't grok `-c -o', but also, the minuso test has
260
1177
      # not run yet.  These depmodes are late enough in the game, and
261
1178
      # so weak that their functioning should not be impacted.
320
1237
if test "x$enable_dependency_tracking" != xno; then
321
1238
  am_depcomp="$ac_aux_dir/depcomp"
322
1239
  AMDEPBACKSLASH='\'
 
1240
  am__nodep='_no'
323
1241
fi
324
1242
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325
1243
AC_SUBST([AMDEPBACKSLASH])dnl
326
1244
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 
1245
AC_SUBST([am__nodep])dnl
 
1246
_AM_SUBST_NOTMAKE([am__nodep])dnl
327
1247
])
328
1248
 
329
1249
# Generate code to set up dependency tracking.              -*- Autoconf -*-
545
1465
done
546
1466
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547
1467
 
548
 
# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
 
1468
# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
 
1469
# Inc.
549
1470
#
550
1471
# This file is free software; the Free Software Foundation
551
1472
# gives unlimited permission to copy and/or distribute it,
552
1473
# with or without modifications, as long as this notice is preserved.
553
1474
 
 
1475
# serial 1
 
1476
 
554
1477
# AM_PROG_INSTALL_SH
555
1478
# ------------------
556
1479
# Define $install_sh.
590
1513
# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
591
1514
# From Jim Meyering
592
1515
 
593
 
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
594
 
# Free Software Foundation, Inc.
 
1516
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
 
1517
# 2011 Free Software Foundation, Inc.
595
1518
#
596
1519
# This file is free software; the Free Software Foundation
597
1520
# gives unlimited permission to copy and/or distribute it,
611
1534
       [disable], [m4_define([am_maintainer_other], [enable])],
612
1535
       [m4_define([am_maintainer_other], [enable])
613
1536
        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
614
 
AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
 
1537
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
615
1538
  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
616
1539
  AC_ARG_ENABLE([maintainer-mode],
617
1540
[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
757
1680
fi
758
1681
])
759
1682
 
760
 
# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
 
1683
# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
 
1684
# Inc.
761
1685
#
762
1686
# This file is free software; the Free Software Foundation
763
1687
# gives unlimited permission to copy and/or distribute it,
764
1688
# with or without modifications, as long as this notice is preserved.
765
1689
 
 
1690
# serial 1
 
1691
 
766
1692
# AM_PROG_MKDIR_P
767
1693
# ---------------
768
1694
# Check for `mkdir -p'.
785
1711
 
786
1712
# Helper functions for option handling.                     -*- Autoconf -*-
787
1713
 
788
 
# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
 
1714
# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
 
1715
# Foundation, Inc.
789
1716
#
790
1717
# This file is free software; the Free Software Foundation
791
1718
# gives unlimited permission to copy and/or distribute it,
792
1719
# with or without modifications, as long as this notice is preserved.
793
1720
 
794
 
# serial 4
 
1721
# serial 5
795
1722
 
796
1723
# _AM_MANGLE_OPTION(NAME)
797
1724
# -----------------------
799
1726
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
800
1727
 
801
1728
# _AM_SET_OPTION(NAME)
802
 
# ------------------------------
 
1729
# --------------------
803
1730
# Set option NAME.  Presently that only means defining a flag for this option.
804
1731
AC_DEFUN([_AM_SET_OPTION],
805
1732
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
806
1733
 
807
1734
# _AM_SET_OPTIONS(OPTIONS)
808
 
# ----------------------------------
 
1735
# ------------------------
809
1736
# OPTIONS is a space-separated list of Automake options.
810
1737
AC_DEFUN([_AM_SET_OPTIONS],
811
1738
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
816
1743
AC_DEFUN([_AM_IF_OPTION],
817
1744
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
818
1745
 
819
 
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
1746
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
820
1747
#
821
1748
# This file is free software; the Free Software Foundation
822
1749
# gives unlimited permission to copy and/or distribute it,
823
1750
# with or without modifications, as long as this notice is preserved.
824
1751
 
 
1752
# serial 1
 
1753
 
825
1754
# AM_RUN_LOG(COMMAND)
826
1755
# -------------------
827
1756
# Run COMMAND, save the exit status in ac_status, and log it.
898
1827
fi
899
1828
AC_MSG_RESULT(yes)])
900
1829
 
901
 
# Copyright (C) 2009  Free Software Foundation, Inc.
 
1830
# Copyright (C) 2009, 2011  Free Software Foundation, Inc.
902
1831
#
903
1832
# This file is free software; the Free Software Foundation
904
1833
# gives unlimited permission to copy and/or distribute it,
905
1834
# with or without modifications, as long as this notice is preserved.
906
1835
 
907
 
# serial 1
 
1836
# serial 2
908
1837
 
909
1838
# AM_SILENT_RULES([DEFAULT])
910
1839
# --------------------------
919
1848
no)  AM_DEFAULT_VERBOSITY=1;;
920
1849
*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
921
1850
esac
 
1851
dnl
 
1852
dnl A few `make' implementations (e.g., NonStop OS and NextStep)
 
1853
dnl do not support nested variable expansions.
 
1854
dnl See automake bug#9928 and bug#10237.
 
1855
am_make=${MAKE-make}
 
1856
AC_CACHE_CHECK([whether $am_make supports nested variables],
 
1857
   [am_cv_make_support_nested_variables],
 
1858
   [if AS_ECHO([['TRUE=$(BAR$(V))
 
1859
BAR0=false
 
1860
BAR1=true
 
1861
V=1
 
1862
am__doit:
 
1863
        @$(TRUE)
 
1864
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
 
1865
  am_cv_make_support_nested_variables=yes
 
1866
else
 
1867
  am_cv_make_support_nested_variables=no
 
1868
fi])
 
1869
if test $am_cv_make_support_nested_variables = yes; then
 
1870
  dnl Using `$V' instead of `$(V)' breaks IRIX make.
 
1871
  AM_V='$(V)'
 
1872
  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
 
1873
else
 
1874
  AM_V=$AM_DEFAULT_VERBOSITY
 
1875
  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
 
1876
fi
 
1877
AC_SUBST([AM_V])dnl
 
1878
AM_SUBST_NOTMAKE([AM_V])dnl
 
1879
AC_SUBST([AM_DEFAULT_V])dnl
 
1880
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
922
1881
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
923
1882
AM_BACKSLASH='\'
924
1883
AC_SUBST([AM_BACKSLASH])dnl
925
1884
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
926
1885
])
927
1886
 
928
 
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
1887
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
929
1888
#
930
1889
# This file is free software; the Free Software Foundation
931
1890
# gives unlimited permission to copy and/or distribute it,
932
1891
# with or without modifications, as long as this notice is preserved.
933
1892
 
 
1893
# serial 1
 
1894
 
934
1895
# AM_PROG_INSTALL_STRIP
935
1896
# ---------------------
936
1897
# One issue with vendor `install' (even GNU) is that you can't
953
1914
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
954
1915
AC_SUBST([INSTALL_STRIP_PROGRAM])])
955
1916
 
956
 
# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
 
1917
# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
957
1918
#
958
1919
# This file is free software; the Free Software Foundation
959
1920
# gives unlimited permission to copy and/or distribute it,
960
1921
# with or without modifications, as long as this notice is preserved.
961
1922
 
962
 
# serial 2
 
1923
# serial 3
963
1924
 
964
1925
# _AM_SUBST_NOTMAKE(VARIABLE)
965
1926
# ---------------------------
968
1929
AC_DEFUN([_AM_SUBST_NOTMAKE])
969
1930
 
970
1931
# AM_SUBST_NOTMAKE(VARIABLE)
971
 
# ---------------------------
 
1932
# --------------------------
972
1933
# Public sister of _AM_SUBST_NOTMAKE.
973
1934
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
974
1935
 
975
1936
# Check how to create a tarball.                            -*- Autoconf -*-
976
1937
 
977
 
# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
 
1938
# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
978
1939
#
979
1940
# This file is free software; the Free Software Foundation
980
1941
# gives unlimited permission to copy and/or distribute it,
996
1957
# a tarball read from stdin.
997
1958
#     $(am__untar) < result.tar
998
1959
AC_DEFUN([_AM_PROG_TAR],
999
 
[# Always define AMTAR for backward compatibility.
1000
 
AM_MISSING_PROG([AMTAR], [tar])
 
1960
[# Always define AMTAR for backward compatibility.  Yes, it's still used
 
1961
# in the wild :-(  We should find a proper way to deprecate it ...
 
1962
AC_SUBST([AMTAR], ['$${TAR-tar}'])
1001
1963
m4_if([$1], [v7],
1002
 
     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
 
1964
     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1003
1965
     [m4_case([$1], [ustar],, [pax],,
1004
1966
              [m4_fatal([Unknown tar format])])
1005
1967
AC_MSG_CHECKING([how to create a $1 tar archive])
1068
2030
AC_SUBST([am__untar])
1069
2031
]) # _AM_PROG_TAR
1070
2032
 
1071
 
# nls.m4 serial 5 (gettext-0.18)
1072
 
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
1073
 
dnl Inc.
1074
 
dnl This file is free software; the Free Software Foundation
1075
 
dnl gives unlimited permission to copy and/or distribute it,
1076
 
dnl with or without modifications, as long as this notice is preserved.
1077
 
dnl
1078
 
dnl This file can can be used in projects which are not available under
1079
 
dnl the GNU General Public License or the GNU Library General Public
1080
 
dnl License but which still want to provide support for the GNU gettext
1081
 
dnl functionality.
1082
 
dnl Please note that the actual code of the GNU gettext library is covered
1083
 
dnl by the GNU Library General Public License, and the rest of the GNU
1084
 
dnl gettext package package is covered by the GNU General Public License.
1085
 
dnl They are *not* in the public domain.
1086
 
 
1087
 
dnl Authors:
1088
 
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1089
 
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1090
 
 
1091
 
AC_PREREQ([2.50])
1092
 
 
1093
 
AC_DEFUN([AM_NLS],
1094
 
[
1095
 
  AC_MSG_CHECKING([whether NLS is requested])
1096
 
  dnl Default is enabled NLS
1097
 
  AC_ARG_ENABLE([nls],
1098
 
    [  --disable-nls           do not use Native Language Support],
1099
 
    USE_NLS=$enableval, USE_NLS=yes)
1100
 
  AC_MSG_RESULT([$USE_NLS])
1101
 
  AC_SUBST([USE_NLS])
1102
 
])
1103
 
 
1104
 
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1105
 
# serial 1 (pkg-config-0.24)
1106
 
1107
 
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1108
 
#
1109
 
# This program is free software; you can redistribute it and/or modify
1110
 
# it under the terms of the GNU General Public License as published by
1111
 
# the Free Software Foundation; either version 2 of the License, or
1112
 
# (at your option) any later version.
1113
 
#
1114
 
# This program is distributed in the hope that it will be useful, but
1115
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
1116
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1117
 
# General Public License for more details.
1118
 
#
1119
 
# You should have received a copy of the GNU General Public License
1120
 
# along with this program; if not, write to the Free Software
1121
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1122
 
#
1123
 
# As a special exception to the GNU General Public License, if you
1124
 
# distribute this file as part of a program that contains a
1125
 
# configuration script generated by Autoconf, you may include it under
1126
 
# the same distribution terms that you use for the rest of that program.
1127
 
 
1128
 
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1129
 
# ----------------------------------
1130
 
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1131
 
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1132
 
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1133
 
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1134
 
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1135
 
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1136
 
 
1137
 
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1138
 
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1139
 
fi
1140
 
if test -n "$PKG_CONFIG"; then
1141
 
        _pkg_min_version=m4_default([$1], [0.9.0])
1142
 
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1143
 
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1144
 
                AC_MSG_RESULT([yes])
1145
 
        else
1146
 
                AC_MSG_RESULT([no])
1147
 
                PKG_CONFIG=""
1148
 
        fi
1149
 
fi[]dnl
1150
 
])# PKG_PROG_PKG_CONFIG
1151
 
 
1152
 
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1153
 
#
1154
 
# Check to see whether a particular set of modules exists.  Similar
1155
 
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1156
 
#
1157
 
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1158
 
# only at the first occurence in configure.ac, so if the first place
1159
 
# it's called might be skipped (such as if it is within an "if", you
1160
 
# have to call PKG_CHECK_EXISTS manually
1161
 
# --------------------------------------------------------------
1162
 
AC_DEFUN([PKG_CHECK_EXISTS],
1163
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1164
 
if test -n "$PKG_CONFIG" && \
1165
 
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1166
 
  m4_default([$2], [:])
1167
 
m4_ifvaln([$3], [else
1168
 
  $3])dnl
1169
 
fi])
1170
 
 
1171
 
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1172
 
# ---------------------------------------------
1173
 
m4_define([_PKG_CONFIG],
1174
 
[if test -n "$$1"; then
1175
 
    pkg_cv_[]$1="$$1"
1176
 
 elif test -n "$PKG_CONFIG"; then
1177
 
    PKG_CHECK_EXISTS([$3],
1178
 
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1179
 
                     [pkg_failed=yes])
1180
 
 else
1181
 
    pkg_failed=untried
1182
 
fi[]dnl
1183
 
])# _PKG_CONFIG
1184
 
 
1185
 
# _PKG_SHORT_ERRORS_SUPPORTED
1186
 
# -----------------------------
1187
 
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1188
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1189
 
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1190
 
        _pkg_short_errors_supported=yes
1191
 
else
1192
 
        _pkg_short_errors_supported=no
1193
 
fi[]dnl
1194
 
])# _PKG_SHORT_ERRORS_SUPPORTED
1195
 
 
1196
 
 
1197
 
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1198
 
# [ACTION-IF-NOT-FOUND])
1199
 
#
1200
 
#
1201
 
# Note that if there is a possibility the first call to
1202
 
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1203
 
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1204
 
#
1205
 
#
1206
 
# --------------------------------------------------------------
1207
 
AC_DEFUN([PKG_CHECK_MODULES],
1208
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1209
 
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1210
 
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1211
 
 
1212
 
pkg_failed=no
1213
 
AC_MSG_CHECKING([for $1])
1214
 
 
1215
 
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1216
 
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1217
 
 
1218
 
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1219
 
and $1[]_LIBS to avoid the need to call pkg-config.
1220
 
See the pkg-config man page for more details.])
1221
 
 
1222
 
if test $pkg_failed = yes; then
1223
 
        AC_MSG_RESULT([no])
1224
 
        _PKG_SHORT_ERRORS_SUPPORTED
1225
 
        if test $_pkg_short_errors_supported = yes; then
1226
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1227
 
        else 
1228
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1229
 
        fi
1230
 
        # Put the nasty error message in config.log where it belongs
1231
 
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1232
 
 
1233
 
        m4_default([$4], [AC_MSG_ERROR(
1234
 
[Package requirements ($2) were not met:
1235
 
 
1236
 
$$1_PKG_ERRORS
1237
 
 
1238
 
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1239
 
installed software in a non-standard prefix.
1240
 
 
1241
 
_PKG_TEXT])
1242
 
        ])
1243
 
elif test $pkg_failed = untried; then
1244
 
        AC_MSG_RESULT([no])
1245
 
        m4_default([$4], [AC_MSG_FAILURE(
1246
 
[The pkg-config script could not be found or is too old.  Make sure it
1247
 
is in your PATH or set the PKG_CONFIG environment variable to the full
1248
 
path to pkg-config.
1249
 
 
1250
 
_PKG_TEXT
1251
 
 
1252
 
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
1253
 
        ])
1254
 
else
1255
 
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1256
 
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1257
 
        AC_MSG_RESULT([yes])
1258
 
        $3
1259
 
fi[]dnl
1260
 
])# PKG_CHECK_MODULES
1261
 
 
1262
 
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
1263
 
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
1264
 
#
1265
 
# This file is free software, distributed under the terms of the GNU
1266
 
# General Public License.  As a special exception to the GNU General
1267
 
# Public License, this file may be distributed as part of a program
1268
 
# that contains a configuration script generated by Autoconf, under
1269
 
# the same distribution terms as the rest of that program.
1270
 
#
1271
 
# This file can be copied and used freely without restrictions.  It can
1272
 
# be used in projects which are not available under the GNU Public License
1273
 
# but which still want to provide support for the GNU gettext functionality.
1274
 
#
1275
 
# Macro to add for using GNU gettext.
1276
 
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
1277
 
#
1278
 
# Modified to never use included libintl. 
1279
 
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
1280
 
#
1281
 
# Major rework to remove unused code
1282
 
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
1283
 
#
1284
 
# Added better handling of ALL_LINGUAS from GNU gettext version 
1285
 
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
1286
 
#
1287
 
# Modified to require ngettext
1288
 
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
1289
 
#
1290
 
# We need this here as well, since someone might use autoconf-2.5x
1291
 
# to configure GLib then an older version to configure a package
1292
 
# using AM_GLIB_GNU_GETTEXT
1293
 
AC_PREREQ(2.53)
1294
 
 
1295
 
dnl
1296
 
dnl We go to great lengths to make sure that aclocal won't 
1297
 
dnl try to pull in the installed version of these macros
1298
 
dnl when running aclocal in the glib directory.
1299
 
dnl
1300
 
m4_copy([AC_DEFUN],[glib_DEFUN])
1301
 
m4_copy([AC_REQUIRE],[glib_REQUIRE])
1302
 
dnl
1303
 
dnl At the end, if we're not within glib, we'll define the public
1304
 
dnl definitions in terms of our private definitions.
1305
 
dnl
1306
 
 
1307
 
# GLIB_LC_MESSAGES
1308
 
#--------------------
1309
 
glib_DEFUN([GLIB_LC_MESSAGES],
1310
 
  [AC_CHECK_HEADERS([locale.h])
1311
 
    if test $ac_cv_header_locale_h = yes; then
1312
 
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1313
 
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1314
 
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1315
 
    if test $am_cv_val_LC_MESSAGES = yes; then
1316
 
      AC_DEFINE(HAVE_LC_MESSAGES, 1,
1317
 
        [Define if your <locale.h> file defines LC_MESSAGES.])
1318
 
    fi
1319
 
  fi])
1320
 
 
1321
 
# GLIB_PATH_PROG_WITH_TEST
1322
 
#----------------------------
1323
 
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1324
 
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1325
 
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
1326
 
[# Extract the first word of "$2", so it can be a program name with args.
1327
 
set dummy $2; ac_word=[$]2
1328
 
AC_MSG_CHECKING([for $ac_word])
1329
 
AC_CACHE_VAL(ac_cv_path_$1,
1330
 
[case "[$]$1" in
1331
 
  /*)
1332
 
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1333
 
  ;;
1334
 
  *)
1335
 
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1336
 
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
1337
 
    test -z "$ac_dir" && ac_dir=.
1338
 
    if test -f $ac_dir/$ac_word; then
1339
 
      if [$3]; then
1340
 
        ac_cv_path_$1="$ac_dir/$ac_word"
1341
 
        break
1342
 
      fi
1343
 
    fi
1344
 
  done
1345
 
  IFS="$ac_save_ifs"
1346
 
dnl If no 4th arg is given, leave the cache variable unset,
1347
 
dnl so AC_PATH_PROGS will keep looking.
1348
 
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1349
 
])dnl
1350
 
  ;;
1351
 
esac])dnl
1352
 
$1="$ac_cv_path_$1"
1353
 
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1354
 
  AC_MSG_RESULT([$]$1)
1355
 
else
1356
 
  AC_MSG_RESULT(no)
1357
 
fi
1358
 
AC_SUBST($1)dnl
1359
 
])
1360
 
 
1361
 
# GLIB_WITH_NLS
1362
 
#-----------------
1363
 
glib_DEFUN([GLIB_WITH_NLS],
1364
 
  dnl NLS is obligatory
1365
 
  [USE_NLS=yes
1366
 
    AC_SUBST(USE_NLS)
1367
 
 
1368
 
    gt_cv_have_gettext=no
1369
 
 
1370
 
    CATOBJEXT=NONE
1371
 
    XGETTEXT=:
1372
 
    INTLLIBS=
1373
 
 
1374
 
    AC_CHECK_HEADER(libintl.h,
1375
 
     [gt_cv_func_dgettext_libintl="no"
1376
 
      libintl_extra_libs=""
1377
 
 
1378
 
      #
1379
 
      # First check in libc
1380
 
      #
1381
 
      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
1382
 
        [AC_TRY_LINK([
1383
 
#include <libintl.h>
1384
 
],
1385
 
         [return !ngettext ("","", 1)],
1386
 
          gt_cv_func_ngettext_libc=yes,
1387
 
          gt_cv_func_ngettext_libc=no)
1388
 
        ])
1389
 
  
1390
 
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1391
 
              AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1392
 
                [AC_TRY_LINK([
1393
 
#include <libintl.h>
1394
 
],
1395
 
                  [return !dgettext ("","")],
1396
 
                  gt_cv_func_dgettext_libc=yes,
1397
 
                  gt_cv_func_dgettext_libc=no)
1398
 
                ])
1399
 
      fi
1400
 
  
1401
 
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1402
 
        AC_CHECK_FUNCS(bind_textdomain_codeset)
1403
 
      fi
1404
 
 
1405
 
      #
1406
 
      # If we don't have everything we want, check in libintl
1407
 
      #
1408
 
      if test "$gt_cv_func_dgettext_libc" != "yes" \
1409
 
         || test "$gt_cv_func_ngettext_libc" != "yes" \
1410
 
         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
1411
 
        
1412
 
        AC_CHECK_LIB(intl, bindtextdomain,
1413
 
            [AC_CHECK_LIB(intl, ngettext,
1414
 
                    [AC_CHECK_LIB(intl, dgettext,
1415
 
                                  gt_cv_func_dgettext_libintl=yes)])])
1416
 
 
1417
 
        if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
1418
 
          AC_MSG_CHECKING([if -liconv is needed to use gettext])
1419
 
          AC_MSG_RESULT([])
1420
 
          AC_CHECK_LIB(intl, ngettext,
1421
 
                [AC_CHECK_LIB(intl, dcgettext,
1422
 
                       [gt_cv_func_dgettext_libintl=yes
1423
 
                        libintl_extra_libs=-liconv],
1424
 
                        :,-liconv)],
1425
 
                :,-liconv)
1426
 
        fi
1427
 
 
1428
 
        #
1429
 
        # If we found libintl, then check in it for bind_textdomain_codeset();
1430
 
        # we'll prefer libc if neither have bind_textdomain_codeset(),
1431
 
        # and both have dgettext and ngettext
1432
 
        #
1433
 
        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
1434
 
          glib_save_LIBS="$LIBS"
1435
 
          LIBS="$LIBS -lintl $libintl_extra_libs"
1436
 
          unset ac_cv_func_bind_textdomain_codeset
1437
 
          AC_CHECK_FUNCS(bind_textdomain_codeset)
1438
 
          LIBS="$glib_save_LIBS"
1439
 
 
1440
 
          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
1441
 
            gt_cv_func_dgettext_libc=no
1442
 
          else
1443
 
            if test "$gt_cv_func_dgettext_libc" = "yes" \
1444
 
                && test "$gt_cv_func_ngettext_libc" = "yes"; then
1445
 
              gt_cv_func_dgettext_libintl=no
1446
 
            fi
1447
 
          fi
1448
 
        fi
1449
 
      fi
1450
 
 
1451
 
      if test "$gt_cv_func_dgettext_libc" = "yes" \
1452
 
        || test "$gt_cv_func_dgettext_libintl" = "yes"; then
1453
 
        gt_cv_have_gettext=yes
1454
 
      fi
1455
 
  
1456
 
      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
1457
 
        INTLLIBS="-lintl $libintl_extra_libs"
1458
 
      fi
1459
 
  
1460
 
      if test "$gt_cv_have_gettext" = "yes"; then
1461
 
        AC_DEFINE(HAVE_GETTEXT,1,
1462
 
          [Define if the GNU gettext() function is already present or preinstalled.])
1463
 
        GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1464
 
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
1465
 
        if test "$MSGFMT" != "no"; then
1466
 
          glib_save_LIBS="$LIBS"
1467
 
          LIBS="$LIBS $INTLLIBS"
1468
 
          AC_CHECK_FUNCS(dcgettext)
1469
 
          MSGFMT_OPTS=
1470
 
          AC_MSG_CHECKING([if msgfmt accepts -c])
1471
 
          GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
1472
 
msgid ""
1473
 
msgstr ""
1474
 
"Content-Type: text/plain; charset=UTF-8\n"
1475
 
"Project-Id-Version: test 1.0\n"
1476
 
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
1477
 
"Last-Translator: test <foo@bar.xx>\n"
1478
 
"Language-Team: C <LL@li.org>\n"
1479
 
"MIME-Version: 1.0\n"
1480
 
"Content-Transfer-Encoding: 8bit\n"
1481
 
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
1482
 
          AC_SUBST(MSGFMT_OPTS)
1483
 
          AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1484
 
          GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1485
 
            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
1486
 
          AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
1487
 
                         return _nl_msg_cat_cntr],
1488
 
            [CATOBJEXT=.gmo 
1489
 
             DATADIRNAME=share],
1490
 
            [case $host in
1491
 
            *-*-solaris*)
1492
 
            dnl On Solaris, if bind_textdomain_codeset is in libc,
1493
 
            dnl GNU format message catalog is always supported,
1494
 
            dnl since both are added to the libc all together.
1495
 
            dnl Hence, we'd like to go with DATADIRNAME=share and
1496
 
            dnl and CATOBJEXT=.gmo in this case.
1497
 
            AC_CHECK_FUNC(bind_textdomain_codeset,
1498
 
              [CATOBJEXT=.gmo 
1499
 
               DATADIRNAME=share],
1500
 
              [CATOBJEXT=.mo
1501
 
               DATADIRNAME=lib])
1502
 
            ;;
1503
 
            *-*-openbsd*)
1504
 
            CATOBJEXT=.mo
1505
 
            DATADIRNAME=share
1506
 
            ;;
1507
 
            *)
1508
 
            CATOBJEXT=.mo
1509
 
            DATADIRNAME=lib
1510
 
            ;;
1511
 
            esac])
1512
 
          LIBS="$glib_save_LIBS"
1513
 
          INSTOBJEXT=.mo
1514
 
        else
1515
 
          gt_cv_have_gettext=no
1516
 
        fi
1517
 
      fi
1518
 
    ])
1519
 
 
1520
 
    if test "$gt_cv_have_gettext" = "yes" ; then
1521
 
      AC_DEFINE(ENABLE_NLS, 1,
1522
 
        [always defined to indicate that i18n is enabled])
1523
 
    fi
1524
 
 
1525
 
    dnl Test whether we really found GNU xgettext.
1526
 
    if test "$XGETTEXT" != ":"; then
1527
 
      dnl If it is not GNU xgettext we define it as : so that the
1528
 
      dnl Makefiles still can work.
1529
 
      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
1530
 
        : ;
1531
 
      else
1532
 
        AC_MSG_RESULT(
1533
 
          [found xgettext program is not GNU xgettext; ignore it])
1534
 
        XGETTEXT=":"
1535
 
      fi
1536
 
    fi
1537
 
 
1538
 
    # We need to process the po/ directory.
1539
 
    POSUB=po
1540
 
 
1541
 
    AC_OUTPUT_COMMANDS(
1542
 
      [case "$CONFIG_FILES" in *po/Makefile.in*)
1543
 
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
1544
 
      esac])
1545
 
 
1546
 
    dnl These rules are solely for the distribution goal.  While doing this
1547
 
    dnl we only have to keep exactly one list of the available catalogs
1548
 
    dnl in configure.ac.
1549
 
    for lang in $ALL_LINGUAS; do
1550
 
      GMOFILES="$GMOFILES $lang.gmo"
1551
 
      POFILES="$POFILES $lang.po"
1552
 
    done
1553
 
 
1554
 
    dnl Make all variables we use known to autoconf.
1555
 
    AC_SUBST(CATALOGS)
1556
 
    AC_SUBST(CATOBJEXT)
1557
 
    AC_SUBST(DATADIRNAME)
1558
 
    AC_SUBST(GMOFILES)
1559
 
    AC_SUBST(INSTOBJEXT)
1560
 
    AC_SUBST(INTLLIBS)
1561
 
    AC_SUBST(PO_IN_DATADIR_TRUE)
1562
 
    AC_SUBST(PO_IN_DATADIR_FALSE)
1563
 
    AC_SUBST(POFILES)
1564
 
    AC_SUBST(POSUB)
1565
 
  ])
1566
 
 
1567
 
# AM_GLIB_GNU_GETTEXT
1568
 
# -------------------
1569
 
# Do checks necessary for use of gettext. If a suitable implementation 
1570
 
# of gettext is found in either in libintl or in the C library,
1571
 
# it will set INTLLIBS to the libraries needed for use of gettext
1572
 
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
1573
 
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
1574
 
# on various variables needed by the Makefile.in.in installed by 
1575
 
# glib-gettextize.
1576
 
dnl
1577
 
glib_DEFUN([GLIB_GNU_GETTEXT],
1578
 
  [AC_REQUIRE([AC_PROG_CC])dnl
1579
 
   AC_REQUIRE([AC_HEADER_STDC])dnl
1580
 
   
1581
 
   GLIB_LC_MESSAGES
1582
 
   GLIB_WITH_NLS
1583
 
 
1584
 
   if test "$gt_cv_have_gettext" = "yes"; then
1585
 
     if test "x$ALL_LINGUAS" = "x"; then
1586
 
       LINGUAS=
1587
 
     else
1588
 
       AC_MSG_CHECKING(for catalogs to be installed)
1589
 
       NEW_LINGUAS=
1590
 
       for presentlang in $ALL_LINGUAS; do
1591
 
         useit=no
1592
 
         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
1593
 
           desiredlanguages="$LINGUAS"
1594
 
         else
1595
 
           desiredlanguages="$ALL_LINGUAS"
1596
 
         fi
1597
 
         for desiredlang in $desiredlanguages; do
1598
 
           # Use the presentlang catalog if desiredlang is
1599
 
           #   a. equal to presentlang, or
1600
 
           #   b. a variant of presentlang (because in this case,
1601
 
           #      presentlang can be used as a fallback for messages
1602
 
           #      which are not translated in the desiredlang catalog).
1603
 
           case "$desiredlang" in
1604
 
             "$presentlang"*) useit=yes;;
1605
 
           esac
1606
 
         done
1607
 
         if test $useit = yes; then
1608
 
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1609
 
         fi
1610
 
       done
1611
 
       LINGUAS=$NEW_LINGUAS
1612
 
       AC_MSG_RESULT($LINGUAS)
1613
 
     fi
1614
 
 
1615
 
     dnl Construct list of names of catalog files to be constructed.
1616
 
     if test -n "$LINGUAS"; then
1617
 
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1618
 
     fi
1619
 
   fi
1620
 
 
1621
 
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1622
 
   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
1623
 
   dnl Try to locate is.
1624
 
   MKINSTALLDIRS=
1625
 
   if test -n "$ac_aux_dir"; then
1626
 
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1627
 
   fi
1628
 
   if test -z "$MKINSTALLDIRS"; then
1629
 
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1630
 
   fi
1631
 
   AC_SUBST(MKINSTALLDIRS)
1632
 
 
1633
 
   dnl Generate list of files to be processed by xgettext which will
1634
 
   dnl be included in po/Makefile.
1635
 
   test -d po || mkdir po
1636
 
   if test "x$srcdir" != "x."; then
1637
 
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
1638
 
       posrcprefix="$srcdir/"
1639
 
     else
1640
 
       posrcprefix="../$srcdir/"
1641
 
     fi
1642
 
   else
1643
 
     posrcprefix="../"
1644
 
   fi
1645
 
   rm -f po/POTFILES
1646
 
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
1647
 
        < $srcdir/po/POTFILES.in > po/POTFILES
1648
 
  ])
1649
 
 
1650
 
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
1651
 
# -------------------------------
1652
 
# Define VARIABLE to the location where catalog files will
1653
 
# be installed by po/Makefile.
1654
 
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
1655
 
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
1656
 
glib_save_prefix="$prefix"
1657
 
glib_save_exec_prefix="$exec_prefix"
1658
 
glib_save_datarootdir="$datarootdir"
1659
 
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1660
 
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
1661
 
datarootdir=`eval echo "${datarootdir}"`
1662
 
if test "x$CATOBJEXT" = "x.mo" ; then
1663
 
  localedir=`eval echo "${libdir}/locale"`
1664
 
else
1665
 
  localedir=`eval echo "${datadir}/locale"`
1666
 
fi
1667
 
prefix="$glib_save_prefix"
1668
 
exec_prefix="$glib_save_exec_prefix"
1669
 
datarootdir="$glib_save_datarootdir"
1670
 
AC_DEFINE_UNQUOTED($1, "$localedir",
1671
 
  [Define the location where the catalogs will be installed])
1672
 
])
1673
 
 
1674
 
dnl
1675
 
dnl Now the definitions that aclocal will find
1676
 
dnl
1677
 
ifdef(glib_configure_ac,[],[
1678
 
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
1679
 
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
1680
 
])dnl
1681
 
 
1682
 
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
1683
 
1684
 
# Create a temporary file with TEST-FILE as its contents and pass the
1685
 
# file name to PROGRAM.  Perform ACTION-IF-PASS if PROGRAM exits with
1686
 
# 0 and perform ACTION-IF-FAIL for any other exit status.
1687
 
AC_DEFUN([GLIB_RUN_PROG],
1688
 
[cat >conftest.foo <<_ACEOF
1689
 
$2
1690
 
_ACEOF
1691
 
if AC_RUN_LOG([$1 conftest.foo]); then
1692
 
  m4_ifval([$3], [$3], [:])
1693
 
m4_ifvaln([$4], [else $4])dnl
1694
 
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
1695
 
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
1696
 
fi])
1697
 
 
1698
 
 
1699
 
# gnome-common.m4
1700
 
#
1701
 
# serial 3
1702
 
1703
 
 
1704
 
dnl GNOME_COMMON_INIT
1705
 
 
1706
 
AU_DEFUN([GNOME_COMMON_INIT],
1707
 
[
1708
 
  dnl this macro should come after AC_CONFIG_MACRO_DIR
1709
 
  AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
1710
 
 
1711
 
  dnl ensure that when the Automake generated makefile calls aclocal,
1712
 
  dnl it honours the $ACLOCAL_FLAGS environment variable
1713
 
  ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
1714
 
  if test -n "$ac_macro_dir"; then
1715
 
    ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
1716
 
  fi
1717
 
 
1718
 
  AC_SUBST([ACLOCAL_AMFLAGS])
1719
 
],
1720
 
[[$0: This macro is deprecated. You should set put "ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}"
1721
 
in your top-level Makefile.am, instead, where "m4" is the macro directory set
1722
 
with AC_CONFIG_MACRO_DIR() in your configure.ac]])
1723
 
 
1724
 
AC_DEFUN([GNOME_DEBUG_CHECK],
1725
 
[
1726
 
        AC_ARG_ENABLE([debug],
1727
 
                      AC_HELP_STRING([--enable-debug],
1728
 
                                     [turn on debugging]),,
1729
 
                      [enable_debug=no])
1730
 
 
1731
 
        if test x$enable_debug = xyes ; then
1732
 
            AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
1733
 
                [Enable additional debugging at the expense of performance and size])
1734
 
        fi
1735
 
])
1736
 
 
1737
 
dnl GNOME_MAINTAINER_MODE_DEFINES ()
1738
 
dnl define DISABLE_DEPRECATED
1739
 
dnl
1740
 
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
1741
 
[
1742
 
        AC_REQUIRE([AM_MAINTAINER_MODE])
1743
 
 
1744
 
        DISABLE_DEPRECATED=""
1745
 
        if test $USE_MAINTAINER_MODE = yes; then
1746
 
                DOMAINS="GCONF BONOBO BONOBO_UI GNOME LIBGLADE GNOME_VFS WNCK LIBSOUP"
1747
 
                for DOMAIN in $DOMAINS; do
1748
 
                       DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
1749
 
                done
1750
 
        fi
1751
 
 
1752
 
        AC_SUBST(DISABLE_DEPRECATED)
1753
 
])
1754
 
 
1755
 
dnl GNOME_COMPILE_WARNINGS
1756
 
dnl Turn on many useful compiler warnings
1757
 
dnl For now, only works on GCC
1758
 
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
1759
 
    dnl ******************************
1760
 
    dnl More compiler warnings
1761
 
    dnl ******************************
1762
 
 
1763
 
    AC_ARG_ENABLE(compile-warnings, 
1764
 
                  AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
1765
 
                                 [Turn on compiler warnings]),,
1766
 
                  [enable_compile_warnings="m4_default([$1],[yes])"])
1767
 
 
1768
 
    warnCFLAGS=
1769
 
    if test "x$GCC" != xyes; then
1770
 
        enable_compile_warnings=no
1771
 
    fi
1772
 
 
1773
 
    warning_flags=
1774
 
    realsave_CFLAGS="$CFLAGS"
1775
 
 
1776
 
    case "$enable_compile_warnings" in
1777
 
    no)
1778
 
        warning_flags=
1779
 
        ;;
1780
 
    minimum)
1781
 
        warning_flags="-Wall"
1782
 
        ;;
1783
 
    yes)
1784
 
        warning_flags="-Wall -Wmissing-prototypes"
1785
 
        ;;
1786
 
    maximum|error)
1787
 
        warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
1788
 
        CFLAGS="$warning_flags $CFLAGS"
1789
 
        for option in -Wno-sign-compare; do
1790
 
                SAVE_CFLAGS="$CFLAGS"
1791
 
                CFLAGS="$CFLAGS $option"
1792
 
                AC_MSG_CHECKING([whether gcc understands $option])
1793
 
                AC_TRY_COMPILE([], [],
1794
 
                        has_option=yes,
1795
 
                        has_option=no,)
1796
 
                CFLAGS="$SAVE_CFLAGS"
1797
 
                AC_MSG_RESULT($has_option)
1798
 
                if test $has_option = yes; then
1799
 
                  warning_flags="$warning_flags $option"
1800
 
                fi
1801
 
                unset has_option
1802
 
                unset SAVE_CFLAGS
1803
 
        done
1804
 
        unset option
1805
 
        if test "$enable_compile_warnings" = "error" ; then
1806
 
            warning_flags="$warning_flags -Werror"
1807
 
        fi
1808
 
        ;;
1809
 
    *)
1810
 
        AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
1811
 
        ;;
1812
 
    esac
1813
 
    CFLAGS="$realsave_CFLAGS"
1814
 
    AC_MSG_CHECKING(what warning flags to pass to the C compiler)
1815
 
    AC_MSG_RESULT($warning_flags)
1816
 
 
1817
 
    AC_ARG_ENABLE(iso-c,
1818
 
                  AC_HELP_STRING([--enable-iso-c],
1819
 
                                 [Try to warn if code is not ISO C ]),,
1820
 
                  [enable_iso_c=no])
1821
 
 
1822
 
    AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
1823
 
    complCFLAGS=
1824
 
    if test "x$enable_iso_c" != "xno"; then
1825
 
        if test "x$GCC" = "xyes"; then
1826
 
        case " $CFLAGS " in
1827
 
            *[\ \       ]-ansi[\ \      ]*) ;;
1828
 
            *) complCFLAGS="$complCFLAGS -ansi" ;;
1829
 
        esac
1830
 
        case " $CFLAGS " in
1831
 
            *[\ \       ]-pedantic[\ \  ]*) ;;
1832
 
            *) complCFLAGS="$complCFLAGS -pedantic" ;;
1833
 
        esac
1834
 
        fi
1835
 
    fi
1836
 
    AC_MSG_RESULT($complCFLAGS)
1837
 
 
1838
 
    WARN_CFLAGS="$warning_flags $complCFLAGS"
1839
 
    AC_SUBST(WARN_CFLAGS)
1840
 
])
1841
 
 
1842
 
dnl For C++, do basically the same thing.
1843
 
 
1844
 
AC_DEFUN([GNOME_CXX_WARNINGS],[
1845
 
  AC_ARG_ENABLE(cxx-warnings,
1846
 
                AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
1847
 
                               [Turn on compiler warnings.]),,
1848
 
                [enable_cxx_warnings="m4_default([$1],[minimum])"])
1849
 
 
1850
 
  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
1851
 
  warnCXXFLAGS=
1852
 
  if test "x$GXX" != xyes; then
1853
 
    enable_cxx_warnings=no
1854
 
  fi
1855
 
  if test "x$enable_cxx_warnings" != "xno"; then
1856
 
    if test "x$GXX" = "xyes"; then
1857
 
      case " $CXXFLAGS " in
1858
 
      *[\ \     ]-Wall[\ \      ]*) ;;
1859
 
      *) warnCXXFLAGS="-Wall -Wno-unused" ;;
1860
 
      esac
1861
 
 
1862
 
      ## -W is not all that useful.  And it cannot be controlled
1863
 
      ## with individual -Wno-xxx flags, unlike -Wall
1864
 
      if test "x$enable_cxx_warnings" = "xyes"; then
1865
 
        warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
1866
 
      fi
1867
 
    fi
1868
 
  fi
1869
 
  AC_MSG_RESULT($warnCXXFLAGS)
1870
 
 
1871
 
   AC_ARG_ENABLE(iso-cxx,
1872
 
                 AC_HELP_STRING([--enable-iso-cxx],
1873
 
                                [Try to warn if code is not ISO C++ ]),,
1874
 
                 [enable_iso_cxx=no])
1875
 
 
1876
 
   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
1877
 
   complCXXFLAGS=
1878
 
   if test "x$enable_iso_cxx" != "xno"; then
1879
 
     if test "x$GXX" = "xyes"; then
1880
 
      case " $CXXFLAGS " in
1881
 
      *[\ \     ]-ansi[\ \      ]*) ;;
1882
 
      *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
1883
 
      esac
1884
 
 
1885
 
      case " $CXXFLAGS " in
1886
 
      *[\ \     ]-pedantic[\ \  ]*) ;;
1887
 
      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
1888
 
      esac
1889
 
     fi
1890
 
   fi
1891
 
  AC_MSG_RESULT($complCXXFLAGS)
1892
 
 
1893
 
  WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
1894
 
  AC_SUBST(WARN_CXXFLAGS)
1895
 
])
1896
 
 
1897
 
dnl GLIB_GSETTINGS
1898
 
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
1899
 
dnl the schema should be compiled
1900
 
dnl
1901
 
 
1902
 
AC_DEFUN([GLIB_GSETTINGS],
1903
 
[
1904
 
  m4_pattern_allow([AM_V_GEN])
1905
 
  AC_ARG_ENABLE(schemas-compile,
1906
 
                AS_HELP_STRING([--disable-schemas-compile],
1907
 
                               [Disable regeneration of gschemas.compiled on install]),
1908
 
                [case ${enableval} in
1909
 
                  yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE=""  ;;
1910
 
                  no)  GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
1911
 
                  *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
1912
 
                 esac])
1913
 
  AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
1914
 
  PKG_PROG_PKG_CONFIG([0.16])
1915
 
  AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
1916
 
  if test x$cross_compiling != xyes; then
1917
 
    GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
1918
 
  else
1919
 
    AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
1920
 
  fi
1921
 
  AC_SUBST(GLIB_COMPILE_SCHEMAS)
1922
 
  if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
1923
 
    ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
1924
 
  else
1925
 
    ifelse([$1],,[:],[$1])
1926
 
  fi
1927
 
 
1928
 
  GSETTINGS_RULES='
1929
 
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
1930
 
 
1931
 
mostlyclean-am: clean-gsettings-schemas
1932
 
 
1933
 
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
1934
 
 
1935
 
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
1936
 
        $(AM_V_GEN) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${d}$< && touch [$]@
1937
 
 
1938
 
all-am: $(gsettings_SCHEMAS:.xml=.valid)
1939
 
uninstall-am: uninstall-gsettings-schemas
1940
 
install-data-am: install-gsettings-schemas
1941
 
 
1942
 
.SECONDARY: $(gsettings_SCHEMAS)
1943
 
 
1944
 
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
1945
 
        @$(NORMAL_INSTALL)
1946
 
        if test -n "$^"; then \
1947
 
                test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
1948
 
                $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
1949
 
                test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
1950
 
        fi
1951
 
 
1952
 
uninstall-gsettings-schemas:
1953
 
        @$(NORMAL_UNINSTALL)
1954
 
        @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
1955
 
        files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
1956
 
        test -n "$$files" || exit 0; \
1957
 
        echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
1958
 
        cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
1959
 
        test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
1960
 
 
1961
 
clean-gsettings-schemas:
1962
 
        rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
1963
 
 
1964
 
ifdef gsettings_ENUM_NAMESPACE
1965
 
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
1966
 
        $(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead "  <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod "    <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail "  </@type@>" --ftail "</schemalist>" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@
1967
 
endif
1968
 
'
1969
 
  _GSETTINGS_SUBST(GSETTINGS_RULES)
1970
 
])
1971
 
 
1972
 
dnl _GSETTINGS_SUBST(VARIABLE)
1973
 
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
1974
 
AC_DEFUN([_GSETTINGS_SUBST],
1975
 
[
1976
 
AC_SUBST([$1])
1977
 
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
1978
 
]
1979
 
)
1980
 
 
1981
2033
m4_include([m4/intltool.m4])
1982
2034
m4_include([m4/libtool.m4])
1983
2035
m4_include([m4/ltoptions.m4])