Blame aclocal.m4

Packit 631bab
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
Packit 631bab
Packit 631bab
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
Packit 631bab
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# This program is distributed in the hope that it will be useful,
Packit 631bab
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
Packit 631bab
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
Packit 631bab
# PARTICULAR PURPOSE.
Packit 631bab
Packit 631bab
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
Packit 631bab
m4_ifndef([AC_AUTOCONF_VERSION],
Packit 631bab
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
Packit 631bab
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
Packit 631bab
[m4_warning([this file was generated for autoconf 2.69.
Packit 631bab
You have another version of autoconf.  It may work, but is not guaranteed to.
Packit 631bab
If you have problems, you may need to regenerate the build system entirely.
Packit 631bab
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
Packit 631bab
Packit 631bab
dnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
Packit 631bab
dnl serial 11 (pkg-config-0.29.1)
Packit 631bab
dnl
Packit 631bab
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
Packit 631bab
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
Packit 631bab
dnl
Packit 631bab
dnl This program is free software; you can redistribute it and/or modify
Packit 631bab
dnl it under the terms of the GNU General Public License as published by
Packit 631bab
dnl the Free Software Foundation; either version 2 of the License, or
Packit 631bab
dnl (at your option) any later version.
Packit 631bab
dnl
Packit 631bab
dnl This program is distributed in the hope that it will be useful, but
Packit 631bab
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 631bab
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Packit 631bab
dnl General Public License for more details.
Packit 631bab
dnl
Packit 631bab
dnl You should have received a copy of the GNU General Public License
Packit 631bab
dnl along with this program; if not, write to the Free Software
Packit 631bab
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Packit 631bab
dnl 02111-1307, USA.
Packit 631bab
dnl
Packit 631bab
dnl As a special exception to the GNU General Public License, if you
Packit 631bab
dnl distribute this file as part of a program that contains a
Packit 631bab
dnl configuration script generated by Autoconf, you may include it under
Packit 631bab
dnl the same distribution terms that you use for the rest of that
Packit 631bab
dnl program.
Packit 631bab
Packit 631bab
dnl PKG_PREREQ(MIN-VERSION)
Packit 631bab
dnl -----------------------
Packit 631bab
dnl Since: 0.29
Packit 631bab
dnl
Packit 631bab
dnl Verify that the version of the pkg-config macros are at least
Packit 631bab
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
Packit 631bab
dnl installed version of pkg-config, this checks the developer's version
Packit 631bab
dnl of pkg.m4 when generating configure.
Packit 631bab
dnl
Packit 631bab
dnl To ensure that this macro is defined, also add:
Packit 631bab
dnl m4_ifndef([PKG_PREREQ],
Packit 631bab
dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
Packit 631bab
dnl
Packit 631bab
dnl See the "Since" comment for each macro you use to see what version
Packit 631bab
dnl of the macros you require.
Packit 631bab
m4_defun([PKG_PREREQ],
Packit 631bab
[m4_define([PKG_MACROS_VERSION], [0.29.1])
Packit 631bab
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
Packit 631bab
    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
Packit 631bab
])dnl PKG_PREREQ
Packit 631bab
Packit 631bab
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
Packit 631bab
dnl ----------------------------------
Packit 631bab
dnl Since: 0.16
Packit 631bab
dnl
Packit 631bab
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
Packit 631bab
dnl first found in the path. Checks that the version of pkg-config found
Packit 631bab
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
Packit 631bab
dnl used since that's the first version where most current features of
Packit 631bab
dnl pkg-config existed.
Packit 631bab
AC_DEFUN([PKG_PROG_PKG_CONFIG],
Packit 631bab
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
Packit 631bab
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
Packit 631bab
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
Packit 631bab
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
Packit 631bab
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
Packit 631bab
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
Packit 631bab
Packit 631bab
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
Packit 631bab
	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
Packit 631bab
fi
Packit 631bab
if test -n "$PKG_CONFIG"; then
Packit 631bab
	_pkg_min_version=m4_default([$1], [0.9.0])
Packit 631bab
	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
Packit 631bab
	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
Packit 631bab
		AC_MSG_RESULT([yes])
Packit 631bab
	else
Packit 631bab
		AC_MSG_RESULT([no])
Packit 631bab
		PKG_CONFIG=""
Packit 631bab
	fi
Packit 631bab
fi[]dnl
Packit 631bab
])dnl PKG_PROG_PKG_CONFIG
Packit 631bab
Packit 631bab
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
Packit 631bab
dnl -------------------------------------------------------------------
Packit 631bab
dnl Since: 0.18
Packit 631bab
dnl
Packit 631bab
dnl Check to see whether a particular set of modules exists. Similar to
Packit 631bab
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
Packit 631bab
dnl
Packit 631bab
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
Packit 631bab
dnl only at the first occurence in configure.ac, so if the first place
Packit 631bab
dnl it's called might be skipped (such as if it is within an "if", you
Packit 631bab
dnl have to call PKG_CHECK_EXISTS manually
Packit 631bab
AC_DEFUN([PKG_CHECK_EXISTS],
Packit 631bab
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
Packit 631bab
if test -n "$PKG_CONFIG" && \
Packit 631bab
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
Packit 631bab
  m4_default([$2], [:])
Packit 631bab
m4_ifvaln([$3], [else
Packit 631bab
  $3])dnl
Packit 631bab
fi])
Packit 631bab
Packit 631bab
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
Packit 631bab
dnl ---------------------------------------------
Packit 631bab
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
Packit 631bab
dnl pkg_failed based on the result.
Packit 631bab
m4_define([_PKG_CONFIG],
Packit 631bab
[if test -n "$$1"; then
Packit 631bab
    pkg_cv_[]$1="$$1"
Packit 631bab
 elif test -n "$PKG_CONFIG"; then
Packit 631bab
    PKG_CHECK_EXISTS([$3],
Packit 631bab
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
Packit 631bab
		      test "x$?" != "x0" && pkg_failed=yes ],
Packit 631bab
		     [pkg_failed=yes])
Packit 631bab
 else
Packit 631bab
    pkg_failed=untried
Packit 631bab
fi[]dnl
Packit 631bab
])dnl _PKG_CONFIG
Packit 631bab
Packit 631bab
dnl _PKG_SHORT_ERRORS_SUPPORTED
Packit 631bab
dnl ---------------------------
Packit 631bab
dnl Internal check to see if pkg-config supports short errors.
Packit 631bab
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
Packit 631bab
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
Packit 631bab
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
Packit 631bab
        _pkg_short_errors_supported=yes
Packit 631bab
else
Packit 631bab
        _pkg_short_errors_supported=no
Packit 631bab
fi[]dnl
Packit 631bab
])dnl _PKG_SHORT_ERRORS_SUPPORTED
Packit 631bab
Packit 631bab
Packit 631bab
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
Packit 631bab
dnl   [ACTION-IF-NOT-FOUND])
Packit 631bab
dnl --------------------------------------------------------------
Packit 631bab
dnl Since: 0.4.0
Packit 631bab
dnl
Packit 631bab
dnl Note that if there is a possibility the first call to
Packit 631bab
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
Packit 631bab
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
Packit 631bab
AC_DEFUN([PKG_CHECK_MODULES],
Packit 631bab
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
Packit 631bab
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
Packit 631bab
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
Packit 631bab
Packit 631bab
pkg_failed=no
Packit 631bab
AC_MSG_CHECKING([for $1])
Packit 631bab
Packit 631bab
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
Packit 631bab
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
Packit 631bab
Packit 631bab
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
Packit 631bab
and $1[]_LIBS to avoid the need to call pkg-config.
Packit 631bab
See the pkg-config man page for more details.])
Packit 631bab
Packit 631bab
if test $pkg_failed = yes; then
Packit 631bab
   	AC_MSG_RESULT([no])
Packit 631bab
        _PKG_SHORT_ERRORS_SUPPORTED
Packit 631bab
        if test $_pkg_short_errors_supported = yes; then
Packit 631bab
	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
Packit 631bab
        else 
Packit 631bab
	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
Packit 631bab
        fi
Packit 631bab
	# Put the nasty error message in config.log where it belongs
Packit 631bab
	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
Packit 631bab
Packit 631bab
	m4_default([$4], [AC_MSG_ERROR(
Packit 631bab
[Package requirements ($2) were not met:
Packit 631bab
Packit 631bab
$$1_PKG_ERRORS
Packit 631bab
Packit 631bab
Consider adjusting the PKG_CONFIG_PATH environment variable if you
Packit 631bab
installed software in a non-standard prefix.
Packit 631bab
Packit 631bab
_PKG_TEXT])[]dnl
Packit 631bab
        ])
Packit 631bab
elif test $pkg_failed = untried; then
Packit 631bab
     	AC_MSG_RESULT([no])
Packit 631bab
	m4_default([$4], [AC_MSG_FAILURE(
Packit 631bab
[The pkg-config script could not be found or is too old.  Make sure it
Packit 631bab
is in your PATH or set the PKG_CONFIG environment variable to the full
Packit 631bab
path to pkg-config.
Packit 631bab
Packit 631bab
_PKG_TEXT
Packit 631bab
Packit 631bab
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
Packit 631bab
        ])
Packit 631bab
else
Packit 631bab
	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
Packit 631bab
	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
Packit 631bab
        AC_MSG_RESULT([yes])
Packit 631bab
	$3
Packit 631bab
fi[]dnl
Packit 631bab
])dnl PKG_CHECK_MODULES
Packit 631bab
Packit 631bab
Packit 631bab
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
Packit 631bab
dnl   [ACTION-IF-NOT-FOUND])
Packit 631bab
dnl ---------------------------------------------------------------------
Packit 631bab
dnl Since: 0.29
Packit 631bab
dnl
Packit 631bab
dnl Checks for existence of MODULES and gathers its build flags with
Packit 631bab
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
Packit 631bab
dnl and VARIABLE-PREFIX_LIBS from --libs.
Packit 631bab
dnl
Packit 631bab
dnl Note that if there is a possibility the first call to
Packit 631bab
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
Packit 631bab
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
Packit 631bab
dnl configure.ac.
Packit 631bab
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
Packit 631bab
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
Packit 631bab
_save_PKG_CONFIG=$PKG_CONFIG
Packit 631bab
PKG_CONFIG="$PKG_CONFIG --static"
Packit 631bab
PKG_CHECK_MODULES($@)
Packit 631bab
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
Packit 631bab
])dnl PKG_CHECK_MODULES_STATIC
Packit 631bab
Packit 631bab
Packit 631bab
dnl PKG_INSTALLDIR([DIRECTORY])
Packit 631bab
dnl -------------------------
Packit 631bab
dnl Since: 0.27
Packit 631bab
dnl
Packit 631bab
dnl Substitutes the variable pkgconfigdir as the location where a module
Packit 631bab
dnl should install pkg-config .pc files. By default the directory is
Packit 631bab
dnl $libdir/pkgconfig, but the default can be changed by passing
Packit 631bab
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
Packit 631bab
dnl parameter.
Packit 631bab
AC_DEFUN([PKG_INSTALLDIR],
Packit 631bab
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
Packit 631bab
m4_pushdef([pkg_description],
Packit 631bab
    [pkg-config installation directory @<:@]pkg_default[@:>@])
Packit 631bab
AC_ARG_WITH([pkgconfigdir],
Packit 631bab
    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
Packit 631bab
    [with_pkgconfigdir=]pkg_default)
Packit 631bab
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
Packit 631bab
m4_popdef([pkg_default])
Packit 631bab
m4_popdef([pkg_description])
Packit 631bab
])dnl PKG_INSTALLDIR
Packit 631bab
Packit 631bab
Packit 631bab
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
Packit 631bab
dnl --------------------------------
Packit 631bab
dnl Since: 0.27
Packit 631bab
dnl
Packit 631bab
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
Packit 631bab
dnl module should install arch-independent pkg-config .pc files. By
Packit 631bab
dnl default the directory is $datadir/pkgconfig, but the default can be
Packit 631bab
dnl changed by passing DIRECTORY. The user can override through the
Packit 631bab
dnl --with-noarch-pkgconfigdir parameter.
Packit 631bab
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
Packit 631bab
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
Packit 631bab
m4_pushdef([pkg_description],
Packit 631bab
    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
Packit 631bab
AC_ARG_WITH([noarch-pkgconfigdir],
Packit 631bab
    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
Packit 631bab
    [with_noarch_pkgconfigdir=]pkg_default)
Packit 631bab
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
Packit 631bab
m4_popdef([pkg_default])
Packit 631bab
m4_popdef([pkg_description])
Packit 631bab
])dnl PKG_NOARCH_INSTALLDIR
Packit 631bab
Packit 631bab
Packit 631bab
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
Packit 631bab
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
Packit 631bab
dnl -------------------------------------------
Packit 631bab
dnl Since: 0.28
Packit 631bab
dnl
Packit 631bab
dnl Retrieves the value of the pkg-config variable for the given module.
Packit 631bab
AC_DEFUN([PKG_CHECK_VAR],
Packit 631bab
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
Packit 631bab
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
Packit 631bab
Packit 631bab
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
Packit 631bab
AS_VAR_COPY([$1], [pkg_cv_][$1])
Packit 631bab
Packit 631bab
AS_VAR_IF([$1], [""], [$5], [$4])dnl
Packit 631bab
])dnl PKG_CHECK_VAR
Packit 631bab
Packit 631bab
dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
Packit 631bab
dnl
Packit 631bab
dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
Packit 631bab
dnl
Packit 631bab
dnl Permission is hereby granted, free of charge, to any person obtaining a
Packit 631bab
dnl copy of this software and associated documentation files (the "Software"),
Packit 631bab
dnl to deal in the Software without restriction, including without limitation
Packit 631bab
dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
Packit 631bab
dnl and/or sell copies of the Software, and to permit persons to whom the
Packit 631bab
dnl Software is furnished to do so, subject to the following conditions:
Packit 631bab
dnl
Packit 631bab
dnl The above copyright notice and this permission notice (including the next
Packit 631bab
dnl paragraph) shall be included in all copies or substantial portions of the
Packit 631bab
dnl Software.
Packit 631bab
dnl
Packit 631bab
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit 631bab
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit 631bab
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
Packit 631bab
dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Packit 631bab
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
Packit 631bab
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
Packit 631bab
dnl DEALINGS IN THE SOFTWARE.
Packit 631bab
Packit 631bab
# XORG_MACROS_VERSION(required-version)
Packit 631bab
# -------------------------------------
Packit 631bab
# Minimum version: 1.1.0
Packit 631bab
#
Packit 631bab
# If you're using a macro added in Version 1.1 or newer, include this in
Packit 631bab
# your configure.ac with the minimum required version, such as:
Packit 631bab
# XORG_MACROS_VERSION(1.1)
Packit 631bab
#
Packit 631bab
# To ensure that this macro is defined, also add:
Packit 631bab
# m4_ifndef([XORG_MACROS_VERSION],
Packit 631bab
#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
Packit 631bab
#
Packit 631bab
#
Packit 631bab
# See the "minimum version" comment for each macro you use to see what
Packit 631bab
# version you require.
Packit 631bab
m4_defun([XORG_MACROS_VERSION],[
Packit 631bab
m4_define([vers_have], [1.19.0])
Packit 631bab
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
Packit 631bab
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
Packit 631bab
m4_if(m4_cmp(maj_have, maj_needed), 0,,
Packit 631bab
    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
Packit 631bab
m4_if(m4_version_compare(vers_have, [$1]), -1,
Packit 631bab
    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
Packit 631bab
m4_undefine([vers_have])
Packit 631bab
m4_undefine([maj_have])
Packit 631bab
m4_undefine([maj_needed])
Packit 631bab
]) # XORG_MACROS_VERSION
Packit 631bab
Packit 631bab
# XORG_PROG_RAWCPP()
Packit 631bab
# ------------------
Packit 631bab
# Minimum version: 1.0.0
Packit 631bab
#
Packit 631bab
# Find cpp program and necessary flags for use in pre-processing text files
Packit 631bab
# such as man pages and config files
Packit 631bab
AC_DEFUN([XORG_PROG_RAWCPP],[
Packit 631bab
AC_REQUIRE([AC_PROG_CPP])
Packit 631bab
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
Packit 631bab
   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
Packit 631bab
Packit 631bab
# Check for flag to avoid builtin definitions - assumes unix is predefined,
Packit 631bab
# which is not the best choice for supporting other OS'es, but covers most
Packit 631bab
# of the ones we need for now.
Packit 631bab
AC_MSG_CHECKING([if $RAWCPP requires -undef])
Packit 631bab
AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
Packit 631bab
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
Packit 631bab
	AC_MSG_RESULT([no])
Packit 631bab
else
Packit 631bab
	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
Packit 631bab
		RAWCPPFLAGS=-undef
Packit 631bab
		AC_MSG_RESULT([yes])
Packit 631bab
	# under Cygwin unix is still defined even with -undef
Packit 631bab
	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
Packit 631bab
		RAWCPPFLAGS="-undef -ansi"
Packit 631bab
		AC_MSG_RESULT([yes, with -ansi])
Packit 631bab
	else
Packit 631bab
		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
Packit 631bab
	fi
Packit 631bab
fi
Packit 631bab
rm -f conftest.$ac_ext
Packit 631bab
Packit 631bab
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
Packit 631bab
AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
Packit 631bab
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
Packit 631bab
	AC_MSG_RESULT([no])
Packit 631bab
else
Packit 631bab
	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
Packit 631bab
		TRADITIONALCPPFLAGS="-traditional"
Packit 631bab
		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
Packit 631bab
		AC_MSG_RESULT([yes])
Packit 631bab
	else
Packit 631bab
		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
Packit 631bab
	fi
Packit 631bab
fi
Packit 631bab
rm -f conftest.$ac_ext
Packit 631bab
AC_SUBST(RAWCPPFLAGS)
Packit 631bab
AC_SUBST(TRADITIONALCPPFLAGS)
Packit 631bab
]) # XORG_PROG_RAWCPP
Packit 631bab
Packit 631bab
# XORG_MANPAGE_SECTIONS()
Packit 631bab
# -----------------------
Packit 631bab
# Minimum version: 1.0.0
Packit 631bab
#
Packit 631bab
# Determine which sections man pages go in for the different man page types
Packit 631bab
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
Packit 631bab
# Not sure if there's any better way than just hardcoding by OS name.
Packit 631bab
# Override default settings by setting environment variables
Packit 631bab
# Added MAN_SUBSTS in version 1.8
Packit 631bab
# Added AC_PROG_SED in version 1.8
Packit 631bab
Packit 631bab
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
Packit 631bab
AC_REQUIRE([AC_CANONICAL_HOST])
Packit 631bab
AC_REQUIRE([AC_PROG_SED])
Packit 631bab
Packit 631bab
if test x$APP_MAN_SUFFIX = x    ; then
Packit 631bab
    APP_MAN_SUFFIX=1
Packit 631bab
fi
Packit 631bab
if test x$APP_MAN_DIR = x    ; then
Packit 631bab
    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
Packit 631bab
fi
Packit 631bab
Packit 631bab
if test x$LIB_MAN_SUFFIX = x    ; then
Packit 631bab
    LIB_MAN_SUFFIX=3
Packit 631bab
fi
Packit 631bab
if test x$LIB_MAN_DIR = x    ; then
Packit 631bab
    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
Packit 631bab
fi
Packit 631bab
Packit 631bab
if test x$FILE_MAN_SUFFIX = x    ; then
Packit 631bab
    case $host_os in
Packit 631bab
	solaris*)	FILE_MAN_SUFFIX=4  ;;
Packit 631bab
	*)		FILE_MAN_SUFFIX=5  ;;
