Mercurial > hg > octave-nkf
annotate m4/pkg.m4 @ 20827:e54ecb33727e
lo-array-gripes.cc: Remove FIXME's related to buffer size.
* lo-array-gripes.cc: Remove FIXME's related to buffer size. Shorten sprintf
buffers from 100 to 64 characters (still well more than 19 required).
Use 'const' decorator on constant value for clarity. Remove extra space
between variable and array bracket.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 12 Oct 2015 21:13:47 -0700 |
parents | 4b82664f526b |
children |
rev | line source |
---|---|
15360
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
1 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
2 # |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
3 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
4 # |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
5 # This program is free software; you can redistribute it and/or modify |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
6 # it under the terms of the GNU General Public License as published by |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
7 # the Free Software Foundation; either version 2 of the License, or |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
8 # (at your option) any later version. |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
9 # |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
10 # This program is distributed in the hope that it will be useful, but |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
11 # WITHOUT ANY WARRANTY; without even the implied warranty of |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
13 # General Public License for more details. |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
14 # |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
15 # You should have received a copy of the GNU General Public License |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
16 # along with this program; if not, write to the Free Software |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
18 # |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
19 # As a special exception to the GNU General Public License, if you |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
20 # distribute this file as part of a program that contains a |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
21 # configuration script generated by Autoconf, you may include it under |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
22 # the same distribution terms that you use for the rest of that program. |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
23 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
24 # PKG_PROG_PKG_CONFIG([MIN-VERSION]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
25 # ---------------------------------- |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
26 AC_DEFUN([PKG_PROG_PKG_CONFIG], |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
27 [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
28 m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
29 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
30 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
31 AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
32 fi |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
33 if test -n "$PKG_CONFIG"; then |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
34 _pkg_min_version=m4_default([$1], [0.9.0]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
35 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
36 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
37 AC_MSG_RESULT([yes]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
38 else |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
39 AC_MSG_RESULT([no]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
40 PKG_CONFIG="" |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
41 fi |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
42 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
43 fi[]dnl |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
44 ])# PKG_PROG_PKG_CONFIG |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
45 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
46 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
47 # |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
48 # Check to see whether a particular set of modules exists. Similar |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
49 # to PKG_CHECK_MODULES(), but does not set variables or print errors. |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
50 # |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
51 # |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
52 # Similar to PKG_CHECK_MODULES, make sure that the first instance of |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
53 # this or PKG_CHECK_MODULES is called, or make sure to call |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
54 # PKG_CHECK_EXISTS manually |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
55 # -------------------------------------------------------------- |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
56 AC_DEFUN([PKG_CHECK_EXISTS], |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
57 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
58 if test -n "$PKG_CONFIG" && \ |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
59 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
60 m4_ifval([$2], [$2], [:]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
61 m4_ifvaln([$3], [else |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
62 $3])dnl |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
63 fi]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
64 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
65 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
66 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
67 # --------------------------------------------- |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
68 m4_define([_PKG_CONFIG], |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
69 [if test -n "$PKG_CONFIG"; then |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
70 if test -n "$$1"; then |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
71 pkg_cv_[]$1="$$1" |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
72 else |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
73 PKG_CHECK_EXISTS([$3], |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
74 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
75 [pkg_failed=yes]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
76 fi |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
77 else |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
78 pkg_failed=untried |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
79 fi[]dnl |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
80 ])# _PKG_CONFIG |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
81 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
82 # _PKG_SHORT_ERRORS_SUPPORTED |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
83 # ----------------------------- |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
84 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
85 [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
86 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
87 _pkg_short_errors_supported=yes |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
88 else |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
89 _pkg_short_errors_supported=no |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
90 fi[]dnl |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
91 ])# _PKG_SHORT_ERRORS_SUPPORTED |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
92 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
93 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
94 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
95 # [ACTION-IF-NOT-FOUND]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
96 # |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
97 # |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
98 # Note that if there is a possibility the first call to |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
99 # PKG_CHECK_MODULES might not happen, you should be sure to include an |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
100 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
101 # |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
102 # |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
103 # -------------------------------------------------------------- |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
104 AC_DEFUN([PKG_CHECK_MODULES], |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
105 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
106 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
107 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
108 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
109 pkg_failed=no |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
110 AC_MSG_CHECKING([for $1]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
111 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
112 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
113 _PKG_CONFIG([$1][_LIBS], [libs], [$2]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
114 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
115 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
116 and $1[]_LIBS to avoid the need to call pkg-config. |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
117 See the pkg-config man page for more details.]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
118 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
119 if test $pkg_failed = yes; then |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
120 _PKG_SHORT_ERRORS_SUPPORTED |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
121 if test $_pkg_short_errors_supported = yes; then |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
122 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
123 else |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
124 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
125 fi |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
126 # Put the nasty error message in config.log where it belongs |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
127 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
128 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
129 ifelse([$4], , [AC_MSG_ERROR(dnl |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
130 [Package requirements ($2) were not met: |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
131 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
132 $$1_PKG_ERRORS |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
133 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
134 Consider adjusting the PKG_CONFIG_PATH environment variable if you |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
135 installed software in a non-standard prefix. |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
136 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
137 _PKG_TEXT |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
138 ])], |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
139 [AC_MSG_RESULT([no]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
140 $4]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
141 elif test $pkg_failed = untried; then |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
142 ifelse([$4], , [AC_MSG_FAILURE(dnl |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
143 [The pkg-config script could not be found or is too old. Make sure it |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
144 is in your PATH or set the PKG_CONFIG environment variable to the full |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
145 path to pkg-config. |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
146 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
147 _PKG_TEXT |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
148 |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
149 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
150 [$4]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
151 else |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
152 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
153 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
154 AC_MSG_RESULT([yes]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
155 ifelse([$3], , :, [$3]) |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
156 fi[]dnl |
4b82664f526b
build: Move non-Octave Autoconf pkg macros from acinclude.m4 to a separate file.
Rik <rik@octave.org>
parents:
diff
changeset
|
157 ])# PKG_CHECK_MODULES |