~ubuntu-branches/ubuntu/lucid/libgweather/lucid-updates

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-03-30 11:02:50 UTC
  • mfrom: (1.1.25 upstream)
  • Revision ID: james.westby@ubuntu.com-20100330110250-x31ubgbuop62twtr
Tags: 2.30.0-0ubuntu1
* New upstream version
* debian/patches/99_autoreconf.patch:
  - new version update

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
 
# Configure paths for GLIB
68
 
# Owen Taylor     1997-2001
69
 
 
70
 
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
71
 
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
72
 
dnl gthread, or gio is specified in MODULES, pass to pkg-config
73
 
dnl
74
 
AC_DEFUN([AM_PATH_GLIB_2_0],
75
 
[dnl 
76
 
dnl Get the cflags and libraries from pkg-config
77
 
dnl
78
 
AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
79
 
                    , enable_glibtest=yes)
80
 
 
81
 
  pkg_config_args=glib-2.0
82
 
  for module in . $4
83
 
  do
84
 
      case "$module" in
85
 
         gmodule) 
86
 
             pkg_config_args="$pkg_config_args gmodule-2.0"
87
 
         ;;
88
 
         gmodule-no-export) 
89
 
             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
90
 
         ;;
91
 
         gobject) 
92
 
             pkg_config_args="$pkg_config_args gobject-2.0"
93
 
         ;;
94
 
         gthread) 
95
 
             pkg_config_args="$pkg_config_args gthread-2.0"
96
 
         ;;
97
 
         gio*) 
98
 
             pkg_config_args="$pkg_config_args $module-2.0"
99
 
         ;;
100
 
      esac
101
 
  done
102
 
 
103
 
  PKG_PROG_PKG_CONFIG([0.16])
104
 
 
105
 
  no_glib=""
106
 
 
107
 
  if test "x$PKG_CONFIG" = x ; then
108
 
    no_glib=yes
109
 
    PKG_CONFIG=no
110
 
  fi
111
 
 
112
 
  min_glib_version=ifelse([$1], ,2.0.0,$1)
113
 
  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
114
 
 
115
 
  if test x$PKG_CONFIG != xno ; then
116
 
    ## don't try to run the test against uninstalled libtool libs
117
 
    if $PKG_CONFIG --uninstalled $pkg_config_args; then
118
 
          echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
119
 
          enable_glibtest=no
120
 
    fi
121
 
 
122
 
    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
123
 
          :
124
 
    else
125
 
          no_glib=yes
126
 
    fi
127
 
  fi
128
 
 
129
 
  if test x"$no_glib" = x ; then
130
 
    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
131
 
    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
132
 
    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
133
 
 
134
 
    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
135
 
    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
136
 
    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
137
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
138
 
    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
139
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
140
 
    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
141
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
142
 
    if test "x$enable_glibtest" = "xyes" ; then
143
 
      ac_save_CFLAGS="$CFLAGS"
144
 
      ac_save_LIBS="$LIBS"
145
 
      CFLAGS="$CFLAGS $GLIB_CFLAGS"
146
 
      LIBS="$GLIB_LIBS $LIBS"
147
 
dnl
148
 
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
149
 
dnl checks the results of pkg-config to some extent)
150
 
dnl
151
 
      rm -f conf.glibtest
152
 
      AC_TRY_RUN([
153
 
#include <glib.h>
154
 
#include <stdio.h>
155
 
#include <stdlib.h>
156
 
 
157
 
int 
158
 
main ()
159
 
{
160
 
  int major, minor, micro;
161
 
  char *tmp_version;
162
 
  int ignored;
163
 
 
164
 
  ignored = system ("touch conf.glibtest");
165
 
 
166
 
  /* HP/UX 9 (%@#!) writes to sscanf strings */
167
 
  tmp_version = g_strdup("$min_glib_version");
168
 
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
169
 
     printf("%s, bad version string\n", "$min_glib_version");
170
 
     exit(1);
171
 
   }
172
 
 
173
 
  if ((glib_major_version != $glib_config_major_version) ||
174
 
      (glib_minor_version != $glib_config_minor_version) ||
175
 
      (glib_micro_version != $glib_config_micro_version))
176
 
    {
177
 
      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
178
 
             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
179
 
             glib_major_version, glib_minor_version, glib_micro_version);
180
 
      printf ("*** was found! If pkg-config was correct, then it is best\n");
181
 
      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
182
 
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
183
 
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
184
 
      printf("*** required on your system.\n");
185
 
      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
186
 
      printf("*** to point to the correct configuration files\n");
187
 
    } 
188
 
  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
189
 
           (glib_minor_version != GLIB_MINOR_VERSION) ||
190
 
           (glib_micro_version != GLIB_MICRO_VERSION))
191
 
    {
192
 
      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
193
 
             GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
194
 
      printf("*** library (version %d.%d.%d)\n",
195
 
             glib_major_version, glib_minor_version, glib_micro_version);
196
 
    }
197
 
  else
198
 
    {
199
 
      if ((glib_major_version > major) ||
200
 
        ((glib_major_version == major) && (glib_minor_version > minor)) ||
201
 
        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
202
 
      {
203
 
        return 0;
204
 
       }
205
 
     else
206
 
      {
207
 
        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
208
 
               glib_major_version, glib_minor_version, glib_micro_version);
209
 
        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
210
 
               major, minor, micro);
211
 
        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
212
 
        printf("***\n");
213
 
        printf("*** If you have already installed a sufficiently new version, this error\n");
214
 
        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
215
 
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
216
 
        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
217
 
        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
218
 
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
219
 
        printf("*** so that the correct libraries are found at run-time))\n");
220
 
      }
221
 
    }
222
 
  return 1;
223
 
}
224
 
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
225
 
       CFLAGS="$ac_save_CFLAGS"
226
 
       LIBS="$ac_save_LIBS"
227
 
     fi
228
 
  fi
229
 
  if test "x$no_glib" = x ; then
230
 
     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
231
 
     ifelse([$2], , :, [$2])     
232
 
  else
233
 
     AC_MSG_RESULT(no)
234
 
     if test "$PKG_CONFIG" = "no" ; then
235
 
       echo "*** A new enough version of pkg-config was not found."
236
 
       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
237
 
     else
238
 
       if test -f conf.glibtest ; then
239
 
        :
240
 
       else
241
 
          echo "*** Could not run GLIB test program, checking why..."
242
 
          ac_save_CFLAGS="$CFLAGS"
243
 
          ac_save_LIBS="$LIBS"
244
 
          CFLAGS="$CFLAGS $GLIB_CFLAGS"
245
 
          LIBS="$LIBS $GLIB_LIBS"
246
 
          AC_TRY_LINK([
247
 
#include <glib.h>
248
 
#include <stdio.h>
249
 
],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
250
 
        [ echo "*** The test program compiled, but did not run. This usually means"
251
 
          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
252
 
          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
253
 
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
254
 
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
255
 
          echo "*** is required on your system"
256
 
          echo "***"
257
 
          echo "*** If you have an old version installed, it is best to remove it, although"
258
 
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
259
 
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
260
 
          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
261
 
          CFLAGS="$ac_save_CFLAGS"
262
 
          LIBS="$ac_save_LIBS"
263
 
       fi
264
 
     fi
265
 
     GLIB_CFLAGS=""
266
 
     GLIB_LIBS=""
267
 
     GLIB_GENMARSHAL=""
268
 
     GOBJECT_QUERY=""
269
 
     GLIB_MKENUMS=""
270
 
     ifelse([$3], , :, [$3])
271
 
  fi
272
 
  AC_SUBST(GLIB_CFLAGS)
273
 
  AC_SUBST(GLIB_LIBS)
274
 
  AC_SUBST(GLIB_GENMARSHAL)
275
 
  AC_SUBST(GOBJECT_QUERY)
276
 
  AC_SUBST(GLIB_MKENUMS)
277
 
  rm -f conf.glibtest
278
 
])
279
 
 
280
 
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
281
 
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
282
 
#
283
 
# This file is free software, distributed under the terms of the GNU
284
 
# General Public License.  As a special exception to the GNU General
285
 
# Public License, this file may be distributed as part of a program
286
 
# that contains a configuration script generated by Autoconf, under
287
 
# the same distribution terms as the rest of that program.
288
 
#
289
 
# This file can be copied and used freely without restrictions.  It can
290
 
# be used in projects which are not available under the GNU Public License
291
 
# but which still want to provide support for the GNU gettext functionality.
292
 
#
293
 
# Macro to add for using GNU gettext.
294
 
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
295
 
#
296
 
# Modified to never use included libintl. 
297
 
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
298
 
#
299
 
# Major rework to remove unused code
300
 
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
301
 
#
302
 
# Added better handling of ALL_LINGUAS from GNU gettext version 
303
 
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
304
 
#
305
 
