aclocal.m4 revision dbe7da2e
1dbe7da2eSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2a8fdb4bcSmrg
3a8fdb4bcSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4dbe7da2eSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5a8fdb4bcSmrg# This file is free software; the Free Software Foundation
6a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
7a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
8a8fdb4bcSmrg
9a8fdb4bcSmrg# This program is distributed in the hope that it will be useful,
10a8fdb4bcSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11a8fdb4bcSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12a8fdb4bcSmrg# PARTICULAR PURPOSE.
13a8fdb4bcSmrg
14a8fdb4bcSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15a8fdb4bcSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16dbe7da2eSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
17dbe7da2eSmrg[m4_warning([this file was generated for autoconf 2.65.
18a8fdb4bcSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19a8fdb4bcSmrgIf you have problems, you may need to regenerate the build system entirely.
20a8fdb4bcSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21a8fdb4bcSmrg
22a8fdb4bcSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
23a8fdb4bcSmrg# 
24a8fdb4bcSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
25a8fdb4bcSmrg#
26a8fdb4bcSmrg# This program is free software; you can redistribute it and/or modify
27a8fdb4bcSmrg# it under the terms of the GNU General Public License as published by
28a8fdb4bcSmrg# the Free Software Foundation; either version 2 of the License, or
29a8fdb4bcSmrg# (at your option) any later version.
30a8fdb4bcSmrg#
31a8fdb4bcSmrg# This program is distributed in the hope that it will be useful, but
32a8fdb4bcSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
33a8fdb4bcSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
34a8fdb4bcSmrg# General Public License for more details.
35a8fdb4bcSmrg#
36a8fdb4bcSmrg# You should have received a copy of the GNU General Public License
37a8fdb4bcSmrg# along with this program; if not, write to the Free Software
38a8fdb4bcSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39a8fdb4bcSmrg#
40a8fdb4bcSmrg# As a special exception to the GNU General Public License, if you
41a8fdb4bcSmrg# distribute this file as part of a program that contains a
42a8fdb4bcSmrg# configuration script generated by Autoconf, you may include it under
43a8fdb4bcSmrg# the same distribution terms that you use for the rest of that program.
44a8fdb4bcSmrg
45a8fdb4bcSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
46a8fdb4bcSmrg# ----------------------------------
47a8fdb4bcSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
48a8fdb4bcSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
49a8fdb4bcSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
50a8fdb4bcSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
51a8fdb4bcSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
52a8fdb4bcSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
53a8fdb4bcSmrgfi
54a8fdb4bcSmrgif test -n "$PKG_CONFIG"; then
55a8fdb4bcSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
56a8fdb4bcSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
57a8fdb4bcSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
58a8fdb4bcSmrg		AC_MSG_RESULT([yes])
59a8fdb4bcSmrg	else
60a8fdb4bcSmrg		AC_MSG_RESULT([no])
61a8fdb4bcSmrg		PKG_CONFIG=""
62a8fdb4bcSmrg	fi
63a8fdb4bcSmrg		
64a8fdb4bcSmrgfi[]dnl
65a8fdb4bcSmrg])# PKG_PROG_PKG_CONFIG
66a8fdb4bcSmrg
67a8fdb4bcSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
68a8fdb4bcSmrg#
69a8fdb4bcSmrg# Check to see whether a particular set of modules exists.  Similar
70a8fdb4bcSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
71a8fdb4bcSmrg#
72a8fdb4bcSmrg#
73a8fdb4bcSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
74a8fdb4bcSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
75a8fdb4bcSmrg# PKG_CHECK_EXISTS manually
76a8fdb4bcSmrg# --------------------------------------------------------------
77a8fdb4bcSmrgAC_DEFUN([PKG_CHECK_EXISTS],
78a8fdb4bcSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
79a8fdb4bcSmrgif test -n "$PKG_CONFIG" && \
80a8fdb4bcSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
81a8fdb4bcSmrg  m4_ifval([$2], [$2], [:])
82a8fdb4bcSmrgm4_ifvaln([$3], [else
83a8fdb4bcSmrg  $3])dnl
84a8fdb4bcSmrgfi])
85a8fdb4bcSmrg
86a8fdb4bcSmrg
87a8fdb4bcSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
88a8fdb4bcSmrg# ---------------------------------------------
89a8fdb4bcSmrgm4_define([_PKG_CONFIG],
90a8fdb4bcSmrg[if test -n "$PKG_CONFIG"; then
91a8fdb4bcSmrg    if test -n "$$1"; then
92a8fdb4bcSmrg        pkg_cv_[]$1="$$1"
93a8fdb4bcSmrg    else
94a8fdb4bcSmrg        PKG_CHECK_EXISTS([$3],
95a8fdb4bcSmrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
96a8fdb4bcSmrg			 [pkg_failed=yes])
97a8fdb4bcSmrg    fi
98a8fdb4bcSmrgelse
99a8fdb4bcSmrg	pkg_failed=untried
100a8fdb4bcSmrgfi[]dnl
101a8fdb4bcSmrg])# _PKG_CONFIG
102a8fdb4bcSmrg
103a8fdb4bcSmrg# _PKG_SHORT_ERRORS_SUPPORTED
104a8fdb4bcSmrg# -----------------------------
105a8fdb4bcSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
106a8fdb4bcSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
107a8fdb4bcSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
108a8fdb4bcSmrg        _pkg_short_errors_supported=yes
109a8fdb4bcSmrgelse
110a8fdb4bcSmrg        _pkg_short_errors_supported=no
111a8fdb4bcSmrgfi[]dnl
112a8fdb4bcSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
113a8fdb4bcSmrg
114a8fdb4bcSmrg
115a8fdb4bcSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
116a8fdb4bcSmrg# [ACTION-IF-NOT-FOUND])
117a8fdb4bcSmrg#
118a8fdb4bcSmrg#
119a8fdb4bcSmrg# Note that if there is a possibility the first call to
120a8fdb4bcSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
121a8fdb4bcSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
122a8fdb4bcSmrg#
123a8fdb4bcSmrg#
124a8fdb4bcSmrg# --------------------------------------------------------------
125a8fdb4bcSmrgAC_DEFUN([PKG_CHECK_MODULES],
126a8fdb4bcSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
127a8fdb4bcSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
128a8fdb4bcSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
129a8fdb4bcSmrg
130a8fdb4bcSmrgpkg_failed=no
131a8fdb4bcSmrgAC_MSG_CHECKING([for $1])
132a8fdb4bcSmrg
133a8fdb4bcSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
134a8fdb4bcSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
135a8fdb4bcSmrg
136a8fdb4bcSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
137a8fdb4bcSmrgand $1[]_LIBS to avoid the need to call pkg-config.
138a8fdb4bcSmrgSee the pkg-config man page for more details.])
139a8fdb4bcSmrg
140a8fdb4bcSmrgif test $pkg_failed = yes; then
141a8fdb4bcSmrg        _PKG_SHORT_ERRORS_SUPPORTED
142a8fdb4bcSmrg        if test $_pkg_short_errors_supported = yes; then
143a8fdb4bcSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
144a8fdb4bcSmrg        else 
145a8fdb4bcSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
146a8fdb4bcSmrg        fi
147a8fdb4bcSmrg	# Put the nasty error message in config.log where it belongs
148a8fdb4bcSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
149a8fdb4bcSmrg
150a8fdb4bcSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
151a8fdb4bcSmrg[Package requirements ($2) were not met:
152a8fdb4bcSmrg
153a8fdb4bcSmrg$$1_PKG_ERRORS
154a8fdb4bcSmrg
155a8fdb4bcSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
156a8fdb4bcSmrginstalled software in a non-standard prefix.
157a8fdb4bcSmrg
158a8fdb4bcSmrg_PKG_TEXT
159a8fdb4bcSmrg])],
160a8fdb4bcSmrg		[AC_MSG_RESULT([no])
161a8fdb4bcSmrg                $4])
162a8fdb4bcSmrgelif test $pkg_failed = untried; then
163a8fdb4bcSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
164a8fdb4bcSmrg[The pkg-config script could not be found or is too old.  Make sure it
165a8fdb4bcSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
166a8fdb4bcSmrgpath to pkg-config.
167a8fdb4bcSmrg
168a8fdb4bcSmrg_PKG_TEXT
169a8fdb4bcSmrg
170a8fdb4bcSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
171a8fdb4bcSmrg		[$4])
172a8fdb4bcSmrgelse
173a8fdb4bcSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
174a8fdb4bcSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
175a8fdb4bcSmrg        AC_MSG_RESULT([yes])
176a8fdb4bcSmrg	ifelse([$3], , :, [$3])
177a8fdb4bcSmrgfi[]dnl
178a8fdb4bcSmrg])# PKG_CHECK_MODULES
179a8fdb4bcSmrg
180dbe7da2eSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
181a8fdb4bcSmrgdnl
182a8fdb4bcSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
183a8fdb4bcSmrgdnl 
184a8fdb4bcSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
185dbe7da2eSmrgdnl copy of this software and associated documentation files (the "Software"),
186dbe7da2eSmrgdnl to deal in the Software without restriction, including without limitation
187dbe7da2eSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
188dbe7da2eSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
189dbe7da2eSmrgdnl Software is furnished to do so, subject to the following conditions:
190a8fdb4bcSmrgdnl
191dbe7da2eSmrgdnl The above copyright notice and this permission notice (including the next
192dbe7da2eSmrgdnl paragraph) shall be included in all copies or substantial portions of the
193dbe7da2eSmrgdnl Software.
194a8fdb4bcSmrgdnl
195dbe7da2eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
196dbe7da2eSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
197dbe7da2eSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
198dbe7da2eSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
199dbe7da2eSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
200dbe7da2eSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
201dbe7da2eSmrgdnl DEALINGS IN THE SOFTWARE.
202a8fdb4bcSmrg
203a8fdb4bcSmrg# XORG_MACROS_VERSION(required-version)
204a8fdb4bcSmrg# -------------------------------------
205a8fdb4bcSmrg# Minimum version: 1.1.0
206a8fdb4bcSmrg#
207a8fdb4bcSmrg# If you're using a macro added in Version 1.1 or newer, include this in
208a8fdb4bcSmrg# your configure.ac with the minimum required version, such as:
209a8fdb4bcSmrg# XORG_MACROS_VERSION(1.1)
210a8fdb4bcSmrg#
211dbe7da2eSmrg# To ensure that this macro is defined, also add:
212dbe7da2eSmrg# m4_ifndef([XORG_MACROS_VERSION],
213dbe7da2eSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
214a8fdb4bcSmrg#
215a8fdb4bcSmrg#
216a8fdb4bcSmrg# See the "minimum version" comment for each macro you use to see what 
217a8fdb4bcSmrg# version you require.
218dbe7da2eSmrgm4_defun([XORG_MACROS_VERSION],[
219dbe7da2eSmrgm4_define([vers_have], [1.5.0])
220dbe7da2eSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
221dbe7da2eSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
222dbe7da2eSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
223dbe7da2eSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
224dbe7da2eSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
225dbe7da2eSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
226dbe7da2eSmrgm4_undefine([vers_have])
227dbe7da2eSmrgm4_undefine([maj_have])
228dbe7da2eSmrgm4_undefine([maj_needed])
229a8fdb4bcSmrg]) # XORG_MACROS_VERSION
230a8fdb4bcSmrg
231a8fdb4bcSmrg# XORG_PROG_RAWCPP()
232a8fdb4bcSmrg# ------------------
233a8fdb4bcSmrg# Minimum version: 1.0.0
234a8fdb4bcSmrg#
235a8fdb4bcSmrg# Find cpp program and necessary flags for use in pre-processing text files
236a8fdb4bcSmrg# such as man pages and config files
237a8fdb4bcSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
238a8fdb4bcSmrgAC_REQUIRE([AC_PROG_CPP])
239a8fdb4bcSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
240a8fdb4bcSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
241a8fdb4bcSmrg
242a8fdb4bcSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
243a8fdb4bcSmrg# which is not the best choice for supporting other OS'es, but covers most
244a8fdb4bcSmrg# of the ones we need for now.
245a8fdb4bcSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
246a8fdb4bcSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
247a8fdb4bcSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
248a8fdb4bcSmrg	AC_MSG_RESULT([no])
249a8fdb4bcSmrgelse
250a8fdb4bcSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
251a8fdb4bcSmrg		RAWCPPFLAGS=-undef
252a8fdb4bcSmrg		AC_MSG_RESULT([yes])
253dbe7da2eSmrg	# under Cygwin unix is still defined even with -undef
254dbe7da2eSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
255dbe7da2eSmrg		RAWCPPFLAGS="-undef -ansi"
256dbe7da2eSmrg		AC_MSG_RESULT([yes, with -ansi])
257a8fdb4bcSmrg	else
258a8fdb4bcSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
259a8fdb4bcSmrg	fi
260a8fdb4bcSmrgfi
261a8fdb4bcSmrgrm -f conftest.$ac_ext
262a8fdb4bcSmrg
263a8fdb4bcSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
264a8fdb4bcSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
265a8fdb4bcSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
266a8fdb4bcSmrg	AC_MSG_RESULT([no])
267a8fdb4bcSmrgelse
268a8fdb4bcSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
269a8fdb4bcSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
270a8fdb4bcSmrg		AC_MSG_RESULT([yes])
271a8fdb4bcSmrg	else
272a8fdb4bcSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
273a8fdb4bcSmrg	fi
274a8fdb4bcSmrgfi
275a8fdb4bcSmrgrm -f conftest.$ac_ext
276a8fdb4bcSmrgAC_SUBST(RAWCPPFLAGS)
277a8fdb4bcSmrg]) # XORG_PROG_RAWCPP
278a8fdb4bcSmrg
279a8fdb4bcSmrg# XORG_MANPAGE_SECTIONS()
280a8fdb4bcSmrg# -----------------------
281a8fdb4bcSmrg# Minimum version: 1.0.0
282a8fdb4bcSmrg#
283a8fdb4bcSmrg# Determine which sections man pages go in for the different man page types
284a8fdb4bcSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
285a8fdb4bcSmrg# Not sure if there's any better way than just hardcoding by OS name.
286a8fdb4bcSmrg# Override default settings by setting environment variables
287a8fdb4bcSmrg
288a8fdb4bcSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
289a8fdb4bcSmrgAC_REQUIRE([AC_CANONICAL_HOST])
290a8fdb4bcSmrg
291a8fdb4bcSmrgif test x$APP_MAN_SUFFIX = x    ; then
292a8fdb4bcSmrg    APP_MAN_SUFFIX=1
293a8fdb4bcSmrgfi
294a8fdb4bcSmrgif test x$APP_MAN_DIR = x    ; then
295a8fdb4bcSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
296a8fdb4bcSmrgfi
297a8fdb4bcSmrg
298a8fdb4bcSmrgif test x$LIB_MAN_SUFFIX = x    ; then
299a8fdb4bcSmrg    LIB_MAN_SUFFIX=3
300a8fdb4bcSmrgfi
301a8fdb4bcSmrgif test x$LIB_MAN_DIR = x    ; then
302a8fdb4bcSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
303a8fdb4bcSmrgfi
304a8fdb4bcSmrg
305a8fdb4bcSmrgif test x$FILE_MAN_SUFFIX = x    ; then
306a8fdb4bcSmrg    case $host_os in
307a8fdb4bcSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
308a8fdb4bcSmrg	*)		FILE_MAN_SUFFIX=5  ;;
309a8fdb4bcSmrg    esac
310a8fdb4bcSmrgfi
311a8fdb4bcSmrgif test x$FILE_MAN_DIR = x    ; then
312a8fdb4bcSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
313a8fdb4bcSmrgfi
314a8fdb4bcSmrg
315a8fdb4bcSmrgif test x$MISC_MAN_SUFFIX = x    ; then
316a8fdb4bcSmrg    case $host_os in
317a8fdb4bcSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
318a8fdb4bcSmrg	*)		MISC_MAN_SUFFIX=7  ;;
319a8fdb4bcSmrg    esac
320a8fdb4bcSmrgfi
321a8fdb4bcSmrgif test x$MISC_MAN_DIR = x    ; then
322a8fdb4bcSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
323a8fdb4bcSmrgfi
324a8fdb4bcSmrg
325a8fdb4bcSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
326a8fdb4bcSmrg    case $host_os in
327a8fdb4bcSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
328a8fdb4bcSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
329a8fdb4bcSmrg    esac
330a8fdb4bcSmrgfi
331a8fdb4bcSmrgif test x$DRIVER_MAN_DIR = x    ; then
332a8fdb4bcSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
333a8fdb4bcSmrgfi
334a8fdb4bcSmrg
335a8fdb4bcSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
336a8fdb4bcSmrg    case $host_os in
337a8fdb4bcSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
338a8fdb4bcSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
339a8fdb4bcSmrg    esac
340a8fdb4bcSmrgfi
341a8fdb4bcSmrgif test x$ADMIN_MAN_DIR = x    ; then
342a8fdb4bcSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
343a8fdb4bcSmrgfi
344a8fdb4bcSmrg
345a8fdb4bcSmrg
346a8fdb4bcSmrgAC_SUBST([APP_MAN_SUFFIX])
347a8fdb4bcSmrgAC_SUBST([LIB_MAN_SUFFIX])
348a8fdb4bcSmrgAC_SUBST([FILE_MAN_SUFFIX])
349a8fdb4bcSmrgAC_SUBST([MISC_MAN_SUFFIX])
350a8fdb4bcSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
351a8fdb4bcSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
352a8fdb4bcSmrgAC_SUBST([APP_MAN_DIR])
353a8fdb4bcSmrgAC_SUBST([LIB_MAN_DIR])
354a8fdb4bcSmrgAC_SUBST([FILE_MAN_DIR])
355a8fdb4bcSmrgAC_SUBST([MISC_MAN_DIR])
356a8fdb4bcSmrgAC_SUBST([DRIVER_MAN_DIR])
357a8fdb4bcSmrgAC_SUBST([ADMIN_MAN_DIR])
358a8fdb4bcSmrg]) # XORG_MANPAGE_SECTIONS
359a8fdb4bcSmrg
360a8fdb4bcSmrg# XORG_CHECK_LINUXDOC
361a8fdb4bcSmrg# -------------------
362a8fdb4bcSmrg# Minimum version: 1.0.0
363a8fdb4bcSmrg#
364a8fdb4bcSmrg# Defines the variable MAKE_TEXT if the necessary tools and
365a8fdb4bcSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
366a8fdb4bcSmrg# Whether or not the necessary tools and files are found can be checked
367a8fdb4bcSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
368a8fdb4bcSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
369dbe7da2eSmrgif test x$XORG_SGML_PATH = x ; then
370dbe7da2eSmrg    XORG_SGML_PATH=$prefix/share/sgml
371dbe7da2eSmrgfi
372a8fdb4bcSmrgHAVE_DEFS_ENT=
373a8fdb4bcSmrg
374dbe7da2eSmrgif test x"$cross_compiling" = x"yes" ; then
375dbe7da2eSmrg  HAVE_DEFS_ENT=no
376dbe7da2eSmrgelse
377dbe7da2eSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
378dbe7da2eSmrgfi
379a8fdb4bcSmrg
380a8fdb4bcSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
381a8fdb4bcSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
382a8fdb4bcSmrg
383a8fdb4bcSmrgAC_MSG_CHECKING([Whether to build documentation])
384a8fdb4bcSmrg
385a8fdb4bcSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
386a8fdb4bcSmrg   BUILDDOC=yes
387a8fdb4bcSmrgelse
388a8fdb4bcSmrg   BUILDDOC=no
389a8fdb4bcSmrgfi
390a8fdb4bcSmrg
391a8fdb4bcSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
392a8fdb4bcSmrg
393a8fdb4bcSmrgAC_MSG_RESULT([$BUILDDOC])
394a8fdb4bcSmrg
395a8fdb4bcSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
396a8fdb4bcSmrg
397a8fdb4bcSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
398a8fdb4bcSmrg   BUILDPDFDOC=yes
399a8fdb4bcSmrgelse
400a8fdb4bcSmrg   BUILDPDFDOC=no
401a8fdb4bcSmrgfi
402a8fdb4bcSmrg
403a8fdb4bcSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
404a8fdb4bcSmrg
405a8fdb4bcSmrgAC_MSG_RESULT([$BUILDPDFDOC])
406a8fdb4bcSmrg
407a8fdb4bcSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
408a8fdb4bcSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
409a8fdb4bcSmrgMAKE_PDF="$PS2PDF"
410a8fdb4bcSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
411a8fdb4bcSmrg
412a8fdb4bcSmrgAC_SUBST(MAKE_TEXT)
413a8fdb4bcSmrgAC_SUBST(MAKE_PS)
414a8fdb4bcSmrgAC_SUBST(MAKE_PDF)
415a8fdb4bcSmrgAC_SUBST(MAKE_HTML)
416a8fdb4bcSmrg]) # XORG_CHECK_LINUXDOC
417a8fdb4bcSmrg
418a8fdb4bcSmrg# XORG_CHECK_DOCBOOK
419a8fdb4bcSmrg# -------------------
420a8fdb4bcSmrg# Minimum version: 1.0.0
421a8fdb4bcSmrg#
422a8fdb4bcSmrg# Checks for the ability to build output formats from SGML DocBook source.
423a8fdb4bcSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
424a8fdb4bcSmrg# indicates whether the necessary tools and files are found and, if set,
425a8fdb4bcSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
426a8fdb4bcSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
427dbe7da2eSmrgif test x$XORG_SGML_PATH = x ; then
428dbe7da2eSmrg    XORG_SGML_PATH=$prefix/share/sgml
429dbe7da2eSmrgfi
430a8fdb4bcSmrgHAVE_DEFS_ENT=
431a8fdb4bcSmrgBUILDTXTDOC=no
432a8fdb4bcSmrgBUILDPDFDOC=no
433a8fdb4bcSmrgBUILDPSDOC=no
434a8fdb4bcSmrgBUILDHTMLDOC=no
435a8fdb4bcSmrg
436a8fdb4bcSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
437a8fdb4bcSmrg
438a8fdb4bcSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
439a8fdb4bcSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
440a8fdb4bcSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
441a8fdb4bcSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
442a8fdb4bcSmrg
443a8fdb4bcSmrgAC_MSG_CHECKING([Whether to build text documentation])
444a8fdb4bcSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
445a8fdb4bcSmrg   test x$BUILD_TXTDOC != xno; then
446a8fdb4bcSmrg	BUILDTXTDOC=yes
447a8fdb4bcSmrgfi
448a8fdb4bcSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
449a8fdb4bcSmrgAC_MSG_RESULT([$BUILDTXTDOC])
450a8fdb4bcSmrg
451a8fdb4bcSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
452a8fdb4bcSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
453a8fdb4bcSmrg   test x$BUILD_PDFDOC != xno; then
454a8fdb4bcSmrg	BUILDPDFDOC=yes
455a8fdb4bcSmrgfi
456a8fdb4bcSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
457a8fdb4bcSmrgAC_MSG_RESULT([$BUILDPDFDOC])
458a8fdb4bcSmrg
459a8fdb4bcSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
460a8fdb4bcSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
461a8fdb4bcSmrg   test x$BUILD_PSDOC != xno; then
462a8fdb4bcSmrg	BUILDPSDOC=yes
463a8fdb4bcSmrgfi
464a8fdb4bcSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
465a8fdb4bcSmrgAC_MSG_RESULT([$BUILDPSDOC])
466a8fdb4bcSmrg
467a8fdb4bcSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
468a8fdb4bcSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
469a8fdb4bcSmrg   test x$BUILD_HTMLDOC != xno; then
470a8fdb4bcSmrg	BUILDHTMLDOC=yes
471a8fdb4bcSmrgfi
472a8fdb4bcSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
473a8fdb4bcSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
474a8fdb4bcSmrg
475a8fdb4bcSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
476a8fdb4bcSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
477a8fdb4bcSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
478a8fdb4bcSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
479a8fdb4bcSmrg
480a8fdb4bcSmrgAC_SUBST(MAKE_TEXT)
481a8fdb4bcSmrgAC_SUBST(MAKE_PS)
482a8fdb4bcSmrgAC_SUBST(MAKE_PDF)
483a8fdb4bcSmrgAC_SUBST(MAKE_HTML)
484a8fdb4bcSmrg]) # XORG_CHECK_DOCBOOK
485a8fdb4bcSmrg
486dbe7da2eSmrg# XORG_WITH_XMLTO
487dbe7da2eSmrg# ----------------
488dbe7da2eSmrg# Minimum version: 1.5.0
489dbe7da2eSmrg#
490dbe7da2eSmrg# Documentation tools are not always available on all platforms and sometimes
491dbe7da2eSmrg# not at the appropriate level. This macro enables a module to test for the
492dbe7da2eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
493dbe7da2eSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
494dbe7da2eSmrg# as whether or not to use the xmlto package.
495dbe7da2eSmrg#
496dbe7da2eSmrg# Interface to module:
497dbe7da2eSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
498dbe7da2eSmrg# XMLTO:	returns the path of the xmlto program found
499dbe7da2eSmrg#		returns the path set by the user in the environment
500dbe7da2eSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
501dbe7da2eSmrg#		'no' user instructs the module not to use xmlto
502dbe7da2eSmrg#
503dbe7da2eSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
504dbe7da2eSmrg#
505dbe7da2eSmrgAC_DEFUN([XORG_WITH_XMLTO],[
506dbe7da2eSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
507dbe7da2eSmrgAC_ARG_WITH(xmlto,
508dbe7da2eSmrg	AS_HELP_STRING([--with-xmlto],
509dbe7da2eSmrg	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
510dbe7da2eSmrg	   [use_xmlto=$withval], [use_xmlto=auto])
511dbe7da2eSmrg
512dbe7da2eSmrgif test "x$use_xmlto" = x"auto"; then
513dbe7da2eSmrg   AC_PATH_PROG([XMLTO], [xmlto])
514dbe7da2eSmrg   if test "x$XMLTO" = "x"; then
515dbe7da2eSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
516dbe7da2eSmrg	have_xmlto=no
517dbe7da2eSmrg   else
518dbe7da2eSmrg        have_xmlto=yes
519dbe7da2eSmrg   fi
520dbe7da2eSmrgelif test "x$use_xmlto" = x"yes" ; then
521dbe7da2eSmrg   AC_PATH_PROG([XMLTO], [xmlto])
522dbe7da2eSmrg   if test "x$XMLTO" = "x"; then
523dbe7da2eSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
524dbe7da2eSmrg   fi
525dbe7da2eSmrg   have_xmlto=yes
526dbe7da2eSmrgelif test "x$use_xmlto" = x"no" ; then
527dbe7da2eSmrg   if test "x$XMLTO" != "x"; then
528dbe7da2eSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
529dbe7da2eSmrg   fi
530dbe7da2eSmrg   have_xmlto=no
531dbe7da2eSmrgelse
532dbe7da2eSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
533dbe7da2eSmrgfi
534dbe7da2eSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
535dbe7da2eSmrg]) # XORG_CHECK_XMLTO
536dbe7da2eSmrg
537dbe7da2eSmrg# XORG_WITH_ASCIIDOC
538dbe7da2eSmrg# ----------------
539dbe7da2eSmrg# Minimum version: 1.5.0
540dbe7da2eSmrg#
541dbe7da2eSmrg# Documentation tools are not always available on all platforms and sometimes
542dbe7da2eSmrg# not at the appropriate level. This macro enables a module to test for the
543dbe7da2eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
544dbe7da2eSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
545dbe7da2eSmrg# as whether or not to use the asciidoc package.
546dbe7da2eSmrg#
547dbe7da2eSmrg# Interface to module:
548dbe7da2eSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
549dbe7da2eSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
550dbe7da2eSmrg#		 returns the path set by the user in the environment
551dbe7da2eSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
552dbe7da2eSmrg#		  'no' user instructs the module not to use asciidoc
553dbe7da2eSmrg#
554dbe7da2eSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
555dbe7da2eSmrg#
556dbe7da2eSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
557dbe7da2eSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
558dbe7da2eSmrgAC_ARG_WITH(asciidoc,
559dbe7da2eSmrg	AS_HELP_STRING([--with-asciidoc],
560dbe7da2eSmrg	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
561dbe7da2eSmrg	   [use_asciidoc=$withval], [use_asciidoc=auto])
562dbe7da2eSmrg
563dbe7da2eSmrgif test "x$use_asciidoc" = x"auto"; then
564dbe7da2eSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
565dbe7da2eSmrg   if test "x$ASCIIDOC" = "x"; then
566dbe7da2eSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
567dbe7da2eSmrg	have_asciidoc=no
568dbe7da2eSmrg   else
569dbe7da2eSmrg        have_asciidoc=yes
570dbe7da2eSmrg   fi
571dbe7da2eSmrgelif test "x$use_asciidoc" = x"yes" ; then
572dbe7da2eSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
573dbe7da2eSmrg   if test "x$ASCIIDOC" = "x"; then
574dbe7da2eSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
575dbe7da2eSmrg   fi
576dbe7da2eSmrg   have_asciidoc=yes
577dbe7da2eSmrgelif test "x$use_asciidoc" = x"no" ; then
578dbe7da2eSmrg   if test "x$ASCIIDOC" != "x"; then
579dbe7da2eSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
580dbe7da2eSmrg   fi
581dbe7da2eSmrg   have_asciidoc=no
582dbe7da2eSmrgelse
583dbe7da2eSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
584dbe7da2eSmrgfi
585dbe7da2eSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
586dbe7da2eSmrg]) # XORG_CHECK_ASCIIDOC
587dbe7da2eSmrg
588dbe7da2eSmrg# XORG_WITH_DOXYGEN
589dbe7da2eSmrg# ----------------
590dbe7da2eSmrg# Minimum version: 1.5.0
591dbe7da2eSmrg#
592dbe7da2eSmrg# Documentation tools are not always available on all platforms and sometimes
593dbe7da2eSmrg# not at the appropriate level. This macro enables a module to test for the
594dbe7da2eSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
595dbe7da2eSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
596dbe7da2eSmrg# as whether or not to use the doxygen package.
597dbe7da2eSmrg#
598dbe7da2eSmrg# Interface to module:
599dbe7da2eSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
600dbe7da2eSmrg# DOXYGEN:	 returns the path of the doxygen program found
601dbe7da2eSmrg#		 returns the path set by the user in the environment
602dbe7da2eSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
603dbe7da2eSmrg#		  'no' user instructs the module not to use doxygen
604dbe7da2eSmrg#
605dbe7da2eSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
606dbe7da2eSmrg#
607dbe7da2eSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
608dbe7da2eSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
609dbe7da2eSmrgAC_ARG_WITH(doxygen,
610dbe7da2eSmrg	AS_HELP_STRING([--with-doxygen],
611dbe7da2eSmrg	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
612dbe7da2eSmrg	   [use_doxygen=$withval], [use_doxygen=auto])
613dbe7da2eSmrg
614dbe7da2eSmrgif test "x$use_doxygen" = x"auto"; then
615dbe7da2eSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
616dbe7da2eSmrg   if test "x$DOXYGEN" = "x"; then
617dbe7da2eSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
618dbe7da2eSmrg	have_doxygen=no
619dbe7da2eSmrg   else
620dbe7da2eSmrg        have_doxygen=yes
621dbe7da2eSmrg   fi
622dbe7da2eSmrgelif test "x$use_doxygen" = x"yes" ; then
623dbe7da2eSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
624dbe7da2eSmrg   if test "x$DOXYGEN" = "x"; then
625dbe7da2eSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
626dbe7da2eSmrg   fi
627dbe7da2eSmrg   have_doxygen=yes
628dbe7da2eSmrgelif test "x$use_doxygen" = x"no" ; then
629dbe7da2eSmrg   if test "x$DOXYGEN" != "x"; then
630dbe7da2eSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
631dbe7da2eSmrg   fi
632dbe7da2eSmrg   have_doxygen=no
633dbe7da2eSmrgelse
634dbe7da2eSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
635dbe7da2eSmrgfi
636dbe7da2eSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
637dbe7da2eSmrg]) # XORG_CHECK_DOXYGEN
638dbe7da2eSmrg
639a8fdb4bcSmrg# XORG_CHECK_MALLOC_ZERO
640a8fdb4bcSmrg# ----------------------
641a8fdb4bcSmrg# Minimum version: 1.0.0
642a8fdb4bcSmrg#
643a8fdb4bcSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
644a8fdb4bcSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
645a8fdb4bcSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
646a8fdb4bcSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
647a8fdb4bcSmrgAC_ARG_ENABLE(malloc0returnsnull,
648dbe7da2eSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
649a8fdb4bcSmrg		       [malloc(0) returns NULL (default: auto)]),
650a8fdb4bcSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
651a8fdb4bcSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
652a8fdb4bcSmrg
653a8fdb4bcSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
654a8fdb4bcSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
655a8fdb4bcSmrg	AC_RUN_IFELSE([
656a8fdb4bcSmrgchar *malloc();
657a8fdb4bcSmrgchar *realloc();
658a8fdb4bcSmrgchar *calloc();
659a8fdb4bcSmrgmain() {
660a8fdb4bcSmrg    char *m0, *r0, *c0, *p;
661a8fdb4bcSmrg    m0 = malloc(0);
662a8fdb4bcSmrg    p = malloc(10);
663a8fdb4bcSmrg    r0 = realloc(p,0);
664a8fdb4bcSmrg    c0 = calloc(0);
665a8fdb4bcSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
666a8fdb4bcSmrg}],
667a8fdb4bcSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
668dbe7da2eSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
669dbe7da2eSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
670a8fdb4bcSmrgfi
671a8fdb4bcSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
672a8fdb4bcSmrg
673a8fdb4bcSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
674a8fdb4bcSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
675a8fdb4bcSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
676a8fdb4bcSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
677a8fdb4bcSmrgelse
678a8fdb4bcSmrg	MALLOC_ZERO_CFLAGS=""
679a8fdb4bcSmrg	XMALLOC_ZERO_CFLAGS=""
680a8fdb4bcSmrg	XTMALLOC_ZERO_CFLAGS=""
681a8fdb4bcSmrgfi
682a8fdb4bcSmrg
683a8fdb4bcSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
684a8fdb4bcSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
685a8fdb4bcSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
686a8fdb4bcSmrg]) # XORG_CHECK_MALLOC_ZERO
687a8fdb4bcSmrg
688a8fdb4bcSmrg# XORG_WITH_LINT()
689a8fdb4bcSmrg# ----------------
690a8fdb4bcSmrg# Minimum version: 1.1.0
691a8fdb4bcSmrg#
692a8fdb4bcSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
693a8fdb4bcSmrg# is specified.   (Use --with-lint=sparse for sparse.)
694a8fdb4bcSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
695a8fdb4bcSmrg# Sets $LINT_FLAGS to flags to pass to source checker
696a8fdb4bcSmrg# Sets LINT automake conditional if enabled (default: disabled)
697a8fdb4bcSmrg#
698a8fdb4bcSmrgAC_DEFUN([XORG_WITH_LINT],[
699a8fdb4bcSmrg
700a8fdb4bcSmrg# Allow checking code with lint, sparse, etc.
701dbe7da2eSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
702a8fdb4bcSmrg		[Use a lint-style source code checker (default: disabled)])],
703a8fdb4bcSmrg		[use_lint=$withval], [use_lint=no])
704a8fdb4bcSmrgif test "x$use_lint" = "xyes" ; then
705a8fdb4bcSmrg	LINT="lint"
706a8fdb4bcSmrgelse
707a8fdb4bcSmrg	LINT="$use_lint"
708a8fdb4bcSmrgfi
709a8fdb4bcSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
710a8fdb4bcSmrg    case $LINT in
711a8fdb4bcSmrg	lint|*/lint)
712a8fdb4bcSmrg	    case $host_os in
713a8fdb4bcSmrg		solaris*)
714a8fdb4bcSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
715a8fdb4bcSmrg			;;
716a8fdb4bcSmrg	    esac
717a8fdb4bcSmrg	    ;;
718a8fdb4bcSmrg    esac
719a8fdb4bcSmrgfi
720a8fdb4bcSmrg
721a8fdb4bcSmrgAC_SUBST(LINT)
722a8fdb4bcSmrgAC_SUBST(LINT_FLAGS)
723a8fdb4bcSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
724a8fdb4bcSmrg
725a8fdb4bcSmrg]) # XORG_WITH_LINT
726a8fdb4bcSmrg
727a8fdb4bcSmrg# XORG_LINT_LIBRARY(LIBNAME)
728a8fdb4bcSmrg# --------------------------
729a8fdb4bcSmrg# Minimum version: 1.1.0
730a8fdb4bcSmrg#
731a8fdb4bcSmrg# Sets up flags for building lint libraries for checking programs that call
732a8fdb4bcSmrg# functions in the library.
733a8fdb4bcSmrg# Disabled by default, enable with --enable-lint-library
734a8fdb4bcSmrg# Sets: 
735a8fdb4bcSmrg#	@LINTLIB@		- name of lint library file to make
736a8fdb4bcSmrg#	MAKE_LINT_LIB		- automake conditional
737a8fdb4bcSmrg#
738a8fdb4bcSmrg
739a8fdb4bcSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
740a8fdb4bcSmrgAC_REQUIRE([XORG_WITH_LINT])
741a8fdb4bcSmrg# Build lint "library" for more indepth checks of programs calling this library
742dbe7da2eSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
743a8fdb4bcSmrg	[Create lint library (default: disabled)])],
744a8fdb4bcSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
745a8fdb4bcSmrgif test "x$make_lint_lib" != "xno" ; then
746a8fdb4bcSmrg	if test "x$LINT" = "xno" ; then
747a8fdb4bcSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
748a8fdb4bcSmrg	fi
749a8fdb4bcSmrg	if test "x$make_lint_lib" = "xyes" ; then
750a8fdb4bcSmrg		LINTLIB=llib-l$1.ln
751a8fdb4bcSmrg	else
752a8fdb4bcSmrg		LINTLIB=$make_lint_lib
753a8fdb4bcSmrg	fi
754a8fdb4bcSmrgfi
755a8fdb4bcSmrgAC_SUBST(LINTLIB)
756a8fdb4bcSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
757a8fdb4bcSmrg
758a8fdb4bcSmrg]) # XORG_LINT_LIBRARY
759a8fdb4bcSmrg
760dbe7da2eSmrg# XORG_CWARNFLAGS
761dbe7da2eSmrg# ---------------
762dbe7da2eSmrg# Minimum version: 1.2.0
763dbe7da2eSmrg#
764dbe7da2eSmrg# Defines CWARNFLAGS to enable C compiler warnings.
765dbe7da2eSmrg#
766dbe7da2eSmrgAC_DEFUN([XORG_CWARNFLAGS], [
767dbe7da2eSmrgAC_REQUIRE([AC_PROG_CC])
768dbe7da2eSmrgif  test "x$GCC" = xyes ; then
769dbe7da2eSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
770dbe7da2eSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
771dbe7da2eSmrg-Wbad-function-cast"
772dbe7da2eSmrg    case `$CC -dumpversion` in
773dbe7da2eSmrg    3.4.* | 4.*)
774dbe7da2eSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
775dbe7da2eSmrg	;;
776dbe7da2eSmrg    esac
777dbe7da2eSmrgelse
778dbe7da2eSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
779dbe7da2eSmrg    if test "x$SUNCC" = "xyes"; then
780dbe7da2eSmrg	CWARNFLAGS="-v"
781dbe7da2eSmrg    fi
782dbe7da2eSmrgfi
783dbe7da2eSmrgAC_SUBST(CWARNFLAGS)
784dbe7da2eSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
785dbe7da2eSmrg]) # XORG_CWARNFLAGS
786dbe7da2eSmrg
787dbe7da2eSmrg# XORG_STRICT_OPTION
788dbe7da2eSmrg# -----------------------
789dbe7da2eSmrg# Minimum version: 1.3.0
790dbe7da2eSmrg#
791dbe7da2eSmrg# Add configure option to enable strict compilation
792dbe7da2eSmrgAC_DEFUN([XORG_STRICT_OPTION], [
793dbe7da2eSmrgAC_REQUIRE([AC_PROG_CC])
794dbe7da2eSmrgAC_REQUIRE([AC_PROG_CC_C99])
795dbe7da2eSmrgAC_REQUIRE([XORG_CWARNFLAGS])
796dbe7da2eSmrg
797dbe7da2eSmrgAC_ARG_ENABLE(strict-compilation,
798dbe7da2eSmrg			  AS_HELP_STRING([--enable-strict-compilation],
799dbe7da2eSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
800dbe7da2eSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
801dbe7da2eSmrgif test "x$STRICT_COMPILE" = "xyes"; then
802dbe7da2eSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
803dbe7da2eSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
804dbe7da2eSmrg	if test "x$GCC" = xyes ; then
805dbe7da2eSmrg		STRICT_CFLAGS="-pedantic -Werror"
806dbe7da2eSmrg	elif test "x$SUNCC" = "xyes"; then
807dbe7da2eSmrg		STRICT_CFLAGS="-errwarn"
808dbe7da2eSmrg    elif test "x$INTELCC" = "xyes"; then
809dbe7da2eSmrg		STRICT_CFLAGS="-Werror"
810dbe7da2eSmrg	fi
811dbe7da2eSmrgfi
812dbe7da2eSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
813dbe7da2eSmrgAC_SUBST([CWARNFLAGS])
814dbe7da2eSmrg]) # XORG_STRICT_OPTION
815dbe7da2eSmrg
816dbe7da2eSmrg# XORG_DEFAULT_OPTIONS
817dbe7da2eSmrg# --------------------
818dbe7da2eSmrg# Minimum version: 1.3.0
819dbe7da2eSmrg#
820dbe7da2eSmrg# Defines default options for X.Org modules.
821dbe7da2eSmrg#
822dbe7da2eSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
823dbe7da2eSmrgXORG_CWARNFLAGS
824dbe7da2eSmrgXORG_STRICT_OPTION
825dbe7da2eSmrgXORG_RELEASE_VERSION
826dbe7da2eSmrgXORG_CHANGELOG
827dbe7da2eSmrgXORG_INSTALL
828dbe7da2eSmrgXORG_MANPAGE_SECTIONS
829dbe7da2eSmrg]) # XORG_DEFAULT_OPTIONS
830dbe7da2eSmrg
831dbe7da2eSmrg# XORG_INSTALL()
832dbe7da2eSmrg# ----------------
833dbe7da2eSmrg# Minimum version: 1.4.0
834dbe7da2eSmrg#
835dbe7da2eSmrg# Defines the variable INSTALL_CMD as the command to copy
836dbe7da2eSmrg# INSTALL from $prefix/share/util-macros.
837dbe7da2eSmrg#
838dbe7da2eSmrgAC_DEFUN([XORG_INSTALL], [
839dbe7da2eSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
840dbe7da2eSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
841dbe7da2eSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
842dbe7da2eSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
843dbe7da2eSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
844dbe7da2eSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
845dbe7da2eSmrgAC_SUBST([INSTALL_CMD])
846dbe7da2eSmrg]) # XORG_INSTALL
847a8fdb4bcSmrgdnl Copyright 2005 Red Hat, Inc
848a8fdb4bcSmrgdnl
849a8fdb4bcSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
850a8fdb4bcSmrgdnl documentation for any purpose is hereby granted without fee, provided that
851a8fdb4bcSmrgdnl the above copyright notice appear in all copies and that both that
852a8fdb4bcSmrgdnl copyright notice and this permission notice appear in supporting
853a8fdb4bcSmrgdnl documentation.
854a8fdb4bcSmrgdnl
855a8fdb4bcSmrgdnl The above copyright notice and this permission notice shall be included
856a8fdb4bcSmrgdnl in all copies or substantial portions of the Software.
857a8fdb4bcSmrgdnl
858a8fdb4bcSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
859a8fdb4bcSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
860a8fdb4bcSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
861a8fdb4bcSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
862a8fdb4bcSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
863a8fdb4bcSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
864a8fdb4bcSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
865a8fdb4bcSmrgdnl
866a8fdb4bcSmrgdnl Except as contained in this notice, the name of the copyright holders shall
867a8fdb4bcSmrgdnl not be used in advertising or otherwise to promote the sale, use or
868a8fdb4bcSmrgdnl other dealings in this Software without prior written authorization
869a8fdb4bcSmrgdnl from the copyright holders.
870a8fdb4bcSmrgdnl
871a8fdb4bcSmrg
872a8fdb4bcSmrg# XORG_RELEASE_VERSION
873a8fdb4bcSmrg# --------------------
874a8fdb4bcSmrg# Adds --with/without-release-string and changes the PACKAGE and
875a8fdb4bcSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
876a8fdb4bcSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
877a8fdb4bcSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
878a8fdb4bcSmrg 
879a8fdb4bcSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
880a8fdb4bcSmrg	AC_ARG_WITH(release-version,
881dbe7da2eSmrg			AS_HELP_STRING([--with-release-version=STRING],
882a8fdb4bcSmrg				[Use release version string in package name]),
883a8fdb4bcSmrg			[RELEASE_VERSION="$withval"],
884a8fdb4bcSmrg			[RELEASE_VERSION=""])
885a8fdb4bcSmrg	if test "x$RELEASE_VERSION" != "x"; then
886a8fdb4bcSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
887a8fdb4bcSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
888a8fdb4bcSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
889a8fdb4bcSmrg	fi
890a8fdb4bcSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
891a8fdb4bcSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
892a8fdb4bcSmrg		[Major version of this package])
893dbe7da2eSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
894a8fdb4bcSmrg	if test "x$PVM" = "x"; then
895a8fdb4bcSmrg		PVM="0"
896a8fdb4bcSmrg	fi
897a8fdb4bcSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
898a8fdb4bcSmrg		[$PVM],
899a8fdb4bcSmrg		[Minor version of this package])
900dbe7da2eSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
901a8fdb4bcSmrg	if test "x$PVP" = "x"; then
902a8fdb4bcSmrg		PVP="0"
903a8fdb4bcSmrg	fi
904a8fdb4bcSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
905a8fdb4bcSmrg		[$PVP],
906a8fdb4bcSmrg		[Patch version of this package])
907a8fdb4bcSmrg])
908a8fdb4bcSmrg
909dbe7da2eSmrg# XORG_CHANGELOG()
910dbe7da2eSmrg# ----------------
911dbe7da2eSmrg# Minimum version: 1.2.0
912dbe7da2eSmrg#
913dbe7da2eSmrg# Defines the variable CHANGELOG_CMD as the command to generate
914dbe7da2eSmrg# ChangeLog from git.
915dbe7da2eSmrg#
916dbe7da2eSmrg#
917dbe7da2eSmrgAC_DEFUN([XORG_CHANGELOG], [
918dbe7da2eSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
919dbe7da2eSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
920dbe7da2eSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
921dbe7da2eSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
922dbe7da2eSmrgAC_SUBST([CHANGELOG_CMD])
923dbe7da2eSmrg]) # XORG_CHANGELOG
924dbe7da2eSmrg
925dbe7da2eSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
926a8fdb4bcSmrg#
927a8fdb4bcSmrg# This file is free software; the Free Software Foundation
928a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
929a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
930a8fdb4bcSmrg
931a8fdb4bcSmrg# AM_AUTOMAKE_VERSION(VERSION)
932a8fdb4bcSmrg# ----------------------------
933a8fdb4bcSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
934a8fdb4bcSmrg# generated from the m4 files accompanying Automake X.Y.
935a8fdb4bcSmrg# (This private macro should not be called outside this file.)
936a8fdb4bcSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
937dbe7da2eSmrg[am__api_version='1.11'
938a8fdb4bcSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
939a8fdb4bcSmrgdnl require some minimum version.  Point them to the right macro.
940dbe7da2eSmrgm4_if([$1], [1.11.1], [],
941a8fdb4bcSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
942a8fdb4bcSmrg])
943a8fdb4bcSmrg
944a8fdb4bcSmrg# _AM_AUTOCONF_VERSION(VERSION)
945a8fdb4bcSmrg# -----------------------------
946a8fdb4bcSmrg# aclocal traces this macro to find the Autoconf version.
947a8fdb4bcSmrg# This is a private macro too.  Using m4_define simplifies
948a8fdb4bcSmrg# the logic in aclocal, which can simply ignore this definition.
949a8fdb4bcSmrgm4_define([_AM_AUTOCONF_VERSION], [])
950a8fdb4bcSmrg
951a8fdb4bcSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
952a8fdb4bcSmrg# -------------------------------
953a8fdb4bcSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
954dbe7da2eSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
955a8fdb4bcSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
956dbe7da2eSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
957a8fdb4bcSmrgm4_ifndef([AC_AUTOCONF_VERSION],
958a8fdb4bcSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
959dbe7da2eSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
960a8fdb4bcSmrg
961a8fdb4bcSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
962a8fdb4bcSmrg
963a8fdb4bcSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
964a8fdb4bcSmrg#
965a8fdb4bcSmrg# This file is free software; the Free Software Foundation
966a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
967a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
968a8fdb4bcSmrg
969a8fdb4bcSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
970a8fdb4bcSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
971a8fdb4bcSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
972a8fdb4bcSmrg#
973a8fdb4bcSmrg# Of course, Automake must honor this variable whenever it calls a
974a8fdb4bcSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
975a8fdb4bcSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
976a8fdb4bcSmrg# depending on how configure is run.  This is pretty annoying, since
977a8fdb4bcSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
978a8fdb4bcSmrg# source directory, any form will work fine, but in subdirectories a
979a8fdb4bcSmrg# relative path needs to be adjusted first.
980a8fdb4bcSmrg#
981a8fdb4bcSmrg# $ac_aux_dir/missing
982a8fdb4bcSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
983a8fdb4bcSmrg# $top_srcdir/$ac_aux_dir/missing
984a8fdb4bcSmrg#    fails if $ac_aux_dir is absolute,
985a8fdb4bcSmrg#    fails when called from a subdirectory in a VPATH build with
986a8fdb4bcSmrg#          a relative $ac_aux_dir
987a8fdb4bcSmrg#
988a8fdb4bcSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
989a8fdb4bcSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
990a8fdb4bcSmrg# harmless because $srcdir is `.', but things will broke when you
991a8fdb4bcSmrg# start a VPATH build or use an absolute $srcdir.
992a8fdb4bcSmrg#
993a8fdb4bcSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
994a8fdb4bcSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
995a8fdb4bcSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
996a8fdb4bcSmrg# and then we would define $MISSING as
997a8fdb4bcSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
998a8fdb4bcSmrg# This will work as long as MISSING is not called from configure, because
999a8fdb4bcSmrg# unfortunately $(top_srcdir) has no meaning in configure.
1000a8fdb4bcSmrg# However there are other variables, like CC, which are often used in
1001a8fdb4bcSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1002a8fdb4bcSmrg#
1003a8fdb4bcSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
1004a8fdb4bcSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
1005a8fdb4bcSmrg# configured tree to be moved without reconfiguration.
1006a8fdb4bcSmrg
1007a8fdb4bcSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1008a8fdb4bcSmrg[dnl Rely on autoconf to set up CDPATH properly.
1009a8fdb4bcSmrgAC_PREREQ([2.50])dnl
1010a8fdb4bcSmrg# expand $ac_aux_dir to an absolute path
1011a8fdb4bcSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
1012a8fdb4bcSmrg])
1013a8fdb4bcSmrg
1014a8fdb4bcSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1015a8fdb4bcSmrg
1016dbe7da2eSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1017a8fdb4bcSmrg# Free Software Foundation, Inc.
1018a8fdb4bcSmrg#
1019a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1020a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1021a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1022a8fdb4bcSmrg
1023dbe7da2eSmrg# serial 9
1024a8fdb4bcSmrg
1025a8fdb4bcSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1026a8fdb4bcSmrg# -------------------------------------
1027a8fdb4bcSmrg# Define a conditional.
1028a8fdb4bcSmrgAC_DEFUN([AM_CONDITIONAL],
1029a8fdb4bcSmrg[AC_PREREQ(2.52)dnl
1030a8fdb4bcSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1031a8fdb4bcSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1032a8fdb4bcSmrgAC_SUBST([$1_TRUE])dnl
1033a8fdb4bcSmrgAC_SUBST([$1_FALSE])dnl
1034a8fdb4bcSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1035a8fdb4bcSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1036dbe7da2eSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1037a8fdb4bcSmrgif $2; then
1038a8fdb4bcSmrg  $1_TRUE=
1039a8fdb4bcSmrg  $1_FALSE='#'
1040a8fdb4bcSmrgelse
1041a8fdb4bcSmrg  $1_TRUE='#'
1042a8fdb4bcSmrg  $1_FALSE=
1043a8fdb4bcSmrgfi
1044a8fdb4bcSmrgAC_CONFIG_COMMANDS_PRE(
1045a8fdb4bcSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1046a8fdb4bcSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1047a8fdb4bcSmrgUsually this means the macro was only invoked conditionally.]])
1048a8fdb4bcSmrgfi])])
1049a8fdb4bcSmrg
1050dbe7da2eSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1051a8fdb4bcSmrg# Free Software Foundation, Inc.
1052a8fdb4bcSmrg#
1053a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1054a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1055a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1056a8fdb4bcSmrg
1057dbe7da2eSmrg# serial 10
1058a8fdb4bcSmrg
1059a8fdb4bcSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1060a8fdb4bcSmrg# written in clear, in which case automake, when reading aclocal.m4,
1061a8fdb4bcSmrg# will think it sees a *use*, and therefore will trigger all it's
1062a8fdb4bcSmrg# C support machinery.  Also note that it means that autoscan, seeing
1063a8fdb4bcSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1064a8fdb4bcSmrg
1065a8fdb4bcSmrg
1066a8fdb4bcSmrg# _AM_DEPENDENCIES(NAME)
1067a8fdb4bcSmrg# ----------------------
1068a8fdb4bcSmrg# See how the compiler implements dependency checking.
1069a8fdb4bcSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1070a8fdb4bcSmrg# We try a few techniques and use that to set a single cache variable.
1071a8fdb4bcSmrg#
1072a8fdb4bcSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1073a8fdb4bcSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1074a8fdb4bcSmrg# dependency, and given that the user is not expected to run this macro,
1075a8fdb4bcSmrg# just rely on AC_PROG_CC.
1076a8fdb4bcSmrgAC_DEFUN([_AM_DEPENDENCIES],
1077a8fdb4bcSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1078a8fdb4bcSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1079a8fdb4bcSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1080a8fdb4bcSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1081a8fdb4bcSmrg
1082a8fdb4bcSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1083a8fdb4bcSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1084a8fdb4bcSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1085a8fdb4bcSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1086a8fdb4bcSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1087a8fdb4bcSmrg                   [depcc="$$1"   am_compiler_list=])
1088a8fdb4bcSmrg
1089a8fdb4bcSmrgAC_CACHE_CHECK([dependency style of $depcc],
1090a8fdb4bcSmrg               [am_cv_$1_dependencies_compiler_type],
1091a8fdb4bcSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1092a8fdb4bcSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1093a8fdb4bcSmrg  # making bogus files that we don't know about and never remove.  For
1094a8fdb4bcSmrg  # instance it was reported that on HP-UX the gcc test will end up
1095a8fdb4bcSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1096a8fdb4bcSmrg  # in D'.
1097a8fdb4bcSmrg  mkdir conftest.dir
1098a8fdb4bcSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1099a8fdb4bcSmrg  # using a relative directory.
1100a8fdb4bcSmrg  cp "$am_depcomp" conftest.dir
1101a8fdb4bcSmrg  cd conftest.dir
1102a8fdb4bcSmrg  # We will build objects and dependencies in a subdirectory because
1103a8fdb4bcSmrg  # it helps to detect inapplicable dependency modes.  For instance
1104a8fdb4bcSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1105a8fdb4bcSmrg  # side effect of compilation, but ICC will put the dependencies in
1106a8fdb4bcSmrg  # the current directory while Tru64 will put them in the object
1107a8fdb4bcSmrg  # directory.
1108a8fdb4bcSmrg  mkdir sub
1109a8fdb4bcSmrg
1110a8fdb4bcSmrg  am_cv_$1_dependencies_compiler_type=none
1111a8fdb4bcSmrg  if test "$am_compiler_list" = ""; then
1112a8fdb4bcSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1113a8fdb4bcSmrg  fi
1114dbe7da2eSmrg  am__universal=false
1115dbe7da2eSmrg  m4_case([$1], [CC],
1116dbe7da2eSmrg    [case " $depcc " in #(
1117dbe7da2eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1118dbe7da2eSmrg     esac],
1119dbe7da2eSmrg    [CXX],
1120dbe7da2eSmrg    [case " $depcc " in #(
1121dbe7da2eSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1122dbe7da2eSmrg     esac])
1123dbe7da2eSmrg
1124a8fdb4bcSmrg  for depmode in $am_compiler_list; do
1125a8fdb4bcSmrg    # Setup a source with many dependencies, because some compilers
1126a8fdb4bcSmrg    # like to wrap large dependency lists on column 80 (with \), and
1127a8fdb4bcSmrg    # we should not choose a depcomp mode which is confused by this.
1128a8fdb4bcSmrg    #
1129a8fdb4bcSmrg    # We need to recreate these files for each test, as the compiler may
1130a8fdb4bcSmrg    # overwrite some of them when testing with obscure command lines.
1131a8fdb4bcSmrg    # This happens at least with the AIX C compiler.
1132a8fdb4bcSmrg    : > sub/conftest.c
1133a8fdb4bcSmrg    for i in 1 2 3 4 5 6; do
1134a8fdb4bcSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
1135a8fdb4bcSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1136a8fdb4bcSmrg      # Solaris 8's {/usr,}/bin/sh.
1137a8fdb4bcSmrg      touch sub/conftst$i.h
1138a8fdb4bcSmrg    done
1139a8fdb4bcSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1140a8fdb4bcSmrg
1141dbe7da2eSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
1142dbe7da2eSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
1143dbe7da2eSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
1144dbe7da2eSmrg    # versions had trouble with output in subdirs
1145dbe7da2eSmrg    am__obj=sub/conftest.${OBJEXT-o}
1146dbe7da2eSmrg    am__minus_obj="-o $am__obj"
1147a8fdb4bcSmrg    case $depmode in
1148dbe7da2eSmrg    gcc)
1149dbe7da2eSmrg      # This depmode causes a compiler race in universal mode.
1150dbe7da2eSmrg      test "$am__universal" = false || continue
1151dbe7da2eSmrg      ;;
1152a8fdb4bcSmrg    nosideeffect)
1153a8fdb4bcSmrg      # after this tag, mechanisms are not by side-effect, so they'll
1154a8fdb4bcSmrg      # only be used when explicitly requested
1155a8fdb4bcSmrg      if test "x$enable_dependency_tracking" = xyes; then
1156a8fdb4bcSmrg	continue
1157a8fdb4bcSmrg      else
1158a8fdb4bcSmrg	break
1159a8fdb4bcSmrg      fi
1160a8fdb4bcSmrg      ;;
1161dbe7da2eSmrg    msvisualcpp | msvcmsys)
1162dbe7da2eSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
1163dbe7da2eSmrg      # not run yet.  These depmodes are late enough in the game, and
1164dbe7da2eSmrg      # so weak that their functioning should not be impacted.
1165dbe7da2eSmrg      am__obj=conftest.${OBJEXT-o}
1166dbe7da2eSmrg      am__minus_obj=
1167dbe7da2eSmrg      ;;
1168a8fdb4bcSmrg    none) break ;;
1169a8fdb4bcSmrg    esac
1170a8fdb4bcSmrg    if depmode=$depmode \
1171dbe7da2eSmrg       source=sub/conftest.c object=$am__obj \
1172a8fdb4bcSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1173dbe7da2eSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1174a8fdb4bcSmrg         >/dev/null 2>conftest.err &&
1175a8fdb4bcSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1176a8fdb4bcSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1177dbe7da2eSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1178a8fdb4bcSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1179a8fdb4bcSmrg      # icc doesn't choke on unknown options, it will just issue warnings
1180a8fdb4bcSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
1181a8fdb4bcSmrg      # that says an option was ignored or not supported.
1182a8fdb4bcSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
1183a8fdb4bcSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
1184a8fdb4bcSmrg      # The diagnosis changed in icc 8.0:
1185a8fdb4bcSmrg      #   icc: Command line remark: option '-MP' not supported
1186a8fdb4bcSmrg      if (grep 'ignoring option' conftest.err ||
1187a8fdb4bcSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1188a8fdb4bcSmrg        am_cv_$1_dependencies_compiler_type=$depmode
1189a8fdb4bcSmrg        break
1190a8fdb4bcSmrg      fi
1191a8fdb4bcSmrg    fi
1192a8fdb4bcSmrg  done
1193a8fdb4bcSmrg
1194a8fdb4bcSmrg  cd ..
1195a8fdb4bcSmrg  rm -rf conftest.dir
1196a8fdb4bcSmrgelse
1197a8fdb4bcSmrg  am_cv_$1_dependencies_compiler_type=none
1198a8fdb4bcSmrgfi
1199a8fdb4bcSmrg])
1200a8fdb4bcSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1201a8fdb4bcSmrgAM_CONDITIONAL([am__fastdep$1], [
1202a8fdb4bcSmrg  test "x$enable_dependency_tracking" != xno \
1203a8fdb4bcSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1204a8fdb4bcSmrg])
1205a8fdb4bcSmrg
1206a8fdb4bcSmrg
1207a8fdb4bcSmrg# AM_SET_DEPDIR
1208a8fdb4bcSmrg# -------------
1209a8fdb4bcSmrg# Choose a directory name for dependency files.
1210a8fdb4bcSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
1211a8fdb4bcSmrgAC_DEFUN([AM_SET_DEPDIR],
1212a8fdb4bcSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1213a8fdb4bcSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1214a8fdb4bcSmrg])
1215a8fdb4bcSmrg
1216a8fdb4bcSmrg
1217a8fdb4bcSmrg# AM_DEP_TRACK
1218a8fdb4bcSmrg# ------------
1219a8fdb4bcSmrgAC_DEFUN([AM_DEP_TRACK],
1220a8fdb4bcSmrg[AC_ARG_ENABLE(dependency-tracking,
1221a8fdb4bcSmrg[  --disable-dependency-tracking  speeds up one-time build
1222a8fdb4bcSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
1223a8fdb4bcSmrgif test "x$enable_dependency_tracking" != xno; then
1224a8fdb4bcSmrg  am_depcomp="$ac_aux_dir/depcomp"
1225a8fdb4bcSmrg  AMDEPBACKSLASH='\'
1226a8fdb4bcSmrgfi
1227a8fdb4bcSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1228a8fdb4bcSmrgAC_SUBST([AMDEPBACKSLASH])dnl
1229a8fdb4bcSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1230a8fdb4bcSmrg])
1231a8fdb4bcSmrg
1232a8fdb4bcSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
1233a8fdb4bcSmrg
1234dbe7da2eSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1235a8fdb4bcSmrg# Free Software Foundation, Inc.
1236a8fdb4bcSmrg#
1237a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1238a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1239a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1240a8fdb4bcSmrg
1241dbe7da2eSmrg#serial 5
1242a8fdb4bcSmrg
1243a8fdb4bcSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
1244a8fdb4bcSmrg# ------------------------------
1245a8fdb4bcSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1246dbe7da2eSmrg[{
1247dbe7da2eSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
1248dbe7da2eSmrg  # are listed without --file.  Let's play safe and only enable the eval
1249dbe7da2eSmrg  # if we detect the quoting.
1250dbe7da2eSmrg  case $CONFIG_FILES in
1251dbe7da2eSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
1252dbe7da2eSmrg  *)   set x $CONFIG_FILES ;;
1253dbe7da2eSmrg  esac
1254dbe7da2eSmrg  shift
1255dbe7da2eSmrg  for mf
1256dbe7da2eSmrg  do
1257dbe7da2eSmrg    # Strip MF so we end up with the name of the file.
1258dbe7da2eSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
1259dbe7da2eSmrg    # Check whether this is an Automake generated Makefile or not.
1260dbe7da2eSmrg    # We used to match only the files named `Makefile.in', but
1261dbe7da2eSmrg    # some people rename them; so instead we look at the file content.
1262dbe7da2eSmrg    # Grep'ing the first line is not enough: some people post-process
1263dbe7da2eSmrg    # each Makefile.in and add a new line on top of each file to say so.
1264dbe7da2eSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
1265dbe7da2eSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
1266dbe7da2eSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1267dbe7da2eSmrg      dirpart=`AS_DIRNAME("$mf")`
1268dbe7da2eSmrg    else
1269dbe7da2eSmrg      continue
1270dbe7da2eSmrg    fi
1271dbe7da2eSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
1272dbe7da2eSmrg    # from the Makefile without running `make'.
1273dbe7da2eSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1274dbe7da2eSmrg    test -z "$DEPDIR" && continue
1275dbe7da2eSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
1276dbe7da2eSmrg    test -z "am__include" && continue
1277dbe7da2eSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1278dbe7da2eSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
1279dbe7da2eSmrg    U=`sed -n 's/^U = //p' < "$mf"`
1280dbe7da2eSmrg    # Find all dependency output files, they are included files with
1281dbe7da2eSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
1282dbe7da2eSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
1283dbe7da2eSmrg    # expansion.
1284dbe7da2eSmrg    for file in `sed -n "
1285dbe7da2eSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1286dbe7da2eSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1287dbe7da2eSmrg      # Make sure the directory exists.
1288dbe7da2eSmrg      test -f "$dirpart/$file" && continue
1289dbe7da2eSmrg      fdir=`AS_DIRNAME(["$file"])`
1290dbe7da2eSmrg      AS_MKDIR_P([$dirpart/$fdir])
1291dbe7da2eSmrg      # echo "creating $dirpart/$file"
1292dbe7da2eSmrg      echo '# dummy' > "$dirpart/$file"
1293dbe7da2eSmrg    done
1294a8fdb4bcSmrg  done
1295dbe7da2eSmrg}
1296a8fdb4bcSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1297a8fdb4bcSmrg
1298a8fdb4bcSmrg
1299a8fdb4bcSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
1300a8fdb4bcSmrg# -----------------------------
1301a8fdb4bcSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
1302a8fdb4bcSmrg#
1303a8fdb4bcSmrg# This code is only required when automatic dependency tracking
1304a8fdb4bcSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
1305a8fdb4bcSmrg# need in order to bootstrap the dependency handling code.
1306a8fdb4bcSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1307a8fdb4bcSmrg[AC_CONFIG_COMMANDS([depfiles],
1308a8fdb4bcSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1309a8fdb4bcSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1310a8fdb4bcSmrg])
1311a8fdb4bcSmrg
1312a8fdb4bcSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1313a8fdb4bcSmrg# Free Software Foundation, Inc.
1314a8fdb4bcSmrg#
1315a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1316a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1317a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1318a8fdb4bcSmrg
1319a8fdb4bcSmrg# serial 8
1320a8fdb4bcSmrg
1321a8fdb4bcSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
1322a8fdb4bcSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1323a8fdb4bcSmrg
1324a8fdb4bcSmrg# Do all the work for Automake.                             -*- Autoconf -*-
1325a8fdb4bcSmrg
1326a8fdb4bcSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1327dbe7da2eSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1328a8fdb4bcSmrg#
1329a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1330a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1331a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1332a8fdb4bcSmrg
1333dbe7da2eSmrg# serial 16
1334a8fdb4bcSmrg
1335a8fdb4bcSmrg# This macro actually does too much.  Some checks are only needed if
1336a8fdb4bcSmrg# your package does certain things.  But this isn't really a big deal.
1337a8fdb4bcSmrg
1338a8fdb4bcSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1339a8fdb4bcSmrg# AM_INIT_AUTOMAKE([OPTIONS])
1340a8fdb4bcSmrg# -----------------------------------------------
1341a8fdb4bcSmrg# The call with PACKAGE and VERSION arguments is the old style
1342a8fdb4bcSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
1343a8fdb4bcSmrg# and VERSION should now be passed to AC_INIT and removed from
1344a8fdb4bcSmrg# the call to AM_INIT_AUTOMAKE.
1345a8fdb4bcSmrg# We support both call styles for the transition.  After
1346a8fdb4bcSmrg# the next Automake release, Autoconf can make the AC_INIT
1347a8fdb4bcSmrg# arguments mandatory, and then we can depend on a new Autoconf
1348a8fdb4bcSmrg# release and drop the old call support.
1349a8fdb4bcSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
1350dbe7da2eSmrg[AC_PREREQ([2.62])dnl
1351a8fdb4bcSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
1352a8fdb4bcSmrgdnl the ones we care about.
1353a8fdb4bcSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1354a8fdb4bcSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1355a8fdb4bcSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
1356a8fdb4bcSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
1357a8fdb4bcSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1358a8fdb4bcSmrg  # is not polluted with repeated "-I."
1359a8fdb4bcSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1360a8fdb4bcSmrg  # test to see if srcdir already configured
1361a8fdb4bcSmrg  if test -f $srcdir/config.status; then
1362a8fdb4bcSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1363a8fdb4bcSmrg  fi
1364a8fdb4bcSmrgfi
1365a8fdb4bcSmrg
1366a8fdb4bcSmrg# test whether we have cygpath
1367a8fdb4bcSmrgif test -z "$CYGPATH_W"; then
1368a8fdb4bcSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
1369a8fdb4bcSmrg    CYGPATH_W='cygpath -w'
1370a8fdb4bcSmrg  else
1371a8fdb4bcSmrg    CYGPATH_W=echo
1372a8fdb4bcSmrg  fi
1373a8fdb4bcSmrgfi
1374a8fdb4bcSmrgAC_SUBST([CYGPATH_W])
1375a8fdb4bcSmrg
1376a8fdb4bcSmrg# Define the identity of the package.
1377a8fdb4bcSmrgdnl Distinguish between old-style and new-style calls.
1378a8fdb4bcSmrgm4_ifval([$2],
1379a8fdb4bcSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1380a8fdb4bcSmrg AC_SUBST([PACKAGE], [$1])dnl
1381a8fdb4bcSmrg AC_SUBST([VERSION], [$2])],
1382a8fdb4bcSmrg[_AM_SET_OPTIONS([$1])dnl
1383a8fdb4bcSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1384a8fdb4bcSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1385a8fdb4bcSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1386a8fdb4bcSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1387a8fdb4bcSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1388a8fdb4bcSmrg
1389a8fdb4bcSmrg_AM_IF_OPTION([no-define],,
1390a8fdb4bcSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1391a8fdb4bcSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1392a8fdb4bcSmrg
1393a8fdb4bcSmrg# Some tools Automake needs.
1394a8fdb4bcSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
1395a8fdb4bcSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
1396a8fdb4bcSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1397a8fdb4bcSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
1398a8fdb4bcSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1399a8fdb4bcSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
1400a8fdb4bcSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
1401dbe7da2eSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1402dbe7da2eSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1403a8fdb4bcSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
1404a8fdb4bcSmrg# We need awk for the "check" target.  The system "awk" is bad on
1405a8fdb4bcSmrg# some platforms.
1406a8fdb4bcSmrgAC_REQUIRE([AC_PROG_AWK])dnl
1407a8fdb4bcSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
1408a8fdb4bcSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
1409a8fdb4bcSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1410dbe7da2eSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1411dbe7da2eSmrg			     [_AM_PROG_TAR([v7])])])
1412a8fdb4bcSmrg_AM_IF_OPTION([no-dependencies],,
1413a8fdb4bcSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
1414dbe7da2eSmrg		  [_AM_DEPENDENCIES(CC)],
1415dbe7da2eSmrg		  [define([AC_PROG_CC],
1416dbe7da2eSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1417a8fdb4bcSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
1418dbe7da2eSmrg		  [_AM_DEPENDENCIES(CXX)],
1419dbe7da2eSmrg		  [define([AC_PROG_CXX],
1420dbe7da2eSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1421a8fdb4bcSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
1422dbe7da2eSmrg		  [_AM_DEPENDENCIES(OBJC)],
1423dbe7da2eSmrg		  [define([AC_PROG_OBJC],
1424dbe7da2eSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1425a8fdb4bcSmrg])
1426dbe7da2eSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1427dbe7da2eSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
1428dbe7da2eSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
1429dbe7da2eSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
1430dbe7da2eSmrgAC_CONFIG_COMMANDS_PRE(dnl
1431dbe7da2eSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
1432dbe7da2eSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1433a8fdb4bcSmrg])
1434a8fdb4bcSmrg
1435dbe7da2eSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
1436dbe7da2eSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1437dbe7da2eSmrgdnl mangled by Autoconf and run in a shell conditional statement.
1438dbe7da2eSmrgm4_define([_AC_COMPILER_EXEEXT],
1439dbe7da2eSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1440dbe7da2eSmrg
1441a8fdb4bcSmrg
1442a8fdb4bcSmrg# When config.status generates a header, we must update the stamp-h file.
1443a8fdb4bcSmrg# This file resides in the same directory as the config header
1444a8fdb4bcSmrg# that is generated.  The stamp files are numbered to have different names.
1445a8fdb4bcSmrg
1446a8fdb4bcSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1447a8fdb4bcSmrg# loop where config.status creates the headers, so we can generate
1448a8fdb4bcSmrg# our stamp files there.
1449a8fdb4bcSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1450a8fdb4bcSmrg[# Compute $1's index in $config_headers.
1451a8fdb4bcSmrg_am_arg=$1
1452a8fdb4bcSmrg_am_stamp_count=1
1453a8fdb4bcSmrgfor _am_header in $config_headers :; do
1454a8fdb4bcSmrg  case $_am_header in
1455a8fdb4bcSmrg    $_am_arg | $_am_arg:* )
1456a8fdb4bcSmrg      break ;;
1457a8fdb4bcSmrg    * )
1458a8fdb4bcSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1459a8fdb4bcSmrg  esac
1460a8fdb4bcSmrgdone
1461a8fdb4bcSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1462a8fdb4bcSmrg
1463dbe7da2eSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
1464a8fdb4bcSmrg#
1465a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1466a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1467a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1468a8fdb4bcSmrg
1469a8fdb4bcSmrg# AM_PROG_INSTALL_SH
1470a8fdb4bcSmrg# ------------------
1471a8fdb4bcSmrg# Define $install_sh.
1472a8fdb4bcSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
1473a8fdb4bcSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1474dbe7da2eSmrgif test x"${install_sh}" != xset; then
1475dbe7da2eSmrg  case $am_aux_dir in
1476dbe7da2eSmrg  *\ * | *\	*)
1477dbe7da2eSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1478dbe7da2eSmrg  *)
1479dbe7da2eSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
1480dbe7da2eSmrg  esac
1481dbe7da2eSmrgfi
1482a8fdb4bcSmrgAC_SUBST(install_sh)])
1483a8fdb4bcSmrg
1484a8fdb4bcSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1485a8fdb4bcSmrg#
1486a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1487a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1488a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1489a8fdb4bcSmrg
1490a8fdb4bcSmrg# serial 2
1491a8fdb4bcSmrg
1492a8fdb4bcSmrg# Check whether the underlying file-system supports filenames
1493a8fdb4bcSmrg# with a leading dot.  For instance MS-DOS doesn't.
1494a8fdb4bcSmrgAC_DEFUN([AM_SET_LEADING_DOT],
1495a8fdb4bcSmrg[rm -rf .tst 2>/dev/null
1496a8fdb4bcSmrgmkdir .tst 2>/dev/null
1497a8fdb4bcSmrgif test -d .tst; then
1498a8fdb4bcSmrg  am__leading_dot=.
1499a8fdb4bcSmrgelse
1500a8fdb4bcSmrg  am__leading_dot=_
1501a8fdb4bcSmrgfi
1502a8fdb4bcSmrgrmdir .tst 2>/dev/null
1503a8fdb4bcSmrgAC_SUBST([am__leading_dot])])
1504a8fdb4bcSmrg
1505a8fdb4bcSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
1506a8fdb4bcSmrg# From Jim Meyering
1507a8fdb4bcSmrg
1508dbe7da2eSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1509a8fdb4bcSmrg# Free Software Foundation, Inc.
1510a8fdb4bcSmrg#
1511a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1512a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1513a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1514a8fdb4bcSmrg
1515dbe7da2eSmrg# serial 5
1516a8fdb4bcSmrg
1517dbe7da2eSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
1518dbe7da2eSmrg# ----------------------------------
1519dbe7da2eSmrg# Control maintainer-specific portions of Makefiles.
1520dbe7da2eSmrg# Default is to disable them, unless `enable' is passed literally.
1521dbe7da2eSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
1522dbe7da2eSmrg# can override the default with the --enable/--disable switch.
1523a8fdb4bcSmrgAC_DEFUN([AM_MAINTAINER_MODE],
1524dbe7da2eSmrg[m4_case(m4_default([$1], [disable]),
1525dbe7da2eSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
1526dbe7da2eSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
1527dbe7da2eSmrg       [m4_define([am_maintainer_other], [enable])
1528dbe7da2eSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
1529dbe7da2eSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
1530dbe7da2eSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
1531dbe7da2eSmrg  AC_ARG_ENABLE([maintainer-mode],
1532dbe7da2eSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
1533a8fdb4bcSmrg			  (and sometimes confusing) to the casual installer],
1534dbe7da2eSmrg      [USE_MAINTAINER_MODE=$enableval],
1535dbe7da2eSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
1536a8fdb4bcSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1537dbe7da2eSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
1538a8fdb4bcSmrg  MAINT=$MAINTAINER_MODE_TRUE
1539dbe7da2eSmrg  AC_SUBST([MAINT])dnl
1540a8fdb4bcSmrg]
1541a8fdb4bcSmrg)
1542a8fdb4bcSmrg
1543a8fdb4bcSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
1544a8fdb4bcSmrg
1545a8fdb4bcSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1546a8fdb4bcSmrg
1547dbe7da2eSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
1548a8fdb4bcSmrg#
1549a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1550a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1551a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1552a8fdb4bcSmrg
1553dbe7da2eSmrg# serial 4
1554a8fdb4bcSmrg
1555a8fdb4bcSmrg# AM_MAKE_INCLUDE()
1556a8fdb4bcSmrg# -----------------
1557a8fdb4bcSmrg# Check to see how make treats includes.
1558a8fdb4bcSmrgAC_DEFUN([AM_MAKE_INCLUDE],
1559a8fdb4bcSmrg[am_make=${MAKE-make}
1560a8fdb4bcSmrgcat > confinc << 'END'
1561a8fdb4bcSmrgam__doit:
1562dbe7da2eSmrg	@echo this is the am__doit target
1563a8fdb4bcSmrg.PHONY: am__doit
1564a8fdb4bcSmrgEND
1565a8fdb4bcSmrg# If we don't find an include directive, just comment out the code.
1566a8fdb4bcSmrgAC_MSG_CHECKING([for style of include used by $am_make])
1567a8fdb4bcSmrgam__include="#"
1568a8fdb4bcSmrgam__quote=
1569a8fdb4bcSmrg_am_result=none
1570a8fdb4bcSmrg# First try GNU make style include.
1571a8fdb4bcSmrgecho "include confinc" > confmf
1572dbe7da2eSmrg# Ignore all kinds of additional output from `make'.
1573dbe7da2eSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
1574dbe7da2eSmrg*the\ am__doit\ target*)
1575dbe7da2eSmrg  am__include=include
1576dbe7da2eSmrg  am__quote=
1577dbe7da2eSmrg  _am_result=GNU
1578dbe7da2eSmrg  ;;
1579dbe7da2eSmrgesac
1580a8fdb4bcSmrg# Now try BSD make style include.
1581a8fdb4bcSmrgif test "$am__include" = "#"; then
1582a8fdb4bcSmrg   echo '.include "confinc"' > confmf
1583dbe7da2eSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
1584dbe7da2eSmrg   *the\ am__doit\ target*)
1585dbe7da2eSmrg     am__include=.include
1586dbe7da2eSmrg     am__quote="\""
1587dbe7da2eSmrg     _am_result=BSD
1588dbe7da2eSmrg     ;;
1589dbe7da2eSmrg   esac
1590a8fdb4bcSmrgfi
1591a8fdb4bcSmrgAC_SUBST([am__include])
1592a8fdb4bcSmrgAC_SUBST([am__quote])
1593a8fdb4bcSmrgAC_MSG_RESULT([$_am_result])
1594a8fdb4bcSmrgrm -f confinc confmf
1595a8fdb4bcSmrg])
1596a8fdb4bcSmrg
1597a8fdb4bcSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1598a8fdb4bcSmrg
1599dbe7da2eSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
1600a8fdb4bcSmrg# Free Software Foundation, Inc.
1601a8fdb4bcSmrg#
1602a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1603a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1604a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1605a8fdb4bcSmrg
1606dbe7da2eSmrg# serial 6
1607a8fdb4bcSmrg
1608a8fdb4bcSmrg# AM_MISSING_PROG(NAME, PROGRAM)
1609a8fdb4bcSmrg# ------------------------------
1610a8fdb4bcSmrgAC_DEFUN([AM_MISSING_PROG],
1611a8fdb4bcSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
1612a8fdb4bcSmrg$1=${$1-"${am_missing_run}$2"}
1613a8fdb4bcSmrgAC_SUBST($1)])
1614a8fdb4bcSmrg
1615a8fdb4bcSmrg
1616a8fdb4bcSmrg# AM_MISSING_HAS_RUN
1617a8fdb4bcSmrg# ------------------
1618a8fdb4bcSmrg# Define MISSING if not defined so far and test if it supports --run.
1619a8fdb4bcSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
1620a8fdb4bcSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
1621a8fdb4bcSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1622a8fdb4bcSmrgAC_REQUIRE_AUX_FILE([missing])dnl
1623dbe7da2eSmrgif test x"${MISSING+set}" != xset; then
1624dbe7da2eSmrg  case $am_aux_dir in
1625dbe7da2eSmrg  *\ * | *\	*)
1626dbe7da2eSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1627dbe7da2eSmrg  *)
1628dbe7da2eSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
1629dbe7da2eSmrg  esac
1630dbe7da2eSmrgfi
1631a8fdb4bcSmrg# Use eval to expand $SHELL
1632a8fdb4bcSmrgif eval "$MISSING --run true"; then
1633a8fdb4bcSmrg  am_missing_run="$MISSING --run "
1634a8fdb4bcSmrgelse
1635a8fdb4bcSmrg  am_missing_run=
1636a8fdb4bcSmrg  AC_MSG_WARN([`missing' script is too old or missing])
1637a8fdb4bcSmrgfi
1638a8fdb4bcSmrg])
1639a8fdb4bcSmrg
1640a8fdb4bcSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
1641a8fdb4bcSmrg#
1642a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1643a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1644a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1645a8fdb4bcSmrg
1646a8fdb4bcSmrg# AM_PROG_MKDIR_P
1647a8fdb4bcSmrg# ---------------
1648a8fdb4bcSmrg# Check for `mkdir -p'.
1649a8fdb4bcSmrgAC_DEFUN([AM_PROG_MKDIR_P],
1650a8fdb4bcSmrg[AC_PREREQ([2.60])dnl
1651a8fdb4bcSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
1652a8fdb4bcSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1653a8fdb4bcSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
1654a8fdb4bcSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1655a8fdb4bcSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1656a8fdb4bcSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
1657a8fdb4bcSmrgdnl adjustment using top_builddir (which is defined more often than
1658a8fdb4bcSmrgdnl MKDIR_P).
1659a8fdb4bcSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1660a8fdb4bcSmrgcase $mkdir_p in
1661a8fdb4bcSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
1662a8fdb4bcSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1663a8fdb4bcSmrgesac
1664a8fdb4bcSmrg])
1665a8fdb4bcSmrg
1666a8fdb4bcSmrg# Helper functions for option handling.                     -*- Autoconf -*-
1667a8fdb4bcSmrg
1668dbe7da2eSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
1669a8fdb4bcSmrg#
1670a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1671a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1672a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1673a8fdb4bcSmrg
1674dbe7da2eSmrg# serial 4
1675a8fdb4bcSmrg
1676a8fdb4bcSmrg# _AM_MANGLE_OPTION(NAME)
1677a8fdb4bcSmrg# -----------------------
1678a8fdb4bcSmrgAC_DEFUN([_AM_MANGLE_OPTION],
1679a8fdb4bcSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1680a8fdb4bcSmrg
1681a8fdb4bcSmrg# _AM_SET_OPTION(NAME)
1682a8fdb4bcSmrg# ------------------------------
1683a8fdb4bcSmrg# Set option NAME.  Presently that only means defining a flag for this option.
1684a8fdb4bcSmrgAC_DEFUN([_AM_SET_OPTION],
1685a8fdb4bcSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1686a8fdb4bcSmrg
1687a8fdb4bcSmrg# _AM_SET_OPTIONS(OPTIONS)
1688a8fdb4bcSmrg# ----------------------------------
1689a8fdb4bcSmrg# OPTIONS is a space-separated list of Automake options.
1690a8fdb4bcSmrgAC_DEFUN([_AM_SET_OPTIONS],
1691dbe7da2eSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1692a8fdb4bcSmrg
1693a8fdb4bcSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1694a8fdb4bcSmrg# -------------------------------------------
1695a8fdb4bcSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1696a8fdb4bcSmrgAC_DEFUN([_AM_IF_OPTION],
1697a8fdb4bcSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1698a8fdb4bcSmrg
1699a8fdb4bcSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
1700a8fdb4bcSmrg
1701dbe7da2eSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
1702a8fdb4bcSmrg# Free Software Foundation, Inc.
1703a8fdb4bcSmrg#
1704a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1705a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1706a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1707a8fdb4bcSmrg
1708dbe7da2eSmrg# serial 5
1709a8fdb4bcSmrg
1710a8fdb4bcSmrg# AM_SANITY_CHECK
1711a8fdb4bcSmrg# ---------------
1712a8fdb4bcSmrgAC_DEFUN([AM_SANITY_CHECK],
1713a8fdb4bcSmrg[AC_MSG_CHECKING([whether build environment is sane])
1714a8fdb4bcSmrg# Just in case
1715a8fdb4bcSmrgsleep 1
1716a8fdb4bcSmrgecho timestamp > conftest.file
1717dbe7da2eSmrg# Reject unsafe characters in $srcdir or the absolute working directory
1718dbe7da2eSmrg# name.  Accept space and tab only in the latter.
1719dbe7da2eSmrgam_lf='
1720dbe7da2eSmrg'
1721dbe7da2eSmrgcase `pwd` in
1722dbe7da2eSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
1723dbe7da2eSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
1724dbe7da2eSmrgesac
1725dbe7da2eSmrgcase $srcdir in
1726dbe7da2eSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
1727dbe7da2eSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
1728dbe7da2eSmrgesac
1729dbe7da2eSmrg
1730a8fdb4bcSmrg# Do `set' in a subshell so we don't clobber the current shell's
1731a8fdb4bcSmrg# arguments.  Must try -L first in case configure is actually a
1732a8fdb4bcSmrg# symlink; some systems play weird games with the mod time of symlinks
1733a8fdb4bcSmrg# (eg FreeBSD returns the mod time of the symlink's containing
1734a8fdb4bcSmrg# directory).
1735a8fdb4bcSmrgif (
1736dbe7da2eSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1737a8fdb4bcSmrg   if test "$[*]" = "X"; then
1738a8fdb4bcSmrg      # -L didn't work.
1739dbe7da2eSmrg      set X `ls -t "$srcdir/configure" conftest.file`
1740a8fdb4bcSmrg   fi
1741a8fdb4bcSmrg   rm -f conftest.file
1742a8fdb4bcSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
1743a8fdb4bcSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
1744a8fdb4bcSmrg
1745a8fdb4bcSmrg      # If neither matched, then we have a broken ls.  This can happen
1746a8fdb4bcSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
1747a8fdb4bcSmrg      # broken ls alias from the environment.  This has actually
1748a8fdb4bcSmrg      # happened.  Such a system could not be considered "sane".
1749a8fdb4bcSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1750a8fdb4bcSmrgalias in your environment])
1751a8fdb4bcSmrg   fi
1752a8fdb4bcSmrg
1753a8fdb4bcSmrg   test "$[2]" = conftest.file
1754a8fdb4bcSmrg   )
1755a8fdb4bcSmrgthen
1756a8fdb4bcSmrg   # Ok.
1757a8fdb4bcSmrg   :
1758a8fdb4bcSmrgelse
1759a8fdb4bcSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
1760a8fdb4bcSmrgCheck your system clock])
1761a8fdb4bcSmrgfi
1762a8fdb4bcSmrgAC_MSG_RESULT(yes)])
1763a8fdb4bcSmrg
1764dbe7da2eSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
1765dbe7da2eSmrg#
1766dbe7da2eSmrg# This file is free software; the Free Software Foundation
1767dbe7da2eSmrg# gives unlimited permission to copy and/or distribute it,
1768dbe7da2eSmrg# with or without modifications, as long as this notice is preserved.
1769dbe7da2eSmrg
1770dbe7da2eSmrg# serial 1
1771dbe7da2eSmrg
1772dbe7da2eSmrg# AM_SILENT_RULES([DEFAULT])
1773dbe7da2eSmrg# --------------------------
1774dbe7da2eSmrg# Enable less verbose build rules; with the default set to DEFAULT
1775dbe7da2eSmrg# (`yes' being less verbose, `no' or empty being verbose).
1776dbe7da2eSmrgAC_DEFUN([AM_SILENT_RULES],
1777dbe7da2eSmrg[AC_ARG_ENABLE([silent-rules],
1778dbe7da2eSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
1779dbe7da2eSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
1780dbe7da2eSmrgcase $enable_silent_rules in
1781dbe7da2eSmrgyes) AM_DEFAULT_VERBOSITY=0;;
1782dbe7da2eSmrgno)  AM_DEFAULT_VERBOSITY=1;;
1783dbe7da2eSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1784dbe7da2eSmrgesac
1785dbe7da2eSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1786dbe7da2eSmrgAM_BACKSLASH='\'
1787dbe7da2eSmrgAC_SUBST([AM_BACKSLASH])dnl
1788dbe7da2eSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1789dbe7da2eSmrg])
1790dbe7da2eSmrg
1791a8fdb4bcSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1792a8fdb4bcSmrg#
1793a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1794a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1795a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1796a8fdb4bcSmrg
1797a8fdb4bcSmrg# AM_PROG_INSTALL_STRIP
1798a8fdb4bcSmrg# ---------------------
1799a8fdb4bcSmrg# One issue with vendor `install' (even GNU) is that you can't
1800a8fdb4bcSmrg# specify the program used to strip binaries.  This is especially
1801a8fdb4bcSmrg# annoying in cross-compiling environments, where the build's strip
1802a8fdb4bcSmrg# is unlikely to handle the host's binaries.
1803a8fdb4bcSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
1804a8fdb4bcSmrg# always use install-sh in `make install-strip', and initialize
1805a8fdb4bcSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
1806a8fdb4bcSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
1807a8fdb4bcSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1808a8fdb4bcSmrg# Installed binaries are usually stripped using `strip' when the user
1809a8fdb4bcSmrg# run `make install-strip'.  However `strip' might not be the right
1810a8fdb4bcSmrg# tool to use in cross-compilation environments, therefore Automake
1811a8fdb4bcSmrg# will honor the `STRIP' environment variable to overrule this program.
1812a8fdb4bcSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1813a8fdb4bcSmrgif test "$cross_compiling" != no; then
1814a8fdb4bcSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
1815a8fdb4bcSmrgfi
1816a8fdb4bcSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1817a8fdb4bcSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1818a8fdb4bcSmrg
1819dbe7da2eSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
1820a8fdb4bcSmrg#
1821a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1822a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1823a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1824a8fdb4bcSmrg
1825dbe7da2eSmrg# serial 2
1826dbe7da2eSmrg
1827a8fdb4bcSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
1828a8fdb4bcSmrg# ---------------------------
1829a8fdb4bcSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1830a8fdb4bcSmrg# This macro is traced by Automake.
1831a8fdb4bcSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1832a8fdb4bcSmrg
1833dbe7da2eSmrg# AM_SUBST_NOTMAKE(VARIABLE)
1834dbe7da2eSmrg# ---------------------------
1835dbe7da2eSmrg# Public sister of _AM_SUBST_NOTMAKE.
1836dbe7da2eSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1837dbe7da2eSmrg
1838a8fdb4bcSmrg# Check how to create a tarball.                            -*- Autoconf -*-
1839a8fdb4bcSmrg
1840a8fdb4bcSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1841a8fdb4bcSmrg#
1842a8fdb4bcSmrg# This file is free software; the Free Software Foundation
1843a8fdb4bcSmrg# gives unlimited permission to copy and/or distribute it,
1844a8fdb4bcSmrg# with or without modifications, as long as this notice is preserved.
1845a8fdb4bcSmrg
1846a8fdb4bcSmrg# serial 2
1847a8fdb4bcSmrg
1848a8fdb4bcSmrg# _AM_PROG_TAR(FORMAT)
1849a8fdb4bcSmrg# --------------------
1850a8fdb4bcSmrg# Check how to create a tarball in format FORMAT.
1851a8fdb4bcSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
1852a8fdb4bcSmrg#
1853a8fdb4bcSmrg# Substitute a variable $(am__tar) that is a command
1854a8fdb4bcSmrg# writing to stdout a FORMAT-tarball containing the directory
1855a8fdb4bcSmrg# $tardir.
1856a8fdb4bcSmrg#     tardir=directory && $(am__tar) > result.tar
1857a8fdb4bcSmrg#
1858a8fdb4bcSmrg# Substitute a variable $(am__untar) that extract such
1859a8fdb4bcSmrg# a tarball read from stdin.
1860a8fdb4bcSmrg#     $(am__untar) < result.tar
1861a8fdb4bcSmrgAC_DEFUN([_AM_PROG_TAR],
1862a8fdb4bcSmrg[# Always define AMTAR for backward compatibility.
1863a8fdb4bcSmrgAM_MISSING_PROG([AMTAR], [tar])
1864a8fdb4bcSmrgm4_if([$1], [v7],
1865a8fdb4bcSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1866a8fdb4bcSmrg     [m4_case([$1], [ustar],, [pax],,
1867a8fdb4bcSmrg              [m4_fatal([Unknown tar format])])
1868a8fdb4bcSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
1869a8fdb4bcSmrg# Loop over all known methods to create a tar archive until one works.
1870a8fdb4bcSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1871a8fdb4bcSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1872a8fdb4bcSmrg# Do not fold the above two line into one, because Tru64 sh and
1873a8fdb4bcSmrg# Solaris sh will not grok spaces in the rhs of `-'.
1874a8fdb4bcSmrgfor _am_tool in $_am_tools
1875a8fdb4bcSmrgdo
1876a8fdb4bcSmrg  case $_am_tool in
1877a8fdb4bcSmrg  gnutar)
1878a8fdb4bcSmrg    for _am_tar in tar gnutar gtar;
1879a8fdb4bcSmrg    do
1880a8fdb4bcSmrg      AM_RUN_LOG([$_am_tar --version]) && break
1881a8fdb4bcSmrg    done
1882a8fdb4bcSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1883a8fdb4bcSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1884a8fdb4bcSmrg    am__untar="$_am_tar -xf -"
1885a8fdb4bcSmrg    ;;
1886a8fdb4bcSmrg  plaintar)
1887a8fdb4bcSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
1888a8fdb4bcSmrg    # ustar tarball either.
1889a8fdb4bcSmrg    (tar --version) >/dev/null 2>&1 && continue
1890a8fdb4bcSmrg    am__tar='tar chf - "$$tardir"'
1891a8fdb4bcSmrg    am__tar_='tar chf - "$tardir"'
1892a8fdb4bcSmrg    am__untar='tar xf -'
1893a8fdb4bcSmrg    ;;
1894a8fdb4bcSmrg  pax)
1895a8fdb4bcSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
1896a8fdb4bcSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
1897a8fdb4bcSmrg    am__untar='pax -r'
1898a8fdb4bcSmrg    ;;
1899a8fdb4bcSmrg  cpio)
1900a8fdb4bcSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1901a8fdb4bcSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1902a8fdb4bcSmrg    am__untar='cpio -i -H $1 -d'
1903a8fdb4bcSmrg    ;;
1904a8fdb4bcSmrg  none)
1905a8fdb4bcSmrg    am__tar=false
1906a8fdb4bcSmrg    am__tar_=false
1907a8fdb4bcSmrg    am__untar=false
1908a8fdb4bcSmrg    ;;
1909a8fdb4bcSmrg  esac
1910a8fdb4bcSmrg
1911a8fdb4bcSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
1912a8fdb4bcSmrg  # and am__untar set.
1913a8fdb4bcSmrg  test -n "${am_cv_prog_tar_$1}" && break
1914a8fdb4bcSmrg
1915a8fdb4bcSmrg  # tar/untar a dummy directory, and stop if the command works
1916a8fdb4bcSmrg  rm -rf conftest.dir
1917a8fdb4bcSmrg  mkdir conftest.dir
1918a8fdb4bcSmrg  echo GrepMe > conftest.dir/file
1919a8fdb4bcSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1920a8fdb4bcSmrg  rm -rf conftest.dir
1921a8fdb4bcSmrg  if test -s conftest.tar; then
1922a8fdb4bcSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1923a8fdb4bcSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1924a8fdb4bcSmrg  fi
1925a8fdb4bcSmrgdone
1926a8fdb4bcSmrgrm -rf conftest.dir
1927a8fdb4bcSmrg
1928a8fdb4bcSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1929a8fdb4bcSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1930a8fdb4bcSmrgAC_SUBST([am__tar])
1931a8fdb4bcSmrgAC_SUBST([am__untar])
1932a8fdb4bcSmrg]) # _AM_PROG_TAR
1933a8fdb4bcSmrg
1934