aclocal.m4 revision 54e0bb33
153719b08Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2b1297603Smrg
3b1297603Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
453719b08Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5b1297603Smrg# This file is free software; the Free Software Foundation
6b1297603Smrg# gives unlimited permission to copy and/or distribute it,
7b1297603Smrg# with or without modifications, as long as this notice is preserved.
8b1297603Smrg
9b1297603Smrg# This program is distributed in the hope that it will be useful,
10b1297603Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11b1297603Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12b1297603Smrg# PARTICULAR PURPOSE.
13b1297603Smrg
145b944e2aSmrgm4_ifndef([AC_AUTOCONF_VERSION],
155b944e2aSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1654e0bb33Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.66],,
1754e0bb33Smrg[m4_warning([this file was generated for autoconf 2.66.
185b944e2aSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
195b944e2aSmrgIf you have problems, you may need to regenerate the build system entirely.
205b944e2aSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
215b944e2aSmrg
22b1297603Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2354e0bb33Smrg# serial 1 (pkg-config-0.24)
24b1297603Smrg# 
25b1297603Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
26b1297603Smrg#
27b1297603Smrg# This program is free software; you can redistribute it and/or modify
28b1297603Smrg# it under the terms of the GNU General Public License as published by
29b1297603Smrg# the Free Software Foundation; either version 2 of the License, or
30b1297603Smrg# (at your option) any later version.
31b1297603Smrg#
32b1297603Smrg# This program is distributed in the hope that it will be useful, but
33b1297603Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
34b1297603Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
35b1297603Smrg# General Public License for more details.
36b1297603Smrg#
37b1297603Smrg# You should have received a copy of the GNU General Public License
38b1297603Smrg# along with this program; if not, write to the Free Software
39b1297603Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
40b1297603Smrg#
41b1297603Smrg# As a special exception to the GNU General Public License, if you
42b1297603Smrg# distribute this file as part of a program that contains a
43b1297603Smrg# configuration script generated by Autoconf, you may include it under
44b1297603Smrg# the same distribution terms that you use for the rest of that program.
45b1297603Smrg
46b1297603Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
47b1297603Smrg# ----------------------------------
48b1297603SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
49b1297603Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
50b1297603Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
5154e0bb33SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
5254e0bb33SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
5354e0bb33SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
5454e0bb33Smrg
55b1297603Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
56b1297603Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
57b1297603Smrgfi
58b1297603Smrgif test -n "$PKG_CONFIG"; then
59b1297603Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
60b1297603Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
61b1297603Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
62b1297603Smrg		AC_MSG_RESULT([yes])
63b1297603Smrg	else
64b1297603Smrg		AC_MSG_RESULT([no])
65b1297603Smrg		PKG_CONFIG=""
66b1297603Smrg	fi
67b1297603Smrgfi[]dnl
68b1297603Smrg])# PKG_PROG_PKG_CONFIG
69b1297603Smrg
70b1297603Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
71b1297603Smrg#
72b1297603Smrg# Check to see whether a particular set of modules exists.  Similar
73b1297603Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
74b1297603Smrg#
7554e0bb33Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
7654e0bb33Smrg# only at the first occurence in configure.ac, so if the first place
7754e0bb33Smrg# it's called might be skipped (such as if it is within an "if", you
7854e0bb33Smrg# have to call PKG_CHECK_EXISTS manually
79b1297603Smrg# --------------------------------------------------------------
80b1297603SmrgAC_DEFUN([PKG_CHECK_EXISTS],
81b1297603Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
82b1297603Smrgif test -n "$PKG_CONFIG" && \
83b1297603Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8454e0bb33Smrg  m4_default([$2], [:])
85b1297603Smrgm4_ifvaln([$3], [else
86b1297603Smrg  $3])dnl
87b1297603Smrgfi])
88b1297603Smrg
89b1297603Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
90b1297603Smrg# ---------------------------------------------
91b1297603Smrgm4_define([_PKG_CONFIG],
925b944e2aSmrg[if test -n "$$1"; then
935b944e2aSmrg    pkg_cv_[]$1="$$1"
945b944e2aSmrg elif test -n "$PKG_CONFIG"; then
955b944e2aSmrg    PKG_CHECK_EXISTS([$3],
965b944e2aSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
975b944e2aSmrg		     [pkg_failed=yes])
985b944e2aSmrg else
995b944e2aSmrg    pkg_failed=untried
100b1297603Smrgfi[]dnl
101b1297603Smrg])# _PKG_CONFIG
102b1297603Smrg
103b1297603Smrg# _PKG_SHORT_ERRORS_SUPPORTED
104b1297603Smrg# -----------------------------
105b1297603SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
106b1297603Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
107b1297603Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
108b1297603Smrg        _pkg_short_errors_supported=yes
109b1297603Smrgelse
110b1297603Smrg        _pkg_short_errors_supported=no
111b1297603Smrgfi[]dnl
112b1297603Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
113b1297603Smrg
114b1297603Smrg
115b1297603Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
116b1297603Smrg# [ACTION-IF-NOT-FOUND])
117b1297603Smrg#
118b1297603Smrg#
119b1297603Smrg# Note that if there is a possibility the first call to
120b1297603Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
121b1297603Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
122b1297603Smrg#
123b1297603Smrg#
124b1297603Smrg# --------------------------------------------------------------
125b1297603SmrgAC_DEFUN([PKG_CHECK_MODULES],
126b1297603Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
127b1297603SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
128b1297603SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
129b1297603Smrg
130b1297603Smrgpkg_failed=no
131b1297603SmrgAC_MSG_CHECKING([for $1])
132b1297603Smrg
133b1297603Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
134b1297603Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
135b1297603Smrg
136b1297603Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
137b1297603Smrgand $1[]_LIBS to avoid the need to call pkg-config.
138b1297603SmrgSee the pkg-config man page for more details.])
139b1297603Smrg
140b1297603Smrgif test $pkg_failed = yes; then
14154e0bb33Smrg   	AC_MSG_RESULT([no])
142b1297603Smrg        _PKG_SHORT_ERRORS_SUPPORTED
143b1297603Smrg        if test $_pkg_short_errors_supported = yes; then
1445b944e2aSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
145b1297603Smrg        else 
1465b944e2aSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
147b1297603Smrg        fi
148b1297603Smrg	# Put the nasty error message in config.log where it belongs
149b1297603Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
150b1297603Smrg
15154e0bb33Smrg	m4_default([$4], [AC_MSG_ERROR(
152b1297603Smrg[Package requirements ($2) were not met:
153b1297603Smrg
154b1297603Smrg$$1_PKG_ERRORS
155b1297603Smrg
156b1297603SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
157b1297603Smrginstalled software in a non-standard prefix.
158b1297603Smrg
15954e0bb33Smrg_PKG_TEXT])
16054e0bb33Smrg        ])
161b1297603Smrgelif test $pkg_failed = untried; then
16254e0bb33Smrg     	AC_MSG_RESULT([no])
16354e0bb33Smrg	m4_default([$4], [AC_MSG_FAILURE(
164b1297603Smrg[The pkg-config script could not be found or is too old.  Make sure it
165b1297603Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
166b1297603Smrgpath to pkg-config.
167b1297603Smrg
168b1297603Smrg_PKG_TEXT
169b1297603Smrg
17054e0bb33SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])
17154e0bb33Smrg        ])
172b1297603Smrgelse
173b1297603Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
174b1297603Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
175b1297603Smrg        AC_MSG_RESULT([yes])
17654e0bb33Smrg	$3
177b1297603Smrgfi[]dnl
178b1297603Smrg])# PKG_CHECK_MODULES
179b1297603Smrg
18054e0bb33Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
18154e0bb33Smrgdnl
18254e0bb33Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
18354e0bb33Smrgdnl 
18454e0bb33Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
18554e0bb33Smrgdnl copy of this software and associated documentation files (the "Software"),
18654e0bb33Smrgdnl to deal in the Software without restriction, including without limitation
18754e0bb33Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
18854e0bb33Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
18954e0bb33Smrgdnl Software is furnished to do so, subject to the following conditions:
19054e0bb33Smrgdnl
19154e0bb33Smrgdnl The above copyright notice and this permission notice (including the next
19254e0bb33Smrgdnl paragraph) shall be included in all copies or substantial portions of the
19354e0bb33Smrgdnl Software.
19454e0bb33Smrgdnl
19554e0bb33Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19654e0bb33Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19754e0bb33Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19854e0bb33Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19954e0bb33Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20054e0bb33Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20154e0bb33Smrgdnl DEALINGS IN THE SOFTWARE.
202cea37944Smrg
20354e0bb33Smrg# XORG_MACROS_VERSION(required-version)
20454e0bb33Smrg# -------------------------------------
20554e0bb33Smrg# Minimum version: 1.1.0
2065b944e2aSmrg#
20754e0bb33Smrg# If you're using a macro added in Version 1.1 or newer, include this in
20854e0bb33Smrg# your configure.ac with the minimum required version, such as:
20954e0bb33Smrg# XORG_MACROS_VERSION(1.1)
2105b944e2aSmrg#
21154e0bb33Smrg# To ensure that this macro is defined, also add:
21254e0bb33Smrg# m4_ifndef([XORG_MACROS_VERSION],
21354e0bb33Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
214cea37944Smrg#
215cea37944Smrg#
21654e0bb33Smrg# See the "minimum version" comment for each macro you use to see what 
21754e0bb33Smrg# version you require.
21854e0bb33Smrgm4_defun([XORG_MACROS_VERSION],[
21954e0bb33Smrgm4_define([vers_have], [1.10.0])
22054e0bb33Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
22154e0bb33Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
22254e0bb33Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
22354e0bb33Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
22454e0bb33Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
22554e0bb33Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
22654e0bb33Smrgm4_undefine([vers_have])
22754e0bb33Smrgm4_undefine([maj_have])
22854e0bb33Smrgm4_undefine([maj_needed])
22954e0bb33Smrg]) # XORG_MACROS_VERSION
230cea37944Smrg
23154e0bb33Smrg# XORG_PROG_RAWCPP()
23254e0bb33Smrg# ------------------
23354e0bb33Smrg# Minimum version: 1.0.0
234b1297603Smrg#
23554e0bb33Smrg# Find cpp program and necessary flags for use in pre-processing text files
23654e0bb33Smrg# such as man pages and config files
23754e0bb33SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
23854e0bb33SmrgAC_REQUIRE([AC_PROG_CPP])
23954e0bb33SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
24054e0bb33Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
241b1297603Smrg
24254e0bb33Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
24354e0bb33Smrg# which is not the best choice for supporting other OS'es, but covers most
24454e0bb33Smrg# of the ones we need for now.
24554e0bb33SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
24654e0bb33SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
24754e0bb33Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
24854e0bb33Smrg	AC_MSG_RESULT([no])
24954e0bb33Smrgelse
25054e0bb33Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
25154e0bb33Smrg		RAWCPPFLAGS=-undef
25254e0bb33Smrg		AC_MSG_RESULT([yes])
25354e0bb33Smrg	# under Cygwin unix is still defined even with -undef
25454e0bb33Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
25554e0bb33Smrg		RAWCPPFLAGS="-undef -ansi"
25654e0bb33Smrg		AC_MSG_RESULT([yes, with -ansi])
25754e0bb33Smrg	else
25854e0bb33Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
25954e0bb33Smrg	fi
26054e0bb33Smrgfi
26154e0bb33Smrgrm -f conftest.$ac_ext
262b1297603Smrg
26354e0bb33SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
26454e0bb33SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
26554e0bb33Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
26654e0bb33Smrg	AC_MSG_RESULT([no])
267b1297603Smrgelse
26854e0bb33Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
26954e0bb33Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
27054e0bb33Smrg		AC_MSG_RESULT([yes])
27154e0bb33Smrg	else
27254e0bb33Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
27354e0bb33Smrg	fi
274b1297603Smrgfi
27554e0bb33Smrgrm -f conftest.$ac_ext
27654e0bb33SmrgAC_SUBST(RAWCPPFLAGS)
27754e0bb33Smrg]) # XORG_PROG_RAWCPP
278b1297603Smrg
27954e0bb33Smrg# XORG_MANPAGE_SECTIONS()
28054e0bb33Smrg# -----------------------
28154e0bb33Smrg# Minimum version: 1.0.0
282b1297603Smrg#
28354e0bb33Smrg# Determine which sections man pages go in for the different man page types
28454e0bb33Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
28554e0bb33Smrg# Not sure if there's any better way than just hardcoding by OS name.
28654e0bb33Smrg# Override default settings by setting environment variables
28754e0bb33Smrg# Added MAN_SUBSTS in version 1.8
28854e0bb33Smrg# Added AC_PROG_SED in version 1.8
289b1297603Smrg
29054e0bb33SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
29154e0bb33SmrgAC_REQUIRE([AC_CANONICAL_HOST])
29254e0bb33SmrgAC_REQUIRE([AC_PROG_SED])
293b1297603Smrg
29454e0bb33Smrgif test x$APP_MAN_SUFFIX = x    ; then
29554e0bb33Smrg    APP_MAN_SUFFIX=1
29654e0bb33Smrgfi
29754e0bb33Smrgif test x$APP_MAN_DIR = x    ; then
29854e0bb33Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
29954e0bb33Smrgfi
300b1297603Smrg
30154e0bb33Smrgif test x$LIB_MAN_SUFFIX = x    ; then
30254e0bb33Smrg    LIB_MAN_SUFFIX=3
30354e0bb33Smrgfi
30454e0bb33Smrgif test x$LIB_MAN_DIR = x    ; then
30554e0bb33Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
30654e0bb33Smrgfi
307b1297603Smrg
30854e0bb33Smrgif test x$FILE_MAN_SUFFIX = x    ; then
30954e0bb33Smrg    case $host_os in
31054e0bb33Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
31154e0bb33Smrg	*)		FILE_MAN_SUFFIX=5  ;;
31254e0bb33Smrg    esac
31354e0bb33Smrgfi
31454e0bb33Smrgif test x$FILE_MAN_DIR = x    ; then
31554e0bb33Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
31654e0bb33Smrgfi
317b1297603Smrg
31854e0bb33Smrgif test x$MISC_MAN_SUFFIX = x    ; then
31954e0bb33Smrg    case $host_os in
32054e0bb33Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
32154e0bb33Smrg	*)		MISC_MAN_SUFFIX=7  ;;
32254e0bb33Smrg    esac
32354e0bb33Smrgfi
32454e0bb33Smrgif test x$MISC_MAN_DIR = x    ; then
32554e0bb33Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
32654e0bb33Smrgfi
327b1297603Smrg
32854e0bb33Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
32954e0bb33Smrg    case $host_os in
33054e0bb33Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
33154e0bb33Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
33254e0bb33Smrg    esac
33354e0bb33Smrgfi
33454e0bb33Smrgif test x$DRIVER_MAN_DIR = x    ; then
33554e0bb33Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
33654e0bb33Smrgfi
337b1297603Smrg
33854e0bb33Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
33954e0bb33Smrg    case $host_os in
34054e0bb33Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
34154e0bb33Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
342cea37944Smrg    esac
34354e0bb33Smrgfi
34454e0bb33Smrgif test x$ADMIN_MAN_DIR = x    ; then
34554e0bb33Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
34654e0bb33Smrgfi
347b1297603Smrg
34854e0bb33Smrg
34954e0bb33SmrgAC_SUBST([APP_MAN_SUFFIX])
35054e0bb33SmrgAC_SUBST([LIB_MAN_SUFFIX])
35154e0bb33SmrgAC_SUBST([FILE_MAN_SUFFIX])
35254e0bb33SmrgAC_SUBST([MISC_MAN_SUFFIX])
35354e0bb33SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
35454e0bb33SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
35554e0bb33SmrgAC_SUBST([APP_MAN_DIR])
35654e0bb33SmrgAC_SUBST([LIB_MAN_DIR])
35754e0bb33SmrgAC_SUBST([FILE_MAN_DIR])
35854e0bb33SmrgAC_SUBST([MISC_MAN_DIR])
35954e0bb33SmrgAC_SUBST([DRIVER_MAN_DIR])
36054e0bb33SmrgAC_SUBST([ADMIN_MAN_DIR])
36154e0bb33Smrg
36254e0bb33SmrgXORG_MAN_PAGE="X Version 11"
36354e0bb33SmrgAC_SUBST([XORG_MAN_PAGE])
36454e0bb33SmrgMAN_SUBSTS="\
36554e0bb33Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
36654e0bb33Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
36754e0bb33Smrg	-e 's|__xservername__|Xorg|g' \
36854e0bb33Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
36954e0bb33Smrg	-e 's|__projectroot__|\$(prefix)|g' \
37054e0bb33Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
37154e0bb33Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
37254e0bb33Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
37354e0bb33Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
37454e0bb33Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
37554e0bb33Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
37654e0bb33SmrgAC_SUBST([MAN_SUBSTS])
37754e0bb33Smrg
37854e0bb33Smrg]) # XORG_MANPAGE_SECTIONS
37954e0bb33Smrg
38054e0bb33Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
38154e0bb33Smrg# ------------------------
38254e0bb33Smrg# Minimum version: 1.7.0
38354e0bb33Smrg#
38454e0bb33Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
38554e0bb33Smrg# provided by xorg-sgml-doctools, if installed.
38654e0bb33SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
38754e0bb33SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
38854e0bb33SmrgXORG_SGML_PATH=
38954e0bb33SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
39054e0bb33Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
39154e0bb33Smrg    [m4_ifval([$1],[:],
39254e0bb33Smrg        [if test x"$cross_compiling" != x"yes" ; then
39354e0bb33Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
39454e0bb33Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
39554e0bb33Smrg         fi])
39654e0bb33Smrg    ])
39754e0bb33Smrg
39854e0bb33Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
39954e0bb33Smrg# the path and the name of the doc stylesheet
40054e0bb33Smrgif test "x$XORG_SGML_PATH" != "x" ; then
40154e0bb33Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
40254e0bb33Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
40354e0bb33Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
40453719b08Smrgelse
40554e0bb33Smrg   AC_MSG_RESULT([no])
40653719b08Smrgfi
407b1297603Smrg
40854e0bb33SmrgAC_SUBST(XORG_SGML_PATH)
40954e0bb33SmrgAC_SUBST(STYLESHEET_SRCDIR)
41054e0bb33SmrgAC_SUBST(XSL_STYLESHEET)
41154e0bb33SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
41254e0bb33Smrg]) # XORG_CHECK_SGML_DOCTOOLS
413b1297603Smrg
41454e0bb33Smrg# XORG_CHECK_LINUXDOC
41554e0bb33Smrg# -------------------
41654e0bb33Smrg# Minimum version: 1.0.0
41754e0bb33Smrg#
41854e0bb33Smrg# Defines the variable MAKE_TEXT if the necessary tools and
41954e0bb33Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
42054e0bb33Smrg# Whether or not the necessary tools and files are found can be checked
42154e0bb33Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
42254e0bb33SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
42354e0bb33SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
42454e0bb33SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
42554e0bb33Smrg
42654e0bb33SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
4275b944e2aSmrg
42854e0bb33SmrgAC_MSG_CHECKING([whether to build documentation])
429b1297603Smrg
43054e0bb33Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
43154e0bb33Smrg   BUILDDOC=yes
43254e0bb33Smrgelse
43354e0bb33Smrg   BUILDDOC=no
43453719b08Smrgfi
435b1297603Smrg
43654e0bb33SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
43753719b08Smrg
43854e0bb33SmrgAC_MSG_RESULT([$BUILDDOC])
439b1297603Smrg
44054e0bb33SmrgAC_MSG_CHECKING([whether to build pdf documentation])
441b1297603Smrg
44254e0bb33Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
44354e0bb33Smrg   BUILDPDFDOC=yes
44454e0bb33Smrgelse
44554e0bb33Smrg   BUILDPDFDOC=no
44654e0bb33Smrgfi
447cea37944Smrg
44854e0bb33SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
449cea37944Smrg
45054e0bb33SmrgAC_MSG_RESULT([$BUILDPDFDOC])
451cea37944Smrg
45254e0bb33SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
45354e0bb33SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
45454e0bb33SmrgMAKE_PDF="$PS2PDF"
45554e0bb33SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
456cea37944Smrg
45754e0bb33SmrgAC_SUBST(MAKE_TEXT)
45854e0bb33SmrgAC_SUBST(MAKE_PS)
45954e0bb33SmrgAC_SUBST(MAKE_PDF)
46054e0bb33SmrgAC_SUBST(MAKE_HTML)
46154e0bb33Smrg]) # XORG_CHECK_LINUXDOC
462cea37944Smrg
46354e0bb33Smrg# XORG_CHECK_DOCBOOK
46454e0bb33Smrg# -------------------
46554e0bb33Smrg# Minimum version: 1.0.0
46653719b08Smrg#
46754e0bb33Smrg# Checks for the ability to build output formats from SGML DocBook source.
46854e0bb33Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
46954e0bb33Smrg# indicates whether the necessary tools and files are found and, if set,
47054e0bb33Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
47154e0bb33SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
47254e0bb33SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
47353719b08Smrg
47454e0bb33SmrgBUILDTXTDOC=no
47554e0bb33SmrgBUILDPDFDOC=no
47654e0bb33SmrgBUILDPSDOC=no
47754e0bb33SmrgBUILDHTMLDOC=no
478cea37944Smrg
47954e0bb33SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
48054e0bb33SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
48154e0bb33SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
48254e0bb33SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
483cea37944Smrg
48454e0bb33SmrgAC_MSG_CHECKING([whether to build text documentation])
48554e0bb33Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
48654e0bb33Smrg   test x$BUILD_TXTDOC != xno; then
48754e0bb33Smrg	BUILDTXTDOC=yes
48853719b08Smrgfi
48954e0bb33SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
49054e0bb33SmrgAC_MSG_RESULT([$BUILDTXTDOC])
491b1297603Smrg
49254e0bb33SmrgAC_MSG_CHECKING([whether to build PDF documentation])
49354e0bb33Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
49454e0bb33Smrg   test x$BUILD_PDFDOC != xno; then
49554e0bb33Smrg	BUILDPDFDOC=yes
496cea37944Smrgfi
49754e0bb33SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
49854e0bb33SmrgAC_MSG_RESULT([$BUILDPDFDOC])
499cea37944Smrg
50054e0bb33SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
50154e0bb33Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
50254e0bb33Smrg   test x$BUILD_PSDOC != xno; then
50354e0bb33Smrg	BUILDPSDOC=yes
50454e0bb33Smrgfi
50554e0bb33SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
50654e0bb33SmrgAC_MSG_RESULT([$BUILDPSDOC])
507cea37944Smrg
50854e0bb33SmrgAC_MSG_CHECKING([whether to build HTML documentation])
50954e0bb33Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
51054e0bb33Smrg   test x$BUILD_HTMLDOC != xno; then
51154e0bb33Smrg	BUILDHTMLDOC=yes
51254e0bb33Smrgfi
51354e0bb33SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
51454e0bb33SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
515cea37944Smrg
51654e0bb33SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
51754e0bb33SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
51854e0bb33SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
51954e0bb33SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
520cea37944Smrg
52154e0bb33SmrgAC_SUBST(MAKE_TEXT)
52254e0bb33SmrgAC_SUBST(MAKE_PS)
52354e0bb33SmrgAC_SUBST(MAKE_PDF)
52454e0bb33SmrgAC_SUBST(MAKE_HTML)
52554e0bb33Smrg]) # XORG_CHECK_DOCBOOK
526cea37944Smrg
52754e0bb33Smrg# XORG_WITH_XMLTO([MIN-VERSION])
52854e0bb33Smrg# ----------------
52954e0bb33Smrg# Minimum version: 1.5.0
53053719b08Smrg#
53154e0bb33Smrg# Documentation tools are not always available on all platforms and sometimes
53254e0bb33Smrg# not at the appropriate level. This macro enables a module to test for the
53354e0bb33Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
53454e0bb33Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
53554e0bb33Smrg# as whether or not to use the xmlto package.
53653719b08Smrg#
53754e0bb33Smrg# Interface to module:
53854e0bb33Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
53954e0bb33Smrg# XMLTO:	returns the path of the xmlto program found
54054e0bb33Smrg#		returns the path set by the user in the environment
54154e0bb33Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
54254e0bb33Smrg#		'no' user instructs the module not to use xmlto
54354e0bb33Smrg#
54454e0bb33Smrg# Added in version 1.10.0
54554e0bb33Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
54654e0bb33Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
54754e0bb33Smrg#
54854e0bb33Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
54954e0bb33Smrg#
55054e0bb33SmrgAC_DEFUN([XORG_WITH_XMLTO],[
55154e0bb33SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
55254e0bb33SmrgAC_ARG_WITH(xmlto,
55354e0bb33Smrg	AS_HELP_STRING([--with-xmlto],
55454e0bb33Smrg	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
55554e0bb33Smrg	   [use_xmlto=$withval], [use_xmlto=auto])
556cea37944Smrg
55754e0bb33Smrgif test "x$use_xmlto" = x"auto"; then
55854e0bb33Smrg   AC_PATH_PROG([XMLTO], [xmlto])
55954e0bb33Smrg   if test "x$XMLTO" = "x"; then
56054e0bb33Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
56154e0bb33Smrg	have_xmlto=no
56254e0bb33Smrg   else
56354e0bb33Smrg        have_xmlto=yes
56454e0bb33Smrg   fi
56554e0bb33Smrgelif test "x$use_xmlto" = x"yes" ; then
56654e0bb33Smrg   AC_PATH_PROG([XMLTO], [xmlto])
56754e0bb33Smrg   if test "x$XMLTO" = "x"; then
56854e0bb33Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
56954e0bb33Smrg   fi
57054e0bb33Smrg   have_xmlto=yes
57154e0bb33Smrgelif test "x$use_xmlto" = x"no" ; then
57254e0bb33Smrg   if test "x$XMLTO" != "x"; then
57354e0bb33Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
57454e0bb33Smrg   fi
57554e0bb33Smrg   have_xmlto=no
57653719b08Smrgelse
57754e0bb33Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
57853719b08Smrgfi
579cea37944Smrg
58054e0bb33Smrg# Test for a minimum version of xmlto, if provided.
58154e0bb33Smrgm4_ifval([$1],
58254e0bb33Smrg[if test "$have_xmlto" = yes; then
58354e0bb33Smrg    # scrape the xmlto version
58454e0bb33Smrg    AC_MSG_CHECKING([the xmlto version])
58554e0bb33Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
58654e0bb33Smrg    AC_MSG_RESULT([$xmlto_version])
58754e0bb33Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
58854e0bb33Smrg        [if test "x$use_xmlto" = xauto; then
58954e0bb33Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
59054e0bb33Smrg            have_xmlto=no
59154e0bb33Smrg        else
59254e0bb33Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
59354e0bb33Smrg        fi])
59454e0bb33Smrgfi])
595cea37944Smrg
59654e0bb33Smrg# Test for the ability of xmlto to generate a text target
59754e0bb33Smrghave_xmlto_text=no
59854e0bb33Smrgcat > conftest.xml << "EOF"
59954e0bb33SmrgEOF
60054e0bb33SmrgAS_IF([test "$have_xmlto" = yes],
60154e0bb33Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
60254e0bb33Smrg             [have_xmlto_text=yes],
60354e0bb33Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
60454e0bb33Smrgrm -f conftest.xml
60554e0bb33SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
60654e0bb33SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
60754e0bb33Smrg]) # XORG_WITH_XMLTO
608cea37944Smrg
60954e0bb33Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION])
61054e0bb33Smrg# ----------------
61154e0bb33Smrg# Minimum version: 1.5.0
61253719b08Smrg#
61354e0bb33Smrg# Documentation tools are not always available on all platforms and sometimes
61454e0bb33Smrg# not at the appropriate level. This macro enables a module to test for the
61554e0bb33Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
61654e0bb33Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
61754e0bb33Smrg# as whether or not to use the asciidoc package.
61854e0bb33Smrg#
61954e0bb33Smrg# Interface to module:
62054e0bb33Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
62154e0bb33Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
62254e0bb33Smrg#		 returns the path set by the user in the environment
62354e0bb33Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
62454e0bb33Smrg#		  'no' user instructs the module not to use asciidoc
62554e0bb33Smrg#
62654e0bb33Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
62754e0bb33Smrg#
62854e0bb33SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
62954e0bb33SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
63054e0bb33SmrgAC_ARG_WITH(asciidoc,
63154e0bb33Smrg	AS_HELP_STRING([--with-asciidoc],
63254e0bb33Smrg	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
63354e0bb33Smrg	   [use_asciidoc=$withval], [use_asciidoc=auto])
634cea37944Smrg
63554e0bb33Smrgif test "x$use_asciidoc" = x"auto"; then
63654e0bb33Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
63754e0bb33Smrg   if test "x$ASCIIDOC" = "x"; then
63854e0bb33Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
63954e0bb33Smrg	have_asciidoc=no
64054e0bb33Smrg   else
64154e0bb33Smrg        have_asciidoc=yes
64254e0bb33Smrg   fi
64354e0bb33Smrgelif test "x$use_asciidoc" = x"yes" ; then
64454e0bb33Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
64554e0bb33Smrg   if test "x$ASCIIDOC" = "x"; then
64654e0bb33Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
64754e0bb33Smrg   fi
64854e0bb33Smrg   have_asciidoc=yes
64954e0bb33Smrgelif test "x$use_asciidoc" = x"no" ; then
65054e0bb33Smrg   if test "x$ASCIIDOC" != "x"; then
65154e0bb33Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
65254e0bb33Smrg   fi
65354e0bb33Smrg   have_asciidoc=no
65454e0bb33Smrgelse
65554e0bb33Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
65653719b08Smrgfi
65754e0bb33Smrgm4_ifval([$1],
65854e0bb33Smrg[if test "$have_asciidoc" = yes; then
65954e0bb33Smrg    # scrape the asciidoc version
66054e0bb33Smrg    AC_MSG_CHECKING([the asciidoc version])
66154e0bb33Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
66254e0bb33Smrg    AC_MSG_RESULT([$asciidoc_version])
66354e0bb33Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
66454e0bb33Smrg        [if test "x$use_asciidoc" = xauto; then
66554e0bb33Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
66654e0bb33Smrg            have_asciidoc=no
66754e0bb33Smrg        else
66854e0bb33Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
66954e0bb33Smrg        fi])
67054e0bb33Smrgfi])
67154e0bb33SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
67254e0bb33Smrg]) # XORG_WITH_ASCIIDOC
6735b944e2aSmrg
67454e0bb33Smrg# XORG_WITH_DOXYGEN([MIN-VERSION])
67554e0bb33Smrg# --------------------------------
67654e0bb33Smrg# Minimum version: 1.5.0
677b1297603Smrg#
67854e0bb33Smrg# Documentation tools are not always available on all platforms and sometimes
67954e0bb33Smrg# not at the appropriate level. This macro enables a module to test for the
68054e0bb33Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
68154e0bb33Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
68254e0bb33Smrg# as whether or not to use the doxygen package.
68354e0bb33Smrg#
68454e0bb33Smrg# Interface to module:
68554e0bb33Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
68654e0bb33Smrg# DOXYGEN:	 returns the path of the doxygen program found
68754e0bb33Smrg#		 returns the path set by the user in the environment
68854e0bb33Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
68954e0bb33Smrg#		  'no' user instructs the module not to use doxygen
69054e0bb33Smrg#
69154e0bb33Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
69254e0bb33Smrg#
69354e0bb33SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
69454e0bb33SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
69554e0bb33SmrgAC_ARG_WITH(doxygen,
69654e0bb33Smrg	AS_HELP_STRING([--with-doxygen],
69754e0bb33Smrg	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
69854e0bb33Smrg	   [use_doxygen=$withval], [use_doxygen=auto])
699cea37944Smrg
70054e0bb33Smrgif test "x$use_doxygen" = x"auto"; then
70154e0bb33Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
70254e0bb33Smrg   if test "x$DOXYGEN" = "x"; then
70354e0bb33Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
70454e0bb33Smrg	have_doxygen=no
70554e0bb33Smrg   else
70654e0bb33Smrg        have_doxygen=yes
70754e0bb33Smrg   fi
70854e0bb33Smrgelif test "x$use_doxygen" = x"yes" ; then
70954e0bb33Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
71054e0bb33Smrg   if test "x$DOXYGEN" = "x"; then
71154e0bb33Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
71254e0bb33Smrg   fi
71354e0bb33Smrg   have_doxygen=yes
71454e0bb33Smrgelif test "x$use_doxygen" = x"no" ; then
71554e0bb33Smrg   if test "x$DOXYGEN" != "x"; then
71654e0bb33Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
71754e0bb33Smrg   fi
71854e0bb33Smrg   have_doxygen=no
719b1297603Smrgelse
72054e0bb33Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
721b1297603Smrgfi
72254e0bb33Smrgm4_ifval([$1],
72354e0bb33Smrg[if test "$have_doxygen" = yes; then
72454e0bb33Smrg    # scrape the doxygen version
72554e0bb33Smrg    AC_MSG_CHECKING([the doxygen version])
72654e0bb33Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
72754e0bb33Smrg    AC_MSG_RESULT([$doxygen_version])
72854e0bb33Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
72954e0bb33Smrg        [if test "x$use_doxygen" = xauto; then
73054e0bb33Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
73154e0bb33Smrg            have_doxygen=no
73254e0bb33Smrg        else
73354e0bb33Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
73454e0bb33Smrg        fi])
73554e0bb33Smrgfi])
73654e0bb33SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
73754e0bb33Smrg]) # XORG_WITH_DOXYGEN
738b1297603Smrg
73954e0bb33Smrg# XORG_WITH_GROFF
74054e0bb33Smrg# ----------------
74154e0bb33Smrg# Minimum version: 1.6.0
742b1297603Smrg#
74354e0bb33Smrg# Documentation tools are not always available on all platforms and sometimes
74454e0bb33Smrg# not at the appropriate level. This macro enables a module to test for the
74554e0bb33Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
74654e0bb33Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
74754e0bb33Smrg# as whether or not to use the groff package.
74853719b08Smrg#
74954e0bb33Smrg# Interface to module:
75054e0bb33Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
75154e0bb33Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
75254e0bb33Smrg# HAVE_GROFF_MS: the -ms macros package
75354e0bb33Smrg# GROFF:	 returns the path of the groff program found
75454e0bb33Smrg#		 returns the path set by the user in the environment
75554e0bb33Smrg# --with-groff:	 'yes' user instructs the module to use groff
75654e0bb33Smrg#		 'no' user instructs the module not to use groff
75754e0bb33Smrg#
75854e0bb33Smrg# Added in version 1.9.0:
75954e0bb33Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
76054e0bb33Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
76154e0bb33Smrg#		   psselect from the psutils package.
76254e0bb33Smrg#		   the ghostcript package. Refer to the grohtml man pages
76354e0bb33Smrg#
76454e0bb33Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
76554e0bb33Smrg#
76654e0bb33Smrg# OS and distros often splits groff in a basic and full package, the former
76754e0bb33Smrg# having the groff program and the later having devices, fonts and macros
76854e0bb33Smrg# Checking for the groff executable is not enough.
76954e0bb33Smrg#
77054e0bb33Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
77154e0bb33Smrg# unset HAVE_GROFF or GROFF env variables.
77254e0bb33Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
77354e0bb33Smrg#
77454e0bb33SmrgAC_DEFUN([XORG_WITH_GROFF],[
77554e0bb33SmrgAC_ARG_VAR([GROFF], [Path to groff command])
77654e0bb33SmrgAC_ARG_WITH(groff,
77754e0bb33Smrg	AS_HELP_STRING([--with-groff],
77854e0bb33Smrg	   [Use groff to regenerate documentation (default: yes, if installed)]),
77954e0bb33Smrg	   [use_groff=$withval], [use_groff=auto])
780b1297603Smrg
78154e0bb33Smrgif test "x$use_groff" = x"auto"; then
78254e0bb33Smrg   AC_PATH_PROG([GROFF], [groff])
78354e0bb33Smrg   if test "x$GROFF" = "x"; then
78454e0bb33Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
78554e0bb33Smrg	have_groff=no
78654e0bb33Smrg   else
78754e0bb33Smrg        have_groff=yes
78854e0bb33Smrg   fi
78954e0bb33Smrgelif test "x$use_groff" = x"yes" ; then
79054e0bb33Smrg   AC_PATH_PROG([GROFF], [groff])
79154e0bb33Smrg   if test "x$GROFF" = "x"; then
79254e0bb33Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
79354e0bb33Smrg   fi
79454e0bb33Smrg   have_groff=yes
79554e0bb33Smrgelif test "x$use_groff" = x"no" ; then
79654e0bb33Smrg   if test "x$GROFF" != "x"; then
79754e0bb33Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
79854e0bb33Smrg   fi
79954e0bb33Smrg   have_groff=no
80054e0bb33Smrgelse
80154e0bb33Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
80254e0bb33Smrgfi
803b1297603Smrg
80454e0bb33Smrg# We have groff, test for the presence of the macro packages
80554e0bb33Smrgif test "x$have_groff" = x"yes"; then
80654e0bb33Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
80754e0bb33Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
80854e0bb33Smrg        groff_ms_works=yes
80954e0bb33Smrg    else
81054e0bb33Smrg        groff_ms_works=no
81154e0bb33Smrg    fi
81254e0bb33Smrg    AC_MSG_RESULT([$groff_ms_works])
81354e0bb33Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
81454e0bb33Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
81554e0bb33Smrg        groff_mm_works=yes
81654e0bb33Smrg    else
81754e0bb33Smrg        groff_mm_works=no
81854e0bb33Smrg    fi
81954e0bb33Smrg    AC_MSG_RESULT([$groff_mm_works])
82054e0bb33Smrgfi
821b1297603Smrg
82254e0bb33Smrg# We have groff, test for HTML dependencies, one command per package
82354e0bb33Smrgif test "x$have_groff" = x"yes"; then
82454e0bb33Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
82554e0bb33Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
82654e0bb33Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
82754e0bb33Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
82854e0bb33Smrg      have_groff_html=yes
82954e0bb33Smrg   else
83054e0bb33Smrg      have_groff_html=no
83154e0bb33Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
83254e0bb33Smrg   fi
83354e0bb33Smrgfi
834b1297603Smrg
83554e0bb33Smrg# Set Automake conditionals for Makefiles
83654e0bb33SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
83754e0bb33SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
83854e0bb33SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
83954e0bb33SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
84054e0bb33Smrg]) # XORG_WITH_GROFF
841b1297603Smrg
84254e0bb33Smrg# XORG_WITH_FOP
84354e0bb33Smrg# ----------------
84454e0bb33Smrg# Minimum version: 1.6.0
84553719b08Smrg#
84654e0bb33Smrg# Documentation tools are not always available on all platforms and sometimes
84754e0bb33Smrg# not at the appropriate level. This macro enables a module to test for the
84854e0bb33Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
84954e0bb33Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
85054e0bb33Smrg# as whether or not to use the fop package.
85154e0bb33Smrg#
85254e0bb33Smrg# Interface to module:
85354e0bb33Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
85454e0bb33Smrg# FOP:	 	returns the path of the fop program found
85554e0bb33Smrg#		returns the path set by the user in the environment
85654e0bb33Smrg# --with-fop: 	'yes' user instructs the module to use fop
85754e0bb33Smrg#		'no' user instructs the module not to use fop
85854e0bb33Smrg#
85954e0bb33Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
86054e0bb33Smrg#
86154e0bb33SmrgAC_DEFUN([XORG_WITH_FOP],[
86254e0bb33SmrgAC_ARG_VAR([FOP], [Path to fop command])
86354e0bb33SmrgAC_ARG_WITH(fop,
86454e0bb33Smrg	AS_HELP_STRING([--with-fop],
86554e0bb33Smrg	   [Use fop to regenerate documentation (default: yes, if installed)]),
86654e0bb33Smrg	   [use_fop=$withval], [use_fop=auto])
867cea37944Smrg
86854e0bb33Smrgif test "x$use_fop" = x"auto"; then
86954e0bb33Smrg   AC_PATH_PROG([FOP], [fop])
87054e0bb33Smrg   if test "x$FOP" = "x"; then
87154e0bb33Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
87254e0bb33Smrg	have_fop=no
87354e0bb33Smrg   else
87454e0bb33Smrg        have_fop=yes
875cea37944Smrg   fi
87654e0bb33Smrgelif test "x$use_fop" = x"yes" ; then
87754e0bb33Smrg   AC_PATH_PROG([FOP], [fop])
87854e0bb33Smrg   if test "x$FOP" = "x"; then
87954e0bb33Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
880cea37944Smrg   fi
88154e0bb33Smrg   have_fop=yes
88254e0bb33Smrgelif test "x$use_fop" = x"no" ; then
88354e0bb33Smrg   if test "x$FOP" != "x"; then
88454e0bb33Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
88554e0bb33Smrg   fi
88654e0bb33Smrg   have_fop=no
887cea37944Smrgelse
88854e0bb33Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
88953719b08Smrgfi
89054e0bb33SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
89154e0bb33Smrg]) # XORG_WITH_FOP
892b1297603Smrg
89354e0bb33Smrg# XORG_WITH_PS2PDF
89454e0bb33Smrg# ----------------
89554e0bb33Smrg# Minimum version: 1.6.0
89653719b08Smrg#
89754e0bb33Smrg# Documentation tools are not always available on all platforms and sometimes
89854e0bb33Smrg# not at the appropriate level. This macro enables a module to test for the
89954e0bb33Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
90054e0bb33Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
90154e0bb33Smrg# as whether or not to use the ps2pdf package.
90253719b08Smrg#
90354e0bb33Smrg# Interface to module:
90454e0bb33Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
90554e0bb33Smrg# PS2PDF:	returns the path of the ps2pdf program found
90654e0bb33Smrg#		returns the path set by the user in the environment
90754e0bb33Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
90854e0bb33Smrg#		 'no' user instructs the module not to use ps2pdf
90954e0bb33Smrg#
91054e0bb33Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
91154e0bb33Smrg#
91254e0bb33SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
91354e0bb33SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
91454e0bb33SmrgAC_ARG_WITH(ps2pdf,
91554e0bb33Smrg	AS_HELP_STRING([--with-ps2pdf],
91654e0bb33Smrg	   [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
91754e0bb33Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=auto])
918cea37944Smrg
91954e0bb33Smrgif test "x$use_ps2pdf" = x"auto"; then
92054e0bb33Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
92154e0bb33Smrg   if test "x$PS2PDF" = "x"; then
92254e0bb33Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
92354e0bb33Smrg	have_ps2pdf=no
92454e0bb33Smrg   else
92554e0bb33Smrg        have_ps2pdf=yes
92654e0bb33Smrg   fi
92754e0bb33Smrgelif test "x$use_ps2pdf" = x"yes" ; then
92854e0bb33Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
92954e0bb33Smrg   if test "x$PS2PDF" = "x"; then
93054e0bb33Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
93154e0bb33Smrg   fi
93254e0bb33Smrg   have_ps2pdf=yes
93354e0bb33Smrgelif test "x$use_ps2pdf" = x"no" ; then
93454e0bb33Smrg   if test "x$PS2PDF" != "x"; then
93554e0bb33Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
93654e0bb33Smrg   fi
93754e0bb33Smrg   have_ps2pdf=no
93854e0bb33Smrgelse
93954e0bb33Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
940cea37944Smrgfi
94154e0bb33SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
94254e0bb33Smrg]) # XORG_WITH_PS2PDF
943cea37944Smrg
94454e0bb33Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
94554e0bb33Smrg# ----------------
94654e0bb33Smrg# Minimum version: 1.6.0
94753719b08Smrg#
94854e0bb33Smrg# Documentation tools are not always available on all platforms and sometimes
94954e0bb33Smrg# not at the appropriate level. This macro enables a builder to skip all
95054e0bb33Smrg# documentation targets except traditional man pages.
95154e0bb33Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
95254e0bb33Smrg# maximum flexibilty in controlling documentation building.
95354e0bb33Smrg# Refer to:
95454e0bb33Smrg# XORG_WITH_XMLTO         --with-xmlto
95554e0bb33Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
95654e0bb33Smrg# XORG_WITH_DOXYGEN       --with-doxygen
95754e0bb33Smrg# XORG_WITH_FOP           --with-fop
95854e0bb33Smrg# XORG_WITH_GROFF         --with-groff
95954e0bb33Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
960b1297603Smrg#
96154e0bb33Smrg# Interface to module:
96254e0bb33Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
96354e0bb33Smrg# --enable-docs: 'yes' user instructs the module to generate docs
96454e0bb33Smrg#		 'no' user instructs the module not to generate docs
96554e0bb33Smrg# parm1:	specify the default value, yes or no.
96654e0bb33Smrg#
96754e0bb33SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
96854e0bb33Smrgdefault=$1
96954e0bb33Smrgif test "x$default" = x ; then
97054e0bb33Smrg  default="yes"
97154e0bb33Smrgfi
97254e0bb33SmrgAC_ARG_ENABLE(docs,
97354e0bb33Smrg	AS_HELP_STRING([--enable-docs],
97454e0bb33Smrg	   [Enable building the documentation (default: yes)]),
97554e0bb33Smrg	   [build_docs=$enableval], [build_docs=$default])
97654e0bb33SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
97754e0bb33SmrgAC_MSG_CHECKING([whether to build documentation])
97854e0bb33SmrgAC_MSG_RESULT([$build_docs])
97954e0bb33Smrg]) # XORG_ENABLE_DOCS
980b1297603Smrg
98154e0bb33Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
98254e0bb33Smrg# ----------------
98354e0bb33Smrg# Minimum version: 1.6.0
984cea37944Smrg#
98554e0bb33Smrg# This macro enables a builder to skip all developer documentation.
98654e0bb33Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
98754e0bb33Smrg# maximum flexibilty in controlling documentation building.
98854e0bb33Smrg# Refer to:
98954e0bb33Smrg# XORG_WITH_XMLTO         --with-xmlto
99054e0bb33Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
99154e0bb33Smrg# XORG_WITH_DOXYGEN       --with-doxygen
99254e0bb33Smrg# XORG_WITH_FOP           --with-fop
99354e0bb33Smrg# XORG_WITH_GROFF         --with-groff
99454e0bb33Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
995cea37944Smrg#
99654e0bb33Smrg# Interface to module:
99754e0bb33Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
99854e0bb33Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
99954e0bb33Smrg#			'no' user instructs the module not to generate developer docs
100054e0bb33Smrg# parm1:		specify the default value, yes or no.
100153719b08Smrg#
100254e0bb33SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
100354e0bb33Smrgdevel_default=$1
100454e0bb33Smrgif test "x$devel_default" = x ; then
100554e0bb33Smrg  devel_default="yes"
100654e0bb33Smrgfi
100754e0bb33SmrgAC_ARG_ENABLE(devel-docs,
100854e0bb33Smrg	AS_HELP_STRING([--enable-devel-docs],
100954e0bb33Smrg	   [Enable building the developer documentation (default: yes)]),
101054e0bb33Smrg	   [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
101154e0bb33SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
101254e0bb33SmrgAC_MSG_CHECKING([whether to build developer documentation])
101354e0bb33SmrgAC_MSG_RESULT([$build_devel_docs])
101454e0bb33Smrg]) # XORG_ENABLE_DEVEL_DOCS
101554e0bb33Smrg
101654e0bb33Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
101754e0bb33Smrg# ----------------
101854e0bb33Smrg# Minimum version: 1.6.0
101953719b08Smrg#
102054e0bb33Smrg# This macro enables a builder to skip all functional specification targets.
102154e0bb33Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
102254e0bb33Smrg# maximum flexibilty in controlling documentation building.
102354e0bb33Smrg# Refer to:
102454e0bb33Smrg# XORG_WITH_XMLTO         --with-xmlto
102554e0bb33Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
102654e0bb33Smrg# XORG_WITH_DOXYGEN       --with-doxygen
102754e0bb33Smrg# XORG_WITH_FOP           --with-fop
102854e0bb33Smrg# XORG_WITH_GROFF         --with-groff
102954e0bb33Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
103053719b08Smrg#
103154e0bb33Smrg# Interface to module:
103254e0bb33Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
103354e0bb33Smrg# --enable-specs:	'yes' user instructs the module to generate specs
103454e0bb33Smrg#			'no' user instructs the module not to generate specs
103554e0bb33Smrg# parm1:		specify the default value, yes or no.
103653719b08Smrg#
103754e0bb33SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
103854e0bb33Smrgspec_default=$1
103954e0bb33Smrgif test "x$spec_default" = x ; then
104054e0bb33Smrg  spec_default="yes"
104154e0bb33Smrgfi
104254e0bb33SmrgAC_ARG_ENABLE(specs,
104354e0bb33Smrg	AS_HELP_STRING([--enable-specs],
104454e0bb33Smrg	   [Enable building the specs (default: yes)]),
104554e0bb33Smrg	   [build_specs=$enableval], [build_specs=$spec_default])
104654e0bb33SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
104754e0bb33SmrgAC_MSG_CHECKING([whether to build functional specifications])
104854e0bb33SmrgAC_MSG_RESULT([$build_specs])
104954e0bb33Smrg]) # XORG_ENABLE_SPECS
1050b1297603Smrg
105154e0bb33Smrg# XORG_CHECK_MALLOC_ZERO
105254e0bb33Smrg# ----------------------
1053cea37944Smrg# Minimum version: 1.0.0
10545b944e2aSmrg#
105554e0bb33Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
105654e0bb33Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
105754e0bb33Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
105854e0bb33SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
105954e0bb33SmrgAC_ARG_ENABLE(malloc0returnsnull,
106054e0bb33Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
106154e0bb33Smrg		       [malloc(0) returns NULL (default: auto)]),
106254e0bb33Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
106354e0bb33Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
106453719b08Smrg
106554e0bb33SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
106654e0bb33Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
106754e0bb33Smrg	AC_RUN_IFELSE([
106854e0bb33Smrgchar *malloc();
106954e0bb33Smrgchar *realloc();
107054e0bb33Smrgchar *calloc();
107154e0bb33Smrgmain() {
107254e0bb33Smrg    char *m0, *r0, *c0, *p;
107354e0bb33Smrg    m0 = malloc(0);
107454e0bb33Smrg    p = malloc(10);
107554e0bb33Smrg    r0 = realloc(p,0);
107654e0bb33Smrg    c0 = calloc(0);
107754e0bb33Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
107854e0bb33Smrg}],
107954e0bb33Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
108054e0bb33Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
108154e0bb33Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
10825b944e2aSmrgfi
108354e0bb33SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
10845b944e2aSmrg
108554e0bb33Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
108654e0bb33Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
108754e0bb33Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
108854e0bb33Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1089cea37944Smrgelse
109054e0bb33Smrg	MALLOC_ZERO_CFLAGS=""
109154e0bb33Smrg	XMALLOC_ZERO_CFLAGS=""
109254e0bb33Smrg	XTMALLOC_ZERO_CFLAGS=""
1093cea37944Smrgfi
1094b1297603Smrg
109554e0bb33SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
109654e0bb33SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
109754e0bb33SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
109854e0bb33Smrg]) # XORG_CHECK_MALLOC_ZERO
109954e0bb33Smrg
110054e0bb33Smrg# XORG_WITH_LINT()
110154e0bb33Smrg# ----------------
110254e0bb33Smrg# Minimum version: 1.1.0
1103cea37944Smrg#
110454e0bb33Smrg# This macro enables the use of a tool that flags some suspicious and
110554e0bb33Smrg# non-portable constructs (likely to be bugs) in C language source code.
110654e0bb33Smrg# It will attempt to locate the tool and use appropriate options.
110754e0bb33Smrg# There are various lint type tools on different platforms.
110854e0bb33Smrg#
110954e0bb33Smrg# Interface to module:
111054e0bb33Smrg# LINT:		returns the path to the tool found on the platform
111154e0bb33Smrg#		or the value set to LINT on the configure cmd line
111254e0bb33Smrg#		also an Automake conditional
111354e0bb33Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
111454e0bb33Smrg#
111554e0bb33Smrg# --with-lint:	'yes' user instructs the module to use lint
111654e0bb33Smrg#		'no' user instructs the module not to use lint (default)
111754e0bb33Smrg#
111854e0bb33Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
111954e0bb33Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
112054e0bb33Smrg#
112154e0bb33SmrgAC_DEFUN([XORG_WITH_LINT],[
1122b1297603Smrg
112354e0bb33SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
112454e0bb33SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
112554e0bb33SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
112654e0bb33Smrg		[Use a lint-style source code checker (default: disabled)])],
112754e0bb33Smrg		[use_lint=$withval], [use_lint=no])
1128b1297603Smrg
112954e0bb33Smrg# Obtain platform specific info like program name and options
113054e0bb33Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
113154e0bb33Smrgcase $host_os in
113254e0bb33Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
113354e0bb33Smrg	lint_name=splint
113454e0bb33Smrg	lint_options="-badflag"
113554e0bb33Smrg	;;
113654e0bb33Smrg  *freebsd* | *netbsd*)
113754e0bb33Smrg	lint_name=lint
113854e0bb33Smrg	lint_options="-u -b"
113954e0bb33Smrg	;;
114054e0bb33Smrg  *solaris*)
114154e0bb33Smrg	lint_name=lint
114254e0bb33Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
114354e0bb33Smrg	;;
114454e0bb33Smrgesac
1145b1297603Smrg
114654e0bb33Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
114754e0bb33Smrgif test "x$use_lint" = x"yes" ; then
114854e0bb33Smrg   AC_PATH_PROG([LINT], [$lint_name])
114954e0bb33Smrg   if test "x$LINT" = "x"; then
115054e0bb33Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
115154e0bb33Smrg   fi
115254e0bb33Smrgelif test "x$use_lint" = x"no" ; then
115354e0bb33Smrg   if test "x$LINT" != "x"; then
115454e0bb33Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
115554e0bb33Smrg   fi
115654e0bb33Smrgelse
115754e0bb33Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1158cea37944Smrgfi
1159b1297603Smrg
116054e0bb33Smrg# User supplied flags override default flags
116154e0bb33Smrgif test "x$LINT_FLAGS" != "x"; then
116254e0bb33Smrg   lint_options=$LINT_FLAGS
11635b944e2aSmrgfi
1164b1297603Smrg
116554e0bb33SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
116654e0bb33SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1167b1297603Smrg
116854e0bb33Smrg]) # XORG_WITH_LINT
1169b1297603Smrg
117054e0bb33Smrg# XORG_LINT_LIBRARY(LIBNAME)
117154e0bb33Smrg# --------------------------
117254e0bb33Smrg# Minimum version: 1.1.0
1173cea37944Smrg#
117454e0bb33Smrg# Sets up flags for building lint libraries for checking programs that call
117554e0bb33Smrg# functions in the library.
117653719b08Smrg#
117754e0bb33Smrg# Interface to module:
117854e0bb33Smrg# LINTLIB		- Automake variable with the name of lint library file to make
117954e0bb33Smrg# MAKE_LINT_LIB		- Automake conditional
118054e0bb33Smrg#
118154e0bb33Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
118254e0bb33Smrg#			  - 'no' user instructs the module not to create a lint library (default)
1183b1297603Smrg
118454e0bb33SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
118554e0bb33SmrgAC_REQUIRE([XORG_WITH_LINT])
118654e0bb33SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
118754e0bb33Smrg	[Create lint library (default: disabled)])],
118854e0bb33Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1189b1297603Smrg
119054e0bb33Smrgif test "x$make_lint_lib" = x"yes" ; then
119154e0bb33Smrg   LINTLIB=llib-l$1.ln
119254e0bb33Smrg   if test "x$LINT" = "x"; then
119354e0bb33Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
119454e0bb33Smrg   fi
119554e0bb33Smrgelif test "x$make_lint_lib" != x"no" ; then
119654e0bb33Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1197cea37944Smrgfi
1198b1297603Smrg
119954e0bb33SmrgAC_SUBST(LINTLIB)
120054e0bb33SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1201b1297603Smrg
120254e0bb33Smrg]) # XORG_LINT_LIBRARY
1203b1297603Smrg
120454e0bb33Smrg# XORG_CWARNFLAGS
120554e0bb33Smrg# ---------------
120654e0bb33Smrg# Minimum version: 1.2.0
120754e0bb33Smrg#
120854e0bb33Smrg# Defines CWARNFLAGS to enable C compiler warnings.
120954e0bb33Smrg#
121054e0bb33SmrgAC_DEFUN([XORG_CWARNFLAGS], [
121154e0bb33SmrgAC_REQUIRE([AC_PROG_CC_C99])
121254e0bb33Smrgif  test "x$GCC" = xyes ; then
121354e0bb33Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
121454e0bb33Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
121554e0bb33Smrg-Wbad-function-cast -Wformat=2"
121654e0bb33Smrg    case `$CC -dumpversion` in
121754e0bb33Smrg    3.4.* | 4.*)
121854e0bb33Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
121954e0bb33Smrg	;;
122054e0bb33Smrg    esac
1221cea37944Smrgelse
122254e0bb33Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
122354e0bb33Smrg    if test "x$SUNCC" = "xyes"; then
122454e0bb33Smrg	CWARNFLAGS="-v"
122554e0bb33Smrg    fi
12265b944e2aSmrgfi
122754e0bb33SmrgAC_SUBST(CWARNFLAGS)
122854e0bb33Smrg]) # XORG_CWARNFLAGS
1229b1297603Smrg
123054e0bb33Smrg# XORG_STRICT_OPTION
123154e0bb33Smrg# -----------------------
123254e0bb33Smrg# Minimum version: 1.3.0
123354e0bb33Smrg#
123454e0bb33Smrg# Add configure option to enable strict compilation
123554e0bb33SmrgAC_DEFUN([XORG_STRICT_OPTION], [
123654e0bb33Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
123754e0bb33SmrgAC_REQUIRE([AC_PROG_CC_C99])
123854e0bb33SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1239b1297603Smrg
124054e0bb33SmrgAC_ARG_ENABLE(strict-compilation,
124154e0bb33Smrg			  AS_HELP_STRING([--enable-strict-compilation],
124254e0bb33Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
124354e0bb33Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
124454e0bb33Smrgif test "x$STRICT_COMPILE" = "xyes"; then
124554e0bb33Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
124654e0bb33Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
124754e0bb33Smrg	if test "x$GCC" = xyes ; then
124854e0bb33Smrg		STRICT_CFLAGS="-pedantic -Werror"
124954e0bb33Smrg	elif test "x$SUNCC" = "xyes"; then
125054e0bb33Smrg		STRICT_CFLAGS="-errwarn"
125154e0bb33Smrg    elif test "x$INTELCC" = "xyes"; then
125254e0bb33Smrg		STRICT_CFLAGS="-Werror"
125354e0bb33Smrg	fi
125454e0bb33Smrgfi
125554e0bb33SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
125654e0bb33SmrgAC_SUBST([CWARNFLAGS])
125754e0bb33Smrg]) # XORG_STRICT_OPTION
1258b1297603Smrg
125954e0bb33Smrg# XORG_DEFAULT_OPTIONS
126054e0bb33Smrg# --------------------
126154e0bb33Smrg# Minimum version: 1.3.0
126254e0bb33Smrg#
126354e0bb33Smrg# Defines default options for X.Org modules.
126454e0bb33Smrg#
126554e0bb33SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
126654e0bb33SmrgAC_REQUIRE([AC_PROG_INSTALL])
126754e0bb33SmrgXORG_CWARNFLAGS
126854e0bb33SmrgXORG_STRICT_OPTION
126954e0bb33SmrgXORG_RELEASE_VERSION
127054e0bb33SmrgXORG_CHANGELOG
127154e0bb33SmrgXORG_INSTALL
127254e0bb33SmrgXORG_MANPAGE_SECTIONS
127354e0bb33Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
127454e0bb33Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
127554e0bb33Smrg]) # XORG_DEFAULT_OPTIONS
1276b1297603Smrg
127754e0bb33Smrg# XORG_INSTALL()
127854e0bb33Smrg# ----------------
127954e0bb33Smrg# Minimum version: 1.4.0
1280cea37944Smrg#
128154e0bb33Smrg# Defines the variable INSTALL_CMD as the command to copy
128254e0bb33Smrg# INSTALL from $prefix/share/util-macros.
128354e0bb33Smrg#
128454e0bb33SmrgAC_DEFUN([XORG_INSTALL], [
128554e0bb33SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
128654e0bb33Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
128754e0bb33SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
128854e0bb33Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
128954e0bb33Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
129054e0bb33Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
129154e0bb33SmrgAC_SUBST([INSTALL_CMD])
129254e0bb33Smrg]) # XORG_INSTALL
129354e0bb33Smrgdnl Copyright 2005 Red Hat, Inc
129454e0bb33Smrgdnl
129554e0bb33Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
129654e0bb33Smrgdnl documentation for any purpose is hereby granted without fee, provided that
129754e0bb33Smrgdnl the above copyright notice appear in all copies and that both that
129854e0bb33Smrgdnl copyright notice and this permission notice appear in supporting
129954e0bb33Smrgdnl documentation.
130054e0bb33Smrgdnl
130154e0bb33Smrgdnl The above copyright notice and this permission notice shall be included
130254e0bb33Smrgdnl in all copies or substantial portions of the Software.
130354e0bb33Smrgdnl
130454e0bb33Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
130554e0bb33Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
130654e0bb33Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
130754e0bb33Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
130854e0bb33Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
130954e0bb33Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
131054e0bb33Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
131154e0bb33Smrgdnl
131254e0bb33Smrgdnl Except as contained in this notice, the name of the copyright holders shall
131354e0bb33Smrgdnl not be used in advertising or otherwise to promote the sale, use or
131454e0bb33Smrgdnl other dealings in this Software without prior written authorization
131554e0bb33Smrgdnl from the copyright holders.
131654e0bb33Smrgdnl
131753719b08Smrg
131854e0bb33Smrg# XORG_RELEASE_VERSION
131954e0bb33Smrg# --------------------
132054e0bb33Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
132154e0bb33Smrg 
132254e0bb33SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
132354e0bb33Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
132454e0bb33Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
132554e0bb33Smrg		[Major version of this package])
132654e0bb33Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
132754e0bb33Smrg	if test "x$PVM" = "x"; then
132854e0bb33Smrg		PVM="0"
132954e0bb33Smrg	fi
133054e0bb33Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
133154e0bb33Smrg		[$PVM],
133254e0bb33Smrg		[Minor version of this package])
133354e0bb33Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
133454e0bb33Smrg	if test "x$PVP" = "x"; then
133554e0bb33Smrg		PVP="0"
133654e0bb33Smrg	fi
133754e0bb33Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
133854e0bb33Smrg		[$PVP],
133954e0bb33Smrg		[Patch version of this package])
134054e0bb33Smrg])
134153719b08Smrg
134254e0bb33Smrg# XORG_CHANGELOG()
134354e0bb33Smrg# ----------------
134454e0bb33Smrg# Minimum version: 1.2.0
134554e0bb33Smrg#
134654e0bb33Smrg# Defines the variable CHANGELOG_CMD as the command to generate
134754e0bb33Smrg# ChangeLog from git.
134854e0bb33Smrg#
134954e0bb33Smrg#
135054e0bb33SmrgAC_DEFUN([XORG_CHANGELOG], [
135154e0bb33SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
135254e0bb33Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
135354e0bb33Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
135454e0bb33Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
135554e0bb33SmrgAC_SUBST([CHANGELOG_CMD])
135654e0bb33Smrg]) # XORG_CHANGELOG
135753719b08Smrg
135854e0bb33Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
135954e0bb33Smrg#
136054e0bb33Smrg# This file is free software; the Free Software Foundation
136154e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
136254e0bb33Smrg# with or without modifications, as long as this notice is preserved.
136353719b08Smrg
136454e0bb33Smrg# AM_AUTOMAKE_VERSION(VERSION)
136554e0bb33Smrg# ----------------------------
136654e0bb33Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
136754e0bb33Smrg# generated from the m4 files accompanying Automake X.Y.
136854e0bb33Smrg# (This private macro should not be called outside this file.)
136954e0bb33SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
137054e0bb33Smrg[am__api_version='1.11'
137154e0bb33Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
137254e0bb33Smrgdnl require some minimum version.  Point them to the right macro.
137354e0bb33Smrgm4_if([$1], [1.11.1], [],
137454e0bb33Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
137554e0bb33Smrg])
1376cea37944Smrg
137754e0bb33Smrg# _AM_AUTOCONF_VERSION(VERSION)
137854e0bb33Smrg# -----------------------------
137954e0bb33Smrg# aclocal traces this macro to find the Autoconf version.
138054e0bb33Smrg# This is a private macro too.  Using m4_define simplifies
138154e0bb33Smrg# the logic in aclocal, which can simply ignore this definition.
138254e0bb33Smrgm4_define([_AM_AUTOCONF_VERSION], [])
1383cea37944Smrg
138454e0bb33Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
138554e0bb33Smrg# -------------------------------
138654e0bb33Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
138754e0bb33Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
138854e0bb33SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
138954e0bb33Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
139054e0bb33Smrgm4_ifndef([AC_AUTOCONF_VERSION],
139154e0bb33Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
139254e0bb33Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1393cea37944Smrg
139454e0bb33Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1395cea37944Smrg
139654e0bb33Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
139754e0bb33Smrg#
139854e0bb33Smrg# This file is free software; the Free Software Foundation
139954e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
140054e0bb33Smrg# with or without modifications, as long as this notice is preserved.
1401cea37944Smrg
140254e0bb33Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
140354e0bb33Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
140454e0bb33Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
14055b944e2aSmrg#
140654e0bb33Smrg# Of course, Automake must honor this variable whenever it calls a
140754e0bb33Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
140854e0bb33Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
140954e0bb33Smrg# depending on how configure is run.  This is pretty annoying, since
141054e0bb33Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
141154e0bb33Smrg# source directory, any form will work fine, but in subdirectories a
141254e0bb33Smrg# relative path needs to be adjusted first.
1413cea37944Smrg#
141454e0bb33Smrg# $ac_aux_dir/missing
141554e0bb33Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
141654e0bb33Smrg# $top_srcdir/$ac_aux_dir/missing
141754e0bb33Smrg#    fails if $ac_aux_dir is absolute,
141854e0bb33Smrg#    fails when called from a subdirectory in a VPATH build with
141954e0bb33Smrg#          a relative $ac_aux_dir
1420cea37944Smrg#
142154e0bb33Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
142254e0bb33Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
142354e0bb33Smrg# harmless because $srcdir is `.', but things will broke when you
142454e0bb33Smrg# start a VPATH build or use an absolute $srcdir.
1425cea37944Smrg#
142654e0bb33Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
142754e0bb33Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
142854e0bb33Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
142954e0bb33Smrg# and then we would define $MISSING as
143054e0bb33Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
143154e0bb33Smrg# This will work as long as MISSING is not called from configure, because
143254e0bb33Smrg# unfortunately $(top_srcdir) has no meaning in configure.
143354e0bb33Smrg# However there are other variables, like CC, which are often used in
143454e0bb33Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1435cea37944Smrg#
143654e0bb33Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
143754e0bb33Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
143854e0bb33Smrg# configured tree to be moved without reconfiguration.
1439b1297603Smrg
144054e0bb33SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
144154e0bb33Smrg[dnl Rely on autoconf to set up CDPATH properly.
144254e0bb33SmrgAC_PREREQ([2.50])dnl
144354e0bb33Smrg# expand $ac_aux_dir to an absolute path
144454e0bb33Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
144554e0bb33Smrg])
1446b1297603Smrg
144754e0bb33Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
144854e0bb33Smrg
144954e0bb33Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
145054e0bb33Smrg# Free Software Foundation, Inc.
1451cea37944Smrg#
145254e0bb33Smrg# This file is free software; the Free Software Foundation
145354e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
145454e0bb33Smrg# with or without modifications, as long as this notice is preserved.
145553719b08Smrg
145654e0bb33Smrg# serial 9
145754e0bb33Smrg
145854e0bb33Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
145954e0bb33Smrg# -------------------------------------
146054e0bb33Smrg# Define a conditional.
146154e0bb33SmrgAC_DEFUN([AM_CONDITIONAL],
146254e0bb33Smrg[AC_PREREQ(2.52)dnl
146354e0bb33Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
146454e0bb33Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
146554e0bb33SmrgAC_SUBST([$1_TRUE])dnl
146654e0bb33SmrgAC_SUBST([$1_FALSE])dnl
146754e0bb33Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
146854e0bb33Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
146954e0bb33Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
147054e0bb33Smrgif $2; then
147154e0bb33Smrg  $1_TRUE=
147254e0bb33Smrg  $1_FALSE='#'
1473cea37944Smrgelse
147454e0bb33Smrg  $1_TRUE='#'
147554e0bb33Smrg  $1_FALSE=
14765b944e2aSmrgfi
147754e0bb33SmrgAC_CONFIG_COMMANDS_PRE(
147854e0bb33Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
147954e0bb33Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
148054e0bb33SmrgUsually this means the macro was only invoked conditionally.]])
148154e0bb33Smrgfi])])
148253719b08Smrg
148354e0bb33Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148454e0bb33Smrg# Free Software Foundation, Inc.
1485cea37944Smrg#
148654e0bb33Smrg# This file is free software; the Free Software Foundation
148754e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
148854e0bb33Smrg# with or without modifications, as long as this notice is preserved.
1489cea37944Smrg
149054e0bb33Smrg# serial 10
149154e0bb33Smrg
149254e0bb33Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
149354e0bb33Smrg# written in clear, in which case automake, when reading aclocal.m4,
149454e0bb33Smrg# will think it sees a *use*, and therefore will trigger all it's
149554e0bb33Smrg# C support machinery.  Also note that it means that autoscan, seeing
149654e0bb33Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
149754e0bb33Smrg
149854e0bb33Smrg
149954e0bb33Smrg# _AM_DEPENDENCIES(NAME)
150054e0bb33Smrg# ----------------------
150154e0bb33Smrg# See how the compiler implements dependency checking.
150254e0bb33Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
150354e0bb33Smrg# We try a few techniques and use that to set a single cache variable.
150454e0bb33Smrg#
150554e0bb33Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
150654e0bb33Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
150754e0bb33Smrg# dependency, and given that the user is not expected to run this macro,
150854e0bb33Smrg# just rely on AC_PROG_CC.
150954e0bb33SmrgAC_DEFUN([_AM_DEPENDENCIES],
151054e0bb33Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
151154e0bb33SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
151254e0bb33SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
151354e0bb33SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
151454e0bb33Smrg
151554e0bb33Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
151654e0bb33Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
151754e0bb33Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
151854e0bb33Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
151954e0bb33Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
152054e0bb33Smrg                   [depcc="$$1"   am_compiler_list=])
152154e0bb33Smrg
152254e0bb33SmrgAC_CACHE_CHECK([dependency style of $depcc],
152354e0bb33Smrg               [am_cv_$1_dependencies_compiler_type],
152454e0bb33Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
152554e0bb33Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
152654e0bb33Smrg  # making bogus files that we don't know about and never remove.  For
152754e0bb33Smrg  # instance it was reported that on HP-UX the gcc test will end up
152854e0bb33Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
152954e0bb33Smrg  # in D'.
153054e0bb33Smrg  mkdir conftest.dir
153154e0bb33Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
153254e0bb33Smrg  # using a relative directory.
153354e0bb33Smrg  cp "$am_depcomp" conftest.dir
153454e0bb33Smrg  cd conftest.dir
153554e0bb33Smrg  # We will build objects and dependencies in a subdirectory because
153654e0bb33Smrg  # it helps to detect inapplicable dependency modes.  For instance
153754e0bb33Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
153854e0bb33Smrg  # side effect of compilation, but ICC will put the dependencies in
153954e0bb33Smrg  # the current directory while Tru64 will put them in the object
154054e0bb33Smrg  # directory.
154154e0bb33Smrg  mkdir sub
154254e0bb33Smrg
154354e0bb33Smrg  am_cv_$1_dependencies_compiler_type=none
154454e0bb33Smrg  if test "$am_compiler_list" = ""; then
154554e0bb33Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
154654e0bb33Smrg  fi
154754e0bb33Smrg  am__universal=false
154854e0bb33Smrg  m4_case([$1], [CC],
154954e0bb33Smrg    [case " $depcc " in #(
155054e0bb33Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
155154e0bb33Smrg     esac],
155254e0bb33Smrg    [CXX],
155354e0bb33Smrg    [case " $depcc " in #(
155454e0bb33Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
155554e0bb33Smrg     esac])
155654e0bb33Smrg
155754e0bb33Smrg  for depmode in $am_compiler_list; do
155854e0bb33Smrg    # Setup a source with many dependencies, because some compilers
155954e0bb33Smrg    # like to wrap large dependency lists on column 80 (with \), and
156054e0bb33Smrg    # we should not choose a depcomp mode which is confused by this.
156154e0bb33Smrg    #
156254e0bb33Smrg    # We need to recreate these files for each test, as the compiler may
156354e0bb33Smrg    # overwrite some of them when testing with obscure command lines.
156454e0bb33Smrg    # This happens at least with the AIX C compiler.
156554e0bb33Smrg    : > sub/conftest.c
156654e0bb33Smrg    for i in 1 2 3 4 5 6; do
156754e0bb33Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
156854e0bb33Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
156954e0bb33Smrg      # Solaris 8's {/usr,}/bin/sh.
157054e0bb33Smrg      touch sub/conftst$i.h
157154e0bb33Smrg    done
157254e0bb33Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
157354e0bb33Smrg
157454e0bb33Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
157554e0bb33Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
157654e0bb33Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
157754e0bb33Smrg    # versions had trouble with output in subdirs
157854e0bb33Smrg    am__obj=sub/conftest.${OBJEXT-o}
157954e0bb33Smrg    am__minus_obj="-o $am__obj"
158054e0bb33Smrg    case $depmode in
158154e0bb33Smrg    gcc)
158254e0bb33Smrg      # This depmode causes a compiler race in universal mode.
158354e0bb33Smrg      test "$am__universal" = false || continue
158454e0bb33Smrg      ;;
158554e0bb33Smrg    nosideeffect)
158654e0bb33Smrg      # after this tag, mechanisms are not by side-effect, so they'll
158754e0bb33Smrg      # only be used when explicitly requested
158854e0bb33Smrg      if test "x$enable_dependency_tracking" = xyes; then
158954e0bb33Smrg	continue
159054e0bb33Smrg      else
159154e0bb33Smrg	break
159254e0bb33Smrg      fi
159354e0bb33Smrg      ;;
159454e0bb33Smrg    msvisualcpp | msvcmsys)
159554e0bb33Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
159654e0bb33Smrg      # not run yet.  These depmodes are late enough in the game, and
159754e0bb33Smrg      # so weak that their functioning should not be impacted.
159854e0bb33Smrg      am__obj=conftest.${OBJEXT-o}
159954e0bb33Smrg      am__minus_obj=
160054e0bb33Smrg      ;;
160154e0bb33Smrg    none) break ;;
160254e0bb33Smrg    esac
160354e0bb33Smrg    if depmode=$depmode \
160454e0bb33Smrg       source=sub/conftest.c object=$am__obj \
160554e0bb33Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
160654e0bb33Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
160754e0bb33Smrg         >/dev/null 2>conftest.err &&
160854e0bb33Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
160954e0bb33Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
161054e0bb33Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
161154e0bb33Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
161254e0bb33Smrg      # icc doesn't choke on unknown options, it will just issue warnings
161354e0bb33Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
161454e0bb33Smrg      # that says an option was ignored or not supported.
161554e0bb33Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
161654e0bb33Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
161754e0bb33Smrg      # The diagnosis changed in icc 8.0:
161854e0bb33Smrg      #   icc: Command line remark: option '-MP' not supported
161954e0bb33Smrg      if (grep 'ignoring option' conftest.err ||
162054e0bb33Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
162154e0bb33Smrg        am_cv_$1_dependencies_compiler_type=$depmode
162254e0bb33Smrg        break
162354e0bb33Smrg      fi
162454e0bb33Smrg    fi
162554e0bb33Smrg  done
162654e0bb33Smrg
162754e0bb33Smrg  cd ..
162854e0bb33Smrg  rm -rf conftest.dir
1629cea37944Smrgelse
163054e0bb33Smrg  am_cv_$1_dependencies_compiler_type=none
163153719b08Smrgfi
163254e0bb33Smrg])
163354e0bb33SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
163454e0bb33SmrgAM_CONDITIONAL([am__fastdep$1], [
163554e0bb33Smrg  test "x$enable_dependency_tracking" != xno \
163654e0bb33Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
163754e0bb33Smrg])
163854e0bb33Smrg
163954e0bb33Smrg
164054e0bb33Smrg# AM_SET_DEPDIR
164154e0bb33Smrg# -------------
164254e0bb33Smrg# Choose a directory name for dependency files.
164354e0bb33Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
164454e0bb33SmrgAC_DEFUN([AM_SET_DEPDIR],
164554e0bb33Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
164654e0bb33SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
164754e0bb33Smrg])
164854e0bb33Smrg
164954e0bb33Smrg
165054e0bb33Smrg# AM_DEP_TRACK
165154e0bb33Smrg# ------------
165254e0bb33SmrgAC_DEFUN([AM_DEP_TRACK],
165354e0bb33Smrg[AC_ARG_ENABLE(dependency-tracking,
165454e0bb33Smrg[  --disable-dependency-tracking  speeds up one-time build
165554e0bb33Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
165654e0bb33Smrgif test "x$enable_dependency_tracking" != xno; then
165754e0bb33Smrg  am_depcomp="$ac_aux_dir/depcomp"
165854e0bb33Smrg  AMDEPBACKSLASH='\'
1659cea37944Smrgfi
166054e0bb33SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
166154e0bb33SmrgAC_SUBST([AMDEPBACKSLASH])dnl
166254e0bb33Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
166354e0bb33Smrg])
1664cea37944Smrg
166554e0bb33Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
166654e0bb33Smrg
166754e0bb33Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
166854e0bb33Smrg# Free Software Foundation, Inc.
1669cea37944Smrg#
167054e0bb33Smrg# This file is free software; the Free Software Foundation
167154e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
167254e0bb33Smrg# with or without modifications, as long as this notice is preserved.
167354e0bb33Smrg
167454e0bb33Smrg#serial 5
167554e0bb33Smrg
167654e0bb33Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
167754e0bb33Smrg# ------------------------------
167854e0bb33SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
167954e0bb33Smrg[{
168054e0bb33Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
168154e0bb33Smrg  # are listed without --file.  Let's play safe and only enable the eval
168254e0bb33Smrg  # if we detect the quoting.
168354e0bb33Smrg  case $CONFIG_FILES in
168454e0bb33Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
168554e0bb33Smrg  *)   set x $CONFIG_FILES ;;
168654e0bb33Smrg  esac
168754e0bb33Smrg  shift
168854e0bb33Smrg  for mf
168954e0bb33Smrg  do
169054e0bb33Smrg    # Strip MF so we end up with the name of the file.
169154e0bb33Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
169254e0bb33Smrg    # Check whether this is an Automake generated Makefile or not.
169354e0bb33Smrg    # We used to match only the files named `Makefile.in', but
169454e0bb33Smrg    # some people rename them; so instead we look at the file content.
169554e0bb33Smrg    # Grep'ing the first line is not enough: some people post-process
169654e0bb33Smrg    # each Makefile.in and add a new line on top of each file to say so.
169754e0bb33Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
169854e0bb33Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
169954e0bb33Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
170054e0bb33Smrg      dirpart=`AS_DIRNAME("$mf")`
170154e0bb33Smrg    else
170254e0bb33Smrg      continue
170354e0bb33Smrg    fi
170454e0bb33Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
170554e0bb33Smrg    # from the Makefile without running `make'.
170654e0bb33Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
170754e0bb33Smrg    test -z "$DEPDIR" && continue
170854e0bb33Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
170954e0bb33Smrg    test -z "am__include" && continue
171054e0bb33Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
171154e0bb33Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
171254e0bb33Smrg    U=`sed -n 's/^U = //p' < "$mf"`
171354e0bb33Smrg    # Find all dependency output files, they are included files with
171454e0bb33Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
171554e0bb33Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
171654e0bb33Smrg    # expansion.
171754e0bb33Smrg    for file in `sed -n "
171854e0bb33Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
171954e0bb33Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
172054e0bb33Smrg      # Make sure the directory exists.
172154e0bb33Smrg      test -f "$dirpart/$file" && continue
172254e0bb33Smrg      fdir=`AS_DIRNAME(["$file"])`
172354e0bb33Smrg      AS_MKDIR_P([$dirpart/$fdir])
172454e0bb33Smrg      # echo "creating $dirpart/$file"
172554e0bb33Smrg      echo '# dummy' > "$dirpart/$file"
172654e0bb33Smrg    done
172754e0bb33Smrg  done
172854e0bb33Smrg}
172954e0bb33Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1730cea37944Smrg
1731b1297603Smrg
173254e0bb33Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
173354e0bb33Smrg# -----------------------------
173454e0bb33Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
1735b1297603Smrg#
173654e0bb33Smrg# This code is only required when automatic dependency tracking
173754e0bb33Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
173854e0bb33Smrg# need in order to bootstrap the dependency handling code.
173954e0bb33SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
174054e0bb33Smrg[AC_CONFIG_COMMANDS([depfiles],
174154e0bb33Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
174254e0bb33Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
174354e0bb33Smrg])
174454e0bb33Smrg
174554e0bb33Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
174654e0bb33Smrg# Free Software Foundation, Inc.
1747cea37944Smrg#
174854e0bb33Smrg# This file is free software; the Free Software Foundation
174954e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
175054e0bb33Smrg# with or without modifications, as long as this notice is preserved.
175154e0bb33Smrg
175254e0bb33Smrg# serial 8
175354e0bb33Smrg
175454e0bb33Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
175554e0bb33SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
175654e0bb33Smrg
175754e0bb33Smrg# Do all the work for Automake.                             -*- Autoconf -*-
175854e0bb33Smrg
175954e0bb33Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
176054e0bb33Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1761cea37944Smrg#
176254e0bb33Smrg# This file is free software; the Free Software Foundation
176354e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
176454e0bb33Smrg# with or without modifications, as long as this notice is preserved.
1765cea37944Smrg
176654e0bb33Smrg# serial 16
176754e0bb33Smrg
176854e0bb33Smrg# This macro actually does too much.  Some checks are only needed if
176954e0bb33Smrg# your package does certain things.  But this isn't really a big deal.
177054e0bb33Smrg
177154e0bb33Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
177254e0bb33Smrg# AM_INIT_AUTOMAKE([OPTIONS])
177354e0bb33Smrg# -----------------------------------------------
177454e0bb33Smrg# The call with PACKAGE and VERSION arguments is the old style
177554e0bb33Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
177654e0bb33Smrg# and VERSION should now be passed to AC_INIT and removed from
177754e0bb33Smrg# the call to AM_INIT_AUTOMAKE.
177854e0bb33Smrg# We support both call styles for the transition.  After
177954e0bb33Smrg# the next Automake release, Autoconf can make the AC_INIT
178054e0bb33Smrg# arguments mandatory, and then we can depend on a new Autoconf
178154e0bb33Smrg# release and drop the old call support.
178254e0bb33SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
178354e0bb33Smrg[AC_PREREQ([2.62])dnl
178454e0bb33Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
178554e0bb33Smrgdnl the ones we care about.
178654e0bb33Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
178754e0bb33SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
178854e0bb33SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
178954e0bb33Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
179054e0bb33Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
179154e0bb33Smrg  # is not polluted with repeated "-I."
179254e0bb33Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
179354e0bb33Smrg  # test to see if srcdir already configured
179454e0bb33Smrg  if test -f $srcdir/config.status; then
179554e0bb33Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
179654e0bb33Smrg  fi
1797cea37944Smrgfi
179853719b08Smrg
179954e0bb33Smrg# test whether we have cygpath
180054e0bb33Smrgif test -z "$CYGPATH_W"; then
180154e0bb33Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
180254e0bb33Smrg    CYGPATH_W='cygpath -w'
180354e0bb33Smrg  else
180454e0bb33Smrg    CYGPATH_W=echo
180554e0bb33Smrg  fi
180654e0bb33Smrgfi
180754e0bb33SmrgAC_SUBST([CYGPATH_W])
180854e0bb33Smrg
180954e0bb33Smrg# Define the identity of the package.
181054e0bb33Smrgdnl Distinguish between old-style and new-style calls.
181154e0bb33Smrgm4_ifval([$2],
181254e0bb33Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
181354e0bb33Smrg AC_SUBST([PACKAGE], [$1])dnl
181454e0bb33Smrg AC_SUBST([VERSION], [$2])],
181554e0bb33Smrg[_AM_SET_OPTIONS([$1])dnl
181654e0bb33Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
181754e0bb33Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
181854e0bb33Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
181954e0bb33Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
182054e0bb33Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
182154e0bb33Smrg
182254e0bb33Smrg_AM_IF_OPTION([no-define],,
182354e0bb33Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
182454e0bb33Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
182554e0bb33Smrg
182654e0bb33Smrg# Some tools Automake needs.
182754e0bb33SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
182854e0bb33SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
182954e0bb33SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
183054e0bb33SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
183154e0bb33SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
183254e0bb33SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
183354e0bb33SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
183454e0bb33SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
183554e0bb33SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
183654e0bb33SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
183754e0bb33Smrg# We need awk for the "check" target.  The system "awk" is bad on
183854e0bb33Smrg# some platforms.
183954e0bb33SmrgAC_REQUIRE([AC_PROG_AWK])dnl
184054e0bb33SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
184154e0bb33SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
184254e0bb33Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
184354e0bb33Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
184454e0bb33Smrg			     [_AM_PROG_TAR([v7])])])
184554e0bb33Smrg_AM_IF_OPTION([no-dependencies],,
184654e0bb33Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
184754e0bb33Smrg		  [_AM_DEPENDENCIES(CC)],
184854e0bb33Smrg		  [define([AC_PROG_CC],
184954e0bb33Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
185054e0bb33SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
185154e0bb33Smrg		  [_AM_DEPENDENCIES(CXX)],
185254e0bb33Smrg		  [define([AC_PROG_CXX],
185354e0bb33Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
185454e0bb33SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
185554e0bb33Smrg		  [_AM_DEPENDENCIES(OBJC)],
185654e0bb33Smrg		  [define([AC_PROG_OBJC],
185754e0bb33Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
185854e0bb33Smrg])
185954e0bb33Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
186054e0bb33Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
186154e0bb33Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
186254e0bb33Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
186354e0bb33SmrgAC_CONFIG_COMMANDS_PRE(dnl
186454e0bb33Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
186554e0bb33Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
186654e0bb33Smrg])
186754e0bb33Smrg
186854e0bb33Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
186954e0bb33Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
187054e0bb33Smrgdnl mangled by Autoconf and run in a shell conditional statement.
187154e0bb33Smrgm4_define([_AC_COMPILER_EXEEXT],
187254e0bb33Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
187354e0bb33Smrg
187454e0bb33Smrg
187554e0bb33Smrg# When config.status generates a header, we must update the stamp-h file.
187654e0bb33Smrg# This file resides in the same directory as the config header
187754e0bb33Smrg# that is generated.  The stamp files are numbered to have different names.
187854e0bb33Smrg
187954e0bb33Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
188054e0bb33Smrg# loop where config.status creates the headers, so we can generate
188154e0bb33Smrg# our stamp files there.
188254e0bb33SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
188354e0bb33Smrg[# Compute $1's index in $config_headers.
188454e0bb33Smrg_am_arg=$1
188554e0bb33Smrg_am_stamp_count=1
188654e0bb33Smrgfor _am_header in $config_headers :; do
188754e0bb33Smrg  case $_am_header in
188854e0bb33Smrg    $_am_arg | $_am_arg:* )
188954e0bb33Smrg      break ;;
189054e0bb33Smrg    * )
189154e0bb33Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
189254e0bb33Smrg  esac
189354e0bb33Smrgdone
189454e0bb33Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
189554e0bb33Smrg
189654e0bb33Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
1897cea37944Smrg#
189854e0bb33Smrg# This file is free software; the Free Software Foundation
189954e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
190054e0bb33Smrg# with or without modifications, as long as this notice is preserved.
190154e0bb33Smrg
190254e0bb33Smrg# AM_PROG_INSTALL_SH
190354e0bb33Smrg# ------------------
190454e0bb33Smrg# Define $install_sh.
190554e0bb33SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
190654e0bb33Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
190754e0bb33Smrgif test x"${install_sh}" != xset; then
190854e0bb33Smrg  case $am_aux_dir in
190954e0bb33Smrg  *\ * | *\	*)
191054e0bb33Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
191154e0bb33Smrg  *)
191254e0bb33Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
191354e0bb33Smrg  esac
1914cea37944Smrgfi
191554e0bb33SmrgAC_SUBST(install_sh)])
1916cea37944Smrg
191754e0bb33Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1918cea37944Smrg#
191954e0bb33Smrg# This file is free software; the Free Software Foundation
192054e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
192154e0bb33Smrg# with or without modifications, as long as this notice is preserved.
192254e0bb33Smrg
192354e0bb33Smrg# serial 2
192454e0bb33Smrg
192554e0bb33Smrg# Check whether the underlying file-system supports filenames
192654e0bb33Smrg# with a leading dot.  For instance MS-DOS doesn't.
192754e0bb33SmrgAC_DEFUN([AM_SET_LEADING_DOT],
192854e0bb33Smrg[rm -rf .tst 2>/dev/null
192954e0bb33Smrgmkdir .tst 2>/dev/null
193054e0bb33Smrgif test -d .tst; then
193154e0bb33Smrg  am__leading_dot=.
193254e0bb33Smrgelse
193354e0bb33Smrg  am__leading_dot=_
1934cea37944Smrgfi
193554e0bb33Smrgrmdir .tst 2>/dev/null
193654e0bb33SmrgAC_SUBST([am__leading_dot])])
1937cea37944Smrg
193854e0bb33Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
193954e0bb33Smrg# From Jim Meyering
194054e0bb33Smrg
194154e0bb33Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
194254e0bb33Smrg# Free Software Foundation, Inc.
1943cea37944Smrg#
194454e0bb33Smrg# This file is free software; the Free Software Foundation
194554e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
194654e0bb33Smrg# with or without modifications, as long as this notice is preserved.
194754e0bb33Smrg
194854e0bb33Smrg# serial 5
194954e0bb33Smrg
195054e0bb33Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
195154e0bb33Smrg# ----------------------------------
195254e0bb33Smrg# Control maintainer-specific portions of Makefiles.
195354e0bb33Smrg# Default is to disable them, unless `enable' is passed literally.
195454e0bb33Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
195554e0bb33Smrg# can override the default with the --enable/--disable switch.
195654e0bb33SmrgAC_DEFUN([AM_MAINTAINER_MODE],
195754e0bb33Smrg[m4_case(m4_default([$1], [disable]),
195854e0bb33Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
195954e0bb33Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
196054e0bb33Smrg       [m4_define([am_maintainer_other], [enable])
196154e0bb33Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
196254e0bb33SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
196354e0bb33Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
196454e0bb33Smrg  AC_ARG_ENABLE([maintainer-mode],
196554e0bb33Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
196654e0bb33Smrg			  (and sometimes confusing) to the casual installer],
196754e0bb33Smrg      [USE_MAINTAINER_MODE=$enableval],
196854e0bb33Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
196954e0bb33Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
197054e0bb33Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
197154e0bb33Smrg  MAINT=$MAINTAINER_MODE_TRUE
197254e0bb33Smrg  AC_SUBST([MAINT])dnl
197354e0bb33Smrg]
197454e0bb33Smrg)
197554e0bb33Smrg
197654e0bb33SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
197754e0bb33Smrg
197854e0bb33Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
197954e0bb33Smrg
198054e0bb33Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
1981cea37944Smrg#
198254e0bb33Smrg# This file is free software; the Free Software Foundation
198354e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
198454e0bb33Smrg# with or without modifications, as long as this notice is preserved.
198554e0bb33Smrg
198654e0bb33Smrg# serial 4
198754e0bb33Smrg
198854e0bb33Smrg# AM_MAKE_INCLUDE()
198954e0bb33Smrg# -----------------
199054e0bb33Smrg# Check to see how make treats includes.
199154e0bb33SmrgAC_DEFUN([AM_MAKE_INCLUDE],
199254e0bb33Smrg[am_make=${MAKE-make}
199354e0bb33Smrgcat > confinc << 'END'
199454e0bb33Smrgam__doit:
199554e0bb33Smrg	@echo this is the am__doit target
199654e0bb33Smrg.PHONY: am__doit
199754e0bb33SmrgEND
199854e0bb33Smrg# If we don't find an include directive, just comment out the code.
199954e0bb33SmrgAC_MSG_CHECKING([for style of include used by $am_make])
200054e0bb33Smrgam__include="#"
200154e0bb33Smrgam__quote=
200254e0bb33Smrg_am_result=none
200354e0bb33Smrg# First try GNU make style include.
200454e0bb33Smrgecho "include confinc" > confmf
200554e0bb33Smrg# Ignore all kinds of additional output from `make'.
200654e0bb33Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
200754e0bb33Smrg*the\ am__doit\ target*)
200854e0bb33Smrg  am__include=include
200954e0bb33Smrg  am__quote=
201054e0bb33Smrg  _am_result=GNU
201154e0bb33Smrg  ;;
201254e0bb33Smrgesac
201354e0bb33Smrg# Now try BSD make style include.
201454e0bb33Smrgif test "$am__include" = "#"; then
201554e0bb33Smrg   echo '.include "confinc"' > confmf
201654e0bb33Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
201754e0bb33Smrg   *the\ am__doit\ target*)
201854e0bb33Smrg     am__include=.include
201954e0bb33Smrg     am__quote="\""
202054e0bb33Smrg     _am_result=BSD
202154e0bb33Smrg     ;;
202254e0bb33Smrg   esac
2023cea37944Smrgfi
202454e0bb33SmrgAC_SUBST([am__include])
202554e0bb33SmrgAC_SUBST([am__quote])
202654e0bb33SmrgAC_MSG_RESULT([$_am_result])
202754e0bb33Smrgrm -f confinc confmf
202854e0bb33Smrg])
202953719b08Smrg
203054e0bb33Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
203154e0bb33Smrg
203254e0bb33Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
203354e0bb33Smrg# Free Software Foundation, Inc.
2034cea37944Smrg#
203554e0bb33Smrg# This file is free software; the Free Software Foundation
203654e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
203754e0bb33Smrg# with or without modifications, as long as this notice is preserved.
203853719b08Smrg
203954e0bb33Smrg# serial 6
204054e0bb33Smrg
204154e0bb33Smrg# AM_MISSING_PROG(NAME, PROGRAM)
204254e0bb33Smrg# ------------------------------
204354e0bb33SmrgAC_DEFUN([AM_MISSING_PROG],
204454e0bb33Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
204554e0bb33Smrg$1=${$1-"${am_missing_run}$2"}
204654e0bb33SmrgAC_SUBST($1)])
204754e0bb33Smrg
204854e0bb33Smrg
204954e0bb33Smrg# AM_MISSING_HAS_RUN
205054e0bb33Smrg# ------------------
205154e0bb33Smrg# Define MISSING if not defined so far and test if it supports --run.
205254e0bb33Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
205354e0bb33SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
205454e0bb33Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
205554e0bb33SmrgAC_REQUIRE_AUX_FILE([missing])dnl
205654e0bb33Smrgif test x"${MISSING+set}" != xset; then
205754e0bb33Smrg  case $am_aux_dir in
205854e0bb33Smrg  *\ * | *\	*)
205954e0bb33Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
206054e0bb33Smrg  *)
206154e0bb33Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
206254e0bb33Smrg  esac
2063cea37944Smrgfi
206454e0bb33Smrg# Use eval to expand $SHELL
206554e0bb33Smrgif eval "$MISSING --run true"; then
206654e0bb33Smrg  am_missing_run="$MISSING --run "
2067cea37944Smrgelse
206854e0bb33Smrg  am_missing_run=
206954e0bb33Smrg  AC_MSG_WARN([`missing' script is too old or missing])
2070cea37944Smrgfi
207154e0bb33Smrg])
207253719b08Smrg
207354e0bb33Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
2074cea37944Smrg#
207554e0bb33Smrg# This file is free software; the Free Software Foundation
207654e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
207754e0bb33Smrg# with or without modifications, as long as this notice is preserved.
207854e0bb33Smrg
207954e0bb33Smrg# AM_PROG_MKDIR_P
208054e0bb33Smrg# ---------------
208154e0bb33Smrg# Check for `mkdir -p'.
208254e0bb33SmrgAC_DEFUN([AM_PROG_MKDIR_P],
208354e0bb33Smrg[AC_PREREQ([2.60])dnl
208454e0bb33SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
208554e0bb33Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
208654e0bb33Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
208754e0bb33Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
208854e0bb33Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
208954e0bb33Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
209054e0bb33Smrgdnl adjustment using top_builddir (which is defined more often than
209154e0bb33Smrgdnl MKDIR_P).
209254e0bb33SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
209354e0bb33Smrgcase $mkdir_p in
209454e0bb33Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
209554e0bb33Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
209654e0bb33Smrgesac
209754e0bb33Smrg])
209854e0bb33Smrg
209954e0bb33Smrg# Helper functions for option handling.                     -*- Autoconf -*-
210054e0bb33Smrg
210154e0bb33Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
2102cea37944Smrg#
210354e0bb33Smrg# This file is free software; the Free Software Foundation
210454e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
210554e0bb33Smrg# with or without modifications, as long as this notice is preserved.
210654e0bb33Smrg
210754e0bb33Smrg# serial 4
210854e0bb33Smrg
210954e0bb33Smrg# _AM_MANGLE_OPTION(NAME)
211054e0bb33Smrg# -----------------------
211154e0bb33SmrgAC_DEFUN([_AM_MANGLE_OPTION],
211254e0bb33Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
211354e0bb33Smrg
211454e0bb33Smrg# _AM_SET_OPTION(NAME)
211554e0bb33Smrg# ------------------------------
211654e0bb33Smrg# Set option NAME.  Presently that only means defining a flag for this option.
211754e0bb33SmrgAC_DEFUN([_AM_SET_OPTION],
211854e0bb33Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
211954e0bb33Smrg
212054e0bb33Smrg# _AM_SET_OPTIONS(OPTIONS)
212154e0bb33Smrg# ----------------------------------
212254e0bb33Smrg# OPTIONS is a space-separated list of Automake options.
212354e0bb33SmrgAC_DEFUN([_AM_SET_OPTIONS],
212454e0bb33Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
212554e0bb33Smrg
212654e0bb33Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
212754e0bb33Smrg# -------------------------------------------
212854e0bb33Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
212954e0bb33SmrgAC_DEFUN([_AM_IF_OPTION],
213054e0bb33Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
213154e0bb33Smrg
213254e0bb33Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
213354e0bb33Smrg
213454e0bb33Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
213554e0bb33Smrg# Free Software Foundation, Inc.
2136cea37944Smrg#
213754e0bb33Smrg# This file is free software; the Free Software Foundation
213854e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
213954e0bb33Smrg# with or without modifications, as long as this notice is preserved.
2140b1297603Smrg
214154e0bb33Smrg# serial 5
214253719b08Smrg
214354e0bb33Smrg# AM_SANITY_CHECK
214454e0bb33Smrg# ---------------
214554e0bb33SmrgAC_DEFUN([AM_SANITY_CHECK],
214654e0bb33Smrg[AC_MSG_CHECKING([whether build environment is sane])
214754e0bb33Smrg# Just in case
214854e0bb33Smrgsleep 1
214954e0bb33Smrgecho timestamp > conftest.file
215054e0bb33Smrg# Reject unsafe characters in $srcdir or the absolute working directory
215154e0bb33Smrg# name.  Accept space and tab only in the latter.
215254e0bb33Smrgam_lf='
215354e0bb33Smrg'
215454e0bb33Smrgcase `pwd` in
215554e0bb33Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
215654e0bb33Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
215754e0bb33Smrgesac
215854e0bb33Smrgcase $srcdir in
215954e0bb33Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
216054e0bb33Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
216153719b08Smrgesac
216253719b08Smrg
216354e0bb33Smrg# Do `set' in a subshell so we don't clobber the current shell's
216454e0bb33Smrg# arguments.  Must try -L first in case configure is actually a
216554e0bb33Smrg# symlink; some systems play weird games with the mod time of symlinks
216654e0bb33Smrg# (eg FreeBSD returns the mod time of the symlink's containing
216754e0bb33Smrg# directory).
216854e0bb33Smrgif (
216954e0bb33Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
217054e0bb33Smrg   if test "$[*]" = "X"; then
217154e0bb33Smrg      # -L didn't work.
217254e0bb33Smrg      set X `ls -t "$srcdir/configure" conftest.file`
217353719b08Smrg   fi
217454e0bb33Smrg   rm -f conftest.file
217554e0bb33Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
217654e0bb33Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
217754e0bb33Smrg
217854e0bb33Smrg      # If neither matched, then we have a broken ls.  This can happen
217954e0bb33Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
218054e0bb33Smrg      # broken ls alias from the environment.  This has actually
218154e0bb33Smrg      # happened.  Such a system could not be considered "sane".
218254e0bb33Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
218354e0bb33Smrgalias in your environment])
218453719b08Smrg   fi
21855b944e2aSmrg
218654e0bb33Smrg   test "$[2]" = conftest.file
218754e0bb33Smrg   )
218854e0bb33Smrgthen
218954e0bb33Smrg   # Ok.
219054e0bb33Smrg   :
219154e0bb33Smrgelse
219254e0bb33Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
219354e0bb33SmrgCheck your system clock])
2194cea37944Smrgfi
219554e0bb33SmrgAC_MSG_RESULT(yes)])
219653719b08Smrg
219754e0bb33Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
219854e0bb33Smrg#
219954e0bb33Smrg# This file is free software; the Free Software Foundation
220054e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
220154e0bb33Smrg# with or without modifications, as long as this notice is preserved.
2202b1297603Smrg
220354e0bb33Smrg# serial 1
2204b1297603Smrg
220554e0bb33Smrg# AM_SILENT_RULES([DEFAULT])
2206cea37944Smrg# --------------------------
220754e0bb33Smrg# Enable less verbose build rules; with the default set to DEFAULT
220854e0bb33Smrg# (`yes' being less verbose, `no' or empty being verbose).
220954e0bb33SmrgAC_DEFUN([AM_SILENT_RULES],
221054e0bb33Smrg[AC_ARG_ENABLE([silent-rules],
221154e0bb33Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
221254e0bb33Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
221354e0bb33Smrgcase $enable_silent_rules in
221454e0bb33Smrgyes) AM_DEFAULT_VERBOSITY=0;;
221554e0bb33Smrgno)  AM_DEFAULT_VERBOSITY=1;;
221654e0bb33Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
221754e0bb33Smrgesac
221854e0bb33SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
221954e0bb33SmrgAM_BACKSLASH='\'
222054e0bb33SmrgAC_SUBST([AM_BACKSLASH])dnl
222154e0bb33Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
222254e0bb33Smrg])
2223b1297603Smrg
222454e0bb33Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
222554e0bb33Smrg#
222654e0bb33Smrg# This file is free software; the Free Software Foundation
222754e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
222854e0bb33Smrg# with or without modifications, as long as this notice is preserved.
22295b944e2aSmrg
223054e0bb33Smrg# AM_PROG_INSTALL_STRIP
223154e0bb33Smrg# ---------------------
223254e0bb33Smrg# One issue with vendor `install' (even GNU) is that you can't
223354e0bb33Smrg# specify the program used to strip binaries.  This is especially
223454e0bb33Smrg# annoying in cross-compiling environments, where the build's strip
223554e0bb33Smrg# is unlikely to handle the host's binaries.
223654e0bb33Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
223754e0bb33Smrg# always use install-sh in `make install-strip', and initialize
223854e0bb33Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
223954e0bb33SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
224054e0bb33Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
224154e0bb33Smrg# Installed binaries are usually stripped using `strip' when the user
224254e0bb33Smrg# run `make install-strip'.  However `strip' might not be the right
224354e0bb33Smrg# tool to use in cross-compilation environments, therefore Automake
224454e0bb33Smrg# will honor the `STRIP' environment variable to overrule this program.
224554e0bb33Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
224654e0bb33Smrgif test "$cross_compiling" != no; then
224754e0bb33Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
2248cea37944Smrgfi
224954e0bb33SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
225054e0bb33SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
225153719b08Smrg
225254e0bb33Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
225354e0bb33Smrg#
225454e0bb33Smrg# This file is free software; the Free Software Foundation
225554e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
225654e0bb33Smrg# with or without modifications, as long as this notice is preserved.
225753719b08Smrg
225854e0bb33Smrg# serial 2
225953719b08Smrg
226054e0bb33Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
226154e0bb33Smrg# ---------------------------
226254e0bb33Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
226354e0bb33Smrg# This macro is traced by Automake.
226454e0bb33SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
226553719b08Smrg
226654e0bb33Smrg# AM_SUBST_NOTMAKE(VARIABLE)
226754e0bb33Smrg# ---------------------------
226854e0bb33Smrg# Public sister of _AM_SUBST_NOTMAKE.
226954e0bb33SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
227054e0bb33Smrg
227154e0bb33Smrg# Check how to create a tarball.                            -*- Autoconf -*-
227254e0bb33Smrg
227354e0bb33Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
2274cea37944Smrg#
227554e0bb33Smrg# This file is free software; the Free Software Foundation
227654e0bb33Smrg# gives unlimited permission to copy and/or distribute it,
227754e0bb33Smrg# with or without modifications, as long as this notice is preserved.
227853719b08Smrg
227954e0bb33Smrg# serial 2
2280cea37944Smrg
228154e0bb33Smrg# _AM_PROG_TAR(FORMAT)
228253719b08Smrg# --------------------
228354e0bb33Smrg# Check how to create a tarball in format FORMAT.
228454e0bb33Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
2285b1297603Smrg#
228654e0bb33Smrg# Substitute a variable $(am__tar) that is a command
228754e0bb33Smrg# writing to stdout a FORMAT-tarball containing the directory
228854e0bb33Smrg# $tardir.
228954e0bb33Smrg#     tardir=directory && $(am__tar) > result.tar
2290d3263506Smrg#
229154e0bb33Smrg# Substitute a variable $(am__untar) that extract such
229254e0bb33Smrg# a tarball read from stdin.
229354e0bb33Smrg#     $(am__untar) < result.tar
229454e0bb33SmrgAC_DEFUN([_AM_PROG_TAR],
229554e0bb33Smrg[# Always define AMTAR for backward compatibility.
229654e0bb33SmrgAM_MISSING_PROG([AMTAR], [tar])
229754e0bb33Smrgm4_if([$1], [v7],
229854e0bb33Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
229954e0bb33Smrg     [m4_case([$1], [ustar],, [pax],,
230054e0bb33Smrg              [m4_fatal([Unknown tar format])])
230154e0bb33SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
230254e0bb33Smrg# Loop over all known methods to create a tar archive until one works.
230354e0bb33Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
230454e0bb33Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
230554e0bb33Smrg# Do not fold the above two line into one, because Tru64 sh and
230654e0bb33Smrg# Solaris sh will not grok spaces in the rhs of `-'.
230754e0bb33Smrgfor _am_tool in $_am_tools
230854e0bb33Smrgdo
230954e0bb33Smrg  case $_am_tool in
231054e0bb33Smrg  gnutar)
231154e0bb33Smrg    for _am_tar in tar gnutar gtar;
231254e0bb33Smrg    do
231354e0bb33Smrg      AM_RUN_LOG([$_am_tar --version]) && break
231454e0bb33Smrg    done
231554e0bb33Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
231654e0bb33Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
231754e0bb33Smrg    am__untar="$_am_tar -xf -"
231854e0bb33Smrg    ;;
231954e0bb33Smrg  plaintar)
232054e0bb33Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
232154e0bb33Smrg    # ustar tarball either.
232254e0bb33Smrg    (tar --version) >/dev/null 2>&1 && continue
232354e0bb33Smrg    am__tar='tar chf - "$$tardir"'
232454e0bb33Smrg    am__tar_='tar chf - "$tardir"'
232554e0bb33Smrg    am__untar='tar xf -'
232654e0bb33Smrg    ;;
232754e0bb33Smrg  pax)
232854e0bb33Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
232954e0bb33Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
233054e0bb33Smrg    am__untar='pax -r'
233154e0bb33Smrg    ;;
233254e0bb33Smrg  cpio)
233354e0bb33Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
233454e0bb33Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
233554e0bb33Smrg    am__untar='cpio -i -H $1 -d'
233654e0bb33Smrg    ;;
233754e0bb33Smrg  none)
233854e0bb33Smrg    am__tar=false
233954e0bb33Smrg    am__tar_=false
234054e0bb33Smrg    am__untar=false
234154e0bb33Smrg    ;;
234254e0bb33Smrg  esac
234353719b08Smrg
234454e0bb33Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
234554e0bb33Smrg  # and am__untar set.
234654e0bb33Smrg  test -n "${am_cv_prog_tar_$1}" && break
234753719b08Smrg
234854e0bb33Smrg  # tar/untar a dummy directory, and stop if the command works
234954e0bb33Smrg  rm -rf conftest.dir
235054e0bb33Smrg  mkdir conftest.dir
235154e0bb33Smrg  echo GrepMe > conftest.dir/file
235254e0bb33Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
235354e0bb33Smrg  rm -rf conftest.dir
235454e0bb33Smrg  if test -s conftest.tar; then
235554e0bb33Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
235654e0bb33Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
235754e0bb33Smrg  fi
235854e0bb33Smrgdone
235954e0bb33Smrgrm -rf conftest.dir
236053719b08Smrg
236154e0bb33SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
236254e0bb33SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
236354e0bb33SmrgAC_SUBST([am__tar])
236454e0bb33SmrgAC_SUBST([am__untar])
236554e0bb33Smrg]) # _AM_PROG_TAR
2366b1297603Smrg
2367