Packit 631bab
    esac
Packit 631bab
fi
Packit 631bab
if test x$FILE_MAN_DIR = x    ; then
Packit 631bab
    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
Packit 631bab
fi
Packit 631bab
Packit 631bab
if test x$MISC_MAN_SUFFIX = x    ; then
Packit 631bab
    case $host_os in
Packit 631bab
	solaris*)	MISC_MAN_SUFFIX=5  ;;
Packit 631bab
	*)		MISC_MAN_SUFFIX=7  ;;
Packit 631bab
    esac
Packit 631bab
fi
Packit 631bab
if test x$MISC_MAN_DIR = x    ; then
Packit 631bab
    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
Packit 631bab
fi
Packit 631bab
Packit 631bab
if test x$DRIVER_MAN_SUFFIX = x    ; then
Packit 631bab
    case $host_os in
Packit 631bab
	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
Packit 631bab
	*)		DRIVER_MAN_SUFFIX=4  ;;
Packit 631bab
    esac
Packit 631bab
fi
Packit 631bab
if test x$DRIVER_MAN_DIR = x    ; then
Packit 631bab
    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
Packit 631bab
fi
Packit 631bab
Packit 631bab
if test x$ADMIN_MAN_SUFFIX = x    ; then
Packit 631bab
    case $host_os in
Packit 631bab
	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
Packit 631bab
	*)		ADMIN_MAN_SUFFIX=8  ;;
Packit 631bab
    esac
Packit 631bab
fi
Packit 631bab
if test x$ADMIN_MAN_DIR = x    ; then
Packit 631bab
    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
Packit 631bab
fi
Packit 631bab
Packit 631bab
Packit 631bab
AC_SUBST([APP_MAN_SUFFIX])
Packit 631bab
AC_SUBST([LIB_MAN_SUFFIX])
Packit 631bab
AC_SUBST([FILE_MAN_SUFFIX])
Packit 631bab
AC_SUBST([MISC_MAN_SUFFIX])
Packit 631bab
AC_SUBST([DRIVER_MAN_SUFFIX])
Packit 631bab
AC_SUBST([ADMIN_MAN_SUFFIX])
Packit 631bab
AC_SUBST([APP_MAN_DIR])
Packit 631bab
AC_SUBST([LIB_MAN_DIR])
Packit 631bab
AC_SUBST([FILE_MAN_DIR])
Packit 631bab
AC_SUBST([MISC_MAN_DIR])
Packit 631bab
AC_SUBST([DRIVER_MAN_DIR])
Packit 631bab
AC_SUBST([ADMIN_MAN_DIR])
Packit 631bab
Packit 631bab
XORG_MAN_PAGE="X Version 11"
Packit 631bab
AC_SUBST([XORG_MAN_PAGE])
Packit 631bab
MAN_SUBSTS="\
Packit 631bab
	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
Packit 631bab
	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
Packit 631bab
	-e 's|__xservername__|Xorg|g' \
Packit 631bab
	-e 's|__xconfigfile__|xorg.conf|g' \
Packit 631bab
	-e 's|__projectroot__|\$(prefix)|g' \
Packit 631bab
	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
Packit 631bab
	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
Packit 631bab
	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
Packit 631bab
	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
Packit 631bab
	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
Packit 631bab
	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
Packit 631bab
	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
Packit 631bab
AC_SUBST([MAN_SUBSTS])
Packit 631bab
Packit 631bab
]) # XORG_MANPAGE_SECTIONS
Packit 631bab
Packit 631bab
# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
Packit 631bab
# ------------------------
Packit 631bab
# Minimum version: 1.7.0
Packit 631bab
#
Packit 631bab
# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
Packit 631bab
# provided by xorg-sgml-doctools, if installed.
Packit 631bab
AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
Packit 631bab
AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
Packit 631bab
XORG_SGML_PATH=
Packit 631bab
PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
Packit 631bab
    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
Packit 631bab
    [m4_ifval([$1],[:],
Packit 631bab
        [if test x"$cross_compiling" != x"yes" ; then
Packit 631bab
            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
Packit 631bab
                          [XORG_SGML_PATH=$prefix/share/sgml])
Packit 631bab
         fi])
Packit 631bab
    ])
Packit 631bab
Packit 631bab
# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
Packit 631bab
# the path and the name of the doc stylesheet
Packit 631bab
if test "x$XORG_SGML_PATH" != "x" ; then
Packit 631bab
   AC_MSG_RESULT([$XORG_SGML_PATH])
Packit 631bab
   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
Packit 631bab
   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
Packit 631bab
else
Packit 631bab
   AC_MSG_RESULT([no])
Packit 631bab
fi
Packit 631bab
Packit 631bab
AC_SUBST(XORG_SGML_PATH)
Packit 631bab
AC_SUBST(STYLESHEET_SRCDIR)
Packit 631bab
AC_SUBST(XSL_STYLESHEET)
Packit 631bab
AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
Packit 631bab
]) # XORG_CHECK_SGML_DOCTOOLS
Packit 631bab
Packit 631bab
# XORG_CHECK_LINUXDOC
Packit 631bab
# -------------------
Packit 631bab
# Minimum version: 1.0.0
Packit 631bab
#
Packit 631bab
# Defines the variable MAKE_TEXT if the necessary tools and
Packit 631bab
# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
Packit 631bab
# Whether or not the necessary tools and files are found can be checked
Packit 631bab
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
Packit 631bab
AC_DEFUN([XORG_CHECK_LINUXDOC],[
Packit 631bab
AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
Packit 631bab
AC_REQUIRE([XORG_WITH_PS2PDF])
Packit 631bab
Packit 631bab
AC_PATH_PROG(LINUXDOC, linuxdoc)
Packit 631bab
Packit 631bab
AC_MSG_CHECKING([whether to build documentation])
Packit 631bab
Packit 631bab
if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
Packit 631bab
   BUILDDOC=yes
Packit 631bab
else
Packit 631bab
   BUILDDOC=no
Packit 631bab
fi
Packit 631bab
Packit 631bab
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
Packit 631bab
Packit 631bab
AC_MSG_RESULT([$BUILDDOC])
Packit 631bab
Packit 631bab
AC_MSG_CHECKING([whether to build pdf documentation])
Packit 631bab
Packit 631bab
if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
Packit 631bab
   BUILDPDFDOC=yes
Packit 631bab
else
Packit 631bab
   BUILDPDFDOC=no
Packit 631bab
fi
Packit 631bab
Packit 631bab
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
Packit 631bab
Packit 631bab
AC_MSG_RESULT([$BUILDPDFDOC])
Packit 631bab
Packit 631bab
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
Packit 631bab
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
Packit 631bab
MAKE_PDF="$PS2PDF"
Packit 631bab
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
Packit 631bab
Packit 631bab
AC_SUBST(MAKE_TEXT)
Packit 631bab
AC_SUBST(MAKE_PS)
Packit 631bab
AC_SUBST(MAKE_PDF)
Packit 631bab
AC_SUBST(MAKE_HTML)
Packit 631bab
]) # XORG_CHECK_LINUXDOC
Packit 631bab
Packit 631bab
# XORG_CHECK_DOCBOOK
Packit 631bab
# -------------------
Packit 631bab
# Minimum version: 1.0.0
Packit 631bab
#
Packit 631bab
# Checks for the ability to build output formats from SGML DocBook source.
Packit 631bab
# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
Packit 631bab
# indicates whether the necessary tools and files are found and, if set,
Packit 631bab
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
Packit 631bab
AC_DEFUN([XORG_CHECK_DOCBOOK],[
Packit 631bab
AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
Packit 631bab
Packit 631bab
BUILDTXTDOC=no
Packit 631bab
BUILDPDFDOC=no
Packit 631bab
BUILDPSDOC=no
Packit 631bab
BUILDHTMLDOC=no
Packit 631bab
Packit 631bab
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
Packit 631bab
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
Packit 631bab
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
Packit 631bab
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
Packit 631bab
Packit 631bab
AC_MSG_CHECKING([whether to build text documentation])
Packit 631bab
if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
Packit 631bab
   test x$BUILD_TXTDOC != xno; then
Packit 631bab
	BUILDTXTDOC=yes
Packit 631bab
fi
Packit 631bab
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
Packit 631bab
AC_MSG_RESULT([$BUILDTXTDOC])
Packit 631bab
Packit 631bab
AC_MSG_CHECKING([whether to build PDF documentation])
Packit 631bab
if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
Packit 631bab
   test x$BUILD_PDFDOC != xno; then
Packit 631bab
	BUILDPDFDOC=yes
Packit 631bab
fi
Packit 631bab
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
Packit 631bab
AC_MSG_RESULT([$BUILDPDFDOC])
Packit 631bab
Packit 631bab
AC_MSG_CHECKING([whether to build PostScript documentation])
Packit 631bab
if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
Packit 631bab
   test x$BUILD_PSDOC != xno; then
Packit 631bab
	BUILDPSDOC=yes
Packit 631bab
fi
Packit 631bab
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
Packit 631bab
AC_MSG_RESULT([$BUILDPSDOC])
Packit 631bab
Packit 631bab
AC_MSG_CHECKING([whether to build HTML documentation])
Packit 631bab
if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
Packit 631bab
   test x$BUILD_HTMLDOC != xno; then
Packit 631bab
	BUILDHTMLDOC=yes
Packit 631bab
fi
Packit 631bab
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
Packit 631bab
AC_MSG_RESULT([$BUILDHTMLDOC])
Packit 631bab
Packit 631bab
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
Packit 631bab
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
Packit 631bab
MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
Packit 631bab
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
Packit 631bab
Packit 631bab
AC_SUBST(MAKE_TEXT)
Packit 631bab
AC_SUBST(MAKE_PS)
Packit 631bab
AC_SUBST(MAKE_PDF)
Packit 631bab
AC_SUBST(MAKE_HTML)
Packit 631bab
]) # XORG_CHECK_DOCBOOK
Packit 631bab
Packit 631bab
# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
Packit 631bab
# ----------------
Packit 631bab
# Minimum version: 1.5.0
Packit 631bab
# Minimum version for optional DEFAULT argument: 1.11.0
Packit 631bab
#
Packit 631bab
# Documentation tools are not always available on all platforms and sometimes
Packit 631bab
# not at the appropriate level. This macro enables a module to test for the
Packit 631bab
# presence of the tool and obtain it's path in separate variables. Coupled with
Packit 631bab
# the --with-xmlto option, it allows maximum flexibilty in making decisions
Packit 631bab
# as whether or not to use the xmlto package. When DEFAULT is not specified,
Packit 631bab
# --with-xmlto assumes 'auto'.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
Packit 631bab
# XMLTO:	returns the path of the xmlto program found
Packit 631bab
#		returns the path set by the user in the environment
Packit 631bab
# --with-xmlto:	'yes' user instructs the module to use xmlto
Packit 631bab
#		'no' user instructs the module not to use xmlto
Packit 631bab
#
Packit 631bab
# Added in version 1.10.0
Packit 631bab
# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
Packit 631bab
#                  xmlto for text output requires either lynx, links, or w3m browsers
Packit 631bab
#
Packit 631bab
# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_WITH_XMLTO],[
Packit 631bab
AC_ARG_VAR([XMLTO], [Path to xmlto command])
Packit 631bab
m4_define([_defopt], m4_default([$2], [auto]))
Packit 631bab
AC_ARG_WITH(xmlto,
Packit 631bab
	AS_HELP_STRING([--with-xmlto],
Packit 631bab
	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
Packit 631bab
	   [use_xmlto=$withval], [use_xmlto=]_defopt)
Packit 631bab
m4_undefine([_defopt])
Packit 631bab
Packit 631bab
if test "x$use_xmlto" = x"auto"; then
Packit 631bab
   AC_PATH_PROG([XMLTO], [xmlto])
Packit 631bab
   if test "x$XMLTO" = "x"; then
Packit 631bab
        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
Packit 631bab
	have_xmlto=no
Packit 631bab
   else
Packit 631bab
        have_xmlto=yes
Packit 631bab
   fi
Packit 631bab
elif test "x$use_xmlto" = x"yes" ; then
Packit 631bab
   AC_PATH_PROG([XMLTO], [xmlto])
Packit 631bab
   if test "x$XMLTO" = "x"; then
Packit 631bab
        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
Packit 631bab
   fi
Packit 631bab
   have_xmlto=yes
Packit 631bab
elif test "x$use_xmlto" = x"no" ; then
Packit 631bab
   if test "x$XMLTO" != "x"; then
Packit 631bab
      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
Packit 631bab
   fi
Packit 631bab
   have_xmlto=no
Packit 631bab
else
Packit 631bab
   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
Packit 631bab
fi
Packit 631bab
Packit 631bab
# Test for a minimum version of xmlto, if provided.
Packit 631bab
m4_ifval([$1],
Packit 631bab
[if test "$have_xmlto" = yes; then
Packit 631bab
    # scrape the xmlto version
Packit 631bab
    AC_MSG_CHECKING([the xmlto version])
Packit 631bab
    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
Packit 631bab
    AC_MSG_RESULT([$xmlto_version])
Packit 631bab
    AS_VERSION_COMPARE([$xmlto_version], [$1],
Packit 631bab
        [if test "x$use_xmlto" = xauto; then
Packit 631bab
            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
Packit 631bab
            have_xmlto=no
Packit 631bab
        else
Packit 631bab
            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
Packit 631bab
        fi])
Packit 631bab
fi])
Packit 631bab
Packit 631bab
# Test for the ability of xmlto to generate a text target
Packit 631bab
#
Packit 631bab
# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
Packit 631bab
# following test for empty XML docbook files.
Packit 631bab
# For compatibility reasons use the following empty XML docbook file and if
Packit 631bab
# it fails try it again with a non-empty XML file.
Packit 631bab
have_xmlto_text=no
Packit 631bab
cat > conftest.xml << "EOF"
Packit 631bab
EOF
Packit 631bab
AS_IF([test "$have_xmlto" = yes],
Packit 631bab
      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
Packit 631bab
             [have_xmlto_text=yes],
Packit 631bab
             [# Try it again with a non-empty XML file.
Packit 631bab
              cat > conftest.xml << "EOF"
Packit 631bab
<x></x>
Packit 631bab
EOF
Packit 631bab
              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
Packit 631bab
                    [have_xmlto_text=yes],
Packit 631bab
                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
Packit 631bab
rm -f conftest.xml
Packit 631bab
AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
Packit 631bab
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
Packit 631bab
]) # XORG_WITH_XMLTO
Packit 631bab
Packit 631bab
# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
Packit 631bab
# --------------------------------------------
Packit 631bab
# Minimum version: 1.12.0
Packit 631bab
# Minimum version for optional DEFAULT argument: 1.12.0
Packit 631bab
#
Packit 631bab
# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
Packit 631bab
# XML-based language used for the transformation of XML documents.
Packit 631bab
# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
Packit 631bab
# It is used under the cover by xmlto to generate html files from DocBook/XML.
Packit 631bab
# The XSLT processor is often used as a standalone tool for transformations.
Packit 631bab
# It should not be assumed that this tool is used only to work with documnetation.
Packit 631bab
# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
Packit 631bab
# XSLTPROC:	 returns the path of the xsltproc program found
Packit 631bab
#		 returns the path set by the user in the environment
Packit 631bab
# --with-xsltproc: 'yes' user instructs the module to use xsltproc
Packit 631bab
#		  'no' user instructs the module not to use xsltproc
Packit 631bab
# have_xsltproc: returns yes if xsltproc found in PATH or no
Packit 631bab
#
Packit 631bab
# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_WITH_XSLTPROC],[
Packit 631bab
AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
Packit 631bab
# Preserves the interface, should it be implemented later
Packit 631bab
m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
Packit 631bab
m4_define([_defopt], m4_default([$2], [auto]))
Packit 631bab
AC_ARG_WITH(xsltproc,
Packit 631bab
	AS_HELP_STRING([--with-xsltproc],
Packit 631bab
	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
Packit 631bab
	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
Packit 631bab
m4_undefine([_defopt])
Packit 631bab
Packit 631bab
if test "x$use_xsltproc" = x"auto"; then
Packit 631bab
   AC_PATH_PROG([XSLTPROC], [xsltproc])
Packit 631bab
   if test "x$XSLTPROC" = "x"; then
Packit 631bab
        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
Packit 631bab
	have_xsltproc=no
Packit 631bab
   else
Packit 631bab
        have_xsltproc=yes
Packit 631bab
   fi
Packit 631bab
elif test "x$use_xsltproc" = x"yes" ; then
Packit 631bab
   AC_PATH_PROG([XSLTPROC], [xsltproc])
Packit 631bab
   if test "x$XSLTPROC" = "x"; then
Packit 631bab
        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
Packit 631bab
   fi
Packit 631bab
   have_xsltproc=yes
Packit 631bab
elif test "x$use_xsltproc" = x"no" ; then
Packit 631bab
   if test "x$XSLTPROC" != "x"; then
Packit 631bab
      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
Packit 631bab
   fi
Packit 631bab
   have_xsltproc=no
Packit 631bab
else
Packit 631bab
   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
Packit 631bab
fi
Packit 631bab
Packit 631bab
AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
Packit 631bab
]) # XORG_WITH_XSLTPROC
Packit 631bab
Packit 631bab
# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
Packit 631bab
# ----------------------------------------
Packit 631bab
# Minimum version: 1.15.0
Packit 631bab
#
Packit 631bab
# PERL (Practical Extraction and Report Language) is a language optimized for
Packit 631bab
# scanning arbitrary text files, extracting information from those text files,
Packit 631bab
# and printing reports based on that information.
Packit 631bab
#
Packit 631bab
# When DEFAULT is not specified, --with-perl assumes 'auto'.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# HAVE_PERL: used in makefiles to conditionally scan text files
Packit 631bab
# PERL:	     returns the path of the perl program found
Packit 631bab
#	     returns the path set by the user in the environment
Packit 631bab
# --with-perl: 'yes' user instructs the module to use perl
Packit 631bab
#	       'no' user instructs the module not to use perl
Packit 631bab
# have_perl: returns yes if perl found in PATH or no
Packit 631bab
#
Packit 631bab
# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_WITH_PERL],[
Packit 631bab
AC_ARG_VAR([PERL], [Path to perl command])
Packit 631bab
# Preserves the interface, should it be implemented later
Packit 631bab
m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
Packit 631bab
m4_define([_defopt], m4_default([$2], [auto]))
Packit 631bab
AC_ARG_WITH(perl,
Packit 631bab
	AS_HELP_STRING([--with-perl],
Packit 631bab
	   [Use perl for extracting information from files (default: ]_defopt[)]),
Packit 631bab
	   [use_perl=$withval], [use_perl=]_defopt)
Packit 631bab
m4_undefine([_defopt])
Packit 631bab
Packit 631bab
if test "x$use_perl" = x"auto"; then
Packit 631bab
   AC_PATH_PROG([PERL], [perl])
Packit 631bab
   if test "x$PERL" = "x"; then
Packit 631bab
        AC_MSG_WARN([perl not found - cannot extract information and report])
Packit 631bab
	have_perl=no
Packit 631bab
   else
Packit 631bab
        have_perl=yes
Packit 631bab
   fi
Packit 631bab
elif test "x$use_perl" = x"yes" ; then
Packit 631bab
   AC_PATH_PROG([PERL], [perl])
Packit 631bab
   if test "x$PERL" = "x"; then
Packit 631bab
        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
Packit 631bab
   fi
Packit 631bab
   have_perl=yes
Packit 631bab
elif test "x$use_perl" = x"no" ; then
Packit 631bab
   if test "x$PERL" != "x"; then
Packit 631bab
      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
Packit 631bab
   fi
Packit 631bab
   have_perl=no
Packit 631bab
else
Packit 631bab
   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
Packit 631bab
fi
Packit 631bab
Packit 631bab
AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
Packit 631bab
]) # XORG_WITH_PERL
Packit 631bab
Packit 631bab
# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
Packit 631bab
# ----------------
Packit 631bab
# Minimum version: 1.5.0
Packit 631bab
# Minimum version for optional DEFAULT argument: 1.11.0
Packit 631bab
#
Packit 631bab
# Documentation tools are not always available on all platforms and sometimes
Packit 631bab
# not at the appropriate level. This macro enables a module to test for the
Packit 631bab
# presence of the tool and obtain it's path in separate variables. Coupled with
Packit 631bab
# the --with-asciidoc option, it allows maximum flexibilty in making decisions
Packit 631bab
# as whether or not to use the asciidoc package. When DEFAULT is not specified,
Packit 631bab
# --with-asciidoc assumes 'auto'.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
Packit 631bab
# ASCIIDOC:	 returns the path of the asciidoc program found
Packit 631bab
#		 returns the path set by the user in the environment
Packit 631bab
# --with-asciidoc: 'yes' user instructs the module to use asciidoc
Packit 631bab
#		  'no' user instructs the module not to use asciidoc
Packit 631bab
#
Packit 631bab
# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_WITH_ASCIIDOC],[
Packit 631bab
AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
Packit 631bab
m4_define([_defopt], m4_default([$2], [auto]))
Packit 631bab
AC_ARG_WITH(asciidoc,
Packit 631bab
	AS_HELP_STRING([--with-asciidoc],
Packit 631bab
	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
Packit 631bab
	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
Packit 631bab
m4_undefine([_defopt])
Packit 631bab
Packit 631bab
if test "x$use_asciidoc" = x"auto"; then
Packit 631bab
   AC_PATH_PROG([ASCIIDOC], [asciidoc])
Packit 631bab
   if test "x$ASCIIDOC" = "x"; then
Packit 631bab
        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
Packit 631bab
	have_asciidoc=no
Packit 631bab
   else
Packit 631bab
        have_asciidoc=yes
Packit 631bab
   fi
Packit 631bab
elif test "x$use_asciidoc" = x"yes" ; then
Packit 631bab
   AC_PATH_PROG([ASCIIDOC], [asciidoc])
Packit 631bab
   if test "x$ASCIIDOC" = "x"; then
Packit 631bab
        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
Packit 631bab
   fi
Packit 631bab
   have_asciidoc=yes
Packit 631bab
elif test "x$use_asciidoc" = x"no" ; then
Packit 631bab
   if test "x$ASCIIDOC" != "x"; then
Packit 631bab
      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
Packit 631bab
   fi
Packit 631bab
   have_asciidoc=no
Packit 631bab
else
Packit 631bab
   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
Packit 631bab
fi
Packit 631bab
m4_ifval([$1],
Packit 631bab
[if test "$have_asciidoc" = yes; then
Packit 631bab
    # scrape the asciidoc version
Packit 631bab
    AC_MSG_CHECKING([the asciidoc version])
Packit 631bab
    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
Packit 631bab
    AC_MSG_RESULT([$asciidoc_version])
Packit 631bab
    AS_VERSION_COMPARE([$asciidoc_version], [$1],
Packit 631bab
        [if test "x$use_asciidoc" = xauto; then
Packit 631bab
            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
Packit 631bab
            have_asciidoc=no
Packit 631bab
        else
Packit 631bab
            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
Packit 631bab
        fi])
Packit 631bab
fi])
Packit 631bab
AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
Packit 631bab
]) # XORG_WITH_ASCIIDOC
Packit 631bab
Packit 631bab
# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
Packit 631bab
# -------------------------------------------
Packit 631bab
# Minimum version: 1.5.0
Packit 631bab
# Minimum version for optional DEFAULT argument: 1.11.0
Packit 631bab
# Minimum version for optional DOT checking: 1.18.0
Packit 631bab
#
Packit 631bab
# Documentation tools are not always available on all platforms and sometimes
Packit 631bab
# not at the appropriate level. This macro enables a module to test for the
Packit 631bab
# presence of the tool and obtain it's path in separate variables. Coupled with
Packit 631bab
# the --with-doxygen option, it allows maximum flexibilty in making decisions
Packit 631bab
# as whether or not to use the doxygen package. When DEFAULT is not specified,
Packit 631bab
# --with-doxygen assumes 'auto'.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
Packit 631bab
# DOXYGEN:	 returns the path of the doxygen program found
Packit 631bab
#		 returns the path set by the user in the environment
Packit 631bab
# --with-doxygen: 'yes' user instructs the module to use doxygen
Packit 631bab
#		  'no' user instructs the module not to use doxygen
Packit 631bab
#
Packit 631bab
# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_WITH_DOXYGEN],[
Packit 631bab
AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
Packit 631bab
AC_ARG_VAR([DOT], [Path to the dot graphics utility])
Packit 631bab
m4_define([_defopt], m4_default([$2], [auto]))
Packit 631bab
AC_ARG_WITH(doxygen,
Packit 631bab
	AS_HELP_STRING([--with-doxygen],
Packit 631bab
	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
Packit 631bab
	   [use_doxygen=$withval], [use_doxygen=]_defopt)
Packit 631bab
m4_undefine([_defopt])
Packit 631bab
Packit 631bab
if test "x$use_doxygen" = x"auto"; then
Packit 631bab
   AC_PATH_PROG([DOXYGEN], [doxygen])
Packit 631bab
   if test "x$DOXYGEN" = "x"; then
Packit 631bab
        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
Packit 631bab
	have_doxygen=no
Packit 631bab
   else
Packit 631bab
        have_doxygen=yes
Packit 631bab
   fi
Packit 631bab
elif test "x$use_doxygen" = x"yes" ; then
Packit 631bab
   AC_PATH_PROG([DOXYGEN], [doxygen])
Packit 631bab
   if test "x$DOXYGEN" = "x"; then
Packit 631bab
        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
Packit 631bab
   fi
Packit 631bab
   have_doxygen=yes
Packit 631bab
elif test "x$use_doxygen" = x"no" ; then
Packit 631bab
   if test "x$DOXYGEN" != "x"; then
Packit 631bab
      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
Packit 631bab
   fi
Packit 631bab
   have_doxygen=no
Packit 631bab
else
Packit 631bab
   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
Packit 631bab
fi
Packit 631bab
m4_ifval([$1],
Packit 631bab
[if test "$have_doxygen" = yes; then
Packit 631bab
    # scrape the doxygen version
Packit 631bab
    AC_MSG_CHECKING([the doxygen version])
Packit 631bab
    doxygen_version=`$DOXYGEN --version 2>/dev/null`
Packit 631bab
    AC_MSG_RESULT([$doxygen_version])
Packit 631bab
    AS_VERSION_COMPARE([$doxygen_version], [$1],
Packit 631bab
        [if test "x$use_doxygen" = xauto; then
Packit 631bab
            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
Packit 631bab
            have_doxygen=no
Packit 631bab
        else
Packit 631bab
            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
Packit 631bab
        fi])
Packit 631bab
fi])
Packit 631bab
Packit 631bab
dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
Packit 631bab
dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
Packit 631bab
dnl 	HAVE_DOT = @HAVE_DOT@
Packit 631bab
HAVE_DOT=no
Packit 631bab
if test "x$have_doxygen" = "xyes"; then
Packit 631bab
  AC_PATH_PROG([DOT], [dot])
Packit 631bab
    if test "x$DOT" != "x"; then
Packit 631bab
      HAVE_DOT=yes
Packit 631bab
    fi
Packit 631bab
fi
Packit 631bab
Packit 631bab
AC_SUBST([HAVE_DOT])
Packit 631bab
AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
Packit 631bab
AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
Packit 631bab
]) # XORG_WITH_DOXYGEN
Packit 631bab
Packit 631bab
# XORG_WITH_GROFF([DEFAULT])
Packit 631bab
# ----------------
Packit 631bab
# Minimum version: 1.6.0
Packit 631bab
# Minimum version for optional DEFAULT argument: 1.11.0
Packit 631bab
#
Packit 631bab
# Documentation tools are not always available on all platforms and sometimes
Packit 631bab
# not at the appropriate level. This macro enables a module to test for the
Packit 631bab
# presence of the tool and obtain it's path in separate variables. Coupled with
Packit 631bab
# the --with-groff option, it allows maximum flexibilty in making decisions
Packit 631bab
# as whether or not to use the groff package. When DEFAULT is not specified,
Packit 631bab
# --with-groff assumes 'auto'.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
Packit 631bab
# HAVE_GROFF_MM: the memorandum macros (-mm) package
Packit 631bab
# HAVE_GROFF_MS: the -ms macros package
Packit 631bab
# GROFF:	 returns the path of the groff program found
Packit 631bab
#		 returns the path set by the user in the environment
Packit 631bab
# --with-groff:	 'yes' user instructs the module to use groff
Packit 631bab
#		 'no' user instructs the module not to use groff
Packit 631bab
#
Packit 631bab
# Added in version 1.9.0:
Packit 631bab
# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
Packit 631bab
#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
Packit 631bab
#		   psselect from the psutils package.
Packit 631bab
#		   the ghostcript package. Refer to the grohtml man pages
Packit 631bab
#
Packit 631bab
# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
Packit 631bab
#
Packit 631bab
# OS and distros often splits groff in a basic and full package, the former
Packit 631bab
# having the groff program and the later having devices, fonts and macros
Packit 631bab
# Checking for the groff executable is not enough.
Packit 631bab
#
Packit 631bab
# If macros are missing, we cannot assume that groff is useless, so we don't
Packit 631bab
# unset HAVE_GROFF or GROFF env variables.
Packit 631bab
# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_WITH_GROFF],[
Packit 631bab
AC_ARG_VAR([GROFF], [Path to groff command])
Packit 631bab
m4_define([_defopt], m4_default([$1], [auto]))
Packit 631bab
AC_ARG_WITH(groff,
Packit 631bab
	AS_HELP_STRING([--with-groff],
Packit 631bab
	   [Use groff to regenerate documentation (default: ]_defopt[)]),
Packit 631bab
	   [use_groff=$withval], [use_groff=]_defopt)
