~ubuntu-branches/ubuntu/quantal/epiphany-extensions/quantal

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2011-04-14 19:04:24 UTC
  • mfrom: (1.1.43 upstream) (2.3.16 experimental)
  • Revision ID: james.westby@ubuntu.com-20110414190424-df2o8wz2pei97hbd
Tags: 3.0.0-2
debian/control.in: bump build-dep on epiphany.

Show diffs side-by-side

added added

removed removed

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