aclocal.m4 revision 44d7874b
144d7874bSmrg# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
244d7874bSmrg
344d7874bSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
444d7874bSmrg# 2005  Free Software Foundation, Inc.
544d7874bSmrg# This file is free software; the Free Software Foundation
644d7874bSmrg# gives unlimited permission to copy and/or distribute it,
744d7874bSmrg# with or without modifications, as long as this notice is preserved.
844d7874bSmrg
944d7874bSmrg# This program is distributed in the hope that it will be useful,
1044d7874bSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1144d7874bSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1244d7874bSmrg# PARTICULAR PURPOSE.
1344d7874bSmrg
1444d7874bSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1544d7874bSmrg# 
1644d7874bSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1744d7874bSmrg#
1844d7874bSmrg# This program is free software; you can redistribute it and/or modify
1944d7874bSmrg# it under the terms of the GNU General Public License as published by
2044d7874bSmrg# the Free Software Foundation; either version 2 of the License, or
2144d7874bSmrg# (at your option) any later version.
2244d7874bSmrg#
2344d7874bSmrg# This program is distributed in the hope that it will be useful, but
2444d7874bSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2544d7874bSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2644d7874bSmrg# General Public License for more details.
2744d7874bSmrg#
2844d7874bSmrg# You should have received a copy of the GNU General Public License
2944d7874bSmrg# along with this program; if not, write to the Free Software
3044d7874bSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3144d7874bSmrg#
3244d7874bSmrg# As a special exception to the GNU General Public License, if you
3344d7874bSmrg# distribute this file as part of a program that contains a
3444d7874bSmrg# configuration script generated by Autoconf, you may include it under
3544d7874bSmrg# the same distribution terms that you use for the rest of that program.
3644d7874bSmrg
3744d7874bSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
3844d7874bSmrg# ----------------------------------
3944d7874bSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
4044d7874bSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
4144d7874bSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
4244d7874bSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
4344d7874bSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
4444d7874bSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
4544d7874bSmrgfi
4644d7874bSmrgif test -n "$PKG_CONFIG"; then
4744d7874bSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
4844d7874bSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
4944d7874bSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
5044d7874bSmrg		AC_MSG_RESULT([yes])
5144d7874bSmrg	else
5244d7874bSmrg		AC_MSG_RESULT([no])
5344d7874bSmrg		PKG_CONFIG=""
5444d7874bSmrg	fi
5544d7874bSmrg		
5644d7874bSmrgfi[]dnl
5744d7874bSmrg])# PKG_PROG_PKG_CONFIG
5844d7874bSmrg
5944d7874bSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
6044d7874bSmrg#
6144d7874bSmrg# Check to see whether a particular set of modules exists.  Similar
6244d7874bSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
6344d7874bSmrg#
6444d7874bSmrg#
6544d7874bSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
6644d7874bSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
6744d7874bSmrg# PKG_CHECK_EXISTS manually
6844d7874bSmrg# --------------------------------------------------------------
6944d7874bSmrgAC_DEFUN([PKG_CHECK_EXISTS],
7044d7874bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
7144d7874bSmrgif test -n "$PKG_CONFIG" && \
7244d7874bSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
7344d7874bSmrg  m4_ifval([$2], [$2], [:])
7444d7874bSmrgm4_ifvaln([$3], [else
7544d7874bSmrg  $3])dnl
7644d7874bSmrgfi])
7744d7874bSmrg
7844d7874bSmrg
7944d7874bSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8044d7874bSmrg# ---------------------------------------------
8144d7874bSmrgm4_define([_PKG_CONFIG],
8244d7874bSmrg[if test -n "$PKG_CONFIG"; then
8344d7874bSmrg    if test -n "$$1"; then
8444d7874bSmrg        pkg_cv_[]$1="$$1"
8544d7874bSmrg    else
8644d7874bSmrg        PKG_CHECK_EXISTS([$3],
8744d7874bSmrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8844d7874bSmrg			 [pkg_failed=yes])
8944d7874bSmrg    fi
9044d7874bSmrgelse
9144d7874bSmrg	pkg_failed=untried
9244d7874bSmrgfi[]dnl
9344d7874bSmrg])# _PKG_CONFIG
9444d7874bSmrg
9544d7874bSmrg# _PKG_SHORT_ERRORS_SUPPORTED
9644d7874bSmrg# -----------------------------
9744d7874bSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9844d7874bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9944d7874bSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
10044d7874bSmrg        _pkg_short_errors_supported=yes
10144d7874bSmrgelse
10244d7874bSmrg        _pkg_short_errors_supported=no
10344d7874bSmrgfi[]dnl
10444d7874bSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
10544d7874bSmrg
10644d7874bSmrg
10744d7874bSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
10844d7874bSmrg# [ACTION-IF-NOT-FOUND])
10944d7874bSmrg#
11044d7874bSmrg#
11144d7874bSmrg# Note that if there is a possibility the first call to
11244d7874bSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
11344d7874bSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
11444d7874bSmrg#
11544d7874bSmrg#
11644d7874bSmrg# --------------------------------------------------------------
11744d7874bSmrgAC_DEFUN([PKG_CHECK_MODULES],
11844d7874bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
11944d7874bSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
12044d7874bSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
12144d7874bSmrg
12244d7874bSmrgpkg_failed=no
12344d7874bSmrgAC_MSG_CHECKING([for $1])
12444d7874bSmrg
12544d7874bSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
12644d7874bSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
12744d7874bSmrg
12844d7874bSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
12944d7874bSmrgand $1[]_LIBS to avoid the need to call pkg-config.
13044d7874bSmrgSee the pkg-config man page for more details.])
13144d7874bSmrg
13244d7874bSmrgif test $pkg_failed = yes; then
13344d7874bSmrg        _PKG_SHORT_ERRORS_SUPPORTED
13444d7874bSmrg        if test $_pkg_short_errors_supported = yes; then
13544d7874bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
13644d7874bSmrg        else 
13744d7874bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
13844d7874bSmrg        fi
13944d7874bSmrg	# Put the nasty error message in config.log where it belongs
14044d7874bSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
14144d7874bSmrg
14244d7874bSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
14344d7874bSmrg[Package requirements ($2) were not met:
14444d7874bSmrg
14544d7874bSmrg$$1_PKG_ERRORS
14644d7874bSmrg
14744d7874bSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
14844d7874bSmrginstalled software in a non-standard prefix.
14944d7874bSmrg
15044d7874bSmrg_PKG_TEXT
15144d7874bSmrg])],
15244d7874bSmrg		[AC_MSG_RESULT([no])
15344d7874bSmrg                $4])
15444d7874bSmrgelif test $pkg_failed = untried; then
15544d7874bSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
15644d7874bSmrg[The pkg-config script could not be found or is too old.  Make sure it
15744d7874bSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
15844d7874bSmrgpath to pkg-config.
15944d7874bSmrg
16044d7874bSmrg_PKG_TEXT
16144d7874bSmrg
16244d7874bSmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
16344d7874bSmrg		[$4])
16444d7874bSmrgelse
16544d7874bSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
16644d7874bSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
16744d7874bSmrg        AC_MSG_RESULT([yes])
16844d7874bSmrg	ifelse([$3], , :, [$3])
16944d7874bSmrgfi[]dnl
17044d7874bSmrg])# PKG_CHECK_MODULES
17144d7874bSmrg
17244d7874bSmrg# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
17344d7874bSmrg#
17444d7874bSmrg# This file is free software; the Free Software Foundation
17544d7874bSmrg# gives unlimited permission to copy and/or distribute it,
17644d7874bSmrg# with or without modifications, as long as this notice is preserved.
17744d7874bSmrg
17844d7874bSmrg# AM_AUTOMAKE_VERSION(VERSION)
17944d7874bSmrg# ----------------------------
18044d7874bSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
18144d7874bSmrg# generated from the m4 files accompanying Automake X.Y.
18244d7874bSmrgAC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
18344d7874bSmrg
18444d7874bSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
18544d7874bSmrg# -------------------------------
18644d7874bSmrg# Call AM_AUTOMAKE_VERSION so it can be traced.
18744d7874bSmrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
18844d7874bSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
18944d7874bSmrg	 [AM_AUTOMAKE_VERSION([1.9.6])])
19044d7874bSmrg
19144d7874bSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
19244d7874bSmrg
19344d7874bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
19444d7874bSmrg#
19544d7874bSmrg# This file is free software; the Free Software Foundation
19644d7874bSmrg# gives unlimited permission to copy and/or distribute it,
19744d7874bSmrg# with or without modifications, as long as this notice is preserved.
19844d7874bSmrg
19944d7874bSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
20044d7874bSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
20144d7874bSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
20244d7874bSmrg#
20344d7874bSmrg# Of course, Automake must honor this variable whenever it calls a
20444d7874bSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
20544d7874bSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
20644d7874bSmrg# depending on how configure is run.  This is pretty annoying, since
20744d7874bSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
20844d7874bSmrg# source directory, any form will work fine, but in subdirectories a
20944d7874bSmrg# relative path needs to be adjusted first.
21044d7874bSmrg#
21144d7874bSmrg# $ac_aux_dir/missing
21244d7874bSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
21344d7874bSmrg# $top_srcdir/$ac_aux_dir/missing
21444d7874bSmrg#    fails if $ac_aux_dir is absolute,
21544d7874bSmrg#    fails when called from a subdirectory in a VPATH build with
21644d7874bSmrg#          a relative $ac_aux_dir
21744d7874bSmrg#
21844d7874bSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
21944d7874bSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
22044d7874bSmrg# harmless because $srcdir is `.', but things will broke when you
22144d7874bSmrg# start a VPATH build or use an absolute $srcdir.
22244d7874bSmrg#
22344d7874bSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
22444d7874bSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
22544d7874bSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
22644d7874bSmrg# and then we would define $MISSING as
22744d7874bSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
22844d7874bSmrg# This will work as long as MISSING is not called from configure, because
22944d7874bSmrg# unfortunately $(top_srcdir) has no meaning in configure.
23044d7874bSmrg# However there are other variables, like CC, which are often used in
23144d7874bSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
23244d7874bSmrg#
23344d7874bSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
23444d7874bSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
23544d7874bSmrg# configured tree to be moved without reconfiguration.
23644d7874bSmrg
23744d7874bSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
23844d7874bSmrg[dnl Rely on autoconf to set up CDPATH properly.
23944d7874bSmrgAC_PREREQ([2.50])dnl
24044d7874bSmrg# expand $ac_aux_dir to an absolute path
24144d7874bSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
24244d7874bSmrg])
24344d7874bSmrg
24444d7874bSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
24544d7874bSmrg
24644d7874bSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
24744d7874bSmrg# Free Software Foundation, Inc.
24844d7874bSmrg#
24944d7874bSmrg# This file is free software; the Free Software Foundation
25044d7874bSmrg# gives unlimited permission to copy and/or distribute it,
25144d7874bSmrg# with or without modifications, as long as this notice is preserved.
25244d7874bSmrg
25344d7874bSmrg# serial 7
25444d7874bSmrg
25544d7874bSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
25644d7874bSmrg# -------------------------------------
25744d7874bSmrg# Define a conditional.
25844d7874bSmrgAC_DEFUN([AM_CONDITIONAL],
25944d7874bSmrg[AC_PREREQ(2.52)dnl
26044d7874bSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
26144d7874bSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
26244d7874bSmrgAC_SUBST([$1_TRUE])
26344d7874bSmrgAC_SUBST([$1_FALSE])
26444d7874bSmrgif $2; then
26544d7874bSmrg  $1_TRUE=
26644d7874bSmrg  $1_FALSE='#'
26744d7874bSmrgelse
26844d7874bSmrg  $1_TRUE='#'
26944d7874bSmrg  $1_FALSE=
27044d7874bSmrgfi
27144d7874bSmrgAC_CONFIG_COMMANDS_PRE(
27244d7874bSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
27344d7874bSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
27444d7874bSmrgUsually this means the macro was only invoked conditionally.]])
27544d7874bSmrgfi])])
27644d7874bSmrg
27744d7874bSmrg
27844d7874bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
27944d7874bSmrg# Free Software Foundation, Inc.
28044d7874bSmrg#
28144d7874bSmrg# This file is free software; the Free Software Foundation
28244d7874bSmrg# gives unlimited permission to copy and/or distribute it,
28344d7874bSmrg# with or without modifications, as long as this notice is preserved.
28444d7874bSmrg
28544d7874bSmrg# serial 8
28644d7874bSmrg
28744d7874bSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
28844d7874bSmrg# written in clear, in which case automake, when reading aclocal.m4,
28944d7874bSmrg# will think it sees a *use*, and therefore will trigger all it's
29044d7874bSmrg# C support machinery.  Also note that it means that autoscan, seeing
29144d7874bSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
29244d7874bSmrg
29344d7874bSmrg
29444d7874bSmrg# _AM_DEPENDENCIES(NAME)
29544d7874bSmrg# ----------------------
29644d7874bSmrg# See how the compiler implements dependency checking.
29744d7874bSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
29844d7874bSmrg# We try a few techniques and use that to set a single cache variable.
29944d7874bSmrg#
30044d7874bSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
30144d7874bSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
30244d7874bSmrg# dependency, and given that the user is not expected to run this macro,
30344d7874bSmrg# just rely on AC_PROG_CC.
30444d7874bSmrgAC_DEFUN([_AM_DEPENDENCIES],
30544d7874bSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
30644d7874bSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
30744d7874bSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
30844d7874bSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
30944d7874bSmrg
31044d7874bSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
31144d7874bSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
31244d7874bSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
31344d7874bSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
31444d7874bSmrg                   [depcc="$$1"   am_compiler_list=])
31544d7874bSmrg
31644d7874bSmrgAC_CACHE_CHECK([dependency style of $depcc],
31744d7874bSmrg               [am_cv_$1_dependencies_compiler_type],
31844d7874bSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
31944d7874bSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
32044d7874bSmrg  # making bogus files that we don't know about and never remove.  For
32144d7874bSmrg  # instance it was reported that on HP-UX the gcc test will end up
32244d7874bSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
32344d7874bSmrg  # in D'.
32444d7874bSmrg  mkdir conftest.dir
32544d7874bSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
32644d7874bSmrg  # using a relative directory.
32744d7874bSmrg  cp "$am_depcomp" conftest.dir
32844d7874bSmrg  cd conftest.dir
32944d7874bSmrg  # We will build objects and dependencies in a subdirectory because
33044d7874bSmrg  # it helps to detect inapplicable dependency modes.  For instance
33144d7874bSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
33244d7874bSmrg  # side effect of compilation, but ICC will put the dependencies in
33344d7874bSmrg  # the current directory while Tru64 will put them in the object
33444d7874bSmrg  # directory.
33544d7874bSmrg  mkdir sub
33644d7874bSmrg
33744d7874bSmrg  am_cv_$1_dependencies_compiler_type=none
33844d7874bSmrg  if test "$am_compiler_list" = ""; then
33944d7874bSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
34044d7874bSmrg  fi
34144d7874bSmrg  for depmode in $am_compiler_list; do
34244d7874bSmrg    # Setup a source with many dependencies, because some compilers
34344d7874bSmrg    # like to wrap large dependency lists on column 80 (with \), and
34444d7874bSmrg    # we should not choose a depcomp mode which is confused by this.
34544d7874bSmrg    #
34644d7874bSmrg    # We need to recreate these files for each test, as the compiler may
34744d7874bSmrg    # overwrite some of them when testing with obscure command lines.
34844d7874bSmrg    # This happens at least with the AIX C compiler.
34944d7874bSmrg    : > sub/conftest.c
35044d7874bSmrg    for i in 1 2 3 4 5 6; do
35144d7874bSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
35244d7874bSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
35344d7874bSmrg      # Solaris 8's {/usr,}/bin/sh.
35444d7874bSmrg      touch sub/conftst$i.h
35544d7874bSmrg    done
35644d7874bSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
35744d7874bSmrg
35844d7874bSmrg    case $depmode in
35944d7874bSmrg    nosideeffect)
36044d7874bSmrg      # after this tag, mechanisms are not by side-effect, so they'll
36144d7874bSmrg      # only be used when explicitly requested
36244d7874bSmrg      if test "x$enable_dependency_tracking" = xyes; then
36344d7874bSmrg	continue
36444d7874bSmrg      else
36544d7874bSmrg	break
36644d7874bSmrg      fi
36744d7874bSmrg      ;;
36844d7874bSmrg    none) break ;;
36944d7874bSmrg    esac
37044d7874bSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
37144d7874bSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
37244d7874bSmrg    # handle `-M -o', and we need to detect this.
37344d7874bSmrg    if depmode=$depmode \
37444d7874bSmrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
37544d7874bSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
37644d7874bSmrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
37744d7874bSmrg         >/dev/null 2>conftest.err &&
37844d7874bSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
37944d7874bSmrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
38044d7874bSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
38144d7874bSmrg      # icc doesn't choke on unknown options, it will just issue warnings
38244d7874bSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
38344d7874bSmrg      # that says an option was ignored or not supported.
38444d7874bSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
38544d7874bSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
38644d7874bSmrg      # The diagnosis changed in icc 8.0:
38744d7874bSmrg      #   icc: Command line remark: option '-MP' not supported
38844d7874bSmrg      if (grep 'ignoring option' conftest.err ||
38944d7874bSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
39044d7874bSmrg        am_cv_$1_dependencies_compiler_type=$depmode
39144d7874bSmrg        break
39244d7874bSmrg      fi
39344d7874bSmrg    fi
39444d7874bSmrg  done
39544d7874bSmrg
39644d7874bSmrg  cd ..
39744d7874bSmrg  rm -rf conftest.dir
39844d7874bSmrgelse
39944d7874bSmrg  am_cv_$1_dependencies_compiler_type=none
40044d7874bSmrgfi
40144d7874bSmrg])
40244d7874bSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
40344d7874bSmrgAM_CONDITIONAL([am__fastdep$1], [
40444d7874bSmrg  test "x$enable_dependency_tracking" != xno \
40544d7874bSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
40644d7874bSmrg])
40744d7874bSmrg
40844d7874bSmrg
40944d7874bSmrg# AM_SET_DEPDIR
41044d7874bSmrg# -------------
41144d7874bSmrg# Choose a directory name for dependency files.
41244d7874bSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
41344d7874bSmrgAC_DEFUN([AM_SET_DEPDIR],
41444d7874bSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
41544d7874bSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
41644d7874bSmrg])
41744d7874bSmrg
41844d7874bSmrg
41944d7874bSmrg# AM_DEP_TRACK
42044d7874bSmrg# ------------
42144d7874bSmrgAC_DEFUN([AM_DEP_TRACK],
42244d7874bSmrg[AC_ARG_ENABLE(dependency-tracking,
42344d7874bSmrg[  --disable-dependency-tracking  speeds up one-time build
42444d7874bSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
42544d7874bSmrgif test "x$enable_dependency_tracking" != xno; then
42644d7874bSmrg  am_depcomp="$ac_aux_dir/depcomp"
42744d7874bSmrg  AMDEPBACKSLASH='\'
42844d7874bSmrgfi
42944d7874bSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
43044d7874bSmrgAC_SUBST([AMDEPBACKSLASH])
43144d7874bSmrg])
43244d7874bSmrg
43344d7874bSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
43444d7874bSmrg
43544d7874bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
43644d7874bSmrg# Free Software Foundation, Inc.
43744d7874bSmrg#
43844d7874bSmrg# This file is free software; the Free Software Foundation
43944d7874bSmrg# gives unlimited permission to copy and/or distribute it,
44044d7874bSmrg# with or without modifications, as long as this notice is preserved.
44144d7874bSmrg
44244d7874bSmrg#serial 3
44344d7874bSmrg
44444d7874bSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
44544d7874bSmrg# ------------------------------
44644d7874bSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
44744d7874bSmrg[for mf in $CONFIG_FILES; do
44844d7874bSmrg  # Strip MF so we end up with the name of the file.
44944d7874bSmrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
45044d7874bSmrg  # Check whether this is an Automake generated Makefile or not.
45144d7874bSmrg  # We used to match only the files named `Makefile.in', but
45244d7874bSmrg  # some people rename them; so instead we look at the file content.
45344d7874bSmrg  # Grep'ing the first line is not enough: some people post-process
45444d7874bSmrg  # each Makefile.in and add a new line on top of each file to say so.
45544d7874bSmrg  # So let's grep whole file.
45644d7874bSmrg  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
45744d7874bSmrg    dirpart=`AS_DIRNAME("$mf")`
45844d7874bSmrg  else
45944d7874bSmrg    continue
46044d7874bSmrg  fi
46144d7874bSmrg  # Extract the definition of DEPDIR, am__include, and am__quote
46244d7874bSmrg  # from the Makefile without running `make'.
46344d7874bSmrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
46444d7874bSmrg  test -z "$DEPDIR" && continue
46544d7874bSmrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
46644d7874bSmrg  test -z "am__include" && continue
46744d7874bSmrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
46844d7874bSmrg  # When using ansi2knr, U may be empty or an underscore; expand it
46944d7874bSmrg  U=`sed -n 's/^U = //p' < "$mf"`
47044d7874bSmrg  # Find all dependency output files, they are included files with
47144d7874bSmrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
47244d7874bSmrg  # simplest approach to changing $(DEPDIR) to its actual value in the
47344d7874bSmrg  # expansion.
47444d7874bSmrg  for file in `sed -n "
47544d7874bSmrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
47644d7874bSmrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
47744d7874bSmrg    # Make sure the directory exists.
47844d7874bSmrg    test -f "$dirpart/$file" && continue
47944d7874bSmrg    fdir=`AS_DIRNAME(["$file"])`
48044d7874bSmrg    AS_MKDIR_P([$dirpart/$fdir])
48144d7874bSmrg    # echo "creating $dirpart/$file"
48244d7874bSmrg    echo '# dummy' > "$dirpart/$file"
48344d7874bSmrg  done
48444d7874bSmrgdone
48544d7874bSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
48644d7874bSmrg
48744d7874bSmrg
48844d7874bSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
48944d7874bSmrg# -----------------------------
49044d7874bSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
49144d7874bSmrg#
49244d7874bSmrg# This code is only required when automatic dependency tracking
49344d7874bSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
49444d7874bSmrg# need in order to bootstrap the dependency handling code.
49544d7874bSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
49644d7874bSmrg[AC_CONFIG_COMMANDS([depfiles],
49744d7874bSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
49844d7874bSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
49944d7874bSmrg])
50044d7874bSmrg
50144d7874bSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
50244d7874bSmrg# Free Software Foundation, Inc.
50344d7874bSmrg#
50444d7874bSmrg# This file is free software; the Free Software Foundation
50544d7874bSmrg# gives unlimited permission to copy and/or distribute it,
50644d7874bSmrg# with or without modifications, as long as this notice is preserved.
50744d7874bSmrg
50844d7874bSmrg# serial 8
50944d7874bSmrg
51044d7874bSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
51144d7874bSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
51244d7874bSmrg
51344d7874bSmrg# Do all the work for Automake.                             -*- Autoconf -*-
51444d7874bSmrg
51544d7874bSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
51644d7874bSmrg# Free Software Foundation, Inc.
51744d7874bSmrg#
51844d7874bSmrg# This file is free software; the Free Software Foundation
51944d7874bSmrg# gives unlimited permission to copy and/or distribute it,
52044d7874bSmrg# with or without modifications, as long as this notice is preserved.
52144d7874bSmrg
52244d7874bSmrg# serial 12
52344d7874bSmrg
52444d7874bSmrg# This macro actually does too much.  Some checks are only needed if
52544d7874bSmrg# your package does certain things.  But this isn't really a big deal.
52644d7874bSmrg
52744d7874bSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
52844d7874bSmrg# AM_INIT_AUTOMAKE([OPTIONS])
52944d7874bSmrg# -----------------------------------------------
53044d7874bSmrg# The call with PACKAGE and VERSION arguments is the old style
53144d7874bSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
53244d7874bSmrg# and VERSION should now be passed to AC_INIT and removed from
53344d7874bSmrg# the call to AM_INIT_AUTOMAKE.
53444d7874bSmrg# We support both call styles for the transition.  After
53544d7874bSmrg# the next Automake release, Autoconf can make the AC_INIT
53644d7874bSmrg# arguments mandatory, and then we can depend on a new Autoconf
53744d7874bSmrg# release and drop the old call support.
53844d7874bSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
53944d7874bSmrg[AC_PREREQ([2.58])dnl
54044d7874bSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
54144d7874bSmrgdnl the ones we care about.
54244d7874bSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
54344d7874bSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
54444d7874bSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
54544d7874bSmrg# test to see if srcdir already configured
54644d7874bSmrgif test "`cd $srcdir && pwd`" != "`pwd`" &&
54744d7874bSmrg   test -f $srcdir/config.status; then
54844d7874bSmrg  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
54944d7874bSmrgfi
55044d7874bSmrg
55144d7874bSmrg# test whether we have cygpath
55244d7874bSmrgif test -z "$CYGPATH_W"; then
55344d7874bSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
55444d7874bSmrg    CYGPATH_W='cygpath -w'
55544d7874bSmrg  else
55644d7874bSmrg    CYGPATH_W=echo
55744d7874bSmrg  fi
55844d7874bSmrgfi
55944d7874bSmrgAC_SUBST([CYGPATH_W])
56044d7874bSmrg
56144d7874bSmrg# Define the identity of the package.
56244d7874bSmrgdnl Distinguish between old-style and new-style calls.
56344d7874bSmrgm4_ifval([$2],
56444d7874bSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
56544d7874bSmrg AC_SUBST([PACKAGE], [$1])dnl
56644d7874bSmrg AC_SUBST([VERSION], [$2])],
56744d7874bSmrg[_AM_SET_OPTIONS([$1])dnl
56844d7874bSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
56944d7874bSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
57044d7874bSmrg
57144d7874bSmrg_AM_IF_OPTION([no-define],,
57244d7874bSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
57344d7874bSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
57444d7874bSmrg
57544d7874bSmrg# Some tools Automake needs.
57644d7874bSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
57744d7874bSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
57844d7874bSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
57944d7874bSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
58044d7874bSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
58144d7874bSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
58244d7874bSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
58344d7874bSmrgAM_PROG_INSTALL_SH
58444d7874bSmrgAM_PROG_INSTALL_STRIP
58544d7874bSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
58644d7874bSmrg# We need awk for the "check" target.  The system "awk" is bad on
58744d7874bSmrg# some platforms.
58844d7874bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
58944d7874bSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
59044d7874bSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
59144d7874bSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
59244d7874bSmrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
59344d7874bSmrg	      		     [_AM_PROG_TAR([v7])])])
59444d7874bSmrg_AM_IF_OPTION([no-dependencies],,
59544d7874bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
59644d7874bSmrg                  [_AM_DEPENDENCIES(CC)],
59744d7874bSmrg                  [define([AC_PROG_CC],
59844d7874bSmrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
59944d7874bSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
60044d7874bSmrg                  [_AM_DEPENDENCIES(CXX)],
60144d7874bSmrg                  [define([AC_PROG_CXX],
60244d7874bSmrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
60344d7874bSmrg])
60444d7874bSmrg])
60544d7874bSmrg
60644d7874bSmrg
60744d7874bSmrg# When config.status generates a header, we must update the stamp-h file.
60844d7874bSmrg# This file resides in the same directory as the config header
60944d7874bSmrg# that is generated.  The stamp files are numbered to have different names.
61044d7874bSmrg
61144d7874bSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
61244d7874bSmrg# loop where config.status creates the headers, so we can generate
61344d7874bSmrg# our stamp files there.
61444d7874bSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
61544d7874bSmrg[# Compute $1's index in $config_headers.
61644d7874bSmrg_am_stamp_count=1
61744d7874bSmrgfor _am_header in $config_headers :; do
61844d7874bSmrg  case $_am_header in
61944d7874bSmrg    $1 | $1:* )
62044d7874bSmrg      break ;;
62144d7874bSmrg    * )
62244d7874bSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
62344d7874bSmrg  esac
62444d7874bSmrgdone
62544d7874bSmrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
62644d7874bSmrg
62744d7874bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
62844d7874bSmrg#
62944d7874bSmrg# This file is free software; the Free Software Foundation
63044d7874bSmrg# gives unlimited permission to copy and/or distribute it,
63144d7874bSmrg# with or without modifications, as long as this notice is preserved.
63244d7874bSmrg
63344d7874bSmrg# AM_PROG_INSTALL_SH
63444d7874bSmrg# ------------------
63544d7874bSmrg# Define $install_sh.
63644d7874bSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
63744d7874bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
63844d7874bSmrginstall_sh=${install_sh-"$am_aux_dir/install-sh"}
63944d7874bSmrgAC_SUBST(install_sh)])
64044d7874bSmrg
64144d7874bSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
64244d7874bSmrg#
64344d7874bSmrg# This file is free software; the Free Software Foundation
64444d7874bSmrg# gives unlimited permission to copy and/or distribute it,
64544d7874bSmrg# with or without modifications, as long as this notice is preserved.
64644d7874bSmrg
64744d7874bSmrg# serial 2
64844d7874bSmrg
64944d7874bSmrg# Check whether the underlying file-system supports filenames
65044d7874bSmrg# with a leading dot.  For instance MS-DOS doesn't.
65144d7874bSmrgAC_DEFUN([AM_SET_LEADING_DOT],
65244d7874bSmrg[rm -rf .tst 2>/dev/null
65344d7874bSmrgmkdir .tst 2>/dev/null
65444d7874bSmrgif test -d .tst; then
65544d7874bSmrg  am__leading_dot=.
65644d7874bSmrgelse
65744d7874bSmrg  am__leading_dot=_
65844d7874bSmrgfi
65944d7874bSmrgrmdir .tst 2>/dev/null
66044d7874bSmrgAC_SUBST([am__leading_dot])])
66144d7874bSmrg
66244d7874bSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
66344d7874bSmrg# From Jim Meyering
66444d7874bSmrg
66544d7874bSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
66644d7874bSmrg# Free Software Foundation, Inc.
66744d7874bSmrg#
66844d7874bSmrg# This file is free software; the Free Software Foundation
66944d7874bSmrg# gives unlimited permission to copy and/or distribute it,
67044d7874bSmrg# with or without modifications, as long as this notice is preserved.
67144d7874bSmrg
67244d7874bSmrg# serial 4
67344d7874bSmrg
67444d7874bSmrgAC_DEFUN([AM_MAINTAINER_MODE],
67544d7874bSmrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
67644d7874bSmrg  dnl maintainer-mode is disabled by default
67744d7874bSmrg  AC_ARG_ENABLE(maintainer-mode,
67844d7874bSmrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
67944d7874bSmrg			  (and sometimes confusing) to the casual installer],
68044d7874bSmrg      USE_MAINTAINER_MODE=$enableval,
68144d7874bSmrg      USE_MAINTAINER_MODE=no)
68244d7874bSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
68344d7874bSmrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
68444d7874bSmrg  MAINT=$MAINTAINER_MODE_TRUE
68544d7874bSmrg  AC_SUBST(MAINT)dnl
68644d7874bSmrg]
68744d7874bSmrg)
68844d7874bSmrg
68944d7874bSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
69044d7874bSmrg
69144d7874bSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
69244d7874bSmrg
69344d7874bSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
69444d7874bSmrg#
69544d7874bSmrg# This file is free software; the Free Software Foundation
69644d7874bSmrg# gives unlimited permission to copy and/or distribute it,
69744d7874bSmrg# with or without modifications, as long as this notice is preserved.
69844d7874bSmrg
69944d7874bSmrg# serial 3
70044d7874bSmrg
70144d7874bSmrg# AM_MAKE_INCLUDE()
70244d7874bSmrg# -----------------
70344d7874bSmrg# Check to see how make treats includes.
70444d7874bSmrgAC_DEFUN([AM_MAKE_INCLUDE],
70544d7874bSmrg[am_make=${MAKE-make}
70644d7874bSmrgcat > confinc << 'END'
70744d7874bSmrgam__doit:
70844d7874bSmrg	@echo done
70944d7874bSmrg.PHONY: am__doit
71044d7874bSmrgEND
71144d7874bSmrg# If we don't find an include directive, just comment out the code.
71244d7874bSmrgAC_MSG_CHECKING([for style of include used by $am_make])
71344d7874bSmrgam__include="#"
71444d7874bSmrgam__quote=
71544d7874bSmrg_am_result=none
71644d7874bSmrg# First try GNU make style include.
71744d7874bSmrgecho "include confinc" > confmf
71844d7874bSmrg# We grep out `Entering directory' and `Leaving directory'
71944d7874bSmrg# messages which can occur if `w' ends up in MAKEFLAGS.
72044d7874bSmrg# In particular we don't look at `^make:' because GNU make might
72144d7874bSmrg# be invoked under some other name (usually "gmake"), in which
72244d7874bSmrg# case it prints its new name instead of `make'.
72344d7874bSmrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
72444d7874bSmrg   am__include=include
72544d7874bSmrg   am__quote=
72644d7874bSmrg   _am_result=GNU
72744d7874bSmrgfi
72844d7874bSmrg# Now try BSD make style include.
72944d7874bSmrgif test "$am__include" = "#"; then
73044d7874bSmrg   echo '.include "confinc"' > confmf
73144d7874bSmrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
73244d7874bSmrg      am__include=.include
73344d7874bSmrg      am__quote="\""
73444d7874bSmrg      _am_result=BSD
73544d7874bSmrg   fi
73644d7874bSmrgfi
73744d7874bSmrgAC_SUBST([am__include])
73844d7874bSmrgAC_SUBST([am__quote])
73944d7874bSmrgAC_MSG_RESULT([$_am_result])
74044d7874bSmrgrm -f confinc confmf
74144d7874bSmrg])
74244d7874bSmrg
74344d7874bSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
74444d7874bSmrg
74544d7874bSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
74644d7874bSmrg# Free Software Foundation, Inc.
74744d7874bSmrg#
74844d7874bSmrg# This file is free software; the Free Software Foundation
74944d7874bSmrg# gives unlimited permission to copy and/or distribute it,
75044d7874bSmrg# with or without modifications, as long as this notice is preserved.
75144d7874bSmrg
75244d7874bSmrg# serial 4
75344d7874bSmrg
75444d7874bSmrg# AM_MISSING_PROG(NAME, PROGRAM)
75544d7874bSmrg# ------------------------------
75644d7874bSmrgAC_DEFUN([AM_MISSING_PROG],
75744d7874bSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
75844d7874bSmrg$1=${$1-"${am_missing_run}$2"}
75944d7874bSmrgAC_SUBST($1)])
76044d7874bSmrg
76144d7874bSmrg
76244d7874bSmrg# AM_MISSING_HAS_RUN
76344d7874bSmrg# ------------------
76444d7874bSmrg# Define MISSING if not defined so far and test if it supports --run.
76544d7874bSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
76644d7874bSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
76744d7874bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
76844d7874bSmrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
76944d7874bSmrg# Use eval to expand $SHELL
77044d7874bSmrgif eval "$MISSING --run true"; then
77144d7874bSmrg  am_missing_run="$MISSING --run "
77244d7874bSmrgelse
77344d7874bSmrg  am_missing_run=
77444d7874bSmrg  AC_MSG_WARN([`missing' script is too old or missing])
77544d7874bSmrgfi
77644d7874bSmrg])
77744d7874bSmrg
77844d7874bSmrg# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
77944d7874bSmrg#
78044d7874bSmrg# This file is free software; the Free Software Foundation
78144d7874bSmrg# gives unlimited permission to copy and/or distribute it,
78244d7874bSmrg# with or without modifications, as long as this notice is preserved.
78344d7874bSmrg
78444d7874bSmrg# AM_PROG_MKDIR_P
78544d7874bSmrg# ---------------
78644d7874bSmrg# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
78744d7874bSmrg#
78844d7874bSmrg# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
78944d7874bSmrg# created by `make install' are always world readable, even if the
79044d7874bSmrg# installer happens to have an overly restrictive umask (e.g. 077).
79144d7874bSmrg# This was a mistake.  There are at least two reasons why we must not
79244d7874bSmrg# use `-m 0755':
79344d7874bSmrg#   - it causes special bits like SGID to be ignored,
79444d7874bSmrg#   - it may be too restrictive (some setups expect 775 directories).
79544d7874bSmrg#
79644d7874bSmrg# Do not use -m 0755 and let people choose whatever they expect by
79744d7874bSmrg# setting umask.
79844d7874bSmrg#
79944d7874bSmrg# We cannot accept any implementation of `mkdir' that recognizes `-p'.
80044d7874bSmrg# Some implementations (such as Solaris 8's) are not thread-safe: if a
80144d7874bSmrg# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
80244d7874bSmrg# concurrently, both version can detect that a/ is missing, but only
80344d7874bSmrg# one can create it and the other will error out.  Consequently we
80444d7874bSmrg# restrict ourselves to GNU make (using the --version option ensures
80544d7874bSmrg# this.)
80644d7874bSmrgAC_DEFUN([AM_PROG_MKDIR_P],
80744d7874bSmrg[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
80844d7874bSmrg  # We used to keeping the `.' as first argument, in order to
80944d7874bSmrg  # allow $(mkdir_p) to be used without argument.  As in
81044d7874bSmrg  #   $(mkdir_p) $(somedir)
81144d7874bSmrg  # where $(somedir) is conditionally defined.  However this is wrong
81244d7874bSmrg  # for two reasons:
81344d7874bSmrg  #  1. if the package is installed by a user who cannot write `.'
81444d7874bSmrg  #     make install will fail,
81544d7874bSmrg  #  2. the above comment should most certainly read
81644d7874bSmrg  #     $(mkdir_p) $(DESTDIR)$(somedir)
81744d7874bSmrg  #     so it does not work when $(somedir) is undefined and
81844d7874bSmrg  #     $(DESTDIR) is not.
81944d7874bSmrg  #  To support the latter case, we have to write
82044d7874bSmrg  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
82144d7874bSmrg  #  so the `.' trick is pointless.
82244d7874bSmrg  mkdir_p='mkdir -p --'
82344d7874bSmrgelse
82444d7874bSmrg  # On NextStep and OpenStep, the `mkdir' command does not
82544d7874bSmrg  # recognize any option.  It will interpret all options as
82644d7874bSmrg  # directories to create, and then abort because `.' already
82744d7874bSmrg  # exists.
82844d7874bSmrg  for d in ./-p ./--version;
82944d7874bSmrg  do
83044d7874bSmrg    test -d $d && rmdir $d
83144d7874bSmrg  done
83244d7874bSmrg  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
83344d7874bSmrg  if test -f "$ac_aux_dir/mkinstalldirs"; then
83444d7874bSmrg    mkdir_p='$(mkinstalldirs)'
83544d7874bSmrg  else
83644d7874bSmrg    mkdir_p='$(SHELL) $(install_sh) -d'
83744d7874bSmrg  fi
83844d7874bSmrgfi
83944d7874bSmrgAC_SUBST([mkdir_p])])
84044d7874bSmrg
84144d7874bSmrg# Helper functions for option handling.                     -*- Autoconf -*-
84244d7874bSmrg
84344d7874bSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
84444d7874bSmrg#
84544d7874bSmrg# This file is free software; the Free Software Foundation
84644d7874bSmrg# gives unlimited permission to copy and/or distribute it,
84744d7874bSmrg# with or without modifications, as long as this notice is preserved.
84844d7874bSmrg
84944d7874bSmrg# serial 3
85044d7874bSmrg
85144d7874bSmrg# _AM_MANGLE_OPTION(NAME)
85244d7874bSmrg# -----------------------
85344d7874bSmrgAC_DEFUN([_AM_MANGLE_OPTION],
85444d7874bSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
85544d7874bSmrg
85644d7874bSmrg# _AM_SET_OPTION(NAME)
85744d7874bSmrg# ------------------------------
85844d7874bSmrg# Set option NAME.  Presently that only means defining a flag for this option.
85944d7874bSmrgAC_DEFUN([_AM_SET_OPTION],
86044d7874bSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
86144d7874bSmrg
86244d7874bSmrg# _AM_SET_OPTIONS(OPTIONS)
86344d7874bSmrg# ----------------------------------
86444d7874bSmrg# OPTIONS is a space-separated list of Automake options.
86544d7874bSmrgAC_DEFUN([_AM_SET_OPTIONS],
86644d7874bSmrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
86744d7874bSmrg
86844d7874bSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
86944d7874bSmrg# -------------------------------------------
87044d7874bSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
87144d7874bSmrgAC_DEFUN([_AM_IF_OPTION],
87244d7874bSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
87344d7874bSmrg
87444d7874bSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
87544d7874bSmrg
87644d7874bSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
87744d7874bSmrg# Free Software Foundation, Inc.
87844d7874bSmrg#
87944d7874bSmrg# This file is free software; the Free Software Foundation
88044d7874bSmrg# gives unlimited permission to copy and/or distribute it,
88144d7874bSmrg# with or without modifications, as long as this notice is preserved.
88244d7874bSmrg
88344d7874bSmrg# serial 4
88444d7874bSmrg
88544d7874bSmrg# AM_SANITY_CHECK
88644d7874bSmrg# ---------------
88744d7874bSmrgAC_DEFUN([AM_SANITY_CHECK],
88844d7874bSmrg[AC_MSG_CHECKING([whether build environment is sane])
88944d7874bSmrg# Just in case
89044d7874bSmrgsleep 1
89144d7874bSmrgecho timestamp > conftest.file
89244d7874bSmrg# Do `set' in a subshell so we don't clobber the current shell's
89344d7874bSmrg# arguments.  Must try -L first in case configure is actually a
89444d7874bSmrg# symlink; some systems play weird games with the mod time of symlinks
89544d7874bSmrg# (eg FreeBSD returns the mod time of the symlink's containing
89644d7874bSmrg# directory).
89744d7874bSmrgif (
89844d7874bSmrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
89944d7874bSmrg   if test "$[*]" = "X"; then
90044d7874bSmrg      # -L didn't work.
90144d7874bSmrg      set X `ls -t $srcdir/configure conftest.file`
90244d7874bSmrg   fi
90344d7874bSmrg   rm -f conftest.file
90444d7874bSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
90544d7874bSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
90644d7874bSmrg
90744d7874bSmrg      # If neither matched, then we have a broken ls.  This can happen
90844d7874bSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
90944d7874bSmrg      # broken ls alias from the environment.  This has actually
91044d7874bSmrg      # happened.  Such a system could not be considered "sane".
91144d7874bSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
91244d7874bSmrgalias in your environment])
91344d7874bSmrg   fi
91444d7874bSmrg
91544d7874bSmrg   test "$[2]" = conftest.file
91644d7874bSmrg   )
91744d7874bSmrgthen
91844d7874bSmrg   # Ok.
91944d7874bSmrg   :
92044d7874bSmrgelse
92144d7874bSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
92244d7874bSmrgCheck your system clock])
92344d7874bSmrgfi
92444d7874bSmrgAC_MSG_RESULT(yes)])
92544d7874bSmrg
92644d7874bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
92744d7874bSmrg#
92844d7874bSmrg# This file is free software; the Free Software Foundation
92944d7874bSmrg# gives unlimited permission to copy and/or distribute it,
93044d7874bSmrg# with or without modifications, as long as this notice is preserved.
93144d7874bSmrg
93244d7874bSmrg# AM_PROG_INSTALL_STRIP
93344d7874bSmrg# ---------------------
93444d7874bSmrg# One issue with vendor `install' (even GNU) is that you can't
93544d7874bSmrg# specify the program used to strip binaries.  This is especially
93644d7874bSmrg# annoying in cross-compiling environments, where the build's strip
93744d7874bSmrg# is unlikely to handle the host's binaries.
93844d7874bSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
93944d7874bSmrg# always use install-sh in `make install-strip', and initialize
94044d7874bSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
94144d7874bSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
94244d7874bSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
94344d7874bSmrg# Installed binaries are usually stripped using `strip' when the user
94444d7874bSmrg# run `make install-strip'.  However `strip' might not be the right
94544d7874bSmrg# tool to use in cross-compilation environments, therefore Automake
94644d7874bSmrg# will honor the `STRIP' environment variable to overrule this program.
94744d7874bSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
94844d7874bSmrgif test "$cross_compiling" != no; then
94944d7874bSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
95044d7874bSmrgfi
95144d7874bSmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
95244d7874bSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
95344d7874bSmrg
95444d7874bSmrg# Check how to create a tarball.                            -*- Autoconf -*-
95544d7874bSmrg
95644d7874bSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
95744d7874bSmrg#
95844d7874bSmrg# This file is free software; the Free Software Foundation
95944d7874bSmrg# gives unlimited permission to copy and/or distribute it,
96044d7874bSmrg# with or without modifications, as long as this notice is preserved.
96144d7874bSmrg
96244d7874bSmrg# serial 2
96344d7874bSmrg
96444d7874bSmrg# _AM_PROG_TAR(FORMAT)
96544d7874bSmrg# --------------------
96644d7874bSmrg# Check how to create a tarball in format FORMAT.
96744d7874bSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
96844d7874bSmrg#
96944d7874bSmrg# Substitute a variable $(am__tar) that is a command
97044d7874bSmrg# writing to stdout a FORMAT-tarball containing the directory
97144d7874bSmrg# $tardir.
97244d7874bSmrg#     tardir=directory && $(am__tar) > result.tar
97344d7874bSmrg#
97444d7874bSmrg# Substitute a variable $(am__untar) that extract such
97544d7874bSmrg# a tarball read from stdin.
97644d7874bSmrg#     $(am__untar) < result.tar
97744d7874bSmrgAC_DEFUN([_AM_PROG_TAR],
97844d7874bSmrg[# Always define AMTAR for backward compatibility.
97944d7874bSmrgAM_MISSING_PROG([AMTAR], [tar])
98044d7874bSmrgm4_if([$1], [v7],
98144d7874bSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
98244d7874bSmrg     [m4_case([$1], [ustar],, [pax],,
98344d7874bSmrg              [m4_fatal([Unknown tar format])])
98444d7874bSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
98544d7874bSmrg# Loop over all known methods to create a tar archive until one works.
98644d7874bSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
98744d7874bSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
98844d7874bSmrg# Do not fold the above two line into one, because Tru64 sh and
98944d7874bSmrg# Solaris sh will not grok spaces in the rhs of `-'.
99044d7874bSmrgfor _am_tool in $_am_tools
99144d7874bSmrgdo
99244d7874bSmrg  case $_am_tool in
99344d7874bSmrg  gnutar)
99444d7874bSmrg    for _am_tar in tar gnutar gtar;
99544d7874bSmrg    do
99644d7874bSmrg      AM_RUN_LOG([$_am_tar --version]) && break
99744d7874bSmrg    done
99844d7874bSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
99944d7874bSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
100044d7874bSmrg    am__untar="$_am_tar -xf -"
100144d7874bSmrg    ;;
100244d7874bSmrg  plaintar)
100344d7874bSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
100444d7874bSmrg    # ustar tarball either.
100544d7874bSmrg    (tar --version) >/dev/null 2>&1 && continue
100644d7874bSmrg    am__tar='tar chf - "$$tardir"'
100744d7874bSmrg    am__tar_='tar chf - "$tardir"'
100844d7874bSmrg    am__untar='tar xf -'
100944d7874bSmrg    ;;
101044d7874bSmrg  pax)
101144d7874bSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
101244d7874bSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
101344d7874bSmrg    am__untar='pax -r'
101444d7874bSmrg    ;;
101544d7874bSmrg  cpio)
101644d7874bSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
101744d7874bSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
101844d7874bSmrg    am__untar='cpio -i -H $1 -d'
101944d7874bSmrg    ;;
102044d7874bSmrg  none)
102144d7874bSmrg    am__tar=false
102244d7874bSmrg    am__tar_=false
102344d7874bSmrg    am__untar=false
102444d7874bSmrg    ;;
102544d7874bSmrg  esac
102644d7874bSmrg
102744d7874bSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
102844d7874bSmrg  # and am__untar set.
102944d7874bSmrg  test -n "${am_cv_prog_tar_$1}" && break
103044d7874bSmrg
103144d7874bSmrg  # tar/untar a dummy directory, and stop if the command works
103244d7874bSmrg  rm -rf conftest.dir
103344d7874bSmrg  mkdir conftest.dir
103444d7874bSmrg  echo GrepMe > conftest.dir/file
103544d7874bSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
103644d7874bSmrg  rm -rf conftest.dir
103744d7874bSmrg  if test -s conftest.tar; then
103844d7874bSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
103944d7874bSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
104044d7874bSmrg  fi
104144d7874bSmrgdone
104244d7874bSmrgrm -rf conftest.dir
104344d7874bSmrg
104444d7874bSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
104544d7874bSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
104644d7874bSmrgAC_SUBST([am__tar])
104744d7874bSmrgAC_SUBST([am__untar])
104844d7874bSmrg]) # _AM_PROG_TAR
104944d7874bSmrg
105044d7874bSmrgdnl
105144d7874bSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
105244d7874bSmrgdnl 
105344d7874bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
105444d7874bSmrgdnl copy of this software and associated documentation files (the
105544d7874bSmrgdnl "Software"), to deal in the Software without restriction, including
105644d7874bSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
105744d7874bSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
105844d7874bSmrgdnl to whom the Software is furnished to do so, provided that the above
105944d7874bSmrgdnl copyright notice(s) and this permission notice appear in all copies of
106044d7874bSmrgdnl the Software and that both the above copyright notice(s) and this
106144d7874bSmrgdnl permission notice appear in supporting documentation.
106244d7874bSmrgdnl
106344d7874bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
106444d7874bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
106544d7874bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
106644d7874bSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
106744d7874bSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
106844d7874bSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
106944d7874bSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
107044d7874bSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
107144d7874bSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
107244d7874bSmrgdnl
107344d7874bSmrgdnl Except as contained in this notice, the name of a copyright holder
107444d7874bSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
107544d7874bSmrgdnl or other dealings in this Software without prior written authorization
107644d7874bSmrgdnl of the copyright holder.
107744d7874bSmrg
107844d7874bSmrg# XORG_MACROS_VERSION(required-version)
107944d7874bSmrg# -------------------------------------
108044d7874bSmrg# Minimum version: 1.1.0
108144d7874bSmrg#
108244d7874bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
108344d7874bSmrg# your configure.ac with the minimum required version, such as:
108444d7874bSmrg# XORG_MACROS_VERSION(1.1)
108544d7874bSmrg#
108644d7874bSmrg# To force at least a version with this macro defined, also add:
108744d7874bSmrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
108844d7874bSmrg#
108944d7874bSmrg#
109044d7874bSmrg# See the "minimum version" comment for each macro you use to see what 
109144d7874bSmrg# version you require.
109244d7874bSmrgAC_DEFUN([XORG_MACROS_VERSION],[
109344d7874bSmrg	[XORG_MACROS_needed_version=$1
109444d7874bSmrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
109544d7874bSmrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
109644d7874bSmrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
109744d7874bSmrg	[XORG_MACROS_version=1.1.5
109844d7874bSmrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
109944d7874bSmrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
110044d7874bSmrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
110144d7874bSmrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
110244d7874bSmrg	fi
110344d7874bSmrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
110444d7874bSmrg		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
110544d7874bSmrg	fi
110644d7874bSmrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
110744d7874bSmrg]) # XORG_MACROS_VERSION
110844d7874bSmrg
110944d7874bSmrg# XORG_PROG_RAWCPP()
111044d7874bSmrg# ------------------
111144d7874bSmrg# Minimum version: 1.0.0
111244d7874bSmrg#
111344d7874bSmrg# Find cpp program and necessary flags for use in pre-processing text files
111444d7874bSmrg# such as man pages and config files
111544d7874bSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
111644d7874bSmrgAC_REQUIRE([AC_PROG_CPP])
111744d7874bSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
111844d7874bSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
111944d7874bSmrg
112044d7874bSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
112144d7874bSmrg# which is not the best choice for supporting other OS'es, but covers most
112244d7874bSmrg# of the ones we need for now.
112344d7874bSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
112444d7874bSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
112544d7874bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
112644d7874bSmrg	AC_MSG_RESULT([no])
112744d7874bSmrgelse
112844d7874bSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
112944d7874bSmrg		RAWCPPFLAGS=-undef
113044d7874bSmrg		AC_MSG_RESULT([yes])
113144d7874bSmrg	else
113244d7874bSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
113344d7874bSmrg	fi
113444d7874bSmrgfi
113544d7874bSmrgrm -f conftest.$ac_ext
113644d7874bSmrg
113744d7874bSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
113844d7874bSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
113944d7874bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
114044d7874bSmrg	AC_MSG_RESULT([no])
114144d7874bSmrgelse
114244d7874bSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
114344d7874bSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
114444d7874bSmrg		AC_MSG_RESULT([yes])
114544d7874bSmrg	else
114644d7874bSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
114744d7874bSmrg	fi
114844d7874bSmrgfi
114944d7874bSmrgrm -f conftest.$ac_ext
115044d7874bSmrgAC_SUBST(RAWCPPFLAGS)
115144d7874bSmrg]) # XORG_PROG_RAWCPP
115244d7874bSmrg
115344d7874bSmrg# XORG_MANPAGE_SECTIONS()
115444d7874bSmrg# -----------------------
115544d7874bSmrg# Minimum version: 1.0.0
115644d7874bSmrg#
115744d7874bSmrg# Determine which sections man pages go in for the different man page types
115844d7874bSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
115944d7874bSmrg# Not sure if there's any better way than just hardcoding by OS name.
116044d7874bSmrg# Override default settings by setting environment variables
116144d7874bSmrg
116244d7874bSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
116344d7874bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
116444d7874bSmrg
116544d7874bSmrgif test x$APP_MAN_SUFFIX = x    ; then
116644d7874bSmrg    APP_MAN_SUFFIX=1
116744d7874bSmrgfi
116844d7874bSmrgif test x$APP_MAN_DIR = x    ; then
116944d7874bSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
117044d7874bSmrgfi
117144d7874bSmrg
117244d7874bSmrgif test x$LIB_MAN_SUFFIX = x    ; then
117344d7874bSmrg    LIB_MAN_SUFFIX=3
117444d7874bSmrgfi
117544d7874bSmrgif test x$LIB_MAN_DIR = x    ; then
117644d7874bSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
117744d7874bSmrgfi
117844d7874bSmrg
117944d7874bSmrgif test x$FILE_MAN_SUFFIX = x    ; then
118044d7874bSmrg    case $host_os in
118144d7874bSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
118244d7874bSmrg	*)		FILE_MAN_SUFFIX=5  ;;
118344d7874bSmrg    esac
118444d7874bSmrgfi
118544d7874bSmrgif test x$FILE_MAN_DIR = x    ; then
118644d7874bSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
118744d7874bSmrgfi
118844d7874bSmrg
118944d7874bSmrgif test x$MISC_MAN_SUFFIX = x    ; then
119044d7874bSmrg    case $host_os in
119144d7874bSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
119244d7874bSmrg	*)		MISC_MAN_SUFFIX=7  ;;
119344d7874bSmrg    esac
119444d7874bSmrgfi
119544d7874bSmrgif test x$MISC_MAN_DIR = x    ; then
119644d7874bSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
119744d7874bSmrgfi
119844d7874bSmrg
119944d7874bSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
120044d7874bSmrg    case $host_os in
120144d7874bSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
120244d7874bSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
120344d7874bSmrg    esac
120444d7874bSmrgfi
120544d7874bSmrgif test x$DRIVER_MAN_DIR = x    ; then
120644d7874bSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
120744d7874bSmrgfi
120844d7874bSmrg
120944d7874bSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
121044d7874bSmrg    case $host_os in
121144d7874bSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
121244d7874bSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
121344d7874bSmrg    esac
121444d7874bSmrgfi
121544d7874bSmrgif test x$ADMIN_MAN_DIR = x    ; then
121644d7874bSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
121744d7874bSmrgfi
121844d7874bSmrg
121944d7874bSmrg
122044d7874bSmrgAC_SUBST([APP_MAN_SUFFIX])
122144d7874bSmrgAC_SUBST([LIB_MAN_SUFFIX])
122244d7874bSmrgAC_SUBST([FILE_MAN_SUFFIX])
122344d7874bSmrgAC_SUBST([MISC_MAN_SUFFIX])
122444d7874bSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
122544d7874bSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
122644d7874bSmrgAC_SUBST([APP_MAN_DIR])
122744d7874bSmrgAC_SUBST([LIB_MAN_DIR])
122844d7874bSmrgAC_SUBST([FILE_MAN_DIR])
122944d7874bSmrgAC_SUBST([MISC_MAN_DIR])
123044d7874bSmrgAC_SUBST([DRIVER_MAN_DIR])
123144d7874bSmrgAC_SUBST([ADMIN_MAN_DIR])
123244d7874bSmrg]) # XORG_MANPAGE_SECTIONS
123344d7874bSmrg
123444d7874bSmrg# XORG_CHECK_LINUXDOC
123544d7874bSmrg# -------------------
123644d7874bSmrg# Minimum version: 1.0.0
123744d7874bSmrg#
123844d7874bSmrg# Defines the variable MAKE_TEXT if the necessary tools and
123944d7874bSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
124044d7874bSmrg# Whether or not the necessary tools and files are found can be checked
124144d7874bSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
124244d7874bSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
124344d7874bSmrgXORG_SGML_PATH=$prefix/share/sgml
124444d7874bSmrgHAVE_DEFS_ENT=
124544d7874bSmrg
124644d7874bSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
124744d7874bSmrg
124844d7874bSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
124944d7874bSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
125044d7874bSmrg
125144d7874bSmrgAC_MSG_CHECKING([Whether to build documentation])
125244d7874bSmrg
125344d7874bSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
125444d7874bSmrg   BUILDDOC=yes
125544d7874bSmrgelse
125644d7874bSmrg   BUILDDOC=no
125744d7874bSmrgfi
125844d7874bSmrg
125944d7874bSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
126044d7874bSmrg
126144d7874bSmrgAC_MSG_RESULT([$BUILDDOC])
126244d7874bSmrg
126344d7874bSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
126444d7874bSmrg
126544d7874bSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
126644d7874bSmrg   BUILDPDFDOC=yes
126744d7874bSmrgelse
126844d7874bSmrg   BUILDPDFDOC=no
126944d7874bSmrgfi
127044d7874bSmrg
127144d7874bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
127244d7874bSmrg
127344d7874bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
127444d7874bSmrg
127544d7874bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
127644d7874bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
127744d7874bSmrgMAKE_PDF="$PS2PDF"
127844d7874bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
127944d7874bSmrg
128044d7874bSmrgAC_SUBST(MAKE_TEXT)
128144d7874bSmrgAC_SUBST(MAKE_PS)
128244d7874bSmrgAC_SUBST(MAKE_PDF)
128344d7874bSmrgAC_SUBST(MAKE_HTML)
128444d7874bSmrg]) # XORG_CHECK_LINUXDOC
128544d7874bSmrg
128644d7874bSmrg# XORG_CHECK_DOCBOOK
128744d7874bSmrg# -------------------
128844d7874bSmrg# Minimum version: 1.0.0
128944d7874bSmrg#
129044d7874bSmrg# Checks for the ability to build output formats from SGML DocBook source.
129144d7874bSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
129244d7874bSmrg# indicates whether the necessary tools and files are found and, if set,
129344d7874bSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
129444d7874bSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
129544d7874bSmrgXORG_SGML_PATH=$prefix/share/sgml
129644d7874bSmrgHAVE_DEFS_ENT=
129744d7874bSmrgBUILDTXTDOC=no
129844d7874bSmrgBUILDPDFDOC=no
129944d7874bSmrgBUILDPSDOC=no
130044d7874bSmrgBUILDHTMLDOC=no
130144d7874bSmrg
130244d7874bSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
130344d7874bSmrg
130444d7874bSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
130544d7874bSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
130644d7874bSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
130744d7874bSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
130844d7874bSmrg
130944d7874bSmrgAC_MSG_CHECKING([Whether to build text documentation])
131044d7874bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
131144d7874bSmrg   test x$BUILD_TXTDOC != xno; then
131244d7874bSmrg	BUILDTXTDOC=yes
131344d7874bSmrgfi
131444d7874bSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
131544d7874bSmrgAC_MSG_RESULT([$BUILDTXTDOC])
131644d7874bSmrg
131744d7874bSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
131844d7874bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
131944d7874bSmrg   test x$BUILD_PDFDOC != xno; then
132044d7874bSmrg	BUILDPDFDOC=yes
132144d7874bSmrgfi
132244d7874bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
132344d7874bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
132444d7874bSmrg
132544d7874bSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
132644d7874bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
132744d7874bSmrg   test x$BUILD_PSDOC != xno; then
132844d7874bSmrg	BUILDPSDOC=yes
132944d7874bSmrgfi
133044d7874bSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
133144d7874bSmrgAC_MSG_RESULT([$BUILDPSDOC])
133244d7874bSmrg
133344d7874bSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
133444d7874bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
133544d7874bSmrg   test x$BUILD_HTMLDOC != xno; then
133644d7874bSmrg	BUILDHTMLDOC=yes
133744d7874bSmrgfi
133844d7874bSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
133944d7874bSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
134044d7874bSmrg
134144d7874bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
134244d7874bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
134344d7874bSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
134444d7874bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
134544d7874bSmrg
134644d7874bSmrgAC_SUBST(MAKE_TEXT)
134744d7874bSmrgAC_SUBST(MAKE_PS)
134844d7874bSmrgAC_SUBST(MAKE_PDF)
134944d7874bSmrgAC_SUBST(MAKE_HTML)
135044d7874bSmrg]) # XORG_CHECK_DOCBOOK
135144d7874bSmrg
135244d7874bSmrg# XORG_CHECK_MALLOC_ZERO
135344d7874bSmrg# ----------------------
135444d7874bSmrg# Minimum version: 1.0.0
135544d7874bSmrg#
135644d7874bSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
135744d7874bSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
135844d7874bSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
135944d7874bSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
136044d7874bSmrgAC_ARG_ENABLE(malloc0returnsnull,
136144d7874bSmrg	AC_HELP_STRING([--enable-malloc0returnsnull],
136244d7874bSmrg		       [malloc(0) returns NULL (default: auto)]),
136344d7874bSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
136444d7874bSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
136544d7874bSmrg
136644d7874bSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
136744d7874bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
136844d7874bSmrg	AC_RUN_IFELSE([
136944d7874bSmrgchar *malloc();
137044d7874bSmrgchar *realloc();
137144d7874bSmrgchar *calloc();
137244d7874bSmrgmain() {
137344d7874bSmrg    char *m0, *r0, *c0, *p;
137444d7874bSmrg    m0 = malloc(0);
137544d7874bSmrg    p = malloc(10);
137644d7874bSmrg    r0 = realloc(p,0);
137744d7874bSmrg    c0 = calloc(0);
137844d7874bSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
137944d7874bSmrg}],
138044d7874bSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
138144d7874bSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
138244d7874bSmrgfi
138344d7874bSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
138444d7874bSmrg
138544d7874bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
138644d7874bSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
138744d7874bSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
138844d7874bSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
138944d7874bSmrgelse
139044d7874bSmrg	MALLOC_ZERO_CFLAGS=""
139144d7874bSmrg	XMALLOC_ZERO_CFLAGS=""
139244d7874bSmrg	XTMALLOC_ZERO_CFLAGS=""
139344d7874bSmrgfi
139444d7874bSmrg
139544d7874bSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
139644d7874bSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
139744d7874bSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
139844d7874bSmrg]) # XORG_CHECK_MALLOC_ZERO
139944d7874bSmrg
140044d7874bSmrg# XORG_WITH_LINT()
140144d7874bSmrg# ----------------
140244d7874bSmrg# Minimum version: 1.1.0
140344d7874bSmrg#
140444d7874bSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
140544d7874bSmrg# is specified.   (Use --with-lint=sparse for sparse.)
140644d7874bSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
140744d7874bSmrg# Sets $LINT_FLAGS to flags to pass to source checker
140844d7874bSmrg# Sets LINT automake conditional if enabled (default: disabled)
140944d7874bSmrg#
141044d7874bSmrgAC_DEFUN([XORG_WITH_LINT],[
141144d7874bSmrg
141244d7874bSmrg# Allow checking code with lint, sparse, etc.
141344d7874bSmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
141444d7874bSmrg		[Use a lint-style source code checker (default: disabled)])],
141544d7874bSmrg		[use_lint=$withval], [use_lint=no])
141644d7874bSmrgif test "x$use_lint" = "xyes" ; then
141744d7874bSmrg	LINT="lint"
141844d7874bSmrgelse
141944d7874bSmrg	LINT="$use_lint"
142044d7874bSmrgfi
142144d7874bSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
142244d7874bSmrg    case $LINT in
142344d7874bSmrg	lint|*/lint)
142444d7874bSmrg	    case $host_os in
142544d7874bSmrg		solaris*)
142644d7874bSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
142744d7874bSmrg			;;
142844d7874bSmrg	    esac
142944d7874bSmrg	    ;;
143044d7874bSmrg    esac
143144d7874bSmrgfi
143244d7874bSmrg
143344d7874bSmrgAC_SUBST(LINT)
143444d7874bSmrgAC_SUBST(LINT_FLAGS)
143544d7874bSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
143644d7874bSmrg
143744d7874bSmrg]) # XORG_WITH_LINT
143844d7874bSmrg
143944d7874bSmrg# XORG_LINT_LIBRARY(LIBNAME)
144044d7874bSmrg# --------------------------
144144d7874bSmrg# Minimum version: 1.1.0
144244d7874bSmrg#
144344d7874bSmrg# Sets up flags for building lint libraries for checking programs that call
144444d7874bSmrg# functions in the library.
144544d7874bSmrg# Disabled by default, enable with --enable-lint-library
144644d7874bSmrg# Sets: 
144744d7874bSmrg#	@LINTLIB@		- name of lint library file to make
144844d7874bSmrg#	MAKE_LINT_LIB		- automake conditional
144944d7874bSmrg#
145044d7874bSmrg
145144d7874bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
145244d7874bSmrgAC_REQUIRE([XORG_WITH_LINT])
145344d7874bSmrg# Build lint "library" for more indepth checks of programs calling this library
145444d7874bSmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
145544d7874bSmrg	[Create lint library (default: disabled)])],
145644d7874bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
145744d7874bSmrgif test "x$make_lint_lib" != "xno" ; then
145844d7874bSmrg	if test "x$LINT" = "xno" ; then
145944d7874bSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
146044d7874bSmrg	fi
146144d7874bSmrg	if test "x$make_lint_lib" = "xyes" ; then
146244d7874bSmrg		LINTLIB=llib-l$1.ln
146344d7874bSmrg	else
146444d7874bSmrg		LINTLIB=$make_lint_lib
146544d7874bSmrg	fi
146644d7874bSmrgfi
146744d7874bSmrgAC_SUBST(LINTLIB)
146844d7874bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
146944d7874bSmrg
147044d7874bSmrg]) # XORG_LINT_LIBRARY
147144d7874bSmrg
147244d7874bSmrgdnl Copyright 2005 Red Hat, Inc
147344d7874bSmrgdnl
147444d7874bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
147544d7874bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
147644d7874bSmrgdnl the above copyright notice appear in all copies and that both that
147744d7874bSmrgdnl copyright notice and this permission notice appear in supporting
147844d7874bSmrgdnl documentation.
147944d7874bSmrgdnl
148044d7874bSmrgdnl The above copyright notice and this permission notice shall be included
148144d7874bSmrgdnl in all copies or substantial portions of the Software.
148244d7874bSmrgdnl
148344d7874bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
148444d7874bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
148544d7874bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
148644d7874bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
148744d7874bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
148844d7874bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
148944d7874bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
149044d7874bSmrgdnl
149144d7874bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
149244d7874bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
149344d7874bSmrgdnl other dealings in this Software without prior written authorization
149444d7874bSmrgdnl from the copyright holders.
149544d7874bSmrgdnl
149644d7874bSmrg
149744d7874bSmrg# XORG_RELEASE_VERSION
149844d7874bSmrg# --------------------
149944d7874bSmrg# Adds --with/without-release-string and changes the PACKAGE and
150044d7874bSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
150144d7874bSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
150244d7874bSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
150344d7874bSmrg 
150444d7874bSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
150544d7874bSmrg	AC_ARG_WITH(release-version,
150644d7874bSmrg			AC_HELP_STRING([--with-release-version=STRING],
150744d7874bSmrg				[Use release version string in package name]),
150844d7874bSmrg			[RELEASE_VERSION="$withval"],
150944d7874bSmrg			[RELEASE_VERSION=""])
151044d7874bSmrg	if test "x$RELEASE_VERSION" != "x"; then
151144d7874bSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
151244d7874bSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
151344d7874bSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
151444d7874bSmrg	fi
151544d7874bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
151644d7874bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
151744d7874bSmrg		[Major version of this package])
151844d7874bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
151944d7874bSmrg	if test "x$PVM" = "x"; then
152044d7874bSmrg		PVM="0"
152144d7874bSmrg	fi
152244d7874bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
152344d7874bSmrg		[$PVM],
152444d7874bSmrg		[Minor version of this package])
152544d7874bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
152644d7874bSmrg	if test "x$PVP" = "x"; then
152744d7874bSmrg		PVP="0"
152844d7874bSmrg	fi
152944d7874bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
153044d7874bSmrg		[$PVP],
153144d7874bSmrg		[Patch version of this package])
153244d7874bSmrg])
153344d7874bSmrg
1534