# Modified to require ngettext
306
 
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
307
 
#
308
 
# We need this here as well, since someone might use autoconf-2.5x
309
 
# to configure GLib then an older version to configure a package
310
 
# using AM_GLIB_GNU_GETTEXT
311
 
AC_PREREQ(2.53)
312
 
 
313
 
dnl
314
 
dnl We go to great lengths to make sure that aclocal won't 
315
 
dnl try to pull in the installed version of these macros
316
 
dnl when running aclocal in the glib directory.
317
 
dnl
318
 
m4_copy([AC_DEFUN],[glib_DEFUN])
319
 
m4_copy([AC_REQUIRE],[glib_REQUIRE])
320
 
dnl
321
 
dnl At the end, if we're not within glib, we'll define the public
322
 
dnl definitions in terms of our private definitions.
323
 
dnl
324
 
 
325
 
# GLIB_LC_MESSAGES
326
 
#--------------------
327
 
glib_DEFUN([GLIB_LC_MESSAGES],
328
 
  [AC_CHECK_HEADERS([locale.h])
329
 
    if test $ac_cv_header_locale_h = yes; then
330
 
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
331
 
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
332
 
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
333
 
    if test $am_cv_val_LC_MESSAGES = yes; then
334
 
      AC_DEFINE(HAVE_LC_MESSAGES, 1,
335
 
        [Define if your <locale.h> file defines LC_MESSAGES.])
336
 
    fi
337
 
  fi])
338
 
 
339
 
# GLIB_PATH_PROG_WITH_TEST
340
 
#----------------------------
341
 
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
342
 
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
343
 
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
344
 
