~ubuntu-branches/ubuntu/trusty/vino/trusty-proposed

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-08-21 17:07:41 UTC
  • mfrom: (1.1.63)
  • Revision ID: package-import@ubuntu.com-20120821170741-zj374mk9p2ij8jvr
Tags: 3.5.90-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
 
1
# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
2
2
 
3
3
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4
 
# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 
4
# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
 
5
# Inc.
5
6
# This file is free software; the Free Software Foundation
6
7
# gives unlimited permission to copy and/or distribute it,
7
8
# with or without modifications, as long as this notice is preserved.
19
20
If you have problems, you may need to regenerate the build system entirely.
20
21
To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
22
 
22
 
# gnome-common.m4
23
 
#
24
 
# serial 3
25
 
26
 
 
27
 
dnl GNOME_COMMON_INIT
28
 
 
29
 
AU_DEFUN([GNOME_COMMON_INIT],
30
 
[
31
 
  dnl this macro should come after AC_CONFIG_MACRO_DIR
32
 
  AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
33
 
 
34
 
  dnl ensure that when the Automake generated makefile calls aclocal,
35
 
  dnl it honours the $ACLOCAL_FLAGS environment variable
36
 
  ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
37
 
  if test -n "$ac_macro_dir"; then
38
 
    ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
39
 
  fi
40
 
 
41
 
  AC_SUBST([ACLOCAL_AMFLAGS])
42
 
],
43
 
[[$0: This macro is deprecated. You should set put "ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}"
44
 
in your top-level Makefile.am, instead, where "m4" is the macro directory set
45
 
with AC_CONFIG_MACRO_DIR() in your configure.ac]])
46
 
 
47
 
AC_DEFUN([GNOME_DEBUG_CHECK],
48
 
[
49
 
        AC_ARG_ENABLE([debug],
50
 
                      AC_HELP_STRING([--enable-debug],
51
 
                                     [turn on debugging]),,
52
 
                      [enable_debug=no])
53
 
 
54
 
        if test x$enable_debug = xyes ; then
55
 
            AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
56
 
                [Enable additional debugging at the expense of performance and size])
57
 
        fi
58
 
])
59
 
 
60
 
dnl GNOME_MAINTAINER_MODE_DEFINES ()
61
 
dnl define DISABLE_DEPRECATED
62
 
dnl
63
 
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
64
 
[
65
 
        AC_REQUIRE([AM_MAINTAINER_MODE])
66
 
 
67
 
        DISABLE_DEPRECATED=""
68
 
        if test $USE_MAINTAINER_MODE = yes; then
69
 
                DOMAINS="G ATK PANGO GDK GDK_PIXBUF GTK GCONF BONOBO BONOBO_UI GNOME LIBGLADE VTE GNOME_VFS WNCK LIBSOUP"
70
 
                for DOMAIN in $DOMAINS; do
71
 
                       DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
72
 
                done
73
 
        fi
74
 
 
75
 
        AC_SUBST(DISABLE_DEPRECATED)
76
 
])
77
 
 
78
 
dnl GNOME_COMPILE_WARNINGS
79
 
dnl Turn on many useful compiler warnings
80
 
dnl For now, only works on GCC
81
 
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
82
 
    dnl ******************************
83
 
    dnl More compiler warnings
84
 
    dnl ******************************
85
 
 
86
 
    AC_ARG_ENABLE(compile-warnings, 
87
 
                  AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
88
 
                                 [Turn on compiler warnings]),,
89
 
                  [enable_compile_warnings="m4_default([$1],[yes])"])
90
 
 
91
 
    warnCFLAGS=
92
 
    if test "x$GCC" != xyes; then
93
 
        enable_compile_warnings=no
94
 
    fi
95
 
 
96
 
    warning_flags=
97
 
    realsave_CFLAGS="$CFLAGS"
98
 
 
99
 
    case "$enable_compile_warnings" in
100
 
    no)
101
 
        warning_flags=
102
 
        ;;
103
 
    minimum)
104
 
        warning_flags="-Wall"
105
 
        ;;
106
 
    yes)
107
 
        warning_flags="-Wall -Wmissing-prototypes"
108
 
        ;;
109
 
    maximum|error)
110
 
        warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
111
 
        CFLAGS="$warning_flags $CFLAGS"
112
 
        for option in -Wno-sign-compare; do
113
 
                SAVE_CFLAGS="$CFLAGS"
114
 
                CFLAGS="$CFLAGS $option"
115
 
                AC_MSG_CHECKING([whether gcc understands $option])
116
 
                AC_TRY_COMPILE([], [],
117
 
                        has_option=yes,
118
 
                        has_option=no,)
119
 
                CFLAGS="$SAVE_CFLAGS"
120
 
                AC_MSG_RESULT($has_option)
121
 
                if test $has_option = yes; then
122
 
                  warning_flags="$warning_flags $option"
123
 
                fi
124
 
                unset has_option
125
 
                unset SAVE_CFLAGS
126
 
        done
127
 
        unset option
128
 
        if test "$enable_compile_warnings" = "error" ; then
129
 
            warning_flags="$warning_flags -Werror"
130
 
        fi
131
 
        ;;
132
 
    *)
133
 
        AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
134
 
        ;;
135
 
    esac
136
 
    CFLAGS="$realsave_CFLAGS"
137
 
    AC_MSG_CHECKING(what warning flags to pass to the C compiler)
138
 
    AC_MSG_RESULT($warning_flags)
139
 
 
140
 
    AC_ARG_ENABLE(iso-c,
141
 
                  AC_HELP_STRING([--enable-iso-c],
142
 
                                 [Try to warn if code is not ISO C ]),,
143
 
                  [enable_iso_c=no])
144
 
 
145
 
    AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
146
 
    complCFLAGS=
147
 
    if test "x$enable_iso_c" != "xno"; then
148
 
        if test "x$GCC" = "xyes"; then
149
 
        case " $CFLAGS " in
150
 
            *[\ \       ]-ansi[\ \      ]*) ;;
151
 
            *) complCFLAGS="$complCFLAGS -ansi" ;;
152
 
        esac
153
 
        case " $CFLAGS " in
154
 
            *[\ \       ]-pedantic[\ \  ]*) ;;
155
 
            *) complCFLAGS="$complCFLAGS -pedantic" ;;
156
 
        esac
157
 
        fi
158
 
    fi
159
 
    AC_MSG_RESULT($complCFLAGS)
160
 
 
161
 
    WARN_CFLAGS="$warning_flags $complCFLAGS"
162
 
    AC_SUBST(WARN_CFLAGS)
163
 
])
164
 
 
165
 
dnl For C++, do basically the same thing.
166
 
 
167
 
AC_DEFUN([GNOME_CXX_WARNINGS],[
168
 
  AC_ARG_ENABLE(cxx-warnings,
169
 
                AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
170
 
                               [Turn on compiler warnings.]),,
171
 
                [enable_cxx_warnings="m4_default([$1],[minimum])"])
172
 
 
173
 
  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
174
 
  warnCXXFLAGS=
175
 
  if test "x$GXX" != xyes; then
176
 
    enable_cxx_warnings=no
177
 
  fi
178
 
  if test "x$enable_cxx_warnings" != "xno"; then
179
 
    if test "x$GXX" = "xyes"; then
180
 
      case " $CXXFLAGS " in
181
 
      *[\ \     ]-Wall[\ \      ]*) ;;
182
 
      *) warnCXXFLAGS="-Wall -Wno-unused" ;;
183
 
      esac
