~attente/glib/gicon-upstream

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-03-26 13:24:05 UTC
  • mfrom: (1.63.18)
  • Revision ID: package-import@ubuntu.com-20130326132405-rwwke1lhar1e02sl
Tags: 2.36.0-1ubuntu1
* Merge with Debian experimental. Remaining Ubuntu changes:
  - Build-depend on python:any for cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
If you have problems, you may need to regenerate the build system entirely.
20
20
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
21
21
 
22
 
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
23
 
# serial 1 (pkg-config-0.24)
24
 
25
 
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
26
 
#
27
 
# This program is free software; you can redistribute it and/or modify
28
 
# it under the terms of the GNU General Public License as published by
29
 
# the Free Software Foundation; either version 2 of the License, or
30
 
# (at your option) any later version.
31
 
#
32
 
# This program is distributed in the hope that it will be useful, but
33
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
34
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
35
 
# General Public License for more details.
36
 
#
37
 
# You should have received a copy of the GNU General Public License
38
 
# along with this program; if not, write to the Free Software
39
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
40
 
#
41
 
# As a special exception to the GNU General Public License, if you
42
 
# distribute this file as part of a program that contains a
43
 
# configuration script generated by Autoconf, you may include it under
44
 
# the same distribution terms that you use for the rest of that program.
45
 
 
46
 
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
47
 
# ----------------------------------
48
 
AC_DEFUN([PKG_PROG_PKG_CONFIG],
49
 
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
50
 
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
51
 
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
52
 
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
53
 
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
54
 
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
55
 
 
56
 
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
57
 
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
58
 
fi
59
 
if test -n "$PKG_CONFIG"; then
60
 
        _pkg_min_version=m4_default([$1], [0.9.0])
61
 
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
62
 
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
63
 
                AC_MSG_RESULT([yes])
64
 
        else
65
 
                AC_MSG_RESULT([no])
66
 
                PKG_CONFIG=""
67
 
        fi
68
 
fi[]dnl
69
 
])# PKG_PROG_PKG_CONFIG
70
 
 
71
 
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
72
 
#
73
 
# Check to see whether a particular set of modules exists.  Similar
74
 
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
75
 
#
76
 
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
77
 
# only at the first occurence in configure.ac, so if the first place
78
 
# it's called might be skipped (such as if it is within an "if", you
79
 
# have to call PKG_CHECK_EXISTS manually
80
 
# --------------------------------------------------------------
81
 
AC_DEFUN([PKG_CHECK_EXISTS],
82
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
83
 
if test -n "$PKG_CONFIG" && \
84
 
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
85
 
  m4_default([$2], [:])
86
 
m4_ifvaln([$3], [else
87
 
  $3])dnl
88
 
fi])
89
 
 
90
 
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
91
 
# ---------------------------------------------
92
 
m4_define([_PKG_CONFIG],
93
 
[if test -n "$$1"; then
94
 
    pkg_cv_[]$1="$$1"
95
 
 elif test -n "$PKG_CONFIG"; then
96
 
    PKG_CHECK_EXISTS([$3],
97
 
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
98
 
                      test "x$?" != "x0" && pkg_failed=yes ],
99
 
                     [pkg_failed=yes])
100
 
 else
101
 
    pkg_failed=untried
102
 
fi[]dnl
103
 
])# _PKG_CONFIG
104
 
 
105
 
# _PKG_SHORT_ERRORS_SUPPORTED
106
 
# -----------------------------
107
 
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
108
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
109
 
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
110
 
        _pkg_short_errors_supported=yes
111
 
else
112
 
        _pkg_short_errors_supported=no
113
 
fi[]dnl
114
 
])# _PKG_SHORT_ERRORS_SUPPORTED
115
 
 
116
 
 
117
 
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
118
 
# [ACTION-IF-NOT-FOUND])
119
 
#
120
 
#
121
 
# Note that if there is a possibility the first call to
122
 
# PKG_CHECK_MODULES might not happen, you should be sure to include an
123
 
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
124
 
