900 |
|
|
901 |
# isc-posix.m4 serial 2 (gettext-0.11.2) |
# isc-posix.m4 serial 2 (gettext-0.11.2) |
902 |
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. |
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. |
903 |
dnl This file is free software, distributed under the terms of the GNU |
dnl This file is free software; the Free Software Foundation |
904 |
dnl General Public License. As a special exception to the GNU General |
dnl gives unlimited permission to copy and/or distribute it, |
905 |
dnl Public License, this file may be distributed as part of a program |
dnl with or without modifications, as long as this notice is preserved. |
|
dnl that contains a configuration script generated by Autoconf, under |
|
|
dnl the same distribution terms as the rest of that program. |
|
906 |
|
|
907 |
# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. |
# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. |
908 |
|
|
1031 |
|
|
1032 |
AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC]) |
AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC]) |
1033 |
|
|
1034 |
|
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- |
1035 |
|
# |
1036 |
|
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. |
1037 |
|
# |
1038 |
|
# This program is free software; you can redistribute it and/or modify |
1039 |
|
# it under the terms of the GNU General Public License as published by |
1040 |
|
# the Free Software Foundation; either version 2 of the License, or |
1041 |
|
# (at your option) any later version. |
1042 |
|
# |
1043 |
|
# This program is distributed in the hope that it will be useful, but |
1044 |
|
# WITHOUT ANY WARRANTY; without even the implied warranty of |
1045 |
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1046 |
|
# General Public License for more details. |
1047 |
|
# |
1048 |
|
# You should have received a copy of the GNU General Public License |
1049 |
|
# along with this program; if not, write to the Free Software |
1050 |
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1051 |
|
# |
1052 |
|
# As a special exception to the GNU General Public License, if you |
1053 |
|
# distribute this file as part of a program that contains a |
1054 |
|
# configuration script generated by Autoconf, you may include it under |
1055 |
|
# the same distribution terms that you use for the rest of that program. |
1056 |
|
|
1057 |
|
# PKG_PROG_PKG_CONFIG([MIN-VERSION]) |
1058 |
|
# ---------------------------------- |
1059 |
|
AC_DEFUN([PKG_PROG_PKG_CONFIG], |
1060 |
|
[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) |
1061 |
|
m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) |
1062 |
|
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl |
1063 |
|
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then |
1064 |
|
AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) |
1065 |
|
fi |
1066 |
|
if test -n "$PKG_CONFIG"; then |
1067 |
|
_pkg_min_version=m4_ifval([$1], [$1], [0.9.0]) |
1068 |
|
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) |
1069 |
|
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then |
1070 |
|
AC_MSG_RESULT([yes]) |
1071 |
|
else |
1072 |
|
AC_MSG_RESULT([no]) |
1073 |
|
PKG_CONFIG="" |
1074 |
|
fi |
1075 |
|
|
1076 |
|
fi[]dnl |
1077 |
|
])# PKG_PROG_PKG_CONFIG |
1078 |
|
|
1079 |
|
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) |
1080 |
|
# --------------------------------------------- |
1081 |
|
m4_define([_PKG_CONFIG], |
1082 |
|
[if test "x$ac_cv_env_[]$1[]_set" = "xset"; then |
1083 |
|
pkg_cv_[]$1=$ac_cv_env_[]$1[]_value |
1084 |
|
elif test -n "$PKG_CONFIG"; then |
1085 |
|
if AC_RUN_LOG([$PKG_CONFIG --exists "$3" >/dev/null 2>&1]); then |
1086 |
|
pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` |
1087 |
|
else |
1088 |
|
pkg_failed=yes |
1089 |
|
fi |
1090 |
|
else |
1091 |
|
pkg_failed=untried |
1092 |
|
fi[]dnl |
1093 |
|
])# _PKG_CONFIG |
1094 |
|
|
1095 |
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) |
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], |
1096 |
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page |
# [ACTION-IF-NOT-FOUND]) |
1097 |
dnl also defines GSTUFF_PKG_ERRORS on error |
# |
1098 |
AC_DEFUN(PKG_CHECK_MODULES, [ |
# |
1099 |
succeeded=no |
# Note that if there is a possibility the first call to |
1100 |
|
# PKG_CHECK_MODULES might not happen, you should be sure to include an |
1101 |
if test -z "$PKG_CONFIG"; then |
# explicit call to PKG_PROG_PKG_CONFIG in your configure.in |
1102 |
AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
# |
1103 |
fi |
# |
1104 |
|
# -------------------------------------------------------------- |
1105 |
if test "$PKG_CONFIG" = "no" ; then |
AC_DEFUN([PKG_CHECK_MODULES], |
1106 |
echo "*** The pkg-config script could not be found. Make sure it is" |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
1107 |
echo "*** in your path, or set the PKG_CONFIG environment variable" |
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl |
1108 |
echo "*** to the full path to pkg-config." |
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl |
1109 |
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." |
|
1110 |
else |
pkg_failed=no |
1111 |
PKG_CONFIG_MIN_VERSION=0.9.0 |
AC_CACHE_CHECK([for $1][_CFLAGS], [pkg_cv_][$1][_CFLAGS], |
1112 |
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then |
[_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])]) |
1113 |
AC_MSG_CHECKING(for $2) |
AC_CACHE_CHECK([for $1][_LIBS], [pkg_cv_][$1][_LIBS], |
1114 |
|
[_PKG_CONFIG([$1][_LIBS], [libs], [$2])]) |
1115 |
if $PKG_CONFIG --exists "$2" ; then |
|
1116 |
AC_MSG_RESULT(yes) |
if test $pkg_failed = yes; then |
1117 |
succeeded=yes |
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` |
1118 |
|
# Put the nasty error message in config.log where it belongs |
1119 |
AC_MSG_CHECKING($1_CFLAGS) |
echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD |
1120 |
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"` |
|
1121 |
AC_MSG_RESULT($$1_CFLAGS) |
ifelse([$4], , [AC_MSG_ERROR(dnl |
1122 |
|
[Package requirements ($2) were not met. |
1123 |
AC_MSG_CHECKING($1_LIBS) |
Consider adjusting the PKG_CONFIG_PATH environment variable if you |
1124 |
$1_LIBS=`$PKG_CONFIG --libs "$2"` |
installed software in a non-standard prefix. |
1125 |
AC_MSG_RESULT($$1_LIBS) |
|
1126 |
else |
Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables |
1127 |
$1_CFLAGS="" |
to avoid the need to call pkg-config. See the pkg-config man page for |
1128 |
$1_LIBS="" |
more details.])], |
1129 |
## If we have a custom action on failure, don't print errors, but |
[$4]) |
1130 |
## do set a variable so people can do so. |
elif test $pkg_failed = untried; then |
1131 |
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` |
ifelse([$4], , [AC_MSG_FAILURE(dnl |
1132 |
ifelse([$4], ,echo $$1_PKG_ERRORS,) |
[The pkg-config script could not be found or is too old. Make sure it |
1133 |
fi |
is in your PATH or set the PKG_CONFIG environment variable to the full |
1134 |
|
path to pkg-config. |
1135 |
AC_SUBST($1_CFLAGS) |
|
1136 |
AC_SUBST($1_LIBS) |
Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables |
1137 |
else |
to avoid the need to call pkg-config. See the pkg-config man page for |
1138 |
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." |
more details. |
|
echo "*** See http://www.freedesktop.org/software/pkgconfig" |
|
|
fi |
|
|
fi |
|
|
|
|
|
if test $succeeded = yes; then |
|
|
ifelse([$3], , :, [$3]) |
|
|
else |
|
|
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) |
|
|
fi |
|
|
]) |
|
|
|
|
1139 |
|
|
1140 |
|
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], |
1141 |
|
[$4]) |
1142 |
|
else |
1143 |
|
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS |
1144 |
|
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS |
1145 |
|
ifelse([$3], , :, [$3]) |
1146 |
|
fi[]dnl |
1147 |
|
])# PKG_CHECK_MODULES |
1148 |
|
|