184
 
 
185
 
      ## -W is not all that useful.  And it cannot be controlled
186
 
      ## with individual -Wno-xxx flags, unlike -Wall
187
 
      if test "x$enable_cxx_warnings" = "xyes"; then
188
 
        warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
189
 
      fi
190
 
    fi
191
 
  fi
192
 
  AC_MSG_RESULT($warnCXXFLAGS)
193
 
 
194
 
   AC_ARG_ENABLE(iso-cxx,
195
 
                 AC_HELP_STRING([--enable-iso-cxx],
196
 
                                [Try to warn if code is not ISO C++ ]),,
197
 
                 [enable_iso_cxx=no])
198
 
 
199
 
   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
200
 
   complCXXFLAGS=
201
 
   if test "x$enable_iso_cxx" != "xno"; then
202
 
     if test "x$GXX" = "xyes"; then
203
 
      case " $CXXFLAGS " in
204
 
      *[\ \     ]-ansi[\ \      ]*) ;;
205
 
      *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
206
 
      esac
207
 
 
208
 
      case " $CXXFLAGS " in
209
 
      *[\ \     ]-pedantic[\ \  ]*) ;;
210
 
      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
211
 
      esac
212
 
     fi
213
 
   fi
214
 
  AC_MSG_RESULT($complCXXFLAGS)
215
 
 
216
 
  WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
217
 
  AC_SUBST(WARN_CXXFLAGS)
218
 
])
219
 
 
220
 
dnl GLIB_GSETTINGS
221
 
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
222
 
dnl the schema should be compiled
223
 
dnl
224
 
 
225
 
AC_DEFUN([GLIB_GSETTINGS],
226
 
[
227
 
  m4_pattern_allow([AM_V_GEN])
228
 
  AC_ARG_ENABLE(schemas-compile,
229
 
                AS_HELP_STRING([--disable-schemas-compile],
230
 
                               [Disable regeneration of gschemas.compiled on install]),
231
 
                [case ${enableval} in
232
 
                  yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE=""  ;;
233
 
                  no)  GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
234
 
                  *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
235
 
                 esac])
236
 
  AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
237
 
  PKG_PROG_PKG_CONFIG([0.16])
238
 
  AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
239
 
  if test x$cross_compiling != xyes; then
240
 
    GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
241
 
  else
242
 
    AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
243
 
  fi
244
 
  AC_SUBST(GLIB_COMPILE_SCHEMAS)
245
 
  if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
246
 
    ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
247
 
  else
248
 
    ifelse([$1],,[:],[$1])
249
 
  fi
250
 
 
251
 
  GSETTINGS_RULES='
252
 
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
253
 
 
254
 
mostlyclean-am: clean-gsettings-schemas
255
 
 
256
 
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
257
 
 
258
 
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
259
 
        $(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 [$]@
260
 
 
261
 
all-am: $(gsettings_SCHEMAS:.xml=.valid)
262
 
uninstall-am: uninstall-gsettings-schemas
263
 
install-data-am: install-gsettings-schemas
264
 
 
265
 
.SECONDARY: $(gsettings_SCHEMAS)
266
 
 
267
 
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
268
 
        @$(NORMAL_INSTALL)
269
 
        if test -n "$^"; then \
270
 
                test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
271
 
                $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
272
 
                test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
273
 
        fi
274
 
 
275
 
uninstall-gsettings-schemas:
276
 
        @$(NORMAL_UNINSTALL)
277
 
        @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
278
 
        files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
279
 
        test -n "$$files" || exit 0; \
280
 
        echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
281
 
        cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
282
 
        test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
283
 
 
284
 
clean-gsettings-schemas:
285
 
        rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
286
 
 
287
 
ifdef gsettings_ENUM_NAMESPACE
288
 
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
289
 
        $(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 [$]@
290
 
endif
291
 
'
292
 
  _GSETTINGS_SUBST(GSETTINGS_RULES)
293
 
])
294
 
 
295
 
dnl _GSETTINGS_SUBST(VARIABLE)
296
 
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
297
 
AC_DEFUN([_GSETTINGS_SUBST],
298
 
[
299
 
AC_SUBST([$1])
300
 
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
301
 
]
302
 
)
303
 
 
304
 
dnl Autoconf macros for libgcrypt
305
 
dnl       Copyright (C) 2002, 2004 Free Software Foundation, Inc.
306
 
dnl
307
 
dnl This file is free software; as a special exception the author gives
308
 
dnl unlimited permission to copy and/or distribute it, with or without
309
 
dnl modifications, as long as this notice is preserved.
310
 
dnl
311
 
dnl This file is distributed in the hope that it will be useful, but
312
 
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
313
 
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
314
 
 
315
 
 
316
 
dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
317
 
dnl                   [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
318
 
dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
319
 
dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed
320
 
dnl with the API version to also check the API compatibility. Example:
321
 
dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed 
322
 
dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1.  Using
323
 
dnl this features allows to prevent build against newer versions of libgcrypt
324
 
dnl with a changed API.
325
 
dnl
326
 
AC_DEFUN([AM_PATH_LIBGCRYPT],
327
 
[ AC_ARG_WITH(libgcrypt-prefix,
328
 
            AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
329
 
                           [prefix where LIBGCRYPT is installed (optional)]),
330
 
     libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
331
 
  if test x$libgcrypt_config_prefix != x ; then
332
 
     if test x${LIBGCRYPT_CONFIG+set} != xset ; then
333
 
        LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
334
 
     fi
335
 
  fi
336
 
 
337
 
  AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
338
 
  tmp=ifelse([$1], ,1:1.2.0,$1)
339
 
  if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
340
 
     req_libgcrypt_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
341
 
     min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
342
 
  else
343
 
     req_libgcrypt_api=0
344
 
     min_libgcrypt_version="$tmp"
345
 
  fi
346
 
 
347
 
  AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
348
 
  ok=no
349
 
  if test "$LIBGCRYPT_CONFIG" != "no" ; then
350
 
    req_major=`echo $min_libgcrypt_version | \
351
 
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
352
 
    req_minor=`echo $min_libgcrypt_version | \
353
 
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
354
 
    req_micro=`echo $min_libgcrypt_version | \
355
 
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
356
 
    libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
357
 
    major=`echo $libgcrypt_config_version | \
358
 
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
359
 
    minor=`echo $libgcrypt_config_version | \
360
 
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
361
 
    micro=`echo $libgcrypt_config_version | \
362
 
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
363
 
    if test "$major" -gt "$req_major"; then
364
 
        ok=yes
365
 
    else 
366
 
        if test "$major" -eq "$req_major"; then
367
 
            if test "$minor" -gt "$req_minor"; then
368
 
               ok=yes
369
 
            else
370
 
               if test "$minor" -eq "$req_minor"; then
371
 
                   if test "$micro" -ge "$req_micro"; then
372
 
                     ok=yes
373
 
                   fi
374
 
               fi
375
 
            fi
376
 
        fi
377
 
    fi
378
 
  fi
379
 
  if test $ok = yes; then
380
 
    AC_MSG_RESULT([yes ($libgcrypt_config_version)])
381
 
  else
382
 
    AC_MSG_RESULT(no)
383
 
  fi
384
 
  if test $ok = yes; then
385
 
     # If we have a recent libgcrypt, we should also check that the
386
 
     # API is compatible
387
 
     if test "$req_libgcrypt_api" -gt 0 ; then
388
 
        tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
389
 
        if test "$tmp" -gt 0 ; then
390
 
           AC_MSG_CHECKING([LIBGCRYPT API version])
391
 
           if test "$req_libgcrypt_api" -eq "$tmp" ; then
392
 
             AC_MSG_RESULT([okay])
393
 
           else
394
 
             ok=no
395
 
             AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
396
 
           fi
397
 
        fi
398
 
     fi
399
 
  fi
400
 
  if test $ok = yes; then
401
 
    LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
402
 
    LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
403
 
    ifelse([$2], , :, [$2])
404
 
  else
405
 
    LIBGCRYPT_CFLAGS=""
406
 
    LIBGCRYPT_LIBS=""
407
 
    ifelse([$3], , :, [$3])
408
 
  fi
409
 
  AC_SUBST(LIBGCRYPT_CFLAGS)
410
 
  AC_SUBST(LIBGCRYPT_LIBS)
411
 
])
412
 
 
413
 
# nls.m4 serial 5 (gettext-0.18)
414
 
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
415
 
dnl Inc.
416
 
dnl This file is free software; the Free Software Foundation
417
 
dnl gives unlimited permission to copy and/or distribute it,
418
 
dnl with or without modifications, as long as this notice is preserved.
419
 
dnl
420
 
dnl This file can can be used in projects which are not available under
421
 
dnl the GNU General Public License or the GNU Library General Public
422
 
dnl License but which still want to provide support for the GNU gettext
423
 
dnl functionality.
424
 
dnl Please note that the actual code of the GNU gettext library is covered
425
 
dnl by the GNU Library General Public License, and the rest of the GNU
426
 
dnl gettext package package is covered by the GNU General Public License.
427
 
dnl They are *not* in the public domain.
428
 
 
429
 
dnl Authors:
430
 
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
431
 
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
432
 
 
433
 
AC_PREREQ([2.50])
434
 
 
435
 
AC_DEFUN([AM_NLS],
436
 
[
437
 
  AC_MSG_CHECKING([whether NLS is requested])
438
 
  dnl Default is enabled NLS
439
 
  AC_ARG_ENABLE([nls],
440
 
    [  --disable-nls           do not use Native Language Support],
441
 
    USE_NLS=$enableval, USE_NLS=yes)
442
 
  AC_MSG_RESULT([$USE_NLS])
443
 
  AC_SUBST([USE_NLS])
444
 
])
445
 
 
446
 
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
447
 
# serial 1 (pkg-config-0.24)
448
 
449
 
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
450
 
#
451
 
# This program is free software; you can redistribute it and/or modify
452
 
# it under the terms of the GNU General Public License as published by
453
 
# the Free Software Foundation; either version 2 of the License, or
454
 
# (at your option) any later version.
455
 
#
456
 
# This program is distributed in the hope that it will be useful, but
457
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
458
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
459
 
# General Public License for more details.
460
 
#
461
 
# You should have received a copy of the GNU General Public License
462
 
# along with this program; if not, write to the Free Software
463
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
464
 
#
465
 
# As a special exception to the GNU General Public License, if you
466
 
# distribute this file as part of a program that contains a
467
 
# configuration script generated by Autoconf, you may include it under
468
 
# the same distribution terms that you use for the rest of that program.
469
 
 
470
 
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
471
 
# ----------------------------------
472
 
AC_DEFUN([PKG_PROG_PKG_CONFIG],
473
 
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
474
 
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
475
 
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
476
 
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
477
 
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
478
 
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
479
 
 
480
 
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
481
 
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
482
 
fi
483
 
if test -n "$PKG_CONFIG"; then
484
 
        _pkg_min_version=m4_default([$1], [0.9.0])
485
 
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
486
 
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
487
 
                AC_MSG_RESULT([yes])
488
 
        else
489
 
                AC_MSG_RESULT([no])
490
 
                PKG_CONFIG=""
491
 
        fi
492
 
fi[]dnl
493
 
])# PKG_PROG_PKG_CONFIG
494
 
 
495
 
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
496
 
#
497
 
# Check to see whether a particular set of modules exists.  Similar
498
 
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
499
 
#
500
 
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
501
 
# only at the first occurence in configure.ac, so if the first place
502
 
# it's called might be skipped (such as if it is within an "if", you
503
 
# have to call PKG_CHECK_EXISTS manually
504
 
# --------------------------------------------------------------
505
 
AC_DEFUN([PKG_CHECK_EXISTS],
506
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
507
 
if test -n "$PKG_CONFIG" && \
508
 
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
509
 
  m4_default([$2], [:])
510
 
m4_ifvaln([$3], [else
511
 
  $3])dnl
512
 
fi])
513
 
 
514
 
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
515
 
