20
20
If you have problems, you may need to regenerate the build system entirely.
21
21
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
23
# nls.m4 serial 5 (gettext-0.18)
24
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation,
26
dnl This file is free software; the Free Software Foundation
27
dnl gives unlimited permission to copy and/or distribute it,
28
dnl with or without modifications, as long as this notice is preserved.
30
dnl This file can can be used in projects which are not available under
31
dnl the GNU General Public License or the GNU Library General Public
32
dnl License but which still want to provide support for the GNU gettext
34
dnl Please note that the actual code of the GNU gettext library is covered
35
dnl by the GNU Library General Public License, and the rest of the GNU
36
dnl gettext package package is covered by the GNU General Public License.
37
dnl They are *not* in the public domain.
40
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
41
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
47
AC_MSG_CHECKING([whether NLS is requested])
48
dnl Default is enabled NLS
50
[ --disable-nls do not use Native Language Support],
51
USE_NLS=$enableval, USE_NLS=yes)
52
AC_MSG_RESULT([$USE_NLS])
56
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
57
# serial 1 (pkg-config-0.24)
59
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
61
# This program is free software; you can redistribute it and/or modify
62
# it under the terms of the GNU General Public License as published by
63
# the Free Software Foundation; either version 2 of the License, or
64
# (at your option) any later version.
66
# This program is distributed in the hope that it will be useful, but
67
# WITHOUT ANY WARRANTY; without even the implied warranty of
68
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
69
# General Public License for more details.
71
# You should have received a copy of the GNU General Public License
72
# along with this program; if not, write to the Free Software
73
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
75
# As a special exception to the GNU General Public License, if you
76
# distribute this file as part of a program that contains a
77
# configuration script generated by Autoconf, you may include it under
78
# the same distribution terms that you use for the rest of that program.
80
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
81
# ----------------------------------
82
AC_DEFUN([PKG_PROG_PKG_CONFIG],
83
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
84
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
85
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
86
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
87
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
88
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
90
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
91
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
93
if test -n "$PKG_CONFIG"; then
94
_pkg_min_version=m4_default([$1], [0.9.0])
95
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
96
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
103
])# PKG_PROG_PKG_CONFIG
105
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
107
# Check to see whether a particular set of modules exists. Similar
108
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
110
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
111
# only at the first occurence in configure.ac, so if the first place
112
# it's called might be skipped (such as if it is within an "if", you
113
# have to call PKG_CHECK_EXISTS manually
114
# --------------------------------------------------------------
115
AC_DEFUN([PKG_CHECK_EXISTS],
116
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
117
if test -n "$PKG_CONFIG" && \
118
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
119
m4_default([$2], [:])
120
m4_ifvaln([$3], [else
124
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
125
# ---------------------------------------------
126
m4_define([_PKG_CONFIG],
127
[if test -n "$$1"; then
129
elif test -n "$PKG_CONFIG"; then
130
PKG_CHECK_EXISTS([$3],
131
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
132
test "x$?" != "x0" && pkg_failed=yes ],
139
# _PKG_SHORT_ERRORS_SUPPORTED
140
# -----------------------------
141
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
142
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
143
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
144
_pkg_short_errors_supported=yes
146
_pkg_short_errors_supported=no
148
])# _PKG_SHORT_ERRORS_SUPPORTED
151
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
152
# [ACTION-IF-NOT-FOUND])
155
# Note that if there is a possibility the first call to
156
# PKG_CHECK_MODULES might not happen, you should be sure to include an
157
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
160
# --------------------------------------------------------------
161
AC_DEFUN([PKG_CHECK_MODULES],
162
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
163
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
164
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
167
AC_MSG_CHECKING([for $1])
169
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
170
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
172
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
173
and $1[]_LIBS to avoid the need to call pkg-config.
174
See the pkg-config man page for more details.])
176
if test $pkg_failed = yes; then
178
_PKG_SHORT_ERRORS_SUPPORTED
179
if test $_pkg_short_errors_supported = yes; then
180
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
182
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
184
# Put the nasty error message in config.log where it belongs
185
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
187
m4_default([$4], [AC_MSG_ERROR(
188
[Package requirements ($2) were not met:
192
Consider adjusting the PKG_CONFIG_PATH environment variable if you
193
installed software in a non-standard prefix.
197
elif test $pkg_failed = untried; then
199
m4_default([$4], [AC_MSG_FAILURE(
200
[The pkg-config script could not be found or is too old. Make sure it
201
is in your PATH or set the PKG_CONFIG environment variable to the full
206
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
209
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
210
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
214
])# PKG_CHECK_MODULES
217
# PKG_INSTALLDIR(DIRECTORY)
218
# -------------------------
219
# Substitutes the variable pkgconfigdir as the location where a module
220
# should install pkg-config .pc files. By default the directory is
221
# $libdir/pkgconfig, but the default can be changed by passing
222
# DIRECTORY. The user can override through the --with-pkgconfigdir
224
AC_DEFUN([PKG_INSTALLDIR],
225
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
226
m4_pushdef([pkg_description],
227
[pkg-config installation directory @<:@]pkg_default[@:>@])
228
AC_ARG_WITH([pkgconfigdir],
229
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
230
[with_pkgconfigdir=]pkg_default)
231
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
232
m4_popdef([pkg_default])
233
m4_popdef([pkg_description])
234
]) dnl PKG_INSTALLDIR
237
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
238
# -------------------------
239
# Substitutes the variable noarch_pkgconfigdir as the location where a
240
# module should install arch-independent pkg-config .pc files. By
241
# default the directory is $datadir/pkgconfig, but the default can be
242
# changed by passing DIRECTORY. The user can override through the
243
# --with-noarch-pkgconfigdir parameter.
244
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
245
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
246
m4_pushdef([pkg_description],
247
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
248
AC_ARG_WITH([noarch-pkgconfigdir],
249
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
250
[with_noarch_pkgconfigdir=]pkg_default)
251
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
252
m4_popdef([pkg_default])
253
m4_popdef([pkg_description])
254
]) dnl PKG_NOARCH_INSTALLDIR
257
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
258
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
259
# -------------------------------------------
260
# Retrieves the value of the pkg-config variable for the given module.
261
AC_DEFUN([PKG_CHECK_VAR],
262
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
263
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
265
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
266
AS_VAR_COPY([$1], [pkg_cv_][$1])
268
AS_VAR_IF([$1], [""], [$5], [$4])dnl
272
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
273
dnl the schema should be compiled
276
AC_DEFUN([GLIB_GSETTINGS],
278
m4_pattern_allow([AM_V_GEN])
279
AC_ARG_ENABLE(schemas-compile,
280
AS_HELP_STRING([--disable-schemas-compile],
281
[Disable regeneration of gschemas.compiled on install]),
282
[case ${enableval} in
283
yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;;
284
no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
285
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
287
AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
288
PKG_PROG_PKG_CONFIG([0.16])
289
AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
290
if test x$cross_compiling != xyes; then
291
GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
293
AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
295
AC_SUBST(GLIB_COMPILE_SCHEMAS)
296
if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
297
ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
299
ifelse([$1],,[:],[$1])
303
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
305
mostlyclean-am: clean-gsettings-schemas
307
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
309
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
310
$(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 [$]@
312
all-am: $(gsettings_SCHEMAS:.xml=.valid)
313
uninstall-am: uninstall-gsettings-schemas
314
install-data-am: install-gsettings-schemas
316
.SECONDARY: $(gsettings_SCHEMAS)
318
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
320
if test -n "$^"; then \
321
test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
322
$(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
323
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
326
uninstall-gsettings-schemas:
328
@list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
329
files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
330
test -n "$$files" || exit 0; \
331
echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
332
cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
333
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
335
clean-gsettings-schemas:
336
rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
338
ifdef gsettings_ENUM_NAMESPACE
339
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
340
$(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 [$]@
343
_GSETTINGS_SUBST(GSETTINGS_RULES)
346
dnl _GSETTINGS_SUBST(VARIABLE)
347
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
348
AC_DEFUN([_GSETTINGS_SUBST],
351
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
355
dnl -*- mode: autoconf -*-
356
dnl Copyright 2009 Johan Dahlin
358
dnl This file is free software; the author(s) gives unlimited
359
dnl permission to copy and/or distribute it, with or without
360
dnl modifications, as long as this notice is preserved.
365
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
367
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
368
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
369
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
371
dnl enable/disable introspection
372
m4_if([$2], [require],
374
enable_introspection=yes
376
AC_ARG_ENABLE(introspection,
377
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
378
[Enable introspection for this build]),,
379
[enable_introspection=auto])
382
AC_MSG_CHECKING([for gobject-introspection])
384
dnl presence/version checking
385
AS_CASE([$enable_introspection],
387
found_introspection="no (disabled, use --enable-introspection to enable)"
390
PKG_CHECK_EXISTS([gobject-introspection-1.0],,
391
AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
392
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
393
found_introspection=yes,
394
AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
397
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
398
dnl Canonicalize enable_introspection
399
enable_introspection=$found_introspection
402
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
405
AC_MSG_RESULT([$found_introspection])
407
INTROSPECTION_SCANNER=
408
INTROSPECTION_COMPILER=
409
INTROSPECTION_GENERATE=
410
INTROSPECTION_GIRDIR=
411
INTROSPECTION_TYPELIBDIR=
412
if test "x$found_introspection" = "xyes"; then
413
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
414
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
415
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
416
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
417
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
418
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
419
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
420
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
422
AC_SUBST(INTROSPECTION_SCANNER)
423
AC_SUBST(INTROSPECTION_COMPILER)
424
AC_SUBST(INTROSPECTION_GENERATE)
425
AC_SUBST(INTROSPECTION_GIRDIR)
426
AC_SUBST(INTROSPECTION_TYPELIBDIR)
427
AC_SUBST(INTROSPECTION_CFLAGS)
428
AC_SUBST(INTROSPECTION_LIBS)
429
AC_SUBST(INTROSPECTION_MAKEFILE)
431
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
436
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
438
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
440
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
444
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
447
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
449
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
452
23
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
454
25
# This file is free software; the Free Software Foundation
1515
1086
AC_SUBST([am__untar])
1516
1087
]) # _AM_PROG_TAR
1089
# nls.m4 serial 5 (gettext-0.18)
1090
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation,
1092
dnl This file is free software; the Free Software Foundation
1093
dnl gives unlimited permission to copy and/or distribute it,
1094
dnl with or without modifications, as long as this notice is preserved.
1096
dnl This file can can be used in projects which are not available under
1097
dnl the GNU General Public License or the GNU Library General Public
1098
dnl License but which still want to provide support for the GNU gettext
1100
dnl Please note that the actual code of the GNU gettext library is covered
1101
dnl by the GNU Library General Public License, and the rest of the GNU
1102
dnl gettext package package is covered by the GNU General Public License.
1103
dnl They are *not* in the public domain.
1106
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1107
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1113
AC_MSG_CHECKING([whether NLS is requested])
1114
dnl Default is enabled NLS
1115
AC_ARG_ENABLE([nls],
1116
[ --disable-nls do not use Native Language Support],
1117
USE_NLS=$enableval, USE_NLS=yes)
1118
AC_MSG_RESULT([$USE_NLS])
1122
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1123
# serial 1 (pkg-config-0.24)
1125
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1127
# This program is free software; you can redistribute it and/or modify
1128
# it under the terms of the GNU General Public License as published by
1129
# the Free Software Foundation; either version 2 of the License, or
1130
# (at your option) any later version.
1132
# This program is distributed in the hope that it will be useful, but
1133
# WITHOUT ANY WARRANTY; without even the implied warranty of
1134
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1135
# General Public License for more details.
1137
# You should have received a copy of the GNU General Public License
1138
# along with this program; if not, write to the Free Software
1139
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1141
# As a special exception to the GNU General Public License, if you
1142
# distribute this file as part of a program that contains a
1143
# configuration script generated by Autoconf, you may include it under
1144
# the same distribution terms that you use for the rest of that program.
1146
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1147
# ----------------------------------
1148
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1149
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1150
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1151
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1152
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1153
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1154
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1156
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1157
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1159
if test -n "$PKG_CONFIG"; then
1160
_pkg_min_version=m4_default([$1], [0.9.0])
1161
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1162
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1163
AC_MSG_RESULT([yes])
1169
])# PKG_PROG_PKG_CONFIG
1171
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1173
# Check to see whether a particular set of modules exists. Similar
1174
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1176
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1177
# only at the first occurence in configure.ac, so if the first place
1178
# it's called might be skipped (such as if it is within an "if", you
1179
# have to call PKG_CHECK_EXISTS manually
1180
# --------------------------------------------------------------
1181
AC_DEFUN([PKG_CHECK_EXISTS],
1182
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1183
if test -n "$PKG_CONFIG" && \
1184
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1185
m4_default([$2], [:])
1186
m4_ifvaln([$3], [else
1190
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1191
# ---------------------------------------------
1192
m4_define([_PKG_CONFIG],
1193
[if test -n "$$1"; then
1195
elif test -n "$PKG_CONFIG"; then
1196
PKG_CHECK_EXISTS([$3],
1197
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1198
test "x$?" != "x0" && pkg_failed=yes ],
1205
# _PKG_SHORT_ERRORS_SUPPORTED
1206
# -----------------------------
1207
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1208
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1209
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1210
_pkg_short_errors_supported=yes
1212
_pkg_short_errors_supported=no
1214
])# _PKG_SHORT_ERRORS_SUPPORTED
1217
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1218
# [ACTION-IF-NOT-FOUND])
1221
# Note that if there is a possibility the first call to
1222
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1223
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1226
# --------------------------------------------------------------
1227
AC_DEFUN([PKG_CHECK_MODULES],
1228
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1229
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1230
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1233
AC_MSG_CHECKING([for $1])
1235
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1236
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1238
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1239
and $1[]_LIBS to avoid the need to call pkg-config.
1240
See the pkg-config man page for more details.])
1242
if test $pkg_failed = yes; then
1244
_PKG_SHORT_ERRORS_SUPPORTED
1245
if test $_pkg_short_errors_supported = yes; then
1246
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1248
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1250
# Put the nasty error message in config.log where it belongs
1251
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1253
m4_default([$4], [AC_MSG_ERROR(
1254
[Package requirements ($2) were not met:
1258
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1259
installed software in a non-standard prefix.
1263
elif test $pkg_failed = untried; then
1265
m4_default([$4], [AC_MSG_FAILURE(
1266
[The pkg-config script could not be found or is too old. Make sure it
1267
is in your PATH or set the PKG_CONFIG environment variable to the full
1272
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1275
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1276
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1277
AC_MSG_RESULT([yes])
1280
])# PKG_CHECK_MODULES
1283
# PKG_INSTALLDIR(DIRECTORY)
1284
# -------------------------
1285
# Substitutes the variable pkgconfigdir as the location where a module
1286
# should install pkg-config .pc files. By default the directory is
1287
# $libdir/pkgconfig, but the default can be changed by passing
1288
# DIRECTORY. The user can override through the --with-pkgconfigdir
1290
AC_DEFUN([PKG_INSTALLDIR],
1291
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
1292
m4_pushdef([pkg_description],
1293
[pkg-config installation directory @<:@]pkg_default[@:>@])
1294
AC_ARG_WITH([pkgconfigdir],
1295
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
1296
[with_pkgconfigdir=]pkg_default)
1297
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
1298
m4_popdef([pkg_default])
1299
m4_popdef([pkg_description])
1300
]) dnl PKG_INSTALLDIR
1303
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
1304
# -------------------------
1305
# Substitutes the variable noarch_pkgconfigdir as the location where a
1306
# module should install arch-independent pkg-config .pc files. By
1307
# default the directory is $datadir/pkgconfig, but the default can be
1308
# changed by passing DIRECTORY. The user can override through the
1309
# --with-noarch-pkgconfigdir parameter.
1310
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
1311
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
1312
m4_pushdef([pkg_description],
1313
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
1314
AC_ARG_WITH([noarch-pkgconfigdir],
1315
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
1316
[with_noarch_pkgconfigdir=]pkg_default)
1317
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
1318
m4_popdef([pkg_default])
1319
m4_popdef([pkg_description])
1320
]) dnl PKG_NOARCH_INSTALLDIR
1323
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
1324
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1325
# -------------------------------------------
1326
# Retrieves the value of the pkg-config variable for the given module.
1327
AC_DEFUN([PKG_CHECK_VAR],
1328
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1329
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
1331
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
1332
AS_VAR_COPY([$1], [pkg_cv_][$1])
1334
AS_VAR_IF([$1], [""], [$5], [$4])dnl
1338
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
1339
dnl the schema should be compiled
1342
AC_DEFUN([GLIB_GSETTINGS],
1344
m4_pattern_allow([AM_V_GEN])
1345
AC_ARG_ENABLE(schemas-compile,
1346
AS_HELP_STRING([--disable-schemas-compile],
1347
[Disable regeneration of gschemas.compiled on install]),
1348
[case ${enableval} in
1349
yes) GSETTINGS_DISABLE_SCHEMAS_COMPILE="" ;;
1350
no) GSETTINGS_DISABLE_SCHEMAS_COMPILE="1" ;;
1351
*) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-compile]) ;;
1353
AC_SUBST([GSETTINGS_DISABLE_SCHEMAS_COMPILE])
1354
PKG_PROG_PKG_CONFIG([0.16])
1355
AC_SUBST(gsettingsschemadir, [${datadir}/glib-2.0/schemas])
1356
if test x$cross_compiling != xyes; then
1357
GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable glib_compile_schemas gio-2.0`
1359
AC_PATH_PROG(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
1361
AC_SUBST(GLIB_COMPILE_SCHEMAS)
1362
if test "x$GLIB_COMPILE_SCHEMAS" = "x"; then
1363
ifelse([$2],,[AC_MSG_ERROR([glib-compile-schemas not found.])],[$2])
1365
ifelse([$1],,[:],[$1])
1369
.PHONY : uninstall-gsettings-schemas install-gsettings-schemas clean-gsettings-schemas
1371
mostlyclean-am: clean-gsettings-schemas
1373
gsettings__enum_file = $(addsuffix .enums.xml,$(gsettings_ENUM_NAMESPACE))
1375
%.gschema.valid: %.gschema.xml $(gsettings__enum_file)
1376
$(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --strict --dry-run $(addprefix --schema-file=,$(gsettings__enum_file)) --schema-file=$< && mkdir -p [$](@D) && touch [$]@
1378
all-am: $(gsettings_SCHEMAS:.xml=.valid)
1379
uninstall-am: uninstall-gsettings-schemas
1380
install-data-am: install-gsettings-schemas
1382
.SECONDARY: $(gsettings_SCHEMAS)
1384
install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
1386
if test -n "$^"; then \
1387
test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"; \
1388
$(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"; \
1389
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); \
1392
uninstall-gsettings-schemas:
1393
@$(NORMAL_UNINSTALL)
1394
@list='\''$(gsettings_SCHEMAS) $(gsettings__enum_file)'\''; test -n "$(gsettingsschemadir)" || list=; \
1395
files=`for p in $$list; do echo $$p; done | sed -e '\''s|^.*/||'\''`; \
1396
test -n "$$files" || exit 0; \
1397
echo " ( cd '\''$(DESTDIR)$(gsettingsschemadir)'\'' && rm -f" $$files ")"; \
1398
cd "$(DESTDIR)$(gsettingsschemadir)" && rm -f $$files
1399
test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
1401
clean-gsettings-schemas:
1402
rm -f $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
1404
ifdef gsettings_ENUM_NAMESPACE
1405
$(gsettings__enum_file): $(gsettings_ENUM_FILES)
1406
$(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 [$]@
1409
_GSETTINGS_SUBST(GSETTINGS_RULES)
1412
dnl _GSETTINGS_SUBST(VARIABLE)
1413
dnl Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
1414
AC_DEFUN([_GSETTINGS_SUBST],
1417
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
1421
dnl -*- mode: autoconf -*-
1422
dnl Copyright 2009 Johan Dahlin
1424
dnl This file is free software; the author(s) gives unlimited
1425
dnl permission to copy and/or distribute it, with or without
1426
dnl modifications, as long as this notice is preserved.
1431
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
1433
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
1434
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
1435
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
1437
dnl enable/disable introspection
1438
m4_if([$2], [require],
1440
enable_introspection=yes
1442
AC_ARG_ENABLE(introspection,
1443
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
1444
[Enable introspection for this build]),,
1445
[enable_introspection=auto])
1448
AC_MSG_CHECKING([for gobject-introspection])
1450
dnl presence/version checking
1451
AS_CASE([$enable_introspection],
1453
found_introspection="no (disabled, use --enable-introspection to enable)"
1456
PKG_CHECK_EXISTS([gobject-introspection-1.0],,
1457
AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
1458
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
1459
found_introspection=yes,
1460
AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
1463
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
1464
dnl Canonicalize enable_introspection
1465
enable_introspection=$found_introspection
1468
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
1471
AC_MSG_RESULT([$found_introspection])
1473
INTROSPECTION_SCANNER=
1474
INTROSPECTION_COMPILER=
1475
INTROSPECTION_GENERATE=
1476
INTROSPECTION_GIRDIR=
1477
INTROSPECTION_TYPELIBDIR=
1478
if test "x$found_introspection" = "xyes"; then
1479
INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
1480
INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
1481
INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
1482
INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
1483
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
1484
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
1485
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
1486
INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
1488
AC_SUBST(INTROSPECTION_SCANNER)
1489
AC_SUBST(INTROSPECTION_COMPILER)
1490
AC_SUBST(INTROSPECTION_GENERATE)
1491
AC_SUBST(INTROSPECTION_GIRDIR)
1492
AC_SUBST(INTROSPECTION_TYPELIBDIR)
1493
AC_SUBST(INTROSPECTION_CFLAGS)
1494
AC_SUBST(INTROSPECTION_LIBS)
1495
AC_SUBST(INTROSPECTION_MAKEFILE)
1497
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
1502
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
1504
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
1506
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
1510
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
1513
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
1515
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
1518
1518
m4_include([libgd/libgd.m4])
1519
m4_include([m4/glibtests.m4])
1519
1520
m4_include([m4/intltool.m4])
1520
1521
m4_include([m4/libtool.m4])
1521
1522
m4_include([m4/ltoptions.m4])