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'.])])
29
AU_DEFUN([GNOME_COMMON_INIT],
31
dnl this macro should come after AC_CONFIG_MACRO_DIR
32
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
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"
41
AC_SUBST([ACLOCAL_AMFLAGS])
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]])
47
AC_DEFUN([GNOME_DEBUG_CHECK],
49
AC_ARG_ENABLE([debug],
50
AC_HELP_STRING([--enable-debug],
51
[turn on debugging]),,
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])
60
dnl GNOME_MAINTAINER_MODE_DEFINES ()
61
dnl define DISABLE_DEPRECATED
63
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
65
AC_REQUIRE([AM_MAINTAINER_MODE])
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"
75
AC_SUBST(DISABLE_DEPRECATED)
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 ******************************
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])"])
92
if test "x$GCC" != xyes; then
93
enable_compile_warnings=no
97
realsave_CFLAGS="$CFLAGS"
99
case "$enable_compile_warnings" in
104
warning_flags="-Wall"
107
warning_flags="-Wall -Wmissing-prototypes"
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([], [],
119
CFLAGS="$SAVE_CFLAGS"
120
AC_MSG_RESULT($has_option)
121
if test $has_option = yes; then
122
warning_flags="$warning_flags $option"
128
if test "$enable_compile_warnings" = "error" ; then
129
warning_flags="$warning_flags -Werror"
133
AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
136
CFLAGS="$realsave_CFLAGS"
137
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
138
AC_MSG_RESULT($warning_flags)
141
AC_HELP_STRING([--enable-iso-c],
142
[Try to warn if code is not ISO C ]),,
145
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
147
if test "x$enable_iso_c" != "xno"; then
148
if test "x$GCC" = "xyes"; then
150
*[\ \ ]-ansi[\ \ ]*) ;;
151
*) complCFLAGS="$complCFLAGS -ansi" ;;
154
*[\ \ ]-pedantic[\ \ ]*) ;;
155
*) complCFLAGS="$complCFLAGS -pedantic" ;;
159
AC_MSG_RESULT($complCFLAGS)
161
WARN_CFLAGS="$warning_flags $complCFLAGS"
162
AC_SUBST(WARN_CFLAGS)
165
dnl For C++, do basically the same thing.
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])"])
173
AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
175
if test "x$GXX" != xyes; then
176
enable_cxx_warnings=no
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" ;;
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"
192
AC_MSG_RESULT($warnCXXFLAGS)
194
AC_ARG_ENABLE(iso-cxx,
195
AC_HELP_STRING([--enable-iso-cxx],
196
[Try to warn if code is not ISO C++ ]),,
199
AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
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" ;;
208
case " $CXXFLAGS " in
209
*[\ \ ]-pedantic[\ \ ]*) ;;
210
*) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
214
AC_MSG_RESULT($complCXXFLAGS)
216
WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
217
AC_SUBST(WARN_CXXFLAGS)
221
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
222
dnl the schema should be compiled
225
AC_DEFUN([GLIB_GSETTINGS],
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]) ;;
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`
242
AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
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])
248
ifelse([$1],,[:],[$1])
252
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
254
mostlyclean-am: clean-gsettings-schemas
256
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
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 [$]@
261
all-am: $(gsettings_SCHEMAS:.xml=.valid)
262
uninstall-am: uninstall-gsettings-schemas
263
install-data-am: install-gsettings-schemas
265
.SECONDARY: $(gsettings_SCHEMAS)
267
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
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); \
275
uninstall-gsettings-schemas:
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)
284
clean-gsettings-schemas:
285
rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
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 [$]@
292
_GSETTINGS_SUBST(GSETTINGS_RULES)
295
dnl _GSETTINGS_SUBST(VARIABLE)
296
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
297
AC_DEFUN([_GSETTINGS_SUBST],
300
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
304
dnl Autoconf macros for libgcrypt
305
dnl Copyright (C) 2002, 2004 Free Software Foundation, Inc.
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.
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.
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.
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
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/'`
344
min_libgcrypt_version="$tmp"
347
AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
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
366
if test "$major" -eq "$req_major"; then
367
if test "$minor" -gt "$req_minor"; then
370
if test "$minor" -eq "$req_minor"; then
371
if test "$micro" -ge "$req_micro"; then
379
if test $ok = yes; then
380
AC_MSG_RESULT([yes ($libgcrypt_config_version)])
384
if test $ok = yes; then
385
# If we have a recent libgcrypt, we should also check that the
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])
395
AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
400
if test $ok = yes; then
401
LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
402
LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
403
ifelse([$2], , :, [$2])
407
ifelse([$3], , :, [$3])
409
AC_SUBST(LIBGCRYPT_CFLAGS)
410
AC_SUBST(LIBGCRYPT_LIBS)
413
# nls.m4 serial 5 (gettext-0.18)
414
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
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.
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
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.
430
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
431
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
437
AC_MSG_CHECKING([whether NLS is requested])
438
dnl Default is enabled NLS
440
[ --disable-nls do not use Native Language Support],
441
USE_NLS=$enableval, USE_NLS=yes)
442
AC_MSG_RESULT([$USE_NLS])
446
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
447
# serial 1 (pkg-config-0.24)
449
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
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.
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.
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.
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.
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])
480
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
481
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
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
493
])# PKG_PROG_PKG_CONFIG
495
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
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.
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
514
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
515
# ---------------------------------------------
516
m4_define([_PKG_CONFIG],
517
[if test -n "$$1"; then
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 ],
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
536
_pkg_short_errors_supported=no
538
])# _PKG_SHORT_ERRORS_SUPPORTED
541
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
542
# [ACTION-IF-NOT-FOUND])
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
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
557
AC_MSG_CHECKING([for $1])
559
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
560
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
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.])
566
if test $pkg_failed = yes; then
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`
572
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
574
# Put the nasty error message in config.log where it belongs
575
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
577
m4_default([$4], [AC_MSG_ERROR(
578
[Package requirements ($2) were not met:
582
Consider adjusting the PKG_CONFIG_PATH environment variable if you
583
installed software in a non-standard prefix.
587
elif test $pkg_failed = untried; then
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
596
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
599
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
600
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
604
])# PKG_CHECK_MODULES
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
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.
612
32
# AM_AUTOMAKE_VERSION(VERSION)
613
33
# ----------------------------
614
34
# Automake X.Y traces this macro to ensure aclocal.m4 has been
1635
1101
AC_SUBST([am__untar])
1636
1102
]) # _AM_PROG_TAR
1104
# nls.m4 serial 5 (gettext-0.18)
1105
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
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.
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
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.
1121
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1122
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
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])
1137
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1138
# serial 1 (pkg-config-0.24)
1140
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
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.
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.
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.
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.
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])
1171
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1172
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
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])
1184
])# PKG_PROG_PKG_CONFIG
1186
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
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.
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
1205
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1206
# ---------------------------------------------
1207
m4_define([_PKG_CONFIG],
1208
[if test -n "$$1"; then
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 ],
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
1227
_pkg_short_errors_supported=no
1229
])# _PKG_SHORT_ERRORS_SUPPORTED
1232
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1233
# [ACTION-IF-NOT-FOUND])
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
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
1248
AC_MSG_CHECKING([for $1])
1250
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1251
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
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.])
1257
if test $pkg_failed = yes; then
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`
1263
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1265
# Put the nasty error message in config.log where it belongs
1266
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1268
m4_default([$4], [AC_MSG_ERROR(
1269
[Package requirements ($2) were not met:
1273
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1274
installed software in a non-standard prefix.
1278
elif test $pkg_failed = untried; then
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
1287
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1290
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1291
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1292
AC_MSG_RESULT([yes])
1295
])# PKG_CHECK_MODULES
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
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
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
1342
dnl GNOME_COMMON_INIT
1344
AU_DEFUN([GNOME_COMMON_INIT],
1346
dnl this macro should come after AC_CONFIG_MACRO_DIR
1347
AC_BEFORE([AC_CONFIG_MACRO_DIR], [$0])
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"
1356
AC_SUBST([ACLOCAL_AMFLAGS])
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]])
1362
AC_DEFUN([GNOME_DEBUG_CHECK],
1364
AC_ARG_ENABLE([debug],
1365
AC_HELP_STRING([--enable-debug],
1366
[turn on debugging]),,
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])
1375
dnl GNOME_MAINTAINER_MODE_DEFINES ()
1376
dnl define DISABLE_DEPRECATED
1378
AC_DEFUN([GNOME_MAINTAINER_MODE_DEFINES],
1380
AC_REQUIRE([AM_MAINTAINER_MODE])
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"
1390
AC_SUBST(DISABLE_DEPRECATED)
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 ******************************
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])"])
1407
if test "x$GCC" != xyes; then
1408
enable_compile_warnings=no
1412
realsave_CFLAGS="$CFLAGS"
1414
case "$enable_compile_warnings" in
1419
warning_flags="-Wall"
1422
warning_flags="-Wall -Wmissing-prototypes"
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([], [],
1434
CFLAGS="$SAVE_CFLAGS"
1435
AC_MSG_RESULT($has_option)
1436
if test $has_option = yes; then
1437
warning_flags="$warning_flags $option"
1443
if test "$enable_compile_warnings" = "error" ; then
1444
warning_flags="$warning_flags -Werror"
1448
AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
1451
CFLAGS="$realsave_CFLAGS"
1452
AC_MSG_CHECKING(what warning flags to pass to the C compiler)
1453
AC_MSG_RESULT($warning_flags)
1455
AC_ARG_ENABLE(iso-c,
1456
AC_HELP_STRING([--enable-iso-c],
1457
[Try to warn if code is not ISO C ]),,
1460
AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
1462
if test "x$enable_iso_c" != "xno"; then
1463
if test "x$GCC" = "xyes"; then
1465
*[\ \ ]-ansi[\ \ ]*) ;;
1466
*) complCFLAGS="$complCFLAGS -ansi" ;;
1469
*[\ \ ]-pedantic[\ \ ]*) ;;
1470
*) complCFLAGS="$complCFLAGS -pedantic" ;;
1474
AC_MSG_RESULT($complCFLAGS)
1476
WARN_CFLAGS="$warning_flags $complCFLAGS"
1477
AC_SUBST(WARN_CFLAGS)
1480
dnl For C++, do basically the same thing.
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])"])
1488
AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
1490
if test "x$GXX" != xyes; then
1491
enable_cxx_warnings=no
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" ;;
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"
1507
AC_MSG_RESULT($warnCXXFLAGS)
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])
1514
AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
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" ;;
1523
case " $CXXFLAGS " in
1524
*[\ \ ]-pedantic[\ \ ]*) ;;
1525
*) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
1529
AC_MSG_RESULT($complCXXFLAGS)
1531
WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
1532
AC_SUBST(WARN_CXXFLAGS)
1536
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
1537
dnl the schema should be compiled
1540
AC_DEFUN([GLIB_GSETTINGS],
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]) ;;
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`
1557
AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
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])
1563
ifelse([$1],,[:],[$1])
1567
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
1569
mostlyclean-am: clean-gsettings-schemas
1571
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
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 [$]@
1576
all-am: $(gsettings_SCHEMAS:.xml=.valid)
1577
uninstall-am: uninstall-gsettings-schemas
1578
install-data-am: install-gsettings-schemas
1580
.SECONDARY: $(gsettings_SCHEMAS)
1582
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
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); \
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)
1599
clean-gsettings-schemas:
1600
rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
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 [$]@
1607
_GSETTINGS_SUBST(GSETTINGS_RULES)
1610
dnl _GSETTINGS_SUBST(VARIABLE)
1611
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
1612
AC_DEFUN([_GSETTINGS_SUBST],
1615
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
1619
dnl Autoconf macros for libgcrypt
1620
dnl Copyright (C) 2002, 2004 Free Software Foundation, Inc.
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.
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.
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.
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
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/'`
1659
min_libgcrypt_version="$tmp"
1662
AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
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
1681
if test "$major" -eq "$req_major"; then
1682
if test "$minor" -gt "$req_minor"; then
1685
if test "$minor" -eq "$req_minor"; then
1686
if test "$micro" -ge "$req_micro"; then
1694
if test $ok = yes; then
1695
AC_MSG_RESULT([yes ($libgcrypt_config_version)])
1699
if test $ok = yes; then
1700
# If we have a recent libgcrypt, we should also check that the
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])
1710
AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
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
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.
1737
ifelse([$3], , :, [$3])
1739
AC_SUBST(LIBGCRYPT_CFLAGS)
1740
AC_SUBST(LIBGCRYPT_LIBS)
1638
1743
m4_include([m4/intltool.m4])
1639
1744
m4_include([m4/libtool.m4])
1640
1745
m4_include([m4/ltoptions.m4])