Packit 631bab
m4_undefine([_defopt])
Packit 631bab
Packit 631bab
if test "x$use_groff" = x"auto"; then
Packit 631bab
   AC_PATH_PROG([GROFF], [groff])
Packit 631bab
   if test "x$GROFF" = "x"; then
Packit 631bab
        AC_MSG_WARN([groff not found - documentation targets will be skipped])
Packit 631bab
	have_groff=no
Packit 631bab
   else
Packit 631bab
        have_groff=yes
Packit 631bab
   fi
Packit 631bab
elif test "x$use_groff" = x"yes" ; then
Packit 631bab
   AC_PATH_PROG([GROFF], [groff])
Packit 631bab
   if test "x$GROFF" = "x"; then
Packit 631bab
        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
Packit 631bab
   fi
Packit 631bab
   have_groff=yes
Packit 631bab
elif test "x$use_groff" = x"no" ; then
Packit 631bab
   if test "x$GROFF" != "x"; then
Packit 631bab
      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
Packit 631bab
   fi
Packit 631bab
   have_groff=no
Packit 631bab
else
Packit 631bab
   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
Packit 631bab
fi
Packit 631bab
Packit 631bab
# We have groff, test for the presence of the macro packages
Packit 631bab
if test "x$have_groff" = x"yes"; then
Packit 631bab
    AC_MSG_CHECKING([for ${GROFF} -ms macros])
Packit 631bab
    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
Packit 631bab
        groff_ms_works=yes
Packit 631bab
    else
Packit 631bab
        groff_ms_works=no
Packit 631bab
    fi
Packit 631bab
    AC_MSG_RESULT([$groff_ms_works])
Packit 631bab
    AC_MSG_CHECKING([for ${GROFF} -mm macros])
Packit 631bab
    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
Packit 631bab
        groff_mm_works=yes
Packit 631bab
    else
Packit 631bab
        groff_mm_works=no
Packit 631bab
    fi
Packit 631bab
    AC_MSG_RESULT([$groff_mm_works])
Packit 631bab
fi
Packit 631bab
Packit 631bab
# We have groff, test for HTML dependencies, one command per package
Packit 631bab
if test "x$have_groff" = x"yes"; then
Packit 631bab
   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
Packit 631bab
   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
Packit 631bab
   AC_PATH_PROG(PSSELECT_PATH, [psselect])
Packit 631bab
   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
Packit 631bab
      have_groff_html=yes
Packit 631bab
   else
Packit 631bab
      have_groff_html=no
Packit 631bab
      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
Packit 631bab
   fi
Packit 631bab
fi
Packit 631bab
Packit 631bab
# Set Automake conditionals for Makefiles
Packit 631bab
AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
Packit 631bab
AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
Packit 631bab
AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
Packit 631bab
AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
Packit 631bab
]) # XORG_WITH_GROFF
Packit 631bab
Packit 631bab
# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
Packit 631bab
# ---------------------------------------
Packit 631bab
# Minimum version: 1.6.0
Packit 631bab
# Minimum version for optional DEFAULT argument: 1.11.0
Packit 631bab
# Minimum version for optional MIN-VERSION argument: 1.15.0
Packit 631bab
#
Packit 631bab
# Documentation tools are not always available on all platforms and sometimes
Packit 631bab
# not at the appropriate level. This macro enables a module to test for the
Packit 631bab
# presence of the tool and obtain it's path in separate variables. Coupled with
Packit 631bab
# the --with-fop option, it allows maximum flexibilty in making decisions
Packit 631bab
# as whether or not to use the fop package. When DEFAULT is not specified,
Packit 631bab
# --with-fop assumes 'auto'.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# HAVE_FOP: 	used in makefiles to conditionally generate documentation
Packit 631bab
# FOP:	 	returns the path of the fop program found
Packit 631bab
#		returns the path set by the user in the environment
Packit 631bab
# --with-fop: 	'yes' user instructs the module to use fop
Packit 631bab
#		'no' user instructs the module not to use fop
Packit 631bab
#
Packit 631bab
# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_WITH_FOP],[
Packit 631bab
AC_ARG_VAR([FOP], [Path to fop command])
Packit 631bab
m4_define([_defopt], m4_default([$2], [auto]))
Packit 631bab
AC_ARG_WITH(fop,
Packit 631bab
	AS_HELP_STRING([--with-fop],
Packit 631bab
	   [Use fop to regenerate documentation (default: ]_defopt[)]),
Packit 631bab
	   [use_fop=$withval], [use_fop=]_defopt)
Packit 631bab
m4_undefine([_defopt])
Packit 631bab
Packit 631bab
if test "x$use_fop" = x"auto"; then
Packit 631bab
   AC_PATH_PROG([FOP], [fop])
Packit 631bab
   if test "x$FOP" = "x"; then
Packit 631bab
        AC_MSG_WARN([fop not found - documentation targets will be skipped])
Packit 631bab
	have_fop=no
Packit 631bab
   else
Packit 631bab
        have_fop=yes
Packit 631bab
   fi
Packit 631bab
elif test "x$use_fop" = x"yes" ; then
Packit 631bab
   AC_PATH_PROG([FOP], [fop])
Packit 631bab
   if test "x$FOP" = "x"; then
Packit 631bab
        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
Packit 631bab
   fi
Packit 631bab
   have_fop=yes
Packit 631bab
elif test "x$use_fop" = x"no" ; then
Packit 631bab
   if test "x$FOP" != "x"; then
Packit 631bab
      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
Packit 631bab
   fi
Packit 631bab
   have_fop=no
Packit 631bab
else
Packit 631bab
   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
Packit 631bab
fi
Packit 631bab
Packit 631bab
# Test for a minimum version of fop, if provided.
Packit 631bab
m4_ifval([$1],
Packit 631bab
[if test "$have_fop" = yes; then
Packit 631bab
    # scrape the fop version
Packit 631bab
    AC_MSG_CHECKING([for fop minimum version])
Packit 631bab
    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
Packit 631bab
    AC_MSG_RESULT([$fop_version])
Packit 631bab
    AS_VERSION_COMPARE([$fop_version], [$1],
Packit 631bab
        [if test "x$use_fop" = xauto; then
Packit 631bab
            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
Packit 631bab
            have_fop=no
Packit 631bab
        else
Packit 631bab
            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
Packit 631bab
        fi])
Packit 631bab
fi])
Packit 631bab
AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
Packit 631bab
]) # XORG_WITH_FOP
Packit 631bab
Packit 631bab
# XORG_WITH_M4([MIN-VERSION])
Packit 631bab
# ---------------------------
Packit 631bab
# Minimum version: 1.19.0
Packit 631bab
#
Packit 631bab
# This macro attempts to locate an m4 macro processor which supports
Packit 631bab
# -I option and is only useful for modules relying on M4 in order to
Packit 631bab
# expand macros in source code files.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# M4:	 	returns the path of the m4 program found
Packit 631bab
#		returns the path set by the user in the environment
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_WITH_M4], [
Packit 631bab
AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
Packit 631bab
   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
Packit 631bab
       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
Packit 631bab
         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
Packit 631bab
   [AC_MSG_ERROR([could not find m4 that supports -I option])],
Packit 631bab
   [$PATH:/usr/gnu/bin])])
