~ubuntu-branches/ubuntu/saucy/gnome-shell/saucy-proposed

« back to all changes in this revision

Viewing changes to aclocal.m4

Tags: upstream-3.3.90
ImportĀ upstreamĀ versionĀ 3.3.90

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
 
  unsigned int major, minor, micro;
161
 
  char *tmp_version;
162
 
 
163
 
  fclose (fopen ("conf.glibtest", "w"));
164
 
 
165
 
  /* HP/UX 9 (%@#!) writes to sscanf strings */
166
 
  tmp_version = g_strdup("$min_glib_version");
167
 
  if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, &micro) != 3) {
168
 
     printf("%s, bad version string\n", "$min_glib_version");
169
 
     exit(1);
170
 
   }
171
 
 
172
 
  if ((glib_major_version != $glib_config_major_version) ||
173
 
      (glib_minor_version != $glib_config_minor_version) ||
174
 
      (glib_micro_version != $glib_config_micro_version))
175
 
    {
176
 
      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
177
 
             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
178
 
             glib_major_version, glib_minor_version, glib_micro_version);
179
 
      printf ("*** was found! If pkg-config was correct, then it is best\n");
180
 
      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
181
 
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
182
 
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
183
 
      printf("*** required on your system.\n");
184
 
      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
185
 
      printf("*** to point to the correct configuration files\n");
186
 
    } 
187
 
  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
188
 
           (glib_minor_version != GLIB_MINOR_VERSION) ||
189
 
           (glib_micro_version != GLIB_MICRO_VERSION))
190
 
    {
191
 
      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
192
 
             GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
193
 
      printf("*** library (version %d.%d.%d)\n",
194
 
             glib_major_version, glib_minor_version, glib_micro_version);
195
 
    }
196
 
  else
197
 
    {
198
 
      if ((glib_major_version > major) ||
199
 
        ((glib_major_version == major) && (glib_minor_version > minor)) ||
200
 
        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
201
 
      {
202
 
        return 0;
203
 
       }
204
 
     else
205
 
      {
206
 
        printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
207
 
               glib_major_version, glib_minor_version, glib_micro_version);
208
 
        printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
209
 
               major, minor, micro);
210
 
        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
211
 
        printf("***\n");
212
 
        printf("*** If you have already installed a sufficiently new version, this error\n");
213
 
        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
214
 
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
215
 
        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
216
 
        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
217
 
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
218
 
        printf("*** so that the correct libraries are found at run-time))\n");
219
 
      }
220
 
    }
221
 
  return 1;
222
 
}
223
 
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
224
 
       CFLAGS="$ac_save_CFLAGS"
225
 
       LIBS="$ac_save_LIBS"
226
 
     fi
227
 
  fi
228
 
  if test "x$no_glib" = x ; then
229
 
     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
230
 
     ifelse([$2], , :, [$2])     
231
 
  else
232
 
     AC_MSG_RESULT(no)
233
 
     if test "$PKG_CONFIG" = "no" ; then
234
 
       echo "*** A new enough version of pkg-config was not found."
235
 
       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
236
 
     else
237
 
       if test -f conf.glibtest ; then
238
 
        :
239
 
       else
240
 
          echo "*** Could not run GLIB test program, checking why..."
241
 
          ac_save_CFLAGS="$CFLAGS"
242
 
          ac_save_LIBS="$LIBS"
243
 
          CFLAGS="$CFLAGS $GLIB_CFLAGS"
244
 
          LIBS="$LIBS $GLIB_LIBS"
245
 
          AC_TRY_LINK([
246
 
#include <glib.h>
247
 
#include <stdio.h>
248
 
],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
249
 
        [ echo "*** The test program compiled, but did not run. This usually means"
250
 
          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
251
 
          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
252
 
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
253
 
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
254
 
          echo "*** is required on your system"
255
 
          echo "***"
256
 
          echo "*** If you have an old version installed, it is best to remove it, although"
257
 
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
258
 
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
259
 
          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
260
 
          CFLAGS="$ac_save_CFLAGS"
261
 
          LIBS="$ac_save_LIBS"
262
 
       fi
263
 
     fi
264
 
     GLIB_CFLAGS=""
265
 
     GLIB_LIBS=""
266
 
     GLIB_GENMARSHAL=""
267
 
     GOBJECT_QUERY=""
268
 
     GLIB_MKENUMS=""
269
 
     ifelse([$3], , :, [$3])
270
 
  fi
271
 
  AC_SUBST(GLIB_CFLAGS)
272
 
  AC_SUBST(GLIB_LIBS)
273
 
  AC_SUBST(GLIB_GENMARSHAL)
274
 
  AC_SUBST(GOBJECT_QUERY)
275
 
  AC_SUBST(GLIB_MKENUMS)
276
 
  rm -f conf.glibtest
277
 
])
278
 
 
279
 
