aclocal.m4 revision 76910425
176910425Smrg# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
276910425Smrg
376910425Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
476910425Smrg# 2005  Free Software Foundation, Inc.
576910425Smrg# This file is free software; the Free Software Foundation
676910425Smrg# gives unlimited permission to copy and/or distribute it,
776910425Smrg# with or without modifications, as long as this notice is preserved.
876910425Smrg
976910425Smrg# This program is distributed in the hope that it will be useful,
1076910425Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1176910425Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1276910425Smrg# PARTICULAR PURPOSE.
1376910425Smrg
1476910425Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1576910425Smrg# 
1676910425Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1776910425Smrg#
1876910425Smrg# This program is free software; you can redistribute it and/or modify
1976910425Smrg# it under the terms of the GNU General Public License as published by
2076910425Smrg# the Free Software Foundation; either version 2 of the License, or
2176910425Smrg# (at your option) any later version.
2276910425Smrg#
2376910425Smrg# This program is distributed in the hope that it will be useful, but
2476910425Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2576910425Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2676910425Smrg# General Public License for more details.
2776910425Smrg#
2876910425Smrg# You should have received a copy of the GNU General Public License
2976910425Smrg# along with this program; if not, write to the Free Software
3076910425Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3176910425Smrg#
3276910425Smrg# As a special exception to the GNU General Public License, if you
3376910425Smrg# distribute this file as part of a program that contains a
3476910425Smrg# configuration script generated by Autoconf, you may include it under
3576910425Smrg# the same distribution terms that you use for the rest of that program.
3676910425Smrg
3776910425Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
3876910425Smrg# ----------------------------------
3976910425SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
4076910425Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
4176910425Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
4276910425SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
4376910425Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
4476910425Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
4576910425Smrgfi
4676910425Smrgif test -n "$PKG_CONFIG"; then
4776910425Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
4876910425Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
4976910425Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
5076910425Smrg		AC_MSG_RESULT([yes])
5176910425Smrg	else
5276910425Smrg		AC_MSG_RESULT([no])
5376910425Smrg		PKG_CONFIG=""
5476910425Smrg	fi
5576910425Smrg		
5676910425Smrgfi[]dnl
5776910425Smrg])# PKG_PROG_PKG_CONFIG
5876910425Smrg
5976910425Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
6076910425Smrg#
6176910425Smrg# Check to see whether a particular set of modules exists.  Similar
6276910425Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
6376910425Smrg#
6476910425Smrg#
6576910425Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
6676910425Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
6776910425Smrg# PKG_CHECK_EXISTS manually
6876910425Smrg# --------------------------------------------------------------
6976910425SmrgAC_DEFUN([PKG_CHECK_EXISTS],
7076910425Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
7176910425Smrgif test -n "$PKG_CONFIG" && \
7276910425Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
7376910425Smrg  m4_ifval([$2], [$2], [:])
7476910425Smrgm4_ifvaln([$3], [else
7576910425Smrg  $3])dnl
7676910425Smrgfi])
7776910425Smrg
7876910425Smrg
7976910425Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8076910425Smrg# ---------------------------------------------
8176910425Smrgm4_define([_PKG_CONFIG],
8276910425Smrg[if test -n "$PKG_CONFIG"; then
8376910425Smrg    if test -n "$$1"; then
8476910425Smrg        pkg_cv_[]$1="$$1"
8576910425Smrg    else
8676910425Smrg        PKG_CHECK_EXISTS([$3],
8776910425Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8876910425Smrg			 [pkg_failed=yes])
8976910425Smrg    fi
9076910425Smrgelse
9176910425Smrg	pkg_failed=untried
9276910425Smrgfi[]dnl
9376910425Smrg])# _PKG_CONFIG
9476910425Smrg
9576910425Smrg# _PKG_SHORT_ERRORS_SUPPORTED
9676910425Smrg# -----------------------------
9776910425SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9876910425Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9976910425Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
10076910425Smrg        _pkg_short_errors_supported=yes
10176910425Smrgelse
10276910425Smrg        _pkg_short_errors_supported=no
10376910425Smrgfi[]dnl
10476910425Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
10576910425Smrg
10676910425Smrg
10776910425Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
10876910425Smrg# [ACTION-IF-NOT-FOUND])
10976910425Smrg#
11076910425Smrg#
11176910425Smrg# Note that if there is a possibility the first call to
11276910425Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
11376910425Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
11476910425Smrg#
11576910425Smrg#
11676910425Smrg# --------------------------------------------------------------
11776910425SmrgAC_DEFUN([PKG_CHECK_MODULES],
11876910425Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
11976910425SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
12076910425SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
12176910425Smrg
12276910425Smrgpkg_failed=no
12376910425SmrgAC_MSG_CHECKING([for $1])
12476910425Smrg
12576910425Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
12676910425Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
12776910425Smrg
12876910425Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
12976910425Smrgand $1[]_LIBS to avoid the need to call pkg-config.
13076910425SmrgSee the pkg-config man page for more details.])
13176910425Smrg
13276910425Smrgif test $pkg_failed = yes; then
13376910425Smrg        _PKG_SHORT_ERRORS_SUPPORTED
13476910425Smrg        if test $_pkg_short_errors_supported = yes; then
13576910425Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
13676910425Smrg        else 
13776910425Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
13876910425Smrg        fi
13976910425Smrg	# Put the nasty error message in config.log where it belongs
14076910425Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
14176910425Smrg
14276910425Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
14376910425Smrg[Package requirements ($2) were not met:
14476910425Smrg
14576910425Smrg$$1_PKG_ERRORS
14676910425Smrg
14776910425SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
14876910425Smrginstalled software in a non-standard prefix.
14976910425Smrg
15076910425Smrg_PKG_TEXT
15176910425Smrg])],
15276910425Smrg		[$4])
15376910425Smrgelif test $pkg_failed = untried; then
15476910425Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
15576910425Smrg[The pkg-config script could not be found or is too old.  Make sure it
15676910425Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
15776910425Smrgpath to pkg-config.
15876910425Smrg
15976910425Smrg_PKG_TEXT
16076910425Smrg
16176910425SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
16276910425Smrg		[$4])
16376910425Smrgelse
16476910425Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
16576910425Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
16676910425Smrg        AC_MSG_RESULT([yes])
16776910425Smrg	ifelse([$3], , :, [$3])
16876910425Smrgfi[]dnl
16976910425Smrg])# PKG_CHECK_MODULES
17076910425Smrg
17176910425Smrgdnl $Id: aclocal.m4,v 1.1.1.1 2008/07/30 04:22:32 mrg Exp $
17276910425Smrgdnl
17376910425Smrgdnl Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
17476910425Smrgdnl 
17576910425Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
17676910425Smrgdnl documentation for any purpose is hereby granted without fee, provided that
17776910425Smrgdnl the above copyright notice appear in all copies and that both that
17876910425Smrgdnl copyright notice and this permission notice appear in supporting
17976910425Smrgdnl documentation.
18076910425Smrgdnl 
18176910425Smrgdnl The above copyright notice and this permission notice shall be included
18276910425Smrgdnl in all copies or substantial portions of the Software.
18376910425Smrgdnl 
18476910425Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18576910425Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18676910425Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18776910425Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18876910425Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18976910425Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19076910425Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
19176910425Smrgdnl 
19276910425Smrgdnl Except as contained in this notice, the name of the copyright holders shall
19376910425Smrgdnl not be used in advertising or otherwise to promote the sale, use or
19476910425Smrgdnl other dealings in this Software without prior written authorization
19576910425Smrgdnl from the copyright holders.
19676910425Smrgdnl 
19776910425Smrg
19876910425Smrg# XORG_PROG_RAWCPP()
19976910425Smrg# ------------------
20076910425Smrg# Find cpp program and necessary flags for use in pre-processing text files
20176910425Smrg# such as man pages and config files
20276910425SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
20376910425SmrgAC_REQUIRE([AC_PROG_CPP])
20476910425SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
20576910425Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
20676910425Smrg
20776910425Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
20876910425Smrg# which is not the best choice for supporting other OS'es, but covers most
20976910425Smrg# of the ones we need for now.
21076910425SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
21176910425SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
21276910425Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
21376910425Smrg	AC_MSG_RESULT([no])
21476910425Smrgelse
21576910425Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
21676910425Smrg		RAWCPPFLAGS=-undef
21776910425Smrg		AC_MSG_RESULT([yes])
21876910425Smrg	else
21976910425Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
22076910425Smrg	fi
22176910425Smrgfi
22276910425Smrgrm -f conftest.$ac_ext
22376910425Smrg
22476910425SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
22576910425SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
22676910425Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
22776910425Smrg	AC_MSG_RESULT([no])
22876910425Smrgelse
22976910425Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
23076910425Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
23176910425Smrg		AC_MSG_RESULT([yes])
23276910425Smrg	else
23376910425Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
23476910425Smrg	fi
23576910425Smrgfi
23676910425Smrgrm -f conftest.$ac_ext
23776910425SmrgAC_SUBST(RAWCPPFLAGS)
23876910425Smrg]) # XORG_PROG_RAWCPP
23976910425Smrg
24076910425Smrg# XORG_MANPAGE_SECTIONS()
24176910425Smrg# -----------------------
24276910425Smrg# Determine which sections man pages go in for the different man page types
24376910425Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
24476910425Smrg# Not sure if there's any better way than just hardcoding by OS name.
24576910425Smrg# Override default settings by setting environment variables
24676910425Smrg
24776910425SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
24876910425SmrgAC_REQUIRE([AC_CANONICAL_HOST])
24976910425Smrg
25076910425Smrgif test x$APP_MAN_SUFFIX = x    ; then
25176910425Smrg    case $host_os in
25276910425Smrg	linux*)	APP_MAN_SUFFIX=1x ;;
25376910425Smrg	*)	APP_MAN_SUFFIX=1  ;;
25476910425Smrg    esac
25576910425Smrgfi
25676910425Smrgif test x$APP_MAN_DIR = x    ; then
25776910425Smrg    case $host_os in
25876910425Smrg	linux*)	APP_MAN_DIR='$(mandir)/man1' ;;
25976910425Smrg	*)	APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;;
26076910425Smrg    esac
26176910425Smrgfi
26276910425Smrg
26376910425Smrgif test x$LIB_MAN_SUFFIX = x    ; then
26476910425Smrg    case $host_os in
26576910425Smrg	linux*)	LIB_MAN_SUFFIX=3x ;;
26676910425Smrg	*)	LIB_MAN_SUFFIX=3  ;;
26776910425Smrg    esac
26876910425Smrgfi
26976910425Smrgif test x$LIB_MAN_DIR = x    ; then
27076910425Smrg    case $host_os in
27176910425Smrg	linux*)	LIB_MAN_DIR='$(mandir)/man3' ;;
27276910425Smrg	*)	LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;;
27376910425Smrg    esac
27476910425Smrgfi
27576910425Smrg
27676910425Smrgif test x$FILE_MAN_SUFFIX = x    ; then
27776910425Smrg    case $host_os in
27876910425Smrg	linux*)		FILE_MAN_SUFFIX=5x ;;
27976910425Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
28076910425Smrg	*)		FILE_MAN_SUFFIX=5  ;;
28176910425Smrg    esac
28276910425Smrgfi
28376910425Smrgif test x$FILE_MAN_DIR = x    ; then
28476910425Smrg    case $host_os in
28576910425Smrg	linux*)	FILE_MAN_DIR='$(mandir)/man5' ;;
28676910425Smrg	*)	FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;;
28776910425Smrg    esac
28876910425Smrgfi
28976910425Smrg
29076910425Smrg# In Imake's linux.cf, the misc man suffix & dir was only changed for 
29176910425Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here
29276910425Smrgif test x$MISC_MAN_SUFFIX = x    ; then
29376910425Smrg    case $host_os in
29476910425Smrg#	linux*)		MISC_MAN_SUFFIX=7x ;;
29576910425Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
29676910425Smrg	*)		MISC_MAN_SUFFIX=7  ;;
29776910425Smrg    esac
29876910425Smrgfi
29976910425Smrgif test x$MISC_MAN_DIR = x    ; then
30076910425Smrg    case $host_os in
30176910425Smrg#	linux*)	MISC_MAN_DIR='$(mandir)/man7' ;;
30276910425Smrg	*)	MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;;
30376910425Smrg    esac
30476910425Smrgfi
30576910425Smrg
30676910425Smrg# In Imake's linux.cf, the driver man suffix & dir was only changed for 
30776910425Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here
30876910425Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
30976910425Smrg    case $host_os in
31076910425Smrg#	linux*)		DRIVER_MAN_SUFFIX=4x ;;
31176910425Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
31276910425Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
31376910425Smrg    esac
31476910425Smrgfi
31576910425Smrgif test x$DRIVER_MAN_DIR = x    ; then
31676910425Smrg    case $host_os in
31776910425Smrg#	linux*)	DRIVER_MAN_DIR='$(mandir)/man4' ;;
31876910425Smrg	*)	DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;;
31976910425Smrg    esac
32076910425Smrgfi
32176910425Smrg
32276910425Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
32376910425Smrg    case $host_os in
32476910425Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
32576910425Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
32676910425Smrg    esac
32776910425Smrgfi
32876910425Smrgif test x$ADMIN_MAN_DIR = x    ; then
32976910425Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
33076910425Smrgfi
33176910425Smrg
33276910425Smrg
33376910425SmrgAC_SUBST([APP_MAN_SUFFIX])
33476910425SmrgAC_SUBST([LIB_MAN_SUFFIX])
33576910425SmrgAC_SUBST([FILE_MAN_SUFFIX])
33676910425SmrgAC_SUBST([MISC_MAN_SUFFIX])
33776910425SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
33876910425SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
33976910425SmrgAC_SUBST([APP_MAN_DIR])
34076910425SmrgAC_SUBST([LIB_MAN_DIR])
34176910425SmrgAC_SUBST([FILE_MAN_DIR])
34276910425SmrgAC_SUBST([MISC_MAN_DIR])
34376910425SmrgAC_SUBST([DRIVER_MAN_DIR])
34476910425SmrgAC_SUBST([ADMIN_MAN_DIR])
34576910425Smrg]) # XORG_MANPAGE_SECTIONS
34676910425Smrg
34776910425Smrg# XORG_CHECK_LINUXDOC
34876910425Smrg# -------------------
34976910425Smrg# Defines the variable MAKE_TEXT if the necessary tools and
35076910425Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
35176910425Smrg# Whether or not the necessary tools and files are found can be checked
35276910425Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
35376910425SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
35476910425SmrgAC_CHECK_FILE(
35576910425Smrg	[$prefix/share/X11/sgml/defs.ent], 
35676910425Smrg	[DEFS_ENT_PATH=$prefix/share/X11/sgml],
35776910425Smrg	[DEFS_ENT_PATH=]
35876910425Smrg)
35976910425Smrg
36076910425SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
36176910425SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
36276910425Smrg
36376910425SmrgAC_MSG_CHECKING([Whether to build documentation])
36476910425Smrg
36576910425Smrgif test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then
36676910425Smrg   BUILDDOC=yes
36776910425Smrgelse
36876910425Smrg   BUILDDOC=no
36976910425Smrgfi
37076910425Smrg
37176910425SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
37276910425Smrg
37376910425SmrgAC_MSG_RESULT([$BUILDDOC])
37476910425Smrg
37576910425SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
37676910425Smrg
37776910425Smrgif test x$PS2PDF != x ; then
37876910425Smrg   BUILDPDFDOC=yes
37976910425Smrgelse
38076910425Smrg   BUILDPDFDOC=no
38176910425Smrgfi
38276910425Smrg
38376910425SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
38476910425Smrg
38576910425SmrgAC_MSG_RESULT([$BUILDPDFDOC])
38676910425Smrg
38776910425SmrgMAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
38876910425SmrgMAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
38976910425SmrgMAKE_PDF="$PS2PDF"
39076910425SmrgMAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC  -B html --split=0"
39176910425Smrg
39276910425SmrgAC_SUBST(MAKE_TEXT)
39376910425SmrgAC_SUBST(MAKE_PS)
39476910425SmrgAC_SUBST(MAKE_PDF)
39576910425SmrgAC_SUBST(MAKE_HTML)
39676910425Smrg]) # XORG_CHECK_LINUXDOC
39776910425Smrg
39876910425Smrg# XORG_CHECK_MALLOC_ZERO
39976910425Smrg# ----------------------
40076910425Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
40176910425Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
40276910425Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
40376910425SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
40476910425SmrgAC_ARG_ENABLE(malloc0returnsnull,
40576910425Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
40676910425Smrg		       [malloc(0) returns NULL (default: auto)]),
40776910425Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
40876910425Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
40976910425Smrg
41076910425SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
41176910425Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
41276910425Smrg	AC_RUN_IFELSE([
41376910425Smrgchar *malloc();
41476910425Smrgchar *realloc();
41576910425Smrgchar *calloc();
41676910425Smrgmain() {
41776910425Smrg    char *m0, *r0, *c0, *p;
41876910425Smrg    m0 = malloc(0);
41976910425Smrg    p = malloc(10);
42076910425Smrg    r0 = realloc(p,0);
42176910425Smrg    c0 = calloc(0);
42276910425Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
42376910425Smrg}],
42476910425Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
42576910425Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
42676910425Smrgfi
42776910425SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
42876910425Smrg
42976910425Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
43076910425Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
43176910425Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
43276910425Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
43376910425Smrgelse
43476910425Smrg	MALLOC_ZERO_CFLAGS=""
43576910425Smrg	XMALLOC_ZERO_CFLAGS=""
43676910425Smrg	XTMALLOC_ZERO_CFLAGS=""
43776910425Smrgfi
43876910425Smrg
43976910425SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
44076910425SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
44176910425SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
44276910425Smrg]) # XORG_CHECK_MALLOC_ZERO
44376910425Smrg
44476910425Smrgdnl Copyright 2005 Red Hat, Inc
44576910425Smrgdnl
44676910425Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
44776910425Smrgdnl documentation for any purpose is hereby granted without fee, provided that
44876910425Smrgdnl the above copyright notice appear in all copies and that both that
44976910425Smrgdnl copyright notice and this permission notice appear in supporting
45076910425Smrgdnl documentation.
45176910425Smrgdnl
45276910425Smrgdnl The above copyright notice and this permission notice shall be included
45376910425Smrgdnl in all copies or substantial portions of the Software.
45476910425Smrgdnl
45576910425Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
45676910425Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
45776910425Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45876910425Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
45976910425Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
46076910425Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
46176910425Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
46276910425Smrgdnl
46376910425Smrgdnl Except as contained in this notice, the name of the copyright holders shall
46476910425Smrgdnl not be used in advertising or otherwise to promote the sale, use or
46576910425Smrgdnl other dealings in this Software without prior written authorization
46676910425Smrgdnl from the copyright holders.
46776910425Smrgdnl
46876910425Smrg
46976910425Smrg# XORG_RELEASE_VERSION
47076910425Smrg# --------------------
47176910425Smrg# Adds --with/without-release-string and changes the PACKAGE and
47276910425Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
47376910425Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.
47476910425Smrg 
47576910425SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
47676910425Smrg	AC_ARG_WITH(release-version,
47776910425Smrg			AC_HELP_STRING([--with-release-version=STRING],
47876910425Smrg				[Use release version string in package name]),
47976910425Smrg			[RELEASE_VERSION="$withval"],
48076910425Smrg			[RELEASE_VERSION=""])
48176910425Smrg	if test "x$RELEASE_VERSION" != "x"; then
48276910425Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
48376910425Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
48476910425Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
48576910425Smrg	fi
48676910425Smrg])
48776910425Smrg
48876910425Smrg# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
48976910425Smrg#
49076910425Smrg# This file is free software; the Free Software Foundation
49176910425Smrg# gives unlimited permission to copy and/or distribute it,
49276910425Smrg# with or without modifications, as long as this notice is preserved.
49376910425Smrg
49476910425Smrg# AM_AUTOMAKE_VERSION(VERSION)
49576910425Smrg# ----------------------------
49676910425Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
49776910425Smrg# generated from the m4 files accompanying Automake X.Y.
49876910425SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
49976910425Smrg
50076910425Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
50176910425Smrg# -------------------------------
50276910425Smrg# Call AM_AUTOMAKE_VERSION so it can be traced.
50376910425Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
50476910425SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
50576910425Smrg	 [AM_AUTOMAKE_VERSION([1.9.6])])
50676910425Smrg
50776910425Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
50876910425Smrg
50976910425Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
51076910425Smrg#
51176910425Smrg# This file is free software; the Free Software Foundation
51276910425Smrg# gives unlimited permission to copy and/or distribute it,
51376910425Smrg# with or without modifications, as long as this notice is preserved.
51476910425Smrg
51576910425Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
51676910425Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
51776910425Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
51876910425Smrg#
51976910425Smrg# Of course, Automake must honor this variable whenever it calls a
52076910425Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
52176910425Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
52276910425Smrg# depending on how configure is run.  This is pretty annoying, since
52376910425Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
52476910425Smrg# source directory, any form will work fine, but in subdirectories a
52576910425Smrg# relative path needs to be adjusted first.
52676910425Smrg#
52776910425Smrg# $ac_aux_dir/missing
52876910425Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
52976910425Smrg# $top_srcdir/$ac_aux_dir/missing
53076910425Smrg#    fails if $ac_aux_dir is absolute,
53176910425Smrg#    fails when called from a subdirectory in a VPATH build with
53276910425Smrg#          a relative $ac_aux_dir
53376910425Smrg#
53476910425Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
53576910425Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
53676910425Smrg# harmless because $srcdir is `.', but things will broke when you
53776910425Smrg# start a VPATH build or use an absolute $srcdir.
53876910425Smrg#
53976910425Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
54076910425Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
54176910425Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
54276910425Smrg# and then we would define $MISSING as
54376910425Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
54476910425Smrg# This will work as long as MISSING is not called from configure, because
54576910425Smrg# unfortunately $(top_srcdir) has no meaning in configure.
54676910425Smrg# However there are other variables, like CC, which are often used in
54776910425Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
54876910425Smrg#
54976910425Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
55076910425Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
55176910425Smrg# configured tree to be moved without reconfiguration.
55276910425Smrg
55376910425SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
55476910425Smrg[dnl Rely on autoconf to set up CDPATH properly.
55576910425SmrgAC_PREREQ([2.50])dnl
55676910425Smrg# expand $ac_aux_dir to an absolute path
55776910425Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
55876910425Smrg])
55976910425Smrg
56076910425Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
56176910425Smrg
56276910425Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
56376910425Smrg# Free Software Foundation, Inc.
56476910425Smrg#
56576910425Smrg# This file is free software; the Free Software Foundation
56676910425Smrg# gives unlimited permission to copy and/or distribute it,
56776910425Smrg# with or without modifications, as long as this notice is preserved.
56876910425Smrg
56976910425Smrg# serial 7
57076910425Smrg
57176910425Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
57276910425Smrg# -------------------------------------
57376910425Smrg# Define a conditional.
57476910425SmrgAC_DEFUN([AM_CONDITIONAL],
57576910425Smrg[AC_PREREQ(2.52)dnl
57676910425Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
57776910425Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
57876910425SmrgAC_SUBST([$1_TRUE])
57976910425SmrgAC_SUBST([$1_FALSE])
58076910425Smrgif $2; then
58176910425Smrg  $1_TRUE=
58276910425Smrg  $1_FALSE='#'
58376910425Smrgelse
58476910425Smrg  $1_TRUE='#'
58576910425Smrg  $1_FALSE=
58676910425Smrgfi
58776910425SmrgAC_CONFIG_COMMANDS_PRE(
58876910425Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
58976910425Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
59076910425SmrgUsually this means the macro was only invoked conditionally.]])
59176910425Smrgfi])])
59276910425Smrg
59376910425Smrg
59476910425Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
59576910425Smrg# Free Software Foundation, Inc.
59676910425Smrg#
59776910425Smrg# This file is free software; the Free Software Foundation
59876910425Smrg# gives unlimited permission to copy and/or distribute it,
59976910425Smrg# with or without modifications, as long as this notice is preserved.
60076910425Smrg
60176910425Smrg# serial 8
60276910425Smrg
60376910425Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
60476910425Smrg# written in clear, in which case automake, when reading aclocal.m4,
60576910425Smrg# will think it sees a *use*, and therefore will trigger all it's
60676910425Smrg# C support machinery.  Also note that it means that autoscan, seeing
60776910425Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
60876910425Smrg
60976910425Smrg
61076910425Smrg# _AM_DEPENDENCIES(NAME)
61176910425Smrg# ----------------------
61276910425Smrg# See how the compiler implements dependency checking.
61376910425Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
61476910425Smrg# We try a few techniques and use that to set a single cache variable.
61576910425Smrg#
61676910425Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
61776910425Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
61876910425Smrg# dependency, and given that the user is not expected to run this macro,
61976910425Smrg# just rely on AC_PROG_CC.
62076910425SmrgAC_DEFUN([_AM_DEPENDENCIES],
62176910425Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
62276910425SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
62376910425SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
62476910425SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
62576910425Smrg
62676910425Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
62776910425Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
62876910425Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
62976910425Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
63076910425Smrg                   [depcc="$$1"   am_compiler_list=])
63176910425Smrg
63276910425SmrgAC_CACHE_CHECK([dependency style of $depcc],
63376910425Smrg               [am_cv_$1_dependencies_compiler_type],
63476910425Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
63576910425Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
63676910425Smrg  # making bogus files that we don't know about and never remove.  For
63776910425Smrg  # instance it was reported that on HP-UX the gcc test will end up
63876910425Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
63976910425Smrg  # in D'.
64076910425Smrg  mkdir conftest.dir
64176910425Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
64276910425Smrg  # using a relative directory.
64376910425Smrg  cp "$am_depcomp" conftest.dir
64476910425Smrg  cd conftest.dir
64576910425Smrg  # We will build objects and dependencies in a subdirectory because
64676910425Smrg  # it helps to detect inapplicable dependency modes.  For instance
64776910425Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
64876910425Smrg  # side effect of compilation, but ICC will put the dependencies in
64976910425Smrg  # the current directory while Tru64 will put them in the object
65076910425Smrg  # directory.
65176910425Smrg  mkdir sub
65276910425Smrg
65376910425Smrg  am_cv_$1_dependencies_compiler_type=none
65476910425Smrg  if test "$am_compiler_list" = ""; then
65576910425Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
65676910425Smrg  fi
65776910425Smrg  for depmode in $am_compiler_list; do
65876910425Smrg    # Setup a source with many dependencies, because some compilers
65976910425Smrg    # like to wrap large dependency lists on column 80 (with \), and
66076910425Smrg    # we should not choose a depcomp mode which is confused by this.
66176910425Smrg    #
66276910425Smrg    # We need to recreate these files for each test, as the compiler may
66376910425Smrg    # overwrite some of them when testing with obscure command lines.
66476910425Smrg    # This happens at least with the AIX C compiler.
66576910425Smrg    : > sub/conftest.c
66676910425Smrg    for i in 1 2 3 4 5 6; do
66776910425Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
66876910425Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
66976910425Smrg      # Solaris 8's {/usr,}/bin/sh.
67076910425Smrg      touch sub/conftst$i.h
67176910425Smrg    done
67276910425Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
67376910425Smrg
67476910425Smrg    case $depmode in
67576910425Smrg    nosideeffect)
67676910425Smrg      # after this tag, mechanisms are not by side-effect, so they'll
67776910425Smrg      # only be used when explicitly requested
67876910425Smrg      if test "x$enable_dependency_tracking" = xyes; then
67976910425Smrg	continue
68076910425Smrg      else
68176910425Smrg	break
68276910425Smrg      fi
68376910425Smrg      ;;
68476910425Smrg    none) break ;;
68576910425Smrg    esac
68676910425Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
68776910425Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
68876910425Smrg    # handle `-M -o', and we need to detect this.
68976910425Smrg    if depmode=$depmode \
69076910425Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
69176910425Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
69276910425Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
69376910425Smrg         >/dev/null 2>conftest.err &&
69476910425Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
69576910425Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
69676910425Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
69776910425Smrg      # icc doesn't choke on unknown options, it will just issue warnings
69876910425Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
69976910425Smrg      # that says an option was ignored or not supported.
70076910425Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
70176910425Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
70276910425Smrg      # The diagnosis changed in icc 8.0:
70376910425Smrg      #   icc: Command line remark: option '-MP' not supported
70476910425Smrg      if (grep 'ignoring option' conftest.err ||
70576910425Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
70676910425Smrg        am_cv_$1_dependencies_compiler_type=$depmode
70776910425Smrg        break
70876910425Smrg      fi
70976910425Smrg    fi
71076910425Smrg  done
71176910425Smrg
71276910425Smrg  cd ..
71376910425Smrg  rm -rf conftest.dir
71476910425Smrgelse
71576910425Smrg  am_cv_$1_dependencies_compiler_type=none
71676910425Smrgfi
71776910425Smrg])
71876910425SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
71976910425SmrgAM_CONDITIONAL([am__fastdep$1], [
72076910425Smrg  test "x$enable_dependency_tracking" != xno \
72176910425Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
72276910425Smrg])
72376910425Smrg
72476910425Smrg
72576910425Smrg# AM_SET_DEPDIR
72676910425Smrg# -------------
72776910425Smrg# Choose a directory name for dependency files.
72876910425Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
72976910425SmrgAC_DEFUN([AM_SET_DEPDIR],
73076910425Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
73176910425SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
73276910425Smrg])
73376910425Smrg
73476910425Smrg
73576910425Smrg# AM_DEP_TRACK
73676910425Smrg# ------------
73776910425SmrgAC_DEFUN([AM_DEP_TRACK],
73876910425Smrg[AC_ARG_ENABLE(dependency-tracking,
73976910425Smrg[  --disable-dependency-tracking  speeds up one-time build
74076910425Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
74176910425Smrgif test "x$enable_dependency_tracking" != xno; then
74276910425Smrg  am_depcomp="$ac_aux_dir/depcomp"
74376910425Smrg  AMDEPBACKSLASH='\'
74476910425Smrgfi
74576910425SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
74676910425SmrgAC_SUBST([AMDEPBACKSLASH])
74776910425Smrg])
74876910425Smrg
74976910425Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
75076910425Smrg
75176910425Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
75276910425Smrg# Free Software Foundation, Inc.
75376910425Smrg#
75476910425Smrg# This file is free software; the Free Software Foundation
75576910425Smrg# gives unlimited permission to copy and/or distribute it,
75676910425Smrg# with or without modifications, as long as this notice is preserved.
75776910425Smrg
75876910425Smrg#serial 3
75976910425Smrg
76076910425Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
76176910425Smrg# ------------------------------
76276910425SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
76376910425Smrg[for mf in $CONFIG_FILES; do
76476910425Smrg  # Strip MF so we end up with the name of the file.
76576910425Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
76676910425Smrg  # Check whether this is an Automake generated Makefile or not.
76776910425Smrg  # We used to match only the files named `Makefile.in', but
76876910425Smrg  # some people rename them; so instead we look at the file content.
76976910425Smrg  # Grep'ing the first line is not enough: some people post-process
77076910425Smrg  # each Makefile.in and add a new line on top of each file to say so.
77176910425Smrg  # So let's grep whole file.
77276910425Smrg  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
77376910425Smrg    dirpart=`AS_DIRNAME("$mf")`
77476910425Smrg  else
77576910425Smrg    continue
77676910425Smrg  fi
77776910425Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
77876910425Smrg  # from the Makefile without running `make'.
77976910425Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
78076910425Smrg  test -z "$DEPDIR" && continue
78176910425Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
78276910425Smrg  test -z "am__include" && continue
78376910425Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
78476910425Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
78576910425Smrg  U=`sed -n 's/^U = //p' < "$mf"`
78676910425Smrg  # Find all dependency output files, they are included files with
78776910425Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
78876910425Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
78976910425Smrg  # expansion.
79076910425Smrg  for file in `sed -n "
79176910425Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
79276910425Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
79376910425Smrg    # Make sure the directory exists.
79476910425Smrg    test -f "$dirpart/$file" && continue
79576910425Smrg    fdir=`AS_DIRNAME(["$file"])`
79676910425Smrg    AS_MKDIR_P([$dirpart/$fdir])
79776910425Smrg    # echo "creating $dirpart/$file"
79876910425Smrg    echo '# dummy' > "$dirpart/$file"
79976910425Smrg  done
80076910425Smrgdone
80176910425Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
80276910425Smrg
80376910425Smrg
80476910425Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
80576910425Smrg# -----------------------------
80676910425Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
80776910425Smrg#
80876910425Smrg# This code is only required when automatic dependency tracking
80976910425Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
81076910425Smrg# need in order to bootstrap the dependency handling code.
81176910425SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
81276910425Smrg[AC_CONFIG_COMMANDS([depfiles],
81376910425Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
81476910425Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
81576910425Smrg])
81676910425Smrg
81776910425Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
81876910425Smrg# Free Software Foundation, Inc.
81976910425Smrg#
82076910425Smrg# This file is free software; the Free Software Foundation
82176910425Smrg# gives unlimited permission to copy and/or distribute it,
82276910425Smrg# with or without modifications, as long as this notice is preserved.
82376910425Smrg
82476910425Smrg# serial 8
82576910425Smrg
82676910425Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
82776910425SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
82876910425Smrg
82976910425Smrg# Do all the work for Automake.                             -*- Autoconf -*-
83076910425Smrg
83176910425Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
83276910425Smrg# Free Software Foundation, Inc.
83376910425Smrg#
83476910425Smrg# This file is free software; the Free Software Foundation
83576910425Smrg# gives unlimited permission to copy and/or distribute it,
83676910425Smrg# with or without modifications, as long as this notice is preserved.
83776910425Smrg
83876910425Smrg# serial 12
83976910425Smrg
84076910425Smrg# This macro actually does too much.  Some checks are only needed if
84176910425Smrg# your package does certain things.  But this isn't really a big deal.
84276910425Smrg
84376910425Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
84476910425Smrg# AM_INIT_AUTOMAKE([OPTIONS])
84576910425Smrg# -----------------------------------------------
84676910425Smrg# The call with PACKAGE and VERSION arguments is the old style
84776910425Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
84876910425Smrg# and VERSION should now be passed to AC_INIT and removed from
84976910425Smrg# the call to AM_INIT_AUTOMAKE.
85076910425Smrg# We support both call styles for the transition.  After
85176910425Smrg# the next Automake release, Autoconf can make the AC_INIT
85276910425Smrg# arguments mandatory, and then we can depend on a new Autoconf
85376910425Smrg# release and drop the old call support.
85476910425SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
85576910425Smrg[AC_PREREQ([2.58])dnl
85676910425Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
85776910425Smrgdnl the ones we care about.
85876910425Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
85976910425SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
86076910425SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
86176910425Smrg# test to see if srcdir already configured
86276910425Smrgif test "`cd $srcdir && pwd`" != "`pwd`" &&
86376910425Smrg   test -f $srcdir/config.status; then
86476910425Smrg  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
86576910425Smrgfi
86676910425Smrg
86776910425Smrg# test whether we have cygpath
86876910425Smrgif test -z "$CYGPATH_W"; then
86976910425Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
87076910425Smrg    CYGPATH_W='cygpath -w'
87176910425Smrg  else
87276910425Smrg    CYGPATH_W=echo
87376910425Smrg  fi
87476910425Smrgfi
87576910425SmrgAC_SUBST([CYGPATH_W])
87676910425Smrg
87776910425Smrg# Define the identity of the package.
87876910425Smrgdnl Distinguish between old-style and new-style calls.
87976910425Smrgm4_ifval([$2],
88076910425Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
88176910425Smrg AC_SUBST([PACKAGE], [$1])dnl
88276910425Smrg AC_SUBST([VERSION], [$2])],
88376910425Smrg[_AM_SET_OPTIONS([$1])dnl
88476910425Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
88576910425Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
88676910425Smrg
88776910425Smrg_AM_IF_OPTION([no-define],,
88876910425Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
88976910425Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
89076910425Smrg
89176910425Smrg# Some tools Automake needs.
89276910425SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
89376910425SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
89476910425SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
89576910425SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
89676910425SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
89776910425SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
89876910425SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
89976910425SmrgAM_PROG_INSTALL_SH
90076910425SmrgAM_PROG_INSTALL_STRIP
90176910425SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
90276910425Smrg# We need awk for the "check" target.  The system "awk" is bad on
90376910425Smrg# some platforms.
90476910425SmrgAC_REQUIRE([AC_PROG_AWK])dnl
90576910425SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
90676910425SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
90776910425Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
90876910425Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
90976910425Smrg	      		     [_AM_PROG_TAR([v7])])])
91076910425Smrg_AM_IF_OPTION([no-dependencies],,
91176910425Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
91276910425Smrg                  [_AM_DEPENDENCIES(CC)],
91376910425Smrg                  [define([AC_PROG_CC],
91476910425Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
91576910425SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
91676910425Smrg                  [_AM_DEPENDENCIES(CXX)],
91776910425Smrg                  [define([AC_PROG_CXX],
91876910425Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
91976910425Smrg])
92076910425Smrg])
92176910425Smrg
92276910425Smrg
92376910425Smrg# When config.status generates a header, we must update the stamp-h file.
92476910425Smrg# This file resides in the same directory as the config header
92576910425Smrg# that is generated.  The stamp files are numbered to have different names.
92676910425Smrg
92776910425Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
92876910425Smrg# loop where config.status creates the headers, so we can generate
92976910425Smrg# our stamp files there.
93076910425SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
93176910425Smrg[# Compute $1's index in $config_headers.
93276910425Smrg_am_stamp_count=1
93376910425Smrgfor _am_header in $config_headers :; do
93476910425Smrg  case $_am_header in
93576910425Smrg    $1 | $1:* )
93676910425Smrg      break ;;
93776910425Smrg    * )
93876910425Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
93976910425Smrg  esac
94076910425Smrgdone
94176910425Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
94276910425Smrg
94376910425Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
94476910425Smrg#
94576910425Smrg# This file is free software; the Free Software Foundation
94676910425Smrg# gives unlimited permission to copy and/or distribute it,
94776910425Smrg# with or without modifications, as long as this notice is preserved.
94876910425Smrg
94976910425Smrg# AM_PROG_INSTALL_SH
95076910425Smrg# ------------------
95176910425Smrg# Define $install_sh.
95276910425SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
95376910425Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
95476910425Smrginstall_sh=${install_sh-"$am_aux_dir/install-sh"}
95576910425SmrgAC_SUBST(install_sh)])
95676910425Smrg
95776910425Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
95876910425Smrg#
95976910425Smrg# This file is free software; the Free Software Foundation
96076910425Smrg# gives unlimited permission to copy and/or distribute it,
96176910425Smrg# with or without modifications, as long as this notice is preserved.
96276910425Smrg
96376910425Smrg# serial 2
96476910425Smrg
96576910425Smrg# Check whether the underlying file-system supports filenames
96676910425Smrg# with a leading dot.  For instance MS-DOS doesn't.
96776910425SmrgAC_DEFUN([AM_SET_LEADING_DOT],
96876910425Smrg[rm -rf .tst 2>/dev/null
96976910425Smrgmkdir .tst 2>/dev/null
97076910425Smrgif test -d .tst; then
97176910425Smrg  am__leading_dot=.
97276910425Smrgelse
97376910425Smrg  am__leading_dot=_
97476910425Smrgfi
97576910425Smrgrmdir .tst 2>/dev/null
97676910425SmrgAC_SUBST([am__leading_dot])])
97776910425Smrg
97876910425Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
97976910425Smrg# From Jim Meyering
98076910425Smrg
98176910425Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
98276910425Smrg# Free Software Foundation, Inc.
98376910425Smrg#
98476910425Smrg# This file is free software; the Free Software Foundation
98576910425Smrg# gives unlimited permission to copy and/or distribute it,
98676910425Smrg# with or without modifications, as long as this notice is preserved.
98776910425Smrg
98876910425Smrg# serial 4
98976910425Smrg
99076910425SmrgAC_DEFUN([AM_MAINTAINER_MODE],
99176910425Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
99276910425Smrg  dnl maintainer-mode is disabled by default
99376910425Smrg  AC_ARG_ENABLE(maintainer-mode,
99476910425Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
99576910425Smrg			  (and sometimes confusing) to the casual installer],
99676910425Smrg      USE_MAINTAINER_MODE=$enableval,
99776910425Smrg      USE_MAINTAINER_MODE=no)
99876910425Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
99976910425Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
100076910425Smrg  MAINT=$MAINTAINER_MODE_TRUE
100176910425Smrg  AC_SUBST(MAINT)dnl
100276910425Smrg]
100376910425Smrg)
100476910425Smrg
100576910425SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
100676910425Smrg
100776910425Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
100876910425Smrg
100976910425Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
101076910425Smrg#
101176910425Smrg# This file is free software; the Free Software Foundation
101276910425Smrg# gives unlimited permission to copy and/or distribute it,
101376910425Smrg# with or without modifications, as long as this notice is preserved.
101476910425Smrg
101576910425Smrg# serial 3
101676910425Smrg
101776910425Smrg# AM_MAKE_INCLUDE()
101876910425Smrg# -----------------
101976910425Smrg# Check to see how make treats includes.
102076910425SmrgAC_DEFUN([AM_MAKE_INCLUDE],
102176910425Smrg[am_make=${MAKE-make}
102276910425Smrgcat > confinc << 'END'
102376910425Smrgam__doit:
102476910425Smrg	@echo done
102576910425Smrg.PHONY: am__doit
102676910425SmrgEND
102776910425Smrg# If we don't find an include directive, just comment out the code.
102876910425SmrgAC_MSG_CHECKING([for style of include used by $am_make])
102976910425Smrgam__include="#"
103076910425Smrgam__quote=
103176910425Smrg_am_result=none
103276910425Smrg# First try GNU make style include.
103376910425Smrgecho "include confinc" > confmf
103476910425Smrg# We grep out `Entering directory' and `Leaving directory'
103576910425Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
103676910425Smrg# In particular we don't look at `^make:' because GNU make might
103776910425Smrg# be invoked under some other name (usually "gmake"), in which
103876910425Smrg# case it prints its new name instead of `make'.
103976910425Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
104076910425Smrg   am__include=include
104176910425Smrg   am__quote=
104276910425Smrg   _am_result=GNU
104376910425Smrgfi
104476910425Smrg# Now try BSD make style include.
104576910425Smrgif test "$am__include" = "#"; then
104676910425Smrg   echo '.include "confinc"' > confmf
104776910425Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
104876910425Smrg      am__include=.include
104976910425Smrg      am__quote="\""
105076910425Smrg      _am_result=BSD
105176910425Smrg   fi
105276910425Smrgfi
105376910425SmrgAC_SUBST([am__include])
105476910425SmrgAC_SUBST([am__quote])
105576910425SmrgAC_MSG_RESULT([$_am_result])
105676910425Smrgrm -f confinc confmf
105776910425Smrg])
105876910425Smrg
105976910425Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
106076910425Smrg
106176910425Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
106276910425Smrg# Free Software Foundation, Inc.
106376910425Smrg#
106476910425Smrg# This file is free software; the Free Software Foundation
106576910425Smrg# gives unlimited permission to copy and/or distribute it,
106676910425Smrg# with or without modifications, as long as this notice is preserved.
106776910425Smrg
106876910425Smrg# serial 4
106976910425Smrg
107076910425Smrg# AM_MISSING_PROG(NAME, PROGRAM)
107176910425Smrg# ------------------------------
107276910425SmrgAC_DEFUN([AM_MISSING_PROG],
107376910425Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
107476910425Smrg$1=${$1-"${am_missing_run}$2"}
107576910425SmrgAC_SUBST($1)])
107676910425Smrg
107776910425Smrg
107876910425Smrg# AM_MISSING_HAS_RUN
107976910425Smrg# ------------------
108076910425Smrg# Define MISSING if not defined so far and test if it supports --run.
108176910425Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
108276910425SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
108376910425Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
108476910425Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
108576910425Smrg# Use eval to expand $SHELL
108676910425Smrgif eval "$MISSING --run true"; then
108776910425Smrg  am_missing_run="$MISSING --run "
108876910425Smrgelse
108976910425Smrg  am_missing_run=
109076910425Smrg  AC_MSG_WARN([`missing' script is too old or missing])
109176910425Smrgfi
109276910425Smrg])
109376910425Smrg
109476910425Smrg# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
109576910425Smrg#
109676910425Smrg# This file is free software; the Free Software Foundation
109776910425Smrg# gives unlimited permission to copy and/or distribute it,
109876910425Smrg# with or without modifications, as long as this notice is preserved.
109976910425Smrg
110076910425Smrg# AM_PROG_MKDIR_P
110176910425Smrg# ---------------
110276910425Smrg# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
110376910425Smrg#
110476910425Smrg# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
110576910425Smrg# created by `make install' are always world readable, even if the
110676910425Smrg# installer happens to have an overly restrictive umask (e.g. 077).
110776910425Smrg# This was a mistake.  There are at least two reasons why we must not
110876910425Smrg# use `-m 0755':
110976910425Smrg#   - it causes special bits like SGID to be ignored,
111076910425Smrg#   - it may be too restrictive (some setups expect 775 directories).
111176910425Smrg#
111276910425Smrg# Do not use -m 0755 and let people choose whatever they expect by
111376910425Smrg# setting umask.
111476910425Smrg#
111576910425Smrg# We cannot accept any implementation of `mkdir' that recognizes `-p'.
111676910425Smrg# Some implementations (such as Solaris 8's) are not thread-safe: if a
111776910425Smrg# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
111876910425Smrg# concurrently, both version can detect that a/ is missing, but only
111976910425Smrg# one can create it and the other will error out.  Consequently we
112076910425Smrg# restrict ourselves to GNU make (using the --version option ensures
112176910425Smrg# this.)
112276910425SmrgAC_DEFUN([AM_PROG_MKDIR_P],
112376910425Smrg[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
112476910425Smrg  # We used to keeping the `.' as first argument, in order to
112576910425Smrg  # allow $(mkdir_p) to be used without argument.  As in
112676910425Smrg  #   $(mkdir_p) $(somedir)
112776910425Smrg  # where $(somedir) is conditionally defined.  However this is wrong
112876910425Smrg  # for two reasons:
112976910425Smrg  #  1. if the package is installed by a user who cannot write `.'
113076910425Smrg  #     make install will fail,
113176910425Smrg  #  2. the above comment should most certainly read
113276910425Smrg  #     $(mkdir_p) $(DESTDIR)$(somedir)
113376910425Smrg  #     so it does not work when $(somedir) is undefined and
113476910425Smrg  #     $(DESTDIR) is not.
113576910425Smrg  #  To support the latter case, we have to write
113676910425Smrg  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
113776910425Smrg  #  so the `.' trick is pointless.
113876910425Smrg  mkdir_p='mkdir -p --'
113976910425Smrgelse
114076910425Smrg  # On NextStep and OpenStep, the `mkdir' command does not
114176910425Smrg  # recognize any option.  It will interpret all options as
114276910425Smrg  # directories to create, and then abort because `.' already
114376910425Smrg  # exists.
114476910425Smrg  for d in ./-p ./--version;
114576910425Smrg  do
114676910425Smrg    test -d $d && rmdir $d
114776910425Smrg  done
114876910425Smrg  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
114976910425Smrg  if test -f "$ac_aux_dir/mkinstalldirs"; then
115076910425Smrg    mkdir_p='$(mkinstalldirs)'
115176910425Smrg  else
115276910425Smrg    mkdir_p='$(install_sh) -d'
115376910425Smrg  fi
115476910425Smrgfi
115576910425SmrgAC_SUBST([mkdir_p])])
115676910425Smrg
115776910425Smrg# Helper functions for option handling.                     -*- Autoconf -*-
115876910425Smrg
115976910425Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
116076910425Smrg#
116176910425Smrg# This file is free software; the Free Software Foundation
116276910425Smrg# gives unlimited permission to copy and/or distribute it,
116376910425Smrg# with or without modifications, as long as this notice is preserved.
116476910425Smrg
116576910425Smrg# serial 3
116676910425Smrg
116776910425Smrg# _AM_MANGLE_OPTION(NAME)
116876910425Smrg# -----------------------
116976910425SmrgAC_DEFUN([_AM_MANGLE_OPTION],
117076910425Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
117176910425Smrg
117276910425Smrg# _AM_SET_OPTION(NAME)
117376910425Smrg# ------------------------------
117476910425Smrg# Set option NAME.  Presently that only means defining a flag for this option.
117576910425SmrgAC_DEFUN([_AM_SET_OPTION],
117676910425Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
117776910425Smrg
117876910425Smrg# _AM_SET_OPTIONS(OPTIONS)
117976910425Smrg# ----------------------------------
118076910425Smrg# OPTIONS is a space-separated list of Automake options.
118176910425SmrgAC_DEFUN([_AM_SET_OPTIONS],
118276910425Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
118376910425Smrg
118476910425Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
118576910425Smrg# -------------------------------------------
118676910425Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
118776910425SmrgAC_DEFUN([_AM_IF_OPTION],
118876910425Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
118976910425Smrg
119076910425Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
119176910425Smrg
119276910425Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
119376910425Smrg# Free Software Foundation, Inc.
119476910425Smrg#
119576910425Smrg# This file is free software; the Free Software Foundation
119676910425Smrg# gives unlimited permission to copy and/or distribute it,
119776910425Smrg# with or without modifications, as long as this notice is preserved.
119876910425Smrg
119976910425Smrg# serial 4
120076910425Smrg
120176910425Smrg# AM_SANITY_CHECK
120276910425Smrg# ---------------
120376910425SmrgAC_DEFUN([AM_SANITY_CHECK],
120476910425Smrg[AC_MSG_CHECKING([whether build environment is sane])
120576910425Smrg# Just in case
120676910425Smrgsleep 1
120776910425Smrgecho timestamp > conftest.file
120876910425Smrg# Do `set' in a subshell so we don't clobber the current shell's
120976910425Smrg# arguments.  Must try -L first in case configure is actually a
121076910425Smrg# symlink; some systems play weird games with the mod time of symlinks
121176910425Smrg# (eg FreeBSD returns the mod time of the symlink's containing
121276910425Smrg# directory).
121376910425Smrgif (
121476910425Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
121576910425Smrg   if test "$[*]" = "X"; then
121676910425Smrg      # -L didn't work.
121776910425Smrg      set X `ls -t $srcdir/configure conftest.file`
121876910425Smrg   fi
121976910425Smrg   rm -f conftest.file
122076910425Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
122176910425Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
122276910425Smrg
122376910425Smrg      # If neither matched, then we have a broken ls.  This can happen
122476910425Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
122576910425Smrg      # broken ls alias from the environment.  This has actually
122676910425Smrg      # happened.  Such a system could not be considered "sane".
122776910425Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
122876910425Smrgalias in your environment])
122976910425Smrg   fi
123076910425Smrg
123176910425Smrg   test "$[2]" = conftest.file
123276910425Smrg   )
123376910425Smrgthen
123476910425Smrg   # Ok.
123576910425Smrg   :
123676910425Smrgelse
123776910425Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
123876910425SmrgCheck your system clock])
123976910425Smrgfi
124076910425SmrgAC_MSG_RESULT(yes)])
124176910425Smrg
124276910425Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
124376910425Smrg#
124476910425Smrg# This file is free software; the Free Software Foundation
124576910425Smrg# gives unlimited permission to copy and/or distribute it,
124676910425Smrg# with or without modifications, as long as this notice is preserved.
124776910425Smrg
124876910425Smrg# AM_PROG_INSTALL_STRIP
124976910425Smrg# ---------------------
125076910425Smrg# One issue with vendor `install' (even GNU) is that you can't
125176910425Smrg# specify the program used to strip binaries.  This is especially
125276910425Smrg# annoying in cross-compiling environments, where the build's strip
125376910425Smrg# is unlikely to handle the host's binaries.
125476910425Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
125576910425Smrg# always use install-sh in `make install-strip', and initialize
125676910425Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
125776910425SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
125876910425Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
125976910425Smrg# Installed binaries are usually stripped using `strip' when the user
126076910425Smrg# run `make install-strip'.  However `strip' might not be the right
126176910425Smrg# tool to use in cross-compilation environments, therefore Automake
126276910425Smrg# will honor the `STRIP' environment variable to overrule this program.
126376910425Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
126476910425Smrgif test "$cross_compiling" != no; then
126576910425Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
126676910425Smrgfi
126776910425SmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
126876910425SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
126976910425Smrg
127076910425Smrg# Check how to create a tarball.                            -*- Autoconf -*-
127176910425Smrg
127276910425Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
127376910425Smrg#
127476910425Smrg# This file is free software; the Free Software Foundation
127576910425Smrg# gives unlimited permission to copy and/or distribute it,
127676910425Smrg# with or without modifications, as long as this notice is preserved.
127776910425Smrg
127876910425Smrg# serial 2
127976910425Smrg
128076910425Smrg# _AM_PROG_TAR(FORMAT)
128176910425Smrg# --------------------
128276910425Smrg# Check how to create a tarball in format FORMAT.
128376910425Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
128476910425Smrg#
128576910425Smrg# Substitute a variable $(am__tar) that is a command
128676910425Smrg# writing to stdout a FORMAT-tarball containing the directory
128776910425Smrg# $tardir.
128876910425Smrg#     tardir=directory && $(am__tar) > result.tar
128976910425Smrg#
129076910425Smrg# Substitute a variable $(am__untar) that extract such
129176910425Smrg# a tarball read from stdin.
129276910425Smrg#     $(am__untar) < result.tar
129376910425SmrgAC_DEFUN([_AM_PROG_TAR],
129476910425Smrg[# Always define AMTAR for backward compatibility.
129576910425SmrgAM_MISSING_PROG([AMTAR], [tar])
129676910425Smrgm4_if([$1], [v7],
129776910425Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
129876910425Smrg     [m4_case([$1], [ustar],, [pax],,
129976910425Smrg              [m4_fatal([Unknown tar format])])
130076910425SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
130176910425Smrg# Loop over all known methods to create a tar archive until one works.
130276910425Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
130376910425Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
130476910425Smrg# Do not fold the above two line into one, because Tru64 sh and
130576910425Smrg# Solaris sh will not grok spaces in the rhs of `-'.
130676910425Smrgfor _am_tool in $_am_tools
130776910425Smrgdo
130876910425Smrg  case $_am_tool in
130976910425Smrg  gnutar)
131076910425Smrg    for _am_tar in tar gnutar gtar;
131176910425Smrg    do
131276910425Smrg      AM_RUN_LOG([$_am_tar --version]) && break
131376910425Smrg    done
131476910425Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
131576910425Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
131676910425Smrg    am__untar="$_am_tar -xf -"
131776910425Smrg    ;;
131876910425Smrg  plaintar)
131976910425Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
132076910425Smrg    # ustar tarball either.
132176910425Smrg    (tar --version) >/dev/null 2>&1 && continue
132276910425Smrg    am__tar='tar chf - "$$tardir"'
132376910425Smrg    am__tar_='tar chf - "$tardir"'
132476910425Smrg    am__untar='tar xf -'
132576910425Smrg    ;;
132676910425Smrg  pax)
132776910425Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
132876910425Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
132976910425Smrg    am__untar='pax -r'
133076910425Smrg    ;;
133176910425Smrg  cpio)
133276910425Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
133376910425Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
133476910425Smrg    am__untar='cpio -i -H $1 -d'
133576910425Smrg    ;;
133676910425Smrg  none)
133776910425Smrg    am__tar=false
133876910425Smrg    am__tar_=false
133976910425Smrg    am__untar=false
134076910425Smrg    ;;
134176910425Smrg  esac
134276910425Smrg
134376910425Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
134476910425Smrg  # and am__untar set.
134576910425Smrg  test -n "${am_cv_prog_tar_$1}" && break
134676910425Smrg
134776910425Smrg  # tar/untar a dummy directory, and stop if the command works
134876910425Smrg  rm -rf conftest.dir
134976910425Smrg  mkdir conftest.dir
135076910425Smrg  echo GrepMe > conftest.dir/file
135176910425Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
135276910425Smrg  rm -rf conftest.dir
135376910425Smrg  if test -s conftest.tar; then
135476910425Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
135576910425Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
135676910425Smrg  fi
135776910425Smrgdone
135876910425Smrgrm -rf conftest.dir
135976910425Smrg
136076910425SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
136176910425SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
136276910425SmrgAC_SUBST([am__tar])
136376910425SmrgAC_SUBST([am__untar])
136476910425Smrg]) # _AM_PROG_TAR
136576910425Smrg
1366