[# Extract the first word of "$2", so it can be a program name with args.
345
 
set dummy $2; ac_word=[$]2
346
 
AC_MSG_CHECKING([for $ac_word])
347
 
AC_CACHE_VAL(ac_cv_path_$1,
348
 
[case "[$]$1" in
349
 
  /*)
350
 
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
351
 
  ;;
352
 
  *)
353
 
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
354
 
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
355
 
    test -z "$ac_dir" && ac_dir=.
356
 
    if test -f $ac_dir/$ac_word; then
357
 
      if [$3]; then
358
 
        ac_cv_path_$1="$ac_dir/$ac_word"
359
 
        break
360
 
      fi
361
 
    fi
362
 
  done
363
 
  IFS="$ac_save_ifs"
364
 
dnl If no 4th arg is given, leave the cache variable unset,
365
 
dnl so AC_PATH_PROGS will keep looking.
366
 
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
367
 
])dnl
368
 
  ;;
369
 
esac])dnl
370
 
$1="$ac_cv_path_$1"
371
 
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
372
 
  AC_MSG_RESULT([$]$1)
373
 
else
374
 
  AC_MSG_RESULT(no)
375
 
fi
376
 
AC_SUBST($1)dnl
377
 
])
378
 
 
379
 
# GLIB_WITH_NLS
380
 
#-----------------
381
 
glib_DEFUN([GLIB_WITH_NLS],
382
 
  dnl NLS is obligatory
383
 
  [USE_NLS=yes
384
 
    AC_SUBST(USE_NLS)
385
 
 
386
 
    gt_cv_have_gettext=no
387
 
 
388
 
    CATOBJEXT=NONE
389
 
    XGETTEXT=:
390
 
    INTLLIBS=
391
 
 
392
 
    AC_CHECK_HEADER(libintl.h,
393
 
     [gt_cv_func_dgettext_libintl="no"
394
 
      libintl_extra_libs=""
395
 
 
396
 
      #
397
 
      # First check in libc
398
 
      #
399
 
      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
400
 
        [AC_TRY_LINK([
401
 
#include <libintl.h>
402
 
],
403
 
         [return !ngettext ("","", 1)],
404
 
          gt_cv_func_ngettext_libc=yes,
405
 
          gt_cv_func_ngettext_libc=no)
406
 
        ])
407
 
  
408
 
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
409
 
              AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
410
 
                [AC_TRY_LINK([
411
 
#include <libintl.h>
412
 
],
413
 
                  [return !dgettext ("","")],
414
 
                  gt_cv_func_dgettext_libc=yes,
415
 
                  gt_cv_func_dgettext_libc=no)
416
 
                ])
417
 
      fi
418
 
  
419
 
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
420
 
        AC_CHECK_FUNCS(bind_textdomain_codeset)
421
 
      fi
422
 
 
423
 
      #
424
 
      # If we don't have everything we want, check in libintl
425
 
      #
426
 
      if test "$gt_cv_func_dgettext_libc" != "yes" \
427
 
         || test "$gt_cv_func_ngettext_libc" != "yes" \
428
 
         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
429
 
        
430
 
        AC_CHECK_LIB(intl, bindtextdomain,
431
 
            [AC_CHECK_LIB(intl, ngettext,
432
 
                    [AC_CHECK_LIB(intl, dgettext,
433
 
                                  gt_cv_func_dgettext_libintl=yes)])])
434
 
 
435
 
        if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
436
 
          AC_MSG_CHECKING([if -liconv is needed to use gettext])
437
 
          AC_MSG_RESULT([])
438
 
          AC_CHECK_LIB(intl, ngettext,
439
 
                [AC_CHECK_LIB(intl, dcgettext,
440
 
                       [gt_cv_func_dgettext_libintl=yes
441
 
                        libintl_extra_libs=-liconv],
442
 
                        :,-liconv)],
443
 
                :,-liconv)
444
 
        fi
445
 
 
446
 
        #
447
 
        # If we found libintl, then check in it for bind_textdomain_codeset();
448
 
        # we'll prefer libc if neither have bind_textdomain_codeset(),
449
 
        # and both have dgettext and ngettext
450
 
        #
451
 
        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
452
 
          glib_save_LIBS="$LIBS"
453
 
          LIBS="$LIBS -lintl $libintl_extra_libs"
454
 
          unset ac_cv_func_bind_textdomain_codeset
455
 
          AC_CHECK_FUNCS(bind_textdomain_codeset)
456
 
          LIBS="$glib_save_LIBS"
457
 
 
458
 
          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
459
 
            gt_cv_func_dgettext_libc=no
460
 
          else
461
 
            if test "$gt_cv_func_dgettext_libc" = "yes" \
462
 
                && test "$gt_cv_func_ngettext_libc" = "yes"; then
463
 
              gt_cv_func_dgettext_libintl=no
464
 
            fi
465
 
          fi
466
 
        fi
467
 
      fi
468
 
 
469
 
      if test "$gt_cv_func_dgettext_libc" = "yes" \
470
 
        || test "$gt_cv_func_dgettext_libintl" = "yes"; then
471
 
        gt_cv_have_gettext=yes
472
 
      fi
473
 
  
474
 
      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
475
 
        INTLLIBS="-lintl $libintl_extra_libs"
476
 
      fi
477
 
  
478
 
      if test "$gt_cv_have_gettext" = "yes"; then
479
 
        AC_DEFINE(HAVE_GETTEXT,1,
480
 
          [Define if the GNU gettext() function is already present or preinstalled.])
481
 
        GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
482
 
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
483
 
        if test "$MSGFMT" != "no"; then
484
 
          glib_save_LIBS="$LIBS"
485
 
          LIBS="$LIBS $INTLLIBS"
486
 
          AC_CHECK_FUNCS(dcgettext)
487
 
          MSGFMT_OPTS=
488
 
          AC_MSG_CHECKING([if msgfmt accepts -c])
489
 
          GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
490
 
msgid ""
491
 
msgstr ""
492
 
"Content-Type: text/plain; charset=UTF-8\n"
493
 
"Project-Id-Version: test 1.0\n"
494
 
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
495
 
"Last-Translator: test <foo@bar.xx>\n"
496
 
"Language-Team: C <LL@li.org>\n"
497
 
"MIME-Version: 1.0\n"
498
 
"Content-Transfer-Encoding: 8bit\n"
499
 
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
500
 
          AC_SUBST(MSGFMT_OPTS)
501
 
          AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
502
 
          GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
503
 
            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
504
 
          AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
505
 
                         return _nl_msg_cat_cntr],
506
 
            [CATOBJEXT=.gmo 
507
 
             DATADIRNAME=share],
508
 
            [case $host in
509
 
            *-*-solaris*)
510
 
            dnl On Solaris, if bind_textdomain_codeset is in libc,
511
 
            dnl GNU format message catalog is always supported,
512
 
            dnl since both are added to the libc all together.
513
 
            dnl Hence, we'd like to go with DATADIRNAME=share and
514
 
            dnl and CATOBJEXT=.gmo in this case.
515
 
            AC_CHECK_FUNC(bind_textdomain_codeset,
516
 
              [CATOBJEXT=.gmo 
517
 
               DATADIRNAME=share],
518
 
              [CATOBJEXT=.mo
519
 
               DATADIRNAME=lib])
520
 
            ;;
521
 
            *)
522
 
            CATOBJEXT=.mo
523
 
            DATADIRNAME=lib
524
 
            ;;
525
 
            esac])
526
 
          LIBS="$glib_save_LIBS"
527
 
          INSTOBJEXT=.mo
528
 
        else
529
 
          gt_cv_have_gettext=no
530
 
        fi
531
 
      fi
532
 
    ])
533
 
 
534
 
    if test "$gt_cv_have_gettext" = "yes" ; then
535
 
      AC_DEFINE(ENABLE_NLS, 1,
536
 
        [always defined to indicate that i18n is enabled])
537
 
    fi
538
 
 
539
 
    dnl Test whether we really found GNU xgettext.
540
 
    if test "$XGETTEXT" != ":"; then
541
 
      dnl If it is not GNU xgettext we define it as : so that the
542
 
      dnl Makefiles still can work.
543
 
      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
544
 
        : ;
545
 
      else
546
 
        AC_MSG_RESULT(
547
 
          [found xgettext program is not GNU xgettext; ignore it])
548
 
        XGETTEXT=":"
549
 
      fi
550
 
    fi
551
 
 
552
 
    # We need to process the po/ directory.
553
 
    POSUB=po
554
 
 
555
 
    AC_OUTPUT_COMMANDS(
556
 
      [case "$CONFIG_FILES" in *po/Makefile.in*)
557
 
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
558
 
      esac])
559
 
 
560
 
    dnl These rules are solely for the distribution goal.  While doing this
561
 
    dnl we only have to keep exactly one list of the available catalogs
562
 
    dnl in configure.in.
563
 
    for lang in $ALL_LINGUAS; do
564
 
      GMOFILES="$GMOFILES $lang.gmo"
565
 
      POFILES="$POFILES $lang.po"
566
 
    done
567
 
 
568
 
    dnl Make all variables we use known to autoconf.
569
 
    AC_SUBST(CATALOGS)
570
 
    AC_SUBST(CATOBJEXT)
571
 
    AC_SUBST(DATADIRNAME)
572
 
    AC_SUBST(GMOFILES)
573
 
    AC_SUBST(INSTOBJEXT)
574
 
    AC_SUBST(INTLLIBS)
575
 
    AC_SUBST(PO_IN_DATADIR_TRUE)
576
 
    AC_SUBST(PO_IN_DATADIR_FALSE)
577
 
    AC_SUBST(POFILES)
578
 
    AC_SUBST(POSUB)
579
 
  ])
580
 
 
581
 
# AM_GLIB_GNU_GETTEXT
582
 
# -------------------
583
 
# Do checks necessary for use of gettext. If a suitable implementation 
584
 
# of gettext is found in either in libintl or in the C library,
585
 
# it will set INTLLIBS to the libraries needed for use of gettext
586
 
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
587
 
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
588
 
# on various variables needed by the Makefile.in.in installed by 
589
 
# glib-gettextize.
590
 
dnl
591
 
glib_DEFUN([GLIB_GNU_GETTEXT],
592
 
  [AC_REQUIRE([AC_PROG_CC])dnl
593
 
   AC_REQUIRE([AC_HEADER_STDC])dnl
594
 
   
595
 
   GLIB_LC_MESSAGES
596
 
   GLIB_WITH_NLS
597
 
 
598
 
   if test "$gt_cv_have_gettext" = "yes"; then
599
 
     if test "x$ALL_LINGUAS" = "x"; then
600
 
       LINGUAS=
601
 
     else
602
 
       AC_MSG_CHECKING(for catalogs to be installed)
603
 
       NEW_LINGUAS=
604
 
       for presentlang in $ALL_LINGUAS; do
605
 
         useit=no
606
 
         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
607
 
           desiredlanguages="$LINGUAS"
608
 
         else
609
 
           desiredlanguages="$ALL_LINGUAS"
610
 
         fi
611
 
         for desiredlang in $desiredlanguages; do
612
 
           # Use the presentlang catalog if desiredlang is
613
 
           #   a. equal to presentlang, or
614
 
           #   b. a variant of presentlang (because in this case,
615
 
           #      presentlang can be used as a fallback for messages
616
 
           #      which are not translated in the desiredlang catalog).
617
 
           case "$desiredlang" in
618
 
             "$presentlang"*) useit=yes;;
619
 
           esac
620
 
         done
621
 
         if test $useit = yes; then
622
 
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
623
 
         fi
624
 
       done
625
 
       LINGUAS=$NEW_LINGUAS
626
 
       AC_MSG_RESULT($LINGUAS)
627
 
     fi
628
 
 
629
 
     dnl Construct list of names of catalog files to be constructed.
630
 
     if test -n "$LINGUAS"; then
631
 
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
632
 
     fi
633
 
   fi
634
 
 
635
 
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
636
 
   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
637
 
   dnl Try to locate is.
638
 
   MKINSTALLDIRS=
639
 
   if test -n "$ac_aux_dir"; then
640
 
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
641
 
   fi
642
 
   if test -z "$MKINSTALLDIRS"; then
643
 
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
644
 
   fi
645
 
   AC_SUBST(MKINSTALLDIRS)
646
 
 
647
 
   dnl Generate list of files to be processed by xgettext which will
648
 
   dnl be included in po/Makefile.
649
 
   test -d po || mkdir po
650
 
   if test "x$srcdir" != "x."; then
651
 
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
652
 
       posrcprefix="$srcdir/"
653
 
     else
654
 
       posrcprefix="../$srcdir/"
655
 
     fi
656
 
   else
657
 
     posrcprefix="../"
658
 
   fi
659
 
   rm -f po/POTFILES
660
 
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
661
 
        < $srcdir/po/POTFILES.in > po/POTFILES
662
 
  ])
663
 
 
664
 
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
665
 
# -------------------------------
666
 
# Define VARIABLE to the location where catalog files will
667
 
# be installed by po/Makefile.
668
 
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
669
 
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
670
 
glib_save_prefix="$prefix"
671
 
glib_save_exec_prefix="$exec_prefix"
672
 
glib_save_datarootdir="$datarootdir"
673
 
test "x$prefix" = xNONE && prefix=$ac_default_prefix
674
 
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
675
 
datarootdir=`eval echo "${datarootdir}"`
676
 
if test "x$CATOBJEXT" = "x.mo" ; then
677
 
  localedir=`eval echo "${libdir}/locale"`
678
 
else
679
 
  localedir=`eval echo "${datadir}/locale"`
680
 
fi
681
 
prefix="$glib_save_prefix"
682
 
exec_prefix="$glib_save_exec_prefix"
683
 
datarootdir="$glib_save_datarootdir"
684
 
AC_DEFINE_UNQUOTED($1, "$localedir",
685
 
  [Define the location where the catalogs will be installed])
686
 
])
687
 
 
688
 
dnl
689
 
dnl Now the definitions that aclocal will find
690
 
dnl
691
 
ifdef(glib_configure_in,[],[
692
 
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
693
 
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
694
 
])dnl
695
 
 
696
 
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
697
 
698
 
# Create a temporary file with TEST-FILE as its contents and pass the
699
 
# file name to PROGRAM.  Perform ACTION-IF-PASS if PROGRAM exits with
700
 
# 0 and perform ACTION-IF-FAIL for any other exit status.
701
 
AC_DEFUN([GLIB_RUN_PROG],
702
 
[cat >conftest.foo <<_ACEOF
703
 
$2
704
 
_ACEOF
705
 
if AC_RUN_LOG([$1 conftest.foo]); then
706
 
  m4_ifval([$3], [$3], [:])
707
 
m4_ifvaln([$4], [else $4])dnl
708
 
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
709
 
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
710
 
fi])
711
 
 
712
 
 
713
 
# gnome-common.m4
714
 
715
 
 
716
 
dnl GNOME_COMMON_INIT
717
 
 
718
 
AC_DEFUN([GNOME_COMMON_INIT],
719
 
[
720
 
  dnl this macro should come after AC_CONFIG_MACRO_DIR
721
 
  AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
722
 
 
723
 
  dnl ensure that when the Automake generated makefile calls aclocal,
724
 
  dnl it honours the $ACLOCAL_FLAGS environment variable
725
 
  ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
726
 
  if test -n "$ac_macro_dir"; then
727
 
    ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
728
 
  fi
729
 
 
730
 
  AC_SUBST([ACLOCAL_AMFLAGS])
731
 
])
732
 
 
733
 
AC_DEFUN([GNOME_DEBUG_CHECK],
734
 
[
735
 
        AC_ARG_ENABLE([debug],
736
 
                      AC_HELP_STRING([--enable-debug],
737
 
                                     [turn on debugging]),,
738
 
                      [enable_debug=no])
739
 
 
740
 
        if test x$enable_debug = xyes ; then
741
 
            AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
742
 
                [Enable additional debugging at the expense of performance and size])
743
 
        fi
744
 
])
745
 
 
746
 
dnl GNOME_MAINTAINER_MODE_DEFINES ()
747
 
dnl define DISABLE_DEPRECATED
748
 
dnl
749
 
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
750
 
[
751
 
        AC_REQUIRE([AM_MAINTAINER_MODE])
752
 
 
753
 
        DISABLE_DEPRECATED=""
754
 
        if test $USE_MAINTAINER_MODE = yes; then
755
 
                DOMAINS="G ATK PANGO GDK GDK_PIXBUF GTK GCONF BONOBO BONOBO_UI GNOME LIBGLADE VTE GNOME_VFS WNCK LIBSOUP"
756
 
                for DOMAIN in $DOMAINS; do
757
 
                       DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
758
 
                done
759
 
        fi
760
 
 
761
 
        AC_SUBST(DISABLE_DEPRECATED)
762
 
])
763
 
 
764
 
dnl GNOME_COMPILE_WARNINGS
765
 
dnl Turn on many useful compiler warnings
766
 
dnl For now, only works on GCC
767
 
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
768
 
    dnl ******************************
769
 
    dnl More compiler warnings
770
 
    dnl ******************************
771
 
 
772
 
    AC_ARG_ENABLE(compile-warnings, 
773
 
                  AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
774
 
                                 [Turn on compiler warnings]),,
775
 
                  [enable_compile_warnings="m4_default([$1],[yes])"])
776
 
 
777
 
    warnCFLAGS=
778
 
    if test "x$GCC" != xyes; then
779
 
        enable_compile_warnings=no
780
 
    fi
781
 
 
782
 
    warning_flags=
783
 
    realsave_CFLAGS="$CFLAGS"
784
 
 
785
 
    case "$enable_compile_warnings" in
786
 
    no)
787
 
        warning_flags=
788
 
        ;;
789
 
    minimum)
790
 
        warning_flags="-Wall"
791
 
        ;;
792
 
    yes)
793
 
        warning_flags="-Wall -Wmissing-prototypes"
794
 
        ;;
795
 
    maximum|error)
796
 
        warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
797
 
        CFLAGS="$warning_flags $CFLAGS"
798
 
        for option in -Wno-sign-compare; do
799
 
                SAVE_CFLAGS="$CFLAGS"
800
 
                CFLAGS="$CFLAGS $option"
801
 
                AC_MSG_CHECKING([whether gcc understands $option])
802
 
                AC_TRY_COMPILE([], [],
803
 
                        has_option=yes,
804
 
                        has_option=no,)
805
 
                CFLAGS="$SAVE_CFLAGS"
806
 
                AC_MSG_RESULT($has_option)
807
 
                if test $has_option = yes; then
808
 
                  warning_flags="$warning_flags $option"
809
 
                fi
810
 
                unset has_option
811
 
                unset SAVE_CFLAGS
812
 
        done
813
 
        unset option
814
 
        if test "$enable_compile_warnings" = "error" ; then
815
 
            warning_flags="$warning_flags -Werror"
816
 
        fi
817
 
        ;;
818
 
    *)
819
 
        AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
820
 
        ;;
821
 
    esac
822
 
    CFLAGS="$realsave_CFLAGS"
823
 
    AC_MSG_CHECKING(what warning flags to pass to the C compiler)
824
 
    AC_MSG_RESULT($warning_flags)
825
 
 
826
 
    AC_ARG_ENABLE(iso-c,
827
 
                  AC_HELP_STRING([--enable-iso-c],
828
 
                                 [Try to warn if code is not ISO C ]),,
829
 
                  [enable_iso_c=no])
830
 
 
831
 
    AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
832
 
    complCFLAGS=
833
 
    if test "x$enable_iso_c" != "xno"; then
834
 
        if test "x$GCC" = "xyes"; then
835
 
        case " $CFLAGS " in
836
 
            *[\ \       ]-ansi[\ \      ]*) ;;
837
 
            *) complCFLAGS="$complCFLAGS -ansi" ;;
838
 
        esac
839
 
        case " $CFLAGS " in
840
 
            *[\ \       ]-pedantic[\ \  ]*) ;;
841
 
            *) complCFLAGS="$complCFLAGS -pedantic" ;;
842
 
        esac
843
 
        fi
844
 
    fi
845
 
    AC_MSG_RESULT($complCFLAGS)
846
 
 
847
 
    WARN_CFLAGS="$warning_flags $complCFLAGS"
848
 
    AC_SUBST(WARN_CFLAGS)
849
 
])
850
 
 
851
 
dnl For C++, do basically the same thing.
852
 
 
853
 
AC_DEFUN([GNOME_CXX_WARNINGS],[
854
 
  AC_ARG_ENABLE(cxx-warnings,
855
 
                AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
856
 
                               [Turn on compiler warnings.]),,
857
 
                [enable_cxx_warnings="m4_default([$1],[minimum])"])
858
 
 
859
 
  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
860
 
  warnCXXFLAGS=
861
 
  if test "x$GXX" != xyes; then
862
 
    enable_cxx_warnings=no
863
 
  fi
864
 
  if test "x$enable_cxx_warnings" != "xno"; then
865
 
    if test "x$GXX" = "xyes"; then
866
 
      case " $CXXFLAGS " in
867
 
      *[\ \     ]-Wall[\ \      ]*) ;;
868
 
      *) warnCXXFLAGS="-Wall -Wno-unused" ;;
869
 
      esac
870
 
 
871
 
      ## -W is not all that useful.  And it cannot be controlled
872
 
      ## with individual -Wno-xxx flags, unlike -Wall
873
 
      if test "x$enable_cxx_warnings" = "xyes"; then
874
 
        warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
875
 
      fi
876
 
    fi
877
 
  fi
878
 
  AC_MSG_RESULT($warnCXXFLAGS)
879
 
 
880
 
   AC_ARG_ENABLE(iso-cxx,
881
 
                 AC_HELP_STRING([--enable-iso-cxx],
882
 
                                [Try to warn if code is not ISO C++ ]),,
883
 
                 [enable_iso_cxx=no])
884
 
 
885
 
   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
886
 
   complCXXFLAGS=
887
 
   if test "x$enable_iso_cxx" != "xno"; then
888
 
     if test "x$GXX" = "xyes"; then
889
 
      case " $CXXFLAGS " in
890
 
      *[\ \     ]-ansi[\ \      ]*) ;;
891
 
      *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
892
 
      esac
893
 
 
894
 
      case " $CXXFLAGS " in
895
 
      *[\ \     ]-pedantic[\ \  ]*) ;;
896
 
      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
897
 
      esac
898
 
     fi
899
 
   fi
900
 
  AC_MSG_RESULT($complCXXFLAGS)
901
 
 
902
 
  WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
903
 
  AC_SUBST(WARN_CXXFLAGS)
904
 
])
905
 
 
906
22
# nls.m4 serial 3 (gettext-0.15)
907
23
dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
908
24
dnl This file is free software; the Free Software Foundation
2326
1442
AC_SUBST([am__untar])
2327
1443
]) # _AM_PROG_TAR
2328
1444
 
 
1445
dnl AM_GCONF_SOURCE_2
 
1446
dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
 
1447
dnl  (i.e. pass to gconftool-2
 
1448
dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
 
1449
dnl  you should install foo.schemas files
 
1450
dnl
 
1451
 
 
1452
AC_DEFUN([AM_GCONF_SOURCE_2],
 
1453
[
 
1454
  if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
 
1455
    GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
 
1456
  else
 
1457
    GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
 
1458
  fi
 
1459
 
 
1460
  AC_ARG_WITH([gconf-source],
 
1461
              AC_HELP_STRING([--with-gconf-source=sourceaddress],
 
1462
                             [Config database for installing schema files.]),
 
1463
              [GCONF_SCHEMA_CONFIG_SOURCE="$withval"],)
 
1464
 
 
1465
  AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
 
1466
  AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
 
1467
 
 
1468
  if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
 
1469
    GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
 
1470
  fi
 
1471
 
 
1472
  AC_ARG_WITH([gconf-schema-file-dir],
 
1473
              AC_HELP_STRING([--with-gconf-schema-file-dir=dir],
 
1474
                             [Directory for installing schema files.]),
 
1475
              [GCONF_SCHEMA_FILE_DIR="$withval"],)
 
1476
 
 
1477
  AC_SUBST(GCONF_SCHEMA_FILE_DIR)
 
1478
  AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
 
1479
 
 
1480
  AC_ARG_ENABLE(schemas-install,
 
1481
        AC_HELP_STRING([--disable-schemas-install],
 
1482
                       [Disable the schemas installation]),
 
1483
     [case ${enableval} in
 
1484
       yes|no) ;;
 
1485
       *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-install]) ;;
 
1486
      esac])
 
1487
  AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
 
1488
])
 
1489
 
 
1490
# Configure paths for GLIB
 
1491
# Owen Taylor     1997-2001
 
1492
 
 
1493
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
 
1494
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
 
1495
dnl gthread, or gio is specified in MODULES, pass to pkg-config
 
1496
dnl
 
1497
AC_DEFUN([AM_PATH_GLIB_2_0],
 
1498
[dnl 
 
1499
dnl Get the cflags and libraries from pkg-config
 
1500
dnl
 
1501
AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
 
1502
                    , enable_glibtest=yes)
 
1503
 
 
1504
  pkg_config_args=glib-2.0
 
1505
  for module in . $4
 
1506
  do
 
1507
      case "$module" in
 
1508
         gmodule) 
 
1509
             pkg_config_args="$pkg_config_args gmodule-2.0"
 
1510
         ;;
 
1511
         gmodule-no-export) 
 
1512
             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
 
1513
         ;;
 
1514
         gobject) 
 
1515
             pkg_config_args="$pkg_config_args gobject-2.0"
 
1516
         ;;
 
1517
         gthread) 
 
1518
             pkg_config_args="$pkg_config_args gthread-2.0"
 
1519
         ;;
 
1520
         gio*) 
 
1521
             pkg_config_args="$pkg_config_args $module-2.0"
 
1522
         ;;
 
1523
      esac
 
1524
  done
 
1525
 
 
1526
  PKG_PROG_PKG_CONFIG([0.16])
 
1527
 
 
1528
  no_glib=""
 
1529
 
 
1530
  if test "x$PKG_CONFIG" = x ; then
 
1531
    no_glib=yes
 
1532
    PKG_CONFIG=no
 
1533
  fi
 
1534
 
 
1535
  min_glib_version=ifelse([$1], ,2.0.0,$1)
 
1536
  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
 
1537
 
 
1538
  if test x$PKG_CONFIG != xno ; then
 
1539
    ## don't try to run the test against uninstalled libtool libs
 
1540
    if $PKG_CONFIG --uninstalled $pkg_config_args; then
 
1541
          echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
 
1542
          enable_glibtest=no
 
1543
    fi
 
1544
 
 
1545
    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
 
1546
          :
 
1547
    else
 
1548
          no_glib=yes
 
1549
    fi
 
1550
  fi
 
1551
 
 
1552
  if test x"$no_glib" = x ; then
 
1553
    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
 
1554
    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
 
1555
    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
 
1556
 
 
1557
    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
 
1558
    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
 
1559
    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
 
1560
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
 
1561
    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
 
1562
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
 
1563
    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
 
1564
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
1565
    if test "x$enable_glibtest" = "xyes" ; then
 
1566
      ac_save_CFLAGS="$CFLAGS"
 
1567
      ac_save_LIBS="$LIBS"
 
1568
      CFLAGS="$CFLAGS $GLIB_CFLAGS"
 
1569
      LIBS="$GLIB_LIBS $LIBS"
 
1570
dnl
 
1571
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
 
1572
dnl checks the results of pkg-config to some extent)
 
1573
dnl
 
1574
      rm -f conf.glibtest
 
1575
      AC_TRY_RUN([
 
1576
#include <glib.h>
 
1577
#include <stdio.h>
 
1578
#include <stdlib.h>
 
1579
 
 
1580
int 
 
1581
main ()
 
1582
{
 
1583
  int major, minor, micro;
 
1584
  char *tmp_version;
 
1585
 
 
1586
  fclose (fopen ("conf.glibtest", "w"));
 
1587
 
 
1588
  /* HP/UX 9 (%@#!) writes to sscanf strings */
 
1589
  tmp_version = g_strdup("$min_glib_version");
 
1590
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
 
1591
     printf("%s, bad version string\n", "$min_glib_version");
 
1592
     exit(1);
 
1593
   }
 
1594
 
 
1595
  if ((glib_major_version != $glib_config_major_version) ||
 
1596
      (glib_minor_version != $glib_config_minor_version) ||
 
1597
      (glib_micro_version != $glib_config_micro_version))
 
1598
    {
 
1599
      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
 
1600
             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
 
1601
             glib_major_version, glib_minor_version, glib_micro_version);
 
1602
      printf ("*** was found! If pkg-config was correct, then it is best\n");
 
1603
      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
 
1604
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
 
1605
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
 
1606
      printf("*** required on your system.\n");
 
1607
      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
 
1608
      printf("*** to point to the correct configuration files\n");
 
1609
    } 
 
1610
  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
 
1611
           (glib_minor_version != GLIB_MINOR_VERSION) ||
 
1612
           (glib_micro_version != GLIB_MICRO_VERSION))
 
