1033
1033
AC_SUBST([am__untar])
1034
1034
]) # _AM_PROG_TAR
1036
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1037
# serial 1 (pkg-config-0.24)
1039
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1041
# This program is free software; you can redistribute it and/or modify
1042
# it under the terms of the GNU General Public License as published by
1043
# the Free Software Foundation; either version 2 of the License, or
1044
# (at your option) any later version.
1046
# This program is distributed in the hope that it will be useful, but
1047
# WITHOUT ANY WARRANTY; without even the implied warranty of
1048
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1049
# General Public License for more details.
1051
# You should have received a copy of the GNU General Public License
1052
# along with this program; if not, write to the Free Software
1053
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1055
# As a special exception to the GNU General Public License, if you
1056
# distribute this file as part of a program that contains a
1057
# configuration script generated by Autoconf, you may include it under
1058
# the same distribution terms that you use for the rest of that program.
1060
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1061
# ----------------------------------
1062
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1063
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1064
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1065
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1066
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1067
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1068
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1070
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1071
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1073
if test -n "$PKG_CONFIG"; then
1074
_pkg_min_version=m4_default([$1], [0.9.0])
1075
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1076
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1077
AC_MSG_RESULT([yes])
1083
])# PKG_PROG_PKG_CONFIG
1085
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1087
# Check to see whether a particular set of modules exists. Similar
1088
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1090
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1091
# only at the first occurence in configure.ac, so if the first place
1092
# it's called might be skipped (such as if it is within an "if", you
1093
# have to call PKG_CHECK_EXISTS manually
1094
# --------------------------------------------------------------
1095
AC_DEFUN([PKG_CHECK_EXISTS],
1096
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1097
if test -n "$PKG_CONFIG" && \
1098
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1099
m4_default([$2], [:])
1100
m4_ifvaln([$3], [else
1104
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1105
# ---------------------------------------------
1106
m4_define([_PKG_CONFIG],
1107
[if test -n "$$1"; then
1109
elif test -n "$PKG_CONFIG"; then
1110
PKG_CHECK_EXISTS([$3],
1111
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1112
test "x$?" != "x0" && pkg_failed=yes ],
1119
# _PKG_SHORT_ERRORS_SUPPORTED
1120
# -----------------------------
1121
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1122
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1123
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1124
_pkg_short_errors_supported=yes
1126
_pkg_short_errors_supported=no
1128
])# _PKG_SHORT_ERRORS_SUPPORTED
1131
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1132
# [ACTION-IF-NOT-FOUND])
1135
# Note that if there is a possibility the first call to
1136
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1137
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1140
# --------------------------------------------------------------
1141
AC_DEFUN([PKG_CHECK_MODULES],
1142
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1143
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1144
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1147
AC_MSG_CHECKING([for $1])
1149
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1150
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1152
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1153
and $1[]_LIBS to avoid the need to call pkg-config.
1154
See the pkg-config man page for more details.])
1156
if test $pkg_failed = yes; then
1158
_PKG_SHORT_ERRORS_SUPPORTED
1159
if test $_pkg_short_errors_supported = yes; then
1160
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1162
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1164
# Put the nasty error message in config.log where it belongs
1165
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1167
m4_default([$4], [AC_MSG_ERROR(
1168
[Package requirements ($2) were not met:
1172
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1173
installed software in a non-standard prefix.
1177
elif test $pkg_failed = untried; then
1179
m4_default([$4], [AC_MSG_FAILURE(
1180
[The pkg-config script could not be found or is too old. Make sure it
1181
is in your PATH or set the PKG_CONFIG environment variable to the full
1186
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1189
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1190
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1191
AC_MSG_RESULT([yes])
1194
])# PKG_CHECK_MODULES
1037
1197
#serial 20090814
1462
1622
AC_MSG_RESULT([$mm_all_flags])[]dnl
1465
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1466
# serial 1 (pkg-config-0.24)
1468
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1470
# This program is free software; you can redistribute it and/or modify
1471
# it under the terms of the GNU General Public License as published by
1472
# the Free Software Foundation; either version 2 of the License, or
1473
# (at your option) any later version.
1475
# This program is distributed in the hope that it will be useful, but
1476
# WITHOUT ANY WARRANTY; without even the implied warranty of
1477
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1478
# General Public License for more details.
1480
# You should have received a copy of the GNU General Public License
1481
# along with this program; if not, write to the Free Software
1482
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1484
# As a special exception to the GNU General Public License, if you
1485
# distribute this file as part of a program that contains a
1486
# configuration script generated by Autoconf, you may include it under
1487
# the same distribution terms that you use for the rest of that program.
1489
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1490
# ----------------------------------
1491
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1492
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1493
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1494
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1495
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1496
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1497
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1499
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1500
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1502
if test -n "$PKG_CONFIG"; then
1503
_pkg_min_version=m4_default([$1], [0.9.0])
1504
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1505
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1506
AC_MSG_RESULT([yes])
1512
])# PKG_PROG_PKG_CONFIG
1514
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1516
# Check to see whether a particular set of modules exists. Similar
1517
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1519
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1520
# only at the first occurence in configure.ac, so if the first place
1521
# it's called might be skipped (such as if it is within an "if", you
1522
# have to call PKG_CHECK_EXISTS manually
1523
# --------------------------------------------------------------
1524
AC_DEFUN([PKG_CHECK_EXISTS],
1525
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1526
if test -n "$PKG_CONFIG" && \
1527
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1528
m4_default([$2], [:])
1529
m4_ifvaln([$3], [else
1533
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1534
# ---------------------------------------------
1535
m4_define([_PKG_CONFIG],
1536
[if test -n "$$1"; then
1538
elif test -n "$PKG_CONFIG"; then
1539
PKG_CHECK_EXISTS([$3],
1540
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1541
test "x$?" != "x0" && pkg_failed=yes ],
1548
# _PKG_SHORT_ERRORS_SUPPORTED
1549
# -----------------------------
1550
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1551
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1552
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1553
_pkg_short_errors_supported=yes
1555
_pkg_short_errors_supported=no
1557
])# _PKG_SHORT_ERRORS_SUPPORTED
1560
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1561
# [ACTION-IF-NOT-FOUND])
1564
# Note that if there is a possibility the first call to
1565
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1566
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1569
# --------------------------------------------------------------
1570
AC_DEFUN([PKG_CHECK_MODULES],
1571
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1572
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1573
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1576
AC_MSG_CHECKING([for $1])
1578
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1579
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1581
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1582
and $1[]_LIBS to avoid the need to call pkg-config.
1583
See the pkg-config man page for more details.])
1585
if test $pkg_failed = yes; then
1587
_PKG_SHORT_ERRORS_SUPPORTED
1588
if test $_pkg_short_errors_supported = yes; then
1589
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1591
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1593
# Put the nasty error message in config.log where it belongs
1594
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1596
m4_default([$4], [AC_MSG_ERROR(
1597
[Package requirements ($2) were not met:
1601
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1602
installed software in a non-standard prefix.
1606
elif test $pkg_failed = untried; then
1608
m4_default([$4], [AC_MSG_FAILURE(
1609
[The pkg-config script could not be found or is too old. Make sure it
1610
is in your PATH or set the PKG_CONFIG environment variable to the full
1615
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1618
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1619
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1620
AC_MSG_RESULT([yes])
1623
])# PKG_CHECK_MODULES
1625
1625
m4_include([build/libtool.m4])
1626
1626
m4_include([build/ltoptions.m4])
1627
1627
m4_include([build/ltsugar.m4])