aclocal.m4 revision 9f00f3a1
19f00f3a1Smrg# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
2ac92798bSmrg
3ac92798bSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4a966c04fSmrg
5a966c04fSmrg# This file is free software; the Free Software Foundation
6a966c04fSmrg# gives unlimited permission to copy and/or distribute it,
7a966c04fSmrg# with or without modifications, as long as this notice is preserved.
8a966c04fSmrg
9a966c04fSmrg# This program is distributed in the hope that it will be useful,
10a966c04fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11a966c04fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12a966c04fSmrg# PARTICULAR PURPOSE.
13a966c04fSmrg
14ac92798bSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
152e2dd055Smrgm4_ifndef([AC_AUTOCONF_VERSION],
162e2dd055Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
179f00f3a1Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
189f00f3a1Smrg[m4_warning([this file was generated for autoconf 2.69.
192e2dd055SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
202e2dd055SmrgIf you have problems, you may need to regenerate the build system entirely.
21ac92798bSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22a966c04fSmrg
239f00f3a1Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
249f00f3a1Smrg# serial 1 (pkg-config-0.24)
259f00f3a1Smrg# 
269f00f3a1Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
27a966c04fSmrg#
289f00f3a1Smrg# This program is free software; you can redistribute it and/or modify
299f00f3a1Smrg# it under the terms of the GNU General Public License as published by
309f00f3a1Smrg# the Free Software Foundation; either version 2 of the License, or
319f00f3a1Smrg# (at your option) any later version.
329f00f3a1Smrg#
339f00f3a1Smrg# This program is distributed in the hope that it will be useful, but
349f00f3a1Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
359f00f3a1Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
369f00f3a1Smrg# General Public License for more details.
379f00f3a1Smrg#
389f00f3a1Smrg# You should have received a copy of the GNU General Public License
399f00f3a1Smrg# along with this program; if not, write to the Free Software
409f00f3a1Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
419f00f3a1Smrg#
429f00f3a1Smrg# As a special exception to the GNU General Public License, if you
439f00f3a1Smrg# distribute this file as part of a program that contains a
449f00f3a1Smrg# configuration script generated by Autoconf, you may include it under
459f00f3a1Smrg# the same distribution terms that you use for the rest of that program.
46a966c04fSmrg
479f00f3a1Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
489f00f3a1Smrg# ----------------------------------
499f00f3a1SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
509f00f3a1Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
519f00f3a1Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
529f00f3a1Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
539f00f3a1SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
549f00f3a1SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
559f00f3a1SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
56a966c04fSmrg
579f00f3a1Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
589f00f3a1Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
599f00f3a1Smrgfi
609f00f3a1Smrgif test -n "$PKG_CONFIG"; then
619f00f3a1Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
629f00f3a1Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
639f00f3a1Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
649f00f3a1Smrg		AC_MSG_RESULT([yes])
659f00f3a1Smrg	else
669f00f3a1Smrg		AC_MSG_RESULT([no])
679f00f3a1Smrg		PKG_CONFIG=""
689f00f3a1Smrg	fi
699f00f3a1Smrgfi[]dnl
709f00f3a1Smrg])# PKG_PROG_PKG_CONFIG
71a966c04fSmrg
729f00f3a1Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
739f00f3a1Smrg#
749f00f3a1Smrg# Check to see whether a particular set of modules exists.  Similar
759f00f3a1Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
769f00f3a1Smrg#
779f00f3a1Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
789f00f3a1Smrg# only at the first occurence in configure.ac, so if the first place
799f00f3a1Smrg# it's called might be skipped (such as if it is within an "if", you
809f00f3a1Smrg# have to call PKG_CHECK_EXISTS manually
819f00f3a1Smrg# --------------------------------------------------------------
829f00f3a1SmrgAC_DEFUN([PKG_CHECK_EXISTS],
839f00f3a1Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
849f00f3a1Smrgif test -n "$PKG_CONFIG" && \
859f00f3a1Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
869f00f3a1Smrg  m4_default([$2], [:])
879f00f3a1Smrgm4_ifvaln([$3], [else
889f00f3a1Smrg  $3])dnl
899f00f3a1Smrgfi])
90a966c04fSmrg
919f00f3a1Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
929f00f3a1Smrg# ---------------------------------------------
939f00f3a1Smrgm4_define([_PKG_CONFIG],
949f00f3a1Smrg[if test -n "$$1"; then
959f00f3a1Smrg    pkg_cv_[]$1="$$1"
969f00f3a1Smrg elif test -n "$PKG_CONFIG"; then
979f00f3a1Smrg    PKG_CHECK_EXISTS([$3],
989f00f3a1Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
999f00f3a1Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
1009f00f3a1Smrg		     [pkg_failed=yes])
1019f00f3a1Smrg else
1029f00f3a1Smrg    pkg_failed=untried
1039f00f3a1Smrgfi[]dnl
1049f00f3a1Smrg])# _PKG_CONFIG
105a966c04fSmrg
1069f00f3a1Smrg# _PKG_SHORT_ERRORS_SUPPORTED
1079f00f3a1Smrg# -----------------------------
1089f00f3a1SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1099f00f3a1Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1109f00f3a1Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1119f00f3a1Smrg        _pkg_short_errors_supported=yes
1129f00f3a1Smrgelse
1139f00f3a1Smrg        _pkg_short_errors_supported=no
1149f00f3a1Smrgfi[]dnl
1159f00f3a1Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
116a966c04fSmrg
1179f00f3a1Smrg
1189f00f3a1Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1199f00f3a1Smrg# [ACTION-IF-NOT-FOUND])
120a966c04fSmrg#
121a966c04fSmrg#
1229f00f3a1Smrg# Note that if there is a possibility the first call to
1239f00f3a1Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
1249f00f3a1Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
125a966c04fSmrg#
126a966c04fSmrg#
1279f00f3a1Smrg# --------------------------------------------------------------
1289f00f3a1SmrgAC_DEFUN([PKG_CHECK_MODULES],
1299f00f3a1Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1309f00f3a1SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1319f00f3a1SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
132a966c04fSmrg
1339f00f3a1Smrgpkg_failed=no
1349f00f3a1SmrgAC_MSG_CHECKING([for $1])
135a966c04fSmrg
1369f00f3a1Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1379f00f3a1Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
138a966c04fSmrg
1399f00f3a1Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1409f00f3a1Smrgand $1[]_LIBS to avoid the need to call pkg-config.
1419f00f3a1SmrgSee the pkg-config man page for more details.])
142a966c04fSmrg
1439f00f3a1Smrgif test $pkg_failed = yes; then
1449f00f3a1Smrg   	AC_MSG_RESULT([no])
1459f00f3a1Smrg        _PKG_SHORT_ERRORS_SUPPORTED
1469f00f3a1Smrg        if test $_pkg_short_errors_supported = yes; then
1479f00f3a1Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1489f00f3a1Smrg        else 
1499f00f3a1Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1509f00f3a1Smrg        fi
1519f00f3a1Smrg	# Put the nasty error message in config.log where it belongs
1529f00f3a1Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
153a966c04fSmrg
1549f00f3a1Smrg	m4_default([$4], [AC_MSG_ERROR(
1559f00f3a1Smrg[Package requirements ($2) were not met:
156a966c04fSmrg
1579f00f3a1Smrg$$1_PKG_ERRORS
158a966c04fSmrg
1599f00f3a1SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1609f00f3a1Smrginstalled software in a non-standard prefix.
161a966c04fSmrg
1629f00f3a1Smrg_PKG_TEXT])[]dnl
1639f00f3a1Smrg        ])
1649f00f3a1Smrgelif test $pkg_failed = untried; then
1659f00f3a1Smrg     	AC_MSG_RESULT([no])
1669f00f3a1Smrg	m4_default([$4], [AC_MSG_FAILURE(
1679f00f3a1Smrg[The pkg-config script could not be found or is too old.  Make sure it
1689f00f3a1Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
1699f00f3a1Smrgpath to pkg-config.
170a966c04fSmrg
1719f00f3a1Smrg_PKG_TEXT
172a966c04fSmrg
1739f00f3a1SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1749f00f3a1Smrg        ])
1759f00f3a1Smrgelse
1769f00f3a1Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1779f00f3a1Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1789f00f3a1Smrg        AC_MSG_RESULT([yes])
1799f00f3a1Smrg	$3
1809f00f3a1Smrgfi[]dnl
1819f00f3a1Smrg])# PKG_CHECK_MODULES
182a966c04fSmrg
1839f00f3a1Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1849f00f3a1Smrgdnl
1859f00f3a1Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1869f00f3a1Smrgdnl 
1879f00f3a1Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1889f00f3a1Smrgdnl copy of this software and associated documentation files (the "Software"),
1899f00f3a1Smrgdnl to deal in the Software without restriction, including without limitation
1909f00f3a1Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1919f00f3a1Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
1929f00f3a1Smrgdnl Software is furnished to do so, subject to the following conditions:
1939f00f3a1Smrgdnl
1949f00f3a1Smrgdnl The above copyright notice and this permission notice (including the next
1959f00f3a1Smrgdnl paragraph) shall be included in all copies or substantial portions of the
1969f00f3a1Smrgdnl Software.
1979f00f3a1Smrgdnl
1989f00f3a1Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1999f00f3a1Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2009f00f3a1Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
2019f00f3a1Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2029f00f3a1Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2039f00f3a1Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2049f00f3a1Smrgdnl DEALINGS IN THE SOFTWARE.
205a966c04fSmrg
2069f00f3a1Smrg# XORG_MACROS_VERSION(required-version)
2079f00f3a1Smrg# -------------------------------------
2089f00f3a1Smrg# Minimum version: 1.1.0
2099f00f3a1Smrg#
2109f00f3a1Smrg# If you're using a macro added in Version 1.1 or newer, include this in
2119f00f3a1Smrg# your configure.ac with the minimum required version, such as:
2129f00f3a1Smrg# XORG_MACROS_VERSION(1.1)
2139f00f3a1Smrg#
2149f00f3a1Smrg# To ensure that this macro is defined, also add:
2159f00f3a1Smrg# m4_ifndef([XORG_MACROS_VERSION],
2169f00f3a1Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
2179f00f3a1Smrg#
2189f00f3a1Smrg#
2199f00f3a1Smrg# See the "minimum version" comment for each macro you use to see what 
2209f00f3a1Smrg# version you require.
2219f00f3a1Smrgm4_defun([XORG_MACROS_VERSION],[
2229f00f3a1Smrgm4_define([vers_have], [1.17])
2239f00f3a1Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
2249f00f3a1Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
2259f00f3a1Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
2269f00f3a1Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
2279f00f3a1Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
2289f00f3a1Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
2299f00f3a1Smrgm4_undefine([vers_have])
2309f00f3a1Smrgm4_undefine([maj_have])
2319f00f3a1Smrgm4_undefine([maj_needed])
2329f00f3a1Smrg]) # XORG_MACROS_VERSION
2332e2dd055Smrg
2349f00f3a1Smrg# XORG_PROG_RAWCPP()
2359f00f3a1Smrg# ------------------
2369f00f3a1Smrg# Minimum version: 1.0.0
2379f00f3a1Smrg#
2389f00f3a1Smrg# Find cpp program and necessary flags for use in pre-processing text files
2399f00f3a1Smrg# such as man pages and config files
2409f00f3a1SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
2419f00f3a1SmrgAC_REQUIRE([AC_PROG_CPP])
2429f00f3a1SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
2439f00f3a1Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
244a966c04fSmrg
2459f00f3a1Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
2469f00f3a1Smrg# which is not the best choice for supporting other OS'es, but covers most
2479f00f3a1Smrg# of the ones we need for now.
2489f00f3a1SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
2499f00f3a1SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
2509f00f3a1Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
2519f00f3a1Smrg	AC_MSG_RESULT([no])
2529f00f3a1Smrgelse
2539f00f3a1Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
2549f00f3a1Smrg		RAWCPPFLAGS=-undef
2559f00f3a1Smrg		AC_MSG_RESULT([yes])
2569f00f3a1Smrg	# under Cygwin unix is still defined even with -undef
2579f00f3a1Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
2589f00f3a1Smrg		RAWCPPFLAGS="-undef -ansi"
2599f00f3a1Smrg		AC_MSG_RESULT([yes, with -ansi])
2609f00f3a1Smrg	else
2619f00f3a1Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
2629f00f3a1Smrg	fi
2639f00f3a1Smrgfi
2649f00f3a1Smrgrm -f conftest.$ac_ext
265a966c04fSmrg
2669f00f3a1SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
2679f00f3a1SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
2689f00f3a1Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
2699f00f3a1Smrg	AC_MSG_RESULT([no])
270a966c04fSmrgelse
2719f00f3a1Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
2729f00f3a1Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
2739f00f3a1Smrg		AC_MSG_RESULT([yes])
2749f00f3a1Smrg	else
2759f00f3a1Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
2769f00f3a1Smrg	fi
277a966c04fSmrgfi
2789f00f3a1Smrgrm -f conftest.$ac_ext
2799f00f3a1SmrgAC_SUBST(RAWCPPFLAGS)
2809f00f3a1Smrg]) # XORG_PROG_RAWCPP
281a966c04fSmrg
2829f00f3a1Smrg# XORG_MANPAGE_SECTIONS()
2839f00f3a1Smrg# -----------------------
2849f00f3a1Smrg# Minimum version: 1.0.0
2859f00f3a1Smrg#
2869f00f3a1Smrg# Determine which sections man pages go in for the different man page types
2879f00f3a1Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
2889f00f3a1Smrg# Not sure if there's any better way than just hardcoding by OS name.
2899f00f3a1Smrg# Override default settings by setting environment variables
2909f00f3a1Smrg# Added MAN_SUBSTS in version 1.8
2919f00f3a1Smrg# Added AC_PROG_SED in version 1.8
292a966c04fSmrg
2939f00f3a1SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
2949f00f3a1SmrgAC_REQUIRE([AC_CANONICAL_HOST])
2959f00f3a1SmrgAC_REQUIRE([AC_PROG_SED])
296a966c04fSmrg
2979f00f3a1Smrgif test x$APP_MAN_SUFFIX = x    ; then
2989f00f3a1Smrg    APP_MAN_SUFFIX=1
2999f00f3a1Smrgfi
3009f00f3a1Smrgif test x$APP_MAN_DIR = x    ; then
3019f00f3a1Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
3029f00f3a1Smrgfi
303a966c04fSmrg
3049f00f3a1Smrgif test x$LIB_MAN_SUFFIX = x    ; then
3059f00f3a1Smrg    LIB_MAN_SUFFIX=3
3069f00f3a1Smrgfi
3079f00f3a1Smrgif test x$LIB_MAN_DIR = x    ; then
3089f00f3a1Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
309a966c04fSmrgfi
310a966c04fSmrg
3119f00f3a1Smrgif test x$FILE_MAN_SUFFIX = x    ; then
3129f00f3a1Smrg    case $host_os in
3139f00f3a1Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
3149f00f3a1Smrg	*)		FILE_MAN_SUFFIX=5  ;;
3159f00f3a1Smrg    esac
3169f00f3a1Smrgfi
3179f00f3a1Smrgif test x$FILE_MAN_DIR = x    ; then
3189f00f3a1Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
3199f00f3a1Smrgfi
320a966c04fSmrg
3219f00f3a1Smrgif test x$MISC_MAN_SUFFIX = x    ; then
3229f00f3a1Smrg    case $host_os in
3239f00f3a1Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
3249f00f3a1Smrg	*)		MISC_MAN_SUFFIX=7  ;;
3259f00f3a1Smrg    esac
3269f00f3a1Smrgfi
3279f00f3a1Smrgif test x$MISC_MAN_DIR = x    ; then
3289f00f3a1Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
3299f00f3a1Smrgfi
330a966c04fSmrg
3319f00f3a1Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
3329f00f3a1Smrg    case $host_os in
3339f00f3a1Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
3349f00f3a1Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
3359f00f3a1Smrg    esac
3369f00f3a1Smrgfi
3379f00f3a1Smrgif test x$DRIVER_MAN_DIR = x    ; then
3389f00f3a1Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
3399f00f3a1Smrgfi
340a966c04fSmrg
3419f00f3a1Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
3429f00f3a1Smrg    case $host_os in
3439f00f3a1Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
3449f00f3a1Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
3459f00f3a1Smrg    esac
3469f00f3a1Smrgfi
3479f00f3a1Smrgif test x$ADMIN_MAN_DIR = x    ; then
3489f00f3a1Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
3499f00f3a1Smrgfi
350a966c04fSmrg
351a966c04fSmrg
3529f00f3a1SmrgAC_SUBST([APP_MAN_SUFFIX])
3539f00f3a1SmrgAC_SUBST([LIB_MAN_SUFFIX])
3549f00f3a1SmrgAC_SUBST([FILE_MAN_SUFFIX])
3559f00f3a1SmrgAC_SUBST([MISC_MAN_SUFFIX])
3569f00f3a1SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
3579f00f3a1SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
3589f00f3a1SmrgAC_SUBST([APP_MAN_DIR])
3599f00f3a1SmrgAC_SUBST([LIB_MAN_DIR])
3609f00f3a1SmrgAC_SUBST([FILE_MAN_DIR])
3619f00f3a1SmrgAC_SUBST([MISC_MAN_DIR])
3629f00f3a1SmrgAC_SUBST([DRIVER_MAN_DIR])
3639f00f3a1SmrgAC_SUBST([ADMIN_MAN_DIR])
3649f00f3a1Smrg
3659f00f3a1SmrgXORG_MAN_PAGE="X Version 11"
3669f00f3a1SmrgAC_SUBST([XORG_MAN_PAGE])
3679f00f3a1SmrgMAN_SUBSTS="\
3689f00f3a1Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
3699f00f3a1Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
3709f00f3a1Smrg	-e 's|__xservername__|Xorg|g' \
3719f00f3a1Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
3729f00f3a1Smrg	-e 's|__projectroot__|\$(prefix)|g' \
3739f00f3a1Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
3749f00f3a1Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
3759f00f3a1Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
3769f00f3a1Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
3779f00f3a1Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
3789f00f3a1Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
3799f00f3a1Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
3809f00f3a1SmrgAC_SUBST([MAN_SUBSTS])
3819f00f3a1Smrg
3829f00f3a1Smrg]) # XORG_MANPAGE_SECTIONS
3839f00f3a1Smrg
3849f00f3a1Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
3859f00f3a1Smrg# ------------------------
3869f00f3a1Smrg# Minimum version: 1.7.0
387a966c04fSmrg#
3889f00f3a1Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
3899f00f3a1Smrg# provided by xorg-sgml-doctools, if installed.
3909f00f3a1SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
3919f00f3a1SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
3929f00f3a1SmrgXORG_SGML_PATH=
3939f00f3a1SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
3949f00f3a1Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
3959f00f3a1Smrg    [m4_ifval([$1],[:],
3969f00f3a1Smrg        [if test x"$cross_compiling" != x"yes" ; then
3979f00f3a1Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
3989f00f3a1Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
3999f00f3a1Smrg         fi])
4009f00f3a1Smrg    ])
401a966c04fSmrg
4029f00f3a1Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
4039f00f3a1Smrg# the path and the name of the doc stylesheet
4049f00f3a1Smrgif test "x$XORG_SGML_PATH" != "x" ; then
4059f00f3a1Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
4069f00f3a1Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
4079f00f3a1Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
4089f00f3a1Smrgelse
4099f00f3a1Smrg   AC_MSG_RESULT([no])
4109f00f3a1Smrgfi
411a966c04fSmrg
4129f00f3a1SmrgAC_SUBST(XORG_SGML_PATH)
4139f00f3a1SmrgAC_SUBST(STYLESHEET_SRCDIR)
4149f00f3a1SmrgAC_SUBST(XSL_STYLESHEET)
4159f00f3a1SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
4169f00f3a1Smrg]) # XORG_CHECK_SGML_DOCTOOLS
4179f00f3a1Smrg
4189f00f3a1Smrg# XORG_CHECK_LINUXDOC
4199f00f3a1Smrg# -------------------
4209f00f3a1Smrg# Minimum version: 1.0.0
421a966c04fSmrg#
4229f00f3a1Smrg# Defines the variable MAKE_TEXT if the necessary tools and
4239f00f3a1Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
4249f00f3a1Smrg# Whether or not the necessary tools and files are found can be checked
4259f00f3a1Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
4269f00f3a1SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
4279f00f3a1SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
4289f00f3a1SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
429a966c04fSmrg
4309f00f3a1SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
431a966c04fSmrg
4329f00f3a1SmrgAC_MSG_CHECKING([whether to build documentation])
433ac92798bSmrg
4349f00f3a1Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
4359f00f3a1Smrg   BUILDDOC=yes
4369f00f3a1Smrgelse
4379f00f3a1Smrg   BUILDDOC=no
438a966c04fSmrgfi
439a966c04fSmrg
4409f00f3a1SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
4419f00f3a1Smrg
4429f00f3a1SmrgAC_MSG_RESULT([$BUILDDOC])
4439f00f3a1Smrg
4449f00f3a1SmrgAC_MSG_CHECKING([whether to build pdf documentation])
4459f00f3a1Smrg
4469f00f3a1Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
4479f00f3a1Smrg   BUILDPDFDOC=yes
4489f00f3a1Smrgelse
4499f00f3a1Smrg   BUILDPDFDOC=no
450a966c04fSmrgfi
451a966c04fSmrg
4529f00f3a1SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
453a966c04fSmrg
4549f00f3a1SmrgAC_MSG_RESULT([$BUILDPDFDOC])
455a966c04fSmrg
4569f00f3a1SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
4579f00f3a1SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
4589f00f3a1SmrgMAKE_PDF="$PS2PDF"
4599f00f3a1SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
460a966c04fSmrg
4619f00f3a1SmrgAC_SUBST(MAKE_TEXT)
4629f00f3a1SmrgAC_SUBST(MAKE_PS)
4639f00f3a1SmrgAC_SUBST(MAKE_PDF)
4649f00f3a1SmrgAC_SUBST(MAKE_HTML)
4659f00f3a1Smrg]) # XORG_CHECK_LINUXDOC
466ac92798bSmrg
4679f00f3a1Smrg# XORG_CHECK_DOCBOOK
4689f00f3a1Smrg# -------------------
4699f00f3a1Smrg# Minimum version: 1.0.0
4709f00f3a1Smrg#
4719f00f3a1Smrg# Checks for the ability to build output formats from SGML DocBook source.
4729f00f3a1Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
4739f00f3a1Smrg# indicates whether the necessary tools and files are found and, if set,
4749f00f3a1Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
4759f00f3a1SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
4769f00f3a1SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
477ac92798bSmrg
4789f00f3a1SmrgBUILDTXTDOC=no
4799f00f3a1SmrgBUILDPDFDOC=no
4809f00f3a1SmrgBUILDPSDOC=no
4819f00f3a1SmrgBUILDHTMLDOC=no
482ac92798bSmrg
4839f00f3a1SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
4849f00f3a1SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
4859f00f3a1SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
4869f00f3a1SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
487ac92798bSmrg
4889f00f3a1SmrgAC_MSG_CHECKING([whether to build text documentation])
4899f00f3a1Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
4909f00f3a1Smrg   test x$BUILD_TXTDOC != xno; then
4919f00f3a1Smrg	BUILDTXTDOC=yes
4929f00f3a1Smrgfi
4939f00f3a1SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
4949f00f3a1SmrgAC_MSG_RESULT([$BUILDTXTDOC])
495ac92798bSmrg
4969f00f3a1SmrgAC_MSG_CHECKING([whether to build PDF documentation])
4979f00f3a1Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
4989f00f3a1Smrg   test x$BUILD_PDFDOC != xno; then
4999f00f3a1Smrg	BUILDPDFDOC=yes
5009f00f3a1Smrgfi
5019f00f3a1SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
5029f00f3a1SmrgAC_MSG_RESULT([$BUILDPDFDOC])
503ac92798bSmrg
5049f00f3a1SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
5059f00f3a1Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
5069f00f3a1Smrg   test x$BUILD_PSDOC != xno; then
5079f00f3a1Smrg	BUILDPSDOC=yes
5089f00f3a1Smrgfi
5099f00f3a1SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
5109f00f3a1SmrgAC_MSG_RESULT([$BUILDPSDOC])
511ac92798bSmrg
5129f00f3a1SmrgAC_MSG_CHECKING([whether to build HTML documentation])
5139f00f3a1Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
5149f00f3a1Smrg   test x$BUILD_HTMLDOC != xno; then
5159f00f3a1Smrg	BUILDHTMLDOC=yes
5169f00f3a1Smrgfi
5179f00f3a1SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
5189f00f3a1SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
5192e2dd055Smrg
5209f00f3a1SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
5219f00f3a1SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
5229f00f3a1SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
5239f00f3a1SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
524a966c04fSmrg
5259f00f3a1SmrgAC_SUBST(MAKE_TEXT)
5269f00f3a1SmrgAC_SUBST(MAKE_PS)
5279f00f3a1SmrgAC_SUBST(MAKE_PDF)
5289f00f3a1SmrgAC_SUBST(MAKE_HTML)
5299f00f3a1Smrg]) # XORG_CHECK_DOCBOOK
530a966c04fSmrg
5319f00f3a1Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
5329f00f3a1Smrg# ----------------
5339f00f3a1Smrg# Minimum version: 1.5.0
5349f00f3a1Smrg# Minimum version for optional DEFAULT argument: 1.11.0
535a966c04fSmrg#
5369f00f3a1Smrg# Documentation tools are not always available on all platforms and sometimes
5379f00f3a1Smrg# not at the appropriate level. This macro enables a module to test for the
5389f00f3a1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
5399f00f3a1Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
5409f00f3a1Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
5419f00f3a1Smrg# --with-xmlto assumes 'auto'.
542a966c04fSmrg#
5439f00f3a1Smrg# Interface to module:
5449f00f3a1Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
5459f00f3a1Smrg# XMLTO:	returns the path of the xmlto program found
5469f00f3a1Smrg#		returns the path set by the user in the environment
5479f00f3a1Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
5489f00f3a1Smrg#		'no' user instructs the module not to use xmlto
5499f00f3a1Smrg#
5509f00f3a1Smrg# Added in version 1.10.0
5519f00f3a1Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
5529f00f3a1Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
5539f00f3a1Smrg#
5549f00f3a1Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
5559f00f3a1Smrg#
5569f00f3a1SmrgAC_DEFUN([XORG_WITH_XMLTO],[
5579f00f3a1SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
5589f00f3a1Smrgm4_define([_defopt], m4_default([$2], [auto]))
5599f00f3a1SmrgAC_ARG_WITH(xmlto,
5609f00f3a1Smrg	AS_HELP_STRING([--with-xmlto],
5619f00f3a1Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
5629f00f3a1Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
5639f00f3a1Smrgm4_undefine([_defopt])
564a966c04fSmrg
5659f00f3a1Smrgif test "x$use_xmlto" = x"auto"; then
5669f00f3a1Smrg   AC_PATH_PROG([XMLTO], [xmlto])
5679f00f3a1Smrg   if test "x$XMLTO" = "x"; then
5689f00f3a1Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
5699f00f3a1Smrg	have_xmlto=no
5709f00f3a1Smrg   else
5719f00f3a1Smrg        have_xmlto=yes
5729f00f3a1Smrg   fi
5739f00f3a1Smrgelif test "x$use_xmlto" = x"yes" ; then
5749f00f3a1Smrg   AC_PATH_PROG([XMLTO], [xmlto])
5759f00f3a1Smrg   if test "x$XMLTO" = "x"; then
5769f00f3a1Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
5779f00f3a1Smrg   fi
5789f00f3a1Smrg   have_xmlto=yes
5799f00f3a1Smrgelif test "x$use_xmlto" = x"no" ; then
5809f00f3a1Smrg   if test "x$XMLTO" != "x"; then
5819f00f3a1Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
5829f00f3a1Smrg   fi
5839f00f3a1Smrg   have_xmlto=no
584a966c04fSmrgelse
5859f00f3a1Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
586a966c04fSmrgfi
587a966c04fSmrg
5889f00f3a1Smrg# Test for a minimum version of xmlto, if provided.
5899f00f3a1Smrgm4_ifval([$1],
5909f00f3a1Smrg[if test "$have_xmlto" = yes; then
5919f00f3a1Smrg    # scrape the xmlto version
5929f00f3a1Smrg    AC_MSG_CHECKING([the xmlto version])
5939f00f3a1Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
5949f00f3a1Smrg    AC_MSG_RESULT([$xmlto_version])
5959f00f3a1Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
5969f00f3a1Smrg        [if test "x$use_xmlto" = xauto; then
5979f00f3a1Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
5989f00f3a1Smrg            have_xmlto=no
5999f00f3a1Smrg        else
6009f00f3a1Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
6019f00f3a1Smrg        fi])
6029f00f3a1Smrgfi])
603a966c04fSmrg
6049f00f3a1Smrg# Test for the ability of xmlto to generate a text target
6059f00f3a1Smrghave_xmlto_text=no
6069f00f3a1Smrgcat > conftest.xml << "EOF"
6079f00f3a1SmrgEOF
6089f00f3a1SmrgAS_IF([test "$have_xmlto" = yes],
6099f00f3a1Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
6109f00f3a1Smrg             [have_xmlto_text=yes],
6119f00f3a1Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
6129f00f3a1Smrgrm -f conftest.xml
6139f00f3a1SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
6149f00f3a1SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
6159f00f3a1Smrg]) # XORG_WITH_XMLTO
616a966c04fSmrg
6179f00f3a1Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
6189f00f3a1Smrg# --------------------------------------------
6199f00f3a1Smrg# Minimum version: 1.12.0
6209f00f3a1Smrg# Minimum version for optional DEFAULT argument: 1.12.0
621a966c04fSmrg#
6229f00f3a1Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
6239f00f3a1Smrg# XML-based language used for the transformation of XML documents.
6249f00f3a1Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
6259f00f3a1Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
6269f00f3a1Smrg# The XSLT processor is often used as a standalone tool for transformations.
6279f00f3a1Smrg# It should not be assumed that this tool is used only to work with documnetation.
6289f00f3a1Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
6299f00f3a1Smrg#
6309f00f3a1Smrg# Interface to module:
6319f00f3a1Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
6329f00f3a1Smrg# XSLTPROC:	 returns the path of the xsltproc program found
6339f00f3a1Smrg#		 returns the path set by the user in the environment
6349f00f3a1Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
6359f00f3a1Smrg#		  'no' user instructs the module not to use xsltproc
6369f00f3a1Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
6379f00f3a1Smrg#
6389f00f3a1Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
6399f00f3a1Smrg#
6409f00f3a1SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
6419f00f3a1SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
6429f00f3a1Smrg# Preserves the interface, should it be implemented later
6439f00f3a1Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
6449f00f3a1Smrgm4_define([_defopt], m4_default([$2], [auto]))
6459f00f3a1SmrgAC_ARG_WITH(xsltproc,
6469f00f3a1Smrg	AS_HELP_STRING([--with-xsltproc],
6479f00f3a1Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
6489f00f3a1Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
6499f00f3a1Smrgm4_undefine([_defopt])
650a966c04fSmrg
6519f00f3a1Smrgif test "x$use_xsltproc" = x"auto"; then
6529f00f3a1Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
6539f00f3a1Smrg   if test "x$XSLTPROC" = "x"; then
6549f00f3a1Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
6559f00f3a1Smrg	have_xsltproc=no
6569f00f3a1Smrg   else
6579f00f3a1Smrg        have_xsltproc=yes
6589f00f3a1Smrg   fi
6599f00f3a1Smrgelif test "x$use_xsltproc" = x"yes" ; then
6609f00f3a1Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
6619f00f3a1Smrg   if test "x$XSLTPROC" = "x"; then
6629f00f3a1Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
6639f00f3a1Smrg   fi
6649f00f3a1Smrg   have_xsltproc=yes
6659f00f3a1Smrgelif test "x$use_xsltproc" = x"no" ; then
6669f00f3a1Smrg   if test "x$XSLTPROC" != "x"; then
6679f00f3a1Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
6689f00f3a1Smrg   fi
6699f00f3a1Smrg   have_xsltproc=no
670a966c04fSmrgelse
6719f00f3a1Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
672a966c04fSmrgfi
673a966c04fSmrg
6749f00f3a1SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
6759f00f3a1Smrg]) # XORG_WITH_XSLTPROC
676a966c04fSmrg
6779f00f3a1Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
6789f00f3a1Smrg# ----------------------------------------
6799f00f3a1Smrg# Minimum version: 1.15.0
680a966c04fSmrg#
6819f00f3a1Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
6829f00f3a1Smrg# scanning arbitrary text files, extracting information from those text files,
6839f00f3a1Smrg# and printing reports based on that information.
6849f00f3a1Smrg#
6859f00f3a1Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
6869f00f3a1Smrg#
6879f00f3a1Smrg# Interface to module:
6889f00f3a1Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
6899f00f3a1Smrg# PERL:	     returns the path of the perl program found
6909f00f3a1Smrg#	     returns the path set by the user in the environment
6919f00f3a1Smrg# --with-perl: 'yes' user instructs the module to use perl
6929f00f3a1Smrg#	       'no' user instructs the module not to use perl
6939f00f3a1Smrg# have_perl: returns yes if perl found in PATH or no
6949f00f3a1Smrg#
6959f00f3a1Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
6969f00f3a1Smrg#
6979f00f3a1SmrgAC_DEFUN([XORG_WITH_PERL],[
6989f00f3a1SmrgAC_ARG_VAR([PERL], [Path to perl command])
6999f00f3a1Smrg# Preserves the interface, should it be implemented later
7009f00f3a1Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
7019f00f3a1Smrgm4_define([_defopt], m4_default([$2], [auto]))
7029f00f3a1SmrgAC_ARG_WITH(perl,
7039f00f3a1Smrg	AS_HELP_STRING([--with-perl],
7049f00f3a1Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
7059f00f3a1Smrg	   [use_perl=$withval], [use_perl=]_defopt)
7069f00f3a1Smrgm4_undefine([_defopt])
707a966c04fSmrg
7089f00f3a1Smrgif test "x$use_perl" = x"auto"; then
7099f00f3a1Smrg   AC_PATH_PROG([PERL], [perl])
7109f00f3a1Smrg   if test "x$PERL" = "x"; then
7119f00f3a1Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
7129f00f3a1Smrg	have_perl=no
7139f00f3a1Smrg   else
7149f00f3a1Smrg        have_perl=yes
7159f00f3a1Smrg   fi
7169f00f3a1Smrgelif test "x$use_perl" = x"yes" ; then
7179f00f3a1Smrg   AC_PATH_PROG([PERL], [perl])
7189f00f3a1Smrg   if test "x$PERL" = "x"; then
7199f00f3a1Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
7209f00f3a1Smrg   fi
7219f00f3a1Smrg   have_perl=yes
7229f00f3a1Smrgelif test "x$use_perl" = x"no" ; then
7239f00f3a1Smrg   if test "x$PERL" != "x"; then
7249f00f3a1Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
7259f00f3a1Smrg   fi
7269f00f3a1Smrg   have_perl=no
7279f00f3a1Smrgelse
7289f00f3a1Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
7299f00f3a1Smrgfi
730a966c04fSmrg
7319f00f3a1SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
7329f00f3a1Smrg]) # XORG_WITH_PERL
733a966c04fSmrg
7349f00f3a1Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
7359f00f3a1Smrg# ----------------
7369f00f3a1Smrg# Minimum version: 1.5.0
7379f00f3a1Smrg# Minimum version for optional DEFAULT argument: 1.11.0
738ac92798bSmrg#
7399f00f3a1Smrg# Documentation tools are not always available on all platforms and sometimes
7409f00f3a1Smrg# not at the appropriate level. This macro enables a module to test for the
7419f00f3a1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
7429f00f3a1Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
7439f00f3a1Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
7449f00f3a1Smrg# --with-asciidoc assumes 'auto'.
745a966c04fSmrg#
7469f00f3a1Smrg# Interface to module:
7479f00f3a1Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
7489f00f3a1Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
7499f00f3a1Smrg#		 returns the path set by the user in the environment
7509f00f3a1Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
7519f00f3a1Smrg#		  'no' user instructs the module not to use asciidoc
752ac92798bSmrg#
7539f00f3a1Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
7549f00f3a1Smrg#
7559f00f3a1SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
7569f00f3a1SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
7579f00f3a1Smrgm4_define([_defopt], m4_default([$2], [auto]))
7589f00f3a1SmrgAC_ARG_WITH(asciidoc,
7599f00f3a1Smrg	AS_HELP_STRING([--with-asciidoc],
7609f00f3a1Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
7619f00f3a1Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
7629f00f3a1Smrgm4_undefine([_defopt])
763a966c04fSmrg
7649f00f3a1Smrgif test "x$use_asciidoc" = x"auto"; then
7659f00f3a1Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
7669f00f3a1Smrg   if test "x$ASCIIDOC" = "x"; then
7679f00f3a1Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
7689f00f3a1Smrg	have_asciidoc=no
7699f00f3a1Smrg   else
7709f00f3a1Smrg        have_asciidoc=yes
7719f00f3a1Smrg   fi
7729f00f3a1Smrgelif test "x$use_asciidoc" = x"yes" ; then
7739f00f3a1Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
7749f00f3a1Smrg   if test "x$ASCIIDOC" = "x"; then
7759f00f3a1Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
7769f00f3a1Smrg   fi
7779f00f3a1Smrg   have_asciidoc=yes
7789f00f3a1Smrgelif test "x$use_asciidoc" = x"no" ; then
7799f00f3a1Smrg   if test "x$ASCIIDOC" != "x"; then
7809f00f3a1Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
7819f00f3a1Smrg   fi
7829f00f3a1Smrg   have_asciidoc=no
7839f00f3a1Smrgelse
7849f00f3a1Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
7859f00f3a1Smrgfi
7869f00f3a1Smrgm4_ifval([$1],
7879f00f3a1Smrg[if test "$have_asciidoc" = yes; then
7889f00f3a1Smrg    # scrape the asciidoc version
7899f00f3a1Smrg    AC_MSG_CHECKING([the asciidoc version])
7909f00f3a1Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
7919f00f3a1Smrg    AC_MSG_RESULT([$asciidoc_version])
7929f00f3a1Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
7939f00f3a1Smrg        [if test "x$use_asciidoc" = xauto; then
7949f00f3a1Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
7959f00f3a1Smrg            have_asciidoc=no
7969f00f3a1Smrg        else
7979f00f3a1Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
7989f00f3a1Smrg        fi])
7999f00f3a1Smrgfi])
8009f00f3a1SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
8019f00f3a1Smrg]) # XORG_WITH_ASCIIDOC
8022e2dd055Smrg
8039f00f3a1Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
8049f00f3a1Smrg# --------------------------------
8059f00f3a1Smrg# Minimum version: 1.5.0
8069f00f3a1Smrg# Minimum version for optional DEFAULT argument: 1.11.0
8079f00f3a1Smrg#
8089f00f3a1Smrg# Documentation tools are not always available on all platforms and sometimes
8099f00f3a1Smrg# not at the appropriate level. This macro enables a module to test for the
8109f00f3a1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8119f00f3a1Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
8129f00f3a1Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
8139f00f3a1Smrg# --with-doxygen assumes 'auto'.
8149f00f3a1Smrg#
8159f00f3a1Smrg# Interface to module:
8169f00f3a1Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
8179f00f3a1Smrg# DOXYGEN:	 returns the path of the doxygen program found
8189f00f3a1Smrg#		 returns the path set by the user in the environment
8199f00f3a1Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
8209f00f3a1Smrg#		  'no' user instructs the module not to use doxygen
8219f00f3a1Smrg#
8229f00f3a1Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
8239f00f3a1Smrg#
8249f00f3a1SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
8259f00f3a1SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
8269f00f3a1Smrgm4_define([_defopt], m4_default([$2], [auto]))
8279f00f3a1SmrgAC_ARG_WITH(doxygen,
8289f00f3a1Smrg	AS_HELP_STRING([--with-doxygen],
8299f00f3a1Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
8309f00f3a1Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
8319f00f3a1Smrgm4_undefine([_defopt])
832ac92798bSmrg
8339f00f3a1Smrgif test "x$use_doxygen" = x"auto"; then
8349f00f3a1Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
8359f00f3a1Smrg   if test "x$DOXYGEN" = "x"; then
8369f00f3a1Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
8379f00f3a1Smrg	have_doxygen=no
8389f00f3a1Smrg   else
8399f00f3a1Smrg        have_doxygen=yes
8409f00f3a1Smrg   fi
8419f00f3a1Smrgelif test "x$use_doxygen" = x"yes" ; then
8429f00f3a1Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
8439f00f3a1Smrg   if test "x$DOXYGEN" = "x"; then
8449f00f3a1Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
8459f00f3a1Smrg   fi
8469f00f3a1Smrg   have_doxygen=yes
8479f00f3a1Smrgelif test "x$use_doxygen" = x"no" ; then
8489f00f3a1Smrg   if test "x$DOXYGEN" != "x"; then
8499f00f3a1Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
8509f00f3a1Smrg   fi
8519f00f3a1Smrg   have_doxygen=no
852a966c04fSmrgelse
8539f00f3a1Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
854ac92798bSmrgfi
8559f00f3a1Smrgm4_ifval([$1],
8569f00f3a1Smrg[if test "$have_doxygen" = yes; then
8579f00f3a1Smrg    # scrape the doxygen version
8589f00f3a1Smrg    AC_MSG_CHECKING([the doxygen version])
8599f00f3a1Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
8609f00f3a1Smrg    AC_MSG_RESULT([$doxygen_version])
8619f00f3a1Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
8629f00f3a1Smrg        [if test "x$use_doxygen" = xauto; then
8639f00f3a1Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
8649f00f3a1Smrg            have_doxygen=no
8659f00f3a1Smrg        else
8669f00f3a1Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
8679f00f3a1Smrg        fi])
8689f00f3a1Smrgfi])
8699f00f3a1SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
8709f00f3a1Smrg]) # XORG_WITH_DOXYGEN
871a966c04fSmrg
8729f00f3a1Smrg# XORG_WITH_GROFF([DEFAULT])
8739f00f3a1Smrg# ----------------
8749f00f3a1Smrg# Minimum version: 1.6.0
8759f00f3a1Smrg# Minimum version for optional DEFAULT argument: 1.11.0
8762e2dd055Smrg#
8779f00f3a1Smrg# Documentation tools are not always available on all platforms and sometimes
8789f00f3a1Smrg# not at the appropriate level. This macro enables a module to test for the
8799f00f3a1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8809f00f3a1Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
8819f00f3a1Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
8829f00f3a1Smrg# --with-groff assumes 'auto'.
8839f00f3a1Smrg#
8849f00f3a1Smrg# Interface to module:
8859f00f3a1Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
8869f00f3a1Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
8879f00f3a1Smrg# HAVE_GROFF_MS: the -ms macros package
8889f00f3a1Smrg# GROFF:	 returns the path of the groff program found
8899f00f3a1Smrg#		 returns the path set by the user in the environment
8909f00f3a1Smrg# --with-groff:	 'yes' user instructs the module to use groff
8919f00f3a1Smrg#		 'no' user instructs the module not to use groff
8929f00f3a1Smrg#
8939f00f3a1Smrg# Added in version 1.9.0:
8949f00f3a1Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
8959f00f3a1Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
8969f00f3a1Smrg#		   psselect from the psutils package.
8979f00f3a1Smrg#		   the ghostcript package. Refer to the grohtml man pages
8989f00f3a1Smrg#
8999f00f3a1Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
9009f00f3a1Smrg#
9019f00f3a1Smrg# OS and distros often splits groff in a basic and full package, the former
9029f00f3a1Smrg# having the groff program and the later having devices, fonts and macros
9039f00f3a1Smrg# Checking for the groff executable is not enough.
9049f00f3a1Smrg#
9059f00f3a1Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
9069f00f3a1Smrg# unset HAVE_GROFF or GROFF env variables.
9079f00f3a1Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
9089f00f3a1Smrg#
9099f00f3a1SmrgAC_DEFUN([XORG_WITH_GROFF],[
9109f00f3a1SmrgAC_ARG_VAR([GROFF], [Path to groff command])
9119f00f3a1Smrgm4_define([_defopt], m4_default([$1], [auto]))
9129f00f3a1SmrgAC_ARG_WITH(groff,
9139f00f3a1Smrg	AS_HELP_STRING([--with-groff],
9149f00f3a1Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
9159f00f3a1Smrg	   [use_groff=$withval], [use_groff=]_defopt)
9169f00f3a1Smrgm4_undefine([_defopt])
9172e2dd055Smrg
9189f00f3a1Smrgif test "x$use_groff" = x"auto"; then
9199f00f3a1Smrg   AC_PATH_PROG([GROFF], [groff])
9209f00f3a1Smrg   if test "x$GROFF" = "x"; then
9219f00f3a1Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
9229f00f3a1Smrg	have_groff=no
9239f00f3a1Smrg   else
9249f00f3a1Smrg        have_groff=yes
9259f00f3a1Smrg   fi
9269f00f3a1Smrgelif test "x$use_groff" = x"yes" ; then
9279f00f3a1Smrg   AC_PATH_PROG([GROFF], [groff])
9289f00f3a1Smrg   if test "x$GROFF" = "x"; then
9299f00f3a1Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
9309f00f3a1Smrg   fi
9319f00f3a1Smrg   have_groff=yes
9329f00f3a1Smrgelif test "x$use_groff" = x"no" ; then
9339f00f3a1Smrg   if test "x$GROFF" != "x"; then
9349f00f3a1Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
9359f00f3a1Smrg   fi
9369f00f3a1Smrg   have_groff=no
937ac92798bSmrgelse
9389f00f3a1Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
939ac92798bSmrgfi
940a966c04fSmrg
9419f00f3a1Smrg# We have groff, test for the presence of the macro packages
9429f00f3a1Smrgif test "x$have_groff" = x"yes"; then
9439f00f3a1Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
9449f00f3a1Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
9459f00f3a1Smrg        groff_ms_works=yes
9469f00f3a1Smrg    else
9479f00f3a1Smrg        groff_ms_works=no
9489f00f3a1Smrg    fi
9499f00f3a1Smrg    AC_MSG_RESULT([$groff_ms_works])
9509f00f3a1Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
9519f00f3a1Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
9529f00f3a1Smrg        groff_mm_works=yes
9539f00f3a1Smrg    else
9549f00f3a1Smrg        groff_mm_works=no
9559f00f3a1Smrg    fi
9569f00f3a1Smrg    AC_MSG_RESULT([$groff_mm_works])
957a966c04fSmrgfi
958a966c04fSmrg
9599f00f3a1Smrg# We have groff, test for HTML dependencies, one command per package
9609f00f3a1Smrgif test "x$have_groff" = x"yes"; then
9619f00f3a1Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
9629f00f3a1Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
9639f00f3a1Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
9649f00f3a1Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
9659f00f3a1Smrg      have_groff_html=yes
9669f00f3a1Smrg   else
9679f00f3a1Smrg      have_groff_html=no
9689f00f3a1Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
9699f00f3a1Smrg   fi
9709f00f3a1Smrgfi
9712e2dd055Smrg
9729f00f3a1Smrg# Set Automake conditionals for Makefiles
9739f00f3a1SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
9749f00f3a1SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
9759f00f3a1SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
9769f00f3a1SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
9779f00f3a1Smrg]) # XORG_WITH_GROFF
978a966c04fSmrg
9799f00f3a1Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
9809f00f3a1Smrg# ---------------------------------------
9819f00f3a1Smrg# Minimum version: 1.6.0
9829f00f3a1Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9839f00f3a1Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
984a966c04fSmrg#
9859f00f3a1Smrg# Documentation tools are not always available on all platforms and sometimes
9869f00f3a1Smrg# not at the appropriate level. This macro enables a module to test for the
9879f00f3a1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9889f00f3a1Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
9899f00f3a1Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
9909f00f3a1Smrg# --with-fop assumes 'auto'.
991a966c04fSmrg#
9929f00f3a1Smrg# Interface to module:
9939f00f3a1Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
9949f00f3a1Smrg# FOP:	 	returns the path of the fop program found
9959f00f3a1Smrg#		returns the path set by the user in the environment
9969f00f3a1Smrg# --with-fop: 	'yes' user instructs the module to use fop
9979f00f3a1Smrg#		'no' user instructs the module not to use fop
998a966c04fSmrg#
9999f00f3a1Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1000a966c04fSmrg#
10019f00f3a1SmrgAC_DEFUN([XORG_WITH_FOP],[
10029f00f3a1SmrgAC_ARG_VAR([FOP], [Path to fop command])
10039f00f3a1Smrgm4_define([_defopt], m4_default([$2], [auto]))
10049f00f3a1SmrgAC_ARG_WITH(fop,
10059f00f3a1Smrg	AS_HELP_STRING([--with-fop],
10069f00f3a1Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10079f00f3a1Smrg	   [use_fop=$withval], [use_fop=]_defopt)
10089f00f3a1Smrgm4_undefine([_defopt])
1009ac92798bSmrg
10109f00f3a1Smrgif test "x$use_fop" = x"auto"; then
10119f00f3a1Smrg   AC_PATH_PROG([FOP], [fop])
10129f00f3a1Smrg   if test "x$FOP" = "x"; then
10139f00f3a1Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10149f00f3a1Smrg	have_fop=no
10159f00f3a1Smrg   else
10169f00f3a1Smrg        have_fop=yes
10179f00f3a1Smrg   fi
10189f00f3a1Smrgelif test "x$use_fop" = x"yes" ; then
10199f00f3a1Smrg   AC_PATH_PROG([FOP], [fop])
10209f00f3a1Smrg   if test "x$FOP" = "x"; then
10219f00f3a1Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10229f00f3a1Smrg   fi
10239f00f3a1Smrg   have_fop=yes
10249f00f3a1Smrgelif test "x$use_fop" = x"no" ; then
10259f00f3a1Smrg   if test "x$FOP" != "x"; then
10269f00f3a1Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10279f00f3a1Smrg   fi
10289f00f3a1Smrg   have_fop=no
10299f00f3a1Smrgelse
10309f00f3a1Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10319f00f3a1Smrgfi
1032ac92798bSmrg
10339f00f3a1Smrg# Test for a minimum version of fop, if provided.
10349f00f3a1Smrgm4_ifval([$1],
10359f00f3a1Smrg[if test "$have_fop" = yes; then
10369f00f3a1Smrg    # scrape the fop version
10379f00f3a1Smrg    AC_MSG_CHECKING([for fop minimum version])
10389f00f3a1Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10399f00f3a1Smrg    AC_MSG_RESULT([$fop_version])
10409f00f3a1Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
10419f00f3a1Smrg        [if test "x$use_fop" = xauto; then
10429f00f3a1Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10439f00f3a1Smrg            have_fop=no
10449f00f3a1Smrg        else
10459f00f3a1Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10469f00f3a1Smrg        fi])
10479f00f3a1Smrgfi])
10489f00f3a1SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10499f00f3a1Smrg]) # XORG_WITH_FOP
1050a966c04fSmrg
10519f00f3a1Smrg# XORG_WITH_PS2PDF([DEFAULT])
10529f00f3a1Smrg# ----------------
10539f00f3a1Smrg# Minimum version: 1.6.0
10549f00f3a1Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10559f00f3a1Smrg#
10569f00f3a1Smrg# Documentation tools are not always available on all platforms and sometimes
10579f00f3a1Smrg# not at the appropriate level. This macro enables a module to test for the
10589f00f3a1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10599f00f3a1Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10609f00f3a1Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10619f00f3a1Smrg# --with-ps2pdf assumes 'auto'.
10629f00f3a1Smrg#
10639f00f3a1Smrg# Interface to module:
10649f00f3a1Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10659f00f3a1Smrg# PS2PDF:	returns the path of the ps2pdf program found
10669f00f3a1Smrg#		returns the path set by the user in the environment
10679f00f3a1Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10689f00f3a1Smrg#		 'no' user instructs the module not to use ps2pdf
10699f00f3a1Smrg#
10709f00f3a1Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10719f00f3a1Smrg#
10729f00f3a1SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
10739f00f3a1SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10749f00f3a1Smrgm4_define([_defopt], m4_default([$1], [auto]))
10759f00f3a1SmrgAC_ARG_WITH(ps2pdf,
10769f00f3a1Smrg	AS_HELP_STRING([--with-ps2pdf],
10779f00f3a1Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10789f00f3a1Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10799f00f3a1Smrgm4_undefine([_defopt])
1080a966c04fSmrg
10819f00f3a1Smrgif test "x$use_ps2pdf" = x"auto"; then
10829f00f3a1Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10839f00f3a1Smrg   if test "x$PS2PDF" = "x"; then
10849f00f3a1Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10859f00f3a1Smrg	have_ps2pdf=no
10869f00f3a1Smrg   else
10879f00f3a1Smrg        have_ps2pdf=yes
10889f00f3a1Smrg   fi
10899f00f3a1Smrgelif test "x$use_ps2pdf" = x"yes" ; then
10909f00f3a1Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10919f00f3a1Smrg   if test "x$PS2PDF" = "x"; then
10929f00f3a1Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10939f00f3a1Smrg   fi
10949f00f3a1Smrg   have_ps2pdf=yes
10959f00f3a1Smrgelif test "x$use_ps2pdf" = x"no" ; then
10969f00f3a1Smrg   if test "x$PS2PDF" != "x"; then
10979f00f3a1Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10989f00f3a1Smrg   fi
10999f00f3a1Smrg   have_ps2pdf=no
11009f00f3a1Smrgelse
11019f00f3a1Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
11029f00f3a1Smrgfi
11039f00f3a1SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
11049f00f3a1Smrg]) # XORG_WITH_PS2PDF
1105a966c04fSmrg
11069f00f3a1Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
11079f00f3a1Smrg# ----------------
11089f00f3a1Smrg# Minimum version: 1.6.0
110997cf2ee2Smrg#
11109f00f3a1Smrg# Documentation tools are not always available on all platforms and sometimes
11119f00f3a1Smrg# not at the appropriate level. This macro enables a builder to skip all
11129f00f3a1Smrg# documentation targets except traditional man pages.
11139f00f3a1Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
11149f00f3a1Smrg# maximum flexibilty in controlling documentation building.
11159f00f3a1Smrg# Refer to:
11169f00f3a1Smrg# XORG_WITH_XMLTO         --with-xmlto
11179f00f3a1Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
11189f00f3a1Smrg# XORG_WITH_DOXYGEN       --with-doxygen
11199f00f3a1Smrg# XORG_WITH_FOP           --with-fop
11209f00f3a1Smrg# XORG_WITH_GROFF         --with-groff
11219f00f3a1Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
11229f00f3a1Smrg#
11239f00f3a1Smrg# Interface to module:
11249f00f3a1Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
11259f00f3a1Smrg# --enable-docs: 'yes' user instructs the module to generate docs
11269f00f3a1Smrg#		 'no' user instructs the module not to generate docs
11279f00f3a1Smrg# parm1:	specify the default value, yes or no.
112897cf2ee2Smrg#
11299f00f3a1SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
11309f00f3a1Smrgm4_define([docs_default], m4_default([$1], [yes]))
11319f00f3a1SmrgAC_ARG_ENABLE(docs,
11329f00f3a1Smrg	AS_HELP_STRING([--enable-docs],
11339f00f3a1Smrg	   [Enable building the documentation (default: ]docs_default[)]),
11349f00f3a1Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
11359f00f3a1Smrgm4_undefine([docs_default])
11369f00f3a1SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
11379f00f3a1SmrgAC_MSG_CHECKING([whether to build documentation])
11389f00f3a1SmrgAC_MSG_RESULT([$build_docs])
11399f00f3a1Smrg]) # XORG_ENABLE_DOCS
1140a966c04fSmrg
11419f00f3a1Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
11429f00f3a1Smrg# ----------------
11439f00f3a1Smrg# Minimum version: 1.6.0
114497cf2ee2Smrg#
11459f00f3a1Smrg# This macro enables a builder to skip all developer documentation.
11469f00f3a1Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
11479f00f3a1Smrg# maximum flexibilty in controlling documentation building.
11489f00f3a1Smrg# Refer to:
11499f00f3a1Smrg# XORG_WITH_XMLTO         --with-xmlto
11509f00f3a1Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
11519f00f3a1Smrg# XORG_WITH_DOXYGEN       --with-doxygen
11529f00f3a1Smrg# XORG_WITH_FOP           --with-fop
11539f00f3a1Smrg# XORG_WITH_GROFF         --with-groff
11549f00f3a1Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
115597cf2ee2Smrg#
11569f00f3a1Smrg# Interface to module:
11579f00f3a1Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
11589f00f3a1Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
11599f00f3a1Smrg#			'no' user instructs the module not to generate developer docs
11609f00f3a1Smrg# parm1:		specify the default value, yes or no.
116197cf2ee2Smrg#
11629f00f3a1SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
11639f00f3a1Smrgm4_define([devel_default], m4_default([$1], [yes]))
11649f00f3a1SmrgAC_ARG_ENABLE(devel-docs,
11659f00f3a1Smrg	AS_HELP_STRING([--enable-devel-docs],
11669f00f3a1Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
11679f00f3a1Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
11689f00f3a1Smrgm4_undefine([devel_default])
11699f00f3a1SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
11709f00f3a1SmrgAC_MSG_CHECKING([whether to build developer documentation])
11719f00f3a1SmrgAC_MSG_RESULT([$build_devel_docs])
11729f00f3a1Smrg]) # XORG_ENABLE_DEVEL_DOCS
11739f00f3a1Smrg
11749f00f3a1Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
11759f00f3a1Smrg# ----------------
11769f00f3a1Smrg# Minimum version: 1.6.0
117797cf2ee2Smrg#
11789f00f3a1Smrg# This macro enables a builder to skip all functional specification targets.
11799f00f3a1Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
11809f00f3a1Smrg# maximum flexibilty in controlling documentation building.
11819f00f3a1Smrg# Refer to:
11829f00f3a1Smrg# XORG_WITH_XMLTO         --with-xmlto
11839f00f3a1Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
11849f00f3a1Smrg# XORG_WITH_DOXYGEN       --with-doxygen
11859f00f3a1Smrg# XORG_WITH_FOP           --with-fop
11869f00f3a1Smrg# XORG_WITH_GROFF         --with-groff
11879f00f3a1Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
118897cf2ee2Smrg#
11899f00f3a1Smrg# Interface to module:
11909f00f3a1Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
11919f00f3a1Smrg# --enable-specs:	'yes' user instructs the module to generate specs
11929f00f3a1Smrg#			'no' user instructs the module not to generate specs
11939f00f3a1Smrg# parm1:		specify the default value, yes or no.
11949f00f3a1Smrg#
11959f00f3a1SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
11969f00f3a1Smrgm4_define([spec_default], m4_default([$1], [yes]))
11979f00f3a1SmrgAC_ARG_ENABLE(specs,
11989f00f3a1Smrg	AS_HELP_STRING([--enable-specs],
11999f00f3a1Smrg	   [Enable building the specs (default: ]spec_default[)]),
12009f00f3a1Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
12019f00f3a1Smrgm4_undefine([spec_default])
12029f00f3a1SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
12039f00f3a1SmrgAC_MSG_CHECKING([whether to build functional specifications])
12049f00f3a1SmrgAC_MSG_RESULT([$build_specs])
12059f00f3a1Smrg]) # XORG_ENABLE_SPECS
1206a966c04fSmrg
12079f00f3a1Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
12089f00f3a1Smrg# ----------------------------------------------
12099f00f3a1Smrg# Minimum version: 1.13.0
12109f00f3a1Smrg#
12119f00f3a1Smrg# This macro enables a builder to enable/disable unit testing
12129f00f3a1Smrg# It makes no assumption about the test cases implementation
12139f00f3a1Smrg# Test cases may or may not use Automake "Support for test suites"
12149f00f3a1Smrg# They may or may not use the software utility library GLib
12159f00f3a1Smrg#
12169f00f3a1Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
12179f00f3a1Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
12189f00f3a1Smrg# The variable enable_unit_tests is used by other macros in this file.
12199f00f3a1Smrg#
12209f00f3a1Smrg# Interface to module:
12219f00f3a1Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
12229f00f3a1Smrg# enable_unit_tests:    used in configure.ac for additional configuration
12239f00f3a1Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
12249f00f3a1Smrg#			'no' user instructs the module not to build tests
12259f00f3a1Smrg# parm1:		specify the default value, yes or no.
12269f00f3a1Smrg#
12279f00f3a1SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
12289f00f3a1SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
12299f00f3a1SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
12309f00f3a1SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
12319f00f3a1Smrgm4_define([_defopt], m4_default([$1], [auto]))
12329f00f3a1SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
12339f00f3a1Smrg	[Enable building unit test cases (default: ]_defopt[)]),
12349f00f3a1Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
12359f00f3a1Smrgm4_undefine([_defopt])
12369f00f3a1SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
12379f00f3a1SmrgAC_MSG_CHECKING([whether to build unit test cases])
12389f00f3a1SmrgAC_MSG_RESULT([$enable_unit_tests])
12399f00f3a1Smrg]) # XORG_ENABLE_UNIT_TESTS
1240a966c04fSmrg
12419f00f3a1Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
12429f00f3a1Smrg# ------------------------------------------------------
12439f00f3a1Smrg# Minimum version: 1.17.0
12449f00f3a1Smrg#
12459f00f3a1Smrg# This macro enables a builder to enable/disable integration testing
12469f00f3a1Smrg# It makes no assumption about the test cases' implementation
12479f00f3a1Smrg# Test cases may or may not use Automake "Support for test suites"
12489f00f3a1Smrg#
12499f00f3a1Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
12509f00f3a1Smrg# usually requires less dependencies and may be built and run under less
12519f00f3a1Smrg# stringent environments than integration tests.
12529f00f3a1Smrg#
12539f00f3a1Smrg# Interface to module:
12549f00f3a1Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
12559f00f3a1Smrg# enable_integration_tests:   used in configure.ac for additional configuration
12569f00f3a1Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
12579f00f3a1Smrg#                             'no' user instructs the module not to build tests
12589f00f3a1Smrg# parm1:                      specify the default value, yes or no.
12599f00f3a1Smrg#
12609f00f3a1SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
12619f00f3a1SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
12629f00f3a1Smrgm4_define([_defopt], m4_default([$1], [auto]))
12639f00f3a1SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
12649f00f3a1Smrg	[Enable building integration test cases (default: ]_defopt[)]),
12659f00f3a1Smrg	[enable_integration_tests=$enableval],
12669f00f3a1Smrg	[enable_integration_tests=]_defopt)
12679f00f3a1Smrgm4_undefine([_defopt])
12689f00f3a1SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
12699f00f3a1Smrg	[test "x$enable_integration_tests" != xno])
12709f00f3a1SmrgAC_MSG_CHECKING([whether to build unit test cases])
12719f00f3a1SmrgAC_MSG_RESULT([$enable_integration_tests])
12729f00f3a1Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
12736e7d3316Smrg
12749f00f3a1Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
12759f00f3a1Smrg# ----------------------------------------
12769f00f3a1Smrg# Minimum version: 1.13.0
12779f00f3a1Smrg#
12789f00f3a1Smrg# GLib is a library which provides advanced data structures and functions.
12799f00f3a1Smrg# This macro enables a module to test for the presence of Glib.
12809f00f3a1Smrg#
12819f00f3a1Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
12829f00f3a1Smrg# Otherwise the value of $enable_unit_tests is blank.
12839f00f3a1Smrg#
12849f00f3a1Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
12859f00f3a1Smrg# test support usually requires less dependencies and may be built and run under
12869f00f3a1Smrg# less stringent environments than integration tests.
12879f00f3a1Smrg#
12889f00f3a1Smrg# Interface to module:
12899f00f3a1Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
12909f00f3a1Smrg# with_glib: used in configure.ac to know if GLib has been found
12919f00f3a1Smrg# --with-glib:	'yes' user instructs the module to use glib
12929f00f3a1Smrg#		'no' user instructs the module not to use glib
12939f00f3a1Smrg#
12949f00f3a1SmrgAC_DEFUN([XORG_WITH_GLIB],[
12959f00f3a1SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
12969f00f3a1Smrgm4_define([_defopt], m4_default([$2], [auto]))
12979f00f3a1SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
12989f00f3a1Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
12999f00f3a1Smrg	[with_glib=$withval], [with_glib=]_defopt)
13009f00f3a1Smrgm4_undefine([_defopt])
13016e7d3316Smrg
13029f00f3a1Smrghave_glib=no
13039f00f3a1Smrg# Do not probe GLib if user explicitly disabled unit testing
13049f00f3a1Smrgif test "x$enable_unit_tests" != x"no"; then
13059f00f3a1Smrg  # Do not probe GLib if user explicitly disabled it
13069f00f3a1Smrg  if test "x$with_glib" != x"no"; then
13079f00f3a1Smrg    m4_ifval(
13089f00f3a1Smrg      [$1],
13099f00f3a1Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
13109f00f3a1Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
13119f00f3a1Smrg    )
13129f00f3a1Smrg  fi
13136e7d3316Smrgfi
13146e7d3316Smrg
13159f00f3a1Smrg# Not having GLib when unit testing has been explicitly requested is an error
13169f00f3a1Smrgif test "x$enable_unit_tests" = x"yes"; then
13179f00f3a1Smrg  if test "x$have_glib" = x"no"; then
13189f00f3a1Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
131997cf2ee2Smrg  fi
13209f00f3a1Smrgfi
13216e7d3316Smrg
13229f00f3a1Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
13239f00f3a1Smrgif test "x$enable_unit_tests" = x"no"; then
13249f00f3a1Smrg  if test "x$with_glib" = x"yes"; then
13259f00f3a1Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
132697cf2ee2Smrg  fi
13279f00f3a1Smrgfi
13286e7d3316Smrg
13299f00f3a1Smrg# Not having GLib when it has been explicitly requested is an error
13309f00f3a1Smrgif test "x$with_glib" = x"yes"; then
13319f00f3a1Smrg  if test "x$have_glib" = x"no"; then
13329f00f3a1Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
13339f00f3a1Smrg  fi
13349f00f3a1Smrgfi
13356e7d3316Smrg
13369f00f3a1SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
13379f00f3a1Smrg]) # XORG_WITH_GLIB
13386e7d3316Smrg
13399f00f3a1Smrg# XORG_LD_WRAP([required|optional])
13409f00f3a1Smrg# ---------------------------------
13419f00f3a1Smrg# Minimum version: 1.13.0
134297cf2ee2Smrg#
13439f00f3a1Smrg# Check if linker supports -wrap, passed via compiler flags
13449f00f3a1Smrg#
13459f00f3a1Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
13469f00f3a1Smrg# Otherwise the value of $enable_unit_tests is blank.
13479f00f3a1Smrg#
13489f00f3a1Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
13499f00f3a1Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
13509f00f3a1Smrg# available, an argument of "optional" allows use when some unit tests require
13519f00f3a1Smrg# ld -wrap and others do not.
13529f00f3a1Smrg#
13539f00f3a1SmrgAC_DEFUN([XORG_LD_WRAP],[
13549f00f3a1SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
13559f00f3a1Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
13569f00f3a1Smrg                      void __wrap_exit(int status) { return; }],
13579f00f3a1Smrg                     [exit(0);])])
13589f00f3a1Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
13599f00f3a1Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
13609f00f3a1Smrg  if test "x$have_ld_wrap" = x"no"; then
13619f00f3a1Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
13629f00f3a1Smrg  fi
13639f00f3a1Smrgfi
13649f00f3a1SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
13659f00f3a1Smrg#
13669f00f3a1Smrg]) # XORG_LD_WRAP
13676e7d3316Smrg
13689f00f3a1Smrg# XORG_CHECK_LINKER_FLAGS
136997cf2ee2Smrg# -----------------------
13709f00f3a1Smrg# SYNOPSIS
13719f00f3a1Smrg#
13729f00f3a1Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
13739f00f3a1Smrg#
13749f00f3a1Smrg# DESCRIPTION
13759f00f3a1Smrg#
13769f00f3a1Smrg#   Check whether the given linker FLAGS work with the current language's
13779f00f3a1Smrg#   linker, or whether they give an error.
13789f00f3a1Smrg#
13799f00f3a1Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
13809f00f3a1Smrg#   success/failure.
13819f00f3a1Smrg#
13829f00f3a1Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
13839f00f3a1Smrg#
13849f00f3a1Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
13859f00f3a1Smrg#
13869f00f3a1Smrg# LICENSE
13879f00f3a1Smrg#
13889f00f3a1Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
13899f00f3a1Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
13909f00f3a1Smrg#   Copyright (c) 2009 Matteo Frigo
13919f00f3a1Smrg#
13929f00f3a1Smrg#   This program is free software: you can redistribute it and/or modify it
13939f00f3a1Smrg#   under the terms of the GNU General Public License as published by the
13949f00f3a1Smrg#   Free Software Foundation, either version 3 of the License, or (at your
13959f00f3a1Smrg#   option) any later version.
13969f00f3a1Smrg#
13979f00f3a1Smrg#   This program is distributed in the hope that it will be useful, but
13989f00f3a1Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
13999f00f3a1Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
14009f00f3a1Smrg#   Public License for more details.
14019f00f3a1Smrg#
14029f00f3a1Smrg#   You should have received a copy of the GNU General Public License along
14039f00f3a1Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
14049f00f3a1Smrg#
14059f00f3a1Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
14069f00f3a1Smrg#   gives unlimited permission to copy, distribute and modify the configure
14079f00f3a1Smrg#   scripts that are the output of Autoconf when processing the Macro. You
14089f00f3a1Smrg#   need not follow the terms of the GNU General Public License when using
14099f00f3a1Smrg#   or distributing such scripts, even though portions of the text of the
14109f00f3a1Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
14119f00f3a1Smrg#   all other use of the material that constitutes the Autoconf Macro.
14129f00f3a1Smrg#
14139f00f3a1Smrg#   This special exception to the GPL applies to versions of the Autoconf
14149f00f3a1Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
14159f00f3a1Smrg#   modified version of the Autoconf Macro, you may extend this special
14169f00f3a1Smrg#   exception to the GPL to apply to your modified version as well.#
14179f00f3a1SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
14189f00f3a1Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
14199f00f3a1Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
14209f00f3a1SmrgAS_LITERAL_IF([$1],
14219f00f3a1Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
14229f00f3a1Smrg      ax_save_FLAGS=$LDFLAGS
14239f00f3a1Smrg      LDFLAGS="$1"
14249f00f3a1Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
14259f00f3a1Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
14269f00f3a1Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
14279f00f3a1Smrg      LDFLAGS=$ax_save_FLAGS])],
14289f00f3a1Smrg  [ax_save_FLAGS=$LDFLAGS
14299f00f3a1Smrg   LDFLAGS="$1"
14309f00f3a1Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
14319f00f3a1Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
14329f00f3a1Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
14339f00f3a1Smrg   LDFLAGS=$ax_save_FLAGS])
14349f00f3a1Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
14359f00f3a1SmrgAC_MSG_RESULT($xorg_check_linker_flags)
14369f00f3a1Smrgif test "x$xorg_check_linker_flags" = xyes; then
14379f00f3a1Smrg	m4_default([$2], :)
14389f00f3a1Smrgelse
14399f00f3a1Smrg	m4_default([$3], :)
14409f00f3a1Smrgfi
14419f00f3a1Smrg]) # XORG_CHECK_LINKER_FLAGS
14426e7d3316Smrg
14439f00f3a1Smrg# XORG_MEMORY_CHECK_FLAGS
14449f00f3a1Smrg# -----------------------
14459f00f3a1Smrg# Minimum version: 1.16.0
14469f00f3a1Smrg#
14479f00f3a1Smrg# This macro attempts to find appropriate memory checking functionality
14489f00f3a1Smrg# for various platforms which unit testing code may use to catch various
14499f00f3a1Smrg# forms of memory allocation and access errors in testing.
14509f00f3a1Smrg#
14519f00f3a1Smrg# Interface to module:
14529f00f3a1Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
14539f00f3a1Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
14549f00f3a1Smrg#
14559f00f3a1Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
14569f00f3a1Smrg#
14579f00f3a1SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
14586e7d3316Smrg
14599f00f3a1SmrgAC_REQUIRE([AC_CANONICAL_HOST])
14609f00f3a1SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
14619f00f3a1Smrg           [Environment variables to enable memory checking in tests])
1462a966c04fSmrg
14639f00f3a1Smrg# Check for different types of support on different platforms
14649f00f3a1Smrgcase $host_os in
14659f00f3a1Smrg    solaris*)
14669f00f3a1Smrg        AC_CHECK_LIB([umem], [umem_alloc],
14679f00f3a1Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
14689f00f3a1Smrg        ;;
14699f00f3a1Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
14709f00f3a1Smrg        # both directly and inverted, so should not be 0 or 255.
14719f00f3a1Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
14729f00f3a1Smrg        ;;
14739f00f3a1Smrg    darwin*)
14749f00f3a1Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
14759f00f3a1Smrg        ;;
14769f00f3a1Smrg    *bsd*)
14779f00f3a1Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
14789f00f3a1Smrg        ;;
14799f00f3a1Smrgesac
1480a966c04fSmrg
14819f00f3a1Smrg# User supplied flags override default flags
14829f00f3a1Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
14839f00f3a1Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
148497cf2ee2Smrgfi
14856e7d3316Smrg
14869f00f3a1SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
14879f00f3a1Smrg]) # XORG_WITH_LINT
1488a966c04fSmrg
14899f00f3a1Smrg# XORG_CHECK_MALLOC_ZERO
14909f00f3a1Smrg# ----------------------
14919f00f3a1Smrg# Minimum version: 1.0.0
14929f00f3a1Smrg#
14939f00f3a1Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
14949f00f3a1Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
14959f00f3a1Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
14969f00f3a1SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
14979f00f3a1SmrgAC_ARG_ENABLE(malloc0returnsnull,
14989f00f3a1Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
14999f00f3a1Smrg		       [malloc(0) returns NULL (default: auto)]),
15009f00f3a1Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
15019f00f3a1Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1502a966c04fSmrg
15039f00f3a1SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
15049f00f3a1Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
15059f00f3a1Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
15069f00f3a1Smrg#include <stdlib.h>
15079f00f3a1Smrg],[
15089f00f3a1Smrg    char *m0, *r0, *c0, *p;
15099f00f3a1Smrg    m0 = malloc(0);
15109f00f3a1Smrg    p = malloc(10);
15119f00f3a1Smrg    r0 = realloc(p,0);
15129f00f3a1Smrg    c0 = calloc(0,10);
15139f00f3a1Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
15149f00f3a1Smrg])],
15159f00f3a1Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
15169f00f3a1Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
15179f00f3a1Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1518ac92798bSmrgfi
15199f00f3a1SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
15209f00f3a1Smrg
15219f00f3a1Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
15229f00f3a1Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
15239f00f3a1Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
15249f00f3a1Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
15259f00f3a1Smrgelse
15269f00f3a1Smrg	MALLOC_ZERO_CFLAGS=""
15279f00f3a1Smrg	XMALLOC_ZERO_CFLAGS=""
15289f00f3a1Smrg	XTMALLOC_ZERO_CFLAGS=""
1529ac92798bSmrgfi
1530ac92798bSmrg
15319f00f3a1SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
15329f00f3a1SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
15339f00f3a1SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
15349f00f3a1Smrg]) # XORG_CHECK_MALLOC_ZERO
1535ac92798bSmrg
15369f00f3a1Smrg# XORG_WITH_LINT()
153797cf2ee2Smrg# ----------------
15389f00f3a1Smrg# Minimum version: 1.1.0
15399f00f3a1Smrg#
15409f00f3a1Smrg# This macro enables the use of a tool that flags some suspicious and
15419f00f3a1Smrg# non-portable constructs (likely to be bugs) in C language source code.
15429f00f3a1Smrg# It will attempt to locate the tool and use appropriate options.
15439f00f3a1Smrg# There are various lint type tools on different platforms.
15449f00f3a1Smrg#
15459f00f3a1Smrg# Interface to module:
15469f00f3a1Smrg# LINT:		returns the path to the tool found on the platform
15479f00f3a1Smrg#		or the value set to LINT on the configure cmd line
15489f00f3a1Smrg#		also an Automake conditional
15499f00f3a1Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
15509f00f3a1Smrg#
15519f00f3a1Smrg# --with-lint:	'yes' user instructs the module to use lint
15529f00f3a1Smrg#		'no' user instructs the module not to use lint (default)
15539f00f3a1Smrg#
15549f00f3a1Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
15559f00f3a1Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
15569f00f3a1Smrg#
15579f00f3a1SmrgAC_DEFUN([XORG_WITH_LINT],[
15586e7d3316Smrg
15599f00f3a1SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
15609f00f3a1SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
15619f00f3a1SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
15629f00f3a1Smrg		[Use a lint-style source code checker (default: disabled)])],
15639f00f3a1Smrg		[use_lint=$withval], [use_lint=no])
15646e7d3316Smrg
15659f00f3a1Smrg# Obtain platform specific info like program name and options
15669f00f3a1Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
15679f00f3a1Smrgcase $host_os in
15689f00f3a1Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
15699f00f3a1Smrg	lint_name=splint
15709f00f3a1Smrg	lint_options="-badflag"
15719f00f3a1Smrg	;;
15729f00f3a1Smrg  *freebsd* | *netbsd*)
15739f00f3a1Smrg	lint_name=lint
15749f00f3a1Smrg	lint_options="-u -b"
15759f00f3a1Smrg	;;
15769f00f3a1Smrg  *solaris*)
15779f00f3a1Smrg	lint_name=lint
15789f00f3a1Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
15799f00f3a1Smrg	;;
15809f00f3a1Smrgesac
15816e7d3316Smrg
15829f00f3a1Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
15839f00f3a1Smrgif test "x$use_lint" = x"yes" ; then
15849f00f3a1Smrg   AC_PATH_PROG([LINT], [$lint_name])
15859f00f3a1Smrg   if test "x$LINT" = "x"; then
15869f00f3a1Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
15879f00f3a1Smrg   fi
15889f00f3a1Smrgelif test "x$use_lint" = x"no" ; then
15899f00f3a1Smrg   if test "x$LINT" != "x"; then
15909f00f3a1Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
15919f00f3a1Smrg   fi
15929f00f3a1Smrgelse
15939f00f3a1Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
15949f00f3a1Smrgfi
15956e7d3316Smrg
15969f00f3a1Smrg# User supplied flags override default flags
15979f00f3a1Smrgif test "x$LINT_FLAGS" != "x"; then
15989f00f3a1Smrg   lint_options=$LINT_FLAGS
15999f00f3a1Smrgfi
16006e7d3316Smrg
16019f00f3a1SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
16029f00f3a1SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
16036e7d3316Smrg
16049f00f3a1Smrg]) # XORG_WITH_LINT
16056e7d3316Smrg
16069f00f3a1Smrg# XORG_LINT_LIBRARY(LIBNAME)
16079f00f3a1Smrg# --------------------------
16089f00f3a1Smrg# Minimum version: 1.1.0
16099f00f3a1Smrg#
16109f00f3a1Smrg# Sets up flags for building lint libraries for checking programs that call
16119f00f3a1Smrg# functions in the library.
16129f00f3a1Smrg#
16139f00f3a1Smrg# Interface to module:
16149f00f3a1Smrg# LINTLIB		- Automake variable with the name of lint library file to make
16159f00f3a1Smrg# MAKE_LINT_LIB		- Automake conditional
16169f00f3a1Smrg#
16179f00f3a1Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
16189f00f3a1Smrg#			  - 'no' user instructs the module not to create a lint library (default)
16196e7d3316Smrg
16209f00f3a1SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
16219f00f3a1SmrgAC_REQUIRE([XORG_WITH_LINT])
16229f00f3a1SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
16239f00f3a1Smrg	[Create lint library (default: disabled)])],
16249f00f3a1Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
16256e7d3316Smrg
16269f00f3a1Smrgif test "x$make_lint_lib" = x"yes" ; then
16279f00f3a1Smrg   LINTLIB=llib-l$1.ln
16289f00f3a1Smrg   if test "x$LINT" = "x"; then
16299f00f3a1Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
16309f00f3a1Smrg   fi
16319f00f3a1Smrgelif test "x$make_lint_lib" != x"no" ; then
16329f00f3a1Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
163397cf2ee2Smrgfi
16346e7d3316Smrg
16359f00f3a1SmrgAC_SUBST(LINTLIB)
16369f00f3a1SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
16379f00f3a1Smrg
16389f00f3a1Smrg]) # XORG_LINT_LIBRARY
16396e7d3316Smrg
16409f00f3a1Smrg# XORG_COMPILER_BRAND
16416e7d3316Smrg# -------------------
16429f00f3a1Smrg# Minimum version: 1.14.0
16439f00f3a1Smrg#
16449f00f3a1Smrg# Checks for various brands of compilers and sets flags as appropriate:
16459f00f3a1Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
16469f00f3a1Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
16479f00f3a1Smrg#   clang compiler - sets CLANGCC to "yes"
16489f00f3a1Smrg#   Intel compiler - sets INTELCC to "yes"
16499f00f3a1Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
16509f00f3a1Smrg#
16519f00f3a1SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
16529f00f3a1SmrgAC_LANG_CASE(
16539f00f3a1Smrg	[C], [
16549f00f3a1Smrg		AC_REQUIRE([AC_PROG_CC_C99])
16559f00f3a1Smrg	],
16569f00f3a1Smrg	[C++], [
16579f00f3a1Smrg		AC_REQUIRE([AC_PROG_CXX])
16589f00f3a1Smrg	]
16599f00f3a1Smrg)
16609f00f3a1SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
16619f00f3a1SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
16629f00f3a1SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
16639f00f3a1Smrg]) # XORG_COMPILER_BRAND
16646e7d3316Smrg
16659f00f3a1Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
16669f00f3a1Smrg# ---------------
16679f00f3a1Smrg# Minimum version: 1.16.0
16689f00f3a1Smrg#
16699f00f3a1Smrg# Test if the compiler works when passed the given flag as a command line argument.
16709f00f3a1Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
16719f00f3a1Smrg# next flag in the list until there are no more options.
16729f00f3a1Smrg#
16739f00f3a1Smrg# Note that this does not guarantee that the compiler supports the flag as some
16749f00f3a1Smrg# compilers will simply ignore arguments that they do not understand, but we do
16759f00f3a1Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
16769f00f3a1Smrg# -Werror=unused-command-line-argument
16779f00f3a1Smrg#
16789f00f3a1SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
16799f00f3a1Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
16809f00f3a1Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
16816e7d3316Smrg
16829f00f3a1SmrgAC_LANG_COMPILER_REQUIRE
16836e7d3316Smrg
16849f00f3a1SmrgAC_LANG_CASE(
16859f00f3a1Smrg	[C], [
16869f00f3a1Smrg		AC_REQUIRE([AC_PROG_CC_C99])
16879f00f3a1Smrg		define([PREFIX], [C])
16889f00f3a1Smrg		define([CACHE_PREFIX], [cc])
16899f00f3a1Smrg		define([COMPILER], [$CC])
16909f00f3a1Smrg	],
16919f00f3a1Smrg	[C++], [
16929f00f3a1Smrg		define([PREFIX], [CXX])
16939f00f3a1Smrg		define([CACHE_PREFIX], [cxx])
16949f00f3a1Smrg		define([COMPILER], [$CXX])
16959f00f3a1Smrg	]
16969f00f3a1Smrg)
16976e7d3316Smrg
16989f00f3a1Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
16996e7d3316Smrg
17009f00f3a1Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
17019f00f3a1Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
17029f00f3a1Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
17039f00f3a1Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
17049f00f3a1Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
17059f00f3a1Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
17069f00f3a1Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
17079f00f3a1Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
17089f00f3a1Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
17099f00f3a1Smrgfi
17106e7d3316Smrg
17119f00f3a1Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
17129f00f3a1Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
17139f00f3a1Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
17149f00f3a1Smrg	fi
17159f00f3a1Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
17169f00f3a1Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
17179f00f3a1Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
17189f00f3a1Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
17199f00f3a1Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
17209f00f3a1Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
17219f00f3a1Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
17229f00f3a1Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
17239f00f3a1Smrgfi
17246e7d3316Smrg
17259f00f3a1Smrgfound="no"
17269f00f3a1Smrgm4_foreach([flag], m4_cdr($@), [
17279f00f3a1Smrg	if test $found = "no" ; then
17289f00f3a1Smrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
17299f00f3a1Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
17309f00f3a1Smrg		fi
17316e7d3316Smrg
17329f00f3a1Smrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
17339f00f3a1Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
17349f00f3a1Smrg		fi
17356e7d3316Smrg
17369f00f3a1Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
17376e7d3316Smrg
17389f00f3a1Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
17399f00f3a1Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports]flag[])
17409f00f3a1Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
17419f00f3a1Smrg		AC_CACHE_VAL($cacheid,
17429f00f3a1Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
17439f00f3a1Smrg					     [eval $cacheid=yes],
17449f00f3a1Smrg					     [eval $cacheid=no])])
17456e7d3316Smrg
17469f00f3a1Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
17476e7d3316Smrg
17489f00f3a1Smrg		eval supported=\$$cacheid
17499f00f3a1Smrg		AC_MSG_RESULT([$supported])
17509f00f3a1Smrg		if test "$supported" = "yes" ; then
17519f00f3a1Smrg			$1="$$1 ]flag["
17529f00f3a1Smrg			found="yes"
17539f00f3a1Smrg		fi
175497cf2ee2Smrg	fi
17559f00f3a1Smrg])
17569f00f3a1Smrg]) # XORG_TESTSET_CFLAG
17576e7d3316Smrg
17589f00f3a1Smrg# XORG_COMPILER_FLAGS
17599f00f3a1Smrg# ---------------
17609f00f3a1Smrg# Minimum version: 1.16.0
17619f00f3a1Smrg#
17629f00f3a1Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
17639f00f3a1Smrg# arguments supported by the selected compiler which do NOT alter the generated
17649f00f3a1Smrg# code.  These arguments will cause the compiler to print various warnings
17659f00f3a1Smrg# during compilation AND turn a conservative set of warnings into errors.
17669f00f3a1Smrg#
17679f00f3a1Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
17689f00f3a1Smrg# future versions of util-macros as options are added to new compilers.
17699f00f3a1Smrg#
17709f00f3a1SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
17719f00f3a1SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
17729f00f3a1Smrg
17739f00f3a1SmrgAC_ARG_ENABLE(selective-werror,
17749f00f3a1Smrg              AS_HELP_STRING([--disable-selective-werror],
17759f00f3a1Smrg                             [Turn off selective compiler errors. (default: enabled)]),
17769f00f3a1Smrg              [SELECTIVE_WERROR=$enableval],
17779f00f3a1Smrg              [SELECTIVE_WERROR=yes])
17786e7d3316Smrg
17799f00f3a1SmrgAC_LANG_CASE(
17809f00f3a1Smrg        [C], [
17819f00f3a1Smrg                define([PREFIX], [C])
17829f00f3a1Smrg        ],
17839f00f3a1Smrg        [C++], [
17849f00f3a1Smrg                define([PREFIX], [CXX])
17859f00f3a1Smrg        ]
17869f00f3a1Smrg)
17879f00f3a1Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
17889f00f3a1Smrgif test "x$SUNCC" = "xyes"; then
17899f00f3a1Smrg    [BASE_]PREFIX[FLAGS]="-v"
179097cf2ee2Smrgelse
17919f00f3a1Smrg    [BASE_]PREFIX[FLAGS]=""
17926e7d3316Smrgfi
17936e7d3316Smrg
17949f00f3a1Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
17959f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
17969f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
17979f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
17989f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
17996e7d3316Smrg
18009f00f3a1SmrgAC_LANG_CASE(
18019f00f3a1Smrg	[C], [
18029f00f3a1Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
18039f00f3a1Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
18049f00f3a1Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
18059f00f3a1Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
18069f00f3a1Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
18079f00f3a1Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
18089f00f3a1Smrg	]
18099f00f3a1Smrg)
18106e7d3316Smrg
18119f00f3a1Smrg# This chunk adds additional warnings that could catch undesired effects.
18129f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
18139f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
18149f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
18159f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
18169f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
18179f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
18189f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
18196e7d3316Smrg
18209f00f3a1Smrg# These are currently disabled because they are noisy.  They will be enabled
18219f00f3a1Smrg# in the future once the codebase is sufficiently modernized to silence
18229f00f3a1Smrg# them.  For now, I don't want them to drown out the other warnings.
18239f00f3a1Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
18249f00f3a1Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
18259f00f3a1Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
18266e7d3316Smrg
18279f00f3a1Smrg# Turn some warnings into errors, so we don't accidently get successful builds
18289f00f3a1Smrg# when there are problems that should be fixed.
18296e7d3316Smrg
18309f00f3a1Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
18319f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
18329f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
18339f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
18349f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
18359f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
18369f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
18379f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
18389f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
18399f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
18409f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
18419f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
18429f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
18439f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
184497cf2ee2Smrgelse
18459f00f3a1SmrgAC_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])
18469f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
18479f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
18489f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
18499f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
18509f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
18519f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
18529f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
18539f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
18549f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
18559f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
18569f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
18579f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
18589f00f3a1SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
185997cf2ee2Smrgfi
18606e7d3316Smrg
18619f00f3a1SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
18629f00f3a1Smrg]) # XORG_COMPILER_FLAGS
1863a966c04fSmrg
18649f00f3a1Smrg# XORG_CWARNFLAGS
18659f00f3a1Smrg# ---------------
18669f00f3a1Smrg# Minimum version: 1.2.0
18679f00f3a1Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
18689f00f3a1Smrg#
18699f00f3a1Smrg# Defines CWARNFLAGS to enable C compiler warnings.
18709f00f3a1Smrg#
18719f00f3a1Smrg# This function is deprecated because it defines -fno-strict-aliasing
18729f00f3a1Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
18739f00f3a1Smrg# is needed, then it should be added explicitly in the module when
18749f00f3a1Smrg# it is updated to use BASE_CFLAGS.
18759f00f3a1Smrg#
18769f00f3a1SmrgAC_DEFUN([XORG_CWARNFLAGS], [
18779f00f3a1SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
18789f00f3a1SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
18799f00f3a1SmrgAC_LANG_CASE(
18809f00f3a1Smrg	[C], [
18819f00f3a1Smrg		CWARNFLAGS="$BASE_CFLAGS"
18829f00f3a1Smrg		if  test "x$GCC" = xyes ; then
18839f00f3a1Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
18849f00f3a1Smrg		fi
18859f00f3a1Smrg		AC_SUBST(CWARNFLAGS)
18869f00f3a1Smrg	]
18879f00f3a1Smrg)
18889f00f3a1Smrg]) # XORG_CWARNFLAGS
1889a966c04fSmrg
18909f00f3a1Smrg# XORG_STRICT_OPTION
18919f00f3a1Smrg# -----------------------
18929f00f3a1Smrg# Minimum version: 1.3.0
18939f00f3a1Smrg#
18949f00f3a1Smrg# Add configure option to enable strict compilation flags, such as treating
18959f00f3a1Smrg# warnings as fatal errors.
18969f00f3a1Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
18979f00f3a1Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
18989f00f3a1Smrg#
18999f00f3a1Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
19009f00f3a1Smrg# when strict compilation is unconditionally desired.
19019f00f3a1SmrgAC_DEFUN([XORG_STRICT_OPTION], [
19029f00f3a1SmrgAC_REQUIRE([XORG_CWARNFLAGS])
19039f00f3a1SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
190497cf2ee2Smrg
19059f00f3a1SmrgAC_ARG_ENABLE(strict-compilation,
19069f00f3a1Smrg			  AS_HELP_STRING([--enable-strict-compilation],
19079f00f3a1Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
19089f00f3a1Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1909a966c04fSmrg
19109f00f3a1SmrgAC_LANG_CASE(
19119f00f3a1Smrg        [C], [
19129f00f3a1Smrg                define([PREFIX], [C])
19139f00f3a1Smrg        ],
19149f00f3a1Smrg        [C++], [
19159f00f3a1Smrg                define([PREFIX], [CXX])
19169f00f3a1Smrg        ]
19179f00f3a1Smrg)
1918a966c04fSmrg
19199f00f3a1Smrg[STRICT_]PREFIX[FLAGS]=""
19209f00f3a1SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
19219f00f3a1SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
1922a966c04fSmrg
19239f00f3a1Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
19249f00f3a1Smrg# activate it with -Werror, so we add it here explicitly.
19259f00f3a1SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
19266e7d3316Smrg
19279f00f3a1Smrgif test "x$STRICT_COMPILE" = "xyes"; then
19289f00f3a1Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
19299f00f3a1Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1930a966c04fSmrgfi
19319f00f3a1SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
19329f00f3a1SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
19339f00f3a1SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
19349f00f3a1Smrg]) # XORG_STRICT_OPTION
1935a966c04fSmrg
19369f00f3a1Smrg# XORG_DEFAULT_OPTIONS
19379f00f3a1Smrg# --------------------
19389f00f3a1Smrg# Minimum version: 1.3.0
19399f00f3a1Smrg#
19409f00f3a1Smrg# Defines default options for X.Org modules.
19419f00f3a1Smrg#
19429f00f3a1SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
19439f00f3a1SmrgAC_REQUIRE([AC_PROG_INSTALL])
19449f00f3a1SmrgXORG_COMPILER_FLAGS
19459f00f3a1SmrgXORG_CWARNFLAGS
19469f00f3a1SmrgXORG_STRICT_OPTION
19479f00f3a1SmrgXORG_RELEASE_VERSION
19489f00f3a1SmrgXORG_CHANGELOG
19499f00f3a1SmrgXORG_INSTALL
19509f00f3a1SmrgXORG_MANPAGE_SECTIONS
19519f00f3a1Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
19529f00f3a1Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
19539f00f3a1Smrg]) # XORG_DEFAULT_OPTIONS
1954a966c04fSmrg
19559f00f3a1Smrg# XORG_INSTALL()
19569f00f3a1Smrg# ----------------
19579f00f3a1Smrg# Minimum version: 1.4.0
19589f00f3a1Smrg#
19599f00f3a1Smrg# Defines the variable INSTALL_CMD as the command to copy
19609f00f3a1Smrg# INSTALL from $prefix/share/util-macros.
19619f00f3a1Smrg#
19629f00f3a1SmrgAC_DEFUN([XORG_INSTALL], [
19639f00f3a1SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
19649f00f3a1Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
19659f00f3a1SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
19669f00f3a1Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
19679f00f3a1Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
19689f00f3a1Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
19699f00f3a1SmrgAC_SUBST([INSTALL_CMD])
19709f00f3a1Smrg]) # XORG_INSTALL
19719f00f3a1Smrgdnl Copyright 2005 Red Hat, Inc
19729f00f3a1Smrgdnl
19739f00f3a1Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
19749f00f3a1Smrgdnl documentation for any purpose is hereby granted without fee, provided that
19759f00f3a1Smrgdnl the above copyright notice appear in all copies and that both that
19769f00f3a1Smrgdnl copyright notice and this permission notice appear in supporting
19779f00f3a1Smrgdnl documentation.
19789f00f3a1Smrgdnl
19799f00f3a1Smrgdnl The above copyright notice and this permission notice shall be included
19809f00f3a1Smrgdnl in all copies or substantial portions of the Software.
19819f00f3a1Smrgdnl
19829f00f3a1Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19839f00f3a1Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19849f00f3a1Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19859f00f3a1Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
19869f00f3a1Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19879f00f3a1Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19889f00f3a1Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
19899f00f3a1Smrgdnl
19909f00f3a1Smrgdnl Except as contained in this notice, the name of the copyright holders shall
19919f00f3a1Smrgdnl not be used in advertising or otherwise to promote the sale, use or
19929f00f3a1Smrgdnl other dealings in this Software without prior written authorization
19939f00f3a1Smrgdnl from the copyright holders.
19949f00f3a1Smrgdnl
1995a966c04fSmrg
19969f00f3a1Smrg# XORG_RELEASE_VERSION
19979f00f3a1Smrg# --------------------
19989f00f3a1Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
19999f00f3a1Smrg 
20009f00f3a1SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
20019f00f3a1Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
20029f00f3a1Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
20039f00f3a1Smrg		[Major version of this package])
20049f00f3a1Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
20059f00f3a1Smrg	if test "x$PVM" = "x"; then
20069f00f3a1Smrg		PVM="0"
20079f00f3a1Smrg	fi
20089f00f3a1Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
20099f00f3a1Smrg		[$PVM],
20109f00f3a1Smrg		[Minor version of this package])
20119f00f3a1Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
20129f00f3a1Smrg	if test "x$PVP" = "x"; then
20139f00f3a1Smrg		PVP="0"
20149f00f3a1Smrg	fi
20159f00f3a1Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
20169f00f3a1Smrg		[$PVP],
20179f00f3a1Smrg		[Patch version of this package])
2018a966c04fSmrg])
20196e7d3316Smrg
20209f00f3a1Smrg# XORG_CHANGELOG()
202197cf2ee2Smrg# ----------------
20229f00f3a1Smrg# Minimum version: 1.2.0
20239f00f3a1Smrg#
20249f00f3a1Smrg# Defines the variable CHANGELOG_CMD as the command to generate
20259f00f3a1Smrg# ChangeLog from git.
20269f00f3a1Smrg#
20279f00f3a1Smrg#
20289f00f3a1SmrgAC_DEFUN([XORG_CHANGELOG], [
20299f00f3a1SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
20309f00f3a1Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
20319f00f3a1Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
20329f00f3a1Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
20339f00f3a1SmrgAC_SUBST([CHANGELOG_CMD])
20349f00f3a1Smrg]) # XORG_CHANGELOG
2035a966c04fSmrg
20369f00f3a1Smrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
20379f00f3a1Smrg#
20389f00f3a1Smrg# This file is free software; the Free Software Foundation
20399f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
20409f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
2041a966c04fSmrg
20429f00f3a1Smrg# AM_AUTOMAKE_VERSION(VERSION)
20439f00f3a1Smrg# ----------------------------
20449f00f3a1Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
20459f00f3a1Smrg# generated from the m4 files accompanying Automake X.Y.
20469f00f3a1Smrg# (This private macro should not be called outside this file.)
20479f00f3a1SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
20489f00f3a1Smrg[am__api_version='1.14'
20499f00f3a1Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
20509f00f3a1Smrgdnl require some minimum version.  Point them to the right macro.
20519f00f3a1Smrgm4_if([$1], [1.14.1], [],
20529f00f3a1Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
20539f00f3a1Smrg])
205497cf2ee2Smrg
20559f00f3a1Smrg# _AM_AUTOCONF_VERSION(VERSION)
205697cf2ee2Smrg# -----------------------------
20579f00f3a1Smrg# aclocal traces this macro to find the Autoconf version.
20589f00f3a1Smrg# This is a private macro too.  Using m4_define simplifies
20599f00f3a1Smrg# the logic in aclocal, which can simply ignore this definition.
20609f00f3a1Smrgm4_define([_AM_AUTOCONF_VERSION], [])
2061a966c04fSmrg
20629f00f3a1Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
20639f00f3a1Smrg# -------------------------------
20649f00f3a1Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
20659f00f3a1Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
20669f00f3a1SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
20679f00f3a1Smrg[AM_AUTOMAKE_VERSION([1.14.1])dnl
20689f00f3a1Smrgm4_ifndef([AC_AUTOCONF_VERSION],
20699f00f3a1Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
20709f00f3a1Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
2071a966c04fSmrg
20729f00f3a1Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
2073a966c04fSmrg
20749f00f3a1Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
20759f00f3a1Smrg#
20769f00f3a1Smrg# This file is free software; the Free Software Foundation
20779f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
20789f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
2079a966c04fSmrg
20809f00f3a1Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
20819f00f3a1Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
20829f00f3a1Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
20839f00f3a1Smrg#
20849f00f3a1Smrg# Of course, Automake must honor this variable whenever it calls a
20859f00f3a1Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
20869f00f3a1Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
20879f00f3a1Smrg# depending on how configure is run.  This is pretty annoying, since
20889f00f3a1Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
20899f00f3a1Smrg# source directory, any form will work fine, but in subdirectories a
20909f00f3a1Smrg# relative path needs to be adjusted first.
20919f00f3a1Smrg#
20929f00f3a1Smrg# $ac_aux_dir/missing
20939f00f3a1Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
20949f00f3a1Smrg# $top_srcdir/$ac_aux_dir/missing
20959f00f3a1Smrg#    fails if $ac_aux_dir is absolute,
20969f00f3a1Smrg#    fails when called from a subdirectory in a VPATH build with
20979f00f3a1Smrg#          a relative $ac_aux_dir
20989f00f3a1Smrg#
20999f00f3a1Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
21009f00f3a1Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
21019f00f3a1Smrg# harmless because $srcdir is '.', but things will broke when you
21029f00f3a1Smrg# start a VPATH build or use an absolute $srcdir.
21039f00f3a1Smrg#
21049f00f3a1Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
21059f00f3a1Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
21069f00f3a1Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
21079f00f3a1Smrg# and then we would define $MISSING as
21089f00f3a1Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
21099f00f3a1Smrg# This will work as long as MISSING is not called from configure, because
21109f00f3a1Smrg# unfortunately $(top_srcdir) has no meaning in configure.
21119f00f3a1Smrg# However there are other variables, like CC, which are often used in
21129f00f3a1Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
21139f00f3a1Smrg#
21149f00f3a1Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
21159f00f3a1Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
21169f00f3a1Smrg# configured tree to be moved without reconfiguration.
2117a966c04fSmrg
21189f00f3a1SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
21199f00f3a1Smrg[dnl Rely on autoconf to set up CDPATH properly.
21209f00f3a1SmrgAC_PREREQ([2.50])dnl
21219f00f3a1Smrg# expand $ac_aux_dir to an absolute path
21229f00f3a1Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
21239f00f3a1Smrg])
2124a966c04fSmrg
21259f00f3a1Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
2126a966c04fSmrg
21279f00f3a1Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
21289f00f3a1Smrg#
21299f00f3a1Smrg# This file is free software; the Free Software Foundation
21309f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
21319f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
2132a966c04fSmrg
21339f00f3a1Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
21349f00f3a1Smrg# -------------------------------------
21359f00f3a1Smrg# Define a conditional.
21369f00f3a1SmrgAC_DEFUN([AM_CONDITIONAL],
21379f00f3a1Smrg[AC_PREREQ([2.52])dnl
21389f00f3a1Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
21399f00f3a1Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
21409f00f3a1SmrgAC_SUBST([$1_TRUE])dnl
21419f00f3a1SmrgAC_SUBST([$1_FALSE])dnl
21429f00f3a1Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
21439f00f3a1Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
21449f00f3a1Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
21459f00f3a1Smrgif $2; then
21469f00f3a1Smrg  $1_TRUE=
21479f00f3a1Smrg  $1_FALSE='#'
21489f00f3a1Smrgelse
21499f00f3a1Smrg  $1_TRUE='#'
21509f00f3a1Smrg  $1_FALSE=
21519f00f3a1Smrgfi
21529f00f3a1SmrgAC_CONFIG_COMMANDS_PRE(
21539f00f3a1Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
21549f00f3a1Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
21559f00f3a1SmrgUsually this means the macro was only invoked conditionally.]])
21569f00f3a1Smrgfi])])
2157a966c04fSmrg
21589f00f3a1Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
21599f00f3a1Smrg#
21609f00f3a1Smrg# This file is free software; the Free Software Foundation
21619f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
21629f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
2163a966c04fSmrg
2164a966c04fSmrg
21659f00f3a1Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
21669f00f3a1Smrg# written in clear, in which case automake, when reading aclocal.m4,
21679f00f3a1Smrg# will think it sees a *use*, and therefore will trigger all it's
21689f00f3a1Smrg# C support machinery.  Also note that it means that autoscan, seeing
21699f00f3a1Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
2170a966c04fSmrg
21716e7d3316Smrg
21729f00f3a1Smrg# _AM_DEPENDENCIES(NAME)
21739f00f3a1Smrg# ----------------------
21749f00f3a1Smrg# See how the compiler implements dependency checking.
21759f00f3a1Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
21769f00f3a1Smrg# We try a few techniques and use that to set a single cache variable.
21779f00f3a1Smrg#
21789f00f3a1Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
21799f00f3a1Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
21809f00f3a1Smrg# dependency, and given that the user is not expected to run this macro,
21819f00f3a1Smrg# just rely on AC_PROG_CC.
21829f00f3a1SmrgAC_DEFUN([_AM_DEPENDENCIES],
21839f00f3a1Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
21849f00f3a1SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
21859f00f3a1SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
21869f00f3a1SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
2187a966c04fSmrg
21889f00f3a1Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
21899f00f3a1Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
21909f00f3a1Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
21919f00f3a1Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
21929f00f3a1Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
21939f00f3a1Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
21949f00f3a1Smrg                    [depcc="$$1"   am_compiler_list=])
2195a966c04fSmrg
21969f00f3a1SmrgAC_CACHE_CHECK([dependency style of $depcc],
21979f00f3a1Smrg               [am_cv_$1_dependencies_compiler_type],
21989f00f3a1Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
21999f00f3a1Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
22009f00f3a1Smrg  # making bogus files that we don't know about and never remove.  For
22019f00f3a1Smrg  # instance it was reported that on HP-UX the gcc test will end up
22029f00f3a1Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
22039f00f3a1Smrg  # in D".
22049f00f3a1Smrg  rm -rf conftest.dir
22059f00f3a1Smrg  mkdir conftest.dir
22069f00f3a1Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
22079f00f3a1Smrg  # using a relative directory.
22089f00f3a1Smrg  cp "$am_depcomp" conftest.dir
22099f00f3a1Smrg  cd conftest.dir
22109f00f3a1Smrg  # We will build objects and dependencies in a subdirectory because
22119f00f3a1Smrg  # it helps to detect inapplicable dependency modes.  For instance
22129f00f3a1Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
22139f00f3a1Smrg  # side effect of compilation, but ICC will put the dependencies in
22149f00f3a1Smrg  # the current directory while Tru64 will put them in the object
22159f00f3a1Smrg  # directory.
22169f00f3a1Smrg  mkdir sub
2217a966c04fSmrg
22189f00f3a1Smrg  am_cv_$1_dependencies_compiler_type=none
22199f00f3a1Smrg  if test "$am_compiler_list" = ""; then
22209f00f3a1Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2221a966c04fSmrg  fi
22229f00f3a1Smrg  am__universal=false
22239f00f3a1Smrg  m4_case([$1], [CC],
22249f00f3a1Smrg    [case " $depcc " in #(
22259f00f3a1Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
22269f00f3a1Smrg     esac],
22279f00f3a1Smrg    [CXX],
22289f00f3a1Smrg    [case " $depcc " in #(
22299f00f3a1Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
22309f00f3a1Smrg     esac])
2231a966c04fSmrg
22329f00f3a1Smrg  for depmode in $am_compiler_list; do
22339f00f3a1Smrg    # Setup a source with many dependencies, because some compilers
22349f00f3a1Smrg    # like to wrap large dependency lists on column 80 (with \), and
22359f00f3a1Smrg    # we should not choose a depcomp mode which is confused by this.
22369f00f3a1Smrg    #
22379f00f3a1Smrg    # We need to recreate these files for each test, as the compiler may
22389f00f3a1Smrg    # overwrite some of them when testing with obscure command lines.
22399f00f3a1Smrg    # This happens at least with the AIX C compiler.
22409f00f3a1Smrg    : > sub/conftest.c
22419f00f3a1Smrg    for i in 1 2 3 4 5 6; do
22429f00f3a1Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
22439f00f3a1Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
22449f00f3a1Smrg      # Solaris 10 /bin/sh.
22459f00f3a1Smrg      echo '/* dummy */' > sub/conftst$i.h
22469f00f3a1Smrg    done
22479f00f3a1Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
224897cf2ee2Smrg
22499f00f3a1Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
22509f00f3a1Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
22519f00f3a1Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
22529f00f3a1Smrg    # versions had trouble with output in subdirs.
22539f00f3a1Smrg    am__obj=sub/conftest.${OBJEXT-o}
22549f00f3a1Smrg    am__minus_obj="-o $am__obj"
22559f00f3a1Smrg    case $depmode in
22569f00f3a1Smrg    gcc)
22579f00f3a1Smrg      # This depmode causes a compiler race in universal mode.
22589f00f3a1Smrg      test "$am__universal" = false || continue
225997cf2ee2Smrg      ;;
22609f00f3a1Smrg    nosideeffect)
22619f00f3a1Smrg      # After this tag, mechanisms are not by side-effect, so they'll
22629f00f3a1Smrg      # only be used when explicitly requested.
22639f00f3a1Smrg      if test "x$enable_dependency_tracking" = xyes; then
22649f00f3a1Smrg	continue
22659f00f3a1Smrg      else
22669f00f3a1Smrg	break
22679f00f3a1Smrg      fi
226897cf2ee2Smrg      ;;
22699f00f3a1Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
22709f00f3a1Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
22719f00f3a1Smrg      # not run yet.  These depmodes are late enough in the game, and
22729f00f3a1Smrg      # so weak that their functioning should not be impacted.
22739f00f3a1Smrg      am__obj=conftest.${OBJEXT-o}
22749f00f3a1Smrg      am__minus_obj=
227597cf2ee2Smrg      ;;
22769f00f3a1Smrg    none) break ;;
2277a966c04fSmrg    esac
22789f00f3a1Smrg    if depmode=$depmode \
22799f00f3a1Smrg       source=sub/conftest.c object=$am__obj \
22809f00f3a1Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
22819f00f3a1Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
22829f00f3a1Smrg         >/dev/null 2>conftest.err &&
22839f00f3a1Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
22849f00f3a1Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
22859f00f3a1Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
22869f00f3a1Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
22879f00f3a1Smrg      # icc doesn't choke on unknown options, it will just issue warnings
22889f00f3a1Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
22899f00f3a1Smrg      # that says an option was ignored or not supported.
22909f00f3a1Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
22919f00f3a1Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
22929f00f3a1Smrg      # The diagnosis changed in icc 8.0:
22939f00f3a1Smrg      #   icc: Command line remark: option '-MP' not supported
22949f00f3a1Smrg      if (grep 'ignoring option' conftest.err ||
22959f00f3a1Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
22969f00f3a1Smrg        am_cv_$1_dependencies_compiler_type=$depmode
22979f00f3a1Smrg        break
229897cf2ee2Smrg      fi
229997cf2ee2Smrg    fi
230097cf2ee2Smrg  done
23016e7d3316Smrg
23029f00f3a1Smrg  cd ..
23039f00f3a1Smrg  rm -rf conftest.dir
23046e7d3316Smrgelse
23059f00f3a1Smrg  am_cv_$1_dependencies_compiler_type=none
23066e7d3316Smrgfi
230797cf2ee2Smrg])
23089f00f3a1SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
23099f00f3a1SmrgAM_CONDITIONAL([am__fastdep$1], [
23109f00f3a1Smrg  test "x$enable_dependency_tracking" != xno \
23119f00f3a1Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
23129f00f3a1Smrg])
231397cf2ee2Smrg
231497cf2ee2Smrg
23159f00f3a1Smrg# AM_SET_DEPDIR
23169f00f3a1Smrg# -------------
23179f00f3a1Smrg# Choose a directory name for dependency files.
23189f00f3a1Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
23199f00f3a1SmrgAC_DEFUN([AM_SET_DEPDIR],
23209f00f3a1Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
23219f00f3a1SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
23229f00f3a1Smrg])
232397cf2ee2Smrg
2324a966c04fSmrg
23259f00f3a1Smrg# AM_DEP_TRACK
23269f00f3a1Smrg# ------------
23279f00f3a1SmrgAC_DEFUN([AM_DEP_TRACK],
23289f00f3a1Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
23299f00f3a1SmrgAS_HELP_STRING(
23309f00f3a1Smrg  [--enable-dependency-tracking],
23319f00f3a1Smrg  [do not reject slow dependency extractors])
23329f00f3a1SmrgAS_HELP_STRING(
23339f00f3a1Smrg  [--disable-dependency-tracking],
23349f00f3a1Smrg  [speeds up one-time build])])
23359f00f3a1Smrgif test "x$enable_dependency_tracking" != xno; then
23369f00f3a1Smrg  am_depcomp="$ac_aux_dir/depcomp"
23379f00f3a1Smrg  AMDEPBACKSLASH='\'
23389f00f3a1Smrg  am__nodep='_no'
23399f00f3a1Smrgfi
23409f00f3a1SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
23419f00f3a1SmrgAC_SUBST([AMDEPBACKSLASH])dnl
23429f00f3a1Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
23439f00f3a1SmrgAC_SUBST([am__nodep])dnl
23449f00f3a1Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
23459f00f3a1Smrg])
2346a966c04fSmrg
23479f00f3a1Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
2348a966c04fSmrg
23499f00f3a1Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
2350ac92798bSmrg#
23519f00f3a1Smrg# This file is free software; the Free Software Foundation
23529f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
23539f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
2354ac92798bSmrg
23559f00f3a1Smrg
23569f00f3a1Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
23579f00f3a1Smrg# ------------------------------
23589f00f3a1SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
23599f00f3a1Smrg[{
23609f00f3a1Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
23619f00f3a1Smrg  # are listed without --file.  Let's play safe and only enable the eval
23629f00f3a1Smrg  # if we detect the quoting.
23639f00f3a1Smrg  case $CONFIG_FILES in
23649f00f3a1Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
23659f00f3a1Smrg  *)   set x $CONFIG_FILES ;;
23669f00f3a1Smrg  esac
23679f00f3a1Smrg  shift
23689f00f3a1Smrg  for mf
23699f00f3a1Smrg  do
23709f00f3a1Smrg    # Strip MF so we end up with the name of the file.
23719f00f3a1Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
23729f00f3a1Smrg    # Check whether this is an Automake generated Makefile or not.
23739f00f3a1Smrg    # We used to match only the files named 'Makefile.in', but
23749f00f3a1Smrg    # some people rename them; so instead we look at the file content.
23759f00f3a1Smrg    # Grep'ing the first line is not enough: some people post-process
23769f00f3a1Smrg    # each Makefile.in and add a new line on top of each file to say so.
23779f00f3a1Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
23789f00f3a1Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
23799f00f3a1Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
23809f00f3a1Smrg      dirpart=`AS_DIRNAME("$mf")`
23819f00f3a1Smrg    else
23829f00f3a1Smrg      continue
23839f00f3a1Smrg    fi
23849f00f3a1Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
23859f00f3a1Smrg    # from the Makefile without running 'make'.
23869f00f3a1Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
23879f00f3a1Smrg    test -z "$DEPDIR" && continue
23889f00f3a1Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
23899f00f3a1Smrg    test -z "$am__include" && continue
23909f00f3a1Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
23919f00f3a1Smrg    # Find all dependency output files, they are included files with
23929f00f3a1Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
23939f00f3a1Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
23949f00f3a1Smrg    # expansion.
23959f00f3a1Smrg    for file in `sed -n "
23969f00f3a1Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
23979f00f3a1Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
23989f00f3a1Smrg      # Make sure the directory exists.
23999f00f3a1Smrg      test -f "$dirpart/$file" && continue
24009f00f3a1Smrg      fdir=`AS_DIRNAME(["$file"])`
24019f00f3a1Smrg      AS_MKDIR_P([$dirpart/$fdir])
24029f00f3a1Smrg      # echo "creating $dirpart/$file"
24039f00f3a1Smrg      echo '# dummy' > "$dirpart/$file"
24049f00f3a1Smrg    done
24059f00f3a1Smrg  done
24069f00f3a1Smrg}
24079f00f3a1Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
24089f00f3a1Smrg
24099f00f3a1Smrg
24109f00f3a1Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
24119f00f3a1Smrg# -----------------------------
24129f00f3a1Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
2413ac92798bSmrg#
24149f00f3a1Smrg# This code is only required when automatic dependency tracking
24159f00f3a1Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
24169f00f3a1Smrg# need in order to bootstrap the dependency handling code.
24179f00f3a1SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
24189f00f3a1Smrg[AC_CONFIG_COMMANDS([depfiles],
24199f00f3a1Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
24209f00f3a1Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
24219f00f3a1Smrg])
24229f00f3a1Smrg
24239f00f3a1Smrg# Do all the work for Automake.                             -*- Autoconf -*-
24249f00f3a1Smrg
24259f00f3a1Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
242697cf2ee2Smrg#
24279f00f3a1Smrg# This file is free software; the Free Software Foundation
24289f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
24299f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
2430a966c04fSmrg
24319f00f3a1Smrg# This macro actually does too much.  Some checks are only needed if
24329f00f3a1Smrg# your package does certain things.  But this isn't really a big deal.
2433a966c04fSmrg
24349f00f3a1Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
24359f00f3a1Smrgm4_define([AC_PROG_CC],
24369f00f3a1Smrgm4_defn([AC_PROG_CC])
24379f00f3a1Smrg[_AM_PROG_CC_C_O
24389f00f3a1Smrg])
24399f00f3a1Smrg
24409f00f3a1Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
24419f00f3a1Smrg# AM_INIT_AUTOMAKE([OPTIONS])
24429f00f3a1Smrg# -----------------------------------------------
24439f00f3a1Smrg# The call with PACKAGE and VERSION arguments is the old style
24449f00f3a1Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
24459f00f3a1Smrg# and VERSION should now be passed to AC_INIT and removed from
24469f00f3a1Smrg# the call to AM_INIT_AUTOMAKE.
24479f00f3a1Smrg# We support both call styles for the transition.  After
24489f00f3a1Smrg# the next Automake release, Autoconf can make the AC_INIT
24499f00f3a1Smrg# arguments mandatory, and then we can depend on a new Autoconf
24509f00f3a1Smrg# release and drop the old call support.
24519f00f3a1SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
24529f00f3a1Smrg[AC_PREREQ([2.65])dnl
24539f00f3a1Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
24549f00f3a1Smrgdnl the ones we care about.
24559f00f3a1Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
24569f00f3a1SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
24579f00f3a1SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
24589f00f3a1Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
24599f00f3a1Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
24609f00f3a1Smrg  # is not polluted with repeated "-I."
24619f00f3a1Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
24629f00f3a1Smrg  # test to see if srcdir already configured
24639f00f3a1Smrg  if test -f $srcdir/config.status; then
24649f00f3a1Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
246597cf2ee2Smrg  fi
246697cf2ee2Smrgfi
2467a966c04fSmrg
24689f00f3a1Smrg# test whether we have cygpath
24699f00f3a1Smrgif test -z "$CYGPATH_W"; then
24709f00f3a1Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
24719f00f3a1Smrg    CYGPATH_W='cygpath -w'
24729f00f3a1Smrg  else
24739f00f3a1Smrg    CYGPATH_W=echo
247497cf2ee2Smrg  fi
247597cf2ee2Smrgfi
24769f00f3a1SmrgAC_SUBST([CYGPATH_W])
2477a966c04fSmrg
24789f00f3a1Smrg# Define the identity of the package.
24799f00f3a1Smrgdnl Distinguish between old-style and new-style calls.
24809f00f3a1Smrgm4_ifval([$2],
24819f00f3a1Smrg[AC_DIAGNOSE([obsolete],
24829f00f3a1Smrg             [$0: two- and three-arguments forms are deprecated.])
24839f00f3a1Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
24849f00f3a1Smrg AC_SUBST([PACKAGE], [$1])dnl
24859f00f3a1Smrg AC_SUBST([VERSION], [$2])],
24869f00f3a1Smrg[_AM_SET_OPTIONS([$1])dnl
24879f00f3a1Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
24889f00f3a1Smrgm4_if(
24899f00f3a1Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
24909f00f3a1Smrg  [ok:ok],,
24919f00f3a1Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
24929f00f3a1Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
24939f00f3a1Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
2494a966c04fSmrg
24959f00f3a1Smrg_AM_IF_OPTION([no-define],,
24969f00f3a1Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
24979f00f3a1Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
2498a966c04fSmrg
24999f00f3a1Smrg# Some tools Automake needs.
25009f00f3a1SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
25019f00f3a1SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
25029f00f3a1SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
25039f00f3a1SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
25049f00f3a1SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
25059f00f3a1SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
25069f00f3a1SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
25079f00f3a1SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
25089f00f3a1SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
25099f00f3a1SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
25109f00f3a1Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
25119f00f3a1Smrg# dies out for good.  For more background, see:
25129f00f3a1Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
25139f00f3a1Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
25149f00f3a1SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
25159f00f3a1Smrg# We need awk for the "check" target.  The system "awk" is bad on
25169f00f3a1Smrg# some platforms.
25179f00f3a1SmrgAC_REQUIRE([AC_PROG_AWK])dnl
25189f00f3a1SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
25199f00f3a1SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
25209f00f3a1Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
25219f00f3a1Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
25229f00f3a1Smrg			     [_AM_PROG_TAR([v7])])])
25239f00f3a1Smrg_AM_IF_OPTION([no-dependencies],,
25249f00f3a1Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
25259f00f3a1Smrg		  [_AM_DEPENDENCIES([CC])],
25269f00f3a1Smrg		  [m4_define([AC_PROG_CC],
25279f00f3a1Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
25289f00f3a1SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
25299f00f3a1Smrg		  [_AM_DEPENDENCIES([CXX])],
25309f00f3a1Smrg		  [m4_define([AC_PROG_CXX],
25319f00f3a1Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
25329f00f3a1SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
25339f00f3a1Smrg		  [_AM_DEPENDENCIES([OBJC])],
25349f00f3a1Smrg		  [m4_define([AC_PROG_OBJC],
25359f00f3a1Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
25369f00f3a1SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
25379f00f3a1Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
25389f00f3a1Smrg		  [m4_define([AC_PROG_OBJCXX],
25399f00f3a1Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
25409f00f3a1Smrg])
25419f00f3a1SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
25429f00f3a1Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
25439f00f3a1Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
25449f00f3a1Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
25459f00f3a1SmrgAC_CONFIG_COMMANDS_PRE(dnl
25469f00f3a1Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
25479f00f3a1Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
2548a966c04fSmrg
25499f00f3a1Smrg# POSIX will say in a future version that running "rm -f" with no argument
25509f00f3a1Smrg# is OK; and we want to be able to make that assumption in our Makefile
25519f00f3a1Smrg# recipes.  So use an aggressive probe to check that the usage we want is
25529f00f3a1Smrg# actually supported "in the wild" to an acceptable degree.
25539f00f3a1Smrg# See automake bug#10828.
25549f00f3a1Smrg# To make any issue more visible, cause the running configure to be aborted
25559f00f3a1Smrg# by default if the 'rm' program in use doesn't match our expectations; the
25569f00f3a1Smrg# user can still override this though.
25579f00f3a1Smrgif rm -f && rm -fr && rm -rf; then : OK; else
25589f00f3a1Smrg  cat >&2 <<'END'
25599f00f3a1SmrgOops!
2560a966c04fSmrg
25619f00f3a1SmrgYour 'rm' program seems unable to run without file operands specified
25629f00f3a1Smrgon the command line, even when the '-f' option is present.  This is contrary
25639f00f3a1Smrgto the behaviour of most rm programs out there, and not conforming with
25649f00f3a1Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
25652e2dd055Smrg
25669f00f3a1SmrgPlease tell bug-automake@gnu.org about your system, including the value
25679f00f3a1Smrgof your $PATH and any error possibly output before this message.  This
25689f00f3a1Smrgcan help us improve future automake versions.
25692e2dd055Smrg
25709f00f3a1SmrgEND
25719f00f3a1Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
25729f00f3a1Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
25739f00f3a1Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
25749f00f3a1Smrg    echo >&2
25759f00f3a1Smrg  else
25769f00f3a1Smrg    cat >&2 <<'END'
25779f00f3a1SmrgAborting the configuration process, to ensure you take notice of the issue.
25782e2dd055Smrg
25799f00f3a1SmrgYou can download and install GNU coreutils to get an 'rm' implementation
25809f00f3a1Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
25812e2dd055Smrg
25829f00f3a1SmrgIf you want to complete the configuration process using your problematic
25839f00f3a1Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
25849f00f3a1Smrgto "yes", and re-run configure.
2585a966c04fSmrg
25869f00f3a1SmrgEND
25879f00f3a1Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
25889f00f3a1Smrg  fi
25899f00f3a1Smrgfi])
2590a966c04fSmrg
25919f00f3a1Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
25929f00f3a1Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
25939f00f3a1Smrgdnl mangled by Autoconf and run in a shell conditional statement.
25949f00f3a1Smrgm4_define([_AC_COMPILER_EXEEXT],
25959f00f3a1Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
2596a966c04fSmrg
25979f00f3a1Smrg# When config.status generates a header, we must update the stamp-h file.
25989f00f3a1Smrg# This file resides in the same directory as the config header
25999f00f3a1Smrg# that is generated.  The stamp files are numbered to have different names.
26006e7d3316Smrg
26019f00f3a1Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
26029f00f3a1Smrg# loop where config.status creates the headers, so we can generate
26039f00f3a1Smrg# our stamp files there.
26049f00f3a1SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
26059f00f3a1Smrg[# Compute $1's index in $config_headers.
26069f00f3a1Smrg_am_arg=$1
26079f00f3a1Smrg_am_stamp_count=1
26089f00f3a1Smrgfor _am_header in $config_headers :; do
26099f00f3a1Smrg  case $_am_header in
26109f00f3a1Smrg    $_am_arg | $_am_arg:* )
26119f00f3a1Smrg      break ;;
26129f00f3a1Smrg    * )
26139f00f3a1Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
26149f00f3a1Smrg  esac
26159f00f3a1Smrgdone
26169f00f3a1Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
26176e7d3316Smrg
26189f00f3a1Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
261997cf2ee2Smrg#
26209f00f3a1Smrg# This file is free software; the Free Software Foundation
26219f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
26229f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
26236e7d3316Smrg
26249f00f3a1Smrg# AM_PROG_INSTALL_SH
26259f00f3a1Smrg# ------------------
26269f00f3a1Smrg# Define $install_sh.
26279f00f3a1SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
26289f00f3a1Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
26299f00f3a1Smrgif test x"${install_sh}" != xset; then
26309f00f3a1Smrg  case $am_aux_dir in
26319f00f3a1Smrg  *\ * | *\	*)
26329f00f3a1Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
26339f00f3a1Smrg  *)
26349f00f3a1Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
26359f00f3a1Smrg  esac
26369f00f3a1Smrgfi
26379f00f3a1SmrgAC_SUBST([install_sh])])
26386e7d3316Smrg
26399f00f3a1Smrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
26409f00f3a1Smrg#
26419f00f3a1Smrg# This file is free software; the Free Software Foundation
26429f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
26439f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
26446e7d3316Smrg
26459f00f3a1Smrg# Check whether the underlying file-system supports filenames
26469f00f3a1Smrg# with a leading dot.  For instance MS-DOS doesn't.
26479f00f3a1SmrgAC_DEFUN([AM_SET_LEADING_DOT],
26489f00f3a1Smrg[rm -rf .tst 2>/dev/null
26499f00f3a1Smrgmkdir .tst 2>/dev/null
26509f00f3a1Smrgif test -d .tst; then
26519f00f3a1Smrg  am__leading_dot=.
265297cf2ee2Smrgelse
26539f00f3a1Smrg  am__leading_dot=_
265497cf2ee2Smrgfi
26559f00f3a1Smrgrmdir .tst 2>/dev/null
26569f00f3a1SmrgAC_SUBST([am__leading_dot])])
26576e7d3316Smrg
26589f00f3a1Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
26596e7d3316Smrg
26609f00f3a1Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
266197cf2ee2Smrg#
26629f00f3a1Smrg# This file is free software; the Free Software Foundation
26639f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
26649f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
26656e7d3316Smrg
26669f00f3a1Smrg# AM_MAKE_INCLUDE()
26679f00f3a1Smrg# -----------------
26689f00f3a1Smrg# Check to see how make treats includes.
26699f00f3a1SmrgAC_DEFUN([AM_MAKE_INCLUDE],
26709f00f3a1Smrg[am_make=${MAKE-make}
26719f00f3a1Smrgcat > confinc << 'END'
26729f00f3a1Smrgam__doit:
26739f00f3a1Smrg	@echo this is the am__doit target
26749f00f3a1Smrg.PHONY: am__doit
26759f00f3a1SmrgEND
26769f00f3a1Smrg# If we don't find an include directive, just comment out the code.
26779f00f3a1SmrgAC_MSG_CHECKING([for style of include used by $am_make])
26789f00f3a1Smrgam__include="#"
26799f00f3a1Smrgam__quote=
26809f00f3a1Smrg_am_result=none
26819f00f3a1Smrg# First try GNU make style include.
26829f00f3a1Smrgecho "include confinc" > confmf
26839f00f3a1Smrg# Ignore all kinds of additional output from 'make'.
26849f00f3a1Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
26859f00f3a1Smrg*the\ am__doit\ target*)
26869f00f3a1Smrg  am__include=include
26879f00f3a1Smrg  am__quote=
26889f00f3a1Smrg  _am_result=GNU
26899f00f3a1Smrg  ;;
26909f00f3a1Smrgesac
26919f00f3a1Smrg# Now try BSD make style include.
26929f00f3a1Smrgif test "$am__include" = "#"; then
26939f00f3a1Smrg   echo '.include "confinc"' > confmf
26949f00f3a1Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
26959f00f3a1Smrg   *the\ am__doit\ target*)
26969f00f3a1Smrg     am__include=.include
26979f00f3a1Smrg     am__quote="\""
26989f00f3a1Smrg     _am_result=BSD
26999f00f3a1Smrg     ;;
27009f00f3a1Smrg   esac
270197cf2ee2Smrgfi
27029f00f3a1SmrgAC_SUBST([am__include])
27039f00f3a1SmrgAC_SUBST([am__quote])
27049f00f3a1SmrgAC_MSG_RESULT([$_am_result])
27059f00f3a1Smrgrm -f confinc confmf
27069f00f3a1Smrg])
27076e7d3316Smrg
27089f00f3a1Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2709a966c04fSmrg
27109f00f3a1Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
271197cf2ee2Smrg#
27129f00f3a1Smrg# This file is free software; the Free Software Foundation
27139f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
27149f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
2715a966c04fSmrg
27169f00f3a1Smrg# AM_MISSING_PROG(NAME, PROGRAM)
27179f00f3a1Smrg# ------------------------------
27189f00f3a1SmrgAC_DEFUN([AM_MISSING_PROG],
27199f00f3a1Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
27209f00f3a1Smrg$1=${$1-"${am_missing_run}$2"}
27219f00f3a1SmrgAC_SUBST($1)])
272297cf2ee2Smrg
27239f00f3a1Smrg# AM_MISSING_HAS_RUN
27249f00f3a1Smrg# ------------------
27259f00f3a1Smrg# Define MISSING if not defined so far and test if it is modern enough.
27269f00f3a1Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
27279f00f3a1SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
27289f00f3a1Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
27299f00f3a1SmrgAC_REQUIRE_AUX_FILE([missing])dnl
27309f00f3a1Smrgif test x"${MISSING+set}" != xset; then
27319f00f3a1Smrg  case $am_aux_dir in
27329f00f3a1Smrg  *\ * | *\	*)
27339f00f3a1Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
27349f00f3a1Smrg  *)
27359f00f3a1Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
27369f00f3a1Smrg  esac
273797cf2ee2Smrgfi
27389f00f3a1Smrg# Use eval to expand $SHELL
27399f00f3a1Smrgif eval "$MISSING --is-lightweight"; then
27409f00f3a1Smrg  am_missing_run="$MISSING "
27419f00f3a1Smrgelse
27429f00f3a1Smrg  am_missing_run=
27439f00f3a1Smrg  AC_MSG_WARN(['missing' script is too old or missing])
274497cf2ee2Smrgfi
27459f00f3a1Smrg])
27462e2dd055Smrg
27479f00f3a1Smrg# Helper functions for option handling.                     -*- Autoconf -*-
274897cf2ee2Smrg
27499f00f3a1Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
27509f00f3a1Smrg#
27519f00f3a1Smrg# This file is free software; the Free Software Foundation
27529f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
27539f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
275497cf2ee2Smrg
27559f00f3a1Smrg# _AM_MANGLE_OPTION(NAME)
27569f00f3a1Smrg# -----------------------
27579f00f3a1SmrgAC_DEFUN([_AM_MANGLE_OPTION],
27589f00f3a1Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
275997cf2ee2Smrg
27609f00f3a1Smrg# _AM_SET_OPTION(NAME)
27619f00f3a1Smrg# --------------------
27629f00f3a1Smrg# Set option NAME.  Presently that only means defining a flag for this option.
27639f00f3a1SmrgAC_DEFUN([_AM_SET_OPTION],
27649f00f3a1Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
276597cf2ee2Smrg
27669f00f3a1Smrg# _AM_SET_OPTIONS(OPTIONS)
27679f00f3a1Smrg# ------------------------
27689f00f3a1Smrg# OPTIONS is a space-separated list of Automake options.
27699f00f3a1SmrgAC_DEFUN([_AM_SET_OPTIONS],
27709f00f3a1Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
277197cf2ee2Smrg
27729f00f3a1Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
27739f00f3a1Smrg# -------------------------------------------
27749f00f3a1Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
27759f00f3a1SmrgAC_DEFUN([_AM_IF_OPTION],
27769f00f3a1Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
27772e2dd055Smrg
27789f00f3a1Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
277997cf2ee2Smrg#
27809f00f3a1Smrg# This file is free software; the Free Software Foundation
27819f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
27829f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
278397cf2ee2Smrg
27849f00f3a1Smrg# _AM_PROG_CC_C_O
27859f00f3a1Smrg# ---------------
27869f00f3a1Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
27879f00f3a1Smrg# to automatically call this.
27889f00f3a1SmrgAC_DEFUN([_AM_PROG_CC_C_O],
27899f00f3a1Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
27909f00f3a1SmrgAC_REQUIRE_AUX_FILE([compile])dnl
27919f00f3a1SmrgAC_LANG_PUSH([C])dnl
27929f00f3a1SmrgAC_CACHE_CHECK(
27939f00f3a1Smrg  [whether $CC understands -c and -o together],
27949f00f3a1Smrg  [am_cv_prog_cc_c_o],
27959f00f3a1Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
27969f00f3a1Smrg  # Make sure it works both with $CC and with simple cc.
27979f00f3a1Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
27989f00f3a1Smrg  # compilers refuse to overwrite an existing .o file with -o,
27999f00f3a1Smrg  # though they will create one.
28009f00f3a1Smrg  am_cv_prog_cc_c_o=yes
28019f00f3a1Smrg  for am_i in 1 2; do
28029f00f3a1Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
28039f00f3a1Smrg         && test -f conftest2.$ac_objext; then
28049f00f3a1Smrg      : OK
28059f00f3a1Smrg    else
28069f00f3a1Smrg      am_cv_prog_cc_c_o=no
28079f00f3a1Smrg      break
28089f00f3a1Smrg    fi
28099f00f3a1Smrg  done
28109f00f3a1Smrg  rm -f core conftest*
28119f00f3a1Smrg  unset am_i])
28129f00f3a1Smrgif test "$am_cv_prog_cc_c_o" != yes; then
28139f00f3a1Smrg   # Losing compiler, so override with the script.
28149f00f3a1Smrg   # FIXME: It is wrong to rewrite CC.
28159f00f3a1Smrg   # But if we don't then we get into trouble of one sort or another.
28169f00f3a1Smrg   # A longer-term fix would be to have automake use am__CC in this case,
28179f00f3a1Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
28189f00f3a1Smrg   CC="$am_aux_dir/compile $CC"
281997cf2ee2Smrgfi
28209f00f3a1SmrgAC_LANG_POP([C])])
2821a966c04fSmrg
28229f00f3a1Smrg# For backward compatibility.
28239f00f3a1SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
28249f00f3a1Smrg
28259f00f3a1Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
28269f00f3a1Smrg#
28279f00f3a1Smrg# This file is free software; the Free Software Foundation
28289f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
28299f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
28309f00f3a1Smrg
28319f00f3a1Smrg# AM_RUN_LOG(COMMAND)
28329f00f3a1Smrg# -------------------
28339f00f3a1Smrg# Run COMMAND, save the exit status in ac_status, and log it.
28349f00f3a1Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
28359f00f3a1SmrgAC_DEFUN([AM_RUN_LOG],
28369f00f3a1Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
28379f00f3a1Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
28389f00f3a1Smrg   ac_status=$?
28399f00f3a1Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
28409f00f3a1Smrg   (exit $ac_status); }])
284197cf2ee2Smrg
28429f00f3a1Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
2843a966c04fSmrg
28449f00f3a1Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
28459f00f3a1Smrg#
28469f00f3a1Smrg# This file is free software; the Free Software Foundation
28479f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
28489f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
284997cf2ee2Smrg
28509f00f3a1Smrg# AM_SANITY_CHECK
28519f00f3a1Smrg# ---------------
28529f00f3a1SmrgAC_DEFUN([AM_SANITY_CHECK],
28539f00f3a1Smrg[AC_MSG_CHECKING([whether build environment is sane])
28549f00f3a1Smrg# Reject unsafe characters in $srcdir or the absolute working directory
28559f00f3a1Smrg# name.  Accept space and tab only in the latter.
28569f00f3a1Smrgam_lf='
28579f00f3a1Smrg'
28589f00f3a1Smrgcase `pwd` in
28599f00f3a1Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
28609f00f3a1Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
28619f00f3a1Smrgesac
28629f00f3a1Smrgcase $srcdir in
28639f00f3a1Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
28649f00f3a1Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
28659f00f3a1Smrgesac
286697cf2ee2Smrg
28679f00f3a1Smrg# Do 'set' in a subshell so we don't clobber the current shell's
28689f00f3a1Smrg# arguments.  Must try -L first in case configure is actually a
28699f00f3a1Smrg# symlink; some systems play weird games with the mod time of symlinks
28709f00f3a1Smrg# (eg FreeBSD returns the mod time of the symlink's containing
28719f00f3a1Smrg# directory).
28729f00f3a1Smrgif (
28739f00f3a1Smrg   am_has_slept=no
28749f00f3a1Smrg   for am_try in 1 2; do
28759f00f3a1Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
28769f00f3a1Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
28779f00f3a1Smrg     if test "$[*]" = "X"; then
28789f00f3a1Smrg	# -L didn't work.
28799f00f3a1Smrg	set X `ls -t "$srcdir/configure" conftest.file`
28809f00f3a1Smrg     fi
28819f00f3a1Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
28829f00f3a1Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
288397cf2ee2Smrg
28849f00f3a1Smrg	# If neither matched, then we have a broken ls.  This can happen
28859f00f3a1Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
28869f00f3a1Smrg	# broken ls alias from the environment.  This has actually
28879f00f3a1Smrg	# happened.  Such a system could not be considered "sane".
28889f00f3a1Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
28899f00f3a1Smrg  alias in your environment])
28909f00f3a1Smrg     fi
28919f00f3a1Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
28929f00f3a1Smrg       break
28939f00f3a1Smrg     fi
28949f00f3a1Smrg     # Just in case.
28959f00f3a1Smrg     sleep 1
28969f00f3a1Smrg     am_has_slept=yes
28979f00f3a1Smrg   done
28989f00f3a1Smrg   test "$[2]" = conftest.file
28999f00f3a1Smrg   )
29009f00f3a1Smrgthen
29019f00f3a1Smrg   # Ok.
29029f00f3a1Smrg   :
290397cf2ee2Smrgelse
29049f00f3a1Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
29059f00f3a1SmrgCheck your system clock])
290697cf2ee2Smrgfi
29079f00f3a1SmrgAC_MSG_RESULT([yes])
29089f00f3a1Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
29099f00f3a1Smrg# generated files are strictly newer.
29109f00f3a1Smrgam_sleep_pid=
29119f00f3a1Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
29129f00f3a1Smrg  ( sleep 1 ) &
29139f00f3a1Smrg  am_sleep_pid=$!
29149f00f3a1Smrgfi
29159f00f3a1SmrgAC_CONFIG_COMMANDS_PRE(
29169f00f3a1Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
29179f00f3a1Smrg   if test -n "$am_sleep_pid"; then
29189f00f3a1Smrg     # Hide warnings about reused PIDs.
29199f00f3a1Smrg     wait $am_sleep_pid 2>/dev/null
29209f00f3a1Smrg   fi
29219f00f3a1Smrg   AC_MSG_RESULT([done])])
29229f00f3a1Smrgrm -f conftest.file
29239f00f3a1Smrg])
2924a966c04fSmrg
29259f00f3a1Smrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
292697cf2ee2Smrg#
29279f00f3a1Smrg# This file is free software; the Free Software Foundation
29289f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
29299f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
2930a966c04fSmrg
29319f00f3a1Smrg# AM_SILENT_RULES([DEFAULT])
29329f00f3a1Smrg# --------------------------
29339f00f3a1Smrg# Enable less verbose build rules; with the default set to DEFAULT
29349f00f3a1Smrg# ("yes" being less verbose, "no" or empty being verbose).
29359f00f3a1SmrgAC_DEFUN([AM_SILENT_RULES],
29369f00f3a1Smrg[AC_ARG_ENABLE([silent-rules], [dnl
29379f00f3a1SmrgAS_HELP_STRING(
29389f00f3a1Smrg  [--enable-silent-rules],
29399f00f3a1Smrg  [less verbose build output (undo: "make V=1")])
29409f00f3a1SmrgAS_HELP_STRING(
29419f00f3a1Smrg  [--disable-silent-rules],
29429f00f3a1Smrg  [verbose build output (undo: "make V=0")])dnl
29439f00f3a1Smrg])
29449f00f3a1Smrgcase $enable_silent_rules in @%:@ (((
29459f00f3a1Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
29469f00f3a1Smrg   no) AM_DEFAULT_VERBOSITY=1;;
29479f00f3a1Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
29489f00f3a1Smrgesac
29499f00f3a1Smrgdnl
29509f00f3a1Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
29519f00f3a1Smrgdnl do not support nested variable expansions.
29529f00f3a1Smrgdnl See automake bug#9928 and bug#10237.
29539f00f3a1Smrgam_make=${MAKE-make}
29549f00f3a1SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
29559f00f3a1Smrg   [am_cv_make_support_nested_variables],
29569f00f3a1Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
29579f00f3a1SmrgBAR0=false
29589f00f3a1SmrgBAR1=true
29599f00f3a1SmrgV=1
29609f00f3a1Smrgam__doit:
29619f00f3a1Smrg	@$(TRUE)
29629f00f3a1Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
29639f00f3a1Smrg  am_cv_make_support_nested_variables=yes
29649f00f3a1Smrgelse
29659f00f3a1Smrg  am_cv_make_support_nested_variables=no
29669f00f3a1Smrgfi])
29679f00f3a1Smrgif test $am_cv_make_support_nested_variables = yes; then
29689f00f3a1Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
29699f00f3a1Smrg  AM_V='$(V)'
29709f00f3a1Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
29719f00f3a1Smrgelse
29729f00f3a1Smrg  AM_V=$AM_DEFAULT_VERBOSITY
29739f00f3a1Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
29749f00f3a1Smrgfi
29759f00f3a1SmrgAC_SUBST([AM_V])dnl
29769f00f3a1SmrgAM_SUBST_NOTMAKE([AM_V])dnl
29779f00f3a1SmrgAC_SUBST([AM_DEFAULT_V])dnl
29789f00f3a1SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
29799f00f3a1SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
29809f00f3a1SmrgAM_BACKSLASH='\'
29819f00f3a1SmrgAC_SUBST([AM_BACKSLASH])dnl
29829f00f3a1Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
29839f00f3a1Smrg])
29849f00f3a1Smrg
29859f00f3a1Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
298697cf2ee2Smrg#
29879f00f3a1Smrg# This file is free software; the Free Software Foundation
29889f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
29899f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
29909f00f3a1Smrg
29919f00f3a1Smrg# AM_PROG_INSTALL_STRIP
29929f00f3a1Smrg# ---------------------
29939f00f3a1Smrg# One issue with vendor 'install' (even GNU) is that you can't
29949f00f3a1Smrg# specify the program used to strip binaries.  This is especially
29959f00f3a1Smrg# annoying in cross-compiling environments, where the build's strip
29969f00f3a1Smrg# is unlikely to handle the host's binaries.
29979f00f3a1Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
29989f00f3a1Smrg# always use install-sh in "make install-strip", and initialize
29999f00f3a1Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
30009f00f3a1SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
30019f00f3a1Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
30029f00f3a1Smrg# Installed binaries are usually stripped using 'strip' when the user
30039f00f3a1Smrg# run "make install-strip".  However 'strip' might not be the right
30049f00f3a1Smrg# tool to use in cross-compilation environments, therefore Automake
30059f00f3a1Smrg# will honor the 'STRIP' environment variable to overrule this program.
30069f00f3a1Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
30079f00f3a1Smrgif test "$cross_compiling" != no; then
30089f00f3a1Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
30099f00f3a1Smrgfi
30109f00f3a1SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
30119f00f3a1SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
30122e2dd055Smrg
30139f00f3a1Smrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
30149f00f3a1Smrg#
30159f00f3a1Smrg# This file is free software; the Free Software Foundation
30169f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
30179f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
30182e2dd055Smrg
30199f00f3a1Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
30209f00f3a1Smrg# ---------------------------
30219f00f3a1Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
30229f00f3a1Smrg# This macro is traced by Automake.
30239f00f3a1SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
3024a966c04fSmrg
30259f00f3a1Smrg# AM_SUBST_NOTMAKE(VARIABLE)
30269f00f3a1Smrg# --------------------------
30279f00f3a1Smrg# Public sister of _AM_SUBST_NOTMAKE.
30289f00f3a1SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
3029a966c04fSmrg
30309f00f3a1Smrg# Check how to create a tarball.                            -*- Autoconf -*-
3031a966c04fSmrg
30329f00f3a1Smrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
30339f00f3a1Smrg#
30349f00f3a1Smrg# This file is free software; the Free Software Foundation
30359f00f3a1Smrg# gives unlimited permission to copy and/or distribute it,
30369f00f3a1Smrg# with or without modifications, as long as this notice is preserved.
30376e7d3316Smrg
30389f00f3a1Smrg# _AM_PROG_TAR(FORMAT)
303997cf2ee2Smrg# --------------------
30409f00f3a1Smrg# Check how to create a tarball in format FORMAT.
30419f00f3a1Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
30426e7d3316Smrg#
30439f00f3a1Smrg# Substitute a variable $(am__tar) that is a command
30449f00f3a1Smrg# writing to stdout a FORMAT-tarball containing the directory
30459f00f3a1Smrg# $tardir.
30469f00f3a1Smrg#     tardir=directory && $(am__tar) > result.tar
30476e7d3316Smrg#
30489f00f3a1Smrg# Substitute a variable $(am__untar) that extract such
30499f00f3a1Smrg# a tarball read from stdin.
30509f00f3a1Smrg#     $(am__untar) < result.tar
30516e7d3316Smrg#
30529f00f3a1SmrgAC_DEFUN([_AM_PROG_TAR],
30539f00f3a1Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
30549f00f3a1Smrg# in the wild :-(  We should find a proper way to deprecate it ...
30559f00f3a1SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
30566e7d3316Smrg
30579f00f3a1Smrg# We'll loop over all known methods to create a tar archive until one works.
30589f00f3a1Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
3059ac92798bSmrg
30609f00f3a1Smrgm4_if([$1], [v7],
30619f00f3a1Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
30626e7d3316Smrg
30639f00f3a1Smrg  [m4_case([$1],
30649f00f3a1Smrg    [ustar],
30659f00f3a1Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
30669f00f3a1Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
30679f00f3a1Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
30689f00f3a1Smrg      # and bug#13588).
30699f00f3a1Smrg      am_max_uid=2097151 # 2^21 - 1
30709f00f3a1Smrg      am_max_gid=$am_max_uid
30719f00f3a1Smrg      # The $UID and $GID variables are not portable, so we need to resort
30729f00f3a1Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
30739f00f3a1Smrg      # below are definitely unexpected, so allow the users to see them
30749f00f3a1Smrg      # (that is, avoid stderr redirection).
30759f00f3a1Smrg      am_uid=`id -u || echo unknown`
30769f00f3a1Smrg      am_gid=`id -g || echo unknown`
30779f00f3a1Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
30789f00f3a1Smrg      if test $am_uid -le $am_max_uid; then
30799f00f3a1Smrg         AC_MSG_RESULT([yes])
30809f00f3a1Smrg      else
30819f00f3a1Smrg         AC_MSG_RESULT([no])
30829f00f3a1Smrg         _am_tools=none
30839f00f3a1Smrg      fi
30849f00f3a1Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
30859f00f3a1Smrg      if test $am_gid -le $am_max_gid; then
30869f00f3a1Smrg         AC_MSG_RESULT([yes])
30879f00f3a1Smrg      else
30889f00f3a1Smrg        AC_MSG_RESULT([no])
30899f00f3a1Smrg        _am_tools=none
30909f00f3a1Smrg      fi],
30919f00f3a1Smrg
30929f00f3a1Smrg  [pax],
30939f00f3a1Smrg    [],
30949f00f3a1Smrg
30959f00f3a1Smrg  [m4_fatal([Unknown tar format])])
30969f00f3a1Smrg
30979f00f3a1Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
30989f00f3a1Smrg
30999f00f3a1Smrg  # Go ahead even if we have the value already cached.  We do so because we
31009f00f3a1Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
31019f00f3a1Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
31029f00f3a1Smrg
31039f00f3a1Smrg  for _am_tool in $_am_tools; do
31049f00f3a1Smrg    case $_am_tool in
31059f00f3a1Smrg    gnutar)
31069f00f3a1Smrg      for _am_tar in tar gnutar gtar; do
31079f00f3a1Smrg        AM_RUN_LOG([$_am_tar --version]) && break
31089f00f3a1Smrg      done
31099f00f3a1Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
31109f00f3a1Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
31119f00f3a1Smrg      am__untar="$_am_tar -xf -"
31129f00f3a1Smrg      ;;
31139f00f3a1Smrg    plaintar)
31149f00f3a1Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
31159f00f3a1Smrg      # ustar tarball either.
31169f00f3a1Smrg      (tar --version) >/dev/null 2>&1 && continue
31179f00f3a1Smrg      am__tar='tar chf - "$$tardir"'
31189f00f3a1Smrg      am__tar_='tar chf - "$tardir"'
31199f00f3a1Smrg      am__untar='tar xf -'
31209f00f3a1Smrg      ;;
31219f00f3a1Smrg    pax)
31229f00f3a1Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
31239f00f3a1Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
31249f00f3a1Smrg      am__untar='pax -r'
31259f00f3a1Smrg      ;;
31269f00f3a1Smrg    cpio)
31279f00f3a1Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
31289f00f3a1Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
31299f00f3a1Smrg      am__untar='cpio -i -H $1 -d'
31309f00f3a1Smrg      ;;
31319f00f3a1Smrg    none)
31329f00f3a1Smrg      am__tar=false
31339f00f3a1Smrg      am__tar_=false
31349f00f3a1Smrg      am__untar=false
31359f00f3a1Smrg      ;;
31369f00f3a1Smrg    esac
31379f00f3a1Smrg
31389f00f3a1Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
31399f00f3a1Smrg    # and am__untar set.
31409f00f3a1Smrg    test -n "${am_cv_prog_tar_$1}" && break
31419f00f3a1Smrg
31429f00f3a1Smrg    # tar/untar a dummy directory, and stop if the command works.
31439f00f3a1Smrg    rm -rf conftest.dir
31449f00f3a1Smrg    mkdir conftest.dir
31459f00f3a1Smrg    echo GrepMe > conftest.dir/file
31469f00f3a1Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
31479f00f3a1Smrg    rm -rf conftest.dir
31489f00f3a1Smrg    if test -s conftest.tar; then
31499f00f3a1Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
31509f00f3a1Smrg      AM_RUN_LOG([cat conftest.dir/file])
31519f00f3a1Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
31529f00f3a1Smrg    fi
31539f00f3a1Smrg  done
31549f00f3a1Smrg  rm -rf conftest.dir
3155a966c04fSmrg
31569f00f3a1Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
31579f00f3a1Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
31589f00f3a1Smrg
31599f00f3a1SmrgAC_SUBST([am__tar])
31609f00f3a1SmrgAC_SUBST([am__untar])
31619f00f3a1Smrg]) # _AM_PROG_TAR
31629f00f3a1Smrg
31639f00f3a1Smrgm4_include([m4/ax_define_dir.m4])
31649f00f3a1Smrgm4_include([m4/libtool.m4])
31659f00f3a1Smrgm4_include([m4/ltoptions.m4])
31669f00f3a1Smrgm4_include([m4/ltsugar.m4])
31679f00f3a1Smrgm4_include([m4/ltversion.m4])
31689f00f3a1Smrgm4_include([m4/lt~obsolete.m4])
3169