dnl GLIB_GSETTINGS
280
 
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
281
 
dnl the schema should be compiled
282
 
dnl
283
 
 
284
 
AC_DEFUN([GLIB_GSETTINGS],
285
 
[
286
 
  m4_pattern_allow([AM_V_GEN])
287
 
  AC_ARG_ENABLE(schemas-compile,
288
 
                AS_HELP_STRING([--disable-schemas-compile],
289
 
                               [Disable regeneration of gschemas.compiled on install]),
290
 
                [case ${enableval} in
291
 
                  yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE=""  ;;
292
 
                  no)  GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
293
 
                  *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
294
 
                 esac])
295
 
  AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
296
 
  PKG_PROG_PKG_CONFIG([0.16])
297
 
  AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
298
 
  if test x$cross_compiling != xyes; then
299
 
    GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
300
 
  else
301
 
    AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
302
 
  fi
303
 
  AC_SUBST(GLIB_COMPILE_SCHEMAS)
304
 
  if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
305
 
    ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
306
 
  else
307
 
    ifelse([$1],,[:],[$1])
308
 
  fi
309
 
 
310
 
  GSETTINGS_RULES='
311
 
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
312
 
 
313
 
mostlyclean-am: clean-gsettings-schemas
314
 
 
315
 
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
316
 
 
317
 
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
318
 
        $(AM_V_GEN) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${d}$< && touch [$]@
319
 
 
320
 
all-am: $(gsettings_SCHEMAS:.xml=.valid)
321
 
uninstall-am: uninstall-gsettings-schemas
322
 
install-data-am: install-gsettings-schemas
323
 
 
324
 
.SECONDARY: $(gsettings_SCHEMAS)
325
 
 
326
 
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
327
 
        @$(NORMAL_INSTALL)
328
 
        if test -n "$^"; then \
329
 
                test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
330
 
                $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
331
 
                test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
332
 
        fi
333
 
 
334
 
uninstall-gsettings-schemas:
335
 
        @$(NORMAL_UNINSTALL)
336
 
        @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
337
 
        files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
338
 
        test -n "$$files" || exit 0; \
339
 
        echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
340
 
        cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
341
 
        test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
342
 
 
343
 
clean-gsettings-schemas:
344
 
        rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
345
 
 
346
 
ifdef gsettings_ENUM_NAMESPACE
347
 
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
348
 
        $(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead "  <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod "    <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail "  </@type@>" --ftail "</schemalist>" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@
349
 
endif
350
 
'
351
 
  _GSETTINGS_SUBST(GSETTINGS_RULES)
352
 
])
353
 
 
354
 
dnl _GSETTINGS_SUBST(VARIABLE)
355
 
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
356
 
AC_DEFUN([_GSETTINGS_SUBST],
357
 
[
358
 
AC_SUBST([$1])
359
 
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
360
 
]
361
 
)
362
 
 
363
 
dnl -*- mode: autoconf -*-
364
 
dnl Copyright 2009 Johan Dahlin
365
 
dnl
366
 
dnl This file is free software; the author(s) gives unlimited
367
 
dnl permission to copy and/or distribute it, with or without
368
 
dnl modifications, as long as this notice is preserved.
369
 
dnl
370
 
 
371
 
# serial 1
372
 
 
373
 
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
374
 
[
375
 
    AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
376
 
    AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
377
 
    AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
378
 
 
379
 
    dnl enable/disable introspection
380
 
    m4_if([$2], [require],
381
 
    [dnl
382
 
        enable_introspection=yes
383
 
    ],[dnl
384
 
        AC_ARG_ENABLE(introspection,
385
 
                  AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
386
 
                                 [Enable introspection for this build]),, 
387
 
                                 [enable_introspection=auto])
388
 
    ])dnl
389
 
 
390
 
    AC_MSG_CHECKING([for gobject-introspection])
391
 
 
392
 
    dnl presence/version checking
