Search
lxdream.org :: lxdream/aclocal.m4 :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename aclocal.m4
changeset 180:e6dcf9b65658
prev10:c898b37506e0
next360:dff4a3bbac0c
author nkeynes
date Sun Jul 02 04:59:00 2006 +0000 (13 years ago)
permissions -rw-r--r--
last change Merge changes made on the MILESTONE1 branch back into head (mostly
release touchups)
file annotate diff log raw
1.1 --- a/aclocal.m4 Sun Dec 11 05:15:36 2005 +0000
1.2 +++ b/aclocal.m4 Sun Jul 02 04:59:00 2006 +0000
1.3 @@ -1033,63 +1033,162 @@
1.4
1.5 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
1.6
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 modify
1.12 +# it under the terms of the GNU General Public License as published by
1.13 +# the Free Software Foundation; either version 2 of the License, or
1.14 +# (at your option) any later version.
1.15 +#
1.16 +# This program is distributed in the hope that it will be useful, but
1.17 +# WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1.19 +# General Public License for more details.
1.20 +#
1.21 +# You should have received a copy of the GNU General Public License
1.22 +# along with this program; if not, write to the Free Software
1.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 you
1.26 +# distribute this file as part of a program that contains a
1.27 +# configuration script generated by Autoconf, you may include it under
1.28 +# the same distribution terms that you use for the rest of that program.
1.29
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 page
1.32 -dnl also defines GSTUFF_PKG_ERRORS on error
1.33 -AC_DEFUN(PKG_CHECK_MODULES, [
1.34 - succeeded=no
1.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])dnl
1.41 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1.42 + AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1.43 +fi
1.44 +if test -n "$PKG_CONFIG"; then
1.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; then
1.48 + AC_MSG_RESULT([yes])
1.49 + else
1.50 + AC_MSG_RESULT([no])
1.51 + PKG_CONFIG=""
1.52 + fi
1.53 +
1.54 +fi[]dnl
1.55 +])# PKG_PROG_PKG_CONFIG
1.56
1.57 - if test -z "$PKG_CONFIG"; then
1.58 - AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1.59 - fi
1.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. Similar
1.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 of
1.67 +# this or PKG_CHECK_MODULES is called, or make sure to call
1.68 +# PKG_CHECK_EXISTS manually
1.69 +# --------------------------------------------------------------
1.70 +AC_DEFUN([PKG_CHECK_EXISTS],
1.71 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1.72 +if test -n "$PKG_CONFIG" && \
1.73 + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1.74 + m4_ifval([$2], [$2], [:])
1.75 +m4_ifvaln([$3], [else
1.76 + $3])dnl
1.77 +fi])
1.78
1.79 - if test "$PKG_CONFIG" = "no" ; then
1.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 - else
1.85 - PKG_CONFIG_MIN_VERSION=0.9.0
1.86 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
1.87 - AC_MSG_CHECKING(for $2)
1.88
1.89 - if $PKG_CONFIG --exists "$2" ; then
1.90 - AC_MSG_RESULT(yes)
1.91 - succeeded=yes
1.92 +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1.93 +# ---------------------------------------------
1.94 +m4_define([_PKG_CONFIG],
1.95 +[if test -n "$PKG_CONFIG"; then
1.96 + if test -n "$$1"; then
1.97 + pkg_cv_[]$1="$$1"
1.98 + else
1.99 + PKG_CHECK_EXISTS([$3],
1.100 + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1.101 + [pkg_failed=yes])
1.102 + fi
1.103 +else
1.104 + pkg_failed=untried
1.105 +fi[]dnl
1.106 +])# _PKG_CONFIG
1.107
1.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_SUPPORTED
1.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; then
1.116 + _pkg_short_errors_supported=yes
1.117 +else
1.118 + _pkg_short_errors_supported=no
1.119 +fi[]dnl
1.120 +])# _PKG_SHORT_ERRORS_SUPPORTED
1.121
1.122 - AC_MSG_CHECKING($1_LIBS)
1.123 - $1_LIBS=`$PKG_CONFIG --libs "$2"`
1.124 - AC_MSG_RESULT($$1_LIBS)
1.125 - else
1.126 - $1_CFLAGS=""
1.127 - $1_LIBS=""
1.128 - ## If we have a custom action on failure, don't print errors, but
1.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 to
1.138 +# PKG_CHECK_MODULES might not happen, you should be sure to include an
1.139 +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1.140 +#
1.141 +#
1.142 +# --------------------------------------------------------------
1.143 +AC_DEFUN([PKG_CHECK_MODULES],
1.144 +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1.145 +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1.146 +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1.147 +
1.148 +pkg_failed=no
1.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[]_CFLAGS
1.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; then
1.159 + _PKG_SHORT_ERRORS_SUPPORTED
1.160 + if test $_pkg_short_errors_supported = yes; then
1.161 + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
1.162 + else
1.163 + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1.164 fi
1.165 + # Put the nasty error message in config.log where it belongs
1.166 + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1.167
1.168 - AC_SUBST($1_CFLAGS)
1.169 - AC_SUBST($1_LIBS)
1.170 - else
1.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 - fi
1.174 - fi
1.175 + ifelse([$4], , [AC_MSG_ERROR(dnl
1.176 +[Package requirements ($2) were not met:
1.177
1.178 - if test $succeeded = yes; then
1.179 - ifelse([$3], , :, [$3])
1.180 - else
1.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 - fi
1.183 -])
1.184 +$$1_PKG_ERRORS
1.185
1.186 +Consider adjusting the PKG_CONFIG_PATH environment variable if you
1.187 +installed software in a non-standard prefix.
1.188
1.189 +_PKG_TEXT
1.190 +])],
1.191 + [$4])
1.192 +elif test $pkg_failed = untried; then
1.193 + ifelse([$4], , [AC_MSG_FAILURE(dnl
1.194 +[The pkg-config script could not be found or is too old. Make sure it
1.195 +is in your PATH or set the PKG_CONFIG environment variable to the full
1.196 +path to pkg-config.
1.197 +
1.198 +_PKG_TEXT
1.199 +
1.200 +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
1.201 + [$4])
1.202 +else
1.203 + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1.204 + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1.205 + AC_MSG_RESULT([yes])
1.206 + ifelse([$3], , :, [$3])
1.207 +fi[]dnl
1.208 +])# PKG_CHECK_MODULES
1.209
1.210 # Copyright (C) 1995-2002 Free Software Foundation, Inc.
1.211 # Copyright (C) 2001-2003,2004 Red Hat, Inc.
.