1613
    {
 
1614
      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
 
1615
             GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
 
1616
      printf("*** library (version %d.%d.%d)\n",
 
1617
             glib_major_version, glib_minor_version, glib_micro_version);
 
1618
    }
 
1619
  else
 
1620
    {
 
1621
      if ((glib_major_version > major) ||
 
1622
        ((glib_major_version == major) && (glib_minor_version > minor)) ||
 
1623
        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
 
1624
      {
 
1625
        return 0;
 
1626
       }
 
1627
     else
 
1628
      {
 
1629
        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
 
1630
               glib_major_version, glib_minor_version, glib_micro_version);
 
1631
        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
 
1632
               major, minor, micro);
 
1633
        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
 
1634
        printf("***\n");
 
1635
        printf("*** If you have already installed a sufficiently new version, this error\n");
 
1636
        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
 
1637
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
 
1638
        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
 
1639
        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
 
1640
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
 
1641
        printf("*** so that the correct libraries are found at run-time))\n");
 
1642
      }
 
1643
    }
 
1644
  return 1;
 
1645
}
 
1646
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
1647
       CFLAGS="$ac_save_CFLAGS"
 
1648
       LIBS="$ac_save_LIBS"
 
1649
     fi
 
1650
  fi
 
1651
  if test "x$no_glib" = x ; then
 
