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