filename | aclocal.m4 |
changeset | 180:e6dcf9b65658 |
prev | 10:c898b37506e0 |
next | 360:dff4a3bbac0c |
author | nkeynes |
date | Tue Feb 13 08:34:27 2007 +0000 (16 years ago) |
permissions | -rw-r--r-- |
last change | Add tests for FLOAT and FTRC Comment out user-mode exception test (broken) |
file | annotate | diff | log | raw |
1.1 --- a/aclocal.m4 Sun Dec 11 05:15:36 2005 +00001.2 +++ b/aclocal.m4 Tue Feb 13 08:34:27 2007 +00001.3 @@ -1033,63 +1033,162 @@1.5 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])1.7 +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-1.8 +#1.9 +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.1.10 +#1.11 +# This program is free software; you can redistribute it and/or modify1.12 +# it under the terms of the GNU General Public License as published by1.13 +# the Free Software Foundation; either version 2 of the License, or1.14 +# (at your option) any later version.1.15 +#1.16 +# This program is distributed in the hope that it will be useful, but1.17 +# WITHOUT ANY WARRANTY; without even the implied warranty of1.18 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU1.19 +# General Public License for more details.1.20 +#1.21 +# You should have received a copy of the GNU General Public License1.22 +# along with this program; if not, write to the Free Software1.23 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.1.24 +#1.25 +# As a special exception to the GNU General Public License, if you1.26 +# distribute this file as part of a program that contains a1.27 +# configuration script generated by Autoconf, you may include it under1.28 +# the same distribution terms that you use for the rest of that program.1.30 -dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)1.31 -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page1.32 -dnl also defines GSTUFF_PKG_ERRORS on error1.33 -AC_DEFUN(PKG_CHECK_MODULES, [1.34 - succeeded=no1.35 +# PKG_PROG_PKG_CONFIG([MIN-VERSION])1.36 +# ----------------------------------1.37 +AC_DEFUN([PKG_PROG_PKG_CONFIG],1.38 +[m4_pattern_forbid([^_?PKG_[A-Z_]+$])1.39 +m4_pattern_allow([^PKG_CONFIG(_PATH)?$])1.40 +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl1.41 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then1.42 + AC_PATH_TOOL([PKG_CONFIG], [pkg-config])1.43 +fi1.44 +if test -n "$PKG_CONFIG"; then1.45 + _pkg_min_version=m4_default([$1], [0.9.0])1.46 + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])1.47 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then1.48 + AC_MSG_RESULT([yes])1.49 + else1.50 + AC_MSG_RESULT([no])1.51 + PKG_CONFIG=""1.52 + fi1.53 +1.54 +fi[]dnl1.55 +])# PKG_PROG_PKG_CONFIG1.57 - if test -z "$PKG_CONFIG"; then1.58 - AC_PATH_PROG(PKG_CONFIG, pkg-config, no)1.59 - fi1.60 +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])1.61 +#1.62 +# Check to see whether a particular set of modules exists. Similar1.63 +# to PKG_CHECK_MODULES(), but does not set variables or print errors.1.64 +#1.65 +#1.66 +# Similar to PKG_CHECK_MODULES, make sure that the first instance of1.67 +# this or PKG_CHECK_MODULES is called, or make sure to call1.68 +# PKG_CHECK_EXISTS manually1.69 +# --------------------------------------------------------------1.70 +AC_DEFUN([PKG_CHECK_EXISTS],1.71 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl1.72 +if test -n "$PKG_CONFIG" && \1.73 + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then1.74 + m4_ifval([$2], [$2], [:])1.75 +m4_ifvaln([$3], [else1.76 + $3])dnl1.77 +fi])1.79 - if test "$PKG_CONFIG" = "no" ; then1.80 - echo "*** The pkg-config script could not be found. Make sure it is"1.81 - echo "*** in your path, or set the PKG_CONFIG environment variable"1.82 - echo "*** to the full path to pkg-config."1.83 - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."1.84 - else1.85 - PKG_CONFIG_MIN_VERSION=0.9.01.86 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then1.87 - AC_MSG_CHECKING(for $2)1.89 - if $PKG_CONFIG --exists "$2" ; then1.90 - AC_MSG_RESULT(yes)1.91 - succeeded=yes1.92 +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])1.93 +# ---------------------------------------------1.94 +m4_define([_PKG_CONFIG],1.95 +[if test -n "$PKG_CONFIG"; then1.96 + if test -n "$$1"; then1.97 + pkg_cv_[]$1="$$1"1.98 + else1.99 + PKG_CHECK_EXISTS([$3],1.100 + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],1.101 + [pkg_failed=yes])1.102 + fi1.103 +else1.104 + pkg_failed=untried1.105 +fi[]dnl1.106 +])# _PKG_CONFIG1.108 - AC_MSG_CHECKING($1_CFLAGS)1.109 - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`1.110 - AC_MSG_RESULT($$1_CFLAGS)1.111 +# _PKG_SHORT_ERRORS_SUPPORTED1.112 +# -----------------------------1.113 +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],1.114 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])1.115 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then1.116 + _pkg_short_errors_supported=yes1.117 +else1.118 + _pkg_short_errors_supported=no1.119 +fi[]dnl1.120 +])# _PKG_SHORT_ERRORS_SUPPORTED1.122 - AC_MSG_CHECKING($1_LIBS)1.123 - $1_LIBS=`$PKG_CONFIG --libs "$2"`1.124 - AC_MSG_RESULT($$1_LIBS)1.125 - else1.126 - $1_CFLAGS=""1.127 - $1_LIBS=""1.128 - ## If we have a custom action on failure, don't print errors, but1.129 - ## do set a variable so people can do so.1.130 - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`1.131 - ifelse([$4], ,echo $$1_PKG_ERRORS,)1.132 +1.133 +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],1.134 +# [ACTION-IF-NOT-FOUND])1.135 +#1.136 +#1.137 +# Note that if there is a possibility the first call to1.138 +# PKG_CHECK_MODULES might not happen, you should be sure to include an1.139 +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac1.140 +#1.141 +#1.142 +# --------------------------------------------------------------1.143 +AC_DEFUN([PKG_CHECK_MODULES],1.144 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl1.145 +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl1.146 +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl1.147 +1.148 +pkg_failed=no1.149 +AC_MSG_CHECKING([for $1])1.150 +1.151 +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])1.152 +_PKG_CONFIG([$1][_LIBS], [libs], [$2])1.153 +1.154 +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS1.155 +and $1[]_LIBS to avoid the need to call pkg-config.1.156 +See the pkg-config man page for more details.])1.157 +1.158 +if test $pkg_failed = yes; then1.159 + _PKG_SHORT_ERRORS_SUPPORTED1.160 + if test $_pkg_short_errors_supported = yes; then1.161 + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`1.162 + else1.163 + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`1.164 fi1.165 + # Put the nasty error message in config.log where it belongs1.166 + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD1.168 - AC_SUBST($1_CFLAGS)1.169 - AC_SUBST($1_LIBS)1.170 - else1.171 - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."1.172 - echo "*** See http://www.freedesktop.org/software/pkgconfig"1.173 - fi1.174 - fi1.175 + ifelse([$4], , [AC_MSG_ERROR(dnl1.176 +[Package requirements ($2) were not met:1.178 - if test $succeeded = yes; then1.179 - ifelse([$3], , :, [$3])1.180 - else1.181 - 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])1.182 - fi1.183 -])1.184 +$$1_PKG_ERRORS1.186 +Consider adjusting the PKG_CONFIG_PATH environment variable if you1.187 +installed software in a non-standard prefix.1.189 +_PKG_TEXT1.190 +])],1.191 + [$4])1.192 +elif test $pkg_failed = untried; then1.193 + ifelse([$4], , [AC_MSG_FAILURE(dnl1.194 +[The pkg-config script could not be found or is too old. Make sure it1.195 +is in your PATH or set the PKG_CONFIG environment variable to the full1.196 +path to pkg-config.1.197 +1.198 +_PKG_TEXT1.199 +1.200 +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],1.201 + [$4])1.202 +else1.203 + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS1.204 + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS1.205 + AC_MSG_RESULT([yes])1.206 + ifelse([$3], , :, [$3])1.207 +fi[]dnl1.208 +])# PKG_CHECK_MODULES1.210 # Copyright (C) 1995-2002 Free Software Foundation, Inc.1.211 # Copyright (C) 2001-2003,2004 Red Hat, Inc.
.