1652
     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
 
1653
     ifelse([$2], , :, [$2])     
 
1654
  else
 
1655
     AC_MSG_RESULT(no)
 
1656
     if test "$PKG_CONFIG" = "no" ; then
 
1657
       echo "*** A new enough version of pkg-config was not found."
 
1658
       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
 
1659
     else
 
1660
       if test -f conf.glibtest ; then
 
1661
        :
 
1662
       else
 
1663
          echo "*** Could not run GLIB test program, checking why..."
 
1664
          ac_save_CFLAGS="$CFLAGS"
 
1665
          ac_save_LIBS="$LIBS"
 
1666
          CFLAGS="$CFLAGS $GLIB_CFLAGS"
 
1667
          LIBS="$LIBS $GLIB_LIBS"
 
1668
          AC_TRY_LINK([
 
1669
#include <glib.h>
 
1670
#include <stdio.h>
 
1671
],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
 
1672
        [ echo "*** The test program compiled, but did not run. This usually means"
 
1673
          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
 
1674
          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
 
1675
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
 
1676
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
 
1677
          echo "*** is required on your system"
 
1678
          echo "***"
 
1679
          echo "*** If you have an old version installed, it is best to remove it, although"
 
1680
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
 
1681
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
 
1682
          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
 
1683
          CFLAGS="$ac_save_CFLAGS"
 
1684
          LIBS="$ac_save_LIBS"
 
1685
       fi
 
1686
     fi
 
1687
     GLIB_CFLAGS=""
 
1688
     GLIB_LIBS=""
 
1689
     GLIB_GENMARSHAL=""
 
1690
     GOBJECT_QUERY=""
 
1691
     GLIB_MKENUMS=""
 
1692
     ifelse([$3], , :, [$3])
 
1693
  fi
 
1694
  AC_SUBST(GLIB_CFLAGS)
 
1695
  AC_SUBST(GLIB_LIBS)
 
1696
  AC_SUBST(GLIB_GENMARSHAL)
 
1697
  AC_SUBST(GOBJECT_QUERY)
 
1698
  AC_SUBST(GLIB_MKENUMS)
 
1699
  rm -f conf.glibtest
 
1700
])
 
1701
 
 
1702
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
 
1703
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
 
1704
#
 
1705
# This file is free software, distributed under the terms of the GNU
 
1706
# General Public License.  As a special exception to the GNU General
 
1707
# Public License, this file may be distributed as part of a program
 
1708
# that contains a configuration script generated by Autoconf, under
 
1709
# the same distribution terms as the rest of that program.
 
1710
#
 
1711
# This file can be copied and used freely without restrictions.  It can
 
1712
# be used in projects which are not available under the GNU Public License
 
1713
# but which still want to provide support for the GNU gettext functionality.
 
1714
#
 
1715
# Macro to add for using GNU gettext.
 
1716
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
 
1717
#
 