393
 
    AS_CASE([$enable_introspection],
394
 
    [no], [dnl
395
 
        found_introspection="no (disabled, use --enable-introspection to enable)"
396
 
    ],dnl
397
 
    [yes],[dnl
398
 
        PKG_CHECK_EXISTS([gobject-introspection-1.0],,
399
 
                         AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
400
 
        PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
401
 
                         found_introspection=yes,
402
 
                         AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
403
 
    ],dnl
404
 
    [auto],[dnl
405
 
        PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
406
 
    ],dnl
407
 
    [dnl        
408
 
        AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
409
 
    ])dnl
410
 
 
411
 
    AC_MSG_RESULT([$found_introspection])
412
 
 
413
 
    INTROSPECTION_SCANNER=
414
 
    INTROSPECTION_COMPILER=
415
 
    INTROSPECTION_GENERATE=
416
 
    INTROSPECTION_GIRDIR=
417
 
    INTROSPECTION_TYPELIBDIR=
418
 
    if test "x$found_introspection" = "xyes"; then
419
 
       INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
420
 
       INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
421
 
       INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
422
 
       INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
423
 
       INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
424
 
       INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
425
 
       INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
426
 
       INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
427
 
    fi
428
 
    AC_SUBST(INTROSPECTION_SCANNER)
429
 
    AC_SUBST(INTROSPECTION_COMPILER)
430
 
    AC_SUBST(INTROSPECTION_GENERATE)
431
 
    AC_SUBST(INTROSPECTION_GIRDIR)
432
 
    AC_SUBST(INTROSPECTION_TYPELIBDIR)
433
 
    AC_SUBST(INTROSPECTION_CFLAGS)
434
 
    AC_SUBST(INTROSPECTION_LIBS)
435
 
    AC_SUBST(INTROSPECTION_MAKEFILE)
436
 
 
437
 
    AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
438
 
])
439
 
 
440
 
 
441
 
dnl Usage:
442
 
dnl   GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
443
 
 
444
 
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
445
 
[
446
 
  _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
447
 
])
448
 
 
449
 
dnl Usage:
450
 
dnl   GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
451
 
 
452
 
 
453
 
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
454
 
[
455
 
  _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
456
 
])
457
 
 
458
 
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
459
 
# serial 1 (pkg-config-0.24)
460
 
461
 
# Copyright Ā© 2004 Scott James Remnant <scott@netsplit.com>.
462
 
#
463
 
# This program is free software; you can redistribute it and/or modify
464
 
# it under the terms of the GNU General Public License as published by
465
 
# the Free Software Foundation; either version 2 of the License, or
466
 
# (at your option) any later version.
467
 
#
468
 
# This program is distributed in the hope that it will be useful, but
469
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
470
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
471
 
# General Public License for more details.
472
 
#
473
 
# You should have received a copy of the GNU General Public License
474
 
# along with this program; if not, write to the Free Software
475
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
476
 
#
477
 
# As a special exception to the GNU General Public License, if you
478
 
# distribute this file as part of a program that contains a
479
 
# configuration script generated by Autoconf, you may include it under
480
 
# the same distribution terms that you use for the rest of that program.
481
 
 
482
 
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
483
 
# ----------------------------------
484
 
AC_DEFUN([PKG_PROG_PKG_CONFIG],
485
 
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
486
 
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
487
 
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
488
 
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
489
 
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
490
 
 
491
 
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
492
 
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
493
 
fi
494
 
if test -n "$PKG_CONFIG"; then
495
 
        _pkg_min_version=m4_default([$1], [0.9.0])
496
 
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
497
 
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
498
 
                AC_MSG_RESULT([yes])
499
 
        else
500
 
                AC_MSG_RESULT([no])
501
 
                PKG_CONFIG=""
502
 
        fi
503
 
fi[]dnl
504
 
])# PKG_PROG_PKG_CONFIG
505
 
 
506
 
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
507
 
#
508
 
# Check to see whether a particular set of modules exists.  Similar
509
 
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
510
 
#
511
 
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
512
 
# only at the first occurence in configure.ac, so if the first place
513
 
# it's called might be skipped (such as if it is within an "if", you
514
 
# have to call PKG_CHECK_EXISTS manually
515
 
# --------------------------------------------------------------
516
 
AC_DEFUN([PKG_CHECK_EXISTS],
517
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
518
 
if test -n "$PKG_CONFIG" && \
519
 
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
520
 
  m4_default([$2], [:])
521
 
m4_ifvaln([$3], [else
522
 
  $3])dnl
523
 
fi])
524
 
 
525
 
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
526
 
# ---------------------------------------------
527
 
m4_define([_PKG_CONFIG],
528
 
[if test -n "$$1"; then
529
 
    pkg_cv_[]$1="$$1"
530
 
 elif test -n "$PKG_CONFIG"; then
531
 
    PKG_CHECK_EXISTS([$3],
532
 
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
533
 
                     [pkg_failed=yes])
534
 
 else
535
 
    pkg_failed=untried
536
 
fi[]dnl
537
 
])# _PKG_CONFIG
538
 
 
539
 
# _PKG_SHORT_ERRORS_SUPPORTED
540
 
# -----------------------------
541
 
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
542
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
543
 
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
544
 
        _pkg_short_errors_supported=yes
545
 
else
546
 
        _pkg_short_errors_supported=no
547
 
fi[]dnl
548
 
])# _PKG_SHORT_ERRORS_SUPPORTED
549
 
 
550
 
 
551
 
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
552
 
# [ACTION-IF-NOT-FOUND])
553
 
