annotate src/libsndfile-1.0.25/M4/extra_pkg.m4 @ 88:fe7c3a0b0259

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