1718
# Modified to never use included libintl. 
 
1719
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
 
1720
#
 
1721
# Major rework to remove unused code
 
1722
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
 
1723
#
 
1724
# Added better handling of ALL_LINGUAS from GNU gettext version 
 
1725
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
 
1726
#
 
1727
# Modified to require ngettext
 
1728
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
 
1729
#
 
1730
# We need this here as well, since someone might use autoconf-2.5x
 
1731
# to configure GLib then an older version to configure a package
 
1732
# using AM_GLIB_GNU_GETTEXT
 
1733
AC_PREREQ(2.53)
 
1734
 
 
1735
dnl
 
1736
dnl We go to great lengths to make sure that aclocal won't 
 
1737
dnl try to pull in the installed version of these macros
 
1738
dnl when running aclocal in the glib directory.
 
1739
dnl
 
1740
m4_copy([AC_DEFUN],[glib_DEFUN])
 
1741
m4_copy([AC_REQUIRE],[glib_REQUIRE])
 
1742
dnl
 
1743
dnl At the end, if we're not within glib, we'll define the public
 
1744
dnl definitions in terms of our private definitions.
 
1745
dnl
 
1746
 
 
1747
# GLIB_LC_MESSAGES
 
1748
#--------------------
 
1749
glib_DEFUN([GLIB_LC_MESSAGES],
 
1750
  [AC_CHECK_HEADERS([locale.h])
 
1751
    if test $ac_cv_header_locale_h = yes; then
 
1752
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
 
1753
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
 
1754
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
 
1755
    if test $am_cv_val_LC_MESSAGES = yes; then
 
1756
      AC_DEFINE(HAVE_LC_MESSAGES, 1,
 
1757
        [Define if your <locale.h> file defines LC_MESSAGES.])
 
1758
    fi
 
1759
  fi])
 
1760
 
 
1761
# GLIB_PATH_PROG_WITH_TEST
 
1762
#----------------------------
 
1763
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 
1764
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
1765
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
 
