191a17321Smrg# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
291a17321Smrg
391a17321Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
491a17321Smrg# 2005  Free Software Foundation, Inc.
591a17321Smrg# This file is free software; the Free Software Foundation
691a17321Smrg# gives unlimited permission to copy and/or distribute it,
791a17321Smrg# with or without modifications, as long as this notice is preserved.
891a17321Smrg
991a17321Smrg# This program is distributed in the hope that it will be useful,
1091a17321Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1191a17321Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1291a17321Smrg# PARTICULAR PURPOSE.
1391a17321Smrg
1491a17321Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1591a17321Smrg# 
1691a17321Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1791a17321Smrg#
1891a17321Smrg# This program is free software; you can redistribute it and/or modify
1991a17321Smrg# it under the terms of the GNU General Public License as published by
2091a17321Smrg# the Free Software Foundation; either version 2 of the License, or
2191a17321Smrg# (at your option) any later version.
2291a17321Smrg#
2391a17321Smrg# This program is distributed in the hope that it will be useful, but
2491a17321Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2591a17321Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2691a17321Smrg# General Public License for more details.
2791a17321Smrg#
2891a17321Smrg# You should have received a copy of the GNU General Public License
2991a17321Smrg# along with this program; if not, write to the Free Software
3091a17321Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3191a17321Smrg#
3291a17321Smrg# As a special exception to the GNU General Public License, if you
3391a17321Smrg# distribute this file as part of a program that contains a
3491a17321Smrg# configuration script generated by Autoconf, you may include it under
3591a17321Smrg# the same distribution terms that you use for the rest of that program.
3691a17321Smrg
3791a17321Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
3891a17321Smrg# ----------------------------------
3991a17321SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
4091a17321Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
4191a17321Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
4291a17321SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
4391a17321Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
4491a17321Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
4591a17321Smrgfi
4691a17321Smrgif test -n "$PKG_CONFIG"; then
4791a17321Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
4891a17321Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
4991a17321Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
5091a17321Smrg		AC_MSG_RESULT([yes])
5191a17321Smrg	else
5291a17321Smrg		AC_MSG_RESULT([no])
5391a17321Smrg		PKG_CONFIG=""
5491a17321Smrg	fi
5591a17321Smrg		
5691a17321Smrgfi[]dnl
5791a17321Smrg])# PKG_PROG_PKG_CONFIG
5891a17321Smrg
5991a17321Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
6091a17321Smrg#
6191a17321Smrg# Check to see whether a particular set of modules exists.  Similar
6291a17321Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
6391a17321Smrg#
6491a17321Smrg#
6591a17321Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
6691a17321Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
6791a17321Smrg# PKG_CHECK_EXISTS manually
6891a17321Smrg# --------------------------------------------------------------
6991a17321SmrgAC_DEFUN([PKG_CHECK_EXISTS],
7091a17321Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
7191a17321Smrgif test -n "$PKG_CONFIG" && \
7291a17321Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
7391a17321Smrg  m4_ifval([$2], [$2], [:])
7491a17321Smrgm4_ifvaln([$3], [else
7591a17321Smrg  $3])dnl
7691a17321Smrgfi])
7791a17321Smrg
7891a17321Smrg
7991a17321Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8091a17321Smrg# ---------------------------------------------
8191a17321Smrgm4_define([_PKG_CONFIG],
8291a17321Smrg[if test -n "$PKG_CONFIG"; then
8391a17321Smrg    if test -n "$$1"; then
8491a17321Smrg        pkg_cv_[]$1="$$1"
8591a17321Smrg    else
8691a17321Smrg        PKG_CHECK_EXISTS([$3],
8791a17321Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8891a17321Smrg			 [pkg_failed=yes])
8991a17321Smrg    fi
9091a17321Smrgelse
9191a17321Smrg	pkg_failed=untried
9291a17321Smrgfi[]dnl
9391a17321Smrg])# _PKG_CONFIG
9491a17321Smrg
9591a17321Smrg# _PKG_SHORT_ERRORS_SUPPORTED
9691a17321Smrg# -----------------------------
9791a17321SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9891a17321Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9991a17321Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
10091a17321Smrg        _pkg_short_errors_supported=yes
10191a17321Smrgelse
10291a17321Smrg        _pkg_short_errors_supported=no
10391a17321Smrgfi[]dnl
10491a17321Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
10591a17321Smrg
10691a17321Smrg
10791a17321Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
10891a17321Smrg# [ACTION-IF-NOT-FOUND])
10991a17321Smrg#
11091a17321Smrg#
11191a17321Smrg# Note that if there is a possibility the first call to
11291a17321Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
11391a17321Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
11491a17321Smrg#
11591a17321Smrg#
11691a17321Smrg# --------------------------------------------------------------
11791a17321SmrgAC_DEFUN([PKG_CHECK_MODULES],
11891a17321Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
11991a17321SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
12091a17321SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
12191a17321Smrg
12291a17321Smrgpkg_failed=no
12391a17321SmrgAC_MSG_CHECKING([for $1])
12491a17321Smrg
12591a17321Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
12691a17321Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
12791a17321Smrg
12891a17321Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
12991a17321Smrgand $1[]_LIBS to avoid the need to call pkg-config.
13091a17321SmrgSee the pkg-config man page for more details.])
13191a17321Smrg
13291a17321Smrgif test $pkg_failed = yes; then
13391a17321Smrg        _PKG_SHORT_ERRORS_SUPPORTED
13491a17321Smrg        if test $_pkg_short_errors_supported = yes; then
13591a17321Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
13691a17321Smrg        else 
13791a17321Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
13891a17321Smrg        fi
13991a17321Smrg	# Put the nasty error message in config.log where it belongs
14091a17321Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
14191a17321Smrg
14291a17321Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
14391a17321Smrg[Package requirements ($2) were not met:
14491a17321Smrg
14591a17321Smrg$$1_PKG_ERRORS
14691a17321Smrg
14791a17321SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
14891a17321Smrginstalled software in a non-standard prefix.
14991a17321Smrg
15091a17321Smrg_PKG_TEXT
15191a17321Smrg])],
15291a17321Smrg		[$4])
15391a17321Smrgelif test $pkg_failed = untried; then
15491a17321Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
15591a17321Smrg[The pkg-config script could not be found or is too old.  Make sure it
15691a17321Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
15791a17321Smrgpath to pkg-config.
15891a17321Smrg
15991a17321Smrg_PKG_TEXT
16091a17321Smrg
16191a17321SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
16291a17321Smrg		[$4])
16391a17321Smrgelse
16491a17321Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
16591a17321Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
16691a17321Smrg        AC_MSG_RESULT([yes])
16791a17321Smrg	ifelse([$3], , :, [$3])
16891a17321Smrgfi[]dnl
16991a17321Smrg])# PKG_CHECK_MODULES
17091a17321Smrg
17191a17321Smrgdnl $Id: aclocal.m4,v 1.1.1.1 2008/07/30 04:38:39 mrg Exp $
17291a17321Smrgdnl
17391a17321Smrgdnl Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
17491a17321Smrgdnl 
17591a17321Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
17691a17321Smrgdnl documentation for any purpose is hereby granted without fee, provided that
17791a17321Smrgdnl the above copyright notice appear in all copies and that both that
17891a17321Smrgdnl copyright notice and this permission notice appear in supporting
17991a17321Smrgdnl documentation.
18091a17321Smrgdnl 
18191a17321Smrgdnl The above copyright notice and this permission notice shall be included
18291a17321Smrgdnl in all copies or substantial portions of the Software.
18391a17321Smrgdnl 
18491a17321Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18591a17321Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18691a17321Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18791a17321Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18891a17321Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18991a17321Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19091a17321Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
19191a17321Smrgdnl 
19291a17321Smrgdnl Except as contained in this notice, the name of the copyright holders shall
19391a17321Smrgdnl not be used in advertising or otherwise to promote the sale, use or
19491a17321Smrgdnl other dealings in this Software without prior written authorization
19591a17321Smrgdnl from the copyright holders.
19691a17321Smrgdnl 
19791a17321Smrg
19891a17321Smrg# XORG_PROG_RAWCPP()
19991a17321Smrg# ------------------
20091a17321Smrg# Find cpp program and necessary flags for use in pre-processing text files
20191a17321Smrg# such as man pages and config files
20291a17321SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
20391a17321SmrgAC_REQUIRE([AC_PROG_CPP])
20491a17321SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
20591a17321Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
20691a17321Smrg
20791a17321Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
20891a17321Smrg# which is not the best choice for supporting other OS'es, but covers most
20991a17321Smrg# of the ones we need for now.
21091a17321SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
21191a17321SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
21291a17321Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
21391a17321Smrg	AC_MSG_RESULT([no])
21491a17321Smrgelse
21591a17321Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
21691a17321Smrg		RAWCPPFLAGS=-undef
21791a17321Smrg		AC_MSG_RESULT([yes])
21891a17321Smrg	else
21991a17321Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
22091a17321Smrg	fi
22191a17321Smrgfi
22291a17321Smrgrm -f conftest.$ac_ext
22391a17321Smrg
22491a17321SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
22591a17321SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
22691a17321Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
22791a17321Smrg	AC_MSG_RESULT([no])
22891a17321Smrgelse
22991a17321Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
23091a17321Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
23191a17321Smrg		AC_MSG_RESULT([yes])
23291a17321Smrg	else
23391a17321Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
23491a17321Smrg	fi
23591a17321Smrgfi
23691a17321Smrgrm -f conftest.$ac_ext
23791a17321SmrgAC_SUBST(RAWCPPFLAGS)
23891a17321Smrg]) # XORG_PROG_RAWCPP
23991a17321Smrg
24091a17321Smrg# XORG_MANPAGE_SECTIONS()
24191a17321Smrg# -----------------------
24291a17321Smrg# Determine which sections man pages go in for the different man page types
24391a17321Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
24491a17321Smrg# Not sure if there's any better way than just hardcoding by OS name.
24591a17321Smrg# Override default settings by setting environment variables
24691a17321Smrg
24791a17321SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
24891a17321SmrgAC_REQUIRE([AC_CANONICAL_HOST])
24991a17321Smrg
25091a17321Smrgif test x$APP_MAN_SUFFIX = x    ; then
25191a17321Smrg    case $host_os in
25291a17321Smrg	linux*)	APP_MAN_SUFFIX=1x ;;
25391a17321Smrg	*)	APP_MAN_SUFFIX=1  ;;
25491a17321Smrg    esac
25591a17321Smrgfi
25691a17321Smrgif test x$APP_MAN_DIR = x    ; then
25791a17321Smrg    case $host_os in
25891a17321Smrg	linux*)	APP_MAN_DIR='$(mandir)/man1' ;;
25991a17321Smrg	*)	APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;;
26091a17321Smrg    esac
26191a17321Smrgfi
26291a17321Smrg
26391a17321Smrgif test x$LIB_MAN_SUFFIX = x    ; then
26491a17321Smrg    case $host_os in
26591a17321Smrg	linux*)	LIB_MAN_SUFFIX=3x ;;
26691a17321Smrg	*)	LIB_MAN_SUFFIX=3  ;;
26791a17321Smrg    esac
26891a17321Smrgfi
26991a17321Smrgif test x$LIB_MAN_DIR = x    ; then
27091a17321Smrg    case $host_os in
27191a17321Smrg	linux*)	LIB_MAN_DIR='$(mandir)/man3' ;;
27291a17321Smrg	*)	LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;;
27391a17321Smrg    esac
27491a17321Smrgfi
27591a17321Smrg
27691a17321Smrgif test x$FILE_MAN_SUFFIX = x    ; then
27791a17321Smrg    case $host_os in
27891a17321Smrg	linux*)		FILE_MAN_SUFFIX=5x ;;
27991a17321Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
28091a17321Smrg	*)		FILE_MAN_SUFFIX=5  ;;
28191a17321Smrg    esac
28291a17321Smrgfi
28391a17321Smrgif test x$FILE_MAN_DIR = x    ; then
28491a17321Smrg    case $host_os in
28591a17321Smrg	linux*)	FILE_MAN_DIR='$(mandir)/man5' ;;
28691a17321Smrg	*)	FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;;
28791a17321Smrg    esac
28891a17321Smrgfi
28991a17321Smrg
29091a17321Smrg# In Imake's linux.cf, the misc man suffix & dir was only changed for 
29191a17321Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here
29291a17321Smrgif test x$MISC_MAN_SUFFIX = x    ; then
29391a17321Smrg    case $host_os in
29491a17321Smrg#	linux*)		MISC_MAN_SUFFIX=7x ;;
29591a17321Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
29691a17321Smrg	*)		MISC_MAN_SUFFIX=7  ;;
29791a17321Smrg    esac
29891a17321Smrgfi
29991a17321Smrgif test x$MISC_MAN_DIR = x    ; then
30091a17321Smrg    case $host_os in
30191a17321Smrg#	linux*)	MISC_MAN_DIR='$(mandir)/man7' ;;
30291a17321Smrg	*)	MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;;
30391a17321Smrg    esac
30491a17321Smrgfi
30591a17321Smrg
30691a17321Smrg# In Imake's linux.cf, the driver man suffix & dir was only changed for 
30791a17321Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here
30891a17321Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
30991a17321Smrg    case $host_os in
31091a17321Smrg#	linux*)		DRIVER_MAN_SUFFIX=4x ;;
31191a17321Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
31291a17321Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
31391a17321Smrg    esac
31491a17321Smrgfi
31591a17321Smrgif test x$DRIVER_MAN_DIR = x    ; then
31691a17321Smrg    case $host_os in
31791a17321Smrg#	linux*)	DRIVER_MAN_DIR='$(mandir)/man4' ;;
31891a17321Smrg	*)	DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;;
31991a17321Smrg    esac
32091a17321Smrgfi
32191a17321Smrg
32291a17321Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
32391a17321Smrg    case $host_os in
32491a17321Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
32591a17321Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
32691a17321Smrg    esac
32791a17321Smrgfi
32891a17321Smrgif test x$ADMIN_MAN_DIR = x    ; then
32991a17321Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
33091a17321Smrgfi
33191a17321Smrg
33291a17321Smrg
33391a17321SmrgAC_SUBST([APP_MAN_SUFFIX])
33491a17321SmrgAC_SUBST([LIB_MAN_SUFFIX])
33591a17321SmrgAC_SUBST([FILE_MAN_SUFFIX])
33691a17321SmrgAC_SUBST([MISC_MAN_SUFFIX])
33791a17321SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
33891a17321SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
33991a17321SmrgAC_SUBST([APP_MAN_DIR])
34091a17321SmrgAC_SUBST([LIB_MAN_DIR])
34191a17321SmrgAC_SUBST([FILE_MAN_DIR])
34291a17321SmrgAC_SUBST([MISC_MAN_DIR])
34391a17321SmrgAC_SUBST([DRIVER_MAN_DIR])
34491a17321SmrgAC_SUBST([ADMIN_MAN_DIR])
34591a17321Smrg]) # XORG_MANPAGE_SECTIONS
34691a17321Smrg
34791a17321Smrg# XORG_CHECK_LINUXDOC
34891a17321Smrg# -------------------
34991a17321Smrg# Defines the variable MAKE_TEXT if the necessary tools and
35091a17321Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
35191a17321Smrg# Whether or not the necessary tools and files are found can be checked
35291a17321Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
35391a17321SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
35491a17321SmrgAC_CHECK_FILE(
35591a17321Smrg	[$prefix/share/X11/sgml/defs.ent], 
35691a17321Smrg	[DEFS_ENT_PATH=$prefix/share/X11/sgml],
35791a17321Smrg	[DEFS_ENT_PATH=]
35891a17321Smrg)
35991a17321Smrg
36091a17321SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
36191a17321SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
36291a17321Smrg
36391a17321SmrgAC_MSG_CHECKING([Whether to build documentation])
36491a17321Smrg
36591a17321Smrgif test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then
36691a17321Smrg   BUILDDOC=yes
36791a17321Smrgelse
36891a17321Smrg   BUILDDOC=no
36991a17321Smrgfi
37091a17321Smrg
37191a17321SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
37291a17321Smrg
37391a17321SmrgAC_MSG_RESULT([$BUILDDOC])
37491a17321Smrg
37591a17321SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
37691a17321Smrg
37791a17321Smrgif test x$PS2PDF != x ; then
37891a17321Smrg   BUILDPDFDOC=yes
37991a17321Smrgelse
38091a17321Smrg   BUILDPDFDOC=no
38191a17321Smrgfi
38291a17321Smrg
38391a17321SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
38491a17321Smrg
38591a17321SmrgAC_MSG_RESULT([$BUILDPDFDOC])
38691a17321Smrg
38791a17321SmrgMAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
38891a17321SmrgMAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
38991a17321SmrgMAKE_PDF="$PS2PDF"
39091a17321SmrgMAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC  -B html --split=0"
39191a17321Smrg
39291a17321SmrgAC_SUBST(MAKE_TEXT)
39391a17321SmrgAC_SUBST(MAKE_PS)
39491a17321SmrgAC_SUBST(MAKE_PDF)
39591a17321SmrgAC_SUBST(MAKE_HTML)
39691a17321Smrg]) # XORG_CHECK_LINUXDOC
39791a17321Smrg
39891a17321Smrg# XORG_CHECK_MALLOC_ZERO
39991a17321Smrg# ----------------------
40091a17321Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
40191a17321Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
40291a17321Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
40391a17321SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
40491a17321SmrgAC_ARG_ENABLE(malloc0returnsnull,
40591a17321Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
40691a17321Smrg		       [malloc(0) returns NULL (default: auto)]),
40791a17321Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
40891a17321Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
40991a17321Smrg
41091a17321SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
41191a17321Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
41291a17321Smrg	AC_RUN_IFELSE([
41391a17321Smrgchar *malloc();
41491a17321Smrgchar *realloc();
41591a17321Smrgchar *calloc();
41691a17321Smrgmain() {
41791a17321Smrg    char *m0, *r0, *c0, *p;
41891a17321Smrg    m0 = malloc(0);
41991a17321Smrg    p = malloc(10);
42091a17321Smrg    r0 = realloc(p,0);
42191a17321Smrg    c0 = calloc(0);
42291a17321Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
42391a17321Smrg}],
42491a17321Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
42591a17321Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
42691a17321Smrgfi
42791a17321SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
42891a17321Smrg
42991a17321Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
43091a17321Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
43191a17321Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
43291a17321Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
43391a17321Smrgelse
43491a17321Smrg	MALLOC_ZERO_CFLAGS=""
43591a17321Smrg	XMALLOC_ZERO_CFLAGS=""
43691a17321Smrg	XTMALLOC_ZERO_CFLAGS=""
43791a17321Smrgfi
43891a17321Smrg
43991a17321SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
44091a17321SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
44191a17321SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
44291a17321Smrg]) # XORG_CHECK_MALLOC_ZERO
44391a17321Smrg
44491a17321Smrgdnl Copyright 2005 Red Hat, Inc
44591a17321Smrgdnl
44691a17321Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
44791a17321Smrgdnl documentation for any purpose is hereby granted without fee, provided that
44891a17321Smrgdnl the above copyright notice appear in all copies and that both that
44991a17321Smrgdnl copyright notice and this permission notice appear in supporting
45091a17321Smrgdnl documentation.
45191a17321Smrgdnl
45291a17321Smrgdnl The above copyright notice and this permission notice shall be included
45391a17321Smrgdnl in all copies or substantial portions of the Software.
45491a17321Smrgdnl
45591a17321Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
45691a17321Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
45791a17321Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45891a17321Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
45991a17321Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
46091a17321Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
46191a17321Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
46291a17321Smrgdnl
46391a17321Smrgdnl Except as contained in this notice, the name of the copyright holders shall
46491a17321Smrgdnl not be used in advertising or otherwise to promote the sale, use or
46591a17321Smrgdnl other dealings in this Software without prior written authorization
46691a17321Smrgdnl from the copyright holders.
46791a17321Smrgdnl
46891a17321Smrg
46991a17321Smrg# XORG_RELEASE_VERSION
47091a17321Smrg# --------------------
47191a17321Smrg# Adds --with/without-release-string and changes the PACKAGE and
47291a17321Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
47391a17321Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.
47491a17321Smrg 
47591a17321SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
47691a17321Smrg	AC_ARG_WITH(release-version,
47791a17321Smrg			AC_HELP_STRING([--with-release-version=STRING],
47891a17321Smrg				[Use release version string in package name]),
47991a17321Smrg			[RELEASE_VERSION="$withval"],
48091a17321Smrg			[RELEASE_VERSION=""])
48191a17321Smrg	if test "x$RELEASE_VERSION" != "x"; then
48291a17321Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
48391a17321Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
48491a17321Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
48591a17321Smrg	fi
48691a17321Smrg])
48791a17321Smrg
48891a17321Smrg# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
48991a17321Smrg#
49091a17321Smrg# This file is free software; the Free Software Foundation
49191a17321Smrg# gives unlimited permission to copy and/or distribute it,
49291a17321Smrg# with or without modifications, as long as this notice is preserved.
49391a17321Smrg
49491a17321Smrg# AM_AUTOMAKE_VERSION(VERSION)
49591a17321Smrg# ----------------------------
49691a17321Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
49791a17321Smrg# generated from the m4 files accompanying Automake X.Y.
49891a17321SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
49991a17321Smrg
50091a17321Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
50191a17321Smrg# -------------------------------
50291a17321Smrg# Call AM_AUTOMAKE_VERSION so it can be traced.
50391a17321Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
50491a17321SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
50591a17321Smrg	 [AM_AUTOMAKE_VERSION([1.9.6])])
50691a17321Smrg
50791a17321Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
50891a17321Smrg
50991a17321Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
51091a17321Smrg#
51191a17321Smrg# This file is free software; the Free Software Foundation
51291a17321Smrg# gives unlimited permission to copy and/or distribute it,
51391a17321Smrg# with or without modifications, as long as this notice is preserved.
51491a17321Smrg
51591a17321Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
51691a17321Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
51791a17321Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
51891a17321Smrg#
51991a17321Smrg# Of course, Automake must honor this variable whenever it calls a
52091a17321Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
52191a17321Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
52291a17321Smrg# depending on how configure is run.  This is pretty annoying, since
52391a17321Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
52491a17321Smrg# source directory, any form will work fine, but in subdirectories a
52591a17321Smrg# relative path needs to be adjusted first.
52691a17321Smrg#
52791a17321Smrg# $ac_aux_dir/missing
52891a17321Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
52991a17321Smrg# $top_srcdir/$ac_aux_dir/missing
53091a17321Smrg#    fails if $ac_aux_dir is absolute,
53191a17321Smrg#    fails when called from a subdirectory in a VPATH build with
53291a17321Smrg#          a relative $ac_aux_dir
53391a17321Smrg#
53491a17321Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
53591a17321Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
53691a17321Smrg# harmless because $srcdir is `.', but things will broke when you
53791a17321Smrg# start a VPATH build or use an absolute $srcdir.
53891a17321Smrg#
53991a17321Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
54091a17321Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
54191a17321Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
54291a17321Smrg# and then we would define $MISSING as
54391a17321Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
54491a17321Smrg# This will work as long as MISSING is not called from configure, because
54591a17321Smrg# unfortunately $(top_srcdir) has no meaning in configure.
54691a17321Smrg# However there are other variables, like CC, which are often used in
54791a17321Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
54891a17321Smrg#
54991a17321Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
55091a17321Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
55191a17321Smrg# configured tree to be moved without reconfiguration.
55291a17321Smrg
55391a17321SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
55491a17321Smrg[dnl Rely on autoconf to set up CDPATH properly.
55591a17321SmrgAC_PREREQ([2.50])dnl
55691a17321Smrg# expand $ac_aux_dir to an absolute path
55791a17321Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
55891a17321Smrg])
55991a17321Smrg
56091a17321Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
56191a17321Smrg
56291a17321Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
56391a17321Smrg# Free Software Foundation, Inc.
56491a17321Smrg#
56591a17321Smrg# This file is free software; the Free Software Foundation
56691a17321Smrg# gives unlimited permission to copy and/or distribute it,
56791a17321Smrg# with or without modifications, as long as this notice is preserved.
56891a17321Smrg
56991a17321Smrg# serial 7
57091a17321Smrg
57191a17321Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
57291a17321Smrg# -------------------------------------
57391a17321Smrg# Define a conditional.
57491a17321SmrgAC_DEFUN([AM_CONDITIONAL],
57591a17321Smrg[AC_PREREQ(2.52)dnl
57691a17321Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
57791a17321Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
57891a17321SmrgAC_SUBST([$1_TRUE])
57991a17321SmrgAC_SUBST([$1_FALSE])
58091a17321Smrgif $2; then
58191a17321Smrg  $1_TRUE=
58291a17321Smrg  $1_FALSE='#'
58391a17321Smrgelse
58491a17321Smrg  $1_TRUE='#'
58591a17321Smrg  $1_FALSE=
58691a17321Smrgfi
58791a17321SmrgAC_CONFIG_COMMANDS_PRE(
58891a17321Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
58991a17321Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
59091a17321SmrgUsually this means the macro was only invoked conditionally.]])
59191a17321Smrgfi])])
59291a17321Smrg
59391a17321Smrg
59491a17321Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
59591a17321Smrg# Free Software Foundation, Inc.
59691a17321Smrg#
59791a17321Smrg# This file is free software; the Free Software Foundation
59891a17321Smrg# gives unlimited permission to copy and/or distribute it,
59991a17321Smrg# with or without modifications, as long as this notice is preserved.
60091a17321Smrg
60191a17321Smrg# serial 8
60291a17321Smrg
60391a17321Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
60491a17321Smrg# written in clear, in which case automake, when reading aclocal.m4,
60591a17321Smrg# will think it sees a *use*, and therefore will trigger all it's
60691a17321Smrg# C support machinery.  Also note that it means that autoscan, seeing
60791a17321Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
60891a17321Smrg
60991a17321Smrg
61091a17321Smrg# _AM_DEPENDENCIES(NAME)
61191a17321Smrg# ----------------------
61291a17321Smrg# See how the compiler implements dependency checking.
61391a17321Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
61491a17321Smrg# We try a few techniques and use that to set a single cache variable.
61591a17321Smrg#
61691a17321Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
61791a17321Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
61891a17321Smrg# dependency, and given that the user is not expected to run this macro,
61991a17321Smrg# just rely on AC_PROG_CC.
62091a17321SmrgAC_DEFUN([_AM_DEPENDENCIES],
62191a17321Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
62291a17321SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
62391a17321SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
62491a17321SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
62591a17321Smrg
62691a17321Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
62791a17321Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
62891a17321Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
62991a17321Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
63091a17321Smrg                   [depcc="$$1"   am_compiler_list=])
63191a17321Smrg
63291a17321SmrgAC_CACHE_CHECK([dependency style of $depcc],
63391a17321Smrg               [am_cv_$1_dependencies_compiler_type],
63491a17321Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
63591a17321Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
63691a17321Smrg  # making bogus files that we don't know about and never remove.  For
63791a17321Smrg  # instance it was reported that on HP-UX the gcc test will end up
63891a17321Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
63991a17321Smrg  # in D'.
64091a17321Smrg  mkdir conftest.dir
64191a17321Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
64291a17321Smrg  # using a relative directory.
64391a17321Smrg  cp "$am_depcomp" conftest.dir
64491a17321Smrg  cd conftest.dir
64591a17321Smrg  # We will build objects and dependencies in a subdirectory because
64691a17321Smrg  # it helps to detect inapplicable dependency modes.  For instance
64791a17321Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
64891a17321Smrg  # side effect of compilation, but ICC will put the dependencies in
64991a17321Smrg  # the current directory while Tru64 will put them in the object
65091a17321Smrg  # directory.
65191a17321Smrg  mkdir sub
65291a17321Smrg
65391a17321Smrg  am_cv_$1_dependencies_compiler_type=none
65491a17321Smrg  if test "$am_compiler_list" = ""; then
65591a17321Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
65691a17321Smrg  fi
65791a17321Smrg  for depmode in $am_compiler_list; do
65891a17321Smrg    # Setup a source with many dependencies, because some compilers
65991a17321Smrg    # like to wrap large dependency lists on column 80 (with \), and
66091a17321Smrg    # we should not choose a depcomp mode which is confused by this.
66191a17321Smrg    #
66291a17321Smrg    # We need to recreate these files for each test, as the compiler may
66391a17321Smrg    # overwrite some of them when testing with obscure command lines.
66491a17321Smrg    # This happens at least with the AIX C compiler.
66591a17321Smrg    : > sub/conftest.c
66691a17321Smrg    for i in 1 2 3 4 5 6; do
66791a17321Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
66891a17321Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
66991a17321Smrg      # Solaris 8's {/usr,}/bin/sh.
67091a17321Smrg      touch sub/conftst$i.h
67191a17321Smrg    done
67291a17321Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
67391a17321Smrg
67491a17321Smrg    case $depmode in
67591a17321Smrg    nosideeffect)
67691a17321Smrg      # after this tag, mechanisms are not by side-effect, so they'll
67791a17321Smrg      # only be used when explicitly requested
67891a17321Smrg      if test "x$enable_dependency_tracking" = xyes; then
67991a17321Smrg	continue
68091a17321Smrg      else
68191a17321Smrg	break
68291a17321Smrg      fi
68391a17321Smrg      ;;
68491a17321Smrg    none) break ;;
68591a17321Smrg    esac
68691a17321Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
68791a17321Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
68891a17321Smrg    # handle `-M -o', and we need to detect this.
68991a17321Smrg    if depmode=$depmode \
69091a17321Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
69191a17321Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
69291a17321Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
69391a17321Smrg         >/dev/null 2>conftest.err &&
69491a17321Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
69591a17321Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
69691a17321Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
69791a17321Smrg      # icc doesn't choke on unknown options, it will just issue warnings
69891a17321Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
69991a17321Smrg      # that says an option was ignored or not supported.
70091a17321Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
70191a17321Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
70291a17321Smrg      # The diagnosis changed in icc 8.0:
70391a17321Smrg      #   icc: Command line remark: option '-MP' not supported
70491a17321Smrg      if (grep 'ignoring option' conftest.err ||
70591a17321Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
70691a17321Smrg        am_cv_$1_dependencies_compiler_type=$depmode
70791a17321Smrg        break
70891a17321Smrg      fi
70991a17321Smrg    fi
71091a17321Smrg  done
71191a17321Smrg
71291a17321Smrg  cd ..
71391a17321Smrg  rm -rf conftest.dir
71491a17321Smrgelse
71591a17321Smrg  am_cv_$1_dependencies_compiler_type=none
71691a17321Smrgfi
71791a17321Smrg])
71891a17321SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
71991a17321SmrgAM_CONDITIONAL([am__fastdep$1], [
72091a17321Smrg  test "x$enable_dependency_tracking" != xno \
72191a17321Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
72291a17321Smrg])
72391a17321Smrg
72491a17321Smrg
72591a17321Smrg# AM_SET_DEPDIR
72691a17321Smrg# -------------
72791a17321Smrg# Choose a directory name for dependency files.
72891a17321Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
72991a17321SmrgAC_DEFUN([AM_SET_DEPDIR],
73091a17321Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
73191a17321SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
73291a17321Smrg])
73391a17321Smrg
73491a17321Smrg
73591a17321Smrg# AM_DEP_TRACK
73691a17321Smrg# ------------
73791a17321SmrgAC_DEFUN([AM_DEP_TRACK],
73891a17321Smrg[AC_ARG_ENABLE(dependency-tracking,
73991a17321Smrg[  --disable-dependency-tracking  speeds up one-time build
74091a17321Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
74191a17321Smrgif test "x$enable_dependency_tracking" != xno; then
74291a17321Smrg  am_depcomp="$ac_aux_dir/depcomp"
74391a17321Smrg  AMDEPBACKSLASH='\'
74491a17321Smrgfi
74591a17321SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
74691a17321SmrgAC_SUBST([AMDEPBACKSLASH])
74791a17321Smrg])
74891a17321Smrg
74991a17321Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
75091a17321Smrg
75191a17321Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
75291a17321Smrg# Free Software Foundation, Inc.
75391a17321Smrg#
75491a17321Smrg# This file is free software; the Free Software Foundation
75591a17321Smrg# gives unlimited permission to copy and/or distribute it,
75691a17321Smrg# with or without modifications, as long as this notice is preserved.
75791a17321Smrg
75891a17321Smrg#serial 3
75991a17321Smrg
76091a17321Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
76191a17321Smrg# ------------------------------
76291a17321SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
76391a17321Smrg[for mf in $CONFIG_FILES; do
76491a17321Smrg  # Strip MF so we end up with the name of the file.
76591a17321Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
76691a17321Smrg  # Check whether this is an Automake generated Makefile or not.
76791a17321Smrg  # We used to match only the files named `Makefile.in', but
76891a17321Smrg  # some people rename them; so instead we look at the file content.
76991a17321Smrg  # Grep'ing the first line is not enough: some people post-process
77091a17321Smrg  # each Makefile.in and add a new line on top of each file to say so.
77191a17321Smrg  # So let's grep whole file.
77291a17321Smrg  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
77391a17321Smrg    dirpart=`AS_DIRNAME("$mf")`
77491a17321Smrg  else
77591a17321Smrg    continue
77691a17321Smrg  fi
77791a17321Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
77891a17321Smrg  # from the Makefile without running `make'.
77991a17321Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
78091a17321Smrg  test -z "$DEPDIR" && continue
78191a17321Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
78291a17321Smrg  test -z "am__include" && continue
78391a17321Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
78491a17321Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
78591a17321Smrg  U=`sed -n 's/^U = //p' < "$mf"`
78691a17321Smrg  # Find all dependency output files, they are included files with
78791a17321Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
78891a17321Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
78991a17321Smrg  # expansion.
79091a17321Smrg  for file in `sed -n "
79191a17321Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
79291a17321Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
79391a17321Smrg    # Make sure the directory exists.
79491a17321Smrg    test -f "$dirpart/$file" && continue
79591a17321Smrg    fdir=`AS_DIRNAME(["$file"])`
79691a17321Smrg    AS_MKDIR_P([$dirpart/$fdir])
79791a17321Smrg    # echo "creating $dirpart/$file"
79891a17321Smrg    echo '# dummy' > "$dirpart/$file"
79991a17321Smrg  done
80091a17321Smrgdone
80191a17321Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
80291a17321Smrg
80391a17321Smrg
80491a17321Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
80591a17321Smrg# -----------------------------
80691a17321Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
80791a17321Smrg#
80891a17321Smrg# This code is only required when automatic dependency tracking
80991a17321Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
81091a17321Smrg# need in order to bootstrap the dependency handling code.
81191a17321SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
81291a17321Smrg[AC_CONFIG_COMMANDS([depfiles],
81391a17321Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
81491a17321Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
81591a17321Smrg])
81691a17321Smrg
81791a17321Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
81891a17321Smrg# Free Software Foundation, Inc.
81991a17321Smrg#
82091a17321Smrg# This file is free software; the Free Software Foundation
82191a17321Smrg# gives unlimited permission to copy and/or distribute it,
82291a17321Smrg# with or without modifications, as long as this notice is preserved.
82391a17321Smrg
82491a17321Smrg# serial 8
82591a17321Smrg
82691a17321Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
82791a17321SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
82891a17321Smrg
82991a17321Smrg# Do all the work for Automake.                             -*- Autoconf -*-
83091a17321Smrg
83191a17321Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
83291a17321Smrg# Free Software Foundation, Inc.
83391a17321Smrg#
83491a17321Smrg# This file is free software; the Free Software Foundation
83591a17321Smrg# gives unlimited permission to copy and/or distribute it,
83691a17321Smrg# with or without modifications, as long as this notice is preserved.
83791a17321Smrg
83891a17321Smrg# serial 12
83991a17321Smrg
84091a17321Smrg# This macro actually does too much.  Some checks are only needed if
84191a17321Smrg# your package does certain things.  But this isn't really a big deal.
84291a17321Smrg
84391a17321Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
84491a17321Smrg# AM_INIT_AUTOMAKE([OPTIONS])
84591a17321Smrg# -----------------------------------------------
84691a17321Smrg# The call with PACKAGE and VERSION arguments is the old style
84791a17321Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
84891a17321Smrg# and VERSION should now be passed to AC_INIT and removed from
84991a17321Smrg# the call to AM_INIT_AUTOMAKE.
85091a17321Smrg# We support both call styles for the transition.  After
85191a17321Smrg# the next Automake release, Autoconf can make the AC_INIT
85291a17321Smrg# arguments mandatory, and then we can depend on a new Autoconf
85391a17321Smrg# release and drop the old call support.
85491a17321SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
85591a17321Smrg[AC_PREREQ([2.58])dnl
85691a17321Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
85791a17321Smrgdnl the ones we care about.
85891a17321Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
85991a17321SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
86091a17321SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
86191a17321Smrg# test to see if srcdir already configured
86291a17321Smrgif test "`cd $srcdir && pwd`" != "`pwd`" &&
86391a17321Smrg   test -f $srcdir/config.status; then
86491a17321Smrg  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
86591a17321Smrgfi
86691a17321Smrg
86791a17321Smrg# test whether we have cygpath
86891a17321Smrgif test -z "$CYGPATH_W"; then
86991a17321Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
87091a17321Smrg    CYGPATH_W='cygpath -w'
87191a17321Smrg  else
87291a17321Smrg    CYGPATH_W=echo
87391a17321Smrg  fi
87491a17321Smrgfi
87591a17321SmrgAC_SUBST([CYGPATH_W])
87691a17321Smrg
87791a17321Smrg# Define the identity of the package.
87891a17321Smrgdnl Distinguish between old-style and new-style calls.
87991a17321Smrgm4_ifval([$2],
88091a17321Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
88191a17321Smrg AC_SUBST([PACKAGE], [$1])dnl
88291a17321Smrg AC_SUBST([VERSION], [$2])],
88391a17321Smrg[_AM_SET_OPTIONS([$1])dnl
88491a17321Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
88591a17321Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
88691a17321Smrg
88791a17321Smrg_AM_IF_OPTION([no-define],,
88891a17321Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
88991a17321Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
89091a17321Smrg
89191a17321Smrg# Some tools Automake needs.
89291a17321SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
89391a17321SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
89491a17321SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
89591a17321SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
89691a17321SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
89791a17321SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
89891a17321SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
89991a17321SmrgAM_PROG_INSTALL_SH
90091a17321SmrgAM_PROG_INSTALL_STRIP
90191a17321SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
90291a17321Smrg# We need awk for the "check" target.  The system "awk" is bad on
90391a17321Smrg# some platforms.
90491a17321SmrgAC_REQUIRE([AC_PROG_AWK])dnl
90591a17321SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
90691a17321SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
90791a17321Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
90891a17321Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
90991a17321Smrg	      		     [_AM_PROG_TAR([v7])])])
91091a17321Smrg_AM_IF_OPTION([no-dependencies],,
91191a17321Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
91291a17321Smrg                  [_AM_DEPENDENCIES(CC)],
91391a17321Smrg                  [define([AC_PROG_CC],
91491a17321Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
91591a17321SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
91691a17321Smrg                  [_AM_DEPENDENCIES(CXX)],
91791a17321Smrg                  [define([AC_PROG_CXX],
91891a17321Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
91991a17321Smrg])
92091a17321Smrg])
92191a17321Smrg
92291a17321Smrg
92391a17321Smrg# When config.status generates a header, we must update the stamp-h file.
92491a17321Smrg# This file resides in the same directory as the config header
92591a17321Smrg# that is generated.  The stamp files are numbered to have different names.
92691a17321Smrg
92791a17321Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
92891a17321Smrg# loop where config.status creates the headers, so we can generate
92991a17321Smrg# our stamp files there.
93091a17321SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
93191a17321Smrg[# Compute $1's index in $config_headers.
93291a17321Smrg_am_stamp_count=1
93391a17321Smrgfor _am_header in $config_headers :; do
93491a17321Smrg  case $_am_header in
93591a17321Smrg    $1 | $1:* )
93691a17321Smrg      break ;;
93791a17321Smrg    * )
93891a17321Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
93991a17321Smrg  esac
94091a17321Smrgdone
94191a17321Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
94291a17321Smrg
94391a17321Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
94491a17321Smrg#
94591a17321Smrg# This file is free software; the Free Software Foundation
94691a17321Smrg# gives unlimited permission to copy and/or distribute it,
94791a17321Smrg# with or without modifications, as long as this notice is preserved.
94891a17321Smrg
94991a17321Smrg# AM_PROG_INSTALL_SH
95091a17321Smrg# ------------------
95191a17321Smrg# Define $install_sh.
95291a17321SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
95391a17321Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
95491a17321Smrginstall_sh=${install_sh-"$am_aux_dir/install-sh"}
95591a17321SmrgAC_SUBST(install_sh)])
95691a17321Smrg
95791a17321Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
95891a17321Smrg#
95991a17321Smrg# This file is free software; the Free Software Foundation
96091a17321Smrg# gives unlimited permission to copy and/or distribute it,
96191a17321Smrg# with or without modifications, as long as this notice is preserved.
96291a17321Smrg
96391a17321Smrg# serial 2
96491a17321Smrg
96591a17321Smrg# Check whether the underlying file-system supports filenames
96691a17321Smrg# with a leading dot.  For instance MS-DOS doesn't.
96791a17321SmrgAC_DEFUN([AM_SET_LEADING_DOT],
96891a17321Smrg[rm -rf .tst 2>/dev/null
96991a17321Smrgmkdir .tst 2>/dev/null
97091a17321Smrgif test -d .tst; then
97191a17321Smrg  am__leading_dot=.
97291a17321Smrgelse
97391a17321Smrg  am__leading_dot=_
97491a17321Smrgfi
97591a17321Smrgrmdir .tst 2>/dev/null
97691a17321SmrgAC_SUBST([am__leading_dot])])
97791a17321Smrg
97891a17321Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
97991a17321Smrg# From Jim Meyering
98091a17321Smrg
98191a17321Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
98291a17321Smrg# Free Software Foundation, Inc.
98391a17321Smrg#
98491a17321Smrg# This file is free software; the Free Software Foundation
98591a17321Smrg# gives unlimited permission to copy and/or distribute it,
98691a17321Smrg# with or without modifications, as long as this notice is preserved.
98791a17321Smrg
98891a17321Smrg# serial 4
98991a17321Smrg
99091a17321SmrgAC_DEFUN([AM_MAINTAINER_MODE],
99191a17321Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
99291a17321Smrg  dnl maintainer-mode is disabled by default
99391a17321Smrg  AC_ARG_ENABLE(maintainer-mode,
99491a17321Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
99591a17321Smrg			  (and sometimes confusing) to the casual installer],
99691a17321Smrg      USE_MAINTAINER_MODE=$enableval,
99791a17321Smrg      USE_MAINTAINER_MODE=no)
99891a17321Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
99991a17321Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
100091a17321Smrg  MAINT=$MAINTAINER_MODE_TRUE
100191a17321Smrg  AC_SUBST(MAINT)dnl
100291a17321Smrg]
100391a17321Smrg)
100491a17321Smrg
100591a17321SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
100691a17321Smrg
100791a17321Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
100891a17321Smrg
100991a17321Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
101091a17321Smrg#
101191a17321Smrg# This file is free software; the Free Software Foundation
101291a17321Smrg# gives unlimited permission to copy and/or distribute it,
101391a17321Smrg# with or without modifications, as long as this notice is preserved.
101491a17321Smrg
101591a17321Smrg# serial 3
101691a17321Smrg
101791a17321Smrg# AM_MAKE_INCLUDE()
101891a17321Smrg# -----------------
101991a17321Smrg# Check to see how make treats includes.
102091a17321SmrgAC_DEFUN([AM_MAKE_INCLUDE],
102191a17321Smrg[am_make=${MAKE-make}
102291a17321Smrgcat > confinc << 'END'
102391a17321Smrgam__doit:
102491a17321Smrg	@echo done
102591a17321Smrg.PHONY: am__doit
102691a17321SmrgEND
102791a17321Smrg# If we don't find an include directive, just comment out the code.
102891a17321SmrgAC_MSG_CHECKING([for style of include used by $am_make])
102991a17321Smrgam__include="#"
103091a17321Smrgam__quote=
103191a17321Smrg_am_result=none
103291a17321Smrg# First try GNU make style include.
103391a17321Smrgecho "include confinc" > confmf
103491a17321Smrg# We grep out `Entering directory' and `Leaving directory'
103591a17321Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
103691a17321Smrg# In particular we don't look at `^make:' because GNU make might
103791a17321Smrg# be invoked under some other name (usually "gmake"), in which
103891a17321Smrg# case it prints its new name instead of `make'.
103991a17321Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
104091a17321Smrg   am__include=include
104191a17321Smrg   am__quote=
104291a17321Smrg   _am_result=GNU
104391a17321Smrgfi
104491a17321Smrg# Now try BSD make style include.
104591a17321Smrgif test "$am__include" = "#"; then
104691a17321Smrg   echo '.include "confinc"' > confmf
104791a17321Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
104891a17321Smrg      am__include=.include
104991a17321Smrg      am__quote="\""
105091a17321Smrg      _am_result=BSD
105191a17321Smrg   fi
105291a17321Smrgfi
105391a17321SmrgAC_SUBST([am__include])
105491a17321SmrgAC_SUBST([am__quote])
105591a17321SmrgAC_MSG_RESULT([$_am_result])
105691a17321Smrgrm -f confinc confmf
105791a17321Smrg])
105891a17321Smrg
105991a17321Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
106091a17321Smrg
106191a17321Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
106291a17321Smrg# Free Software Foundation, Inc.
106391a17321Smrg#
106491a17321Smrg# This file is free software; the Free Software Foundation
106591a17321Smrg# gives unlimited permission to copy and/or distribute it,
106691a17321Smrg# with or without modifications, as long as this notice is preserved.
106791a17321Smrg
106891a17321Smrg# serial 4
106991a17321Smrg
107091a17321Smrg# AM_MISSING_PROG(NAME, PROGRAM)
107191a17321Smrg# ------------------------------
107291a17321SmrgAC_DEFUN([AM_MISSING_PROG],
107391a17321Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
107491a17321Smrg$1=${$1-"${am_missing_run}$2"}
107591a17321SmrgAC_SUBST($1)])
107691a17321Smrg
107791a17321Smrg
107891a17321Smrg# AM_MISSING_HAS_RUN
107991a17321Smrg# ------------------
108091a17321Smrg# Define MISSING if not defined so far and test if it supports --run.
108191a17321Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
108291a17321SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
108391a17321Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
108491a17321Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
108591a17321Smrg# Use eval to expand $SHELL
108691a17321Smrgif eval "$MISSING --run true"; then
108791a17321Smrg  am_missing_run="$MISSING --run "
108891a17321Smrgelse
108991a17321Smrg  am_missing_run=
109091a17321Smrg  AC_MSG_WARN([`missing' script is too old or missing])
109191a17321Smrgfi
109291a17321Smrg])
109391a17321Smrg
109491a17321Smrg# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
109591a17321Smrg#
109691a17321Smrg# This file is free software; the Free Software Foundation
109791a17321Smrg# gives unlimited permission to copy and/or distribute it,
109891a17321Smrg# with or without modifications, as long as this notice is preserved.
109991a17321Smrg
110091a17321Smrg# AM_PROG_MKDIR_P
110191a17321Smrg# ---------------
110291a17321Smrg# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
110391a17321Smrg#
110491a17321Smrg# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
110591a17321Smrg# created by `make install' are always world readable, even if the
110691a17321Smrg# installer happens to have an overly restrictive umask (e.g. 077).
110791a17321Smrg# This was a mistake.  There are at least two reasons why we must not
110891a17321Smrg# use `-m 0755':
110991a17321Smrg#   - it causes special bits like SGID to be ignored,
111091a17321Smrg#   - it may be too restrictive (some setups expect 775 directories).
111191a17321Smrg#
111291a17321Smrg# Do not use -m 0755 and let people choose whatever they expect by
111391a17321Smrg# setting umask.
111491a17321Smrg#
111591a17321Smrg# We cannot accept any implementation of `mkdir' that recognizes `-p'.
111691a17321Smrg# Some implementations (such as Solaris 8's) are not thread-safe: if a
111791a17321Smrg# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
111891a17321Smrg# concurrently, both version can detect that a/ is missing, but only
111991a17321Smrg# one can create it and the other will error out.  Consequently we
112091a17321Smrg# restrict ourselves to GNU make (using the --version option ensures
112191a17321Smrg# this.)
112291a17321SmrgAC_DEFUN([AM_PROG_MKDIR_P],
112391a17321Smrg[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
112491a17321Smrg  # We used to keeping the `.' as first argument, in order to
112591a17321Smrg  # allow $(mkdir_p) to be used without argument.  As in
112691a17321Smrg  #   $(mkdir_p) $(somedir)
112791a17321Smrg  # where $(somedir) is conditionally defined.  However this is wrong
112891a17321Smrg  # for two reasons:
112991a17321Smrg  #  1. if the package is installed by a user who cannot write `.'
113091a17321Smrg  #     make install will fail,
113191a17321Smrg  #  2. the above comment should most certainly read
113291a17321Smrg  #     $(mkdir_p) $(DESTDIR)$(somedir)
113391a17321Smrg  #     so it does not work when $(somedir) is undefined and
113491a17321Smrg  #     $(DESTDIR) is not.
113591a17321Smrg  #  To support the latter case, we have to write
113691a17321Smrg  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
113791a17321Smrg  #  so the `.' trick is pointless.
113891a17321Smrg  mkdir_p='mkdir -p --'
113991a17321Smrgelse
114091a17321Smrg  # On NextStep and OpenStep, the `mkdir' command does not
114191a17321Smrg  # recognize any option.  It will interpret all options as
114291a17321Smrg  # directories to create, and then abort because `.' already
114391a17321Smrg  # exists.
114491a17321Smrg  for d in ./-p ./--version;
114591a17321Smrg  do
114691a17321Smrg    test -d $d && rmdir $d
114791a17321Smrg  done
114891a17321Smrg  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
114991a17321Smrg  if test -f "$ac_aux_dir/mkinstalldirs"; then
115091a17321Smrg    mkdir_p='$(mkinstalldirs)'
115191a17321Smrg  else
115291a17321Smrg    mkdir_p='$(install_sh) -d'
115391a17321Smrg  fi
115491a17321Smrgfi
115591a17321SmrgAC_SUBST([mkdir_p])])
115691a17321Smrg
115791a17321Smrg# Helper functions for option handling.                     -*- Autoconf -*-
115891a17321Smrg
115991a17321Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
116091a17321Smrg#
116191a17321Smrg# This file is free software; the Free Software Foundation
116291a17321Smrg# gives unlimited permission to copy and/or distribute it,
116391a17321Smrg# with or without modifications, as long as this notice is preserved.
116491a17321Smrg
116591a17321Smrg# serial 3
116691a17321Smrg
116791a17321Smrg# _AM_MANGLE_OPTION(NAME)
116891a17321Smrg# -----------------------
116991a17321SmrgAC_DEFUN([_AM_MANGLE_OPTION],
117091a17321Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
117191a17321Smrg
117291a17321Smrg# _AM_SET_OPTION(NAME)
117391a17321Smrg# ------------------------------
117491a17321Smrg# Set option NAME.  Presently that only means defining a flag for this option.
117591a17321SmrgAC_DEFUN([_AM_SET_OPTION],
117691a17321Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
117791a17321Smrg
117891a17321Smrg# _AM_SET_OPTIONS(OPTIONS)
117991a17321Smrg# ----------------------------------
118091a17321Smrg# OPTIONS is a space-separated list of Automake options.
118191a17321SmrgAC_DEFUN([_AM_SET_OPTIONS],
118291a17321Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
118391a17321Smrg
118491a17321Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
118591a17321Smrg# -------------------------------------------
118691a17321Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
118791a17321SmrgAC_DEFUN([_AM_IF_OPTION],
118891a17321Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
118991a17321Smrg
119091a17321Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
119191a17321Smrg
119291a17321Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
119391a17321Smrg# Free Software Foundation, Inc.
119491a17321Smrg#
119591a17321Smrg# This file is free software; the Free Software Foundation
119691a17321Smrg# gives unlimited permission to copy and/or distribute it,
119791a17321Smrg# with or without modifications, as long as this notice is preserved.
119891a17321Smrg
119991a17321Smrg# serial 4
120091a17321Smrg
120191a17321Smrg# AM_SANITY_CHECK
120291a17321Smrg# ---------------
120391a17321SmrgAC_DEFUN([AM_SANITY_CHECK],
120491a17321Smrg[AC_MSG_CHECKING([whether build environment is sane])
120591a17321Smrg# Just in case
120691a17321Smrgsleep 1
120791a17321Smrgecho timestamp > conftest.file
120891a17321Smrg# Do `set' in a subshell so we don't clobber the current shell's
120991a17321Smrg# arguments.  Must try -L first in case configure is actually a
121091a17321Smrg# symlink; some systems play weird games with the mod time of symlinks
121191a17321Smrg# (eg FreeBSD returns the mod time of the symlink's containing
121291a17321Smrg# directory).
121391a17321Smrgif (
121491a17321Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
121591a17321Smrg   if test "$[*]" = "X"; then
121691a17321Smrg      # -L didn't work.
121791a17321Smrg      set X `ls -t $srcdir/configure conftest.file`
121891a17321Smrg   fi
121991a17321Smrg   rm -f conftest.file
122091a17321Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
122191a17321Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
122291a17321Smrg
122391a17321Smrg      # If neither matched, then we have a broken ls.  This can happen
122491a17321Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
122591a17321Smrg      # broken ls alias from the environment.  This has actually
122691a17321Smrg      # happened.  Such a system could not be considered "sane".
122791a17321Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
122891a17321Smrgalias in your environment])
122991a17321Smrg   fi
123091a17321Smrg
123191a17321Smrg   test "$[2]" = conftest.file
123291a17321Smrg   )
123391a17321Smrgthen
123491a17321Smrg   # Ok.
123591a17321Smrg   :
123691a17321Smrgelse
123791a17321Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
123891a17321SmrgCheck your system clock])
123991a17321Smrgfi
124091a17321SmrgAC_MSG_RESULT(yes)])
124191a17321Smrg
124291a17321Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
124391a17321Smrg#
124491a17321Smrg# This file is free software; the Free Software Foundation
124591a17321Smrg# gives unlimited permission to copy and/or distribute it,
124691a17321Smrg# with or without modifications, as long as this notice is preserved.
124791a17321Smrg
124891a17321Smrg# AM_PROG_INSTALL_STRIP
124991a17321Smrg# ---------------------
125091a17321Smrg# One issue with vendor `install' (even GNU) is that you can't
125191a17321Smrg# specify the program used to strip binaries.  This is especially
125291a17321Smrg# annoying in cross-compiling environments, where the build's strip
125391a17321Smrg# is unlikely to handle the host's binaries.
125491a17321Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
125591a17321Smrg# always use install-sh in `make install-strip', and initialize
125691a17321Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
125791a17321SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
125891a17321Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
125991a17321Smrg# Installed binaries are usually stripped using `strip' when the user
126091a17321Smrg# run `make install-strip'.  However `strip' might not be the right
126191a17321Smrg# tool to use in cross-compilation environments, therefore Automake
126291a17321Smrg# will honor the `STRIP' environment variable to overrule this program.
126391a17321Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
126491a17321Smrgif test "$cross_compiling" != no; then
126591a17321Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
126691a17321Smrgfi
126791a17321SmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
126891a17321SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
126991a17321Smrg
127091a17321Smrg# Check how to create a tarball.                            -*- Autoconf -*-
127191a17321Smrg
127291a17321Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
127391a17321Smrg#
127491a17321Smrg# This file is free software; the Free Software Foundation
127591a17321Smrg# gives unlimited permission to copy and/or distribute it,
127691a17321Smrg# with or without modifications, as long as this notice is preserved.
127791a17321Smrg
127891a17321Smrg# serial 2
127991a17321Smrg
128091a17321Smrg# _AM_PROG_TAR(FORMAT)
128191a17321Smrg# --------------------
128291a17321Smrg# Check how to create a tarball in format FORMAT.
128391a17321Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
128491a17321Smrg#
128591a17321Smrg# Substitute a variable $(am__tar) that is a command
128691a17321Smrg# writing to stdout a FORMAT-tarball containing the directory
128791a17321Smrg# $tardir.
128891a17321Smrg#     tardir=directory && $(am__tar) > result.tar
128991a17321Smrg#
129091a17321Smrg# Substitute a variable $(am__untar) that extract such
129191a17321Smrg# a tarball read from stdin.
129291a17321Smrg#     $(am__untar) < result.tar
129391a17321SmrgAC_DEFUN([_AM_PROG_TAR],
129491a17321Smrg[# Always define AMTAR for backward compatibility.
129591a17321SmrgAM_MISSING_PROG([AMTAR], [tar])
129691a17321Smrgm4_if([$1], [v7],
129791a17321Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
129891a17321Smrg     [m4_case([$1], [ustar],, [pax],,
129991a17321Smrg              [m4_fatal([Unknown tar format])])
130091a17321SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
130191a17321Smrg# Loop over all known methods to create a tar archive until one works.
130291a17321Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
130391a17321Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
130491a17321Smrg# Do not fold the above two line into one, because Tru64 sh and
130591a17321Smrg# Solaris sh will not grok spaces in the rhs of `-'.
130691a17321Smrgfor _am_tool in $_am_tools
130791a17321Smrgdo
130891a17321Smrg  case $_am_tool in
130991a17321Smrg  gnutar)
131091a17321Smrg    for _am_tar in tar gnutar gtar;
131191a17321Smrg    do
131291a17321Smrg      AM_RUN_LOG([$_am_tar --version]) && break
131391a17321Smrg    done
131491a17321Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
131591a17321Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
131691a17321Smrg    am__untar="$_am_tar -xf -"
131791a17321Smrg    ;;
131891a17321Smrg  plaintar)
131991a17321Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
132091a17321Smrg    # ustar tarball either.
132191a17321Smrg    (tar --version) >/dev/null 2>&1 && continue
132291a17321Smrg    am__tar='tar chf - "$$tardir"'
132391a17321Smrg    am__tar_='tar chf - "$tardir"'
132491a17321Smrg    am__untar='tar xf -'
132591a17321Smrg    ;;
132691a17321Smrg  pax)
132791a17321Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
132891a17321Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
132991a17321Smrg    am__untar='pax -r'
133091a17321Smrg    ;;
133191a17321Smrg  cpio)
133291a17321Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
133391a17321Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
133491a17321Smrg    am__untar='cpio -i -H $1 -d'
133591a17321Smrg    ;;
133691a17321Smrg  none)
133791a17321Smrg    am__tar=false
133891a17321Smrg    am__tar_=false
133991a17321Smrg    am__untar=false
134091a17321Smrg    ;;
134191a17321Smrg  esac
134291a17321Smrg
134391a17321Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
134491a17321Smrg  # and am__untar set.
134591a17321Smrg  test -n "${am_cv_prog_tar_$1}" && break
134691a17321Smrg
134791a17321Smrg  # tar/untar a dummy directory, and stop if the command works
134891a17321Smrg  rm -rf conftest.dir
134991a17321Smrg  mkdir conftest.dir
135091a17321Smrg  echo GrepMe > conftest.dir/file
135191a17321Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
135291a17321Smrg  rm -rf conftest.dir
135391a17321Smrg  if test -s conftest.tar; then
135491a17321Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
135591a17321Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
135691a17321Smrg  fi
135791a17321Smrgdone
135891a17321Smrgrm -rf conftest.dir
135991a17321Smrg
136091a17321SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
136191a17321SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
136291a17321SmrgAC_SUBST([am__tar])
136391a17321SmrgAC_SUBST([am__untar])
136491a17321Smrg]) # _AM_PROG_TAR
136591a17321Smrg
1366