aclocal.m4 revision 43f32c10
143f32c10Smrg# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
243f32c10Smrg
343f32c10Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
443f32c10Smrg# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
543f32c10Smrg# This file is free software; the Free Software Foundation
643f32c10Smrg# gives unlimited permission to copy and/or distribute it,
743f32c10Smrg# with or without modifications, as long as this notice is preserved.
843f32c10Smrg
943f32c10Smrg# This program is distributed in the hope that it will be useful,
1043f32c10Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1143f32c10Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1243f32c10Smrg# PARTICULAR PURPOSE.
1343f32c10Smrg
1443f32c10Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1543f32c10Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1643f32c10Smrgm4_if(AC_AUTOCONF_VERSION, [2.61],,
1743f32c10Smrg[m4_warning([this file was generated for autoconf 2.61.
1843f32c10SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
1943f32c10SmrgIf you have problems, you may need to regenerate the build system entirely.
2043f32c10SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
2143f32c10Smrg
2243f32c10Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2343f32c10Smrg# 
2443f32c10Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2543f32c10Smrg#
2643f32c10Smrg# This program is free software; you can redistribute it and/or modify
2743f32c10Smrg# it under the terms of the GNU General Public License as published by
2843f32c10Smrg# the Free Software Foundation; either version 2 of the License, or
2943f32c10Smrg# (at your option) any later version.
3043f32c10Smrg#
3143f32c10Smrg# This program is distributed in the hope that it will be useful, but
3243f32c10Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
3343f32c10Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3443f32c10Smrg# General Public License for more details.
3543f32c10Smrg#
3643f32c10Smrg# You should have received a copy of the GNU General Public License
3743f32c10Smrg# along with this program; if not, write to the Free Software
3843f32c10Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3943f32c10Smrg#
4043f32c10Smrg# As a special exception to the GNU General Public License, if you
4143f32c10Smrg# distribute this file as part of a program that contains a
4243f32c10Smrg# configuration script generated by Autoconf, you may include it under
4343f32c10Smrg# the same distribution terms that you use for the rest of that program.
4443f32c10Smrg
4543f32c10Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
4643f32c10Smrg# ----------------------------------
4743f32c10SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
4843f32c10Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
4943f32c10Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
5043f32c10SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
5143f32c10Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
5243f32c10Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
5343f32c10Smrgfi
5443f32c10Smrgif test -n "$PKG_CONFIG"; then
5543f32c10Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
5643f32c10Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
5743f32c10Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
5843f32c10Smrg		AC_MSG_RESULT([yes])
5943f32c10Smrg	else
6043f32c10Smrg		AC_MSG_RESULT([no])
6143f32c10Smrg		PKG_CONFIG=""
6243f32c10Smrg	fi
6343f32c10Smrg		
6443f32c10Smrgfi[]dnl
6543f32c10Smrg])# PKG_PROG_PKG_CONFIG
6643f32c10Smrg
6743f32c10Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
6843f32c10Smrg#
6943f32c10Smrg# Check to see whether a particular set of modules exists.  Similar
7043f32c10Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
7143f32c10Smrg#
7243f32c10Smrg#
7343f32c10Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
7443f32c10Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
7543f32c10Smrg# PKG_CHECK_EXISTS manually
7643f32c10Smrg# --------------------------------------------------------------
7743f32c10SmrgAC_DEFUN([PKG_CHECK_EXISTS],
7843f32c10Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
7943f32c10Smrgif test -n "$PKG_CONFIG" && \
8043f32c10Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8143f32c10Smrg  m4_ifval([$2], [$2], [:])
8243f32c10Smrgm4_ifvaln([$3], [else
8343f32c10Smrg  $3])dnl
8443f32c10Smrgfi])
8543f32c10Smrg
8643f32c10Smrg
8743f32c10Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8843f32c10Smrg# ---------------------------------------------
8943f32c10Smrgm4_define([_PKG_CONFIG],
9043f32c10Smrg[if test -n "$PKG_CONFIG"; then
9143f32c10Smrg    if test -n "$$1"; then
9243f32c10Smrg        pkg_cv_[]$1="$$1"
9343f32c10Smrg    else
9443f32c10Smrg        PKG_CHECK_EXISTS([$3],
9543f32c10Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
9643f32c10Smrg			 [pkg_failed=yes])
9743f32c10Smrg    fi
9843f32c10Smrgelse
9943f32c10Smrg	pkg_failed=untried
10043f32c10Smrgfi[]dnl
10143f32c10Smrg])# _PKG_CONFIG
10243f32c10Smrg
10343f32c10Smrg# _PKG_SHORT_ERRORS_SUPPORTED
10443f32c10Smrg# -----------------------------
10543f32c10SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
10643f32c10Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10743f32c10Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
10843f32c10Smrg        _pkg_short_errors_supported=yes
10943f32c10Smrgelse
11043f32c10Smrg        _pkg_short_errors_supported=no
11143f32c10Smrgfi[]dnl
11243f32c10Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
11343f32c10Smrg
11443f32c10Smrg
11543f32c10Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
11643f32c10Smrg# [ACTION-IF-NOT-FOUND])
11743f32c10Smrg#
11843f32c10Smrg#
11943f32c10Smrg# Note that if there is a possibility the first call to
12043f32c10Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
12143f32c10Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
12243f32c10Smrg#
12343f32c10Smrg#
12443f32c10Smrg# --------------------------------------------------------------
12543f32c10SmrgAC_DEFUN([PKG_CHECK_MODULES],
12643f32c10Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
12743f32c10SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
12843f32c10SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
12943f32c10Smrg
13043f32c10Smrgpkg_failed=no
13143f32c10SmrgAC_MSG_CHECKING([for $1])
13243f32c10Smrg
13343f32c10Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
13443f32c10Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
13543f32c10Smrg
13643f32c10Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
13743f32c10Smrgand $1[]_LIBS to avoid the need to call pkg-config.
13843f32c10SmrgSee the pkg-config man page for more details.])
13943f32c10Smrg
14043f32c10Smrgif test $pkg_failed = yes; then
14143f32c10Smrg        _PKG_SHORT_ERRORS_SUPPORTED
14243f32c10Smrg        if test $_pkg_short_errors_supported = yes; then
14343f32c10Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
14443f32c10Smrg        else 
14543f32c10Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
14643f32c10Smrg        fi
14743f32c10Smrg	# Put the nasty error message in config.log where it belongs
14843f32c10Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
14943f32c10Smrg
15043f32c10Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
15143f32c10Smrg[Package requirements ($2) were not met:
15243f32c10Smrg
15343f32c10Smrg$$1_PKG_ERRORS
15443f32c10Smrg
15543f32c10SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
15643f32c10Smrginstalled software in a non-standard prefix.
15743f32c10Smrg
15843f32c10Smrg_PKG_TEXT
15943f32c10Smrg])],
16043f32c10Smrg		[AC_MSG_RESULT([no])
16143f32c10Smrg                $4])
16243f32c10Smrgelif test $pkg_failed = untried; then
16343f32c10Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
16443f32c10Smrg[The pkg-config script could not be found or is too old.  Make sure it
16543f32c10Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
16643f32c10Smrgpath to pkg-config.
16743f32c10Smrg
16843f32c10Smrg_PKG_TEXT
16943f32c10Smrg
17043f32c10SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
17143f32c10Smrg		[$4])
17243f32c10Smrgelse
17343f32c10Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
17443f32c10Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
17543f32c10Smrg        AC_MSG_RESULT([yes])
17643f32c10Smrg	ifelse([$3], , :, [$3])
17743f32c10Smrgfi[]dnl
17843f32c10Smrg])# PKG_CHECK_MODULES
17943f32c10Smrg
18043f32c10Smrgdnl
18143f32c10Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
18243f32c10Smrgdnl 
18343f32c10Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
18443f32c10Smrgdnl copy of this software and associated documentation files (the
18543f32c10Smrgdnl "Software"), to deal in the Software without restriction, including
18643f32c10Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
18743f32c10Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
18843f32c10Smrgdnl to whom the Software is furnished to do so, provided that the above
18943f32c10Smrgdnl copyright notice(s) and this permission notice appear in all copies of
19043f32c10Smrgdnl the Software and that both the above copyright notice(s) and this
19143f32c10Smrgdnl permission notice appear in supporting documentation.
19243f32c10Smrgdnl
19343f32c10Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19443f32c10Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19543f32c10Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
19643f32c10Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
19743f32c10Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
19843f32c10Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
19943f32c10Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20043f32c10Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
20143f32c10Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20243f32c10Smrgdnl
20343f32c10Smrgdnl Except as contained in this notice, the name of a copyright holder
20443f32c10Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
20543f32c10Smrgdnl or other dealings in this Software without prior written authorization
20643f32c10Smrgdnl of the copyright holder.
20743f32c10Smrg
20843f32c10Smrg# XORG_MACROS_VERSION(required-version)
20943f32c10Smrg# -------------------------------------
21043f32c10Smrg# Minimum version: 1.1.0
21143f32c10Smrg#
21243f32c10Smrg# If you're using a macro added in Version 1.1 or newer, include this in
21343f32c10Smrg# your configure.ac with the minimum required version, such as:
21443f32c10Smrg# XORG_MACROS_VERSION(1.1)
21543f32c10Smrg#
21643f32c10Smrg# To force at least a version with this macro defined, also add:
21743f32c10Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
21843f32c10Smrg#
21943f32c10Smrg#
22043f32c10Smrg# See the "minimum version" comment for each macro you use to see what 
22143f32c10Smrg# version you require.
22243f32c10SmrgAC_DEFUN([XORG_MACROS_VERSION],[
22343f32c10Smrg	[XORG_MACROS_needed_version=$1
22443f32c10Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
22543f32c10Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
22643f32c10Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
22743f32c10Smrg	[XORG_MACROS_version=1.1.6
22843f32c10Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
22943f32c10Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
23043f32c10Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
23143f32c10Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
23243f32c10Smrg	fi
23343f32c10Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
23443f32c10Smrg		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])
23543f32c10Smrg	fi
23643f32c10Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
23743f32c10Smrg]) # XORG_MACROS_VERSION
23843f32c10Smrg
23943f32c10Smrg# XORG_PROG_RAWCPP()
24043f32c10Smrg# ------------------
24143f32c10Smrg# Minimum version: 1.0.0
24243f32c10Smrg#
24343f32c10Smrg# Find cpp program and necessary flags for use in pre-processing text files
24443f32c10Smrg# such as man pages and config files
24543f32c10SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
24643f32c10SmrgAC_REQUIRE([AC_PROG_CPP])
24743f32c10SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
24843f32c10Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
24943f32c10Smrg
25043f32c10Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
25143f32c10Smrg# which is not the best choice for supporting other OS'es, but covers most
25243f32c10Smrg# of the ones we need for now.
25343f32c10SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
25443f32c10SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
25543f32c10Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
25643f32c10Smrg	AC_MSG_RESULT([no])
25743f32c10Smrgelse
25843f32c10Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
25943f32c10Smrg		RAWCPPFLAGS=-undef
26043f32c10Smrg		AC_MSG_RESULT([yes])
26143f32c10Smrg	else
26243f32c10Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
26343f32c10Smrg	fi
26443f32c10Smrgfi
26543f32c10Smrgrm -f conftest.$ac_ext
26643f32c10Smrg
26743f32c10SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
26843f32c10SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
26943f32c10Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
27043f32c10Smrg	AC_MSG_RESULT([no])
27143f32c10Smrgelse
27243f32c10Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
27343f32c10Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
27443f32c10Smrg		AC_MSG_RESULT([yes])
27543f32c10Smrg	else
27643f32c10Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
27743f32c10Smrg	fi
27843f32c10Smrgfi
27943f32c10Smrgrm -f conftest.$ac_ext
28043f32c10SmrgAC_SUBST(RAWCPPFLAGS)
28143f32c10Smrg]) # XORG_PROG_RAWCPP
28243f32c10Smrg
28343f32c10Smrg# XORG_MANPAGE_SECTIONS()
28443f32c10Smrg# -----------------------
28543f32c10Smrg# Minimum version: 1.0.0
28643f32c10Smrg#
28743f32c10Smrg# Determine which sections man pages go in for the different man page types
28843f32c10Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
28943f32c10Smrg# Not sure if there's any better way than just hardcoding by OS name.
29043f32c10Smrg# Override default settings by setting environment variables
29143f32c10Smrg
29243f32c10SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
29343f32c10SmrgAC_REQUIRE([AC_CANONICAL_HOST])
29443f32c10Smrg
29543f32c10Smrgif test x$APP_MAN_SUFFIX = x    ; then
29643f32c10Smrg    APP_MAN_SUFFIX=1
29743f32c10Smrgfi
29843f32c10Smrgif test x$APP_MAN_DIR = x    ; then
29943f32c10Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
30043f32c10Smrgfi
30143f32c10Smrg
30243f32c10Smrgif test x$LIB_MAN_SUFFIX = x    ; then
30343f32c10Smrg    LIB_MAN_SUFFIX=3
30443f32c10Smrgfi
30543f32c10Smrgif test x$LIB_MAN_DIR = x    ; then
30643f32c10Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
30743f32c10Smrgfi
30843f32c10Smrg
30943f32c10Smrgif test x$FILE_MAN_SUFFIX = x    ; then
31043f32c10Smrg    case $host_os in
31143f32c10Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
31243f32c10Smrg	*)		FILE_MAN_SUFFIX=5  ;;
31343f32c10Smrg    esac
31443f32c10Smrgfi
31543f32c10Smrgif test x$FILE_MAN_DIR = x    ; then
31643f32c10Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
31743f32c10Smrgfi
31843f32c10Smrg
31943f32c10Smrgif test x$MISC_MAN_SUFFIX = x    ; then
32043f32c10Smrg    case $host_os in
32143f32c10Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
32243f32c10Smrg	*)		MISC_MAN_SUFFIX=7  ;;
32343f32c10Smrg    esac
32443f32c10Smrgfi
32543f32c10Smrgif test x$MISC_MAN_DIR = x    ; then
32643f32c10Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
32743f32c10Smrgfi
32843f32c10Smrg
32943f32c10Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
33043f32c10Smrg    case $host_os in
33143f32c10Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
33243f32c10Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
33343f32c10Smrg    esac
33443f32c10Smrgfi
33543f32c10Smrgif test x$DRIVER_MAN_DIR = x    ; then
33643f32c10Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
33743f32c10Smrgfi
33843f32c10Smrg
33943f32c10Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
34043f32c10Smrg    case $host_os in
34143f32c10Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
34243f32c10Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
34343f32c10Smrg    esac
34443f32c10Smrgfi
34543f32c10Smrgif test x$ADMIN_MAN_DIR = x    ; then
34643f32c10Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
34743f32c10Smrgfi
34843f32c10Smrg
34943f32c10Smrg
35043f32c10SmrgAC_SUBST([APP_MAN_SUFFIX])
35143f32c10SmrgAC_SUBST([LIB_MAN_SUFFIX])
35243f32c10SmrgAC_SUBST([FILE_MAN_SUFFIX])
35343f32c10SmrgAC_SUBST([MISC_MAN_SUFFIX])
35443f32c10SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
35543f32c10SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
35643f32c10SmrgAC_SUBST([APP_MAN_DIR])
35743f32c10SmrgAC_SUBST([LIB_MAN_DIR])
35843f32c10SmrgAC_SUBST([FILE_MAN_DIR])
35943f32c10SmrgAC_SUBST([MISC_MAN_DIR])
36043f32c10SmrgAC_SUBST([DRIVER_MAN_DIR])
36143f32c10SmrgAC_SUBST([ADMIN_MAN_DIR])
36243f32c10Smrg]) # XORG_MANPAGE_SECTIONS
36343f32c10Smrg
36443f32c10Smrg# XORG_CHECK_LINUXDOC
36543f32c10Smrg# -------------------
36643f32c10Smrg# Minimum version: 1.0.0
36743f32c10Smrg#
36843f32c10Smrg# Defines the variable MAKE_TEXT if the necessary tools and
36943f32c10Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
37043f32c10Smrg# Whether or not the necessary tools and files are found can be checked
37143f32c10Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
37243f32c10SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
37343f32c10SmrgXORG_SGML_PATH=$prefix/share/sgml
37443f32c10SmrgHAVE_DEFS_ENT=
37543f32c10Smrg
37643f32c10Smrgif test x"$cross_compiling" = x"yes" ; then
37743f32c10Smrg  HAVE_DEFS_ENT=no
37843f32c10Smrgelse
37943f32c10Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
38043f32c10Smrgfi
38143f32c10Smrg
38243f32c10SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
38343f32c10SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
38443f32c10Smrg
38543f32c10SmrgAC_MSG_CHECKING([Whether to build documentation])
38643f32c10Smrg
38743f32c10Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
38843f32c10Smrg   BUILDDOC=yes
38943f32c10Smrgelse
39043f32c10Smrg   BUILDDOC=no
39143f32c10Smrgfi
39243f32c10Smrg
39343f32c10SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
39443f32c10Smrg
39543f32c10SmrgAC_MSG_RESULT([$BUILDDOC])
39643f32c10Smrg
39743f32c10SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
39843f32c10Smrg
39943f32c10Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
40043f32c10Smrg   BUILDPDFDOC=yes
40143f32c10Smrgelse
40243f32c10Smrg   BUILDPDFDOC=no
40343f32c10Smrgfi
40443f32c10Smrg
40543f32c10SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
40643f32c10Smrg
40743f32c10SmrgAC_MSG_RESULT([$BUILDPDFDOC])
40843f32c10Smrg
40943f32c10SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
41043f32c10SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
41143f32c10SmrgMAKE_PDF="$PS2PDF"
41243f32c10SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
41343f32c10Smrg
41443f32c10SmrgAC_SUBST(MAKE_TEXT)
41543f32c10SmrgAC_SUBST(MAKE_PS)
41643f32c10SmrgAC_SUBST(MAKE_PDF)
41743f32c10SmrgAC_SUBST(MAKE_HTML)
41843f32c10Smrg]) # XORG_CHECK_LINUXDOC
41943f32c10Smrg
42043f32c10Smrg# XORG_CHECK_DOCBOOK
42143f32c10Smrg# -------------------
42243f32c10Smrg# Minimum version: 1.0.0
42343f32c10Smrg#
42443f32c10Smrg# Checks for the ability to build output formats from SGML DocBook source.
42543f32c10Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
42643f32c10Smrg# indicates whether the necessary tools and files are found and, if set,
42743f32c10Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
42843f32c10SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
42943f32c10SmrgXORG_SGML_PATH=$prefix/share/sgml
43043f32c10SmrgHAVE_DEFS_ENT=
43143f32c10SmrgBUILDTXTDOC=no
43243f32c10SmrgBUILDPDFDOC=no
43343f32c10SmrgBUILDPSDOC=no
43443f32c10SmrgBUILDHTMLDOC=no
43543f32c10Smrg
43643f32c10SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
43743f32c10Smrg
43843f32c10SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
43943f32c10SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
44043f32c10SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
44143f32c10SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
44243f32c10Smrg
44343f32c10SmrgAC_MSG_CHECKING([Whether to build text documentation])
44443f32c10Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
44543f32c10Smrg   test x$BUILD_TXTDOC != xno; then
44643f32c10Smrg	BUILDTXTDOC=yes
44743f32c10Smrgfi
44843f32c10SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
44943f32c10SmrgAC_MSG_RESULT([$BUILDTXTDOC])
45043f32c10Smrg
45143f32c10SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
45243f32c10Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
45343f32c10Smrg   test x$BUILD_PDFDOC != xno; then
45443f32c10Smrg	BUILDPDFDOC=yes
45543f32c10Smrgfi
45643f32c10SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
45743f32c10SmrgAC_MSG_RESULT([$BUILDPDFDOC])
45843f32c10Smrg
45943f32c10SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
46043f32c10Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
46143f32c10Smrg   test x$BUILD_PSDOC != xno; then
46243f32c10Smrg	BUILDPSDOC=yes
46343f32c10Smrgfi
46443f32c10SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
46543f32c10SmrgAC_MSG_RESULT([$BUILDPSDOC])
46643f32c10Smrg
46743f32c10SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
46843f32c10Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
46943f32c10Smrg   test x$BUILD_HTMLDOC != xno; then
47043f32c10Smrg	BUILDHTMLDOC=yes
47143f32c10Smrgfi
47243f32c10SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
47343f32c10SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
47443f32c10Smrg
47543f32c10SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
47643f32c10SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
47743f32c10SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
47843f32c10SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
47943f32c10Smrg
48043f32c10SmrgAC_SUBST(MAKE_TEXT)
48143f32c10SmrgAC_SUBST(MAKE_PS)
48243f32c10SmrgAC_SUBST(MAKE_PDF)
48343f32c10SmrgAC_SUBST(MAKE_HTML)
48443f32c10Smrg]) # XORG_CHECK_DOCBOOK
48543f32c10Smrg
48643f32c10Smrg# XORG_CHECK_MALLOC_ZERO
48743f32c10Smrg# ----------------------
48843f32c10Smrg# Minimum version: 1.0.0
48943f32c10Smrg#
49043f32c10Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
49143f32c10Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
49243f32c10Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
49343f32c10SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
49443f32c10SmrgAC_ARG_ENABLE(malloc0returnsnull,
49543f32c10Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
49643f32c10Smrg		       [malloc(0) returns NULL (default: auto)]),
49743f32c10Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
49843f32c10Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
49943f32c10Smrg
50043f32c10SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
50143f32c10Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
50243f32c10Smrg	AC_RUN_IFELSE([
50343f32c10Smrgchar *malloc();
50443f32c10Smrgchar *realloc();
50543f32c10Smrgchar *calloc();
50643f32c10Smrgmain() {
50743f32c10Smrg    char *m0, *r0, *c0, *p;
50843f32c10Smrg    m0 = malloc(0);
50943f32c10Smrg    p = malloc(10);
51043f32c10Smrg    r0 = realloc(p,0);
51143f32c10Smrg    c0 = calloc(0);
51243f32c10Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
51343f32c10Smrg}],
51443f32c10Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
51543f32c10Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
51643f32c10Smrgfi
51743f32c10SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
51843f32c10Smrg
51943f32c10Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
52043f32c10Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
52143f32c10Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
52243f32c10Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
52343f32c10Smrgelse
52443f32c10Smrg	MALLOC_ZERO_CFLAGS=""
52543f32c10Smrg	XMALLOC_ZERO_CFLAGS=""
52643f32c10Smrg	XTMALLOC_ZERO_CFLAGS=""
52743f32c10Smrgfi
52843f32c10Smrg
52943f32c10SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
53043f32c10SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
53143f32c10SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
53243f32c10Smrg]) # XORG_CHECK_MALLOC_ZERO
53343f32c10Smrg
53443f32c10Smrg# XORG_WITH_LINT()
53543f32c10Smrg# ----------------
53643f32c10Smrg# Minimum version: 1.1.0
53743f32c10Smrg#
53843f32c10Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
53943f32c10Smrg# is specified.   (Use --with-lint=sparse for sparse.)
54043f32c10Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
54143f32c10Smrg# Sets $LINT_FLAGS to flags to pass to source checker
54243f32c10Smrg# Sets LINT automake conditional if enabled (default: disabled)
54343f32c10Smrg#
54443f32c10SmrgAC_DEFUN([XORG_WITH_LINT],[
54543f32c10Smrg
54643f32c10Smrg# Allow checking code with lint, sparse, etc.
54743f32c10SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
54843f32c10Smrg		[Use a lint-style source code checker (default: disabled)])],
54943f32c10Smrg		[use_lint=$withval], [use_lint=no])
55043f32c10Smrgif test "x$use_lint" = "xyes" ; then
55143f32c10Smrg	LINT="lint"
55243f32c10Smrgelse
55343f32c10Smrg	LINT="$use_lint"
55443f32c10Smrgfi
55543f32c10Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
55643f32c10Smrg    case $LINT in
55743f32c10Smrg	lint|*/lint)
55843f32c10Smrg	    case $host_os in
55943f32c10Smrg		solaris*)
56043f32c10Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
56143f32c10Smrg			;;
56243f32c10Smrg	    esac
56343f32c10Smrg	    ;;
56443f32c10Smrg    esac
56543f32c10Smrgfi
56643f32c10Smrg
56743f32c10SmrgAC_SUBST(LINT)
56843f32c10SmrgAC_SUBST(LINT_FLAGS)
56943f32c10SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
57043f32c10Smrg
57143f32c10Smrg]) # XORG_WITH_LINT
57243f32c10Smrg
57343f32c10Smrg# XORG_LINT_LIBRARY(LIBNAME)
57443f32c10Smrg# --------------------------
57543f32c10Smrg# Minimum version: 1.1.0
57643f32c10Smrg#
57743f32c10Smrg# Sets up flags for building lint libraries for checking programs that call
57843f32c10Smrg# functions in the library.
57943f32c10Smrg# Disabled by default, enable with --enable-lint-library
58043f32c10Smrg# Sets: 
58143f32c10Smrg#	@LINTLIB@		- name of lint library file to make
58243f32c10Smrg#	MAKE_LINT_LIB		- automake conditional
58343f32c10Smrg#
58443f32c10Smrg
58543f32c10SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
58643f32c10SmrgAC_REQUIRE([XORG_WITH_LINT])
58743f32c10Smrg# Build lint "library" for more indepth checks of programs calling this library
58843f32c10SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
58943f32c10Smrg	[Create lint library (default: disabled)])],
59043f32c10Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
59143f32c10Smrgif test "x$make_lint_lib" != "xno" ; then
59243f32c10Smrg	if test "x$LINT" = "xno" ; then
59343f32c10Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
59443f32c10Smrg	fi
59543f32c10Smrg	if test "x$make_lint_lib" = "xyes" ; then
59643f32c10Smrg		LINTLIB=llib-l$1.ln
59743f32c10Smrg	else
59843f32c10Smrg		LINTLIB=$make_lint_lib
59943f32c10Smrg	fi
60043f32c10Smrgfi
60143f32c10SmrgAC_SUBST(LINTLIB)
60243f32c10SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
60343f32c10Smrg
60443f32c10Smrg]) # XORG_LINT_LIBRARY
60543f32c10Smrg
60643f32c10Smrgdnl Copyright 2005 Red Hat, Inc
60743f32c10Smrgdnl
60843f32c10Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
60943f32c10Smrgdnl documentation for any purpose is hereby granted without fee, provided that
61043f32c10Smrgdnl the above copyright notice appear in all copies and that both that
61143f32c10Smrgdnl copyright notice and this permission notice appear in supporting
61243f32c10Smrgdnl documentation.
61343f32c10Smrgdnl
61443f32c10Smrgdnl The above copyright notice and this permission notice shall be included
61543f32c10Smrgdnl in all copies or substantial portions of the Software.
61643f32c10Smrgdnl
61743f32c10Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
61843f32c10Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
61943f32c10Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
62043f32c10Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
62143f32c10Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
62243f32c10Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
62343f32c10Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
62443f32c10Smrgdnl
62543f32c10Smrgdnl Except as contained in this notice, the name of the copyright holders shall
62643f32c10Smrgdnl not be used in advertising or otherwise to promote the sale, use or
62743f32c10Smrgdnl other dealings in this Software without prior written authorization
62843f32c10Smrgdnl from the copyright holders.
62943f32c10Smrgdnl
63043f32c10Smrg
63143f32c10Smrg# XORG_RELEASE_VERSION
63243f32c10Smrg# --------------------
63343f32c10Smrg# Adds --with/without-release-string and changes the PACKAGE and
63443f32c10Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
63543f32c10Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
63643f32c10Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
63743f32c10Smrg 
63843f32c10SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
63943f32c10Smrg	AC_ARG_WITH(release-version,
64043f32c10Smrg			AC_HELP_STRING([--with-release-version=STRING],
64143f32c10Smrg				[Use release version string in package name]),
64243f32c10Smrg			[RELEASE_VERSION="$withval"],
64343f32c10Smrg			[RELEASE_VERSION=""])
64443f32c10Smrg	if test "x$RELEASE_VERSION" != "x"; then
64543f32c10Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
64643f32c10Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
64743f32c10Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
64843f32c10Smrg	fi
64943f32c10Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
65043f32c10Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
65143f32c10Smrg		[Major version of this package])
65243f32c10Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
65343f32c10Smrg	if test "x$PVM" = "x"; then
65443f32c10Smrg		PVM="0"
65543f32c10Smrg	fi
65643f32c10Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
65743f32c10Smrg		[$PVM],
65843f32c10Smrg		[Minor version of this package])
65943f32c10Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
66043f32c10Smrg	if test "x$PVP" = "x"; then
66143f32c10Smrg		PVP="0"
66243f32c10Smrg	fi
66343f32c10Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
66443f32c10Smrg		[$PVP],
66543f32c10Smrg		[Patch version of this package])
66643f32c10Smrg])
66743f32c10Smrg
66843f32c10Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
66943f32c10Smrg#
67043f32c10Smrg# This file is free software; the Free Software Foundation
67143f32c10Smrg# gives unlimited permission to copy and/or distribute it,
67243f32c10Smrg# with or without modifications, as long as this notice is preserved.
67343f32c10Smrg
67443f32c10Smrg# AM_AUTOMAKE_VERSION(VERSION)
67543f32c10Smrg# ----------------------------
67643f32c10Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
67743f32c10Smrg# generated from the m4 files accompanying Automake X.Y.
67843f32c10Smrg# (This private macro should not be called outside this file.)
67943f32c10SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
68043f32c10Smrg[am__api_version='1.10'
68143f32c10Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
68243f32c10Smrgdnl require some minimum version.  Point them to the right macro.
68343f32c10Smrgm4_if([$1], [1.10.1], [],
68443f32c10Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
68543f32c10Smrg])
68643f32c10Smrg
68743f32c10Smrg# _AM_AUTOCONF_VERSION(VERSION)
68843f32c10Smrg# -----------------------------
68943f32c10Smrg# aclocal traces this macro to find the Autoconf version.
69043f32c10Smrg# This is a private macro too.  Using m4_define simplifies
69143f32c10Smrg# the logic in aclocal, which can simply ignore this definition.
69243f32c10Smrgm4_define([_AM_AUTOCONF_VERSION], [])
69343f32c10Smrg
69443f32c10Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
69543f32c10Smrg# -------------------------------
69643f32c10Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
69743f32c10Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
69843f32c10SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
69943f32c10Smrg[AM_AUTOMAKE_VERSION([1.10.1])dnl
70043f32c10Smrgm4_ifndef([AC_AUTOCONF_VERSION],
70143f32c10Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
70243f32c10Smrg_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
70343f32c10Smrg
70443f32c10Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
70543f32c10Smrg
70643f32c10Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
70743f32c10Smrg#
70843f32c10Smrg# This file is free software; the Free Software Foundation
70943f32c10Smrg# gives unlimited permission to copy and/or distribute it,
71043f32c10Smrg# with or without modifications, as long as this notice is preserved.
71143f32c10Smrg
71243f32c10Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
71343f32c10Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
71443f32c10Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
71543f32c10Smrg#
71643f32c10Smrg# Of course, Automake must honor this variable whenever it calls a
71743f32c10Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
71843f32c10Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
71943f32c10Smrg# depending on how configure is run.  This is pretty annoying, since
72043f32c10Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
72143f32c10Smrg# source directory, any form will work fine, but in subdirectories a
72243f32c10Smrg# relative path needs to be adjusted first.
72343f32c10Smrg#
72443f32c10Smrg# $ac_aux_dir/missing
72543f32c10Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
72643f32c10Smrg# $top_srcdir/$ac_aux_dir/missing
72743f32c10Smrg#    fails if $ac_aux_dir is absolute,
72843f32c10Smrg#    fails when called from a subdirectory in a VPATH build with
72943f32c10Smrg#          a relative $ac_aux_dir
73043f32c10Smrg#
73143f32c10Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
73243f32c10Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
73343f32c10Smrg# harmless because $srcdir is `.', but things will broke when you
73443f32c10Smrg# start a VPATH build or use an absolute $srcdir.
73543f32c10Smrg#
73643f32c10Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
73743f32c10Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
73843f32c10Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
73943f32c10Smrg# and then we would define $MISSING as
74043f32c10Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
74143f32c10Smrg# This will work as long as MISSING is not called from configure, because
74243f32c10Smrg# unfortunately $(top_srcdir) has no meaning in configure.
74343f32c10Smrg# However there are other variables, like CC, which are often used in
74443f32c10Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
74543f32c10Smrg#
74643f32c10Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
74743f32c10Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
74843f32c10Smrg# configured tree to be moved without reconfiguration.
74943f32c10Smrg
75043f32c10SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
75143f32c10Smrg[dnl Rely on autoconf to set up CDPATH properly.
75243f32c10SmrgAC_PREREQ([2.50])dnl
75343f32c10Smrg# expand $ac_aux_dir to an absolute path
75443f32c10Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
75543f32c10Smrg])
75643f32c10Smrg
75743f32c10Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
75843f32c10Smrg
75943f32c10Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
76043f32c10Smrg# Free Software Foundation, Inc.
76143f32c10Smrg#
76243f32c10Smrg# This file is free software; the Free Software Foundation
76343f32c10Smrg# gives unlimited permission to copy and/or distribute it,
76443f32c10Smrg# with or without modifications, as long as this notice is preserved.
76543f32c10Smrg
76643f32c10Smrg# serial 8
76743f32c10Smrg
76843f32c10Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
76943f32c10Smrg# -------------------------------------
77043f32c10Smrg# Define a conditional.
77143f32c10SmrgAC_DEFUN([AM_CONDITIONAL],
77243f32c10Smrg[AC_PREREQ(2.52)dnl
77343f32c10Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
77443f32c10Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
77543f32c10SmrgAC_SUBST([$1_TRUE])dnl
77643f32c10SmrgAC_SUBST([$1_FALSE])dnl
77743f32c10Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
77843f32c10Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
77943f32c10Smrgif $2; then
78043f32c10Smrg  $1_TRUE=
78143f32c10Smrg  $1_FALSE='#'
78243f32c10Smrgelse
78343f32c10Smrg  $1_TRUE='#'
78443f32c10Smrg  $1_FALSE=
78543f32c10Smrgfi
78643f32c10SmrgAC_CONFIG_COMMANDS_PRE(
78743f32c10Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
78843f32c10Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
78943f32c10SmrgUsually this means the macro was only invoked conditionally.]])
79043f32c10Smrgfi])])
79143f32c10Smrg
79243f32c10Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
79343f32c10Smrg# Free Software Foundation, Inc.
79443f32c10Smrg#
79543f32c10Smrg# This file is free software; the Free Software Foundation
79643f32c10Smrg# gives unlimited permission to copy and/or distribute it,
79743f32c10Smrg# with or without modifications, as long as this notice is preserved.
79843f32c10Smrg
79943f32c10Smrg# serial 9
80043f32c10Smrg
80143f32c10Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
80243f32c10Smrg# written in clear, in which case automake, when reading aclocal.m4,
80343f32c10Smrg# will think it sees a *use*, and therefore will trigger all it's
80443f32c10Smrg# C support machinery.  Also note that it means that autoscan, seeing
80543f32c10Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
80643f32c10Smrg
80743f32c10Smrg
80843f32c10Smrg# _AM_DEPENDENCIES(NAME)
80943f32c10Smrg# ----------------------
81043f32c10Smrg# See how the compiler implements dependency checking.
81143f32c10Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
81243f32c10Smrg# We try a few techniques and use that to set a single cache variable.
81343f32c10Smrg#
81443f32c10Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
81543f32c10Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
81643f32c10Smrg# dependency, and given that the user is not expected to run this macro,
81743f32c10Smrg# just rely on AC_PROG_CC.
81843f32c10SmrgAC_DEFUN([_AM_DEPENDENCIES],
81943f32c10Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
82043f32c10SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
82143f32c10SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
82243f32c10SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
82343f32c10Smrg
82443f32c10Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
82543f32c10Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
82643f32c10Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
82743f32c10Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
82843f32c10Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
82943f32c10Smrg                   [depcc="$$1"   am_compiler_list=])
83043f32c10Smrg
83143f32c10SmrgAC_CACHE_CHECK([dependency style of $depcc],
83243f32c10Smrg               [am_cv_$1_dependencies_compiler_type],
83343f32c10Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
83443f32c10Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
83543f32c10Smrg  # making bogus files that we don't know about and never remove.  For
83643f32c10Smrg  # instance it was reported that on HP-UX the gcc test will end up
83743f32c10Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
83843f32c10Smrg  # in D'.
83943f32c10Smrg  mkdir conftest.dir
84043f32c10Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
84143f32c10Smrg  # using a relative directory.
84243f32c10Smrg  cp "$am_depcomp" conftest.dir
84343f32c10Smrg  cd conftest.dir
84443f32c10Smrg  # We will build objects and dependencies in a subdirectory because
84543f32c10Smrg  # it helps to detect inapplicable dependency modes.  For instance
84643f32c10Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
84743f32c10Smrg  # side effect of compilation, but ICC will put the dependencies in
84843f32c10Smrg  # the current directory while Tru64 will put them in the object
84943f32c10Smrg  # directory.
85043f32c10Smrg  mkdir sub
85143f32c10Smrg
85243f32c10Smrg  am_cv_$1_dependencies_compiler_type=none
85343f32c10Smrg  if test "$am_compiler_list" = ""; then
85443f32c10Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
85543f32c10Smrg  fi
85643f32c10Smrg  for depmode in $am_compiler_list; do
85743f32c10Smrg    # Setup a source with many dependencies, because some compilers
85843f32c10Smrg    # like to wrap large dependency lists on column 80 (with \), and
85943f32c10Smrg    # we should not choose a depcomp mode which is confused by this.
86043f32c10Smrg    #
86143f32c10Smrg    # We need to recreate these files for each test, as the compiler may
86243f32c10Smrg    # overwrite some of them when testing with obscure command lines.
86343f32c10Smrg    # This happens at least with the AIX C compiler.
86443f32c10Smrg    : > sub/conftest.c
86543f32c10Smrg    for i in 1 2 3 4 5 6; do
86643f32c10Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
86743f32c10Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
86843f32c10Smrg      # Solaris 8's {/usr,}/bin/sh.
86943f32c10Smrg      touch sub/conftst$i.h
87043f32c10Smrg    done
87143f32c10Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
87243f32c10Smrg
87343f32c10Smrg    case $depmode in
87443f32c10Smrg    nosideeffect)
87543f32c10Smrg      # after this tag, mechanisms are not by side-effect, so they'll
87643f32c10Smrg      # only be used when explicitly requested
87743f32c10Smrg      if test "x$enable_dependency_tracking" = xyes; then
87843f32c10Smrg	continue
87943f32c10Smrg      else
88043f32c10Smrg	break
88143f32c10Smrg      fi
88243f32c10Smrg      ;;
88343f32c10Smrg    none) break ;;
88443f32c10Smrg    esac
88543f32c10Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
88643f32c10Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
88743f32c10Smrg    # handle `-M -o', and we need to detect this.
88843f32c10Smrg    if depmode=$depmode \
88943f32c10Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
89043f32c10Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
89143f32c10Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
89243f32c10Smrg         >/dev/null 2>conftest.err &&
89343f32c10Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
89443f32c10Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
89543f32c10Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
89643f32c10Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
89743f32c10Smrg      # icc doesn't choke on unknown options, it will just issue warnings
89843f32c10Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
89943f32c10Smrg      # that says an option was ignored or not supported.
90043f32c10Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
90143f32c10Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
90243f32c10Smrg      # The diagnosis changed in icc 8.0:
90343f32c10Smrg      #   icc: Command line remark: option '-MP' not supported
90443f32c10Smrg      if (grep 'ignoring option' conftest.err ||
90543f32c10Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
90643f32c10Smrg        am_cv_$1_dependencies_compiler_type=$depmode
90743f32c10Smrg        break
90843f32c10Smrg      fi
90943f32c10Smrg    fi
91043f32c10Smrg  done
91143f32c10Smrg
91243f32c10Smrg  cd ..
91343f32c10Smrg  rm -rf conftest.dir
91443f32c10Smrgelse
91543f32c10Smrg  am_cv_$1_dependencies_compiler_type=none
91643f32c10Smrgfi
91743f32c10Smrg])
91843f32c10SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
91943f32c10SmrgAM_CONDITIONAL([am__fastdep$1], [
92043f32c10Smrg  test "x$enable_dependency_tracking" != xno \
92143f32c10Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
92243f32c10Smrg])
92343f32c10Smrg
92443f32c10Smrg
92543f32c10Smrg# AM_SET_DEPDIR
92643f32c10Smrg# -------------
92743f32c10Smrg# Choose a directory name for dependency files.
92843f32c10Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
92943f32c10SmrgAC_DEFUN([AM_SET_DEPDIR],
93043f32c10Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
93143f32c10SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
93243f32c10Smrg])
93343f32c10Smrg
93443f32c10Smrg
93543f32c10Smrg# AM_DEP_TRACK
93643f32c10Smrg# ------------
93743f32c10SmrgAC_DEFUN([AM_DEP_TRACK],
93843f32c10Smrg[AC_ARG_ENABLE(dependency-tracking,
93943f32c10Smrg[  --disable-dependency-tracking  speeds up one-time build
94043f32c10Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
94143f32c10Smrgif test "x$enable_dependency_tracking" != xno; then
94243f32c10Smrg  am_depcomp="$ac_aux_dir/depcomp"
94343f32c10Smrg  AMDEPBACKSLASH='\'
94443f32c10Smrgfi
94543f32c10SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
94643f32c10SmrgAC_SUBST([AMDEPBACKSLASH])dnl
94743f32c10Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
94843f32c10Smrg])
94943f32c10Smrg
95043f32c10Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
95143f32c10Smrg
95243f32c10Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
95343f32c10Smrg# Free Software Foundation, Inc.
95443f32c10Smrg#
95543f32c10Smrg# This file is free software; the Free Software Foundation
95643f32c10Smrg# gives unlimited permission to copy and/or distribute it,
95743f32c10Smrg# with or without modifications, as long as this notice is preserved.
95843f32c10Smrg
95943f32c10Smrg#serial 3
96043f32c10Smrg
96143f32c10Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
96243f32c10Smrg# ------------------------------
96343f32c10SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
96443f32c10Smrg[for mf in $CONFIG_FILES; do
96543f32c10Smrg  # Strip MF so we end up with the name of the file.
96643f32c10Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
96743f32c10Smrg  # Check whether this is an Automake generated Makefile or not.
96843f32c10Smrg  # We used to match only the files named `Makefile.in', but
96943f32c10Smrg  # some people rename them; so instead we look at the file content.
97043f32c10Smrg  # Grep'ing the first line is not enough: some people post-process
97143f32c10Smrg  # each Makefile.in and add a new line on top of each file to say so.
97243f32c10Smrg  # Grep'ing the whole file is not good either: AIX grep has a line
97343f32c10Smrg  # limit of 2048, but all sed's we know have understand at least 4000.
97443f32c10Smrg  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
97543f32c10Smrg    dirpart=`AS_DIRNAME("$mf")`
97643f32c10Smrg  else
97743f32c10Smrg    continue
97843f32c10Smrg  fi
97943f32c10Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
98043f32c10Smrg  # from the Makefile without running `make'.
98143f32c10Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
98243f32c10Smrg  test -z "$DEPDIR" && continue
98343f32c10Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
98443f32c10Smrg  test -z "am__include" && continue
98543f32c10Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
98643f32c10Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
98743f32c10Smrg  U=`sed -n 's/^U = //p' < "$mf"`
98843f32c10Smrg  # Find all dependency output files, they are included files with
98943f32c10Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
99043f32c10Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
99143f32c10Smrg  # expansion.
99243f32c10Smrg  for file in `sed -n "
99343f32c10Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
99443f32c10Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
99543f32c10Smrg    # Make sure the directory exists.
99643f32c10Smrg    test -f "$dirpart/$file" && continue
99743f32c10Smrg    fdir=`AS_DIRNAME(["$file"])`
99843f32c10Smrg    AS_MKDIR_P([$dirpart/$fdir])
99943f32c10Smrg    # echo "creating $dirpart/$file"
100043f32c10Smrg    echo '# dummy' > "$dirpart/$file"
100143f32c10Smrg  done
100243f32c10Smrgdone
100343f32c10Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
100443f32c10Smrg
100543f32c10Smrg
100643f32c10Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
100743f32c10Smrg# -----------------------------
100843f32c10Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
100943f32c10Smrg#
101043f32c10Smrg# This code is only required when automatic dependency tracking
101143f32c10Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
101243f32c10Smrg# need in order to bootstrap the dependency handling code.
101343f32c10SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
101443f32c10Smrg[AC_CONFIG_COMMANDS([depfiles],
101543f32c10Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
101643f32c10Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
101743f32c10Smrg])
101843f32c10Smrg
101943f32c10Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
102043f32c10Smrg# Free Software Foundation, Inc.
102143f32c10Smrg#
102243f32c10Smrg# This file is free software; the Free Software Foundation
102343f32c10Smrg# gives unlimited permission to copy and/or distribute it,
102443f32c10Smrg# with or without modifications, as long as this notice is preserved.
102543f32c10Smrg
102643f32c10Smrg# serial 8
102743f32c10Smrg
102843f32c10Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
102943f32c10SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
103043f32c10Smrg
103143f32c10Smrg# Do all the work for Automake.                             -*- Autoconf -*-
103243f32c10Smrg
103343f32c10Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
103443f32c10Smrg# 2005, 2006, 2008 Free Software Foundation, Inc.
103543f32c10Smrg#
103643f32c10Smrg# This file is free software; the Free Software Foundation
103743f32c10Smrg# gives unlimited permission to copy and/or distribute it,
103843f32c10Smrg# with or without modifications, as long as this notice is preserved.
103943f32c10Smrg
104043f32c10Smrg# serial 13
104143f32c10Smrg
104243f32c10Smrg# This macro actually does too much.  Some checks are only needed if
104343f32c10Smrg# your package does certain things.  But this isn't really a big deal.
104443f32c10Smrg
104543f32c10Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
104643f32c10Smrg# AM_INIT_AUTOMAKE([OPTIONS])
104743f32c10Smrg# -----------------------------------------------
104843f32c10Smrg# The call with PACKAGE and VERSION arguments is the old style
104943f32c10Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
105043f32c10Smrg# and VERSION should now be passed to AC_INIT and removed from
105143f32c10Smrg# the call to AM_INIT_AUTOMAKE.
105243f32c10Smrg# We support both call styles for the transition.  After
105343f32c10Smrg# the next Automake release, Autoconf can make the AC_INIT
105443f32c10Smrg# arguments mandatory, and then we can depend on a new Autoconf
105543f32c10Smrg# release and drop the old call support.
105643f32c10SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
105743f32c10Smrg[AC_PREREQ([2.60])dnl
105843f32c10Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
105943f32c10Smrgdnl the ones we care about.
106043f32c10Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
106143f32c10SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
106243f32c10SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
106343f32c10Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
106443f32c10Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
106543f32c10Smrg  # is not polluted with repeated "-I."
106643f32c10Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
106743f32c10Smrg  # test to see if srcdir already configured
106843f32c10Smrg  if test -f $srcdir/config.status; then
106943f32c10Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
107043f32c10Smrg  fi
107143f32c10Smrgfi
107243f32c10Smrg
107343f32c10Smrg# test whether we have cygpath
107443f32c10Smrgif test -z "$CYGPATH_W"; then
107543f32c10Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
107643f32c10Smrg    CYGPATH_W='cygpath -w'
107743f32c10Smrg  else
107843f32c10Smrg    CYGPATH_W=echo
107943f32c10Smrg  fi
108043f32c10Smrgfi
108143f32c10SmrgAC_SUBST([CYGPATH_W])
108243f32c10Smrg
108343f32c10Smrg# Define the identity of the package.
108443f32c10Smrgdnl Distinguish between old-style and new-style calls.
108543f32c10Smrgm4_ifval([$2],
108643f32c10Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
108743f32c10Smrg AC_SUBST([PACKAGE], [$1])dnl
108843f32c10Smrg AC_SUBST([VERSION], [$2])],
108943f32c10Smrg[_AM_SET_OPTIONS([$1])dnl
109043f32c10Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
109143f32c10Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
109243f32c10Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
109343f32c10Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
109443f32c10Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
109543f32c10Smrg
109643f32c10Smrg_AM_IF_OPTION([no-define],,
109743f32c10Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
109843f32c10Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
109943f32c10Smrg
110043f32c10Smrg# Some tools Automake needs.
110143f32c10SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
110243f32c10SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
110343f32c10SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
110443f32c10SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
110543f32c10SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
110643f32c10SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
110743f32c10SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
110843f32c10SmrgAM_PROG_INSTALL_SH
110943f32c10SmrgAM_PROG_INSTALL_STRIP
111043f32c10SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
111143f32c10Smrg# We need awk for the "check" target.  The system "awk" is bad on
111243f32c10Smrg# some platforms.
111343f32c10SmrgAC_REQUIRE([AC_PROG_AWK])dnl
111443f32c10SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
111543f32c10SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
111643f32c10Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
111743f32c10Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
111843f32c10Smrg	      		     [_AM_PROG_TAR([v7])])])
111943f32c10Smrg_AM_IF_OPTION([no-dependencies],,
112043f32c10Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
112143f32c10Smrg                  [_AM_DEPENDENCIES(CC)],
112243f32c10Smrg                  [define([AC_PROG_CC],
112343f32c10Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
112443f32c10SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
112543f32c10Smrg                  [_AM_DEPENDENCIES(CXX)],
112643f32c10Smrg                  [define([AC_PROG_CXX],
112743f32c10Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
112843f32c10SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
112943f32c10Smrg                  [_AM_DEPENDENCIES(OBJC)],
113043f32c10Smrg                  [define([AC_PROG_OBJC],
113143f32c10Smrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
113243f32c10Smrg])
113343f32c10Smrg])
113443f32c10Smrg
113543f32c10Smrg
113643f32c10Smrg# When config.status generates a header, we must update the stamp-h file.
113743f32c10Smrg# This file resides in the same directory as the config header
113843f32c10Smrg# that is generated.  The stamp files are numbered to have different names.
113943f32c10Smrg
114043f32c10Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
114143f32c10Smrg# loop where config.status creates the headers, so we can generate
114243f32c10Smrg# our stamp files there.
114343f32c10SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
114443f32c10Smrg[# Compute $1's index in $config_headers.
114543f32c10Smrg_am_arg=$1
114643f32c10Smrg_am_stamp_count=1
114743f32c10Smrgfor _am_header in $config_headers :; do
114843f32c10Smrg  case $_am_header in
114943f32c10Smrg    $_am_arg | $_am_arg:* )
115043f32c10Smrg      break ;;
115143f32c10Smrg    * )
115243f32c10Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
115343f32c10Smrg  esac
115443f32c10Smrgdone
115543f32c10Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
115643f32c10Smrg
115743f32c10Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
115843f32c10Smrg#
115943f32c10Smrg# This file is free software; the Free Software Foundation
116043f32c10Smrg# gives unlimited permission to copy and/or distribute it,
116143f32c10Smrg# with or without modifications, as long as this notice is preserved.
116243f32c10Smrg
116343f32c10Smrg# AM_PROG_INSTALL_SH
116443f32c10Smrg# ------------------
116543f32c10Smrg# Define $install_sh.
116643f32c10SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
116743f32c10Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
116843f32c10Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
116943f32c10SmrgAC_SUBST(install_sh)])
117043f32c10Smrg
117143f32c10Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
117243f32c10Smrg#
117343f32c10Smrg# This file is free software; the Free Software Foundation
117443f32c10Smrg# gives unlimited permission to copy and/or distribute it,
117543f32c10Smrg# with or without modifications, as long as this notice is preserved.
117643f32c10Smrg
117743f32c10Smrg# serial 2
117843f32c10Smrg
117943f32c10Smrg# Check whether the underlying file-system supports filenames
118043f32c10Smrg# with a leading dot.  For instance MS-DOS doesn't.
118143f32c10SmrgAC_DEFUN([AM_SET_LEADING_DOT],
118243f32c10Smrg[rm -rf .tst 2>/dev/null
118343f32c10Smrgmkdir .tst 2>/dev/null
118443f32c10Smrgif test -d .tst; then
118543f32c10Smrg  am__leading_dot=.
118643f32c10Smrgelse
118743f32c10Smrg  am__leading_dot=_
118843f32c10Smrgfi
118943f32c10Smrgrmdir .tst 2>/dev/null
119043f32c10SmrgAC_SUBST([am__leading_dot])])
119143f32c10Smrg
119243f32c10Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
119343f32c10Smrg# From Jim Meyering
119443f32c10Smrg
119543f32c10Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
119643f32c10Smrg# Free Software Foundation, Inc.
119743f32c10Smrg#
119843f32c10Smrg# This file is free software; the Free Software Foundation
119943f32c10Smrg# gives unlimited permission to copy and/or distribute it,
120043f32c10Smrg# with or without modifications, as long as this notice is preserved.
120143f32c10Smrg
120243f32c10Smrg# serial 4
120343f32c10Smrg
120443f32c10SmrgAC_DEFUN([AM_MAINTAINER_MODE],
120543f32c10Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
120643f32c10Smrg  dnl maintainer-mode is disabled by default
120743f32c10Smrg  AC_ARG_ENABLE(maintainer-mode,
120843f32c10Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
120943f32c10Smrg			  (and sometimes confusing) to the casual installer],
121043f32c10Smrg      USE_MAINTAINER_MODE=$enableval,
121143f32c10Smrg      USE_MAINTAINER_MODE=no)
121243f32c10Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
121343f32c10Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
121443f32c10Smrg  MAINT=$MAINTAINER_MODE_TRUE
121543f32c10Smrg  AC_SUBST(MAINT)dnl
121643f32c10Smrg]
121743f32c10Smrg)
121843f32c10Smrg
121943f32c10SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
122043f32c10Smrg
122143f32c10Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
122243f32c10Smrg
122343f32c10Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
122443f32c10Smrg#
122543f32c10Smrg# This file is free software; the Free Software Foundation
122643f32c10Smrg# gives unlimited permission to copy and/or distribute it,
122743f32c10Smrg# with or without modifications, as long as this notice is preserved.
122843f32c10Smrg
122943f32c10Smrg# serial 3
123043f32c10Smrg
123143f32c10Smrg# AM_MAKE_INCLUDE()
123243f32c10Smrg# -----------------
123343f32c10Smrg# Check to see how make treats includes.
123443f32c10SmrgAC_DEFUN([AM_MAKE_INCLUDE],
123543f32c10Smrg[am_make=${MAKE-make}
123643f32c10Smrgcat > confinc << 'END'
123743f32c10Smrgam__doit:
123843f32c10Smrg	@echo done
123943f32c10Smrg.PHONY: am__doit
124043f32c10SmrgEND
124143f32c10Smrg# If we don't find an include directive, just comment out the code.
124243f32c10SmrgAC_MSG_CHECKING([for style of include used by $am_make])
124343f32c10Smrgam__include="#"
124443f32c10Smrgam__quote=
124543f32c10Smrg_am_result=none
124643f32c10Smrg# First try GNU make style include.
124743f32c10Smrgecho "include confinc" > confmf
124843f32c10Smrg# We grep out `Entering directory' and `Leaving directory'
124943f32c10Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
125043f32c10Smrg# In particular we don't look at `^make:' because GNU make might
125143f32c10Smrg# be invoked under some other name (usually "gmake"), in which
125243f32c10Smrg# case it prints its new name instead of `make'.
125343f32c10Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
125443f32c10Smrg   am__include=include
125543f32c10Smrg   am__quote=
125643f32c10Smrg   _am_result=GNU
125743f32c10Smrgfi
125843f32c10Smrg# Now try BSD make style include.
125943f32c10Smrgif test "$am__include" = "#"; then
126043f32c10Smrg   echo '.include "confinc"' > confmf
126143f32c10Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
126243f32c10Smrg      am__include=.include
126343f32c10Smrg      am__quote="\""
126443f32c10Smrg      _am_result=BSD
126543f32c10Smrg   fi
126643f32c10Smrgfi
126743f32c10SmrgAC_SUBST([am__include])
126843f32c10SmrgAC_SUBST([am__quote])
126943f32c10SmrgAC_MSG_RESULT([$_am_result])
127043f32c10Smrgrm -f confinc confmf
127143f32c10Smrg])
127243f32c10Smrg
127343f32c10Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
127443f32c10Smrg
127543f32c10Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
127643f32c10Smrg# Free Software Foundation, Inc.
127743f32c10Smrg#
127843f32c10Smrg# This file is free software; the Free Software Foundation
127943f32c10Smrg# gives unlimited permission to copy and/or distribute it,
128043f32c10Smrg# with or without modifications, as long as this notice is preserved.
128143f32c10Smrg
128243f32c10Smrg# serial 5
128343f32c10Smrg
128443f32c10Smrg# AM_MISSING_PROG(NAME, PROGRAM)
128543f32c10Smrg# ------------------------------
128643f32c10SmrgAC_DEFUN([AM_MISSING_PROG],
128743f32c10Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
128843f32c10Smrg$1=${$1-"${am_missing_run}$2"}
128943f32c10SmrgAC_SUBST($1)])
129043f32c10Smrg
129143f32c10Smrg
129243f32c10Smrg# AM_MISSING_HAS_RUN
129343f32c10Smrg# ------------------
129443f32c10Smrg# Define MISSING if not defined so far and test if it supports --run.
129543f32c10Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
129643f32c10SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
129743f32c10Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
129843f32c10SmrgAC_REQUIRE_AUX_FILE([missing])dnl
129943f32c10Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
130043f32c10Smrg# Use eval to expand $SHELL
130143f32c10Smrgif eval "$MISSING --run true"; then
130243f32c10Smrg  am_missing_run="$MISSING --run "
130343f32c10Smrgelse
130443f32c10Smrg  am_missing_run=
130543f32c10Smrg  AC_MSG_WARN([`missing' script is too old or missing])
130643f32c10Smrgfi
130743f32c10Smrg])
130843f32c10Smrg
130943f32c10Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
131043f32c10Smrg#
131143f32c10Smrg# This file is free software; the Free Software Foundation
131243f32c10Smrg# gives unlimited permission to copy and/or distribute it,
131343f32c10Smrg# with or without modifications, as long as this notice is preserved.
131443f32c10Smrg
131543f32c10Smrg# AM_PROG_MKDIR_P
131643f32c10Smrg# ---------------
131743f32c10Smrg# Check for `mkdir -p'.
131843f32c10SmrgAC_DEFUN([AM_PROG_MKDIR_P],
131943f32c10Smrg[AC_PREREQ([2.60])dnl
132043f32c10SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
132143f32c10Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
132243f32c10Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
132343f32c10Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
132443f32c10Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
132543f32c10Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
132643f32c10Smrgdnl adjustment using top_builddir (which is defined more often than
132743f32c10Smrgdnl MKDIR_P).
132843f32c10SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
132943f32c10Smrgcase $mkdir_p in
133043f32c10Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
133143f32c10Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
133243f32c10Smrgesac
133343f32c10Smrg])
133443f32c10Smrg
133543f32c10Smrg# Helper functions for option handling.                     -*- Autoconf -*-
133643f32c10Smrg
133743f32c10Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
133843f32c10Smrg#
133943f32c10Smrg# This file is free software; the Free Software Foundation
134043f32c10Smrg# gives unlimited permission to copy and/or distribute it,
134143f32c10Smrg# with or without modifications, as long as this notice is preserved.
134243f32c10Smrg
134343f32c10Smrg# serial 3
134443f32c10Smrg
134543f32c10Smrg# _AM_MANGLE_OPTION(NAME)
134643f32c10Smrg# -----------------------
134743f32c10SmrgAC_DEFUN([_AM_MANGLE_OPTION],
134843f32c10Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
134943f32c10Smrg
135043f32c10Smrg# _AM_SET_OPTION(NAME)
135143f32c10Smrg# ------------------------------
135243f32c10Smrg# Set option NAME.  Presently that only means defining a flag for this option.
135343f32c10SmrgAC_DEFUN([_AM_SET_OPTION],
135443f32c10Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
135543f32c10Smrg
135643f32c10Smrg# _AM_SET_OPTIONS(OPTIONS)
135743f32c10Smrg# ----------------------------------
135843f32c10Smrg# OPTIONS is a space-separated list of Automake options.
135943f32c10SmrgAC_DEFUN([_AM_SET_OPTIONS],
136043f32c10Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
136143f32c10Smrg
136243f32c10Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
136343f32c10Smrg# -------------------------------------------
136443f32c10Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
136543f32c10SmrgAC_DEFUN([_AM_IF_OPTION],
136643f32c10Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
136743f32c10Smrg
136843f32c10Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
136943f32c10Smrg
137043f32c10Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
137143f32c10Smrg# Free Software Foundation, Inc.
137243f32c10Smrg#
137343f32c10Smrg# This file is free software; the Free Software Foundation
137443f32c10Smrg# gives unlimited permission to copy and/or distribute it,
137543f32c10Smrg# with or without modifications, as long as this notice is preserved.
137643f32c10Smrg
137743f32c10Smrg# serial 4
137843f32c10Smrg
137943f32c10Smrg# AM_SANITY_CHECK
138043f32c10Smrg# ---------------
138143f32c10SmrgAC_DEFUN([AM_SANITY_CHECK],
138243f32c10Smrg[AC_MSG_CHECKING([whether build environment is sane])
138343f32c10Smrg# Just in case
138443f32c10Smrgsleep 1
138543f32c10Smrgecho timestamp > conftest.file
138643f32c10Smrg# Do `set' in a subshell so we don't clobber the current shell's
138743f32c10Smrg# arguments.  Must try -L first in case configure is actually a
138843f32c10Smrg# symlink; some systems play weird games with the mod time of symlinks
138943f32c10Smrg# (eg FreeBSD returns the mod time of the symlink's containing
139043f32c10Smrg# directory).
139143f32c10Smrgif (
139243f32c10Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
139343f32c10Smrg   if test "$[*]" = "X"; then
139443f32c10Smrg      # -L didn't work.
139543f32c10Smrg      set X `ls -t $srcdir/configure conftest.file`
139643f32c10Smrg   fi
139743f32c10Smrg   rm -f conftest.file
139843f32c10Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
139943f32c10Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
140043f32c10Smrg
140143f32c10Smrg      # If neither matched, then we have a broken ls.  This can happen
140243f32c10Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
140343f32c10Smrg      # broken ls alias from the environment.  This has actually
140443f32c10Smrg      # happened.  Such a system could not be considered "sane".
140543f32c10Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
140643f32c10Smrgalias in your environment])
140743f32c10Smrg   fi
140843f32c10Smrg
140943f32c10Smrg   test "$[2]" = conftest.file
141043f32c10Smrg   )
141143f32c10Smrgthen
141243f32c10Smrg   # Ok.
141343f32c10Smrg   :
141443f32c10Smrgelse
141543f32c10Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
141643f32c10SmrgCheck your system clock])
141743f32c10Smrgfi
141843f32c10SmrgAC_MSG_RESULT(yes)])
141943f32c10Smrg
142043f32c10Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
142143f32c10Smrg#
142243f32c10Smrg# This file is free software; the Free Software Foundation
142343f32c10Smrg# gives unlimited permission to copy and/or distribute it,
142443f32c10Smrg# with or without modifications, as long as this notice is preserved.
142543f32c10Smrg
142643f32c10Smrg# AM_PROG_INSTALL_STRIP
142743f32c10Smrg# ---------------------
142843f32c10Smrg# One issue with vendor `install' (even GNU) is that you can't
142943f32c10Smrg# specify the program used to strip binaries.  This is especially
143043f32c10Smrg# annoying in cross-compiling environments, where the build's strip
143143f32c10Smrg# is unlikely to handle the host's binaries.
143243f32c10Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
143343f32c10Smrg# always use install-sh in `make install-strip', and initialize
143443f32c10Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
143543f32c10SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
143643f32c10Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
143743f32c10Smrg# Installed binaries are usually stripped using `strip' when the user
143843f32c10Smrg# run `make install-strip'.  However `strip' might not be the right
143943f32c10Smrg# tool to use in cross-compilation environments, therefore Automake
144043f32c10Smrg# will honor the `STRIP' environment variable to overrule this program.
144143f32c10Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
144243f32c10Smrgif test "$cross_compiling" != no; then
144343f32c10Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
144443f32c10Smrgfi
144543f32c10SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
144643f32c10SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
144743f32c10Smrg
144843f32c10Smrg# Copyright (C) 2006  Free Software Foundation, Inc.
144943f32c10Smrg#
145043f32c10Smrg# This file is free software; the Free Software Foundation
145143f32c10Smrg# gives unlimited permission to copy and/or distribute it,
145243f32c10Smrg# with or without modifications, as long as this notice is preserved.
145343f32c10Smrg
145443f32c10Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
145543f32c10Smrg# ---------------------------
145643f32c10Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
145743f32c10Smrg# This macro is traced by Automake.
145843f32c10SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
145943f32c10Smrg
146043f32c10Smrg# Check how to create a tarball.                            -*- Autoconf -*-
146143f32c10Smrg
146243f32c10Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
146343f32c10Smrg#
146443f32c10Smrg# This file is free software; the Free Software Foundation
146543f32c10Smrg# gives unlimited permission to copy and/or distribute it,
146643f32c10Smrg# with or without modifications, as long as this notice is preserved.
146743f32c10Smrg
146843f32c10Smrg# serial 2
146943f32c10Smrg
147043f32c10Smrg# _AM_PROG_TAR(FORMAT)
147143f32c10Smrg# --------------------
147243f32c10Smrg# Check how to create a tarball in format FORMAT.
147343f32c10Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
147443f32c10Smrg#
147543f32c10Smrg# Substitute a variable $(am__tar) that is a command
147643f32c10Smrg# writing to stdout a FORMAT-tarball containing the directory
147743f32c10Smrg# $tardir.
147843f32c10Smrg#     tardir=directory && $(am__tar) > result.tar
147943f32c10Smrg#
148043f32c10Smrg# Substitute a variable $(am__untar) that extract such
148143f32c10Smrg# a tarball read from stdin.
148243f32c10Smrg#     $(am__untar) < result.tar
148343f32c10SmrgAC_DEFUN([_AM_PROG_TAR],
148443f32c10Smrg[# Always define AMTAR for backward compatibility.
148543f32c10SmrgAM_MISSING_PROG([AMTAR], [tar])
148643f32c10Smrgm4_if([$1], [v7],
148743f32c10Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
148843f32c10Smrg     [m4_case([$1], [ustar],, [pax],,
148943f32c10Smrg              [m4_fatal([Unknown tar format])])
149043f32c10SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
149143f32c10Smrg# Loop over all known methods to create a tar archive until one works.
149243f32c10Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
149343f32c10Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
149443f32c10Smrg# Do not fold the above two line into one, because Tru64 sh and
149543f32c10Smrg# Solaris sh will not grok spaces in the rhs of `-'.
149643f32c10Smrgfor _am_tool in $_am_tools
149743f32c10Smrgdo
149843f32c10Smrg  case $_am_tool in
149943f32c10Smrg  gnutar)
150043f32c10Smrg    for _am_tar in tar gnutar gtar;
150143f32c10Smrg    do
150243f32c10Smrg      AM_RUN_LOG([$_am_tar --version]) && break
150343f32c10Smrg    done
150443f32c10Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
150543f32c10Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
150643f32c10Smrg    am__untar="$_am_tar -xf -"
150743f32c10Smrg    ;;
150843f32c10Smrg  plaintar)
150943f32c10Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
151043f32c10Smrg    # ustar tarball either.
151143f32c10Smrg    (tar --version) >/dev/null 2>&1 && continue
151243f32c10Smrg    am__tar='tar chf - "$$tardir"'
151343f32c10Smrg    am__tar_='tar chf - "$tardir"'
151443f32c10Smrg    am__untar='tar xf -'
151543f32c10Smrg    ;;
151643f32c10Smrg  pax)
151743f32c10Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
151843f32c10Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
151943f32c10Smrg    am__untar='pax -r'
152043f32c10Smrg    ;;
152143f32c10Smrg  cpio)
152243f32c10Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
152343f32c10Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
152443f32c10Smrg    am__untar='cpio -i -H $1 -d'
152543f32c10Smrg    ;;
152643f32c10Smrg  none)
152743f32c10Smrg    am__tar=false
152843f32c10Smrg    am__tar_=false
152943f32c10Smrg    am__untar=false
153043f32c10Smrg    ;;
153143f32c10Smrg  esac
153243f32c10Smrg
153343f32c10Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
153443f32c10Smrg  # and am__untar set.
153543f32c10Smrg  test -n "${am_cv_prog_tar_$1}" && break
153643f32c10Smrg
153743f32c10Smrg  # tar/untar a dummy directory, and stop if the command works
153843f32c10Smrg  rm -rf conftest.dir
153943f32c10Smrg  mkdir conftest.dir
154043f32c10Smrg  echo GrepMe > conftest.dir/file
154143f32c10Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
154243f32c10Smrg  rm -rf conftest.dir
154343f32c10Smrg  if test -s conftest.tar; then
154443f32c10Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
154543f32c10Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
154643f32c10Smrg  fi
154743f32c10Smrgdone
154843f32c10Smrgrm -rf conftest.dir
154943f32c10Smrg
155043f32c10SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
155143f32c10SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
155243f32c10SmrgAC_SUBST([am__tar])
155343f32c10SmrgAC_SUBST([am__untar])
155443f32c10Smrg]) # _AM_PROG_TAR
155543f32c10Smrg
1556