aclocal.m4 revision f14f4646
1f14f4646Smrg# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
25dfecf96Smrg
35dfecf96Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4f14f4646Smrg# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
55dfecf96Smrg# This file is free software; the Free Software Foundation
65dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
75dfecf96Smrg# with or without modifications, as long as this notice is preserved.
85dfecf96Smrg
95dfecf96Smrg# This program is distributed in the hope that it will be useful,
105dfecf96Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
115dfecf96Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
125dfecf96Smrg# PARTICULAR PURPOSE.
135dfecf96Smrg
14f14f4646Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15f14f4646Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16f14f4646Smrgm4_if(AC_AUTOCONF_VERSION, [2.63],,
17f14f4646Smrg[m4_warning([this file was generated for autoconf 2.63.
18f14f4646SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19f14f4646SmrgIf you have problems, you may need to regenerate the build system entirely.
20f14f4646SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21f14f4646Smrg
225dfecf96Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
235dfecf96Smrg# 
245dfecf96Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
255dfecf96Smrg#
265dfecf96Smrg# This program is free software; you can redistribute it and/or modify
275dfecf96Smrg# it under the terms of the GNU General Public License as published by
285dfecf96Smrg# the Free Software Foundation; either version 2 of the License, or
295dfecf96Smrg# (at your option) any later version.
305dfecf96Smrg#
315dfecf96Smrg# This program is distributed in the hope that it will be useful, but
325dfecf96Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
335dfecf96Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
345dfecf96Smrg# General Public License for more details.
355dfecf96Smrg#
365dfecf96Smrg# You should have received a copy of the GNU General Public License
375dfecf96Smrg# along with this program; if not, write to the Free Software
385dfecf96Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
395dfecf96Smrg#
405dfecf96Smrg# As a special exception to the GNU General Public License, if you
415dfecf96Smrg# distribute this file as part of a program that contains a
425dfecf96Smrg# configuration script generated by Autoconf, you may include it under
435dfecf96Smrg# the same distribution terms that you use for the rest of that program.
445dfecf96Smrg
455dfecf96Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
465dfecf96Smrg# ----------------------------------
475dfecf96SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
485dfecf96Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
495dfecf96Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
505dfecf96SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
515dfecf96Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
525dfecf96Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
535dfecf96Smrgfi
545dfecf96Smrgif test -n "$PKG_CONFIG"; then
555dfecf96Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
565dfecf96Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
575dfecf96Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
585dfecf96Smrg		AC_MSG_RESULT([yes])
595dfecf96Smrg	else
605dfecf96Smrg		AC_MSG_RESULT([no])
615dfecf96Smrg		PKG_CONFIG=""
625dfecf96Smrg	fi
635dfecf96Smrg		
645dfecf96Smrgfi[]dnl
655dfecf96Smrg])# PKG_PROG_PKG_CONFIG
665dfecf96Smrg
675dfecf96Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
685dfecf96Smrg#
695dfecf96Smrg# Check to see whether a particular set of modules exists.  Similar
705dfecf96Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
715dfecf96Smrg#
725dfecf96Smrg#
735dfecf96Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
745dfecf96Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
755dfecf96Smrg# PKG_CHECK_EXISTS manually
765dfecf96Smrg# --------------------------------------------------------------
775dfecf96SmrgAC_DEFUN([PKG_CHECK_EXISTS],
785dfecf96Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
795dfecf96Smrgif test -n "$PKG_CONFIG" && \
805dfecf96Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
815dfecf96Smrg  m4_ifval([$2], [$2], [:])
825dfecf96Smrgm4_ifvaln([$3], [else
835dfecf96Smrg  $3])dnl
845dfecf96Smrgfi])
855dfecf96Smrg
865dfecf96Smrg
875dfecf96Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
885dfecf96Smrg# ---------------------------------------------
895dfecf96Smrgm4_define([_PKG_CONFIG],
90f14f4646Smrg[if test -n "$$1"; then
91f14f4646Smrg    pkg_cv_[]$1="$$1"
92f14f4646Smrg elif test -n "$PKG_CONFIG"; then
93f14f4646Smrg    PKG_CHECK_EXISTS([$3],
94f14f4646Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
95f14f4646Smrg		     [pkg_failed=yes])
96f14f4646Smrg else
97f14f4646Smrg    pkg_failed=untried
985dfecf96Smrgfi[]dnl
995dfecf96Smrg])# _PKG_CONFIG
1005dfecf96Smrg
1015dfecf96Smrg# _PKG_SHORT_ERRORS_SUPPORTED
1025dfecf96Smrg# -----------------------------
1035dfecf96SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1045dfecf96Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1055dfecf96Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1065dfecf96Smrg        _pkg_short_errors_supported=yes
1075dfecf96Smrgelse
1085dfecf96Smrg        _pkg_short_errors_supported=no
1095dfecf96Smrgfi[]dnl
1105dfecf96Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
1115dfecf96Smrg
1125dfecf96Smrg
1135dfecf96Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1145dfecf96Smrg# [ACTION-IF-NOT-FOUND])
1155dfecf96Smrg#
1165dfecf96Smrg#
1175dfecf96Smrg# Note that if there is a possibility the first call to
1185dfecf96Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
1195dfecf96Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1205dfecf96Smrg#
1215dfecf96Smrg#
1225dfecf96Smrg# --------------------------------------------------------------
1235dfecf96SmrgAC_DEFUN([PKG_CHECK_MODULES],
1245dfecf96Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1255dfecf96SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1265dfecf96SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1275dfecf96Smrg
1285dfecf96Smrgpkg_failed=no
1295dfecf96SmrgAC_MSG_CHECKING([for $1])
1305dfecf96Smrg
1315dfecf96Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1325dfecf96Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1335dfecf96Smrg
1345dfecf96Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1355dfecf96Smrgand $1[]_LIBS to avoid the need to call pkg-config.
1365dfecf96SmrgSee the pkg-config man page for more details.])
1375dfecf96Smrg
1385dfecf96Smrgif test $pkg_failed = yes; then
1395dfecf96Smrg        _PKG_SHORT_ERRORS_SUPPORTED
1405dfecf96Smrg        if test $_pkg_short_errors_supported = yes; then
141f14f4646Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1425dfecf96Smrg        else 
143f14f4646Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1445dfecf96Smrg        fi
1455dfecf96Smrg	# Put the nasty error message in config.log where it belongs
1465dfecf96Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1475dfecf96Smrg
1485dfecf96Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
1495dfecf96Smrg[Package requirements ($2) were not met:
1505dfecf96Smrg
1515dfecf96Smrg$$1_PKG_ERRORS
1525dfecf96Smrg
1535dfecf96SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1545dfecf96Smrginstalled software in a non-standard prefix.
1555dfecf96Smrg
1565dfecf96Smrg_PKG_TEXT
1575dfecf96Smrg])],
158f14f4646Smrg		[AC_MSG_RESULT([no])
159f14f4646Smrg                $4])
1605dfecf96Smrgelif test $pkg_failed = untried; then
1615dfecf96Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
1625dfecf96Smrg[The pkg-config script could not be found or is too old.  Make sure it
1635dfecf96Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
1645dfecf96Smrgpath to pkg-config.
1655dfecf96Smrg
1665dfecf96Smrg_PKG_TEXT
1675dfecf96Smrg
168f14f4646SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1695dfecf96Smrg		[$4])
1705dfecf96Smrgelse
1715dfecf96Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1725dfecf96Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1735dfecf96Smrg        AC_MSG_RESULT([yes])
1745dfecf96Smrg	ifelse([$3], , :, [$3])
1755dfecf96Smrgfi[]dnl
1765dfecf96Smrg])# PKG_CHECK_MODULES
1775dfecf96Smrg
178f14f4646Smrgdnl
179f14f4646Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1805dfecf96Smrgdnl 
181f14f4646Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
182f14f4646Smrgdnl copy of this software and associated documentation files (the
183f14f4646Smrgdnl "Software"), to deal in the Software without restriction, including
184f14f4646Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
185f14f4646Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
186f14f4646Smrgdnl to whom the Software is furnished to do so, provided that the above
187f14f4646Smrgdnl copyright notice(s) and this permission notice appear in all copies of
188f14f4646Smrgdnl the Software and that both the above copyright notice(s) and this
189f14f4646Smrgdnl permission notice appear in supporting documentation.
190f14f4646Smrgdnl
1915dfecf96Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1925dfecf96Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
193f14f4646Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
194f14f4646Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
195f14f4646Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
196f14f4646Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
197f14f4646Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
198f14f4646Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
199f14f4646Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
200f14f4646Smrgdnl
201f14f4646Smrgdnl Except as contained in this notice, the name of a copyright holder
202f14f4646Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
203f14f4646Smrgdnl or other dealings in this Software without prior written authorization
204f14f4646Smrgdnl of the copyright holder.
2055dfecf96Smrg
206f14f4646Smrg# XORG_MACROS_VERSION(required-version)
207f14f4646Smrg# -------------------------------------
208f14f4646Smrg# Minimum version: 1.1.0
209f14f4646Smrg#
210f14f4646Smrg# If you're using a macro added in Version 1.1 or newer, include this in
211f14f4646Smrg# your configure.ac with the minimum required version, such as:
212f14f4646Smrg# XORG_MACROS_VERSION(1.1)
213f14f4646Smrg#
214f14f4646Smrg# To force at least a version with this macro defined, also add:
215f14f4646Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
216f14f4646Smrg#
217f14f4646Smrg#
218f14f4646Smrg# See the "minimum version" comment for each macro you use to see what 
219f14f4646Smrg# version you require.
220f14f4646SmrgAC_DEFUN([XORG_MACROS_VERSION],[
221f14f4646Smrg	[XORG_MACROS_needed_version=$1
222f14f4646Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
223f14f4646Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
224f14f4646Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
225f14f4646Smrg	[XORG_MACROS_version=1.1.6
226f14f4646Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
227f14f4646Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
228f14f4646Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
229f14f4646Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
2305dfecf96Smrg	fi
231f14f4646Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
232f14f4646Smrg		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])
2335dfecf96Smrg	fi
234f14f4646Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
235f14f4646Smrg]) # XORG_MACROS_VERSION
2365dfecf96Smrg
2375dfecf96Smrg# XORG_PROG_RAWCPP()
2385dfecf96Smrg# ------------------
239f14f4646Smrg# Minimum version: 1.0.0
240f14f4646Smrg#
2415dfecf96Smrg# Find cpp program and necessary flags for use in pre-processing text files
2425dfecf96Smrg# such as man pages and config files
2435dfecf96SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
2445dfecf96SmrgAC_REQUIRE([AC_PROG_CPP])
2455dfecf96SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
2465dfecf96Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
2475dfecf96Smrg
2485dfecf96Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
2495dfecf96Smrg# which is not the best choice for supporting other OS'es, but covers most
2505dfecf96Smrg# of the ones we need for now.
2515dfecf96SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
2525dfecf96SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
2535dfecf96Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
2545dfecf96Smrg	AC_MSG_RESULT([no])
2555dfecf96Smrgelse
2565dfecf96Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
2575dfecf96Smrg		RAWCPPFLAGS=-undef
2585dfecf96Smrg		AC_MSG_RESULT([yes])
2595dfecf96Smrg	else
2605dfecf96Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
2615dfecf96Smrg	fi
2625dfecf96Smrgfi
2635dfecf96Smrgrm -f conftest.$ac_ext
2645dfecf96Smrg
2655dfecf96SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
2665dfecf96SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
2675dfecf96Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
2685dfecf96Smrg	AC_MSG_RESULT([no])
2695dfecf96Smrgelse
2705dfecf96Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
2715dfecf96Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
2725dfecf96Smrg		AC_MSG_RESULT([yes])
2735dfecf96Smrg	else
2745dfecf96Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
2755dfecf96Smrg	fi
2765dfecf96Smrgfi
2775dfecf96Smrgrm -f conftest.$ac_ext
2785dfecf96SmrgAC_SUBST(RAWCPPFLAGS)
2795dfecf96Smrg]) # XORG_PROG_RAWCPP
2805dfecf96Smrg
2815dfecf96Smrg# XORG_MANPAGE_SECTIONS()
2825dfecf96Smrg# -----------------------
283f14f4646Smrg# Minimum version: 1.0.0
284f14f4646Smrg#
2855dfecf96Smrg# Determine which sections man pages go in for the different man page types
2865dfecf96Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
2875dfecf96Smrg# Not sure if there's any better way than just hardcoding by OS name.
2885dfecf96Smrg# Override default settings by setting environment variables
2895dfecf96Smrg
2905dfecf96SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
2915dfecf96SmrgAC_REQUIRE([AC_CANONICAL_HOST])
2925dfecf96Smrg
2935dfecf96Smrgif test x$APP_MAN_SUFFIX = x    ; then
294f14f4646Smrg    APP_MAN_SUFFIX=1
2955dfecf96Smrgfi
2965dfecf96Smrgif test x$APP_MAN_DIR = x    ; then
297f14f4646Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
2985dfecf96Smrgfi
2995dfecf96Smrg
3005dfecf96Smrgif test x$LIB_MAN_SUFFIX = x    ; then
301f14f4646Smrg    LIB_MAN_SUFFIX=3
3025dfecf96Smrgfi
3035dfecf96Smrgif test x$LIB_MAN_DIR = x    ; then
304f14f4646Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
3055dfecf96Smrgfi
3065dfecf96Smrg
3075dfecf96Smrgif test x$FILE_MAN_SUFFIX = x    ; then
3085dfecf96Smrg    case $host_os in
3095dfecf96Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
3105dfecf96Smrg	*)		FILE_MAN_SUFFIX=5  ;;
3115dfecf96Smrg    esac
3125dfecf96Smrgfi
3135dfecf96Smrgif test x$FILE_MAN_DIR = x    ; then
314f14f4646Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
3155dfecf96Smrgfi
3165dfecf96Smrg
3175dfecf96Smrgif test x$MISC_MAN_SUFFIX = x    ; then
3185dfecf96Smrg    case $host_os in
3195dfecf96Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
3205dfecf96Smrg	*)		MISC_MAN_SUFFIX=7  ;;
3215dfecf96Smrg    esac
3225dfecf96Smrgfi
3235dfecf96Smrgif test x$MISC_MAN_DIR = x    ; then
324f14f4646Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
3255dfecf96Smrgfi
3265dfecf96Smrg
3275dfecf96Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
3285dfecf96Smrg    case $host_os in
3295dfecf96Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
3305dfecf96Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
3315dfecf96Smrg    esac
3325dfecf96Smrgfi
3335dfecf96Smrgif test x$DRIVER_MAN_DIR = x    ; then
334f14f4646Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
3355dfecf96Smrgfi
3365dfecf96Smrg
3375dfecf96Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
3385dfecf96Smrg    case $host_os in
3395dfecf96Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
3405dfecf96Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
3415dfecf96Smrg    esac
3425dfecf96Smrgfi
3435dfecf96Smrgif test x$ADMIN_MAN_DIR = x    ; then
3445dfecf96Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
3455dfecf96Smrgfi
3465dfecf96Smrg
3475dfecf96Smrg
3485dfecf96SmrgAC_SUBST([APP_MAN_SUFFIX])
3495dfecf96SmrgAC_SUBST([LIB_MAN_SUFFIX])
3505dfecf96SmrgAC_SUBST([FILE_MAN_SUFFIX])
3515dfecf96SmrgAC_SUBST([MISC_MAN_SUFFIX])
3525dfecf96SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
3535dfecf96SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
3545dfecf96SmrgAC_SUBST([APP_MAN_DIR])
3555dfecf96SmrgAC_SUBST([LIB_MAN_DIR])
3565dfecf96SmrgAC_SUBST([FILE_MAN_DIR])
3575dfecf96SmrgAC_SUBST([MISC_MAN_DIR])
3585dfecf96SmrgAC_SUBST([DRIVER_MAN_DIR])
3595dfecf96SmrgAC_SUBST([ADMIN_MAN_DIR])
3605dfecf96Smrg]) # XORG_MANPAGE_SECTIONS
3615dfecf96Smrg
3625dfecf96Smrg# XORG_CHECK_LINUXDOC
3635dfecf96Smrg# -------------------
364f14f4646Smrg# Minimum version: 1.0.0
365f14f4646Smrg#
3665dfecf96Smrg# Defines the variable MAKE_TEXT if the necessary tools and
3675dfecf96Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
3685dfecf96Smrg# Whether or not the necessary tools and files are found can be checked
3695dfecf96Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
3705dfecf96SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
371f14f4646SmrgXORG_SGML_PATH=$prefix/share/sgml
372f14f4646SmrgHAVE_DEFS_ENT=
373f14f4646Smrg
374f14f4646Smrgif test x"$cross_compiling" = x"yes" ; then
375f14f4646Smrg  HAVE_DEFS_ENT=no
376f14f4646Smrgelse
377f14f4646Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
378f14f4646Smrgfi
3795dfecf96Smrg
3805dfecf96SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
3815dfecf96SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
3825dfecf96Smrg
3835dfecf96SmrgAC_MSG_CHECKING([Whether to build documentation])
3845dfecf96Smrg
385f14f4646Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
3865dfecf96Smrg   BUILDDOC=yes
3875dfecf96Smrgelse
3885dfecf96Smrg   BUILDDOC=no
3895dfecf96Smrgfi
3905dfecf96Smrg
3915dfecf96SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
3925dfecf96Smrg
3935dfecf96SmrgAC_MSG_RESULT([$BUILDDOC])
3945dfecf96Smrg
3955dfecf96SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
3965dfecf96Smrg
397f14f4646Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
3985dfecf96Smrg   BUILDPDFDOC=yes
3995dfecf96Smrgelse
4005dfecf96Smrg   BUILDPDFDOC=no
4015dfecf96Smrgfi
4025dfecf96Smrg
4035dfecf96SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
4045dfecf96Smrg
4055dfecf96SmrgAC_MSG_RESULT([$BUILDPDFDOC])
4065dfecf96Smrg
407f14f4646SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
408f14f4646SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
4095dfecf96SmrgMAKE_PDF="$PS2PDF"
410f14f4646SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
4115dfecf96Smrg
4125dfecf96SmrgAC_SUBST(MAKE_TEXT)
4135dfecf96SmrgAC_SUBST(MAKE_PS)
4145dfecf96SmrgAC_SUBST(MAKE_PDF)
4155dfecf96SmrgAC_SUBST(MAKE_HTML)
4165dfecf96Smrg]) # XORG_CHECK_LINUXDOC
4175dfecf96Smrg
418f14f4646Smrg# XORG_CHECK_DOCBOOK
419f14f4646Smrg# -------------------
420f14f4646Smrg# Minimum version: 1.0.0
421f14f4646Smrg#
422f14f4646Smrg# Checks for the ability to build output formats from SGML DocBook source.
423f14f4646Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
424f14f4646Smrg# indicates whether the necessary tools and files are found and, if set,
425f14f4646Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
426f14f4646SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
427f14f4646SmrgXORG_SGML_PATH=$prefix/share/sgml
428f14f4646SmrgHAVE_DEFS_ENT=
429f14f4646SmrgBUILDTXTDOC=no
430f14f4646SmrgBUILDPDFDOC=no
431f14f4646SmrgBUILDPSDOC=no
432f14f4646SmrgBUILDHTMLDOC=no
433f14f4646Smrg
434f14f4646SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
435f14f4646Smrg
436f14f4646SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
437f14f4646SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
438f14f4646SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
439f14f4646SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
440f14f4646Smrg
441f14f4646SmrgAC_MSG_CHECKING([Whether to build text documentation])
442f14f4646Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
443f14f4646Smrg   test x$BUILD_TXTDOC != xno; then
444f14f4646Smrg	BUILDTXTDOC=yes
445f14f4646Smrgfi
446f14f4646SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
447f14f4646SmrgAC_MSG_RESULT([$BUILDTXTDOC])
448f14f4646Smrg
449f14f4646SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
450f14f4646Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
451f14f4646Smrg   test x$BUILD_PDFDOC != xno; then
452f14f4646Smrg	BUILDPDFDOC=yes
453f14f4646Smrgfi
454f14f4646SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
455f14f4646SmrgAC_MSG_RESULT([$BUILDPDFDOC])
456f14f4646Smrg
457f14f4646SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
458f14f4646Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
459f14f4646Smrg   test x$BUILD_PSDOC != xno; then
460f14f4646Smrg	BUILDPSDOC=yes
461f14f4646Smrgfi
462f14f4646SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
463f14f4646SmrgAC_MSG_RESULT([$BUILDPSDOC])
464f14f4646Smrg
465f14f4646SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
466f14f4646Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
467f14f4646Smrg   test x$BUILD_HTMLDOC != xno; then
468f14f4646Smrg	BUILDHTMLDOC=yes
469f14f4646Smrgfi
470f14f4646SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
471f14f4646SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
472f14f4646Smrg
473f14f4646SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
474f14f4646SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
475f14f4646SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
476f14f4646SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
477f14f4646Smrg
478f14f4646SmrgAC_SUBST(MAKE_TEXT)
479f14f4646SmrgAC_SUBST(MAKE_PS)
480f14f4646SmrgAC_SUBST(MAKE_PDF)
481f14f4646SmrgAC_SUBST(MAKE_HTML)
482f14f4646Smrg]) # XORG_CHECK_DOCBOOK
483f14f4646Smrg
4845dfecf96Smrg# XORG_CHECK_MALLOC_ZERO
4855dfecf96Smrg# ----------------------
486f14f4646Smrg# Minimum version: 1.0.0
487f14f4646Smrg#
4885dfecf96Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
4895dfecf96Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
4905dfecf96Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
4915dfecf96SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
4925dfecf96SmrgAC_ARG_ENABLE(malloc0returnsnull,
4935dfecf96Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
4945dfecf96Smrg		       [malloc(0) returns NULL (default: auto)]),
4955dfecf96Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
4965dfecf96Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
4975dfecf96Smrg
4985dfecf96SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
4995dfecf96Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
5005dfecf96Smrg	AC_RUN_IFELSE([
5015dfecf96Smrgchar *malloc();
5025dfecf96Smrgchar *realloc();
5035dfecf96Smrgchar *calloc();
5045dfecf96Smrgmain() {
5055dfecf96Smrg    char *m0, *r0, *c0, *p;
5065dfecf96Smrg    m0 = malloc(0);
5075dfecf96Smrg    p = malloc(10);
5085dfecf96Smrg    r0 = realloc(p,0);
5095dfecf96Smrg    c0 = calloc(0);
5105dfecf96Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
5115dfecf96Smrg}],
5125dfecf96Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
5135dfecf96Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
5145dfecf96Smrgfi
5155dfecf96SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
5165dfecf96Smrg
5175dfecf96Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
5185dfecf96Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
5195dfecf96Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
5205dfecf96Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
5215dfecf96Smrgelse
5225dfecf96Smrg	MALLOC_ZERO_CFLAGS=""
5235dfecf96Smrg	XMALLOC_ZERO_CFLAGS=""
5245dfecf96Smrg	XTMALLOC_ZERO_CFLAGS=""
5255dfecf96Smrgfi
5265dfecf96Smrg
5275dfecf96SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
5285dfecf96SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
5295dfecf96SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
5305dfecf96Smrg]) # XORG_CHECK_MALLOC_ZERO
5315dfecf96Smrg
532f14f4646Smrg# XORG_WITH_LINT()
533f14f4646Smrg# ----------------
534f14f4646Smrg# Minimum version: 1.1.0
535f14f4646Smrg#
536f14f4646Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
537f14f4646Smrg# is specified.   (Use --with-lint=sparse for sparse.)
538f14f4646Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
539f14f4646Smrg# Sets $LINT_FLAGS to flags to pass to source checker
540f14f4646Smrg# Sets LINT automake conditional if enabled (default: disabled)
541f14f4646Smrg#
542f14f4646SmrgAC_DEFUN([XORG_WITH_LINT],[
543f14f4646Smrg
544f14f4646Smrg# Allow checking code with lint, sparse, etc.
545f14f4646SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
546f14f4646Smrg		[Use a lint-style source code checker (default: disabled)])],
547f14f4646Smrg		[use_lint=$withval], [use_lint=no])
548f14f4646Smrgif test "x$use_lint" = "xyes" ; then
549f14f4646Smrg	LINT="lint"
550f14f4646Smrgelse
551f14f4646Smrg	LINT="$use_lint"
552f14f4646Smrgfi
553f14f4646Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
554f14f4646Smrg    case $LINT in
555f14f4646Smrg	lint|*/lint)
556f14f4646Smrg	    case $host_os in
557f14f4646Smrg		solaris*)
558f14f4646Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
559f14f4646Smrg			;;
560f14f4646Smrg	    esac
561f14f4646Smrg	    ;;
562f14f4646Smrg    esac
563f14f4646Smrgfi
564f14f4646Smrg
565f14f4646SmrgAC_SUBST(LINT)
566f14f4646SmrgAC_SUBST(LINT_FLAGS)
567f14f4646SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
568f14f4646Smrg
569f14f4646Smrg]) # XORG_WITH_LINT
570f14f4646Smrg
571f14f4646Smrg# XORG_LINT_LIBRARY(LIBNAME)
572f14f4646Smrg# --------------------------
573f14f4646Smrg# Minimum version: 1.1.0
574f14f4646Smrg#
575f14f4646Smrg# Sets up flags for building lint libraries for checking programs that call
576f14f4646Smrg# functions in the library.
577f14f4646Smrg# Disabled by default, enable with --enable-lint-library
578f14f4646Smrg# Sets: 
579f14f4646Smrg#	@LINTLIB@		- name of lint library file to make
580f14f4646Smrg#	MAKE_LINT_LIB		- automake conditional
581f14f4646Smrg#
582f14f4646Smrg
583f14f4646SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
584f14f4646SmrgAC_REQUIRE([XORG_WITH_LINT])
585f14f4646Smrg# Build lint "library" for more indepth checks of programs calling this library
586f14f4646SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
587f14f4646Smrg	[Create lint library (default: disabled)])],
588f14f4646Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
589f14f4646Smrgif test "x$make_lint_lib" != "xno" ; then
590f14f4646Smrg	if test "x$LINT" = "xno" ; then
591f14f4646Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
592f14f4646Smrg	fi
593f14f4646Smrg	if test "x$make_lint_lib" = "xyes" ; then
594f14f4646Smrg		LINTLIB=llib-l$1.ln
595f14f4646Smrg	else
596f14f4646Smrg		LINTLIB=$make_lint_lib
597f14f4646Smrg	fi
598f14f4646Smrgfi
599f14f4646SmrgAC_SUBST(LINTLIB)
600f14f4646SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
601f14f4646Smrg
602f14f4646Smrg]) # XORG_LINT_LIBRARY
603f14f4646Smrg
6045dfecf96Smrgdnl Copyright 2005 Red Hat, Inc
6055dfecf96Smrgdnl
6065dfecf96Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
6075dfecf96Smrgdnl documentation for any purpose is hereby granted without fee, provided that
6085dfecf96Smrgdnl the above copyright notice appear in all copies and that both that
6095dfecf96Smrgdnl copyright notice and this permission notice appear in supporting
6105dfecf96Smrgdnl documentation.
6115dfecf96Smrgdnl
6125dfecf96Smrgdnl The above copyright notice and this permission notice shall be included
6135dfecf96Smrgdnl in all copies or substantial portions of the Software.
6145dfecf96Smrgdnl
6155dfecf96Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6165dfecf96Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6175dfecf96Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
6185dfecf96Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
6195dfecf96Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
6205dfecf96Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
6215dfecf96Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
6225dfecf96Smrgdnl
6235dfecf96Smrgdnl Except as contained in this notice, the name of the copyright holders shall
6245dfecf96Smrgdnl not be used in advertising or otherwise to promote the sale, use or
6255dfecf96Smrgdnl other dealings in this Software without prior written authorization
6265dfecf96Smrgdnl from the copyright holders.
6275dfecf96Smrgdnl
6285dfecf96Smrg
6295dfecf96Smrg# XORG_RELEASE_VERSION
6305dfecf96Smrg# --------------------
6315dfecf96Smrg# Adds --with/without-release-string and changes the PACKAGE and
6325dfecf96Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
633f14f4646Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
634f14f4646Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
6355dfecf96Smrg 
6365dfecf96SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
6375dfecf96Smrg	AC_ARG_WITH(release-version,
6385dfecf96Smrg			AC_HELP_STRING([--with-release-version=STRING],
6395dfecf96Smrg				[Use release version string in package name]),
6405dfecf96Smrg			[RELEASE_VERSION="$withval"],
6415dfecf96Smrg			[RELEASE_VERSION=""])
6425dfecf96Smrg	if test "x$RELEASE_VERSION" != "x"; then
6435dfecf96Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
6445dfecf96Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
6455dfecf96Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
6465dfecf96Smrg	fi
647f14f4646Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
648f14f4646Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
649f14f4646Smrg		[Major version of this package])
650f14f4646Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
651f14f4646Smrg	if test "x$PVM" = "x"; then
652f14f4646Smrg		PVM="0"
653f14f4646Smrg	fi
654f14f4646Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
655f14f4646Smrg		[$PVM],
656f14f4646Smrg		[Minor version of this package])
657f14f4646Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
658f14f4646Smrg	if test "x$PVP" = "x"; then
659f14f4646Smrg		PVP="0"
660f14f4646Smrg	fi
661f14f4646Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
662f14f4646Smrg		[$PVP],
663f14f4646Smrg		[Patch version of this package])
6645dfecf96Smrg])
6655dfecf96Smrg
666f14f4646Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
6675dfecf96Smrg#
6685dfecf96Smrg# This file is free software; the Free Software Foundation
6695dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
6705dfecf96Smrg# with or without modifications, as long as this notice is preserved.
6715dfecf96Smrg
6725dfecf96Smrg# AM_AUTOMAKE_VERSION(VERSION)
6735dfecf96Smrg# ----------------------------
6745dfecf96Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
6755dfecf96Smrg# generated from the m4 files accompanying Automake X.Y.
676f14f4646Smrg# (This private macro should not be called outside this file.)
677f14f4646SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
678f14f4646Smrg[am__api_version='1.10'
679f14f4646Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
680f14f4646Smrgdnl require some minimum version.  Point them to the right macro.
681f14f4646Smrgm4_if([$1], [1.10.1], [],
682f14f4646Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
683f14f4646Smrg])
684f14f4646Smrg
685f14f4646Smrg# _AM_AUTOCONF_VERSION(VERSION)
686f14f4646Smrg# -----------------------------
687f14f4646Smrg# aclocal traces this macro to find the Autoconf version.
688f14f4646Smrg# This is a private macro too.  Using m4_define simplifies
689f14f4646Smrg# the logic in aclocal, which can simply ignore this definition.
690f14f4646Smrgm4_define([_AM_AUTOCONF_VERSION], [])
6915dfecf96Smrg
6925dfecf96Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
6935dfecf96Smrg# -------------------------------
694f14f4646Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
6955dfecf96Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
6965dfecf96SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
697f14f4646Smrg[AM_AUTOMAKE_VERSION([1.10.1])dnl
698f14f4646Smrgm4_ifndef([AC_AUTOCONF_VERSION],
699f14f4646Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
700f14f4646Smrg_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
7015dfecf96Smrg
7025dfecf96Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
7035dfecf96Smrg
7045dfecf96Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7055dfecf96Smrg#
7065dfecf96Smrg# This file is free software; the Free Software Foundation
7075dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
7085dfecf96Smrg# with or without modifications, as long as this notice is preserved.
7095dfecf96Smrg
7105dfecf96Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
7115dfecf96Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
7125dfecf96Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
7135dfecf96Smrg#
7145dfecf96Smrg# Of course, Automake must honor this variable whenever it calls a
7155dfecf96Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7165dfecf96Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7175dfecf96Smrg# depending on how configure is run.  This is pretty annoying, since
7185dfecf96Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7195dfecf96Smrg# source directory, any form will work fine, but in subdirectories a
7205dfecf96Smrg# relative path needs to be adjusted first.
7215dfecf96Smrg#
7225dfecf96Smrg# $ac_aux_dir/missing
7235dfecf96Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
7245dfecf96Smrg# $top_srcdir/$ac_aux_dir/missing
7255dfecf96Smrg#    fails if $ac_aux_dir is absolute,
7265dfecf96Smrg#    fails when called from a subdirectory in a VPATH build with
7275dfecf96Smrg#          a relative $ac_aux_dir
7285dfecf96Smrg#
7295dfecf96Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
7305dfecf96Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
7315dfecf96Smrg# harmless because $srcdir is `.', but things will broke when you
7325dfecf96Smrg# start a VPATH build or use an absolute $srcdir.
7335dfecf96Smrg#
7345dfecf96Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
7355dfecf96Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
7365dfecf96Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
7375dfecf96Smrg# and then we would define $MISSING as
7385dfecf96Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
7395dfecf96Smrg# This will work as long as MISSING is not called from configure, because
7405dfecf96Smrg# unfortunately $(top_srcdir) has no meaning in configure.
7415dfecf96Smrg# However there are other variables, like CC, which are often used in
7425dfecf96Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
7435dfecf96Smrg#
7445dfecf96Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
7455dfecf96Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
7465dfecf96Smrg# configured tree to be moved without reconfiguration.
7475dfecf96Smrg
7485dfecf96SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
7495dfecf96Smrg[dnl Rely on autoconf to set up CDPATH properly.
7505dfecf96SmrgAC_PREREQ([2.50])dnl
7515dfecf96Smrg# expand $ac_aux_dir to an absolute path
7525dfecf96Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
7535dfecf96Smrg])
7545dfecf96Smrg
7555dfecf96Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
7565dfecf96Smrg
757f14f4646Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
7585dfecf96Smrg# Free Software Foundation, Inc.
7595dfecf96Smrg#
7605dfecf96Smrg# This file is free software; the Free Software Foundation
7615dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
7625dfecf96Smrg# with or without modifications, as long as this notice is preserved.
7635dfecf96Smrg
764f14f4646Smrg# serial 8
7655dfecf96Smrg
7665dfecf96Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
7675dfecf96Smrg# -------------------------------------
7685dfecf96Smrg# Define a conditional.
7695dfecf96SmrgAC_DEFUN([AM_CONDITIONAL],
7705dfecf96Smrg[AC_PREREQ(2.52)dnl
7715dfecf96Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
7725dfecf96Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
773f14f4646SmrgAC_SUBST([$1_TRUE])dnl
774f14f4646SmrgAC_SUBST([$1_FALSE])dnl
775f14f4646Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
776f14f4646Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
7775dfecf96Smrgif $2; then
7785dfecf96Smrg  $1_TRUE=
7795dfecf96Smrg  $1_FALSE='#'
7805dfecf96Smrgelse
7815dfecf96Smrg  $1_TRUE='#'
7825dfecf96Smrg  $1_FALSE=
7835dfecf96Smrgfi
7845dfecf96SmrgAC_CONFIG_COMMANDS_PRE(
7855dfecf96Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
7865dfecf96Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
7875dfecf96SmrgUsually this means the macro was only invoked conditionally.]])
7885dfecf96Smrgfi])])
7895dfecf96Smrg
790f14f4646Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7915dfecf96Smrg# Free Software Foundation, Inc.
7925dfecf96Smrg#
7935dfecf96Smrg# This file is free software; the Free Software Foundation
7945dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
7955dfecf96Smrg# with or without modifications, as long as this notice is preserved.
7965dfecf96Smrg
797f14f4646Smrg# serial 9
7985dfecf96Smrg
7995dfecf96Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
8005dfecf96Smrg# written in clear, in which case automake, when reading aclocal.m4,
8015dfecf96Smrg# will think it sees a *use*, and therefore will trigger all it's
8025dfecf96Smrg# C support machinery.  Also note that it means that autoscan, seeing
8035dfecf96Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
8045dfecf96Smrg
8055dfecf96Smrg
8065dfecf96Smrg# _AM_DEPENDENCIES(NAME)
8075dfecf96Smrg# ----------------------
8085dfecf96Smrg# See how the compiler implements dependency checking.
8095dfecf96Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
8105dfecf96Smrg# We try a few techniques and use that to set a single cache variable.
8115dfecf96Smrg#
8125dfecf96Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
8135dfecf96Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
8145dfecf96Smrg# dependency, and given that the user is not expected to run this macro,
8155dfecf96Smrg# just rely on AC_PROG_CC.
8165dfecf96SmrgAC_DEFUN([_AM_DEPENDENCIES],
8175dfecf96Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
8185dfecf96SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
8195dfecf96SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
8205dfecf96SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
8215dfecf96Smrg
8225dfecf96Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
8235dfecf96Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
8245dfecf96Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
825f14f4646Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
8265dfecf96Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
8275dfecf96Smrg                   [depcc="$$1"   am_compiler_list=])
8285dfecf96Smrg
8295dfecf96SmrgAC_CACHE_CHECK([dependency style of $depcc],
8305dfecf96Smrg               [am_cv_$1_dependencies_compiler_type],
8315dfecf96Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
8325dfecf96Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
8335dfecf96Smrg  # making bogus files that we don't know about and never remove.  For
8345dfecf96Smrg  # instance it was reported that on HP-UX the gcc test will end up
8355dfecf96Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
8365dfecf96Smrg  # in D'.
8375dfecf96Smrg  mkdir conftest.dir
8385dfecf96Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
8395dfecf96Smrg  # using a relative directory.
8405dfecf96Smrg  cp "$am_depcomp" conftest.dir
8415dfecf96Smrg  cd conftest.dir
8425dfecf96Smrg  # We will build objects and dependencies in a subdirectory because
8435dfecf96Smrg  # it helps to detect inapplicable dependency modes.  For instance
8445dfecf96Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
8455dfecf96Smrg  # side effect of compilation, but ICC will put the dependencies in
8465dfecf96Smrg  # the current directory while Tru64 will put them in the object
8475dfecf96Smrg  # directory.
8485dfecf96Smrg  mkdir sub
8495dfecf96Smrg
8505dfecf96Smrg  am_cv_$1_dependencies_compiler_type=none
8515dfecf96Smrg  if test "$am_compiler_list" = ""; then
8525dfecf96Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
8535dfecf96Smrg  fi
8545dfecf96Smrg  for depmode in $am_compiler_list; do
8555dfecf96Smrg    # Setup a source with many dependencies, because some compilers
8565dfecf96Smrg    # like to wrap large dependency lists on column 80 (with \), and
8575dfecf96Smrg    # we should not choose a depcomp mode which is confused by this.
8585dfecf96Smrg    #
8595dfecf96Smrg    # We need to recreate these files for each test, as the compiler may
8605dfecf96Smrg    # overwrite some of them when testing with obscure command lines.
8615dfecf96Smrg    # This happens at least with the AIX C compiler.
8625dfecf96Smrg    : > sub/conftest.c
8635dfecf96Smrg    for i in 1 2 3 4 5 6; do
8645dfecf96Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
8655dfecf96Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
8665dfecf96Smrg      # Solaris 8's {/usr,}/bin/sh.
8675dfecf96Smrg      touch sub/conftst$i.h
8685dfecf96Smrg    done
8695dfecf96Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
8705dfecf96Smrg
8715dfecf96Smrg    case $depmode in
8725dfecf96Smrg    nosideeffect)
8735dfecf96Smrg      # after this tag, mechanisms are not by side-effect, so they'll
8745dfecf96Smrg      # only be used when explicitly requested
8755dfecf96Smrg      if test "x$enable_dependency_tracking" = xyes; then
8765dfecf96Smrg	continue
8775dfecf96Smrg      else
8785dfecf96Smrg	break
8795dfecf96Smrg      fi
8805dfecf96Smrg      ;;
8815dfecf96Smrg    none) break ;;
8825dfecf96Smrg    esac
8835dfecf96Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
8845dfecf96Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
8855dfecf96Smrg    # handle `-M -o', and we need to detect this.
8865dfecf96Smrg    if depmode=$depmode \
8875dfecf96Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
8885dfecf96Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
8895dfecf96Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
8905dfecf96Smrg         >/dev/null 2>conftest.err &&
891f14f4646Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
8925dfecf96Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
8935dfecf96Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
8945dfecf96Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
8955dfecf96Smrg      # icc doesn't choke on unknown options, it will just issue warnings
8965dfecf96Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
8975dfecf96Smrg      # that says an option was ignored or not supported.
8985dfecf96Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
8995dfecf96Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
9005dfecf96Smrg      # The diagnosis changed in icc 8.0:
9015dfecf96Smrg      #   icc: Command line remark: option '-MP' not supported
9025dfecf96Smrg      if (grep 'ignoring option' conftest.err ||
9035dfecf96Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
9045dfecf96Smrg        am_cv_$1_dependencies_compiler_type=$depmode
9055dfecf96Smrg        break
9065dfecf96Smrg      fi
9075dfecf96Smrg    fi
9085dfecf96Smrg  done
9095dfecf96Smrg
9105dfecf96Smrg  cd ..
9115dfecf96Smrg  rm -rf conftest.dir
9125dfecf96Smrgelse
9135dfecf96Smrg  am_cv_$1_dependencies_compiler_type=none
9145dfecf96Smrgfi
9155dfecf96Smrg])
9165dfecf96SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
9175dfecf96SmrgAM_CONDITIONAL([am__fastdep$1], [
9185dfecf96Smrg  test "x$enable_dependency_tracking" != xno \
9195dfecf96Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
9205dfecf96Smrg])
9215dfecf96Smrg
9225dfecf96Smrg
9235dfecf96Smrg# AM_SET_DEPDIR
9245dfecf96Smrg# -------------
9255dfecf96Smrg# Choose a directory name for dependency files.
9265dfecf96Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
9275dfecf96SmrgAC_DEFUN([AM_SET_DEPDIR],
9285dfecf96Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
9295dfecf96SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
9305dfecf96Smrg])
9315dfecf96Smrg
9325dfecf96Smrg
9335dfecf96Smrg# AM_DEP_TRACK
9345dfecf96Smrg# ------------
9355dfecf96SmrgAC_DEFUN([AM_DEP_TRACK],
9365dfecf96Smrg[AC_ARG_ENABLE(dependency-tracking,
9375dfecf96Smrg[  --disable-dependency-tracking  speeds up one-time build
9385dfecf96Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
9395dfecf96Smrgif test "x$enable_dependency_tracking" != xno; then
9405dfecf96Smrg  am_depcomp="$ac_aux_dir/depcomp"
9415dfecf96Smrg  AMDEPBACKSLASH='\'
9425dfecf96Smrgfi
9435dfecf96SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
944f14f4646SmrgAC_SUBST([AMDEPBACKSLASH])dnl
945f14f4646Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
9465dfecf96Smrg])
9475dfecf96Smrg
9485dfecf96Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
9495dfecf96Smrg
9505dfecf96Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
9515dfecf96Smrg# Free Software Foundation, Inc.
9525dfecf96Smrg#
9535dfecf96Smrg# This file is free software; the Free Software Foundation
9545dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
9555dfecf96Smrg# with or without modifications, as long as this notice is preserved.
9565dfecf96Smrg
9575dfecf96Smrg#serial 3
9585dfecf96Smrg
9595dfecf96Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
9605dfecf96Smrg# ------------------------------
9615dfecf96SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
9625dfecf96Smrg[for mf in $CONFIG_FILES; do
9635dfecf96Smrg  # Strip MF so we end up with the name of the file.
9645dfecf96Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
9655dfecf96Smrg  # Check whether this is an Automake generated Makefile or not.
9665dfecf96Smrg  # We used to match only the files named `Makefile.in', but
9675dfecf96Smrg  # some people rename them; so instead we look at the file content.
9685dfecf96Smrg  # Grep'ing the first line is not enough: some people post-process
9695dfecf96Smrg  # each Makefile.in and add a new line on top of each file to say so.
970f14f4646Smrg  # Grep'ing the whole file is not good either: AIX grep has a line
971f14f4646Smrg  # limit of 2048, but all sed's we know have understand at least 4000.
972f14f4646Smrg  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
9735dfecf96Smrg    dirpart=`AS_DIRNAME("$mf")`
9745dfecf96Smrg  else
9755dfecf96Smrg    continue
9765dfecf96Smrg  fi
9775dfecf96Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
9785dfecf96Smrg  # from the Makefile without running `make'.
9795dfecf96Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
9805dfecf96Smrg  test -z "$DEPDIR" && continue
9815dfecf96Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
9825dfecf96Smrg  test -z "am__include" && continue
9835dfecf96Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
9845dfecf96Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
9855dfecf96Smrg  U=`sed -n 's/^U = //p' < "$mf"`
9865dfecf96Smrg  # Find all dependency output files, they are included files with
9875dfecf96Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
9885dfecf96Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
9895dfecf96Smrg  # expansion.
9905dfecf96Smrg  for file in `sed -n "
9915dfecf96Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
9925dfecf96Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
9935dfecf96Smrg    # Make sure the directory exists.
9945dfecf96Smrg    test -f "$dirpart/$file" && continue
9955dfecf96Smrg    fdir=`AS_DIRNAME(["$file"])`
9965dfecf96Smrg    AS_MKDIR_P([$dirpart/$fdir])
9975dfecf96Smrg    # echo "creating $dirpart/$file"
9985dfecf96Smrg    echo '# dummy' > "$dirpart/$file"
9995dfecf96Smrg  done
10005dfecf96Smrgdone
10015dfecf96Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
10025dfecf96Smrg
10035dfecf96Smrg
10045dfecf96Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
10055dfecf96Smrg# -----------------------------
10065dfecf96Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
10075dfecf96Smrg#
10085dfecf96Smrg# This code is only required when automatic dependency tracking
10095dfecf96Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
10105dfecf96Smrg# need in order to bootstrap the dependency handling code.
10115dfecf96SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
10125dfecf96Smrg[AC_CONFIG_COMMANDS([depfiles],
10135dfecf96Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
10145dfecf96Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
10155dfecf96Smrg])
10165dfecf96Smrg
10175dfecf96Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
10185dfecf96Smrg# Free Software Foundation, Inc.
10195dfecf96Smrg#
10205dfecf96Smrg# This file is free software; the Free Software Foundation
10215dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
10225dfecf96Smrg# with or without modifications, as long as this notice is preserved.
10235dfecf96Smrg
10245dfecf96Smrg# serial 8
10255dfecf96Smrg
10265dfecf96Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
10275dfecf96SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
10285dfecf96Smrg
10295dfecf96Smrg# Do all the work for Automake.                             -*- Autoconf -*-
10305dfecf96Smrg
1031f14f4646Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1032f14f4646Smrg# 2005, 2006, 2008 Free Software Foundation, Inc.
10335dfecf96Smrg#
10345dfecf96Smrg# This file is free software; the Free Software Foundation
10355dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
10365dfecf96Smrg# with or without modifications, as long as this notice is preserved.
10375dfecf96Smrg
1038f14f4646Smrg# serial 13
10395dfecf96Smrg
10405dfecf96Smrg# This macro actually does too much.  Some checks are only needed if
10415dfecf96Smrg# your package does certain things.  But this isn't really a big deal.
10425dfecf96Smrg
10435dfecf96Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
10445dfecf96Smrg# AM_INIT_AUTOMAKE([OPTIONS])
10455dfecf96Smrg# -----------------------------------------------
10465dfecf96Smrg# The call with PACKAGE and VERSION arguments is the old style
10475dfecf96Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
10485dfecf96Smrg# and VERSION should now be passed to AC_INIT and removed from
10495dfecf96Smrg# the call to AM_INIT_AUTOMAKE.
10505dfecf96Smrg# We support both call styles for the transition.  After
10515dfecf96Smrg# the next Automake release, Autoconf can make the AC_INIT
10525dfecf96Smrg# arguments mandatory, and then we can depend on a new Autoconf
10535dfecf96Smrg# release and drop the old call support.
10545dfecf96SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
1055f14f4646Smrg[AC_PREREQ([2.60])dnl
10565dfecf96Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
10575dfecf96Smrgdnl the ones we care about.
10585dfecf96Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
10595dfecf96SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
10605dfecf96SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
1061f14f4646Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
1062f14f4646Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1063f14f4646Smrg  # is not polluted with repeated "-I."
1064f14f4646Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1065f14f4646Smrg  # test to see if srcdir already configured
1066f14f4646Smrg  if test -f $srcdir/config.status; then
1067f14f4646Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1068f14f4646Smrg  fi
10695dfecf96Smrgfi
10705dfecf96Smrg
10715dfecf96Smrg# test whether we have cygpath
10725dfecf96Smrgif test -z "$CYGPATH_W"; then
10735dfecf96Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
10745dfecf96Smrg    CYGPATH_W='cygpath -w'
10755dfecf96Smrg  else
10765dfecf96Smrg    CYGPATH_W=echo
10775dfecf96Smrg  fi
10785dfecf96Smrgfi
10795dfecf96SmrgAC_SUBST([CYGPATH_W])
10805dfecf96Smrg
10815dfecf96Smrg# Define the identity of the package.
10825dfecf96Smrgdnl Distinguish between old-style and new-style calls.
10835dfecf96Smrgm4_ifval([$2],
10845dfecf96Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
10855dfecf96Smrg AC_SUBST([PACKAGE], [$1])dnl
10865dfecf96Smrg AC_SUBST([VERSION], [$2])],
10875dfecf96Smrg[_AM_SET_OPTIONS([$1])dnl
1088f14f4646Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1089f14f4646Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1090f14f4646Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
10915dfecf96Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
10925dfecf96Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
10935dfecf96Smrg
10945dfecf96Smrg_AM_IF_OPTION([no-define],,
10955dfecf96Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
10965dfecf96Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
10975dfecf96Smrg
10985dfecf96Smrg# Some tools Automake needs.
10995dfecf96SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
11005dfecf96SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
11015dfecf96SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
11025dfecf96SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
11035dfecf96SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
11045dfecf96SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
11055dfecf96SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
11065dfecf96SmrgAM_PROG_INSTALL_SH
11075dfecf96SmrgAM_PROG_INSTALL_STRIP
11085dfecf96SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
11095dfecf96Smrg# We need awk for the "check" target.  The system "awk" is bad on
11105dfecf96Smrg# some platforms.
11115dfecf96SmrgAC_REQUIRE([AC_PROG_AWK])dnl
11125dfecf96SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
11135dfecf96SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
11145dfecf96Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
11155dfecf96Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
11165dfecf96Smrg	      		     [_AM_PROG_TAR([v7])])])
11175dfecf96Smrg_AM_IF_OPTION([no-dependencies],,
11185dfecf96Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
11195dfecf96Smrg                  [_AM_DEPENDENCIES(CC)],
11205dfecf96Smrg                  [define([AC_PROG_CC],
11215dfecf96Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
11225dfecf96SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
11235dfecf96Smrg                  [_AM_DEPENDENCIES(CXX)],
11245dfecf96Smrg                  [define([AC_PROG_CXX],
11255dfecf96Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1126f14f4646SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
1127f14f4646Smrg                  [_AM_DEPENDENCIES(OBJC)],
1128f14f4646Smrg                  [define([AC_PROG_OBJC],
1129f14f4646Smrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
11305dfecf96Smrg])
11315dfecf96Smrg])
11325dfecf96Smrg
11335dfecf96Smrg
11345dfecf96Smrg# When config.status generates a header, we must update the stamp-h file.
11355dfecf96Smrg# This file resides in the same directory as the config header
11365dfecf96Smrg# that is generated.  The stamp files are numbered to have different names.
11375dfecf96Smrg
11385dfecf96Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
11395dfecf96Smrg# loop where config.status creates the headers, so we can generate
11405dfecf96Smrg# our stamp files there.
11415dfecf96SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
11425dfecf96Smrg[# Compute $1's index in $config_headers.
1143f14f4646Smrg_am_arg=$1
11445dfecf96Smrg_am_stamp_count=1
11455dfecf96Smrgfor _am_header in $config_headers :; do
11465dfecf96Smrg  case $_am_header in
1147f14f4646Smrg    $_am_arg | $_am_arg:* )
11485dfecf96Smrg      break ;;
11495dfecf96Smrg    * )
11505dfecf96Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
11515dfecf96Smrg  esac
11525dfecf96Smrgdone
1153f14f4646Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
11545dfecf96Smrg
11555dfecf96Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
11565dfecf96Smrg#
11575dfecf96Smrg# This file is free software; the Free Software Foundation
11585dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
11595dfecf96Smrg# with or without modifications, as long as this notice is preserved.
11605dfecf96Smrg
11615dfecf96Smrg# AM_PROG_INSTALL_SH
11625dfecf96Smrg# ------------------
11635dfecf96Smrg# Define $install_sh.
11645dfecf96SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
11655dfecf96Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1166f14f4646Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
11675dfecf96SmrgAC_SUBST(install_sh)])
11685dfecf96Smrg
11695dfecf96Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
11705dfecf96Smrg#
11715dfecf96Smrg# This file is free software; the Free Software Foundation
11725dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
11735dfecf96Smrg# with or without modifications, as long as this notice is preserved.
11745dfecf96Smrg
11755dfecf96Smrg# serial 2
11765dfecf96Smrg
11775dfecf96Smrg# Check whether the underlying file-system supports filenames
11785dfecf96Smrg# with a leading dot.  For instance MS-DOS doesn't.
11795dfecf96SmrgAC_DEFUN([AM_SET_LEADING_DOT],
11805dfecf96Smrg[rm -rf .tst 2>/dev/null
11815dfecf96Smrgmkdir .tst 2>/dev/null
11825dfecf96Smrgif test -d .tst; then
11835dfecf96Smrg  am__leading_dot=.
11845dfecf96Smrgelse
11855dfecf96Smrg  am__leading_dot=_
11865dfecf96Smrgfi
11875dfecf96Smrgrmdir .tst 2>/dev/null
11885dfecf96SmrgAC_SUBST([am__leading_dot])])
11895dfecf96Smrg
11905dfecf96Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
11915dfecf96Smrg# From Jim Meyering
11925dfecf96Smrg
11935dfecf96Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
11945dfecf96Smrg# Free Software Foundation, Inc.
11955dfecf96Smrg#
11965dfecf96Smrg# This file is free software; the Free Software Foundation
11975dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
11985dfecf96Smrg# with or without modifications, as long as this notice is preserved.
11995dfecf96Smrg
12005dfecf96Smrg# serial 4
12015dfecf96Smrg
12025dfecf96SmrgAC_DEFUN([AM_MAINTAINER_MODE],
12035dfecf96Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
12045dfecf96Smrg  dnl maintainer-mode is disabled by default
12055dfecf96Smrg  AC_ARG_ENABLE(maintainer-mode,
12065dfecf96Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
12075dfecf96Smrg			  (and sometimes confusing) to the casual installer],
12085dfecf96Smrg      USE_MAINTAINER_MODE=$enableval,
12095dfecf96Smrg      USE_MAINTAINER_MODE=no)
12105dfecf96Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
12115dfecf96Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
12125dfecf96Smrg  MAINT=$MAINTAINER_MODE_TRUE
12135dfecf96Smrg  AC_SUBST(MAINT)dnl
12145dfecf96Smrg]
12155dfecf96Smrg)
12165dfecf96Smrg
12175dfecf96SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
12185dfecf96Smrg
12195dfecf96Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
12205dfecf96Smrg
12215dfecf96Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
12225dfecf96Smrg#
12235dfecf96Smrg# This file is free software; the Free Software Foundation
12245dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
12255dfecf96Smrg# with or without modifications, as long as this notice is preserved.
12265dfecf96Smrg
12275dfecf96Smrg# serial 3
12285dfecf96Smrg
12295dfecf96Smrg# AM_MAKE_INCLUDE()
12305dfecf96Smrg# -----------------
12315dfecf96Smrg# Check to see how make treats includes.
12325dfecf96SmrgAC_DEFUN([AM_MAKE_INCLUDE],
12335dfecf96Smrg[am_make=${MAKE-make}
12345dfecf96Smrgcat > confinc << 'END'
12355dfecf96Smrgam__doit:
12365dfecf96Smrg	@echo done
12375dfecf96Smrg.PHONY: am__doit
12385dfecf96SmrgEND
12395dfecf96Smrg# If we don't find an include directive, just comment out the code.
12405dfecf96SmrgAC_MSG_CHECKING([for style of include used by $am_make])
12415dfecf96Smrgam__include="#"
12425dfecf96Smrgam__quote=
12435dfecf96Smrg_am_result=none
12445dfecf96Smrg# First try GNU make style include.
12455dfecf96Smrgecho "include confinc" > confmf
12465dfecf96Smrg# We grep out `Entering directory' and `Leaving directory'
12475dfecf96Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
12485dfecf96Smrg# In particular we don't look at `^make:' because GNU make might
12495dfecf96Smrg# be invoked under some other name (usually "gmake"), in which
12505dfecf96Smrg# case it prints its new name instead of `make'.
12515dfecf96Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
12525dfecf96Smrg   am__include=include
12535dfecf96Smrg   am__quote=
12545dfecf96Smrg   _am_result=GNU
12555dfecf96Smrgfi
12565dfecf96Smrg# Now try BSD make style include.
12575dfecf96Smrgif test "$am__include" = "#"; then
12585dfecf96Smrg   echo '.include "confinc"' > confmf
12595dfecf96Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
12605dfecf96Smrg      am__include=.include
12615dfecf96Smrg      am__quote="\""
12625dfecf96Smrg      _am_result=BSD
12635dfecf96Smrg   fi
12645dfecf96Smrgfi
12655dfecf96SmrgAC_SUBST([am__include])
12665dfecf96SmrgAC_SUBST([am__quote])
12675dfecf96SmrgAC_MSG_RESULT([$_am_result])
12685dfecf96Smrgrm -f confinc confmf
12695dfecf96Smrg])
12705dfecf96Smrg
1271f14f4646Smrg# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005
1272f14f4646Smrg# Free Software Foundation, Inc.
1273f14f4646Smrg#
1274f14f4646Smrg# This file is free software; the Free Software Foundation
1275f14f4646Smrg# gives unlimited permission to copy and/or distribute it,
1276f14f4646Smrg# with or without modifications, as long as this notice is preserved.
1277f14f4646Smrg
1278f14f4646Smrg# serial 5
1279f14f4646Smrg
1280f14f4646Smrg# AM_PROG_CC_C_O
1281f14f4646Smrg# --------------
1282f14f4646Smrg# Like AC_PROG_CC_C_O, but changed for automake.
1283f14f4646SmrgAC_DEFUN([AM_PROG_CC_C_O],
1284f14f4646Smrg[AC_REQUIRE([AC_PROG_CC_C_O])dnl
1285f14f4646SmrgAC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1286f14f4646SmrgAC_REQUIRE_AUX_FILE([compile])dnl
1287f14f4646Smrg# FIXME: we rely on the cache variable name because
1288f14f4646Smrg# there is no other way.
1289f14f4646Smrgset dummy $CC
1290f14f4646Smrgac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
1291f14f4646Smrgif eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
1292f14f4646Smrg   # Losing compiler, so override with the script.
1293f14f4646Smrg   # FIXME: It is wrong to rewrite CC.
1294f14f4646Smrg   # But if we don't then we get into trouble of one sort or another.
1295f14f4646Smrg   # A longer-term fix would be to have automake use am__CC in this case,
1296f14f4646Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
1297f14f4646Smrg   CC="$am_aux_dir/compile $CC"
1298f14f4646Smrgfi
1299f14f4646Smrgdnl Make sure AC_PROG_CC is never called again, or it will override our
1300f14f4646Smrgdnl setting of CC.
1301f14f4646Smrgm4_define([AC_PROG_CC],
1302f14f4646Smrg          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
1303f14f4646Smrg])
1304f14f4646Smrg
13055dfecf96Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
13065dfecf96Smrg
1307f14f4646Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
13085dfecf96Smrg# Free Software Foundation, Inc.
13095dfecf96Smrg#
13105dfecf96Smrg# This file is free software; the Free Software Foundation
13115dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
13125dfecf96Smrg# with or without modifications, as long as this notice is preserved.
13135dfecf96Smrg
1314f14f4646Smrg# serial 5
13155dfecf96Smrg
13165dfecf96Smrg# AM_MISSING_PROG(NAME, PROGRAM)
13175dfecf96Smrg# ------------------------------
13185dfecf96SmrgAC_DEFUN([AM_MISSING_PROG],
13195dfecf96Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
13205dfecf96Smrg$1=${$1-"${am_missing_run}$2"}
13215dfecf96SmrgAC_SUBST($1)])
13225dfecf96Smrg
13235dfecf96Smrg
13245dfecf96Smrg# AM_MISSING_HAS_RUN
13255dfecf96Smrg# ------------------
13265dfecf96Smrg# Define MISSING if not defined so far and test if it supports --run.
13275dfecf96Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
13285dfecf96SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
13295dfecf96Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1330f14f4646SmrgAC_REQUIRE_AUX_FILE([missing])dnl
13315dfecf96Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
13325dfecf96Smrg# Use eval to expand $SHELL
13335dfecf96Smrgif eval "$MISSING --run true"; then
13345dfecf96Smrg  am_missing_run="$MISSING --run "
13355dfecf96Smrgelse
13365dfecf96Smrg  am_missing_run=
13375dfecf96Smrg  AC_MSG_WARN([`missing' script is too old or missing])
13385dfecf96Smrgfi
13395dfecf96Smrg])
13405dfecf96Smrg
1341f14f4646Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
13425dfecf96Smrg#
13435dfecf96Smrg# This file is free software; the Free Software Foundation
13445dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
13455dfecf96Smrg# with or without modifications, as long as this notice is preserved.
13465dfecf96Smrg
13475dfecf96Smrg# AM_PROG_MKDIR_P
13485dfecf96Smrg# ---------------
1349f14f4646Smrg# Check for `mkdir -p'.
13505dfecf96SmrgAC_DEFUN([AM_PROG_MKDIR_P],
1351f14f4646Smrg[AC_PREREQ([2.60])dnl
1352f14f4646SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
1353f14f4646Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1354f14f4646Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
1355f14f4646Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1356f14f4646Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1357f14f4646Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
1358f14f4646Smrgdnl adjustment using top_builddir (which is defined more often than
1359f14f4646Smrgdnl MKDIR_P).
1360f14f4646SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1361f14f4646Smrgcase $mkdir_p in
1362f14f4646Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
1363f14f4646Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1364f14f4646Smrgesac
1365f14f4646Smrg])
13665dfecf96Smrg
13675dfecf96Smrg# Helper functions for option handling.                     -*- Autoconf -*-
13685dfecf96Smrg
13695dfecf96Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
13705dfecf96Smrg#
13715dfecf96Smrg# This file is free software; the Free Software Foundation
13725dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
13735dfecf96Smrg# with or without modifications, as long as this notice is preserved.
13745dfecf96Smrg
13755dfecf96Smrg# serial 3
13765dfecf96Smrg
13775dfecf96Smrg# _AM_MANGLE_OPTION(NAME)
13785dfecf96Smrg# -----------------------
13795dfecf96SmrgAC_DEFUN([_AM_MANGLE_OPTION],
13805dfecf96Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
13815dfecf96Smrg
13825dfecf96Smrg# _AM_SET_OPTION(NAME)
13835dfecf96Smrg# ------------------------------
13845dfecf96Smrg# Set option NAME.  Presently that only means defining a flag for this option.
13855dfecf96SmrgAC_DEFUN([_AM_SET_OPTION],
13865dfecf96Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
13875dfecf96Smrg
13885dfecf96Smrg# _AM_SET_OPTIONS(OPTIONS)
13895dfecf96Smrg# ----------------------------------
13905dfecf96Smrg# OPTIONS is a space-separated list of Automake options.
13915dfecf96SmrgAC_DEFUN([_AM_SET_OPTIONS],
13925dfecf96Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
13935dfecf96Smrg
13945dfecf96Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
13955dfecf96Smrg# -------------------------------------------
13965dfecf96Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
13975dfecf96SmrgAC_DEFUN([_AM_IF_OPTION],
13985dfecf96Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
13995dfecf96Smrg
14005dfecf96Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
14015dfecf96Smrg
14025dfecf96Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
14035dfecf96Smrg# Free Software Foundation, Inc.
14045dfecf96Smrg#
14055dfecf96Smrg# This file is free software; the Free Software Foundation
14065dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
14075dfecf96Smrg# with or without modifications, as long as this notice is preserved.
14085dfecf96Smrg
14095dfecf96Smrg# serial 4
14105dfecf96Smrg
14115dfecf96Smrg# AM_SANITY_CHECK
14125dfecf96Smrg# ---------------
14135dfecf96SmrgAC_DEFUN([AM_SANITY_CHECK],
14145dfecf96Smrg[AC_MSG_CHECKING([whether build environment is sane])
14155dfecf96Smrg# Just in case
14165dfecf96Smrgsleep 1
14175dfecf96Smrgecho timestamp > conftest.file
14185dfecf96Smrg# Do `set' in a subshell so we don't clobber the current shell's
14195dfecf96Smrg# arguments.  Must try -L first in case configure is actually a
14205dfecf96Smrg# symlink; some systems play weird games with the mod time of symlinks
14215dfecf96Smrg# (eg FreeBSD returns the mod time of the symlink's containing
14225dfecf96Smrg# directory).
14235dfecf96Smrgif (
14245dfecf96Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
14255dfecf96Smrg   if test "$[*]" = "X"; then
14265dfecf96Smrg      # -L didn't work.
14275dfecf96Smrg      set X `ls -t $srcdir/configure conftest.file`
14285dfecf96Smrg   fi
14295dfecf96Smrg   rm -f conftest.file
14305dfecf96Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
14315dfecf96Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
14325dfecf96Smrg
14335dfecf96Smrg      # If neither matched, then we have a broken ls.  This can happen
14345dfecf96Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
14355dfecf96Smrg      # broken ls alias from the environment.  This has actually
14365dfecf96Smrg      # happened.  Such a system could not be considered "sane".
14375dfecf96Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
14385dfecf96Smrgalias in your environment])
14395dfecf96Smrg   fi
14405dfecf96Smrg
14415dfecf96Smrg   test "$[2]" = conftest.file
14425dfecf96Smrg   )
14435dfecf96Smrgthen
14445dfecf96Smrg   # Ok.
14455dfecf96Smrg   :
14465dfecf96Smrgelse
14475dfecf96Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
14485dfecf96SmrgCheck your system clock])
14495dfecf96Smrgfi
14505dfecf96SmrgAC_MSG_RESULT(yes)])
14515dfecf96Smrg
14525dfecf96Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
14535dfecf96Smrg#
14545dfecf96Smrg# This file is free software; the Free Software Foundation
14555dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
14565dfecf96Smrg# with or without modifications, as long as this notice is preserved.
14575dfecf96Smrg
14585dfecf96Smrg# AM_PROG_INSTALL_STRIP
14595dfecf96Smrg# ---------------------
14605dfecf96Smrg# One issue with vendor `install' (even GNU) is that you can't
14615dfecf96Smrg# specify the program used to strip binaries.  This is especially
14625dfecf96Smrg# annoying in cross-compiling environments, where the build's strip
14635dfecf96Smrg# is unlikely to handle the host's binaries.
14645dfecf96Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
14655dfecf96Smrg# always use install-sh in `make install-strip', and initialize
14665dfecf96Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
14675dfecf96SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
14685dfecf96Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
14695dfecf96Smrg# Installed binaries are usually stripped using `strip' when the user
14705dfecf96Smrg# run `make install-strip'.  However `strip' might not be the right
14715dfecf96Smrg# tool to use in cross-compilation environments, therefore Automake
14725dfecf96Smrg# will honor the `STRIP' environment variable to overrule this program.
14735dfecf96Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
14745dfecf96Smrgif test "$cross_compiling" != no; then
14755dfecf96Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
14765dfecf96Smrgfi
1477f14f4646SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
14785dfecf96SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
14795dfecf96Smrg
1480f14f4646Smrg# Copyright (C) 2006  Free Software Foundation, Inc.
1481f14f4646Smrg#
1482f14f4646Smrg# This file is free software; the Free Software Foundation
1483f14f4646Smrg# gives unlimited permission to copy and/or distribute it,
1484f14f4646Smrg# with or without modifications, as long as this notice is preserved.
1485f14f4646Smrg
1486f14f4646Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
1487f14f4646Smrg# ---------------------------
1488f14f4646Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1489f14f4646Smrg# This macro is traced by Automake.
1490f14f4646SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1491f14f4646Smrg
14925dfecf96Smrg# Check how to create a tarball.                            -*- Autoconf -*-
14935dfecf96Smrg
14945dfecf96Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
14955dfecf96Smrg#
14965dfecf96Smrg# This file is free software; the Free Software Foundation
14975dfecf96Smrg# gives unlimited permission to copy and/or distribute it,
14985dfecf96Smrg# with or without modifications, as long as this notice is preserved.
14995dfecf96Smrg
15005dfecf96Smrg# serial 2
15015dfecf96Smrg
15025dfecf96Smrg# _AM_PROG_TAR(FORMAT)
15035dfecf96Smrg# --------------------
15045dfecf96Smrg# Check how to create a tarball in format FORMAT.
15055dfecf96Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
15065dfecf96Smrg#
15075dfecf96Smrg# Substitute a variable $(am__tar) that is a command
15085dfecf96Smrg# writing to stdout a FORMAT-tarball containing the directory
15095dfecf96Smrg# $tardir.
15105dfecf96Smrg#     tardir=directory && $(am__tar) > result.tar
15115dfecf96Smrg#
15125dfecf96Smrg# Substitute a variable $(am__untar) that extract such
15135dfecf96Smrg# a tarball read from stdin.
15145dfecf96Smrg#     $(am__untar) < result.tar
15155dfecf96SmrgAC_DEFUN([_AM_PROG_TAR],
15165dfecf96Smrg[# Always define AMTAR for backward compatibility.
15175dfecf96SmrgAM_MISSING_PROG([AMTAR], [tar])
15185dfecf96Smrgm4_if([$1], [v7],
15195dfecf96Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
15205dfecf96Smrg     [m4_case([$1], [ustar],, [pax],,
15215dfecf96Smrg              [m4_fatal([Unknown tar format])])
15225dfecf96SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
15235dfecf96Smrg# Loop over all known methods to create a tar archive until one works.
15245dfecf96Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
15255dfecf96Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
15265dfecf96Smrg# Do not fold the above two line into one, because Tru64 sh and
15275dfecf96Smrg# Solaris sh will not grok spaces in the rhs of `-'.
15285dfecf96Smrgfor _am_tool in $_am_tools
15295dfecf96Smrgdo
15305dfecf96Smrg  case $_am_tool in
15315dfecf96Smrg  gnutar)
15325dfecf96Smrg    for _am_tar in tar gnutar gtar;
15335dfecf96Smrg    do
15345dfecf96Smrg      AM_RUN_LOG([$_am_tar --version]) && break
15355dfecf96Smrg    done
15365dfecf96Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
15375dfecf96Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
15385dfecf96Smrg    am__untar="$_am_tar -xf -"
15395dfecf96Smrg    ;;
15405dfecf96Smrg  plaintar)
15415dfecf96Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
15425dfecf96Smrg    # ustar tarball either.
15435dfecf96Smrg    (tar --version) >/dev/null 2>&1 && continue
15445dfecf96Smrg    am__tar='tar chf - "$$tardir"'
15455dfecf96Smrg    am__tar_='tar chf - "$tardir"'
15465dfecf96Smrg    am__untar='tar xf -'
15475dfecf96Smrg    ;;
15485dfecf96Smrg  pax)
15495dfecf96Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
15505dfecf96Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
15515dfecf96Smrg    am__untar='pax -r'
15525dfecf96Smrg    ;;
15535dfecf96Smrg  cpio)
15545dfecf96Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
15555dfecf96Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
15565dfecf96Smrg    am__untar='cpio -i -H $1 -d'
15575dfecf96Smrg    ;;
15585dfecf96Smrg  none)
15595dfecf96Smrg    am__tar=false
15605dfecf96Smrg    am__tar_=false
15615dfecf96Smrg    am__untar=false
15625dfecf96Smrg    ;;
15635dfecf96Smrg  esac
15645dfecf96Smrg
15655dfecf96Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
15665dfecf96Smrg  # and am__untar set.
15675dfecf96Smrg  test -n "${am_cv_prog_tar_$1}" && break
15685dfecf96Smrg
15695dfecf96Smrg  # tar/untar a dummy directory, and stop if the command works
15705dfecf96Smrg  rm -rf conftest.dir
15715dfecf96Smrg  mkdir conftest.dir
15725dfecf96Smrg  echo GrepMe > conftest.dir/file
15735dfecf96Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
15745dfecf96Smrg  rm -rf conftest.dir
15755dfecf96Smrg  if test -s conftest.tar; then
15765dfecf96Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
15775dfecf96Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
15785dfecf96Smrg  fi
15795dfecf96Smrgdone
15805dfecf96Smrgrm -rf conftest.dir
15815dfecf96Smrg
15825dfecf96SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
15835dfecf96SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
15845dfecf96SmrgAC_SUBST([am__tar])
15855dfecf96SmrgAC_SUBST([am__untar])
15865dfecf96Smrg]) # _AM_PROG_TAR
15875dfecf96Smrg
1588