Packit 631bab
Packit 631bab
AC_SUBST([M4], [$ac_cv_path_M4])
Packit 631bab
]) # XORG_WITH_M4
Packit 631bab
Packit 631bab
# XORG_WITH_PS2PDF([DEFAULT])
Packit 631bab
# ----------------
Packit 631bab
# Minimum version: 1.6.0
Packit 631bab
# Minimum version for optional DEFAULT argument: 1.11.0
Packit 631bab
#
Packit 631bab
# Documentation tools are not always available on all platforms and sometimes
Packit 631bab
# not at the appropriate level. This macro enables a module to test for the
Packit 631bab
# presence of the tool and obtain it's path in separate variables. Coupled with
Packit 631bab
# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
Packit 631bab
# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
Packit 631bab
# --with-ps2pdf assumes 'auto'.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
Packit 631bab
# PS2PDF:	returns the path of the ps2pdf program found
Packit 631bab
#		returns the path set by the user in the environment
Packit 631bab
# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
Packit 631bab
#		 'no' user instructs the module not to use ps2pdf
Packit 631bab
#
Packit 631bab
# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_WITH_PS2PDF],[
Packit 631bab
AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
Packit 631bab
m4_define([_defopt], m4_default([$1], [auto]))
Packit 631bab
AC_ARG_WITH(ps2pdf,
Packit 631bab
	AS_HELP_STRING([--with-ps2pdf],
Packit 631bab
	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
Packit 631bab
	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
Packit 631bab
m4_undefine([_defopt])
Packit 631bab
Packit 631bab
if test "x$use_ps2pdf" = x"auto"; then
Packit 631bab
   AC_PATH_PROG([PS2PDF], [ps2pdf])
Packit 631bab
   if test "x$PS2PDF" = "x"; then
Packit 631bab
        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
Packit 631bab
	have_ps2pdf=no
Packit 631bab
   else
Packit 631bab
        have_ps2pdf=yes
Packit 631bab
   fi
Packit 631bab
elif test "x$use_ps2pdf" = x"yes" ; then
Packit 631bab
   AC_PATH_PROG([PS2PDF], [ps2pdf])
Packit 631bab
   if test "x$PS2PDF" = "x"; then
Packit 631bab
        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
Packit 631bab
   fi
Packit 631bab
   have_ps2pdf=yes
Packit 631bab
elif test "x$use_ps2pdf" = x"no" ; then
Packit 631bab
   if test "x$PS2PDF" != "x"; then
Packit 631bab
      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
Packit 631bab
   fi
Packit 631bab
   have_ps2pdf=no
Packit 631bab
else
Packit 631bab
   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
Packit 631bab
fi
Packit 631bab
AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
Packit 631bab
]) # XORG_WITH_PS2PDF
Packit 631bab
Packit 631bab
# XORG_ENABLE_DOCS (enable_docs=yes)
Packit 631bab
# ----------------
Packit 631bab
# Minimum version: 1.6.0
Packit 631bab
#
Packit 631bab
# Documentation tools are not always available on all platforms and sometimes
Packit 631bab
# not at the appropriate level. This macro enables a builder to skip all
Packit 631bab
# documentation targets except traditional man pages.
Packit 631bab
# Combined with the specific tool checking macros XORG_WITH_*, it provides
Packit 631bab
# maximum flexibilty in controlling documentation building.
Packit 631bab
# Refer to:
Packit 631bab
# XORG_WITH_XMLTO         --with-xmlto
Packit 631bab
# XORG_WITH_ASCIIDOC      --with-asciidoc
Packit 631bab
# XORG_WITH_DOXYGEN       --with-doxygen
Packit 631bab
# XORG_WITH_FOP           --with-fop
Packit 631bab
# XORG_WITH_GROFF         --with-groff
Packit 631bab
# XORG_WITH_PS2PDF        --with-ps2pdf
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
Packit 631bab
# --enable-docs: 'yes' user instructs the module to generate docs
Packit 631bab
#		 'no' user instructs the module not to generate docs
Packit 631bab
# parm1:	specify the default value, yes or no.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_ENABLE_DOCS],[
Packit 631bab
m4_define([docs_default], m4_default([$1], [yes]))
Packit 631bab
AC_ARG_ENABLE(docs,
Packit 631bab
	AS_HELP_STRING([--enable-docs],
Packit 631bab
	   [Enable building the documentation (default: ]docs_default[)]),
Packit 631bab
	   [build_docs=$enableval], [build_docs=]docs_default)
Packit 631bab
m4_undefine([docs_default])
Packit 631bab
AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
Packit 631bab
AC_MSG_CHECKING([whether to build documentation])
Packit 631bab
AC_MSG_RESULT([$build_docs])
Packit 631bab
]) # XORG_ENABLE_DOCS
Packit 631bab
Packit 631bab
# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
Packit 631bab
# ----------------
Packit 631bab
# Minimum version: 1.6.0
Packit 631bab
#
Packit 631bab
# This macro enables a builder to skip all developer documentation.
Packit 631bab
# Combined with the specific tool checking macros XORG_WITH_*, it provides
Packit 631bab
# maximum flexibilty in controlling documentation building.
Packit 631bab
# Refer to:
Packit 631bab
# XORG_WITH_XMLTO         --with-xmlto
Packit 631bab
# XORG_WITH_ASCIIDOC      --with-asciidoc
Packit 631bab
# XORG_WITH_DOXYGEN       --with-doxygen
Packit 631bab
# XORG_WITH_FOP           --with-fop
Packit 631bab
# XORG_WITH_GROFF         --with-groff
Packit 631bab
# XORG_WITH_PS2PDF        --with-ps2pdf
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
Packit 631bab
# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
Packit 631bab
#			'no' user instructs the module not to generate developer docs
Packit 631bab
# parm1:		specify the default value, yes or no.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
Packit 631bab
m4_define([devel_default], m4_default([$1], [yes]))
Packit 631bab
AC_ARG_ENABLE(devel-docs,
Packit 631bab
	AS_HELP_STRING([--enable-devel-docs],
Packit 631bab
	   [Enable building the developer documentation (default: ]devel_default[)]),
Packit 631bab
	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
Packit 631bab
m4_undefine([devel_default])
Packit 631bab
AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
Packit 631bab
AC_MSG_CHECKING([whether to build developer documentation])
Packit 631bab
AC_MSG_RESULT([$build_devel_docs])
Packit 631bab
]) # XORG_ENABLE_DEVEL_DOCS
Packit 631bab
Packit 631bab
# XORG_ENABLE_SPECS (enable_specs=yes)
Packit 631bab
# ----------------
Packit 631bab
# Minimum version: 1.6.0
Packit 631bab
#
Packit 631bab
# This macro enables a builder to skip all functional specification targets.
Packit 631bab
# Combined with the specific tool checking macros XORG_WITH_*, it provides
Packit 631bab
# maximum flexibilty in controlling documentation building.
Packit 631bab
# Refer to:
Packit 631bab
# XORG_WITH_XMLTO         --with-xmlto
Packit 631bab
# XORG_WITH_ASCIIDOC      --with-asciidoc
Packit 631bab
# XORG_WITH_DOXYGEN       --with-doxygen
Packit 631bab
# XORG_WITH_FOP           --with-fop
Packit 631bab
# XORG_WITH_GROFF         --with-groff
Packit 631bab
# XORG_WITH_PS2PDF        --with-ps2pdf
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# ENABLE_SPECS:		used in makefiles to conditionally generate specs
Packit 631bab
# --enable-specs:	'yes' user instructs the module to generate specs
Packit 631bab
#			'no' user instructs the module not to generate specs
Packit 631bab
# parm1:		specify the default value, yes or no.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_ENABLE_SPECS],[
Packit 631bab
m4_define([spec_default], m4_default([$1], [yes]))
Packit 631bab
AC_ARG_ENABLE(specs,
Packit 631bab
	AS_HELP_STRING([--enable-specs],
Packit 631bab
	   [Enable building the specs (default: ]spec_default[)]),
Packit 631bab
	   [build_specs=$enableval], [build_specs=]spec_default)
Packit 631bab
m4_undefine([spec_default])
Packit 631bab
AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
Packit 631bab
AC_MSG_CHECKING([whether to build functional specifications])
Packit 631bab
AC_MSG_RESULT([$build_specs])
Packit 631bab
]) # XORG_ENABLE_SPECS
Packit 631bab
Packit 631bab
# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
Packit 631bab
# ----------------------------------------------
Packit 631bab
# Minimum version: 1.13.0
Packit 631bab
#
Packit 631bab
# This macro enables a builder to enable/disable unit testing
Packit 631bab
# It makes no assumption about the test cases implementation
Packit 631bab
# Test cases may or may not use Automake "Support for test suites"
Packit 631bab
# They may or may not use the software utility library GLib
Packit 631bab
#
Packit 631bab
# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
Packit 631bab
# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
Packit 631bab
# The variable enable_unit_tests is used by other macros in this file.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
Packit 631bab
# enable_unit_tests:    used in configure.ac for additional configuration
Packit 631bab
# --enable-unit-tests:	'yes' user instructs the module to build tests
Packit 631bab
#			'no' user instructs the module not to build tests
Packit 631bab
# parm1:		specify the default value, yes or no.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
Packit 631bab
AC_BEFORE([$0], [XORG_WITH_GLIB])
Packit 631bab
AC_BEFORE([$0], [XORG_LD_WRAP])
Packit 631bab
AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
Packit 631bab
m4_define([_defopt], m4_default([$1], [auto]))
Packit 631bab
AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
Packit 631bab
	[Enable building unit test cases (default: ]_defopt[)]),
Packit 631bab
	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
Packit 631bab
m4_undefine([_defopt])
Packit 631bab
AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
Packit 631bab
AC_MSG_CHECKING([whether to build unit test cases])
Packit 631bab
AC_MSG_RESULT([$enable_unit_tests])
Packit 631bab
]) # XORG_ENABLE_UNIT_TESTS
Packit 631bab
Packit 631bab
# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
Packit 631bab
# ------------------------------------------------------
Packit 631bab
# Minimum version: 1.17.0
Packit 631bab
#
Packit 631bab
# This macro enables a builder to enable/disable integration testing
Packit 631bab
# It makes no assumption about the test cases' implementation
Packit 631bab
# Test cases may or may not use Automake "Support for test suites"
Packit 631bab
#
Packit 631bab
# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
Packit 631bab
# usually requires less dependencies and may be built and run under less
Packit 631bab
# stringent environments than integration tests.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
Packit 631bab
# enable_integration_tests:   used in configure.ac for additional configuration
Packit 631bab
# --enable-integration-tests: 'yes' user instructs the module to build tests
Packit 631bab
#                             'no' user instructs the module not to build tests
Packit 631bab
# parm1:                      specify the default value, yes or no.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
Packit 631bab
AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
Packit 631bab
m4_define([_defopt], m4_default([$1], [auto]))
Packit 631bab
AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
Packit 631bab
	[Enable building integration test cases (default: ]_defopt[)]),
Packit 631bab
	[enable_integration_tests=$enableval],
Packit 631bab
	[enable_integration_tests=]_defopt)
Packit 631bab
m4_undefine([_defopt])
Packit 631bab
AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
Packit 631bab
	[test "x$enable_integration_tests" != xno])
Packit 631bab
AC_MSG_CHECKING([whether to build unit test cases])
Packit 631bab
AC_MSG_RESULT([$enable_integration_tests])
Packit 631bab
]) # XORG_ENABLE_INTEGRATION_TESTS
Packit 631bab
Packit 631bab
# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
Packit 631bab
# ----------------------------------------
Packit 631bab
# Minimum version: 1.13.0
Packit 631bab
#
Packit 631bab
# GLib is a library which provides advanced data structures and functions.
Packit 631bab
# This macro enables a module to test for the presence of Glib.
Packit 631bab
#
Packit 631bab
# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
Packit 631bab
# Otherwise the value of $enable_unit_tests is blank.
Packit 631bab
#
Packit 631bab
# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
Packit 631bab
# test support usually requires less dependencies and may be built and run under
Packit 631bab
# less stringent environments than integration tests.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# HAVE_GLIB: used in makefiles to conditionally build targets
Packit 631bab
# with_glib: used in configure.ac to know if GLib has been found
Packit 631bab
# --with-glib:	'yes' user instructs the module to use glib
Packit 631bab
#		'no' user instructs the module not to use glib
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_WITH_GLIB],[
Packit 631bab
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
Packit 631bab
m4_define([_defopt], m4_default([$2], [auto]))
Packit 631bab
AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
Packit 631bab
	[Use GLib library for unit testing (default: ]_defopt[)]),
Packit 631bab
	[with_glib=$withval], [with_glib=]_defopt)
Packit 631bab
m4_undefine([_defopt])
Packit 631bab
Packit 631bab
have_glib=no
Packit 631bab
# Do not probe GLib if user explicitly disabled unit testing
Packit 631bab
if test "x$enable_unit_tests" != x"no"; then
Packit 631bab
  # Do not probe GLib if user explicitly disabled it
Packit 631bab
  if test "x$with_glib" != x"no"; then
Packit 631bab
    m4_ifval(
Packit 631bab
      [$1],
Packit 631bab
      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
Packit 631bab
      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
Packit 631bab
    )
Packit 631bab
  fi
Packit 631bab
fi
Packit 631bab
Packit 631bab
# Not having GLib when unit testing has been explicitly requested is an error
Packit 631bab
if test "x$enable_unit_tests" = x"yes"; then
Packit 631bab
  if test "x$have_glib" = x"no"; then
Packit 631bab
    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
Packit 631bab
  fi
Packit 631bab
fi
Packit 631bab
Packit 631bab
# Having unit testing disabled when GLib has been explicitly requested is an error
Packit 631bab
if test "x$enable_unit_tests" = x"no"; then
Packit 631bab
  if test "x$with_glib" = x"yes"; then
Packit 631bab
    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
Packit 631bab
  fi
Packit 631bab
fi
Packit 631bab
Packit 631bab
# Not having GLib when it has been explicitly requested is an error
Packit 631bab
if test "x$with_glib" = x"yes"; then
Packit 631bab
  if test "x$have_glib" = x"no"; then
Packit 631bab
    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
Packit 631bab
  fi
Packit 631bab
fi
Packit 631bab
Packit 631bab
AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
Packit 631bab
]) # XORG_WITH_GLIB
Packit 631bab
Packit 631bab
# XORG_LD_WRAP([required|optional])
Packit 631bab
# ---------------------------------
Packit 631bab
# Minimum version: 1.13.0
Packit 631bab
#
Packit 631bab
# Check if linker supports -wrap, passed via compiler flags
Packit 631bab
#
Packit 631bab
# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
Packit 631bab
# Otherwise the value of $enable_unit_tests is blank.
Packit 631bab
#
Packit 631bab
# Argument added in 1.16.0 - default is "required", to match existing behavior
Packit 631bab
# of returning an error if enable_unit_tests is yes, and ld -wrap is not
Packit 631bab
# available, an argument of "optional" allows use when some unit tests require
Packit 631bab
# ld -wrap and others do not.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_LD_WRAP],[
Packit 631bab
XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
Packit 631bab
    [AC_LANG_PROGRAM([#include <stdlib.h>
Packit 631bab
                      void __wrap_exit(int status) { return; }],
Packit 631bab
                     [exit(0);])])
Packit 631bab
# Not having ld wrap when unit testing has been explicitly requested is an error
Packit 631bab
if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
Packit 631bab
  if test "x$have_ld_wrap" = x"no"; then
Packit 631bab
    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
Packit 631bab
  fi
Packit 631bab
fi
Packit 631bab
AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
Packit 631bab
#
Packit 631bab
]) # XORG_LD_WRAP
Packit 631bab
Packit 631bab
# XORG_CHECK_LINKER_FLAGS
Packit 631bab
# -----------------------
Packit 631bab
# SYNOPSIS
Packit 631bab
#
Packit 631bab
#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
Packit 631bab
#
Packit 631bab
# DESCRIPTION
Packit 631bab
#
Packit 631bab
#   Check whether the given linker FLAGS work with the current language's
Packit 631bab
#   linker, or whether they give an error.
Packit 631bab
#
Packit 631bab
#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
Packit 631bab
#   success/failure.
Packit 631bab
#
Packit 631bab
#   PROGRAM-SOURCE is the program source to link with, if needed
Packit 631bab
#
Packit 631bab
#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
Packit 631bab
#
Packit 631bab
# LICENSE
Packit 631bab
#
Packit 631bab
#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
Packit 631bab
#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
Packit 631bab
#   Copyright (c) 2009 Matteo Frigo
Packit 631bab
#
Packit 631bab
#   This program is free software: you can redistribute it and/or modify it
Packit 631bab
#   under the terms of the GNU General Public License as published by the
Packit 631bab
#   Free Software Foundation, either version 3 of the License, or (at your
Packit 631bab
#   option) any later version.
Packit 631bab
#
Packit 631bab
#   This program is distributed in the hope that it will be useful, but
Packit 631bab
#   WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 631bab
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Packit 631bab
#   Public License for more details.
Packit 631bab
#
Packit 631bab
#   You should have received a copy of the GNU General Public License along
Packit 631bab
#   with this program. If not, see <http://www.gnu.org/licenses/>.
Packit 631bab
#
Packit 631bab
#   As a special exception, the respective Autoconf Macro's copyright owner
Packit 631bab
#   gives unlimited permission to copy, distribute and modify the configure
Packit 631bab
#   scripts that are the output of Autoconf when processing the Macro. You
Packit 631bab
#   need not follow the terms of the GNU General Public License when using
Packit 631bab
#   or distributing such scripts, even though portions of the text of the
Packit 631bab
#   Macro appear in them. The GNU General Public License (GPL) does govern
Packit 631bab
#   all other use of the material that constitutes the Autoconf Macro.
Packit 631bab
#
Packit 631bab
#   This special exception to the GPL applies to versions of the Autoconf
Packit 631bab
#   Macro released by the Autoconf Archive. When you make and distribute a
Packit 631bab
#   modified version of the Autoconf Macro, you may extend this special
Packit 631bab
#   exception to the GPL to apply to your modified version as well.#
Packit 631bab
AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
Packit 631bab
[AC_MSG_CHECKING([whether the linker accepts $1])
Packit 631bab
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
Packit 631bab
AS_LITERAL_IF([$1],
Packit 631bab
  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
Packit 631bab
      ax_save_FLAGS=$LDFLAGS
Packit 631bab
      LDFLAGS="$1"
Packit 631bab
      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
Packit 631bab
        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
Packit 631bab
        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
Packit 631bab
      LDFLAGS=$ax_save_FLAGS])],