1766
[# Extract the first word of "$2", so it can be a program name with args.
 
1767
set dummy $2; ac_word=[$]2
 
1768
AC_MSG_CHECKING([for $ac_word])
 
1769
AC_CACHE_VAL(ac_cv_path_$1,
 
1770
[case "[$]$1" in
 
1771
  /*)
 
1772
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
1773
  ;;
 
1774
  *)
 
1775
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 
1776
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
1777
    test -z "$ac_dir" && ac_dir=.
 
1778
    if test -f $ac_dir/$ac_word; then
 
1779
      if [$3]; then
 
1780
        ac_cv_path_$1="$ac_dir/$ac_word"
 
1781
        break
 
1782
      fi
 
1783
    fi
 
1784
  done
 
1785
  IFS="$ac_save_ifs"
 
1786
dnl If no 4th arg is given, leave the cache variable unset,
 
1787
dnl so AC_PATH_PROGS will keep looking.
 
1788
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
1789
])dnl
 
1790
  ;;
 
1791
esac])dnl
 
1792
$1="$ac_cv_path_$1"
 
1793
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
 
1794
  AC_MSG_RESULT([$]$1)
 
1795
else
 
1796
  AC_MSG_RESULT(no)
 
1797
fi
 
1798
AC_SUBST($1)dnl
 
1799
])
 
1800
 
 
1801
# GLIB_WITH_NLS
 
1802
#-----------------
 
1803
glib_DEFUN([GLIB_WITH_NLS],
 
1804
  dnl NLS is obligatory
 
1805
  [USE_NLS=yes
 
1806
    AC_SUBST(USE_NLS)
 
1807
 
 
1808
    gt_cv_have_gettext=no
 
1809
 
 
1810
    CATOBJEXT=NONE
 
1811
    XGETTEXT=:
 
1812
    INTLLIBS=
 
1813
 
 
1814
    AC_CHECK_HEADER(libintl.h,
 
1815
     [gt_cv_func_dgettext_libintl="no"
 
1816
      libintl_extra_libs=""
 
1817
 
 
1818
      #
 
1819
      # First check in libc
 
1820
      #
 
1821
      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
 
1822
        [AC_TRY_LINK([
 
1823
#include <libintl.h>
 
1824
],
 
1825
         [return !ngettext ("","", 1)],
 
1826
          gt_cv_func_ngettext_libc=yes,
 
1827
          gt_cv_func_ngettext_libc=no)
 
1828
        ])
 
1829
  
 
1830
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
 
1831
              AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
 
1832
                [AC_TRY_LINK([
 
1833
#include <libintl.h>
 
1834
],
 
1835
                  [return !dgettext ("","")],
 
1836
                  gt_cv_func_dgettext_libc=yes,
 
1837
                  gt_cv_func_dgettext_libc=no)
 
1838
                ])
 
1839
      fi
 
1840
  
 
1841
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
 
1842
        AC_CHECK_FUNCS(bind_textdomain_codeset)
 
1843
      fi
 
1844
 
 
1845
      #
 
1846
      # If we don't have everything we want, check in libintl
 
1847
      #
 
1848
      if test "$gt_cv_func_dgettext_libc" != "yes" \
 
1849
         || test "$gt_cv_func_ngettext_libc" != "yes" \
 
1850
         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
 
1851
        
 
1852
        AC_CHECK_LIB(intl, bindtextdomain,
 
1853
            [AC_CHECK_LIB(intl, ngettext,
 
1854
                    [AC_CHECK_LIB(intl, dgettext,
 
1855
                                  gt_cv_func_dgettext_libintl=yes)])])
 
1856
 
 
1857
        if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
 
1858
          AC_MSG_CHECKING([if -liconv is needed to use gettext])
 
1859
          AC_MSG_RESULT([])
 
1860
          AC_CHECK_LIB(intl, ngettext,
 
1861
                [AC_CHECK_LIB(intl, dcgettext,
 
1862
                       [gt_cv_func_dgettext_libintl=yes
 
1863
                        libintl_extra_libs=-liconv],
 
1864
                        :,-liconv)],
 
1865
                :,-liconv)
 
1866
        fi
 
1867
 
 
1868
        #
 
1869
        # If we found libintl, then check in it for bind_textdomain_codeset();
 
1870
        # we'll prefer libc if neither have bind_textdomain_codeset(),
 
1871
        # and both have dgettext and ngettext
 
1872
        #
 
1873
        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
 
1874
          glib_save_LIBS="$LIBS"
 
1875
          LIBS="$LIBS -lintl $libintl_extra_libs"
 
1876
          unset ac_cv_func_bind_textdomain_codeset
 
1877
          AC_CHECK_FUNCS(bind_textdomain_codeset)
 
1878
          LIBS="$glib_save_LIBS"
 
1879
 
 
1880
          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
 
1881
            gt_cv_func_dgettext_libc=no
 
1882
          else
 
1883
            if test "$gt_cv_func_dgettext_libc" = "yes" \
 
1884
                && test "$gt_cv_func_ngettext_libc" = "yes"; then
 
1885
              gt_cv_func_dgettext_libintl=no
 
1886
            fi
 
1887
          fi
 
1888
        fi
 
1889
      fi
 
1890
 
 
1891
      if test "$gt_cv_func_dgettext_libc" = "yes" \
 
1892
        || test "$gt_cv_func_dgettext_libintl" = "yes"; then
 
1893
        gt_cv_have_gettext=yes
 
1894
      fi
 
1895
  
 
1896
      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
 
1897
        INTLLIBS="-lintl $libintl_extra_libs"
 
1898
      fi
 
1899
  
 
1900
      if test "$gt_cv_have_gettext" = "yes"; then
 
1901
        AC_DEFINE(HAVE_GETTEXT,1,
 
1902
          [Define if the GNU gettext() function is already present or preinstalled.])
 
1903
        GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
1904
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
 
1905
        if test "$MSGFMT" != "no"; then
 
1906
          glib_save_LIBS="$LIBS"
 
1907
          LIBS="$LIBS $INTLLIBS"
 
1908
          AC_CHECK_FUNCS(dcgettext)
 
1909
          MSGFMT_OPTS=
 
1910
          AC_MSG_CHECKING([if msgfmt accepts -c])
 
1911
          GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
 
1912
msgid ""
 
1913
msgstr ""
 
1914
"Content-Type: text/plain; charset=UTF-8\n"
 
1915
"Project-Id-Version: test 1.0\n"
 
1916
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
 
1917
"Last-Translator: test <foo@bar.xx>\n"
 
1918
"Language-Team: C <LL@li.org>\n"
 
1919
"MIME-Version: 1.0\n"
 
1920
"Content-Transfer-Encoding: 8bit\n"
 
1921
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
 
1922
          AC_SUBST(MSGFMT_OPTS)
 
1923
          AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
1924
          GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
1925
            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 
1926
          AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
 
1927
                         return _nl_msg_cat_cntr],
 
1928
            [CATOBJEXT=.gmo 
 
1929
             DATADIRNAME=share],
 
1930
            [case $host in
 
1931
            *-*-solaris*)
 
1932
            dnl On Solaris, if bind_textdomain_codeset is in libc,
 
1933
            dnl GNU format message catalog is always supported,
 
1934
            dnl since both are added to the libc all together.
 
1935
            dnl Hence, we'd like to go with DATADIRNAME=share and
 
1936
            dnl and CATOBJEXT=.gmo in this case.
 
1937
            AC_CHECK_FUNC(bind_textdomain_codeset,
 
1938
              [CATOBJEXT=.gmo 
 
1939
               DATADIRNAME=share],
 
1940
              [CATOBJEXT=.mo
 
1941
               DATADIRNAME=lib])
 
1942
            ;;
 
1943
            *)
 
1944
            CATOBJEXT=.mo
 
1945
            DATADIRNAME=lib
 
1946
            ;;
 
1947
            esac])
 
1948
          LIBS="$glib_save_LIBS"
 
1949
          INSTOBJEXT=.mo
 
1950
        else
 
1951
          gt_cv_have_gettext=no
 
1952
        fi
 
1953
      fi
 
1954
    ])
 
1955
 
 
1956
    if test "$gt_cv_have_gettext" = "yes" ; then
 
1957
      AC_DEFINE(ENABLE_NLS, 1,
 
1958
        [always defined to indicate that i18n is enabled])
 
1959
    fi
 
1960
 
 
1961
    dnl Test whether we really found GNU xgettext.
 
1962
    if test "$XGETTEXT" != ":"; then
 
1963
      dnl If it is not GNU xgettext we define it as : so that the
 
1964
      dnl Makefiles still can work.
 
1965
      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
 
1966
        : ;
 
1967
      else
 
1968
        AC_MSG_RESULT(
 
1969
          [found xgettext program is not GNU xgettext; ignore it])
 
1970
        XGETTEXT=":"
 
1971
      fi
 
1972
    fi
 
1973
 
 
1974
    # We need to process the po/ directory.
 
1975
    POSUB=po
 
1976
 
 
1977
    AC_OUTPUT_COMMANDS(
 
1978
      [case "$CONFIG_FILES" in *po/Makefile.in*)
 
1979
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
 
1980
      esac])
 
1981
 
 
1982
    dnl These rules are solely for the distribution goal.  While doing this
 
1983
    dnl we only have to keep exactly one list of the available catalogs
 
1984
    dnl in configure.in.
 
1985
    for lang in $ALL_LINGUAS; do
 
1986
      GMOFILES="$GMOFILES $lang.gmo"
 
1987
      POFILES="$POFILES $lang.po"
 
1988
    done
 
1989
 
 
1990
    dnl Make all variables we use known to autoconf.
 
1991
    AC_SUBST(CATALOGS)
 
1992
    AC_SUBST(CATOBJEXT)
 
1993
    AC_SUBST(DATADIRNAME)
 
1994
    AC_SUBST(GMOFILES)
 
1995
    AC_SUBST(INSTOBJEXT)
 
1996
    AC_SUBST(INTLLIBS)
 
1997
    AC_SUBST(PO_IN_DATADIR_TRUE)
 
1998
    AC_SUBST(PO_IN_DATADIR_FALSE)
 
1999
    AC_SUBST(POFILES)
 
2000
    AC_SUBST(POSUB)
 
2001
  ])
 
2002
 
 
2003
# AM_GLIB_GNU_GETTEXT
 
2004
# -------------------
 
2005
# Do checks necessary for use of gettext. If a suitable implementation 
 
2006
# of gettext is found in either in libintl or in the C library,
 
2007
# it will set INTLLIBS to the libraries needed for use of gettext
 
2008
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
 
2009
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
 
2010
# on various variables needed by the Makefile.in.in installed by 
 
2011
# glib-gettextize.
 
2012
dnl
 
2013
glib_DEFUN([GLIB_GNU_GETTEXT],
 
2014
  [AC_REQUIRE([AC_PROG_CC])dnl
 
2015
   AC_REQUIRE([AC_HEADER_STDC])dnl
 
2016
   
 
2017
   GLIB_LC_MESSAGES
 
2018
   GLIB_WITH_NLS
 
2019
 
 
2020
   if test "$gt_cv_have_gettext" = "yes"; then
 
2021
     if test "x$ALL_LINGUAS" = "x"; then
 
2022
       LINGUAS=
 
2023
     else
 
2024
       AC_MSG_CHECKING(for catalogs to be installed)
 
2025
       NEW_LINGUAS=
 
2026
       for presentlang in $ALL_LINGUAS; do
 
2027
         useit=no
 
2028
         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
 
2029
           desiredlanguages="$LINGUAS"
 
2030
         else
 
2031
           desiredlanguages="$ALL_LINGUAS"
 
2032
         fi
 
2033
         for desiredlang in $desiredlanguages; do
 
2034
           # Use the presentlang catalog if desiredlang is
 
2035
           #   a. equal to presentlang, or
 
2036
           #   b. a variant of presentlang (because in this case,
 
2037
           #      presentlang can be used as a fallback for messages
 
2038
           #      which are not translated in the desiredlang catalog).
 
2039
           case "$desiredlang" in
 
2040
             "$presentlang"*) useit=yes;;
 
2041
           esac
 
2042
         done
 
2043
         if test $useit = yes; then
 
2044
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
 
2045
         fi
 
2046
       done
 
2047
       LINGUAS=$NEW_LINGUAS
 
2048
       AC_MSG_RESULT($LINGUAS)
 
2049
     fi
 
2050
 
 
2051
     dnl Construct list of names of catalog files to be constructed.
 
2052
     if test -n "$LINGUAS"; then
 
2053
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
 
2054
     fi
 
2055
   fi
 
2056
 
 
2057
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
 
2058
   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
 
2059
   dnl Try to locate is.
 
2060
   MKINSTALLDIRS=
 
2061
   if test -n "$ac_aux_dir"; then
 
2062
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
 
2063
   fi
 
2064
   if test -z "$MKINSTALLDIRS"; then
 
2065
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
 
2066
   fi
 
2067
   AC_SUBST(MKINSTALLDIRS)
 
2068
 
 
2069
   dnl Generate list of files to be processed by xgettext which will
 
2070
   dnl be included in po/Makefile.
 
2071
   test -d po || mkdir po
 
2072
   if test "x$srcdir" != "x."; then
 
2073
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
 
2074
       posrcprefix="$srcdir/"
 
2075
     else
 
2076
       posrcprefix="../$srcdir/"
 
2077
     fi
 
2078
   else
 
2079
     posrcprefix="../"
 
2080
   fi
 
2081
   rm -f po/POTFILES
 
2082
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
 
2083
        < $srcdir/po/POTFILES.in > po/POTFILES
 
2084
  ])
 
2085
 
 
2086
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
 
2087
# -------------------------------
 
2088
# Define VARIABLE to the location where catalog files will
 
2089
# be installed by po/Makefile.
 
2090
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
 
2091
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
 
2092
glib_save_prefix="$prefix"
 
2093
glib_save_exec_prefix="$exec_prefix"
 
2094
glib_save_datarootdir="$datarootdir"
 
2095
test "x$prefix" = xNONE && prefix=$ac_default_prefix
 
2096
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
 
2097
datarootdir=`eval echo "${datarootdir}"`
 
2098
if test "x$CATOBJEXT" = "x.mo" ; then
 
2099
  localedir=`eval echo "${libdir}/locale"`
 
2100
else
 
2101
  localedir=`eval echo "${datadir}/locale"`
 
2102
fi
 
2103
prefix="$glib_save_prefix"
 
2104
exec_prefix="$glib_save_exec_prefix"
 
2105
datarootdir="$glib_save_datarootdir"
 
2106
AC_DEFINE_UNQUOTED($1, "$localedir",
 
2107
  [Define the location where the catalogs will be installed])
 
2108
])
 
2109
 
 
2110
dnl
 
2111
dnl Now the definitions that aclocal will find
 
2112
dnl
 
2113
ifdef(glib_configure_in,[],[
 
2114
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
 
2115
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
 
2116
])dnl
 
2117
 
 
2118
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
 
2119
 
2120
# Create a temporary file with TEST-FILE as its contents and pass the
 
2121
# file name to PROGRAM.  Perform ACTION-IF-PASS if PROGRAM exits with
 
2122
# 0 and perform ACTION-IF-FAIL for any other exit status.
 
2123
AC_DEFUN([GLIB_RUN_PROG],
 
2124
[cat >conftest.foo <<_ACEOF
 
2125
$2
 
2126
_ACEOF
 
2127
if AC_RUN_LOG([$1 conftest.foo]); then
 
2128
  m4_ifval([$3], [$3], [:])
 
2129
m4_ifvaln([$4], [else $4])dnl
 
2130
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
 
2131
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
 
2132
fi])
 
2133
 
 
2134
 
 
2135
# gnome-common.m4
 
2136
 
2137
 
 
2138
dnl GNOME_COMMON_INIT
 
2139
 
 
2140
AC_DEFUN([GNOME_COMMON_INIT],
 
2141
[
 
2142
  dnl this macro should come after AC_CONFIG_MACRO_DIR
 
2143
  AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
 
2144
 
 
2145
  dnl ensure that when the Automake generated makefile calls aclocal,
 
2146
  dnl it honours the $ACLOCAL_FLAGS environment variable
 
2147
  ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
 
2148
  if test -n "$ac_macro_dir"; then
 
2149
    ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
 
2150
  fi
 
2151
 
 
2152
  AC_SUBST([ACLOCAL_AMFLAGS])
 
2153
])
 
2154
 
 
2155
AC_DEFUN([GNOME_DEBUG_CHECK],
 
2156
[
 
2157
        AC_ARG_ENABLE([debug],
 
2158
                      AC_HELP_STRING([--enable-debug],
 
2159
                                     [turn on debugging]),,
 
2160
                      [enable_debug=no])
 
2161
 
 
2162
        if test x$enable_debug = xyes ; then
 
2163
            AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
 
2164
                [Enable additional debugging at the expense of performance and size])
 
2165
        fi
 
2166
])
 
2167
 
 
2168
dnl GNOME_MAINTAINER_MODE_DEFINES ()
 
2169
dnl define DISABLE_DEPRECATED
 
2170
dnl
 
2171
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
 
2172
[
 
2173
        AC_REQUIRE([AM_MAINTAINER_MODE])
 
2174
 
 
2175
        DISABLE_DEPRECATED=""
 
2176
        if test $USE_MAINTAINER_MODE = yes; then
 
2177
                DOMAINS="G ATK PANGO GDK GDK_PIXBUF GTK GCONF BONOBO BONOBO_UI GNOME LIBGLADE VTE GNOME_VFS WNCK LIBSOUP"
 
2178
                for DOMAIN in $DOMAINS; do
 
2179
                       DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
 
2180
                done
 
2181
        fi
 
2182
 
 
2183
        AC_SUBST(DISABLE_DEPRECATED)
 
2184
])
 
2185
 
 
2186
dnl GNOME_COMPILE_WARNINGS
 
2187
dnl Turn on many useful compiler warnings
 
2188
dnl For now, only works on GCC
 
2189
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
 
2190
    dnl ******************************
 
2191
    dnl More compiler warnings
 
2192
    dnl ******************************
 
2193
 
 
2194
    AC_ARG_ENABLE(compile-warnings, 
 
2195
                  AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
 
2196
                                 [Turn on compiler warnings]),,
 
2197
                  [enable_compile_warnings="m4_default([$1],[yes])"])
 
2198
 
 
2199
    warnCFLAGS=
 
2200
    if test "x$GCC" != xyes; then
 
2201
        enable_compile_warnings=no
 
2202
    fi
 
2203
 
 
2204
    warning_flags=
 
2205
    realsave_CFLAGS="$CFLAGS"
 
2206
 
 
2207
    case "$enable_compile_warnings" in
 
2208
    no)
 
2209
        warning_flags=
 
2210
        ;;
 
2211
    minimum)
 
2212
        warning_flags="-Wall"
 
2213
        ;;
 
2214
    yes)
 
2215
        warning_flags="-Wall -Wmissing-prototypes"
 
2216
        ;;
 
2217
    maximum|error)
 
2218
        warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
 
2219
        CFLAGS="$warning_flags $CFLAGS"
 
2220
        for option in -Wno-sign-compare; do
 
2221
                SAVE_CFLAGS="$CFLAGS"
 
2222
                CFLAGS="$CFLAGS $option"
 
2223
                AC_MSG_CHECKING([whether gcc understands $option])
 
2224
                AC_TRY_COMPILE([], [],
 
2225
                        has_option=yes,
 
2226
                        has_option=no,)
 
2227
                CFLAGS="$SAVE_CFLAGS"
 
2228
                AC_MSG_RESULT($has_option)
 
2229
                if test $has_option = yes; then
 
2230
                  warning_flags="$warning_flags $option"
 
2231
                fi
 
2232
                unset has_option
 
2233
                unset SAVE_CFLAGS
 
2234
        done
 
2235
        unset option
 
2236
        if test "$enable_compile_warnings" = "error" ; then
 
2237
            warning_flags="$warning_flags -Werror"
 
2238
        fi
 
2239
        ;;
 
2240
    *)
 
2241
        AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
 
2242
        ;;
 
2243
    esac
 
2244
    CFLAGS="$realsave_CFLAGS"
 
2245
    AC_MSG_CHECKING(what warning flags to pass to the C compiler)
 
2246
    AC_MSG_RESULT($warning_flags)
 
2247
 
 
2248
    AC_ARG_ENABLE(iso-c,
 
2249
                  AC_HELP_STRING([--enable-iso-c],
 
2250
                                 [Try to warn if code is not ISO C ]),,
 
2251
                  [enable_iso_c=no])
 
2252
 
 
2253
    AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
 
2254
    complCFLAGS=
 
2255
    if test "x$enable_iso_c" != "xno"; then
 
2256
        if test "x$GCC" = "xyes"; then
 
2257
        case " $CFLAGS " in
 
2258
            *[\ \       ]-ansi[\ \      ]*) ;;
 
2259
            *) complCFLAGS="$complCFLAGS -ansi" ;;
 
2260
        esac
 
2261
        case " $CFLAGS " in
 
2262
            *[\ \       ]-pedantic[\ \  ]*) ;;
 
2263
            *) complCFLAGS="$complCFLAGS -pedantic" ;;
 
2264
        esac
 
2265
        fi
 
2266
    fi
 
2267
    AC_MSG_RESULT($complCFLAGS)
 
2268
 
 
2269
    WARN_CFLAGS="$warning_flags $complCFLAGS"
 
2270
    AC_SUBST(WARN_CFLAGS)
 
2271
])
 
2272
 
 
2273
dnl For C++, do basically the same thing.
 
2274
 
 
2275
AC_DEFUN([GNOME_CXX_WARNINGS],[
 
2276
  AC_ARG_ENABLE(cxx-warnings,
 
2277
                AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
 
2278
                               [Turn on compiler warnings.]),,
 
2279
                [enable_cxx_warnings="m4_default([$1],[minimum])"])
 
2280
 
 
2281
  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
 
2282
  warnCXXFLAGS=
 
2283
  if test "x$GXX" != xyes; then
 
2284
    enable_cxx_warnings=no
 
2285
  fi
 
2286
  if test "x$enable_cxx_warnings" != "xno"; then
 
2287
    if test "x$GXX" = "xyes"; then
 
2288
      case " $CXXFLAGS " in
 
2289
      *[\ \     ]-Wall[\ \      ]*) ;;
 
2290
      *) warnCXXFLAGS="-Wall -Wno-unused" ;;
 
2291
      esac
 
2292
 
 
2293
      ## -W is not all that useful.  And it cannot be controlled
 
2294
      ## with individual -Wno-xxx flags, unlike -Wall
 
2295
      if test "x$enable_cxx_warnings" = "xyes"; then
 
2296
        warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
 
2297
      fi
 
2298
    fi
 
2299
  fi
 
2300
  AC_MSG_RESULT($warnCXXFLAGS)
 
2301
 
 
2302
   AC_ARG_ENABLE(iso-cxx,
 
2303
                 AC_HELP_STRING([--enable-iso-cxx],
 
2304
                                [Try to warn if code is not ISO C++ ]),,
 
2305
                 [enable_iso_cxx=no])
 
2306
 
 
2307
   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
 
2308
   complCXXFLAGS=
 
2309
   if test "x$enable_iso_cxx" != "xno"; then
 
2310
     if test "x$GXX" = "xyes"; then
 
2311
      case " $CXXFLAGS " in
 
2312
      *[\ \     ]-ansi[\ \      ]*) ;;
 
2313
      *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
 
2314
      esac
 
2315
 
 
2316
      case " $CXXFLAGS " in
 
2317
      *[\ \     ]-pedantic[\ \  ]*) ;;
 
2318
      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
 
2319
      esac
 
2320
     fi
 
2321
   fi
 
2322
  AC_MSG_RESULT($complCXXFLAGS)
 
2323
 
 
2324
  WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
 
2325
  AC_SUBST(WARN_CXXFLAGS)
 
2326
])
 
2327
 
2329
2328
m4_include([m4/gtk-doc.m4])
2330
2329
m4_include([m4/intltool.m4])
2331
2330
m4_include([m4/libtool.m4])