# ---------------------------------------------
516
 
m4_define([_PKG_CONFIG],
517
 
[if test -n "$$1"; then
518
 
    pkg_cv_[]$1="$$1"
519
 
 elif test -n "$PKG_CONFIG"; then
520
 
    PKG_CHECK_EXISTS([$3],
521
 
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
522
 
                      test "x$?" != "x0" && pkg_failed=yes ],
523
 
                     [pkg_failed=yes])
524
 
 else
525
 
    pkg_failed=untried
526
 
fi[]dnl
527
 
])# _PKG_CONFIG
528
 
 
529
 
# _PKG_SHORT_ERRORS_SUPPORTED
530
 
# -----------------------------
531
 
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
532
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
533
 
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
534
 
        _pkg_short_errors_supported=yes
535
 
else
536
 
        _pkg_short_errors_supported=no
537
 
fi[]dnl
538
 
])# _PKG_SHORT_ERRORS_SUPPORTED
539
 
 
540
 
 
541
 
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
542
 
# [ACTION-IF-NOT-FOUND])
543
 
#
544
 
#
545
 
# Note that if there is a possibility the first call to
546
 
# PKG_CHECK_MODULES might not happen, you should be sure to include an
547
 
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
548
 
#
549
 
#
550
 
# --------------------------------------------------------------
551
 
AC_DEFUN([PKG_CHECK_MODULES],
552
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
553
 
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
554
 
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
555
 
 
556
 
pkg_failed=no
557
 
AC_MSG_CHECKING([for $1])
558
 
 
559
 
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
560
 
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
561
 
 
562
 
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
563
 
and $1[]_LIBS to avoid the need to call pkg-config.
564
 
See the pkg-config man page for more details.])
565
 
 
566
 
if test $pkg_failed = yes; then
567
 
        AC_MSG_RESULT([no])
568
 
        _PKG_SHORT_ERRORS_SUPPORTED
569
 
        if test $_pkg_short_errors_supported = yes; then
570
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
571
 
        else 
572
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
573
 
        fi
574
 
        # Put the nasty error message in config.log where it belongs
575
 
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
576
 
 
577
 
        m4_default([$4], [AC_MSG_ERROR(
578
 
[Package requirements ($2) were not met:
579
 
 
580
 
$$1_PKG_ERRORS
581
 
 
582
 
Consider adjusting the PKG_CONFIG_PATH environment variable if you
583
 
installed software in a non-standard prefix.
584
 
 
585
 
_PKG_TEXT])[]dnl
586
 
        ])
587
 
elif test $pkg_failed = untried; then
588
 
        AC_MSG_RESULT([no])
589
 
        m4_default([$4], [AC_MSG_FAILURE(
590
 
[The pkg-config script could not be found or is too old.  Make sure it
591
 
is in your PATH or set the PKG_CONFIG environment variable to the full
592
 
path to pkg-config.
593
 
 
594
 
_PKG_TEXT
595
 
 
596
 
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
597
 
        ])
598
 
else
599
 
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
600
 
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
601
 
        AC_MSG_RESULT([yes])
602
 
        $3
603
 
fi[]dnl
604
 
])# PKG_CHECK_MODULES
605
 
 
606
 
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 
23
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
 
