aclocal.m4 revision 1c7386f4
11c7386f4Smrg# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
208c70cfbSmrg
308c70cfbSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4602e473dSmrg
5602e473dSmrg# This file is free software; the Free Software Foundation
6602e473dSmrg# gives unlimited permission to copy and/or distribute it,
7602e473dSmrg# with or without modifications, as long as this notice is preserved.
8602e473dSmrg
9602e473dSmrg# This program is distributed in the hope that it will be useful,
10602e473dSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11602e473dSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12602e473dSmrg# PARTICULAR PURPOSE.
13602e473dSmrg
1408c70cfbSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15602e473dSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16602e473dSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
171016ad83Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
181016ad83Smrg[m4_warning([this file was generated for autoconf 2.69.
19602e473dSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20602e473dSmrgIf you have problems, you may need to regenerate the build system entirely.
2108c70cfbSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22602e473dSmrg
231016ad83Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
241016ad83Smrg# serial 1 (pkg-config-0.24)
251016ad83Smrg# 
261016ad83Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
271016ad83Smrg#
281016ad83Smrg# This program is free software; you can redistribute it and/or modify
291016ad83Smrg# it under the terms of the GNU General Public License as published by
301016ad83Smrg# the Free Software Foundation; either version 2 of the License, or
311016ad83Smrg# (at your option) any later version.
321016ad83Smrg#
331016ad83Smrg# This program is distributed in the hope that it will be useful, but
341016ad83Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
351016ad83Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
361016ad83Smrg# General Public License for more details.
371016ad83Smrg#
381016ad83Smrg# You should have received a copy of the GNU General Public License
391016ad83Smrg# along with this program; if not, write to the Free Software
401016ad83Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
411016ad83Smrg#
421016ad83Smrg# As a special exception to the GNU General Public License, if you
431016ad83Smrg# distribute this file as part of a program that contains a
441016ad83Smrg# configuration script generated by Autoconf, you may include it under
451016ad83Smrg# the same distribution terms that you use for the rest of that program.
461016ad83Smrg
471016ad83Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
481016ad83Smrg# ----------------------------------
491016ad83SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
501016ad83Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
511016ad83Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
521016ad83Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
531016ad83SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
541016ad83SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
551016ad83SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
561016ad83Smrg
571016ad83Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
581016ad83Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
591016ad83Smrgfi
601016ad83Smrgif test -n "$PKG_CONFIG"; then
611016ad83Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
621016ad83Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
631016ad83Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
641016ad83Smrg		AC_MSG_RESULT([yes])
651016ad83Smrg	else
661016ad83Smrg		AC_MSG_RESULT([no])
671016ad83Smrg		PKG_CONFIG=""
681016ad83Smrg	fi
691016ad83Smrgfi[]dnl
701016ad83Smrg])# PKG_PROG_PKG_CONFIG
711016ad83Smrg
721016ad83Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
731016ad83Smrg#
741016ad83Smrg# Check to see whether a particular set of modules exists.  Similar
751016ad83Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
761016ad83Smrg#
771016ad83Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
781016ad83Smrg# only at the first occurence in configure.ac, so if the first place
791016ad83Smrg# it's called might be skipped (such as if it is within an "if", you
801016ad83Smrg# have to call PKG_CHECK_EXISTS manually
811016ad83Smrg# --------------------------------------------------------------
821016ad83SmrgAC_DEFUN([PKG_CHECK_EXISTS],
831016ad83Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
841016ad83Smrgif test -n "$PKG_CONFIG" && \
851016ad83Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
861016ad83Smrg  m4_default([$2], [:])
871016ad83Smrgm4_ifvaln([$3], [else
881016ad83Smrg  $3])dnl
891016ad83Smrgfi])
901016ad83Smrg
911016ad83Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
921016ad83Smrg# ---------------------------------------------
931016ad83Smrgm4_define([_PKG_CONFIG],
941016ad83Smrg[if test -n "$$1"; then
951016ad83Smrg    pkg_cv_[]$1="$$1"
961016ad83Smrg elif test -n "$PKG_CONFIG"; then
971016ad83Smrg    PKG_CHECK_EXISTS([$3],
981016ad83Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
991016ad83Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
1001016ad83Smrg		     [pkg_failed=yes])
1011016ad83Smrg else
1021016ad83Smrg    pkg_failed=untried
1031016ad83Smrgfi[]dnl
1041016ad83Smrg])# _PKG_CONFIG
1051016ad83Smrg
1061016ad83Smrg# _PKG_SHORT_ERRORS_SUPPORTED
1071016ad83Smrg# -----------------------------
1081016ad83SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1091016ad83Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1101016ad83Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1111016ad83Smrg        _pkg_short_errors_supported=yes
1121016ad83Smrgelse
1131016ad83Smrg        _pkg_short_errors_supported=no
1141016ad83Smrgfi[]dnl
1151016ad83Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
1161016ad83Smrg
1171016ad83Smrg
1181016ad83Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1191016ad83Smrg# [ACTION-IF-NOT-FOUND])
1201016ad83Smrg#
1211016ad83Smrg#
1221016ad83Smrg# Note that if there is a possibility the first call to
1231016ad83Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
1241016ad83Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1251016ad83Smrg#
1261016ad83Smrg#
1271016ad83Smrg# --------------------------------------------------------------
1281016ad83SmrgAC_DEFUN([PKG_CHECK_MODULES],
1291016ad83Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1301016ad83SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1311016ad83SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1321016ad83Smrg
1331016ad83Smrgpkg_failed=no
1341016ad83SmrgAC_MSG_CHECKING([for $1])
1351016ad83Smrg
1361016ad83Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1371016ad83Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1381016ad83Smrg
1391016ad83Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1401016ad83Smrgand $1[]_LIBS to avoid the need to call pkg-config.
1411016ad83SmrgSee the pkg-config man page for more details.])
1421016ad83Smrg
1431016ad83Smrgif test $pkg_failed = yes; then
1441016ad83Smrg   	AC_MSG_RESULT([no])
1451016ad83Smrg        _PKG_SHORT_ERRORS_SUPPORTED
1461016ad83Smrg        if test $_pkg_short_errors_supported = yes; then
1471016ad83Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1481016ad83Smrg        else 
1491016ad83Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1501016ad83Smrg        fi
1511016ad83Smrg	# Put the nasty error message in config.log where it belongs
1521016ad83Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1531016ad83Smrg
1541016ad83Smrg	m4_default([$4], [AC_MSG_ERROR(
1551016ad83Smrg[Package requirements ($2) were not met:
1561016ad83Smrg
1571016ad83Smrg$$1_PKG_ERRORS
1581016ad83Smrg
1591016ad83SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1601016ad83Smrginstalled software in a non-standard prefix.
1611016ad83Smrg
1621016ad83Smrg_PKG_TEXT])[]dnl
1631016ad83Smrg        ])
1641016ad83Smrgelif test $pkg_failed = untried; then
1651016ad83Smrg     	AC_MSG_RESULT([no])
1661016ad83Smrg	m4_default([$4], [AC_MSG_FAILURE(
1671016ad83Smrg[The pkg-config script could not be found or is too old.  Make sure it
1681016ad83Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
1691016ad83Smrgpath to pkg-config.
1701016ad83Smrg
1711016ad83Smrg_PKG_TEXT
1721016ad83Smrg
1731016ad83SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1741016ad83Smrg        ])
1751016ad83Smrgelse
1761016ad83Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1771016ad83Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1781016ad83Smrg        AC_MSG_RESULT([yes])
1791016ad83Smrg	$3
1801016ad83Smrgfi[]dnl
1811016ad83Smrg])# PKG_CHECK_MODULES
1821016ad83Smrg
1831c7386f4Smrg
1841c7386f4Smrg# PKG_INSTALLDIR(DIRECTORY)
1851c7386f4Smrg# -------------------------
1861c7386f4Smrg# Substitutes the variable pkgconfigdir as the location where a module
1871c7386f4Smrg# should install pkg-config .pc files. By default the directory is
1881c7386f4Smrg# $libdir/pkgconfig, but the default can be changed by passing
1891c7386f4Smrg# DIRECTORY. The user can override through the --with-pkgconfigdir
1901c7386f4Smrg# parameter.
1911c7386f4SmrgAC_DEFUN([PKG_INSTALLDIR],
1921c7386f4Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
1931c7386f4Smrgm4_pushdef([pkg_description],
1941c7386f4Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
1951c7386f4SmrgAC_ARG_WITH([pkgconfigdir],
1961c7386f4Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
1971c7386f4Smrg    [with_pkgconfigdir=]pkg_default)
1981c7386f4SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
1991c7386f4Smrgm4_popdef([pkg_default])
2001c7386f4Smrgm4_popdef([pkg_description])
2011c7386f4Smrg]) dnl PKG_INSTALLDIR
2021c7386f4Smrg
2031c7386f4Smrg
2041c7386f4Smrg# PKG_NOARCH_INSTALLDIR(DIRECTORY)
2051c7386f4Smrg# -------------------------
2061c7386f4Smrg# Substitutes the variable noarch_pkgconfigdir as the location where a
2071c7386f4Smrg# module should install arch-independent pkg-config .pc files. By
2081c7386f4Smrg# default the directory is $datadir/pkgconfig, but the default can be
2091c7386f4Smrg# changed by passing DIRECTORY. The user can override through the
2101c7386f4Smrg# --with-noarch-pkgconfigdir parameter.
2111c7386f4SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
2121c7386f4Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
2131c7386f4Smrgm4_pushdef([pkg_description],
2141c7386f4Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
2151c7386f4SmrgAC_ARG_WITH([noarch-pkgconfigdir],
2161c7386f4Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
2171c7386f4Smrg    [with_noarch_pkgconfigdir=]pkg_default)
2181c7386f4SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
2191c7386f4Smrgm4_popdef([pkg_default])
2201c7386f4Smrgm4_popdef([pkg_description])
2211c7386f4Smrg]) dnl PKG_NOARCH_INSTALLDIR
2221c7386f4Smrg
2231c7386f4Smrg
2241c7386f4Smrg# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
2251c7386f4Smrg# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2261c7386f4Smrg# -------------------------------------------
2271c7386f4Smrg# Retrieves the value of the pkg-config variable for the given module.
2281c7386f4SmrgAC_DEFUN([PKG_CHECK_VAR],
2291c7386f4Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2301c7386f4SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
2311c7386f4Smrg
2321c7386f4Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
2331c7386f4SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
2341c7386f4Smrg
2351c7386f4SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
2361c7386f4Smrg])# PKG_CHECK_VAR
2371c7386f4Smrg
2381c7386f4Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
2391c7386f4Smrgdnl
2401c7386f4Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
2411c7386f4Smrgdnl
2421c7386f4Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
2431c7386f4Smrgdnl copy of this software and associated documentation files (the "Software"),
2441c7386f4Smrgdnl to deal in the Software without restriction, including without limitation
2451c7386f4Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
2461c7386f4Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
2471c7386f4Smrgdnl Software is furnished to do so, subject to the following conditions:
2481c7386f4Smrgdnl
2491c7386f4Smrgdnl The above copyright notice and this permission notice (including the next
2501c7386f4Smrgdnl paragraph) shall be included in all copies or substantial portions of the
2511c7386f4Smrgdnl Software.
2521c7386f4Smrgdnl
2531c7386f4Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2541c7386f4Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2551c7386f4Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
2561c7386f4Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2571c7386f4Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2581c7386f4Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2591c7386f4Smrgdnl DEALINGS IN THE SOFTWARE.
2601c7386f4Smrg
2611c7386f4Smrg# XORG_MACROS_VERSION(required-version)
2621c7386f4Smrg# -------------------------------------
2631c7386f4Smrg# Minimum version: 1.1.0
2641c7386f4Smrg#
2651c7386f4Smrg# If you're using a macro added in Version 1.1 or newer, include this in
2661c7386f4Smrg# your configure.ac with the minimum required version, such as:
2671c7386f4Smrg# XORG_MACROS_VERSION(1.1)
2681c7386f4Smrg#
2691c7386f4Smrg# To ensure that this macro is defined, also add:
2701c7386f4Smrg# m4_ifndef([XORG_MACROS_VERSION],
2711c7386f4Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
2721c7386f4Smrg#
2731c7386f4Smrg#
2741c7386f4Smrg# See the "minimum version" comment for each macro you use to see what
2751c7386f4Smrg# version you require.
2761c7386f4Smrgm4_defun([XORG_MACROS_VERSION],[
2771c7386f4Smrgm4_define([vers_have], [1.19.0])
2781c7386f4Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
2791c7386f4Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
2801c7386f4Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
2811c7386f4Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
2821c7386f4Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
2831c7386f4Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
2841c7386f4Smrgm4_undefine([vers_have])
2851c7386f4Smrgm4_undefine([maj_have])
2861c7386f4Smrgm4_undefine([maj_needed])
2871c7386f4Smrg]) # XORG_MACROS_VERSION
2881c7386f4Smrg
2891c7386f4Smrg# XORG_PROG_RAWCPP()
2901c7386f4Smrg# ------------------
2911c7386f4Smrg# Minimum version: 1.0.0
2921c7386f4Smrg#
2931c7386f4Smrg# Find cpp program and necessary flags for use in pre-processing text files
2941c7386f4Smrg# such as man pages and config files
2951c7386f4SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
2961c7386f4SmrgAC_REQUIRE([AC_PROG_CPP])
2971c7386f4SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
2981c7386f4Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
2991c7386f4Smrg
3001c7386f4Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
3011c7386f4Smrg# which is not the best choice for supporting other OS'es, but covers most
3021c7386f4Smrg# of the ones we need for now.
3031c7386f4SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
3041c7386f4SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
3051c7386f4Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
3061c7386f4Smrg	AC_MSG_RESULT([no])
3071c7386f4Smrgelse
3081c7386f4Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
3091c7386f4Smrg		RAWCPPFLAGS=-undef
3101c7386f4Smrg		AC_MSG_RESULT([yes])
3111c7386f4Smrg	# under Cygwin unix is still defined even with -undef
3121c7386f4Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
3131c7386f4Smrg		RAWCPPFLAGS="-undef -ansi"
3141c7386f4Smrg		AC_MSG_RESULT([yes, with -ansi])
3151c7386f4Smrg	else
3161c7386f4Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
3171c7386f4Smrg	fi
3181c7386f4Smrgfi
3191c7386f4Smrgrm -f conftest.$ac_ext
3201c7386f4Smrg
3211c7386f4SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
3221c7386f4SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
3231c7386f4Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
3241c7386f4Smrg	AC_MSG_RESULT([no])
3251c7386f4Smrgelse
3261c7386f4Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
3271c7386f4Smrg		TRADITIONALCPPFLAGS="-traditional"
3281c7386f4Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
3291c7386f4Smrg		AC_MSG_RESULT([yes])
3301c7386f4Smrg	else
3311c7386f4Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
3321c7386f4Smrg	fi
3331c7386f4Smrgfi
3341c7386f4Smrgrm -f conftest.$ac_ext
3351c7386f4SmrgAC_SUBST(RAWCPPFLAGS)
3361c7386f4SmrgAC_SUBST(TRADITIONALCPPFLAGS)
3371c7386f4Smrg]) # XORG_PROG_RAWCPP
3381c7386f4Smrg
3391c7386f4Smrg# XORG_MANPAGE_SECTIONS()
3401c7386f4Smrg# -----------------------
3411c7386f4Smrg# Minimum version: 1.0.0
3421c7386f4Smrg#
3431c7386f4Smrg# Determine which sections man pages go in for the different man page types
3441c7386f4Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
3451c7386f4Smrg# Not sure if there's any better way than just hardcoding by OS name.
3461c7386f4Smrg# Override default settings by setting environment variables
3471c7386f4Smrg# Added MAN_SUBSTS in version 1.8
3481c7386f4Smrg# Added AC_PROG_SED in version 1.8
3491c7386f4Smrg
3501c7386f4SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
3511c7386f4SmrgAC_REQUIRE([AC_CANONICAL_HOST])
3521c7386f4SmrgAC_REQUIRE([AC_PROG_SED])
3531c7386f4Smrg
3541c7386f4Smrgif test x$APP_MAN_SUFFIX = x    ; then
3551c7386f4Smrg    APP_MAN_SUFFIX=1
3561c7386f4Smrgfi
3571c7386f4Smrgif test x$APP_MAN_DIR = x    ; then
3581c7386f4Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
3591c7386f4Smrgfi
3601c7386f4Smrg
3611c7386f4Smrgif test x$LIB_MAN_SUFFIX = x    ; then
3621c7386f4Smrg    LIB_MAN_SUFFIX=3
3631c7386f4Smrgfi
3641c7386f4Smrgif test x$LIB_MAN_DIR = x    ; then
3651c7386f4Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
3661c7386f4Smrgfi
3671c7386f4Smrg
3681c7386f4Smrgif test x$FILE_MAN_SUFFIX = x    ; then
3691c7386f4Smrg    case $host_os in
3701c7386f4Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
3711c7386f4Smrg	*)		FILE_MAN_SUFFIX=5  ;;
3721c7386f4Smrg    esac
3731c7386f4Smrgfi
3741c7386f4Smrgif test x$FILE_MAN_DIR = x    ; then
3751c7386f4Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
3761c7386f4Smrgfi
3771c7386f4Smrg
3781c7386f4Smrgif test x$MISC_MAN_SUFFIX = x    ; then
3791c7386f4Smrg    case $host_os in
3801c7386f4Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
3811c7386f4Smrg	*)		MISC_MAN_SUFFIX=7  ;;
3821c7386f4Smrg    esac
3831c7386f4Smrgfi
3841c7386f4Smrgif test x$MISC_MAN_DIR = x    ; then
3851c7386f4Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
3861c7386f4Smrgfi
3871c7386f4Smrg
3881c7386f4Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
3891c7386f4Smrg    case $host_os in
3901c7386f4Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
3911c7386f4Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
3921c7386f4Smrg    esac
3931c7386f4Smrgfi
3941c7386f4Smrgif test x$DRIVER_MAN_DIR = x    ; then
3951c7386f4Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
3961c7386f4Smrgfi
3971c7386f4Smrg
3981c7386f4Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
3991c7386f4Smrg    case $host_os in
4001c7386f4Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
4011c7386f4Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
4021c7386f4Smrg    esac
4031c7386f4Smrgfi
4041c7386f4Smrgif test x$ADMIN_MAN_DIR = x    ; then
4051c7386f4Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
4061c7386f4Smrgfi
4071c7386f4Smrg
4081c7386f4Smrg
4091c7386f4SmrgAC_SUBST([APP_MAN_SUFFIX])
4101c7386f4SmrgAC_SUBST([LIB_MAN_SUFFIX])
4111c7386f4SmrgAC_SUBST([FILE_MAN_SUFFIX])
4121c7386f4SmrgAC_SUBST([MISC_MAN_SUFFIX])
4131c7386f4SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
4141c7386f4SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
4151c7386f4SmrgAC_SUBST([APP_MAN_DIR])
4161c7386f4SmrgAC_SUBST([LIB_MAN_DIR])
4171c7386f4SmrgAC_SUBST([FILE_MAN_DIR])
4181c7386f4SmrgAC_SUBST([MISC_MAN_DIR])
4191c7386f4SmrgAC_SUBST([DRIVER_MAN_DIR])
4201c7386f4SmrgAC_SUBST([ADMIN_MAN_DIR])
4211c7386f4Smrg
4221c7386f4SmrgXORG_MAN_PAGE="X Version 11"
4231c7386f4SmrgAC_SUBST([XORG_MAN_PAGE])
4241c7386f4SmrgMAN_SUBSTS="\
4251c7386f4Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
4261c7386f4Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
4271c7386f4Smrg	-e 's|__xservername__|Xorg|g' \
4281c7386f4Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
4291c7386f4Smrg	-e 's|__projectroot__|\$(prefix)|g' \
4301c7386f4Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
4311c7386f4Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
4321c7386f4Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
4331c7386f4Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
4341c7386f4Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
4351c7386f4Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
4361c7386f4Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
4371c7386f4SmrgAC_SUBST([MAN_SUBSTS])
4381c7386f4Smrg
4391c7386f4Smrg]) # XORG_MANPAGE_SECTIONS
4401c7386f4Smrg
4411c7386f4Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
4421c7386f4Smrg# ------------------------
4431c7386f4Smrg# Minimum version: 1.7.0
4441c7386f4Smrg#
4451c7386f4Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
4461c7386f4Smrg# provided by xorg-sgml-doctools, if installed.
4471c7386f4SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
4481c7386f4SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
4491c7386f4SmrgXORG_SGML_PATH=
4501c7386f4SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
4511c7386f4Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
4521c7386f4Smrg    [m4_ifval([$1],[:],
4531c7386f4Smrg        [if test x"$cross_compiling" != x"yes" ; then
4541c7386f4Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
4551c7386f4Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
4561c7386f4Smrg         fi])
4571c7386f4Smrg    ])
4581c7386f4Smrg
4591c7386f4Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
4601c7386f4Smrg# the path and the name of the doc stylesheet
4611c7386f4Smrgif test "x$XORG_SGML_PATH" != "x" ; then
4621c7386f4Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
4631c7386f4Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
4641c7386f4Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
4651c7386f4Smrgelse
4661c7386f4Smrg   AC_MSG_RESULT([no])
4671c7386f4Smrgfi
4681c7386f4Smrg
4691c7386f4SmrgAC_SUBST(XORG_SGML_PATH)
4701c7386f4SmrgAC_SUBST(STYLESHEET_SRCDIR)
4711c7386f4SmrgAC_SUBST(XSL_STYLESHEET)
4721c7386f4SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
4731c7386f4Smrg]) # XORG_CHECK_SGML_DOCTOOLS
4741c7386f4Smrg
4751c7386f4Smrg# XORG_CHECK_LINUXDOC
4761c7386f4Smrg# -------------------
4771c7386f4Smrg# Minimum version: 1.0.0
4781c7386f4Smrg#
4791c7386f4Smrg# Defines the variable MAKE_TEXT if the necessary tools and
4801c7386f4Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
4811c7386f4Smrg# Whether or not the necessary tools and files are found can be checked
4821c7386f4Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
4831c7386f4SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
4841c7386f4SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
4851c7386f4SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
4861c7386f4Smrg
4871c7386f4SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
4881c7386f4Smrg
4891c7386f4SmrgAC_MSG_CHECKING([whether to build documentation])
4901c7386f4Smrg
4911c7386f4Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
4921c7386f4Smrg   BUILDDOC=yes
4931c7386f4Smrgelse
4941c7386f4Smrg   BUILDDOC=no
4951c7386f4Smrgfi
4961c7386f4Smrg
4971c7386f4SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
4981c7386f4Smrg
4991c7386f4SmrgAC_MSG_RESULT([$BUILDDOC])
5001c7386f4Smrg
5011c7386f4SmrgAC_MSG_CHECKING([whether to build pdf documentation])
5021c7386f4Smrg
5031c7386f4Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
5041c7386f4Smrg   BUILDPDFDOC=yes
5051c7386f4Smrgelse
5061c7386f4Smrg   BUILDPDFDOC=no
5071c7386f4Smrgfi
5081c7386f4Smrg
5091c7386f4SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
5101c7386f4Smrg
5111c7386f4SmrgAC_MSG_RESULT([$BUILDPDFDOC])
5121c7386f4Smrg
5131c7386f4SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
5141c7386f4SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
5151c7386f4SmrgMAKE_PDF="$PS2PDF"
5161c7386f4SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
5171c7386f4Smrg
5181c7386f4SmrgAC_SUBST(MAKE_TEXT)
5191c7386f4SmrgAC_SUBST(MAKE_PS)
5201c7386f4SmrgAC_SUBST(MAKE_PDF)
5211c7386f4SmrgAC_SUBST(MAKE_HTML)
5221c7386f4Smrg]) # XORG_CHECK_LINUXDOC
5231c7386f4Smrg
5241c7386f4Smrg# XORG_CHECK_DOCBOOK
5251c7386f4Smrg# -------------------
5261c7386f4Smrg# Minimum version: 1.0.0
5271c7386f4Smrg#
5281c7386f4Smrg# Checks for the ability to build output formats from SGML DocBook source.
5291c7386f4Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
5301c7386f4Smrg# indicates whether the necessary tools and files are found and, if set,
5311c7386f4Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
5321c7386f4SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
5331c7386f4SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
5341c7386f4Smrg
5351c7386f4SmrgBUILDTXTDOC=no
5361c7386f4SmrgBUILDPDFDOC=no
5371c7386f4SmrgBUILDPSDOC=no
5381c7386f4SmrgBUILDHTMLDOC=no
5391c7386f4Smrg
5401c7386f4SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
5411c7386f4SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
5421c7386f4SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
5431c7386f4SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
5441c7386f4Smrg
5451c7386f4SmrgAC_MSG_CHECKING([whether to build text documentation])
5461c7386f4Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
5471c7386f4Smrg   test x$BUILD_TXTDOC != xno; then
5481c7386f4Smrg	BUILDTXTDOC=yes
5491c7386f4Smrgfi
5501c7386f4SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
5511c7386f4SmrgAC_MSG_RESULT([$BUILDTXTDOC])
5521c7386f4Smrg
5531c7386f4SmrgAC_MSG_CHECKING([whether to build PDF documentation])
5541c7386f4Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
5551c7386f4Smrg   test x$BUILD_PDFDOC != xno; then
5561c7386f4Smrg	BUILDPDFDOC=yes
5571c7386f4Smrgfi
5581c7386f4SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
5591c7386f4SmrgAC_MSG_RESULT([$BUILDPDFDOC])
5601c7386f4Smrg
5611c7386f4SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
5621c7386f4Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
5631c7386f4Smrg   test x$BUILD_PSDOC != xno; then
5641c7386f4Smrg	BUILDPSDOC=yes
5651c7386f4Smrgfi
5661c7386f4SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
5671c7386f4SmrgAC_MSG_RESULT([$BUILDPSDOC])
5681c7386f4Smrg
5691c7386f4SmrgAC_MSG_CHECKING([whether to build HTML documentation])
5701c7386f4Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
5711c7386f4Smrg   test x$BUILD_HTMLDOC != xno; then
5721c7386f4Smrg	BUILDHTMLDOC=yes
5731c7386f4Smrgfi
5741c7386f4SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
5751c7386f4SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
5761c7386f4Smrg
5771c7386f4SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
5781c7386f4SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
5791c7386f4SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
5801c7386f4SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
5811c7386f4Smrg
5821c7386f4SmrgAC_SUBST(MAKE_TEXT)
5831c7386f4SmrgAC_SUBST(MAKE_PS)
5841c7386f4SmrgAC_SUBST(MAKE_PDF)
5851c7386f4SmrgAC_SUBST(MAKE_HTML)
5861c7386f4Smrg]) # XORG_CHECK_DOCBOOK
5871c7386f4Smrg
5881c7386f4Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
5891c7386f4Smrg# ----------------
5901c7386f4Smrg# Minimum version: 1.5.0
5911c7386f4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
5921c7386f4Smrg#
5931c7386f4Smrg# Documentation tools are not always available on all platforms and sometimes
5941c7386f4Smrg# not at the appropriate level. This macro enables a module to test for the
5951c7386f4Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
5961c7386f4Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
5971c7386f4Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
5981c7386f4Smrg# --with-xmlto assumes 'auto'.
5991c7386f4Smrg#
6001c7386f4Smrg# Interface to module:
6011c7386f4Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
6021c7386f4Smrg# XMLTO:	returns the path of the xmlto program found
6031c7386f4Smrg#		returns the path set by the user in the environment
6041c7386f4Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
6051c7386f4Smrg#		'no' user instructs the module not to use xmlto
6061c7386f4Smrg#
6071c7386f4Smrg# Added in version 1.10.0
6081c7386f4Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
6091c7386f4Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
6101c7386f4Smrg#
6111c7386f4Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
6121c7386f4Smrg#
6131c7386f4SmrgAC_DEFUN([XORG_WITH_XMLTO],[
6141c7386f4SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
6151c7386f4Smrgm4_define([_defopt], m4_default([$2], [auto]))
6161c7386f4SmrgAC_ARG_WITH(xmlto,
6171c7386f4Smrg	AS_HELP_STRING([--with-xmlto],
6181c7386f4Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
6191c7386f4Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
6201c7386f4Smrgm4_undefine([_defopt])
6211c7386f4Smrg
6221c7386f4Smrgif test "x$use_xmlto" = x"auto"; then
6231c7386f4Smrg   AC_PATH_PROG([XMLTO], [xmlto])
6241c7386f4Smrg   if test "x$XMLTO" = "x"; then
6251c7386f4Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
6261c7386f4Smrg	have_xmlto=no
6271c7386f4Smrg   else
6281c7386f4Smrg        have_xmlto=yes
6291c7386f4Smrg   fi
6301c7386f4Smrgelif test "x$use_xmlto" = x"yes" ; then
6311c7386f4Smrg   AC_PATH_PROG([XMLTO], [xmlto])
6321c7386f4Smrg   if test "x$XMLTO" = "x"; then
6331c7386f4Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
6341c7386f4Smrg   fi
6351c7386f4Smrg   have_xmlto=yes
6361c7386f4Smrgelif test "x$use_xmlto" = x"no" ; then
6371c7386f4Smrg   if test "x$XMLTO" != "x"; then
6381c7386f4Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
6391c7386f4Smrg   fi
6401c7386f4Smrg   have_xmlto=no
6411c7386f4Smrgelse
6421c7386f4Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
6431c7386f4Smrgfi
6441c7386f4Smrg
6451c7386f4Smrg# Test for a minimum version of xmlto, if provided.
6461c7386f4Smrgm4_ifval([$1],
6471c7386f4Smrg[if test "$have_xmlto" = yes; then
6481c7386f4Smrg    # scrape the xmlto version
6491c7386f4Smrg    AC_MSG_CHECKING([the xmlto version])
6501c7386f4Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
6511c7386f4Smrg    AC_MSG_RESULT([$xmlto_version])
6521c7386f4Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
6531c7386f4Smrg        [if test "x$use_xmlto" = xauto; then
6541c7386f4Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
6551c7386f4Smrg            have_xmlto=no
6561c7386f4Smrg        else
6571c7386f4Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
6581c7386f4Smrg        fi])
6591c7386f4Smrgfi])
6601c7386f4Smrg
6611c7386f4Smrg# Test for the ability of xmlto to generate a text target
6621c7386f4Smrghave_xmlto_text=no
6631c7386f4Smrgcat > conftest.xml << "EOF"
6641c7386f4SmrgEOF
6651c7386f4SmrgAS_IF([test "$have_xmlto" = yes],
6661c7386f4Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
6671c7386f4Smrg             [have_xmlto_text=yes],
6681c7386f4Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
6691c7386f4Smrgrm -f conftest.xml
6701c7386f4SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
6711c7386f4SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
6721c7386f4Smrg]) # XORG_WITH_XMLTO
6731c7386f4Smrg
6741c7386f4Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
6751c7386f4Smrg# --------------------------------------------
6761c7386f4Smrg# Minimum version: 1.12.0
6771c7386f4Smrg# Minimum version for optional DEFAULT argument: 1.12.0
6781c7386f4Smrg#
6791c7386f4Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
6801c7386f4Smrg# XML-based language used for the transformation of XML documents.
6811c7386f4Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
6821c7386f4Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
6831c7386f4Smrg# The XSLT processor is often used as a standalone tool for transformations.
6841c7386f4Smrg# It should not be assumed that this tool is used only to work with documnetation.
6851c7386f4Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
6861c7386f4Smrg#
6871c7386f4Smrg# Interface to module:
6881c7386f4Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
6891c7386f4Smrg# XSLTPROC:	 returns the path of the xsltproc program found
6901c7386f4Smrg#		 returns the path set by the user in the environment
6911c7386f4Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
6921c7386f4Smrg#		  'no' user instructs the module not to use xsltproc
6931c7386f4Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
6941c7386f4Smrg#
6951c7386f4Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
6961c7386f4Smrg#
6971c7386f4SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
6981c7386f4SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
6991c7386f4Smrg# Preserves the interface, should it be implemented later
7001c7386f4Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
7011c7386f4Smrgm4_define([_defopt], m4_default([$2], [auto]))
7021c7386f4SmrgAC_ARG_WITH(xsltproc,
7031c7386f4Smrg	AS_HELP_STRING([--with-xsltproc],
7041c7386f4Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
7051c7386f4Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
7061c7386f4Smrgm4_undefine([_defopt])
7071c7386f4Smrg
7081c7386f4Smrgif test "x$use_xsltproc" = x"auto"; then
7091c7386f4Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
7101c7386f4Smrg   if test "x$XSLTPROC" = "x"; then
7111c7386f4Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
7121c7386f4Smrg	have_xsltproc=no
7131c7386f4Smrg   else
7141c7386f4Smrg        have_xsltproc=yes
7151c7386f4Smrg   fi
7161c7386f4Smrgelif test "x$use_xsltproc" = x"yes" ; then
7171c7386f4Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
7181c7386f4Smrg   if test "x$XSLTPROC" = "x"; then
7191c7386f4Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
7201c7386f4Smrg   fi
7211c7386f4Smrg   have_xsltproc=yes
7221c7386f4Smrgelif test "x$use_xsltproc" = x"no" ; then
7231c7386f4Smrg   if test "x$XSLTPROC" != "x"; then
7241c7386f4Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
7251c7386f4Smrg   fi
7261c7386f4Smrg   have_xsltproc=no
7271c7386f4Smrgelse
7281c7386f4Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
7291c7386f4Smrgfi
7301c7386f4Smrg
7311c7386f4SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
7321c7386f4Smrg]) # XORG_WITH_XSLTPROC
7331c7386f4Smrg
7341c7386f4Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
7351c7386f4Smrg# ----------------------------------------
7361c7386f4Smrg# Minimum version: 1.15.0
7371c7386f4Smrg#
7381c7386f4Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
7391c7386f4Smrg# scanning arbitrary text files, extracting information from those text files,
7401c7386f4Smrg# and printing reports based on that information.
7411c7386f4Smrg#
7421c7386f4Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
7431c7386f4Smrg#
7441c7386f4Smrg# Interface to module:
7451c7386f4Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
7461c7386f4Smrg# PERL:	     returns the path of the perl program found
7471c7386f4Smrg#	     returns the path set by the user in the environment
7481c7386f4Smrg# --with-perl: 'yes' user instructs the module to use perl
7491c7386f4Smrg#	       'no' user instructs the module not to use perl
7501c7386f4Smrg# have_perl: returns yes if perl found in PATH or no
7511c7386f4Smrg#
7521c7386f4Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
7531c7386f4Smrg#
7541c7386f4SmrgAC_DEFUN([XORG_WITH_PERL],[
7551c7386f4SmrgAC_ARG_VAR([PERL], [Path to perl command])
7561c7386f4Smrg# Preserves the interface, should it be implemented later
7571c7386f4Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
7581c7386f4Smrgm4_define([_defopt], m4_default([$2], [auto]))
7591c7386f4SmrgAC_ARG_WITH(perl,
7601c7386f4Smrg	AS_HELP_STRING([--with-perl],
7611c7386f4Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
7621c7386f4Smrg	   [use_perl=$withval], [use_perl=]_defopt)
7631c7386f4Smrgm4_undefine([_defopt])
7641c7386f4Smrg
7651c7386f4Smrgif test "x$use_perl" = x"auto"; then
7661c7386f4Smrg   AC_PATH_PROG([PERL], [perl])
7671c7386f4Smrg   if test "x$PERL" = "x"; then
7681c7386f4Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
7691c7386f4Smrg	have_perl=no
7701c7386f4Smrg   else
7711c7386f4Smrg        have_perl=yes
7721c7386f4Smrg   fi
7731c7386f4Smrgelif test "x$use_perl" = x"yes" ; then
7741c7386f4Smrg   AC_PATH_PROG([PERL], [perl])
7751c7386f4Smrg   if test "x$PERL" = "x"; then
7761c7386f4Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
7771c7386f4Smrg   fi
7781c7386f4Smrg   have_perl=yes
7791c7386f4Smrgelif test "x$use_perl" = x"no" ; then
7801c7386f4Smrg   if test "x$PERL" != "x"; then
7811c7386f4Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
7821c7386f4Smrg   fi
7831c7386f4Smrg   have_perl=no
7841c7386f4Smrgelse
7851c7386f4Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
7861c7386f4Smrgfi
7871c7386f4Smrg
7881c7386f4SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
7891c7386f4Smrg]) # XORG_WITH_PERL
7901c7386f4Smrg
7911c7386f4Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
7921c7386f4Smrg# ----------------
7931c7386f4Smrg# Minimum version: 1.5.0
7941c7386f4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
7951c7386f4Smrg#
7961c7386f4Smrg# Documentation tools are not always available on all platforms and sometimes
7971c7386f4Smrg# not at the appropriate level. This macro enables a module to test for the
7981c7386f4Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
7991c7386f4Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
8001c7386f4Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
8011c7386f4Smrg# --with-asciidoc assumes 'auto'.
8021c7386f4Smrg#
8031c7386f4Smrg# Interface to module:
8041c7386f4Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
8051c7386f4Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
8061c7386f4Smrg#		 returns the path set by the user in the environment
8071c7386f4Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
8081c7386f4Smrg#		  'no' user instructs the module not to use asciidoc
8091c7386f4Smrg#
8101c7386f4Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
8111c7386f4Smrg#
8121c7386f4SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
8131c7386f4SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
8141c7386f4Smrgm4_define([_defopt], m4_default([$2], [auto]))
8151c7386f4SmrgAC_ARG_WITH(asciidoc,
8161c7386f4Smrg	AS_HELP_STRING([--with-asciidoc],
8171c7386f4Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
8181c7386f4Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
8191c7386f4Smrgm4_undefine([_defopt])
8201c7386f4Smrg
8211c7386f4Smrgif test "x$use_asciidoc" = x"auto"; then
8221c7386f4Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
8231c7386f4Smrg   if test "x$ASCIIDOC" = "x"; then
8241c7386f4Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
8251c7386f4Smrg	have_asciidoc=no
8261c7386f4Smrg   else
8271c7386f4Smrg        have_asciidoc=yes
8281c7386f4Smrg   fi
8291c7386f4Smrgelif test "x$use_asciidoc" = x"yes" ; then
8301c7386f4Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
8311c7386f4Smrg   if test "x$ASCIIDOC" = "x"; then
8321c7386f4Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
8331c7386f4Smrg   fi
8341c7386f4Smrg   have_asciidoc=yes
8351c7386f4Smrgelif test "x$use_asciidoc" = x"no" ; then
8361c7386f4Smrg   if test "x$ASCIIDOC" != "x"; then
8371c7386f4Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
8381c7386f4Smrg   fi
8391c7386f4Smrg   have_asciidoc=no
8401c7386f4Smrgelse
8411c7386f4Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
8421c7386f4Smrgfi
8431c7386f4Smrgm4_ifval([$1],
8441c7386f4Smrg[if test "$have_asciidoc" = yes; then
8451c7386f4Smrg    # scrape the asciidoc version
8461c7386f4Smrg    AC_MSG_CHECKING([the asciidoc version])
8471c7386f4Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
8481c7386f4Smrg    AC_MSG_RESULT([$asciidoc_version])
8491c7386f4Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
8501c7386f4Smrg        [if test "x$use_asciidoc" = xauto; then
8511c7386f4Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
8521c7386f4Smrg            have_asciidoc=no
8531c7386f4Smrg        else
8541c7386f4Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
8551c7386f4Smrg        fi])
8561c7386f4Smrgfi])
8571c7386f4SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
8581c7386f4Smrg]) # XORG_WITH_ASCIIDOC
8591c7386f4Smrg
8601c7386f4Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
8611c7386f4Smrg# -------------------------------------------
8621c7386f4Smrg# Minimum version: 1.5.0
8631c7386f4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
8641c7386f4Smrg# Minimum version for optional DOT checking: 1.18.0
8651c7386f4Smrg#
8661c7386f4Smrg# Documentation tools are not always available on all platforms and sometimes
8671c7386f4Smrg# not at the appropriate level. This macro enables a module to test for the
8681c7386f4Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8691c7386f4Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
8701c7386f4Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
8711c7386f4Smrg# --with-doxygen assumes 'auto'.
8721c7386f4Smrg#
8731c7386f4Smrg# Interface to module:
8741c7386f4Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
8751c7386f4Smrg# DOXYGEN:	 returns the path of the doxygen program found
8761c7386f4Smrg#		 returns the path set by the user in the environment
8771c7386f4Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
8781c7386f4Smrg#		  'no' user instructs the module not to use doxygen
8791c7386f4Smrg#
8801c7386f4Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
8811c7386f4Smrg#
8821c7386f4SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
8831c7386f4SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
8841c7386f4SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
8851c7386f4Smrgm4_define([_defopt], m4_default([$2], [auto]))
8861c7386f4SmrgAC_ARG_WITH(doxygen,
8871c7386f4Smrg	AS_HELP_STRING([--with-doxygen],
8881c7386f4Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
8891c7386f4Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
8901c7386f4Smrgm4_undefine([_defopt])
8911c7386f4Smrg
8921c7386f4Smrgif test "x$use_doxygen" = x"auto"; then
8931c7386f4Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
8941c7386f4Smrg   if test "x$DOXYGEN" = "x"; then
8951c7386f4Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
8961c7386f4Smrg	have_doxygen=no
8971c7386f4Smrg   else
8981c7386f4Smrg        have_doxygen=yes
8991c7386f4Smrg   fi
9001c7386f4Smrgelif test "x$use_doxygen" = x"yes" ; then
9011c7386f4Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9021c7386f4Smrg   if test "x$DOXYGEN" = "x"; then
9031c7386f4Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
9041c7386f4Smrg   fi
9051c7386f4Smrg   have_doxygen=yes
9061c7386f4Smrgelif test "x$use_doxygen" = x"no" ; then
9071c7386f4Smrg   if test "x$DOXYGEN" != "x"; then
9081c7386f4Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
9091c7386f4Smrg   fi
9101c7386f4Smrg   have_doxygen=no
9111c7386f4Smrgelse
9121c7386f4Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
9131c7386f4Smrgfi
9141c7386f4Smrgm4_ifval([$1],
9151c7386f4Smrg[if test "$have_doxygen" = yes; then
9161c7386f4Smrg    # scrape the doxygen version
9171c7386f4Smrg    AC_MSG_CHECKING([the doxygen version])
9181c7386f4Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
9191c7386f4Smrg    AC_MSG_RESULT([$doxygen_version])
9201c7386f4Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
9211c7386f4Smrg        [if test "x$use_doxygen" = xauto; then
9221c7386f4Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
9231c7386f4Smrg            have_doxygen=no
9241c7386f4Smrg        else
9251c7386f4Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
9261c7386f4Smrg        fi])
9271c7386f4Smrgfi])
9281c7386f4Smrg
9291c7386f4Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
9301c7386f4Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
9311c7386f4Smrgdnl 	HAVE_DOT = @HAVE_DOT@
9321c7386f4SmrgHAVE_DOT=no
9331c7386f4Smrgif test "x$have_doxygen" = "xyes"; then
9341c7386f4Smrg  AC_PATH_PROG([DOT], [dot])
9351c7386f4Smrg    if test "x$DOT" != "x"; then
9361c7386f4Smrg      HAVE_DOT=yes
9371c7386f4Smrg    fi
9381c7386f4Smrgfi
9391c7386f4Smrg
9401c7386f4SmrgAC_SUBST([HAVE_DOT])
9411c7386f4SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
9421c7386f4SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
9431c7386f4Smrg]) # XORG_WITH_DOXYGEN
9441c7386f4Smrg
9451c7386f4Smrg# XORG_WITH_GROFF([DEFAULT])
9461c7386f4Smrg# ----------------
9471c7386f4Smrg# Minimum version: 1.6.0
9481c7386f4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9491c7386f4Smrg#
9501c7386f4Smrg# Documentation tools are not always available on all platforms and sometimes
9511c7386f4Smrg# not at the appropriate level. This macro enables a module to test for the
9521c7386f4Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9531c7386f4Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
9541c7386f4Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
9551c7386f4Smrg# --with-groff assumes 'auto'.
9561c7386f4Smrg#
9571c7386f4Smrg# Interface to module:
9581c7386f4Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
9591c7386f4Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
9601c7386f4Smrg# HAVE_GROFF_MS: the -ms macros package
9611c7386f4Smrg# GROFF:	 returns the path of the groff program found
9621c7386f4Smrg#		 returns the path set by the user in the environment
9631c7386f4Smrg# --with-groff:	 'yes' user instructs the module to use groff
9641c7386f4Smrg#		 'no' user instructs the module not to use groff
9651c7386f4Smrg#
9661c7386f4Smrg# Added in version 1.9.0:
9671c7386f4Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
9681c7386f4Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
9691c7386f4Smrg#		   psselect from the psutils package.
9701c7386f4Smrg#		   the ghostcript package. Refer to the grohtml man pages
9711c7386f4Smrg#
9721c7386f4Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
9731c7386f4Smrg#
9741c7386f4Smrg# OS and distros often splits groff in a basic and full package, the former
9751c7386f4Smrg# having the groff program and the later having devices, fonts and macros
9761c7386f4Smrg# Checking for the groff executable is not enough.
9771c7386f4Smrg#
9781c7386f4Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
9791c7386f4Smrg# unset HAVE_GROFF or GROFF env variables.
9801c7386f4Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
9811c7386f4Smrg#
9821c7386f4SmrgAC_DEFUN([XORG_WITH_GROFF],[
9831c7386f4SmrgAC_ARG_VAR([GROFF], [Path to groff command])
9841c7386f4Smrgm4_define([_defopt], m4_default([$1], [auto]))
9851c7386f4SmrgAC_ARG_WITH(groff,
9861c7386f4Smrg	AS_HELP_STRING([--with-groff],
9871c7386f4Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
9881c7386f4Smrg	   [use_groff=$withval], [use_groff=]_defopt)
9891c7386f4Smrgm4_undefine([_defopt])
9901c7386f4Smrg
9911c7386f4Smrgif test "x$use_groff" = x"auto"; then
9921c7386f4Smrg   AC_PATH_PROG([GROFF], [groff])
9931c7386f4Smrg   if test "x$GROFF" = "x"; then
9941c7386f4Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
9951c7386f4Smrg	have_groff=no
9961c7386f4Smrg   else
9971c7386f4Smrg        have_groff=yes
9981c7386f4Smrg   fi
9991c7386f4Smrgelif test "x$use_groff" = x"yes" ; then
10001c7386f4Smrg   AC_PATH_PROG([GROFF], [groff])
10011c7386f4Smrg   if test "x$GROFF" = "x"; then
10021c7386f4Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10031c7386f4Smrg   fi
10041c7386f4Smrg   have_groff=yes
10051c7386f4Smrgelif test "x$use_groff" = x"no" ; then
10061c7386f4Smrg   if test "x$GROFF" != "x"; then
10071c7386f4Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10081c7386f4Smrg   fi
10091c7386f4Smrg   have_groff=no
10101c7386f4Smrgelse
10111c7386f4Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10121c7386f4Smrgfi
10131c7386f4Smrg
10141c7386f4Smrg# We have groff, test for the presence of the macro packages
10151c7386f4Smrgif test "x$have_groff" = x"yes"; then
10161c7386f4Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10171c7386f4Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10181c7386f4Smrg        groff_ms_works=yes
10191c7386f4Smrg    else
10201c7386f4Smrg        groff_ms_works=no
10211c7386f4Smrg    fi
10221c7386f4Smrg    AC_MSG_RESULT([$groff_ms_works])
10231c7386f4Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10241c7386f4Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10251c7386f4Smrg        groff_mm_works=yes
10261c7386f4Smrg    else
10271c7386f4Smrg        groff_mm_works=no
10281c7386f4Smrg    fi
10291c7386f4Smrg    AC_MSG_RESULT([$groff_mm_works])
10301c7386f4Smrgfi
10311c7386f4Smrg
10321c7386f4Smrg# We have groff, test for HTML dependencies, one command per package
10331c7386f4Smrgif test "x$have_groff" = x"yes"; then
10341c7386f4Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10351c7386f4Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10361c7386f4Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10371c7386f4Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10381c7386f4Smrg      have_groff_html=yes
10391c7386f4Smrg   else
10401c7386f4Smrg      have_groff_html=no
10411c7386f4Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10421c7386f4Smrg   fi
10431c7386f4Smrgfi
10441c7386f4Smrg
10451c7386f4Smrg# Set Automake conditionals for Makefiles
10461c7386f4SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10471c7386f4SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10481c7386f4SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10491c7386f4SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10501c7386f4Smrg]) # XORG_WITH_GROFF
10511c7386f4Smrg
10521c7386f4Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10531c7386f4Smrg# ---------------------------------------
10541c7386f4Smrg# Minimum version: 1.6.0
10551c7386f4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10561c7386f4Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
10571c7386f4Smrg#
10581c7386f4Smrg# Documentation tools are not always available on all platforms and sometimes
10591c7386f4Smrg# not at the appropriate level. This macro enables a module to test for the
10601c7386f4Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10611c7386f4Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
10621c7386f4Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
10631c7386f4Smrg# --with-fop assumes 'auto'.
10641c7386f4Smrg#
10651c7386f4Smrg# Interface to module:
10661c7386f4Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10671c7386f4Smrg# FOP:	 	returns the path of the fop program found
10681c7386f4Smrg#		returns the path set by the user in the environment
10691c7386f4Smrg# --with-fop: 	'yes' user instructs the module to use fop
10701c7386f4Smrg#		'no' user instructs the module not to use fop
10711c7386f4Smrg#
10721c7386f4Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10731c7386f4Smrg#
10741c7386f4SmrgAC_DEFUN([XORG_WITH_FOP],[
10751c7386f4SmrgAC_ARG_VAR([FOP], [Path to fop command])
10761c7386f4Smrgm4_define([_defopt], m4_default([$2], [auto]))
10771c7386f4SmrgAC_ARG_WITH(fop,
10781c7386f4Smrg	AS_HELP_STRING([--with-fop],
10791c7386f4Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10801c7386f4Smrg	   [use_fop=$withval], [use_fop=]_defopt)
10811c7386f4Smrgm4_undefine([_defopt])
10821c7386f4Smrg
10831c7386f4Smrgif test "x$use_fop" = x"auto"; then
10841c7386f4Smrg   AC_PATH_PROG([FOP], [fop])
10851c7386f4Smrg   if test "x$FOP" = "x"; then
10861c7386f4Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10871c7386f4Smrg	have_fop=no
10881c7386f4Smrg   else
10891c7386f4Smrg        have_fop=yes
10901c7386f4Smrg   fi
10911c7386f4Smrgelif test "x$use_fop" = x"yes" ; then
10921c7386f4Smrg   AC_PATH_PROG([FOP], [fop])
10931c7386f4Smrg   if test "x$FOP" = "x"; then
10941c7386f4Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10951c7386f4Smrg   fi
10961c7386f4Smrg   have_fop=yes
10971c7386f4Smrgelif test "x$use_fop" = x"no" ; then
10981c7386f4Smrg   if test "x$FOP" != "x"; then
10991c7386f4Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
11001c7386f4Smrg   fi
11011c7386f4Smrg   have_fop=no
11021c7386f4Smrgelse
11031c7386f4Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
11041c7386f4Smrgfi
11051c7386f4Smrg
11061c7386f4Smrg# Test for a minimum version of fop, if provided.
11071c7386f4Smrgm4_ifval([$1],
11081c7386f4Smrg[if test "$have_fop" = yes; then
11091c7386f4Smrg    # scrape the fop version
11101c7386f4Smrg    AC_MSG_CHECKING([for fop minimum version])
11111c7386f4Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
11121c7386f4Smrg    AC_MSG_RESULT([$fop_version])
11131c7386f4Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
11141c7386f4Smrg        [if test "x$use_fop" = xauto; then
11151c7386f4Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
11161c7386f4Smrg            have_fop=no
11171c7386f4Smrg        else
11181c7386f4Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
11191c7386f4Smrg        fi])
11201c7386f4Smrgfi])
11211c7386f4SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
11221c7386f4Smrg]) # XORG_WITH_FOP
11231c7386f4Smrg
11241c7386f4Smrg# XORG_WITH_M4([MIN-VERSION])
11251c7386f4Smrg# ---------------------------
11261c7386f4Smrg# Minimum version: 1.19.0
11271c7386f4Smrg#
11281c7386f4Smrg# This macro attempts to locate an m4 macro processor which supports
11291c7386f4Smrg# -I option and is only useful for modules relying on M4 in order to
11301c7386f4Smrg# expand macros in source code files.
11311c7386f4Smrg#
11321c7386f4Smrg# Interface to module:
11331c7386f4Smrg# M4:	 	returns the path of the m4 program found
11341c7386f4Smrg#		returns the path set by the user in the environment
11351c7386f4Smrg#
11361c7386f4SmrgAC_DEFUN([XORG_WITH_M4], [
11371c7386f4SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
11381c7386f4Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
11391c7386f4Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
11401c7386f4Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
11411c7386f4Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
11421c7386f4Smrg   [$PATH:/usr/gnu/bin])])
11431c7386f4Smrg
11441c7386f4SmrgAC_SUBST([M4], [$ac_cv_path_M4])
11451c7386f4Smrg]) # XORG_WITH_M4
11461c7386f4Smrg
11471c7386f4Smrg# XORG_WITH_PS2PDF([DEFAULT])
11481c7386f4Smrg# ----------------
11491c7386f4Smrg# Minimum version: 1.6.0
11501c7386f4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
11511c7386f4Smrg#
11521c7386f4Smrg# Documentation tools are not always available on all platforms and sometimes
11531c7386f4Smrg# not at the appropriate level. This macro enables a module to test for the
11541c7386f4Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
11551c7386f4Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
11561c7386f4Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
11571c7386f4Smrg# --with-ps2pdf assumes 'auto'.
11581c7386f4Smrg#
11591c7386f4Smrg# Interface to module:
11601c7386f4Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
11611c7386f4Smrg# PS2PDF:	returns the path of the ps2pdf program found
11621c7386f4Smrg#		returns the path set by the user in the environment
11631c7386f4Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
11641c7386f4Smrg#		 'no' user instructs the module not to use ps2pdf
11651c7386f4Smrg#
11661c7386f4Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
11671c7386f4Smrg#
11681c7386f4SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
11691c7386f4SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
11701c7386f4Smrgm4_define([_defopt], m4_default([$1], [auto]))
11711c7386f4SmrgAC_ARG_WITH(ps2pdf,
11721c7386f4Smrg	AS_HELP_STRING([--with-ps2pdf],
11731c7386f4Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
11741c7386f4Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
11751c7386f4Smrgm4_undefine([_defopt])
11761c7386f4Smrg
11771c7386f4Smrgif test "x$use_ps2pdf" = x"auto"; then
11781c7386f4Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
11791c7386f4Smrg   if test "x$PS2PDF" = "x"; then
11801c7386f4Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
11811c7386f4Smrg	have_ps2pdf=no
11821c7386f4Smrg   else
11831c7386f4Smrg        have_ps2pdf=yes
11841c7386f4Smrg   fi
11851c7386f4Smrgelif test "x$use_ps2pdf" = x"yes" ; then
11861c7386f4Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
11871c7386f4Smrg   if test "x$PS2PDF" = "x"; then
11881c7386f4Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
11891c7386f4Smrg   fi
11901c7386f4Smrg   have_ps2pdf=yes
11911c7386f4Smrgelif test "x$use_ps2pdf" = x"no" ; then
11921c7386f4Smrg   if test "x$PS2PDF" != "x"; then
11931c7386f4Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
11941c7386f4Smrg   fi
11951c7386f4Smrg   have_ps2pdf=no
11961c7386f4Smrgelse
11971c7386f4Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
11981c7386f4Smrgfi
11991c7386f4SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
12001c7386f4Smrg]) # XORG_WITH_PS2PDF
12011c7386f4Smrg
12021c7386f4Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
12031c7386f4Smrg# ----------------
12041c7386f4Smrg# Minimum version: 1.6.0
12051c7386f4Smrg#
12061c7386f4Smrg# Documentation tools are not always available on all platforms and sometimes
12071c7386f4Smrg# not at the appropriate level. This macro enables a builder to skip all
12081c7386f4Smrg# documentation targets except traditional man pages.
12091c7386f4Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
12101c7386f4Smrg# maximum flexibilty in controlling documentation building.
12111c7386f4Smrg# Refer to:
12121c7386f4Smrg# XORG_WITH_XMLTO         --with-xmlto
12131c7386f4Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
12141c7386f4Smrg# XORG_WITH_DOXYGEN       --with-doxygen
12151c7386f4Smrg# XORG_WITH_FOP           --with-fop
12161c7386f4Smrg# XORG_WITH_GROFF         --with-groff
12171c7386f4Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
12181c7386f4Smrg#
12191c7386f4Smrg# Interface to module:
12201c7386f4Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
12211c7386f4Smrg# --enable-docs: 'yes' user instructs the module to generate docs
12221c7386f4Smrg#		 'no' user instructs the module not to generate docs
12231c7386f4Smrg# parm1:	specify the default value, yes or no.
12241c7386f4Smrg#
12251c7386f4SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
12261c7386f4Smrgm4_define([docs_default], m4_default([$1], [yes]))
12271c7386f4SmrgAC_ARG_ENABLE(docs,
12281c7386f4Smrg	AS_HELP_STRING([--enable-docs],
12291c7386f4Smrg	   [Enable building the documentation (default: ]docs_default[)]),
12301c7386f4Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
12311c7386f4Smrgm4_undefine([docs_default])
12321c7386f4SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
12331c7386f4SmrgAC_MSG_CHECKING([whether to build documentation])
12341c7386f4SmrgAC_MSG_RESULT([$build_docs])
12351c7386f4Smrg]) # XORG_ENABLE_DOCS
12361c7386f4Smrg
12371c7386f4Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
12381c7386f4Smrg# ----------------
12391c7386f4Smrg# Minimum version: 1.6.0
12401c7386f4Smrg#
12411c7386f4Smrg# This macro enables a builder to skip all developer documentation.
12421c7386f4Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
12431c7386f4Smrg# maximum flexibilty in controlling documentation building.
12441c7386f4Smrg# Refer to:
12451c7386f4Smrg# XORG_WITH_XMLTO         --with-xmlto
12461c7386f4Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
12471c7386f4Smrg# XORG_WITH_DOXYGEN       --with-doxygen
12481c7386f4Smrg# XORG_WITH_FOP           --with-fop
12491c7386f4Smrg# XORG_WITH_GROFF         --with-groff
12501c7386f4Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
12511c7386f4Smrg#
12521c7386f4Smrg# Interface to module:
12531c7386f4Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
12541c7386f4Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
12551c7386f4Smrg#			'no' user instructs the module not to generate developer docs
12561c7386f4Smrg# parm1:		specify the default value, yes or no.
12571c7386f4Smrg#
12581c7386f4SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
12591c7386f4Smrgm4_define([devel_default], m4_default([$1], [yes]))
12601c7386f4SmrgAC_ARG_ENABLE(devel-docs,
12611c7386f4Smrg	AS_HELP_STRING([--enable-devel-docs],
12621c7386f4Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
12631c7386f4Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
12641c7386f4Smrgm4_undefine([devel_default])
12651c7386f4SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
12661c7386f4SmrgAC_MSG_CHECKING([whether to build developer documentation])
12671c7386f4SmrgAC_MSG_RESULT([$build_devel_docs])
12681c7386f4Smrg]) # XORG_ENABLE_DEVEL_DOCS
12691c7386f4Smrg
12701c7386f4Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
12711c7386f4Smrg# ----------------
12721c7386f4Smrg# Minimum version: 1.6.0
12731c7386f4Smrg#
12741c7386f4Smrg# This macro enables a builder to skip all functional specification targets.
12751c7386f4Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
12761c7386f4Smrg# maximum flexibilty in controlling documentation building.
12771c7386f4Smrg# Refer to:
12781c7386f4Smrg# XORG_WITH_XMLTO         --with-xmlto
12791c7386f4Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
12801c7386f4Smrg# XORG_WITH_DOXYGEN       --with-doxygen
12811c7386f4Smrg# XORG_WITH_FOP           --with-fop
12821c7386f4Smrg# XORG_WITH_GROFF         --with-groff
12831c7386f4Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
12841c7386f4Smrg#
12851c7386f4Smrg# Interface to module:
12861c7386f4Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
12871c7386f4Smrg# --enable-specs:	'yes' user instructs the module to generate specs
12881c7386f4Smrg#			'no' user instructs the module not to generate specs
12891c7386f4Smrg# parm1:		specify the default value, yes or no.
12901c7386f4Smrg#
12911c7386f4SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
12921c7386f4Smrgm4_define([spec_default], m4_default([$1], [yes]))
12931c7386f4SmrgAC_ARG_ENABLE(specs,
12941c7386f4Smrg	AS_HELP_STRING([--enable-specs],
12951c7386f4Smrg	   [Enable building the specs (default: ]spec_default[)]),
12961c7386f4Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
12971c7386f4Smrgm4_undefine([spec_default])
12981c7386f4SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
12991c7386f4SmrgAC_MSG_CHECKING([whether to build functional specifications])
13001c7386f4SmrgAC_MSG_RESULT([$build_specs])
13011c7386f4Smrg]) # XORG_ENABLE_SPECS
13021c7386f4Smrg
13031c7386f4Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
13041c7386f4Smrg# ----------------------------------------------
13051c7386f4Smrg# Minimum version: 1.13.0
13061c7386f4Smrg#
13071c7386f4Smrg# This macro enables a builder to enable/disable unit testing
13081c7386f4Smrg# It makes no assumption about the test cases implementation
13091c7386f4Smrg# Test cases may or may not use Automake "Support for test suites"
13101c7386f4Smrg# They may or may not use the software utility library GLib
13111c7386f4Smrg#
13121c7386f4Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
13131c7386f4Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
13141c7386f4Smrg# The variable enable_unit_tests is used by other macros in this file.
13151c7386f4Smrg#
13161c7386f4Smrg# Interface to module:
13171c7386f4Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
13181c7386f4Smrg# enable_unit_tests:    used in configure.ac for additional configuration
13191c7386f4Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
13201c7386f4Smrg#			'no' user instructs the module not to build tests
13211c7386f4Smrg# parm1:		specify the default value, yes or no.
13221c7386f4Smrg#
13231c7386f4SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
13241c7386f4SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
13251c7386f4SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
13261c7386f4SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
13271c7386f4Smrgm4_define([_defopt], m4_default([$1], [auto]))
13281c7386f4SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
13291c7386f4Smrg	[Enable building unit test cases (default: ]_defopt[)]),
13301c7386f4Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
13311c7386f4Smrgm4_undefine([_defopt])
13321c7386f4SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
13331c7386f4SmrgAC_MSG_CHECKING([whether to build unit test cases])
13341c7386f4SmrgAC_MSG_RESULT([$enable_unit_tests])
13351c7386f4Smrg]) # XORG_ENABLE_UNIT_TESTS
13361c7386f4Smrg
13371c7386f4Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
13381c7386f4Smrg# ------------------------------------------------------
13391c7386f4Smrg# Minimum version: 1.17.0
13401c7386f4Smrg#
13411c7386f4Smrg# This macro enables a builder to enable/disable integration testing
13421c7386f4Smrg# It makes no assumption about the test cases' implementation
13431c7386f4Smrg# Test cases may or may not use Automake "Support for test suites"
13441c7386f4Smrg#
13451c7386f4Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
13461c7386f4Smrg# usually requires less dependencies and may be built and run under less
13471c7386f4Smrg# stringent environments than integration tests.
13481c7386f4Smrg#
13491c7386f4Smrg# Interface to module:
13501c7386f4Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
13511c7386f4Smrg# enable_integration_tests:   used in configure.ac for additional configuration
13521c7386f4Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
13531c7386f4Smrg#                             'no' user instructs the module not to build tests
13541c7386f4Smrg# parm1:                      specify the default value, yes or no.
13551c7386f4Smrg#
13561c7386f4SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
13571c7386f4SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
13581c7386f4Smrgm4_define([_defopt], m4_default([$1], [auto]))
13591c7386f4SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
13601c7386f4Smrg	[Enable building integration test cases (default: ]_defopt[)]),
13611c7386f4Smrg	[enable_integration_tests=$enableval],
13621c7386f4Smrg	[enable_integration_tests=]_defopt)
13631c7386f4Smrgm4_undefine([_defopt])
13641c7386f4SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
13651c7386f4Smrg	[test "x$enable_integration_tests" != xno])
13661c7386f4SmrgAC_MSG_CHECKING([whether to build unit test cases])
13671c7386f4SmrgAC_MSG_RESULT([$enable_integration_tests])
13681c7386f4Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
13691c7386f4Smrg
13701c7386f4Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
13711c7386f4Smrg# ----------------------------------------
13721c7386f4Smrg# Minimum version: 1.13.0
13731c7386f4Smrg#
13741c7386f4Smrg# GLib is a library which provides advanced data structures and functions.
13751c7386f4Smrg# This macro enables a module to test for the presence of Glib.
13761c7386f4Smrg#
13771c7386f4Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
13781c7386f4Smrg# Otherwise the value of $enable_unit_tests is blank.
13791c7386f4Smrg#
13801c7386f4Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
13811c7386f4Smrg# test support usually requires less dependencies and may be built and run under
13821c7386f4Smrg# less stringent environments than integration tests.
13831c7386f4Smrg#
13841c7386f4Smrg# Interface to module:
13851c7386f4Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
13861c7386f4Smrg# with_glib: used in configure.ac to know if GLib has been found
13871c7386f4Smrg# --with-glib:	'yes' user instructs the module to use glib
13881c7386f4Smrg#		'no' user instructs the module not to use glib
13891c7386f4Smrg#
13901c7386f4SmrgAC_DEFUN([XORG_WITH_GLIB],[
13911c7386f4SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
13921c7386f4Smrgm4_define([_defopt], m4_default([$2], [auto]))
13931c7386f4SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
13941c7386f4Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
13951c7386f4Smrg	[with_glib=$withval], [with_glib=]_defopt)
13961c7386f4Smrgm4_undefine([_defopt])
13971c7386f4Smrg
13981c7386f4Smrghave_glib=no
13991c7386f4Smrg# Do not probe GLib if user explicitly disabled unit testing
14001c7386f4Smrgif test "x$enable_unit_tests" != x"no"; then
14011c7386f4Smrg  # Do not probe GLib if user explicitly disabled it
14021c7386f4Smrg  if test "x$with_glib" != x"no"; then
14031c7386f4Smrg    m4_ifval(
14041c7386f4Smrg      [$1],
14051c7386f4Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
14061c7386f4Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
14071c7386f4Smrg    )
14081c7386f4Smrg  fi
14091c7386f4Smrgfi
14101c7386f4Smrg
14111c7386f4Smrg# Not having GLib when unit testing has been explicitly requested is an error
14121c7386f4Smrgif test "x$enable_unit_tests" = x"yes"; then
14131c7386f4Smrg  if test "x$have_glib" = x"no"; then
14141c7386f4Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
14151c7386f4Smrg  fi
14161c7386f4Smrgfi
14171c7386f4Smrg
14181c7386f4Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
14191c7386f4Smrgif test "x$enable_unit_tests" = x"no"; then
14201c7386f4Smrg  if test "x$with_glib" = x"yes"; then
14211c7386f4Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
14221c7386f4Smrg  fi
14231c7386f4Smrgfi
14241c7386f4Smrg
14251c7386f4Smrg# Not having GLib when it has been explicitly requested is an error
14261c7386f4Smrgif test "x$with_glib" = x"yes"; then
14271c7386f4Smrg  if test "x$have_glib" = x"no"; then
14281c7386f4Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
14291c7386f4Smrg  fi
14301c7386f4Smrgfi
14311c7386f4Smrg
14321c7386f4SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
14331c7386f4Smrg]) # XORG_WITH_GLIB
14341c7386f4Smrg
14351c7386f4Smrg# XORG_LD_WRAP([required|optional])
14361c7386f4Smrg# ---------------------------------
14371c7386f4Smrg# Minimum version: 1.13.0
14381c7386f4Smrg#
14391c7386f4Smrg# Check if linker supports -wrap, passed via compiler flags
14401c7386f4Smrg#
14411c7386f4Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
14421c7386f4Smrg# Otherwise the value of $enable_unit_tests is blank.
14431c7386f4Smrg#
14441c7386f4Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
14451c7386f4Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
14461c7386f4Smrg# available, an argument of "optional" allows use when some unit tests require
14471c7386f4Smrg# ld -wrap and others do not.
14481c7386f4Smrg#
14491c7386f4SmrgAC_DEFUN([XORG_LD_WRAP],[
14501c7386f4SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
14511c7386f4Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
14521c7386f4Smrg                      void __wrap_exit(int status) { return; }],
14531c7386f4Smrg                     [exit(0);])])
14541c7386f4Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
14551c7386f4Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
14561c7386f4Smrg  if test "x$have_ld_wrap" = x"no"; then
14571c7386f4Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
14581c7386f4Smrg  fi
14591c7386f4Smrgfi
14601c7386f4SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
14611c7386f4Smrg#
14621c7386f4Smrg]) # XORG_LD_WRAP
14631c7386f4Smrg
14641c7386f4Smrg# XORG_CHECK_LINKER_FLAGS
14651c7386f4Smrg# -----------------------
14661c7386f4Smrg# SYNOPSIS
14671c7386f4Smrg#
14681c7386f4Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
14691c7386f4Smrg#
14701c7386f4Smrg# DESCRIPTION
14711c7386f4Smrg#
14721c7386f4Smrg#   Check whether the given linker FLAGS work with the current language's
14731c7386f4Smrg#   linker, or whether they give an error.
14741c7386f4Smrg#
14751c7386f4Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
14761c7386f4Smrg#   success/failure.
14771c7386f4Smrg#
14781c7386f4Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
14791c7386f4Smrg#
14801c7386f4Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
14811c7386f4Smrg#
14821c7386f4Smrg# LICENSE
14831c7386f4Smrg#
14841c7386f4Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
14851c7386f4Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
14861c7386f4Smrg#   Copyright (c) 2009 Matteo Frigo
14871c7386f4Smrg#
14881c7386f4Smrg#   This program is free software: you can redistribute it and/or modify it
14891c7386f4Smrg#   under the terms of the GNU General Public License as published by the
14901c7386f4Smrg#   Free Software Foundation, either version 3 of the License, or (at your
14911c7386f4Smrg#   option) any later version.
14921c7386f4Smrg#
14931c7386f4Smrg#   This program is distributed in the hope that it will be useful, but
14941c7386f4Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
14951c7386f4Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
14961c7386f4Smrg#   Public License for more details.
14971c7386f4Smrg#
14981c7386f4Smrg#   You should have received a copy of the GNU General Public License along
14991c7386f4Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
15001c7386f4Smrg#
15011c7386f4Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
15021c7386f4Smrg#   gives unlimited permission to copy, distribute and modify the configure
15031c7386f4Smrg#   scripts that are the output of Autoconf when processing the Macro. You
15041c7386f4Smrg#   need not follow the terms of the GNU General Public License when using
15051c7386f4Smrg#   or distributing such scripts, even though portions of the text of the
15061c7386f4Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
15071c7386f4Smrg#   all other use of the material that constitutes the Autoconf Macro.
15081c7386f4Smrg#
15091c7386f4Smrg#   This special exception to the GPL applies to versions of the Autoconf
15101c7386f4Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
15111c7386f4Smrg#   modified version of the Autoconf Macro, you may extend this special
15121c7386f4Smrg#   exception to the GPL to apply to your modified version as well.#
15131c7386f4SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
15141c7386f4Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
15151c7386f4Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
15161c7386f4SmrgAS_LITERAL_IF([$1],
15171c7386f4Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
15181c7386f4Smrg      ax_save_FLAGS=$LDFLAGS
15191c7386f4Smrg      LDFLAGS="$1"
15201c7386f4Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
15211c7386f4Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
15221c7386f4Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
15231c7386f4Smrg      LDFLAGS=$ax_save_FLAGS])],
15241c7386f4Smrg  [ax_save_FLAGS=$LDFLAGS
15251c7386f4Smrg   LDFLAGS="$1"
15261c7386f4Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
15271c7386f4Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
15281c7386f4Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
15291c7386f4Smrg   LDFLAGS=$ax_save_FLAGS])
15301c7386f4Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
15311c7386f4SmrgAC_MSG_RESULT($xorg_check_linker_flags)
15321c7386f4Smrgif test "x$xorg_check_linker_flags" = xyes; then
15331c7386f4Smrg	m4_default([$2], :)
15341c7386f4Smrgelse
15351c7386f4Smrg	m4_default([$3], :)
15361c7386f4Smrgfi
15371c7386f4Smrg]) # XORG_CHECK_LINKER_FLAGS
15381c7386f4Smrg
15391c7386f4Smrg# XORG_MEMORY_CHECK_FLAGS
15401c7386f4Smrg# -----------------------
15411c7386f4Smrg# Minimum version: 1.16.0
15421c7386f4Smrg#
15431c7386f4Smrg# This macro attempts to find appropriate memory checking functionality
15441c7386f4Smrg# for various platforms which unit testing code may use to catch various
15451c7386f4Smrg# forms of memory allocation and access errors in testing.
15461c7386f4Smrg#
15471c7386f4Smrg# Interface to module:
15481c7386f4Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
15491c7386f4Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
15501c7386f4Smrg#
15511c7386f4Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
15521c7386f4Smrg#
15531c7386f4SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
15541c7386f4Smrg
15551c7386f4SmrgAC_REQUIRE([AC_CANONICAL_HOST])
15561c7386f4SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
15571c7386f4Smrg           [Environment variables to enable memory checking in tests])
15581c7386f4Smrg
15591c7386f4Smrg# Check for different types of support on different platforms
15601c7386f4Smrgcase $host_os in
15611c7386f4Smrg    solaris*)
15621c7386f4Smrg        AC_CHECK_LIB([umem], [umem_alloc],
15631c7386f4Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
15641c7386f4Smrg        ;;
15651c7386f4Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
15661c7386f4Smrg        # both directly and inverted, so should not be 0 or 255.
15671c7386f4Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
15681c7386f4Smrg        ;;
15691c7386f4Smrg    darwin*)
15701c7386f4Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
15711c7386f4Smrg        ;;
15721c7386f4Smrg    *bsd*)
15731c7386f4Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
15741c7386f4Smrg        ;;
15751c7386f4Smrgesac
15761c7386f4Smrg
15771c7386f4Smrg# User supplied flags override default flags
15781c7386f4Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
15791c7386f4Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
15801c7386f4Smrgfi
15811c7386f4Smrg
15821c7386f4SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
15831c7386f4Smrg]) # XORG_WITH_LINT
15841c7386f4Smrg
15851c7386f4Smrg# XORG_CHECK_MALLOC_ZERO
15861c7386f4Smrg# ----------------------
15871c7386f4Smrg# Minimum version: 1.0.0
15881c7386f4Smrg#
15891c7386f4Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
15901c7386f4Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
15911c7386f4Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
15921c7386f4SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
15931c7386f4SmrgAC_ARG_ENABLE(malloc0returnsnull,
15941c7386f4Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
15951c7386f4Smrg		       [malloc(0) returns NULL (default: auto)]),
15961c7386f4Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
15971c7386f4Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
15981c7386f4Smrg
15991c7386f4SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
16001c7386f4Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
16011c7386f4SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
16021c7386f4Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
16031c7386f4Smrg#include <stdlib.h>
16041c7386f4Smrg],[
16051c7386f4Smrg    char *m0, *r0, *c0, *p;
16061c7386f4Smrg    m0 = malloc(0);
16071c7386f4Smrg    p = malloc(10);
16081c7386f4Smrg    r0 = realloc(p,0);
16091c7386f4Smrg    c0 = calloc(0,10);
16101c7386f4Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
16111c7386f4Smrg])],
16121c7386f4Smrg		[xorg_cv_malloc0_returns_null=yes],
16131c7386f4Smrg		[xorg_cv_malloc0_returns_null=no])])
16141c7386f4SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
16151c7386f4Smrgfi
16161c7386f4SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
16171c7386f4Smrg
16181c7386f4Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
16191c7386f4Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
16201c7386f4Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
16211c7386f4Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
16221c7386f4Smrgelse
16231c7386f4Smrg	MALLOC_ZERO_CFLAGS=""
16241c7386f4Smrg	XMALLOC_ZERO_CFLAGS=""
16251c7386f4Smrg	XTMALLOC_ZERO_CFLAGS=""
16261c7386f4Smrgfi
16271c7386f4Smrg
16281c7386f4SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
16291c7386f4SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
16301c7386f4SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
16311c7386f4Smrg]) # XORG_CHECK_MALLOC_ZERO
16321c7386f4Smrg
16331c7386f4Smrg# XORG_WITH_LINT()
16341c7386f4Smrg# ----------------
16351c7386f4Smrg# Minimum version: 1.1.0
16361c7386f4Smrg#
16371c7386f4Smrg# This macro enables the use of a tool that flags some suspicious and
16381c7386f4Smrg# non-portable constructs (likely to be bugs) in C language source code.
16391c7386f4Smrg# It will attempt to locate the tool and use appropriate options.
16401c7386f4Smrg# There are various lint type tools on different platforms.
16411c7386f4Smrg#
16421c7386f4Smrg# Interface to module:
16431c7386f4Smrg# LINT:		returns the path to the tool found on the platform
16441c7386f4Smrg#		or the value set to LINT on the configure cmd line
16451c7386f4Smrg#		also an Automake conditional
16461c7386f4Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
16471c7386f4Smrg#
16481c7386f4Smrg# --with-lint:	'yes' user instructs the module to use lint
16491c7386f4Smrg#		'no' user instructs the module not to use lint (default)
16501c7386f4Smrg#
16511c7386f4Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
16521c7386f4Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
16531c7386f4Smrg#
16541c7386f4SmrgAC_DEFUN([XORG_WITH_LINT],[
16551c7386f4Smrg
16561c7386f4SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
16571c7386f4SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
16581c7386f4SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
16591c7386f4Smrg		[Use a lint-style source code checker (default: disabled)])],
16601c7386f4Smrg		[use_lint=$withval], [use_lint=no])
16611c7386f4Smrg
16621c7386f4Smrg# Obtain platform specific info like program name and options
16631c7386f4Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
16641c7386f4Smrgcase $host_os in
16651c7386f4Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
16661c7386f4Smrg	lint_name=splint
16671c7386f4Smrg	lint_options="-badflag"
16681c7386f4Smrg	;;
16691c7386f4Smrg  *freebsd* | *netbsd*)
16701c7386f4Smrg	lint_name=lint
16711c7386f4Smrg	lint_options="-u -b"
16721c7386f4Smrg	;;
16731c7386f4Smrg  *solaris*)
16741c7386f4Smrg	lint_name=lint
16751c7386f4Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
16761c7386f4Smrg	;;
16771c7386f4Smrgesac
16781c7386f4Smrg
16791c7386f4Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
16801c7386f4Smrgif test "x$use_lint" = x"yes" ; then
16811c7386f4Smrg   AC_PATH_PROG([LINT], [$lint_name])
16821c7386f4Smrg   if test "x$LINT" = "x"; then
16831c7386f4Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
16841c7386f4Smrg   fi
16851c7386f4Smrgelif test "x$use_lint" = x"no" ; then
16861c7386f4Smrg   if test "x$LINT" != "x"; then
16871c7386f4Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
16881c7386f4Smrg   fi
16891c7386f4Smrgelse
16901c7386f4Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
16911c7386f4Smrgfi
16921c7386f4Smrg
16931c7386f4Smrg# User supplied flags override default flags
16941c7386f4Smrgif test "x$LINT_FLAGS" != "x"; then
16951c7386f4Smrg   lint_options=$LINT_FLAGS
16961c7386f4Smrgfi
16971c7386f4Smrg
16981c7386f4SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
16991c7386f4SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
17001c7386f4Smrg
17011c7386f4Smrg]) # XORG_WITH_LINT
17021c7386f4Smrg
17031c7386f4Smrg# XORG_LINT_LIBRARY(LIBNAME)
17041c7386f4Smrg# --------------------------
17051c7386f4Smrg# Minimum version: 1.1.0
17061c7386f4Smrg#
17071c7386f4Smrg# Sets up flags for building lint libraries for checking programs that call
17081c7386f4Smrg# functions in the library.
17091c7386f4Smrg#
17101c7386f4Smrg# Interface to module:
17111c7386f4Smrg# LINTLIB		- Automake variable with the name of lint library file to make
17121c7386f4Smrg# MAKE_LINT_LIB		- Automake conditional
17131c7386f4Smrg#
17141c7386f4Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
17151c7386f4Smrg#			  - 'no' user instructs the module not to create a lint library (default)
17161c7386f4Smrg
17171c7386f4SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
17181c7386f4SmrgAC_REQUIRE([XORG_WITH_LINT])
17191c7386f4SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
17201c7386f4Smrg	[Create lint library (default: disabled)])],
17211c7386f4Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
17221c7386f4Smrg
17231c7386f4Smrgif test "x$make_lint_lib" = x"yes" ; then
17241c7386f4Smrg   LINTLIB=llib-l$1.ln
17251c7386f4Smrg   if test "x$LINT" = "x"; then
17261c7386f4Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
17271c7386f4Smrg   fi
17281c7386f4Smrgelif test "x$make_lint_lib" != x"no" ; then
17291c7386f4Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
17301c7386f4Smrgfi
17311c7386f4Smrg
17321c7386f4SmrgAC_SUBST(LINTLIB)
17331c7386f4SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
17341c7386f4Smrg
17351c7386f4Smrg]) # XORG_LINT_LIBRARY
17361c7386f4Smrg
17371c7386f4Smrg# XORG_COMPILER_BRAND
17381c7386f4Smrg# -------------------
17391c7386f4Smrg# Minimum version: 1.14.0
17401c7386f4Smrg#
17411c7386f4Smrg# Checks for various brands of compilers and sets flags as appropriate:
17421c7386f4Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
17431c7386f4Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
17441c7386f4Smrg#   clang compiler - sets CLANGCC to "yes"
17451c7386f4Smrg#   Intel compiler - sets INTELCC to "yes"
17461c7386f4Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
17471c7386f4Smrg#
17481c7386f4SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
17491c7386f4SmrgAC_LANG_CASE(
17501c7386f4Smrg	[C], [
17511c7386f4Smrg		AC_REQUIRE([AC_PROG_CC_C99])
17521c7386f4Smrg	],
17531c7386f4Smrg	[C++], [
17541c7386f4Smrg		AC_REQUIRE([AC_PROG_CXX])
17551c7386f4Smrg	]
17561c7386f4Smrg)
17571c7386f4SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
17581c7386f4SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
17591c7386f4SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
17601c7386f4Smrg]) # XORG_COMPILER_BRAND
17611c7386f4Smrg
17621c7386f4Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
17631c7386f4Smrg# ---------------
17641c7386f4Smrg# Minimum version: 1.16.0
17651c7386f4Smrg#
17661c7386f4Smrg# Test if the compiler works when passed the given flag as a command line argument.
17671c7386f4Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
17681c7386f4Smrg# next flag in the list until there are no more options.
17691c7386f4Smrg#
17701c7386f4Smrg# Note that this does not guarantee that the compiler supports the flag as some
17711c7386f4Smrg# compilers will simply ignore arguments that they do not understand, but we do
17721c7386f4Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
17731c7386f4Smrg# -Werror=unused-command-line-argument
17741c7386f4Smrg#
17751c7386f4SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
17761c7386f4Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
17771c7386f4Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
17781c7386f4Smrg
17791c7386f4SmrgAC_LANG_COMPILER_REQUIRE
17801c7386f4Smrg
17811c7386f4SmrgAC_LANG_CASE(
17821c7386f4Smrg	[C], [
17831c7386f4Smrg		AC_REQUIRE([AC_PROG_CC_C99])
17841c7386f4Smrg		define([PREFIX], [C])
17851c7386f4Smrg		define([CACHE_PREFIX], [cc])
17861c7386f4Smrg		define([COMPILER], [$CC])
17871c7386f4Smrg	],
17881c7386f4Smrg	[C++], [
17891c7386f4Smrg		define([PREFIX], [CXX])
17901c7386f4Smrg		define([CACHE_PREFIX], [cxx])
17911c7386f4Smrg		define([COMPILER], [$CXX])
17921c7386f4Smrg	]
17931c7386f4Smrg)
17941c7386f4Smrg
17951c7386f4Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
17961c7386f4Smrg
17971c7386f4Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
17981c7386f4Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
17991c7386f4Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
18001c7386f4Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
18011c7386f4Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
18021c7386f4Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
18031c7386f4Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
18041c7386f4Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
18051c7386f4Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
18061c7386f4Smrgfi
18071c7386f4Smrg
18081c7386f4Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
18091c7386f4Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
18101c7386f4Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
18111c7386f4Smrg	fi
18121c7386f4Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
18131c7386f4Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
18141c7386f4Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
18151c7386f4Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
18161c7386f4Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
18171c7386f4Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
18181c7386f4Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
18191c7386f4Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
18201c7386f4Smrgfi
18211c7386f4Smrg
18221c7386f4Smrgfound="no"
18231c7386f4Smrgm4_foreach([flag], m4_cdr($@), [
18241c7386f4Smrg	if test $found = "no" ; then
18251c7386f4Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
18261c7386f4Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
18271c7386f4Smrg		fi
18281c7386f4Smrg
18291c7386f4Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
18301c7386f4Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
18311c7386f4Smrg		fi
18321c7386f4Smrg
18331c7386f4Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
18341c7386f4Smrg
18351c7386f4Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
18361c7386f4Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
18371c7386f4Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
18381c7386f4Smrg		AC_CACHE_VAL($cacheid,
18391c7386f4Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
18401c7386f4Smrg					     [eval $cacheid=yes],
18411c7386f4Smrg					     [eval $cacheid=no])])
18421c7386f4Smrg
18431c7386f4Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
18441c7386f4Smrg
18451c7386f4Smrg		eval supported=\$$cacheid
18461c7386f4Smrg		AC_MSG_RESULT([$supported])
18471c7386f4Smrg		if test "$supported" = "yes" ; then
18481c7386f4Smrg			$1="$$1 ]flag["
18491c7386f4Smrg			found="yes"
18501c7386f4Smrg		fi
18511c7386f4Smrg	fi
18521c7386f4Smrg])
18531c7386f4Smrg]) # XORG_TESTSET_CFLAG
18541c7386f4Smrg
18551c7386f4Smrg# XORG_COMPILER_FLAGS
18561c7386f4Smrg# ---------------
18571c7386f4Smrg# Minimum version: 1.16.0
18581c7386f4Smrg#
18591c7386f4Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
18601c7386f4Smrg# arguments supported by the selected compiler which do NOT alter the generated
18611c7386f4Smrg# code.  These arguments will cause the compiler to print various warnings
18621c7386f4Smrg# during compilation AND turn a conservative set of warnings into errors.
18631c7386f4Smrg#
18641c7386f4Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
18651c7386f4Smrg# future versions of util-macros as options are added to new compilers.
18661c7386f4Smrg#
18671c7386f4SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
18681c7386f4SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
18691c7386f4Smrg
18701c7386f4SmrgAC_ARG_ENABLE(selective-werror,
18711c7386f4Smrg              AS_HELP_STRING([--disable-selective-werror],
18721c7386f4Smrg                             [Turn off selective compiler errors. (default: enabled)]),
18731c7386f4Smrg              [SELECTIVE_WERROR=$enableval],
18741c7386f4Smrg              [SELECTIVE_WERROR=yes])
18751c7386f4Smrg
18761c7386f4SmrgAC_LANG_CASE(
18771c7386f4Smrg        [C], [
18781c7386f4Smrg                define([PREFIX], [C])
18791c7386f4Smrg        ],
18801c7386f4Smrg        [C++], [
18811c7386f4Smrg                define([PREFIX], [CXX])
18821c7386f4Smrg        ]
18831c7386f4Smrg)
18841c7386f4Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
18851c7386f4Smrgif test "x$SUNCC" = "xyes"; then
18861c7386f4Smrg    [BASE_]PREFIX[FLAGS]="-v"
18871c7386f4Smrgelse
18881c7386f4Smrg    [BASE_]PREFIX[FLAGS]=""
18891c7386f4Smrgfi
18901c7386f4Smrg
18911c7386f4Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
18921c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
18931c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
18941c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
18951c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
18961c7386f4Smrg
18971c7386f4SmrgAC_LANG_CASE(
18981c7386f4Smrg	[C], [
18991c7386f4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
19001c7386f4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
19011c7386f4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
19021c7386f4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
19031c7386f4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
19041c7386f4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
19051c7386f4Smrg	]
19061c7386f4Smrg)
19071c7386f4Smrg
19081c7386f4Smrg# This chunk adds additional warnings that could catch undesired effects.
19091c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
19101c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
19111c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
19121c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
19131c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
19141c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
19151c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
19161c7386f4Smrg
19171c7386f4Smrg# These are currently disabled because they are noisy.  They will be enabled
19181c7386f4Smrg# in the future once the codebase is sufficiently modernized to silence
19191c7386f4Smrg# them.  For now, I don't want them to drown out the other warnings.
19201c7386f4Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
19211c7386f4Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
19221c7386f4Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
19231c7386f4Smrg
19241c7386f4Smrg# Turn some warnings into errors, so we don't accidently get successful builds
19251c7386f4Smrg# when there are problems that should be fixed.
19261c7386f4Smrg
19271c7386f4Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
19281c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
19291c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
19301c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
19311c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
19321c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
19331c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
19341c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
19351c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
19361c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
19371c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
19381c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
19391c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
19401c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
19411c7386f4Smrgelse
19421c7386f4SmrgAC_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])
19431c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
19441c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
19451c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
19461c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
19471c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
19481c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
19491c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
19501c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
19511c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
19521c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
19531c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
19541c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
19551c7386f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
19561c7386f4Smrgfi
19571c7386f4Smrg
19581c7386f4SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
19591c7386f4Smrg]) # XORG_COMPILER_FLAGS
19601c7386f4Smrg
19611c7386f4Smrg# XORG_CWARNFLAGS
19621c7386f4Smrg# ---------------
19631c7386f4Smrg# Minimum version: 1.2.0
19641c7386f4Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
19651c7386f4Smrg#
19661c7386f4Smrg# Defines CWARNFLAGS to enable C compiler warnings.
19671c7386f4Smrg#
19681c7386f4Smrg# This function is deprecated because it defines -fno-strict-aliasing
19691c7386f4Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
19701c7386f4Smrg# is needed, then it should be added explicitly in the module when
19711c7386f4Smrg# it is updated to use BASE_CFLAGS.
19721c7386f4Smrg#
19731c7386f4SmrgAC_DEFUN([XORG_CWARNFLAGS], [
19741c7386f4SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
19751c7386f4SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
19761c7386f4SmrgAC_LANG_CASE(
19771c7386f4Smrg	[C], [
19781c7386f4Smrg		CWARNFLAGS="$BASE_CFLAGS"
19791c7386f4Smrg		if  test "x$GCC" = xyes ; then
19801c7386f4Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
19811c7386f4Smrg		fi
19821c7386f4Smrg		AC_SUBST(CWARNFLAGS)
19831c7386f4Smrg	]
19841c7386f4Smrg)
19851c7386f4Smrg]) # XORG_CWARNFLAGS
19861c7386f4Smrg
19871c7386f4Smrg# XORG_STRICT_OPTION
19881c7386f4Smrg# -----------------------
19891c7386f4Smrg# Minimum version: 1.3.0
19901c7386f4Smrg#
19911c7386f4Smrg# Add configure option to enable strict compilation flags, such as treating
19921c7386f4Smrg# warnings as fatal errors.
19931c7386f4Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
19941c7386f4Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
19951c7386f4Smrg#
19961c7386f4Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
19971c7386f4Smrg# when strict compilation is unconditionally desired.
19981c7386f4SmrgAC_DEFUN([XORG_STRICT_OPTION], [
19991c7386f4SmrgAC_REQUIRE([XORG_CWARNFLAGS])
20001c7386f4SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
20011c7386f4Smrg
20021c7386f4SmrgAC_ARG_ENABLE(strict-compilation,
20031c7386f4Smrg			  AS_HELP_STRING([--enable-strict-compilation],
20041c7386f4Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
20051c7386f4Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
20061c7386f4Smrg
20071c7386f4SmrgAC_LANG_CASE(
20081c7386f4Smrg        [C], [
20091c7386f4Smrg                define([PREFIX], [C])
20101c7386f4Smrg        ],
20111c7386f4Smrg        [C++], [
20121c7386f4Smrg                define([PREFIX], [CXX])
20131c7386f4Smrg        ]
20141c7386f4Smrg)
20151c7386f4Smrg
20161c7386f4Smrg[STRICT_]PREFIX[FLAGS]=""
20171c7386f4SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
20181c7386f4SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
20191c7386f4Smrg
20201c7386f4Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
20211c7386f4Smrg# activate it with -Werror, so we add it here explicitly.
20221c7386f4SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
20231c7386f4Smrg
20241c7386f4Smrgif test "x$STRICT_COMPILE" = "xyes"; then
20251c7386f4Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
20261c7386f4Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
20271c7386f4Smrgfi
20281c7386f4SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
20291c7386f4SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
20301c7386f4SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
20311c7386f4Smrg]) # XORG_STRICT_OPTION
20321c7386f4Smrg
20331c7386f4Smrg# XORG_DEFAULT_OPTIONS
20341c7386f4Smrg# --------------------
20351c7386f4Smrg# Minimum version: 1.3.0
20361c7386f4Smrg#
20371c7386f4Smrg# Defines default options for X.Org modules.
20381c7386f4Smrg#
20391c7386f4SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
20401c7386f4SmrgAC_REQUIRE([AC_PROG_INSTALL])
20411c7386f4SmrgXORG_COMPILER_FLAGS
20421c7386f4SmrgXORG_CWARNFLAGS
20431c7386f4SmrgXORG_STRICT_OPTION
20441c7386f4SmrgXORG_RELEASE_VERSION
20451c7386f4SmrgXORG_CHANGELOG
20461c7386f4SmrgXORG_INSTALL
20471c7386f4SmrgXORG_MANPAGE_SECTIONS
20481c7386f4Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
20491c7386f4Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
20501c7386f4Smrg]) # XORG_DEFAULT_OPTIONS
20511c7386f4Smrg
20521c7386f4Smrg# XORG_INSTALL()
20531c7386f4Smrg# ----------------
20541c7386f4Smrg# Minimum version: 1.4.0
20551c7386f4Smrg#
20561c7386f4Smrg# Defines the variable INSTALL_CMD as the command to copy
20571c7386f4Smrg# INSTALL from $prefix/share/util-macros.
20581c7386f4Smrg#
20591c7386f4SmrgAC_DEFUN([XORG_INSTALL], [
20601c7386f4SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
20611c7386f4Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
20621c7386f4SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
20631c7386f4Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
20641c7386f4Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
20651c7386f4Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
20661c7386f4SmrgAC_SUBST([INSTALL_CMD])
20671c7386f4Smrg]) # XORG_INSTALL
20681c7386f4Smrgdnl Copyright 2005 Red Hat, Inc
20691c7386f4Smrgdnl
20701c7386f4Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
20711c7386f4Smrgdnl documentation for any purpose is hereby granted without fee, provided that
20721c7386f4Smrgdnl the above copyright notice appear in all copies and that both that
20731c7386f4Smrgdnl copyright notice and this permission notice appear in supporting
20741c7386f4Smrgdnl documentation.
20751c7386f4Smrgdnl
20761c7386f4Smrgdnl The above copyright notice and this permission notice shall be included
20771c7386f4Smrgdnl in all copies or substantial portions of the Software.
20781c7386f4Smrgdnl
20791c7386f4Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20801c7386f4Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20811c7386f4Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20821c7386f4Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
20831c7386f4Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20841c7386f4Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20851c7386f4Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
20861c7386f4Smrgdnl
20871c7386f4Smrgdnl Except as contained in this notice, the name of the copyright holders shall
20881c7386f4Smrgdnl not be used in advertising or otherwise to promote the sale, use or
20891c7386f4Smrgdnl other dealings in this Software without prior written authorization
20901c7386f4Smrgdnl from the copyright holders.
20911c7386f4Smrgdnl
20921c7386f4Smrg
20931c7386f4Smrg# XORG_RELEASE_VERSION
20941c7386f4Smrg# --------------------
20951c7386f4Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
20961c7386f4Smrg
20971c7386f4SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
20981c7386f4Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
20991c7386f4Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
21001c7386f4Smrg		[Major version of this package])
21011c7386f4Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
21021c7386f4Smrg	if test "x$PVM" = "x"; then
21031c7386f4Smrg		PVM="0"
21041c7386f4Smrg	fi
21051c7386f4Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
21061c7386f4Smrg		[$PVM],
21071c7386f4Smrg		[Minor version of this package])
21081c7386f4Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
21091c7386f4Smrg	if test "x$PVP" = "x"; then
21101c7386f4Smrg		PVP="0"
21111c7386f4Smrg	fi
21121c7386f4Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
21131c7386f4Smrg		[$PVP],
21141c7386f4Smrg		[Patch version of this package])
21151c7386f4Smrg])
21161c7386f4Smrg
21171c7386f4Smrg# XORG_CHANGELOG()
21181c7386f4Smrg# ----------------
21191c7386f4Smrg# Minimum version: 1.2.0
21201c7386f4Smrg#
21211c7386f4Smrg# Defines the variable CHANGELOG_CMD as the command to generate
21221c7386f4Smrg# ChangeLog from git.
21231c7386f4Smrg#
21241c7386f4Smrg#
21251c7386f4SmrgAC_DEFUN([XORG_CHANGELOG], [
21261c7386f4SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
21271c7386f4Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
21281c7386f4Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
21291c7386f4Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
21301c7386f4SmrgAC_SUBST([CHANGELOG_CMD])
21311c7386f4Smrg]) # XORG_CHANGELOG
21321c7386f4Smrg
213308c70cfbSmrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
2134602e473dSmrg#
213508c70cfbSmrg# This file is free software; the Free Software Foundation
213608c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
213708c70cfbSmrg# with or without modifications, as long as this notice is preserved.
213808c70cfbSmrg
213908c70cfbSmrg# AM_AUTOMAKE_VERSION(VERSION)
214008c70cfbSmrg# ----------------------------
214108c70cfbSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
214208c70cfbSmrg# generated from the m4 files accompanying Automake X.Y.
214308c70cfbSmrg# (This private macro should not be called outside this file.)
214408c70cfbSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
21451016ad83Smrg[am__api_version='1.14'
214608c70cfbSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
214708c70cfbSmrgdnl require some minimum version.  Point them to the right macro.
21481c7386f4Smrgm4_if([$1], [1.14.1], [],
214908c70cfbSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
215008c70cfbSmrg])
215108c70cfbSmrg
215208c70cfbSmrg# _AM_AUTOCONF_VERSION(VERSION)
215308c70cfbSmrg# -----------------------------
215408c70cfbSmrg# aclocal traces this macro to find the Autoconf version.
215508c70cfbSmrg# This is a private macro too.  Using m4_define simplifies
215608c70cfbSmrg# the logic in aclocal, which can simply ignore this definition.
215708c70cfbSmrgm4_define([_AM_AUTOCONF_VERSION], [])
215808c70cfbSmrg
215908c70cfbSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
216008c70cfbSmrg# -------------------------------
216108c70cfbSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
216208c70cfbSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
216308c70cfbSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
21641c7386f4Smrg[AM_AUTOMAKE_VERSION([1.14.1])dnl
216508c70cfbSmrgm4_ifndef([AC_AUTOCONF_VERSION],
216608c70cfbSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
216708c70cfbSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
216808c70cfbSmrg
216908c70cfbSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
217008c70cfbSmrg
217108c70cfbSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
2172602e473dSmrg#
217308c70cfbSmrg# This file is free software; the Free Software Foundation
217408c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
217508c70cfbSmrg# with or without modifications, as long as this notice is preserved.
2176602e473dSmrg
217708c70cfbSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
217808c70cfbSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
217908c70cfbSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
2180602e473dSmrg#
218108c70cfbSmrg# Of course, Automake must honor this variable whenever it calls a
218208c70cfbSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
218308c70cfbSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
218408c70cfbSmrg# depending on how configure is run.  This is pretty annoying, since
218508c70cfbSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
218608c70cfbSmrg# source directory, any form will work fine, but in subdirectories a
218708c70cfbSmrg# relative path needs to be adjusted first.
2188602e473dSmrg#
218908c70cfbSmrg# $ac_aux_dir/missing
219008c70cfbSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
219108c70cfbSmrg# $top_srcdir/$ac_aux_dir/missing
219208c70cfbSmrg#    fails if $ac_aux_dir is absolute,
219308c70cfbSmrg#    fails when called from a subdirectory in a VPATH build with
219408c70cfbSmrg#          a relative $ac_aux_dir
2195602e473dSmrg#
219608c70cfbSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
219708c70cfbSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
219808c70cfbSmrg# harmless because $srcdir is '.', but things will broke when you
219908c70cfbSmrg# start a VPATH build or use an absolute $srcdir.
2200602e473dSmrg#
220108c70cfbSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
220208c70cfbSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
220308c70cfbSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
220408c70cfbSmrg# and then we would define $MISSING as
220508c70cfbSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
220608c70cfbSmrg# This will work as long as MISSING is not called from configure, because
220708c70cfbSmrg# unfortunately $(top_srcdir) has no meaning in configure.
220808c70cfbSmrg# However there are other variables, like CC, which are often used in
220908c70cfbSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
2210602e473dSmrg#
221108c70cfbSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
221208c70cfbSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
221308c70cfbSmrg# configured tree to be moved without reconfiguration.
2214602e473dSmrg
221508c70cfbSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
221608c70cfbSmrg[dnl Rely on autoconf to set up CDPATH properly.
221708c70cfbSmrgAC_PREREQ([2.50])dnl
221808c70cfbSmrg# expand $ac_aux_dir to an absolute path
221908c70cfbSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
2220602e473dSmrg])
2221602e473dSmrg
222208c70cfbSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
2223602e473dSmrg
222408c70cfbSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
222508c70cfbSmrg#
222608c70cfbSmrg# This file is free software; the Free Software Foundation
222708c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
222808c70cfbSmrg# with or without modifications, as long as this notice is preserved.
2229602e473dSmrg
223008c70cfbSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
223108c70cfbSmrg# -------------------------------------
223208c70cfbSmrg# Define a conditional.
223308c70cfbSmrgAC_DEFUN([AM_CONDITIONAL],
223408c70cfbSmrg[AC_PREREQ([2.52])dnl
223508c70cfbSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
223608c70cfbSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
223708c70cfbSmrgAC_SUBST([$1_TRUE])dnl
223808c70cfbSmrgAC_SUBST([$1_FALSE])dnl
223908c70cfbSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
224008c70cfbSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
224108c70cfbSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
224208c70cfbSmrgif $2; then
224308c70cfbSmrg  $1_TRUE=
224408c70cfbSmrg  $1_FALSE='#'
224508c70cfbSmrgelse
224608c70cfbSmrg  $1_TRUE='#'
224708c70cfbSmrg  $1_FALSE=
224808c70cfbSmrgfi
224908c70cfbSmrgAC_CONFIG_COMMANDS_PRE(
225008c70cfbSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
225108c70cfbSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
225208c70cfbSmrgUsually this means the macro was only invoked conditionally.]])
225308c70cfbSmrgfi])])
2254602e473dSmrg
225508c70cfbSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
225608c70cfbSmrg#
225708c70cfbSmrg# This file is free software; the Free Software Foundation
225808c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
225908c70cfbSmrg# with or without modifications, as long as this notice is preserved.
226021298544Smrg
2261602e473dSmrg
226208c70cfbSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
226308c70cfbSmrg# written in clear, in which case automake, when reading aclocal.m4,
226408c70cfbSmrg# will think it sees a *use*, and therefore will trigger all it's
226508c70cfbSmrg# C support machinery.  Also note that it means that autoscan, seeing
226608c70cfbSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
2267602e473dSmrg
2268602e473dSmrg
226908c70cfbSmrg# _AM_DEPENDENCIES(NAME)
227008c70cfbSmrg# ----------------------
227108c70cfbSmrg# See how the compiler implements dependency checking.
227208c70cfbSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
227308c70cfbSmrg# We try a few techniques and use that to set a single cache variable.
227408c70cfbSmrg#
227508c70cfbSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
227608c70cfbSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
227708c70cfbSmrg# dependency, and given that the user is not expected to run this macro,
227808c70cfbSmrg# just rely on AC_PROG_CC.
227908c70cfbSmrgAC_DEFUN([_AM_DEPENDENCIES],
228008c70cfbSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
228108c70cfbSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
228208c70cfbSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
228308c70cfbSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
2284602e473dSmrg
228508c70cfbSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
228608c70cfbSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
228708c70cfbSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
228808c70cfbSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
228908c70cfbSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
229008c70cfbSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
229108c70cfbSmrg                    [depcc="$$1"   am_compiler_list=])
2292602e473dSmrg
229308c70cfbSmrgAC_CACHE_CHECK([dependency style of $depcc],
229408c70cfbSmrg               [am_cv_$1_dependencies_compiler_type],
229508c70cfbSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
229608c70cfbSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
229708c70cfbSmrg  # making bogus files that we don't know about and never remove.  For
229808c70cfbSmrg  # instance it was reported that on HP-UX the gcc test will end up
229908c70cfbSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
230008c70cfbSmrg  # in D".
230108c70cfbSmrg  rm -rf conftest.dir
230208c70cfbSmrg  mkdir conftest.dir
230308c70cfbSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
230408c70cfbSmrg  # using a relative directory.
230508c70cfbSmrg  cp "$am_depcomp" conftest.dir
230608c70cfbSmrg  cd conftest.dir
230708c70cfbSmrg  # We will build objects and dependencies in a subdirectory because
230808c70cfbSmrg  # it helps to detect inapplicable dependency modes.  For instance
230908c70cfbSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
231008c70cfbSmrg  # side effect of compilation, but ICC will put the dependencies in
231108c70cfbSmrg  # the current directory while Tru64 will put them in the object
231208c70cfbSmrg  # directory.
231308c70cfbSmrg  mkdir sub
2314602e473dSmrg
231508c70cfbSmrg  am_cv_$1_dependencies_compiler_type=none
231608c70cfbSmrg  if test "$am_compiler_list" = ""; then
231708c70cfbSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
231808c70cfbSmrg  fi
231908c70cfbSmrg  am__universal=false
232008c70cfbSmrg  m4_case([$1], [CC],
232108c70cfbSmrg    [case " $depcc " in #(
232208c70cfbSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
232308c70cfbSmrg     esac],
232408c70cfbSmrg    [CXX],
232508c70cfbSmrg    [case " $depcc " in #(
232608c70cfbSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
232708c70cfbSmrg     esac])
2328602e473dSmrg
232908c70cfbSmrg  for depmode in $am_compiler_list; do
233008c70cfbSmrg    # Setup a source with many dependencies, because some compilers
233108c70cfbSmrg    # like to wrap large dependency lists on column 80 (with \), and
233208c70cfbSmrg    # we should not choose a depcomp mode which is confused by this.
233308c70cfbSmrg    #
233408c70cfbSmrg    # We need to recreate these files for each test, as the compiler may
233508c70cfbSmrg    # overwrite some of them when testing with obscure command lines.
233608c70cfbSmrg    # This happens at least with the AIX C compiler.
233708c70cfbSmrg    : > sub/conftest.c
233808c70cfbSmrg    for i in 1 2 3 4 5 6; do
233908c70cfbSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
234008c70cfbSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
234108c70cfbSmrg      # Solaris 10 /bin/sh.
234208c70cfbSmrg      echo '/* dummy */' > sub/conftst$i.h
234308c70cfbSmrg    done
234408c70cfbSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2345602e473dSmrg
234608c70cfbSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
234708c70cfbSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
234808c70cfbSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
234908c70cfbSmrg    # versions had trouble with output in subdirs.
235008c70cfbSmrg    am__obj=sub/conftest.${OBJEXT-o}
235108c70cfbSmrg    am__minus_obj="-o $am__obj"
235208c70cfbSmrg    case $depmode in
235308c70cfbSmrg    gcc)
235408c70cfbSmrg      # This depmode causes a compiler race in universal mode.
235508c70cfbSmrg      test "$am__universal" = false || continue
235608c70cfbSmrg      ;;
235708c70cfbSmrg    nosideeffect)
235808c70cfbSmrg      # After this tag, mechanisms are not by side-effect, so they'll
235908c70cfbSmrg      # only be used when explicitly requested.
236008c70cfbSmrg      if test "x$enable_dependency_tracking" = xyes; then
236108c70cfbSmrg	continue
236208c70cfbSmrg      else
236308c70cfbSmrg	break
236408c70cfbSmrg      fi
236508c70cfbSmrg      ;;
236608c70cfbSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
236708c70cfbSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
236808c70cfbSmrg      # not run yet.  These depmodes are late enough in the game, and
236908c70cfbSmrg      # so weak that their functioning should not be impacted.
237008c70cfbSmrg      am__obj=conftest.${OBJEXT-o}
237108c70cfbSmrg      am__minus_obj=
237208c70cfbSmrg      ;;
237308c70cfbSmrg    none) break ;;
237408c70cfbSmrg    esac
237508c70cfbSmrg    if depmode=$depmode \
237608c70cfbSmrg       source=sub/conftest.c object=$am__obj \
237708c70cfbSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
237808c70cfbSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
237908c70cfbSmrg         >/dev/null 2>conftest.err &&
238008c70cfbSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
238108c70cfbSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
238208c70cfbSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
238308c70cfbSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
238408c70cfbSmrg      # icc doesn't choke on unknown options, it will just issue warnings
238508c70cfbSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
238608c70cfbSmrg      # that says an option was ignored or not supported.
238708c70cfbSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
238808c70cfbSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
238908c70cfbSmrg      # The diagnosis changed in icc 8.0:
239008c70cfbSmrg      #   icc: Command line remark: option '-MP' not supported
239108c70cfbSmrg      if (grep 'ignoring option' conftest.err ||
239208c70cfbSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
239308c70cfbSmrg        am_cv_$1_dependencies_compiler_type=$depmode
239408c70cfbSmrg        break
239508c70cfbSmrg      fi
239608c70cfbSmrg    fi
239708c70cfbSmrg  done
2398602e473dSmrg
239908c70cfbSmrg  cd ..
240008c70cfbSmrg  rm -rf conftest.dir
240108c70cfbSmrgelse
240208c70cfbSmrg  am_cv_$1_dependencies_compiler_type=none
240308c70cfbSmrgfi
240408c70cfbSmrg])
240508c70cfbSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
240608c70cfbSmrgAM_CONDITIONAL([am__fastdep$1], [
240708c70cfbSmrg  test "x$enable_dependency_tracking" != xno \
240808c70cfbSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
240908c70cfbSmrg])
2410602e473dSmrg
2411602e473dSmrg
241208c70cfbSmrg# AM_SET_DEPDIR
241308c70cfbSmrg# -------------
241408c70cfbSmrg# Choose a directory name for dependency files.
241508c70cfbSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
241608c70cfbSmrgAC_DEFUN([AM_SET_DEPDIR],
241708c70cfbSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
241808c70cfbSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
241908c70cfbSmrg])
242021298544Smrg
2421602e473dSmrg
242208c70cfbSmrg# AM_DEP_TRACK
242308c70cfbSmrg# ------------
242408c70cfbSmrgAC_DEFUN([AM_DEP_TRACK],
242508c70cfbSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
242608c70cfbSmrgAS_HELP_STRING(
242708c70cfbSmrg  [--enable-dependency-tracking],
242808c70cfbSmrg  [do not reject slow dependency extractors])
242908c70cfbSmrgAS_HELP_STRING(
243008c70cfbSmrg  [--disable-dependency-tracking],
243108c70cfbSmrg  [speeds up one-time build])])
243208c70cfbSmrgif test "x$enable_dependency_tracking" != xno; then
243308c70cfbSmrg  am_depcomp="$ac_aux_dir/depcomp"
243408c70cfbSmrg  AMDEPBACKSLASH='\'
243508c70cfbSmrg  am__nodep='_no'
2436602e473dSmrgfi
243708c70cfbSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
243808c70cfbSmrgAC_SUBST([AMDEPBACKSLASH])dnl
243908c70cfbSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
244008c70cfbSmrgAC_SUBST([am__nodep])dnl
244108c70cfbSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
2442602e473dSmrg])
2443602e473dSmrg
244408c70cfbSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
2445602e473dSmrg
244608c70cfbSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
244708c70cfbSmrg#
244808c70cfbSmrg# This file is free software; the Free Software Foundation
244908c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
245008c70cfbSmrg# with or without modifications, as long as this notice is preserved.
2451602e473dSmrg
2452602e473dSmrg
245308c70cfbSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
245408c70cfbSmrg# ------------------------------
245508c70cfbSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
245608c70cfbSmrg[{
245708c70cfbSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
245808c70cfbSmrg  # are listed without --file.  Let's play safe and only enable the eval
245908c70cfbSmrg  # if we detect the quoting.
246008c70cfbSmrg  case $CONFIG_FILES in
246108c70cfbSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
246208c70cfbSmrg  *)   set x $CONFIG_FILES ;;
246308c70cfbSmrg  esac
246408c70cfbSmrg  shift
246508c70cfbSmrg  for mf
246608c70cfbSmrg  do
246708c70cfbSmrg    # Strip MF so we end up with the name of the file.
246808c70cfbSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
246908c70cfbSmrg    # Check whether this is an Automake generated Makefile or not.
247008c70cfbSmrg    # We used to match only the files named 'Makefile.in', but
247108c70cfbSmrg    # some people rename them; so instead we look at the file content.
247208c70cfbSmrg    # Grep'ing the first line is not enough: some people post-process
247308c70cfbSmrg    # each Makefile.in and add a new line on top of each file to say so.
247408c70cfbSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
247508c70cfbSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
247608c70cfbSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
247708c70cfbSmrg      dirpart=`AS_DIRNAME("$mf")`
247808c70cfbSmrg    else
247908c70cfbSmrg      continue
248008c70cfbSmrg    fi
248108c70cfbSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
248208c70cfbSmrg    # from the Makefile without running 'make'.
248308c70cfbSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
248408c70cfbSmrg    test -z "$DEPDIR" && continue
248508c70cfbSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
248608c70cfbSmrg    test -z "$am__include" && continue
248708c70cfbSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
248808c70cfbSmrg    # Find all dependency output files, they are included files with
248908c70cfbSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
249008c70cfbSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
249108c70cfbSmrg    # expansion.
249208c70cfbSmrg    for file in `sed -n "
249308c70cfbSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
249408c70cfbSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
249508c70cfbSmrg      # Make sure the directory exists.
249608c70cfbSmrg      test -f "$dirpart/$file" && continue
249708c70cfbSmrg      fdir=`AS_DIRNAME(["$file"])`
249808c70cfbSmrg      AS_MKDIR_P([$dirpart/$fdir])
249908c70cfbSmrg      # echo "creating $dirpart/$file"
250008c70cfbSmrg      echo '# dummy' > "$dirpart/$file"
250108c70cfbSmrg    done
250208c70cfbSmrg  done
250308c70cfbSmrg}
250408c70cfbSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2505602e473dSmrg
2506602e473dSmrg
250708c70cfbSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
250808c70cfbSmrg# -----------------------------
250908c70cfbSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
251008c70cfbSmrg#
251108c70cfbSmrg# This code is only required when automatic dependency tracking
251208c70cfbSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
251308c70cfbSmrg# need in order to bootstrap the dependency handling code.
251408c70cfbSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
251508c70cfbSmrg[AC_CONFIG_COMMANDS([depfiles],
251608c70cfbSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
251708c70cfbSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
251808c70cfbSmrg])
2519602e473dSmrg
252008c70cfbSmrg# Do all the work for Automake.                             -*- Autoconf -*-
2521602e473dSmrg
252208c70cfbSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
252308c70cfbSmrg#
252408c70cfbSmrg# This file is free software; the Free Software Foundation
252508c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
252608c70cfbSmrg# with or without modifications, as long as this notice is preserved.
2527602e473dSmrg
252808c70cfbSmrg# This macro actually does too much.  Some checks are only needed if
252908c70cfbSmrg# your package does certain things.  But this isn't really a big deal.
2530602e473dSmrg
25311016ad83Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
25321016ad83Smrgm4_define([AC_PROG_CC],
25331016ad83Smrgm4_defn([AC_PROG_CC])
25341016ad83Smrg[_AM_PROG_CC_C_O
25351016ad83Smrg])
25361016ad83Smrg
253708c70cfbSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
253808c70cfbSmrg# AM_INIT_AUTOMAKE([OPTIONS])
253908c70cfbSmrg# -----------------------------------------------
254008c70cfbSmrg# The call with PACKAGE and VERSION arguments is the old style
254108c70cfbSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
254208c70cfbSmrg# and VERSION should now be passed to AC_INIT and removed from
254308c70cfbSmrg# the call to AM_INIT_AUTOMAKE.
254408c70cfbSmrg# We support both call styles for the transition.  After
254508c70cfbSmrg# the next Automake release, Autoconf can make the AC_INIT
254608c70cfbSmrg# arguments mandatory, and then we can depend on a new Autoconf
254708c70cfbSmrg# release and drop the old call support.
254808c70cfbSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
254908c70cfbSmrg[AC_PREREQ([2.65])dnl
255008c70cfbSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
255108c70cfbSmrgdnl the ones we care about.
255208c70cfbSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
255308c70cfbSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
255408c70cfbSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
255508c70cfbSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
255608c70cfbSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
255708c70cfbSmrg  # is not polluted with repeated "-I."
255808c70cfbSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
255908c70cfbSmrg  # test to see if srcdir already configured
256008c70cfbSmrg  if test -f $srcdir/config.status; then
256108c70cfbSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
256208c70cfbSmrg  fi
256308c70cfbSmrgfi
256421298544Smrg
256508c70cfbSmrg# test whether we have cygpath
256608c70cfbSmrgif test -z "$CYGPATH_W"; then
256708c70cfbSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
256808c70cfbSmrg    CYGPATH_W='cygpath -w'
256908c70cfbSmrg  else
257008c70cfbSmrg    CYGPATH_W=echo
257108c70cfbSmrg  fi
257208c70cfbSmrgfi
257308c70cfbSmrgAC_SUBST([CYGPATH_W])
257421298544Smrg
257508c70cfbSmrg# Define the identity of the package.
257608c70cfbSmrgdnl Distinguish between old-style and new-style calls.
257708c70cfbSmrgm4_ifval([$2],
257808c70cfbSmrg[AC_DIAGNOSE([obsolete],
257908c70cfbSmrg             [$0: two- and three-arguments forms are deprecated.])
258008c70cfbSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
258108c70cfbSmrg AC_SUBST([PACKAGE], [$1])dnl
258208c70cfbSmrg AC_SUBST([VERSION], [$2])],
258308c70cfbSmrg[_AM_SET_OPTIONS([$1])dnl
258408c70cfbSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
258508c70cfbSmrgm4_if(
258608c70cfbSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
258708c70cfbSmrg  [ok:ok],,
258808c70cfbSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
258908c70cfbSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
259008c70cfbSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
259121298544Smrg
259208c70cfbSmrg_AM_IF_OPTION([no-define],,
259308c70cfbSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
259408c70cfbSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
259521298544Smrg
259608c70cfbSmrg# Some tools Automake needs.
259708c70cfbSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
259808c70cfbSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
259908c70cfbSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
260008c70cfbSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
260108c70cfbSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
260208c70cfbSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
260308c70cfbSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
260408c70cfbSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
260508c70cfbSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
260608c70cfbSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
260708c70cfbSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
260808c70cfbSmrg# dies out for good.  For more background, see:
260908c70cfbSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
261008c70cfbSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
261108c70cfbSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
261208c70cfbSmrg# We need awk for the "check" target.  The system "awk" is bad on
261308c70cfbSmrg# some platforms.
261408c70cfbSmrgAC_REQUIRE([AC_PROG_AWK])dnl
261508c70cfbSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
261608c70cfbSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
261708c70cfbSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
261808c70cfbSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
261908c70cfbSmrg			     [_AM_PROG_TAR([v7])])])
262008c70cfbSmrg_AM_IF_OPTION([no-dependencies],,
262108c70cfbSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
262208c70cfbSmrg		  [_AM_DEPENDENCIES([CC])],
262308c70cfbSmrg		  [m4_define([AC_PROG_CC],
262408c70cfbSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
262508c70cfbSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
262608c70cfbSmrg		  [_AM_DEPENDENCIES([CXX])],
262708c70cfbSmrg		  [m4_define([AC_PROG_CXX],
262808c70cfbSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
262908c70cfbSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
263008c70cfbSmrg		  [_AM_DEPENDENCIES([OBJC])],
263108c70cfbSmrg		  [m4_define([AC_PROG_OBJC],
263208c70cfbSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
263308c70cfbSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
263408c70cfbSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
263508c70cfbSmrg		  [m4_define([AC_PROG_OBJCXX],
263608c70cfbSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
263708c70cfbSmrg])
263808c70cfbSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
263908c70cfbSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
264008c70cfbSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
264108c70cfbSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
264208c70cfbSmrgAC_CONFIG_COMMANDS_PRE(dnl
264308c70cfbSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
264408c70cfbSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
26451016ad83Smrg
26461016ad83Smrg# POSIX will say in a future version that running "rm -f" with no argument
26471016ad83Smrg# is OK; and we want to be able to make that assumption in our Makefile
26481016ad83Smrg# recipes.  So use an aggressive probe to check that the usage we want is
26491016ad83Smrg# actually supported "in the wild" to an acceptable degree.
26501016ad83Smrg# See automake bug#10828.
26511016ad83Smrg# To make any issue more visible, cause the running configure to be aborted
26521016ad83Smrg# by default if the 'rm' program in use doesn't match our expectations; the
26531016ad83Smrg# user can still override this though.
26541016ad83Smrgif rm -f && rm -fr && rm -rf; then : OK; else
26551016ad83Smrg  cat >&2 <<'END'
26561016ad83SmrgOops!
26571016ad83Smrg
26581016ad83SmrgYour 'rm' program seems unable to run without file operands specified
26591016ad83Smrgon the command line, even when the '-f' option is present.  This is contrary
26601016ad83Smrgto the behaviour of most rm programs out there, and not conforming with
26611016ad83Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
26621016ad83Smrg
26631016ad83SmrgPlease tell bug-automake@gnu.org about your system, including the value
26641016ad83Smrgof your $PATH and any error possibly output before this message.  This
26651016ad83Smrgcan help us improve future automake versions.
26661016ad83Smrg
26671016ad83SmrgEND
26681016ad83Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
26691016ad83Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
26701016ad83Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
26711016ad83Smrg    echo >&2
26721016ad83Smrg  else
26731016ad83Smrg    cat >&2 <<'END'
26741016ad83SmrgAborting the configuration process, to ensure you take notice of the issue.
26751016ad83Smrg
26761016ad83SmrgYou can download and install GNU coreutils to get an 'rm' implementation
26771016ad83Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
26781016ad83Smrg
26791016ad83SmrgIf you want to complete the configuration process using your problematic
26801016ad83Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
26811016ad83Smrgto "yes", and re-run configure.
26821016ad83Smrg
26831016ad83SmrgEND
26841016ad83Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
26851016ad83Smrg  fi
26861c7386f4Smrgfi
26871c7386f4Smrg])
268821298544Smrg
268908c70cfbSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
269008c70cfbSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
269108c70cfbSmrgdnl mangled by Autoconf and run in a shell conditional statement.
269208c70cfbSmrgm4_define([_AC_COMPILER_EXEEXT],
269308c70cfbSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
2694602e473dSmrg
269508c70cfbSmrg# When config.status generates a header, we must update the stamp-h file.
269608c70cfbSmrg# This file resides in the same directory as the config header
269708c70cfbSmrg# that is generated.  The stamp files are numbered to have different names.
2698602e473dSmrg
269908c70cfbSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
270008c70cfbSmrg# loop where config.status creates the headers, so we can generate
270108c70cfbSmrg# our stamp files there.
270208c70cfbSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
270308c70cfbSmrg[# Compute $1's index in $config_headers.
270408c70cfbSmrg_am_arg=$1
270508c70cfbSmrg_am_stamp_count=1
270608c70cfbSmrgfor _am_header in $config_headers :; do
270708c70cfbSmrg  case $_am_header in
270808c70cfbSmrg    $_am_arg | $_am_arg:* )
270908c70cfbSmrg      break ;;
271008c70cfbSmrg    * )
271108c70cfbSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
271208c70cfbSmrg  esac
271308c70cfbSmrgdone
271408c70cfbSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
2715602e473dSmrg
271608c70cfbSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
271708c70cfbSmrg#
271808c70cfbSmrg# This file is free software; the Free Software Foundation
271908c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
272008c70cfbSmrg# with or without modifications, as long as this notice is preserved.
2721602e473dSmrg
272208c70cfbSmrg# AM_PROG_INSTALL_SH
272308c70cfbSmrg# ------------------
272408c70cfbSmrg# Define $install_sh.
272508c70cfbSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
272608c70cfbSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
272708c70cfbSmrgif test x"${install_sh}" != xset; then
272808c70cfbSmrg  case $am_aux_dir in
272908c70cfbSmrg  *\ * | *\	*)
273008c70cfbSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
273108c70cfbSmrg  *)
273208c70cfbSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
273308c70cfbSmrg  esac
273408c70cfbSmrgfi
273508c70cfbSmrgAC_SUBST([install_sh])])
2736602e473dSmrg
273708c70cfbSmrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
273808c70cfbSmrg#
273908c70cfbSmrg# This file is free software; the Free Software Foundation
274008c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
274108c70cfbSmrg# with or without modifications, as long as this notice is preserved.
2742602e473dSmrg
274308c70cfbSmrg# Check whether the underlying file-system supports filenames
274408c70cfbSmrg# with a leading dot.  For instance MS-DOS doesn't.
274508c70cfbSmrgAC_DEFUN([AM_SET_LEADING_DOT],
274608c70cfbSmrg[rm -rf .tst 2>/dev/null
274708c70cfbSmrgmkdir .tst 2>/dev/null
274808c70cfbSmrgif test -d .tst; then
274908c70cfbSmrg  am__leading_dot=.
275008c70cfbSmrgelse
275108c70cfbSmrg  am__leading_dot=_
275208c70cfbSmrgfi
275308c70cfbSmrgrmdir .tst 2>/dev/null
275408c70cfbSmrgAC_SUBST([am__leading_dot])])
2755602e473dSmrg
275608c70cfbSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
2757602e473dSmrg
275808c70cfbSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
275908c70cfbSmrg#
276008c70cfbSmrg# This file is free software; the Free Software Foundation
276108c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
276208c70cfbSmrg# with or without modifications, as long as this notice is preserved.
2763602e473dSmrg
276408c70cfbSmrg# AM_MAKE_INCLUDE()
276508c70cfbSmrg# -----------------
276608c70cfbSmrg# Check to see how make treats includes.
276708c70cfbSmrgAC_DEFUN([AM_MAKE_INCLUDE],
276808c70cfbSmrg[am_make=${MAKE-make}
276908c70cfbSmrgcat > confinc << 'END'
277008c70cfbSmrgam__doit:
277108c70cfbSmrg	@echo this is the am__doit target
277208c70cfbSmrg.PHONY: am__doit
277308c70cfbSmrgEND
277408c70cfbSmrg# If we don't find an include directive, just comment out the code.
277508c70cfbSmrgAC_MSG_CHECKING([for style of include used by $am_make])
277608c70cfbSmrgam__include="#"
277708c70cfbSmrgam__quote=
277808c70cfbSmrg_am_result=none
277908c70cfbSmrg# First try GNU make style include.
278008c70cfbSmrgecho "include confinc" > confmf
278108c70cfbSmrg# Ignore all kinds of additional output from 'make'.
278208c70cfbSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
278308c70cfbSmrg*the\ am__doit\ target*)
278408c70cfbSmrg  am__include=include
278508c70cfbSmrg  am__quote=
278608c70cfbSmrg  _am_result=GNU
278708c70cfbSmrg  ;;
278808c70cfbSmrgesac
278908c70cfbSmrg# Now try BSD make style include.
279008c70cfbSmrgif test "$am__include" = "#"; then
279108c70cfbSmrg   echo '.include "confinc"' > confmf
279208c70cfbSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
279308c70cfbSmrg   *the\ am__doit\ target*)
279408c70cfbSmrg     am__include=.include
279508c70cfbSmrg     am__quote="\""
279608c70cfbSmrg     _am_result=BSD
279708c70cfbSmrg     ;;
279808c70cfbSmrg   esac
279908c70cfbSmrgfi
280008c70cfbSmrgAC_SUBST([am__include])
280108c70cfbSmrgAC_SUBST([am__quote])
280208c70cfbSmrgAC_MSG_RESULT([$_am_result])
280308c70cfbSmrgrm -f confinc confmf
2804602e473dSmrg])
2805602e473dSmrg
280608c70cfbSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2807602e473dSmrg
280808c70cfbSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
280908c70cfbSmrg#
281008c70cfbSmrg# This file is free software; the Free Software Foundation
281108c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
281208c70cfbSmrg# with or without modifications, as long as this notice is preserved.
2813602e473dSmrg
281408c70cfbSmrg# AM_MISSING_PROG(NAME, PROGRAM)
281508c70cfbSmrg# ------------------------------
281608c70cfbSmrgAC_DEFUN([AM_MISSING_PROG],
281708c70cfbSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
281808c70cfbSmrg$1=${$1-"${am_missing_run}$2"}
281908c70cfbSmrgAC_SUBST($1)])
2820602e473dSmrg
282108c70cfbSmrg# AM_MISSING_HAS_RUN
282208c70cfbSmrg# ------------------
282308c70cfbSmrg# Define MISSING if not defined so far and test if it is modern enough.
282408c70cfbSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
282508c70cfbSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
282608c70cfbSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
282708c70cfbSmrgAC_REQUIRE_AUX_FILE([missing])dnl
282808c70cfbSmrgif test x"${MISSING+set}" != xset; then
282908c70cfbSmrg  case $am_aux_dir in
283008c70cfbSmrg  *\ * | *\	*)
283108c70cfbSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
283208c70cfbSmrg  *)
283308c70cfbSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
283408c70cfbSmrg  esac
283508c70cfbSmrgfi
283608c70cfbSmrg# Use eval to expand $SHELL
283708c70cfbSmrgif eval "$MISSING --is-lightweight"; then
283808c70cfbSmrg  am_missing_run="$MISSING "
283908c70cfbSmrgelse
284008c70cfbSmrg  am_missing_run=
284108c70cfbSmrg  AC_MSG_WARN(['missing' script is too old or missing])
284208c70cfbSmrgfi
2843602e473dSmrg])
2844602e473dSmrg
284508c70cfbSmrg# Helper functions for option handling.                     -*- Autoconf -*-
2846602e473dSmrg
284708c70cfbSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
284808c70cfbSmrg#
284908c70cfbSmrg# This file is free software; the Free Software Foundation
285008c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
285108c70cfbSmrg# with or without modifications, as long as this notice is preserved.
2852602e473dSmrg
285308c70cfbSmrg# _AM_MANGLE_OPTION(NAME)
285408c70cfbSmrg# -----------------------
285508c70cfbSmrgAC_DEFUN([_AM_MANGLE_OPTION],
285608c70cfbSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2857602e473dSmrg
285808c70cfbSmrg# _AM_SET_OPTION(NAME)
285908c70cfbSmrg# --------------------
286008c70cfbSmrg# Set option NAME.  Presently that only means defining a flag for this option.
286108c70cfbSmrgAC_DEFUN([_AM_SET_OPTION],
286208c70cfbSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
2863602e473dSmrg
286408c70cfbSmrg# _AM_SET_OPTIONS(OPTIONS)
286508c70cfbSmrg# ------------------------
286608c70cfbSmrg# OPTIONS is a space-separated list of Automake options.
286708c70cfbSmrgAC_DEFUN([_AM_SET_OPTIONS],
286808c70cfbSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2869602e473dSmrg
287008c70cfbSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
287108c70cfbSmrg# -------------------------------------------
287208c70cfbSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
287308c70cfbSmrgAC_DEFUN([_AM_IF_OPTION],
287408c70cfbSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2875602e473dSmrg
287608c70cfbSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
287708c70cfbSmrg#
287808c70cfbSmrg# This file is free software; the Free Software Foundation
287908c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
288008c70cfbSmrg# with or without modifications, as long as this notice is preserved.
2881602e473dSmrg
28821016ad83Smrg# _AM_PROG_CC_C_O
28831016ad83Smrg# ---------------
28841016ad83Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
28851016ad83Smrg# to automatically call this.
28861016ad83SmrgAC_DEFUN([_AM_PROG_CC_C_O],
28871016ad83Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
28881016ad83SmrgAC_REQUIRE_AUX_FILE([compile])dnl
28891016ad83SmrgAC_LANG_PUSH([C])dnl
28901016ad83SmrgAC_CACHE_CHECK(
28911016ad83Smrg  [whether $CC understands -c and -o together],
28921016ad83Smrg  [am_cv_prog_cc_c_o],
28931016ad83Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
28941016ad83Smrg  # Make sure it works both with $CC and with simple cc.
28951016ad83Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
28961016ad83Smrg  # compilers refuse to overwrite an existing .o file with -o,
28971016ad83Smrg  # though they will create one.
28981016ad83Smrg  am_cv_prog_cc_c_o=yes
28991016ad83Smrg  for am_i in 1 2; do
29001016ad83Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
29011016ad83Smrg         && test -f conftest2.$ac_objext; then
29021016ad83Smrg      : OK
29031016ad83Smrg    else
29041016ad83Smrg      am_cv_prog_cc_c_o=no
29051016ad83Smrg      break
29061016ad83Smrg    fi
29071016ad83Smrg  done
29081016ad83Smrg  rm -f core conftest*
29091016ad83Smrg  unset am_i])
29101016ad83Smrgif test "$am_cv_prog_cc_c_o" != yes; then
29111016ad83Smrg   # Losing compiler, so override with the script.
29121016ad83Smrg   # FIXME: It is wrong to rewrite CC.
29131016ad83Smrg   # But if we don't then we get into trouble of one sort or another.
29141016ad83Smrg   # A longer-term fix would be to have automake use am__CC in this case,
29151016ad83Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
29161016ad83Smrg   CC="$am_aux_dir/compile $CC"
29171016ad83Smrgfi
29181016ad83SmrgAC_LANG_POP([C])])
29191016ad83Smrg
29201016ad83Smrg# For backward compatibility.
29211016ad83SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
29221016ad83Smrg
29231016ad83Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
29241016ad83Smrg#
29251016ad83Smrg# This file is free software; the Free Software Foundation
29261016ad83Smrg# gives unlimited permission to copy and/or distribute it,
29271016ad83Smrg# with or without modifications, as long as this notice is preserved.
29281016ad83Smrg
2929602e473dSmrg
293008c70cfbSmrg# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
293108c70cfbSmrg# ---------------------------------------------------------------------------
293208c70cfbSmrg# Adds support for distributing Python modules and packages.  To
293308c70cfbSmrg# install modules, copy them to $(pythondir), using the python_PYTHON
293408c70cfbSmrg# automake variable.  To install a package with the same name as the
293508c70cfbSmrg# automake package, install to $(pkgpythondir), or use the
293608c70cfbSmrg# pkgpython_PYTHON automake variable.
2937602e473dSmrg#
293808c70cfbSmrg# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
293908c70cfbSmrg# locations to install python extension modules (shared libraries).
294008c70cfbSmrg# Another macro is required to find the appropriate flags to compile
294108c70cfbSmrg# extension modules.
294208c70cfbSmrg#
294308c70cfbSmrg# If your package is configured with a different prefix to python,
294408c70cfbSmrg# users will have to add the install directory to the PYTHONPATH
294508c70cfbSmrg# environment variable, or create a .pth file (see the python
294608c70cfbSmrg# documentation for details).
294708c70cfbSmrg#
294808c70cfbSmrg# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
294908c70cfbSmrg# cause an error if the version of python installed on the system
295008c70cfbSmrg# doesn't meet the requirement.  MINIMUM-VERSION should consist of
295108c70cfbSmrg# numbers and dots only.
295208c70cfbSmrgAC_DEFUN([AM_PATH_PYTHON],
295308c70cfbSmrg [
295408c70cfbSmrg  dnl Find a Python interpreter.  Python versions prior to 2.0 are not
295508c70cfbSmrg  dnl supported. (2.0 was released on October 16, 2000).
295608c70cfbSmrg  m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
295708c70cfbSmrg[python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl
295808c70cfbSmrg python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
2959602e473dSmrg
296008c70cfbSmrg  AC_ARG_VAR([PYTHON], [the Python interpreter])
2961602e473dSmrg
296208c70cfbSmrg  m4_if([$1],[],[
296308c70cfbSmrg    dnl No version check is needed.
296408c70cfbSmrg    # Find any Python interpreter.
296508c70cfbSmrg    if test -z "$PYTHON"; then
296608c70cfbSmrg      AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
296708c70cfbSmrg    fi
296808c70cfbSmrg    am_display_PYTHON=python
296908c70cfbSmrg  ], [
297008c70cfbSmrg    dnl A version check is needed.
297108c70cfbSmrg    if test -n "$PYTHON"; then
297208c70cfbSmrg      # If the user set $PYTHON, use it and don't search something else.
297308c70cfbSmrg      AC_MSG_CHECKING([whether $PYTHON version is >= $1])
297408c70cfbSmrg      AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
297508c70cfbSmrg			      [AC_MSG_RESULT([yes])],
297608c70cfbSmrg			      [AC_MSG_RESULT([no])
297708c70cfbSmrg			       AC_MSG_ERROR([Python interpreter is too old])])
297808c70cfbSmrg      am_display_PYTHON=$PYTHON
297908c70cfbSmrg    else
298008c70cfbSmrg      # Otherwise, try each interpreter until we find one that satisfies
298108c70cfbSmrg      # VERSION.
298208c70cfbSmrg      AC_CACHE_CHECK([for a Python interpreter with version >= $1],
298308c70cfbSmrg	[am_cv_pathless_PYTHON],[
298408c70cfbSmrg	for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
298508c70cfbSmrg	  test "$am_cv_pathless_PYTHON" = none && break
298608c70cfbSmrg	  AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
298708c70cfbSmrg	done])
298808c70cfbSmrg      # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
298908c70cfbSmrg      if test "$am_cv_pathless_PYTHON" = none; then
299008c70cfbSmrg	PYTHON=:
299108c70cfbSmrg      else
299208c70cfbSmrg        AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
299308c70cfbSmrg      fi
299408c70cfbSmrg      am_display_PYTHON=$am_cv_pathless_PYTHON
299508c70cfbSmrg    fi
299608c70cfbSmrg  ])
2997602e473dSmrg
299808c70cfbSmrg  if test "$PYTHON" = :; then
299908c70cfbSmrg  dnl Run any user-specified action, or abort.
300008c70cfbSmrg    m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
300108c70cfbSmrg  else
3002602e473dSmrg
300308c70cfbSmrg  dnl Query Python for its version number.  Getting [:3] seems to be
300408c70cfbSmrg  dnl the best way to do this; it's what "site.py" does in the standard
300508c70cfbSmrg  dnl library.
3006602e473dSmrg
300708c70cfbSmrg  AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
300808c70cfbSmrg    [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
300908c70cfbSmrg  AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
3010602e473dSmrg
301108c70cfbSmrg  dnl Use the values of $prefix and $exec_prefix for the corresponding
301208c70cfbSmrg  dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX.  These are made
301308c70cfbSmrg  dnl distinct variables so they can be overridden if need be.  However,
301408c70cfbSmrg  dnl general consensus is that you shouldn't need this ability.
3015602e473dSmrg
301608c70cfbSmrg  AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
301708c70cfbSmrg  AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
3018602e473dSmrg
301908c70cfbSmrg  dnl At times (like when building shared libraries) you may want
302008c70cfbSmrg  dnl to know which OS platform Python thinks this is.
3021602e473dSmrg
302208c70cfbSmrg  AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
302308c70cfbSmrg    [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
302408c70cfbSmrg  AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
3025602e473dSmrg
302608c70cfbSmrg  # Just factor out some code duplication.
302708c70cfbSmrg  am_python_setup_sysconfig="\
302808c70cfbSmrgimport sys
302908c70cfbSmrg# Prefer sysconfig over distutils.sysconfig, for better compatibility
303008c70cfbSmrg# with python 3.x.  See automake bug#10227.
303108c70cfbSmrgtry:
303208c70cfbSmrg    import sysconfig
303308c70cfbSmrgexcept ImportError:
303408c70cfbSmrg    can_use_sysconfig = 0
303508c70cfbSmrgelse:
303608c70cfbSmrg    can_use_sysconfig = 1
303708c70cfbSmrg# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
303808c70cfbSmrg# <https://github.com/pypa/virtualenv/issues/118>
303908c70cfbSmrgtry:
304008c70cfbSmrg    from platform import python_implementation
304108c70cfbSmrg    if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
304208c70cfbSmrg        can_use_sysconfig = 0
304308c70cfbSmrgexcept ImportError:
304408c70cfbSmrg    pass"
3045602e473dSmrg
304608c70cfbSmrg  dnl Set up 4 directories:
3047602e473dSmrg
304808c70cfbSmrg  dnl pythondir -- where to install python scripts.  This is the
304908c70cfbSmrg  dnl   site-packages directory, not the python standard library
305008c70cfbSmrg  dnl   directory like in previous automake betas.  This behavior
305108c70cfbSmrg  dnl   is more consistent with lispdir.m4 for example.
305208c70cfbSmrg  dnl Query distutils for this directory.
305308c70cfbSmrg  AC_CACHE_CHECK([for $am_display_PYTHON script directory],
305408c70cfbSmrg    [am_cv_python_pythondir],
305508c70cfbSmrg    [if test "x$prefix" = xNONE
305608c70cfbSmrg     then
305708c70cfbSmrg       am_py_prefix=$ac_default_prefix
305808c70cfbSmrg     else
305908c70cfbSmrg       am_py_prefix=$prefix
306008c70cfbSmrg     fi
306108c70cfbSmrg     am_cv_python_pythondir=`$PYTHON -c "
306208c70cfbSmrg$am_python_setup_sysconfig
306308c70cfbSmrgif can_use_sysconfig:
306408c70cfbSmrg    sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
306508c70cfbSmrgelse:
306608c70cfbSmrg    from distutils import sysconfig
306708c70cfbSmrg    sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
306808c70cfbSmrgsys.stdout.write(sitedir)"`
306908c70cfbSmrg     case $am_cv_python_pythondir in
307008c70cfbSmrg     $am_py_prefix*)
307108c70cfbSmrg       am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
307208c70cfbSmrg       am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
307308c70cfbSmrg       ;;
307408c70cfbSmrg     *)
307508c70cfbSmrg       case $am_py_prefix in
307608c70cfbSmrg         /usr|/System*) ;;
307708c70cfbSmrg         *)
307808c70cfbSmrg	  am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
307908c70cfbSmrg	  ;;
308008c70cfbSmrg       esac
308108c70cfbSmrg       ;;
308208c70cfbSmrg     esac
308308c70cfbSmrg    ])
308408c70cfbSmrg  AC_SUBST([pythondir], [$am_cv_python_pythondir])
3085602e473dSmrg
308608c70cfbSmrg  dnl pkgpythondir -- $PACKAGE directory under pythondir.  Was
308708c70cfbSmrg  dnl   PYTHON_SITE_PACKAGE in previous betas, but this naming is
308808c70cfbSmrg  dnl   more consistent with the rest of automake.
3089602e473dSmrg
309008c70cfbSmrg  AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
3091602e473dSmrg
309208c70cfbSmrg  dnl pyexecdir -- directory for installing python extension modules
309308c70cfbSmrg  dnl   (shared libraries)
309408c70cfbSmrg  dnl Query distutils for this directory.
309508c70cfbSmrg  AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
309608c70cfbSmrg    [am_cv_python_pyexecdir],
309708c70cfbSmrg    [if test "x$exec_prefix" = xNONE
309808c70cfbSmrg     then
309908c70cfbSmrg       am_py_exec_prefix=$am_py_prefix
310008c70cfbSmrg     else
310108c70cfbSmrg       am_py_exec_prefix=$exec_prefix
310208c70cfbSmrg     fi
310308c70cfbSmrg     am_cv_python_pyexecdir=`$PYTHON -c "
310408c70cfbSmrg$am_python_setup_sysconfig
310508c70cfbSmrgif can_use_sysconfig:
310608c70cfbSmrg    sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
310708c70cfbSmrgelse:
310808c70cfbSmrg    from distutils import sysconfig
310908c70cfbSmrg    sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
311008c70cfbSmrgsys.stdout.write(sitedir)"`
311108c70cfbSmrg     case $am_cv_python_pyexecdir in
311208c70cfbSmrg     $am_py_exec_prefix*)
311308c70cfbSmrg       am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
311408c70cfbSmrg       am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
311508c70cfbSmrg       ;;
311608c70cfbSmrg     *)
311708c70cfbSmrg       case $am_py_exec_prefix in
311808c70cfbSmrg         /usr|/System*) ;;
311908c70cfbSmrg         *)
312008c70cfbSmrg	   am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
312108c70cfbSmrg	   ;;
312208c70cfbSmrg       esac
312308c70cfbSmrg       ;;
312408c70cfbSmrg     esac
312508c70cfbSmrg    ])
312608c70cfbSmrg  AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
3127602e473dSmrg
312808c70cfbSmrg  dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
312921298544Smrg
313008c70cfbSmrg  AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
3131602e473dSmrg
313208c70cfbSmrg  dnl Run any user-specified action.
313308c70cfbSmrg  $2
313408c70cfbSmrg  fi
3135602e473dSmrg
3136602e473dSmrg])
3137602e473dSmrg
3138602e473dSmrg
313908c70cfbSmrg# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
314008c70cfbSmrg# ---------------------------------------------------------------------------
314108c70cfbSmrg# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
314208c70cfbSmrg# Run ACTION-IF-FALSE otherwise.
314308c70cfbSmrg# This test uses sys.hexversion instead of the string equivalent (first
314408c70cfbSmrg# word of sys.version), in order to cope with versions such as 2.2c1.
314508c70cfbSmrg# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
314608c70cfbSmrgAC_DEFUN([AM_PYTHON_CHECK_VERSION],
314708c70cfbSmrg [prog="import sys
314808c70cfbSmrg# split strings by '.' and convert to numeric.  Append some zeros
314908c70cfbSmrg# because we need at least 4 digits for the hex conversion.
315008c70cfbSmrg# map returns an iterator in Python 3.0 and a list in 2.x
315108c70cfbSmrgminver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
315208c70cfbSmrgminverhex = 0
315308c70cfbSmrg# xrange is not present in Python 3.0 and range returns an iterator
315408c70cfbSmrgfor i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
315508c70cfbSmrgsys.exit(sys.hexversion < minverhex)"
315608c70cfbSmrg  AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
3157602e473dSmrg
315808c70cfbSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
315908c70cfbSmrg#
316008c70cfbSmrg# This file is free software; the Free Software Foundation
316108c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
316208c70cfbSmrg# with or without modifications, as long as this notice is preserved.
3163602e473dSmrg
316408c70cfbSmrg# AM_RUN_LOG(COMMAND)
316508c70cfbSmrg# -------------------
316608c70cfbSmrg# Run COMMAND, save the exit status in ac_status, and log it.
316708c70cfbSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
316808c70cfbSmrgAC_DEFUN([AM_RUN_LOG],
316908c70cfbSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
317008c70cfbSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
317108c70cfbSmrg   ac_status=$?
317208c70cfbSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
317308c70cfbSmrg   (exit $ac_status); }])
3174602e473dSmrg
317508c70cfbSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
3176602e473dSmrg
317708c70cfbSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
317808c70cfbSmrg#
317908c70cfbSmrg# This file is free software; the Free Software Foundation
318008c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
318108c70cfbSmrg# with or without modifications, as long as this notice is preserved.
3182602e473dSmrg
318308c70cfbSmrg# AM_SANITY_CHECK
318408c70cfbSmrg# ---------------
318508c70cfbSmrgAC_DEFUN([AM_SANITY_CHECK],
318608c70cfbSmrg[AC_MSG_CHECKING([whether build environment is sane])
318708c70cfbSmrg# Reject unsafe characters in $srcdir or the absolute working directory
318808c70cfbSmrg# name.  Accept space and tab only in the latter.
318908c70cfbSmrgam_lf='
319008c70cfbSmrg'
319108c70cfbSmrgcase `pwd` in
319208c70cfbSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
319308c70cfbSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
319408c70cfbSmrgesac
319508c70cfbSmrgcase $srcdir in
319608c70cfbSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
319708c70cfbSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
319808c70cfbSmrgesac
3199602e473dSmrg
320008c70cfbSmrg# Do 'set' in a subshell so we don't clobber the current shell's
320108c70cfbSmrg# arguments.  Must try -L first in case configure is actually a
320208c70cfbSmrg# symlink; some systems play weird games with the mod time of symlinks
320308c70cfbSmrg# (eg FreeBSD returns the mod time of the symlink's containing
320408c70cfbSmrg# directory).
320508c70cfbSmrgif (
320608c70cfbSmrg   am_has_slept=no
320708c70cfbSmrg   for am_try in 1 2; do
320808c70cfbSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
320908c70cfbSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
321008c70cfbSmrg     if test "$[*]" = "X"; then
321108c70cfbSmrg	# -L didn't work.
321208c70cfbSmrg	set X `ls -t "$srcdir/configure" conftest.file`
321308c70cfbSmrg     fi
321408c70cfbSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
321508c70cfbSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
321608c70cfbSmrg
321708c70cfbSmrg	# If neither matched, then we have a broken ls.  This can happen
321808c70cfbSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
321908c70cfbSmrg	# broken ls alias from the environment.  This has actually
322008c70cfbSmrg	# happened.  Such a system could not be considered "sane".
322108c70cfbSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
322208c70cfbSmrg  alias in your environment])
322308c70cfbSmrg     fi
322408c70cfbSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
322508c70cfbSmrg       break
322608c70cfbSmrg     fi
322708c70cfbSmrg     # Just in case.
322808c70cfbSmrg     sleep 1
322908c70cfbSmrg     am_has_slept=yes
323008c70cfbSmrg   done
323108c70cfbSmrg   test "$[2]" = conftest.file
323208c70cfbSmrg   )
323308c70cfbSmrgthen
323408c70cfbSmrg   # Ok.
323508c70cfbSmrg   :
323608c70cfbSmrgelse
323708c70cfbSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
323808c70cfbSmrgCheck your system clock])
323908c70cfbSmrgfi
324008c70cfbSmrgAC_MSG_RESULT([yes])
324108c70cfbSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
324208c70cfbSmrg# generated files are strictly newer.
324308c70cfbSmrgam_sleep_pid=
324408c70cfbSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
324508c70cfbSmrg  ( sleep 1 ) &
324608c70cfbSmrg  am_sleep_pid=$!
324708c70cfbSmrgfi
324808c70cfbSmrgAC_CONFIG_COMMANDS_PRE(
324908c70cfbSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
325008c70cfbSmrg   if test -n "$am_sleep_pid"; then
325108c70cfbSmrg     # Hide warnings about reused PIDs.
325208c70cfbSmrg     wait $am_sleep_pid 2>/dev/null
325308c70cfbSmrg   fi
325408c70cfbSmrg   AC_MSG_RESULT([done])])
325508c70cfbSmrgrm -f conftest.file
325608c70cfbSmrg])
3257602e473dSmrg
325808c70cfbSmrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
325908c70cfbSmrg#
326008c70cfbSmrg# This file is free software; the Free Software Foundation
326108c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
326208c70cfbSmrg# with or without modifications, as long as this notice is preserved.
3263602e473dSmrg
326408c70cfbSmrg# AM_SILENT_RULES([DEFAULT])
326508c70cfbSmrg# --------------------------
326608c70cfbSmrg# Enable less verbose build rules; with the default set to DEFAULT
326708c70cfbSmrg# ("yes" being less verbose, "no" or empty being verbose).
326808c70cfbSmrgAC_DEFUN([AM_SILENT_RULES],
326908c70cfbSmrg[AC_ARG_ENABLE([silent-rules], [dnl
327008c70cfbSmrgAS_HELP_STRING(
327108c70cfbSmrg  [--enable-silent-rules],
327208c70cfbSmrg  [less verbose build output (undo: "make V=1")])
327308c70cfbSmrgAS_HELP_STRING(
327408c70cfbSmrg  [--disable-silent-rules],
327508c70cfbSmrg  [verbose build output (undo: "make V=0")])dnl
327608c70cfbSmrg])
327708c70cfbSmrgcase $enable_silent_rules in @%:@ (((
327808c70cfbSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
327908c70cfbSmrg   no) AM_DEFAULT_VERBOSITY=1;;
328008c70cfbSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
328108c70cfbSmrgesac
328208c70cfbSmrgdnl
328308c70cfbSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
328408c70cfbSmrgdnl do not support nested variable expansions.
328508c70cfbSmrgdnl See automake bug#9928 and bug#10237.
328608c70cfbSmrgam_make=${MAKE-make}
328708c70cfbSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
328808c70cfbSmrg   [am_cv_make_support_nested_variables],
328908c70cfbSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
329008c70cfbSmrgBAR0=false
329108c70cfbSmrgBAR1=true
329208c70cfbSmrgV=1
329308c70cfbSmrgam__doit:
329408c70cfbSmrg	@$(TRUE)
329508c70cfbSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
329608c70cfbSmrg  am_cv_make_support_nested_variables=yes
329708c70cfbSmrgelse
329808c70cfbSmrg  am_cv_make_support_nested_variables=no
329908c70cfbSmrgfi])
330008c70cfbSmrgif test $am_cv_make_support_nested_variables = yes; then
330108c70cfbSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
330208c70cfbSmrg  AM_V='$(V)'
330308c70cfbSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
330408c70cfbSmrgelse
330508c70cfbSmrg  AM_V=$AM_DEFAULT_VERBOSITY
330608c70cfbSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
3307602e473dSmrgfi
330808c70cfbSmrgAC_SUBST([AM_V])dnl
330908c70cfbSmrgAM_SUBST_NOTMAKE([AM_V])dnl
331008c70cfbSmrgAC_SUBST([AM_DEFAULT_V])dnl
331108c70cfbSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
331208c70cfbSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
331308c70cfbSmrgAM_BACKSLASH='\'
331408c70cfbSmrgAC_SUBST([AM_BACKSLASH])dnl
331508c70cfbSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
331608c70cfbSmrg])
3317602e473dSmrg
331808c70cfbSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
331908c70cfbSmrg#
332008c70cfbSmrg# This file is free software; the Free Software Foundation
332108c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
332208c70cfbSmrg# with or without modifications, as long as this notice is preserved.
3323602e473dSmrg
332408c70cfbSmrg# AM_PROG_INSTALL_STRIP
332508c70cfbSmrg# ---------------------
332608c70cfbSmrg# One issue with vendor 'install' (even GNU) is that you can't
332708c70cfbSmrg# specify the program used to strip binaries.  This is especially
332808c70cfbSmrg# annoying in cross-compiling environments, where the build's strip
332908c70cfbSmrg# is unlikely to handle the host's binaries.
333008c70cfbSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
333108c70cfbSmrg# always use install-sh in "make install-strip", and initialize
333208c70cfbSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
333308c70cfbSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
333408c70cfbSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
333508c70cfbSmrg# Installed binaries are usually stripped using 'strip' when the user
333608c70cfbSmrg# run "make install-strip".  However 'strip' might not be the right
333708c70cfbSmrg# tool to use in cross-compilation environments, therefore Automake
333808c70cfbSmrg# will honor the 'STRIP' environment variable to overrule this program.
333908c70cfbSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
334008c70cfbSmrgif test "$cross_compiling" != no; then
334108c70cfbSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
334208c70cfbSmrgfi
334308c70cfbSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
334408c70cfbSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
3345602e473dSmrg
334608c70cfbSmrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
334708c70cfbSmrg#
334808c70cfbSmrg# This file is free software; the Free Software Foundation
334908c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
335008c70cfbSmrg# with or without modifications, as long as this notice is preserved.
3351602e473dSmrg
335208c70cfbSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
335308c70cfbSmrg# ---------------------------
335408c70cfbSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
335508c70cfbSmrg# This macro is traced by Automake.
335608c70cfbSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
3357602e473dSmrg
335808c70cfbSmrg# AM_SUBST_NOTMAKE(VARIABLE)
335908c70cfbSmrg# --------------------------
336008c70cfbSmrg# Public sister of _AM_SUBST_NOTMAKE.
336108c70cfbSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
3362602e473dSmrg
336308c70cfbSmrg# Check how to create a tarball.                            -*- Autoconf -*-
3364602e473dSmrg
336508c70cfbSmrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
3366602e473dSmrg#
336708c70cfbSmrg# This file is free software; the Free Software Foundation
336808c70cfbSmrg# gives unlimited permission to copy and/or distribute it,
336908c70cfbSmrg# with or without modifications, as long as this notice is preserved.
3370602e473dSmrg
337108c70cfbSmrg# _AM_PROG_TAR(FORMAT)
337208c70cfbSmrg# --------------------
337308c70cfbSmrg# Check how to create a tarball in format FORMAT.
337408c70cfbSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
337508c70cfbSmrg#
337608c70cfbSmrg# Substitute a variable $(am__tar) that is a command
337708c70cfbSmrg# writing to stdout a FORMAT-tarball containing the directory
337808c70cfbSmrg# $tardir.
337908c70cfbSmrg#     tardir=directory && $(am__tar) > result.tar
338008c70cfbSmrg#
338108c70cfbSmrg# Substitute a variable $(am__untar) that extract such
338208c70cfbSmrg# a tarball read from stdin.
338308c70cfbSmrg#     $(am__untar) < result.tar
338408c70cfbSmrg#
338508c70cfbSmrgAC_DEFUN([_AM_PROG_TAR],
338608c70cfbSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
338708c70cfbSmrg# in the wild :-(  We should find a proper way to deprecate it ...
338808c70cfbSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
3389602e473dSmrg
339008c70cfbSmrg# We'll loop over all known methods to create a tar archive until one works.
339108c70cfbSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
3392602e473dSmrg
339308c70cfbSmrgm4_if([$1], [v7],
339408c70cfbSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
339508c70cfbSmrg
339608c70cfbSmrg  [m4_case([$1],
339708c70cfbSmrg    [ustar],
339808c70cfbSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
339908c70cfbSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
340008c70cfbSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
340108c70cfbSmrg      # and bug#13588).
340208c70cfbSmrg      am_max_uid=2097151 # 2^21 - 1
340308c70cfbSmrg      am_max_gid=$am_max_uid
340408c70cfbSmrg      # The $UID and $GID variables are not portable, so we need to resort
340508c70cfbSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
340608c70cfbSmrg      # below are definitely unexpected, so allow the users to see them
340708c70cfbSmrg      # (that is, avoid stderr redirection).
340808c70cfbSmrg      am_uid=`id -u || echo unknown`
340908c70cfbSmrg      am_gid=`id -g || echo unknown`
341008c70cfbSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
341108c70cfbSmrg      if test $am_uid -le $am_max_uid; then
341208c70cfbSmrg         AC_MSG_RESULT([yes])
341308c70cfbSmrg      else
341408c70cfbSmrg         AC_MSG_RESULT([no])
341508c70cfbSmrg         _am_tools=none
341608c70cfbSmrg      fi
341708c70cfbSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
341808c70cfbSmrg      if test $am_gid -le $am_max_gid; then
341908c70cfbSmrg         AC_MSG_RESULT([yes])
342008c70cfbSmrg      else
342108c70cfbSmrg        AC_MSG_RESULT([no])
342208c70cfbSmrg        _am_tools=none
342308c70cfbSmrg      fi],
3424602e473dSmrg
342508c70cfbSmrg  [pax],
342608c70cfbSmrg    [],
3427602e473dSmrg
342808c70cfbSmrg  [m4_fatal([Unknown tar format])])
3429602e473dSmrg
343008c70cfbSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
3431602e473dSmrg
343208c70cfbSmrg  # Go ahead even if we have the value already cached.  We do so because we
343308c70cfbSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
343408c70cfbSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
3435602e473dSmrg
343608c70cfbSmrg  for _am_tool in $_am_tools; do
343708c70cfbSmrg    case $_am_tool in
343808c70cfbSmrg    gnutar)
343908c70cfbSmrg      for _am_tar in tar gnutar gtar; do
344008c70cfbSmrg        AM_RUN_LOG([$_am_tar --version]) && break
344108c70cfbSmrg      done
344208c70cfbSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
344308c70cfbSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
344408c70cfbSmrg      am__untar="$_am_tar -xf -"
344508c70cfbSmrg      ;;
344608c70cfbSmrg    plaintar)
344708c70cfbSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
344808c70cfbSmrg      # ustar tarball either.
344908c70cfbSmrg      (tar --version) >/dev/null 2>&1 && continue
345008c70cfbSmrg      am__tar='tar chf - "$$tardir"'
345108c70cfbSmrg      am__tar_='tar chf - "$tardir"'
345208c70cfbSmrg      am__untar='tar xf -'
345308c70cfbSmrg      ;;
345408c70cfbSmrg    pax)
345508c70cfbSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
345608c70cfbSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
345708c70cfbSmrg      am__untar='pax -r'
345808c70cfbSmrg      ;;
345908c70cfbSmrg    cpio)
346008c70cfbSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
346108c70cfbSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
346208c70cfbSmrg      am__untar='cpio -i -H $1 -d'
346308c70cfbSmrg      ;;
346408c70cfbSmrg    none)
346508c70cfbSmrg      am__tar=false
346608c70cfbSmrg      am__tar_=false
346708c70cfbSmrg      am__untar=false
346808c70cfbSmrg      ;;
346908c70cfbSmrg    esac
3470602e473dSmrg
347108c70cfbSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
347208c70cfbSmrg    # and am__untar set.
347308c70cfbSmrg    test -n "${am_cv_prog_tar_$1}" && break
347408c70cfbSmrg
347508c70cfbSmrg    # tar/untar a dummy directory, and stop if the command works.
347608c70cfbSmrg    rm -rf conftest.dir
347708c70cfbSmrg    mkdir conftest.dir
347808c70cfbSmrg    echo GrepMe > conftest.dir/file
347908c70cfbSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
348008c70cfbSmrg    rm -rf conftest.dir
348108c70cfbSmrg    if test -s conftest.tar; then
348208c70cfbSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
348308c70cfbSmrg      AM_RUN_LOG([cat conftest.dir/file])
348408c70cfbSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
348508c70cfbSmrg    fi
348608c70cfbSmrg  done
348708c70cfbSmrg  rm -rf conftest.dir
3488602e473dSmrg
348908c70cfbSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
349008c70cfbSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
3491602e473dSmrg
349208c70cfbSmrgAC_SUBST([am__tar])
349308c70cfbSmrgAC_SUBST([am__untar])
349408c70cfbSmrg]) # _AM_PROG_TAR
3495602e473dSmrg
34961016ad83Smrgm4_include([m4/libtool.m4])
34971016ad83Smrgm4_include([m4/ltoptions.m4])
34981016ad83Smrgm4_include([m4/ltsugar.m4])
34991016ad83Smrgm4_include([m4/ltversion.m4])
35001016ad83Smrgm4_include([m4/lt~obsolete.m4])
35011016ad83Smrgm4_include([m4/xcb.m4])
3502