aclocal.m4 revision 1abf7346
11abf7346Smrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
21abf7346Smrg
31abf7346Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
41abf7346Smrg# 2005, 2006  Free Software Foundation, Inc.
51abf7346Smrg# This file is free software; the Free Software Foundation
61abf7346Smrg# gives unlimited permission to copy and/or distribute it,
71abf7346Smrg# with or without modifications, as long as this notice is preserved.
81abf7346Smrg
91abf7346Smrg# This program is distributed in the hope that it will be useful,
101abf7346Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
111abf7346Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
121abf7346Smrg# PARTICULAR PURPOSE.
131abf7346Smrg
141abf7346Smrgm4_if(m4_PACKAGE_VERSION, [2.61],,
151abf7346Smrg[m4_fatal([this file was generated for autoconf 2.61.
161abf7346SmrgYou have another version of autoconf.  If you want to use that,
171abf7346Smrgyou should regenerate the build system entirely.], [63])])
181abf7346Smrg
191abf7346Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
201abf7346Smrg# 
211abf7346Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
221abf7346Smrg#
231abf7346Smrg# This program is free software; you can redistribute it and/or modify
241abf7346Smrg# it under the terms of the GNU General Public License as published by
251abf7346Smrg# the Free Software Foundation; either version 2 of the License, or
261abf7346Smrg# (at your option) any later version.
271abf7346Smrg#
281abf7346Smrg# This program is distributed in the hope that it will be useful, but
291abf7346Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
301abf7346Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
311abf7346Smrg# General Public License for more details.
321abf7346Smrg#
331abf7346Smrg# You should have received a copy of the GNU General Public License
341abf7346Smrg# along with this program; if not, write to the Free Software
351abf7346Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
361abf7346Smrg#
371abf7346Smrg# As a special exception to the GNU General Public License, if you
381abf7346Smrg# distribute this file as part of a program that contains a
391abf7346Smrg# configuration script generated by Autoconf, you may include it under
401abf7346Smrg# the same distribution terms that you use for the rest of that program.
411abf7346Smrg
421abf7346Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
431abf7346Smrg# ----------------------------------
441abf7346SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
451abf7346Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
461abf7346Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
471abf7346SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
481abf7346Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
491abf7346Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
501abf7346Smrgfi
511abf7346Smrgif test -n "$PKG_CONFIG"; then
521abf7346Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
531abf7346Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
541abf7346Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
551abf7346Smrg		AC_MSG_RESULT([yes])
561abf7346Smrg	else
571abf7346Smrg		AC_MSG_RESULT([no])
581abf7346Smrg		PKG_CONFIG=""
591abf7346Smrg	fi
601abf7346Smrg		
611abf7346Smrgfi[]dnl
621abf7346Smrg])# PKG_PROG_PKG_CONFIG
631abf7346Smrg
641abf7346Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
651abf7346Smrg#
661abf7346Smrg# Check to see whether a particular set of modules exists.  Similar
671abf7346Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
681abf7346Smrg#
691abf7346Smrg#
701abf7346Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
711abf7346Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
721abf7346Smrg# PKG_CHECK_EXISTS manually
731abf7346Smrg# --------------------------------------------------------------
741abf7346SmrgAC_DEFUN([PKG_CHECK_EXISTS],
751abf7346Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
761abf7346Smrgif test -n "$PKG_CONFIG" && \
771abf7346Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
781abf7346Smrg  m4_ifval([$2], [$2], [:])
791abf7346Smrgm4_ifvaln([$3], [else
801abf7346Smrg  $3])dnl
811abf7346Smrgfi])
821abf7346Smrg
831abf7346Smrg
841abf7346Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
851abf7346Smrg# ---------------------------------------------
861abf7346Smrgm4_define([_PKG_CONFIG],
871abf7346Smrg[if test -n "$PKG_CONFIG"; then
881abf7346Smrg    if test -n "$$1"; then
891abf7346Smrg        pkg_cv_[]$1="$$1"
901abf7346Smrg    else
911abf7346Smrg        PKG_CHECK_EXISTS([$3],
921abf7346Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
931abf7346Smrg			 [pkg_failed=yes])
941abf7346Smrg    fi
951abf7346Smrgelse
961abf7346Smrg	pkg_failed=untried
971abf7346Smrgfi[]dnl
981abf7346Smrg])# _PKG_CONFIG
991abf7346Smrg
1001abf7346Smrg# _PKG_SHORT_ERRORS_SUPPORTED
1011abf7346Smrg# -----------------------------
1021abf7346SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1031abf7346Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1041abf7346Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1051abf7346Smrg        _pkg_short_errors_supported=yes
1061abf7346Smrgelse
1071abf7346Smrg        _pkg_short_errors_supported=no
1081abf7346Smrgfi[]dnl
1091abf7346Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
1101abf7346Smrg
1111abf7346Smrg
1121abf7346Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1131abf7346Smrg# [ACTION-IF-NOT-FOUND])
1141abf7346Smrg#
1151abf7346Smrg#
1161abf7346Smrg# Note that if there is a possibility the first call to
1171abf7346Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
1181abf7346Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1191abf7346Smrg#
1201abf7346Smrg#
1211abf7346Smrg# --------------------------------------------------------------
1221abf7346SmrgAC_DEFUN([PKG_CHECK_MODULES],
1231abf7346Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1241abf7346SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1251abf7346SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1261abf7346Smrg
1271abf7346Smrgpkg_failed=no
1281abf7346SmrgAC_MSG_CHECKING([for $1])
1291abf7346Smrg
1301abf7346Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1311abf7346Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1321abf7346Smrg
1331abf7346Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1341abf7346Smrgand $1[]_LIBS to avoid the need to call pkg-config.
1351abf7346SmrgSee the pkg-config man page for more details.])
1361abf7346Smrg
1371abf7346Smrgif test $pkg_failed = yes; then
1381abf7346Smrg        _PKG_SHORT_ERRORS_SUPPORTED
1391abf7346Smrg        if test $_pkg_short_errors_supported = yes; then
1401abf7346Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
1411abf7346Smrg        else 
1421abf7346Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1431abf7346Smrg        fi
1441abf7346Smrg	# Put the nasty error message in config.log where it belongs
1451abf7346Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1461abf7346Smrg
1471abf7346Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
1481abf7346Smrg[Package requirements ($2) were not met:
1491abf7346Smrg
1501abf7346Smrg$$1_PKG_ERRORS
1511abf7346Smrg
1521abf7346SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1531abf7346Smrginstalled software in a non-standard prefix.
1541abf7346Smrg
1551abf7346Smrg_PKG_TEXT
1561abf7346Smrg])],
1571abf7346Smrg		[AC_MSG_RESULT([no])
1581abf7346Smrg                $4])
1591abf7346Smrgelif test $pkg_failed = untried; then
1601abf7346Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
1611abf7346Smrg[The pkg-config script could not be found or is too old.  Make sure it
1621abf7346Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
1631abf7346Smrgpath to pkg-config.
1641abf7346Smrg
1651abf7346Smrg_PKG_TEXT
1661abf7346Smrg
1671abf7346SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
1681abf7346Smrg		[$4])
1691abf7346Smrgelse
1701abf7346Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1711abf7346Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1721abf7346Smrg        AC_MSG_RESULT([yes])
1731abf7346Smrg	ifelse([$3], , :, [$3])
1741abf7346Smrgfi[]dnl
1751abf7346Smrg])# PKG_CHECK_MODULES
1761abf7346Smrg
1771abf7346Smrgdnl Copyright 2005 Red Hat, Inc
1781abf7346Smrgdnl 
1791abf7346Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1801abf7346Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1811abf7346Smrgdnl the above copyright notice appear in all copies and that both that
1821abf7346Smrgdnl copyright notice and this permission notice appear in supporting
1831abf7346Smrgdnl documentation.
1841abf7346Smrgdnl 
1851abf7346Smrgdnl The above copyright notice and this permission notice shall be included
1861abf7346Smrgdnl in all copies or substantial portions of the Software.
1871abf7346Smrgdnl 
1881abf7346Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1891abf7346Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1901abf7346Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1911abf7346Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1921abf7346Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1931abf7346Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1941abf7346Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1951abf7346Smrgdnl 
1961abf7346Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1971abf7346Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1981abf7346Smrgdnl other dealings in this Software without prior written authorization
1991abf7346Smrgdnl from the copyright holders.
2001abf7346Smrgdnl 
2011abf7346Smrg
2021abf7346Smrg# XAW_CHECK_XPRINT_SUPPORT()
2031abf7346Smrg# --------------------------
2041abf7346Smrg# Adds --enable/disable-xprint and selects the appropriate version of the Xaw 
2051abf7346Smrg# library. If neither --enable-xprint nor --disable-xprint are given, 
2061abf7346Smrg# the presence of an Xaw with Xprint support will be auto detected
2071abf7346Smrg
2081abf7346SmrgAC_DEFUN([XAW_CHECK_XPRINT_SUPPORT],[
2091abf7346Smrg	AC_ARG_ENABLE(xprint, AC_HELP_STRING([--enable-xprint], [Enable XPrint support]),
2101abf7346Smrg			[use_xprint=$enableval],[use_xprint=auto])
2111abf7346Smrg	if test "x$use_xprint" = "xyes"; then
2121abf7346Smrg		TMP_CHECK1=xaw8
2131abf7346Smrg		TMP_CHECK2=
2141abf7346Smrg		xaw_use_xprint=yes
2151abf7346Smrg	elif test "x$use_xprint" = "xno"; then
2161abf7346Smrg		TMP_CHECK1=xaw7
2171abf7346Smrg		TMP_CHECK2=
2181abf7346Smrg		xaw_use_xprint=no
2191abf7346Smrg	else
2201abf7346Smrg		TMP_CHECK1=xaw8
2211abf7346Smrg		TMP_CHECK2=xaw7
2221abf7346Smrg		xaw_use_xprint=yes
2231abf7346Smrg	fi
2241abf7346Smrg
2251abf7346Smrg	PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK1, success=yes, success=no)
2261abf7346Smrg	if [[ ! -z $TMP_CHECK2 ]] ; then
2271abf7346Smrg		if test $success = no ; then
2281abf7346Smrg			PKG_CHECK_MODULES(TMP_XAW, $TMP_CHECK2, success=yes, success=no)
2291abf7346Smrg			xaw_use_xprint=no
2301abf7346Smrg		fi
2311abf7346Smrg	fi
2321abf7346Smrg
2331abf7346Smrg	if test "x$success" = "xyes"; then
2341abf7346Smrg		$1_CFLAGS=$TMP_XAW_CFLAGS
2351abf7346Smrg		$1_LIBS=$TMP_XAW_LIBS
2361abf7346Smrg
2371abf7346Smrg		AM_CONDITIONAL([XAW_USE_XPRINT], [test "x$xaw_use_xprint" = "xyes"])
2381abf7346Smrg	else
2391abf7346Smrg		AC_MSG_ERROR([No suitable version of Xaw found])
2401abf7346Smrg	fi
2411abf7346Smrg])
2421abf7346Smrg
2431abf7346Smrgdnl
2441abf7346Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
2451abf7346Smrgdnl 
2461abf7346Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
2471abf7346Smrgdnl copy of this software and associated documentation files (the
2481abf7346Smrgdnl "Software"), to deal in the Software without restriction, including
2491abf7346Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
2501abf7346Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
2511abf7346Smrgdnl to whom the Software is furnished to do so, provided that the above
2521abf7346Smrgdnl copyright notice(s) and this permission notice appear in all copies of
2531abf7346Smrgdnl the Software and that both the above copyright notice(s) and this
2541abf7346Smrgdnl permission notice appear in supporting documentation.
2551abf7346Smrgdnl
2561abf7346Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2571abf7346Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2581abf7346Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
2591abf7346Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
2601abf7346Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
2611abf7346Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
2621abf7346Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
2631abf7346Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
2641abf7346Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2651abf7346Smrgdnl
2661abf7346Smrgdnl Except as contained in this notice, the name of a copyright holder
2671abf7346Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
2681abf7346Smrgdnl or other dealings in this Software without prior written authorization
2691abf7346Smrgdnl of the copyright holder.
2701abf7346Smrg
2711abf7346Smrg# XORG_MACROS_VERSION(required-version)
2721abf7346Smrg# -------------------------------------
2731abf7346Smrg# Minimum version: 1.1.0
2741abf7346Smrg#
2751abf7346Smrg# If you're using a macro added in Version 1.1 or newer, include this in
2761abf7346Smrg# your configure.ac with the minimum required version, such as:
2771abf7346Smrg# XORG_MACROS_VERSION(1.1)
2781abf7346Smrg#
2791abf7346Smrg# To force at least a version with this macro defined, also add:
2801abf7346Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
2811abf7346Smrg#
2821abf7346Smrg#
2831abf7346Smrg# See the "minimum version" comment for each macro you use to see what 
2841abf7346Smrg# version you require.
2851abf7346SmrgAC_DEFUN([XORG_MACROS_VERSION],[
2861abf7346Smrg	[XORG_MACROS_needed_version=$1
2871abf7346Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
2881abf7346Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
2891abf7346Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
2901abf7346Smrg	[XORG_MACROS_version=1.1.5
2911abf7346Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
2921abf7346Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
2931abf7346Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
2941abf7346Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
2951abf7346Smrg	fi
2961abf7346Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
2971abf7346Smrg		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])
2981abf7346Smrg	fi
2991abf7346Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
3001abf7346Smrg]) # XORG_MACROS_VERSION
3011abf7346Smrg
3021abf7346Smrg# XORG_PROG_RAWCPP()
3031abf7346Smrg# ------------------
3041abf7346Smrg# Minimum version: 1.0.0
3051abf7346Smrg#
3061abf7346Smrg# Find cpp program and necessary flags for use in pre-processing text files
3071abf7346Smrg# such as man pages and config files
3081abf7346SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
3091abf7346SmrgAC_REQUIRE([AC_PROG_CPP])
3101abf7346SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
3111abf7346Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
3121abf7346Smrg
3131abf7346Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
3141abf7346Smrg# which is not the best choice for supporting other OS'es, but covers most
3151abf7346Smrg# of the ones we need for now.
3161abf7346SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
3171abf7346SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
3181abf7346Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
3191abf7346Smrg	AC_MSG_RESULT([no])
3201abf7346Smrgelse
3211abf7346Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
3221abf7346Smrg		RAWCPPFLAGS=-undef
3231abf7346Smrg		AC_MSG_RESULT([yes])
3241abf7346Smrg	else
3251abf7346Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
3261abf7346Smrg	fi
3271abf7346Smrgfi
3281abf7346Smrgrm -f conftest.$ac_ext
3291abf7346Smrg
3301abf7346SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
3311abf7346SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
3321abf7346Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
3331abf7346Smrg	AC_MSG_RESULT([no])
3341abf7346Smrgelse
3351abf7346Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
3361abf7346Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
3371abf7346Smrg		AC_MSG_RESULT([yes])
3381abf7346Smrg	else
3391abf7346Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
3401abf7346Smrg	fi
3411abf7346Smrgfi
3421abf7346Smrgrm -f conftest.$ac_ext
3431abf7346SmrgAC_SUBST(RAWCPPFLAGS)
3441abf7346Smrg]) # XORG_PROG_RAWCPP
3451abf7346Smrg
3461abf7346Smrg# XORG_MANPAGE_SECTIONS()
3471abf7346Smrg# -----------------------
3481abf7346Smrg# Minimum version: 1.0.0
3491abf7346Smrg#
3501abf7346Smrg# Determine which sections man pages go in for the different man page types
3511abf7346Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
3521abf7346Smrg# Not sure if there's any better way than just hardcoding by OS name.
3531abf7346Smrg# Override default settings by setting environment variables
3541abf7346Smrg
3551abf7346SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
3561abf7346SmrgAC_REQUIRE([AC_CANONICAL_HOST])
3571abf7346Smrg
3581abf7346Smrgif test x$APP_MAN_SUFFIX = x    ; then
3591abf7346Smrg    APP_MAN_SUFFIX=1
3601abf7346Smrgfi
3611abf7346Smrgif test x$APP_MAN_DIR = x    ; then
3621abf7346Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
3631abf7346Smrgfi
3641abf7346Smrg
3651abf7346Smrgif test x$LIB_MAN_SUFFIX = x    ; then
3661abf7346Smrg    LIB_MAN_SUFFIX=3
3671abf7346Smrgfi
3681abf7346Smrgif test x$LIB_MAN_DIR = x    ; then
3691abf7346Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
3701abf7346Smrgfi
3711abf7346Smrg
3721abf7346Smrgif test x$FILE_MAN_SUFFIX = x    ; then
3731abf7346Smrg    case $host_os in
3741abf7346Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
3751abf7346Smrg	*)		FILE_MAN_SUFFIX=5  ;;
3761abf7346Smrg    esac
3771abf7346Smrgfi
3781abf7346Smrgif test x$FILE_MAN_DIR = x    ; then
3791abf7346Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
3801abf7346Smrgfi
3811abf7346Smrg
3821abf7346Smrgif test x$MISC_MAN_SUFFIX = x    ; then
3831abf7346Smrg    case $host_os in
3841abf7346Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
3851abf7346Smrg	*)		MISC_MAN_SUFFIX=7  ;;
3861abf7346Smrg    esac
3871abf7346Smrgfi
3881abf7346Smrgif test x$MISC_MAN_DIR = x    ; then
3891abf7346Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
3901abf7346Smrgfi
3911abf7346Smrg
3921abf7346Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
3931abf7346Smrg    case $host_os in
3941abf7346Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
3951abf7346Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
3961abf7346Smrg    esac
3971abf7346Smrgfi
3981abf7346Smrgif test x$DRIVER_MAN_DIR = x    ; then
3991abf7346Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
4001abf7346Smrgfi
4011abf7346Smrg
4021abf7346Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
4031abf7346Smrg    case $host_os in
4041abf7346Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
4051abf7346Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
4061abf7346Smrg    esac
4071abf7346Smrgfi
4081abf7346Smrgif test x$ADMIN_MAN_DIR = x    ; then
4091abf7346Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
4101abf7346Smrgfi
4111abf7346Smrg
4121abf7346Smrg
4131abf7346SmrgAC_SUBST([APP_MAN_SUFFIX])
4141abf7346SmrgAC_SUBST([LIB_MAN_SUFFIX])
4151abf7346SmrgAC_SUBST([FILE_MAN_SUFFIX])
4161abf7346SmrgAC_SUBST([MISC_MAN_SUFFIX])
4171abf7346SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
4181abf7346SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
4191abf7346SmrgAC_SUBST([APP_MAN_DIR])
4201abf7346SmrgAC_SUBST([LIB_MAN_DIR])
4211abf7346SmrgAC_SUBST([FILE_MAN_DIR])
4221abf7346SmrgAC_SUBST([MISC_MAN_DIR])
4231abf7346SmrgAC_SUBST([DRIVER_MAN_DIR])
4241abf7346SmrgAC_SUBST([ADMIN_MAN_DIR])
4251abf7346Smrg]) # XORG_MANPAGE_SECTIONS
4261abf7346Smrg
4271abf7346Smrg# XORG_CHECK_LINUXDOC
4281abf7346Smrg# -------------------
4291abf7346Smrg# Minimum version: 1.0.0
4301abf7346Smrg#
4311abf7346Smrg# Defines the variable MAKE_TEXT if the necessary tools and
4321abf7346Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
4331abf7346Smrg# Whether or not the necessary tools and files are found can be checked
4341abf7346Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
4351abf7346SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
4361abf7346SmrgXORG_SGML_PATH=$prefix/share/sgml
4371abf7346SmrgHAVE_DEFS_ENT=
4381abf7346Smrg
4391abf7346SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
4401abf7346Smrg
4411abf7346SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
4421abf7346SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
4431abf7346Smrg
4441abf7346SmrgAC_MSG_CHECKING([Whether to build documentation])
4451abf7346Smrg
4461abf7346Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
4471abf7346Smrg   BUILDDOC=yes
4481abf7346Smrgelse
4491abf7346Smrg   BUILDDOC=no
4501abf7346Smrgfi
4511abf7346Smrg
4521abf7346SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
4531abf7346Smrg
4541abf7346SmrgAC_MSG_RESULT([$BUILDDOC])
4551abf7346Smrg
4561abf7346SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
4571abf7346Smrg
4581abf7346Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
4591abf7346Smrg   BUILDPDFDOC=yes
4601abf7346Smrgelse
4611abf7346Smrg   BUILDPDFDOC=no
4621abf7346Smrgfi
4631abf7346Smrg
4641abf7346SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
4651abf7346Smrg
4661abf7346SmrgAC_MSG_RESULT([$BUILDPDFDOC])
4671abf7346Smrg
4681abf7346SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
4691abf7346SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
4701abf7346SmrgMAKE_PDF="$PS2PDF"
4711abf7346SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
4721abf7346Smrg
4731abf7346SmrgAC_SUBST(MAKE_TEXT)
4741abf7346SmrgAC_SUBST(MAKE_PS)
4751abf7346SmrgAC_SUBST(MAKE_PDF)
4761abf7346SmrgAC_SUBST(MAKE_HTML)
4771abf7346Smrg]) # XORG_CHECK_LINUXDOC
4781abf7346Smrg
4791abf7346Smrg# XORG_CHECK_DOCBOOK
4801abf7346Smrg# -------------------
4811abf7346Smrg# Minimum version: 1.0.0
4821abf7346Smrg#
4831abf7346Smrg# Checks for the ability to build output formats from SGML DocBook source.
4841abf7346Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
4851abf7346Smrg# indicates whether the necessary tools and files are found and, if set,
4861abf7346Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
4871abf7346SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
4881abf7346SmrgXORG_SGML_PATH=$prefix/share/sgml
4891abf7346SmrgHAVE_DEFS_ENT=
4901abf7346SmrgBUILDTXTDOC=no
4911abf7346SmrgBUILDPDFDOC=no
4921abf7346SmrgBUILDPSDOC=no
4931abf7346SmrgBUILDHTMLDOC=no
4941abf7346Smrg
4951abf7346SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
4961abf7346Smrg
4971abf7346SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
4981abf7346SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
4991abf7346SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
5001abf7346SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
5011abf7346Smrg
5021abf7346SmrgAC_MSG_CHECKING([Whether to build text documentation])
5031abf7346Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
5041abf7346Smrg   test x$BUILD_TXTDOC != xno; then
5051abf7346Smrg	BUILDTXTDOC=yes
5061abf7346Smrgfi
5071abf7346SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
5081abf7346SmrgAC_MSG_RESULT([$BUILDTXTDOC])
5091abf7346Smrg
5101abf7346SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
5111abf7346Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
5121abf7346Smrg   test x$BUILD_PDFDOC != xno; then
5131abf7346Smrg	BUILDPDFDOC=yes
5141abf7346Smrgfi
5151abf7346SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
5161abf7346SmrgAC_MSG_RESULT([$BUILDPDFDOC])
5171abf7346Smrg
5181abf7346SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
5191abf7346Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
5201abf7346Smrg   test x$BUILD_PSDOC != xno; then
5211abf7346Smrg	BUILDPSDOC=yes
5221abf7346Smrgfi
5231abf7346SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
5241abf7346SmrgAC_MSG_RESULT([$BUILDPSDOC])
5251abf7346Smrg
5261abf7346SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
5271abf7346Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
5281abf7346Smrg   test x$BUILD_HTMLDOC != xno; then
5291abf7346Smrg	BUILDHTMLDOC=yes
5301abf7346Smrgfi
5311abf7346SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
5321abf7346SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
5331abf7346Smrg
5341abf7346SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
5351abf7346SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
5361abf7346SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
5371abf7346SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
5381abf7346Smrg
5391abf7346SmrgAC_SUBST(MAKE_TEXT)
5401abf7346SmrgAC_SUBST(MAKE_PS)
5411abf7346SmrgAC_SUBST(MAKE_PDF)
5421abf7346SmrgAC_SUBST(MAKE_HTML)
5431abf7346Smrg]) # XORG_CHECK_DOCBOOK
5441abf7346Smrg
5451abf7346Smrg# XORG_CHECK_MALLOC_ZERO
5461abf7346Smrg# ----------------------
5471abf7346Smrg# Minimum version: 1.0.0
5481abf7346Smrg#
5491abf7346Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
5501abf7346Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
5511abf7346Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
5521abf7346SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
5531abf7346SmrgAC_ARG_ENABLE(malloc0returnsnull,
5541abf7346Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
5551abf7346Smrg		       [malloc(0) returns NULL (default: auto)]),
5561abf7346Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
5571abf7346Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
5581abf7346Smrg
5591abf7346SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
5601abf7346Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
5611abf7346Smrg	AC_RUN_IFELSE([
5621abf7346Smrgchar *malloc();
5631abf7346Smrgchar *realloc();
5641abf7346Smrgchar *calloc();
5651abf7346Smrgmain() {
5661abf7346Smrg    char *m0, *r0, *c0, *p;
5671abf7346Smrg    m0 = malloc(0);
5681abf7346Smrg    p = malloc(10);
5691abf7346Smrg    r0 = realloc(p,0);
5701abf7346Smrg    c0 = calloc(0);
5711abf7346Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
5721abf7346Smrg}],
5731abf7346Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
5741abf7346Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
5751abf7346Smrgfi
5761abf7346SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
5771abf7346Smrg
5781abf7346Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
5791abf7346Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
5801abf7346Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
5811abf7346Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
5821abf7346Smrgelse
5831abf7346Smrg	MALLOC_ZERO_CFLAGS=""
5841abf7346Smrg	XMALLOC_ZERO_CFLAGS=""
5851abf7346Smrg	XTMALLOC_ZERO_CFLAGS=""
5861abf7346Smrgfi
5871abf7346Smrg
5881abf7346SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
5891abf7346SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
5901abf7346SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
5911abf7346Smrg]) # XORG_CHECK_MALLOC_ZERO
5921abf7346Smrg
5931abf7346Smrg# XORG_WITH_LINT()
5941abf7346Smrg# ----------------
5951abf7346Smrg# Minimum version: 1.1.0
5961abf7346Smrg#
5971abf7346Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
5981abf7346Smrg# is specified.   (Use --with-lint=sparse for sparse.)
5991abf7346Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
6001abf7346Smrg# Sets $LINT_FLAGS to flags to pass to source checker
6011abf7346Smrg# Sets LINT automake conditional if enabled (default: disabled)
6021abf7346Smrg#
6031abf7346SmrgAC_DEFUN([XORG_WITH_LINT],[
6041abf7346Smrg
6051abf7346Smrg# Allow checking code with lint, sparse, etc.
6061abf7346SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
6071abf7346Smrg		[Use a lint-style source code checker (default: disabled)])],
6081abf7346Smrg		[use_lint=$withval], [use_lint=no])
6091abf7346Smrgif test "x$use_lint" = "xyes" ; then
6101abf7346Smrg	LINT="lint"
6111abf7346Smrgelse
6121abf7346Smrg	LINT="$use_lint"
6131abf7346Smrgfi
6141abf7346Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
6151abf7346Smrg    case $LINT in
6161abf7346Smrg	lint|*/lint)
6171abf7346Smrg	    case $host_os in
6181abf7346Smrg		solaris*)
6191abf7346Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
6201abf7346Smrg			;;
6211abf7346Smrg	    esac
6221abf7346Smrg	    ;;
6231abf7346Smrg    esac
6241abf7346Smrgfi
6251abf7346Smrg
6261abf7346SmrgAC_SUBST(LINT)
6271abf7346SmrgAC_SUBST(LINT_FLAGS)
6281abf7346SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
6291abf7346Smrg
6301abf7346Smrg]) # XORG_WITH_LINT
6311abf7346Smrg
6321abf7346Smrg# XORG_LINT_LIBRARY(LIBNAME)
6331abf7346Smrg# --------------------------
6341abf7346Smrg# Minimum version: 1.1.0
6351abf7346Smrg#
6361abf7346Smrg# Sets up flags for building lint libraries for checking programs that call
6371abf7346Smrg# functions in the library.
6381abf7346Smrg# Disabled by default, enable with --enable-lint-library
6391abf7346Smrg# Sets: 
6401abf7346Smrg#	@LINTLIB@		- name of lint library file to make
6411abf7346Smrg#	MAKE_LINT_LIB		- automake conditional
6421abf7346Smrg#
6431abf7346Smrg
6441abf7346SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
6451abf7346SmrgAC_REQUIRE([XORG_WITH_LINT])
6461abf7346Smrg# Build lint "library" for more indepth checks of programs calling this library
6471abf7346SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
6481abf7346Smrg	[Create lint library (default: disabled)])],
6491abf7346Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
6501abf7346Smrgif test "x$make_lint_lib" != "xno" ; then
6511abf7346Smrg	if test "x$LINT" = "xno" ; then
6521abf7346Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
6531abf7346Smrg	fi
6541abf7346Smrg	if test "x$make_lint_lib" = "xyes" ; then
6551abf7346Smrg		LINTLIB=llib-l$1.ln
6561abf7346Smrg	else
6571abf7346Smrg		LINTLIB=$make_lint_lib
6581abf7346Smrg	fi
6591abf7346Smrgfi
6601abf7346SmrgAC_SUBST(LINTLIB)
6611abf7346SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
6621abf7346Smrg
6631abf7346Smrg]) # XORG_LINT_LIBRARY
6641abf7346Smrg
6651abf7346Smrgdnl Copyright 2005 Red Hat, Inc
6661abf7346Smrgdnl
6671abf7346Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
6681abf7346Smrgdnl documentation for any purpose is hereby granted without fee, provided that
6691abf7346Smrgdnl the above copyright notice appear in all copies and that both that
6701abf7346Smrgdnl copyright notice and this permission notice appear in supporting
6711abf7346Smrgdnl documentation.
6721abf7346Smrgdnl
6731abf7346Smrgdnl The above copyright notice and this permission notice shall be included
6741abf7346Smrgdnl in all copies or substantial portions of the Software.
6751abf7346Smrgdnl
6761abf7346Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6771abf7346Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6781abf7346Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
6791abf7346Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
6801abf7346Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
6811abf7346Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
6821abf7346Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
6831abf7346Smrgdnl
6841abf7346Smrgdnl Except as contained in this notice, the name of the copyright holders shall
6851abf7346Smrgdnl not be used in advertising or otherwise to promote the sale, use or
6861abf7346Smrgdnl other dealings in this Software without prior written authorization
6871abf7346Smrgdnl from the copyright holders.
6881abf7346Smrgdnl
6891abf7346Smrg
6901abf7346Smrg# XORG_RELEASE_VERSION
6911abf7346Smrg# --------------------
6921abf7346Smrg# Adds --with/without-release-string and changes the PACKAGE and
6931abf7346Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
6941abf7346Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
6951abf7346Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
6961abf7346Smrg 
6971abf7346SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
6981abf7346Smrg	AC_ARG_WITH(release-version,
6991abf7346Smrg			AC_HELP_STRING([--with-release-version=STRING],
7001abf7346Smrg				[Use release version string in package name]),
7011abf7346Smrg			[RELEASE_VERSION="$withval"],
7021abf7346Smrg			[RELEASE_VERSION=""])
7031abf7346Smrg	if test "x$RELEASE_VERSION" != "x"; then
7041abf7346Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
7051abf7346Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
7061abf7346Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
7071abf7346Smrg	fi
7081abf7346Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
7091abf7346Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
7101abf7346Smrg		[Major version of this package])
7111abf7346Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
7121abf7346Smrg	if test "x$PVM" = "x"; then
7131abf7346Smrg		PVM="0"
7141abf7346Smrg	fi
7151abf7346Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
7161abf7346Smrg		[$PVM],
7171abf7346Smrg		[Minor version of this package])
7181abf7346Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
7191abf7346Smrg	if test "x$PVP" = "x"; then
7201abf7346Smrg		PVP="0"
7211abf7346Smrg	fi
7221abf7346Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
7231abf7346Smrg		[$PVP],
7241abf7346Smrg		[Patch version of this package])
7251abf7346Smrg])
7261abf7346Smrg
7271abf7346Smrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
7281abf7346Smrg#
7291abf7346Smrg# This file is free software; the Free Software Foundation
7301abf7346Smrg# gives unlimited permission to copy and/or distribute it,
7311abf7346Smrg# with or without modifications, as long as this notice is preserved.
7321abf7346Smrg
7331abf7346Smrg# AM_AUTOMAKE_VERSION(VERSION)
7341abf7346Smrg# ----------------------------
7351abf7346Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
7361abf7346Smrg# generated from the m4 files accompanying Automake X.Y.
7371abf7346Smrg# (This private macro should not be called outside this file.)
7381abf7346SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
7391abf7346Smrg[am__api_version='1.10'
7401abf7346Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
7411abf7346Smrgdnl require some minimum version.  Point them to the right macro.
7421abf7346Smrgm4_if([$1], [1.10], [],
7431abf7346Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
7441abf7346Smrg])
7451abf7346Smrg
7461abf7346Smrg# _AM_AUTOCONF_VERSION(VERSION)
7471abf7346Smrg# -----------------------------
7481abf7346Smrg# aclocal traces this macro to find the Autoconf version.
7491abf7346Smrg# This is a private macro too.  Using m4_define simplifies
7501abf7346Smrg# the logic in aclocal, which can simply ignore this definition.
7511abf7346Smrgm4_define([_AM_AUTOCONF_VERSION], [])
7521abf7346Smrg
7531abf7346Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
7541abf7346Smrg# -------------------------------
7551abf7346Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
7561abf7346Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
7571abf7346SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
7581abf7346Smrg[AM_AUTOMAKE_VERSION([1.10])dnl
7591abf7346Smrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
7601abf7346Smrg
7611abf7346Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
7621abf7346Smrg
7631abf7346Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7641abf7346Smrg#
7651abf7346Smrg# This file is free software; the Free Software Foundation
7661abf7346Smrg# gives unlimited permission to copy and/or distribute it,
7671abf7346Smrg# with or without modifications, as long as this notice is preserved.
7681abf7346Smrg
7691abf7346Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
7701abf7346Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
7711abf7346Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
7721abf7346Smrg#
7731abf7346Smrg# Of course, Automake must honor this variable whenever it calls a
7741abf7346Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7751abf7346Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7761abf7346Smrg# depending on how configure is run.  This is pretty annoying, since
7771abf7346Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7781abf7346Smrg# source directory, any form will work fine, but in subdirectories a
7791abf7346Smrg# relative path needs to be adjusted first.
7801abf7346Smrg#
7811abf7346Smrg# $ac_aux_dir/missing
7821abf7346Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
7831abf7346Smrg# $top_srcdir/$ac_aux_dir/missing
7841abf7346Smrg#    fails if $ac_aux_dir is absolute,
7851abf7346Smrg#    fails when called from a subdirectory in a VPATH build with
7861abf7346Smrg#          a relative $ac_aux_dir
7871abf7346Smrg#
7881abf7346Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
7891abf7346Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
7901abf7346Smrg# harmless because $srcdir is `.', but things will broke when you
7911abf7346Smrg# start a VPATH build or use an absolute $srcdir.
7921abf7346Smrg#
7931abf7346Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
7941abf7346Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
7951abf7346Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
7961abf7346Smrg# and then we would define $MISSING as
7971abf7346Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
7981abf7346Smrg# This will work as long as MISSING is not called from configure, because
7991abf7346Smrg# unfortunately $(top_srcdir) has no meaning in configure.
8001abf7346Smrg# However there are other variables, like CC, which are often used in
8011abf7346Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
8021abf7346Smrg#
8031abf7346Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
8041abf7346Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
8051abf7346Smrg# configured tree to be moved without reconfiguration.
8061abf7346Smrg
8071abf7346SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
8081abf7346Smrg[dnl Rely on autoconf to set up CDPATH properly.
8091abf7346SmrgAC_PREREQ([2.50])dnl
8101abf7346Smrg# expand $ac_aux_dir to an absolute path
8111abf7346Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
8121abf7346Smrg])
8131abf7346Smrg
8141abf7346Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
8151abf7346Smrg
8161abf7346Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
8171abf7346Smrg# Free Software Foundation, Inc.
8181abf7346Smrg#
8191abf7346Smrg# This file is free software; the Free Software Foundation
8201abf7346Smrg# gives unlimited permission to copy and/or distribute it,
8211abf7346Smrg# with or without modifications, as long as this notice is preserved.
8221abf7346Smrg
8231abf7346Smrg# serial 8
8241abf7346Smrg
8251abf7346Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
8261abf7346Smrg# -------------------------------------
8271abf7346Smrg# Define a conditional.
8281abf7346SmrgAC_DEFUN([AM_CONDITIONAL],
8291abf7346Smrg[AC_PREREQ(2.52)dnl
8301abf7346Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
8311abf7346Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
8321abf7346SmrgAC_SUBST([$1_TRUE])dnl
8331abf7346SmrgAC_SUBST([$1_FALSE])dnl
8341abf7346Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
8351abf7346Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
8361abf7346Smrgif $2; then
8371abf7346Smrg  $1_TRUE=
8381abf7346Smrg  $1_FALSE='#'
8391abf7346Smrgelse
8401abf7346Smrg  $1_TRUE='#'
8411abf7346Smrg  $1_FALSE=
8421abf7346Smrgfi
8431abf7346SmrgAC_CONFIG_COMMANDS_PRE(
8441abf7346Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
8451abf7346Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
8461abf7346SmrgUsually this means the macro was only invoked conditionally.]])
8471abf7346Smrgfi])])
8481abf7346Smrg
8491abf7346Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
8501abf7346Smrg# Free Software Foundation, Inc.
8511abf7346Smrg#
8521abf7346Smrg# This file is free software; the Free Software Foundation
8531abf7346Smrg# gives unlimited permission to copy and/or distribute it,
8541abf7346Smrg# with or without modifications, as long as this notice is preserved.
8551abf7346Smrg
8561abf7346Smrg# serial 9
8571abf7346Smrg
8581abf7346Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
8591abf7346Smrg# written in clear, in which case automake, when reading aclocal.m4,
8601abf7346Smrg# will think it sees a *use*, and therefore will trigger all it's
8611abf7346Smrg# C support machinery.  Also note that it means that autoscan, seeing
8621abf7346Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
8631abf7346Smrg
8641abf7346Smrg
8651abf7346Smrg# _AM_DEPENDENCIES(NAME)
8661abf7346Smrg# ----------------------
8671abf7346Smrg# See how the compiler implements dependency checking.
8681abf7346Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
8691abf7346Smrg# We try a few techniques and use that to set a single cache variable.
8701abf7346Smrg#
8711abf7346Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
8721abf7346Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
8731abf7346Smrg# dependency, and given that the user is not expected to run this macro,
8741abf7346Smrg# just rely on AC_PROG_CC.
8751abf7346SmrgAC_DEFUN([_AM_DEPENDENCIES],
8761abf7346Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
8771abf7346SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
8781abf7346SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
8791abf7346SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
8801abf7346Smrg
8811abf7346Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
8821abf7346Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
8831abf7346Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
8841abf7346Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
8851abf7346Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
8861abf7346Smrg                   [depcc="$$1"   am_compiler_list=])
8871abf7346Smrg
8881abf7346SmrgAC_CACHE_CHECK([dependency style of $depcc],
8891abf7346Smrg               [am_cv_$1_dependencies_compiler_type],
8901abf7346Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
8911abf7346Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
8921abf7346Smrg  # making bogus files that we don't know about and never remove.  For
8931abf7346Smrg  # instance it was reported that on HP-UX the gcc test will end up
8941abf7346Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
8951abf7346Smrg  # in D'.
8961abf7346Smrg  mkdir conftest.dir
8971abf7346Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
8981abf7346Smrg  # using a relative directory.
8991abf7346Smrg  cp "$am_depcomp" conftest.dir
9001abf7346Smrg  cd conftest.dir
9011abf7346Smrg  # We will build objects and dependencies in a subdirectory because
9021abf7346Smrg  # it helps to detect inapplicable dependency modes.  For instance
9031abf7346Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
9041abf7346Smrg  # side effect of compilation, but ICC will put the dependencies in
9051abf7346Smrg  # the current directory while Tru64 will put them in the object
9061abf7346Smrg  # directory.
9071abf7346Smrg  mkdir sub
9081abf7346Smrg
9091abf7346Smrg  am_cv_$1_dependencies_compiler_type=none
9101abf7346Smrg  if test "$am_compiler_list" = ""; then
9111abf7346Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
9121abf7346Smrg  fi
9131abf7346Smrg  for depmode in $am_compiler_list; do
9141abf7346Smrg    # Setup a source with many dependencies, because some compilers
9151abf7346Smrg    # like to wrap large dependency lists on column 80 (with \), and
9161abf7346Smrg    # we should not choose a depcomp mode which is confused by this.
9171abf7346Smrg    #
9181abf7346Smrg    # We need to recreate these files for each test, as the compiler may
9191abf7346Smrg    # overwrite some of them when testing with obscure command lines.
9201abf7346Smrg    # This happens at least with the AIX C compiler.
9211abf7346Smrg    : > sub/conftest.c
9221abf7346Smrg    for i in 1 2 3 4 5 6; do
9231abf7346Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
9241abf7346Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
9251abf7346Smrg      # Solaris 8's {/usr,}/bin/sh.
9261abf7346Smrg      touch sub/conftst$i.h
9271abf7346Smrg    done
9281abf7346Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
9291abf7346Smrg
9301abf7346Smrg    case $depmode in
9311abf7346Smrg    nosideeffect)
9321abf7346Smrg      # after this tag, mechanisms are not by side-effect, so they'll
9331abf7346Smrg      # only be used when explicitly requested
9341abf7346Smrg      if test "x$enable_dependency_tracking" = xyes; then
9351abf7346Smrg	continue
9361abf7346Smrg      else
9371abf7346Smrg	break
9381abf7346Smrg      fi
9391abf7346Smrg      ;;
9401abf7346Smrg    none) break ;;
9411abf7346Smrg    esac
9421abf7346Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
9431abf7346Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
9441abf7346Smrg    # handle `-M -o', and we need to detect this.
9451abf7346Smrg    if depmode=$depmode \
9461abf7346Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
9471abf7346Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
9481abf7346Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
9491abf7346Smrg         >/dev/null 2>conftest.err &&
9501abf7346Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
9511abf7346Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
9521abf7346Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
9531abf7346Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
9541abf7346Smrg      # icc doesn't choke on unknown options, it will just issue warnings
9551abf7346Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
9561abf7346Smrg      # that says an option was ignored or not supported.
9571abf7346Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
9581abf7346Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
9591abf7346Smrg      # The diagnosis changed in icc 8.0:
9601abf7346Smrg      #   icc: Command line remark: option '-MP' not supported
9611abf7346Smrg      if (grep 'ignoring option' conftest.err ||
9621abf7346Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
9631abf7346Smrg        am_cv_$1_dependencies_compiler_type=$depmode
9641abf7346Smrg        break
9651abf7346Smrg      fi
9661abf7346Smrg    fi
9671abf7346Smrg  done
9681abf7346Smrg
9691abf7346Smrg  cd ..
9701abf7346Smrg  rm -rf conftest.dir
9711abf7346Smrgelse
9721abf7346Smrg  am_cv_$1_dependencies_compiler_type=none
9731abf7346Smrgfi
9741abf7346Smrg])
9751abf7346SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
9761abf7346SmrgAM_CONDITIONAL([am__fastdep$1], [
9771abf7346Smrg  test "x$enable_dependency_tracking" != xno \
9781abf7346Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
9791abf7346Smrg])
9801abf7346Smrg
9811abf7346Smrg
9821abf7346Smrg# AM_SET_DEPDIR
9831abf7346Smrg# -------------
9841abf7346Smrg# Choose a directory name for dependency files.
9851abf7346Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
9861abf7346SmrgAC_DEFUN([AM_SET_DEPDIR],
9871abf7346Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
9881abf7346SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
9891abf7346Smrg])
9901abf7346Smrg
9911abf7346Smrg
9921abf7346Smrg# AM_DEP_TRACK
9931abf7346Smrg# ------------
9941abf7346SmrgAC_DEFUN([AM_DEP_TRACK],
9951abf7346Smrg[AC_ARG_ENABLE(dependency-tracking,
9961abf7346Smrg[  --disable-dependency-tracking  speeds up one-time build
9971abf7346Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
9981abf7346Smrgif test "x$enable_dependency_tracking" != xno; then
9991abf7346Smrg  am_depcomp="$ac_aux_dir/depcomp"
10001abf7346Smrg  AMDEPBACKSLASH='\'
10011abf7346Smrgfi
10021abf7346SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
10031abf7346SmrgAC_SUBST([AMDEPBACKSLASH])dnl
10041abf7346Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
10051abf7346Smrg])
10061abf7346Smrg
10071abf7346Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
10081abf7346Smrg
10091abf7346Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
10101abf7346Smrg# Free Software Foundation, Inc.
10111abf7346Smrg#
10121abf7346Smrg# This file is free software; the Free Software Foundation
10131abf7346Smrg# gives unlimited permission to copy and/or distribute it,
10141abf7346Smrg# with or without modifications, as long as this notice is preserved.
10151abf7346Smrg
10161abf7346Smrg#serial 3
10171abf7346Smrg
10181abf7346Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
10191abf7346Smrg# ------------------------------
10201abf7346SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
10211abf7346Smrg[for mf in $CONFIG_FILES; do
10221abf7346Smrg  # Strip MF so we end up with the name of the file.
10231abf7346Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
10241abf7346Smrg  # Check whether this is an Automake generated Makefile or not.
10251abf7346Smrg  # We used to match only the files named `Makefile.in', but
10261abf7346Smrg  # some people rename them; so instead we look at the file content.
10271abf7346Smrg  # Grep'ing the first line is not enough: some people post-process
10281abf7346Smrg  # each Makefile.in and add a new line on top of each file to say so.
10291abf7346Smrg  # Grep'ing the whole file is not good either: AIX grep has a line
10301abf7346Smrg  # limit of 2048, but all sed's we know have understand at least 4000.
10311abf7346Smrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
10321abf7346Smrg    dirpart=`AS_DIRNAME("$mf")`
10331abf7346Smrg  else
10341abf7346Smrg    continue
10351abf7346Smrg  fi
10361abf7346Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
10371abf7346Smrg  # from the Makefile without running `make'.
10381abf7346Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
10391abf7346Smrg  test -z "$DEPDIR" && continue
10401abf7346Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
10411abf7346Smrg  test -z "am__include" && continue
10421abf7346Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
10431abf7346Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
10441abf7346Smrg  U=`sed -n 's/^U = //p' < "$mf"`
10451abf7346Smrg  # Find all dependency output files, they are included files with
10461abf7346Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
10471abf7346Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
10481abf7346Smrg  # expansion.
10491abf7346Smrg  for file in `sed -n "
10501abf7346Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
10511abf7346Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
10521abf7346Smrg    # Make sure the directory exists.
10531abf7346Smrg    test -f "$dirpart/$file" && continue
10541abf7346Smrg    fdir=`AS_DIRNAME(["$file"])`
10551abf7346Smrg    AS_MKDIR_P([$dirpart/$fdir])
10561abf7346Smrg    # echo "creating $dirpart/$file"
10571abf7346Smrg    echo '# dummy' > "$dirpart/$file"
10581abf7346Smrg  done
10591abf7346Smrgdone
10601abf7346Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
10611abf7346Smrg
10621abf7346Smrg
10631abf7346Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
10641abf7346Smrg# -----------------------------
10651abf7346Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
10661abf7346Smrg#
10671abf7346Smrg# This code is only required when automatic dependency tracking
10681abf7346Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
10691abf7346Smrg# need in order to bootstrap the dependency handling code.
10701abf7346SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
10711abf7346Smrg[AC_CONFIG_COMMANDS([depfiles],
10721abf7346Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
10731abf7346Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
10741abf7346Smrg])
10751abf7346Smrg
10761abf7346Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
10771abf7346Smrg# Free Software Foundation, Inc.
10781abf7346Smrg#
10791abf7346Smrg# This file is free software; the Free Software Foundation
10801abf7346Smrg# gives unlimited permission to copy and/or distribute it,
10811abf7346Smrg# with or without modifications, as long as this notice is preserved.
10821abf7346Smrg
10831abf7346Smrg# serial 8
10841abf7346Smrg
10851abf7346Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
10861abf7346SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
10871abf7346Smrg
10881abf7346Smrg# Do all the work for Automake.                             -*- Autoconf -*-
10891abf7346Smrg
10901abf7346Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
10911abf7346Smrg# 2005, 2006 Free Software Foundation, Inc.
10921abf7346Smrg#
10931abf7346Smrg# This file is free software; the Free Software Foundation
10941abf7346Smrg# gives unlimited permission to copy and/or distribute it,
10951abf7346Smrg# with or without modifications, as long as this notice is preserved.
10961abf7346Smrg
10971abf7346Smrg# serial 12
10981abf7346Smrg
10991abf7346Smrg# This macro actually does too much.  Some checks are only needed if
11001abf7346Smrg# your package does certain things.  But this isn't really a big deal.
11011abf7346Smrg
11021abf7346Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
11031abf7346Smrg# AM_INIT_AUTOMAKE([OPTIONS])
11041abf7346Smrg# -----------------------------------------------
11051abf7346Smrg# The call with PACKAGE and VERSION arguments is the old style
11061abf7346Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
11071abf7346Smrg# and VERSION should now be passed to AC_INIT and removed from
11081abf7346Smrg# the call to AM_INIT_AUTOMAKE.
11091abf7346Smrg# We support both call styles for the transition.  After
11101abf7346Smrg# the next Automake release, Autoconf can make the AC_INIT
11111abf7346Smrg# arguments mandatory, and then we can depend on a new Autoconf
11121abf7346Smrg# release and drop the old call support.
11131abf7346SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
11141abf7346Smrg[AC_PREREQ([2.60])dnl
11151abf7346Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
11161abf7346Smrgdnl the ones we care about.
11171abf7346Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
11181abf7346SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
11191abf7346SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
11201abf7346Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
11211abf7346Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
11221abf7346Smrg  # is not polluted with repeated "-I."
11231abf7346Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
11241abf7346Smrg  # test to see if srcdir already configured
11251abf7346Smrg  if test -f $srcdir/config.status; then
11261abf7346Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
11271abf7346Smrg  fi
11281abf7346Smrgfi
11291abf7346Smrg
11301abf7346Smrg# test whether we have cygpath
11311abf7346Smrgif test -z "$CYGPATH_W"; then
11321abf7346Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
11331abf7346Smrg    CYGPATH_W='cygpath -w'
11341abf7346Smrg  else
11351abf7346Smrg    CYGPATH_W=echo
11361abf7346Smrg  fi
11371abf7346Smrgfi
11381abf7346SmrgAC_SUBST([CYGPATH_W])
11391abf7346Smrg
11401abf7346Smrg# Define the identity of the package.
11411abf7346Smrgdnl Distinguish between old-style and new-style calls.
11421abf7346Smrgm4_ifval([$2],
11431abf7346Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
11441abf7346Smrg AC_SUBST([PACKAGE], [$1])dnl
11451abf7346Smrg AC_SUBST([VERSION], [$2])],
11461abf7346Smrg[_AM_SET_OPTIONS([$1])dnl
11471abf7346Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
11481abf7346Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
11491abf7346Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
11501abf7346Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
11511abf7346Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11521abf7346Smrg
11531abf7346Smrg_AM_IF_OPTION([no-define],,
11541abf7346Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
11551abf7346Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
11561abf7346Smrg
11571abf7346Smrg# Some tools Automake needs.
11581abf7346SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
11591abf7346SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
11601abf7346SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
11611abf7346SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
11621abf7346SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
11631abf7346SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
11641abf7346SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
11651abf7346SmrgAM_PROG_INSTALL_SH
11661abf7346SmrgAM_PROG_INSTALL_STRIP
11671abf7346SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
11681abf7346Smrg# We need awk for the "check" target.  The system "awk" is bad on
11691abf7346Smrg# some platforms.
11701abf7346SmrgAC_REQUIRE([AC_PROG_AWK])dnl
11711abf7346SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
11721abf7346SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
11731abf7346Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
11741abf7346Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
11751abf7346Smrg	      		     [_AM_PROG_TAR([v7])])])
11761abf7346Smrg_AM_IF_OPTION([no-dependencies],,
11771abf7346Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
11781abf7346Smrg                  [_AM_DEPENDENCIES(CC)],
11791abf7346Smrg                  [define([AC_PROG_CC],
11801abf7346Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
11811abf7346SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
11821abf7346Smrg                  [_AM_DEPENDENCIES(CXX)],
11831abf7346Smrg                  [define([AC_PROG_CXX],
11841abf7346Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
11851abf7346SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
11861abf7346Smrg                  [_AM_DEPENDENCIES(OBJC)],
11871abf7346Smrg                  [define([AC_PROG_OBJC],
11881abf7346Smrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
11891abf7346Smrg])
11901abf7346Smrg])
11911abf7346Smrg
11921abf7346Smrg
11931abf7346Smrg# When config.status generates a header, we must update the stamp-h file.
11941abf7346Smrg# This file resides in the same directory as the config header
11951abf7346Smrg# that is generated.  The stamp files are numbered to have different names.
11961abf7346Smrg
11971abf7346Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
11981abf7346Smrg# loop where config.status creates the headers, so we can generate
11991abf7346Smrg# our stamp files there.
12001abf7346SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
12011abf7346Smrg[# Compute $1's index in $config_headers.
12021abf7346Smrg_am_stamp_count=1
12031abf7346Smrgfor _am_header in $config_headers :; do
12041abf7346Smrg  case $_am_header in
12051abf7346Smrg    $1 | $1:* )
12061abf7346Smrg      break ;;
12071abf7346Smrg    * )
12081abf7346Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
12091abf7346Smrg  esac
12101abf7346Smrgdone
12111abf7346Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
12121abf7346Smrg
12131abf7346Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
12141abf7346Smrg#
12151abf7346Smrg# This file is free software; the Free Software Foundation
12161abf7346Smrg# gives unlimited permission to copy and/or distribute it,
12171abf7346Smrg# with or without modifications, as long as this notice is preserved.
12181abf7346Smrg
12191abf7346Smrg# AM_PROG_INSTALL_SH
12201abf7346Smrg# ------------------
12211abf7346Smrg# Define $install_sh.
12221abf7346SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
12231abf7346Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
12241abf7346Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
12251abf7346SmrgAC_SUBST(install_sh)])
12261abf7346Smrg
12271abf7346Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
12281abf7346Smrg#
12291abf7346Smrg# This file is free software; the Free Software Foundation
12301abf7346Smrg# gives unlimited permission to copy and/or distribute it,
12311abf7346Smrg# with or without modifications, as long as this notice is preserved.
12321abf7346Smrg
12331abf7346Smrg# serial 2
12341abf7346Smrg
12351abf7346Smrg# Check whether the underlying file-system supports filenames
12361abf7346Smrg# with a leading dot.  For instance MS-DOS doesn't.
12371abf7346SmrgAC_DEFUN([AM_SET_LEADING_DOT],
12381abf7346Smrg[rm -rf .tst 2>/dev/null
12391abf7346Smrgmkdir .tst 2>/dev/null
12401abf7346Smrgif test -d .tst; then
12411abf7346Smrg  am__leading_dot=.
12421abf7346Smrgelse
12431abf7346Smrg  am__leading_dot=_
12441abf7346Smrgfi
12451abf7346Smrgrmdir .tst 2>/dev/null
12461abf7346SmrgAC_SUBST([am__leading_dot])])
12471abf7346Smrg
12481abf7346Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
12491abf7346Smrg# From Jim Meyering
12501abf7346Smrg
12511abf7346Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
12521abf7346Smrg# Free Software Foundation, Inc.
12531abf7346Smrg#
12541abf7346Smrg# This file is free software; the Free Software Foundation
12551abf7346Smrg# gives unlimited permission to copy and/or distribute it,
12561abf7346Smrg# with or without modifications, as long as this notice is preserved.
12571abf7346Smrg
12581abf7346Smrg# serial 4
12591abf7346Smrg
12601abf7346SmrgAC_DEFUN([AM_MAINTAINER_MODE],
12611abf7346Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
12621abf7346Smrg  dnl maintainer-mode is disabled by default
12631abf7346Smrg  AC_ARG_ENABLE(maintainer-mode,
12641abf7346Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
12651abf7346Smrg			  (and sometimes confusing) to the casual installer],
12661abf7346Smrg      USE_MAINTAINER_MODE=$enableval,
12671abf7346Smrg      USE_MAINTAINER_MODE=no)
12681abf7346Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
12691abf7346Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
12701abf7346Smrg  MAINT=$MAINTAINER_MODE_TRUE
12711abf7346Smrg  AC_SUBST(MAINT)dnl
12721abf7346Smrg]
12731abf7346Smrg)
12741abf7346Smrg
12751abf7346SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
12761abf7346Smrg
12771abf7346Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
12781abf7346Smrg
12791abf7346Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
12801abf7346Smrg#
12811abf7346Smrg# This file is free software; the Free Software Foundation
12821abf7346Smrg# gives unlimited permission to copy and/or distribute it,
12831abf7346Smrg# with or without modifications, as long as this notice is preserved.
12841abf7346Smrg
12851abf7346Smrg# serial 3
12861abf7346Smrg
12871abf7346Smrg# AM_MAKE_INCLUDE()
12881abf7346Smrg# -----------------
12891abf7346Smrg# Check to see how make treats includes.
12901abf7346SmrgAC_DEFUN([AM_MAKE_INCLUDE],
12911abf7346Smrg[am_make=${MAKE-make}
12921abf7346Smrgcat > confinc << 'END'
12931abf7346Smrgam__doit:
12941abf7346Smrg	@echo done
12951abf7346Smrg.PHONY: am__doit
12961abf7346SmrgEND
12971abf7346Smrg# If we don't find an include directive, just comment out the code.
12981abf7346SmrgAC_MSG_CHECKING([for style of include used by $am_make])
12991abf7346Smrgam__include="#"
13001abf7346Smrgam__quote=
13011abf7346Smrg_am_result=none
13021abf7346Smrg# First try GNU make style include.
13031abf7346Smrgecho "include confinc" > confmf
13041abf7346Smrg# We grep out `Entering directory' and `Leaving directory'
13051abf7346Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
13061abf7346Smrg# In particular we don't look at `^make:' because GNU make might
13071abf7346Smrg# be invoked under some other name (usually "gmake"), in which
13081abf7346Smrg# case it prints its new name instead of `make'.
13091abf7346Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
13101abf7346Smrg   am__include=include
13111abf7346Smrg   am__quote=
13121abf7346Smrg   _am_result=GNU
13131abf7346Smrgfi
13141abf7346Smrg# Now try BSD make style include.
13151abf7346Smrgif test "$am__include" = "#"; then
13161abf7346Smrg   echo '.include "confinc"' > confmf
13171abf7346Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
13181abf7346Smrg      am__include=.include
13191abf7346Smrg      am__quote="\""
13201abf7346Smrg      _am_result=BSD
13211abf7346Smrg   fi
13221abf7346Smrgfi
13231abf7346SmrgAC_SUBST([am__include])
13241abf7346SmrgAC_SUBST([am__quote])
13251abf7346SmrgAC_MSG_RESULT([$_am_result])
13261abf7346Smrgrm -f confinc confmf
13271abf7346Smrg])
13281abf7346Smrg
13291abf7346Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
13301abf7346Smrg
13311abf7346Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
13321abf7346Smrg# Free Software Foundation, Inc.
13331abf7346Smrg#
13341abf7346Smrg# This file is free software; the Free Software Foundation
13351abf7346Smrg# gives unlimited permission to copy and/or distribute it,
13361abf7346Smrg# with or without modifications, as long as this notice is preserved.
13371abf7346Smrg
13381abf7346Smrg# serial 5
13391abf7346Smrg
13401abf7346Smrg# AM_MISSING_PROG(NAME, PROGRAM)
13411abf7346Smrg# ------------------------------
13421abf7346SmrgAC_DEFUN([AM_MISSING_PROG],
13431abf7346Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
13441abf7346Smrg$1=${$1-"${am_missing_run}$2"}
13451abf7346SmrgAC_SUBST($1)])
13461abf7346Smrg
13471abf7346Smrg
13481abf7346Smrg# AM_MISSING_HAS_RUN
13491abf7346Smrg# ------------------
13501abf7346Smrg# Define MISSING if not defined so far and test if it supports --run.
13511abf7346Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
13521abf7346SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
13531abf7346Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
13541abf7346SmrgAC_REQUIRE_AUX_FILE([missing])dnl
13551abf7346Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
13561abf7346Smrg# Use eval to expand $SHELL
13571abf7346Smrgif eval "$MISSING --run true"; then
13581abf7346Smrg  am_missing_run="$MISSING --run "
13591abf7346Smrgelse
13601abf7346Smrg  am_missing_run=
13611abf7346Smrg  AC_MSG_WARN([`missing' script is too old or missing])
13621abf7346Smrgfi
13631abf7346Smrg])
13641abf7346Smrg
13651abf7346Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
13661abf7346Smrg#
13671abf7346Smrg# This file is free software; the Free Software Foundation
13681abf7346Smrg# gives unlimited permission to copy and/or distribute it,
13691abf7346Smrg# with or without modifications, as long as this notice is preserved.
13701abf7346Smrg
13711abf7346Smrg# AM_PROG_MKDIR_P
13721abf7346Smrg# ---------------
13731abf7346Smrg# Check for `mkdir -p'.
13741abf7346SmrgAC_DEFUN([AM_PROG_MKDIR_P],
13751abf7346Smrg[AC_PREREQ([2.60])dnl
13761abf7346SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
13771abf7346Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
13781abf7346Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
13791abf7346Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
13801abf7346Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
13811abf7346Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
13821abf7346Smrgdnl adjustment using top_builddir (which is defined more often than
13831abf7346Smrgdnl MKDIR_P).
13841abf7346SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
13851abf7346Smrgcase $mkdir_p in
13861abf7346Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
13871abf7346Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
13881abf7346Smrgesac
13891abf7346Smrg])
13901abf7346Smrg
13911abf7346Smrg# Helper functions for option handling.                     -*- Autoconf -*-
13921abf7346Smrg
13931abf7346Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
13941abf7346Smrg#
13951abf7346Smrg# This file is free software; the Free Software Foundation
13961abf7346Smrg# gives unlimited permission to copy and/or distribute it,
13971abf7346Smrg# with or without modifications, as long as this notice is preserved.
13981abf7346Smrg
13991abf7346Smrg# serial 3
14001abf7346Smrg
14011abf7346Smrg# _AM_MANGLE_OPTION(NAME)
14021abf7346Smrg# -----------------------
14031abf7346SmrgAC_DEFUN([_AM_MANGLE_OPTION],
14041abf7346Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
14051abf7346Smrg
14061abf7346Smrg# _AM_SET_OPTION(NAME)
14071abf7346Smrg# ------------------------------
14081abf7346Smrg# Set option NAME.  Presently that only means defining a flag for this option.
14091abf7346SmrgAC_DEFUN([_AM_SET_OPTION],
14101abf7346Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
14111abf7346Smrg
14121abf7346Smrg# _AM_SET_OPTIONS(OPTIONS)
14131abf7346Smrg# ----------------------------------
14141abf7346Smrg# OPTIONS is a space-separated list of Automake options.
14151abf7346SmrgAC_DEFUN([_AM_SET_OPTIONS],
14161abf7346Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
14171abf7346Smrg
14181abf7346Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
14191abf7346Smrg# -------------------------------------------
14201abf7346Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
14211abf7346SmrgAC_DEFUN([_AM_IF_OPTION],
14221abf7346Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
14231abf7346Smrg
14241abf7346Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
14251abf7346Smrg
14261abf7346Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
14271abf7346Smrg# Free Software Foundation, Inc.
14281abf7346Smrg#
14291abf7346Smrg# This file is free software; the Free Software Foundation
14301abf7346Smrg# gives unlimited permission to copy and/or distribute it,
14311abf7346Smrg# with or without modifications, as long as this notice is preserved.
14321abf7346Smrg
14331abf7346Smrg# serial 4
14341abf7346Smrg
14351abf7346Smrg# AM_SANITY_CHECK
14361abf7346Smrg# ---------------
14371abf7346SmrgAC_DEFUN([AM_SANITY_CHECK],
14381abf7346Smrg[AC_MSG_CHECKING([whether build environment is sane])
14391abf7346Smrg# Just in case
14401abf7346Smrgsleep 1
14411abf7346Smrgecho timestamp > conftest.file
14421abf7346Smrg# Do `set' in a subshell so we don't clobber the current shell's
14431abf7346Smrg# arguments.  Must try -L first in case configure is actually a
14441abf7346Smrg# symlink; some systems play weird games with the mod time of symlinks
14451abf7346Smrg# (eg FreeBSD returns the mod time of the symlink's containing
14461abf7346Smrg# directory).
14471abf7346Smrgif (
14481abf7346Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
14491abf7346Smrg   if test "$[*]" = "X"; then
14501abf7346Smrg      # -L didn't work.
14511abf7346Smrg      set X `ls -t $srcdir/configure conftest.file`
14521abf7346Smrg   fi
14531abf7346Smrg   rm -f conftest.file
14541abf7346Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
14551abf7346Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
14561abf7346Smrg
14571abf7346Smrg      # If neither matched, then we have a broken ls.  This can happen
14581abf7346Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
14591abf7346Smrg      # broken ls alias from the environment.  This has actually
14601abf7346Smrg      # happened.  Such a system could not be considered "sane".
14611abf7346Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
14621abf7346Smrgalias in your environment])
14631abf7346Smrg   fi
14641abf7346Smrg
14651abf7346Smrg   test "$[2]" = conftest.file
14661abf7346Smrg   )
14671abf7346Smrgthen
14681abf7346Smrg   # Ok.
14691abf7346Smrg   :
14701abf7346Smrgelse
14711abf7346Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
14721abf7346SmrgCheck your system clock])
14731abf7346Smrgfi
14741abf7346SmrgAC_MSG_RESULT(yes)])
14751abf7346Smrg
14761abf7346Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
14771abf7346Smrg#
14781abf7346Smrg# This file is free software; the Free Software Foundation
14791abf7346Smrg# gives unlimited permission to copy and/or distribute it,
14801abf7346Smrg# with or without modifications, as long as this notice is preserved.
14811abf7346Smrg
14821abf7346Smrg# AM_PROG_INSTALL_STRIP
14831abf7346Smrg# ---------------------
14841abf7346Smrg# One issue with vendor `install' (even GNU) is that you can't
14851abf7346Smrg# specify the program used to strip binaries.  This is especially
14861abf7346Smrg# annoying in cross-compiling environments, where the build's strip
14871abf7346Smrg# is unlikely to handle the host's binaries.
14881abf7346Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
14891abf7346Smrg# always use install-sh in `make install-strip', and initialize
14901abf7346Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
14911abf7346SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
14921abf7346Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
14931abf7346Smrg# Installed binaries are usually stripped using `strip' when the user
14941abf7346Smrg# run `make install-strip'.  However `strip' might not be the right
14951abf7346Smrg# tool to use in cross-compilation environments, therefore Automake
14961abf7346Smrg# will honor the `STRIP' environment variable to overrule this program.
14971abf7346Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
14981abf7346Smrgif test "$cross_compiling" != no; then
14991abf7346Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
15001abf7346Smrgfi
15011abf7346SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
15021abf7346SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
15031abf7346Smrg
15041abf7346Smrg# Copyright (C) 2006  Free Software Foundation, Inc.
15051abf7346Smrg#
15061abf7346Smrg# This file is free software; the Free Software Foundation
15071abf7346Smrg# gives unlimited permission to copy and/or distribute it,
15081abf7346Smrg# with or without modifications, as long as this notice is preserved.
15091abf7346Smrg
15101abf7346Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
15111abf7346Smrg# ---------------------------
15121abf7346Smrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
15131abf7346Smrg# This macro is traced by Automake.
15141abf7346SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
15151abf7346Smrg
15161abf7346Smrg# Check how to create a tarball.                            -*- Autoconf -*-
15171abf7346Smrg
15181abf7346Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
15191abf7346Smrg#
15201abf7346Smrg# This file is free software; the Free Software Foundation
15211abf7346Smrg# gives unlimited permission to copy and/or distribute it,
15221abf7346Smrg# with or without modifications, as long as this notice is preserved.
15231abf7346Smrg
15241abf7346Smrg# serial 2
15251abf7346Smrg
15261abf7346Smrg# _AM_PROG_TAR(FORMAT)
15271abf7346Smrg# --------------------
15281abf7346Smrg# Check how to create a tarball in format FORMAT.
15291abf7346Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
15301abf7346Smrg#
15311abf7346Smrg# Substitute a variable $(am__tar) that is a command
15321abf7346Smrg# writing to stdout a FORMAT-tarball containing the directory
15331abf7346Smrg# $tardir.
15341abf7346Smrg#     tardir=directory && $(am__tar) > result.tar
15351abf7346Smrg#
15361abf7346Smrg# Substitute a variable $(am__untar) that extract such
15371abf7346Smrg# a tarball read from stdin.
15381abf7346Smrg#     $(am__untar) < result.tar
15391abf7346SmrgAC_DEFUN([_AM_PROG_TAR],
15401abf7346Smrg[# Always define AMTAR for backward compatibility.
15411abf7346SmrgAM_MISSING_PROG([AMTAR], [tar])
15421abf7346Smrgm4_if([$1], [v7],
15431abf7346Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
15441abf7346Smrg     [m4_case([$1], [ustar],, [pax],,
15451abf7346Smrg              [m4_fatal([Unknown tar format])])
15461abf7346SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
15471abf7346Smrg# Loop over all known methods to create a tar archive until one works.
15481abf7346Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
15491abf7346Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
15501abf7346Smrg# Do not fold the above two line into one, because Tru64 sh and
15511abf7346Smrg# Solaris sh will not grok spaces in the rhs of `-'.
15521abf7346Smrgfor _am_tool in $_am_tools
15531abf7346Smrgdo
15541abf7346Smrg  case $_am_tool in
15551abf7346Smrg  gnutar)
15561abf7346Smrg    for _am_tar in tar gnutar gtar;
15571abf7346Smrg    do
15581abf7346Smrg      AM_RUN_LOG([$_am_tar --version]) && break
15591abf7346Smrg    done
15601abf7346Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
15611abf7346Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
15621abf7346Smrg    am__untar="$_am_tar -xf -"
15631abf7346Smrg    ;;
15641abf7346Smrg  plaintar)
15651abf7346Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
15661abf7346Smrg    # ustar tarball either.
15671abf7346Smrg    (tar --version) >/dev/null 2>&1 && continue
15681abf7346Smrg    am__tar='tar chf - "$$tardir"'
15691abf7346Smrg    am__tar_='tar chf - "$tardir"'
15701abf7346Smrg    am__untar='tar xf -'
15711abf7346Smrg    ;;
15721abf7346Smrg  pax)
15731abf7346Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
15741abf7346Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
15751abf7346Smrg    am__untar='pax -r'
15761abf7346Smrg    ;;
15771abf7346Smrg  cpio)
15781abf7346Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
15791abf7346Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
15801abf7346Smrg    am__untar='cpio -i -H $1 -d'
15811abf7346Smrg    ;;
15821abf7346Smrg  none)
15831abf7346Smrg    am__tar=false
15841abf7346Smrg    am__tar_=false
15851abf7346Smrg    am__untar=false
15861abf7346Smrg    ;;
15871abf7346Smrg  esac
15881abf7346Smrg
15891abf7346Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
15901abf7346Smrg  # and am__untar set.
15911abf7346Smrg  test -n "${am_cv_prog_tar_$1}" && break
15921abf7346Smrg
15931abf7346Smrg  # tar/untar a dummy directory, and stop if the command works
15941abf7346Smrg  rm -rf conftest.dir
15951abf7346Smrg  mkdir conftest.dir
15961abf7346Smrg  echo GrepMe > conftest.dir/file
15971abf7346Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
15981abf7346Smrg  rm -rf conftest.dir
15991abf7346Smrg  if test -s conftest.tar; then
16001abf7346Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
16011abf7346Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
16021abf7346Smrg  fi
16031abf7346Smrgdone
16041abf7346Smrgrm -rf conftest.dir
16051abf7346Smrg
16061abf7346SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
16071abf7346SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
16081abf7346SmrgAC_SUBST([am__tar])
16091abf7346SmrgAC_SUBST([am__untar])
16101abf7346Smrg]) # _AM_PROG_TAR
16111abf7346Smrg
1612