24
# Foundation, Inc.
607
25
#
608
26
# This file is free software; the Free Software Foundation
609
27
# gives unlimited permission to copy and/or distribute it,
610
28
# with or without modifications, as long as this notice is preserved.
611
29
 
 
30
# serial 1
 
31
 
612
32
# AM_AUTOMAKE_VERSION(VERSION)
613
33
# ----------------------------
614
34
# Automake X.Y traces this macro to ensure aclocal.m4 has been
618
38
[am__api_version='1.11'
619
39
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
620
40
dnl require some minimum version.  Point them to the right macro.
621
 
m4_if([$1], [1.11.1], [],
 
41
m4_if([$1], [1.11.6], [],
622
42
      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
623
43
])
624
44
 
634
54
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
635
55
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
636
56
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
637
 
[AM_AUTOMAKE_VERSION([1.11.1])dnl
 
57
[AM_AUTOMAKE_VERSION([1.11.6])dnl
638
58
m4_ifndef([AC_AUTOCONF_VERSION],
639
59
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
640
60
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
641
61
 
642
62
# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
643
63
 
644
 
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
64
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
645
65
#
646
66
# This file is free software; the Free Software Foundation
647
67
# gives unlimited permission to copy and/or distribute it,
648
68
# with or without modifications, as long as this notice is preserved.
649
69
 
 
70
# serial 1
 
71
 
650
72
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
651
73
# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
652
74
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
728
150
Usually this means the macro was only invoked conditionally.]])
729
151
fi])])
730
152
 
731
 
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
732
 
# Free Software Foundation, Inc.
 
153
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
 
154
# 2010, 2011 Free Software Foundation, Inc.
733
155
#
734
156
# This file is free software; the Free Software Foundation
735
157
# gives unlimited permission to copy and/or distribute it,
736
158
# with or without modifications, as long as this notice is preserved.
737
159
 
738
 
# serial 10
 
160
# serial 12
739
161
 
740
162
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
741
163
# written in clear, in which case automake, when reading aclocal.m4,
775
197
  # instance it was reported that on HP-UX the gcc test will end up
776
198
  # making a dummy file named `D' -- because `-MD' means `put the output
777
199
  # in D'.
 
200
  rm -rf conftest.dir
778
201
  mkdir conftest.dir
779
202
  # Copy depcomp to subdir because otherwise we won't find it if we're
780
203
  # using a relative directory.
839
262
        break
840
263
      fi
841
264
      ;;
842
 
    msvisualcpp | msvcmsys)
 
265
    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
843
266
      # This compiler won't grok `-c -o', but also, the minuso test has
844
267
      # not run yet.  These depmodes are late enough in the game, and
845
268
      # so weak that their functioning should not be impacted.
904
327
if test "x$enable_dependency_tracking" != xno; then
905
328
  am_depcomp="$ac_aux_dir/depcomp"
906
329
  AMDEPBACKSLASH='\'
 
330
  am__nodep='_no'
907
331
fi
908
332
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
909
333
AC_SUBST([AMDEPBACKSLASH])dnl
910
334
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 
335
AC_SUBST([am__nodep])dnl
 
336
_AM_SUBST_NOTMAKE([am__nodep])dnl
911
337
])
912
338
 
913
339
# Generate code to set up dependency tracking.              -*- Autoconf -*-
1129
555
done
1130
556
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1131
557
 
1132
 
# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
 
558
# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
 
559
# Inc.
1133
560
#
1134
561
# This file is free software; the Free Software Foundation
1135
562
# gives unlimited permission to copy and/or distribute it,
1136
563
# with or without modifications, as long as this notice is preserved.
1137
564
 
 
565
# serial 1
 
566
 
1138
567
# AM_PROG_INSTALL_SH
1139
568
# ------------------
1140
569
# Define $install_sh.
1174
603
# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
1175
604
# From Jim Meyering
1176
605
 
1177
 
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1178
 
# Free Software Foundation, Inc.
 
606
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
 
607
# 2011 Free Software Foundation, Inc.
1179
608
#
1180
609
# This file is free software; the Free Software Foundation
1181
610
# gives unlimited permission to copy and/or distribute it,
1195
624
       [disable], [m4_define([am_maintainer_other], [enable])],
1196
625
       [m4_define([am_maintainer_other], [enable])
1197
626
        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
1198
 
AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
 
627
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1199
628
  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
1200
629
  AC_ARG_ENABLE([maintainer-mode],
1201
630
[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
1341
770
fi
1342
771
])
1343
772
 
1344
 
# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
 
773
# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
 
774
# Inc.
1345
775
#
1346
776
# This file is free software; the Free Software Foundation
1347
777
# gives unlimited permission to copy and/or distribute it,
1348
778
# with or without modifications, as long as this notice is preserved.
1349
779
 
 
780
# serial 1
 
781
 
1350
782
# AM_PROG_MKDIR_P
1351
783
# ---------------
1352
784
# Check for `mkdir -p'.
1369
801
 
1370
802
# Helper functions for option handling.                     -*- Autoconf -*-
1371
803
 
1372
 
# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
 
804
# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
 
805
# Foundation, Inc.
1373
806
#
1374
807
# This file is free software; the Free Software Foundation
1375
808
# gives unlimited permission to copy and/or distribute it,
1376
809
# with or without modifications, as long as this notice is preserved.
1377
810
 
1378
 
# serial 4
 
811
# serial 5
1379
812
 
1380
813
# _AM_MANGLE_OPTION(NAME)
1381
814
# -----------------------
1383
816
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1384
817
 
1385
818
# _AM_SET_OPTION(NAME)
1386
 
# ------------------------------
 
819
# --------------------
1387
820
# Set option NAME.  Presently that only means defining a flag for this option.
1388
821
AC_DEFUN([_AM_SET_OPTION],
1389
822
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1390
823
 
1391
824
# _AM_SET_OPTIONS(OPTIONS)
1392
 
# ----------------------------------
 
825
# ------------------------
1393
826
# OPTIONS is a space-separated list of Automake options.
1394
827
AC_DEFUN([_AM_SET_OPTIONS],
1395
828
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1465
898
fi
1466
899
AC_MSG_RESULT(yes)])
1467
900
 
1468
 
# Copyright (C) 2009  Free Software Foundation, Inc.
 
901
# Copyright (C) 2009, 2011  Free Software Foundation, Inc.
1469
902
#
1470
903
# This file is free software; the Free Software Foundation
1471
904
# gives unlimited permission to copy and/or distribute it,
1472
905
# with or without modifications, as long as this notice is preserved.
1473
906
 
1474
 
# serial 1
 
907
# serial 2
1475
908
 
1476
909
# AM_SILENT_RULES([DEFAULT])
1477
910
# --------------------------
1486
919
no)  AM_DEFAULT_VERBOSITY=1;;
1487
920
*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1488
921
esac
 
922
dnl
 
