aclocal.m4 revision 14c0a534
114c0a534Smrg# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
214c0a534Smrg
314c0a534Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
414c0a534Smrg# 2005  Free Software Foundation, Inc.
514c0a534Smrg# This file is free software; the Free Software Foundation
614c0a534Smrg# gives unlimited permission to copy and/or distribute it,
714c0a534Smrg# with or without modifications, as long as this notice is preserved.
814c0a534Smrg
914c0a534Smrg# This program is distributed in the hope that it will be useful,
1014c0a534Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1114c0a534Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1214c0a534Smrg# PARTICULAR PURPOSE.
1314c0a534Smrg
1414c0a534Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1514c0a534Smrg# 
1614c0a534Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1714c0a534Smrg#
1814c0a534Smrg# This program is free software; you can redistribute it and/or modify
1914c0a534Smrg# it under the terms of the GNU General Public License as published by
2014c0a534Smrg# the Free Software Foundation; either version 2 of the License, or
2114c0a534Smrg# (at your option) any later version.
2214c0a534Smrg#
2314c0a534Smrg# This program is distributed in the hope that it will be useful, but
2414c0a534Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2514c0a534Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2614c0a534Smrg# General Public License for more details.
2714c0a534Smrg#
2814c0a534Smrg# You should have received a copy of the GNU General Public License
2914c0a534Smrg# along with this program; if not, write to the Free Software
3014c0a534Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3114c0a534Smrg#
3214c0a534Smrg# As a special exception to the GNU General Public License, if you
3314c0a534Smrg# distribute this file as part of a program that contains a
3414c0a534Smrg# configuration script generated by Autoconf, you may include it under
3514c0a534Smrg# the same distribution terms that you use for the rest of that program.
3614c0a534Smrg
3714c0a534Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
3814c0a534Smrg# ----------------------------------
3914c0a534SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
4014c0a534Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
4114c0a534Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
4214c0a534SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
4314c0a534Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
4414c0a534Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
4514c0a534Smrgfi
4614c0a534Smrgif test -n "$PKG_CONFIG"; then
4714c0a534Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
4814c0a534Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
4914c0a534Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
5014c0a534Smrg		AC_MSG_RESULT([yes])
5114c0a534Smrg	else
5214c0a534Smrg		AC_MSG_RESULT([no])
5314c0a534Smrg		PKG_CONFIG=""
5414c0a534Smrg	fi
5514c0a534Smrg		
5614c0a534Smrgfi[]dnl
5714c0a534Smrg])# PKG_PROG_PKG_CONFIG
5814c0a534Smrg
5914c0a534Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
6014c0a534Smrg#
6114c0a534Smrg# Check to see whether a particular set of modules exists.  Similar
6214c0a534Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
6314c0a534Smrg#
6414c0a534Smrg#
6514c0a534Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
6614c0a534Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
6714c0a534Smrg# PKG_CHECK_EXISTS manually
6814c0a534Smrg# --------------------------------------------------------------
6914c0a534SmrgAC_DEFUN([PKG_CHECK_EXISTS],
7014c0a534Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
7114c0a534Smrgif test -n "$PKG_CONFIG" && \
7214c0a534Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
7314c0a534Smrg  m4_ifval([$2], [$2], [:])
7414c0a534Smrgm4_ifvaln([$3], [else
7514c0a534Smrg  $3])dnl
7614c0a534Smrgfi])
7714c0a534Smrg
7814c0a534Smrg
7914c0a534Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8014c0a534Smrg# ---------------------------------------------
8114c0a534Smrgm4_define([_PKG_CONFIG],
8214c0a534Smrg[if test -n "$PKG_CONFIG"; then
8314c0a534Smrg    if test -n "$$1"; then
8414c0a534Smrg        pkg_cv_[]$1="$$1"
8514c0a534Smrg    else
8614c0a534Smrg        PKG_CHECK_EXISTS([$3],
8714c0a534Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8814c0a534Smrg			 [pkg_failed=yes])
8914c0a534Smrg    fi
9014c0a534Smrgelse
9114c0a534Smrg	pkg_failed=untried
9214c0a534Smrgfi[]dnl
9314c0a534Smrg])# _PKG_CONFIG
9414c0a534Smrg
9514c0a534Smrg# _PKG_SHORT_ERRORS_SUPPORTED
9614c0a534Smrg# -----------------------------
9714c0a534SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9814c0a534Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9914c0a534Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
10014c0a534Smrg        _pkg_short_errors_supported=yes
10114c0a534Smrgelse
10214c0a534Smrg        _pkg_short_errors_supported=no
10314c0a534Smrgfi[]dnl
10414c0a534Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
10514c0a534Smrg
10614c0a534Smrg
10714c0a534Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
10814c0a534Smrg# [ACTION-IF-NOT-FOUND])
10914c0a534Smrg#
11014c0a534Smrg#
11114c0a534Smrg# Note that if there is a possibility the first call to
11214c0a534Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
11314c0a534Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
11414c0a534Smrg#
11514c0a534Smrg#
11614c0a534Smrg# --------------------------------------------------------------
11714c0a534SmrgAC_DEFUN([PKG_CHECK_MODULES],
11814c0a534Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
11914c0a534SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
12014c0a534SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
12114c0a534Smrg
12214c0a534Smrgpkg_failed=no
12314c0a534SmrgAC_MSG_CHECKING([for $1])
12414c0a534Smrg
12514c0a534Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
12614c0a534Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
12714c0a534Smrg
12814c0a534Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
12914c0a534Smrgand $1[]_LIBS to avoid the need to call pkg-config.
13014c0a534SmrgSee the pkg-config man page for more details.])
13114c0a534Smrg
13214c0a534Smrgif test $pkg_failed = yes; then
13314c0a534Smrg        _PKG_SHORT_ERRORS_SUPPORTED
13414c0a534Smrg        if test $_pkg_short_errors_supported = yes; then
13514c0a534Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
13614c0a534Smrg        else 
13714c0a534Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
13814c0a534Smrg        fi
13914c0a534Smrg	# Put the nasty error message in config.log where it belongs
14014c0a534Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
14114c0a534Smrg
14214c0a534Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
14314c0a534Smrg[Package requirements ($2) were not met:
14414c0a534Smrg
14514c0a534Smrg$$1_PKG_ERRORS
14614c0a534Smrg
14714c0a534SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
14814c0a534Smrginstalled software in a non-standard prefix.
14914c0a534Smrg
15014c0a534Smrg_PKG_TEXT
15114c0a534Smrg])],
15214c0a534Smrg		[$4])
15314c0a534Smrgelif test $pkg_failed = untried; then
15414c0a534Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
15514c0a534Smrg[The pkg-config script could not be found or is too old.  Make sure it
15614c0a534Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
15714c0a534Smrgpath to pkg-config.
15814c0a534Smrg
15914c0a534Smrg_PKG_TEXT
16014c0a534Smrg
16114c0a534SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
16214c0a534Smrg		[$4])
16314c0a534Smrgelse
16414c0a534Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
16514c0a534Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
16614c0a534Smrg        AC_MSG_RESULT([yes])
16714c0a534Smrg	ifelse([$3], , :, [$3])
16814c0a534Smrgfi[]dnl
16914c0a534Smrg])# PKG_CHECK_MODULES
17014c0a534Smrg
17114c0a534Smrgdnl $Id: aclocal.m4,v 1.1.1.1 2008/07/30 04:10:42 mrg Exp $
17214c0a534Smrgdnl
17314c0a534Smrgdnl Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
17414c0a534Smrgdnl 
17514c0a534Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
17614c0a534Smrgdnl documentation for any purpose is hereby granted without fee, provided that
17714c0a534Smrgdnl the above copyright notice appear in all copies and that both that
17814c0a534Smrgdnl copyright notice and this permission notice appear in supporting
17914c0a534Smrgdnl documentation.
18014c0a534Smrgdnl 
18114c0a534Smrgdnl The above copyright notice and this permission notice shall be included
18214c0a534Smrgdnl in all copies or substantial portions of the Software.
18314c0a534Smrgdnl 
18414c0a534Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18514c0a534Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18614c0a534Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18714c0a534Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18814c0a534Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18914c0a534Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19014c0a534Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
19114c0a534Smrgdnl 
19214c0a534Smrgdnl Except as contained in this notice, the name of the copyright holders shall
19314c0a534Smrgdnl not be used in advertising or otherwise to promote the sale, use or
19414c0a534Smrgdnl other dealings in this Software without prior written authorization
19514c0a534Smrgdnl from the copyright holders.
19614c0a534Smrgdnl 
19714c0a534Smrg
19814c0a534Smrg# XORG_PROG_RAWCPP()
19914c0a534Smrg# ------------------
20014c0a534Smrg# Find cpp program and necessary flags for use in pre-processing text files
20114c0a534Smrg# such as man pages and config files
20214c0a534SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
20314c0a534SmrgAC_REQUIRE([AC_PROG_CPP])
20414c0a534SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
20514c0a534Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
20614c0a534Smrg
20714c0a534Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
20814c0a534Smrg# which is not the best choice for supporting other OS'es, but covers most
20914c0a534Smrg# of the ones we need for now.
21014c0a534SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
21114c0a534SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
21214c0a534Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
21314c0a534Smrg	AC_MSG_RESULT([no])
21414c0a534Smrgelse
21514c0a534Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
21614c0a534Smrg		RAWCPPFLAGS=-undef
21714c0a534Smrg		AC_MSG_RESULT([yes])
21814c0a534Smrg	else
21914c0a534Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
22014c0a534Smrg	fi
22114c0a534Smrgfi
22214c0a534Smrgrm -f conftest.$ac_ext
22314c0a534Smrg
22414c0a534SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
22514c0a534SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
22614c0a534Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
22714c0a534Smrg	AC_MSG_RESULT([no])
22814c0a534Smrgelse
22914c0a534Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
23014c0a534Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
23114c0a534Smrg		AC_MSG_RESULT([yes])
23214c0a534Smrg	else
23314c0a534Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
23414c0a534Smrg	fi
23514c0a534Smrgfi
23614c0a534Smrgrm -f conftest.$ac_ext
23714c0a534SmrgAC_SUBST(RAWCPPFLAGS)
23814c0a534Smrg]) # XORG_PROG_RAWCPP
23914c0a534Smrg
24014c0a534Smrg# XORG_MANPAGE_SECTIONS()
24114c0a534Smrg# -----------------------
24214c0a534Smrg# Determine which sections man pages go in for the different man page types
24314c0a534Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
24414c0a534Smrg# Not sure if there's any better way than just hardcoding by OS name.
24514c0a534Smrg# Override default settings by setting environment variables
24614c0a534Smrg
24714c0a534SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
24814c0a534SmrgAC_REQUIRE([AC_CANONICAL_HOST])
24914c0a534Smrg
25014c0a534Smrgif test x$APP_MAN_SUFFIX = x    ; then
25114c0a534Smrg    case $host_os in
25214c0a534Smrg	linux*)	APP_MAN_SUFFIX=1x ;;
25314c0a534Smrg	*)	APP_MAN_SUFFIX=1  ;;
25414c0a534Smrg    esac
25514c0a534Smrgfi
25614c0a534Smrgif test x$APP_MAN_DIR = x    ; then
25714c0a534Smrg    case $host_os in
25814c0a534Smrg	linux*)	APP_MAN_DIR='$(mandir)/man1' ;;
25914c0a534Smrg	*)	APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;;
26014c0a534Smrg    esac
26114c0a534Smrgfi
26214c0a534Smrg
26314c0a534Smrgif test x$LIB_MAN_SUFFIX = x    ; then
26414c0a534Smrg    case $host_os in
26514c0a534Smrg	linux*)	LIB_MAN_SUFFIX=3x ;;
26614c0a534Smrg	*)	LIB_MAN_SUFFIX=3  ;;
26714c0a534Smrg    esac
26814c0a534Smrgfi
26914c0a534Smrgif test x$LIB_MAN_DIR = x    ; then
27014c0a534Smrg    case $host_os in
27114c0a534Smrg	linux*)	LIB_MAN_DIR='$(mandir)/man3' ;;
27214c0a534Smrg	*)	LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;;
27314c0a534Smrg    esac
27414c0a534Smrgfi
27514c0a534Smrg
27614c0a534Smrgif test x$FILE_MAN_SUFFIX = x    ; then
27714c0a534Smrg    case $host_os in
27814c0a534Smrg	linux*)		FILE_MAN_SUFFIX=5x ;;
27914c0a534Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
28014c0a534Smrg	*)		FILE_MAN_SUFFIX=5  ;;
28114c0a534Smrg    esac
28214c0a534Smrgfi
28314c0a534Smrgif test x$FILE_MAN_DIR = x    ; then
28414c0a534Smrg    case $host_os in
28514c0a534Smrg	linux*)	FILE_MAN_DIR='$(mandir)/man5' ;;
28614c0a534Smrg	*)	FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;;
28714c0a534Smrg    esac
28814c0a534Smrgfi
28914c0a534Smrg
29014c0a534Smrg# In Imake's linux.cf, the misc man suffix & dir was only changed for 
29114c0a534Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here
29214c0a534Smrgif test x$MISC_MAN_SUFFIX = x    ; then
29314c0a534Smrg    case $host_os in
29414c0a534Smrg#	linux*)		MISC_MAN_SUFFIX=7x ;;
29514c0a534Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
29614c0a534Smrg	*)		MISC_MAN_SUFFIX=7  ;;
29714c0a534Smrg    esac
29814c0a534Smrgfi
29914c0a534Smrgif test x$MISC_MAN_DIR = x    ; then
30014c0a534Smrg    case $host_os in
30114c0a534Smrg#	linux*)	MISC_MAN_DIR='$(mandir)/man7' ;;
30214c0a534Smrg	*)	MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;;
30314c0a534Smrg    esac
30414c0a534Smrgfi
30514c0a534Smrg
30614c0a534Smrg# In Imake's linux.cf, the driver man suffix & dir was only changed for 
30714c0a534Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here
30814c0a534Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
30914c0a534Smrg    case $host_os in
31014c0a534Smrg#	linux*)		DRIVER_MAN_SUFFIX=4x ;;
31114c0a534Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
31214c0a534Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
31314c0a534Smrg    esac
31414c0a534Smrgfi
31514c0a534Smrgif test x$DRIVER_MAN_DIR = x    ; then
31614c0a534Smrg    case $host_os in
31714c0a534Smrg#	linux*)	DRIVER_MAN_DIR='$(mandir)/man4' ;;
31814c0a534Smrg	*)	DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;;
31914c0a534Smrg    esac
32014c0a534Smrgfi
32114c0a534Smrg
32214c0a534Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
32314c0a534Smrg    case $host_os in
32414c0a534Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
32514c0a534Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
32614c0a534Smrg    esac
32714c0a534Smrgfi
32814c0a534Smrgif test x$ADMIN_MAN_DIR = x    ; then
32914c0a534Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
33014c0a534Smrgfi
33114c0a534Smrg
33214c0a534Smrg
33314c0a534SmrgAC_SUBST([APP_MAN_SUFFIX])
33414c0a534SmrgAC_SUBST([LIB_MAN_SUFFIX])
33514c0a534SmrgAC_SUBST([FILE_MAN_SUFFIX])
33614c0a534SmrgAC_SUBST([MISC_MAN_SUFFIX])
33714c0a534SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
33814c0a534SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
33914c0a534SmrgAC_SUBST([APP_MAN_DIR])
34014c0a534SmrgAC_SUBST([LIB_MAN_DIR])
34114c0a534SmrgAC_SUBST([FILE_MAN_DIR])
34214c0a534SmrgAC_SUBST([MISC_MAN_DIR])
34314c0a534SmrgAC_SUBST([DRIVER_MAN_DIR])
34414c0a534SmrgAC_SUBST([ADMIN_MAN_DIR])
34514c0a534Smrg]) # XORG_MANPAGE_SECTIONS
34614c0a534Smrg
34714c0a534Smrg# XORG_CHECK_LINUXDOC
34814c0a534Smrg# -------------------
34914c0a534Smrg# Defines the variable MAKE_TEXT if the necessary tools and
35014c0a534Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
35114c0a534Smrg# Whether or not the necessary tools and files are found can be checked
35214c0a534Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
35314c0a534SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
35414c0a534SmrgAC_CHECK_FILE(
35514c0a534Smrg	[$prefix/share/X11/sgml/defs.ent], 
35614c0a534Smrg	[DEFS_ENT_PATH=$prefix/share/X11/sgml],
35714c0a534Smrg	[DEFS_ENT_PATH=]
35814c0a534Smrg)
35914c0a534Smrg
36014c0a534SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
36114c0a534SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
36214c0a534Smrg
36314c0a534SmrgAC_MSG_CHECKING([Whether to build documentation])
36414c0a534Smrg
36514c0a534Smrgif test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then
36614c0a534Smrg   BUILDDOC=yes
36714c0a534Smrgelse
36814c0a534Smrg   BUILDDOC=no
36914c0a534Smrgfi
37014c0a534Smrg
37114c0a534SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
37214c0a534Smrg
37314c0a534SmrgAC_MSG_RESULT([$BUILDDOC])
37414c0a534Smrg
37514c0a534SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
37614c0a534Smrg
37714c0a534Smrgif test x$PS2PDF != x ; then
37814c0a534Smrg   BUILDPDFDOC=yes
37914c0a534Smrgelse
38014c0a534Smrg   BUILDPDFDOC=no
38114c0a534Smrgfi
38214c0a534Smrg
38314c0a534SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
38414c0a534Smrg
38514c0a534SmrgAC_MSG_RESULT([$BUILDPDFDOC])
38614c0a534Smrg
38714c0a534SmrgMAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
38814c0a534SmrgMAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
38914c0a534SmrgMAKE_PDF="$PS2PDF"
39014c0a534SmrgMAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC  -B html --split=0"
39114c0a534Smrg
39214c0a534SmrgAC_SUBST(MAKE_TEXT)
39314c0a534SmrgAC_SUBST(MAKE_PS)
39414c0a534SmrgAC_SUBST(MAKE_PDF)
39514c0a534SmrgAC_SUBST(MAKE_HTML)
39614c0a534Smrg]) # XORG_CHECK_LINUXDOC
39714c0a534Smrg
39814c0a534Smrg# XORG_CHECK_MALLOC_ZERO
39914c0a534Smrg# ----------------------
40014c0a534Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
40114c0a534Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
40214c0a534Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
40314c0a534SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
40414c0a534SmrgAC_ARG_ENABLE(malloc0returnsnull,
40514c0a534Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
40614c0a534Smrg		       [malloc(0) returns NULL (default: auto)]),
40714c0a534Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
40814c0a534Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
40914c0a534Smrg
41014c0a534SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
41114c0a534Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
41214c0a534Smrg	AC_RUN_IFELSE([
41314c0a534Smrgchar *malloc();
41414c0a534Smrgchar *realloc();
41514c0a534Smrgchar *calloc();
41614c0a534Smrgmain() {
41714c0a534Smrg    char *m0, *r0, *c0, *p;
41814c0a534Smrg    m0 = malloc(0);
41914c0a534Smrg    p = malloc(10);
42014c0a534Smrg    r0 = realloc(p,0);
42114c0a534Smrg    c0 = calloc(0);
42214c0a534Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
42314c0a534Smrg}],
42414c0a534Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
42514c0a534Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
42614c0a534Smrgfi
42714c0a534SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
42814c0a534Smrg
42914c0a534Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
43014c0a534Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
43114c0a534Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
43214c0a534Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
43314c0a534Smrgelse
43414c0a534Smrg	MALLOC_ZERO_CFLAGS=""
43514c0a534Smrg	XMALLOC_ZERO_CFLAGS=""
43614c0a534Smrg	XTMALLOC_ZERO_CFLAGS=""
43714c0a534Smrgfi
43814c0a534Smrg
43914c0a534SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
44014c0a534SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
44114c0a534SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
44214c0a534Smrg]) # XORG_CHECK_MALLOC_ZERO
44314c0a534Smrg
44414c0a534Smrgdnl Copyright 2005 Red Hat, Inc
44514c0a534Smrgdnl
44614c0a534Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
44714c0a534Smrgdnl documentation for any purpose is hereby granted without fee, provided that
44814c0a534Smrgdnl the above copyright notice appear in all copies and that both that
44914c0a534Smrgdnl copyright notice and this permission notice appear in supporting
45014c0a534Smrgdnl documentation.
45114c0a534Smrgdnl
45214c0a534Smrgdnl The above copyright notice and this permission notice shall be included
45314c0a534Smrgdnl in all copies or substantial portions of the Software.
45414c0a534Smrgdnl
45514c0a534Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
45614c0a534Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
45714c0a534Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45814c0a534Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
45914c0a534Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
46014c0a534Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
46114c0a534Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
46214c0a534Smrgdnl
46314c0a534Smrgdnl Except as contained in this notice, the name of the copyright holders shall
46414c0a534Smrgdnl not be used in advertising or otherwise to promote the sale, use or
46514c0a534Smrgdnl other dealings in this Software without prior written authorization
46614c0a534Smrgdnl from the copyright holders.
46714c0a534Smrgdnl
46814c0a534Smrg
46914c0a534Smrg# XORG_RELEASE_VERSION
47014c0a534Smrg# --------------------
47114c0a534Smrg# Adds --with/without-release-string and changes the PACKAGE and
47214c0a534Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
47314c0a534Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.
47414c0a534Smrg 
47514c0a534SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
47614c0a534Smrg	AC_ARG_WITH(release-version,
47714c0a534Smrg			AC_HELP_STRING([--with-release-version=STRING],
47814c0a534Smrg				[Use release version string in package name]),
47914c0a534Smrg			[RELEASE_VERSION="$withval"],
48014c0a534Smrg			[RELEASE_VERSION=""])
48114c0a534Smrg	if test "x$RELEASE_VERSION" != "x"; then
48214c0a534Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
48314c0a534Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
48414c0a534Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
48514c0a534Smrg	fi
48614c0a534Smrg])
48714c0a534Smrg
48814c0a534Smrg# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
48914c0a534Smrg#
49014c0a534Smrg# This file is free software; the Free Software Foundation
49114c0a534Smrg# gives unlimited permission to copy and/or distribute it,
49214c0a534Smrg# with or without modifications, as long as this notice is preserved.
49314c0a534Smrg
49414c0a534Smrg# AM_AUTOMAKE_VERSION(VERSION)
49514c0a534Smrg# ----------------------------
49614c0a534Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
49714c0a534Smrg# generated from the m4 files accompanying Automake X.Y.
49814c0a534SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
49914c0a534Smrg
50014c0a534Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
50114c0a534Smrg# -------------------------------
50214c0a534Smrg# Call AM_AUTOMAKE_VERSION so it can be traced.
50314c0a534Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
50414c0a534SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
50514c0a534Smrg	 [AM_AUTOMAKE_VERSION([1.9.6])])
50614c0a534Smrg
50714c0a534Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
50814c0a534Smrg
50914c0a534Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
51014c0a534Smrg#
51114c0a534Smrg# This file is free software; the Free Software Foundation
51214c0a534Smrg# gives unlimited permission to copy and/or distribute it,
51314c0a534Smrg# with or without modifications, as long as this notice is preserved.
51414c0a534Smrg
51514c0a534Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
51614c0a534Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
51714c0a534Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
51814c0a534Smrg#
51914c0a534Smrg# Of course, Automake must honor this variable whenever it calls a
52014c0a534Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
52114c0a534Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
52214c0a534Smrg# depending on how configure is run.  This is pretty annoying, since
52314c0a534Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
52414c0a534Smrg# source directory, any form will work fine, but in subdirectories a
52514c0a534Smrg# relative path needs to be adjusted first.
52614c0a534Smrg#
52714c0a534Smrg# $ac_aux_dir/missing
52814c0a534Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
52914c0a534Smrg# $top_srcdir/$ac_aux_dir/missing
53014c0a534Smrg#    fails if $ac_aux_dir is absolute,
53114c0a534Smrg#    fails when called from a subdirectory in a VPATH build with
53214c0a534Smrg#          a relative $ac_aux_dir
53314c0a534Smrg#
53414c0a534Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
53514c0a534Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
53614c0a534Smrg# harmless because $srcdir is `.', but things will broke when you
53714c0a534Smrg# start a VPATH build or use an absolute $srcdir.
53814c0a534Smrg#
53914c0a534Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
54014c0a534Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
54114c0a534Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
54214c0a534Smrg# and then we would define $MISSING as
54314c0a534Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
54414c0a534Smrg# This will work as long as MISSING is not called from configure, because
54514c0a534Smrg# unfortunately $(top_srcdir) has no meaning in configure.
54614c0a534Smrg# However there are other variables, like CC, which are often used in
54714c0a534Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
54814c0a534Smrg#
54914c0a534Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
55014c0a534Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
55114c0a534Smrg# configured tree to be moved without reconfiguration.
55214c0a534Smrg
55314c0a534SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
55414c0a534Smrg[dnl Rely on autoconf to set up CDPATH properly.
55514c0a534SmrgAC_PREREQ([2.50])dnl
55614c0a534Smrg# expand $ac_aux_dir to an absolute path
55714c0a534Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
55814c0a534Smrg])
55914c0a534Smrg
56014c0a534Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
56114c0a534Smrg
56214c0a534Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
56314c0a534Smrg# Free Software Foundation, Inc.
56414c0a534Smrg#
56514c0a534Smrg# This file is free software; the Free Software Foundation
56614c0a534Smrg# gives unlimited permission to copy and/or distribute it,
56714c0a534Smrg# with or without modifications, as long as this notice is preserved.
56814c0a534Smrg
56914c0a534Smrg# serial 7
57014c0a534Smrg
57114c0a534Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
57214c0a534Smrg# -------------------------------------
57314c0a534Smrg# Define a conditional.
57414c0a534SmrgAC_DEFUN([AM_CONDITIONAL],
57514c0a534Smrg[AC_PREREQ(2.52)dnl
57614c0a534Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
57714c0a534Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
57814c0a534SmrgAC_SUBST([$1_TRUE])
57914c0a534SmrgAC_SUBST([$1_FALSE])
58014c0a534Smrgif $2; then
58114c0a534Smrg  $1_TRUE=
58214c0a534Smrg  $1_FALSE='#'
58314c0a534Smrgelse
58414c0a534Smrg  $1_TRUE='#'
58514c0a534Smrg  $1_FALSE=
58614c0a534Smrgfi
58714c0a534SmrgAC_CONFIG_COMMANDS_PRE(
58814c0a534Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
58914c0a534Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
59014c0a534SmrgUsually this means the macro was only invoked conditionally.]])
59114c0a534Smrgfi])])
59214c0a534Smrg
59314c0a534Smrg
59414c0a534Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
59514c0a534Smrg# Free Software Foundation, Inc.
59614c0a534Smrg#
59714c0a534Smrg# This file is free software; the Free Software Foundation
59814c0a534Smrg# gives unlimited permission to copy and/or distribute it,
59914c0a534Smrg# with or without modifications, as long as this notice is preserved.
60014c0a534Smrg
60114c0a534Smrg# serial 8
60214c0a534Smrg
60314c0a534Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
60414c0a534Smrg# written in clear, in which case automake, when reading aclocal.m4,
60514c0a534Smrg# will think it sees a *use*, and therefore will trigger all it's
60614c0a534Smrg# C support machinery.  Also note that it means that autoscan, seeing
60714c0a534Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
60814c0a534Smrg
60914c0a534Smrg
61014c0a534Smrg# _AM_DEPENDENCIES(NAME)
61114c0a534Smrg# ----------------------
61214c0a534Smrg# See how the compiler implements dependency checking.
61314c0a534Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
61414c0a534Smrg# We try a few techniques and use that to set a single cache variable.
61514c0a534Smrg#
61614c0a534Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
61714c0a534Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
61814c0a534Smrg# dependency, and given that the user is not expected to run this macro,
61914c0a534Smrg# just rely on AC_PROG_CC.
62014c0a534SmrgAC_DEFUN([_AM_DEPENDENCIES],
62114c0a534Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
62214c0a534SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
62314c0a534SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
62414c0a534SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
62514c0a534Smrg
62614c0a534Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
62714c0a534Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
62814c0a534Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
62914c0a534Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
63014c0a534Smrg                   [depcc="$$1"   am_compiler_list=])
63114c0a534Smrg
63214c0a534SmrgAC_CACHE_CHECK([dependency style of $depcc],
63314c0a534Smrg               [am_cv_$1_dependencies_compiler_type],
63414c0a534Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
63514c0a534Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
63614c0a534Smrg  # making bogus files that we don't know about and never remove.  For
63714c0a534Smrg  # instance it was reported that on HP-UX the gcc test will end up
63814c0a534Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
63914c0a534Smrg  # in D'.
64014c0a534Smrg  mkdir conftest.dir
64114c0a534Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
64214c0a534Smrg  # using a relative directory.
64314c0a534Smrg  cp "$am_depcomp" conftest.dir
64414c0a534Smrg  cd conftest.dir
64514c0a534Smrg  # We will build objects and dependencies in a subdirectory because
64614c0a534Smrg  # it helps to detect inapplicable dependency modes.  For instance
64714c0a534Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
64814c0a534Smrg  # side effect of compilation, but ICC will put the dependencies in
64914c0a534Smrg  # the current directory while Tru64 will put them in the object
65014c0a534Smrg  # directory.
65114c0a534Smrg  mkdir sub
65214c0a534Smrg
65314c0a534Smrg  am_cv_$1_dependencies_compiler_type=none
65414c0a534Smrg  if test "$am_compiler_list" = ""; then
65514c0a534Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
65614c0a534Smrg  fi
65714c0a534Smrg  for depmode in $am_compiler_list; do
65814c0a534Smrg    # Setup a source with many dependencies, because some compilers
65914c0a534Smrg    # like to wrap large dependency lists on column 80 (with \), and
66014c0a534Smrg    # we should not choose a depcomp mode which is confused by this.
66114c0a534Smrg    #
66214c0a534Smrg    # We need to recreate these files for each test, as the compiler may
66314c0a534Smrg    # overwrite some of them when testing with obscure command lines.
66414c0a534Smrg    # This happens at least with the AIX C compiler.
66514c0a534Smrg    : > sub/conftest.c
66614c0a534Smrg    for i in 1 2 3 4 5 6; do
66714c0a534Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
66814c0a534Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
66914c0a534Smrg      # Solaris 8's {/usr,}/bin/sh.
67014c0a534Smrg      touch sub/conftst$i.h
67114c0a534Smrg    done
67214c0a534Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
67314c0a534Smrg
67414c0a534Smrg    case $depmode in
67514c0a534Smrg    nosideeffect)
67614c0a534Smrg      # after this tag, mechanisms are not by side-effect, so they'll
67714c0a534Smrg      # only be used when explicitly requested
67814c0a534Smrg      if test "x$enable_dependency_tracking" = xyes; then
67914c0a534Smrg	continue
68014c0a534Smrg      else
68114c0a534Smrg	break
68214c0a534Smrg      fi
68314c0a534Smrg      ;;
68414c0a534Smrg    none) break ;;
68514c0a534Smrg    esac
68614c0a534Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
68714c0a534Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
68814c0a534Smrg    # handle `-M -o', and we need to detect this.
68914c0a534Smrg    if depmode=$depmode \
69014c0a534Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
69114c0a534Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
69214c0a534Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
69314c0a534Smrg         >/dev/null 2>conftest.err &&
69414c0a534Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
69514c0a534Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
69614c0a534Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
69714c0a534Smrg      # icc doesn't choke on unknown options, it will just issue warnings
69814c0a534Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
69914c0a534Smrg      # that says an option was ignored or not supported.
70014c0a534Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
70114c0a534Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
70214c0a534Smrg      # The diagnosis changed in icc 8.0:
70314c0a534Smrg      #   icc: Command line remark: option '-MP' not supported
70414c0a534Smrg      if (grep 'ignoring option' conftest.err ||
70514c0a534Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
70614c0a534Smrg        am_cv_$1_dependencies_compiler_type=$depmode
70714c0a534Smrg        break
70814c0a534Smrg      fi
70914c0a534Smrg    fi
71014c0a534Smrg  done
71114c0a534Smrg
71214c0a534Smrg  cd ..
71314c0a534Smrg  rm -rf conftest.dir
71414c0a534Smrgelse
71514c0a534Smrg  am_cv_$1_dependencies_compiler_type=none
71614c0a534Smrgfi
71714c0a534Smrg])
71814c0a534SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
71914c0a534SmrgAM_CONDITIONAL([am__fastdep$1], [
72014c0a534Smrg  test "x$enable_dependency_tracking" != xno \
72114c0a534Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
72214c0a534Smrg])
72314c0a534Smrg
72414c0a534Smrg
72514c0a534Smrg# AM_SET_DEPDIR
72614c0a534Smrg# -------------
72714c0a534Smrg# Choose a directory name for dependency files.
72814c0a534Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
72914c0a534SmrgAC_DEFUN([AM_SET_DEPDIR],
73014c0a534Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
73114c0a534SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
73214c0a534Smrg])
73314c0a534Smrg
73414c0a534Smrg
73514c0a534Smrg# AM_DEP_TRACK
73614c0a534Smrg# ------------
73714c0a534SmrgAC_DEFUN([AM_DEP_TRACK],
73814c0a534Smrg[AC_ARG_ENABLE(dependency-tracking,
73914c0a534Smrg[  --disable-dependency-tracking  speeds up one-time build
74014c0a534Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
74114c0a534Smrgif test "x$enable_dependency_tracking" != xno; then
74214c0a534Smrg  am_depcomp="$ac_aux_dir/depcomp"
74314c0a534Smrg  AMDEPBACKSLASH='\'
74414c0a534Smrgfi
74514c0a534SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
74614c0a534SmrgAC_SUBST([AMDEPBACKSLASH])
74714c0a534Smrg])
74814c0a534Smrg
74914c0a534Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
75014c0a534Smrg
75114c0a534Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
75214c0a534Smrg# Free Software Foundation, Inc.
75314c0a534Smrg#
75414c0a534Smrg# This file is free software; the Free Software Foundation
75514c0a534Smrg# gives unlimited permission to copy and/or distribute it,
75614c0a534Smrg# with or without modifications, as long as this notice is preserved.
75714c0a534Smrg
75814c0a534Smrg#serial 3
75914c0a534Smrg
76014c0a534Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
76114c0a534Smrg# ------------------------------
76214c0a534SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
76314c0a534Smrg[for mf in $CONFIG_FILES; do
76414c0a534Smrg  # Strip MF so we end up with the name of the file.
76514c0a534Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
76614c0a534Smrg  # Check whether this is an Automake generated Makefile or not.
76714c0a534Smrg  # We used to match only the files named `Makefile.in', but
76814c0a534Smrg  # some people rename them; so instead we look at the file content.
76914c0a534Smrg  # Grep'ing the first line is not enough: some people post-process
77014c0a534Smrg  # each Makefile.in and add a new line on top of each file to say so.
77114c0a534Smrg  # So let's grep whole file.
77214c0a534Smrg  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
77314c0a534Smrg    dirpart=`AS_DIRNAME("$mf")`
77414c0a534Smrg  else
77514c0a534Smrg    continue
77614c0a534Smrg  fi
77714c0a534Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
77814c0a534Smrg  # from the Makefile without running `make'.
77914c0a534Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
78014c0a534Smrg  test -z "$DEPDIR" && continue
78114c0a534Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
78214c0a534Smrg  test -z "am__include" && continue
78314c0a534Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
78414c0a534Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
78514c0a534Smrg  U=`sed -n 's/^U = //p' < "$mf"`
78614c0a534Smrg  # Find all dependency output files, they are included files with
78714c0a534Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
78814c0a534Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
78914c0a534Smrg  # expansion.
79014c0a534Smrg  for file in `sed -n "
79114c0a534Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
79214c0a534Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
79314c0a534Smrg    # Make sure the directory exists.
79414c0a534Smrg    test -f "$dirpart/$file" && continue
79514c0a534Smrg    fdir=`AS_DIRNAME(["$file"])`
79614c0a534Smrg    AS_MKDIR_P([$dirpart/$fdir])
79714c0a534Smrg    # echo "creating $dirpart/$file"
79814c0a534Smrg    echo '# dummy' > "$dirpart/$file"
79914c0a534Smrg  done
80014c0a534Smrgdone
80114c0a534Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
80214c0a534Smrg
80314c0a534Smrg
80414c0a534Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
80514c0a534Smrg# -----------------------------
80614c0a534Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
80714c0a534Smrg#
80814c0a534Smrg# This code is only required when automatic dependency tracking
80914c0a534Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
81014c0a534Smrg# need in order to bootstrap the dependency handling code.
81114c0a534SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
81214c0a534Smrg[AC_CONFIG_COMMANDS([depfiles],
81314c0a534Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
81414c0a534Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
81514c0a534Smrg])
81614c0a534Smrg
81714c0a534Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
81814c0a534Smrg# Free Software Foundation, Inc.
81914c0a534Smrg#
82014c0a534Smrg# This file is free software; the Free Software Foundation
82114c0a534Smrg# gives unlimited permission to copy and/or distribute it,
82214c0a534Smrg# with or without modifications, as long as this notice is preserved.
82314c0a534Smrg
82414c0a534Smrg# serial 8
82514c0a534Smrg
82614c0a534Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
82714c0a534SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
82814c0a534Smrg
82914c0a534Smrg# Do all the work for Automake.                             -*- Autoconf -*-
83014c0a534Smrg
83114c0a534Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
83214c0a534Smrg# Free Software Foundation, Inc.
83314c0a534Smrg#
83414c0a534Smrg# This file is free software; the Free Software Foundation
83514c0a534Smrg# gives unlimited permission to copy and/or distribute it,
83614c0a534Smrg# with or without modifications, as long as this notice is preserved.
83714c0a534Smrg
83814c0a534Smrg# serial 12
83914c0a534Smrg
84014c0a534Smrg# This macro actually does too much.  Some checks are only needed if
84114c0a534Smrg# your package does certain things.  But this isn't really a big deal.
84214c0a534Smrg
84314c0a534Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
84414c0a534Smrg# AM_INIT_AUTOMAKE([OPTIONS])
84514c0a534Smrg# -----------------------------------------------
84614c0a534Smrg# The call with PACKAGE and VERSION arguments is the old style
84714c0a534Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
84814c0a534Smrg# and VERSION should now be passed to AC_INIT and removed from
84914c0a534Smrg# the call to AM_INIT_AUTOMAKE.
85014c0a534Smrg# We support both call styles for the transition.  After
85114c0a534Smrg# the next Automake release, Autoconf can make the AC_INIT
85214c0a534Smrg# arguments mandatory, and then we can depend on a new Autoconf
85314c0a534Smrg# release and drop the old call support.
85414c0a534SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
85514c0a534Smrg[AC_PREREQ([2.58])dnl
85614c0a534Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
85714c0a534Smrgdnl the ones we care about.
85814c0a534Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
85914c0a534SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
86014c0a534SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
86114c0a534Smrg# test to see if srcdir already configured
86214c0a534Smrgif test "`cd $srcdir && pwd`" != "`pwd`" &&
86314c0a534Smrg   test -f $srcdir/config.status; then
86414c0a534Smrg  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
86514c0a534Smrgfi
86614c0a534Smrg
86714c0a534Smrg# test whether we have cygpath
86814c0a534Smrgif test -z "$CYGPATH_W"; then
86914c0a534Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
87014c0a534Smrg    CYGPATH_W='cygpath -w'
87114c0a534Smrg  else
87214c0a534Smrg    CYGPATH_W=echo
87314c0a534Smrg  fi
87414c0a534Smrgfi
87514c0a534SmrgAC_SUBST([CYGPATH_W])
87614c0a534Smrg
87714c0a534Smrg# Define the identity of the package.
87814c0a534Smrgdnl Distinguish between old-style and new-style calls.
87914c0a534Smrgm4_ifval([$2],
88014c0a534Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
88114c0a534Smrg AC_SUBST([PACKAGE], [$1])dnl
88214c0a534Smrg AC_SUBST([VERSION], [$2])],
88314c0a534Smrg[_AM_SET_OPTIONS([$1])dnl
88414c0a534Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
88514c0a534Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
88614c0a534Smrg
88714c0a534Smrg_AM_IF_OPTION([no-define],,
88814c0a534Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
88914c0a534Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
89014c0a534Smrg
89114c0a534Smrg# Some tools Automake needs.
89214c0a534SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
89314c0a534SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
89414c0a534SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
89514c0a534SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
89614c0a534SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
89714c0a534SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
89814c0a534SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
89914c0a534SmrgAM_PROG_INSTALL_SH
90014c0a534SmrgAM_PROG_INSTALL_STRIP
90114c0a534SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
90214c0a534Smrg# We need awk for the "check" target.  The system "awk" is bad on
90314c0a534Smrg# some platforms.
90414c0a534SmrgAC_REQUIRE([AC_PROG_AWK])dnl
90514c0a534SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
90614c0a534SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
90714c0a534Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
90814c0a534Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
90914c0a534Smrg	      		     [_AM_PROG_TAR([v7])])])
91014c0a534Smrg_AM_IF_OPTION([no-dependencies],,
91114c0a534Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
91214c0a534Smrg                  [_AM_DEPENDENCIES(CC)],
91314c0a534Smrg                  [define([AC_PROG_CC],
91414c0a534Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
91514c0a534SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
91614c0a534Smrg                  [_AM_DEPENDENCIES(CXX)],
91714c0a534Smrg                  [define([AC_PROG_CXX],
91814c0a534Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
91914c0a534Smrg])
92014c0a534Smrg])
92114c0a534Smrg
92214c0a534Smrg
92314c0a534Smrg# When config.status generates a header, we must update the stamp-h file.
92414c0a534Smrg# This file resides in the same directory as the config header
92514c0a534Smrg# that is generated.  The stamp files are numbered to have different names.
92614c0a534Smrg
92714c0a534Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
92814c0a534Smrg# loop where config.status creates the headers, so we can generate
92914c0a534Smrg# our stamp files there.
93014c0a534SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
93114c0a534Smrg[# Compute $1's index in $config_headers.
93214c0a534Smrg_am_stamp_count=1
93314c0a534Smrgfor _am_header in $config_headers :; do
93414c0a534Smrg  case $_am_header in
93514c0a534Smrg    $1 | $1:* )
93614c0a534Smrg      break ;;
93714c0a534Smrg    * )
93814c0a534Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
93914c0a534Smrg  esac
94014c0a534Smrgdone
94114c0a534Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
94214c0a534Smrg
94314c0a534Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
94414c0a534Smrg#
94514c0a534Smrg# This file is free software; the Free Software Foundation
94614c0a534Smrg# gives unlimited permission to copy and/or distribute it,
94714c0a534Smrg# with or without modifications, as long as this notice is preserved.
94814c0a534Smrg
94914c0a534Smrg# AM_PROG_INSTALL_SH
95014c0a534Smrg# ------------------
95114c0a534Smrg# Define $install_sh.
95214c0a534SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
95314c0a534Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
95414c0a534Smrginstall_sh=${install_sh-"$am_aux_dir/install-sh"}
95514c0a534SmrgAC_SUBST(install_sh)])
95614c0a534Smrg
95714c0a534Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
95814c0a534Smrg#
95914c0a534Smrg# This file is free software; the Free Software Foundation
96014c0a534Smrg# gives unlimited permission to copy and/or distribute it,
96114c0a534Smrg# with or without modifications, as long as this notice is preserved.
96214c0a534Smrg
96314c0a534Smrg# serial 2
96414c0a534Smrg
96514c0a534Smrg# Check whether the underlying file-system supports filenames
96614c0a534Smrg# with a leading dot.  For instance MS-DOS doesn't.
96714c0a534SmrgAC_DEFUN([AM_SET_LEADING_DOT],
96814c0a534Smrg[rm -rf .tst 2>/dev/null
96914c0a534Smrgmkdir .tst 2>/dev/null
97014c0a534Smrgif test -d .tst; then
97114c0a534Smrg  am__leading_dot=.
97214c0a534Smrgelse
97314c0a534Smrg  am__leading_dot=_
97414c0a534Smrgfi
97514c0a534Smrgrmdir .tst 2>/dev/null
97614c0a534SmrgAC_SUBST([am__leading_dot])])
97714c0a534Smrg
97814c0a534Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
97914c0a534Smrg# From Jim Meyering
98014c0a534Smrg
98114c0a534Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
98214c0a534Smrg# Free Software Foundation, Inc.
98314c0a534Smrg#
98414c0a534Smrg# This file is free software; the Free Software Foundation
98514c0a534Smrg# gives unlimited permission to copy and/or distribute it,
98614c0a534Smrg# with or without modifications, as long as this notice is preserved.
98714c0a534Smrg
98814c0a534Smrg# serial 4
98914c0a534Smrg
99014c0a534SmrgAC_DEFUN([AM_MAINTAINER_MODE],
99114c0a534Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
99214c0a534Smrg  dnl maintainer-mode is disabled by default
99314c0a534Smrg  AC_ARG_ENABLE(maintainer-mode,
99414c0a534Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
99514c0a534Smrg			  (and sometimes confusing) to the casual installer],
99614c0a534Smrg      USE_MAINTAINER_MODE=$enableval,
99714c0a534Smrg      USE_MAINTAINER_MODE=no)
99814c0a534Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
99914c0a534Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
100014c0a534Smrg  MAINT=$MAINTAINER_MODE_TRUE
100114c0a534Smrg  AC_SUBST(MAINT)dnl
100214c0a534Smrg]
100314c0a534Smrg)
100414c0a534Smrg
100514c0a534SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
100614c0a534Smrg
100714c0a534Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
100814c0a534Smrg
100914c0a534Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
101014c0a534Smrg#
101114c0a534Smrg# This file is free software; the Free Software Foundation
101214c0a534Smrg# gives unlimited permission to copy and/or distribute it,
101314c0a534Smrg# with or without modifications, as long as this notice is preserved.
101414c0a534Smrg
101514c0a534Smrg# serial 3
101614c0a534Smrg
101714c0a534Smrg# AM_MAKE_INCLUDE()
101814c0a534Smrg# -----------------
101914c0a534Smrg# Check to see how make treats includes.
102014c0a534SmrgAC_DEFUN([AM_MAKE_INCLUDE],
102114c0a534Smrg[am_make=${MAKE-make}
102214c0a534Smrgcat > confinc << 'END'
102314c0a534Smrgam__doit:
102414c0a534Smrg	@echo done
102514c0a534Smrg.PHONY: am__doit
102614c0a534SmrgEND
102714c0a534Smrg# If we don't find an include directive, just comment out the code.
102814c0a534SmrgAC_MSG_CHECKING([for style of include used by $am_make])
102914c0a534Smrgam__include="#"
103014c0a534Smrgam__quote=
103114c0a534Smrg_am_result=none
103214c0a534Smrg# First try GNU make style include.
103314c0a534Smrgecho "include confinc" > confmf
103414c0a534Smrg# We grep out `Entering directory' and `Leaving directory'
103514c0a534Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
103614c0a534Smrg# In particular we don't look at `^make:' because GNU make might
103714c0a534Smrg# be invoked under some other name (usually "gmake"), in which
103814c0a534Smrg# case it prints its new name instead of `make'.
103914c0a534Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
104014c0a534Smrg   am__include=include
104114c0a534Smrg   am__quote=
104214c0a534Smrg   _am_result=GNU
104314c0a534Smrgfi
104414c0a534Smrg# Now try BSD make style include.
104514c0a534Smrgif test "$am__include" = "#"; then
104614c0a534Smrg   echo '.include "confinc"' > confmf
104714c0a534Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
104814c0a534Smrg      am__include=.include
104914c0a534Smrg      am__quote="\""
105014c0a534Smrg      _am_result=BSD
105114c0a534Smrg   fi
105214c0a534Smrgfi
105314c0a534SmrgAC_SUBST([am__include])
105414c0a534SmrgAC_SUBST([am__quote])
105514c0a534SmrgAC_MSG_RESULT([$_am_result])
105614c0a534Smrgrm -f confinc confmf
105714c0a534Smrg])
105814c0a534Smrg
105914c0a534Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
106014c0a534Smrg
106114c0a534Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
106214c0a534Smrg# Free Software Foundation, Inc.
106314c0a534Smrg#
106414c0a534Smrg# This file is free software; the Free Software Foundation
106514c0a534Smrg# gives unlimited permission to copy and/or distribute it,
106614c0a534Smrg# with or without modifications, as long as this notice is preserved.
106714c0a534Smrg
106814c0a534Smrg# serial 4
106914c0a534Smrg
107014c0a534Smrg# AM_MISSING_PROG(NAME, PROGRAM)
107114c0a534Smrg# ------------------------------
107214c0a534SmrgAC_DEFUN([AM_MISSING_PROG],
107314c0a534Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
107414c0a534Smrg$1=${$1-"${am_missing_run}$2"}
107514c0a534SmrgAC_SUBST($1)])
107614c0a534Smrg
107714c0a534Smrg
107814c0a534Smrg# AM_MISSING_HAS_RUN
107914c0a534Smrg# ------------------
108014c0a534Smrg# Define MISSING if not defined so far and test if it supports --run.
108114c0a534Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
108214c0a534SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
108314c0a534Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
108414c0a534Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
108514c0a534Smrg# Use eval to expand $SHELL
108614c0a534Smrgif eval "$MISSING --run true"; then
108714c0a534Smrg  am_missing_run="$MISSING --run "
108814c0a534Smrgelse
108914c0a534Smrg  am_missing_run=
109014c0a534Smrg  AC_MSG_WARN([`missing' script is too old or missing])
109114c0a534Smrgfi
109214c0a534Smrg])
109314c0a534Smrg
109414c0a534Smrg# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
109514c0a534Smrg#
109614c0a534Smrg# This file is free software; the Free Software Foundation
109714c0a534Smrg# gives unlimited permission to copy and/or distribute it,
109814c0a534Smrg# with or without modifications, as long as this notice is preserved.
109914c0a534Smrg
110014c0a534Smrg# AM_PROG_MKDIR_P
110114c0a534Smrg# ---------------
110214c0a534Smrg# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
110314c0a534Smrg#
110414c0a534Smrg# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
110514c0a534Smrg# created by `make install' are always world readable, even if the
110614c0a534Smrg# installer happens to have an overly restrictive umask (e.g. 077).
110714c0a534Smrg# This was a mistake.  There are at least two reasons why we must not
110814c0a534Smrg# use `-m 0755':
110914c0a534Smrg#   - it causes special bits like SGID to be ignored,
111014c0a534Smrg#   - it may be too restrictive (some setups expect 775 directories).
111114c0a534Smrg#
111214c0a534Smrg# Do not use -m 0755 and let people choose whatever they expect by
111314c0a534Smrg# setting umask.
111414c0a534Smrg#
111514c0a534Smrg# We cannot accept any implementation of `mkdir' that recognizes `-p'.
111614c0a534Smrg# Some implementations (such as Solaris 8's) are not thread-safe: if a
111714c0a534Smrg# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
111814c0a534Smrg# concurrently, both version can detect that a/ is missing, but only
111914c0a534Smrg# one can create it and the other will error out.  Consequently we
112014c0a534Smrg# restrict ourselves to GNU make (using the --version option ensures
112114c0a534Smrg# this.)
112214c0a534SmrgAC_DEFUN([AM_PROG_MKDIR_P],
112314c0a534Smrg[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
112414c0a534Smrg  # We used to keeping the `.' as first argument, in order to
112514c0a534Smrg  # allow $(mkdir_p) to be used without argument.  As in
112614c0a534Smrg  #   $(mkdir_p) $(somedir)
112714c0a534Smrg  # where $(somedir) is conditionally defined.  However this is wrong
112814c0a534Smrg  # for two reasons:
112914c0a534Smrg  #  1. if the package is installed by a user who cannot write `.'
113014c0a534Smrg  #     make install will fail,
113114c0a534Smrg  #  2. the above comment should most certainly read
113214c0a534Smrg  #     $(mkdir_p) $(DESTDIR)$(somedir)
113314c0a534Smrg  #     so it does not work when $(somedir) is undefined and
113414c0a534Smrg  #     $(DESTDIR) is not.
113514c0a534Smrg  #  To support the latter case, we have to write
113614c0a534Smrg  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
113714c0a534Smrg  #  so the `.' trick is pointless.
113814c0a534Smrg  mkdir_p='mkdir -p --'
113914c0a534Smrgelse
114014c0a534Smrg  # On NextStep and OpenStep, the `mkdir' command does not
114114c0a534Smrg  # recognize any option.  It will interpret all options as
114214c0a534Smrg  # directories to create, and then abort because `.' already
114314c0a534Smrg  # exists.
114414c0a534Smrg  for d in ./-p ./--version;
114514c0a534Smrg  do
114614c0a534Smrg    test -d $d && rmdir $d
114714c0a534Smrg  done
114814c0a534Smrg  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
114914c0a534Smrg  if test -f "$ac_aux_dir/mkinstalldirs"; then
115014c0a534Smrg    mkdir_p='$(mkinstalldirs)'
115114c0a534Smrg  else
115214c0a534Smrg    mkdir_p='$(install_sh) -d'
115314c0a534Smrg  fi
115414c0a534Smrgfi
115514c0a534SmrgAC_SUBST([mkdir_p])])
115614c0a534Smrg
115714c0a534Smrg# Helper functions for option handling.                     -*- Autoconf -*-
115814c0a534Smrg
115914c0a534Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
116014c0a534Smrg#
116114c0a534Smrg# This file is free software; the Free Software Foundation
116214c0a534Smrg# gives unlimited permission to copy and/or distribute it,
116314c0a534Smrg# with or without modifications, as long as this notice is preserved.
116414c0a534Smrg
116514c0a534Smrg# serial 3
116614c0a534Smrg
116714c0a534Smrg# _AM_MANGLE_OPTION(NAME)
116814c0a534Smrg# -----------------------
116914c0a534SmrgAC_DEFUN([_AM_MANGLE_OPTION],
117014c0a534Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
117114c0a534Smrg
117214c0a534Smrg# _AM_SET_OPTION(NAME)
117314c0a534Smrg# ------------------------------
117414c0a534Smrg# Set option NAME.  Presently that only means defining a flag for this option.
117514c0a534SmrgAC_DEFUN([_AM_SET_OPTION],
117614c0a534Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
117714c0a534Smrg
117814c0a534Smrg# _AM_SET_OPTIONS(OPTIONS)
117914c0a534Smrg# ----------------------------------
118014c0a534Smrg# OPTIONS is a space-separated list of Automake options.
118114c0a534SmrgAC_DEFUN([_AM_SET_OPTIONS],
118214c0a534Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
118314c0a534Smrg
118414c0a534Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
118514c0a534Smrg# -------------------------------------------
118614c0a534Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
118714c0a534SmrgAC_DEFUN([_AM_IF_OPTION],
118814c0a534Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
118914c0a534Smrg
119014c0a534Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
119114c0a534Smrg
119214c0a534Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
119314c0a534Smrg# Free Software Foundation, Inc.
119414c0a534Smrg#
119514c0a534Smrg# This file is free software; the Free Software Foundation
119614c0a534Smrg# gives unlimited permission to copy and/or distribute it,
119714c0a534Smrg# with or without modifications, as long as this notice is preserved.
119814c0a534Smrg
119914c0a534Smrg# serial 4
120014c0a534Smrg
120114c0a534Smrg# AM_SANITY_CHECK
120214c0a534Smrg# ---------------
120314c0a534SmrgAC_DEFUN([AM_SANITY_CHECK],
120414c0a534Smrg[AC_MSG_CHECKING([whether build environment is sane])
120514c0a534Smrg# Just in case
120614c0a534Smrgsleep 1
120714c0a534Smrgecho timestamp > conftest.file
120814c0a534Smrg# Do `set' in a subshell so we don't clobber the current shell's
120914c0a534Smrg# arguments.  Must try -L first in case configure is actually a
121014c0a534Smrg# symlink; some systems play weird games with the mod time of symlinks
121114c0a534Smrg# (eg FreeBSD returns the mod time of the symlink's containing
121214c0a534Smrg# directory).
121314c0a534Smrgif (
121414c0a534Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
121514c0a534Smrg   if test "$[*]" = "X"; then
121614c0a534Smrg      # -L didn't work.
121714c0a534Smrg      set X `ls -t $srcdir/configure conftest.file`
121814c0a534Smrg   fi
121914c0a534Smrg   rm -f conftest.file
122014c0a534Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
122114c0a534Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
122214c0a534Smrg
122314c0a534Smrg      # If neither matched, then we have a broken ls.  This can happen
122414c0a534Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
122514c0a534Smrg      # broken ls alias from the environment.  This has actually
122614c0a534Smrg      # happened.  Such a system could not be considered "sane".
122714c0a534Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
122814c0a534Smrgalias in your environment])
122914c0a534Smrg   fi
123014c0a534Smrg
123114c0a534Smrg   test "$[2]" = conftest.file
123214c0a534Smrg   )
123314c0a534Smrgthen
123414c0a534Smrg   # Ok.
123514c0a534Smrg   :
123614c0a534Smrgelse
123714c0a534Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
123814c0a534SmrgCheck your system clock])
123914c0a534Smrgfi
124014c0a534SmrgAC_MSG_RESULT(yes)])
124114c0a534Smrg
124214c0a534Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
124314c0a534Smrg#
124414c0a534Smrg# This file is free software; the Free Software Foundation
124514c0a534Smrg# gives unlimited permission to copy and/or distribute it,
124614c0a534Smrg# with or without modifications, as long as this notice is preserved.
124714c0a534Smrg
124814c0a534Smrg# AM_PROG_INSTALL_STRIP
124914c0a534Smrg# ---------------------
125014c0a534Smrg# One issue with vendor `install' (even GNU) is that you can't
125114c0a534Smrg# specify the program used to strip binaries.  This is especially
125214c0a534Smrg# annoying in cross-compiling environments, where the build's strip
125314c0a534Smrg# is unlikely to handle the host's binaries.
125414c0a534Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
125514c0a534Smrg# always use install-sh in `make install-strip', and initialize
125614c0a534Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
125714c0a534SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
125814c0a534Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
125914c0a534Smrg# Installed binaries are usually stripped using `strip' when the user
126014c0a534Smrg# run `make install-strip'.  However `strip' might not be the right
126114c0a534Smrg# tool to use in cross-compilation environments, therefore Automake
126214c0a534Smrg# will honor the `STRIP' environment variable to overrule this program.
126314c0a534Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
126414c0a534Smrgif test "$cross_compiling" != no; then
126514c0a534Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
126614c0a534Smrgfi
126714c0a534SmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
126814c0a534SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
126914c0a534Smrg
127014c0a534Smrg# Check how to create a tarball.                            -*- Autoconf -*-
127114c0a534Smrg
127214c0a534Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
127314c0a534Smrg#
127414c0a534Smrg# This file is free software; the Free Software Foundation
127514c0a534Smrg# gives unlimited permission to copy and/or distribute it,
127614c0a534Smrg# with or without modifications, as long as this notice is preserved.
127714c0a534Smrg
127814c0a534Smrg# serial 2
127914c0a534Smrg
128014c0a534Smrg# _AM_PROG_TAR(FORMAT)
128114c0a534Smrg# --------------------
128214c0a534Smrg# Check how to create a tarball in format FORMAT.
128314c0a534Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
128414c0a534Smrg#
128514c0a534Smrg# Substitute a variable $(am__tar) that is a command
128614c0a534Smrg# writing to stdout a FORMAT-tarball containing the directory
128714c0a534Smrg# $tardir.
128814c0a534Smrg#     tardir=directory && $(am__tar) > result.tar
128914c0a534Smrg#
129014c0a534Smrg# Substitute a variable $(am__untar) that extract such
129114c0a534Smrg# a tarball read from stdin.
129214c0a534Smrg#     $(am__untar) < result.tar
129314c0a534SmrgAC_DEFUN([_AM_PROG_TAR],
129414c0a534Smrg[# Always define AMTAR for backward compatibility.
129514c0a534SmrgAM_MISSING_PROG([AMTAR], [tar])
129614c0a534Smrgm4_if([$1], [v7],
129714c0a534Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
129814c0a534Smrg     [m4_case([$1], [ustar],, [pax],,
129914c0a534Smrg              [m4_fatal([Unknown tar format])])
130014c0a534SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
130114c0a534Smrg# Loop over all known methods to create a tar archive until one works.
130214c0a534Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
130314c0a534Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
130414c0a534Smrg# Do not fold the above two line into one, because Tru64 sh and
130514c0a534Smrg# Solaris sh will not grok spaces in the rhs of `-'.
130614c0a534Smrgfor _am_tool in $_am_tools
130714c0a534Smrgdo
130814c0a534Smrg  case $_am_tool in
130914c0a534Smrg  gnutar)
131014c0a534Smrg    for _am_tar in tar gnutar gtar;
131114c0a534Smrg    do
131214c0a534Smrg      AM_RUN_LOG([$_am_tar --version]) && break
131314c0a534Smrg    done
131414c0a534Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
131514c0a534Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
131614c0a534Smrg    am__untar="$_am_tar -xf -"
131714c0a534Smrg    ;;
131814c0a534Smrg  plaintar)
131914c0a534Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
132014c0a534Smrg    # ustar tarball either.
132114c0a534Smrg    (tar --version) >/dev/null 2>&1 && continue
132214c0a534Smrg    am__tar='tar chf - "$$tardir"'
132314c0a534Smrg    am__tar_='tar chf - "$tardir"'
132414c0a534Smrg    am__untar='tar xf -'
132514c0a534Smrg    ;;
132614c0a534Smrg  pax)
132714c0a534Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
132814c0a534Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
132914c0a534Smrg    am__untar='pax -r'
133014c0a534Smrg    ;;
133114c0a534Smrg  cpio)
133214c0a534Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
133314c0a534Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
133414c0a534Smrg    am__untar='cpio -i -H $1 -d'
133514c0a534Smrg    ;;
133614c0a534Smrg  none)
133714c0a534Smrg    am__tar=false
133814c0a534Smrg    am__tar_=false
133914c0a534Smrg    am__untar=false
134014c0a534Smrg    ;;
134114c0a534Smrg  esac
134214c0a534Smrg
134314c0a534Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
134414c0a534Smrg  # and am__untar set.
134514c0a534Smrg  test -n "${am_cv_prog_tar_$1}" && break
134614c0a534Smrg
134714c0a534Smrg  # tar/untar a dummy directory, and stop if the command works
134814c0a534Smrg  rm -rf conftest.dir
134914c0a534Smrg  mkdir conftest.dir
135014c0a534Smrg  echo GrepMe > conftest.dir/file
135114c0a534Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
135214c0a534Smrg  rm -rf conftest.dir
135314c0a534Smrg  if test -s conftest.tar; then
135414c0a534Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
135514c0a534Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
135614c0a534Smrg  fi
135714c0a534Smrgdone
135814c0a534Smrgrm -rf conftest.dir
135914c0a534Smrg
136014c0a534SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
136114c0a534SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
136214c0a534SmrgAC_SUBST([am__tar])
136314c0a534SmrgAC_SUBST([am__untar])
136414c0a534Smrg]) # _AM_PROG_TAR
136514c0a534Smrg
1366