aclocal.m4 revision 35525df4
1# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
2
3# Copyright (C) 1996-2021 Free Software Foundation, Inc.
4
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15m4_ifndef([AC_AUTOCONF_VERSION],
16  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],,
18[m4_warning([this file was generated for autoconf 2.72.
19You have another version of autoconf.  It may work, but is not guaranteed to.
20If you have problems, you may need to regenerate the build system entirely.
21To do so, use the procedure documented by the package, typically 'autoreconf'.])])
22
23# pkg.m4 - Macros to locate and use pkg-config.   -*- Autoconf -*-
24# serial 12 (pkg-config-0.29.2)
25
26dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
27dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
28dnl
29dnl This program is free software; you can redistribute it and/or modify
30dnl it under the terms of the GNU General Public License as published by
31dnl the Free Software Foundation; either version 2 of the License, or
32dnl (at your option) any later version.
33dnl
34dnl This program is distributed in the hope that it will be useful, but
35dnl WITHOUT ANY WARRANTY; without even the implied warranty of
36dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37dnl General Public License for more details.
38dnl
39dnl You should have received a copy of the GNU General Public License
40dnl along with this program; if not, write to the Free Software
41dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
42dnl 02111-1307, USA.
43dnl
44dnl As a special exception to the GNU General Public License, if you
45dnl distribute this file as part of a program that contains a
46dnl configuration script generated by Autoconf, you may include it under
47dnl the same distribution terms that you use for the rest of that
48dnl program.
49
50dnl PKG_PREREQ(MIN-VERSION)
51dnl -----------------------
52dnl Since: 0.29
53dnl
54dnl Verify that the version of the pkg-config macros are at least
55dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
56dnl installed version of pkg-config, this checks the developer's version
57dnl of pkg.m4 when generating configure.
58dnl
59dnl To ensure that this macro is defined, also add:
60dnl m4_ifndef([PKG_PREREQ],
61dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
62dnl
63dnl See the "Since" comment for each macro you use to see what version
64dnl of the macros you require.
65m4_defun([PKG_PREREQ],
66[m4_define([PKG_MACROS_VERSION], [0.29.2])
67m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
68    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
69])dnl PKG_PREREQ
70
71dnl PKG_PROG_PKG_CONFIG([MIN-VERSION], [ACTION-IF-NOT-FOUND])
72dnl ---------------------------------------------------------
73dnl Since: 0.16
74dnl
75dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
76dnl first found in the path. Checks that the version of pkg-config found
77dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
78dnl used since that's the first version where most current features of
79dnl pkg-config existed.
80dnl
81dnl If pkg-config is not found or older than specified, it will result
82dnl in an empty PKG_CONFIG variable. To avoid widespread issues with
83dnl scripts not checking it, ACTION-IF-NOT-FOUND defaults to aborting.
84dnl You can specify [PKG_CONFIG=false] as an action instead, which would
85dnl result in pkg-config tests failing, but no bogus error messages.
86AC_DEFUN([PKG_PROG_PKG_CONFIG],
87[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
88m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
89m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
90AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
91AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
92AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
93
94if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
95	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
96fi
97if test -n "$PKG_CONFIG"; then
98	_pkg_min_version=m4_default([$1], [0.9.0])
99	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
100	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
101		AC_MSG_RESULT([yes])
102	else
103		AC_MSG_RESULT([no])
104		PKG_CONFIG=""
105	fi
106fi
107if test -z "$PKG_CONFIG"; then
108	m4_default([$2], [AC_MSG_ERROR([pkg-config not found])])
109fi[]dnl
110])dnl PKG_PROG_PKG_CONFIG
111
112dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
113dnl -------------------------------------------------------------------
114dnl Since: 0.18
115dnl
116dnl Check to see whether a particular set of modules exists. Similar to
117dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
118dnl
119dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
120dnl only at the first occurrence in configure.ac, so if the first place
121dnl it's called might be skipped (such as if it is within an "if", you
122dnl have to call PKG_CHECK_EXISTS manually
123AC_DEFUN([PKG_CHECK_EXISTS],
124[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
125if test -n "$PKG_CONFIG" && \
126    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
127  m4_default([$2], [:])
128m4_ifvaln([$3], [else
129  $3])dnl
130fi])
131
132dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
133dnl ---------------------------------------------
134dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
135dnl pkg_failed based on the result.
136m4_define([_PKG_CONFIG],
137[if test -n "$$1"; then
138    pkg_cv_[]$1="$$1"
139 elif test -n "$PKG_CONFIG"; then
140    PKG_CHECK_EXISTS([$3],
141                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
142		      test "x$?" != "x0" && pkg_failed=yes ],
143		     [pkg_failed=yes])
144 else
145    pkg_failed=untried
146fi[]dnl
147])dnl _PKG_CONFIG
148
149dnl _PKG_SHORT_ERRORS_SUPPORTED
150dnl ---------------------------
151dnl Internal check to see if pkg-config supports short errors.
152AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
153[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
154if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
155        _pkg_short_errors_supported=yes
156else
157        _pkg_short_errors_supported=no
158fi[]dnl
159])dnl _PKG_SHORT_ERRORS_SUPPORTED
160
161
162dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
163dnl   [ACTION-IF-NOT-FOUND])
164dnl --------------------------------------------------------------
165dnl Since: 0.4.0
166dnl
167dnl Note that if there is a possibility the first call to
168dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
169dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
170AC_DEFUN([PKG_CHECK_MODULES],
171[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
172AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
173AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
174
175pkg_failed=no
176AC_MSG_CHECKING([for $2])
177
178_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
179_PKG_CONFIG([$1][_LIBS], [libs], [$2])
180
181m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
182and $1[]_LIBS to avoid the need to call pkg-config.
183See the pkg-config man page for more details.])
184
185if test $pkg_failed = yes; then
186        AC_MSG_RESULT([no])
187        _PKG_SHORT_ERRORS_SUPPORTED
188        if test $_pkg_short_errors_supported = yes; then
189                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
190        else
191                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
192        fi
193        # Put the nasty error message in config.log where it belongs
194        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
195
196        m4_default([$4], [AC_MSG_ERROR(
197[Package requirements ($2) were not met:
198
199$$1_PKG_ERRORS
200
201Consider adjusting the PKG_CONFIG_PATH environment variable if you
202installed software in a non-standard prefix.
203
204_PKG_TEXT])[]dnl
205        ])
206elif test $pkg_failed = untried; then
207        AC_MSG_RESULT([no])
208        m4_default([$4], [AC_MSG_FAILURE(
209[The pkg-config script could not be found or is too old.  Make sure it
210is in your PATH or set the PKG_CONFIG environment variable to the full
211path to pkg-config.
212
213_PKG_TEXT
214
215To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
216        ])
217else
218        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
219        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
220        AC_MSG_RESULT([yes])
221        $3
222fi[]dnl
223])dnl PKG_CHECK_MODULES
224
225
226dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
227dnl   [ACTION-IF-NOT-FOUND])
228dnl ---------------------------------------------------------------------
229dnl Since: 0.29
230dnl
231dnl Checks for existence of MODULES and gathers its build flags with
232dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
233dnl and VARIABLE-PREFIX_LIBS from --libs.
234dnl
235dnl Note that if there is a possibility the first call to
236dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
237dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
238dnl configure.ac.
239AC_DEFUN([PKG_CHECK_MODULES_STATIC],
240[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
241_save_PKG_CONFIG=$PKG_CONFIG
242PKG_CONFIG="$PKG_CONFIG --static"
243PKG_CHECK_MODULES($@)
244PKG_CONFIG=$_save_PKG_CONFIG[]dnl
245])dnl PKG_CHECK_MODULES_STATIC
246
247
248dnl PKG_INSTALLDIR([DIRECTORY])
249dnl -------------------------
250dnl Since: 0.27
251dnl
252dnl Substitutes the variable pkgconfigdir as the location where a module
253dnl should install pkg-config .pc files. By default the directory is
254dnl $libdir/pkgconfig, but the default can be changed by passing
255dnl DIRECTORY. The user can override through the --with-pkgconfigdir
256dnl parameter.
257AC_DEFUN([PKG_INSTALLDIR],
258[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
259m4_pushdef([pkg_description],
260    [pkg-config installation directory @<:@]pkg_default[@:>@])
261AC_ARG_WITH([pkgconfigdir],
262    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
263    [with_pkgconfigdir=]pkg_default)
264AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
265m4_popdef([pkg_default])
266m4_popdef([pkg_description])
267])dnl PKG_INSTALLDIR
268
269
270dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
271dnl --------------------------------
272dnl Since: 0.27
273dnl
274dnl Substitutes the variable noarch_pkgconfigdir as the location where a
275dnl module should install arch-independent pkg-config .pc files. By
276dnl default the directory is $datadir/pkgconfig, but the default can be
277dnl changed by passing DIRECTORY. The user can override through the
278dnl --with-noarch-pkgconfigdir parameter.
279AC_DEFUN([PKG_NOARCH_INSTALLDIR],
280[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
281m4_pushdef([pkg_description],
282    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
283AC_ARG_WITH([noarch-pkgconfigdir],
284    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
285    [with_noarch_pkgconfigdir=]pkg_default)
286AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
287m4_popdef([pkg_default])
288m4_popdef([pkg_description])
289])dnl PKG_NOARCH_INSTALLDIR
290
291
292dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
293dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
294dnl -------------------------------------------
295dnl Since: 0.28
296dnl
297dnl Retrieves the value of the pkg-config variable for the given module.
298AC_DEFUN([PKG_CHECK_VAR],
299[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
300AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
301
302_PKG_CONFIG([$1], [variable="][$3]["], [$2])
303AS_VAR_COPY([$1], [pkg_cv_][$1])
304
305AS_VAR_IF([$1], [""], [$5], [$4])dnl
306])dnl PKG_CHECK_VAR
307
308dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
309dnl   [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
310dnl   [DESCRIPTION], [DEFAULT])
311dnl ------------------------------------------
312dnl
313dnl Prepare a "--with-" configure option using the lowercase
314dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
315dnl PKG_CHECK_MODULES in a single macro.
316AC_DEFUN([PKG_WITH_MODULES],
317[
318m4_pushdef([with_arg], m4_tolower([$1]))
319
320m4_pushdef([description],
321           [m4_default([$5], [build with ]with_arg[ support])])
322
323m4_pushdef([def_arg], [m4_default([$6], [auto])])
324m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
325m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
326
327m4_case(def_arg,
328            [yes],[m4_pushdef([with_without], [--without-]with_arg)],
329            [m4_pushdef([with_without],[--with-]with_arg)])
330
331AC_ARG_WITH(with_arg,
332     AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
333    [AS_TR_SH([with_]with_arg)=def_arg])
334
335AS_CASE([$AS_TR_SH([with_]with_arg)],
336            [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
337            [auto],[PKG_CHECK_MODULES([$1],[$2],
338                                        [m4_n([def_action_if_found]) $3],
339                                        [m4_n([def_action_if_not_found]) $4])])
340
341m4_popdef([with_arg])
342m4_popdef([description])
343m4_popdef([def_arg])
344
345])dnl PKG_WITH_MODULES
346
347dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
348dnl   [DESCRIPTION], [DEFAULT])
349dnl -----------------------------------------------
350dnl
351dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
352dnl check._[VARIABLE-PREFIX] is exported as make variable.
353AC_DEFUN([PKG_HAVE_WITH_MODULES],
354[
355PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
356
357AM_CONDITIONAL([HAVE_][$1],
358               [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
359])dnl PKG_HAVE_WITH_MODULES
360
361dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
362dnl   [DESCRIPTION], [DEFAULT])
363dnl ------------------------------------------------------
364dnl
365dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
366dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
367dnl and preprocessor variable.
368AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
369[
370PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
371
372AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
373        [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
374])dnl PKG_HAVE_DEFINE_WITH_MODULES
375
376dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
377dnl
378dnl Copyright (c) 2005, 2023, Oracle and/or its affiliates.
379dnl
380dnl Permission is hereby granted, free of charge, to any person obtaining a
381dnl copy of this software and associated documentation files (the "Software"),
382dnl to deal in the Software without restriction, including without limitation
383dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
384dnl and/or sell copies of the Software, and to permit persons to whom the
385dnl Software is furnished to do so, subject to the following conditions:
386dnl
387dnl The above copyright notice and this permission notice (including the next
388dnl paragraph) shall be included in all copies or substantial portions of the
389dnl Software.
390dnl
391dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
392dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
393dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
394dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
395dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
396dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
397dnl DEALINGS IN THE SOFTWARE.
398
399# XORG_MACROS_VERSION(required-version)
400# -------------------------------------
401# Minimum version: 1.1.0
402#
403# If you're using a macro added in Version 1.1 or newer, include this in
404# your configure.ac with the minimum required version, such as:
405# XORG_MACROS_VERSION(1.1)
406#
407# To ensure that this macro is defined, also add:
408# m4_ifndef([XORG_MACROS_VERSION],
409#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
410#
411#
412# See the "minimum version" comment for each macro you use to see what
413# version you require.
414m4_defun([XORG_MACROS_VERSION],[
415m4_define([vers_have], [1.20.2])
416m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
417m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
418m4_if(m4_cmp(maj_have, maj_needed), 0,,
419    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
420m4_if(m4_version_compare(vers_have, [$1]), -1,
421    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
422m4_undefine([vers_have])
423m4_undefine([maj_have])
424m4_undefine([maj_needed])
425]) # XORG_MACROS_VERSION
426
427# XORG_PROG_RAWCPP()
428# ------------------
429# Minimum version: 1.0.0
430#
431# Find cpp program and necessary flags for use in pre-processing text files
432# such as man pages and config files
433AC_DEFUN([XORG_PROG_RAWCPP],[
434AC_REQUIRE([AC_PROG_CPP])
435AC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
436   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
437
438# Check for flag to avoid builtin definitions - assumes unix is predefined,
439# which is not the best choice for supporting other OS'es, but covers most
440# of the ones we need for now.
441AC_MSG_CHECKING([if $RAWCPP requires -undef])
442AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
443if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
444	AC_MSG_RESULT([no])
445else
446	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
447		RAWCPPFLAGS=-undef
448		AC_MSG_RESULT([yes])
449	# under Cygwin unix is still defined even with -undef
450	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
451		RAWCPPFLAGS="-undef -ansi"
452		AC_MSG_RESULT([yes, with -ansi])
453	else
454		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
455	fi
456fi
457rm -f conftest.$ac_ext
458
459AC_MSG_CHECKING([if $RAWCPP requires -traditional])
460AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
461if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   "'` -eq 1 ; then
462	AC_MSG_RESULT([no])
463else
464	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   "'` -eq 1 ; then
465		TRADITIONALCPPFLAGS="-traditional"
466		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
467		AC_MSG_RESULT([yes])
468	else
469		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
470	fi
471fi
472rm -f conftest.$ac_ext
473AC_SUBST(RAWCPPFLAGS)
474AC_SUBST(TRADITIONALCPPFLAGS)
475]) # XORG_PROG_RAWCPP
476
477# XORG_MANPAGE_SECTIONS()
478# -----------------------
479# Minimum version: 1.0.0
480#
481# Determine which sections man pages go in for the different man page types
482# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
483# Not sure if there's any better way than just hardcoding by OS name.
484# Override default settings by setting environment variables
485# Added MAN_SUBSTS in version 1.8
486# Added AC_PROG_SED in version 1.8
487
488AC_DEFUN([XORG_MANPAGE_SECTIONS],[
489AC_REQUIRE([AC_CANONICAL_HOST])
490AC_REQUIRE([AC_PROG_SED])
491
492case $host_os in
493    solaris*)
494        # Solaris 2.0 - 11.3 use SysV man page section numbers, so we
495        # check for a man page file found in later versions that use
496        # traditional section numbers instead
497        AC_CHECK_FILE([/usr/share/man/man7/attributes.7],
498                [SYSV_MAN_SECTIONS=false], [SYSV_MAN_SECTIONS=true])
499        ;;
500    *) SYSV_MAN_SECTIONS=false ;;
501esac
502
503if test x$APP_MAN_SUFFIX = x    ; then
504    APP_MAN_SUFFIX=1
505fi
506if test x$APP_MAN_DIR = x    ; then
507    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
508fi
509
510if test x$LIB_MAN_SUFFIX = x    ; then
511    LIB_MAN_SUFFIX=3
512fi
513if test x$LIB_MAN_DIR = x    ; then
514    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
515fi
516
517if test x$FILE_MAN_SUFFIX = x    ; then
518    case $SYSV_MAN_SECTIONS in
519	true)				FILE_MAN_SUFFIX=4  ;;
520	*)				FILE_MAN_SUFFIX=5  ;;
521    esac
522fi
523if test x$FILE_MAN_DIR = x    ; then
524    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
525fi
526
527if test x$MISC_MAN_SUFFIX = x    ; then
528    case $SYSV_MAN_SECTIONS in
529	true)				MISC_MAN_SUFFIX=5  ;;
530	*)				MISC_MAN_SUFFIX=7  ;;
531    esac
532fi
533if test x$MISC_MAN_DIR = x    ; then
534    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
535fi
536
537if test x$DRIVER_MAN_SUFFIX = x    ; then
538    case $SYSV_MAN_SECTIONS in
539	true)				DRIVER_MAN_SUFFIX=7  ;;
540	*)				DRIVER_MAN_SUFFIX=4  ;;
541    esac
542fi
543if test x$DRIVER_MAN_DIR = x    ; then
544    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
545fi
546
547if test x$ADMIN_MAN_SUFFIX = x    ; then
548    case $SYSV_MAN_SECTIONS in
549	true)				ADMIN_MAN_SUFFIX=1m ;;
550	*)				ADMIN_MAN_SUFFIX=8  ;;
551    esac
552fi
553if test x$ADMIN_MAN_DIR = x    ; then
554    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
555fi
556
557
558AC_SUBST([APP_MAN_SUFFIX])
559AC_SUBST([LIB_MAN_SUFFIX])
560AC_SUBST([FILE_MAN_SUFFIX])
561AC_SUBST([MISC_MAN_SUFFIX])
562AC_SUBST([DRIVER_MAN_SUFFIX])
563AC_SUBST([ADMIN_MAN_SUFFIX])
564AC_SUBST([APP_MAN_DIR])
565AC_SUBST([LIB_MAN_DIR])
566AC_SUBST([FILE_MAN_DIR])
567AC_SUBST([MISC_MAN_DIR])
568AC_SUBST([DRIVER_MAN_DIR])
569AC_SUBST([ADMIN_MAN_DIR])
570
571XORG_MAN_PAGE="X Version 11"
572AC_SUBST([XORG_MAN_PAGE])
573MAN_SUBSTS="\
574	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
575	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
576	-e 's|__xservername__|Xorg|g' \
577	-e 's|__xconfigfile__|xorg.conf|g' \
578	-e 's|__projectroot__|\$(prefix)|g' \
579	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
580	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
581	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
582	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
583	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
584	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
585	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
586AC_SUBST([MAN_SUBSTS])
587
588]) # XORG_MANPAGE_SECTIONS
589
590# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
591# ------------------------
592# Minimum version: 1.7.0
593#
594# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
595# provided by xorg-sgml-doctools, if installed.
596AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
597AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
598XORG_SGML_PATH=
599PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
600    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
601    [m4_ifval([$1],[:],
602        [if test x"$cross_compiling" != x"yes" ; then
603            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
604                          [XORG_SGML_PATH=$prefix/share/sgml])
605         fi])
606    ])
607
608# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
609# the path and the name of the doc stylesheet
610if test "x$XORG_SGML_PATH" != "x" ; then
611   AC_MSG_RESULT([$XORG_SGML_PATH])
612   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
613   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
614else
615   AC_MSG_RESULT([no])
616fi
617
618AC_SUBST(XORG_SGML_PATH)
619AC_SUBST(STYLESHEET_SRCDIR)
620AC_SUBST(XSL_STYLESHEET)
621AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
622]) # XORG_CHECK_SGML_DOCTOOLS
623
624# XORG_CHECK_LINUXDOC
625# -------------------
626# Minimum version: 1.0.0
627#
628# Defines the variable MAKE_TEXT if the necessary tools and
629# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
630# Whether or not the necessary tools and files are found can be checked
631# with the AM_CONDITIONAL "BUILD_LINUXDOC"
632AC_DEFUN([XORG_CHECK_LINUXDOC],[
633AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
634AC_REQUIRE([XORG_WITH_PS2PDF])
635
636AC_PATH_PROG(LINUXDOC, linuxdoc)
637
638AC_MSG_CHECKING([whether to build documentation])
639
640if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
641   BUILDDOC=yes
642else
643   BUILDDOC=no
644fi
645
646AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
647
648AC_MSG_RESULT([$BUILDDOC])
649
650AC_MSG_CHECKING([whether to build pdf documentation])
651
652if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
653   BUILDPDFDOC=yes
654else
655   BUILDPDFDOC=no
656fi
657
658AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
659
660AC_MSG_RESULT([$BUILDPDFDOC])
661
662MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
663MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
664MAKE_PDF="$PS2PDF"
665MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
666
667AC_SUBST(MAKE_TEXT)
668AC_SUBST(MAKE_PS)
669AC_SUBST(MAKE_PDF)
670AC_SUBST(MAKE_HTML)
671]) # XORG_CHECK_LINUXDOC
672
673# XORG_CHECK_DOCBOOK
674# -------------------
675# Minimum version: 1.0.0
676#
677# Checks for the ability to build output formats from SGML DocBook source.
678# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
679# indicates whether the necessary tools and files are found and, if set,
680# $(MAKE_XXX) blah.sgml will produce blah.xxx.
681AC_DEFUN([XORG_CHECK_DOCBOOK],[
682AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
683
684BUILDTXTDOC=no
685BUILDPDFDOC=no
686BUILDPSDOC=no
687BUILDHTMLDOC=no
688
689AC_PATH_PROG(DOCBOOKPS, docbook2ps)
690AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
691AC_PATH_PROG(DOCBOOKHTML, docbook2html)
692AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
693
694AC_MSG_CHECKING([whether to build text documentation])
695if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
696   test x$BUILD_TXTDOC != xno; then
697	BUILDTXTDOC=yes
698fi
699AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
700AC_MSG_RESULT([$BUILDTXTDOC])
701
702AC_MSG_CHECKING([whether to build PDF documentation])
703if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
704   test x$BUILD_PDFDOC != xno; then
705	BUILDPDFDOC=yes
706fi
707AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
708AC_MSG_RESULT([$BUILDPDFDOC])
709
710AC_MSG_CHECKING([whether to build PostScript documentation])
711if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
712   test x$BUILD_PSDOC != xno; then
713	BUILDPSDOC=yes
714fi
715AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
716AC_MSG_RESULT([$BUILDPSDOC])
717
718AC_MSG_CHECKING([whether to build HTML documentation])
719if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
720   test x$BUILD_HTMLDOC != xno; then
721	BUILDHTMLDOC=yes
722fi
723AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
724AC_MSG_RESULT([$BUILDHTMLDOC])
725
726MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
727MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
728MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
729MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
730
731AC_SUBST(MAKE_TEXT)
732AC_SUBST(MAKE_PS)
733AC_SUBST(MAKE_PDF)
734AC_SUBST(MAKE_HTML)
735]) # XORG_CHECK_DOCBOOK
736
737# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
738# ----------------
739# Minimum version: 1.5.0
740# Minimum version for optional DEFAULT argument: 1.11.0
741#
742# Documentation tools are not always available on all platforms and sometimes
743# not at the appropriate level. This macro enables a module to test for the
744# presence of the tool and obtain it's path in separate variables. Coupled with
745# the --with-xmlto option, it allows maximum flexibility in making decisions
746# as whether or not to use the xmlto package. When DEFAULT is not specified,
747# --with-xmlto assumes 'auto'.
748#
749# Interface to module:
750# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
751# XMLTO:	returns the path of the xmlto program found
752#		returns the path set by the user in the environment
753# --with-xmlto:	'yes' user instructs the module to use xmlto
754#		'no' user instructs the module not to use xmlto
755#
756# Added in version 1.10.0
757# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
758#                  xmlto for text output requires either lynx, links, or w3m browsers
759#
760# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
761#
762AC_DEFUN([XORG_WITH_XMLTO],[
763AC_ARG_VAR([XMLTO], [Path to xmlto command])
764m4_define([_defopt], m4_default([$2], [auto]))
765AC_ARG_WITH(xmlto,
766	AS_HELP_STRING([--with-xmlto],
767	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
768	   [use_xmlto=$withval], [use_xmlto=]_defopt)
769m4_undefine([_defopt])
770
771if test "x$use_xmlto" = x"auto"; then
772   AC_PATH_PROG([XMLTO], [xmlto])
773   if test "x$XMLTO" = "x"; then
774        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
775	have_xmlto=no
776   else
777        have_xmlto=yes
778   fi
779elif test "x$use_xmlto" = x"yes" ; then
780   AC_PATH_PROG([XMLTO], [xmlto])
781   if test "x$XMLTO" = "x"; then
782        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
783   fi
784   have_xmlto=yes
785elif test "x$use_xmlto" = x"no" ; then
786   if test "x$XMLTO" != "x"; then
787      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
788   fi
789   have_xmlto=no
790else
791   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
792fi
793
794# Test for a minimum version of xmlto, if provided.
795m4_ifval([$1],
796[if test "$have_xmlto" = yes; then
797    # scrape the xmlto version
798    AC_MSG_CHECKING([the xmlto version])
799    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
800    AC_MSG_RESULT([$xmlto_version])
801    AS_VERSION_COMPARE([$xmlto_version], [$1],
802        [if test "x$use_xmlto" = xauto; then
803            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
804            have_xmlto=no
805        else
806            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
807        fi])
808fi])
809
810# Test for the ability of xmlto to generate a text target
811#
812# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
813# following test for empty XML docbook files.
814# For compatibility reasons use the following empty XML docbook file and if
815# it fails try it again with a non-empty XML file.
816have_xmlto_text=no
817cat > conftest.xml << "EOF"
818EOF
819AS_IF([test "$have_xmlto" = yes],
820      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
821             [have_xmlto_text=yes],
822             [# Try it again with a non-empty XML file.
823              cat > conftest.xml << "EOF"
824<x></x>
825EOF
826              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
827                    [have_xmlto_text=yes],
828                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
829rm -f conftest.xml
830AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
831AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
832]) # XORG_WITH_XMLTO
833
834# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
835# --------------------------------------------
836# Minimum version: 1.12.0
837# Minimum version for optional DEFAULT argument: 1.12.0
838#
839# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
840# XML-based language used for the transformation of XML documents.
841# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
842# It is used under the cover by xmlto to generate html files from DocBook/XML.
843# The XSLT processor is often used as a standalone tool for transformations.
844# It should not be assumed that this tool is used only to work with documnetation.
845# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
846#
847# Interface to module:
848# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
849# XSLTPROC:	 returns the path of the xsltproc program found
850#		 returns the path set by the user in the environment
851# --with-xsltproc: 'yes' user instructs the module to use xsltproc
852#		  'no' user instructs the module not to use xsltproc
853# have_xsltproc: returns yes if xsltproc found in PATH or no
854#
855# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
856#
857AC_DEFUN([XORG_WITH_XSLTPROC],[
858AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
859# Preserves the interface, should it be implemented later
860m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
861m4_define([_defopt], m4_default([$2], [auto]))
862AC_ARG_WITH(xsltproc,
863	AS_HELP_STRING([--with-xsltproc],
864	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
865	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
866m4_undefine([_defopt])
867
868if test "x$use_xsltproc" = x"auto"; then
869   AC_PATH_PROG([XSLTPROC], [xsltproc])
870   if test "x$XSLTPROC" = "x"; then
871        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
872	have_xsltproc=no
873   else
874        have_xsltproc=yes
875   fi
876elif test "x$use_xsltproc" = x"yes" ; then
877   AC_PATH_PROG([XSLTPROC], [xsltproc])
878   if test "x$XSLTPROC" = "x"; then
879        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
880   fi
881   have_xsltproc=yes
882elif test "x$use_xsltproc" = x"no" ; then
883   if test "x$XSLTPROC" != "x"; then
884      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
885   fi
886   have_xsltproc=no
887else
888   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
889fi
890
891AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
892]) # XORG_WITH_XSLTPROC
893
894# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
895# ----------------------------------------
896# Minimum version: 1.15.0
897#
898# PERL (Practical Extraction and Report Language) is a language optimized for
899# scanning arbitrary text files, extracting information from those text files,
900# and printing reports based on that information.
901#
902# When DEFAULT is not specified, --with-perl assumes 'auto'.
903#
904# Interface to module:
905# HAVE_PERL: used in makefiles to conditionally scan text files
906# PERL:	     returns the path of the perl program found
907#	     returns the path set by the user in the environment
908# --with-perl: 'yes' user instructs the module to use perl
909#	       'no' user instructs the module not to use perl
910# have_perl: returns yes if perl found in PATH or no
911#
912# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
913#
914AC_DEFUN([XORG_WITH_PERL],[
915AC_ARG_VAR([PERL], [Path to perl command])
916# Preserves the interface, should it be implemented later
917m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
918m4_define([_defopt], m4_default([$2], [auto]))
919AC_ARG_WITH(perl,
920	AS_HELP_STRING([--with-perl],
921	   [Use perl for extracting information from files (default: ]_defopt[)]),
922	   [use_perl=$withval], [use_perl=]_defopt)
923m4_undefine([_defopt])
924
925if test "x$use_perl" = x"auto"; then
926   AC_PATH_PROG([PERL], [perl])
927   if test "x$PERL" = "x"; then
928        AC_MSG_WARN([perl not found - cannot extract information and report])
929	have_perl=no
930   else
931        have_perl=yes
932   fi
933elif test "x$use_perl" = x"yes" ; then
934   AC_PATH_PROG([PERL], [perl])
935   if test "x$PERL" = "x"; then
936        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
937   fi
938   have_perl=yes
939elif test "x$use_perl" = x"no" ; then
940   if test "x$PERL" != "x"; then
941      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
942   fi
943   have_perl=no
944else
945   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
946fi
947
948AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
949]) # XORG_WITH_PERL
950
951# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
952# ----------------
953# Minimum version: 1.5.0
954# Minimum version for optional DEFAULT argument: 1.11.0
955#
956# Documentation tools are not always available on all platforms and sometimes
957# not at the appropriate level. This macro enables a module to test for the
958# presence of the tool and obtain it's path in separate variables. Coupled with
959# the --with-asciidoc option, it allows maximum flexibility in making decisions
960# as whether or not to use the asciidoc package. When DEFAULT is not specified,
961# --with-asciidoc assumes 'auto'.
962#
963# Interface to module:
964# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
965# ASCIIDOC:	 returns the path of the asciidoc program found
966#		 returns the path set by the user in the environment
967# --with-asciidoc: 'yes' user instructs the module to use asciidoc
968#		  'no' user instructs the module not to use asciidoc
969#
970# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
971#
972AC_DEFUN([XORG_WITH_ASCIIDOC],[
973AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
974m4_define([_defopt], m4_default([$2], [auto]))
975AC_ARG_WITH(asciidoc,
976	AS_HELP_STRING([--with-asciidoc],
977	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
978	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
979m4_undefine([_defopt])
980
981if test "x$use_asciidoc" = x"auto"; then
982   AC_PATH_PROG([ASCIIDOC], [asciidoc])
983   if test "x$ASCIIDOC" = "x"; then
984        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
985	have_asciidoc=no
986   else
987        have_asciidoc=yes
988   fi
989elif test "x$use_asciidoc" = x"yes" ; then
990   AC_PATH_PROG([ASCIIDOC], [asciidoc])
991   if test "x$ASCIIDOC" = "x"; then
992        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
993   fi
994   have_asciidoc=yes
995elif test "x$use_asciidoc" = x"no" ; then
996   if test "x$ASCIIDOC" != "x"; then
997      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
998   fi
999   have_asciidoc=no
1000else
1001   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1002fi
1003m4_ifval([$1],
1004[if test "$have_asciidoc" = yes; then
1005    # scrape the asciidoc version
1006    AC_MSG_CHECKING([the asciidoc version])
1007    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1008    AC_MSG_RESULT([$asciidoc_version])
1009    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1010        [if test "x$use_asciidoc" = xauto; then
1011            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1012            have_asciidoc=no
1013        else
1014            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1015        fi])
1016fi])
1017AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1018]) # XORG_WITH_ASCIIDOC
1019
1020# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1021# -------------------------------------------
1022# Minimum version: 1.5.0
1023# Minimum version for optional DEFAULT argument: 1.11.0
1024# Minimum version for optional DOT checking: 1.18.0
1025#
1026# Documentation tools are not always available on all platforms and sometimes
1027# not at the appropriate level. This macro enables a module to test for the
1028# presence of the tool and obtain it's path in separate variables. Coupled with
1029# the --with-doxygen option, it allows maximum flexibility in making decisions
1030# as whether or not to use the doxygen package. When DEFAULT is not specified,
1031# --with-doxygen assumes 'auto'.
1032#
1033# Interface to module:
1034# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1035# DOXYGEN:	 returns the path of the doxygen program found
1036#		 returns the path set by the user in the environment
1037# --with-doxygen: 'yes' user instructs the module to use doxygen
1038#		  'no' user instructs the module not to use doxygen
1039#
1040# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1041#
1042AC_DEFUN([XORG_WITH_DOXYGEN],[
1043AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1044AC_ARG_VAR([DOT], [Path to the dot graphics utility])
1045m4_define([_defopt], m4_default([$2], [auto]))
1046AC_ARG_WITH(doxygen,
1047	AS_HELP_STRING([--with-doxygen],
1048	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1049	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1050m4_undefine([_defopt])
1051
1052if test "x$use_doxygen" = x"auto"; then
1053   AC_PATH_PROG([DOXYGEN], [doxygen])
1054   if test "x$DOXYGEN" = "x"; then
1055        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1056	have_doxygen=no
1057   else
1058        have_doxygen=yes
1059   fi
1060elif test "x$use_doxygen" = x"yes" ; then
1061   AC_PATH_PROG([DOXYGEN], [doxygen])
1062   if test "x$DOXYGEN" = "x"; then
1063        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1064   fi
1065   have_doxygen=yes
1066elif test "x$use_doxygen" = x"no" ; then
1067   if test "x$DOXYGEN" != "x"; then
1068      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1069   fi
1070   have_doxygen=no
1071else
1072   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1073fi
1074m4_ifval([$1],
1075[if test "$have_doxygen" = yes; then
1076    # scrape the doxygen version
1077    AC_MSG_CHECKING([the doxygen version])
1078    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1079    AC_MSG_RESULT([$doxygen_version])
1080    AS_VERSION_COMPARE([$doxygen_version], [$1],
1081        [if test "x$use_doxygen" = xauto; then
1082            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1083            have_doxygen=no
1084        else
1085            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1086        fi])
1087fi])
1088
1089dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
1090dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
1091dnl 	HAVE_DOT = @HAVE_DOT@
1092HAVE_DOT=no
1093if test "x$have_doxygen" = "xyes"; then
1094  AC_PATH_PROG([DOT], [dot])
1095    if test "x$DOT" != "x"; then
1096      HAVE_DOT=yes
1097    fi
1098fi
1099
1100AC_SUBST([HAVE_DOT])
1101AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
1102AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1103]) # XORG_WITH_DOXYGEN
1104
1105# XORG_WITH_GROFF([DEFAULT])
1106# ----------------
1107# Minimum version: 1.6.0
1108# Minimum version for optional DEFAULT argument: 1.11.0
1109#
1110# Documentation tools are not always available on all platforms and sometimes
1111# not at the appropriate level. This macro enables a module to test for the
1112# presence of the tool and obtain it's path in separate variables. Coupled with
1113# the --with-groff option, it allows maximum flexibility in making decisions
1114# as whether or not to use the groff package. When DEFAULT is not specified,
1115# --with-groff assumes 'auto'.
1116#
1117# Interface to module:
1118# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1119# HAVE_GROFF_MM: the memorandum macros (-mm) package
1120# HAVE_GROFF_MS: the -ms macros package
1121# GROFF:	 returns the path of the groff program found
1122#		 returns the path set by the user in the environment
1123# --with-groff:	 'yes' user instructs the module to use groff
1124#		 'no' user instructs the module not to use groff
1125#
1126# Added in version 1.9.0:
1127# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1128#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1129#		   psselect from the psutils package.
1130#		   the ghostcript package. Refer to the grohtml man pages
1131#
1132# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1133#
1134# OS and distros often splits groff in a basic and full package, the former
1135# having the groff program and the later having devices, fonts and macros
1136# Checking for the groff executable is not enough.
1137#
1138# If macros are missing, we cannot assume that groff is useless, so we don't
1139# unset HAVE_GROFF or GROFF env variables.
1140# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1141#
1142AC_DEFUN([XORG_WITH_GROFF],[
1143AC_ARG_VAR([GROFF], [Path to groff command])
1144m4_define([_defopt], m4_default([$1], [auto]))
1145AC_ARG_WITH(groff,
1146	AS_HELP_STRING([--with-groff],
1147	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1148	   [use_groff=$withval], [use_groff=]_defopt)
1149m4_undefine([_defopt])
1150
1151if test "x$use_groff" = x"auto"; then
1152   AC_PATH_PROG([GROFF], [groff])
1153   if test "x$GROFF" = "x"; then
1154        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1155	have_groff=no
1156   else
1157        have_groff=yes
1158   fi
1159elif test "x$use_groff" = x"yes" ; then
1160   AC_PATH_PROG([GROFF], [groff])
1161   if test "x$GROFF" = "x"; then
1162        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1163   fi
1164   have_groff=yes
1165elif test "x$use_groff" = x"no" ; then
1166   if test "x$GROFF" != "x"; then
1167      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1168   fi
1169   have_groff=no
1170else
1171   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1172fi
1173
1174# We have groff, test for the presence of the macro packages
1175if test "x$have_groff" = x"yes"; then
1176    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1177    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1178        groff_ms_works=yes
1179    else
1180        groff_ms_works=no
1181    fi
1182    AC_MSG_RESULT([$groff_ms_works])
1183    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1184    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1185        groff_mm_works=yes
1186    else
1187        groff_mm_works=no
1188    fi
1189    AC_MSG_RESULT([$groff_mm_works])
1190fi
1191
1192# We have groff, test for HTML dependencies, one command per package
1193if test "x$have_groff" = x"yes"; then
1194   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1195   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1196   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1197   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1198      have_groff_html=yes
1199   else
1200      have_groff_html=no
1201      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1202   fi
1203fi
1204
1205# Set Automake conditionals for Makefiles
1206AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1207AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1208AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1209AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1210]) # XORG_WITH_GROFF
1211
1212# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1213# ---------------------------------------
1214# Minimum version: 1.6.0
1215# Minimum version for optional DEFAULT argument: 1.11.0
1216# Minimum version for optional MIN-VERSION argument: 1.15.0
1217#
1218# Documentation tools are not always available on all platforms and sometimes
1219# not at the appropriate level. This macro enables a module to test for the
1220# presence of the tool and obtain it's path in separate variables. Coupled with
1221# the --with-fop option, it allows maximum flexibility in making decisions
1222# as whether or not to use the fop package. When DEFAULT is not specified,
1223# --with-fop assumes 'auto'.
1224#
1225# Interface to module:
1226# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1227# FOP:	 	returns the path of the fop program found
1228#		returns the path set by the user in the environment
1229# --with-fop: 	'yes' user instructs the module to use fop
1230#		'no' user instructs the module not to use fop
1231#
1232# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1233#
1234AC_DEFUN([XORG_WITH_FOP],[
1235AC_ARG_VAR([FOP], [Path to fop command])
1236m4_define([_defopt], m4_default([$2], [auto]))
1237AC_ARG_WITH(fop,
1238	AS_HELP_STRING([--with-fop],
1239	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1240	   [use_fop=$withval], [use_fop=]_defopt)
1241m4_undefine([_defopt])
1242
1243if test "x$use_fop" = x"auto"; then
1244   AC_PATH_PROG([FOP], [fop])
1245   if test "x$FOP" = "x"; then
1246        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1247	have_fop=no
1248   else
1249        have_fop=yes
1250   fi
1251elif test "x$use_fop" = x"yes" ; then
1252   AC_PATH_PROG([FOP], [fop])
1253   if test "x$FOP" = "x"; then
1254        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1255   fi
1256   have_fop=yes
1257elif test "x$use_fop" = x"no" ; then
1258   if test "x$FOP" != "x"; then
1259      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1260   fi
1261   have_fop=no
1262else
1263   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1264fi
1265
1266# Test for a minimum version of fop, if provided.
1267m4_ifval([$1],
1268[if test "$have_fop" = yes; then
1269    # scrape the fop version
1270    AC_MSG_CHECKING([for fop minimum version])
1271    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1272    AC_MSG_RESULT([$fop_version])
1273    AS_VERSION_COMPARE([$fop_version], [$1],
1274        [if test "x$use_fop" = xauto; then
1275            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1276            have_fop=no
1277        else
1278            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1279        fi])
1280fi])
1281AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1282]) # XORG_WITH_FOP
1283
1284# XORG_WITH_M4([MIN-VERSION])
1285# ---------------------------
1286# Minimum version: 1.19.0
1287#
1288# This macro attempts to locate an m4 macro processor which supports
1289# -I option and is only useful for modules relying on M4 in order to
1290# expand macros in source code files.
1291#
1292# Interface to module:
1293# M4:	 	returns the path of the m4 program found
1294#		returns the path set by the user in the environment
1295#
1296AC_DEFUN([XORG_WITH_M4], [
1297AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
1298   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
1299       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
1300         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
1301   [AC_MSG_ERROR([could not find m4 that supports -I option])],
1302   [$PATH:/usr/gnu/bin])])
1303
1304AC_SUBST([M4], [$ac_cv_path_M4])
1305]) # XORG_WITH_M4
1306
1307# XORG_WITH_PS2PDF([DEFAULT])
1308# ----------------
1309# Minimum version: 1.6.0
1310# Minimum version for optional DEFAULT argument: 1.11.0
1311#
1312# Documentation tools are not always available on all platforms and sometimes
1313# not at the appropriate level. This macro enables a module to test for the
1314# presence of the tool and obtain it's path in separate variables. Coupled with
1315# the --with-ps2pdf option, it allows maximum flexibility in making decisions
1316# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1317# --with-ps2pdf assumes 'auto'.
1318#
1319# Interface to module:
1320# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1321# PS2PDF:	returns the path of the ps2pdf program found
1322#		returns the path set by the user in the environment
1323# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1324#		 'no' user instructs the module not to use ps2pdf
1325#
1326# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1327#
1328AC_DEFUN([XORG_WITH_PS2PDF],[
1329AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1330m4_define([_defopt], m4_default([$1], [auto]))
1331AC_ARG_WITH(ps2pdf,
1332	AS_HELP_STRING([--with-ps2pdf],
1333	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1334	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1335m4_undefine([_defopt])
1336
1337if test "x$use_ps2pdf" = x"auto"; then
1338   AC_PATH_PROG([PS2PDF], [ps2pdf])
1339   if test "x$PS2PDF" = "x"; then
1340        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1341	have_ps2pdf=no
1342   else
1343        have_ps2pdf=yes
1344   fi
1345elif test "x$use_ps2pdf" = x"yes" ; then
1346   AC_PATH_PROG([PS2PDF], [ps2pdf])
1347   if test "x$PS2PDF" = "x"; then
1348        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1349   fi
1350   have_ps2pdf=yes
1351elif test "x$use_ps2pdf" = x"no" ; then
1352   if test "x$PS2PDF" != "x"; then
1353      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1354   fi
1355   have_ps2pdf=no
1356else
1357   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1358fi
1359AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1360]) # XORG_WITH_PS2PDF
1361
1362# XORG_ENABLE_DOCS (enable_docs=yes)
1363# ----------------
1364# Minimum version: 1.6.0
1365#
1366# Documentation tools are not always available on all platforms and sometimes
1367# not at the appropriate level. This macro enables a builder to skip all
1368# documentation targets except traditional man pages.
1369# Combined with the specific tool checking macros XORG_WITH_*, it provides
1370# maximum flexibility in controlling documentation building.
1371# Refer to:
1372# XORG_WITH_XMLTO         --with-xmlto
1373# XORG_WITH_ASCIIDOC      --with-asciidoc
1374# XORG_WITH_DOXYGEN       --with-doxygen
1375# XORG_WITH_FOP           --with-fop
1376# XORG_WITH_GROFF         --with-groff
1377# XORG_WITH_PS2PDF        --with-ps2pdf
1378#
1379# Interface to module:
1380# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1381# --enable-docs: 'yes' user instructs the module to generate docs
1382#		 'no' user instructs the module not to generate docs
1383# parm1:	specify the default value, yes or no.
1384#
1385AC_DEFUN([XORG_ENABLE_DOCS],[
1386m4_define([docs_default], m4_default([$1], [yes]))
1387AC_ARG_ENABLE(docs,
1388	AS_HELP_STRING([--enable-docs],
1389	   [Enable building the documentation (default: ]docs_default[)]),
1390	   [build_docs=$enableval], [build_docs=]docs_default)
1391m4_undefine([docs_default])
1392AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1393AC_MSG_CHECKING([whether to build documentation])
1394AC_MSG_RESULT([$build_docs])
1395]) # XORG_ENABLE_DOCS
1396
1397# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1398# ----------------
1399# Minimum version: 1.6.0
1400#
1401# This macro enables a builder to skip all developer documentation.
1402# Combined with the specific tool checking macros XORG_WITH_*, it provides
1403# maximum flexibility in controlling documentation building.
1404# Refer to:
1405# XORG_WITH_XMLTO         --with-xmlto
1406# XORG_WITH_ASCIIDOC      --with-asciidoc
1407# XORG_WITH_DOXYGEN       --with-doxygen
1408# XORG_WITH_FOP           --with-fop
1409# XORG_WITH_GROFF         --with-groff
1410# XORG_WITH_PS2PDF        --with-ps2pdf
1411#
1412# Interface to module:
1413# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1414# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1415#			'no' user instructs the module not to generate developer docs
1416# parm1:		specify the default value, yes or no.
1417#
1418AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1419m4_define([devel_default], m4_default([$1], [yes]))
1420AC_ARG_ENABLE(devel-docs,
1421	AS_HELP_STRING([--enable-devel-docs],
1422	   [Enable building the developer documentation (default: ]devel_default[)]),
1423	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1424m4_undefine([devel_default])
1425AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1426AC_MSG_CHECKING([whether to build developer documentation])
1427AC_MSG_RESULT([$build_devel_docs])
1428]) # XORG_ENABLE_DEVEL_DOCS
1429
1430# XORG_ENABLE_SPECS (enable_specs=yes)
1431# ----------------
1432# Minimum version: 1.6.0
1433#
1434# This macro enables a builder to skip all functional specification targets.
1435# Combined with the specific tool checking macros XORG_WITH_*, it provides
1436# maximum flexibility in controlling documentation building.
1437# Refer to:
1438# XORG_WITH_XMLTO         --with-xmlto
1439# XORG_WITH_ASCIIDOC      --with-asciidoc
1440# XORG_WITH_DOXYGEN       --with-doxygen
1441# XORG_WITH_FOP           --with-fop
1442# XORG_WITH_GROFF         --with-groff
1443# XORG_WITH_PS2PDF        --with-ps2pdf
1444#
1445# Interface to module:
1446# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1447# --enable-specs:	'yes' user instructs the module to generate specs
1448#			'no' user instructs the module not to generate specs
1449# parm1:		specify the default value, yes or no.
1450#
1451AC_DEFUN([XORG_ENABLE_SPECS],[
1452m4_define([spec_default], m4_default([$1], [yes]))
1453AC_ARG_ENABLE(specs,
1454	AS_HELP_STRING([--enable-specs],
1455	   [Enable building the specs (default: ]spec_default[)]),
1456	   [build_specs=$enableval], [build_specs=]spec_default)
1457m4_undefine([spec_default])
1458AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1459AC_MSG_CHECKING([whether to build functional specifications])
1460AC_MSG_RESULT([$build_specs])
1461]) # XORG_ENABLE_SPECS
1462
1463# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
1464# ----------------------------------------------
1465# Minimum version: 1.13.0
1466#
1467# This macro enables a builder to enable/disable unit testing
1468# It makes no assumption about the test cases implementation
1469# Test cases may or may not use Automake "Support for test suites"
1470# They may or may not use the software utility library GLib
1471#
1472# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
1473# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
1474# The variable enable_unit_tests is used by other macros in this file.
1475#
1476# Interface to module:
1477# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
1478# enable_unit_tests:    used in configure.ac for additional configuration
1479# --enable-unit-tests:	'yes' user instructs the module to build tests
1480#			'no' user instructs the module not to build tests
1481# parm1:		specify the default value, yes or no.
1482#
1483AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
1484AC_BEFORE([$0], [XORG_WITH_GLIB])
1485AC_BEFORE([$0], [XORG_LD_WRAP])
1486AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1487m4_define([_defopt], m4_default([$1], [auto]))
1488AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
1489	[Enable building unit test cases (default: ]_defopt[)]),
1490	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
1491m4_undefine([_defopt])
1492AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
1493AC_MSG_CHECKING([whether to build unit test cases])
1494AC_MSG_RESULT([$enable_unit_tests])
1495]) # XORG_ENABLE_UNIT_TESTS
1496
1497# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
1498# ------------------------------------------------------
1499# Minimum version: 1.17.0
1500#
1501# This macro enables a builder to enable/disable integration testing
1502# It makes no assumption about the test cases' implementation
1503# Test cases may or may not use Automake "Support for test suites"
1504#
1505# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
1506# usually requires less dependencies and may be built and run under less
1507# stringent environments than integration tests.
1508#
1509# Interface to module:
1510# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
1511# enable_integration_tests:   used in configure.ac for additional configuration
1512# --enable-integration-tests: 'yes' user instructs the module to build tests
1513#                             'no' user instructs the module not to build tests
1514# parm1:                      specify the default value, yes or no.
1515#
1516AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
1517AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1518m4_define([_defopt], m4_default([$1], [auto]))
1519AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
1520	[Enable building integration test cases (default: ]_defopt[)]),
1521	[enable_integration_tests=$enableval],
1522	[enable_integration_tests=]_defopt)
1523m4_undefine([_defopt])
1524AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
1525	[test "x$enable_integration_tests" != xno])
1526AC_MSG_CHECKING([whether to build unit test cases])
1527AC_MSG_RESULT([$enable_integration_tests])
1528]) # XORG_ENABLE_INTEGRATION_TESTS
1529
1530# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
1531# ----------------------------------------
1532# Minimum version: 1.13.0
1533#
1534# GLib is a library which provides advanced data structures and functions.
1535# This macro enables a module to test for the presence of Glib.
1536#
1537# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
1538# Otherwise the value of $enable_unit_tests is blank.
1539#
1540# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
1541# test support usually requires less dependencies and may be built and run under
1542# less stringent environments than integration tests.
1543#
1544# Interface to module:
1545# HAVE_GLIB: used in makefiles to conditionally build targets
1546# with_glib: used in configure.ac to know if GLib has been found
1547# --with-glib:	'yes' user instructs the module to use glib
1548#		'no' user instructs the module not to use glib
1549#
1550AC_DEFUN([XORG_WITH_GLIB],[
1551AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1552m4_define([_defopt], m4_default([$2], [auto]))
1553AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
1554	[Use GLib library for unit testing (default: ]_defopt[)]),
1555	[with_glib=$withval], [with_glib=]_defopt)
1556m4_undefine([_defopt])
1557
1558have_glib=no
1559# Do not probe GLib if user explicitly disabled unit testing
1560if test "x$enable_unit_tests" != x"no"; then
1561  # Do not probe GLib if user explicitly disabled it
1562  if test "x$with_glib" != x"no"; then
1563    m4_ifval(
1564      [$1],
1565      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1566      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1567    )
1568  fi
1569fi
1570
1571# Not having GLib when unit testing has been explicitly requested is an error
1572if test "x$enable_unit_tests" = x"yes"; then
1573  if test "x$have_glib" = x"no"; then
1574    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1575  fi
1576fi
1577
1578# Having unit testing disabled when GLib has been explicitly requested is an error
1579if test "x$enable_unit_tests" = x"no"; then
1580  if test "x$with_glib" = x"yes"; then
1581    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1582  fi
1583fi
1584
1585# Not having GLib when it has been explicitly requested is an error
1586if test "x$with_glib" = x"yes"; then
1587  if test "x$have_glib" = x"no"; then
1588    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1589  fi
1590fi
1591
1592AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1593]) # XORG_WITH_GLIB
1594
1595# XORG_LD_WRAP([required|optional])
1596# ---------------------------------
1597# Minimum version: 1.13.0
1598#
1599# Check if linker supports -wrap, passed via compiler flags
1600#
1601# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1602# Otherwise the value of $enable_unit_tests is blank.
1603#
1604# Argument added in 1.16.0 - default is "required", to match existing behavior
1605# of returning an error if enable_unit_tests is yes, and ld -wrap is not
1606# available, an argument of "optional" allows use when some unit tests require
1607# ld -wrap and others do not.
1608#
1609AC_DEFUN([XORG_LD_WRAP],[
1610XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
1611    [AC_LANG_PROGRAM([#include <stdlib.h>
1612                      void __wrap_exit(int status) { return; }],
1613                     [exit(0);])])
1614# Not having ld wrap when unit testing has been explicitly requested is an error
1615if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
1616  if test "x$have_ld_wrap" = x"no"; then
1617    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1618  fi
1619fi
1620AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1621#
1622]) # XORG_LD_WRAP
1623
1624# XORG_CHECK_LINKER_FLAGS
1625# -----------------------
1626# SYNOPSIS
1627#
1628#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1629#
1630# DESCRIPTION
1631#
1632#   Check whether the given linker FLAGS work with the current language's
1633#   linker, or whether they give an error.
1634#
1635#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1636#   success/failure.
1637#
1638#   PROGRAM-SOURCE is the program source to link with, if needed
1639#
1640#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1641#
1642# LICENSE
1643#
1644#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1645#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1646#   Copyright (c) 2009 Matteo Frigo
1647#
1648#   This program is free software: you can redistribute it and/or modify it
1649#   under the terms of the GNU General Public License as published by the
1650#   Free Software Foundation, either version 3 of the License, or (at your
1651#   option) any later version.
1652#
1653#   This program is distributed in the hope that it will be useful, but
1654#   WITHOUT ANY WARRANTY; without even the implied warranty of
1655#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1656#   Public License for more details.
1657#
1658#   You should have received a copy of the GNU General Public License along
1659#   with this program. If not, see <http://www.gnu.org/licenses/>.
1660#
1661#   As a special exception, the respective Autoconf Macro's copyright owner
1662#   gives unlimited permission to copy, distribute and modify the configure
1663#   scripts that are the output of Autoconf when processing the Macro. You
1664#   need not follow the terms of the GNU General Public License when using
1665#   or distributing such scripts, even though portions of the text of the
1666#   Macro appear in them. The GNU General Public License (GPL) does govern
1667#   all other use of the material that constitutes the Autoconf Macro.
1668#
1669#   This special exception to the GPL applies to versions of the Autoconf
1670#   Macro released by the Autoconf Archive. When you make and distribute a
1671#   modified version of the Autoconf Macro, you may extend this special
1672#   exception to the GPL to apply to your modified version as well.#
1673AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1674[AC_MSG_CHECKING([whether the linker accepts $1])
1675dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1676AS_LITERAL_IF([$1],
1677  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1678      ax_save_FLAGS=$LDFLAGS
1679      LDFLAGS="$1"
1680      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1681        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1682        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1683      LDFLAGS=$ax_save_FLAGS])],
1684  [ax_save_FLAGS=$LDFLAGS
1685   LDFLAGS="$1"
1686   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1687     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1688     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1689   LDFLAGS=$ax_save_FLAGS])
1690eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1691AC_MSG_RESULT($xorg_check_linker_flags)
1692if test "x$xorg_check_linker_flags" = xyes; then
1693	m4_default([$2], :)
1694else
1695	m4_default([$3], :)
1696fi
1697]) # XORG_CHECK_LINKER_FLAGS
1698
1699# XORG_MEMORY_CHECK_FLAGS
1700# -----------------------
1701# Minimum version: 1.16.0
1702#
1703# This macro attempts to find appropriate memory checking functionality
1704# for various platforms which unit testing code may use to catch various
1705# forms of memory allocation and access errors in testing.
1706#
1707# Interface to module:
1708# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1709#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
1710#
1711# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1712#
1713AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
1714
1715AC_REQUIRE([AC_CANONICAL_HOST])
1716AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1717           [Environment variables to enable memory checking in tests])
1718
1719# Check for different types of support on different platforms
1720case $host_os in
1721    solaris*)
1722        AC_CHECK_LIB([umem], [umem_alloc],
1723            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1724        ;;
1725    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1726        # both directly and inverted, so should not be 0 or 255.
1727        malloc_debug_env='MALLOC_PERTURB_=15'
1728        ;;
1729    darwin*)
1730        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1731        ;;
1732    *bsd*)
1733        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1734        ;;
1735esac
1736
1737# User supplied flags override default flags
1738if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1739    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
1740fi
1741
1742AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1743]) # XORG_WITH_LINT
1744
1745# XORG_CHECK_MALLOC_ZERO
1746# ----------------------
1747# Minimum version: 1.0.0
1748#
1749# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1750# malloc(0) returns NULL.  Packages should add one of these cflags to
1751# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1752#
1753# No longer actually tests since there is no guarantee applications will
1754# run with the same malloc implementation we tested against, and the cost
1755# of always ensuring the size passed to malloc is non-zero is minimal now.
1756# Still allows builders to override when they have complete control over
1757# which malloc implementation will be used.
1758AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1759AC_ARG_ENABLE(malloc0returnsnull,
1760	AS_HELP_STRING([--enable-malloc0returnsnull],
1761		       [assume malloc(0) can return NULL (default: yes)]),
1762	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1763	[MALLOC_ZERO_RETURNS_NULL=yes])
1764
1765AC_MSG_CHECKING([whether to act as if malloc(0) can return NULL])
1766AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1767
1768if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1769	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1770	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1771	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1772else
1773	MALLOC_ZERO_CFLAGS=""
1774	XMALLOC_ZERO_CFLAGS=""
1775	XTMALLOC_ZERO_CFLAGS=""
1776fi
1777
1778AC_SUBST([MALLOC_ZERO_CFLAGS])
1779AC_SUBST([XMALLOC_ZERO_CFLAGS])
1780AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1781]) # XORG_CHECK_MALLOC_ZERO
1782
1783# XORG_WITH_LINT()
1784# ----------------
1785# Minimum version: 1.1.0
1786#
1787# This macro enables the use of a tool that flags some suspicious and
1788# non-portable constructs (likely to be bugs) in C language source code.
1789# It will attempt to locate the tool and use appropriate options.
1790# There are various lint type tools on different platforms.
1791#
1792# Interface to module:
1793# LINT:		returns the path to the tool found on the platform
1794#		or the value set to LINT on the configure cmd line
1795#		also an Automake conditional
1796# LINT_FLAGS:	an Automake variable with appropriate flags
1797#
1798# --with-lint:	'yes' user instructs the module to use lint
1799#		'no' user instructs the module not to use lint (default)
1800#
1801# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1802# If the user sets the value of LINT_FLAGS, they are used verbatim.
1803#
1804AC_DEFUN([XORG_WITH_LINT],[
1805
1806AC_ARG_VAR([LINT], [Path to a lint-style command])
1807AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1808AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1809		[Use a lint-style source code checker (default: disabled)])],
1810		[use_lint=$withval], [use_lint=no])
1811
1812# Obtain platform specific info like program name and options
1813# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1814case $host_os in
1815  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1816	lint_name=splint
1817	lint_options="-badflag"
1818	;;
1819  *freebsd* | *netbsd*)
1820	lint_name=lint
1821	lint_options="-u -b"
1822	;;
1823  *solaris*)
1824	lint_name=lint
1825	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1826	;;
1827esac
1828
1829# Test for the presence of the program (either guessed by the code or spelled out by the user)
1830if test "x$use_lint" = x"yes" ; then
1831   AC_PATH_PROG([LINT], [$lint_name])
1832   if test "x$LINT" = "x"; then
1833        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1834   fi
1835elif test "x$use_lint" = x"no" ; then
1836   if test "x$LINT" != "x"; then
1837      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1838   fi
1839else
1840   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1841fi
1842
1843# User supplied flags override default flags
1844if test "x$LINT_FLAGS" != "x"; then
1845   lint_options=$LINT_FLAGS
1846fi
1847
1848AC_SUBST([LINT_FLAGS],[$lint_options])
1849AM_CONDITIONAL(LINT, [test "x$LINT" != x])
1850
1851]) # XORG_WITH_LINT
1852
1853# XORG_LINT_LIBRARY(LIBNAME)
1854# --------------------------
1855# Minimum version: 1.1.0
1856#
1857# Sets up flags for building lint libraries for checking programs that call
1858# functions in the library.
1859#
1860# Interface to module:
1861# LINTLIB		- Automake variable with the name of lint library file to make
1862# MAKE_LINT_LIB		- Automake conditional
1863#
1864# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1865#			  - 'no' user instructs the module not to create a lint library (default)
1866
1867AC_DEFUN([XORG_LINT_LIBRARY],[
1868AC_REQUIRE([XORG_WITH_LINT])
1869AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1870	[Create lint library (default: disabled)])],
1871	[make_lint_lib=$enableval], [make_lint_lib=no])
1872
1873if test "x$make_lint_lib" = x"yes" ; then
1874   LINTLIB=llib-l$1.ln
1875   if test "x$LINT" = "x"; then
1876        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1877   fi
1878elif test "x$make_lint_lib" != x"no" ; then
1879   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1880fi
1881
1882AC_SUBST(LINTLIB)
1883AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1884
1885]) # XORG_LINT_LIBRARY
1886
1887# XORG_COMPILER_BRAND
1888# -------------------
1889# Minimum version: 1.14.0
1890#
1891# Checks for various brands of compilers and sets flags as appropriate:
1892#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1893#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1894#   clang compiler - sets CLANGCC to "yes"
1895#   Intel compiler - sets INTELCC to "yes"
1896#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1897#
1898AC_DEFUN([XORG_COMPILER_BRAND], [
1899AC_LANG_CASE(
1900	[C], [
1901		dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
1902		dnl and complains that AC_PROG_CC_C99 is obsolete
1903		m4_version_prereq([2.70],
1904			[AC_REQUIRE([AC_PROG_CC])],
1905			[AC_REQUIRE([AC_PROG_CC_C99])])
1906	],
1907	[C++], [
1908		AC_REQUIRE([AC_PROG_CXX])
1909	]
1910)
1911AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1912AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1913AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1914]) # XORG_COMPILER_BRAND
1915
1916# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1917# ---------------
1918# Minimum version: 1.16.0
1919#
1920# Test if the compiler works when passed the given flag as a command line argument.
1921# If it succeeds, the flag is appended to the given variable.  If not, it tries the
1922# next flag in the list until there are no more options.
1923#
1924# Note that this does not guarantee that the compiler supports the flag as some
1925# compilers will simply ignore arguments that they do not understand, but we do
1926# attempt to weed out false positives by using -Werror=unknown-warning-option and
1927# -Werror=unused-command-line-argument
1928#
1929AC_DEFUN([XORG_TESTSET_CFLAG], [
1930m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1931m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1932
1933AC_LANG_COMPILER_REQUIRE
1934
1935AC_LANG_CASE(
1936	[C], [
1937		dnl autoconf-2.70 folded AC_PROG_CC_C99 into AC_PROG_CC
1938		dnl and complains that AC_PROG_CC_C99 is obsolete
1939		m4_version_prereq([2.70],
1940			[AC_REQUIRE([AC_PROG_CC])],
1941			[AC_REQUIRE([AC_PROG_CC_C99])])
1942		define([PREFIX], [C])
1943		define([CACHE_PREFIX], [cc])
1944		define([COMPILER], [$CC])
1945	],
1946	[C++], [
1947		define([PREFIX], [CXX])
1948		define([CACHE_PREFIX], [cxx])
1949		define([COMPILER], [$CXX])
1950	]
1951)
1952
1953[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1954
1955if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1956	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1957	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1958			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1959			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1960					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1961					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1962	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1963	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1964fi
1965
1966if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1967	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1968		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1969	fi
1970	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1971	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1972			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1973			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1974					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1975					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1976	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1977	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1978fi
1979
1980found="no"
1981m4_foreach([flag], m4_cdr($@), [
1982	if test $found = "no" ; then
1983		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
1984			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1985		fi
1986
1987		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
1988			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1989		fi
1990
1991		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
1992
1993dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1994		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
1995		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1996		AC_CACHE_VAL($cacheid,
1997			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1998					     [eval $cacheid=yes],
1999					     [eval $cacheid=no])])
2000
2001		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2002
2003		eval supported=\$$cacheid
2004		AC_MSG_RESULT([$supported])
2005		if test "$supported" = "yes" ; then
2006			$1="$$1 ]flag["
2007			found="yes"
2008		fi
2009	fi
2010])
2011]) # XORG_TESTSET_CFLAG
2012
2013# XORG_COMPILER_FLAGS
2014# ---------------
2015# Minimum version: 1.16.0
2016#
2017# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
2018# arguments supported by the selected compiler which do NOT alter the generated
2019# code.  These arguments will cause the compiler to print various warnings
2020# during compilation AND turn a conservative set of warnings into errors.
2021#
2022# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
2023# future versions of util-macros as options are added to new compilers.
2024#
2025AC_DEFUN([XORG_COMPILER_FLAGS], [
2026AC_REQUIRE([XORG_COMPILER_BRAND])
2027
2028AC_ARG_ENABLE(selective-werror,
2029              AS_HELP_STRING([--disable-selective-werror],
2030                             [Turn off selective compiler errors. (default: enabled)]),
2031              [SELECTIVE_WERROR=$enableval],
2032              [SELECTIVE_WERROR=yes])
2033
2034AC_LANG_CASE(
2035        [C], [
2036                define([PREFIX], [C])
2037        ],
2038        [C++], [
2039                define([PREFIX], [CXX])
2040        ]
2041)
2042# -v is too short to test reliably with XORG_TESTSET_CFLAG
2043if test "x$SUNCC" = "xyes"; then
2044    [BASE_]PREFIX[FLAGS]="-v"
2045else
2046    [BASE_]PREFIX[FLAGS]=""
2047fi
2048
2049# This chunk of warnings were those that existed in the legacy CWARNFLAGS
2050XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
2051XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
2052XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
2053XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
2054
2055AC_LANG_CASE(
2056	[C], [
2057		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
2058		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
2059		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
2060		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
2061		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
2062	]
2063)
2064
2065# This chunk adds additional warnings that could catch undesired effects.
2066XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
2067XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
2068XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
2069XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
2070XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
2071XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
2072XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
2073
2074# These are currently disabled because they are noisy.  They will be enabled
2075# in the future once the codebase is sufficiently modernized to silence
2076# them.  For now, I don't want them to drown out the other warnings.
2077# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
2078# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
2079# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
2080
2081# Turn some warnings into errors, so we don't accidentally get successful builds
2082# when there are problems that should be fixed.
2083
2084if test "x$SELECTIVE_WERROR" = "xyes" ; then
2085XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
2086XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
2087XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
2088XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
2089XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
2090XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
2091XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
2092XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
2093XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
2094XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
2095XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
2096XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
2097XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
2098else
2099AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
2100XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
2101XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
2102XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
2103XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
2104XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
2105XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
2106XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
2107XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
2108XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
2109XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
2110XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
2111XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
2112XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
2113fi
2114
2115AC_SUBST([BASE_]PREFIX[FLAGS])
2116]) # XORG_COMPILER_FLAGS
2117
2118# XORG_CWARNFLAGS
2119# ---------------
2120# Minimum version: 1.2.0
2121# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
2122#
2123# Defines CWARNFLAGS to enable C compiler warnings.
2124#
2125# This function is deprecated because it defines -fno-strict-aliasing
2126# which alters the code generated by the compiler.  If -fno-strict-aliasing
2127# is needed, then it should be added explicitly in the module when
2128# it is updated to use BASE_CFLAGS.
2129#
2130AC_DEFUN([XORG_CWARNFLAGS], [
2131AC_REQUIRE([XORG_COMPILER_FLAGS])
2132AC_REQUIRE([XORG_COMPILER_BRAND])
2133AC_LANG_CASE(
2134	[C], [
2135		CWARNFLAGS="$BASE_CFLAGS"
2136		if  test "x$GCC" = xyes ; then
2137		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
2138		fi
2139		AC_SUBST(CWARNFLAGS)
2140	]
2141)
2142]) # XORG_CWARNFLAGS
2143
2144# XORG_STRICT_OPTION
2145# -----------------------
2146# Minimum version: 1.3.0
2147#
2148# Add configure option to enable strict compilation flags, such as treating
2149# warnings as fatal errors.
2150# If --enable-strict-compilation is passed to configure, adds strict flags to
2151# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
2152#
2153# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
2154# when strict compilation is unconditionally desired.
2155AC_DEFUN([XORG_STRICT_OPTION], [
2156AC_REQUIRE([XORG_CWARNFLAGS])
2157AC_REQUIRE([XORG_COMPILER_FLAGS])
2158
2159AC_ARG_ENABLE(strict-compilation,
2160			  AS_HELP_STRING([--enable-strict-compilation],
2161			  [Enable all warnings from compiler and make them errors (default: disabled)]),
2162			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2163
2164AC_LANG_CASE(
2165        [C], [
2166                define([PREFIX], [C])
2167        ],
2168        [C++], [
2169                define([PREFIX], [CXX])
2170        ]
2171)
2172
2173[STRICT_]PREFIX[FLAGS]=""
2174XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
2175XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
2176
2177# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
2178# activate it with -Werror, so we add it here explicitly.
2179XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
2180
2181if test "x$STRICT_COMPILE" = "xyes"; then
2182    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
2183    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
2184fi
2185AC_SUBST([STRICT_]PREFIX[FLAGS])
2186AC_SUBST([BASE_]PREFIX[FLAGS])
2187AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
2188]) # XORG_STRICT_OPTION
2189
2190# XORG_DEFAULT_NOCODE_OPTIONS
2191# ---------------------------
2192# Minimum version: 1.20.0
2193#
2194# Defines default options for X.Org modules which don't compile code,
2195# such as fonts, bitmaps, cursors, and docs.
2196#
2197AC_DEFUN([XORG_DEFAULT_NOCODE_OPTIONS], [
2198AC_REQUIRE([AC_PROG_INSTALL])
2199XORG_RELEASE_VERSION
2200XORG_CHANGELOG
2201XORG_INSTALL
2202XORG_MANPAGE_SECTIONS
2203m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2204    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2205]) # XORG_DEFAULT_NOCODE_OPTIONS
2206
2207# XORG_DEFAULT_OPTIONS
2208# --------------------
2209# Minimum version: 1.3.0
2210#
2211# Defines default options for X.Org modules which compile code.
2212#
2213AC_DEFUN([XORG_DEFAULT_OPTIONS], [
2214AC_REQUIRE([AC_PROG_INSTALL])
2215XORG_COMPILER_FLAGS
2216XORG_CWARNFLAGS
2217XORG_STRICT_OPTION
2218XORG_DEFAULT_NOCODE_OPTIONS
2219]) # XORG_DEFAULT_OPTIONS
2220
2221# XORG_INSTALL()
2222# ----------------
2223# Minimum version: 1.4.0
2224#
2225# Defines the variable INSTALL_CMD as the command to copy
2226# INSTALL from $prefix/share/util-macros.
2227#
2228AC_DEFUN([XORG_INSTALL], [
2229AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2230macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2231INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2232mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2233|| (rm -f \$(top_srcdir)/.INSTALL.tmp; test -e \$(top_srcdir)/INSTALL || ( \
2234touch \$(top_srcdir)/INSTALL; \
2235echo 'failed to copy INSTALL from util-macros: installing empty INSTALL.' >&2))"
2236AC_SUBST([INSTALL_CMD])
2237]) # XORG_INSTALL
2238dnl Copyright 2005 Red Hat, Inc
2239dnl
2240dnl Permission to use, copy, modify, distribute, and sell this software and its
2241dnl documentation for any purpose is hereby granted without fee, provided that
2242dnl the above copyright notice appear in all copies and that both that
2243dnl copyright notice and this permission notice appear in supporting
2244dnl documentation.
2245dnl
2246dnl The above copyright notice and this permission notice shall be included
2247dnl in all copies or substantial portions of the Software.
2248dnl
2249dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2250dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2251dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2252dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2253dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2254dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2255dnl OTHER DEALINGS IN THE SOFTWARE.
2256dnl
2257dnl Except as contained in this notice, the name of the copyright holders shall
2258dnl not be used in advertising or otherwise to promote the sale, use or
2259dnl other dealings in this Software without prior written authorization
2260dnl from the copyright holders.
2261dnl
2262
2263# XORG_RELEASE_VERSION
2264# --------------------
2265# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2266
2267AC_DEFUN([XORG_RELEASE_VERSION],[
2268	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2269		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2270		[Major version of this package])
2271	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2272	if test "x$PVM" = "x"; then
2273		PVM="0"
2274	fi
2275	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2276		[$PVM],
2277		[Minor version of this package])
2278	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2279	if test "x$PVP" = "x"; then
2280		PVP="0"
2281	fi
2282	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2283		[$PVP],
2284		[Patch version of this package])
2285])
2286
2287# XORG_CHANGELOG()
2288# ----------------
2289# Minimum version: 1.2.0
2290#
2291# Defines the variable CHANGELOG_CMD as the command to generate
2292# ChangeLog from git.
2293#
2294#
2295AC_DEFUN([XORG_CHANGELOG], [
2296CHANGELOG_CMD="((GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp) 2>/dev/null && \
2297mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2298|| (rm -f \$(top_srcdir)/.changelog.tmp; test -e \$(top_srcdir)/ChangeLog || ( \
2299touch \$(top_srcdir)/ChangeLog; \
2300echo 'git failed to create ChangeLog: installing empty ChangeLog.' >&2))"
2301AC_SUBST([CHANGELOG_CMD])
2302]) # XORG_CHANGELOG
2303
2304# Copyright (C) 2002-2021 Free Software Foundation, Inc.
2305#
2306# This file is free software; the Free Software Foundation
2307# gives unlimited permission to copy and/or distribute it,
2308# with or without modifications, as long as this notice is preserved.
2309
2310# AM_AUTOMAKE_VERSION(VERSION)
2311# ----------------------------
2312# Automake X.Y traces this macro to ensure aclocal.m4 has been
2313# generated from the m4 files accompanying Automake X.Y.
2314# (This private macro should not be called outside this file.)
2315AC_DEFUN([AM_AUTOMAKE_VERSION],
2316[am__api_version='1.16'
2317dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
2318dnl require some minimum version.  Point them to the right macro.
2319m4_if([$1], [1.16.5], [],
2320      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
2321])
2322
2323# _AM_AUTOCONF_VERSION(VERSION)
2324# -----------------------------
2325# aclocal traces this macro to find the Autoconf version.
2326# This is a private macro too.  Using m4_define simplifies
2327# the logic in aclocal, which can simply ignore this definition.
2328m4_define([_AM_AUTOCONF_VERSION], [])
2329
2330# AM_SET_CURRENT_AUTOMAKE_VERSION
2331# -------------------------------
2332# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
2333# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
2334AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
2335[AM_AUTOMAKE_VERSION([1.16.5])dnl
2336m4_ifndef([AC_AUTOCONF_VERSION],
2337  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
2338_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
2339
2340# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
2341
2342# Copyright (C) 2001-2021 Free Software Foundation, Inc.
2343#
2344# This file is free software; the Free Software Foundation
2345# gives unlimited permission to copy and/or distribute it,
2346# with or without modifications, as long as this notice is preserved.
2347
2348# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
2349# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
2350# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
2351#
2352# Of course, Automake must honor this variable whenever it calls a
2353# tool from the auxiliary directory.  The problem is that $srcdir (and
2354# therefore $ac_aux_dir as well) can be either absolute or relative,
2355# depending on how configure is run.  This is pretty annoying, since
2356# it makes $ac_aux_dir quite unusable in subdirectories: in the top
2357# source directory, any form will work fine, but in subdirectories a
2358# relative path needs to be adjusted first.
2359#
2360# $ac_aux_dir/missing
2361#    fails when called from a subdirectory if $ac_aux_dir is relative
2362# $top_srcdir/$ac_aux_dir/missing
2363#    fails if $ac_aux_dir is absolute,
2364#    fails when called from a subdirectory in a VPATH build with
2365#          a relative $ac_aux_dir
2366#
2367# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
2368# are both prefixed by $srcdir.  In an in-source build this is usually
2369# harmless because $srcdir is '.', but things will broke when you
2370# start a VPATH build or use an absolute $srcdir.
2371#
2372# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
2373# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
2374#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
2375# and then we would define $MISSING as
2376#   MISSING="\${SHELL} $am_aux_dir/missing"
2377# This will work as long as MISSING is not called from configure, because
2378# unfortunately $(top_srcdir) has no meaning in configure.
2379# However there are other variables, like CC, which are often used in
2380# configure, and could therefore not use this "fixed" $ac_aux_dir.
2381#
2382# Another solution, used here, is to always expand $ac_aux_dir to an
2383# absolute PATH.  The drawback is that using absolute paths prevent a
2384# configured tree to be moved without reconfiguration.
2385
2386AC_DEFUN([AM_AUX_DIR_EXPAND],
2387[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
2388# Expand $ac_aux_dir to an absolute path.
2389am_aux_dir=`cd "$ac_aux_dir" && pwd`
2390])
2391
2392# AM_CONDITIONAL                                            -*- Autoconf -*-
2393
2394# Copyright (C) 1997-2021 Free Software Foundation, Inc.
2395#
2396# This file is free software; the Free Software Foundation
2397# gives unlimited permission to copy and/or distribute it,
2398# with or without modifications, as long as this notice is preserved.
2399
2400# AM_CONDITIONAL(NAME, SHELL-CONDITION)
2401# -------------------------------------
2402# Define a conditional.
2403AC_DEFUN([AM_CONDITIONAL],
2404[AC_PREREQ([2.52])dnl
2405 m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
2406       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
2407AC_SUBST([$1_TRUE])dnl
2408AC_SUBST([$1_FALSE])dnl
2409_AM_SUBST_NOTMAKE([$1_TRUE])dnl
2410_AM_SUBST_NOTMAKE([$1_FALSE])dnl
2411m4_define([_AM_COND_VALUE_$1], [$2])dnl
2412if $2; then
2413  $1_TRUE=
2414  $1_FALSE='#'
2415else
2416  $1_TRUE='#'
2417  $1_FALSE=
2418fi
2419AC_CONFIG_COMMANDS_PRE(
2420[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
2421  AC_MSG_ERROR([[conditional "$1" was never defined.
2422Usually this means the macro was only invoked conditionally.]])
2423fi])])
2424
2425# Copyright (C) 1999-2021 Free Software Foundation, Inc.
2426#
2427# This file is free software; the Free Software Foundation
2428# gives unlimited permission to copy and/or distribute it,
2429# with or without modifications, as long as this notice is preserved.
2430
2431
2432# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
2433# written in clear, in which case automake, when reading aclocal.m4,
2434# will think it sees a *use*, and therefore will trigger all it's
2435# C support machinery.  Also note that it means that autoscan, seeing
2436# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
2437
2438
2439# _AM_DEPENDENCIES(NAME)
2440# ----------------------
2441# See how the compiler implements dependency checking.
2442# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
2443# We try a few techniques and use that to set a single cache variable.
2444#
2445# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
2446# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
2447# dependency, and given that the user is not expected to run this macro,
2448# just rely on AC_PROG_CC.
2449AC_DEFUN([_AM_DEPENDENCIES],
2450[AC_REQUIRE([AM_SET_DEPDIR])dnl
2451AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
2452AC_REQUIRE([AM_MAKE_INCLUDE])dnl
2453AC_REQUIRE([AM_DEP_TRACK])dnl
2454
2455m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
2456      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
2457      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
2458      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
2459      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
2460      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
2461                    [depcc="$$1"   am_compiler_list=])
2462
2463AC_CACHE_CHECK([dependency style of $depcc],
2464               [am_cv_$1_dependencies_compiler_type],
2465[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
2466  # We make a subdir and do the tests there.  Otherwise we can end up
2467  # making bogus files that we don't know about and never remove.  For
2468  # instance it was reported that on HP-UX the gcc test will end up
2469  # making a dummy file named 'D' -- because '-MD' means "put the output
2470  # in D".
2471  rm -rf conftest.dir
2472  mkdir conftest.dir
2473  # Copy depcomp to subdir because otherwise we won't find it if we're
2474  # using a relative directory.
2475  cp "$am_depcomp" conftest.dir
2476  cd conftest.dir
2477  # We will build objects and dependencies in a subdirectory because
2478  # it helps to detect inapplicable dependency modes.  For instance
2479  # both Tru64's cc and ICC support -MD to output dependencies as a
2480  # side effect of compilation, but ICC will put the dependencies in
2481  # the current directory while Tru64 will put them in the object
2482  # directory.
2483  mkdir sub
2484
2485  am_cv_$1_dependencies_compiler_type=none
2486  if test "$am_compiler_list" = ""; then
2487     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2488  fi
2489  am__universal=false
2490  m4_case([$1], [CC],
2491    [case " $depcc " in #(
2492     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2493     esac],
2494    [CXX],
2495    [case " $depcc " in #(
2496     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2497     esac])
2498
2499  for depmode in $am_compiler_list; do
2500    # Setup a source with many dependencies, because some compilers
2501    # like to wrap large dependency lists on column 80 (with \), and
2502    # we should not choose a depcomp mode which is confused by this.
2503    #
2504    # We need to recreate these files for each test, as the compiler may
2505    # overwrite some of them when testing with obscure command lines.
2506    # This happens at least with the AIX C compiler.
2507    : > sub/conftest.c
2508    for i in 1 2 3 4 5 6; do
2509      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2510      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
2511      # Solaris 10 /bin/sh.
2512      echo '/* dummy */' > sub/conftst$i.h
2513    done
2514    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2515
2516    # We check with '-c' and '-o' for the sake of the "dashmstdout"
2517    # mode.  It turns out that the SunPro C++ compiler does not properly
2518    # handle '-M -o', and we need to detect this.  Also, some Intel
2519    # versions had trouble with output in subdirs.
2520    am__obj=sub/conftest.${OBJEXT-o}
2521    am__minus_obj="-o $am__obj"
2522    case $depmode in
2523    gcc)
2524      # This depmode causes a compiler race in universal mode.
2525      test "$am__universal" = false || continue
2526      ;;
2527    nosideeffect)
2528      # After this tag, mechanisms are not by side-effect, so they'll
2529      # only be used when explicitly requested.
2530      if test "x$enable_dependency_tracking" = xyes; then
2531	continue
2532      else
2533	break
2534      fi
2535      ;;
2536    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
2537      # This compiler won't grok '-c -o', but also, the minuso test has
2538      # not run yet.  These depmodes are late enough in the game, and
2539      # so weak that their functioning should not be impacted.
2540      am__obj=conftest.${OBJEXT-o}
2541      am__minus_obj=
2542      ;;
2543    none) break ;;
2544    esac
2545    if depmode=$depmode \
2546       source=sub/conftest.c object=$am__obj \
2547       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2548       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2549         >/dev/null 2>conftest.err &&
2550       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2551       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2552       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2553       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2554      # icc doesn't choke on unknown options, it will just issue warnings
2555      # or remarks (even with -Werror).  So we grep stderr for any message
2556      # that says an option was ignored or not supported.
2557      # When given -MP, icc 7.0 and 7.1 complain thusly:
2558      #   icc: Command line warning: ignoring option '-M'; no argument required
2559      # The diagnosis changed in icc 8.0:
2560      #   icc: Command line remark: option '-MP' not supported
2561      if (grep 'ignoring option' conftest.err ||
2562          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2563        am_cv_$1_dependencies_compiler_type=$depmode
2564        break
2565      fi
2566    fi
2567  done
2568
2569  cd ..
2570  rm -rf conftest.dir
2571else
2572  am_cv_$1_dependencies_compiler_type=none
2573fi
2574])
2575AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2576AM_CONDITIONAL([am__fastdep$1], [
2577  test "x$enable_dependency_tracking" != xno \
2578  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2579])
2580
2581
2582# AM_SET_DEPDIR
2583# -------------
2584# Choose a directory name for dependency files.
2585# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
2586AC_DEFUN([AM_SET_DEPDIR],
2587[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2588AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2589])
2590
2591
2592# AM_DEP_TRACK
2593# ------------
2594AC_DEFUN([AM_DEP_TRACK],
2595[AC_ARG_ENABLE([dependency-tracking], [dnl
2596AS_HELP_STRING(
2597  [--enable-dependency-tracking],
2598  [do not reject slow dependency extractors])
2599AS_HELP_STRING(
2600  [--disable-dependency-tracking],
2601  [speeds up one-time build])])
2602if test "x$enable_dependency_tracking" != xno; then
2603  am_depcomp="$ac_aux_dir/depcomp"
2604  AMDEPBACKSLASH='\'
2605  am__nodep='_no'
2606fi
2607AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2608AC_SUBST([AMDEPBACKSLASH])dnl
2609_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
2610AC_SUBST([am__nodep])dnl
2611_AM_SUBST_NOTMAKE([am__nodep])dnl
2612])
2613
2614# Generate code to set up dependency tracking.              -*- Autoconf -*-
2615
2616# Copyright (C) 1999-2021 Free Software Foundation, Inc.
2617#
2618# This file is free software; the Free Software Foundation
2619# gives unlimited permission to copy and/or distribute it,
2620# with or without modifications, as long as this notice is preserved.
2621
2622# _AM_OUTPUT_DEPENDENCY_COMMANDS
2623# ------------------------------
2624AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
2625[{
2626  # Older Autoconf quotes --file arguments for eval, but not when files
2627  # are listed without --file.  Let's play safe and only enable the eval
2628  # if we detect the quoting.
2629  # TODO: see whether this extra hack can be removed once we start
2630  # requiring Autoconf 2.70 or later.
2631  AS_CASE([$CONFIG_FILES],
2632          [*\'*], [eval set x "$CONFIG_FILES"],
2633          [*], [set x $CONFIG_FILES])
2634  shift
2635  # Used to flag and report bootstrapping failures.
2636  am_rc=0
2637  for am_mf
2638  do
2639    # Strip MF so we end up with the name of the file.
2640    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
2641    # Check whether this is an Automake generated Makefile which includes
2642    # dependency-tracking related rules and includes.
2643    # Grep'ing the whole file directly is not great: AIX grep has a line
2644    # limit of 2048, but all sed's we know have understand at least 4000.
2645    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
2646      || continue
2647    am_dirpart=`AS_DIRNAME(["$am_mf"])`
2648    am_filepart=`AS_BASENAME(["$am_mf"])`
2649    AM_RUN_LOG([cd "$am_dirpart" \
2650      && sed -e '/# am--include-marker/d' "$am_filepart" \
2651        | $MAKE -f - am--depfiles]) || am_rc=$?
2652  done
2653  if test $am_rc -ne 0; then
2654    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
2655    for automatic dependency tracking.  If GNU make was not used, consider
2656    re-running the configure script with MAKE="gmake" (or whatever is
2657    necessary).  You can also try re-running configure with the
2658    '--disable-dependency-tracking' option to at least be able to build
2659    the package (albeit without support for automatic dependency tracking).])
2660  fi
2661  AS_UNSET([am_dirpart])
2662  AS_UNSET([am_filepart])
2663  AS_UNSET([am_mf])
2664  AS_UNSET([am_rc])
2665  rm -f conftest-deps.mk
2666}
2667])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2668
2669
2670# AM_OUTPUT_DEPENDENCY_COMMANDS
2671# -----------------------------
2672# This macro should only be invoked once -- use via AC_REQUIRE.
2673#
2674# This code is only required when automatic dependency tracking is enabled.
2675# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
2676# order to bootstrap the dependency handling code.
2677AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
2678[AC_CONFIG_COMMANDS([depfiles],
2679     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2680     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
2681
2682# Do all the work for Automake.                             -*- Autoconf -*-
2683
2684# Copyright (C) 1996-2021 Free Software Foundation, Inc.
2685#
2686# This file is free software; the Free Software Foundation
2687# gives unlimited permission to copy and/or distribute it,
2688# with or without modifications, as long as this notice is preserved.
2689
2690# This macro actually does too much.  Some checks are only needed if
2691# your package does certain things.  But this isn't really a big deal.
2692
2693dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
2694m4_define([AC_PROG_CC],
2695m4_defn([AC_PROG_CC])
2696[_AM_PROG_CC_C_O
2697])
2698
2699# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
2700# AM_INIT_AUTOMAKE([OPTIONS])
2701# -----------------------------------------------
2702# The call with PACKAGE and VERSION arguments is the old style
2703# call (pre autoconf-2.50), which is being phased out.  PACKAGE
2704# and VERSION should now be passed to AC_INIT and removed from
2705# the call to AM_INIT_AUTOMAKE.
2706# We support both call styles for the transition.  After
2707# the next Automake release, Autoconf can make the AC_INIT
2708# arguments mandatory, and then we can depend on a new Autoconf
2709# release and drop the old call support.
2710AC_DEFUN([AM_INIT_AUTOMAKE],
2711[AC_PREREQ([2.65])dnl
2712m4_ifdef([_$0_ALREADY_INIT],
2713  [m4_fatal([$0 expanded multiple times
2714]m4_defn([_$0_ALREADY_INIT]))],
2715  [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
2716dnl Autoconf wants to disallow AM_ names.  We explicitly allow
2717dnl the ones we care about.
2718m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
2719AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2720AC_REQUIRE([AC_PROG_INSTALL])dnl
2721if test "`cd $srcdir && pwd`" != "`pwd`"; then
2722  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2723  # is not polluted with repeated "-I."
2724  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
2725  # test to see if srcdir already configured
2726  if test -f $srcdir/config.status; then
2727    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2728  fi
2729fi
2730
2731# test whether we have cygpath
2732if test -z "$CYGPATH_W"; then
2733  if (cygpath --version) >/dev/null 2>/dev/null; then
2734    CYGPATH_W='cygpath -w'
2735  else
2736    CYGPATH_W=echo
2737  fi
2738fi
2739AC_SUBST([CYGPATH_W])
2740
2741# Define the identity of the package.
2742dnl Distinguish between old-style and new-style calls.
2743m4_ifval([$2],
2744[AC_DIAGNOSE([obsolete],
2745             [$0: two- and three-arguments forms are deprecated.])
2746m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
2747 AC_SUBST([PACKAGE], [$1])dnl
2748 AC_SUBST([VERSION], [$2])],
2749[_AM_SET_OPTIONS([$1])dnl
2750dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
2751m4_if(
2752  m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
2753  [ok:ok],,
2754  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
2755 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
2756 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
2757
2758_AM_IF_OPTION([no-define],,
2759[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
2760 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
2761
2762# Some tools Automake needs.
2763AC_REQUIRE([AM_SANITY_CHECK])dnl
2764AC_REQUIRE([AC_ARG_PROGRAM])dnl
2765AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
2766AM_MISSING_PROG([AUTOCONF], [autoconf])
2767AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
2768AM_MISSING_PROG([AUTOHEADER], [autoheader])
2769AM_MISSING_PROG([MAKEINFO], [makeinfo])
2770AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2771AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
2772AC_REQUIRE([AC_PROG_MKDIR_P])dnl
2773# For better backward compatibility.  To be removed once Automake 1.9.x
2774# dies out for good.  For more background, see:
2775# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2776# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
2777AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
2778# We need awk for the "check" target (and possibly the TAP driver).  The
2779# system "awk" is bad on some platforms.
2780AC_REQUIRE([AC_PROG_AWK])dnl
2781AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2782AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2783_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
2784	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
2785			     [_AM_PROG_TAR([v7])])])
2786_AM_IF_OPTION([no-dependencies],,
2787[AC_PROVIDE_IFELSE([AC_PROG_CC],
2788		  [_AM_DEPENDENCIES([CC])],
2789		  [m4_define([AC_PROG_CC],
2790			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
2791AC_PROVIDE_IFELSE([AC_PROG_CXX],
2792		  [_AM_DEPENDENCIES([CXX])],
2793		  [m4_define([AC_PROG_CXX],
2794			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
2795AC_PROVIDE_IFELSE([AC_PROG_OBJC],
2796		  [_AM_DEPENDENCIES([OBJC])],
2797		  [m4_define([AC_PROG_OBJC],
2798			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
2799AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
2800		  [_AM_DEPENDENCIES([OBJCXX])],
2801		  [m4_define([AC_PROG_OBJCXX],
2802			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
2803])
2804# Variables for tags utilities; see am/tags.am
2805if test -z "$CTAGS"; then
2806  CTAGS=ctags
2807fi
2808AC_SUBST([CTAGS])
2809if test -z "$ETAGS"; then
2810  ETAGS=etags
2811fi
2812AC_SUBST([ETAGS])
2813if test -z "$CSCOPE"; then
2814  CSCOPE=cscope
2815fi
2816AC_SUBST([CSCOPE])
2817
2818AC_REQUIRE([AM_SILENT_RULES])dnl
2819dnl The testsuite driver may need to know about EXEEXT, so add the
2820dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
2821dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
2822AC_CONFIG_COMMANDS_PRE(dnl
2823[m4_provide_if([_AM_COMPILER_EXEEXT],
2824  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
2825
2826# POSIX will say in a future version that running "rm -f" with no argument
2827# is OK; and we want to be able to make that assumption in our Makefile
2828# recipes.  So use an aggressive probe to check that the usage we want is
2829# actually supported "in the wild" to an acceptable degree.
2830# See automake bug#10828.
2831# To make any issue more visible, cause the running configure to be aborted
2832# by default if the 'rm' program in use doesn't match our expectations; the
2833# user can still override this though.
2834if rm -f && rm -fr && rm -rf; then : OK; else
2835  cat >&2 <<'END'
2836Oops!
2837
2838Your 'rm' program seems unable to run without file operands specified
2839on the command line, even when the '-f' option is present.  This is contrary
2840to the behaviour of most rm programs out there, and not conforming with
2841the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
2842
2843Please tell bug-automake@gnu.org about your system, including the value
2844of your $PATH and any error possibly output before this message.  This
2845can help us improve future automake versions.
2846
2847END
2848  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
2849    echo 'Configuration will proceed anyway, since you have set the' >&2
2850    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
2851    echo >&2
2852  else
2853    cat >&2 <<'END'
2854Aborting the configuration process, to ensure you take notice of the issue.
2855
2856You can download and install GNU coreutils to get an 'rm' implementation
2857that behaves properly: <https://www.gnu.org/software/coreutils/>.
2858
2859If you want to complete the configuration process using your problematic
2860'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
2861to "yes", and re-run configure.
2862
2863END
2864    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
2865  fi
2866fi
2867dnl The trailing newline in this macro's definition is deliberate, for
2868dnl backward compatibility and to allow trailing 'dnl'-style comments
2869dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
2870])
2871
2872dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
2873dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
2874dnl mangled by Autoconf and run in a shell conditional statement.
2875m4_define([_AC_COMPILER_EXEEXT],
2876m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
2877
2878# When config.status generates a header, we must update the stamp-h file.
2879# This file resides in the same directory as the config header
2880# that is generated.  The stamp files are numbered to have different names.
2881
2882# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
2883# loop where config.status creates the headers, so we can generate
2884# our stamp files there.
2885AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
2886[# Compute $1's index in $config_headers.
2887_am_arg=$1
2888_am_stamp_count=1
2889for _am_header in $config_headers :; do
2890  case $_am_header in
2891    $_am_arg | $_am_arg:* )
2892      break ;;
2893    * )
2894      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2895  esac
2896done
2897echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
2898
2899# Copyright (C) 2001-2021 Free Software Foundation, Inc.
2900#
2901# This file is free software; the Free Software Foundation
2902# gives unlimited permission to copy and/or distribute it,
2903# with or without modifications, as long as this notice is preserved.
2904
2905# AM_PROG_INSTALL_SH
2906# ------------------
2907# Define $install_sh.
2908AC_DEFUN([AM_PROG_INSTALL_SH],
2909[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2910if test x"${install_sh+set}" != xset; then
2911  case $am_aux_dir in
2912  *\ * | *\	*)
2913    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2914  *)
2915    install_sh="\${SHELL} $am_aux_dir/install-sh"
2916  esac
2917fi
2918AC_SUBST([install_sh])])
2919
2920# Copyright (C) 2003-2021 Free Software Foundation, Inc.
2921#
2922# This file is free software; the Free Software Foundation
2923# gives unlimited permission to copy and/or distribute it,
2924# with or without modifications, as long as this notice is preserved.
2925
2926# Check whether the underlying file-system supports filenames
2927# with a leading dot.  For instance MS-DOS doesn't.
2928AC_DEFUN([AM_SET_LEADING_DOT],
2929[rm -rf .tst 2>/dev/null
2930mkdir .tst 2>/dev/null
2931if test -d .tst; then
2932  am__leading_dot=.
2933else
2934  am__leading_dot=_
2935fi
2936rmdir .tst 2>/dev/null
2937AC_SUBST([am__leading_dot])])
2938
2939# Check to see how 'make' treats includes.	            -*- Autoconf -*-
2940
2941# Copyright (C) 2001-2021 Free Software Foundation, Inc.
2942#
2943# This file is free software; the Free Software Foundation
2944# gives unlimited permission to copy and/or distribute it,
2945# with or without modifications, as long as this notice is preserved.
2946
2947# AM_MAKE_INCLUDE()
2948# -----------------
2949# Check whether make has an 'include' directive that can support all
2950# the idioms we need for our automatic dependency tracking code.
2951AC_DEFUN([AM_MAKE_INCLUDE],
2952[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
2953cat > confinc.mk << 'END'
2954am__doit:
2955	@echo this is the am__doit target >confinc.out
2956.PHONY: am__doit
2957END
2958am__include="#"
2959am__quote=
2960# BSD make does it like this.
2961echo '.include "confinc.mk" # ignored' > confmf.BSD
2962# Other make implementations (GNU, Solaris 10, AIX) do it like this.
2963echo 'include confinc.mk # ignored' > confmf.GNU
2964_am_result=no
2965for s in GNU BSD; do
2966  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
2967  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
2968      ['0:this is the am__doit target'],
2969      [AS_CASE([$s],
2970          [BSD], [am__include='.include' am__quote='"'],
2971          [am__include='include' am__quote=''])])
2972  if test "$am__include" != "#"; then
2973    _am_result="yes ($s style)"
2974    break
2975  fi
2976done
2977rm -f confinc.* confmf.*
2978AC_MSG_RESULT([${_am_result}])
2979AC_SUBST([am__include])])
2980AC_SUBST([am__quote])])
2981
2982# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2983
2984# Copyright (C) 1997-2021 Free Software Foundation, Inc.
2985#
2986# This file is free software; the Free Software Foundation
2987# gives unlimited permission to copy and/or distribute it,
2988# with or without modifications, as long as this notice is preserved.
2989
2990# AM_MISSING_PROG(NAME, PROGRAM)
2991# ------------------------------
2992AC_DEFUN([AM_MISSING_PROG],
2993[AC_REQUIRE([AM_MISSING_HAS_RUN])
2994$1=${$1-"${am_missing_run}$2"}
2995AC_SUBST($1)])
2996
2997# AM_MISSING_HAS_RUN
2998# ------------------
2999# Define MISSING if not defined so far and test if it is modern enough.
3000# If it is, set am_missing_run to use it, otherwise, to nothing.
3001AC_DEFUN([AM_MISSING_HAS_RUN],
3002[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3003AC_REQUIRE_AUX_FILE([missing])dnl
3004if test x"${MISSING+set}" != xset; then
3005  MISSING="\${SHELL} '$am_aux_dir/missing'"
3006fi
3007# Use eval to expand $SHELL
3008if eval "$MISSING --is-lightweight"; then
3009  am_missing_run="$MISSING "
3010else
3011  am_missing_run=
3012  AC_MSG_WARN(['missing' script is too old or missing])
3013fi
3014])
3015
3016# Helper functions for option handling.                     -*- Autoconf -*-
3017
3018# Copyright (C) 2001-2021 Free Software Foundation, Inc.
3019#
3020# This file is free software; the Free Software Foundation
3021# gives unlimited permission to copy and/or distribute it,
3022# with or without modifications, as long as this notice is preserved.
3023
3024# _AM_MANGLE_OPTION(NAME)
3025# -----------------------
3026AC_DEFUN([_AM_MANGLE_OPTION],
3027[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
3028
3029# _AM_SET_OPTION(NAME)
3030# --------------------
3031# Set option NAME.  Presently that only means defining a flag for this option.
3032AC_DEFUN([_AM_SET_OPTION],
3033[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
3034
3035# _AM_SET_OPTIONS(OPTIONS)
3036# ------------------------
3037# OPTIONS is a space-separated list of Automake options.
3038AC_DEFUN([_AM_SET_OPTIONS],
3039[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
3040
3041# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
3042# -------------------------------------------
3043# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
3044AC_DEFUN([_AM_IF_OPTION],
3045[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
3046
3047# Copyright (C) 1999-2021 Free Software Foundation, Inc.
3048#
3049# This file is free software; the Free Software Foundation
3050# gives unlimited permission to copy and/or distribute it,
3051# with or without modifications, as long as this notice is preserved.
3052
3053# _AM_PROG_CC_C_O
3054# ---------------
3055# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
3056# to automatically call this.
3057AC_DEFUN([_AM_PROG_CC_C_O],
3058[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3059AC_REQUIRE_AUX_FILE([compile])dnl
3060AC_LANG_PUSH([C])dnl
3061AC_CACHE_CHECK(
3062  [whether $CC understands -c and -o together],
3063  [am_cv_prog_cc_c_o],
3064  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
3065  # Make sure it works both with $CC and with simple cc.
3066  # Following AC_PROG_CC_C_O, we do the test twice because some
3067  # compilers refuse to overwrite an existing .o file with -o,
3068  # though they will create one.
3069  am_cv_prog_cc_c_o=yes
3070  for am_i in 1 2; do
3071    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
3072         && test -f conftest2.$ac_objext; then
3073      : OK
3074    else
3075      am_cv_prog_cc_c_o=no
3076      break
3077    fi
3078  done
3079  rm -f core conftest*
3080  unset am_i])
3081if test "$am_cv_prog_cc_c_o" != yes; then
3082   # Losing compiler, so override with the script.
3083   # FIXME: It is wrong to rewrite CC.
3084   # But if we don't then we get into trouble of one sort or another.
3085   # A longer-term fix would be to have automake use am__CC in this case,
3086   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
3087   CC="$am_aux_dir/compile $CC"
3088fi
3089AC_LANG_POP([C])])
3090
3091# For backward compatibility.
3092AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
3093
3094# Copyright (C) 2001-2021 Free Software Foundation, Inc.
3095#
3096# This file is free software; the Free Software Foundation
3097# gives unlimited permission to copy and/or distribute it,
3098# with or without modifications, as long as this notice is preserved.
3099
3100# AM_RUN_LOG(COMMAND)
3101# -------------------
3102# Run COMMAND, save the exit status in ac_status, and log it.
3103# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
3104AC_DEFUN([AM_RUN_LOG],
3105[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
3106   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
3107   ac_status=$?
3108   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3109   (exit $ac_status); }])
3110
3111# Check to make sure that the build environment is sane.    -*- Autoconf -*-
3112
3113# Copyright (C) 1996-2021 Free Software Foundation, Inc.
3114#
3115# This file is free software; the Free Software Foundation
3116# gives unlimited permission to copy and/or distribute it,
3117# with or without modifications, as long as this notice is preserved.
3118
3119# AM_SANITY_CHECK
3120# ---------------
3121AC_DEFUN([AM_SANITY_CHECK],
3122[AC_MSG_CHECKING([whether build environment is sane])
3123# Reject unsafe characters in $srcdir or the absolute working directory
3124# name.  Accept space and tab only in the latter.
3125am_lf='
3126'
3127case `pwd` in
3128  *[[\\\"\#\$\&\'\`$am_lf]]*)
3129    AC_MSG_ERROR([unsafe absolute working directory name]);;
3130esac
3131case $srcdir in
3132  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
3133    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
3134esac
3135
3136# Do 'set' in a subshell so we don't clobber the current shell's
3137# arguments.  Must try -L first in case configure is actually a
3138# symlink; some systems play weird games with the mod time of symlinks
3139# (eg FreeBSD returns the mod time of the symlink's containing
3140# directory).
3141if (
3142   am_has_slept=no
3143   for am_try in 1 2; do
3144     echo "timestamp, slept: $am_has_slept" > conftest.file
3145     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
3146     if test "$[*]" = "X"; then
3147	# -L didn't work.
3148	set X `ls -t "$srcdir/configure" conftest.file`
3149     fi
3150     if test "$[*]" != "X $srcdir/configure conftest.file" \
3151	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
3152
3153	# If neither matched, then we have a broken ls.  This can happen
3154	# if, for instance, CONFIG_SHELL is bash and it inherits a
3155	# broken ls alias from the environment.  This has actually
3156	# happened.  Such a system could not be considered "sane".
3157	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
3158  alias in your environment])
3159     fi
3160     if test "$[2]" = conftest.file || test $am_try -eq 2; then
3161       break
3162     fi
3163     # Just in case.
3164     sleep 1
3165     am_has_slept=yes
3166   done
3167   test "$[2]" = conftest.file
3168   )
3169then
3170   # Ok.
3171   :
3172else
3173   AC_MSG_ERROR([newly created file is older than distributed files!
3174Check your system clock])
3175fi
3176AC_MSG_RESULT([yes])
3177# If we didn't sleep, we still need to ensure time stamps of config.status and
3178# generated files are strictly newer.
3179am_sleep_pid=
3180if grep 'slept: no' conftest.file >/dev/null 2>&1; then
3181  ( sleep 1 ) &
3182  am_sleep_pid=$!
3183fi
3184AC_CONFIG_COMMANDS_PRE(
3185  [AC_MSG_CHECKING([that generated files are newer than configure])
3186   if test -n "$am_sleep_pid"; then
3187     # Hide warnings about reused PIDs.
3188     wait $am_sleep_pid 2>/dev/null
3189   fi
3190   AC_MSG_RESULT([done])])
3191rm -f conftest.file
3192])
3193
3194# Copyright (C) 2009-2021 Free Software Foundation, Inc.
3195#
3196# This file is free software; the Free Software Foundation
3197# gives unlimited permission to copy and/or distribute it,
3198# with or without modifications, as long as this notice is preserved.
3199
3200# AM_SILENT_RULES([DEFAULT])
3201# --------------------------
3202# Enable less verbose build rules; with the default set to DEFAULT
3203# ("yes" being less verbose, "no" or empty being verbose).
3204AC_DEFUN([AM_SILENT_RULES],
3205[AC_ARG_ENABLE([silent-rules], [dnl
3206AS_HELP_STRING(
3207  [--enable-silent-rules],
3208  [less verbose build output (undo: "make V=1")])
3209AS_HELP_STRING(
3210  [--disable-silent-rules],
3211  [verbose build output (undo: "make V=0")])dnl
3212])
3213case $enable_silent_rules in @%:@ (((
3214  yes) AM_DEFAULT_VERBOSITY=0;;
3215   no) AM_DEFAULT_VERBOSITY=1;;
3216    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
3217esac
3218dnl
3219dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
3220dnl do not support nested variable expansions.
3221dnl See automake bug#9928 and bug#10237.
3222am_make=${MAKE-make}
3223AC_CACHE_CHECK([whether $am_make supports nested variables],
3224   [am_cv_make_support_nested_variables],
3225   [if AS_ECHO([['TRUE=$(BAR$(V))
3226BAR0=false
3227BAR1=true
3228V=1
3229am__doit:
3230	@$(TRUE)
3231.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
3232  am_cv_make_support_nested_variables=yes
3233else
3234  am_cv_make_support_nested_variables=no
3235fi])
3236if test $am_cv_make_support_nested_variables = yes; then
3237  dnl Using '$V' instead of '$(V)' breaks IRIX make.
3238  AM_V='$(V)'
3239  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
3240else
3241  AM_V=$AM_DEFAULT_VERBOSITY
3242  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
3243fi
3244AC_SUBST([AM_V])dnl
3245AM_SUBST_NOTMAKE([AM_V])dnl
3246AC_SUBST([AM_DEFAULT_V])dnl
3247AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
3248AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
3249AM_BACKSLASH='\'
3250AC_SUBST([AM_BACKSLASH])dnl
3251_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
3252])
3253
3254# Copyright (C) 2001-2021 Free Software Foundation, Inc.
3255#
3256# This file is free software; the Free Software Foundation
3257# gives unlimited permission to copy and/or distribute it,
3258# with or without modifications, as long as this notice is preserved.
3259
3260# AM_PROG_INSTALL_STRIP
3261# ---------------------
3262# One issue with vendor 'install' (even GNU) is that you can't
3263# specify the program used to strip binaries.  This is especially
3264# annoying in cross-compiling environments, where the build's strip
3265# is unlikely to handle the host's binaries.
3266# Fortunately install-sh will honor a STRIPPROG variable, so we
3267# always use install-sh in "make install-strip", and initialize
3268# STRIPPROG with the value of the STRIP variable (set by the user).
3269AC_DEFUN([AM_PROG_INSTALL_STRIP],
3270[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
3271# Installed binaries are usually stripped using 'strip' when the user
3272# run "make install-strip".  However 'strip' might not be the right
3273# tool to use in cross-compilation environments, therefore Automake
3274# will honor the 'STRIP' environment variable to overrule this program.
3275dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
3276if test "$cross_compiling" != no; then
3277  AC_CHECK_TOOL([STRIP], [strip], :)
3278fi
3279INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
3280AC_SUBST([INSTALL_STRIP_PROGRAM])])
3281
3282# Copyright (C) 2006-2021 Free Software Foundation, Inc.
3283#
3284# This file is free software; the Free Software Foundation
3285# gives unlimited permission to copy and/or distribute it,
3286# with or without modifications, as long as this notice is preserved.
3287
3288# _AM_SUBST_NOTMAKE(VARIABLE)
3289# ---------------------------
3290# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
3291# This macro is traced by Automake.
3292AC_DEFUN([_AM_SUBST_NOTMAKE])
3293
3294# AM_SUBST_NOTMAKE(VARIABLE)
3295# --------------------------
3296# Public sister of _AM_SUBST_NOTMAKE.
3297AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
3298
3299# Check how to create a tarball.                            -*- Autoconf -*-
3300
3301# Copyright (C) 2004-2021 Free Software Foundation, Inc.
3302#
3303# This file is free software; the Free Software Foundation
3304# gives unlimited permission to copy and/or distribute it,
3305# with or without modifications, as long as this notice is preserved.
3306
3307# _AM_PROG_TAR(FORMAT)
3308# --------------------
3309# Check how to create a tarball in format FORMAT.
3310# FORMAT should be one of 'v7', 'ustar', or 'pax'.
3311#
3312# Substitute a variable $(am__tar) that is a command
3313# writing to stdout a FORMAT-tarball containing the directory
3314# $tardir.
3315#     tardir=directory && $(am__tar) > result.tar
3316#
3317# Substitute a variable $(am__untar) that extract such
3318# a tarball read from stdin.
3319#     $(am__untar) < result.tar
3320#
3321AC_DEFUN([_AM_PROG_TAR],
3322[# Always define AMTAR for backward compatibility.  Yes, it's still used
3323# in the wild :-(  We should find a proper way to deprecate it ...
3324AC_SUBST([AMTAR], ['$${TAR-tar}'])
3325
3326# We'll loop over all known methods to create a tar archive until one works.
3327_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
3328
3329m4_if([$1], [v7],
3330  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
3331
3332  [m4_case([$1],
3333    [ustar],
3334     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
3335      # There is notably a 21 bits limit for the UID and the GID.  In fact,
3336      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
3337      # and bug#13588).
3338      am_max_uid=2097151 # 2^21 - 1
3339      am_max_gid=$am_max_uid
3340      # The $UID and $GID variables are not portable, so we need to resort
3341      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
3342      # below are definitely unexpected, so allow the users to see them
3343      # (that is, avoid stderr redirection).
3344      am_uid=`id -u || echo unknown`
3345      am_gid=`id -g || echo unknown`
3346      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
3347      if test $am_uid -le $am_max_uid; then
3348         AC_MSG_RESULT([yes])
3349      else
3350         AC_MSG_RESULT([no])
3351         _am_tools=none
3352      fi
3353      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
3354      if test $am_gid -le $am_max_gid; then
3355         AC_MSG_RESULT([yes])
3356      else
3357        AC_MSG_RESULT([no])
3358        _am_tools=none
3359      fi],
3360
3361  [pax],
3362    [],
3363
3364  [m4_fatal([Unknown tar format])])
3365
3366  AC_MSG_CHECKING([how to create a $1 tar archive])
3367
3368  # Go ahead even if we have the value already cached.  We do so because we
3369  # need to set the values for the 'am__tar' and 'am__untar' variables.
3370  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
3371
3372  for _am_tool in $_am_tools; do
3373    case $_am_tool in
3374    gnutar)
3375      for _am_tar in tar gnutar gtar; do
3376        AM_RUN_LOG([$_am_tar --version]) && break
3377      done
3378      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
3379      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
3380      am__untar="$_am_tar -xf -"
3381      ;;
3382    plaintar)
3383      # Must skip GNU tar: if it does not support --format= it doesn't create
3384      # ustar tarball either.
3385      (tar --version) >/dev/null 2>&1 && continue
3386      am__tar='tar chf - "$$tardir"'
3387      am__tar_='tar chf - "$tardir"'
3388      am__untar='tar xf -'
3389      ;;
3390    pax)
3391      am__tar='pax -L -x $1 -w "$$tardir"'
3392      am__tar_='pax -L -x $1 -w "$tardir"'
3393      am__untar='pax -r'
3394      ;;
3395    cpio)
3396      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
3397      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
3398      am__untar='cpio -i -H $1 -d'
3399      ;;
3400    none)
3401      am__tar=false
3402      am__tar_=false
3403      am__untar=false
3404      ;;
3405    esac
3406
3407    # If the value was cached, stop now.  We just wanted to have am__tar
3408    # and am__untar set.
3409    test -n "${am_cv_prog_tar_$1}" && break
3410
3411    # tar/untar a dummy directory, and stop if the command works.
3412    rm -rf conftest.dir
3413    mkdir conftest.dir
3414    echo GrepMe > conftest.dir/file
3415    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
3416    rm -rf conftest.dir
3417    if test -s conftest.tar; then
3418      AM_RUN_LOG([$am__untar <conftest.tar])
3419      AM_RUN_LOG([cat conftest.dir/file])
3420      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
3421    fi
3422  done
3423  rm -rf conftest.dir
3424
3425  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
3426  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
3427
3428AC_SUBST([am__tar])
3429AC_SUBST([am__untar])
3430]) # _AM_PROG_TAR
3431
3432m4_include([m4/ax_define_dir.m4])
3433m4_include([m4/libtool.m4])
3434m4_include([m4/ltoptions.m4])
3435m4_include([m4/ltsugar.m4])
3436m4_include([m4/ltversion.m4])
3437m4_include([m4/lt~obsolete.m4])
3438