923
dnl A few `make' implementations (e.g., NonStop OS and NextStep)
 
924
dnl do not support nested variable expansions.
 
925
dnl See automake bug#9928 and bug#10237.
 
926
am_make=${MAKE-make}
 
927
AC_CACHE_CHECK([whether $am_make supports nested variables],
 
928
   [am_cv_make_support_nested_variables],
 
929
   [if AS_ECHO([['TRUE=$(BAR$(V))
 
930
BAR0=false
 
931
BAR1=true
 
932
V=1
 
933
am__doit:
 
934
        @$(TRUE)
 
935
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
 
936
  am_cv_make_support_nested_variables=yes
 
937
else
 
938
  am_cv_make_support_nested_variables=no
 
939
fi])
 
940
if test $am_cv_make_support_nested_variables = yes; then
 
941
  dnl Using `$V' instead of `$(V)' breaks IRIX make.
 
942
  AM_V='$(V)'
 
943
  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
 
944
else
 
945
  AM_V=$AM_DEFAULT_VERBOSITY
 
946
  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
 
947
fi
 
948
AC_SUBST([AM_V])dnl
 
949
AM_SUBST_NOTMAKE([AM_V])dnl
 
950
AC_SUBST([AM_DEFAULT_V])dnl
 
951
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1489
952
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1490
953
AM_BACKSLASH='\'
1491
954
AC_SUBST([AM_BACKSLASH])dnl
1492
955
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1493
956
])
1494
957
 
1495
 
# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 
958
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
1496
959
#
1497
960
# This file is free software; the Free Software Foundation
1498
961
# gives unlimited permission to copy and/or distribute it,
1499
962
# with or without modifications, as long as this notice is preserved.
1500
963
 
 
964
# serial 1
 
965
 
1501
966
# AM_PROG_INSTALL_STRIP
1502
967
# ---------------------
1503
968
# One issue with vendor `install' (even GNU) is that you can't
1520
985
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1521
986
AC_SUBST([INSTALL_STRIP_PROGRAM])])
1522
987
 
1523
 
# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
 
988
# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
1524
989
#
1525
990
# This file is free software; the Free Software Foundation
1526
991
# gives unlimited permission to copy and/or distribute it,
1527
992
# with or without modifications, as long as this notice is preserved.
1528
993
 
1529
 
# serial 2
 
994
# serial 3
1530
995
 
1531
996
# _AM_SUBST_NOTMAKE(VARIABLE)
1532
997
# ---------------------------
1535
1000
AC_DEFUN([_AM_SUBST_NOTMAKE])
1536
1001
 
1537
1002
# AM_SUBST_NOTMAKE(VARIABLE)
1538
 
# ---------------------------
 
1003
# --------------------------
1539
1004
# Public sister of _AM_SUBST_NOTMAKE.
1540
1005
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1541
1006
 
1542
1007
# Check how to create a tarball.                            -*- Autoconf -*-
1543
1008
 
1544
 
# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
 
1009
# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
1545
1010
#
1546
1011
# This file is free software; the Free Software Foundation
1547
1012
# gives unlimited permission to copy and/or distribute it,
1563
1028
# a tarball read from stdin.
1564
1029
#     $(am__untar) < result.tar
1565
1030
AC_DEFUN([_AM_PROG_TAR],
1566
 
[# Always define AMTAR for backward compatibility.
1567
 
AM_MISSING_PROG([AMTAR], [tar])
 
1031
[# Always define AMTAR for backward compatibility.  Yes, it's still used
 
1032
# in the wild :-(  We should find a proper way to deprecate it ...
 
1033
AC_SUBST([AMTAR], ['$${TAR-tar}'])
1568
1034
m4_if([$1], [v7],
1569
 
     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
 
1035
     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1570
1036
     [m4_case([$1], [ustar],, [pax],,
1571
1037
              [m4_fatal([Unknown tar format])])
1572
1038
AC_MSG_CHECKING([how to create a $1 tar archive])
1635
1101
AC_SUBST([am__untar])
1636
1102
]) # _AM_PROG_TAR
1637
1103
 
 
1104
# nls.m4 serial 5 (gettext-0.18)
 
1105
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
 
1106
dnl Inc.
 
1107
dnl This file is free software; the Free Software Foundation
 
1108
dnl gives unlimited permission to copy and/or distribute it,
 
1109
dnl with or without modifications, as long as this notice is preserved.
 
1110
dnl
 
1111
dnl This file can can be used in projects which are not available under
 
1112
dnl the GNU General Public License or the GNU Library General Public
 
1113
dnl License but which still want to provide support for the GNU gettext
 
1114
dnl functionality.
 
1115
dnl Please note that the actual code of the GNU gettext library is covered
 
1116
dnl by the GNU Library General Public License, and the rest of the GNU
 
1117
dnl gettext package package is covered by the GNU General Public License.
 
1118
dnl They are *not* in the public domain.
 
1119
 
 
1120
dnl Authors:
 
1121
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
1122
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
1123
 
 
1124
AC_PREREQ([2.50])
 
1125
 
 
1126
AC_DEFUN([AM_NLS],
 
1127
[
 
1128
  AC_MSG_CHECKING([whether NLS is requested])
 
1129
  dnl Default is enabled NLS
 
1130
  AC_ARG_ENABLE([nls],
 
1131
    [  --disable-nls           do not use Native Language Support],
 
1132
    USE_NLS=$enableval, USE_NLS=yes)
 
1133
  AC_MSG_RESULT([$USE_NLS])
 
1134
  AC_SUBST([USE_NLS])
 
1135
])
 
1136
 
 
1137
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
1138
# serial 1 (pkg-config-0.24)
 
1139
 
1140
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
 
1141
#
 
1142
# This program is free software; you can redistribute it and/or modify
 
1143
# it under the terms of the GNU General Public License as published by
 
1144
# the Free Software Foundation; either version 2 of the License, or
 
1145
# (at your option) any later version.
 
1146
#
 
1147
# This program is distributed in the hope that it will be useful, but
 
1148
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
1149
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
1150
# General Public License for more details.
 
1151
#
 
1152
# You should have received a copy of the GNU General Public License
 
1153
# along with this program; if not, write to the Free Software
 
1154
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
1155
#
 
1156
# As a special exception to the GNU General Public License, if you
 
1157
# distribute this file as part of a program that contains a
 
1158
# configuration script generated by Autoconf, you may include it under
 
1159
# the same distribution terms that you use for the rest of that program.
 
1160
 
 
1161
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
 
1162
# ----------------------------------
 
1163
AC_DEFUN([PKG_PROG_PKG_CONFIG],
 
1164
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 
1165
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
 
1166
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
 
1167
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 
1168
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 
1169
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
 
1170
 
 
1171
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 
1172
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 
1173
fi
 
1174
if test -n "$PKG_CONFIG"; then
 
1175
        _pkg_min_version=m4_default([$1], [0.9.0])
 
1176
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
 
1177
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 
1178
                AC_MSG_RESULT([yes])
 
1179
        else
 
1180
                AC_MSG_RESULT([no])
 
1181
                PKG_CONFIG=""
 
1182
        fi
 
1183
fi[]dnl
 
1184
])# PKG_PROG_PKG_CONFIG
 
1185
 
 
1186
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
1187
#
 
1188
# Check to see whether a particular set of modules exists.  Similar
 
1189
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
 
1190
#
 
1191
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1192
# only at the first occurence in configure.ac, so if the first place
 
1193
# it's called might be skipped (such as if it is within an "if", you
 
1194
# have to call PKG_CHECK_EXISTS manually
 
1195
# --------------------------------------------------------------
 
1196
AC_DEFUN([PKG_CHECK_EXISTS],
 
1197
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
1198
if test -n "$PKG_CONFIG" && \
 
1199
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
 
1200
  m4_default([$2], [:])
 
1201
m4_ifvaln([$3], [else
 
1202
  $3])dnl
 
1203
fi])
 
1204
 
 
1205
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 
1206
# ---------------------------------------------
 
1207
m4_define([_PKG_CONFIG],
 
1208
[if test -n "$$1"; then
 
1209
    pkg_cv_[]$1="$$1"
 
1210
 elif test -n "$PKG_CONFIG"; then
 
1211
    PKG_CHECK_EXISTS([$3],
 
1212
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
 
1213
                      test "x$?" != "x0" && pkg_failed=yes ],
 
1214
                     [pkg_failed=yes])
 
1215
 else
 
1216
    pkg_failed=untried
 
1217
fi[]dnl
 
1218
])# _PKG_CONFIG
 