#
554
 
#
555
 
# Note that if there is a possibility the first call to
556
 
# PKG_CHECK_MODULES might not happen, you should be sure to include an
557
 
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
558
 
#
559
 
#
560
 
# --------------------------------------------------------------
561
 
AC_DEFUN([PKG_CHECK_MODULES],
562
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
563
 
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
564
 
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
565
 
 
566
 
pkg_failed=no
567
 
AC_MSG_CHECKING([for $1])
568
 
 
569
 
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
570
 
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
571
 
 
572
 
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
573
 
and $1[]_LIBS to avoid the need to call pkg-config.
574
 
See the pkg-config man page for more details.])
575
 
 
576
 
if test $pkg_failed = yes; then
577
 
        AC_MSG_RESULT([no])
578
 
        _PKG_SHORT_ERRORS_SUPPORTED
579
 
        if test $_pkg_short_errors_supported = yes; then
580
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
581
 
        else 
582
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
583
 
        fi
584
 
        # Put the nasty error message in config.log where it belongs
585
 
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
586
 
 
587
 
        m4_default([$4], [AC_MSG_ERROR(
588
 
[Package requirements ($2) were not met:
589
 
 
590
 
$$1_PKG_ERRORS
591
 
 
592
 
Consider adjusting the PKG_CONFIG_PATH environment variable if you
593
 
installed software in a non-standard prefix.
594
 
 
595
 
_PKG_TEXT])
596
 
        ])
597
 
elif test $pkg_failed = untried; then
598
 
        AC_MSG_RESULT([no])
599
 
        m4_default([$4], [AC_MSG_FAILURE(
600
 
[The pkg-config script could not be found or is too old.  Make sure it
601
 
is in your PATH or set the PKG_CONFIG environment variable to the full
602
 
path to pkg-config.
603
 
 
604
 
_PKG_TEXT
605
 
 
606
 
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
607
 
        ])
608
 
else
609
 
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
610
 
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
611
 
        AC_MSG_RESULT([yes])
612
 
        $3
613
 
fi[]dnl
614
 
])# PKG_CHECK_MODULES
615
 
 
616
22
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
617
23
#
618
24
# This file is free software; the Free Software Foundation
1867
1273
AC_SUBST([am__untar])
1868
1274
]) # _AM_PROG_TAR
1869
1275
 
 
1276
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
1277
# serial 1 (pkg-config-0.24)
 
1278
 
1279
# Copyright Ā© 2004 Scott James Remnant <scott@netsplit.com>.
 
1280
#
 
1281
# This program is free software; you can redistribute it and/or modify
 
1282
# it under the terms of the GNU General Public License as published by
 
1283
# the Free Software Foundation; either version 2 of the License, or
 
1284
# (at your option) any later version.
 
1285
#
 
1286
# This program is distributed in the hope that it will be useful, but
 
1287
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
1288
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
1289
# General Public License for more details.
 
1290
#
 
1291
# You should have received a copy of the GNU General Public License
 
1292
# along with this program; if not, write to the Free Software
 
1293
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
1294
#
 
1295
# As a special exception to the GNU General Public License, if you
 
1296
# distribute this file as part of a program that contains a
 
1297
# configuration script generated by Autoconf, you may include it under
 
1298
# the same distribution terms that you use for the rest of that program.
 
1299
 
 
1300
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
 
1301
# ----------------------------------
 
1302
AC_DEFUN([PKG_PROG_PKG_CONFIG],
 
1303
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 
1304
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
 
1305
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 
1306
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 
1307
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
 
1308
 
 
1309
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 
1310
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 
1311
fi
 
1312
if test -n "$PKG_CONFIG"; then
 
1313
        _pkg_min_version=m4_default([$1], [0.9.0])
 
1314
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
 
1315
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 
1316
                AC_MSG_RESULT([yes])
 
1317
        else
 
1318
                AC_MSG_RESULT([no])
 
1319
                PKG_CONFIG=""
 
1320
        fi
 
1321
fi[]dnl
 
1322
])# PKG_PROG_PKG_CONFIG
 
1323
 
 
1324
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
1325
#
 
1326
# Check to see whether a particular set of modules exists.  Similar
 
1327
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
 
1328
#
 
1329
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1330
# only at the first occurence in configure.ac, so if the first place
 
1331
# it's called might be skipped (such as if it is within an "if", you
 
1332
# have to call PKG_CHECK_EXISTS manually
 
1333
# --------------------------------------------------------------
 
1334
AC_DEFUN([PKG_CHECK_EXISTS],
 
1335
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
1336
if test -n "$PKG_CONFIG" && \
 
1337
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
 
1338
  m4_default([$2], [:])
 
1339
m4_ifvaln([$3], [else
 
1340
  $3])dnl
 
1341
fi])
 
