annotate src/libsndfile-1.0.25/M4/extra_pkg.m4 @ 0:c7265573341e

Import initial set of sources
author Chris Cannam
date Mon, 18 Mar 2013 14:12:14 +0000
parents
children
rev   line source
Chris@0 1 # extra_pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
Chris@0 2 #
Chris@0 3 # Copyright (c) 2004 Scott James Remnant <scott@netsplit.com>.
Chris@0 4 #
Chris@0 5 # This program is free software; you can redistribute it and/or modify
Chris@0 6 # it under the terms of the GNU General Public License as published by
Chris@0 7 # the Free Software Foundation; either version 2 of the License, or
Chris@0 8 # (at your option) any later version.
Chris@0 9 #
Chris@0 10 # This program is distributed in the hope that it will be useful, but
Chris@0 11 # WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@0 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Chris@0 13 # General Public License for more details.
Chris@0 14 #
Chris@0 15 # You should have received a copy of the GNU General Public License
Chris@0 16 # along with this program; if not, write to the Free Software
Chris@0 17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Chris@0 18 #
Chris@0 19 # As a special exception to the GNU General Public License, if you
Chris@0 20 # distribute this file as part of a program that contains a
Chris@0 21 # configuration script generated by Autoconf, you may include it under
Chris@0 22 # the same distribution terms that you use for the rest of that program.
Chris@0 23
Chris@0 24 # --------------------------------------------------------------
Chris@0 25 # PKG_CHECK_MOD_VERSION(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
Chris@0 26 # [ACTION-IF-NOT-FOUND])
Chris@0 27 #
Chris@0 28 # This is a very slight modification to the macro PKG_CHECK_MODULES that
Chris@0 29 # is in the original pkg.m4 file. It prints the versions in the checking
Chris@0 30 # message (erikd@mega-nerd.com).
Chris@0 31
Chris@0 32 AC_DEFUN([PKG_CHECK_MOD_VERSION],
Chris@0 33 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
Chris@0 34 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
Chris@0 35 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
Chris@0 36
Chris@0 37 pkg_failed=no
Chris@0 38 AC_MSG_CHECKING([for $2 ])
Chris@0 39
Chris@0 40 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
Chris@0 41 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
Chris@0 42
Chris@0 43 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
Chris@0 44 and $1[]_LIBS to avoid the need to call pkg-config.
Chris@0 45 See the pkg-config man page for more details.])
Chris@0 46
Chris@0 47 if test $pkg_failed = yes; then
Chris@0 48 _PKG_SHORT_ERRORS_SUPPORTED
Chris@0 49 if test $_pkg_short_errors_supported = yes; then
Chris@0 50 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
Chris@0 51 else
Chris@0 52 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
Chris@0 53 fi
Chris@0 54 # Put the nasty error message in config.log where it belongs
Chris@0 55 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
Chris@0 56
Chris@0 57 ifelse([$4], , [AC_MSG_ERROR(dnl
Chris@0 58 [Package requirements ($2) were not met:
Chris@0 59
Chris@0 60 $$1_PKG_ERRORS
Chris@0 61
Chris@0 62 Consider adjusting the PKG_CONFIG_PATH environment variable if you
Chris@0 63 installed software in a non-standard prefix.
Chris@0 64
Chris@0 65 _PKG_TEXT
Chris@0 66 ])],
Chris@0 67 [AC_MSG_RESULT([no])
Chris@0 68 $4])
Chris@0 69 elif test $pkg_failed = untried; then
Chris@0 70 ifelse([$4], , [AC_MSG_FAILURE(dnl
Chris@0 71 [The pkg-config script could not be found or is too old. Make sure it
Chris@0 72 is in your PATH or set the PKG_CONFIG environment variable to the full
Chris@0 73 path to pkg-config.
Chris@0 74
Chris@0 75 _PKG_TEXT
Chris@0 76
Chris@0 77 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
Chris@0 78 [$4])
Chris@0 79 else
Chris@0 80 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
Chris@0 81 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
Chris@0 82 AC_MSG_RESULT([yes])
Chris@0 83 ifelse([$3], , :, [$3])
Chris@0 84 fi[]dnl
Chris@0 85 ])# PKG_CHECK_MOD_VERSION