Packit 631bab
  [ax_save_FLAGS=$LDFLAGS
Packit 631bab
   LDFLAGS="$1"
Packit 631bab
   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
Packit 631bab
     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
Packit 631bab
     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
Packit 631bab
   LDFLAGS=$ax_save_FLAGS])
Packit 631bab
eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
Packit 631bab
AC_MSG_RESULT($xorg_check_linker_flags)
Packit 631bab
if test "x$xorg_check_linker_flags" = xyes; then
Packit 631bab
	m4_default([$2], :)
Packit 631bab
else
Packit 631bab
	m4_default([$3], :)
Packit 631bab
fi
Packit 631bab
]) # XORG_CHECK_LINKER_FLAGS
Packit 631bab
Packit 631bab
# XORG_MEMORY_CHECK_FLAGS
Packit 631bab
# -----------------------
Packit 631bab
# Minimum version: 1.16.0
Packit 631bab
#
Packit 631bab
# This macro attempts to find appropriate memory checking functionality
Packit 631bab
# for various platforms which unit testing code may use to catch various
Packit 631bab
# forms of memory allocation and access errors in testing.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
Packit 631bab
#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
Packit 631bab
#
Packit 631bab
# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
Packit 631bab
Packit 631bab
AC_REQUIRE([AC_CANONICAL_HOST])
Packit 631bab
AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
Packit 631bab
           [Environment variables to enable memory checking in tests])
Packit 631bab
Packit 631bab
# Check for different types of support on different platforms
Packit 631bab
case $host_os in
Packit 631bab
    solaris*)
Packit 631bab
        AC_CHECK_LIB([umem], [umem_alloc],
Packit 631bab
            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
Packit 631bab
        ;;
Packit 631bab
    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
Packit 631bab
        # both directly and inverted, so should not be 0 or 255.
Packit 631bab
        malloc_debug_env='MALLOC_PERTURB_=15'
Packit 631bab
        ;;
Packit 631bab
    darwin*)
Packit 631bab
        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
Packit 631bab
        ;;
Packit 631bab
    *bsd*)
Packit 631bab
        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
Packit 631bab
        ;;
Packit 631bab
esac
Packit 631bab
Packit 631bab
# User supplied flags override default flags
Packit 631bab
if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
Packit 631bab
    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
Packit 631bab
fi
Packit 631bab
Packit 631bab
AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
Packit 631bab
]) # XORG_WITH_LINT
Packit 631bab
Packit 631bab
# XORG_CHECK_MALLOC_ZERO
Packit 631bab
# ----------------------
Packit 631bab
# Minimum version: 1.0.0
Packit 631bab
#
Packit 631bab
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
Packit 631bab
# malloc(0) returns NULL.  Packages should add one of these cflags to
Packit 631bab
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
Packit 631bab
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
Packit 631bab
AC_ARG_ENABLE(malloc0returnsnull,
Packit 631bab
	AS_HELP_STRING([--enable-malloc0returnsnull],
Packit 631bab
		       [malloc(0) returns NULL (default: auto)]),
Packit 631bab
	[MALLOC_ZERO_RETURNS_NULL=$enableval],
Packit 631bab
	[MALLOC_ZERO_RETURNS_NULL=auto])
Packit 631bab
Packit 631bab
AC_MSG_CHECKING([whether malloc(0) returns NULL])
Packit 631bab
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
Packit 631bab
AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
Packit 631bab
	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
Packit 631bab
#include <stdlib.h>
Packit 631bab
],[
Packit 631bab
    char *m0, *r0, *c0, *p;
Packit 631bab
    m0 = malloc(0);
Packit 631bab
    p = malloc(10);
Packit 631bab
    r0 = realloc(p,0);
Packit 631bab
    c0 = calloc(0,10);
Packit 631bab
    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
Packit 631bab
])],
Packit 631bab
		[xorg_cv_malloc0_returns_null=yes],
Packit 631bab
		[xorg_cv_malloc0_returns_null=no])])
Packit 631bab
MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
Packit 631bab
fi
Packit 631bab
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
Packit 631bab
Packit 631bab
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
Packit 631bab
	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
Packit 631bab
	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
Packit 631bab
	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
Packit 631bab
else
Packit 631bab
	MALLOC_ZERO_CFLAGS=""
Packit 631bab
	XMALLOC_ZERO_CFLAGS=""
Packit 631bab
	XTMALLOC_ZERO_CFLAGS=""
Packit 631bab
fi
Packit 631bab
Packit 631bab
AC_SUBST([MALLOC_ZERO_CFLAGS])
Packit 631bab
AC_SUBST([XMALLOC_ZERO_CFLAGS])
Packit 631bab
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
Packit 631bab
]) # XORG_CHECK_MALLOC_ZERO
Packit 631bab
Packit 631bab
# XORG_WITH_LINT()
Packit 631bab
# ----------------
Packit 631bab
# Minimum version: 1.1.0
Packit 631bab
#
Packit 631bab
# This macro enables the use of a tool that flags some suspicious and
Packit 631bab
# non-portable constructs (likely to be bugs) in C language source code.
Packit 631bab
# It will attempt to locate the tool and use appropriate options.
Packit 631bab
# There are various lint type tools on different platforms.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# LINT:		returns the path to the tool found on the platform
Packit 631bab
#		or the value set to LINT on the configure cmd line
Packit 631bab
#		also an Automake conditional
Packit 631bab
# LINT_FLAGS:	an Automake variable with appropriate flags
Packit 631bab
#
Packit 631bab
# --with-lint:	'yes' user instructs the module to use lint
Packit 631bab
#		'no' user instructs the module not to use lint (default)
Packit 631bab
#
Packit 631bab
# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
Packit 631bab
# If the user sets the value of LINT_FLAGS, they are used verbatim.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_WITH_LINT],[
Packit 631bab
Packit 631bab
AC_ARG_VAR([LINT], [Path to a lint-style command])
Packit 631bab
AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
Packit 631bab
AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
Packit 631bab
		[Use a lint-style source code checker (default: disabled)])],
Packit 631bab
		[use_lint=$withval], [use_lint=no])
Packit 631bab
Packit 631bab
# Obtain platform specific info like program name and options
Packit 631bab
# The lint program on FreeBSD and NetBSD is different from the one on Solaris
Packit 631bab
case $host_os in
Packit 631bab
  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
Packit 631bab
	lint_name=splint
Packit 631bab
	lint_options="-badflag"
Packit 631bab
	;;
Packit 631bab
  *freebsd* | *netbsd*)
Packit 631bab
	lint_name=lint
Packit 631bab
	lint_options="-u -b"
Packit 631bab
	;;
Packit 631bab
  *solaris*)
Packit 631bab
	lint_name=lint
Packit 631bab
	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
Packit 631bab
	;;
Packit 631bab
esac
Packit 631bab
Packit 631bab
# Test for the presence of the program (either guessed by the code or spelled out by the user)
Packit 631bab
if test "x$use_lint" = x"yes" ; then
Packit 631bab
   AC_PATH_PROG([LINT], [$lint_name])
Packit 631bab
   if test "x$LINT" = "x"; then
Packit 631bab
        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
Packit 631bab
   fi
Packit 631bab
elif test "x$use_lint" = x"no" ; then
Packit 631bab
   if test "x$LINT" != "x"; then
Packit 631bab
      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
Packit 631bab
   fi
Packit 631bab
else
Packit 631bab
   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
Packit 631bab
fi
Packit 631bab
Packit 631bab
# User supplied flags override default flags
Packit 631bab
if test "x$LINT_FLAGS" != "x"; then
Packit 631bab
   lint_options=$LINT_FLAGS
Packit 631bab
fi
Packit 631bab
Packit 631bab
AC_SUBST([LINT_FLAGS],[$lint_options])
Packit 631bab
AM_CONDITIONAL(LINT, [test "x$LINT" != x])
Packit 631bab
Packit 631bab
]) # XORG_WITH_LINT
Packit 631bab
Packit 631bab
# XORG_LINT_LIBRARY(LIBNAME)
Packit 631bab
# --------------------------
Packit 631bab
# Minimum version: 1.1.0
Packit 631bab
#
Packit 631bab
# Sets up flags for building lint libraries for checking programs that call
Packit 631bab
# functions in the library.
Packit 631bab
#
Packit 631bab
# Interface to module:
Packit 631bab
# LINTLIB		- Automake variable with the name of lint library file to make
Packit 631bab
# MAKE_LINT_LIB		- Automake conditional
Packit 631bab
#
Packit 631bab
# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
Packit 631bab
#			  - 'no' user instructs the module not to create a lint library (default)
Packit 631bab
Packit 631bab
AC_DEFUN([XORG_LINT_LIBRARY],[
Packit 631bab
AC_REQUIRE([XORG_WITH_LINT])
Packit 631bab
AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
Packit 631bab
	[Create lint library (default: disabled)])],
Packit 631bab
	[make_lint_lib=$enableval], [make_lint_lib=no])
Packit 631bab
Packit 631bab
if test "x$make_lint_lib" = x"yes" ; then
Packit 631bab
   LINTLIB=llib-l$1.ln
Packit 631bab
   if test "x$LINT" = "x"; then
Packit 631bab
        AC_MSG_ERROR([Cannot make lint library without --with-lint])
Packit 631bab
   fi
Packit 631bab
elif test "x$make_lint_lib" != x"no" ; then
Packit 631bab
   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
Packit 631bab
fi
Packit 631bab
Packit 631bab
AC_SUBST(LINTLIB)
Packit 631bab
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
Packit 631bab
Packit 631bab
]) # XORG_LINT_LIBRARY
Packit 631bab
Packit 631bab
# XORG_COMPILER_BRAND
Packit 631bab
# -------------------
Packit 631bab
# Minimum version: 1.14.0
Packit 631bab
#
Packit 631bab
# Checks for various brands of compilers and sets flags as appropriate:
Packit 631bab
#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
Packit 631bab
#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
Packit 631bab
#   clang compiler - sets CLANGCC to "yes"
Packit 631bab
#   Intel compiler - sets INTELCC to "yes"
Packit 631bab
#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_COMPILER_BRAND], [
Packit 631bab
AC_LANG_CASE(
Packit 631bab
	[C], [
Packit 631bab
		AC_REQUIRE([AC_PROG_CC_C99])
Packit 631bab
	],
Packit 631bab
	[C++], [
Packit 631bab
		AC_REQUIRE([AC_PROG_CXX])
Packit 631bab
	]
Packit 631bab
)
Packit 631bab
AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
Packit 631bab
AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
Packit 631bab
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
Packit 631bab
]) # XORG_COMPILER_BRAND
Packit 631bab
Packit 631bab
# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
Packit 631bab
# ---------------
Packit 631bab
# Minimum version: 1.16.0
Packit 631bab
#
Packit 631bab
# Test if the compiler works when passed the given flag as a command line argument.
Packit 631bab
# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
Packit 631bab
# next flag in the list until there are no more options.
Packit 631bab
#
Packit 631bab
# Note that this does not guarantee that the compiler supports the flag as some
Packit 631bab
# compilers will simply ignore arguments that they do not understand, but we do
Packit 631bab
# attempt to weed out false positives by using -Werror=unknown-warning-option and
Packit 631bab
# -Werror=unused-command-line-argument
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_TESTSET_CFLAG], [
Packit 631bab
m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
Packit 631bab
m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
Packit 631bab
Packit 631bab
AC_LANG_COMPILER_REQUIRE
Packit 631bab
Packit 631bab
AC_LANG_CASE(
Packit 631bab
	[C], [
Packit 631bab
		AC_REQUIRE([AC_PROG_CC_C99])
Packit 631bab
		define([PREFIX], [C])
Packit 631bab
		define([CACHE_PREFIX], [cc])
Packit 631bab
		define([COMPILER], [$CC])
Packit 631bab
	],
Packit 631bab
	[C++], [
Packit 631bab
		define([PREFIX], [CXX])
Packit 631bab
		define([CACHE_PREFIX], [cxx])
Packit 631bab
		define([COMPILER], [$CXX])
Packit 631bab
	]
Packit 631bab
)
Packit 631bab
Packit 631bab
[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
Packit 631bab
Packit 631bab
if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
Packit 631bab
	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
Packit 631bab
	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
Packit 631bab
			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
Packit 631bab
			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
Packit 631bab
					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
Packit 631bab
					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
Packit 631bab
	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
Packit 631bab
	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
Packit 631bab
fi
Packit 631bab
Packit 631bab
if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
Packit 631bab
	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
Packit 631bab
		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
Packit 631bab
	fi
Packit 631bab
	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
Packit 631bab
	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
Packit 631bab
			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
Packit 631bab
			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
Packit 631bab
					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
Packit 631bab
					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
Packit 631bab
	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
Packit 631bab
	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
Packit 631bab
fi
Packit 631bab
Packit 631bab
found="no"
Packit 631bab
m4_foreach([flag], m4_cdr($@), [
Packit 631bab
	if test $found = "no" ; then
Packit 631bab
		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
Packit 631bab
			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
Packit 631bab
		fi
Packit 631bab
Packit 631bab
		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
Packit 631bab
			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
Packit 631bab
		fi
Packit 631bab
Packit 631bab
		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
Packit 631bab
Packit 631bab
dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
Packit 631bab
		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
Packit 631bab
		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
Packit 631bab
		AC_CACHE_VAL($cacheid,
Packit 631bab
			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
Packit 631bab
					     [eval $cacheid=yes],
Packit 631bab
					     [eval $cacheid=no])])
Packit 631bab
Packit 631bab
		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
Packit 631bab
Packit 631bab
		eval supported=\$$cacheid
Packit 631bab
		AC_MSG_RESULT([$supported])
Packit 631bab
		if test "$supported" = "yes" ; then
Packit 631bab
			$1="$$1 ]flag["
Packit 631bab
			found="yes"
Packit 631bab
		fi
Packit 631bab
	fi
Packit 631bab
])
Packit 631bab
]) # XORG_TESTSET_CFLAG
Packit 631bab
Packit 631bab
# XORG_COMPILER_FLAGS
Packit 631bab
# ---------------
Packit 631bab
# Minimum version: 1.16.0
Packit 631bab
#
Packit 631bab
# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
Packit 631bab
# arguments supported by the selected compiler which do NOT alter the generated
Packit 631bab
# code.  These arguments will cause the compiler to print various warnings
Packit 631bab
# during compilation AND turn a conservative set of warnings into errors.
Packit 631bab
#
Packit 631bab
# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
Packit 631bab
# future versions of util-macros as options are added to new compilers.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_COMPILER_FLAGS], [
Packit 631bab
AC_REQUIRE([XORG_COMPILER_BRAND])
Packit 631bab
Packit 631bab
AC_ARG_ENABLE(selective-werror,
Packit 631bab
              AS_HELP_STRING([--disable-selective-werror],
Packit 631bab
                             [Turn off selective compiler errors. (default: enabled)]),
Packit 631bab
              [SELECTIVE_WERROR=$enableval],
Packit 631bab
              [SELECTIVE_WERROR=yes])
Packit 631bab
Packit 631bab
AC_LANG_CASE(
Packit 631bab
        [C], [
Packit 631bab
                define([PREFIX], [C])
Packit 631bab
        ],
Packit 631bab
        [C++], [
Packit 631bab
                define([PREFIX], [CXX])
Packit 631bab
        ]
Packit 631bab
)
Packit 631bab
# -v is too short to test reliably with XORG_TESTSET_CFLAG
Packit 631bab
if test "x$SUNCC" = "xyes"; then
Packit 631bab
    [BASE_]PREFIX[FLAGS]="-v"
Packit 631bab
else
Packit 631bab
    [BASE_]PREFIX[FLAGS]=""