1342
 
 
1343
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 
1344
# ---------------------------------------------
 
1345
m4_define([_PKG_CONFIG],
 
1346
[if test -n "$$1"; then
 
1347
    pkg_cv_[]$1="$$1"
 
1348
 elif test -n "$PKG_CONFIG"; then
 
1349
    PKG_CHECK_EXISTS([$3],
 
1350
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 
1351
                     [pkg_failed=yes])
 
1352
 else
 
1353
    pkg_failed=untried
 
1354
fi[]dnl
 
1355
])# _PKG_CONFIG
 
1356
 
 
1357
# _PKG_SHORT_ERRORS_SUPPORTED
 
1358
# -----------------------------
 
1359
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 
1360
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1361
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 
1362
        _pkg_short_errors_supported=yes
 
1363
else
 
1364
        _pkg_short_errors_supported=no
 
1365
fi[]dnl
 
1366
])# _PKG_SHORT_ERRORS_SUPPORTED
 
1367
 
 
1368
 
 
1369
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 
1370
# [ACTION-IF-NOT-FOUND])
 
1371
#
 
1372
#
 
1373
# Note that if there is a possibility the first call to
 
1374
# PKG_CHECK_MODULES might not happen, you should be sure to include an
 
1375
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 
1376
#
 
1377
#
 
1378
# --------------------------------------------------------------
 
1379
AC_DEFUN([PKG_CHECK_MODULES],
 
1380
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
1381
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 
1382
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
1383
 
 
1384
pkg_failed=no
 
1385
AC_MSG_CHECKING([for $1])
 
1386
 
 
1387
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 
1388
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
1389
 
 
1390
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 
1391
and $1[]_LIBS to avoid the need to call pkg-config.
 
1392
See the pkg-config man page for more details.])
 
1393
 
 
1394
if test $pkg_failed = yes; then
 
1395
        AC_MSG_RESULT([no])
 
1396
        _PKG_SHORT_ERRORS_SUPPORTED
 
1397
        if test $_pkg_short_errors_supported = yes; then
 
1398
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
 
1399
        else 
 
1400
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
 
1401
        fi
 
1402
        # Put the nasty error message in config.log where it belongs
 
1403
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
1404
 
 
1405
        m4_default([$4], [AC_MSG_ERROR(
 
1406
[Package requirements ($2) were not met:
 
1407
 
 
1408
$$1_PKG_ERRORS
 
1409
 
 
1410
Consider adjusting the PKG_CONFIG_PATH environment variable if you
 
1411
installed software in a non-standard prefix.
 
1412
 
 
1413
_PKG_TEXT])
 
1414
        ])
 
1415
elif test $pkg_failed = untried; then
 
1416
        AC_MSG_RESULT([no])
 
1417
        m4_default([$4], [AC_MSG_FAILURE(
 
1418
[The pkg-config script could not be found or is too old.  Make sure it
 
1419
is in your PATH or set the PKG_CONFIG environment variable to the full
 
1420
path to pkg-config.
 
1421
 
 
1422
_PKG_TEXT
 
1423
 
 
1424
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
 
1425
        ])
 
1426
else
 
1427
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 
1428
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 
1429
        AC_MSG_RESULT([yes])
 
1430
        $3
 
1431
fi[]dnl
 
1432
])# PKG_CHECK_MODULES
 
1433
 
 
1434
# Configure paths for GLIB
 
1435
# Owen Taylor     1997-2001
 
1436
 
 
1437
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
 
1438
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
 
1439
dnl gthread, or gio is specified in MODULES, pass to pkg-config
 
1440
dnl
 
1441
AC_DEFUN([AM_PATH_GLIB_2_0],
 
1442
[dnl 
 
1443
dnl Get the cflags and libraries from pkg-config
 
1444
dnl
 
1445
AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
 
1446
                    , enable_glibtest=yes)
 
1447
 
 
1448
  pkg_config_args=glib-2.0
 
1449
  for module in . $4
 
1450
  do
 
1451
      case "$module" in
 
1452
         gmodule) 
 
1453
             pkg_config_args="$pkg_config_args gmodule-2.0"
 
1454
         ;;
 
1455
         gmodule-no-export) 
 
1456
             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
 
1457
         ;;
 
1458
         gobject) 
 
1459
             pkg_config_args="$pkg_config_args gobject-2.0"
 
1460
         ;;
 
1461
         gthread) 
 
1462
             pkg_config_args="$pkg_config_args gthread-2.0"
 
1463
         ;;
 
1464
         gio*) 
 
1465
             pkg_config_args="$pkg_config_args $module-2.0"
 
1466
         ;;
 
1467
      esac
 
1468
  done
 
1469
 
 
1470
  PKG_PROG_PKG_CONFIG([0.16])
 