1219
 
 
1220
# _PKG_SHORT_ERRORS_SUPPORTED
 
1221
# -----------------------------
 
1222
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 
1223
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1224
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 
1225
        _pkg_short_errors_supported=yes
 
1226
else
 
1227
        _pkg_short_errors_supported=no
 
1228
fi[]dnl
 
1229
])# _PKG_SHORT_ERRORS_SUPPORTED
 
1230
 
 
1231
 
 
1232
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 
1233
# [ACTION-IF-NOT-FOUND])
 
1234
#
 
1235
#
 
1236
# Note that if there is a possibility the first call to
 
1237
# PKG_CHECK_MODULES might not happen, you should be sure to include an
 
1238
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 
1239
#
 
1240
#
 
1241
# --------------------------------------------------------------
 
1242
AC_DEFUN([PKG_CHECK_MODULES],
 
1243
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
1244
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 
1245
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
1246
 
 
1247
pkg_failed=no
 
1248
AC_MSG_CHECKING([for $1])
 
1249
 
 
1250
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 
1251
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
1252
 
 
1253
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 
1254
and $1[]_LIBS to avoid the need to call pkg-config.
 
1255
See the pkg-config man page for more details.])
 
1256
 
 
1257
if test $pkg_failed = yes; then
 
1258
        AC_MSG_RESULT([no])
 
1259
        _PKG_SHORT_ERRORS_SUPPORTED
 
1260
        if test $_pkg_short_errors_supported = yes; then
 
1261
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
 
1262
        else 
 
1263
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
 
1264
        fi
 
1265
        # Put the nasty error message in config.log where it belongs
 
1266
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
1267
 
 
1268
        m4_default([$4], [AC_MSG_ERROR(
 
1269
[Package requirements ($2) were not met:
 
1270
 
 
1271
$$1_PKG_ERRORS
 
1272
 
 
1273
Consider adjusting the PKG_CONFIG_PATH environment variable if you
 
1274
installed software in a non-standard prefix.
 
1275
 
 
1276
_PKG_TEXT])[]dnl
 
1277
        ])
 
1278
elif test $pkg_failed = untried; then
 
1279
        AC_MSG_RESULT([no])
 
1280
        m4_default([$4], [AC_MSG_FAILURE(
 
1281
[The pkg-config script could not be found or is too old.  Make sure it
 
1282
is in your PATH or set the PKG_CONFIG environment variable to the full
 
1283
path to pkg-config.
 
1284
 
 
1285
_PKG_TEXT
 
1286
 
 
1287
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
 
1288
        ])
 
1289
else
 
1290
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 
1291
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 
1292
        AC_MSG_RESULT([yes])
 
1293
        $3
 
1294
fi[]dnl
 
1295
])# PKG_CHECK_MODULES
 
1296
 
 
1297
 
 
1298
# PKG_INSTALLDIR(DIRECTORY)
 
1299
# -------------------------
 
1300
# Substitutes the variable pkgconfigdir as the location where a module
 
1301
# should install pkg-config .pc files. By default the directory is
 
1302
# $libdir/pkgconfig, but the default can be changed by passing
 
1303
# DIRECTORY. The user can override through the --with-pkgconfigdir
 
1304
# parameter.
 
1305
AC_DEFUN([PKG_INSTALLDIR],
 
1306
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
 
1307
m4_pushdef([pkg_description],
 
1308
    [pkg-config installation directory @<:@]pkg_default[@:>@])
 
1309
AC_ARG_WITH([pkgconfigdir],
 
1310
    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
 
1311
    [with_pkgconfigdir=]pkg_default)
 
1312
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
 
1313
m4_popdef([pkg_default])
 
1314
m4_popdef([pkg_description])
 
1315
]) dnl PKG_INSTALLDIR
 
1316
 
 
1317
 
 
1318
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
 
1319
# -------------------------
 
1320
# Substitutes the variable noarch_pkgconfigdir as the location where a
 
1321
# module should install arch-independent pkg-config .pc files. By
 
1322
# default the directory is $datadir/pkgconfig, but the default can be
 
1323
# changed by passing DIRECTORY. The user can override through the
 
1324
# --with-noarch-pkgconfigdir parameter.
 
1325
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
 
1326
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
 
1327
m4_pushdef([pkg_description],
 
1328
    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
 
1329
AC_ARG_WITH([noarch-pkgconfigdir],
 
1330
    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
 
1331
    [with_noarch_pkgconfigdir=]pkg_default)
 
1332
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
 
1333
m4_popdef([pkg_default])
 
1334
m4_popdef([pkg_description])
 
1335
]) dnl PKG_NOARCH_INSTALLDIR
 
1336
 
 
1337
# gnome-common.m4
 
1338
#
 
1339
# serial 3
 
1340
 
1341
 
 
1342
dnl GNOME_COMMON_INIT
 
1343
 
 
1344
AU_DEFUN([GNOME_COMMON_INIT],
 
1345
[
 
1346
  dnl this macro should come after AC_CONFIG_MACRO_DIR
 
1347
  AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
 
1348
 
 
1349
  dnl ensure that when the Automake generated makefile calls aclocal,
 
1350
  dnl it honours the $ACLOCAL_FLAGS environment variable
 
1351
  ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
 
1352
  if test -n "$ac_macro_dir"; then
 
1353
    ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS"
 
1354
  fi
 
1355
 
 
1356
  AC_SUBST([ACLOCAL_AMFLAGS])
 
1357
],
 
1358
[[$0: This macro is deprecated. You should set put "ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}"
 
1359
in your top-level Makefile.am, instead, where "m4" is the macro directory set
 
1360
with AC_CONFIG_MACRO_DIR() in your configure.ac]])
 
1361
 
 
1362
AC_DEFUN([GNOME_DEBUG_CHECK],
 
1363
[
 
1364
        AC_ARG_ENABLE([debug],
 
1365
                      AC_HELP_STRING([--enable-debug],
 
1366
                                     [turn on debugging]),,
 
1367
                      [enable_debug=no])
 
1368
 
 
1369
        if test x$enable_debug = xyes ; then
 
1370
            AC_DEFINE(GNOME_ENABLE_DEBUG, 1,
 
1371
                [Enable additional debugging at the expense of performance and size])
 
1372
        fi
 
1373
])
 
1374
 
 
1375
dnl GNOME_MAINTAINER_MODE_DEFINES ()
 
1376
dnl define DISABLE_DEPRECATED
 
1377
dnl
 
1378
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
 
1379
[
 
1380
        AC_REQUIRE([AM_MAINTAINER_MODE])
 
1381
 
 
1382
        DISABLE_DEPRECATED=""
 
1383
        if test $USE_MAINTAINER_MODE = yes; then
 
1384
                DOMAINS="GCONF BONOBO BONOBO_UI GNOME LIBGLADE GNOME_VFS WNCK LIBSOUP"
 
1385
                for DOMAIN in $DOMAINS; do
 
1386
                       DISABLE_DEPRECATED="$DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_DEPRECATED -D${DOMAIN}_DISABLE_SINGLE_INCLUDES"
 
1387
                done
 
1388
        fi
 
1389
 
 
1390
        AC_SUBST(DISABLE_DEPRECATED)
 
1391
])
 
