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