~ubuntu-branches/ubuntu/oneiric/gnome-desktop3/oneiric

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-01-13 11:33:39 UTC
  • mfrom: (1.2.3 upstream) (1.1.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20110113113339-656gckpk55m1bugr
Tags: 2.91.6-1ubuntu1
* Rebase on Debian
* debian/control.in:
  - downgrade the gtk requirement, the newest version is not required
* debian/rules:
  - distributor is Ubuntu

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