Packit 631bab
fi
Packit 631bab
Packit 631bab
# This chunk of warnings were those that existed in the legacy CWARNFLAGS
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
Packit 631bab
Packit 631bab
AC_LANG_CASE(
Packit 631bab
	[C], [
Packit 631bab
		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
Packit 631bab
		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
Packit 631bab
		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
Packit 631bab
		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
Packit 631bab
		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
Packit 631bab
		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
Packit 631bab
	]
Packit 631bab
)
Packit 631bab
Packit 631bab
# This chunk adds additional warnings that could catch undesired effects.
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
Packit 631bab
Packit 631bab
# These are currently disabled because they are noisy.  They will be enabled
Packit 631bab
# in the future once the codebase is sufficiently modernized to silence
Packit 631bab
# them.  For now, I don't want them to drown out the other warnings.
Packit 631bab
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
Packit 631bab
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
Packit 631bab
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
Packit 631bab
Packit 631bab
# Turn some warnings into errors, so we don't accidently get successful builds
Packit 631bab
# when there are problems that should be fixed.
Packit 631bab
Packit 631bab
if test "x$SELECTIVE_WERROR" = "xyes" ; then
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
Packit 631bab
else
Packit 631bab
AC_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])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
Packit 631bab
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
Packit 631bab
fi
Packit 631bab
Packit 631bab
AC_SUBST([BASE_]PREFIX[FLAGS])
Packit 631bab
]) # XORG_COMPILER_FLAGS
Packit 631bab
Packit 631bab
# XORG_CWARNFLAGS
Packit 631bab
# ---------------
Packit 631bab
# Minimum version: 1.2.0
Packit 631bab
# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
Packit 631bab
#
Packit 631bab
# Defines CWARNFLAGS to enable C compiler warnings.
Packit 631bab
#
Packit 631bab
# This function is deprecated because it defines -fno-strict-aliasing
Packit 631bab
# which alters the code generated by the compiler.  If -fno-strict-aliasing
Packit 631bab
# is needed, then it should be added explicitly in the module when
Packit 631bab
# it is updated to use BASE_CFLAGS.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_CWARNFLAGS], [
Packit 631bab
AC_REQUIRE([XORG_COMPILER_FLAGS])
Packit 631bab
AC_REQUIRE([XORG_COMPILER_BRAND])
Packit 631bab
AC_LANG_CASE(
Packit 631bab
	[C], [
Packit 631bab
		CWARNFLAGS="$BASE_CFLAGS"
Packit 631bab
		if  test "x$GCC" = xyes ; then
Packit 631bab
		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
Packit 631bab
		fi
Packit 631bab
		AC_SUBST(CWARNFLAGS)
Packit 631bab
	]
Packit 631bab
)
Packit 631bab
]) # XORG_CWARNFLAGS
Packit 631bab
Packit 631bab
# XORG_STRICT_OPTION
Packit 631bab
# -----------------------
Packit 631bab
# Minimum version: 1.3.0
Packit 631bab
#
Packit 631bab
# Add configure option to enable strict compilation flags, such as treating
Packit 631bab
# warnings as fatal errors.
Packit 631bab
# If --enable-strict-compilation is passed to configure, adds strict flags to
Packit 631bab
# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
Packit 631bab
#
Packit 631bab
# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
Packit 631bab
# when strict compilation is unconditionally desired.
Packit 631bab
AC_DEFUN([XORG_STRICT_OPTION], [
Packit 631bab
AC_REQUIRE([XORG_CWARNFLAGS])
Packit 631bab
AC_REQUIRE([XORG_COMPILER_FLAGS])
Packit 631bab
Packit 631bab
AC_ARG_ENABLE(strict-compilation,
Packit 631bab
			  AS_HELP_STRING([--enable-strict-compilation],
Packit 631bab
			  [Enable all warnings from compiler and make them errors (default: disabled)]),
Packit 631bab
			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
Packit 631bab
Packit 631bab
AC_LANG_CASE(
Packit 631bab
        [C], [
Packit 631bab
                define([PREFIX], [C])
Packit 631bab
        ],
Packit 631bab
        [C++], [
Packit 631bab
                define([PREFIX], [CXX])
Packit 631bab
        ]
Packit 631bab
)
Packit 631bab
Packit 631bab
[STRICT_]PREFIX[FLAGS]=""
Packit 631bab
XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
Packit 631bab
XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
Packit 631bab
Packit 631bab
# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
Packit 631bab
# activate it with -Werror, so we add it here explicitly.
Packit 631bab
XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
Packit 631bab
Packit 631bab
if test "x$STRICT_COMPILE" = "xyes"; then
Packit 631bab
    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
Packit 631bab
    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
Packit 631bab
fi
Packit 631bab
AC_SUBST([STRICT_]PREFIX[FLAGS])
Packit 631bab
AC_SUBST([BASE_]PREFIX[FLAGS])
Packit 631bab
AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
Packit 631bab
]) # XORG_STRICT_OPTION
Packit 631bab
Packit 631bab
# XORG_DEFAULT_OPTIONS
Packit 631bab
# --------------------
Packit 631bab
# Minimum version: 1.3.0
Packit 631bab
#
Packit 631bab
# Defines default options for X.Org modules.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
Packit 631bab
AC_REQUIRE([AC_PROG_INSTALL])
Packit 631bab
XORG_COMPILER_FLAGS
Packit 631bab
XORG_CWARNFLAGS
Packit 631bab
XORG_STRICT_OPTION
Packit 631bab
XORG_RELEASE_VERSION
Packit 631bab
XORG_CHANGELOG
Packit 631bab
XORG_INSTALL
Packit 631bab
XORG_MANPAGE_SECTIONS
Packit 631bab
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
Packit 631bab
    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
Packit 631bab
]) # XORG_DEFAULT_OPTIONS
Packit 631bab
Packit 631bab
# XORG_INSTALL()
Packit 631bab
# ----------------
Packit 631bab
# Minimum version: 1.4.0
Packit 631bab
#
Packit 631bab
# Defines the variable INSTALL_CMD as the command to copy
Packit 631bab
# INSTALL from $prefix/share/util-macros.
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_INSTALL], [
Packit 631bab
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
Packit 631bab
macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
Packit 631bab
INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
Packit 631bab
mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
Packit 631bab
|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
Packit 631bab
echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
Packit 631bab
AC_SUBST([INSTALL_CMD])
Packit 631bab
]) # XORG_INSTALL
Packit 631bab
dnl Copyright 2005 Red Hat, Inc
Packit 631bab
dnl
Packit 631bab
dnl Permission to use, copy, modify, distribute, and sell this software and its
Packit 631bab
dnl documentation for any purpose is hereby granted without fee, provided that
Packit 631bab
dnl the above copyright notice appear in all copies and that both that
Packit 631bab
dnl copyright notice and this permission notice appear in supporting
Packit 631bab
dnl documentation.
Packit 631bab
dnl
Packit 631bab
dnl The above copyright notice and this permission notice shall be included
Packit 631bab
dnl in all copies or substantial portions of the Software.
Packit 631bab
dnl
Packit 631bab
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
Packit 631bab
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Packit 631bab
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Packit 631bab
dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
Packit 631bab
dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
Packit 631bab
dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
Packit 631bab
dnl OTHER DEALINGS IN THE SOFTWARE.
Packit 631bab
dnl
Packit 631bab
dnl Except as contained in this notice, the name of the copyright holders shall
Packit 631bab
dnl not be used in advertising or otherwise to promote the sale, use or
Packit 631bab
dnl other dealings in this Software without prior written authorization
Packit 631bab
dnl from the copyright holders.
Packit 631bab
dnl
Packit 631bab
Packit 631bab
# XORG_RELEASE_VERSION
Packit 631bab
# --------------------
Packit 631bab
# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
Packit 631bab
Packit 631bab
AC_DEFUN([XORG_RELEASE_VERSION],[
Packit 631bab
	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
Packit 631bab
		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
Packit 631bab
		[Major version of this package])
Packit 631bab
	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
Packit 631bab
	if test "x$PVM" = "x"; then
Packit 631bab
		PVM="0"
Packit 631bab
	fi
Packit 631bab
	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
Packit 631bab
		[$PVM],
Packit 631bab
		[Minor version of this package])
Packit 631bab
	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
Packit 631bab
	if test "x$PVP" = "x"; then
Packit 631bab
		PVP="0"
Packit 631bab
	fi
Packit 631bab
	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
Packit 631bab
		[$PVP],
Packit 631bab
		[Patch version of this package])
Packit 631bab
])
Packit 631bab
Packit 631bab
# XORG_CHANGELOG()
Packit 631bab
# ----------------
Packit 631bab
# Minimum version: 1.2.0
Packit 631bab
#
Packit 631bab
# Defines the variable CHANGELOG_CMD as the command to generate
Packit 631bab
# ChangeLog from git.
Packit 631bab
#
Packit 631bab
#
Packit 631bab
AC_DEFUN([XORG_CHANGELOG], [
Packit 631bab
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
Packit 631bab
mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
Packit 631bab
|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
Packit 631bab
echo 'git directory not found: installing possibly empty changelog.' >&2)"
Packit 631bab
AC_SUBST([CHANGELOG_CMD])
Packit 631bab
]) # XORG_CHANGELOG
Packit 631bab
Packit 631bab
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# AM_AUTOMAKE_VERSION(VERSION)
Packit 631bab
# ----------------------------
Packit 631bab
# Automake X.Y traces this macro to ensure aclocal.m4 has been
Packit 631bab
# generated from the m4 files accompanying Automake X.Y.
Packit 631bab
# (This private macro should not be called outside this file.)
Packit 631bab
AC_DEFUN([AM_AUTOMAKE_VERSION],
Packit 631bab
[am__api_version='1.15'
Packit 631bab
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
Packit 631bab
dnl require some minimum version.  Point them to the right macro.
Packit 631bab
m4_if([$1], [1.15.1], [],
Packit 631bab
      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
Packit 631bab
])
Packit 631bab
Packit 631bab
# _AM_AUTOCONF_VERSION(VERSION)
Packit 631bab
# -----------------------------
Packit 631bab
# aclocal traces this macro to find the Autoconf version.
Packit 631bab
# This is a private macro too.  Using m4_define simplifies
Packit 631bab
# the logic in aclocal, which can simply ignore this definition.
Packit 631bab
m4_define([_AM_AUTOCONF_VERSION], [])
Packit 631bab
Packit 631bab
# AM_SET_CURRENT_AUTOMAKE_VERSION
Packit 631bab
# -------------------------------
Packit 631bab
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
Packit 631bab
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
Packit 631bab
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
Packit 631bab
[AM_AUTOMAKE_VERSION([1.15.1])dnl
Packit 631bab
m4_ifndef([AC_AUTOCONF_VERSION],
Packit 631bab
  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
Packit 631bab
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
Packit 631bab
Packit 631bab
# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
Packit 631bab
Packit 631bab
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
Packit 631bab
# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
Packit 631bab
# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
Packit 631bab
#
Packit 631bab
# Of course, Automake must honor this variable whenever it calls a
Packit 631bab
# tool from the auxiliary directory.  The problem is that $srcdir (and
Packit 631bab
# therefore $ac_aux_dir as well) can be either absolute or relative,
Packit 631bab
# depending on how configure is run.  This is pretty annoying, since
Packit 631bab
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
Packit 631bab
# source directory, any form will work fine, but in subdirectories a
Packit 631bab
# relative path needs to be adjusted first.
Packit 631bab
#
Packit 631bab
# $ac_aux_dir/missing
Packit 631bab
#    fails when called from a subdirectory if $ac_aux_dir is relative
Packit 631bab
# $top_srcdir/$ac_aux_dir/missing
Packit 631bab
#    fails if $ac_aux_dir is absolute,
Packit 631bab
#    fails when called from a subdirectory in a VPATH build with
Packit 631bab
#          a relative $ac_aux_dir
Packit 631bab
#
Packit 631bab
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
Packit 631bab
# are both prefixed by $srcdir.  In an in-source build this is usually
Packit 631bab
# harmless because $srcdir is '.', but things will broke when you
Packit 631bab
# start a VPATH build or use an absolute $srcdir.
Packit 631bab
#
Packit 631bab
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
Packit 631bab
# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
Packit 631bab
#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
Packit 631bab
# and then we would define $MISSING as
Packit 631bab
#   MISSING="\${SHELL} $am_aux_dir/missing"
Packit 631bab
# This will work as long as MISSING is not called from configure, because
Packit 631bab
# unfortunately $(top_srcdir) has no meaning in configure.
Packit 631bab
# However there are other variables, like CC, which are often used in
Packit 631bab
# configure, and could therefore not use this "fixed" $ac_aux_dir.
Packit 631bab
#
Packit 631bab
# Another solution, used here, is to always expand $ac_aux_dir to an
Packit 631bab
# absolute PATH.  The drawback is that using absolute paths prevent a
Packit 631bab
# configured tree to be moved without reconfiguration.
Packit 631bab
Packit 631bab
AC_DEFUN([AM_AUX_DIR_EXPAND],
Packit 631bab
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
Packit 631bab
# Expand $ac_aux_dir to an absolute path.
Packit 631bab
am_aux_dir=`cd "$ac_aux_dir" && pwd`
Packit 631bab
])
Packit 631bab
Packit 631bab
# AM_CONDITIONAL                                            -*- Autoconf -*-
Packit 631bab
Packit 631bab
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
Packit 631bab
# -------------------------------------
Packit 631bab
# Define a conditional.
Packit 631bab
AC_DEFUN([AM_CONDITIONAL],
Packit 631bab
[AC_PREREQ([2.52])dnl
Packit 631bab
 m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
Packit 631bab
       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
Packit 631bab
AC_SUBST([$1_TRUE])dnl
Packit 631bab
AC_SUBST([$1_FALSE])dnl
Packit 631bab
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
Packit 631bab
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
Packit 631bab
m4_define([_AM_COND_VALUE_$1], [$2])dnl
Packit 631bab
if $2; then
Packit 631bab
  $1_TRUE=
Packit 631bab
  $1_FALSE='#'
Packit 631bab
else
Packit 631bab
  $1_TRUE='#'
Packit 631bab
  $1_FALSE=
Packit 631bab
fi
Packit 631bab
AC_CONFIG_COMMANDS_PRE(
Packit 631bab
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
Packit 631bab
  AC_MSG_ERROR([[conditional "$1" was never defined.
Packit 631bab
Usually this means the macro was only invoked conditionally.]])
Packit 631bab
fi])])
Packit 631bab
Packit 631bab
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
Packit 631bab
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
Packit 631bab
# written in clear, in which case automake, when reading aclocal.m4,
Packit 631bab
# will think it sees a *use*, and therefore will trigger all it's
Packit 631bab
# C support machinery.  Also note that it means that autoscan, seeing
Packit 631bab
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
Packit 631bab
Packit 631bab
Packit 631bab
# _AM_DEPENDENCIES(NAME)
Packit 631bab
# ----------------------
Packit 631bab
# See how the compiler implements dependency checking.
Packit 631bab
# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
Packit 631bab
# We try a few techniques and use that to set a single cache variable.
Packit 631bab
#
Packit 631bab
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
Packit 631bab
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
Packit 631bab
# dependency, and given that the user is not expected to run this macro,
Packit 631bab
# just rely on AC_PROG_CC.
Packit 631bab
AC_DEFUN([_AM_DEPENDENCIES],
Packit 631bab
[AC_REQUIRE([AM_SET_DEPDIR])dnl
Packit 631bab
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
Packit 631bab
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
Packit 631bab
AC_REQUIRE([AM_DEP_TRACK])dnl
Packit 631bab
Packit 631bab
m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
Packit 631bab
      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
Packit 631bab
      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
Packit 631bab
      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
Packit 631bab
      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
Packit 631bab
      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
Packit 631bab
                    [depcc="$$1"   am_compiler_list=])
Packit 631bab
Packit 631bab
AC_CACHE_CHECK([dependency style of $depcc],
Packit 631bab
               [am_cv_$1_dependencies_compiler_type],
Packit 631bab
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
Packit 631bab
  # We make a subdir and do the tests there.  Otherwise we can end up
Packit 631bab
  # making bogus files that we don't know about and never remove.  For
Packit 631bab
  # instance it was reported that on HP-UX the gcc test will end up
Packit 631bab
  # making a dummy file named 'D' -- because '-MD' means "put the output
Packit 631bab
  # in D".
Packit 631bab
  rm -rf conftest.dir
Packit 631bab
  mkdir conftest.dir
Packit 631bab
  # Copy depcomp to subdir because otherwise we won't find it if we're
Packit 631bab
  # using a relative directory.
Packit 631bab
  cp "$am_depcomp" conftest.dir
Packit 631bab
  cd conftest.dir
Packit 631bab
  # We will build objects and dependencies in a subdirectory because
Packit 631bab
  # it helps to detect inapplicable dependency modes.  For instance
Packit 631bab
  # both Tru64's cc and ICC support -MD to output dependencies as a
Packit 631bab
  # side effect of compilation, but ICC will put the dependencies in
Packit 631bab
  # the current directory while Tru64 will put them in the object
Packit 631bab
  # directory.
Packit 631bab
  mkdir sub
Packit 631bab
Packit 631bab
  am_cv_$1_dependencies_compiler_type=none
Packit 631bab
  if test "$am_compiler_list" = ""; then
Packit 631bab
     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
Packit 631bab
  fi
Packit 631bab
  am__universal=false
Packit 631bab
  m4_case([$1], [CC],
Packit 631bab
    [case " $depcc " in #(
Packit 631bab
     *\ -arch\ *\ -arch\ *) am__universal=true ;;
Packit 631bab
     esac],
Packit 631bab
    [CXX],
Packit 631bab
    [case " $depcc " in #(
Packit 631bab
     *\ -arch\ *\ -arch\ *) am__universal=true ;;
Packit 631bab
     esac])
Packit 631bab
Packit 631bab
  for depmode in $am_compiler_list; do
Packit 631bab
    # Setup a source with many dependencies, because some compilers
Packit 631bab
    # like to wrap large dependency lists on column 80 (with \), and
Packit 631bab
    # we should not choose a depcomp mode which is confused by this.
Packit 631bab
    #
Packit 631bab
    # We need to recreate these files for each test, as the compiler may
Packit 631bab
    # overwrite some of them when testing with obscure command lines.
Packit 631bab
    # This happens at least with the AIX C compiler.
Packit 631bab
    : > sub/conftest.c
Packit 631bab
    for i in 1 2 3 4 5 6; do
Packit 631bab
      echo '#include "conftst'$i'.h"' >> sub/conftest.c
Packit 631bab
      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
Packit 631bab
      # Solaris 10 /bin/sh.
Packit 631bab
      echo '/* dummy */' > sub/conftst$i.h
Packit 631bab
    done
Packit 631bab
    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
Packit 631bab
Packit 631bab
    # We check with '-c' and '-o' for the sake of the "dashmstdout"
Packit 631bab
    # mode.  It turns out that the SunPro C++ compiler does not properly
Packit 631bab
    # handle '-M -o', and we need to detect this.  Also, some Intel
Packit 631bab
    # versions had trouble with output in subdirs.
Packit 631bab
    am__obj=sub/conftest.${OBJEXT-o}
Packit 631bab
    am__minus_obj="-o $am__obj"
Packit 631bab
    case $depmode in
Packit 631bab
    gcc)
Packit 631bab
      # This depmode causes a compiler race in universal mode.
Packit 631bab
      test "$am__universal" = false || continue
Packit 631bab
      ;;
Packit 631bab
    nosideeffect)
Packit 631bab
      # After this tag, mechanisms are not by side-effect, so they'll
Packit 631bab
      # only be used when explicitly requested.
Packit 631bab
      if test "x$enable_dependency_tracking" = xyes; then
Packit 631bab
	continue
Packit 631bab
      else
Packit 631bab
	break
Packit 631bab
      fi
Packit 631bab
      ;;
Packit 631bab
    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
Packit 631bab
      # This compiler won't grok '-c -o', but also, the minuso test has
Packit 631bab
      # not run yet.  These depmodes are late enough in the game, and
Packit 631bab
      # so weak that their functioning should not be impacted.
Packit 631bab
      am__obj=conftest.${OBJEXT-o}
Packit 631bab
      am__minus_obj=
Packit 631bab
      ;;
Packit 631bab
    none) break ;;
Packit 631bab
    esac
Packit 631bab
    if depmode=$depmode \
Packit 631bab
       source=sub/conftest.c object=$am__obj \
Packit 631bab
       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
Packit 631bab
       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
Packit 631bab
         >/dev/null 2>conftest.err &&
Packit 631bab
       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
Packit 631bab
       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
Packit 631bab
       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
Packit 631bab
       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
Packit 631bab
      # icc doesn't choke on unknown options, it will just issue warnings
Packit 631bab
      # or remarks (even with -Werror).  So we grep stderr for any message
Packit 631bab
      # that says an option was ignored or not supported.