1392
 
 
1393
dnl GNOME_COMPILE_WARNINGS
 
1394
dnl Turn on many useful compiler warnings
 
1395
dnl For now, only works on GCC
 
1396
AC_DEFUN([GNOME_COMPILE_WARNINGS],[
 
1397
    dnl ******************************
 
1398
    dnl More compiler warnings
 
1399
    dnl ******************************
 
1400
 
 
1401
    AC_ARG_ENABLE(compile-warnings, 
 
1402
                  AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
 
1403
                                 [Turn on compiler warnings]),,
 
1404
                  [enable_compile_warnings="m4_default([$1],[yes])"])
 
1405
 
 
1406
    warnCFLAGS=
 
1407
    if test "x$GCC" != xyes; then
 
1408
        enable_compile_warnings=no
 
1409
    fi
 
1410
 
 
1411
    warning_flags=
 
1412
    realsave_CFLAGS="$CFLAGS"
 
1413
 
 
1414
    case "$enable_compile_warnings" in
 
1415
    no)
 
1416
        warning_flags=
 
1417
        ;;
 
1418
    minimum)
 
1419
        warning_flags="-Wall"
 
1420
        ;;
 
1421
    yes)
 
1422
        warning_flags="-Wall -Wmissing-prototypes"
 
1423
        ;;
 
1424
    maximum|error)
 
1425
        warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
 
1426
        CFLAGS="$warning_flags $CFLAGS"
 
1427
        for option in -Wno-sign-compare; do
 
1428
                SAVE_CFLAGS="$CFLAGS"
 
1429
                CFLAGS="$CFLAGS $option"
 
1430
                AC_MSG_CHECKING([whether gcc understands $option])
 
1431
                AC_TRY_COMPILE([], [],
 
1432
                        has_option=yes,
 
1433
                        has_option=no,)
 
1434
                CFLAGS="$SAVE_CFLAGS"
 
1435
                AC_MSG_RESULT($has_option)
 
1436
                if test $has_option = yes; then
 
1437
                  warning_flags="$warning_flags $option"
 
1438
                fi
 
1439
                unset has_option
 
1440
                unset SAVE_CFLAGS
 
1441
        done
 
1442
        unset option
 
1443
        if test "$enable_compile_warnings" = "error" ; then
 
1444
            warning_flags="$warning_flags -Werror"
 
1445
        fi
 
1446
        ;;
 
1447
    *)
 
1448
        AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
 
1449
        ;;
 
1450
    esac
 
1451
    CFLAGS="$realsave_CFLAGS"
 
1452
    AC_MSG_CHECKING(what warning flags to pass to the C compiler)
 
1453
    AC_MSG_RESULT($warning_flags)
 
1454
 
 
1455
    AC_ARG_ENABLE(iso-c,
 
1456
                  AC_HELP_STRING([--enable-iso-c],
 
1457
                                 [Try to warn if code is not ISO C ]),,
 
1458
                  [enable_iso_c=no])
 
1459
 
 
1460
    AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
 
1461
    complCFLAGS=
 
1462
    if test "x$enable_iso_c" != "xno"; then
 
1463
        if test "x$GCC" = "xyes"; then
 
1464
        case " $CFLAGS " in
 
1465
            *[\ \       ]-ansi[\ \      ]*) ;;
 
1466
            *) complCFLAGS="$complCFLAGS -ansi" ;;
 
1467
        esac
 
1468
        case " $CFLAGS " in
 
1469
            *[\ \       ]-pedantic[\ \  ]*) ;;
 
1470
            *) complCFLAGS="$complCFLAGS -pedantic" ;;
 
1471
        esac
 
1472
        fi
 
1473
    fi
 
1474
    AC_MSG_RESULT($complCFLAGS)
 
1475
 
 
1476
    WARN_CFLAGS="$warning_flags $complCFLAGS"
 
1477
    AC_SUBST(WARN_CFLAGS)
 
1478
])
 
1479
 
 
1480
dnl For C++, do basically the same thing.
 
1481
 
 
1482
AC_DEFUN([GNOME_CXX_WARNINGS],[
 
1483
  AC_ARG_ENABLE(cxx-warnings,
 
1484
                AC_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
 
1485
                               [Turn on compiler warnings.]),,
 
1486
                [enable_cxx_warnings="m4_default([$1],[minimum])"])
 
1487
 
 
1488
  AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
 
1489
  warnCXXFLAGS=
 
1490
  if test "x$GXX" != xyes; then
 
1491
    enable_cxx_warnings=no
 
1492
  fi
 
1493
  if test "x$enable_cxx_warnings" != "xno"; then
 
1494
    if test "x$GXX" = "xyes"; then
 
1495
      case " $CXXFLAGS " in
 
1496
      *[\ \     ]-Wall[\ \      ]*) ;;
 
1497
      *) warnCXXFLAGS="-Wall -Wno-unused" ;;
 
1498
      esac
 
1499
 
 
1500
      ## -W is not all that useful.  And it cannot be controlled
 
1501
      ## with individual -Wno-xxx flags, unlike -Wall
 
1502
      if test "x$enable_cxx_warnings" = "xyes"; then
 
1503
        warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
 
1504
      fi
 
1505
    fi
 
1506
  fi
 
1507
  AC_MSG_RESULT($warnCXXFLAGS)
 
1508
 
 
1509
   AC_ARG_ENABLE(iso-cxx,
 
1510
                 AC_HELP_STRING([--enable-iso-cxx],
 
1511
                                [Try to warn if code is not ISO C++ ]),,
 
1512
                 [enable_iso_cxx=no])
 
1513
 
 
1514
   AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
 
1515
   complCXXFLAGS=
 
1516
   if test "x$enable_iso_cxx" != "xno"; then
 
1517
     if test "x$GXX" = "xyes"; then
 
1518
      case " $CXXFLAGS " in
 
1519
      *[\ \     ]-ansi[\ \      ]*) ;;
 
1520
      *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
 
1521
      esac
 
1522
 
 
1523
      case " $CXXFLAGS " in
 
1524
      *[\ \     ]-pedantic[\ \  ]*) ;;
 
1525
      *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
 
1526
      esac
 
1527
     fi
 
1528
   fi
 
1529
  AC_MSG_RESULT($complCXXFLAGS)
 
1530
 
 
1531
  WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
 
1532
  AC_SUBST(WARN_CXXFLAGS)
 
1533
])
 
1534
 
 
1535
dnl GLIB_GSETTINGS
 
1536
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
 
1537
dnl the schema should be compiled
 
1538
dnl
 
