aclocal.m4 revision a0195d5f
1a0195d5fSmrg# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
2a0195d5fSmrg
3a0195d5fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4a0195d5fSmrg# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
5a0195d5fSmrg# This file is free software; the Free Software Foundation
6a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
7a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
8a0195d5fSmrg
9a0195d5fSmrg# This program is distributed in the hope that it will be useful,
10a0195d5fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11a0195d5fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12a0195d5fSmrg# PARTICULAR PURPOSE.
13a0195d5fSmrg
14a0195d5fSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15a0195d5fSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16a0195d5fSmrgm4_if(AC_AUTOCONF_VERSION, [2.61],,
17a0195d5fSmrg[m4_warning([this file was generated for autoconf 2.61.
18a0195d5fSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19a0195d5fSmrgIf you have problems, you may need to regenerate the build system entirely.
20a0195d5fSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21a0195d5fSmrg
22a0195d5fSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
23a0195d5fSmrg# 
24a0195d5fSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
25a0195d5fSmrg#
26a0195d5fSmrg# This program is free software; you can redistribute it and/or modify
27a0195d5fSmrg# it under the terms of the GNU General Public License as published by
28a0195d5fSmrg# the Free Software Foundation; either version 2 of the License, or
29a0195d5fSmrg# (at your option) any later version.
30a0195d5fSmrg#
31a0195d5fSmrg# This program is distributed in the hope that it will be useful, but
32a0195d5fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
33a0195d5fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
34a0195d5fSmrg# General Public License for more details.
35a0195d5fSmrg#
36a0195d5fSmrg# You should have received a copy of the GNU General Public License
37a0195d5fSmrg# along with this program; if not, write to the Free Software
38a0195d5fSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39a0195d5fSmrg#
40a0195d5fSmrg# As a special exception to the GNU General Public License, if you
41a0195d5fSmrg# distribute this file as part of a program that contains a
42a0195d5fSmrg# configuration script generated by Autoconf, you may include it under
43a0195d5fSmrg# the same distribution terms that you use for the rest of that program.
44a0195d5fSmrg
45a0195d5fSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
46a0195d5fSmrg# ----------------------------------
47a0195d5fSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
48a0195d5fSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
49a0195d5fSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
50a0195d5fSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
51a0195d5fSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
52a0195d5fSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
53a0195d5fSmrgfi
54a0195d5fSmrgif test -n "$PKG_CONFIG"; then
55a0195d5fSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
56a0195d5fSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
57a0195d5fSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
58a0195d5fSmrg		AC_MSG_RESULT([yes])
59a0195d5fSmrg	else
60a0195d5fSmrg		AC_MSG_RESULT([no])
61a0195d5fSmrg		PKG_CONFIG=""
62a0195d5fSmrg	fi
63a0195d5fSmrg		
64a0195d5fSmrgfi[]dnl
65a0195d5fSmrg])# PKG_PROG_PKG_CONFIG
66a0195d5fSmrg
67a0195d5fSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
68a0195d5fSmrg#
69a0195d5fSmrg# Check to see whether a particular set of modules exists.  Similar
70a0195d5fSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
71a0195d5fSmrg#
72a0195d5fSmrg#
73a0195d5fSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
74a0195d5fSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
75a0195d5fSmrg# PKG_CHECK_EXISTS manually
76a0195d5fSmrg# --------------------------------------------------------------
77a0195d5fSmrgAC_DEFUN([PKG_CHECK_EXISTS],
78a0195d5fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
79a0195d5fSmrgif test -n "$PKG_CONFIG" && \
80a0195d5fSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
81a0195d5fSmrg  m4_ifval([$2], [$2], [:])
82a0195d5fSmrgm4_ifvaln([$3], [else
83a0195d5fSmrg  $3])dnl
84a0195d5fSmrgfi])
85a0195d5fSmrg
86a0195d5fSmrg
87a0195d5fSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
88a0195d5fSmrg# ---------------------------------------------
89a0195d5fSmrgm4_define([_PKG_CONFIG],
90a0195d5fSmrg[if test -n "$$1"; then
91a0195d5fSmrg    pkg_cv_[]$1="$$1"
92a0195d5fSmrg elif test -n "$PKG_CONFIG"; then
93a0195d5fSmrg    PKG_CHECK_EXISTS([$3],
94a0195d5fSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
95a0195d5fSmrg		     [pkg_failed=yes])
96a0195d5fSmrg else
97a0195d5fSmrg    pkg_failed=untried
98a0195d5fSmrgfi[]dnl
99a0195d5fSmrg])# _PKG_CONFIG
100a0195d5fSmrg
101a0195d5fSmrg# _PKG_SHORT_ERRORS_SUPPORTED
102a0195d5fSmrg# -----------------------------
103a0195d5fSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
104a0195d5fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
105a0195d5fSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
106a0195d5fSmrg        _pkg_short_errors_supported=yes
107a0195d5fSmrgelse
108a0195d5fSmrg        _pkg_short_errors_supported=no
109a0195d5fSmrgfi[]dnl
110a0195d5fSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
111a0195d5fSmrg
112a0195d5fSmrg
113a0195d5fSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
114a0195d5fSmrg# [ACTION-IF-NOT-FOUND])
115a0195d5fSmrg#
116a0195d5fSmrg#
117a0195d5fSmrg# Note that if there is a possibility the first call to
118a0195d5fSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
119a0195d5fSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
120a0195d5fSmrg#
121a0195d5fSmrg#
122a0195d5fSmrg# --------------------------------------------------------------
123a0195d5fSmrgAC_DEFUN([PKG_CHECK_MODULES],
124a0195d5fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
125a0195d5fSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
126a0195d5fSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
127a0195d5fSmrg
128a0195d5fSmrgpkg_failed=no
129a0195d5fSmrgAC_MSG_CHECKING([for $1])
130a0195d5fSmrg
131a0195d5fSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
132a0195d5fSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
133a0195d5fSmrg
134a0195d5fSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
135a0195d5fSmrgand $1[]_LIBS to avoid the need to call pkg-config.
136a0195d5fSmrgSee the pkg-config man page for more details.])
137a0195d5fSmrg
138a0195d5fSmrgif test $pkg_failed = yes; then
139a0195d5fSmrg        _PKG_SHORT_ERRORS_SUPPORTED
140a0195d5fSmrg        if test $_pkg_short_errors_supported = yes; then
141a0195d5fSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
142a0195d5fSmrg        else 
143a0195d5fSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
144a0195d5fSmrg        fi
145a0195d5fSmrg	# Put the nasty error message in config.log where it belongs
146a0195d5fSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
147a0195d5fSmrg
148a0195d5fSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
149a0195d5fSmrg[Package requirements ($2) were not met:
150a0195d5fSmrg
151a0195d5fSmrg$$1_PKG_ERRORS
152a0195d5fSmrg
153a0195d5fSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
154a0195d5fSmrginstalled software in a non-standard prefix.
155a0195d5fSmrg
156a0195d5fSmrg_PKG_TEXT
157a0195d5fSmrg])],
158a0195d5fSmrg		[AC_MSG_RESULT([no])
159a0195d5fSmrg                $4])
160a0195d5fSmrgelif test $pkg_failed = untried; then
161a0195d5fSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
162a0195d5fSmrg[The pkg-config script could not be found or is too old.  Make sure it
163a0195d5fSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
164a0195d5fSmrgpath to pkg-config.
165a0195d5fSmrg
166a0195d5fSmrg_PKG_TEXT
167a0195d5fSmrg
168a0195d5fSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
169a0195d5fSmrg		[$4])
170a0195d5fSmrgelse
171a0195d5fSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
172a0195d5fSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
173a0195d5fSmrg        AC_MSG_RESULT([yes])
174a0195d5fSmrg	ifelse([$3], , :, [$3])
175a0195d5fSmrgfi[]dnl
176a0195d5fSmrg])# PKG_CHECK_MODULES
177a0195d5fSmrg
178a0195d5fSmrgdnl
179a0195d5fSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
180a0195d5fSmrgdnl 
181a0195d5fSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
182a0195d5fSmrgdnl copy of this software and associated documentation files (the
183a0195d5fSmrgdnl "Software"), to deal in the Software without restriction, including
184a0195d5fSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
185a0195d5fSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
186a0195d5fSmrgdnl to whom the Software is furnished to do so, provided that the above
187a0195d5fSmrgdnl copyright notice(s) and this permission notice appear in all copies of
188a0195d5fSmrgdnl the Software and that both the above copyright notice(s) and this
189a0195d5fSmrgdnl permission notice appear in supporting documentation.
190a0195d5fSmrgdnl
191a0195d5fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
192a0195d5fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
193a0195d5fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
194a0195d5fSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
195a0195d5fSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
196a0195d5fSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
197a0195d5fSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
198a0195d5fSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
199a0195d5fSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
200a0195d5fSmrgdnl
201a0195d5fSmrgdnl Except as contained in this notice, the name of a copyright holder
202a0195d5fSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
203a0195d5fSmrgdnl or other dealings in this Software without prior written authorization
204a0195d5fSmrgdnl of the copyright holder.
205a0195d5fSmrg
206a0195d5fSmrg# XORG_MACROS_VERSION(required-version)
207a0195d5fSmrg# -------------------------------------
208a0195d5fSmrg# Minimum version: 1.1.0
209a0195d5fSmrg#
210a0195d5fSmrg# If you're using a macro added in Version 1.1 or newer, include this in
211a0195d5fSmrg# your configure.ac with the minimum required version, such as:
212a0195d5fSmrg# XORG_MACROS_VERSION(1.1)
213a0195d5fSmrg#
214a0195d5fSmrg# To force at least a version with this macro defined, also add:
215a0195d5fSmrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
216a0195d5fSmrg#
217a0195d5fSmrg#
218a0195d5fSmrg# See the "minimum version" comment for each macro you use to see what 
219a0195d5fSmrg# version you require.
220a0195d5fSmrgAC_DEFUN([XORG_MACROS_VERSION],[
221a0195d5fSmrg	[XORG_MACROS_needed_version=$1
222a0195d5fSmrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
223a0195d5fSmrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
224a0195d5fSmrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
225a0195d5fSmrg	[XORG_MACROS_version=1.1.6
226a0195d5fSmrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
227a0195d5fSmrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
228a0195d5fSmrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
229a0195d5fSmrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
230a0195d5fSmrg	fi
231a0195d5fSmrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
232a0195d5fSmrg		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
233a0195d5fSmrg	fi
234a0195d5fSmrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
235a0195d5fSmrg]) # XORG_MACROS_VERSION
236a0195d5fSmrg
237a0195d5fSmrg# XORG_PROG_RAWCPP()
238a0195d5fSmrg# ------------------
239a0195d5fSmrg# Minimum version: 1.0.0
240a0195d5fSmrg#
241a0195d5fSmrg# Find cpp program and necessary flags for use in pre-processing text files
242a0195d5fSmrg# such as man pages and config files
243a0195d5fSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
244a0195d5fSmrgAC_REQUIRE([AC_PROG_CPP])
245a0195d5fSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
246a0195d5fSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
247a0195d5fSmrg
248a0195d5fSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
249a0195d5fSmrg# which is not the best choice for supporting other OS'es, but covers most
250a0195d5fSmrg# of the ones we need for now.
251a0195d5fSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
252a0195d5fSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
253a0195d5fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
254a0195d5fSmrg	AC_MSG_RESULT([no])
255a0195d5fSmrgelse
256a0195d5fSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
257a0195d5fSmrg		RAWCPPFLAGS=-undef
258a0195d5fSmrg		AC_MSG_RESULT([yes])
259a0195d5fSmrg	else
260a0195d5fSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
261a0195d5fSmrg	fi
262a0195d5fSmrgfi
263a0195d5fSmrgrm -f conftest.$ac_ext
264a0195d5fSmrg
265a0195d5fSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
266a0195d5fSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
267a0195d5fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
268a0195d5fSmrg	AC_MSG_RESULT([no])
269a0195d5fSmrgelse
270a0195d5fSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
271a0195d5fSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
272a0195d5fSmrg		AC_MSG_RESULT([yes])
273a0195d5fSmrg	else
274a0195d5fSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
275a0195d5fSmrg	fi
276a0195d5fSmrgfi
277a0195d5fSmrgrm -f conftest.$ac_ext
278a0195d5fSmrgAC_SUBST(RAWCPPFLAGS)
279a0195d5fSmrg]) # XORG_PROG_RAWCPP
280a0195d5fSmrg
281a0195d5fSmrg# XORG_MANPAGE_SECTIONS()
282a0195d5fSmrg# -----------------------
283a0195d5fSmrg# Minimum version: 1.0.0
284a0195d5fSmrg#
285a0195d5fSmrg# Determine which sections man pages go in for the different man page types
286a0195d5fSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
287a0195d5fSmrg# Not sure if there's any better way than just hardcoding by OS name.
288a0195d5fSmrg# Override default settings by setting environment variables
289a0195d5fSmrg
290a0195d5fSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
291a0195d5fSmrgAC_REQUIRE([AC_CANONICAL_HOST])
292a0195d5fSmrg
293a0195d5fSmrgif test x$APP_MAN_SUFFIX = x    ; then
294a0195d5fSmrg    APP_MAN_SUFFIX=1
295a0195d5fSmrgfi
296a0195d5fSmrgif test x$APP_MAN_DIR = x    ; then
297a0195d5fSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
298a0195d5fSmrgfi
299a0195d5fSmrg
300a0195d5fSmrgif test x$LIB_MAN_SUFFIX = x    ; then
301a0195d5fSmrg    LIB_MAN_SUFFIX=3
302a0195d5fSmrgfi
303a0195d5fSmrgif test x$LIB_MAN_DIR = x    ; then
304a0195d5fSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
305a0195d5fSmrgfi
306a0195d5fSmrg
307a0195d5fSmrgif test x$FILE_MAN_SUFFIX = x    ; then
308a0195d5fSmrg    case $host_os in
309a0195d5fSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
310a0195d5fSmrg	*)		FILE_MAN_SUFFIX=5  ;;
311a0195d5fSmrg    esac
312a0195d5fSmrgfi
313a0195d5fSmrgif test x$FILE_MAN_DIR = x    ; then
314a0195d5fSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
315a0195d5fSmrgfi
316a0195d5fSmrg
317a0195d5fSmrgif test x$MISC_MAN_SUFFIX = x    ; then
318a0195d5fSmrg    case $host_os in
319a0195d5fSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
320a0195d5fSmrg	*)		MISC_MAN_SUFFIX=7  ;;
321a0195d5fSmrg    esac
322a0195d5fSmrgfi
323a0195d5fSmrgif test x$MISC_MAN_DIR = x    ; then
324a0195d5fSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
325a0195d5fSmrgfi
326a0195d5fSmrg
327a0195d5fSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
328a0195d5fSmrg    case $host_os in
329a0195d5fSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
330a0195d5fSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
331a0195d5fSmrg    esac
332a0195d5fSmrgfi
333a0195d5fSmrgif test x$DRIVER_MAN_DIR = x    ; then
334a0195d5fSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
335a0195d5fSmrgfi
336a0195d5fSmrg
337a0195d5fSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
338a0195d5fSmrg    case $host_os in
339a0195d5fSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
340a0195d5fSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
341a0195d5fSmrg    esac
342a0195d5fSmrgfi
343a0195d5fSmrgif test x$ADMIN_MAN_DIR = x    ; then
344a0195d5fSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
345a0195d5fSmrgfi
346a0195d5fSmrg
347a0195d5fSmrg
348a0195d5fSmrgAC_SUBST([APP_MAN_SUFFIX])
349a0195d5fSmrgAC_SUBST([LIB_MAN_SUFFIX])
350a0195d5fSmrgAC_SUBST([FILE_MAN_SUFFIX])
351a0195d5fSmrgAC_SUBST([MISC_MAN_SUFFIX])
352a0195d5fSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
353a0195d5fSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
354a0195d5fSmrgAC_SUBST([APP_MAN_DIR])
355a0195d5fSmrgAC_SUBST([LIB_MAN_DIR])
356a0195d5fSmrgAC_SUBST([FILE_MAN_DIR])
357a0195d5fSmrgAC_SUBST([MISC_MAN_DIR])
358a0195d5fSmrgAC_SUBST([DRIVER_MAN_DIR])
359a0195d5fSmrgAC_SUBST([ADMIN_MAN_DIR])
360a0195d5fSmrg]) # XORG_MANPAGE_SECTIONS
361a0195d5fSmrg
362a0195d5fSmrg# XORG_CHECK_LINUXDOC
363a0195d5fSmrg# -------------------
364a0195d5fSmrg# Minimum version: 1.0.0
365a0195d5fSmrg#
366a0195d5fSmrg# Defines the variable MAKE_TEXT if the necessary tools and
367a0195d5fSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
368a0195d5fSmrg# Whether or not the necessary tools and files are found can be checked
369a0195d5fSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
370a0195d5fSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
371a0195d5fSmrgXORG_SGML_PATH=$prefix/share/sgml
372a0195d5fSmrgHAVE_DEFS_ENT=
373a0195d5fSmrg
374a0195d5fSmrgif test x"$cross_compiling" = x"yes" ; then
375a0195d5fSmrg  HAVE_DEFS_ENT=no
376a0195d5fSmrgelse
377a0195d5fSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
378a0195d5fSmrgfi
379a0195d5fSmrg
380a0195d5fSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
381a0195d5fSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
382a0195d5fSmrg
383a0195d5fSmrgAC_MSG_CHECKING([Whether to build documentation])
384a0195d5fSmrg
385a0195d5fSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
386a0195d5fSmrg   BUILDDOC=yes
387a0195d5fSmrgelse
388a0195d5fSmrg   BUILDDOC=no
389a0195d5fSmrgfi
390a0195d5fSmrg
391a0195d5fSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
392a0195d5fSmrg
393a0195d5fSmrgAC_MSG_RESULT([$BUILDDOC])
394a0195d5fSmrg
395a0195d5fSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
396a0195d5fSmrg
397a0195d5fSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
398a0195d5fSmrg   BUILDPDFDOC=yes
399a0195d5fSmrgelse
400a0195d5fSmrg   BUILDPDFDOC=no
401a0195d5fSmrgfi
402a0195d5fSmrg
403a0195d5fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
404a0195d5fSmrg
405a0195d5fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
406a0195d5fSmrg
407a0195d5fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
408a0195d5fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
409a0195d5fSmrgMAKE_PDF="$PS2PDF"
410a0195d5fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
411a0195d5fSmrg
412a0195d5fSmrgAC_SUBST(MAKE_TEXT)
413a0195d5fSmrgAC_SUBST(MAKE_PS)
414a0195d5fSmrgAC_SUBST(MAKE_PDF)
415a0195d5fSmrgAC_SUBST(MAKE_HTML)
416a0195d5fSmrg]) # XORG_CHECK_LINUXDOC
417a0195d5fSmrg
418a0195d5fSmrg# XORG_CHECK_DOCBOOK
419a0195d5fSmrg# -------------------
420a0195d5fSmrg# Minimum version: 1.0.0
421a0195d5fSmrg#
422a0195d5fSmrg# Checks for the ability to build output formats from SGML DocBook source.
423a0195d5fSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
424a0195d5fSmrg# indicates whether the necessary tools and files are found and, if set,
425a0195d5fSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
426a0195d5fSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
427a0195d5fSmrgXORG_SGML_PATH=$prefix/share/sgml
428a0195d5fSmrgHAVE_DEFS_ENT=
429a0195d5fSmrgBUILDTXTDOC=no
430a0195d5fSmrgBUILDPDFDOC=no
431a0195d5fSmrgBUILDPSDOC=no
432a0195d5fSmrgBUILDHTMLDOC=no
433a0195d5fSmrg
434a0195d5fSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
435a0195d5fSmrg
436a0195d5fSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
437a0195d5fSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
438a0195d5fSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
439a0195d5fSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
440a0195d5fSmrg
441a0195d5fSmrgAC_MSG_CHECKING([Whether to build text documentation])
442a0195d5fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
443a0195d5fSmrg   test x$BUILD_TXTDOC != xno; then
444a0195d5fSmrg	BUILDTXTDOC=yes
445a0195d5fSmrgfi
446a0195d5fSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
447a0195d5fSmrgAC_MSG_RESULT([$BUILDTXTDOC])
448a0195d5fSmrg
449a0195d5fSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
450a0195d5fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
451a0195d5fSmrg   test x$BUILD_PDFDOC != xno; then
452a0195d5fSmrg	BUILDPDFDOC=yes
453a0195d5fSmrgfi
454a0195d5fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
455a0195d5fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
456a0195d5fSmrg
457a0195d5fSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
458a0195d5fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
459a0195d5fSmrg   test x$BUILD_PSDOC != xno; then
460a0195d5fSmrg	BUILDPSDOC=yes
461a0195d5fSmrgfi
462a0195d5fSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
463a0195d5fSmrgAC_MSG_RESULT([$BUILDPSDOC])
464a0195d5fSmrg
465a0195d5fSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
466a0195d5fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
467a0195d5fSmrg   test x$BUILD_HTMLDOC != xno; then
468a0195d5fSmrg	BUILDHTMLDOC=yes
469a0195d5fSmrgfi
470a0195d5fSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
471a0195d5fSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
472a0195d5fSmrg
473a0195d5fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
474a0195d5fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
475a0195d5fSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
476a0195d5fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
477a0195d5fSmrg
478a0195d5fSmrgAC_SUBST(MAKE_TEXT)
479a0195d5fSmrgAC_SUBST(MAKE_PS)
480a0195d5fSmrgAC_SUBST(MAKE_PDF)
481a0195d5fSmrgAC_SUBST(MAKE_HTML)
482a0195d5fSmrg]) # XORG_CHECK_DOCBOOK
483a0195d5fSmrg
484a0195d5fSmrg# XORG_CHECK_MALLOC_ZERO
485a0195d5fSmrg# ----------------------
486a0195d5fSmrg# Minimum version: 1.0.0
487a0195d5fSmrg#
488a0195d5fSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
489a0195d5fSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
490a0195d5fSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
491a0195d5fSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
492a0195d5fSmrgAC_ARG_ENABLE(malloc0returnsnull,
493a0195d5fSmrg	AC_HELP_STRING([--enable-malloc0returnsnull],
494a0195d5fSmrg		       [malloc(0) returns NULL (default: auto)]),
495a0195d5fSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
496a0195d5fSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
497a0195d5fSmrg
498a0195d5fSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
499a0195d5fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
500a0195d5fSmrg	AC_RUN_IFELSE([
501a0195d5fSmrgchar *malloc();
502a0195d5fSmrgchar *realloc();
503a0195d5fSmrgchar *calloc();
504a0195d5fSmrgmain() {
505a0195d5fSmrg    char *m0, *r0, *c0, *p;
506a0195d5fSmrg    m0 = malloc(0);
507a0195d5fSmrg    p = malloc(10);
508a0195d5fSmrg    r0 = realloc(p,0);
509a0195d5fSmrg    c0 = calloc(0);
510a0195d5fSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
511a0195d5fSmrg}],
512a0195d5fSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
513a0195d5fSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
514a0195d5fSmrgfi
515a0195d5fSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
516a0195d5fSmrg
517a0195d5fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
518a0195d5fSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
519a0195d5fSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
520a0195d5fSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
521a0195d5fSmrgelse
522a0195d5fSmrg	MALLOC_ZERO_CFLAGS=""
523a0195d5fSmrg	XMALLOC_ZERO_CFLAGS=""
524a0195d5fSmrg	XTMALLOC_ZERO_CFLAGS=""
525a0195d5fSmrgfi
526a0195d5fSmrg
527a0195d5fSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
528a0195d5fSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
529a0195d5fSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
530a0195d5fSmrg]) # XORG_CHECK_MALLOC_ZERO
531a0195d5fSmrg
532a0195d5fSmrg# XORG_WITH_LINT()
533a0195d5fSmrg# ----------------
534a0195d5fSmrg# Minimum version: 1.1.0
535a0195d5fSmrg#
536a0195d5fSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
537a0195d5fSmrg# is specified.   (Use --with-lint=sparse for sparse.)
538a0195d5fSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
539a0195d5fSmrg# Sets $LINT_FLAGS to flags to pass to source checker
540a0195d5fSmrg# Sets LINT automake conditional if enabled (default: disabled)
541a0195d5fSmrg#
542a0195d5fSmrgAC_DEFUN([XORG_WITH_LINT],[
543a0195d5fSmrg
544a0195d5fSmrg# Allow checking code with lint, sparse, etc.
545a0195d5fSmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
546a0195d5fSmrg		[Use a lint-style source code checker (default: disabled)])],
547a0195d5fSmrg		[use_lint=$withval], [use_lint=no])
548a0195d5fSmrgif test "x$use_lint" = "xyes" ; then
549a0195d5fSmrg	LINT="lint"
550a0195d5fSmrgelse
551a0195d5fSmrg	LINT="$use_lint"
552a0195d5fSmrgfi
553a0195d5fSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
554a0195d5fSmrg    case $LINT in
555a0195d5fSmrg	lint|*/lint)
556a0195d5fSmrg	    case $host_os in
557a0195d5fSmrg		solaris*)
558a0195d5fSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
559a0195d5fSmrg			;;
560a0195d5fSmrg	    esac
561a0195d5fSmrg	    ;;
562a0195d5fSmrg    esac
563a0195d5fSmrgfi
564a0195d5fSmrg
565a0195d5fSmrgAC_SUBST(LINT)
566a0195d5fSmrgAC_SUBST(LINT_FLAGS)
567a0195d5fSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
568a0195d5fSmrg
569a0195d5fSmrg]) # XORG_WITH_LINT
570a0195d5fSmrg
571a0195d5fSmrg# XORG_LINT_LIBRARY(LIBNAME)
572a0195d5fSmrg# --------------------------
573a0195d5fSmrg# Minimum version: 1.1.0
574a0195d5fSmrg#
575a0195d5fSmrg# Sets up flags for building lint libraries for checking programs that call
576a0195d5fSmrg# functions in the library.
577a0195d5fSmrg# Disabled by default, enable with --enable-lint-library
578a0195d5fSmrg# Sets: 
579a0195d5fSmrg#	@LINTLIB@		- name of lint library file to make
580a0195d5fSmrg#	MAKE_LINT_LIB		- automake conditional
581a0195d5fSmrg#
582a0195d5fSmrg
583a0195d5fSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
584a0195d5fSmrgAC_REQUIRE([XORG_WITH_LINT])
585a0195d5fSmrg# Build lint "library" for more indepth checks of programs calling this library
586a0195d5fSmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
587a0195d5fSmrg	[Create lint library (default: disabled)])],
588a0195d5fSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
589a0195d5fSmrgif test "x$make_lint_lib" != "xno" ; then
590a0195d5fSmrg	if test "x$LINT" = "xno" ; then
591a0195d5fSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
592a0195d5fSmrg	fi
593a0195d5fSmrg	if test "x$make_lint_lib" = "xyes" ; then
594a0195d5fSmrg		LINTLIB=llib-l$1.ln
595a0195d5fSmrg	else
596a0195d5fSmrg		LINTLIB=$make_lint_lib
597a0195d5fSmrg	fi
598a0195d5fSmrgfi
599a0195d5fSmrgAC_SUBST(LINTLIB)
600a0195d5fSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
601a0195d5fSmrg
602a0195d5fSmrg]) # XORG_LINT_LIBRARY
603a0195d5fSmrg
604a0195d5fSmrgdnl Copyright 2005 Red Hat, Inc
605a0195d5fSmrgdnl
606a0195d5fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
607a0195d5fSmrgdnl documentation for any purpose is hereby granted without fee, provided that
608a0195d5fSmrgdnl the above copyright notice appear in all copies and that both that
609a0195d5fSmrgdnl copyright notice and this permission notice appear in supporting
610a0195d5fSmrgdnl documentation.
611a0195d5fSmrgdnl
612a0195d5fSmrgdnl The above copyright notice and this permission notice shall be included
613a0195d5fSmrgdnl in all copies or substantial portions of the Software.
614a0195d5fSmrgdnl
615a0195d5fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
616a0195d5fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
617a0195d5fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
618a0195d5fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
619a0195d5fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
620a0195d5fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
621a0195d5fSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
622a0195d5fSmrgdnl
623a0195d5fSmrgdnl Except as contained in this notice, the name of the copyright holders shall
624a0195d5fSmrgdnl not be used in advertising or otherwise to promote the sale, use or
625a0195d5fSmrgdnl other dealings in this Software without prior written authorization
626a0195d5fSmrgdnl from the copyright holders.
627a0195d5fSmrgdnl
628a0195d5fSmrg
629a0195d5fSmrg# XORG_RELEASE_VERSION
630a0195d5fSmrg# --------------------
631a0195d5fSmrg# Adds --with/without-release-string and changes the PACKAGE and
632a0195d5fSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
633a0195d5fSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
634a0195d5fSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
635a0195d5fSmrg 
636a0195d5fSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
637a0195d5fSmrg	AC_ARG_WITH(release-version,
638a0195d5fSmrg			AC_HELP_STRING([--with-release-version=STRING],
639a0195d5fSmrg				[Use release version string in package name]),
640a0195d5fSmrg			[RELEASE_VERSION="$withval"],
641a0195d5fSmrg			[RELEASE_VERSION=""])
642a0195d5fSmrg	if test "x$RELEASE_VERSION" != "x"; then
643a0195d5fSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
644a0195d5fSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
645a0195d5fSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
646a0195d5fSmrg	fi
647a0195d5fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
648a0195d5fSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
649a0195d5fSmrg		[Major version of this package])
650a0195d5fSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
651a0195d5fSmrg	if test "x$PVM" = "x"; then
652a0195d5fSmrg		PVM="0"
653a0195d5fSmrg	fi
654a0195d5fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
655a0195d5fSmrg		[$PVM],
656a0195d5fSmrg		[Minor version of this package])
657a0195d5fSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
658a0195d5fSmrg	if test "x$PVP" = "x"; then
659a0195d5fSmrg		PVP="0"
660a0195d5fSmrg	fi
661a0195d5fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
662a0195d5fSmrg		[$PVP],
663a0195d5fSmrg		[Patch version of this package])
664a0195d5fSmrg])
665a0195d5fSmrg
666a0195d5fSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
667a0195d5fSmrg#
668a0195d5fSmrg# This file is free software; the Free Software Foundation
669a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
670a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
671a0195d5fSmrg
672a0195d5fSmrg# AM_AUTOMAKE_VERSION(VERSION)
673a0195d5fSmrg# ----------------------------
674a0195d5fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
675a0195d5fSmrg# generated from the m4 files accompanying Automake X.Y.
676a0195d5fSmrg# (This private macro should not be called outside this file.)
677a0195d5fSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
678a0195d5fSmrg[am__api_version='1.10'
679a0195d5fSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
680a0195d5fSmrgdnl require some minimum version.  Point them to the right macro.
681a0195d5fSmrgm4_if([$1], [1.10.1], [],
682a0195d5fSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
683a0195d5fSmrg])
684a0195d5fSmrg
685a0195d5fSmrg# _AM_AUTOCONF_VERSION(VERSION)
686a0195d5fSmrg# -----------------------------
687a0195d5fSmrg# aclocal traces this macro to find the Autoconf version.
688a0195d5fSmrg# This is a private macro too.  Using m4_define simplifies
689a0195d5fSmrg# the logic in aclocal, which can simply ignore this definition.
690a0195d5fSmrgm4_define([_AM_AUTOCONF_VERSION], [])
691a0195d5fSmrg
692a0195d5fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
693a0195d5fSmrg# -------------------------------
694a0195d5fSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
695a0195d5fSmrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
696a0195d5fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
697a0195d5fSmrg[AM_AUTOMAKE_VERSION([1.10.1])dnl
698a0195d5fSmrgm4_ifndef([AC_AUTOCONF_VERSION],
699a0195d5fSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
700a0195d5fSmrg_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
701a0195d5fSmrg
702a0195d5fSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
703a0195d5fSmrg
704a0195d5fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
705a0195d5fSmrg#
706a0195d5fSmrg# This file is free software; the Free Software Foundation
707a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
708a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
709a0195d5fSmrg
710a0195d5fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
711a0195d5fSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
712a0195d5fSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
713a0195d5fSmrg#
714a0195d5fSmrg# Of course, Automake must honor this variable whenever it calls a
715a0195d5fSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
716a0195d5fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
717a0195d5fSmrg# depending on how configure is run.  This is pretty annoying, since
718a0195d5fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
719a0195d5fSmrg# source directory, any form will work fine, but in subdirectories a
720a0195d5fSmrg# relative path needs to be adjusted first.
721a0195d5fSmrg#
722a0195d5fSmrg# $ac_aux_dir/missing
723a0195d5fSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
724a0195d5fSmrg# $top_srcdir/$ac_aux_dir/missing
725a0195d5fSmrg#    fails if $ac_aux_dir is absolute,
726a0195d5fSmrg#    fails when called from a subdirectory in a VPATH build with
727a0195d5fSmrg#          a relative $ac_aux_dir
728a0195d5fSmrg#
729a0195d5fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
730a0195d5fSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
731a0195d5fSmrg# harmless because $srcdir is `.', but things will broke when you
732a0195d5fSmrg# start a VPATH build or use an absolute $srcdir.
733a0195d5fSmrg#
734a0195d5fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
735a0195d5fSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
736a0195d5fSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
737a0195d5fSmrg# and then we would define $MISSING as
738a0195d5fSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
739a0195d5fSmrg# This will work as long as MISSING is not called from configure, because
740a0195d5fSmrg# unfortunately $(top_srcdir) has no meaning in configure.
741a0195d5fSmrg# However there are other variables, like CC, which are often used in
742a0195d5fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
743a0195d5fSmrg#
744a0195d5fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
745a0195d5fSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
746a0195d5fSmrg# configured tree to be moved without reconfiguration.
747a0195d5fSmrg
748a0195d5fSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
749a0195d5fSmrg[dnl Rely on autoconf to set up CDPATH properly.
750a0195d5fSmrgAC_PREREQ([2.50])dnl
751a0195d5fSmrg# expand $ac_aux_dir to an absolute path
752a0195d5fSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
753a0195d5fSmrg])
754a0195d5fSmrg
755a0195d5fSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
756a0195d5fSmrg
757a0195d5fSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
758a0195d5fSmrg# Free Software Foundation, Inc.
759a0195d5fSmrg#
760a0195d5fSmrg# This file is free software; the Free Software Foundation
761a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
762a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
763a0195d5fSmrg
764a0195d5fSmrg# serial 8
765a0195d5fSmrg
766a0195d5fSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
767a0195d5fSmrg# -------------------------------------
768a0195d5fSmrg# Define a conditional.
769a0195d5fSmrgAC_DEFUN([AM_CONDITIONAL],
770a0195d5fSmrg[AC_PREREQ(2.52)dnl
771a0195d5fSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
772a0195d5fSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
773a0195d5fSmrgAC_SUBST([$1_TRUE])dnl
774a0195d5fSmrgAC_SUBST([$1_FALSE])dnl
775a0195d5fSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
776a0195d5fSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
777a0195d5fSmrgif $2; then
778a0195d5fSmrg  $1_TRUE=
779a0195d5fSmrg  $1_FALSE='#'
780a0195d5fSmrgelse
781a0195d5fSmrg  $1_TRUE='#'
782a0195d5fSmrg  $1_FALSE=
783a0195d5fSmrgfi
784a0195d5fSmrgAC_CONFIG_COMMANDS_PRE(
785a0195d5fSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
786a0195d5fSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
787a0195d5fSmrgUsually this means the macro was only invoked conditionally.]])
788a0195d5fSmrgfi])])
789a0195d5fSmrg
790a0195d5fSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
791a0195d5fSmrg# Free Software Foundation, Inc.
792a0195d5fSmrg#
793a0195d5fSmrg# This file is free software; the Free Software Foundation
794a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
795a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
796a0195d5fSmrg
797a0195d5fSmrg# serial 9
798a0195d5fSmrg
799a0195d5fSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
800a0195d5fSmrg# written in clear, in which case automake, when reading aclocal.m4,
801a0195d5fSmrg# will think it sees a *use*, and therefore will trigger all it's
802a0195d5fSmrg# C support machinery.  Also note that it means that autoscan, seeing
803a0195d5fSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
804a0195d5fSmrg
805a0195d5fSmrg
806a0195d5fSmrg# _AM_DEPENDENCIES(NAME)
807a0195d5fSmrg# ----------------------
808a0195d5fSmrg# See how the compiler implements dependency checking.
809a0195d5fSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
810a0195d5fSmrg# We try a few techniques and use that to set a single cache variable.
811a0195d5fSmrg#
812a0195d5fSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
813a0195d5fSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
814a0195d5fSmrg# dependency, and given that the user is not expected to run this macro,
815a0195d5fSmrg# just rely on AC_PROG_CC.
816a0195d5fSmrgAC_DEFUN([_AM_DEPENDENCIES],
817a0195d5fSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
818a0195d5fSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
819a0195d5fSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
820a0195d5fSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
821a0195d5fSmrg
822a0195d5fSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
823a0195d5fSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
824a0195d5fSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
825a0195d5fSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
826a0195d5fSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
827a0195d5fSmrg                   [depcc="$$1"   am_compiler_list=])
828a0195d5fSmrg
829a0195d5fSmrgAC_CACHE_CHECK([dependency style of $depcc],
830a0195d5fSmrg               [am_cv_$1_dependencies_compiler_type],
831a0195d5fSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
832a0195d5fSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
833a0195d5fSmrg  # making bogus files that we don't know about and never remove.  For
834a0195d5fSmrg  # instance it was reported that on HP-UX the gcc test will end up
835a0195d5fSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
836a0195d5fSmrg  # in D'.
837a0195d5fSmrg  mkdir conftest.dir
838a0195d5fSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
839a0195d5fSmrg  # using a relative directory.
840a0195d5fSmrg  cp "$am_depcomp" conftest.dir
841a0195d5fSmrg  cd conftest.dir
842a0195d5fSmrg  # We will build objects and dependencies in a subdirectory because
843a0195d5fSmrg  # it helps to detect inapplicable dependency modes.  For instance
844a0195d5fSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
845a0195d5fSmrg  # side effect of compilation, but ICC will put the dependencies in
846a0195d5fSmrg  # the current directory while Tru64 will put them in the object
847a0195d5fSmrg  # directory.
848a0195d5fSmrg  mkdir sub
849a0195d5fSmrg
850a0195d5fSmrg  am_cv_$1_dependencies_compiler_type=none
851a0195d5fSmrg  if test "$am_compiler_list" = ""; then
852a0195d5fSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
853a0195d5fSmrg  fi
854a0195d5fSmrg  for depmode in $am_compiler_list; do
855a0195d5fSmrg    # Setup a source with many dependencies, because some compilers
856a0195d5fSmrg    # like to wrap large dependency lists on column 80 (with \), and
857a0195d5fSmrg    # we should not choose a depcomp mode which is confused by this.
858a0195d5fSmrg    #
859a0195d5fSmrg    # We need to recreate these files for each test, as the compiler may
860a0195d5fSmrg    # overwrite some of them when testing with obscure command lines.
861a0195d5fSmrg    # This happens at least with the AIX C compiler.
862a0195d5fSmrg    : > sub/conftest.c
863a0195d5fSmrg    for i in 1 2 3 4 5 6; do
864a0195d5fSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
865a0195d5fSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
866a0195d5fSmrg      # Solaris 8's {/usr,}/bin/sh.
867a0195d5fSmrg      touch sub/conftst$i.h
868a0195d5fSmrg    done
869a0195d5fSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
870a0195d5fSmrg
871a0195d5fSmrg    case $depmode in
872a0195d5fSmrg    nosideeffect)
873a0195d5fSmrg      # after this tag, mechanisms are not by side-effect, so they'll
874a0195d5fSmrg      # only be used when explicitly requested
875a0195d5fSmrg      if test "x$enable_dependency_tracking" = xyes; then
876a0195d5fSmrg	continue
877a0195d5fSmrg      else
878a0195d5fSmrg	break
879a0195d5fSmrg      fi
880a0195d5fSmrg      ;;
881a0195d5fSmrg    none) break ;;
882a0195d5fSmrg    esac
883a0195d5fSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
884a0195d5fSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
885a0195d5fSmrg    # handle `-M -o', and we need to detect this.
886a0195d5fSmrg    if depmode=$depmode \
887a0195d5fSmrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
888a0195d5fSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
889a0195d5fSmrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
890a0195d5fSmrg         >/dev/null 2>conftest.err &&
891a0195d5fSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
892a0195d5fSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
893a0195d5fSmrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
894a0195d5fSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
895a0195d5fSmrg      # icc doesn't choke on unknown options, it will just issue warnings
896a0195d5fSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
897a0195d5fSmrg      # that says an option was ignored or not supported.
898a0195d5fSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
899a0195d5fSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
900a0195d5fSmrg      # The diagnosis changed in icc 8.0:
901a0195d5fSmrg      #   icc: Command line remark: option '-MP' not supported
902a0195d5fSmrg      if (grep 'ignoring option' conftest.err ||
903a0195d5fSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
904a0195d5fSmrg        am_cv_$1_dependencies_compiler_type=$depmode
905a0195d5fSmrg        break
906a0195d5fSmrg      fi
907a0195d5fSmrg    fi
908a0195d5fSmrg  done
909a0195d5fSmrg
910a0195d5fSmrg  cd ..
911a0195d5fSmrg  rm -rf conftest.dir
912a0195d5fSmrgelse
913a0195d5fSmrg  am_cv_$1_dependencies_compiler_type=none
914a0195d5fSmrgfi
915a0195d5fSmrg])
916a0195d5fSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
917a0195d5fSmrgAM_CONDITIONAL([am__fastdep$1], [
918a0195d5fSmrg  test "x$enable_dependency_tracking" != xno \
919a0195d5fSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
920a0195d5fSmrg])
921a0195d5fSmrg
922a0195d5fSmrg
923a0195d5fSmrg# AM_SET_DEPDIR
924a0195d5fSmrg# -------------
925a0195d5fSmrg# Choose a directory name for dependency files.
926a0195d5fSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
927a0195d5fSmrgAC_DEFUN([AM_SET_DEPDIR],
928a0195d5fSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
929a0195d5fSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
930a0195d5fSmrg])
931a0195d5fSmrg
932a0195d5fSmrg
933a0195d5fSmrg# AM_DEP_TRACK
934a0195d5fSmrg# ------------
935a0195d5fSmrgAC_DEFUN([AM_DEP_TRACK],
936a0195d5fSmrg[AC_ARG_ENABLE(dependency-tracking,
937a0195d5fSmrg[  --disable-dependency-tracking  speeds up one-time build
938a0195d5fSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
939a0195d5fSmrgif test "x$enable_dependency_tracking" != xno; then
940a0195d5fSmrg  am_depcomp="$ac_aux_dir/depcomp"
941a0195d5fSmrg  AMDEPBACKSLASH='\'
942a0195d5fSmrgfi
943a0195d5fSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
944a0195d5fSmrgAC_SUBST([AMDEPBACKSLASH])dnl
945a0195d5fSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
946a0195d5fSmrg])
947a0195d5fSmrg
948a0195d5fSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
949a0195d5fSmrg
950a0195d5fSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
951a0195d5fSmrg# Free Software Foundation, Inc.
952a0195d5fSmrg#
953a0195d5fSmrg# This file is free software; the Free Software Foundation
954a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
955a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
956a0195d5fSmrg
957a0195d5fSmrg#serial 3
958a0195d5fSmrg
959a0195d5fSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
960a0195d5fSmrg# ------------------------------
961a0195d5fSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
962a0195d5fSmrg[for mf in $CONFIG_FILES; do
963a0195d5fSmrg  # Strip MF so we end up with the name of the file.
964a0195d5fSmrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
965a0195d5fSmrg  # Check whether this is an Automake generated Makefile or not.
966a0195d5fSmrg  # We used to match only the files named `Makefile.in', but
967a0195d5fSmrg  # some people rename them; so instead we look at the file content.
968a0195d5fSmrg  # Grep'ing the first line is not enough: some people post-process
969a0195d5fSmrg  # each Makefile.in and add a new line on top of each file to say so.
970a0195d5fSmrg  # Grep'ing the whole file is not good either: AIX grep has a line
971a0195d5fSmrg  # limit of 2048, but all sed's we know have understand at least 4000.
972a0195d5fSmrg  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
973a0195d5fSmrg    dirpart=`AS_DIRNAME("$mf")`
974a0195d5fSmrg  else
975a0195d5fSmrg    continue
976a0195d5fSmrg  fi
977a0195d5fSmrg  # Extract the definition of DEPDIR, am__include, and am__quote
978a0195d5fSmrg  # from the Makefile without running `make'.
979a0195d5fSmrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
980a0195d5fSmrg  test -z "$DEPDIR" && continue
981a0195d5fSmrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
982a0195d5fSmrg  test -z "am__include" && continue
983a0195d5fSmrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
984a0195d5fSmrg  # When using ansi2knr, U may be empty or an underscore; expand it
985a0195d5fSmrg  U=`sed -n 's/^U = //p' < "$mf"`
986a0195d5fSmrg  # Find all dependency output files, they are included files with
987a0195d5fSmrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
988a0195d5fSmrg  # simplest approach to changing $(DEPDIR) to its actual value in the
989a0195d5fSmrg  # expansion.
990a0195d5fSmrg  for file in `sed -n "
991a0195d5fSmrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
992a0195d5fSmrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
993a0195d5fSmrg    # Make sure the directory exists.
994a0195d5fSmrg    test -f "$dirpart/$file" && continue
995a0195d5fSmrg    fdir=`AS_DIRNAME(["$file"])`
996a0195d5fSmrg    AS_MKDIR_P([$dirpart/$fdir])
997a0195d5fSmrg    # echo "creating $dirpart/$file"
998a0195d5fSmrg    echo '# dummy' > "$dirpart/$file"
999a0195d5fSmrg  done
1000a0195d5fSmrgdone
1001a0195d5fSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1002a0195d5fSmrg
1003a0195d5fSmrg
1004a0195d5fSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
1005a0195d5fSmrg# -----------------------------
1006a0195d5fSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
1007a0195d5fSmrg#
1008a0195d5fSmrg# This code is only required when automatic dependency tracking
1009a0195d5fSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
1010a0195d5fSmrg# need in order to bootstrap the dependency handling code.
1011a0195d5fSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1012a0195d5fSmrg[AC_CONFIG_COMMANDS([depfiles],
1013a0195d5fSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1014a0195d5fSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1015a0195d5fSmrg])
1016a0195d5fSmrg
1017a0195d5fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1018a0195d5fSmrg# Free Software Foundation, Inc.
1019a0195d5fSmrg#
1020a0195d5fSmrg# This file is free software; the Free Software Foundation
1021a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1022a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1023a0195d5fSmrg
1024a0195d5fSmrg# serial 8
1025a0195d5fSmrg
1026a0195d5fSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
1027a0195d5fSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1028a0195d5fSmrg
1029a0195d5fSmrg# Do all the work for Automake.                             -*- Autoconf -*-
1030a0195d5fSmrg
1031a0195d5fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1032a0195d5fSmrg# 2005, 2006, 2008 Free Software Foundation, Inc.
1033a0195d5fSmrg#
1034a0195d5fSmrg# This file is free software; the Free Software Foundation
1035a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1036a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1037a0195d5fSmrg
1038a0195d5fSmrg# serial 13
1039a0195d5fSmrg
1040a0195d5fSmrg# This macro actually does too much.  Some checks are only needed if
1041a0195d5fSmrg# your package does certain things.  But this isn't really a big deal.
1042a0195d5fSmrg
1043a0195d5fSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1044a0195d5fSmrg# AM_INIT_AUTOMAKE([OPTIONS])
1045a0195d5fSmrg# -----------------------------------------------
1046a0195d5fSmrg# The call with PACKAGE and VERSION arguments is the old style
1047a0195d5fSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
1048a0195d5fSmrg# and VERSION should now be passed to AC_INIT and removed from
1049a0195d5fSmrg# the call to AM_INIT_AUTOMAKE.
1050a0195d5fSmrg# We support both call styles for the transition.  After
1051a0195d5fSmrg# the next Automake release, Autoconf can make the AC_INIT
1052a0195d5fSmrg# arguments mandatory, and then we can depend on a new Autoconf
1053a0195d5fSmrg# release and drop the old call support.
1054a0195d5fSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
1055a0195d5fSmrg[AC_PREREQ([2.60])dnl
1056a0195d5fSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
1057a0195d5fSmrgdnl the ones we care about.
1058a0195d5fSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1059a0195d5fSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1060a0195d5fSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
1061a0195d5fSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
1062a0195d5fSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1063a0195d5fSmrg  # is not polluted with repeated "-I."
1064a0195d5fSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1065a0195d5fSmrg  # test to see if srcdir already configured
1066a0195d5fSmrg  if test -f $srcdir/config.status; then
1067a0195d5fSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1068a0195d5fSmrg  fi
1069a0195d5fSmrgfi
1070a0195d5fSmrg
1071a0195d5fSmrg# test whether we have cygpath
1072a0195d5fSmrgif test -z "$CYGPATH_W"; then
1073a0195d5fSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
1074a0195d5fSmrg    CYGPATH_W='cygpath -w'
1075a0195d5fSmrg  else
1076a0195d5fSmrg    CYGPATH_W=echo
1077a0195d5fSmrg  fi
1078a0195d5fSmrgfi
1079a0195d5fSmrgAC_SUBST([CYGPATH_W])
1080a0195d5fSmrg
1081a0195d5fSmrg# Define the identity of the package.
1082a0195d5fSmrgdnl Distinguish between old-style and new-style calls.
1083a0195d5fSmrgm4_ifval([$2],
1084a0195d5fSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1085a0195d5fSmrg AC_SUBST([PACKAGE], [$1])dnl
1086a0195d5fSmrg AC_SUBST([VERSION], [$2])],
1087a0195d5fSmrg[_AM_SET_OPTIONS([$1])dnl
1088a0195d5fSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1089a0195d5fSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1090a0195d5fSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1091a0195d5fSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1092a0195d5fSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1093a0195d5fSmrg
1094a0195d5fSmrg_AM_IF_OPTION([no-define],,
1095a0195d5fSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1096a0195d5fSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1097a0195d5fSmrg
1098a0195d5fSmrg# Some tools Automake needs.
1099a0195d5fSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
1100a0195d5fSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
1101a0195d5fSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1102a0195d5fSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
1103a0195d5fSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1104a0195d5fSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
1105a0195d5fSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
1106a0195d5fSmrgAM_PROG_INSTALL_SH
1107a0195d5fSmrgAM_PROG_INSTALL_STRIP
1108a0195d5fSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
1109a0195d5fSmrg# We need awk for the "check" target.  The system "awk" is bad on
1110a0195d5fSmrg# some platforms.
1111a0195d5fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
1112a0195d5fSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
1113a0195d5fSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
1114a0195d5fSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1115a0195d5fSmrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1116a0195d5fSmrg	      		     [_AM_PROG_TAR([v7])])])
1117a0195d5fSmrg_AM_IF_OPTION([no-dependencies],,
1118a0195d5fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
1119a0195d5fSmrg                  [_AM_DEPENDENCIES(CC)],
1120a0195d5fSmrg                  [define([AC_PROG_CC],
1121a0195d5fSmrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1122a0195d5fSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
1123a0195d5fSmrg                  [_AM_DEPENDENCIES(CXX)],
1124a0195d5fSmrg                  [define([AC_PROG_CXX],
1125a0195d5fSmrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1126a0195d5fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
1127a0195d5fSmrg                  [_AM_DEPENDENCIES(OBJC)],
1128a0195d5fSmrg                  [define([AC_PROG_OBJC],
1129a0195d5fSmrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1130a0195d5fSmrg])
1131a0195d5fSmrg])
1132a0195d5fSmrg
1133a0195d5fSmrg
1134a0195d5fSmrg# When config.status generates a header, we must update the stamp-h file.
1135a0195d5fSmrg# This file resides in the same directory as the config header
1136a0195d5fSmrg# that is generated.  The stamp files are numbered to have different names.
1137a0195d5fSmrg
1138a0195d5fSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1139a0195d5fSmrg# loop where config.status creates the headers, so we can generate
1140a0195d5fSmrg# our stamp files there.
1141a0195d5fSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1142a0195d5fSmrg[# Compute $1's index in $config_headers.
1143a0195d5fSmrg_am_arg=$1
1144a0195d5fSmrg_am_stamp_count=1
1145a0195d5fSmrgfor _am_header in $config_headers :; do
1146a0195d5fSmrg  case $_am_header in
1147a0195d5fSmrg    $_am_arg | $_am_arg:* )
1148a0195d5fSmrg      break ;;
1149a0195d5fSmrg    * )
1150a0195d5fSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1151a0195d5fSmrg  esac
1152a0195d5fSmrgdone
1153a0195d5fSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1154a0195d5fSmrg
1155a0195d5fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1156a0195d5fSmrg#
1157a0195d5fSmrg# This file is free software; the Free Software Foundation
1158a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1159a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1160a0195d5fSmrg
1161a0195d5fSmrg# AM_PROG_INSTALL_SH
1162a0195d5fSmrg# ------------------
1163a0195d5fSmrg# Define $install_sh.
1164a0195d5fSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
1165a0195d5fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1166a0195d5fSmrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
1167a0195d5fSmrgAC_SUBST(install_sh)])
1168a0195d5fSmrg
1169a0195d5fSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1170a0195d5fSmrg#
1171a0195d5fSmrg# This file is free software; the Free Software Foundation
1172a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1173a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1174a0195d5fSmrg
1175a0195d5fSmrg# serial 2
1176a0195d5fSmrg
1177a0195d5fSmrg# Check whether the underlying file-system supports filenames
1178a0195d5fSmrg# with a leading dot.  For instance MS-DOS doesn't.
1179a0195d5fSmrgAC_DEFUN([AM_SET_LEADING_DOT],
1180a0195d5fSmrg[rm -rf .tst 2>/dev/null
1181a0195d5fSmrgmkdir .tst 2>/dev/null
1182a0195d5fSmrgif test -d .tst; then
1183a0195d5fSmrg  am__leading_dot=.
1184a0195d5fSmrgelse
1185a0195d5fSmrg  am__leading_dot=_
1186a0195d5fSmrgfi
1187a0195d5fSmrgrmdir .tst 2>/dev/null
1188a0195d5fSmrgAC_SUBST([am__leading_dot])])
1189a0195d5fSmrg
1190a0195d5fSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
1191a0195d5fSmrg# From Jim Meyering
1192a0195d5fSmrg
1193a0195d5fSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
1194a0195d5fSmrg# Free Software Foundation, Inc.
1195a0195d5fSmrg#
1196a0195d5fSmrg# This file is free software; the Free Software Foundation
1197a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1198a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1199a0195d5fSmrg
1200a0195d5fSmrg# serial 4
1201a0195d5fSmrg
1202a0195d5fSmrgAC_DEFUN([AM_MAINTAINER_MODE],
1203a0195d5fSmrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
1204a0195d5fSmrg  dnl maintainer-mode is disabled by default
1205a0195d5fSmrg  AC_ARG_ENABLE(maintainer-mode,
1206a0195d5fSmrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
1207a0195d5fSmrg			  (and sometimes confusing) to the casual installer],
1208a0195d5fSmrg      USE_MAINTAINER_MODE=$enableval,
1209a0195d5fSmrg      USE_MAINTAINER_MODE=no)
1210a0195d5fSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1211a0195d5fSmrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
1212a0195d5fSmrg  MAINT=$MAINTAINER_MODE_TRUE
1213a0195d5fSmrg  AC_SUBST(MAINT)dnl
1214a0195d5fSmrg]
1215a0195d5fSmrg)
1216a0195d5fSmrg
1217a0195d5fSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
1218a0195d5fSmrg
1219a0195d5fSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1220a0195d5fSmrg
1221a0195d5fSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
1222a0195d5fSmrg#
1223a0195d5fSmrg# This file is free software; the Free Software Foundation
1224a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1225a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1226a0195d5fSmrg
1227a0195d5fSmrg# serial 3
1228a0195d5fSmrg
1229a0195d5fSmrg# AM_MAKE_INCLUDE()
1230a0195d5fSmrg# -----------------
1231a0195d5fSmrg# Check to see how make treats includes.
1232a0195d5fSmrgAC_DEFUN([AM_MAKE_INCLUDE],
1233a0195d5fSmrg[am_make=${MAKE-make}
1234a0195d5fSmrgcat > confinc << 'END'
1235a0195d5fSmrgam__doit:
1236a0195d5fSmrg	@echo done
1237a0195d5fSmrg.PHONY: am__doit
1238a0195d5fSmrgEND
1239a0195d5fSmrg# If we don't find an include directive, just comment out the code.
1240a0195d5fSmrgAC_MSG_CHECKING([for style of include used by $am_make])
1241a0195d5fSmrgam__include="#"
1242a0195d5fSmrgam__quote=
1243a0195d5fSmrg_am_result=none
1244a0195d5fSmrg# First try GNU make style include.
1245a0195d5fSmrgecho "include confinc" > confmf
1246a0195d5fSmrg# We grep out `Entering directory' and `Leaving directory'
1247a0195d5fSmrg# messages which can occur if `w' ends up in MAKEFLAGS.
1248a0195d5fSmrg# In particular we don't look at `^make:' because GNU make might
1249a0195d5fSmrg# be invoked under some other name (usually "gmake"), in which
1250a0195d5fSmrg# case it prints its new name instead of `make'.
1251a0195d5fSmrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
1252a0195d5fSmrg   am__include=include
1253a0195d5fSmrg   am__quote=
1254a0195d5fSmrg   _am_result=GNU
1255a0195d5fSmrgfi
1256a0195d5fSmrg# Now try BSD make style include.
1257a0195d5fSmrgif test "$am__include" = "#"; then
1258a0195d5fSmrg   echo '.include "confinc"' > confmf
1259a0195d5fSmrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
1260a0195d5fSmrg      am__include=.include
1261a0195d5fSmrg      am__quote="\""
1262a0195d5fSmrg      _am_result=BSD
1263a0195d5fSmrg   fi
1264a0195d5fSmrgfi
1265a0195d5fSmrgAC_SUBST([am__include])
1266a0195d5fSmrgAC_SUBST([am__quote])
1267a0195d5fSmrgAC_MSG_RESULT([$_am_result])
1268a0195d5fSmrgrm -f confinc confmf
1269a0195d5fSmrg])
1270a0195d5fSmrg
1271a0195d5fSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1272a0195d5fSmrg
1273a0195d5fSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
1274a0195d5fSmrg# Free Software Foundation, Inc.
1275a0195d5fSmrg#
1276a0195d5fSmrg# This file is free software; the Free Software Foundation
1277a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1278a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1279a0195d5fSmrg
1280a0195d5fSmrg# serial 5
1281a0195d5fSmrg
1282a0195d5fSmrg# AM_MISSING_PROG(NAME, PROGRAM)
1283a0195d5fSmrg# ------------------------------
1284a0195d5fSmrgAC_DEFUN([AM_MISSING_PROG],
1285a0195d5fSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
1286a0195d5fSmrg$1=${$1-"${am_missing_run}$2"}
1287a0195d5fSmrgAC_SUBST($1)])
1288a0195d5fSmrg
1289a0195d5fSmrg
1290a0195d5fSmrg# AM_MISSING_HAS_RUN
1291a0195d5fSmrg# ------------------
1292a0195d5fSmrg# Define MISSING if not defined so far and test if it supports --run.
1293a0195d5fSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
1294a0195d5fSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
1295a0195d5fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1296a0195d5fSmrgAC_REQUIRE_AUX_FILE([missing])dnl
1297a0195d5fSmrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
1298a0195d5fSmrg# Use eval to expand $SHELL
1299a0195d5fSmrgif eval "$MISSING --run true"; then
1300a0195d5fSmrg  am_missing_run="$MISSING --run "
1301a0195d5fSmrgelse
1302a0195d5fSmrg  am_missing_run=
1303a0195d5fSmrg  AC_MSG_WARN([`missing' script is too old or missing])
1304a0195d5fSmrgfi
1305a0195d5fSmrg])
1306a0195d5fSmrg
1307a0195d5fSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
1308a0195d5fSmrg#
1309a0195d5fSmrg# This file is free software; the Free Software Foundation
1310a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1311a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1312a0195d5fSmrg
1313a0195d5fSmrg# AM_PROG_MKDIR_P
1314a0195d5fSmrg# ---------------
1315a0195d5fSmrg# Check for `mkdir -p'.
1316a0195d5fSmrgAC_DEFUN([AM_PROG_MKDIR_P],
1317a0195d5fSmrg[AC_PREREQ([2.60])dnl
1318a0195d5fSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
1319a0195d5fSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1320a0195d5fSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
1321a0195d5fSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1322a0195d5fSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1323a0195d5fSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
1324a0195d5fSmrgdnl adjustment using top_builddir (which is defined more often than
1325a0195d5fSmrgdnl MKDIR_P).
1326a0195d5fSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1327a0195d5fSmrgcase $mkdir_p in
1328a0195d5fSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
1329a0195d5fSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1330a0195d5fSmrgesac
1331a0195d5fSmrg])
1332a0195d5fSmrg
1333a0195d5fSmrg# Helper functions for option handling.                     -*- Autoconf -*-
1334a0195d5fSmrg
1335a0195d5fSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
1336a0195d5fSmrg#
1337a0195d5fSmrg# This file is free software; the Free Software Foundation
1338a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1339a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1340a0195d5fSmrg
1341a0195d5fSmrg# serial 3
1342a0195d5fSmrg
1343a0195d5fSmrg# _AM_MANGLE_OPTION(NAME)
1344a0195d5fSmrg# -----------------------
1345a0195d5fSmrgAC_DEFUN([_AM_MANGLE_OPTION],
1346a0195d5fSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1347a0195d5fSmrg
1348a0195d5fSmrg# _AM_SET_OPTION(NAME)
1349a0195d5fSmrg# ------------------------------
1350a0195d5fSmrg# Set option NAME.  Presently that only means defining a flag for this option.
1351a0195d5fSmrgAC_DEFUN([_AM_SET_OPTION],
1352a0195d5fSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1353a0195d5fSmrg
1354a0195d5fSmrg# _AM_SET_OPTIONS(OPTIONS)
1355a0195d5fSmrg# ----------------------------------
1356a0195d5fSmrg# OPTIONS is a space-separated list of Automake options.
1357a0195d5fSmrgAC_DEFUN([_AM_SET_OPTIONS],
1358a0195d5fSmrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1359a0195d5fSmrg
1360a0195d5fSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1361a0195d5fSmrg# -------------------------------------------
1362a0195d5fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1363a0195d5fSmrgAC_DEFUN([_AM_IF_OPTION],
1364a0195d5fSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1365a0195d5fSmrg
1366a0195d5fSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
1367a0195d5fSmrg
1368a0195d5fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1369a0195d5fSmrg# Free Software Foundation, Inc.
1370a0195d5fSmrg#
1371a0195d5fSmrg# This file is free software; the Free Software Foundation
1372a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1373a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1374a0195d5fSmrg
1375a0195d5fSmrg# serial 4
1376a0195d5fSmrg
1377a0195d5fSmrg# AM_SANITY_CHECK
1378a0195d5fSmrg# ---------------
1379a0195d5fSmrgAC_DEFUN([AM_SANITY_CHECK],
1380a0195d5fSmrg[AC_MSG_CHECKING([whether build environment is sane])
1381a0195d5fSmrg# Just in case
1382a0195d5fSmrgsleep 1
1383a0195d5fSmrgecho timestamp > conftest.file
1384a0195d5fSmrg# Do `set' in a subshell so we don't clobber the current shell's
1385a0195d5fSmrg# arguments.  Must try -L first in case configure is actually a
1386a0195d5fSmrg# symlink; some systems play weird games with the mod time of symlinks
1387a0195d5fSmrg# (eg FreeBSD returns the mod time of the symlink's containing
1388a0195d5fSmrg# directory).
1389a0195d5fSmrgif (
1390a0195d5fSmrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
1391a0195d5fSmrg   if test "$[*]" = "X"; then
1392a0195d5fSmrg      # -L didn't work.
1393a0195d5fSmrg      set X `ls -t $srcdir/configure conftest.file`
1394a0195d5fSmrg   fi
1395a0195d5fSmrg   rm -f conftest.file
1396a0195d5fSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
1397a0195d5fSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
1398a0195d5fSmrg
1399a0195d5fSmrg      # If neither matched, then we have a broken ls.  This can happen
1400a0195d5fSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
1401a0195d5fSmrg      # broken ls alias from the environment.  This has actually
1402a0195d5fSmrg      # happened.  Such a system could not be considered "sane".
1403a0195d5fSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1404a0195d5fSmrgalias in your environment])
1405a0195d5fSmrg   fi
1406a0195d5fSmrg
1407a0195d5fSmrg   test "$[2]" = conftest.file
1408a0195d5fSmrg   )
1409a0195d5fSmrgthen
1410a0195d5fSmrg   # Ok.
1411a0195d5fSmrg   :
1412a0195d5fSmrgelse
1413a0195d5fSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
1414a0195d5fSmrgCheck your system clock])
1415a0195d5fSmrgfi
1416a0195d5fSmrgAC_MSG_RESULT(yes)])
1417a0195d5fSmrg
1418a0195d5fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1419a0195d5fSmrg#
1420a0195d5fSmrg# This file is free software; the Free Software Foundation
1421a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1422a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1423a0195d5fSmrg
1424a0195d5fSmrg# AM_PROG_INSTALL_STRIP
1425a0195d5fSmrg# ---------------------
1426a0195d5fSmrg# One issue with vendor `install' (even GNU) is that you can't
1427a0195d5fSmrg# specify the program used to strip binaries.  This is especially
1428a0195d5fSmrg# annoying in cross-compiling environments, where the build's strip
1429a0195d5fSmrg# is unlikely to handle the host's binaries.
1430a0195d5fSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
1431a0195d5fSmrg# always use install-sh in `make install-strip', and initialize
1432a0195d5fSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
1433a0195d5fSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
1434a0195d5fSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1435a0195d5fSmrg# Installed binaries are usually stripped using `strip' when the user
1436a0195d5fSmrg# run `make install-strip'.  However `strip' might not be the right
1437a0195d5fSmrg# tool to use in cross-compilation environments, therefore Automake
1438a0195d5fSmrg# will honor the `STRIP' environment variable to overrule this program.
1439a0195d5fSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1440a0195d5fSmrgif test "$cross_compiling" != no; then
1441a0195d5fSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
1442a0195d5fSmrgfi
1443a0195d5fSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1444a0195d5fSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1445a0195d5fSmrg
1446a0195d5fSmrg# Copyright (C) 2006  Free Software Foundation, Inc.
1447a0195d5fSmrg#
1448a0195d5fSmrg# This file is free software; the Free Software Foundation
1449a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1450a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1451a0195d5fSmrg
1452a0195d5fSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
1453a0195d5fSmrg# ---------------------------
1454a0195d5fSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1455a0195d5fSmrg# This macro is traced by Automake.
1456a0195d5fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1457a0195d5fSmrg
1458a0195d5fSmrg# Check how to create a tarball.                            -*- Autoconf -*-
1459a0195d5fSmrg
1460a0195d5fSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1461a0195d5fSmrg#
1462a0195d5fSmrg# This file is free software; the Free Software Foundation
1463a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
1464a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
1465a0195d5fSmrg
1466a0195d5fSmrg# serial 2
1467a0195d5fSmrg
1468a0195d5fSmrg# _AM_PROG_TAR(FORMAT)
1469a0195d5fSmrg# --------------------
1470a0195d5fSmrg# Check how to create a tarball in format FORMAT.
1471a0195d5fSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
1472a0195d5fSmrg#
1473a0195d5fSmrg# Substitute a variable $(am__tar) that is a command
1474a0195d5fSmrg# writing to stdout a FORMAT-tarball containing the directory
1475a0195d5fSmrg# $tardir.
1476a0195d5fSmrg#     tardir=directory && $(am__tar) > result.tar
1477a0195d5fSmrg#
1478a0195d5fSmrg# Substitute a variable $(am__untar) that extract such
1479a0195d5fSmrg# a tarball read from stdin.
1480a0195d5fSmrg#     $(am__untar) < result.tar
1481a0195d5fSmrgAC_DEFUN([_AM_PROG_TAR],
1482a0195d5fSmrg[# Always define AMTAR for backward compatibility.
1483a0195d5fSmrgAM_MISSING_PROG([AMTAR], [tar])
1484a0195d5fSmrgm4_if([$1], [v7],
1485a0195d5fSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1486a0195d5fSmrg     [m4_case([$1], [ustar],, [pax],,
1487a0195d5fSmrg              [m4_fatal([Unknown tar format])])
1488a0195d5fSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
1489a0195d5fSmrg# Loop over all known methods to create a tar archive until one works.
1490a0195d5fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1491a0195d5fSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1492a0195d5fSmrg# Do not fold the above two line into one, because Tru64 sh and
1493a0195d5fSmrg# Solaris sh will not grok spaces in the rhs of `-'.
1494a0195d5fSmrgfor _am_tool in $_am_tools
1495a0195d5fSmrgdo
1496a0195d5fSmrg  case $_am_tool in
1497a0195d5fSmrg  gnutar)
1498a0195d5fSmrg    for _am_tar in tar gnutar gtar;
1499a0195d5fSmrg    do
1500a0195d5fSmrg      AM_RUN_LOG([$_am_tar --version]) && break
1501a0195d5fSmrg    done
1502a0195d5fSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1503a0195d5fSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1504a0195d5fSmrg    am__untar="$_am_tar -xf -"
1505a0195d5fSmrg    ;;
1506a0195d5fSmrg  plaintar)
1507a0195d5fSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
1508a0195d5fSmrg    # ustar tarball either.
1509a0195d5fSmrg    (tar --version) >/dev/null 2>&1 && continue
1510a0195d5fSmrg    am__tar='tar chf - "$$tardir"'
1511a0195d5fSmrg    am__tar_='tar chf - "$tardir"'
1512a0195d5fSmrg    am__untar='tar xf -'
1513a0195d5fSmrg    ;;
1514a0195d5fSmrg  pax)
1515a0195d5fSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
1516a0195d5fSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
1517a0195d5fSmrg    am__untar='pax -r'
1518a0195d5fSmrg    ;;
1519a0195d5fSmrg  cpio)
1520a0195d5fSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1521a0195d5fSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1522a0195d5fSmrg    am__untar='cpio -i -H $1 -d'
1523a0195d5fSmrg    ;;
1524a0195d5fSmrg  none)
1525a0195d5fSmrg    am__tar=false
1526a0195d5fSmrg    am__tar_=false
1527a0195d5fSmrg    am__untar=false
1528a0195d5fSmrg    ;;
1529a0195d5fSmrg  esac
1530a0195d5fSmrg
1531a0195d5fSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
1532a0195d5fSmrg  # and am__untar set.
1533a0195d5fSmrg  test -n "${am_cv_prog_tar_$1}" && break
1534a0195d5fSmrg
1535a0195d5fSmrg  # tar/untar a dummy directory, and stop if the command works
1536a0195d5fSmrg  rm -rf conftest.dir
1537a0195d5fSmrg  mkdir conftest.dir
1538a0195d5fSmrg  echo GrepMe > conftest.dir/file
1539a0195d5fSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1540a0195d5fSmrg  rm -rf conftest.dir
1541a0195d5fSmrg  if test -s conftest.tar; then
1542a0195d5fSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1543a0195d5fSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1544a0195d5fSmrg  fi
1545a0195d5fSmrgdone
1546a0195d5fSmrgrm -rf conftest.dir
1547a0195d5fSmrg
1548a0195d5fSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1549a0195d5fSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1550a0195d5fSmrgAC_SUBST([am__tar])
1551a0195d5fSmrgAC_SUBST([am__untar])
1552a0195d5fSmrg]) # _AM_PROG_TAR
1553a0195d5fSmrg
1554