xref: /netbsd-src/external/bsd/nsd/dist/aclocal.m4 (revision ee75899804fc815b722d4dff05164c608f88c7d5)
1*ee758998Schristos# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
2*ee758998Schristos
3*ee758998Schristos# Copyright (C) 1996-2020 Free Software Foundation, Inc.
4*ee758998Schristos
5*ee758998Schristos# This file is free software; the Free Software Foundation
6*ee758998Schristos# gives unlimited permission to copy and/or distribute it,
7*ee758998Schristos# with or without modifications, as long as this notice is preserved.
8*ee758998Schristos
9*ee758998Schristos# This program is distributed in the hope that it will be useful,
10*ee758998Schristos# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11*ee758998Schristos# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12*ee758998Schristos# PARTICULAR PURPOSE.
13*ee758998Schristos
14*ee758998Schristosm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15*ee758998Schristos# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
16*ee758998Schristos# serial 11 (pkg-config-0.29.1)
17*ee758998Schristos
18*ee758998Schristosdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
19*ee758998Schristosdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
20*ee758998Schristosdnl
21*ee758998Schristosdnl This program is free software; you can redistribute it and/or modify
22*ee758998Schristosdnl it under the terms of the GNU General Public License as published by
23*ee758998Schristosdnl the Free Software Foundation; either version 2 of the License, or
24*ee758998Schristosdnl (at your option) any later version.
25*ee758998Schristosdnl
26*ee758998Schristosdnl This program is distributed in the hope that it will be useful, but
27*ee758998Schristosdnl WITHOUT ANY WARRANTY; without even the implied warranty of
28*ee758998Schristosdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29*ee758998Schristosdnl General Public License for more details.
30*ee758998Schristosdnl
31*ee758998Schristosdnl You should have received a copy of the GNU General Public License
32*ee758998Schristosdnl along with this program; if not, write to the Free Software
33*ee758998Schristosdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
34*ee758998Schristosdnl 02111-1307, USA.
35*ee758998Schristosdnl
36*ee758998Schristosdnl As a special exception to the GNU General Public License, if you
37*ee758998Schristosdnl distribute this file as part of a program that contains a
38*ee758998Schristosdnl configuration script generated by Autoconf, you may include it under
39*ee758998Schristosdnl the same distribution terms that you use for the rest of that
40*ee758998Schristosdnl program.
41*ee758998Schristos
42*ee758998Schristosdnl PKG_PREREQ(MIN-VERSION)
43*ee758998Schristosdnl -----------------------
44*ee758998Schristosdnl Since: 0.29
45*ee758998Schristosdnl
46*ee758998Schristosdnl Verify that the version of the pkg-config macros are at least
47*ee758998Schristosdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
48*ee758998Schristosdnl installed version of pkg-config, this checks the developer's version
49*ee758998Schristosdnl of pkg.m4 when generating configure.
50*ee758998Schristosdnl
51*ee758998Schristosdnl To ensure that this macro is defined, also add:
52*ee758998Schristosdnl m4_ifndef([PKG_PREREQ],
53*ee758998Schristosdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
54*ee758998Schristosdnl
55*ee758998Schristosdnl See the "Since" comment for each macro you use to see what version
56*ee758998Schristosdnl of the macros you require.
57*ee758998Schristosm4_defun([PKG_PREREQ],
58*ee758998Schristos[m4_define([PKG_MACROS_VERSION], [0.29.1])
59*ee758998Schristosm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
60*ee758998Schristos    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
61*ee758998Schristos])dnl PKG_PREREQ
62*ee758998Schristos
63*ee758998Schristosdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
64*ee758998Schristosdnl ----------------------------------
65*ee758998Schristosdnl Since: 0.16
66*ee758998Schristosdnl
67*ee758998Schristosdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
68*ee758998Schristosdnl first found in the path. Checks that the version of pkg-config found
69*ee758998Schristosdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
70*ee758998Schristosdnl used since that's the first version where most current features of
71*ee758998Schristosdnl pkg-config existed.
72*ee758998SchristosAC_DEFUN([PKG_PROG_PKG_CONFIG],
73*ee758998Schristos[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
74*ee758998Schristosm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
75*ee758998Schristosm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
76*ee758998SchristosAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
77*ee758998SchristosAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
78*ee758998SchristosAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
79*ee758998Schristos
80*ee758998Schristosif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
81*ee758998Schristos	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
82*ee758998Schristosfi
83*ee758998Schristosif test -n "$PKG_CONFIG"; then
84*ee758998Schristos	_pkg_min_version=m4_default([$1], [0.9.0])
85*ee758998Schristos	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
86*ee758998Schristos	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
87*ee758998Schristos		AC_MSG_RESULT([yes])
88*ee758998Schristos	else
89*ee758998Schristos		AC_MSG_RESULT([no])
90*ee758998Schristos		PKG_CONFIG=""
91*ee758998Schristos	fi
92*ee758998Schristosfi[]dnl
93*ee758998Schristos])dnl PKG_PROG_PKG_CONFIG
94*ee758998Schristos
95*ee758998Schristosdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
96*ee758998Schristosdnl -------------------------------------------------------------------
97*ee758998Schristosdnl Since: 0.18
98*ee758998Schristosdnl
99*ee758998Schristosdnl Check to see whether a particular set of modules exists. Similar to
100*ee758998Schristosdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
101*ee758998Schristosdnl
102*ee758998Schristosdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
103*ee758998Schristosdnl only at the first occurence in configure.ac, so if the first place
104*ee758998Schristosdnl it's called might be skipped (such as if it is within an "if", you
105*ee758998Schristosdnl have to call PKG_CHECK_EXISTS manually
106*ee758998SchristosAC_DEFUN([PKG_CHECK_EXISTS],
107*ee758998Schristos[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
108*ee758998Schristosif test -n "$PKG_CONFIG" && \
109*ee758998Schristos    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
110*ee758998Schristos  m4_default([$2], [:])
111*ee758998Schristosm4_ifvaln([$3], [else
112*ee758998Schristos  $3])dnl
113*ee758998Schristosfi])
114*ee758998Schristos
115*ee758998Schristosdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
116*ee758998Schristosdnl ---------------------------------------------
117*ee758998Schristosdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
118*ee758998Schristosdnl pkg_failed based on the result.
119*ee758998Schristosm4_define([_PKG_CONFIG],
120*ee758998Schristos[if test -n "$$1"; then
121*ee758998Schristos    pkg_cv_[]$1="$$1"
122*ee758998Schristos elif test -n "$PKG_CONFIG"; then
123*ee758998Schristos    PKG_CHECK_EXISTS([$3],
124*ee758998Schristos                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
125*ee758998Schristos		      test "x$?" != "x0" && pkg_failed=yes ],
126*ee758998Schristos		     [pkg_failed=yes])
127*ee758998Schristos else
128*ee758998Schristos    pkg_failed=untried
129*ee758998Schristosfi[]dnl
130*ee758998Schristos])dnl _PKG_CONFIG
131*ee758998Schristos
132*ee758998Schristosdnl _PKG_SHORT_ERRORS_SUPPORTED
133*ee758998Schristosdnl ---------------------------
134*ee758998Schristosdnl Internal check to see if pkg-config supports short errors.
135*ee758998SchristosAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
136*ee758998Schristos[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
137*ee758998Schristosif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
138*ee758998Schristos        _pkg_short_errors_supported=yes
139*ee758998Schristoselse
140*ee758998Schristos        _pkg_short_errors_supported=no
141*ee758998Schristosfi[]dnl
142*ee758998Schristos])dnl _PKG_SHORT_ERRORS_SUPPORTED
143*ee758998Schristos
144*ee758998Schristos
145*ee758998Schristosdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
146*ee758998Schristosdnl   [ACTION-IF-NOT-FOUND])
147*ee758998Schristosdnl --------------------------------------------------------------
148*ee758998Schristosdnl Since: 0.4.0
149*ee758998Schristosdnl
150*ee758998Schristosdnl Note that if there is a possibility the first call to
151*ee758998Schristosdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
152*ee758998Schristosdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
153*ee758998SchristosAC_DEFUN([PKG_CHECK_MODULES],
154*ee758998Schristos[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
155*ee758998SchristosAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
156*ee758998SchristosAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
157*ee758998Schristos
158*ee758998Schristospkg_failed=no
159*ee758998SchristosAC_MSG_CHECKING([for $1])
160*ee758998Schristos
161*ee758998Schristos_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
162*ee758998Schristos_PKG_CONFIG([$1][_LIBS], [libs], [$2])
163*ee758998Schristos
164*ee758998Schristosm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
165*ee758998Schristosand $1[]_LIBS to avoid the need to call pkg-config.
166*ee758998SchristosSee the pkg-config man page for more details.])
167*ee758998Schristos
168*ee758998Schristosif test $pkg_failed = yes; then
169*ee758998Schristos   	AC_MSG_RESULT([no])
170*ee758998Schristos        _PKG_SHORT_ERRORS_SUPPORTED
171*ee758998Schristos        if test $_pkg_short_errors_supported = yes; then
172*ee758998Schristos	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
173*ee758998Schristos        else
174*ee758998Schristos	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
175*ee758998Schristos        fi
176*ee758998Schristos	# Put the nasty error message in config.log where it belongs
177*ee758998Schristos	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
178*ee758998Schristos
179*ee758998Schristos	m4_default([$4], [AC_MSG_ERROR(
180*ee758998Schristos[Package requirements ($2) were not met:
181*ee758998Schristos
182*ee758998Schristos$$1_PKG_ERRORS
183*ee758998Schristos
184*ee758998SchristosConsider adjusting the PKG_CONFIG_PATH environment variable if you
185*ee758998Schristosinstalled software in a non-standard prefix.
186*ee758998Schristos
187*ee758998Schristos_PKG_TEXT])[]dnl
188*ee758998Schristos        ])
189*ee758998Schristoselif test $pkg_failed = untried; then
190*ee758998Schristos     	AC_MSG_RESULT([no])
191*ee758998Schristos	m4_default([$4], [AC_MSG_FAILURE(
192*ee758998Schristos[The pkg-config script could not be found or is too old.  Make sure it
193*ee758998Schristosis in your PATH or set the PKG_CONFIG environment variable to the full
194*ee758998Schristospath to pkg-config.
195*ee758998Schristos
196*ee758998Schristos_PKG_TEXT
197*ee758998Schristos
198*ee758998SchristosTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
199*ee758998Schristos        ])
200*ee758998Schristoselse
201*ee758998Schristos	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
202*ee758998Schristos	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
203*ee758998Schristos        AC_MSG_RESULT([yes])
204*ee758998Schristos	$3
205*ee758998Schristosfi[]dnl
206*ee758998Schristos])dnl PKG_CHECK_MODULES
207*ee758998Schristos
208*ee758998Schristos
209*ee758998Schristosdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
210*ee758998Schristosdnl   [ACTION-IF-NOT-FOUND])
211*ee758998Schristosdnl ---------------------------------------------------------------------
212*ee758998Schristosdnl Since: 0.29
213*ee758998Schristosdnl
214*ee758998Schristosdnl Checks for existence of MODULES and gathers its build flags with
215*ee758998Schristosdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
216*ee758998Schristosdnl and VARIABLE-PREFIX_LIBS from --libs.
217*ee758998Schristosdnl
218*ee758998Schristosdnl Note that if there is a possibility the first call to
219*ee758998Schristosdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
220*ee758998Schristosdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
221*ee758998Schristosdnl configure.ac.
222*ee758998SchristosAC_DEFUN([PKG_CHECK_MODULES_STATIC],
223*ee758998Schristos[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
224*ee758998Schristos_save_PKG_CONFIG=$PKG_CONFIG
225*ee758998SchristosPKG_CONFIG="$PKG_CONFIG --static"
226*ee758998SchristosPKG_CHECK_MODULES($@)
227*ee758998SchristosPKG_CONFIG=$_save_PKG_CONFIG[]dnl
228*ee758998Schristos])dnl PKG_CHECK_MODULES_STATIC
229*ee758998Schristos
230*ee758998Schristos
231*ee758998Schristosdnl PKG_INSTALLDIR([DIRECTORY])
232*ee758998Schristosdnl -------------------------
233*ee758998Schristosdnl Since: 0.27
234*ee758998Schristosdnl
235*ee758998Schristosdnl Substitutes the variable pkgconfigdir as the location where a module
236*ee758998Schristosdnl should install pkg-config .pc files. By default the directory is
237*ee758998Schristosdnl $libdir/pkgconfig, but the default can be changed by passing
238*ee758998Schristosdnl DIRECTORY. The user can override through the --with-pkgconfigdir
239*ee758998Schristosdnl parameter.
240*ee758998SchristosAC_DEFUN([PKG_INSTALLDIR],
241*ee758998Schristos[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
242*ee758998Schristosm4_pushdef([pkg_description],
243*ee758998Schristos    [pkg-config installation directory @<:@]pkg_default[@:>@])
244*ee758998SchristosAC_ARG_WITH([pkgconfigdir],
245*ee758998Schristos    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
246*ee758998Schristos    [with_pkgconfigdir=]pkg_default)
247*ee758998SchristosAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
248*ee758998Schristosm4_popdef([pkg_default])
249*ee758998Schristosm4_popdef([pkg_description])
250*ee758998Schristos])dnl PKG_INSTALLDIR
251*ee758998Schristos
252*ee758998Schristos
253*ee758998Schristosdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
254*ee758998Schristosdnl --------------------------------
255*ee758998Schristosdnl Since: 0.27
256*ee758998Schristosdnl
257*ee758998Schristosdnl Substitutes the variable noarch_pkgconfigdir as the location where a
258*ee758998Schristosdnl module should install arch-independent pkg-config .pc files. By
259*ee758998Schristosdnl default the directory is $datadir/pkgconfig, but the default can be
260*ee758998Schristosdnl changed by passing DIRECTORY. The user can override through the
261*ee758998Schristosdnl --with-noarch-pkgconfigdir parameter.
262*ee758998SchristosAC_DEFUN([PKG_NOARCH_INSTALLDIR],
263*ee758998Schristos[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
264*ee758998Schristosm4_pushdef([pkg_description],
265*ee758998Schristos    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
266*ee758998SchristosAC_ARG_WITH([noarch-pkgconfigdir],
267*ee758998Schristos    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
268*ee758998Schristos    [with_noarch_pkgconfigdir=]pkg_default)
269*ee758998SchristosAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
270*ee758998Schristosm4_popdef([pkg_default])
271*ee758998Schristosm4_popdef([pkg_description])
272*ee758998Schristos])dnl PKG_NOARCH_INSTALLDIR
273*ee758998Schristos
274*ee758998Schristos
275*ee758998Schristosdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
276*ee758998Schristosdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
277*ee758998Schristosdnl -------------------------------------------
278*ee758998Schristosdnl Since: 0.28
279*ee758998Schristosdnl
280*ee758998Schristosdnl Retrieves the value of the pkg-config variable for the given module.
281*ee758998SchristosAC_DEFUN([PKG_CHECK_VAR],
282*ee758998Schristos[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
283*ee758998SchristosAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
284*ee758998Schristos
285*ee758998Schristos_PKG_CONFIG([$1], [variable="][$3]["], [$2])
286*ee758998SchristosAS_VAR_COPY([$1], [pkg_cv_][$1])
287*ee758998Schristos
288*ee758998SchristosAS_VAR_IF([$1], [""], [$5], [$4])dnl
289*ee758998Schristos])dnl PKG_CHECK_VAR
290*ee758998Schristos
291*ee758998Schristosdnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
292*ee758998Schristosdnl   [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
293*ee758998Schristosdnl   [DESCRIPTION], [DEFAULT])
294*ee758998Schristosdnl ------------------------------------------
295*ee758998Schristosdnl
296*ee758998Schristosdnl Prepare a "--with-" configure option using the lowercase
297*ee758998Schristosdnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
298*ee758998Schristosdnl PKG_CHECK_MODULES in a single macro.
299*ee758998SchristosAC_DEFUN([PKG_WITH_MODULES],
300*ee758998Schristos[
301*ee758998Schristosm4_pushdef([with_arg], m4_tolower([$1]))
302*ee758998Schristos
303*ee758998Schristosm4_pushdef([description],
304*ee758998Schristos           [m4_default([$5], [build with ]with_arg[ support])])
305*ee758998Schristos
306*ee758998Schristosm4_pushdef([def_arg], [m4_default([$6], [auto])])
307*ee758998Schristosm4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
308*ee758998Schristosm4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
309*ee758998Schristos
310*ee758998Schristosm4_case(def_arg,
311*ee758998Schristos            [yes],[m4_pushdef([with_without], [--without-]with_arg)],
312*ee758998Schristos            [m4_pushdef([with_without],[--with-]with_arg)])
313*ee758998Schristos
314*ee758998SchristosAC_ARG_WITH(with_arg,
315*ee758998Schristos     AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
316*ee758998Schristos    [AS_TR_SH([with_]with_arg)=def_arg])
317*ee758998Schristos
318*ee758998SchristosAS_CASE([$AS_TR_SH([with_]with_arg)],
319*ee758998Schristos            [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
320*ee758998Schristos            [auto],[PKG_CHECK_MODULES([$1],[$2],
321*ee758998Schristos                                        [m4_n([def_action_if_found]) $3],
322*ee758998Schristos                                        [m4_n([def_action_if_not_found]) $4])])
323*ee758998Schristos
324*ee758998Schristosm4_popdef([with_arg])
325*ee758998Schristosm4_popdef([description])
326*ee758998Schristosm4_popdef([def_arg])
327*ee758998Schristos
328*ee758998Schristos])dnl PKG_WITH_MODULES
329*ee758998Schristos
330*ee758998Schristosdnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
331*ee758998Schristosdnl   [DESCRIPTION], [DEFAULT])
332*ee758998Schristosdnl -----------------------------------------------
333*ee758998Schristosdnl
334*ee758998Schristosdnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
335*ee758998Schristosdnl check._[VARIABLE-PREFIX] is exported as make variable.
336*ee758998SchristosAC_DEFUN([PKG_HAVE_WITH_MODULES],
337*ee758998Schristos[
338*ee758998SchristosPKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
339*ee758998Schristos
340*ee758998SchristosAM_CONDITIONAL([HAVE_][$1],
341*ee758998Schristos               [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
342*ee758998Schristos])dnl PKG_HAVE_WITH_MODULES
343*ee758998Schristos
344*ee758998Schristosdnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
345*ee758998Schristosdnl   [DESCRIPTION], [DEFAULT])
346*ee758998Schristosdnl ------------------------------------------------------
347*ee758998Schristosdnl
348*ee758998Schristosdnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
349*ee758998Schristosdnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
350*ee758998Schristosdnl and preprocessor variable.
351*ee758998SchristosAC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
352*ee758998Schristos[
353*ee758998SchristosPKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
354*ee758998Schristos
355*ee758998SchristosAS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
356*ee758998Schristos        [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
357*ee758998Schristos])dnl PKG_HAVE_DEFINE_WITH_MODULES
358*ee758998Schristos
359