1539
 
 
1540
AC_DEFUN([GLIB_GSETTINGS],
 
1541
[
 
1542
  m4_pattern_allow([AM_V_GEN])
 
1543
  AC_ARG_ENABLE(schemas-compile,
 
1544
                AS_HELP_STRING([--disable-schemas-compile],
 
1545
                               [Disable regeneration of gschemas.compiled on install]),
 
1546
                [case ${enableval} in
 
1547
                  yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE=""  ;;
 
1548
                  no)  GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
 
1549
                  *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
 
1550
                 esac])
 
1551
  AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
 
1552
  PKG_PROG_PKG_CONFIG([0.16])
 
1553
  AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
 
1554
  if test x$cross_compiling != xyes; then
 
1555
    GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
 
1556
  else
 
1557
    AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
 
1558
  fi
 
1559
  AC_SUBST(GLIB_COMPILE_SCHEMAS)
 
1560
  if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
 
1561
    ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
 
1562
  else
 
1563
    ifelse([$1],,[:],[$1])
 
1564
  fi
 
1565
 
 
1566
  GSETTINGS_RULES='
 
1567
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
 
1568
 
 
1569
mostlyclean-am: clean-gsettings-schemas
 
1570
 
 
1571
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
 
1572
 
 
1573
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
 
1574
        $(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 [$]@
 
1575
 
 
1576
all-am: $(gsettings_SCHEMAS:.xml=.valid)
 
1577
uninstall-am: uninstall-gsettings-schemas
 
1578
install-data-am: install-gsettings-schemas
 
1579
 
 
1580
.SECONDARY: $(gsettings_SCHEMAS)
 
1581
 
 
1582
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
 
1583
        @$(NORMAL_INSTALL)
 
1584
        if test -n "$^"; then \
 
1585
                test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
 
1586
                $(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
 
1587
                test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
 
1588
        fi
 
1589
 
 
1590
uninstall-gsettings-schemas:
 
1591
        @$(NORMAL_UNINSTALL)
 
1592
        @list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
 
1593
        files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
 
1594
        test -n "$$files" || exit 0; \
 
1595
        echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
 
1596
        cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
 
1597
        test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
 
1598
 
 
1599
clean-gsettings-schemas:
 
1600
        rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
 
1601
 
 
1602
ifdef gsettings_ENUM_NAMESPACE
 
1603
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
 
1604
        $(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 [$]@
 
1605
endif
 
1606
'
 
1607
  _GSETTINGS_SUBST(GSETTINGS_RULES)
 
1608
])
 
1609
 
 
1610
dnl _GSETTINGS_SUBST(VARIABLE)
 
1611
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
 
1612
AC_DEFUN([_GSETTINGS_SUBST],
 
1613
[
 
1614
AC_SUBST([$1])
 
1615
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
 
1616
]
 
1617
)
 
1618
 
 
1619
dnl Autoconf macros for libgcrypt
 
1620
dnl       Copyright (C) 2002, 2004 Free Software Foundation, Inc.
 
1621
dnl
 
1622
dnl This file is free software; as a special exception the author gives
 
1623
dnl unlimited permission to copy and/or distribute it, with or without
 
1624
dnl modifications, as long as this notice is preserved.
 
1625
dnl
 
1626
dnl This file is distributed in the hope that it will be useful, but
 
1627
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 
1628
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
1629
 
 
1630
 
 
1631
dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
 
1632
dnl                   [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
 
1633
dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
 
1634
dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed
 
1635
dnl with the API version to also check the API compatibility. Example:
 
1636
dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed
 
1637
dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1.  Using
 
1638
dnl this features allows to prevent build against newer versions of libgcrypt
 
1639
dnl with a changed API.
 
1640
dnl
 
1641
AC_DEFUN([AM_PATH_LIBGCRYPT],
 
1642
[ AC_ARG_WITH(libgcrypt-prefix,
 
1643
            AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
 
1644
                           [prefix where LIBGCRYPT is installed (optional)]),
 
1645
     libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
 
1646
  if test x$libgcrypt_config_prefix != x ; then
 
1647
     if test x${LIBGCRYPT_CONFIG+set} != xset ; then
 
1648
        LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
 
1649
     fi
 
1650
  fi
 
1651
 
 
1652
  AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no)
 
1653
  tmp=ifelse([$1], ,1:1.2.0,$1)
 
1654
  if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
 
1655
     req_libgcrypt_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
 
1656
     min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
 
1657
  else
 
1658
     req_libgcrypt_api=0
 
1659
     min_libgcrypt_version="$tmp"
 
1660
  fi
 
1661
 
 
1662
  AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
 
1663
  ok=no
 
1664
  if test "$LIBGCRYPT_CONFIG" != "no" ; then
 
1665
    req_major=`echo $min_libgcrypt_version | \
 
1666
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
 
1667
    req_minor=`echo $min_libgcrypt_version | \
 
1668
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
 
1669
    req_micro=`echo $min_libgcrypt_version | \
 
1670
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
 
1671
    libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
 
1672
    major=`echo $libgcrypt_config_version | \
 
1673
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
 
1674
    minor=`echo $libgcrypt_config_version | \
 
1675
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
 
1676
    micro=`echo $libgcrypt_config_version | \
 
1677
               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
 
1678
    if test "$major" -gt "$req_major"; then
 
1679
        ok=yes
 
1680
    else
 
1681
        if test "$major" -eq "$req_major"; then
 
1682
            if test "$minor" -gt "$req_minor"; then
 
1683
               ok=yes
 
1684
            else
 
1685
               if test "$minor" -eq "$req_minor"; then
 
1686
                   if test "$micro" -ge "$req_micro"; then
 
1687
                     ok=yes
 
1688
                   fi
 
1689
               fi
 
1690
            fi
 
1691
        fi
 
1692
    fi
 
1693
  fi
 
1694
  if test $ok = yes; then
 
1695
    AC_MSG_RESULT([yes ($libgcrypt_config_version)])
 
1696
  else
 
1697
    AC_MSG_RESULT(no)
 
1698
  fi
 
1699
  if test $ok = yes; then
 
1700
     # If we have a recent libgcrypt, we should also check that the
 
1701
     # API is compatible
 
1702
     if test "$req_libgcrypt_api" -gt 0 ; then
 
1703
        tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
 
1704
        if test "$tmp" -gt 0 ; then
 
1705
           AC_MSG_CHECKING([LIBGCRYPT API version])
 
1706
           if test "$req_libgcrypt_api" -eq "$tmp" ; then
 
1707
             AC_MSG_RESULT([okay])
 
1708
           else
 
1709
             ok=no
 
1710
             AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
 
1711
           fi
 
1712
        fi
 
1713
     fi
 
1714
  fi
 
1715
  if test $ok = yes; then
 
1716
    LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
 
1717
    LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
 
1718
    ifelse([$2], , :, [$2])
 
1719
    if test x"$host" != x ; then
 
1720
      libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
 
1721
      if test x"$libgcrypt_config_host" != xnone ; then
 
1722
        if test x"$libgcrypt_config_host" != x"$host" ; then
 
1723
  AC_MSG_WARN([[
 
1724
***
 
1725
*** The config script $LIBGCRYPT_CONFIG was
 
1726
*** built for $libgcrypt_config_host and thus may not match the
 
1727
*** used host $host.
 
1728
*** You may want to use the configure option --with-libgcrypt-prefix
 
1729
*** to specify a matching config script.
 
1730
***]])
 
1731
        fi
 
1732
      fi
 
1733
    fi
 
1734
  else
 
1735
    LIBGCRYPT_CFLAGS=""
 
1736
    LIBGCRYPT_LIBS=""
 
1737
    ifelse([$3], , :, [$3])
 
1738
  fi
 
1739
  AC_SUBST(LIBGCRYPT_CFLAGS)
 
1740
  AC_SUBST(LIBGCRYPT_LIBS)
 
1741
])
 
1742
 
1638
1743
m4_include([m4/intltool.m4])
1639
1744
m4_include([m4/libtool.m4])
1640
1745
m4_include([m4/ltoptions.m4])