1471
 
 
1472
  no_glib=""
 
1473
 
 
1474
  if test "x$PKG_CONFIG" = x ; then
 
1475
    no_glib=yes
 
1476
    PKG_CONFIG=no
 
1477
  fi
 
1478
 
 
1479
  min_glib_version=ifelse([$1], ,2.0.0,$1)
 
1480
  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
 
1481
 
 
1482
  if test x$PKG_CONFIG != xno ; then
 
1483
    ## don't try to run the test against uninstalled libtool libs
 
1484
    if $PKG_CONFIG --uninstalled $pkg_config_args; then
 
1485
          echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
 
1486
          enable_glibtest=no
 
1487
    fi
 
1488
 
 
1489
    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
 
1490
          :
 
1491
    else
 
1492
          no_glib=yes
 
1493
    fi
 
1494
  fi
 
1495
 
 
1496
  if test x"$no_glib" = x ; then
 
1497
    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
 
1498
    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
 
1499
    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
 
1500
    GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
 
1501
 
 
1502
    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
 
1503
    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
 
1504
    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
 
1505
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
 
1506
    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
 
1507
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
 
1508
    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
 
1509
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
1510
    if test "x$enable_glibtest" = "xyes" ; then
 
1511
      ac_save_CFLAGS="$CFLAGS"
 
1512
      ac_save_LIBS="$LIBS"
 
1513
      CFLAGS="$CFLAGS $GLIB_CFLAGS"
 
1514
      LIBS="$GLIB_LIBS $LIBS"
 
1515
dnl
 
1516
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
 
1517
dnl checks the results of pkg-config to some extent)
 
1518
dnl
 
1519
      rm -f conf.glibtest
 
1520
      AC_TRY_RUN([
 
1521
#include <glib.h>
 
1522
#include <stdio.h>
 
1523
#include <stdlib.h>
 
1524
 
 
1525
int 
 
1526
main ()
 
1527
{
 
1528
  unsigned int major, minor, micro;
 
1529
  char *tmp_version;
 
1530
 
 
1531
  fclose (fopen ("conf.glibtest", "w"));
 
1532
 
 
1533
  /* HP/UX 9 (%@#!) writes to sscanf strings */
 
1534
  tmp_version = g_strdup("$min_glib_version");
 
1535
  if (sscanf(tmp_version, "%u.%u.%u", &major, &minor, &micro) != 3) {
 
1536
     printf("%s, bad version string\n", "$min_glib_version");
 
1537
     exit(1);
 
1538
   }
 
1539
 
 
1540
  if ((glib_major_version != $glib_config_major_version) ||
 
1541
      (glib_minor_version != $glib_config_minor_version) ||
 
1542
      (glib_micro_version != $glib_config_micro_version))
 
1543
    {
 
1544
      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
 
1545
             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
 
1546
             glib_major_version, glib_minor_version, glib_micro_version);
 
1547
      printf ("*** was found! If pkg-config was correct, then it is best\n");
 
1548
      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
 
1549
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
 
1550
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
 
1551
      printf("*** required on your system.\n");
 
1552
      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
 
1553
      printf("*** to point to the correct configuration files\n");
 
1554
    } 
 
1555
  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
 
1556
           (glib_minor_version != GLIB_MINOR_VERSION) ||
 
1557
           (glib_micro_version != GLIB_MICRO_VERSION))
 
1558
    {
 
1559
      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
 
1560
             GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
 
1561
      printf("*** library (version %d.%d.%d)\n",
 
1562
             glib_major_version, glib_minor_version, glib_micro_version);
 
1563
    }
 
1564
  else
 
1565
    {
 
1566
      if ((glib_major_version > major) ||
 
1567
        ((glib_major_version == major) && (glib_minor_version > minor)) ||
 
1568
        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
 
1569
      {
 
1570
        return 0;
 
1571
       }
 
1572
     else
 
1573
      {
 
1574
        printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
 
1575
               glib_major_version, glib_minor_version, glib_micro_version);
 
1576
        printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
 
1577
               major, minor, micro);
 
1578
        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
 
1579
        printf("***\n");
 
1580
        printf("*** If you have already installed a sufficiently new version, this error\n");
 
1581
        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
 
1582
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
 
1583
        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
 
1584
        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
 
1585
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
 
1586
        printf("*** so that the correct libraries are found at run-time))\n");
 
1587
      }
 
1588
    }
 
1589
  return 1;
 
1590
}
 
1591
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
1592
       CFLAGS="$ac_save_CFLAGS"
 
1593
       LIBS="$ac_save_LIBS"
 
1594
     fi
 
1595
  fi
 
1596
  if test "x$no_glib" = x ; then
 
1597
     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
 
1598
     ifelse([$2], , :, [$2])     
 
1599
  else
 
