26 | 26 |
dnl gives unlimited permission to copy and/or distribute it,
|
27 | 27 |
dnl with or without modifications, as long as this notice is preserved.
|
28 | 28 |
dnl
|
29 | |
dnl This file can can be used in projects which are not available under
|
|
29 |
dnl This file can be used in projects which are not available under
|
30 | 30 |
dnl the GNU General Public License or the GNU Library General Public
|
31 | 31 |
dnl License but which still want to provide support for the GNU gettext
|
32 | 32 |
dnl functionality.
|
33 | 33 |
dnl Please note that the actual code of the GNU gettext library is covered
|
34 | 34 |
dnl by the GNU Library General Public License, and the rest of the GNU
|
35 | |
dnl gettext package package is covered by the GNU General Public License.
|
|
35 |
dnl gettext package is covered by the GNU General Public License.
|
36 | 36 |
dnl They are *not* in the public domain.
|
37 | 37 |
|
38 | 38 |
dnl Authors:
|
|
52 | 52 |
AC_SUBST([USE_NLS])
|
53 | 53 |
])
|
54 | 54 |
|
55 | |
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
56 | |
# serial 1 (pkg-config-0.24)
|
57 | |
#
|
58 | |
# Copyright © 2004 Scott James Remnant <[email protected]>.
|
59 | |
#
|
60 | |
# This program is free software; you can redistribute it and/or modify
|
61 | |
# it under the terms of the GNU General Public License as published by
|
62 | |
# the Free Software Foundation; either version 2 of the License, or
|
63 | |
# (at your option) any later version.
|
64 | |
#
|
65 | |
# This program is distributed in the hope that it will be useful, but
|
66 | |
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
67 | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
68 | |
# General Public License for more details.
|
69 | |
#
|
70 | |
# You should have received a copy of the GNU General Public License
|
71 | |
# along with this program; if not, write to the Free Software
|
72 | |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
73 | |
#
|
74 | |
# As a special exception to the GNU General Public License, if you
|
75 | |
# distribute this file as part of a program that contains a
|
76 | |
# configuration script generated by Autoconf, you may include it under
|
77 | |
# the same distribution terms that you use for the rest of that program.
|
78 | |
|
79 | |
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
80 | |
# ----------------------------------
|
|
55 |
dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
|
56 |
dnl serial 11 (pkg-config-0.29)
|
|
57 |
dnl
|
|
58 |
dnl Copyright © 2004 Scott James Remnant <[email protected]>.
|
|
59 |
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
|
|
60 |
dnl
|
|
61 |
dnl This program is free software; you can redistribute it and/or modify
|
|
62 |
dnl it under the terms of the GNU General Public License as published by
|
|
63 |
dnl the Free Software Foundation; either version 2 of the License, or
|
|
64 |
dnl (at your option) any later version.
|
|
65 |
dnl
|
|
66 |
dnl This program is distributed in the hope that it will be useful, but
|
|
67 |
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
68 |
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
69 |
dnl General Public License for more details.
|
|
70 |
dnl
|
|
71 |
dnl You should have received a copy of the GNU General Public License
|
|
72 |
dnl along with this program; if not, write to the Free Software
|
|
73 |
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
74 |
dnl 02111-1307, USA.
|
|
75 |
dnl
|
|
76 |
dnl As a special exception to the GNU General Public License, if you
|
|
77 |
dnl distribute this file as part of a program that contains a
|
|
78 |
dnl configuration script generated by Autoconf, you may include it under
|
|
79 |
dnl the same distribution terms that you use for the rest of that
|
|
80 |
dnl program.
|
|
81 |
|
|
82 |
dnl PKG_PREREQ(MIN-VERSION)
|
|
83 |
dnl -----------------------
|
|
84 |
dnl Since: 0.29
|
|
85 |
dnl
|
|
86 |
dnl Verify that the version of the pkg-config macros are at least
|
|
87 |
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
|
|
88 |
dnl installed version of pkg-config, this checks the developer's version
|
|
89 |
dnl of pkg.m4 when generating configure.
|
|
90 |
dnl
|
|
91 |
dnl To ensure that this macro is defined, also add:
|
|
92 |
dnl m4_ifndef([PKG_PREREQ],
|
|
93 |
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
|
|
94 |
dnl
|
|
95 |
dnl See the "Since" comment for each macro you use to see what version
|
|
96 |
dnl of the macros you require.
|
|
97 |
m4_defun([PKG_PREREQ],
|
|
98 |
[m4_define([PKG_MACROS_VERSION], [0.29])
|
|
99 |
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
|
|
100 |
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
|
|
101 |
])dnl PKG_PREREQ
|
|
102 |
|
|
103 |
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
|
104 |
dnl ----------------------------------
|
|
105 |
dnl Since: 0.16
|
|
106 |
dnl
|
|
107 |
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
|
|
108 |
dnl first found in the path. Checks that the version of pkg-config found
|
|
109 |
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
|
|
110 |
dnl used since that's the first version where most current features of
|
|
111 |
dnl pkg-config existed.
|
81 | 112 |
AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
82 | 113 |
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
83 | 114 |
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
|
|
99 | 130 |
PKG_CONFIG=""
|
100 | 131 |
fi
|
101 | 132 |
fi[]dnl
|
102 | |
])# PKG_PROG_PKG_CONFIG
|
103 | |
|
104 | |
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
105 | |
#
|
106 | |
# Check to see whether a particular set of modules exists. Similar
|
107 | |
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
108 | |
#
|
109 | |
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
110 | |
# only at the first occurence in configure.ac, so if the first place
|
111 | |
# it's called might be skipped (such as if it is within an "if", you
|
112 | |
# have to call PKG_CHECK_EXISTS manually
|
113 | |
# --------------------------------------------------------------
|
|
133 |
])dnl PKG_PROG_PKG_CONFIG
|
|
134 |
|
|
135 |
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
|
136 |
dnl -------------------------------------------------------------------
|
|
137 |
dnl Since: 0.18
|
|
138 |
dnl
|
|
139 |
dnl Check to see whether a particular set of modules exists. Similar to
|
|
140 |
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
|
|
141 |
dnl
|
|
142 |
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
|
143 |
dnl only at the first occurence in configure.ac, so if the first place
|
|
144 |
dnl it's called might be skipped (such as if it is within an "if", you
|
|
145 |
dnl have to call PKG_CHECK_EXISTS manually
|
114 | 146 |
AC_DEFUN([PKG_CHECK_EXISTS],
|
115 | 147 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
116 | 148 |
if test -n "$PKG_CONFIG" && \
|
|
120 | 152 |
$3])dnl
|
121 | 153 |
fi])
|
122 | 154 |
|
123 | |
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
124 | |
# ---------------------------------------------
|
|
155 |
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
|
156 |
dnl ---------------------------------------------
|
|
157 |
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
|
|
158 |
dnl pkg_failed based on the result.
|
125 | 159 |
m4_define([_PKG_CONFIG],
|
126 | 160 |
[if test -n "$$1"; then
|
127 | 161 |
pkg_cv_[]$1="$$1"
|
|
133 | 167 |
else
|
134 | 168 |
pkg_failed=untried
|
135 | 169 |
fi[]dnl
|
136 | |
])# _PKG_CONFIG
|
137 | |
|
138 | |
# _PKG_SHORT_ERRORS_SUPPORTED
|
139 | |
# -----------------------------
|
|
170 |
])dnl _PKG_CONFIG
|
|
171 |
|
|
172 |
dnl _PKG_SHORT_ERRORS_SUPPORTED
|
|
173 |
dnl ---------------------------
|
|
174 |
dnl Internal check to see if pkg-config supports short errors.
|
140 | 175 |
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
141 | 176 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
142 | 177 |
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
|
144 | 179 |
else
|
145 | 180 |
_pkg_short_errors_supported=no
|
146 | 181 |
fi[]dnl
|
147 | |
])# _PKG_SHORT_ERRORS_SUPPORTED
|
148 | |
|
149 | |
|
150 | |
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
151 | |
# [ACTION-IF-NOT-FOUND])
|
152 | |
#
|
153 | |
#
|
154 | |
# Note that if there is a possibility the first call to
|
155 | |
# PKG_CHECK_MODULES might not happen, you should be sure to include an
|
156 | |
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
157 | |
#
|
158 | |
#
|
159 | |
# --------------------------------------------------------------
|
|
182 |
])dnl _PKG_SHORT_ERRORS_SUPPORTED
|
|
183 |
|
|
184 |
|
|
185 |
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
|
186 |
dnl [ACTION-IF-NOT-FOUND])
|
|
187 |
dnl --------------------------------------------------------------
|
|
188 |
dnl Since: 0.4.0
|
|
189 |
dnl
|
|
190 |
dnl Note that if there is a possibility the first call to
|
|
191 |
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
|
|
192 |
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
160 | 193 |
AC_DEFUN([PKG_CHECK_MODULES],
|
161 | 194 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
162 | 195 |
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
|
210 | 243 |
AC_MSG_RESULT([yes])
|
211 | 244 |
$3
|
212 | 245 |
fi[]dnl
|
213 | |
])# PKG_CHECK_MODULES
|
214 | |
|
215 | |
|
216 | |
# PKG_INSTALLDIR(DIRECTORY)
|
217 | |
# -------------------------
|
218 | |
# Substitutes the variable pkgconfigdir as the location where a module
|
219 | |
# should install pkg-config .pc files. By default the directory is
|
220 | |
# $libdir/pkgconfig, but the default can be changed by passing
|
221 | |
# DIRECTORY. The user can override through the --with-pkgconfigdir
|
222 | |
# parameter.
|
|
246 |
])dnl PKG_CHECK_MODULES
|
|
247 |
|
|
248 |
|
|
249 |
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
|
250 |
dnl [ACTION-IF-NOT-FOUND])
|
|
251 |
dnl ---------------------------------------------------------------------
|
|
252 |
dnl Since: 0.29
|
|
253 |
dnl
|
|
254 |
dnl Checks for existence of MODULES and gathers its build flags with
|
|
255 |
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
|
|
256 |
dnl and VARIABLE-PREFIX_LIBS from --libs.
|
|
257 |
dnl
|
|
258 |
dnl Note that if there is a possibility the first call to
|
|
259 |
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
|
|
260 |
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
|
|
261 |
dnl configure.ac.
|
|
262 |
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
|
|
263 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
|
264 |
_save_PKG_CONFIG=$PKG_CONFIG
|
|
265 |
PKG_CONFIG="$PKG_CONFIG --static"
|
|
266 |
PKG_CHECK_MODULES($@)
|
|
267 |
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
|
|
268 |
])dnl PKG_CHECK_MODULES_STATIC
|
|
269 |
|
|
270 |
|
|
271 |
dnl PKG_INSTALLDIR([DIRECTORY])
|
|
272 |
dnl -------------------------
|
|
273 |
dnl Since: 0.27
|
|
274 |
dnl
|
|
275 |
dnl Substitutes the variable pkgconfigdir as the location where a module
|
|
276 |
dnl should install pkg-config .pc files. By default the directory is
|
|
277 |
dnl $libdir/pkgconfig, but the default can be changed by passing
|
|
278 |
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
|
|
279 |
dnl parameter.
|
223 | 280 |
AC_DEFUN([PKG_INSTALLDIR],
|
224 | 281 |
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
|
225 | 282 |
m4_pushdef([pkg_description],
|
|
230 | 287 |
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
|
231 | 288 |
m4_popdef([pkg_default])
|
232 | 289 |
m4_popdef([pkg_description])
|
233 | |
]) dnl PKG_INSTALLDIR
|
234 | |
|
235 | |
|
236 | |
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
|
237 | |
# -------------------------
|
238 | |
# Substitutes the variable noarch_pkgconfigdir as the location where a
|
239 | |
# module should install arch-independent pkg-config .pc files. By
|
240 | |
# default the directory is $datadir/pkgconfig, but the default can be
|
241 | |
# changed by passing DIRECTORY. The user can override through the
|
242 | |
# --with-noarch-pkgconfigdir parameter.
|
|
290 |
])dnl PKG_INSTALLDIR
|
|
291 |
|
|
292 |
|
|
293 |
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
|
|
294 |
dnl --------------------------------
|
|
295 |
dnl Since: 0.27
|
|
296 |
dnl
|
|
297 |
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
|
|
298 |
dnl module should install arch-independent pkg-config .pc files. By
|
|
299 |
dnl default the directory is $datadir/pkgconfig, but the default can be
|
|
300 |
dnl changed by passing DIRECTORY. The user can override through the
|
|
301 |
dnl --with-noarch-pkgconfigdir parameter.
|
243 | 302 |
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
|
244 | 303 |
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
|
245 | 304 |
m4_pushdef([pkg_description],
|
|
250 | 309 |
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
|
251 | 310 |
m4_popdef([pkg_default])
|
252 | 311 |
m4_popdef([pkg_description])
|
253 | |
]) dnl PKG_NOARCH_INSTALLDIR
|
254 | |
|
255 | |
|
256 | |
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
|
257 | |
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
258 | |
# -------------------------------------------
|
259 | |
# Retrieves the value of the pkg-config variable for the given module.
|
|
312 |
])dnl PKG_NOARCH_INSTALLDIR
|
|
313 |
|
|
314 |
|
|
315 |
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
|
|
316 |
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
|
317 |
dnl -------------------------------------------
|
|
318 |
dnl Since: 0.28
|
|
319 |
dnl
|
|
320 |
dnl Retrieves the value of the pkg-config variable for the given module.
|
260 | 321 |
AC_DEFUN([PKG_CHECK_VAR],
|
261 | 322 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
262 | 323 |
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
|
|
265 | 326 |
AS_VAR_COPY([$1], [pkg_cv_][$1])
|
266 | 327 |
|
267 | 328 |
AS_VAR_IF([$1], [""], [$5], [$4])dnl
|
268 | |
])# PKG_CHECK_VAR
|
|
329 |
])dnl PKG_CHECK_VAR
|
269 | 330 |
|
270 | 331 |
dnl GLIB_GSETTINGS
|
271 | 332 |
dnl Defines GSETTINGS_SCHEMAS_INSTALL which controls whether
|