#
125
 
#
126
 
# --------------------------------------------------------------
127
 
AC_DEFUN([PKG_CHECK_MODULES],
128
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
129
 
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
130
 
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
131
 
 
132
 
pkg_failed=no
133
 
AC_MSG_CHECKING([for $1])
134
 
 
135
 
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
136
 
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
137
 
 
138
 
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
139
 
and $1[]_LIBS to avoid the need to call pkg-config.
140
 
See the pkg-config man page for more details.])
141
 
 
142
 
if test $pkg_failed = yes; then
143
 
        AC_MSG_RESULT([no])
144
 
        _PKG_SHORT_ERRORS_SUPPORTED
145
 
        if test $_pkg_short_errors_supported = yes; then
146
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
147
 
        else 
148
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
149
 
        fi
150
 
        # Put the nasty error message in config.log where it belongs
151
 
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
152
 
 
153
 
        m4_default([$4], [AC_MSG_ERROR(
154
 
[Package requirements ($2) were not met:
155
 
 
156
 
$$1_PKG_ERRORS
157
 
 
158
 
Consider adjusting the PKG_CONFIG_PATH environment variable if you
159
 
installed software in a non-standard prefix.
160
 
 
161
 
_PKG_TEXT])[]dnl
162
 
        ])
163
 
elif test $pkg_failed = untried; then
164
 
        AC_MSG_RESULT([no])
165
 
        m4_default([$4], [AC_MSG_FAILURE(
166
 
[The pkg-config script could not be found or is too old.  Make sure it
167
 
is in your PATH or set the PKG_CONFIG environment variable to the full
168
 
path to pkg-config.
169
 
 
170
 
_PKG_TEXT
171
 
 
172
 
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
173
 
        ])
174
 
else
175
 
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
176
 
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
177
 
        AC_MSG_RESULT([yes])
178
 
        $3
179
 
fi[]dnl
180
 
])# PKG_CHECK_MODULES
181
 
 
182
 
 
183
 
# PKG_INSTALLDIR(DIRECTORY)
184
 
# -------------------------
185
 
# Substitutes the variable pkgconfigdir as the location where a module
186
 
# should install pkg-config .pc files. By default the directory is
187
 
# $libdir/pkgconfig, but the default can be changed by passing
188
 
# DIRECTORY. The user can override through the --with-pkgconfigdir
189
 
# parameter.
190
 
AC_DEFUN([PKG_INSTALLDIR],
191
 
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
192
 
m4_pushdef([pkg_description],
193
 
    [pkg-config installation directory @<:@]pkg_default[@:>@])
194
 
AC_ARG_WITH([pkgconfigdir],
195
 
    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
196
 
    [with_pkgconfigdir=]pkg_default)
197
 
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
198
 
m4_popdef([pkg_default])
199
 
m4_popdef([pkg_description])
200
 
]) dnl PKG_INSTALLDIR
201
 
 
202
 
 
203
 
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
204
 
# -------------------------
205
 
# Substitutes the variable noarch_pkgconfigdir as the location where a
206
 
# module should install arch-independent pkg-config .pc files. By
207
 
# default the directory is $datadir/pkgconfig, but the default can be
208
 
# changed by passing DIRECTORY. The user can override through the
209
 
# --with-noarch-pkgconfigdir parameter.
210
 
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
211
 
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
212
 
m4_pushdef([pkg_description],
213
 
    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
214
 
AC_ARG_WITH([noarch-pkgconfigdir],
215
 
    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
216
 
    [with_noarch_pkgconfigdir=]pkg_default)
217
 
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
218
 
m4_popdef([pkg_default])
219
 
m4_popdef([pkg_description])
220
 
]) dnl PKG_NOARCH_INSTALLDIR
221
 
 
222
22
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
223
23
#
224
24
# This file is free software; the Free Software Foundation
1529
1329
AC_SUBST([am__untar])
1530
1330
]) # _AM_PROG_TAR
1531
1331
 
 
1332
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
1333
# serial 1 (pkg-config-0.24)
 