1600
     AC_MSG_RESULT(no)
 
1601
     if test "$PKG_CONFIG" = "no" ; then
 
1602
       echo "*** A new enough version of pkg-config was not found."
 
1603
       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
 
1604
     else
 
1605
       if test -f conf.glibtest ; then
 
1606
        :
 
1607
       else
 
1608
          echo "*** Could not run GLIB test program, checking why..."
 
1609
          ac_save_CFLAGS="$CFLAGS"
 
1610
          ac_save_LIBS="$LIBS"
 
1611
          CFLAGS="$CFLAGS $GLIB_CFLAGS"
 
1612
          LIBS="$LIBS $GLIB_LIBS"
 
1613
          AC_TRY_LINK([
 
1614
#include <glib.h>
 
1615
#include <stdio.h>
 
1616
],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
 
1617
        [ echo "*** The test program compiled, but did not run. This usually means"
 
1618
          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
 
1619
          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
 
1620
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
 
1621
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
 
1622
          echo "*** is required on your system"
 
1623
          echo "***"
 
1624
          echo "*** If you have an old version installed, it is best to remove it, although"
 
1625
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
 
1626
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
 
1627
          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
 
1628
          CFLAGS="$ac_save_CFLAGS"
 
1629
          LIBS="$ac_save_LIBS"
 
1630
       fi
 
1631
     fi
 
1632
     GLIB_CFLAGS=""
 
1633
     GLIB_LIBS=""
 
1634
     GLIB_GENMARSHAL=""
 
1635
     GOBJECT_QUERY=""
 
1636
     GLIB_MKENUMS=""
 
1637
     GLIB_COMPILE_RESOURCES=""
 
1638
     ifelse([$3], , :, [$3])
 
1639
  fi
 
1640
  AC_SUBST(GLIB_CFLAGS)
 
1641
  AC_SUBST(GLIB_LIBS)
 
1642
  AC_SUBST(GLIB_GENMARSHAL)
 
1643
  AC_SUBST(GOBJECT_QUERY)
 
1644
  AC_SUBST(GLIB_MKENUMS)
 
1645
  AC_SUBST(GLIB_COMPILE_RESOURCES)
 
1646
  rm -f conf.glibtest
 
1647
])
 
1648
 
 
1649
dnl GLIB_GSETTINGS
 
1650
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
 
1651
dnl the schema should be compiled
 
1652
dnl
 
1653
 
 
1654
AC_DEFUN([GLIB_GSETTINGS],
 
1655
[
 
1656
  m4_pattern_allow([AM_V_GEN])
 
1657
  AC_ARG_ENABLE(schemas-compile,
 
1658
                AS_HELP_STRING([--disable-schemas-compile],
 
1659
                               [Disable regeneration of gschemas.compiled on install]),
 
1660
                [case ${enableval} in
 
1661
                  yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE=""  ;;
 
1662
                  no)  GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
 
1663
                  *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
 
1664
                 esac])
 
1665
  AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
 
1666
  PKG_PROG_PKG_CONFIG([0.16])
 
1667
  AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
 
1668
  if test x$cross_compiling != xyes; then
 
1669
    GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
 
1670
  else
 
1671
    AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
 
1672
  fi
 
1673
  AC_SUBST(GLIB_COMPILE_SCHEMAS)
 
1674
  if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
 
1675
    ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
 
1676
  else
 
1677
    ifelse([$1],,[:],[$1])
 
1678
  fi
 
1679
 
 
1680
  GSETTINGS_RULES='
 
1681
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
 
1682
 
 
1683
mostlyclean-am: clean-gsettings-schemas
 
1684
 
 
1685
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
 
1686
 
 
1687
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
 
1688
        $(AM_V_GEN) if test -f "$<"; then d=; else d="$(srcdir)/"; fi; $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$${d}$< && touch [$]@
 
1689
 
 
1690
all-am: $(gsettings_SCHEMAS:.xml=.valid)
 
1691
uninstall-am: uninstall-gsettings-schemas
 
1692
install-data-am: install-gsettings-schemas
 
1693
 
 
1694
.SECONDARY: $(gsettings_SCHEMAS)
 
1695
 
 
1696
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
 
1697
        @$(NORMAL_INSTALL)
 
1698
        if test -n "$^"; then \
 
1699
                test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
 
1700
                $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
 
1701
                test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
 
1702
        fi
 
1703
 
 
1704
uninstall-gsettings-schemas:
 
1705
        @$(NORMAL_UNINSTALL)
 
1706
        @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
 
1707
        files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
 
1708
        test -n "$$files" || exit 0; \
 
1709
        echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
 
1710
        cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
 
1711
        test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
 
1712
 
 
1713
clean-gsettings-schemas:
 
1714
        rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
 
1715
 
 
1716
ifdef gsettings_ENUM_NAMESPACE
 
1717
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
 
1718
        $(AM_V_GEN) glib-mkenums --comments '\''<!-- @comment@ -->'\'' --fhead "<schemalist>" --vhead "  <@type@ id='\''$(gsettings_ENUM_NAMESPACE).@EnumName@'\''>" --vprod "    <value nick='\''@valuenick@'\'' value='\''@valuenum@'\''/>" --vtail "  </@type@>" --ftail "</schemalist>" [$]^ > [$]@.tmp && mv [$]@.tmp [$]@
 
1719
endif
 
1720
'
 
1721
  _GSETTINGS_SUBST(GSETTINGS_RULES)
 
1722
])
 
