aclocal.m4 revision b5d2086d
1b5d2086dSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
21cc8c64fSmrg
3b9bb67cbSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4b9bb67cbSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
51cc8c64fSmrg# This file is free software; the Free Software Foundation
61cc8c64fSmrg# gives unlimited permission to copy and/or distribute it,
71cc8c64fSmrg# with or without modifications, as long as this notice is preserved.
81cc8c64fSmrg
91cc8c64fSmrg# This program is distributed in the hope that it will be useful,
101cc8c64fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
111cc8c64fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
121cc8c64fSmrg# PARTICULAR PURPOSE.
131cc8c64fSmrg
14b9bb67cbSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15b9bb67cbSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16b5d2086dSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17b5d2086dSmrg[m4_warning([this file was generated for autoconf 2.68.
18b9bb67cbSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19b9bb67cbSmrgIf you have problems, you may need to regenerate the build system entirely.
20b9bb67cbSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
211cc8c64fSmrg
22b5d2086dSmrgdnl fontutil.m4.  Generated from fontutil.m4.in by configure.
23b5d2086dSmrgdnl
24b5d2086dSmrgdnl This file comes from X.Org's font-util 1.2.0
25b5d2086dSmrgdnl
26b5d2086dSmrgdnl Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
27b5d2086dSmrgdnl
28b5d2086dSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
29b5d2086dSmrgdnl copy of this software and associated documentation files (the "Software"),
30b5d2086dSmrgdnl to deal in the Software without restriction, including without limitation
31b5d2086dSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
32b5d2086dSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
33b5d2086dSmrgdnl Software is furnished to do so, subject to the following conditions:
34b5d2086dSmrgdnl
35b5d2086dSmrgdnl The above copyright notice and this permission notice (including the next
36b5d2086dSmrgdnl paragraph) shall be included in all copies or substantial portions of the
37b5d2086dSmrgdnl Software.
38b5d2086dSmrgdnl
39b5d2086dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40b5d2086dSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41b5d2086dSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
42b5d2086dSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
43b5d2086dSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
44b5d2086dSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
45b5d2086dSmrgdnl DEALINGS IN THE SOFTWARE.
46b5d2086dSmrgdnl
47b5d2086dSmrgdnl --------------------------------------------------------------------
48b5d2086dSmrgdnl
49b5d2086dSmrgdnl Copyright 2005 Red Hat, Inc
50b5d2086dSmrgdnl
51b5d2086dSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
52b5d2086dSmrgdnl documentation for any purpose is hereby granted without fee, provided that
53b5d2086dSmrgdnl the above copyright notice appear in all copies and that both that
54b5d2086dSmrgdnl copyright notice and this permission notice appear in supporting
55b5d2086dSmrgdnl documentation.
56b5d2086dSmrgdnl
57b5d2086dSmrgdnl The above copyright notice and this permission notice shall be included
58b5d2086dSmrgdnl in all copies or substantial portions of the Software.
59b5d2086dSmrgdnl
60b5d2086dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
61b5d2086dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
62b5d2086dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
63b5d2086dSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
64b5d2086dSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
65b5d2086dSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
66b5d2086dSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
67b5d2086dSmrgdnl
68b5d2086dSmrgdnl Except as contained in this notice, the name of the copyright holders shall
69b5d2086dSmrgdnl not be used in advertising or otherwise to promote the sale, use or
70b5d2086dSmrgdnl other dealings in this Software without prior written authorization
71b5d2086dSmrgdnl from the copyright holders.
72b5d2086dSmrg
73b5d2086dSmrg# XORG_FONT_MACROS_VERSION(required-version)
74b5d2086dSmrg# ------------------------------------------
75b5d2086dSmrg# Minimum version: 1.1.0
76b9bb67cbSmrg#
77b5d2086dSmrg# If you're using a macro added in Version 1.1 or newer, include this in
78b5d2086dSmrg# your configure.ac with the minimum required version, such as:
79b5d2086dSmrg# XORG_FONT_MACROS_VERSION(1.1)
80b5d2086dSmrg#
81b5d2086dSmrg# To ensure that this macro is defined, also add:
82b5d2086dSmrg# m4_ifndef([XORG_FONT_MACROS_VERSION],
83b5d2086dSmrg#     [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
84b5d2086dSmrg#
85b5d2086dSmrg#
86b5d2086dSmrg# See the "minimum version" comment for each macro you use to see what
87b5d2086dSmrg# version you require.
88b5d2086dSmrgm4_defun([XORG_FONT_MACROS_VERSION],[
89b5d2086dSmrgm4_define([vers_have], [1.2.0])
90b5d2086dSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
91b5d2086dSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
92b5d2086dSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
93b5d2086dSmrg    [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])])
94b5d2086dSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
95b5d2086dSmrg    [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])])
96b5d2086dSmrgm4_undefine([vers_have])
97b5d2086dSmrgm4_undefine([maj_have])
98b5d2086dSmrgm4_undefine([maj_needed])
99b5d2086dSmrg]) # XORG_FONT_MACROS_VERSION
1001cc8c64fSmrg
101b5d2086dSmrg# XORG_FONT_CHECK_{maps}()
102b5d2086dSmrg# ------------------------
103b5d2086dSmrg# Minimum version: 1.0.0
104b5d2086dSmrg# These macros add --enable/disable-{maps} where {maps} are ISO8859-*,
105b5d2086dSmrg# JISX0201 or KOI8_R.  By default, they are all enabled.
106b9bb67cbSmrg
107b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)])
108b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)])
109b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)])
110b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)])
111b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)])
112b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)])
113b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)])
114b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)])
115b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)])
116b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)])
117b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)])
118b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)])
119b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)])
120b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)])
121b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)])
122b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)])
123b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_JISX0201],  [XORG_FONT_CHECK_ENCODING(JISX0201)])
124b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_KOI8_R],    [XORG_FONT_CHECK_ENCODING(KOI8-R)])
1251cc8c64fSmrg
126b5d2086dSmrg# XORG_FONT_CHECK_ENCODING(encoding)
127b5d2086dSmrg# ----------------------------------
128b5d2086dSmrg# Minimum version: 1.1.0
129b5d2086dSmrg# This macro adds --enable/disable-<encoding>, enabled by default.
130b5d2086dSmrg# It replaced individual copies of this code in the above macros in 1.1.
131b5d2086dSmrg# Currently assumes encoding names will be all upper-case - add m4_toupper
132b5d2086dSmrg# calls if this is not true in the future.
1331cc8c64fSmrg
134b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING],[
135b5d2086dSmrg	AC_ARG_ENABLE(m4_tolower($1),
136b5d2086dSmrg		AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)),
137b5d2086dSmrg				[Build $1 fonts (default: yes)]),
138b5d2086dSmrg		[AS_TR_SH($1)=$enableval])
139b5d2086dSmrg	AC_MSG_CHECKING([whether to build $1 fonts])
140b5d2086dSmrg	AC_MSG_RESULT($[AS_TR_SH($1)])
141b5d2086dSmrg	AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes])
142b5d2086dSmrg]) # XORG_FONT_CHECK_ENCODING
1431cc8c64fSmrg
144b5d2086dSmrg# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....)
145b5d2086dSmrg# -----------------------------------------------------
146b5d2086dSmrg# Minimum version: 1.1.0
147b5d2086dSmrg# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once.
148b5d2086dSmrg# Add a shorthand --enable/disable-all-encodings option.
1491cc8c64fSmrg
150b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[
151b5d2086dSmrg	AC_ARG_ENABLE([all-encodings],
152b5d2086dSmrg		AS_HELP_STRING([--disable-all-encodings],
153b5d2086dSmrg				[Disable building of all font encodings]),
154b5d2086dSmrg		[m4_foreach_w([enc], [$1], [
155b5d2086dSmrg			AS_TR_SH(enc)=$enableval
156b5d2086dSmrg		])],
157b5d2086dSmrg		[m4_foreach_w([enc], [$1], [
158b5d2086dSmrg			AS_TR_SH(enc)=yes
159b5d2086dSmrg		])])
160b5d2086dSmrg	m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)])
161b5d2086dSmrg]) # XORG_FONT_CHECK_ENCODING_LIST
162b5d2086dSmrg
163b5d2086dSmrg# XORG_FONT_REQUIRED_PROG(VARNAME, progname)
164b5d2086dSmrg# ------------------------------------------
165b5d2086dSmrg# Minimum version: 1.1.0
1661cc8c64fSmrg#
167b5d2086dSmrg# Simple wrapper around AC_PATH_PROG that errors if not found
1681cc8c64fSmrg#
1691cc8c64fSmrg
170b5d2086dSmrgAC_DEFUN([XORG_FONT_REQUIRED_PROG],[
171b5d2086dSmrg	AC_PATH_PROG($1, $2)
172b5d2086dSmrg	if test x"$$1" = x; then
173b5d2086dSmrg		AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.])
174b5d2086dSmrg	fi
1751cc8c64fSmrg])
1761cc8c64fSmrg
1771cc8c64fSmrg
178b5d2086dSmrg# XORG_FONT_FCCACHE()
179b5d2086dSmrg# -------------------
180b5d2086dSmrg# Minimum version: 1.1.0
181b9bb67cbSmrg#
182b5d2086dSmrg# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found
183b5d2086dSmrg# Set RUN_FCCACHE to a rule suitable for substituting into a makefile
184b5d2086dSmrg# to run fc-cache if found and not installing to $DESTDIR
185b5d2086dSmrg#
186b5d2086dSmrg# fc-cache is optional, not required, and should be skipped when making
187b5d2086dSmrg# packages (installing to $DESTDIR).
188b5d2086dSmrg#
189b5d2086dSmrgAC_DEFUN([XORG_FONT_FCCACHE],[
190b5d2086dSmrg	AC_PATH_PROG(FCCACHE, fc-cache)
191b5d2086dSmrg	FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"'
192b5d2086dSmrg	if test x"$FCCACHE" = x ; then
193b5d2086dSmrg		RUN_FCCACHE="${FCCACHE_WARN}"
194b5d2086dSmrg	else
195b5d2086dSmrg		RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else'
196b5d2086dSmrg		RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)"
197b5d2086dSmrg	fi
198b5d2086dSmrg	AC_SUBST([RUN_FCCACHE])
199b5d2086dSmrg])
2001cc8c64fSmrg
2011cc8c64fSmrg
202b5d2086dSmrg# XORG_FONT_COMMON_UTILS()
203b5d2086dSmrg# ------------------------
204b5d2086dSmrg# Minimum version: 1.1.0
205b9bb67cbSmrg#
206b5d2086dSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types
2071cc8c64fSmrg
208b5d2086dSmrgAC_DEFUN([XORG_FONT_COMMON_UTILS],[
209b5d2086dSmrg	XORG_FONT_FCCACHE
210b5d2086dSmrg	XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir)
211b5d2086dSmrg])
2121cc8c64fSmrg
213b5d2086dSmrg# XORG_FONT_SCALED_UTILS()
214b5d2086dSmrg# ------------------------
215b5d2086dSmrg# Minimum version: 1.1.0
216b5d2086dSmrg#
217b5d2086dSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts
218b5d2086dSmrg# (TrueType, OpenType, Type1)
2191cc8c64fSmrg
220b5d2086dSmrgAC_DEFUN([XORG_FONT_SCALED_UTILS],[
221b5d2086dSmrg	XORG_FONT_COMMON_UTILS
222b5d2086dSmrg	XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale)
223b5d2086dSmrg])
2241cc8c64fSmrg
225b5d2086dSmrg# XORG_FONT_BDF_UTILS()
226b5d2086dSmrg# ---------------------
227b5d2086dSmrg# Minimum version: 1.1.0
2281cc8c64fSmrg#
229b5d2086dSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts
230b5d2086dSmrg# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the
231b5d2086dSmrg# PCF output files created by bdftopcf
2321cc8c64fSmrg
233b5d2086dSmrgAC_DEFUN([XORG_FONT_BDF_UTILS],[
234b5d2086dSmrg	XORG_FONT_COMMON_UTILS
235b5d2086dSmrg	XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf)
236b5d2086dSmrg	XORG_FONT_CHECK_COMPRESSION
237b5d2086dSmrg])
2381cc8c64fSmrg
239b5d2086dSmrg# XORG_FONT_CHECK_COMPRESSION()
240b5d2086dSmrg# -----------------------------
241b5d2086dSmrg# Minimum version: 1.1.0
242b5d2086dSmrg#
243b5d2086dSmrg# Offer a --with-compression flag to control what compression method is
244b5d2086dSmrg# used for pcf font files.   Offers all the methods currently supported
245b5d2086dSmrg# by libXfont, including no compression.
246b9bb67cbSmrg
247b5d2086dSmrgAC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[
248b5d2086dSmrg	AC_MSG_CHECKING([font compression method])
249b5d2086dSmrg	AC_ARG_WITH(compression,
250b5d2086dSmrg	 [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>],
251b5d2086dSmrg			 [compression method to use on pcf fonts])],
252b5d2086dSmrg         [compression="$withval"], [compression="yes"])
253b5d2086dSmrg	if test x"$compression" = "xyes" ; then
254b5d2086dSmrg		compression="gzip"
255b5d2086dSmrg	fi
256b5d2086dSmrg	AC_MSG_RESULT([${compression}])
257b5d2086dSmrg	case ${compression} in
258b5d2086dSmrg	 *compress)	COMPRESS_SUFFIX=".Z" ;;
259b5d2086dSmrg	 *gzip)		COMPRESS_SUFFIX=".gz" ;;
260b5d2086dSmrg	 *bzip2)	COMPRESS_SUFFIX=".bz2" ;;
261b5d2086dSmrg	 no|none)	COMPRESS_SUFFIX="" ; COMPRESS="cat" ;;
262b5d2086dSmrg	 *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;;
263b5d2086dSmrg	esac
264b5d2086dSmrg	if test x"$COMPRESS_SUFFIX" != "x" ; then
265b5d2086dSmrg	   XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression})
266b5d2086dSmrg	fi
267b5d2086dSmrg	AC_SUBST([COMPRESS_SUFFIX])
268b5d2086dSmrg])
2691cc8c64fSmrg
270b5d2086dSmrg# XORG_FONT_UCS2ANY()
271b5d2086dSmrg# -------------------
272b5d2086dSmrg# Minimum version: 1.1.0
273b5d2086dSmrg#
274b5d2086dSmrg# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting
275b5d2086dSmrg# Unicode-encoded BDF format bitmap fonts into subsets for older encodings.
276b5d2086dSmrg# Also call pkg-config to find the directory with the encoding files needed
277b5d2086dSmrg# by ucs2any, and export it as MAPFILES_PATH to the Makefiles
2781cc8c64fSmrg
279b5d2086dSmrgAC_DEFUN([XORG_FONT_UCS2ANY],[
280b5d2086dSmrg	XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
281b5d2086dSmrg	PKG_CHECK_MODULES(MAPS, [fontutil])
282b5d2086dSmrg	AC_MSG_CHECKING([for ucs2any encoding data files])
283b5d2086dSmrg	MAPFILES_PATH=`pkg-config --variable=mapdir fontutil`
284b5d2086dSmrg	AC_SUBST(MAPFILES_PATH)
285b5d2086dSmrg	AC_MSG_RESULT([${MAPFILES_PATH}])
286b9bb67cbSmrg])
287b9bb67cbSmrg
288b9bb67cbSmrg
289b9bb67cbSmrg
290b5d2086dSmrg# XORG_FONT_FC_CONFDIR()
291b5d2086dSmrg# --------------------
292b5d2086dSmrg# Minimum version: 1.2.0
293b5d2086dSmrg#
294b5d2086dSmrg# Sets FC_CONFDIR to the fontconfig config directory
295b5d2086dSmrg# (which should be --with-confdir=... when building fontconfig)
296b5d2086dSmrg# found from:
297b5d2086dSmrg#	--with-fc-confdir=...
298b5d2086dSmrg#	pkg-config --variable=confdir fontconfig
299b5d2086dSmrg#	${sysconfdir}/fonts
300b9bb67cbSmrg
301b5d2086dSmrgAC_DEFUN([XORG_FONT_FC_CONFDIR],[
302b5d2086dSmrg	dnl Ensure $PKG_CONFIG is set first
303b5d2086dSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
304b5d2086dSmrg
305b5d2086dSmrg	AC_MSG_CHECKING([for fontconfig's configuration directory])
306b5d2086dSmrg	AC_ARG_WITH(fc-confdir,
307b5d2086dSmrg		    AS_HELP_STRING([--with-fc-confdir=DIR],
308b5d2086dSmrg			   [Path to fontconfig's configuration directory]),
309b5d2086dSmrg		    [FC_CONFDIR="$withval"])
310b5d2086dSmrg	# if --with-fc-confdir was not specified
311b5d2086dSmrg	if test "x${FC_CONFDIR}" = "x"; then
312b5d2086dSmrg		FC_CONFDIR=`$PKG_CONFIG --variable=confdir fontconfig`
313b5d2086dSmrg	fi
314b5d2086dSmrg	# ...and if pkg-config didn't find confdir in fontconfig.pc...
315b5d2086dSmrg	if test "x${FC_CONFDIR}" = "x"; then
316b5d2086dSmrg		FC_CONFDIR="${sysconfdir}/fonts"
317b5d2086dSmrg	fi
318b5d2086dSmrg	AC_SUBST(FC_CONFDIR)
319b5d2086dSmrg	AC_MSG_RESULT([${FC_CONFDIR}])
320b9bb67cbSmrg])
321b9bb67cbSmrg
322b9bb67cbSmrg
323b5d2086dSmrg
324b5d2086dSmrg# XORG_FONTROOTDIR()
325b5d2086dSmrg# --------------------
326b5d2086dSmrg# Minimum version: 1.1.0
327b9bb67cbSmrg#
328b5d2086dSmrg# Sets FONTROOTDIR to the root directory for font files.  Uses the first
329b5d2086dSmrg# found from:
330b5d2086dSmrg#	--with-fontrootdir
331b5d2086dSmrg#	pkg-config --variable=fontrootdir fontutil
332b5d2086dSmrg#	${datadir}/fonts/X11
333b9bb67cbSmrg
334b5d2086dSmrgAC_DEFUN([XORG_FONTROOTDIR],[
335b5d2086dSmrg	dnl Ensure $PKG_CONFIG is set first
336b5d2086dSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
337b9bb67cbSmrg
338b5d2086dSmrg	AC_MSG_CHECKING([for root directory for font files])
339b5d2086dSmrg	AC_ARG_WITH(fontrootdir,
340b5d2086dSmrg		    AS_HELP_STRING([--with-fontrootdir=DIR],
341b5d2086dSmrg			   [Path to root directory for font files]),
342b5d2086dSmrg		    [FONTROOTDIR="$withval"])
343b5d2086dSmrg	# if --with-fontrootdir not specified...
344b5d2086dSmrg	if test "x${FONTROOTDIR}" = "x"; then
345b5d2086dSmrg		FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
346b5d2086dSmrg	fi
347b5d2086dSmrg	# ...and if pkg-config didn't find fontdir in fontutil.pc...
348b5d2086dSmrg	if test "x${FONTROOTDIR}" = "x"; then
349b5d2086dSmrg		FONTROOTDIR="${datadir}/fonts/X11"
350b5d2086dSmrg	fi
351b5d2086dSmrg	AC_SUBST(FONTROOTDIR)
352b5d2086dSmrg	AC_MSG_RESULT([${FONTROOTDIR}])
353b5d2086dSmrg])
354b9bb67cbSmrg
355b5d2086dSmrg# XORG_FONTSUBDIR(variable, flag, subdir)
356b5d2086dSmrg# ---------------------------------------
357b5d2086dSmrg# Minimum version: 1.1.0
358b9bb67cbSmrg#
359b5d2086dSmrg# Offer a --with-<flag> flag to control directory for font installation
360b5d2086dSmrg# Default is the specified <subdir> of the font root directory.
361b5d2086dSmrg# Sets <variable> to the selected directory
362b9bb67cbSmrg
363b5d2086dSmrgAC_DEFUN([XORG_FONTSUBDIR],[
364b5d2086dSmrg	AC_REQUIRE([XORG_FONTROOTDIR])
365b9bb67cbSmrg
366b5d2086dSmrg	AC_MSG_CHECKING([for directory for $3 files])
367b5d2086dSmrg	AC_ARG_WITH($2,
368b5d2086dSmrg		    [AS_HELP_STRING([--with-$2=DIR],
369b5d2086dSmrg				    [Path to $3 files [FONTROOTDIR/$3]])],
370b5d2086dSmrg		    [$1="${withval}"], [$1='${FONTROOTDIR}/$3'])
371b5d2086dSmrg	AC_SUBST($1)
372b5d2086dSmrg	AC_MSG_RESULT([${$1}])
373b5d2086dSmrg]) # XORG_FONTSUBDIR
374b5d2086dSmrg
375b5d2086dSmrg# XORG_FONTDIR(subdir)
376b5d2086dSmrg# --------------------
377b5d2086dSmrg# Minimum version: 1.1.0
378b9bb67cbSmrg#
379b5d2086dSmrg# Offer a --with-fontdir flag to control directory for font installation
380b5d2086dSmrg# Default is the specified subdir of the font root directory.
381b5d2086dSmrg# Sets FONTDIR to the selected directory
382b9bb67cbSmrg
383b5d2086dSmrgAC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])])
384b9bb67cbSmrg
385b5d2086dSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
386b5d2086dSmrg# serial 1 (pkg-config-0.24)
387b5d2086dSmrg# 
388b5d2086dSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
389b5d2086dSmrg#
390b5d2086dSmrg# This program is free software; you can redistribute it and/or modify
391b5d2086dSmrg# it under the terms of the GNU General Public License as published by
392b5d2086dSmrg# the Free Software Foundation; either version 2 of the License, or
393b5d2086dSmrg# (at your option) any later version.
394b5d2086dSmrg#
395b5d2086dSmrg# This program is distributed in the hope that it will be useful, but
396b5d2086dSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
397b5d2086dSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
398b5d2086dSmrg# General Public License for more details.
399b5d2086dSmrg#
400b5d2086dSmrg# You should have received a copy of the GNU General Public License
401b5d2086dSmrg# along with this program; if not, write to the Free Software
402b5d2086dSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
403b5d2086dSmrg#
404b5d2086dSmrg# As a special exception to the GNU General Public License, if you
405b5d2086dSmrg# distribute this file as part of a program that contains a
406b5d2086dSmrg# configuration script generated by Autoconf, you may include it under
407b5d2086dSmrg# the same distribution terms that you use for the rest of that program.
408b9bb67cbSmrg
409b5d2086dSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
410b5d2086dSmrg# ----------------------------------
411b5d2086dSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
412b5d2086dSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
413b5d2086dSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
414b5d2086dSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
415b5d2086dSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
416b5d2086dSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
417b9bb67cbSmrg
418b5d2086dSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
419b5d2086dSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
420b9bb67cbSmrgfi
421b5d2086dSmrgif test -n "$PKG_CONFIG"; then
422b5d2086dSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
423b5d2086dSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
424b5d2086dSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
425b5d2086dSmrg		AC_MSG_RESULT([yes])
426b5d2086dSmrg	else
427b5d2086dSmrg		AC_MSG_RESULT([no])
428b5d2086dSmrg		PKG_CONFIG=""
429b5d2086dSmrg	fi
430b5d2086dSmrgfi[]dnl
431b5d2086dSmrg])# PKG_PROG_PKG_CONFIG
432b9bb67cbSmrg
433b5d2086dSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
434b5d2086dSmrg#
435b5d2086dSmrg# Check to see whether a particular set of modules exists.  Similar
436b5d2086dSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
437b5d2086dSmrg#
438b5d2086dSmrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
439b5d2086dSmrg# only at the first occurence in configure.ac, so if the first place
440b5d2086dSmrg# it's called might be skipped (such as if it is within an "if", you
441b5d2086dSmrg# have to call PKG_CHECK_EXISTS manually
442b5d2086dSmrg# --------------------------------------------------------------
443b5d2086dSmrgAC_DEFUN([PKG_CHECK_EXISTS],
444b5d2086dSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
445b5d2086dSmrgif test -n "$PKG_CONFIG" && \
446b5d2086dSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
447b5d2086dSmrg  m4_default([$2], [:])
448b5d2086dSmrgm4_ifvaln([$3], [else
449b5d2086dSmrg  $3])dnl
450b5d2086dSmrgfi])
451b9bb67cbSmrg
452b5d2086dSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
453b5d2086dSmrg# ---------------------------------------------
454b5d2086dSmrgm4_define([_PKG_CONFIG],
455b5d2086dSmrg[if test -n "$$1"; then
456b5d2086dSmrg    pkg_cv_[]$1="$$1"
457b5d2086dSmrg elif test -n "$PKG_CONFIG"; then
458b5d2086dSmrg    PKG_CHECK_EXISTS([$3],
459b5d2086dSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
460b5d2086dSmrg		     [pkg_failed=yes])
461b5d2086dSmrg else
462b5d2086dSmrg    pkg_failed=untried
463b5d2086dSmrgfi[]dnl
464b5d2086dSmrg])# _PKG_CONFIG
465b9bb67cbSmrg
466b5d2086dSmrg# _PKG_SHORT_ERRORS_SUPPORTED
467b5d2086dSmrg# -----------------------------
468b5d2086dSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
469b5d2086dSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
470b5d2086dSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
471b5d2086dSmrg        _pkg_short_errors_supported=yes
472b5d2086dSmrgelse
473b5d2086dSmrg        _pkg_short_errors_supported=no
474b5d2086dSmrgfi[]dnl
475b5d2086dSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
476b9bb67cbSmrg
477b9bb67cbSmrg
478b5d2086dSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
479b5d2086dSmrg# [ACTION-IF-NOT-FOUND])
480b5d2086dSmrg#
481b5d2086dSmrg#
482b5d2086dSmrg# Note that if there is a possibility the first call to
483b5d2086dSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
484b5d2086dSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
485b5d2086dSmrg#
486b5d2086dSmrg#
487b5d2086dSmrg# --------------------------------------------------------------
488b5d2086dSmrgAC_DEFUN([PKG_CHECK_MODULES],
489b5d2086dSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
490b5d2086dSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
491b5d2086dSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
492b9bb67cbSmrg
493b5d2086dSmrgpkg_failed=no
494b5d2086dSmrgAC_MSG_CHECKING([for $1])
495b5d2086dSmrg
496b5d2086dSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
497b5d2086dSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
498b5d2086dSmrg
499b5d2086dSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
500b5d2086dSmrgand $1[]_LIBS to avoid the need to call pkg-config.
501b5d2086dSmrgSee the pkg-config man page for more details.])
502b5d2086dSmrg
503b5d2086dSmrgif test $pkg_failed = yes; then
504b5d2086dSmrg   	AC_MSG_RESULT([no])
505b5d2086dSmrg        _PKG_SHORT_ERRORS_SUPPORTED
506b5d2086dSmrg        if test $_pkg_short_errors_supported = yes; then
507b5d2086dSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
508b5d2086dSmrg        else 
509b5d2086dSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
510b5d2086dSmrg        fi
511b5d2086dSmrg	# Put the nasty error message in config.log where it belongs
512b5d2086dSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
513b5d2086dSmrg
514b5d2086dSmrg	m4_default([$4], [AC_MSG_ERROR(
515b5d2086dSmrg[Package requirements ($2) were not met:
516b5d2086dSmrg
517b5d2086dSmrg$$1_PKG_ERRORS
518b5d2086dSmrg
519b5d2086dSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
520b5d2086dSmrginstalled software in a non-standard prefix.
521b5d2086dSmrg
522b5d2086dSmrg_PKG_TEXT])[]dnl
523b5d2086dSmrg        ])
524b5d2086dSmrgelif test $pkg_failed = untried; then
525b5d2086dSmrg     	AC_MSG_RESULT([no])
526b5d2086dSmrg	m4_default([$4], [AC_MSG_FAILURE(
527b5d2086dSmrg[The pkg-config script could not be found or is too old.  Make sure it
528b5d2086dSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
529b5d2086dSmrgpath to pkg-config.
530b5d2086dSmrg
531b5d2086dSmrg_PKG_TEXT
532b5d2086dSmrg
533b5d2086dSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
534b5d2086dSmrg        ])
535b5d2086dSmrgelse
536b5d2086dSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
537b5d2086dSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
538b5d2086dSmrg        AC_MSG_RESULT([yes])
539b5d2086dSmrg	$3
540b5d2086dSmrgfi[]dnl
541b5d2086dSmrg])# PKG_CHECK_MODULES
542b9bb67cbSmrg
543b5d2086dSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
544b5d2086dSmrgdnl
545b5d2086dSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
546b5d2086dSmrgdnl 
547b5d2086dSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
548b5d2086dSmrgdnl copy of this software and associated documentation files (the "Software"),
549b5d2086dSmrgdnl to deal in the Software without restriction, including without limitation
550b5d2086dSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
551b5d2086dSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
552b5d2086dSmrgdnl Software is furnished to do so, subject to the following conditions:
553b5d2086dSmrgdnl
554b5d2086dSmrgdnl The above copyright notice and this permission notice (including the next
555b5d2086dSmrgdnl paragraph) shall be included in all copies or substantial portions of the
556b5d2086dSmrgdnl Software.
557b5d2086dSmrgdnl
558b5d2086dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
559b5d2086dSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
560b5d2086dSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
561b5d2086dSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
562b5d2086dSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
563b5d2086dSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
564b5d2086dSmrgdnl DEALINGS IN THE SOFTWARE.
565b9bb67cbSmrg
566b5d2086dSmrg# XORG_MACROS_VERSION(required-version)
567b5d2086dSmrg# -------------------------------------
568b5d2086dSmrg# Minimum version: 1.1.0
569b9bb67cbSmrg#
570b5d2086dSmrg# If you're using a macro added in Version 1.1 or newer, include this in
571b5d2086dSmrg# your configure.ac with the minimum required version, such as:
572b5d2086dSmrg# XORG_MACROS_VERSION(1.1)
573b5d2086dSmrg#
574b5d2086dSmrg# To ensure that this macro is defined, also add:
575b5d2086dSmrg# m4_ifndef([XORG_MACROS_VERSION],
576b5d2086dSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
577b5d2086dSmrg#
578b5d2086dSmrg#
579b5d2086dSmrg# See the "minimum version" comment for each macro you use to see what 
580b5d2086dSmrg# version you require.
581b5d2086dSmrgm4_defun([XORG_MACROS_VERSION],[
582b5d2086dSmrgm4_define([vers_have], [1.11.0])
583b5d2086dSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
584b5d2086dSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
585b5d2086dSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
586b5d2086dSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
587b5d2086dSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
588b5d2086dSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
589b5d2086dSmrgm4_undefine([vers_have])
590b5d2086dSmrgm4_undefine([maj_have])
591b5d2086dSmrgm4_undefine([maj_needed])
592b5d2086dSmrg]) # XORG_MACROS_VERSION
593b9bb67cbSmrg
594b5d2086dSmrg# XORG_PROG_RAWCPP()
595b9bb67cbSmrg# ------------------
596b5d2086dSmrg# Minimum version: 1.0.0
597b9bb67cbSmrg#
598b5d2086dSmrg# Find cpp program and necessary flags for use in pre-processing text files
599b5d2086dSmrg# such as man pages and config files
600b5d2086dSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
601b5d2086dSmrgAC_REQUIRE([AC_PROG_CPP])
602b5d2086dSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
603b5d2086dSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
604b9bb67cbSmrg
605b5d2086dSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
606b5d2086dSmrg# which is not the best choice for supporting other OS'es, but covers most
607b5d2086dSmrg# of the ones we need for now.
608b5d2086dSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
609b5d2086dSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
610b5d2086dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
611b5d2086dSmrg	AC_MSG_RESULT([no])
612b9bb67cbSmrgelse
613b5d2086dSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
614b5d2086dSmrg		RAWCPPFLAGS=-undef
615b5d2086dSmrg		AC_MSG_RESULT([yes])
616b5d2086dSmrg	# under Cygwin unix is still defined even with -undef
617b5d2086dSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
618b5d2086dSmrg		RAWCPPFLAGS="-undef -ansi"
619b5d2086dSmrg		AC_MSG_RESULT([yes, with -ansi])
620b5d2086dSmrg	else
621b5d2086dSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
622b5d2086dSmrg	fi
623b9bb67cbSmrgfi
624b5d2086dSmrgrm -f conftest.$ac_ext
625b9bb67cbSmrg
626b5d2086dSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
627b5d2086dSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
628b5d2086dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
629b5d2086dSmrg	AC_MSG_RESULT([no])
630b5d2086dSmrgelse
631b5d2086dSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
632b5d2086dSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
633b5d2086dSmrg		AC_MSG_RESULT([yes])
634b5d2086dSmrg	else
635b5d2086dSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
636b5d2086dSmrg	fi
637b5d2086dSmrgfi
638b5d2086dSmrgrm -f conftest.$ac_ext
639b5d2086dSmrgAC_SUBST(RAWCPPFLAGS)
640b5d2086dSmrg]) # XORG_PROG_RAWCPP
641b9bb67cbSmrg
642b5d2086dSmrg# XORG_MANPAGE_SECTIONS()
643b5d2086dSmrg# -----------------------
644b5d2086dSmrg# Minimum version: 1.0.0
645b9bb67cbSmrg#
646b5d2086dSmrg# Determine which sections man pages go in for the different man page types
647b5d2086dSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
648b5d2086dSmrg# Not sure if there's any better way than just hardcoding by OS name.
649b5d2086dSmrg# Override default settings by setting environment variables
650b5d2086dSmrg# Added MAN_SUBSTS in version 1.8
651b5d2086dSmrg# Added AC_PROG_SED in version 1.8
652b9bb67cbSmrg
653b5d2086dSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
654b5d2086dSmrgAC_REQUIRE([AC_CANONICAL_HOST])
655b5d2086dSmrgAC_REQUIRE([AC_PROG_SED])
656b9bb67cbSmrg
657b5d2086dSmrgif test x$APP_MAN_SUFFIX = x    ; then
658b5d2086dSmrg    APP_MAN_SUFFIX=1
659b5d2086dSmrgfi
660b5d2086dSmrgif test x$APP_MAN_DIR = x    ; then
661b5d2086dSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
662b5d2086dSmrgfi
663b9bb67cbSmrg
664b5d2086dSmrgif test x$LIB_MAN_SUFFIX = x    ; then
665b5d2086dSmrg    LIB_MAN_SUFFIX=3
666b5d2086dSmrgfi
667b5d2086dSmrgif test x$LIB_MAN_DIR = x    ; then
668b5d2086dSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
669b5d2086dSmrgfi
670b9bb67cbSmrg
671b5d2086dSmrgif test x$FILE_MAN_SUFFIX = x    ; then
672b5d2086dSmrg    case $host_os in
673b5d2086dSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
674b5d2086dSmrg	*)		FILE_MAN_SUFFIX=5  ;;
675b5d2086dSmrg    esac
676b5d2086dSmrgfi
677b5d2086dSmrgif test x$FILE_MAN_DIR = x    ; then
678b5d2086dSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
679b5d2086dSmrgfi
680b9bb67cbSmrg
681b5d2086dSmrgif test x$MISC_MAN_SUFFIX = x    ; then
682b5d2086dSmrg    case $host_os in
683b5d2086dSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
684b5d2086dSmrg	*)		MISC_MAN_SUFFIX=7  ;;
685b5d2086dSmrg    esac
686b5d2086dSmrgfi
687b5d2086dSmrgif test x$MISC_MAN_DIR = x    ; then
688b5d2086dSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
689b5d2086dSmrgfi
690b9bb67cbSmrg
691b5d2086dSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
692b5d2086dSmrg    case $host_os in
693b5d2086dSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
694b5d2086dSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
695b5d2086dSmrg    esac
696b5d2086dSmrgfi
697b5d2086dSmrgif test x$DRIVER_MAN_DIR = x    ; then
698b5d2086dSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
699b5d2086dSmrgfi
700b9bb67cbSmrg
701b5d2086dSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
702b5d2086dSmrg    case $host_os in
703b5d2086dSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
704b5d2086dSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
705b5d2086dSmrg    esac
706b5d2086dSmrgfi
707b5d2086dSmrgif test x$ADMIN_MAN_DIR = x    ; then
708b5d2086dSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
709b9bb67cbSmrgfi
710b9bb67cbSmrg
711b9bb67cbSmrg
712b5d2086dSmrgAC_SUBST([APP_MAN_SUFFIX])
713b5d2086dSmrgAC_SUBST([LIB_MAN_SUFFIX])
714b5d2086dSmrgAC_SUBST([FILE_MAN_SUFFIX])
715b5d2086dSmrgAC_SUBST([MISC_MAN_SUFFIX])
716b5d2086dSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
717b5d2086dSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
718b5d2086dSmrgAC_SUBST([APP_MAN_DIR])
719b5d2086dSmrgAC_SUBST([LIB_MAN_DIR])
720b5d2086dSmrgAC_SUBST([FILE_MAN_DIR])
721b5d2086dSmrgAC_SUBST([MISC_MAN_DIR])
722b5d2086dSmrgAC_SUBST([DRIVER_MAN_DIR])
723b5d2086dSmrgAC_SUBST([ADMIN_MAN_DIR])
724b9bb67cbSmrg
725b5d2086dSmrgXORG_MAN_PAGE="X Version 11"
726b5d2086dSmrgAC_SUBST([XORG_MAN_PAGE])
727b5d2086dSmrgMAN_SUBSTS="\
728b5d2086dSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
729b5d2086dSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
730b5d2086dSmrg	-e 's|__xservername__|Xorg|g' \
731b5d2086dSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
732b5d2086dSmrg	-e 's|__projectroot__|\$(prefix)|g' \
733b5d2086dSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
734b5d2086dSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
735b5d2086dSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
736b5d2086dSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
737b5d2086dSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
738b5d2086dSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
739b5d2086dSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
740b5d2086dSmrgAC_SUBST([MAN_SUBSTS])
741b9bb67cbSmrg
742b5d2086dSmrg]) # XORG_MANPAGE_SECTIONS
743b9bb67cbSmrg
744b5d2086dSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
745b5d2086dSmrg# ------------------------
746b5d2086dSmrg# Minimum version: 1.7.0
747b5d2086dSmrg#
748b5d2086dSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
749b5d2086dSmrg# provided by xorg-sgml-doctools, if installed.
750b5d2086dSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
751b5d2086dSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
752b5d2086dSmrgXORG_SGML_PATH=
753b5d2086dSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
754b5d2086dSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
755b5d2086dSmrg    [m4_ifval([$1],[:],
756b5d2086dSmrg        [if test x"$cross_compiling" != x"yes" ; then
757b5d2086dSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
758b5d2086dSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
759b5d2086dSmrg         fi])
760b5d2086dSmrg    ])
761b5d2086dSmrg
762b5d2086dSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
763b5d2086dSmrg# the path and the name of the doc stylesheet
764b5d2086dSmrgif test "x$XORG_SGML_PATH" != "x" ; then
765b5d2086dSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
766b5d2086dSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
767b5d2086dSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
768b9bb67cbSmrgelse
769b5d2086dSmrg   AC_MSG_RESULT([no])
770b9bb67cbSmrgfi
771b9bb67cbSmrg
772b5d2086dSmrgAC_SUBST(XORG_SGML_PATH)
773b5d2086dSmrgAC_SUBST(STYLESHEET_SRCDIR)
774b5d2086dSmrgAC_SUBST(XSL_STYLESHEET)
775b5d2086dSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
776b5d2086dSmrg]) # XORG_CHECK_SGML_DOCTOOLS
777b5d2086dSmrg
778b5d2086dSmrg# XORG_CHECK_LINUXDOC
779b5d2086dSmrg# -------------------
780b5d2086dSmrg# Minimum version: 1.0.0
781b9bb67cbSmrg#
782b5d2086dSmrg# Defines the variable MAKE_TEXT if the necessary tools and
783b5d2086dSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
784b5d2086dSmrg# Whether or not the necessary tools and files are found can be checked
785b5d2086dSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
786b5d2086dSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
787b5d2086dSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
788b5d2086dSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
789b9bb67cbSmrg
790b5d2086dSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
791b9bb67cbSmrg
792b5d2086dSmrgAC_MSG_CHECKING([whether to build documentation])
793b9bb67cbSmrg
794b5d2086dSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
795b5d2086dSmrg   BUILDDOC=yes
796b5d2086dSmrgelse
797b5d2086dSmrg   BUILDDOC=no
798b5d2086dSmrgfi
799b9bb67cbSmrg
800b5d2086dSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
801b9bb67cbSmrg
802b5d2086dSmrgAC_MSG_RESULT([$BUILDDOC])
803b9bb67cbSmrg
804b5d2086dSmrgAC_MSG_CHECKING([whether to build pdf documentation])
805b9bb67cbSmrg
806b5d2086dSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
807b5d2086dSmrg   BUILDPDFDOC=yes
808b5d2086dSmrgelse
809b5d2086dSmrg   BUILDPDFDOC=no
810b5d2086dSmrgfi
811b9bb67cbSmrg
812b5d2086dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
813b9bb67cbSmrg
814b5d2086dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
815b9bb67cbSmrg
816b5d2086dSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
817b5d2086dSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
818b5d2086dSmrgMAKE_PDF="$PS2PDF"
819b5d2086dSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
820b9bb67cbSmrg
821b5d2086dSmrgAC_SUBST(MAKE_TEXT)
822b5d2086dSmrgAC_SUBST(MAKE_PS)
823b5d2086dSmrgAC_SUBST(MAKE_PDF)
824b5d2086dSmrgAC_SUBST(MAKE_HTML)
825b5d2086dSmrg]) # XORG_CHECK_LINUXDOC
826b9bb67cbSmrg
827b5d2086dSmrg# XORG_CHECK_DOCBOOK
828b5d2086dSmrg# -------------------
829b5d2086dSmrg# Minimum version: 1.0.0
830b5d2086dSmrg#
831b5d2086dSmrg# Checks for the ability to build output formats from SGML DocBook source.
832b5d2086dSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
833b5d2086dSmrg# indicates whether the necessary tools and files are found and, if set,
834b5d2086dSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
835b5d2086dSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
836b5d2086dSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
837b9bb67cbSmrg
838b5d2086dSmrgBUILDTXTDOC=no
839b5d2086dSmrgBUILDPDFDOC=no
840b5d2086dSmrgBUILDPSDOC=no
841b5d2086dSmrgBUILDHTMLDOC=no
842b9bb67cbSmrg
843b5d2086dSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
844b5d2086dSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
845b5d2086dSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
846b5d2086dSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
847b9bb67cbSmrg
848b5d2086dSmrgAC_MSG_CHECKING([whether to build text documentation])
849b5d2086dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
850b5d2086dSmrg   test x$BUILD_TXTDOC != xno; then
851b5d2086dSmrg	BUILDTXTDOC=yes
852b9bb67cbSmrgfi
853b5d2086dSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
854b5d2086dSmrgAC_MSG_RESULT([$BUILDTXTDOC])
855b9bb67cbSmrg
856b5d2086dSmrgAC_MSG_CHECKING([whether to build PDF documentation])
857b5d2086dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
858b5d2086dSmrg   test x$BUILD_PDFDOC != xno; then
859b5d2086dSmrg	BUILDPDFDOC=yes
860b5d2086dSmrgfi
861b5d2086dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
862b5d2086dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
863b9bb67cbSmrg
864b5d2086dSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
865b5d2086dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
866b5d2086dSmrg   test x$BUILD_PSDOC != xno; then
867b5d2086dSmrg	BUILDPSDOC=yes
868b5d2086dSmrgfi
869b5d2086dSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
870b5d2086dSmrgAC_MSG_RESULT([$BUILDPSDOC])
871b9bb67cbSmrg
872b5d2086dSmrgAC_MSG_CHECKING([whether to build HTML documentation])
873b5d2086dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
874b5d2086dSmrg   test x$BUILD_HTMLDOC != xno; then
875b5d2086dSmrg	BUILDHTMLDOC=yes
876b5d2086dSmrgfi
877b5d2086dSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
878b5d2086dSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
879b5d2086dSmrg
880b5d2086dSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
881b5d2086dSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
882b5d2086dSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
883b5d2086dSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
884b9bb67cbSmrg
885b5d2086dSmrgAC_SUBST(MAKE_TEXT)
886b5d2086dSmrgAC_SUBST(MAKE_PS)
887b5d2086dSmrgAC_SUBST(MAKE_PDF)
888b5d2086dSmrgAC_SUBST(MAKE_HTML)
889b5d2086dSmrg]) # XORG_CHECK_DOCBOOK
890b9bb67cbSmrg
891b5d2086dSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
892b5d2086dSmrg# ----------------
893b5d2086dSmrg# Minimum version: 1.5.0
894b5d2086dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
895b5d2086dSmrg#
896b5d2086dSmrg# Documentation tools are not always available on all platforms and sometimes
897b5d2086dSmrg# not at the appropriate level. This macro enables a module to test for the
898b5d2086dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
899b5d2086dSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
900b5d2086dSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
901b5d2086dSmrg# --with-xmlto assumes 'auto'.
902b5d2086dSmrg#
903b5d2086dSmrg# Interface to module:
904b5d2086dSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
905b5d2086dSmrg# XMLTO:	returns the path of the xmlto program found
906b5d2086dSmrg#		returns the path set by the user in the environment
907b5d2086dSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
908b5d2086dSmrg#		'no' user instructs the module not to use xmlto
909b5d2086dSmrg#
910b5d2086dSmrg# Added in version 1.10.0
911b5d2086dSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
912b5d2086dSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
913b5d2086dSmrg#
914b5d2086dSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
915b5d2086dSmrg#
916b5d2086dSmrgAC_DEFUN([XORG_WITH_XMLTO],[
917b5d2086dSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
918b5d2086dSmrgm4_define([_defopt], m4_default([$2], [auto]))
919b5d2086dSmrgAC_ARG_WITH(xmlto,
920b5d2086dSmrg	AS_HELP_STRING([--with-xmlto],
921b5d2086dSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
922b5d2086dSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
923b5d2086dSmrgm4_undefine([_defopt])
924b5d2086dSmrg
925b5d2086dSmrgif test "x$use_xmlto" = x"auto"; then
926b5d2086dSmrg   AC_PATH_PROG([XMLTO], [xmlto])
927b5d2086dSmrg   if test "x$XMLTO" = "x"; then
928b5d2086dSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
929b5d2086dSmrg	have_xmlto=no
930b5d2086dSmrg   else
931b5d2086dSmrg        have_xmlto=yes
932b5d2086dSmrg   fi
933b5d2086dSmrgelif test "x$use_xmlto" = x"yes" ; then
934b5d2086dSmrg   AC_PATH_PROG([XMLTO], [xmlto])
935b5d2086dSmrg   if test "x$XMLTO" = "x"; then
936b5d2086dSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
937b5d2086dSmrg   fi
938b5d2086dSmrg   have_xmlto=yes
939b5d2086dSmrgelif test "x$use_xmlto" = x"no" ; then
940b5d2086dSmrg   if test "x$XMLTO" != "x"; then
941b5d2086dSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
942b5d2086dSmrg   fi
943b5d2086dSmrg   have_xmlto=no
944b5d2086dSmrgelse
945b5d2086dSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
946b9bb67cbSmrgfi
947b9bb67cbSmrg
948b5d2086dSmrg# Test for a minimum version of xmlto, if provided.
949b5d2086dSmrgm4_ifval([$1],
950b5d2086dSmrg[if test "$have_xmlto" = yes; then
951b5d2086dSmrg    # scrape the xmlto version
952b5d2086dSmrg    AC_MSG_CHECKING([the xmlto version])
953b5d2086dSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
954b5d2086dSmrg    AC_MSG_RESULT([$xmlto_version])
955b5d2086dSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
956b5d2086dSmrg        [if test "x$use_xmlto" = xauto; then
957b5d2086dSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
958b5d2086dSmrg            have_xmlto=no
959b5d2086dSmrg        else
960b5d2086dSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
961b5d2086dSmrg        fi])
962b5d2086dSmrgfi])
963b9bb67cbSmrg
964b5d2086dSmrg# Test for the ability of xmlto to generate a text target
965b5d2086dSmrghave_xmlto_text=no
966b5d2086dSmrgcat > conftest.xml << "EOF"
967b5d2086dSmrgEOF
968b5d2086dSmrgAS_IF([test "$have_xmlto" = yes],
969b5d2086dSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
970b5d2086dSmrg             [have_xmlto_text=yes],
971b5d2086dSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
972b5d2086dSmrgrm -f conftest.xml
973b5d2086dSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
974b5d2086dSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
975b5d2086dSmrg]) # XORG_WITH_XMLTO
976b5d2086dSmrg
977b5d2086dSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
978b5d2086dSmrg# ----------------
979b5d2086dSmrg# Minimum version: 1.5.0
980b5d2086dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
981b5d2086dSmrg#
982b5d2086dSmrg# Documentation tools are not always available on all platforms and sometimes
983b5d2086dSmrg# not at the appropriate level. This macro enables a module to test for the
984b5d2086dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
985b5d2086dSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
986b5d2086dSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
987b5d2086dSmrg# --with-asciidoc assumes 'auto'.
988b5d2086dSmrg#
989b5d2086dSmrg# Interface to module:
990b5d2086dSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
991b5d2086dSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
992b5d2086dSmrg#		 returns the path set by the user in the environment
993b5d2086dSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
994b5d2086dSmrg#		  'no' user instructs the module not to use asciidoc
995b5d2086dSmrg#
996b5d2086dSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
997b5d2086dSmrg#
998b5d2086dSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
999b5d2086dSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1000b5d2086dSmrgm4_define([_defopt], m4_default([$2], [auto]))
1001b5d2086dSmrgAC_ARG_WITH(asciidoc,
1002b5d2086dSmrg	AS_HELP_STRING([--with-asciidoc],
1003b5d2086dSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1004b5d2086dSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1005b5d2086dSmrgm4_undefine([_defopt])
1006b5d2086dSmrg
1007b5d2086dSmrgif test "x$use_asciidoc" = x"auto"; then
1008b5d2086dSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1009b5d2086dSmrg   if test "x$ASCIIDOC" = "x"; then
1010b5d2086dSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1011b5d2086dSmrg	have_asciidoc=no
1012b5d2086dSmrg   else
1013b5d2086dSmrg        have_asciidoc=yes
1014b5d2086dSmrg   fi
1015b5d2086dSmrgelif test "x$use_asciidoc" = x"yes" ; then
1016b5d2086dSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1017b5d2086dSmrg   if test "x$ASCIIDOC" = "x"; then
1018b5d2086dSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1019b5d2086dSmrg   fi
1020b5d2086dSmrg   have_asciidoc=yes
1021b5d2086dSmrgelif test "x$use_asciidoc" = x"no" ; then
1022b5d2086dSmrg   if test "x$ASCIIDOC" != "x"; then
1023b5d2086dSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1024b5d2086dSmrg   fi
1025b5d2086dSmrg   have_asciidoc=no
1026b5d2086dSmrgelse
1027b5d2086dSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1028b5d2086dSmrgfi
1029b5d2086dSmrgm4_ifval([$1],
1030b5d2086dSmrg[if test "$have_asciidoc" = yes; then
1031b5d2086dSmrg    # scrape the asciidoc version
1032b5d2086dSmrg    AC_MSG_CHECKING([the asciidoc version])
1033b5d2086dSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1034b5d2086dSmrg    AC_MSG_RESULT([$asciidoc_version])
1035b5d2086dSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1036b5d2086dSmrg        [if test "x$use_asciidoc" = xauto; then
1037b5d2086dSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1038b5d2086dSmrg            have_asciidoc=no
1039b5d2086dSmrg        else
1040b5d2086dSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1041b5d2086dSmrg        fi])
1042b5d2086dSmrgfi])
1043b5d2086dSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1044b5d2086dSmrg]) # XORG_WITH_ASCIIDOC
1045b5d2086dSmrg
1046b5d2086dSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1047b5d2086dSmrg# --------------------------------
1048b5d2086dSmrg# Minimum version: 1.5.0
1049b5d2086dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1050b5d2086dSmrg#
1051b5d2086dSmrg# Documentation tools are not always available on all platforms and sometimes
1052b5d2086dSmrg# not at the appropriate level. This macro enables a module to test for the
1053b5d2086dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1054b5d2086dSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1055b5d2086dSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1056b5d2086dSmrg# --with-doxygen assumes 'auto'.
1057b5d2086dSmrg#
1058b5d2086dSmrg# Interface to module:
1059b5d2086dSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1060b5d2086dSmrg# DOXYGEN:	 returns the path of the doxygen program found
1061b5d2086dSmrg#		 returns the path set by the user in the environment
1062b5d2086dSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1063b5d2086dSmrg#		  'no' user instructs the module not to use doxygen
1064b5d2086dSmrg#
1065b5d2086dSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1066b5d2086dSmrg#
1067b5d2086dSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1068b5d2086dSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1069b5d2086dSmrgm4_define([_defopt], m4_default([$2], [auto]))
1070b5d2086dSmrgAC_ARG_WITH(doxygen,
1071b5d2086dSmrg	AS_HELP_STRING([--with-doxygen],
1072b5d2086dSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1073b5d2086dSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1074b5d2086dSmrgm4_undefine([_defopt])
1075b5d2086dSmrg
1076b5d2086dSmrgif test "x$use_doxygen" = x"auto"; then
1077b5d2086dSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1078b5d2086dSmrg   if test "x$DOXYGEN" = "x"; then
1079b5d2086dSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1080b5d2086dSmrg	have_doxygen=no
1081b5d2086dSmrg   else
1082b5d2086dSmrg        have_doxygen=yes
1083b5d2086dSmrg   fi
1084b5d2086dSmrgelif test "x$use_doxygen" = x"yes" ; then
1085b5d2086dSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1086b5d2086dSmrg   if test "x$DOXYGEN" = "x"; then
1087b5d2086dSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1088b5d2086dSmrg   fi
1089b5d2086dSmrg   have_doxygen=yes
1090b5d2086dSmrgelif test "x$use_doxygen" = x"no" ; then
1091b5d2086dSmrg   if test "x$DOXYGEN" != "x"; then
1092b5d2086dSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1093b5d2086dSmrg   fi
1094b5d2086dSmrg   have_doxygen=no
1095b5d2086dSmrgelse
1096b5d2086dSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1097b5d2086dSmrgfi
1098b5d2086dSmrgm4_ifval([$1],
1099b5d2086dSmrg[if test "$have_doxygen" = yes; then
1100b5d2086dSmrg    # scrape the doxygen version
1101b5d2086dSmrg    AC_MSG_CHECKING([the doxygen version])
1102b5d2086dSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1103b5d2086dSmrg    AC_MSG_RESULT([$doxygen_version])
1104b5d2086dSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1105b5d2086dSmrg        [if test "x$use_doxygen" = xauto; then
1106b5d2086dSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1107b5d2086dSmrg            have_doxygen=no
1108b5d2086dSmrg        else
1109b5d2086dSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1110b5d2086dSmrg        fi])
1111b5d2086dSmrgfi])
1112b5d2086dSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1113b5d2086dSmrg]) # XORG_WITH_DOXYGEN
1114b9bb67cbSmrg
1115b5d2086dSmrg# XORG_WITH_GROFF([DEFAULT])
1116b5d2086dSmrg# ----------------
1117b5d2086dSmrg# Minimum version: 1.6.0
1118b5d2086dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1119b5d2086dSmrg#
1120b5d2086dSmrg# Documentation tools are not always available on all platforms and sometimes
1121b5d2086dSmrg# not at the appropriate level. This macro enables a module to test for the
1122b5d2086dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1123b5d2086dSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
1124b5d2086dSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
1125b5d2086dSmrg# --with-groff assumes 'auto'.
1126b5d2086dSmrg#
1127b5d2086dSmrg# Interface to module:
1128b5d2086dSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1129b5d2086dSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1130b5d2086dSmrg# HAVE_GROFF_MS: the -ms macros package
1131b5d2086dSmrg# GROFF:	 returns the path of the groff program found
1132b5d2086dSmrg#		 returns the path set by the user in the environment
1133b5d2086dSmrg# --with-groff:	 'yes' user instructs the module to use groff
1134b5d2086dSmrg#		 'no' user instructs the module not to use groff
1135b5d2086dSmrg#
1136b5d2086dSmrg# Added in version 1.9.0:
1137b5d2086dSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1138b5d2086dSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1139b5d2086dSmrg#		   psselect from the psutils package.
1140b5d2086dSmrg#		   the ghostcript package. Refer to the grohtml man pages
1141b5d2086dSmrg#
1142b5d2086dSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1143b5d2086dSmrg#
1144b5d2086dSmrg# OS and distros often splits groff in a basic and full package, the former
1145b5d2086dSmrg# having the groff program and the later having devices, fonts and macros
1146b5d2086dSmrg# Checking for the groff executable is not enough.
1147b5d2086dSmrg#
1148b5d2086dSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
1149b5d2086dSmrg# unset HAVE_GROFF or GROFF env variables.
1150b5d2086dSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1151b5d2086dSmrg#
1152b5d2086dSmrgAC_DEFUN([XORG_WITH_GROFF],[
1153b5d2086dSmrgAC_ARG_VAR([GROFF], [Path to groff command])
1154b5d2086dSmrgm4_define([_defopt], m4_default([$1], [auto]))
1155b5d2086dSmrgAC_ARG_WITH(groff,
1156b5d2086dSmrg	AS_HELP_STRING([--with-groff],
1157b5d2086dSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1158b5d2086dSmrg	   [use_groff=$withval], [use_groff=]_defopt)
1159b5d2086dSmrgm4_undefine([_defopt])
1160b5d2086dSmrg
1161b5d2086dSmrgif test "x$use_groff" = x"auto"; then
1162b5d2086dSmrg   AC_PATH_PROG([GROFF], [groff])
1163b5d2086dSmrg   if test "x$GROFF" = "x"; then
1164b5d2086dSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1165b5d2086dSmrg	have_groff=no
1166b5d2086dSmrg   else
1167b5d2086dSmrg        have_groff=yes
1168b5d2086dSmrg   fi
1169b5d2086dSmrgelif test "x$use_groff" = x"yes" ; then
1170b5d2086dSmrg   AC_PATH_PROG([GROFF], [groff])
1171b5d2086dSmrg   if test "x$GROFF" = "x"; then
1172b5d2086dSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1173b5d2086dSmrg   fi
1174b5d2086dSmrg   have_groff=yes
1175b5d2086dSmrgelif test "x$use_groff" = x"no" ; then
1176b5d2086dSmrg   if test "x$GROFF" != "x"; then
1177b5d2086dSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1178b5d2086dSmrg   fi
1179b5d2086dSmrg   have_groff=no
1180b5d2086dSmrgelse
1181b5d2086dSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1182b5d2086dSmrgfi
1183b9bb67cbSmrg
1184b5d2086dSmrg# We have groff, test for the presence of the macro packages
1185b5d2086dSmrgif test "x$have_groff" = x"yes"; then
1186b5d2086dSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1187b5d2086dSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1188b5d2086dSmrg        groff_ms_works=yes
1189b5d2086dSmrg    else
1190b5d2086dSmrg        groff_ms_works=no
1191b5d2086dSmrg    fi
1192b5d2086dSmrg    AC_MSG_RESULT([$groff_ms_works])
1193b5d2086dSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1194b5d2086dSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1195b5d2086dSmrg        groff_mm_works=yes
1196b5d2086dSmrg    else
1197b5d2086dSmrg        groff_mm_works=no
1198b5d2086dSmrg    fi
1199b5d2086dSmrg    AC_MSG_RESULT([$groff_mm_works])
1200b5d2086dSmrgfi
1201b9bb67cbSmrg
1202b5d2086dSmrg# We have groff, test for HTML dependencies, one command per package
1203b5d2086dSmrgif test "x$have_groff" = x"yes"; then
1204b5d2086dSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1205b5d2086dSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1206b5d2086dSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1207b5d2086dSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1208b5d2086dSmrg      have_groff_html=yes
1209b5d2086dSmrg   else
1210b5d2086dSmrg      have_groff_html=no
1211b5d2086dSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1212b5d2086dSmrg   fi
1213b5d2086dSmrgfi
1214b9bb67cbSmrg
1215b5d2086dSmrg# Set Automake conditionals for Makefiles
1216b5d2086dSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1217b5d2086dSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1218b5d2086dSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1219b5d2086dSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1220b5d2086dSmrg]) # XORG_WITH_GROFF
1221b9bb67cbSmrg
1222b5d2086dSmrg# XORG_WITH_FOP([DEFAULT])
1223b5d2086dSmrg# ----------------
1224b5d2086dSmrg# Minimum version: 1.6.0
1225b5d2086dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1226b5d2086dSmrg#
1227b5d2086dSmrg# Documentation tools are not always available on all platforms and sometimes
1228b5d2086dSmrg# not at the appropriate level. This macro enables a module to test for the
1229b5d2086dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1230b5d2086dSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
1231b5d2086dSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
1232b5d2086dSmrg# --with-fop assumes 'auto'.
1233b5d2086dSmrg#
1234b5d2086dSmrg# Interface to module:
1235b5d2086dSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1236b5d2086dSmrg# FOP:	 	returns the path of the fop program found
1237b5d2086dSmrg#		returns the path set by the user in the environment
1238b5d2086dSmrg# --with-fop: 	'yes' user instructs the module to use fop
1239b5d2086dSmrg#		'no' user instructs the module not to use fop
1240b5d2086dSmrg#
1241b5d2086dSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1242b5d2086dSmrg#
1243b5d2086dSmrgAC_DEFUN([XORG_WITH_FOP],[
1244b5d2086dSmrgAC_ARG_VAR([FOP], [Path to fop command])
1245b5d2086dSmrgm4_define([_defopt], m4_default([$1], [auto]))
1246b5d2086dSmrgAC_ARG_WITH(fop,
1247b5d2086dSmrg	AS_HELP_STRING([--with-fop],
1248b5d2086dSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1249b5d2086dSmrg	   [use_fop=$withval], [use_fop=]_defopt)
1250b5d2086dSmrgm4_undefine([_defopt])
1251b5d2086dSmrg
1252b5d2086dSmrgif test "x$use_fop" = x"auto"; then
1253b5d2086dSmrg   AC_PATH_PROG([FOP], [fop])
1254b5d2086dSmrg   if test "x$FOP" = "x"; then
1255b5d2086dSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1256b5d2086dSmrg	have_fop=no
1257b5d2086dSmrg   else
1258b5d2086dSmrg        have_fop=yes
1259b5d2086dSmrg   fi
1260b5d2086dSmrgelif test "x$use_fop" = x"yes" ; then
1261b5d2086dSmrg   AC_PATH_PROG([FOP], [fop])
1262b5d2086dSmrg   if test "x$FOP" = "x"; then
1263b5d2086dSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1264b5d2086dSmrg   fi
1265b5d2086dSmrg   have_fop=yes
1266b5d2086dSmrgelif test "x$use_fop" = x"no" ; then
1267b5d2086dSmrg   if test "x$FOP" != "x"; then
1268b5d2086dSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1269b5d2086dSmrg   fi
1270b5d2086dSmrg   have_fop=no
1271b5d2086dSmrgelse
1272b5d2086dSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1273b5d2086dSmrgfi
1274b5d2086dSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1275b5d2086dSmrg]) # XORG_WITH_FOP
1276b9bb67cbSmrg
1277b5d2086dSmrg# XORG_WITH_PS2PDF([DEFAULT])
1278b5d2086dSmrg# ----------------
1279b5d2086dSmrg# Minimum version: 1.6.0
1280b5d2086dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1281b5d2086dSmrg#
1282b5d2086dSmrg# Documentation tools are not always available on all platforms and sometimes
1283b5d2086dSmrg# not at the appropriate level. This macro enables a module to test for the
1284b5d2086dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1285b5d2086dSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1286b5d2086dSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1287b5d2086dSmrg# --with-ps2pdf assumes 'auto'.
1288b5d2086dSmrg#
1289b5d2086dSmrg# Interface to module:
1290b5d2086dSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1291b5d2086dSmrg# PS2PDF:	returns the path of the ps2pdf program found
1292b5d2086dSmrg#		returns the path set by the user in the environment
1293b5d2086dSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1294b5d2086dSmrg#		 'no' user instructs the module not to use ps2pdf
1295b5d2086dSmrg#
1296b5d2086dSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1297b5d2086dSmrg#
1298b5d2086dSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1299b5d2086dSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1300b5d2086dSmrgm4_define([_defopt], m4_default([$1], [auto]))
1301b5d2086dSmrgAC_ARG_WITH(ps2pdf,
1302b5d2086dSmrg	AS_HELP_STRING([--with-ps2pdf],
1303b5d2086dSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1304b5d2086dSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1305b5d2086dSmrgm4_undefine([_defopt])
1306b5d2086dSmrg
1307b5d2086dSmrgif test "x$use_ps2pdf" = x"auto"; then
1308b5d2086dSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1309b5d2086dSmrg   if test "x$PS2PDF" = "x"; then
1310b5d2086dSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1311b5d2086dSmrg	have_ps2pdf=no
1312b5d2086dSmrg   else
1313b5d2086dSmrg        have_ps2pdf=yes
1314b5d2086dSmrg   fi
1315b5d2086dSmrgelif test "x$use_ps2pdf" = x"yes" ; then
1316b5d2086dSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1317b5d2086dSmrg   if test "x$PS2PDF" = "x"; then
1318b5d2086dSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1319b5d2086dSmrg   fi
1320b5d2086dSmrg   have_ps2pdf=yes
1321b5d2086dSmrgelif test "x$use_ps2pdf" = x"no" ; then
1322b5d2086dSmrg   if test "x$PS2PDF" != "x"; then
1323b5d2086dSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1324b5d2086dSmrg   fi
1325b5d2086dSmrg   have_ps2pdf=no
1326b5d2086dSmrgelse
1327b5d2086dSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1328b5d2086dSmrgfi
1329b5d2086dSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1330b5d2086dSmrg]) # XORG_WITH_PS2PDF
1331b9bb67cbSmrg
1332b5d2086dSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
1333b5d2086dSmrg# ----------------
1334b5d2086dSmrg# Minimum version: 1.6.0
1335b5d2086dSmrg#
1336b5d2086dSmrg# Documentation tools are not always available on all platforms and sometimes
1337b5d2086dSmrg# not at the appropriate level. This macro enables a builder to skip all
1338b5d2086dSmrg# documentation targets except traditional man pages.
1339b5d2086dSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1340b5d2086dSmrg# maximum flexibilty in controlling documentation building.
1341b5d2086dSmrg# Refer to:
1342b5d2086dSmrg# XORG_WITH_XMLTO         --with-xmlto
1343b5d2086dSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1344b5d2086dSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1345b5d2086dSmrg# XORG_WITH_FOP           --with-fop
1346b5d2086dSmrg# XORG_WITH_GROFF         --with-groff
1347b5d2086dSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1348b5d2086dSmrg#
1349b5d2086dSmrg# Interface to module:
1350b5d2086dSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1351b5d2086dSmrg# --enable-docs: 'yes' user instructs the module to generate docs
1352b5d2086dSmrg#		 'no' user instructs the module not to generate docs
1353b5d2086dSmrg# parm1:	specify the default value, yes or no.
1354b5d2086dSmrg#
1355b5d2086dSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1356b5d2086dSmrgm4_define([default], m4_default([$1], [yes]))
1357b5d2086dSmrgAC_ARG_ENABLE(docs,
1358b5d2086dSmrg	AS_HELP_STRING([--enable-docs],
1359b5d2086dSmrg	   [Enable building the documentation (default: ]default[)]),
1360b5d2086dSmrg	   [build_docs=$enableval], [build_docs=]default)
1361b5d2086dSmrgm4_undefine([default])
1362b5d2086dSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1363b5d2086dSmrgAC_MSG_CHECKING([whether to build documentation])
1364b5d2086dSmrgAC_MSG_RESULT([$build_docs])
1365b5d2086dSmrg]) # XORG_ENABLE_DOCS
1366b5d2086dSmrg
1367b5d2086dSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1368b5d2086dSmrg# ----------------
1369b5d2086dSmrg# Minimum version: 1.6.0
1370b5d2086dSmrg#
1371b5d2086dSmrg# This macro enables a builder to skip all developer documentation.
1372b5d2086dSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1373b5d2086dSmrg# maximum flexibilty in controlling documentation building.
1374b5d2086dSmrg# Refer to:
1375b5d2086dSmrg# XORG_WITH_XMLTO         --with-xmlto
1376b5d2086dSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1377b5d2086dSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1378b5d2086dSmrg# XORG_WITH_FOP           --with-fop
1379b5d2086dSmrg# XORG_WITH_GROFF         --with-groff
1380b5d2086dSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1381b5d2086dSmrg#
1382b5d2086dSmrg# Interface to module:
1383b5d2086dSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1384b5d2086dSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1385b5d2086dSmrg#			'no' user instructs the module not to generate developer docs
1386b5d2086dSmrg# parm1:		specify the default value, yes or no.
1387b5d2086dSmrg#
1388b5d2086dSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1389b5d2086dSmrgm4_define([devel_default], m4_default([$1], [yes]))
1390b5d2086dSmrgAC_ARG_ENABLE(devel-docs,
1391b5d2086dSmrg	AS_HELP_STRING([--enable-devel-docs],
1392b5d2086dSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1393b5d2086dSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1394b5d2086dSmrgm4_undefine([devel_default])
1395b5d2086dSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1396b5d2086dSmrgAC_MSG_CHECKING([whether to build developer documentation])
1397b5d2086dSmrgAC_MSG_RESULT([$build_devel_docs])
1398b5d2086dSmrg]) # XORG_ENABLE_DEVEL_DOCS
1399b5d2086dSmrg
1400b5d2086dSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
1401b5d2086dSmrg# ----------------
1402b5d2086dSmrg# Minimum version: 1.6.0
1403b5d2086dSmrg#
1404b5d2086dSmrg# This macro enables a builder to skip all functional specification targets.
1405b5d2086dSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1406b5d2086dSmrg# maximum flexibilty in controlling documentation building.
1407b5d2086dSmrg# Refer to:
1408b5d2086dSmrg# XORG_WITH_XMLTO         --with-xmlto
1409b5d2086dSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1410b5d2086dSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1411b5d2086dSmrg# XORG_WITH_FOP           --with-fop
1412b5d2086dSmrg# XORG_WITH_GROFF         --with-groff
1413b5d2086dSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1414b5d2086dSmrg#
1415b5d2086dSmrg# Interface to module:
1416b5d2086dSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1417b5d2086dSmrg# --enable-specs:	'yes' user instructs the module to generate specs
1418b5d2086dSmrg#			'no' user instructs the module not to generate specs
1419b5d2086dSmrg# parm1:		specify the default value, yes or no.
1420b5d2086dSmrg#
1421b5d2086dSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1422b5d2086dSmrgm4_define([spec_default], m4_default([$1], [yes]))
1423b5d2086dSmrgAC_ARG_ENABLE(specs,
1424b5d2086dSmrg	AS_HELP_STRING([--enable-specs],
1425b5d2086dSmrg	   [Enable building the specs (default: ]spec_default[)]),
1426b5d2086dSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
1427b5d2086dSmrgm4_undefine([spec_default])
1428b5d2086dSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1429b5d2086dSmrgAC_MSG_CHECKING([whether to build functional specifications])
1430b5d2086dSmrgAC_MSG_RESULT([$build_specs])
1431b5d2086dSmrg]) # XORG_ENABLE_SPECS
1432b9bb67cbSmrg
1433b5d2086dSmrg# XORG_CHECK_MALLOC_ZERO
1434b5d2086dSmrg# ----------------------
1435b5d2086dSmrg# Minimum version: 1.0.0
1436b5d2086dSmrg#
1437b5d2086dSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1438b5d2086dSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1439b5d2086dSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1440b5d2086dSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1441b5d2086dSmrgAC_ARG_ENABLE(malloc0returnsnull,
1442b5d2086dSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1443b5d2086dSmrg		       [malloc(0) returns NULL (default: auto)]),
1444b5d2086dSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1445b5d2086dSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1446b9bb67cbSmrg
1447b5d2086dSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1448b5d2086dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1449b5d2086dSmrg	AC_RUN_IFELSE([
1450b5d2086dSmrgchar *malloc();
1451b5d2086dSmrgchar *realloc();
1452b5d2086dSmrgchar *calloc();
1453b5d2086dSmrgmain() {
1454b5d2086dSmrg    char *m0, *r0, *c0, *p;
1455b5d2086dSmrg    m0 = malloc(0);
1456b5d2086dSmrg    p = malloc(10);
1457b5d2086dSmrg    r0 = realloc(p,0);
1458b5d2086dSmrg    c0 = calloc(0);
1459b5d2086dSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1460b5d2086dSmrg}],
1461b5d2086dSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1462b5d2086dSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
1463b5d2086dSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1464b5d2086dSmrgfi
1465b5d2086dSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1466b9bb67cbSmrg
1467b5d2086dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1468b5d2086dSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1469b5d2086dSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1470b5d2086dSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1471b5d2086dSmrgelse
1472b5d2086dSmrg	MALLOC_ZERO_CFLAGS=""
1473b5d2086dSmrg	XMALLOC_ZERO_CFLAGS=""
1474b5d2086dSmrg	XTMALLOC_ZERO_CFLAGS=""
1475b5d2086dSmrgfi
1476b5d2086dSmrg
1477b5d2086dSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1478b5d2086dSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1479b5d2086dSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1480b5d2086dSmrg]) # XORG_CHECK_MALLOC_ZERO
1481b9bb67cbSmrg
1482b5d2086dSmrg# XORG_WITH_LINT()
1483b5d2086dSmrg# ----------------
1484b9bb67cbSmrg# Minimum version: 1.1.0
1485b9bb67cbSmrg#
1486b5d2086dSmrg# This macro enables the use of a tool that flags some suspicious and
1487b5d2086dSmrg# non-portable constructs (likely to be bugs) in C language source code.
1488b5d2086dSmrg# It will attempt to locate the tool and use appropriate options.
1489b5d2086dSmrg# There are various lint type tools on different platforms.
1490b9bb67cbSmrg#
1491b5d2086dSmrg# Interface to module:
1492b5d2086dSmrg# LINT:		returns the path to the tool found on the platform
1493b5d2086dSmrg#		or the value set to LINT on the configure cmd line
1494b5d2086dSmrg#		also an Automake conditional
1495b5d2086dSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
1496b9bb67cbSmrg#
1497b5d2086dSmrg# --with-lint:	'yes' user instructs the module to use lint
1498b5d2086dSmrg#		'no' user instructs the module not to use lint (default)
1499b9bb67cbSmrg#
1500b5d2086dSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1501b5d2086dSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1502b5d2086dSmrg#
1503b5d2086dSmrgAC_DEFUN([XORG_WITH_LINT],[
1504b9bb67cbSmrg
1505b5d2086dSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1506b5d2086dSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1507b5d2086dSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1508b5d2086dSmrg		[Use a lint-style source code checker (default: disabled)])],
1509b5d2086dSmrg		[use_lint=$withval], [use_lint=no])
1510b9bb67cbSmrg
1511b5d2086dSmrg# Obtain platform specific info like program name and options
1512b5d2086dSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1513b5d2086dSmrgcase $host_os in
1514b5d2086dSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1515b5d2086dSmrg	lint_name=splint
1516b5d2086dSmrg	lint_options="-badflag"
1517b5d2086dSmrg	;;
1518b5d2086dSmrg  *freebsd* | *netbsd*)
1519b5d2086dSmrg	lint_name=lint
1520b5d2086dSmrg	lint_options="-u -b"
1521b5d2086dSmrg	;;
1522b5d2086dSmrg  *solaris*)
1523b5d2086dSmrg	lint_name=lint
1524b5d2086dSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1525b5d2086dSmrg	;;
1526b5d2086dSmrgesac
1527b9bb67cbSmrg
1528b5d2086dSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1529b5d2086dSmrgif test "x$use_lint" = x"yes" ; then
1530b5d2086dSmrg   AC_PATH_PROG([LINT], [$lint_name])
1531b5d2086dSmrg   if test "x$LINT" = "x"; then
1532b5d2086dSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1533b5d2086dSmrg   fi
1534b5d2086dSmrgelif test "x$use_lint" = x"no" ; then
1535b5d2086dSmrg   if test "x$LINT" != "x"; then
1536b5d2086dSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1537b5d2086dSmrg   fi
1538b5d2086dSmrgelse
1539b5d2086dSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1540b5d2086dSmrgfi
1541b9bb67cbSmrg
1542b5d2086dSmrg# User supplied flags override default flags
1543b5d2086dSmrgif test "x$LINT_FLAGS" != "x"; then
1544b5d2086dSmrg   lint_options=$LINT_FLAGS
1545b5d2086dSmrgfi
1546b9bb67cbSmrg
1547b5d2086dSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1548b5d2086dSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1549b9bb67cbSmrg
1550b5d2086dSmrg]) # XORG_WITH_LINT
1551b9bb67cbSmrg
1552b5d2086dSmrg# XORG_LINT_LIBRARY(LIBNAME)
1553b5d2086dSmrg# --------------------------
1554b9bb67cbSmrg# Minimum version: 1.1.0
1555b9bb67cbSmrg#
1556b5d2086dSmrg# Sets up flags for building lint libraries for checking programs that call
1557b5d2086dSmrg# functions in the library.
1558b9bb67cbSmrg#
1559b5d2086dSmrg# Interface to module:
1560b5d2086dSmrg# LINTLIB		- Automake variable with the name of lint library file to make
1561b5d2086dSmrg# MAKE_LINT_LIB		- Automake conditional
1562b9bb67cbSmrg#
1563b5d2086dSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1564b5d2086dSmrg#			  - 'no' user instructs the module not to create a lint library (default)
15651cc8c64fSmrg
1566b5d2086dSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1567b5d2086dSmrgAC_REQUIRE([XORG_WITH_LINT])
1568b5d2086dSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1569b5d2086dSmrg	[Create lint library (default: disabled)])],
1570b5d2086dSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
15711cc8c64fSmrg
1572b5d2086dSmrgif test "x$make_lint_lib" = x"yes" ; then
1573b5d2086dSmrg   LINTLIB=llib-l$1.ln
1574b5d2086dSmrg   if test "x$LINT" = "x"; then
1575b5d2086dSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1576b5d2086dSmrg   fi
1577b5d2086dSmrgelif test "x$make_lint_lib" != x"no" ; then
1578b5d2086dSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1579b5d2086dSmrgfi
15801cc8c64fSmrg
1581b5d2086dSmrgAC_SUBST(LINTLIB)
1582b5d2086dSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
15831cc8c64fSmrg
1584b5d2086dSmrg]) # XORG_LINT_LIBRARY
15851cc8c64fSmrg
1586b5d2086dSmrg# XORG_CWARNFLAGS
1587b5d2086dSmrg# ---------------
1588b5d2086dSmrg# Minimum version: 1.2.0
1589b9bb67cbSmrg#
1590b5d2086dSmrg# Defines CWARNFLAGS to enable C compiler warnings.
1591b9bb67cbSmrg#
1592b5d2086dSmrgAC_DEFUN([XORG_CWARNFLAGS], [
1593b5d2086dSmrgAC_REQUIRE([AC_PROG_CC_C99])
1594b5d2086dSmrgif  test "x$GCC" = xyes ; then
1595b5d2086dSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1596b5d2086dSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1597b5d2086dSmrg-Wbad-function-cast -Wformat=2"
1598b5d2086dSmrg    case `$CC -dumpversion` in
1599b5d2086dSmrg    3.4.* | 4.*)
1600b5d2086dSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1601b5d2086dSmrg	;;
1602b5d2086dSmrg    esac
1603b5d2086dSmrgelse
1604b5d2086dSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1605b5d2086dSmrg    if test "x$SUNCC" = "xyes"; then
1606b5d2086dSmrg	CWARNFLAGS="-v"
1607b5d2086dSmrg    fi
1608b5d2086dSmrgfi
1609b5d2086dSmrgAC_SUBST(CWARNFLAGS)
1610b5d2086dSmrg]) # XORG_CWARNFLAGS
16111cc8c64fSmrg
1612b5d2086dSmrg# XORG_STRICT_OPTION
1613b5d2086dSmrg# -----------------------
1614b5d2086dSmrg# Minimum version: 1.3.0
1615b9bb67cbSmrg#
1616b5d2086dSmrg# Add configure option to enable strict compilation
1617b5d2086dSmrgAC_DEFUN([XORG_STRICT_OPTION], [
1618b5d2086dSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
1619b5d2086dSmrgAC_REQUIRE([AC_PROG_CC_C99])
1620b5d2086dSmrgAC_REQUIRE([XORG_CWARNFLAGS])
16211cc8c64fSmrg
1622b5d2086dSmrgAC_ARG_ENABLE(strict-compilation,
1623b5d2086dSmrg			  AS_HELP_STRING([--enable-strict-compilation],
1624b5d2086dSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1625b5d2086dSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1626b5d2086dSmrgif test "x$STRICT_COMPILE" = "xyes"; then
1627b5d2086dSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1628b5d2086dSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1629b5d2086dSmrg	if test "x$GCC" = xyes ; then
1630b5d2086dSmrg		STRICT_CFLAGS="-pedantic -Werror"
1631b5d2086dSmrg	elif test "x$SUNCC" = "xyes"; then
1632b5d2086dSmrg		STRICT_CFLAGS="-errwarn"
1633b5d2086dSmrg    elif test "x$INTELCC" = "xyes"; then
1634b5d2086dSmrg		STRICT_CFLAGS="-Werror"
1635b5d2086dSmrg	fi
1636b5d2086dSmrgfi
1637b5d2086dSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1638b5d2086dSmrgAC_SUBST([CWARNFLAGS])
1639b5d2086dSmrg]) # XORG_STRICT_OPTION
16401cc8c64fSmrg
1641b5d2086dSmrg# XORG_DEFAULT_OPTIONS
1642b9bb67cbSmrg# --------------------
1643b5d2086dSmrg# Minimum version: 1.3.0
1644b9bb67cbSmrg#
1645b5d2086dSmrg# Defines default options for X.Org modules.
1646b5d2086dSmrg#
1647b5d2086dSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1648b5d2086dSmrgAC_REQUIRE([AC_PROG_INSTALL])
1649b5d2086dSmrgXORG_CWARNFLAGS
1650b5d2086dSmrgXORG_STRICT_OPTION
1651b5d2086dSmrgXORG_RELEASE_VERSION
1652b5d2086dSmrgXORG_CHANGELOG
1653b5d2086dSmrgXORG_INSTALL
1654b5d2086dSmrgXORG_MANPAGE_SECTIONS
1655b5d2086dSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1656b5d2086dSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1657b5d2086dSmrg]) # XORG_DEFAULT_OPTIONS
1658b9bb67cbSmrg
1659b5d2086dSmrg# XORG_INSTALL()
1660b5d2086dSmrg# ----------------
1661b5d2086dSmrg# Minimum version: 1.4.0
1662b5d2086dSmrg#
1663b5d2086dSmrg# Defines the variable INSTALL_CMD as the command to copy
1664b5d2086dSmrg# INSTALL from $prefix/share/util-macros.
1665b5d2086dSmrg#
1666b5d2086dSmrgAC_DEFUN([XORG_INSTALL], [
1667b5d2086dSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1668b5d2086dSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1669b5d2086dSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1670b5d2086dSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1671b5d2086dSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1672b5d2086dSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1673b5d2086dSmrgAC_SUBST([INSTALL_CMD])
1674b5d2086dSmrg]) # XORG_INSTALL
1675b5d2086dSmrgdnl Copyright 2005 Red Hat, Inc
1676b5d2086dSmrgdnl
1677b5d2086dSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1678b5d2086dSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1679b5d2086dSmrgdnl the above copyright notice appear in all copies and that both that
1680b5d2086dSmrgdnl copyright notice and this permission notice appear in supporting
1681b5d2086dSmrgdnl documentation.
1682b5d2086dSmrgdnl
1683b5d2086dSmrgdnl The above copyright notice and this permission notice shall be included
1684b5d2086dSmrgdnl in all copies or substantial portions of the Software.
1685b5d2086dSmrgdnl
1686b5d2086dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1687b5d2086dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1688b5d2086dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1689b5d2086dSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1690b5d2086dSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1691b5d2086dSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1692b5d2086dSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1693b5d2086dSmrgdnl
1694b5d2086dSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1695b5d2086dSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1696b5d2086dSmrgdnl other dealings in this Software without prior written authorization
1697b5d2086dSmrgdnl from the copyright holders.
1698b5d2086dSmrgdnl
1699b9bb67cbSmrg
1700b5d2086dSmrg# XORG_RELEASE_VERSION
1701b5d2086dSmrg# --------------------
1702b5d2086dSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1703b5d2086dSmrg 
1704b5d2086dSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1705b5d2086dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1706b5d2086dSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1707b5d2086dSmrg		[Major version of this package])
1708b5d2086dSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1709b5d2086dSmrg	if test "x$PVM" = "x"; then
1710b5d2086dSmrg		PVM="0"
1711b9bb67cbSmrg	fi
1712b5d2086dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1713b5d2086dSmrg		[$PVM],
1714b5d2086dSmrg		[Minor version of this package])
1715b5d2086dSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1716b5d2086dSmrg	if test "x$PVP" = "x"; then
1717b5d2086dSmrg		PVP="0"
1718b9bb67cbSmrg	fi
1719b5d2086dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1720b5d2086dSmrg		[$PVP],
1721b5d2086dSmrg		[Patch version of this package])
1722b9bb67cbSmrg])
17231cc8c64fSmrg
1724b5d2086dSmrg# XORG_CHANGELOG()
1725b5d2086dSmrg# ----------------
1726b5d2086dSmrg# Minimum version: 1.2.0
1727b9bb67cbSmrg#
1728b5d2086dSmrg# Defines the variable CHANGELOG_CMD as the command to generate
1729b5d2086dSmrg# ChangeLog from git.
1730b5d2086dSmrg#
1731b5d2086dSmrg#
1732b5d2086dSmrgAC_DEFUN([XORG_CHANGELOG], [
1733b5d2086dSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1734b5d2086dSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1735b5d2086dSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1736b5d2086dSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1737b5d2086dSmrgAC_SUBST([CHANGELOG_CMD])
1738b5d2086dSmrg]) # XORG_CHANGELOG
1739b9bb67cbSmrg
1740b5d2086dSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
1741b5d2086dSmrg#
1742b5d2086dSmrg# This file is free software; the Free Software Foundation
1743b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
1744b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
1745b9bb67cbSmrg
1746b5d2086dSmrg# AM_AUTOMAKE_VERSION(VERSION)
1747b5d2086dSmrg# ----------------------------
1748b5d2086dSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
1749b5d2086dSmrg# generated from the m4 files accompanying Automake X.Y.
1750b5d2086dSmrg# (This private macro should not be called outside this file.)
1751b5d2086dSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
1752b5d2086dSmrg[am__api_version='1.11'
1753b5d2086dSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1754b5d2086dSmrgdnl require some minimum version.  Point them to the right macro.
1755b5d2086dSmrgm4_if([$1], [1.11.1], [],
1756b5d2086dSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1757b5d2086dSmrg])
1758b9bb67cbSmrg
1759b5d2086dSmrg# _AM_AUTOCONF_VERSION(VERSION)
1760b5d2086dSmrg# -----------------------------
1761b5d2086dSmrg# aclocal traces this macro to find the Autoconf version.
1762b5d2086dSmrg# This is a private macro too.  Using m4_define simplifies
1763b5d2086dSmrg# the logic in aclocal, which can simply ignore this definition.
1764b5d2086dSmrgm4_define([_AM_AUTOCONF_VERSION], [])
17651cc8c64fSmrg
1766b5d2086dSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
1767b5d2086dSmrg# -------------------------------
1768b5d2086dSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1769b5d2086dSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1770b5d2086dSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1771b5d2086dSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
1772b5d2086dSmrgm4_ifndef([AC_AUTOCONF_VERSION],
1773b5d2086dSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1774b5d2086dSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
17751cc8c64fSmrg
1776b5d2086dSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1777b9bb67cbSmrg
1778b5d2086dSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
17791cc8c64fSmrg#
1780b5d2086dSmrg# This file is free software; the Free Software Foundation
1781b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
1782b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
1783b5d2086dSmrg
1784b5d2086dSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1785b5d2086dSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
1786b5d2086dSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1787b9bb67cbSmrg#
1788b5d2086dSmrg# Of course, Automake must honor this variable whenever it calls a
1789b5d2086dSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
1790b5d2086dSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
1791b5d2086dSmrg# depending on how configure is run.  This is pretty annoying, since
1792b5d2086dSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
1793b5d2086dSmrg# source directory, any form will work fine, but in subdirectories a
1794b5d2086dSmrg# relative path needs to be adjusted first.
1795b9bb67cbSmrg#
1796b5d2086dSmrg# $ac_aux_dir/missing
1797b5d2086dSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
1798b5d2086dSmrg# $top_srcdir/$ac_aux_dir/missing
1799b5d2086dSmrg#    fails if $ac_aux_dir is absolute,
1800b5d2086dSmrg#    fails when called from a subdirectory in a VPATH build with
1801b5d2086dSmrg#          a relative $ac_aux_dir
1802b9bb67cbSmrg#
1803b5d2086dSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1804b5d2086dSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
1805b5d2086dSmrg# harmless because $srcdir is `.', but things will broke when you
1806b5d2086dSmrg# start a VPATH build or use an absolute $srcdir.
1807b9bb67cbSmrg#
1808b5d2086dSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1809b5d2086dSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1810b5d2086dSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1811b5d2086dSmrg# and then we would define $MISSING as
1812b5d2086dSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
1813b5d2086dSmrg# This will work as long as MISSING is not called from configure, because
1814b5d2086dSmrg# unfortunately $(top_srcdir) has no meaning in configure.
1815b5d2086dSmrg# However there are other variables, like CC, which are often used in
1816b5d2086dSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1817b5d2086dSmrg#
1818b5d2086dSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
1819b5d2086dSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
1820b5d2086dSmrg# configured tree to be moved without reconfiguration.
1821b9bb67cbSmrg
1822b5d2086dSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1823b5d2086dSmrg[dnl Rely on autoconf to set up CDPATH properly.
1824b5d2086dSmrgAC_PREREQ([2.50])dnl
1825b5d2086dSmrg# expand $ac_aux_dir to an absolute path
1826b5d2086dSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
1827b5d2086dSmrg])
1828b5d2086dSmrg
1829b5d2086dSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1830b5d2086dSmrg
1831b5d2086dSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1832b5d2086dSmrg# Free Software Foundation, Inc.
1833b5d2086dSmrg#
1834b5d2086dSmrg# This file is free software; the Free Software Foundation
1835b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
1836b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
18371cc8c64fSmrg
1838b5d2086dSmrg# serial 9
1839b5d2086dSmrg
1840b5d2086dSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1841b5d2086dSmrg# -------------------------------------
1842b5d2086dSmrg# Define a conditional.
1843b5d2086dSmrgAC_DEFUN([AM_CONDITIONAL],
1844b5d2086dSmrg[AC_PREREQ(2.52)dnl
1845b5d2086dSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1846b5d2086dSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1847b5d2086dSmrgAC_SUBST([$1_TRUE])dnl
1848b5d2086dSmrgAC_SUBST([$1_FALSE])dnl
1849b5d2086dSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1850b5d2086dSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1851b5d2086dSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1852b5d2086dSmrgif $2; then
1853b5d2086dSmrg  $1_TRUE=
1854b5d2086dSmrg  $1_FALSE='#'
1855b9bb67cbSmrgelse
1856b5d2086dSmrg  $1_TRUE='#'
1857b5d2086dSmrg  $1_FALSE=
1858b9bb67cbSmrgfi
1859b5d2086dSmrgAC_CONFIG_COMMANDS_PRE(
1860b5d2086dSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1861b5d2086dSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1862b5d2086dSmrgUsually this means the macro was only invoked conditionally.]])
1863b5d2086dSmrgfi])])
18641cc8c64fSmrg
1865b5d2086dSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1866b5d2086dSmrg# Free Software Foundation, Inc.
1867b9bb67cbSmrg#
1868b5d2086dSmrg# This file is free software; the Free Software Foundation
1869b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
1870b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
18711cc8c64fSmrg
1872b5d2086dSmrg# serial 10
18731cc8c64fSmrg
1874b5d2086dSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1875b5d2086dSmrg# written in clear, in which case automake, when reading aclocal.m4,
1876b5d2086dSmrg# will think it sees a *use*, and therefore will trigger all it's
1877b5d2086dSmrg# C support machinery.  Also note that it means that autoscan, seeing
1878b5d2086dSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
18791cc8c64fSmrg
18801cc8c64fSmrg
1881b5d2086dSmrg# _AM_DEPENDENCIES(NAME)
1882b5d2086dSmrg# ----------------------
1883b5d2086dSmrg# See how the compiler implements dependency checking.
1884b5d2086dSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1885b5d2086dSmrg# We try a few techniques and use that to set a single cache variable.
1886b5d2086dSmrg#
1887b5d2086dSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1888b5d2086dSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1889b5d2086dSmrg# dependency, and given that the user is not expected to run this macro,
1890b5d2086dSmrg# just rely on AC_PROG_CC.
1891b5d2086dSmrgAC_DEFUN([_AM_DEPENDENCIES],
1892b5d2086dSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1893b5d2086dSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1894b5d2086dSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1895b5d2086dSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
18961cc8c64fSmrg
1897b5d2086dSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1898b5d2086dSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1899b5d2086dSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1900b5d2086dSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1901b5d2086dSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1902b5d2086dSmrg                   [depcc="$$1"   am_compiler_list=])
19031cc8c64fSmrg
1904b5d2086dSmrgAC_CACHE_CHECK([dependency style of $depcc],
1905b5d2086dSmrg               [am_cv_$1_dependencies_compiler_type],
1906b5d2086dSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1907b5d2086dSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1908b5d2086dSmrg  # making bogus files that we don't know about and never remove.  For
1909b5d2086dSmrg  # instance it was reported that on HP-UX the gcc test will end up
1910b5d2086dSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1911b5d2086dSmrg  # in D'.
1912b5d2086dSmrg  mkdir conftest.dir
1913b5d2086dSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1914b5d2086dSmrg  # using a relative directory.
1915b5d2086dSmrg  cp "$am_depcomp" conftest.dir
1916b5d2086dSmrg  cd conftest.dir
1917b5d2086dSmrg  # We will build objects and dependencies in a subdirectory because
1918b5d2086dSmrg  # it helps to detect inapplicable dependency modes.  For instance
1919b5d2086dSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1920b5d2086dSmrg  # side effect of compilation, but ICC will put the dependencies in
1921b5d2086dSmrg  # the current directory while Tru64 will put them in the object
1922b5d2086dSmrg  # directory.
1923b5d2086dSmrg  mkdir sub
19241cc8c64fSmrg
1925b5d2086dSmrg  am_cv_$1_dependencies_compiler_type=none
1926b5d2086dSmrg  if test "$am_compiler_list" = ""; then
1927b5d2086dSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1928b5d2086dSmrg  fi
1929b5d2086dSmrg  am__universal=false
1930b5d2086dSmrg  m4_case([$1], [CC],
1931b5d2086dSmrg    [case " $depcc " in #(
1932b5d2086dSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1933b5d2086dSmrg     esac],
1934b5d2086dSmrg    [CXX],
1935b5d2086dSmrg    [case " $depcc " in #(
1936b5d2086dSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1937b5d2086dSmrg     esac])
1938b5d2086dSmrg
1939b5d2086dSmrg  for depmode in $am_compiler_list; do
1940b5d2086dSmrg    # Setup a source with many dependencies, because some compilers
1941b5d2086dSmrg    # like to wrap large dependency lists on column 80 (with \), and
1942b5d2086dSmrg    # we should not choose a depcomp mode which is confused by this.
1943b5d2086dSmrg    #
1944b5d2086dSmrg    # We need to recreate these files for each test, as the compiler may
1945b5d2086dSmrg    # overwrite some of them when testing with obscure command lines.
1946b5d2086dSmrg    # This happens at least with the AIX C compiler.
1947b5d2086dSmrg    : > sub/conftest.c
1948b5d2086dSmrg    for i in 1 2 3 4 5 6; do
1949b5d2086dSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
1950b5d2086dSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1951b5d2086dSmrg      # Solaris 8's {/usr,}/bin/sh.
1952b5d2086dSmrg      touch sub/conftst$i.h
1953b5d2086dSmrg    done
1954b5d2086dSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1955b5d2086dSmrg
1956b5d2086dSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
1957b5d2086dSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
1958b5d2086dSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
1959b5d2086dSmrg    # versions had trouble with output in subdirs
1960b5d2086dSmrg    am__obj=sub/conftest.${OBJEXT-o}
1961b5d2086dSmrg    am__minus_obj="-o $am__obj"
1962b5d2086dSmrg    case $depmode in
1963b5d2086dSmrg    gcc)
1964b5d2086dSmrg      # This depmode causes a compiler race in universal mode.
1965b5d2086dSmrg      test "$am__universal" = false || continue
1966b5d2086dSmrg      ;;
1967b5d2086dSmrg    nosideeffect)
1968b5d2086dSmrg      # after this tag, mechanisms are not by side-effect, so they'll
1969b5d2086dSmrg      # only be used when explicitly requested
1970b5d2086dSmrg      if test "x$enable_dependency_tracking" = xyes; then
1971b5d2086dSmrg	continue
1972b5d2086dSmrg      else
1973b5d2086dSmrg	break
1974b5d2086dSmrg      fi
1975b5d2086dSmrg      ;;
1976b5d2086dSmrg    msvisualcpp | msvcmsys)
1977b5d2086dSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
1978b5d2086dSmrg      # not run yet.  These depmodes are late enough in the game, and
1979b5d2086dSmrg      # so weak that their functioning should not be impacted.
1980b5d2086dSmrg      am__obj=conftest.${OBJEXT-o}
1981b5d2086dSmrg      am__minus_obj=
1982b5d2086dSmrg      ;;
1983b5d2086dSmrg    none) break ;;
1984b9bb67cbSmrg    esac
1985b5d2086dSmrg    if depmode=$depmode \
1986b5d2086dSmrg       source=sub/conftest.c object=$am__obj \
1987b5d2086dSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1988b5d2086dSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1989b5d2086dSmrg         >/dev/null 2>conftest.err &&
1990b5d2086dSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1991b5d2086dSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1992b5d2086dSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1993b5d2086dSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1994b5d2086dSmrg      # icc doesn't choke on unknown options, it will just issue warnings
1995b5d2086dSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
1996b5d2086dSmrg      # that says an option was ignored or not supported.
1997b5d2086dSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
1998b5d2086dSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
1999b5d2086dSmrg      # The diagnosis changed in icc 8.0:
2000b5d2086dSmrg      #   icc: Command line remark: option '-MP' not supported
2001b5d2086dSmrg      if (grep 'ignoring option' conftest.err ||
2002b5d2086dSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2003b5d2086dSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2004b5d2086dSmrg        break
2005b5d2086dSmrg      fi
2006b5d2086dSmrg    fi
2007b5d2086dSmrg  done
2008b5d2086dSmrg
2009b5d2086dSmrg  cd ..
2010b5d2086dSmrg  rm -rf conftest.dir
2011b5d2086dSmrgelse
2012b5d2086dSmrg  am_cv_$1_dependencies_compiler_type=none
2013b9bb67cbSmrgfi
2014b5d2086dSmrg])
2015b5d2086dSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2016b5d2086dSmrgAM_CONDITIONAL([am__fastdep$1], [
2017b5d2086dSmrg  test "x$enable_dependency_tracking" != xno \
2018b5d2086dSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2019b5d2086dSmrg])
2020b5d2086dSmrg
2021b5d2086dSmrg
2022b5d2086dSmrg# AM_SET_DEPDIR
2023b5d2086dSmrg# -------------
2024b5d2086dSmrg# Choose a directory name for dependency files.
2025b5d2086dSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
2026b5d2086dSmrgAC_DEFUN([AM_SET_DEPDIR],
2027b5d2086dSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2028b5d2086dSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2029b5d2086dSmrg])
2030b5d2086dSmrg
2031b5d2086dSmrg
2032b5d2086dSmrg# AM_DEP_TRACK
2033b5d2086dSmrg# ------------
2034b5d2086dSmrgAC_DEFUN([AM_DEP_TRACK],
2035b5d2086dSmrg[AC_ARG_ENABLE(dependency-tracking,
2036b5d2086dSmrg[  --disable-dependency-tracking  speeds up one-time build
2037b5d2086dSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
2038b5d2086dSmrgif test "x$enable_dependency_tracking" != xno; then
2039b5d2086dSmrg  am_depcomp="$ac_aux_dir/depcomp"
2040b5d2086dSmrg  AMDEPBACKSLASH='\'
2041b9bb67cbSmrgfi
2042b5d2086dSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2043b5d2086dSmrgAC_SUBST([AMDEPBACKSLASH])dnl
2044b5d2086dSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
2045b5d2086dSmrg])
20461cc8c64fSmrg
2047b5d2086dSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
20481cc8c64fSmrg
2049b5d2086dSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
2050b5d2086dSmrg# Free Software Foundation, Inc.
2051b9bb67cbSmrg#
2052b5d2086dSmrg# This file is free software; the Free Software Foundation
2053b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2054b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
20551cc8c64fSmrg
2056b5d2086dSmrg#serial 5
20571cc8c64fSmrg
2058b5d2086dSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
2059b5d2086dSmrg# ------------------------------
2060b5d2086dSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
2061b5d2086dSmrg[{
2062b5d2086dSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
2063b5d2086dSmrg  # are listed without --file.  Let's play safe and only enable the eval
2064b5d2086dSmrg  # if we detect the quoting.
2065b5d2086dSmrg  case $CONFIG_FILES in
2066b5d2086dSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
2067b5d2086dSmrg  *)   set x $CONFIG_FILES ;;
2068b5d2086dSmrg  esac
2069b5d2086dSmrg  shift
2070b5d2086dSmrg  for mf
2071b5d2086dSmrg  do
2072b5d2086dSmrg    # Strip MF so we end up with the name of the file.
2073b5d2086dSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
2074b5d2086dSmrg    # Check whether this is an Automake generated Makefile or not.
2075b5d2086dSmrg    # We used to match only the files named `Makefile.in', but
2076b5d2086dSmrg    # some people rename them; so instead we look at the file content.
2077b5d2086dSmrg    # Grep'ing the first line is not enough: some people post-process
2078b5d2086dSmrg    # each Makefile.in and add a new line on top of each file to say so.
2079b5d2086dSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
2080b5d2086dSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
2081b5d2086dSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
2082b5d2086dSmrg      dirpart=`AS_DIRNAME("$mf")`
2083b5d2086dSmrg    else
2084b5d2086dSmrg      continue
2085b5d2086dSmrg    fi
2086b5d2086dSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
2087b5d2086dSmrg    # from the Makefile without running `make'.
2088b5d2086dSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
2089b5d2086dSmrg    test -z "$DEPDIR" && continue
2090b5d2086dSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
2091b5d2086dSmrg    test -z "am__include" && continue
2092b5d2086dSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
2093b5d2086dSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
2094b5d2086dSmrg    U=`sed -n 's/^U = //p' < "$mf"`
2095b5d2086dSmrg    # Find all dependency output files, they are included files with
2096b5d2086dSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
2097b5d2086dSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
2098b5d2086dSmrg    # expansion.
2099b5d2086dSmrg    for file in `sed -n "
2100b5d2086dSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
2101b5d2086dSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
2102b5d2086dSmrg      # Make sure the directory exists.
2103b5d2086dSmrg      test -f "$dirpart/$file" && continue
2104b5d2086dSmrg      fdir=`AS_DIRNAME(["$file"])`
2105b5d2086dSmrg      AS_MKDIR_P([$dirpart/$fdir])
2106b5d2086dSmrg      # echo "creating $dirpart/$file"
2107b5d2086dSmrg      echo '# dummy' > "$dirpart/$file"
2108b5d2086dSmrg    done
2109b5d2086dSmrg  done
2110b5d2086dSmrg}
2111b5d2086dSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
21121cc8c64fSmrg
21131cc8c64fSmrg
2114b5d2086dSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
2115b5d2086dSmrg# -----------------------------
2116b5d2086dSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
2117b5d2086dSmrg#
2118b5d2086dSmrg# This code is only required when automatic dependency tracking
2119b5d2086dSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
2120b5d2086dSmrg# need in order to bootstrap the dependency handling code.
2121b5d2086dSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
2122b5d2086dSmrg[AC_CONFIG_COMMANDS([depfiles],
2123b5d2086dSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2124b5d2086dSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2125b5d2086dSmrg])
21261cc8c64fSmrg
2127b5d2086dSmrg# Do all the work for Automake.                             -*- Autoconf -*-
21281cc8c64fSmrg
2129b5d2086dSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2130b5d2086dSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
2131b5d2086dSmrg#
2132b5d2086dSmrg# This file is free software; the Free Software Foundation
2133b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2134b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2135b5d2086dSmrg
2136b5d2086dSmrg# serial 16
21371cc8c64fSmrg
2138b5d2086dSmrg# This macro actually does too much.  Some checks are only needed if
2139b5d2086dSmrg# your package does certain things.  But this isn't really a big deal.
21401cc8c64fSmrg
2141b5d2086dSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
2142b5d2086dSmrg# AM_INIT_AUTOMAKE([OPTIONS])
2143b5d2086dSmrg# -----------------------------------------------
2144b5d2086dSmrg# The call with PACKAGE and VERSION arguments is the old style
2145b5d2086dSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
2146b5d2086dSmrg# and VERSION should now be passed to AC_INIT and removed from
2147b5d2086dSmrg# the call to AM_INIT_AUTOMAKE.
2148b5d2086dSmrg# We support both call styles for the transition.  After
2149b5d2086dSmrg# the next Automake release, Autoconf can make the AC_INIT
2150b5d2086dSmrg# arguments mandatory, and then we can depend on a new Autoconf
2151b5d2086dSmrg# release and drop the old call support.
2152b5d2086dSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
2153b5d2086dSmrg[AC_PREREQ([2.62])dnl
2154b5d2086dSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
2155b5d2086dSmrgdnl the ones we care about.
2156b5d2086dSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
2157b5d2086dSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2158b5d2086dSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
2159b5d2086dSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
2160b5d2086dSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2161b5d2086dSmrg  # is not polluted with repeated "-I."
2162b5d2086dSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
2163b5d2086dSmrg  # test to see if srcdir already configured
2164b5d2086dSmrg  if test -f $srcdir/config.status; then
2165b5d2086dSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2166b5d2086dSmrg  fi
2167b9bb67cbSmrgfi
21681cc8c64fSmrg
2169b5d2086dSmrg# test whether we have cygpath
2170b5d2086dSmrgif test -z "$CYGPATH_W"; then
2171b5d2086dSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
2172b5d2086dSmrg    CYGPATH_W='cygpath -w'
2173b5d2086dSmrg  else
2174b5d2086dSmrg    CYGPATH_W=echo
2175b5d2086dSmrg  fi
2176b5d2086dSmrgfi
2177b5d2086dSmrgAC_SUBST([CYGPATH_W])
21781cc8c64fSmrg
2179b5d2086dSmrg# Define the identity of the package.
2180b5d2086dSmrgdnl Distinguish between old-style and new-style calls.
2181b5d2086dSmrgm4_ifval([$2],
2182b5d2086dSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
2183b5d2086dSmrg AC_SUBST([PACKAGE], [$1])dnl
2184b5d2086dSmrg AC_SUBST([VERSION], [$2])],
2185b5d2086dSmrg[_AM_SET_OPTIONS([$1])dnl
2186b5d2086dSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
2187b5d2086dSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
2188b5d2086dSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
2189b5d2086dSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
2190b5d2086dSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
21911cc8c64fSmrg
2192b5d2086dSmrg_AM_IF_OPTION([no-define],,
2193b5d2086dSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2194b5d2086dSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
21951cc8c64fSmrg
2196b5d2086dSmrg# Some tools Automake needs.
2197b5d2086dSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
2198b5d2086dSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
2199b5d2086dSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
2200b5d2086dSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
2201b5d2086dSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
2202b5d2086dSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
2203b5d2086dSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
2204b5d2086dSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2205b5d2086dSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
2206b5d2086dSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
2207b5d2086dSmrg# We need awk for the "check" target.  The system "awk" is bad on
2208b5d2086dSmrg# some platforms.
2209b5d2086dSmrgAC_REQUIRE([AC_PROG_AWK])dnl
2210b5d2086dSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
2211b5d2086dSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
2212b5d2086dSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
2213b5d2086dSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
2214b5d2086dSmrg			     [_AM_PROG_TAR([v7])])])
2215b5d2086dSmrg_AM_IF_OPTION([no-dependencies],,
2216b5d2086dSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
2217b5d2086dSmrg		  [_AM_DEPENDENCIES(CC)],
2218b5d2086dSmrg		  [define([AC_PROG_CC],
2219b5d2086dSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
2220b5d2086dSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
2221b5d2086dSmrg		  [_AM_DEPENDENCIES(CXX)],
2222b5d2086dSmrg		  [define([AC_PROG_CXX],
2223b5d2086dSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
2224b5d2086dSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
2225b5d2086dSmrg		  [_AM_DEPENDENCIES(OBJC)],
2226b5d2086dSmrg		  [define([AC_PROG_OBJC],
2227b5d2086dSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
2228b5d2086dSmrg])
2229b5d2086dSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
2230b5d2086dSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
2231b5d2086dSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
2232b5d2086dSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
2233b5d2086dSmrgAC_CONFIG_COMMANDS_PRE(dnl
2234b5d2086dSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
2235b5d2086dSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
2236b5d2086dSmrg])
2237b9bb67cbSmrg
2238b5d2086dSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
2239b5d2086dSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
2240b5d2086dSmrgdnl mangled by Autoconf and run in a shell conditional statement.
2241b5d2086dSmrgm4_define([_AC_COMPILER_EXEEXT],
2242b5d2086dSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
2243b5d2086dSmrg
2244b5d2086dSmrg
2245b5d2086dSmrg# When config.status generates a header, we must update the stamp-h file.
2246b5d2086dSmrg# This file resides in the same directory as the config header
2247b5d2086dSmrg# that is generated.  The stamp files are numbered to have different names.
2248b5d2086dSmrg
2249b5d2086dSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
2250b5d2086dSmrg# loop where config.status creates the headers, so we can generate
2251b5d2086dSmrg# our stamp files there.
2252b5d2086dSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
2253b5d2086dSmrg[# Compute $1's index in $config_headers.
2254b5d2086dSmrg_am_arg=$1
2255b5d2086dSmrg_am_stamp_count=1
2256b5d2086dSmrgfor _am_header in $config_headers :; do
2257b5d2086dSmrg  case $_am_header in
2258b5d2086dSmrg    $_am_arg | $_am_arg:* )
2259b5d2086dSmrg      break ;;
2260b5d2086dSmrg    * )
2261b5d2086dSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2262b5d2086dSmrg  esac
2263b5d2086dSmrgdone
2264b5d2086dSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
2265b5d2086dSmrg
2266b5d2086dSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
2267b9bb67cbSmrg#
2268b5d2086dSmrg# This file is free software; the Free Software Foundation
2269b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2270b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2271b5d2086dSmrg
2272b5d2086dSmrg# AM_PROG_INSTALL_SH
2273b5d2086dSmrg# ------------------
2274b5d2086dSmrg# Define $install_sh.
2275b5d2086dSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
2276b5d2086dSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2277b5d2086dSmrgif test x"${install_sh}" != xset; then
2278b5d2086dSmrg  case $am_aux_dir in
2279b5d2086dSmrg  *\ * | *\	*)
2280b5d2086dSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2281b5d2086dSmrg  *)
2282b5d2086dSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
2283b5d2086dSmrg  esac
2284b9bb67cbSmrgfi
2285b5d2086dSmrgAC_SUBST(install_sh)])
2286b9bb67cbSmrg
2287b5d2086dSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
2288b5d2086dSmrg#
2289b5d2086dSmrg# This file is free software; the Free Software Foundation
2290b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2291b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2292b9bb67cbSmrg
2293b5d2086dSmrg# serial 2
2294b9bb67cbSmrg
2295b5d2086dSmrg# Check whether the underlying file-system supports filenames
2296b5d2086dSmrg# with a leading dot.  For instance MS-DOS doesn't.
2297b5d2086dSmrgAC_DEFUN([AM_SET_LEADING_DOT],
2298b5d2086dSmrg[rm -rf .tst 2>/dev/null
2299b5d2086dSmrgmkdir .tst 2>/dev/null
2300b5d2086dSmrgif test -d .tst; then
2301b5d2086dSmrg  am__leading_dot=.
2302b5d2086dSmrgelse
2303b5d2086dSmrg  am__leading_dot=_
2304b9bb67cbSmrgfi
2305b5d2086dSmrgrmdir .tst 2>/dev/null
2306b5d2086dSmrgAC_SUBST([am__leading_dot])])
2307b9bb67cbSmrg
2308b5d2086dSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
2309b5d2086dSmrg# From Jim Meyering
2310b9bb67cbSmrg
2311b5d2086dSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
2312b5d2086dSmrg# Free Software Foundation, Inc.
2313b5d2086dSmrg#
2314b5d2086dSmrg# This file is free software; the Free Software Foundation
2315b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2316b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2317b9bb67cbSmrg
2318b5d2086dSmrg# serial 5
2319b9bb67cbSmrg
2320b5d2086dSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
2321b5d2086dSmrg# ----------------------------------
2322b5d2086dSmrg# Control maintainer-specific portions of Makefiles.
2323b5d2086dSmrg# Default is to disable them, unless `enable' is passed literally.
2324b5d2086dSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
2325b5d2086dSmrg# can override the default with the --enable/--disable switch.
2326b5d2086dSmrgAC_DEFUN([AM_MAINTAINER_MODE],
2327b5d2086dSmrg[m4_case(m4_default([$1], [disable]),
2328b5d2086dSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
2329b5d2086dSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
2330b5d2086dSmrg       [m4_define([am_maintainer_other], [enable])
2331b5d2086dSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
2332b5d2086dSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
2333b5d2086dSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
2334b5d2086dSmrg  AC_ARG_ENABLE([maintainer-mode],
2335b5d2086dSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
2336b5d2086dSmrg			  (and sometimes confusing) to the casual installer],
2337b5d2086dSmrg      [USE_MAINTAINER_MODE=$enableval],
2338b5d2086dSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
2339b5d2086dSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
2340b5d2086dSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
2341b5d2086dSmrg  MAINT=$MAINTAINER_MODE_TRUE
2342b5d2086dSmrg  AC_SUBST([MAINT])dnl
2343b5d2086dSmrg]
2344b5d2086dSmrg)
2345b9bb67cbSmrg
2346b5d2086dSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
2347b9bb67cbSmrg
2348b5d2086dSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
2349b5d2086dSmrg
2350b5d2086dSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
2351b9bb67cbSmrg#
2352b5d2086dSmrg# This file is free software; the Free Software Foundation
2353b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2354b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2355b9bb67cbSmrg
2356b5d2086dSmrg# serial 4
2357b9bb67cbSmrg
2358b5d2086dSmrg# AM_MAKE_INCLUDE()
2359b5d2086dSmrg# -----------------
2360b5d2086dSmrg# Check to see how make treats includes.
2361b5d2086dSmrgAC_DEFUN([AM_MAKE_INCLUDE],
2362b5d2086dSmrg[am_make=${MAKE-make}
2363b5d2086dSmrgcat > confinc << 'END'
2364b5d2086dSmrgam__doit:
2365b5d2086dSmrg	@echo this is the am__doit target
2366b5d2086dSmrg.PHONY: am__doit
2367b5d2086dSmrgEND
2368b5d2086dSmrg# If we don't find an include directive, just comment out the code.
2369b5d2086dSmrgAC_MSG_CHECKING([for style of include used by $am_make])
2370b5d2086dSmrgam__include="#"
2371b5d2086dSmrgam__quote=
2372b5d2086dSmrg_am_result=none
2373b5d2086dSmrg# First try GNU make style include.
2374b5d2086dSmrgecho "include confinc" > confmf
2375b5d2086dSmrg# Ignore all kinds of additional output from `make'.
2376b5d2086dSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
2377b5d2086dSmrg*the\ am__doit\ target*)
2378b5d2086dSmrg  am__include=include
2379b5d2086dSmrg  am__quote=
2380b5d2086dSmrg  _am_result=GNU
2381b5d2086dSmrg  ;;
2382b5d2086dSmrgesac
2383b5d2086dSmrg# Now try BSD make style include.
2384b5d2086dSmrgif test "$am__include" = "#"; then
2385b5d2086dSmrg   echo '.include "confinc"' > confmf
2386b5d2086dSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
2387b5d2086dSmrg   *the\ am__doit\ target*)
2388b5d2086dSmrg     am__include=.include
2389b5d2086dSmrg     am__quote="\""
2390b5d2086dSmrg     _am_result=BSD
2391b5d2086dSmrg     ;;
2392b5d2086dSmrg   esac
2393b9bb67cbSmrgfi
2394b5d2086dSmrgAC_SUBST([am__include])
2395b5d2086dSmrgAC_SUBST([am__quote])
2396b5d2086dSmrgAC_MSG_RESULT([$_am_result])
2397b5d2086dSmrgrm -f confinc confmf
2398b5d2086dSmrg])
2399b9bb67cbSmrg
2400b5d2086dSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
24011cc8c64fSmrg
2402b5d2086dSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
2403b5d2086dSmrg# Free Software Foundation, Inc.
2404b9bb67cbSmrg#
2405b5d2086dSmrg# This file is free software; the Free Software Foundation
2406b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2407b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2408b9bb67cbSmrg
2409b5d2086dSmrg# serial 6
2410b9bb67cbSmrg
2411b5d2086dSmrg# AM_MISSING_PROG(NAME, PROGRAM)
2412b5d2086dSmrg# ------------------------------
2413b5d2086dSmrgAC_DEFUN([AM_MISSING_PROG],
2414b5d2086dSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
2415b5d2086dSmrg$1=${$1-"${am_missing_run}$2"}
2416b5d2086dSmrgAC_SUBST($1)])
2417b9bb67cbSmrg
2418b9bb67cbSmrg
2419b5d2086dSmrg# AM_MISSING_HAS_RUN
2420b5d2086dSmrg# ------------------
2421b5d2086dSmrg# Define MISSING if not defined so far and test if it supports --run.
2422b5d2086dSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
2423b5d2086dSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
2424b5d2086dSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2425b5d2086dSmrgAC_REQUIRE_AUX_FILE([missing])dnl
2426b5d2086dSmrgif test x"${MISSING+set}" != xset; then
2427b5d2086dSmrg  case $am_aux_dir in
2428b5d2086dSmrg  *\ * | *\	*)
2429b5d2086dSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2430b5d2086dSmrg  *)
2431b5d2086dSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
2432b5d2086dSmrg  esac
2433b9bb67cbSmrgfi
2434b5d2086dSmrg# Use eval to expand $SHELL
2435b5d2086dSmrgif eval "$MISSING --run true"; then
2436b5d2086dSmrg  am_missing_run="$MISSING --run "
2437b5d2086dSmrgelse
2438b5d2086dSmrg  am_missing_run=
2439b5d2086dSmrg  AC_MSG_WARN([`missing' script is too old or missing])
2440b5d2086dSmrgfi
2441b5d2086dSmrg])
2442b9bb67cbSmrg
2443b5d2086dSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
2444b5d2086dSmrg#
2445b5d2086dSmrg# This file is free software; the Free Software Foundation
2446b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2447b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2448b9bb67cbSmrg
2449b5d2086dSmrg# AM_PROG_MKDIR_P
2450b9bb67cbSmrg# ---------------
2451b5d2086dSmrg# Check for `mkdir -p'.
2452b5d2086dSmrgAC_DEFUN([AM_PROG_MKDIR_P],
2453b5d2086dSmrg[AC_PREREQ([2.60])dnl
2454b5d2086dSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
2455b5d2086dSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
2456b5d2086dSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
2457b5d2086dSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
2458b5d2086dSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
2459b5d2086dSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
2460b5d2086dSmrgdnl adjustment using top_builddir (which is defined more often than
2461b5d2086dSmrgdnl MKDIR_P).
2462b5d2086dSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
2463b5d2086dSmrgcase $mkdir_p in
2464b5d2086dSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
2465b5d2086dSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2466b5d2086dSmrgesac
2467b5d2086dSmrg])
2468b5d2086dSmrg
2469b5d2086dSmrg# Helper functions for option handling.                     -*- Autoconf -*-
2470b5d2086dSmrg
2471b5d2086dSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
2472b9bb67cbSmrg#
2473b5d2086dSmrg# This file is free software; the Free Software Foundation
2474b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2475b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2476b9bb67cbSmrg
2477b5d2086dSmrg# serial 4
2478b5d2086dSmrg
2479b5d2086dSmrg# _AM_MANGLE_OPTION(NAME)
2480b9bb67cbSmrg# -----------------------
2481b5d2086dSmrgAC_DEFUN([_AM_MANGLE_OPTION],
2482b5d2086dSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2483b9bb67cbSmrg
2484b5d2086dSmrg# _AM_SET_OPTION(NAME)
2485b5d2086dSmrg# ------------------------------
2486b5d2086dSmrg# Set option NAME.  Presently that only means defining a flag for this option.
2487b5d2086dSmrgAC_DEFUN([_AM_SET_OPTION],
2488b5d2086dSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2489b9bb67cbSmrg
2490b5d2086dSmrg# _AM_SET_OPTIONS(OPTIONS)
2491b5d2086dSmrg# ----------------------------------
2492b5d2086dSmrg# OPTIONS is a space-separated list of Automake options.
2493b5d2086dSmrgAC_DEFUN([_AM_SET_OPTIONS],
2494b5d2086dSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
24951cc8c64fSmrg
2496b5d2086dSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2497b5d2086dSmrg# -------------------------------------------
2498b5d2086dSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2499b5d2086dSmrgAC_DEFUN([_AM_IF_OPTION],
2500b5d2086dSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
25011cc8c64fSmrg
2502b5d2086dSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
2503b9bb67cbSmrg
2504b5d2086dSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
2505b5d2086dSmrg# Free Software Foundation, Inc.
2506b9bb67cbSmrg#
2507b5d2086dSmrg# This file is free software; the Free Software Foundation
2508b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2509b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2510b9bb67cbSmrg
2511b5d2086dSmrg# serial 5
2512b5d2086dSmrg
2513b5d2086dSmrg# AM_SANITY_CHECK
2514b5d2086dSmrg# ---------------
2515b5d2086dSmrgAC_DEFUN([AM_SANITY_CHECK],
2516b5d2086dSmrg[AC_MSG_CHECKING([whether build environment is sane])
2517b5d2086dSmrg# Just in case
2518b5d2086dSmrgsleep 1
2519b5d2086dSmrgecho timestamp > conftest.file
2520b5d2086dSmrg# Reject unsafe characters in $srcdir or the absolute working directory
2521b5d2086dSmrg# name.  Accept space and tab only in the latter.
2522b5d2086dSmrgam_lf='
2523b5d2086dSmrg'
2524b5d2086dSmrgcase `pwd` in
2525b5d2086dSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
2526b5d2086dSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
2527b5d2086dSmrgesac
2528b5d2086dSmrgcase $srcdir in
2529b5d2086dSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
2530b5d2086dSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
2531b5d2086dSmrgesac
2532b5d2086dSmrg
2533b5d2086dSmrg# Do `set' in a subshell so we don't clobber the current shell's
2534b5d2086dSmrg# arguments.  Must try -L first in case configure is actually a
2535b5d2086dSmrg# symlink; some systems play weird games with the mod time of symlinks
2536b5d2086dSmrg# (eg FreeBSD returns the mod time of the symlink's containing
2537b5d2086dSmrg# directory).
2538b5d2086dSmrgif (
2539b5d2086dSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2540b5d2086dSmrg   if test "$[*]" = "X"; then
2541b5d2086dSmrg      # -L didn't work.
2542b5d2086dSmrg      set X `ls -t "$srcdir/configure" conftest.file`
2543b5d2086dSmrg   fi
2544b5d2086dSmrg   rm -f conftest.file
2545b5d2086dSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
2546b5d2086dSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
2547b5d2086dSmrg
2548b5d2086dSmrg      # If neither matched, then we have a broken ls.  This can happen
2549b5d2086dSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
2550b5d2086dSmrg      # broken ls alias from the environment.  This has actually
2551b5d2086dSmrg      # happened.  Such a system could not be considered "sane".
2552b5d2086dSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
2553b5d2086dSmrgalias in your environment])
2554b5d2086dSmrg   fi
2555b5d2086dSmrg
2556b5d2086dSmrg   test "$[2]" = conftest.file
2557b5d2086dSmrg   )
2558b5d2086dSmrgthen
2559b5d2086dSmrg   # Ok.
2560b5d2086dSmrg   :
2561b5d2086dSmrgelse
2562b5d2086dSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
2563b5d2086dSmrgCheck your system clock])
2564b9bb67cbSmrgfi
2565b5d2086dSmrgAC_MSG_RESULT(yes)])
2566b9bb67cbSmrg
2567b5d2086dSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
2568b9bb67cbSmrg#
2569b5d2086dSmrg# This file is free software; the Free Software Foundation
2570b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2571b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2572b9bb67cbSmrg
2573b5d2086dSmrg# serial 1
2574b9bb67cbSmrg
2575b5d2086dSmrg# AM_SILENT_RULES([DEFAULT])
2576b5d2086dSmrg# --------------------------
2577b5d2086dSmrg# Enable less verbose build rules; with the default set to DEFAULT
2578b5d2086dSmrg# (`yes' being less verbose, `no' or empty being verbose).
2579b5d2086dSmrgAC_DEFUN([AM_SILENT_RULES],
2580b5d2086dSmrg[AC_ARG_ENABLE([silent-rules],
2581b5d2086dSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
2582b5d2086dSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
2583b5d2086dSmrgcase $enable_silent_rules in
2584b5d2086dSmrgyes) AM_DEFAULT_VERBOSITY=0;;
2585b5d2086dSmrgno)  AM_DEFAULT_VERBOSITY=1;;
2586b5d2086dSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
2587b5d2086dSmrgesac
2588b5d2086dSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
2589b5d2086dSmrgAM_BACKSLASH='\'
2590b5d2086dSmrgAC_SUBST([AM_BACKSLASH])dnl
2591b5d2086dSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
2592b5d2086dSmrg])
2593b9bb67cbSmrg
2594b5d2086dSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
2595b5d2086dSmrg#
2596b5d2086dSmrg# This file is free software; the Free Software Foundation
2597b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2598b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2599b9bb67cbSmrg
2600b5d2086dSmrg# AM_PROG_INSTALL_STRIP
2601b5d2086dSmrg# ---------------------
2602b5d2086dSmrg# One issue with vendor `install' (even GNU) is that you can't
2603b5d2086dSmrg# specify the program used to strip binaries.  This is especially
2604b5d2086dSmrg# annoying in cross-compiling environments, where the build's strip
2605b5d2086dSmrg# is unlikely to handle the host's binaries.
2606b5d2086dSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
2607b5d2086dSmrg# always use install-sh in `make install-strip', and initialize
2608b5d2086dSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
2609b5d2086dSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
2610b5d2086dSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2611b5d2086dSmrg# Installed binaries are usually stripped using `strip' when the user
2612b5d2086dSmrg# run `make install-strip'.  However `strip' might not be the right
2613b5d2086dSmrg# tool to use in cross-compilation environments, therefore Automake
2614b5d2086dSmrg# will honor the `STRIP' environment variable to overrule this program.
2615b5d2086dSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2616b5d2086dSmrgif test "$cross_compiling" != no; then
2617b5d2086dSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
2618b5d2086dSmrgfi
2619b5d2086dSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2620b5d2086dSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
2621b9bb67cbSmrg
2622b5d2086dSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
2623b9bb67cbSmrg#
2624b5d2086dSmrg# This file is free software; the Free Software Foundation
2625b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2626b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2627b9bb67cbSmrg
2628b5d2086dSmrg# serial 2
2629b9bb67cbSmrg
2630b5d2086dSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
2631b5d2086dSmrg# ---------------------------
2632b5d2086dSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2633b5d2086dSmrg# This macro is traced by Automake.
2634b5d2086dSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
2635b9bb67cbSmrg
2636b5d2086dSmrg# AM_SUBST_NOTMAKE(VARIABLE)
2637b5d2086dSmrg# ---------------------------
2638b5d2086dSmrg# Public sister of _AM_SUBST_NOTMAKE.
2639b5d2086dSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2640b9bb67cbSmrg
2641b5d2086dSmrg# Check how to create a tarball.                            -*- Autoconf -*-
2642b9bb67cbSmrg
2643b5d2086dSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
2644b5d2086dSmrg#
2645b5d2086dSmrg# This file is free software; the Free Software Foundation
2646b5d2086dSmrg# gives unlimited permission to copy and/or distribute it,
2647b5d2086dSmrg# with or without modifications, as long as this notice is preserved.
2648b9bb67cbSmrg
2649b5d2086dSmrg# serial 2
2650b9bb67cbSmrg
2651b5d2086dSmrg# _AM_PROG_TAR(FORMAT)
2652b5d2086dSmrg# --------------------
2653b5d2086dSmrg# Check how to create a tarball in format FORMAT.
2654b5d2086dSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
2655b5d2086dSmrg#
2656b5d2086dSmrg# Substitute a variable $(am__tar) that is a command
2657b5d2086dSmrg# writing to stdout a FORMAT-tarball containing the directory
2658b5d2086dSmrg# $tardir.
2659b5d2086dSmrg#     tardir=directory && $(am__tar) > result.tar
2660b5d2086dSmrg#
2661b5d2086dSmrg# Substitute a variable $(am__untar) that extract such
2662b5d2086dSmrg# a tarball read from stdin.
2663b5d2086dSmrg#     $(am__untar) < result.tar
2664b5d2086dSmrgAC_DEFUN([_AM_PROG_TAR],
2665b5d2086dSmrg[# Always define AMTAR for backward compatibility.
2666b5d2086dSmrgAM_MISSING_PROG([AMTAR], [tar])
2667b5d2086dSmrgm4_if([$1], [v7],
2668b5d2086dSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
2669b5d2086dSmrg     [m4_case([$1], [ustar],, [pax],,
2670b5d2086dSmrg              [m4_fatal([Unknown tar format])])
2671b5d2086dSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
2672b5d2086dSmrg# Loop over all known methods to create a tar archive until one works.
2673b5d2086dSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2674b5d2086dSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
2675b5d2086dSmrg# Do not fold the above two line into one, because Tru64 sh and
2676b5d2086dSmrg# Solaris sh will not grok spaces in the rhs of `-'.
2677b5d2086dSmrgfor _am_tool in $_am_tools
2678b5d2086dSmrgdo
2679b5d2086dSmrg  case $_am_tool in
2680b5d2086dSmrg  gnutar)
2681b5d2086dSmrg    for _am_tar in tar gnutar gtar;
2682b5d2086dSmrg    do
2683b5d2086dSmrg      AM_RUN_LOG([$_am_tar --version]) && break
2684b5d2086dSmrg    done
2685b5d2086dSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2686b5d2086dSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2687b5d2086dSmrg    am__untar="$_am_tar -xf -"
2688b5d2086dSmrg    ;;
2689b5d2086dSmrg  plaintar)
2690b5d2086dSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
2691b5d2086dSmrg    # ustar tarball either.
2692b5d2086dSmrg    (tar --version) >/dev/null 2>&1 && continue
2693b5d2086dSmrg    am__tar='tar chf - "$$tardir"'
2694b5d2086dSmrg    am__tar_='tar chf - "$tardir"'
2695b5d2086dSmrg    am__untar='tar xf -'
2696b5d2086dSmrg    ;;
2697b5d2086dSmrg  pax)
2698b5d2086dSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
2699b5d2086dSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
2700b5d2086dSmrg    am__untar='pax -r'
2701b5d2086dSmrg    ;;
2702b5d2086dSmrg  cpio)
2703b5d2086dSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2704b5d2086dSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2705b5d2086dSmrg    am__untar='cpio -i -H $1 -d'
2706b5d2086dSmrg    ;;
2707b5d2086dSmrg  none)
2708b5d2086dSmrg    am__tar=false
2709b5d2086dSmrg    am__tar_=false
2710b5d2086dSmrg    am__untar=false
2711b5d2086dSmrg    ;;
2712b5d2086dSmrg  esac
2713b9bb67cbSmrg
2714b5d2086dSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
2715b5d2086dSmrg  # and am__untar set.
2716b5d2086dSmrg  test -n "${am_cv_prog_tar_$1}" && break
2717b9bb67cbSmrg
2718b5d2086dSmrg  # tar/untar a dummy directory, and stop if the command works
2719b5d2086dSmrg  rm -rf conftest.dir
2720b5d2086dSmrg  mkdir conftest.dir
2721b5d2086dSmrg  echo GrepMe > conftest.dir/file
2722b5d2086dSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2723b5d2086dSmrg  rm -rf conftest.dir
2724b5d2086dSmrg  if test -s conftest.tar; then
2725b5d2086dSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
2726b5d2086dSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2727b5d2086dSmrg  fi
2728b5d2086dSmrgdone
2729b5d2086dSmrgrm -rf conftest.dir
2730b9bb67cbSmrg
2731b5d2086dSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2732b5d2086dSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
2733b5d2086dSmrgAC_SUBST([am__tar])
2734b5d2086dSmrgAC_SUBST([am__untar])
2735b5d2086dSmrg]) # _AM_PROG_TAR
2736b9bb67cbSmrg
2737