Packit 631bab
      # When given -MP, icc 7.0 and 7.1 complain thusly:
Packit 631bab
      #   icc: Command line warning: ignoring option '-M'; no argument required
Packit 631bab
      # The diagnosis changed in icc 8.0:
Packit 631bab
      #   icc: Command line remark: option '-MP' not supported
Packit 631bab
      if (grep 'ignoring option' conftest.err ||
Packit 631bab
          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
Packit 631bab
        am_cv_$1_dependencies_compiler_type=$depmode
Packit 631bab
        break
Packit 631bab
      fi
Packit 631bab
    fi
Packit 631bab
  done
Packit 631bab
Packit 631bab
  cd ..
Packit 631bab
  rm -rf conftest.dir
Packit 631bab
else
Packit 631bab
  am_cv_$1_dependencies_compiler_type=none
Packit 631bab
fi
Packit 631bab
])
Packit 631bab
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
Packit 631bab
AM_CONDITIONAL([am__fastdep$1], [
Packit 631bab
  test "x$enable_dependency_tracking" != xno \
Packit 631bab
  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
Packit 631bab
])
Packit 631bab
Packit 631bab
Packit 631bab
# AM_SET_DEPDIR
Packit 631bab
# -------------
Packit 631bab
# Choose a directory name for dependency files.
Packit 631bab
# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
Packit 631bab
AC_DEFUN([AM_SET_DEPDIR],
Packit 631bab
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
Packit 631bab
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
Packit 631bab
])
Packit 631bab
Packit 631bab
Packit 631bab
# AM_DEP_TRACK
Packit 631bab
# ------------
Packit 631bab
AC_DEFUN([AM_DEP_TRACK],
Packit 631bab
[AC_ARG_ENABLE([dependency-tracking], [dnl
Packit 631bab
AS_HELP_STRING(
Packit 631bab
  [--enable-dependency-tracking],
Packit 631bab
  [do not reject slow dependency extractors])
Packit 631bab
AS_HELP_STRING(
Packit 631bab
  [--disable-dependency-tracking],
Packit 631bab
  [speeds up one-time build])])
Packit 631bab
if test "x$enable_dependency_tracking" != xno; then
Packit 631bab
  am_depcomp="$ac_aux_dir/depcomp"
Packit 631bab
  AMDEPBACKSLASH='\'
Packit 631bab
  am__nodep='_no'
Packit 631bab
fi
Packit 631bab
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
Packit 631bab
AC_SUBST([AMDEPBACKSLASH])dnl
Packit 631bab
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
Packit 631bab
AC_SUBST([am__nodep])dnl
Packit 631bab
_AM_SUBST_NOTMAKE([am__nodep])dnl
Packit 631bab
])
Packit 631bab
Packit 631bab
# Generate code to set up dependency tracking.              -*- Autoconf -*-
Packit 631bab
Packit 631bab
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
Packit 631bab
# _AM_OUTPUT_DEPENDENCY_COMMANDS
Packit 631bab
# ------------------------------
Packit 631bab
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
Packit 631bab
[{
Packit 631bab
  # Older Autoconf quotes --file arguments for eval, but not when files
Packit 631bab
  # are listed without --file.  Let's play safe and only enable the eval
Packit 631bab
  # if we detect the quoting.
Packit 631bab
  case $CONFIG_FILES in
Packit 631bab
  *\'*) eval set x "$CONFIG_FILES" ;;
Packit 631bab
  *)   set x $CONFIG_FILES ;;
Packit 631bab
  esac
Packit 631bab
  shift
Packit 631bab
  for mf
Packit 631bab
  do
Packit 631bab
    # Strip MF so we end up with the name of the file.
Packit 631bab
    mf=`echo "$mf" | sed -e 's/:.*$//'`
Packit 631bab
    # Check whether this is an Automake generated Makefile or not.
Packit 631bab
    # We used to match only the files named 'Makefile.in', but
Packit 631bab
    # some people rename them; so instead we look at the file content.
Packit 631bab
    # Grep'ing the first line is not enough: some people post-process
Packit 631bab
    # each Makefile.in and add a new line on top of each file to say so.
Packit 631bab
    # Grep'ing the whole file is not good either: AIX grep has a line
Packit 631bab
    # limit of 2048, but all sed's we know have understand at least 4000.
Packit 631bab
    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
Packit 631bab
      dirpart=`AS_DIRNAME("$mf")`
Packit 631bab
    else
Packit 631bab
      continue
Packit 631bab
    fi
Packit 631bab
    # Extract the definition of DEPDIR, am__include, and am__quote
Packit 631bab
    # from the Makefile without running 'make'.
Packit 631bab
    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
Packit 631bab
    test -z "$DEPDIR" && continue
Packit 631bab
    am__include=`sed -n 's/^am__include = //p' < "$mf"`
Packit 631bab
    test -z "$am__include" && continue
Packit 631bab
    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
Packit 631bab
    # Find all dependency output files, they are included files with
Packit 631bab
    # $(DEPDIR) in their names.  We invoke sed twice because it is the
Packit 631bab
    # simplest approach to changing $(DEPDIR) to its actual value in the
Packit 631bab
    # expansion.
Packit 631bab
    for file in `sed -n "
Packit 631bab
      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
Packit 631bab
	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
Packit 631bab
      # Make sure the directory exists.
Packit 631bab
      test -f "$dirpart/$file" && continue
Packit 631bab
      fdir=`AS_DIRNAME(["$file"])`
Packit 631bab
      AS_MKDIR_P([$dirpart/$fdir])
Packit 631bab
      # echo "creating $dirpart/$file"
Packit 631bab
      echo '# dummy' > "$dirpart/$file"
Packit 631bab
    done
Packit 631bab
  done
Packit 631bab
}
Packit 631bab
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
Packit 631bab
Packit 631bab
Packit 631bab
# AM_OUTPUT_DEPENDENCY_COMMANDS
Packit 631bab
# -----------------------------
Packit 631bab
# This macro should only be invoked once -- use via AC_REQUIRE.
Packit 631bab
#
Packit 631bab
# This code is only required when automatic dependency tracking
Packit 631bab
# is enabled.  FIXME.  This creates each '.P' file that we will
Packit 631bab
# need in order to bootstrap the dependency handling code.
Packit 631bab
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
Packit 631bab
[AC_CONFIG_COMMANDS([depfiles],
Packit 631bab
     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
Packit 631bab
     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
Packit 631bab
])
Packit 631bab
Packit 631bab
# Do all the work for Automake.                             -*- Autoconf -*-
Packit 631bab
Packit 631bab
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# This macro actually does too much.  Some checks are only needed if
Packit 631bab
# your package does certain things.  But this isn't really a big deal.
Packit 631bab
Packit 631bab
dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
Packit 631bab
m4_define([AC_PROG_CC],
Packit 631bab
m4_defn([AC_PROG_CC])
Packit 631bab
[_AM_PROG_CC_C_O
Packit 631bab
])
Packit 631bab
Packit 631bab
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
Packit 631bab
# AM_INIT_AUTOMAKE([OPTIONS])
Packit 631bab
# -----------------------------------------------
Packit 631bab
# The call with PACKAGE and VERSION arguments is the old style
Packit 631bab
# call (pre autoconf-2.50), which is being phased out.  PACKAGE
Packit 631bab
# and VERSION should now be passed to AC_INIT and removed from
Packit 631bab
# the call to AM_INIT_AUTOMAKE.
Packit 631bab
# We support both call styles for the transition.  After
Packit 631bab
# the next Automake release, Autoconf can make the AC_INIT
Packit 631bab
# arguments mandatory, and then we can depend on a new Autoconf
Packit 631bab
# release and drop the old call support.
Packit 631bab
AC_DEFUN([AM_INIT_AUTOMAKE],
Packit 631bab
[AC_PREREQ([2.65])dnl
Packit 631bab
dnl Autoconf wants to disallow AM_ names.  We explicitly allow
Packit 631bab
dnl the ones we care about.
Packit 631bab
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
Packit 631bab
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
Packit 631bab
AC_REQUIRE([AC_PROG_INSTALL])dnl
Packit 631bab
if test "`cd $srcdir && pwd`" != "`pwd`"; then
Packit 631bab
  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
Packit 631bab
  # is not polluted with repeated "-I."
Packit 631bab
  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
Packit 631bab
  # test to see if srcdir already configured
Packit 631bab
  if test -f $srcdir/config.status; then
Packit 631bab
    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
Packit 631bab
  fi
Packit 631bab
fi
Packit 631bab
Packit 631bab
# test whether we have cygpath
Packit 631bab
if test -z "$CYGPATH_W"; then
Packit 631bab
  if (cygpath --version) >/dev/null 2>/dev/null; then
Packit 631bab
    CYGPATH_W='cygpath -w'
Packit 631bab
  else
Packit 631bab
    CYGPATH_W=echo
Packit 631bab
  fi
Packit 631bab
fi
Packit 631bab
AC_SUBST([CYGPATH_W])
Packit 631bab
Packit 631bab
# Define the identity of the package.
Packit 631bab
dnl Distinguish between old-style and new-style calls.
Packit 631bab
m4_ifval([$2],
Packit 631bab
[AC_DIAGNOSE([obsolete],
Packit 631bab
             [$0: two- and three-arguments forms are deprecated.])
Packit 631bab
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
Packit 631bab
 AC_SUBST([PACKAGE], [$1])dnl
Packit 631bab
 AC_SUBST([VERSION], [$2])],
Packit 631bab
[_AM_SET_OPTIONS([$1])dnl
Packit 631bab
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
Packit 631bab
m4_if(
Packit 631bab
  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
Packit 631bab
  [ok:ok],,
Packit 631bab
  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
Packit 631bab
 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
Packit 631bab
 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
Packit 631bab
Packit 631bab
_AM_IF_OPTION([no-define],,
Packit 631bab
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
Packit 631bab
 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
Packit 631bab
Packit 631bab
# Some tools Automake needs.
Packit 631bab
AC_REQUIRE([AM_SANITY_CHECK])dnl
Packit 631bab
AC_REQUIRE([AC_ARG_PROGRAM])dnl
Packit 631bab
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
Packit 631bab
AM_MISSING_PROG([AUTOCONF], [autoconf])
Packit 631bab
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
Packit 631bab
AM_MISSING_PROG([AUTOHEADER], [autoheader])
Packit 631bab
AM_MISSING_PROG([MAKEINFO], [makeinfo])
Packit 631bab
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
Packit 631bab
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
Packit 631bab
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
Packit 631bab
# For better backward compatibility.  To be removed once Automake 1.9.x
Packit 631bab
# dies out for good.  For more background, see:
Packit 631bab
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
Packit 631bab
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
Packit 631bab
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
Packit 631bab
# We need awk for the "check" target (and possibly the TAP driver).  The
Packit 631bab
# system "awk" is bad on some platforms.
Packit 631bab
AC_REQUIRE([AC_PROG_AWK])dnl
Packit 631bab
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
Packit 631bab
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
Packit 631bab
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
Packit 631bab
	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
Packit 631bab
			     [_AM_PROG_TAR([v7])])])
Packit 631bab
_AM_IF_OPTION([no-dependencies],,
Packit 631bab
[AC_PROVIDE_IFELSE([AC_PROG_CC],
Packit 631bab
		  [_AM_DEPENDENCIES([CC])],
Packit 631bab
		  [m4_define([AC_PROG_CC],
Packit 631bab
			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
Packit 631bab
AC_PROVIDE_IFELSE([AC_PROG_CXX],
Packit 631bab
		  [_AM_DEPENDENCIES([CXX])],
Packit 631bab
		  [m4_define([AC_PROG_CXX],
Packit 631bab
			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
Packit 631bab
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
Packit 631bab
		  [_AM_DEPENDENCIES([OBJC])],
Packit 631bab
		  [m4_define([AC_PROG_OBJC],
Packit 631bab
			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
Packit 631bab
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
Packit 631bab
		  [_AM_DEPENDENCIES([OBJCXX])],
Packit 631bab
		  [m4_define([AC_PROG_OBJCXX],
Packit 631bab
			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
Packit 631bab
])
Packit 631bab
AC_REQUIRE([AM_SILENT_RULES])dnl
Packit 631bab
dnl The testsuite driver may need to know about EXEEXT, so add the
Packit 631bab
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
Packit 631bab
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
Packit 631bab
AC_CONFIG_COMMANDS_PRE(dnl
Packit 631bab
[m4_provide_if([_AM_COMPILER_EXEEXT],
Packit 631bab
  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
Packit 631bab
Packit 631bab
# POSIX will say in a future version that running "rm -f" with no argument
Packit 631bab
# is OK; and we want to be able to make that assumption in our Makefile
Packit 631bab
# recipes.  So use an aggressive probe to check that the usage we want is
Packit 631bab
# actually supported "in the wild" to an acceptable degree.
Packit 631bab
# See automake bug#10828.
Packit 631bab
# To make any issue more visible, cause the running configure to be aborted
Packit 631bab
# by default if the 'rm' program in use doesn't match our expectations; the
Packit 631bab
# user can still override this though.
Packit 631bab
if rm -f && rm -fr && rm -rf; then : OK; else
Packit 631bab
  cat >&2 <<'END'
Packit 631bab
Oops!
Packit 631bab
Packit 631bab
Your 'rm' program seems unable to run without file operands specified
Packit 631bab
on the command line, even when the '-f' option is present.  This is contrary
Packit 631bab
to the behaviour of most rm programs out there, and not conforming with
Packit 631bab
the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
Packit 631bab
Packit 631bab
Please tell bug-automake@gnu.org about your system, including the value
Packit 631bab
of your $PATH and any error possibly output before this message.  This
Packit 631bab
can help us improve future automake versions.
Packit 631bab
Packit 631bab
END
Packit 631bab
  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
Packit 631bab
    echo 'Configuration will proceed anyway, since you have set the' >&2
Packit 631bab
    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
Packit 631bab
    echo >&2
Packit 631bab
  else
Packit 631bab
    cat >&2 <<'END'
Packit 631bab
Aborting the configuration process, to ensure you take notice of the issue.
Packit 631bab
Packit 631bab
You can download and install GNU coreutils to get an 'rm' implementation
Packit 631bab
that behaves properly: <http://www.gnu.org/software/coreutils/>.
Packit 631bab
Packit 631bab
If you want to complete the configuration process using your problematic
Packit 631bab
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
Packit 631bab
to "yes", and re-run configure.
Packit 631bab
Packit 631bab
END
Packit 631bab
    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
Packit 631bab
  fi
Packit 631bab
fi
Packit 631bab
dnl The trailing newline in this macro's definition is deliberate, for
Packit 631bab
dnl backward compatibility and to allow trailing 'dnl'-style comments
Packit 631bab
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
Packit 631bab
])
Packit 631bab
Packit 631bab
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
Packit 631bab
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
Packit 631bab
dnl mangled by Autoconf and run in a shell conditional statement.
Packit 631bab
m4_define([_AC_COMPILER_EXEEXT],
Packit 631bab
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
Packit 631bab
Packit 631bab
# When config.status generates a header, we must update the stamp-h file.
Packit 631bab
# This file resides in the same directory as the config header
Packit 631bab
# that is generated.  The stamp files are numbered to have different names.
Packit 631bab
Packit 631bab
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
Packit 631bab
# loop where config.status creates the headers, so we can generate
Packit 631bab
# our stamp files there.
Packit 631bab
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
Packit 631bab
[# Compute $1's index in $config_headers.
Packit 631bab
_am_arg=$1
Packit 631bab
_am_stamp_count=1
Packit 631bab
for _am_header in $config_headers :; do
Packit 631bab
  case $_am_header in
Packit 631bab
    $_am_arg | $_am_arg:* )
Packit 631bab
      break ;;
Packit 631bab
    * )
Packit 631bab
      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
Packit 631bab
  esac
Packit 631bab
done
Packit 631bab
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
Packit 631bab
Packit 631bab
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# AM_PROG_INSTALL_SH
Packit 631bab
# ------------------
Packit 631bab
# Define $install_sh.
Packit 631bab
AC_DEFUN([AM_PROG_INSTALL_SH],
Packit 631bab
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
Packit 631bab
if test x"${install_sh+set}" != xset; then
Packit 631bab
  case $am_aux_dir in
Packit 631bab
  *\ * | *\	*)
Packit 631bab
    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
Packit 631bab
  *)
Packit 631bab
    install_sh="\${SHELL} $am_aux_dir/install-sh"
Packit 631bab
  esac
Packit 631bab
fi
Packit 631bab
AC_SUBST([install_sh])])
Packit 631bab
Packit 631bab
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# Check whether the underlying file-system supports filenames
Packit 631bab
# with a leading dot.  For instance MS-DOS doesn't.
Packit 631bab
AC_DEFUN([AM_SET_LEADING_DOT],
Packit 631bab
[rm -rf .tst 2>/dev/null
Packit 631bab
mkdir .tst 2>/dev/null
Packit 631bab
if test -d .tst; then
Packit 631bab
  am__leading_dot=.
Packit 631bab
else
Packit 631bab
  am__leading_dot=_
Packit 631bab
fi
Packit 631bab
rmdir .tst 2>/dev/null
Packit 631bab
AC_SUBST([am__leading_dot])])
Packit 631bab
Packit 631bab
# Check to see how 'make' treats includes.	            -*- Autoconf -*-
Packit 631bab
Packit 631bab
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# AM_MAKE_INCLUDE()
Packit 631bab
# -----------------
Packit 631bab
# Check to see how make treats includes.
Packit 631bab
AC_DEFUN([AM_MAKE_INCLUDE],
Packit 631bab
[am_make=${MAKE-make}
Packit 631bab
cat > confinc << 'END'
Packit 631bab
am__doit:
Packit 631bab
	@echo this is the am__doit target
Packit 631bab
.PHONY: am__doit
Packit 631bab
END
Packit 631bab
# If we don't find an include directive, just comment out the code.
Packit 631bab
AC_MSG_CHECKING([for style of include used by $am_make])
Packit 631bab
am__include="#"
Packit 631bab
am__quote=
Packit 631bab
_am_result=none
Packit 631bab
# First try GNU make style include.
Packit 631bab
echo "include confinc" > confmf
Packit 631bab
# Ignore all kinds of additional output from 'make'.
Packit 631bab
case `$am_make -s -f confmf 2> /dev/null` in #(
Packit 631bab
*the\ am__doit\ target*)
Packit 631bab
  am__include=include
Packit 631bab
  am__quote=
Packit 631bab
  _am_result=GNU
Packit 631bab
  ;;
Packit 631bab
esac
Packit 631bab
# Now try BSD make style include.
Packit 631bab
if test "$am__include" = "#"; then
Packit 631bab
   echo '.include "confinc"' > confmf
Packit 631bab
   case `$am_make -s -f confmf 2> /dev/null` in #(
Packit 631bab
   *the\ am__doit\ target*)
Packit 631bab
     am__include=.include
Packit 631bab
     am__quote="\""
Packit 631bab
     _am_result=BSD
Packit 631bab
     ;;
Packit 631bab
   esac
Packit 631bab
fi
Packit 631bab
AC_SUBST([am__include])
Packit 631bab
AC_SUBST([am__quote])
Packit 631bab
AC_MSG_RESULT([$_am_result])
Packit 631bab
rm -f confinc confmf
Packit 631bab
])
Packit 631bab
Packit 631bab
# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
Packit 631bab
Packit 631bab
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# AM_MISSING_PROG(NAME, PROGRAM)
Packit 631bab
# ------------------------------
Packit 631bab
AC_DEFUN([AM_MISSING_PROG],
Packit 631bab
[AC_REQUIRE([AM_MISSING_HAS_RUN])
Packit 631bab
$1=${$1-"${am_missing_run}$2"}
Packit 631bab
AC_SUBST($1)])
Packit 631bab
Packit 631bab
# AM_MISSING_HAS_RUN
Packit 631bab
# ------------------
Packit 631bab
# Define MISSING if not defined so far and test if it is modern enough.
Packit 631bab
# If it is, set am_missing_run to use it, otherwise, to nothing.
Packit 631bab
AC_DEFUN([AM_MISSING_HAS_RUN],
Packit 631bab
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
Packit 631bab
AC_REQUIRE_AUX_FILE([missing])dnl
Packit 631bab
if test x"${MISSING+set}" != xset; then
Packit 631bab
  case $am_aux_dir in
Packit 631bab
  *\ * | *\	*)
Packit 631bab
    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
Packit 631bab
  *)
Packit 631bab
    MISSING="\${SHELL} $am_aux_dir/missing" ;;
Packit 631bab
  esac
Packit 631bab
fi
Packit 631bab
# Use eval to expand $SHELL
Packit 631bab
if eval "$MISSING --is-lightweight"; then
Packit 631bab
  am_missing_run="$MISSING "
Packit 631bab
else
Packit 631bab
  am_missing_run=
Packit 631bab
  AC_MSG_WARN(['missing' script is too old or missing])
Packit 631bab
fi
Packit 631bab
])
Packit 631bab
Packit 631bab
# Helper functions for option handling.                     -*- Autoconf -*-
Packit 631bab
Packit 631bab
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# _AM_MANGLE_OPTION(NAME)
Packit 631bab
# -----------------------
Packit 631bab
AC_DEFUN([_AM_MANGLE_OPTION],
Packit 631bab
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
Packit 631bab
Packit 631bab
# _AM_SET_OPTION(NAME)
Packit 631bab
# --------------------
Packit 631bab
# Set option NAME.  Presently that only means defining a flag for this option.
Packit 631bab
AC_DEFUN([_AM_SET_OPTION],
Packit 631bab
[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
Packit 631bab
Packit 631bab
# _AM_SET_OPTIONS(OPTIONS)
Packit 631bab
# ------------------------
Packit 631bab
# OPTIONS is a space-separated list of Automake options.
Packit 631bab
AC_DEFUN([_AM_SET_OPTIONS],
Packit 631bab
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
Packit 631bab
Packit 631bab
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
Packit 631bab
# -------------------------------------------
Packit 631bab
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
Packit 631bab
AC_DEFUN([_AM_IF_OPTION],
Packit 631bab
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
Packit 631bab
Packit 631bab
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# _AM_PROG_CC_C_O
Packit 631bab
# ---------------
Packit 631bab
# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
Packit 631bab
# to automatically call this.
Packit 631bab
AC_DEFUN([_AM_PROG_CC_C_O],
Packit 631bab
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
Packit 631bab
AC_REQUIRE_AUX_FILE([compile])dnl
Packit 631bab
AC_LANG_PUSH([C])dnl
Packit 631bab
AC_CACHE_CHECK(
Packit 631bab
  [whether $CC understands -c and -o together],
Packit 631bab
  [am_cv_prog_cc_c_o],
Packit 631bab
  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
Packit 631bab
  # Make sure it works both with $CC and with simple cc.
Packit 631bab
  # Following AC_PROG_CC_C_O, we do the test twice because some
Packit 631bab
  # compilers refuse to overwrite an existing .o file with -o,
Packit 631bab
  # though they will create one.
Packit 631bab
  am_cv_prog_cc_c_o=yes
Packit 631bab
  for am_i in 1 2; do
Packit 631bab
    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
Packit 631bab
         && test -f conftest2.$ac_objext; then
Packit 631bab
      : OK
Packit 631bab
    else
Packit 631bab
      am_cv_prog_cc_c_o=no
Packit 631bab
      break
Packit 631bab
    fi
Packit 631bab
  done
Packit 631bab
  rm -f core conftest*
Packit 631bab
  unset am_i])
Packit 631bab
if test "$am_cv_prog_cc_c_o" != yes; then
Packit 631bab
   # Losing compiler, so override with the script.
Packit 631bab
   # FIXME: It is wrong to rewrite CC.
Packit 631bab
   # But if we don't then we get into trouble of one sort or another.
Packit 631bab
   # A longer-term fix would be to have automake use am__CC in this case,
Packit 631bab
   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
Packit 631bab
   CC="$am_aux_dir/compile $CC"
Packit 631bab
fi
Packit 631bab
AC_LANG_POP([C])])
Packit 631bab
Packit 631bab
# For backward compatibility.
Packit 631bab
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
Packit 631bab
Packit 631bab
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# AM_RUN_LOG(COMMAND)
Packit 631bab
# -------------------
Packit 631bab
# Run COMMAND, save the exit status in ac_status, and log it.
Packit 631bab
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
Packit 631bab
AC_DEFUN([AM_RUN_LOG],
Packit 631bab
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
Packit 631bab
   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
Packit 631bab
   ac_status=$?
Packit 631bab
   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
Packit 631bab
   (exit $ac_status); }])
Packit 631bab
Packit 631bab
# Check to make sure that the build environment is sane.    -*- Autoconf -*-
Packit 631bab
Packit 631bab
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# AM_SANITY_CHECK
Packit 631bab
# ---------------
Packit 631bab
AC_DEFUN([AM_SANITY_CHECK],
Packit 631bab
[AC_MSG_CHECKING([whether build environment is sane])
Packit 631bab
# Reject unsafe characters in $srcdir or the absolute working directory
Packit 631bab
# name.  Accept space and tab only in the latter.
Packit 631bab
am_lf='
Packit 631bab
'
Packit 631bab
case `pwd` in
Packit 631bab
  *[[\\\"\#\$\&\'\`$am_lf]]*)
Packit 631bab
    AC_MSG_ERROR([unsafe absolute working directory name]);;
Packit 631bab
esac
Packit 631bab
case $srcdir in
Packit 631bab
  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
Packit 631bab
    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
Packit 631bab
esac
Packit 631bab
Packit 631bab
# Do 'set' in a subshell so we don't clobber the current shell's
Packit 631bab
# arguments.  Must try -L first in case configure is actually a
Packit 631bab
# symlink; some systems play weird games with the mod time of symlinks
Packit 631bab
# (eg FreeBSD returns the mod time of the symlink's containing
Packit 631bab
# directory).
Packit 631bab
if (
Packit 631bab
   am_has_slept=no
Packit 631bab
   for am_try in 1 2; do
Packit 631bab
     echo "timestamp, slept: $am_has_slept" > conftest.file
Packit 631bab
     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
Packit 631bab
     if test "$[*]" = "X"; then
Packit 631bab
	# -L didn't work.
Packit 631bab
	set X `ls -t "$srcdir/configure" conftest.file`
Packit 631bab
     fi
Packit 631bab
     if test "$[*]" != "X $srcdir/configure conftest.file" \
Packit 631bab
	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
Packit 631bab
Packit 631bab
	# If neither matched, then we have a broken ls.  This can happen
Packit 631bab
	# if, for instance, CONFIG_SHELL is bash and it inherits a
Packit 631bab
	# broken ls alias from the environment.  This has actually
Packit 631bab
	# happened.  Such a system could not be considered "sane".
Packit 631bab
	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
Packit 631bab
  alias in your environment])
Packit 631bab
     fi
Packit 631bab
     if test "$[2]" = conftest.file || test $am_try -eq 2; then
Packit 631bab
       break
Packit 631bab
     fi
Packit 631bab
     # Just in case.
Packit 631bab
     sleep 1
Packit 631bab
     am_has_slept=yes
Packit 631bab
   done
Packit 631bab
   test "$[2]" = conftest.file
Packit 631bab
   )
Packit 631bab
then
Packit 631bab
   # Ok.
Packit 631bab
   :
Packit 631bab
else
Packit 631bab
   AC_MSG_ERROR([newly created file is older than distributed files!
Packit 631bab
Check your system clock])
Packit 631bab
fi
Packit 631bab
AC_MSG_RESULT([yes])
Packit 631bab
# If we didn't sleep, we still need to ensure time stamps of config.status and
Packit 631bab
# generated files are strictly newer.
Packit 631bab
am_sleep_pid=
Packit 631bab
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
Packit 631bab
  ( sleep 1 ) &
Packit 631bab
  am_sleep_pid=$!
Packit 631bab
fi
Packit 631bab
AC_CONFIG_COMMANDS_PRE(
Packit 631bab
  [AC_MSG_CHECKING([that generated files are newer than configure])
Packit 631bab
   if test -n "$am_sleep_pid"; then
Packit 631bab
     # Hide warnings about reused PIDs.
Packit 631bab
     wait $am_sleep_pid 2>/dev/null
Packit 631bab
   fi
Packit 631bab
   AC_MSG_RESULT([done])])
Packit 631bab
rm -f conftest.file
Packit 631bab
])
Packit 631bab
Packit 631bab
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# AM_SILENT_RULES([DEFAULT])
Packit 631bab
# --------------------------
Packit 631bab
# Enable less verbose build rules; with the default set to DEFAULT
Packit 631bab
# ("yes" being less verbose, "no" or empty being verbose).
Packit 631bab
AC_DEFUN([AM_SILENT_RULES],
Packit 631bab
[AC_ARG_ENABLE([silent-rules], [dnl
Packit 631bab
AS_HELP_STRING(
Packit 631bab
  [--enable-silent-rules],
Packit 631bab
  [less verbose build output (undo: "make V=1")])
Packit 631bab
AS_HELP_STRING(
Packit 631bab
  [--disable-silent-rules],
Packit 631bab
  [verbose build output (undo: "make V=0")])dnl
Packit 631bab
])
Packit 631bab
case $enable_silent_rules in @%:@ (((
Packit 631bab
  yes) AM_DEFAULT_VERBOSITY=0;;
Packit 631bab
   no) AM_DEFAULT_VERBOSITY=1;;
Packit 631bab
    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
Packit 631bab
esac
Packit 631bab
dnl
Packit 631bab
dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
Packit 631bab
dnl do not support nested variable expansions.
Packit 631bab
dnl See automake bug#9928 and bug#10237.
Packit 631bab
am_make=${MAKE-make}
Packit 631bab
AC_CACHE_CHECK([whether $am_make supports nested variables],
Packit 631bab
   [am_cv_make_support_nested_variables],
Packit 631bab
   [if AS_ECHO([['TRUE=$(BAR$(V))
Packit 631bab
BAR0=false
Packit 631bab
BAR1=true
Packit 631bab
V=1
Packit 631bab
am__doit:
Packit 631bab
	@$(TRUE)
Packit 631bab
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
Packit 631bab
  am_cv_make_support_nested_variables=yes
Packit 631bab
else
Packit 631bab
  am_cv_make_support_nested_variables=no
Packit 631bab
fi])
Packit 631bab
if test $am_cv_make_support_nested_variables = yes; then
Packit 631bab
  dnl Using '$V' instead of '$(V)' breaks IRIX make.
Packit 631bab
  AM_V='$(V)'
Packit 631bab
  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
Packit 631bab
else
Packit 631bab
  AM_V=$AM_DEFAULT_VERBOSITY
Packit 631bab
  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
Packit 631bab
fi
Packit 631bab
AC_SUBST([AM_V])dnl
Packit 631bab
AM_SUBST_NOTMAKE([AM_V])dnl
Packit 631bab
AC_SUBST([AM_DEFAULT_V])dnl
Packit 631bab
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
Packit 631bab
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
Packit 631bab
AM_BACKSLASH='\'
Packit 631bab
AC_SUBST([AM_BACKSLASH])dnl
Packit 631bab
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
Packit 631bab
])
Packit 631bab
Packit 631bab
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# AM_PROG_INSTALL_STRIP
Packit 631bab
# ---------------------
Packit 631bab
# One issue with vendor 'install' (even GNU) is that you can't
Packit 631bab
# specify the program used to strip binaries.  This is especially
Packit 631bab
# annoying in cross-compiling environments, where the build's strip
Packit 631bab
# is unlikely to handle the host's binaries.
Packit 631bab
# Fortunately install-sh will honor a STRIPPROG variable, so we
Packit 631bab
# always use install-sh in "make install-strip", and initialize
Packit 631bab
# STRIPPROG with the value of the STRIP variable (set by the user).
Packit 631bab
AC_DEFUN([AM_PROG_INSTALL_STRIP],
Packit 631bab
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
Packit 631bab
# Installed binaries are usually stripped using 'strip' when the user
Packit 631bab
# run "make install-strip".  However 'strip' might not be the right
Packit 631bab
# tool to use in cross-compilation environments, therefore Automake
Packit 631bab
# will honor the 'STRIP' environment variable to overrule this program.
Packit 631bab
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
Packit 631bab
if test "$cross_compiling" != no; then
Packit 631bab
  AC_CHECK_TOOL([STRIP], [strip], :)
Packit 631bab
fi
Packit 631bab
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
Packit 631bab
AC_SUBST([INSTALL_STRIP_PROGRAM])])
Packit 631bab
Packit 631bab
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# _AM_SUBST_NOTMAKE(VARIABLE)
Packit 631bab
# ---------------------------
Packit 631bab
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
Packit 631bab
# This macro is traced by Automake.
Packit 631bab
AC_DEFUN([_AM_SUBST_NOTMAKE])
Packit 631bab
Packit 631bab
# AM_SUBST_NOTMAKE(VARIABLE)
Packit 631bab
# --------------------------
Packit 631bab
# Public sister of _AM_SUBST_NOTMAKE.
Packit 631bab
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
Packit 631bab
Packit 631bab
# Check how to create a tarball.                            -*- Autoconf -*-
Packit 631bab
Packit 631bab
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
Packit 631bab
#
Packit 631bab
# This file is free software; the Free Software Foundation
Packit 631bab
# gives unlimited permission to copy and/or distribute it,
Packit 631bab
# with or without modifications, as long as this notice is preserved.
Packit 631bab
Packit 631bab
# _AM_PROG_TAR(FORMAT)
Packit 631bab
# --------------------
Packit 631bab
# Check how to create a tarball in format FORMAT.
Packit 631bab
# FORMAT should be one of 'v7', 'ustar', or 'pax'.
Packit 631bab
#
Packit 631bab
# Substitute a variable $(am__tar) that is a command
Packit 631bab
# writing to stdout a FORMAT-tarball containing the directory
Packit 631bab
# $tardir.
Packit 631bab
#     tardir=directory && $(am__tar) > result.tar
Packit 631bab
#
Packit 631bab
# Substitute a variable $(am__untar) that extract such
Packit 631bab
# a tarball read from stdin.
Packit 631bab
#     $(am__untar) < result.tar
Packit 631bab
#
Packit 631bab
AC_DEFUN([_AM_PROG_TAR],
Packit 631bab
[# Always define AMTAR for backward compatibility.  Yes, it's still used
Packit 631bab
# in the wild :-(  We should find a proper way to deprecate it ...
Packit 631bab
AC_SUBST([AMTAR], ['$${TAR-tar}'])
Packit 631bab
Packit 631bab
# We'll loop over all known methods to create a tar archive until one works.
Packit 631bab
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
Packit 631bab
Packit 631bab
m4_if([$1], [v7],
Packit 631bab
  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
Packit 631bab
Packit 631bab
  [m4_case([$1],
Packit 631bab
    [ustar],
Packit 631bab
     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
Packit 631bab
      # There is notably a 21 bits limit for the UID and the GID.  In fact,
Packit 631bab
      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
Packit 631bab
      # and bug#13588).
Packit 631bab
      am_max_uid=2097151 # 2^21 - 1
Packit 631bab
      am_max_gid=$am_max_uid
Packit 631bab
      # The $UID and $GID variables are not portable, so we need to resort
Packit 631bab
      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
Packit 631bab
      # below are definitely unexpected, so allow the users to see them
Packit 631bab
      # (that is, avoid stderr redirection).
Packit 631bab
      am_uid=`id -u || echo unknown`
Packit 631bab
      am_gid=`id -g || echo unknown`
Packit 631bab
      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
Packit 631bab
      if test $am_uid -le $am_max_uid; then
Packit 631bab
         AC_MSG_RESULT([yes])
Packit 631bab
      else
Packit 631bab
         AC_MSG_RESULT([no])
Packit 631bab
         _am_tools=none
Packit 631bab
      fi
Packit 631bab
      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
Packit 631bab
      if test $am_gid -le $am_max_gid; then
Packit 631bab
         AC_MSG_RESULT([yes])
Packit 631bab
      else
Packit 631bab
        AC_MSG_RESULT([no])
Packit 631bab
        _am_tools=none
Packit 631bab
      fi],
Packit 631bab
Packit 631bab
  [pax],
Packit 631bab
    [],
Packit 631bab
Packit 631bab
  [m4_fatal([Unknown tar format])])
Packit 631bab
Packit 631bab
  AC_MSG_CHECKING([how to create a $1 tar archive])
Packit 631bab
Packit 631bab
  # Go ahead even if we have the value already cached.  We do so because we
Packit 631bab
  # need to set the values for the 'am__tar' and 'am__untar' variables.
Packit 631bab
  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
Packit 631bab
Packit 631bab
  for _am_tool in $_am_tools; do
Packit 631bab
    case $_am_tool in
Packit 631bab
    gnutar)
Packit 631bab
      for _am_tar in tar gnutar gtar; do
Packit 631bab
        AM_RUN_LOG([$_am_tar --version]) && break
Packit 631bab
      done
Packit 631bab
      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
Packit 631bab
      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
Packit 631bab
      am__untar="$_am_tar -xf -"
Packit 631bab
      ;;
Packit 631bab