1723
 
 
1724
dnl _GSETTINGS_SUBST(VARIABLE)
 
1725
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
 
1726
AC_DEFUN([_GSETTINGS_SUBST],
 
1727
[
 
1728
AC_SUBST([$1])
 
1729
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
 
1730
]
 
1731
)
 
1732
 
 
1733
dnl -*- mode: autoconf -*-
 
1734
dnl Copyright 2009 Johan Dahlin
 
1735
dnl
 
1736
dnl This file is free software; the author(s) gives unlimited
 
1737
dnl permission to copy and/or distribute it, with or without
 
1738
dnl modifications, as long as this notice is preserved.
 
1739
dnl
 
1740
 
 
1741
# serial 1
 
1742
 
 
1743
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
 
1744
[
 
1745
    AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
 
1746
    AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
 
1747
    AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
 
1748
 
 
1749
    dnl enable/disable introspection
 
1750
    m4_if([$2], [require],
 
1751
    [dnl
 
1752
        enable_introspection=yes
 
1753
    ],[dnl
 
1754
        AC_ARG_ENABLE(introspection,
 
1755
                  AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
 
1756
                                 [Enable introspection for this build]),, 
 
1757
                                 [enable_introspection=auto])
 
1758
    ])dnl
 
1759
 
 
1760
    AC_MSG_CHECKING([for gobject-introspection])
 
1761
 
 
1762
    dnl presence/version checking
 
1763
    AS_CASE([$enable_introspection],
 
1764
    [no], [dnl
 
1765
        found_introspection="no (disabled, use --enable-introspection to enable)"
 
1766
    ],dnl
 
1767
    [yes],[dnl
 
1768
        PKG_CHECK_EXISTS([gobject-introspection-1.0],,
 
1769
                         AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
 
1770
        PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
 
1771
                         found_introspection=yes,
 
1772
                         AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
 
1773
    ],dnl
 
1774
    [auto],[dnl
 
1775
        PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
 
1776
    ],dnl
 
1777
    [dnl        
 
1778
        AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
 
1779
    ])dnl
 
1780
 
 
1781
    AC_MSG_RESULT([$found_introspection])
 
1782
 
 
1783
    INTROSPECTION_SCANNER=
 
1784
    INTROSPECTION_COMPILER=
 
1785
    INTROSPECTION_GENERATE=
 
1786
    INTROSPECTION_GIRDIR=
 
1787
    INTROSPECTION_TYPELIBDIR=
 
1788
    if test "x$found_introspection" = "xyes"; then
 
1789
       INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
 
1790
       INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
 
1791
       INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
 
1792
       INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
 
1793
       INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
 
1794
       INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
 
1795
       INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
 
1796
       INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
 
1797
    fi
 
1798
    AC_SUBST(INTROSPECTION_SCANNER)
 
1799
    AC_SUBST(INTROSPECTION_COMPILER)
 
1800
    AC_SUBST(INTROSPECTION_GENERATE)
 
1801
    AC_SUBST(INTROSPECTION_GIRDIR)
 
1802
    AC_SUBST(INTROSPECTION_TYPELIBDIR)
 
1803
    AC_SUBST(INTROSPECTION_CFLAGS)
 
1804
    AC_SUBST(INTROSPECTION_LIBS)
 
1805
    AC_SUBST(INTROSPECTION_MAKEFILE)
 
1806
 
 
1807
    AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
 
1808
])
 
1809
 
 
1810
 
 
1811
dnl Usage:
 
1812
dnl   GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
 
1813
 
 
1814
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
 
1815
[
 
1816
  _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
 
1817
])
 
1818
 
 
1819
dnl Usage:
 
1820
dnl   GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
 
1821
 
 
1822
 
 
1823
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
 
1824
[
 
1825
  _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
 
1826
])
 
1827
 
1870
1828
m4_include([m4/gettext.m4])
 
1829
m4_include([m4/gtk-doc.m4])
1871
1830
m4_include([m4/iconv.m4])
1872
1831
m4_include([m4/intlmacosx.m4])
1873
1832
m4_include([m4/intltool.m4])