1334
 
1335
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
 
1336
#
 
1337
# This program is free software; you can redistribute it and/or modify
 
1338
# it under the terms of the GNU General Public License as published by
 
1339
# the Free Software Foundation; either version 2 of the License, or
 
1340
# (at your option) any later version.
 
1341
#
 
1342
# This program is distributed in the hope that it will be useful, but
 
1343
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
1344
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
1345
# General Public License for more details.
 
1346
#
 
1347
# You should have received a copy of the GNU General Public License
 
1348
# along with this program; if not, write to the Free Software
 
1349
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
1350
#
 
1351
# As a special exception to the GNU General Public License, if you
 
1352
# distribute this file as part of a program that contains a
 
1353
# configuration script generated by Autoconf, you may include it under
 
1354
# the same distribution terms that you use for the rest of that program.
 
1355
 
 
1356
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
 
1357
# ----------------------------------
 
1358
AC_DEFUN([PKG_PROG_PKG_CONFIG],
 
1359
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 
1360
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
 
1361
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
 
1362
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 
1363
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 
1364
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
 
1365
 
 
1366
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 
1367
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 
1368
fi
 
1369
if test -n "$PKG_CONFIG"; then
 
1370
        _pkg_min_version=m4_default([$1], [0.9.0])
 
1371
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
 
1372
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
 
1373
                AC_MSG_RESULT([yes])
 
1374
        else
 
1375
                AC_MSG_RESULT([no])
 
1376
                PKG_CONFIG=""
 
1377
        fi
 
1378
fi[]dnl
 
1379
])# PKG_PROG_PKG_CONFIG
 
1380
 
 
1381
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
 
1382
#
 
1383
# Check to see whether a particular set of modules exists.  Similar
 
1384
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
 
1385
#
 
1386
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1387
# only at the first occurence in configure.ac, so if the first place
 
1388
# it's called might be skipped (such as if it is within an "if", you
 
1389
# have to call PKG_CHECK_EXISTS manually
 
1390
# --------------------------------------------------------------
 
1391
AC_DEFUN([PKG_CHECK_EXISTS],
 
1392
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
1393
if test -n "$PKG_CONFIG" && \
 
1394
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
 
1395
  m4_default([$2], [:])
 
1396
m4_ifvaln([$3], [else
 
1397
  $3])dnl
 
1398
fi])
 
1399
 
 
1400
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 
1401
# ---------------------------------------------
 
1402
m4_define([_PKG_CONFIG],
 
1403
[if test -n "$$1"; then
 
1404
    pkg_cv_[]$1="$$1"
 
1405
 elif test -n "$PKG_CONFIG"; then
 
1406
    PKG_CHECK_EXISTS([$3],
 
1407
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
 
1408
                      test "x$?" != "x0" && pkg_failed=yes ],
 
1409
                     [pkg_failed=yes])
 
1410
 else
 
1411
    pkg_failed=untried
 
1412
fi[]dnl
 
1413
])# _PKG_CONFIG
 
1414
 
 
1415
# _PKG_SHORT_ERRORS_SUPPORTED
 
1416
# -----------------------------
 
1417
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 
1418
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
1419
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 
1420
        _pkg_short_errors_supported=yes
 
1421
else
 
1422
        _pkg_short_errors_supported=no
 
1423
fi[]dnl
 
1424
])# _PKG_SHORT_ERRORS_SUPPORTED
 
1425
 
 
1426
 
 
1427
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
 
1428
# [ACTION-IF-NOT-FOUND])
 
1429
#
 
1430
#
 
1431
# Note that if there is a possibility the first call to
 
1432
# PKG_CHECK_MODULES might not happen, you should be sure to include an
 
1433
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 
1434
#
 
1435
#
 
1436
# --------------------------------------------------------------
 
1437
AC_DEFUN([PKG_CHECK_MODULES],
 
1438
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 
1439
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
 
1440
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
 
1441
 
 
1442
pkg_failed=no
 
1443
AC_MSG_CHECKING([for $1])
 
1444
 
 
1445
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
 
1446
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
 
1447
 
 
1448
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
 
1449
and $1[]_LIBS to avoid the need to call pkg-config.
 
1450
See the pkg-config man page for more details.])
 
1451
 
 
1452
if test $pkg_failed = yes; then
 
1453
        AC_MSG_RESULT([no])
 
1454
        _PKG_SHORT_ERRORS_SUPPORTED
 
1455
        if test $_pkg_short_errors_supported = yes; then
 
1456
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
 
1457
        else 
 
1458
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
 
1459
        fi
 
1460
        # Put the nasty error message in config.log where it belongs
 
1461
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
1462
 
 
1463
        m4_default([$4], [AC_MSG_ERROR(
 
1464
[Package requirements ($2) were not met:
 
1465
 
 
1466
$$1_PKG_ERRORS
 
1467
 
 
1468
Consider adjusting the PKG_CONFIG_PATH environment variable if you
 
1469
installed software in a non-standard prefix.
 
1470
 
 
1471
_PKG_TEXT])[]dnl
 
1472
        ])
 
1473
elif test $pkg_failed = untried; then
 
1474
        AC_MSG_RESULT([no])
 
1475
        m4_default([$4], [AC_MSG_FAILURE(
 
1476
[The pkg-config script could not be found or is too old.  Make sure it
 
1477
is in your PATH or set the PKG_CONFIG environment variable to the full
 
1478
path to pkg-config.
 
1479
 
 
1480
_PKG_TEXT
 
1481
 
 
1482
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
 
1483
        ])
 
1484
else
 
1485
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
 
1486
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
 
1487
        AC_MSG_RESULT([yes])
 
1488
        $3
 
1489
fi[]dnl
 
1490
])# PKG_CHECK_MODULES
 
1491
 
 
1492
 
 
1493
# PKG_INSTALLDIR(DIRECTORY)
 
1494
# -------------------------
 
1495
# Substitutes the variable pkgconfigdir as the location where a module
 
1496
# should install pkg-config .pc files. By default the directory is
 
1497
# $libdir/pkgconfig, but the default can be changed by passing
 
1498
# DIRECTORY. The user can override through the --with-pkgconfigdir
 
1499
# parameter.
 
1500
AC_DEFUN([PKG_INSTALLDIR],
 
1501
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
 
1502
m4_pushdef([pkg_description],
 
1503
    [pkg-config installation directory @<:@]pkg_default[@:>@])
 
1504
AC_ARG_WITH([pkgconfigdir],
 
1505
    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
 
1506
    [with_pkgconfigdir=]pkg_default)
 
1507
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
 
1508
m4_popdef([pkg_default])
 
1509
m4_popdef([pkg_description])
 
1510
]) dnl PKG_INSTALLDIR
 
1511
 
 
1512
 
 
1513
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
 
1514
# -------------------------
 
1515
# Substitutes the variable noarch_pkgconfigdir as the location where a
 
1516
# module should install arch-independent pkg-config .pc files. By
 
1517
# default the directory is $datadir/pkgconfig, but the default can be
 
1518
# changed by passing DIRECTORY. The user can override through the
 
1519
# --with-noarch-pkgconfigdir parameter.
 
1520
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
 
1521
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
 
1522
m4_pushdef([pkg_description],
 
1523
    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
 
1524
AC_ARG_WITH([noarch-pkgconfigdir],
 
1525
    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
 
1526
    [with_noarch_pkgconfigdir=]pkg_default)
 
1527
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
 
1528
m4_popdef([pkg_default])
 
1529
m4_popdef([pkg_description])
 
1530
]) dnl PKG_NOARCH_INSTALLDIR
 
1531
 
1532
1532
m4_include([m4macros/attributes.m4])
1533
1533
m4_include([m4macros/gtk-doc.m4])
1534
1534
m4_include([m4macros/libtool.m4])