aclocal.m4 revision d3263506
1d3263506Smrg# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
2b1297603Smrg
3b1297603Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
45b944e2aSmrg# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
5b1297603Smrg# This file is free software; the Free Software Foundation
6b1297603Smrg# gives unlimited permission to copy and/or distribute it,
7b1297603Smrg# with or without modifications, as long as this notice is preserved.
8b1297603Smrg
9b1297603Smrg# This program is distributed in the hope that it will be useful,
10b1297603Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11b1297603Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12b1297603Smrg# PARTICULAR PURPOSE.
13b1297603Smrg
145b944e2aSmrgm4_ifndef([AC_AUTOCONF_VERSION],
155b944e2aSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16d3263506Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
175b944e2aSmrg[m4_warning([this file was generated for autoconf 2.63.
185b944e2aSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
195b944e2aSmrgIf you have problems, you may need to regenerate the build system entirely.
205b944e2aSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
215b944e2aSmrg
22b1297603Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
23b1297603Smrg# 
24b1297603Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
25b1297603Smrg#
26b1297603Smrg# This program is free software; you can redistribute it and/or modify
27b1297603Smrg# it under the terms of the GNU General Public License as published by
28b1297603Smrg# the Free Software Foundation; either version 2 of the License, or
29b1297603Smrg# (at your option) any later version.
30b1297603Smrg#
31b1297603Smrg# This program is distributed in the hope that it will be useful, but
32b1297603Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
33b1297603Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
34b1297603Smrg# General Public License for more details.
35b1297603Smrg#
36b1297603Smrg# You should have received a copy of the GNU General Public License
37b1297603Smrg# along with this program; if not, write to the Free Software
38b1297603Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
39b1297603Smrg#
40b1297603Smrg# As a special exception to the GNU General Public License, if you
41b1297603Smrg# distribute this file as part of a program that contains a
42b1297603Smrg# configuration script generated by Autoconf, you may include it under
43b1297603Smrg# the same distribution terms that you use for the rest of that program.
44b1297603Smrg
45b1297603Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
46b1297603Smrg# ----------------------------------
47b1297603SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
48b1297603Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
49b1297603Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
50b1297603SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
51b1297603Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
52b1297603Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
53b1297603Smrgfi
54b1297603Smrgif test -n "$PKG_CONFIG"; then
55b1297603Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
56b1297603Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
57b1297603Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
58b1297603Smrg		AC_MSG_RESULT([yes])
59b1297603Smrg	else
60b1297603Smrg		AC_MSG_RESULT([no])
61b1297603Smrg		PKG_CONFIG=""
62b1297603Smrg	fi
63b1297603Smrg		
64b1297603Smrgfi[]dnl
65b1297603Smrg])# PKG_PROG_PKG_CONFIG
66b1297603Smrg
67b1297603Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
68b1297603Smrg#
69b1297603Smrg# Check to see whether a particular set of modules exists.  Similar
70b1297603Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
71b1297603Smrg#
72b1297603Smrg#
73b1297603Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
74b1297603Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
75b1297603Smrg# PKG_CHECK_EXISTS manually
76b1297603Smrg# --------------------------------------------------------------
77b1297603SmrgAC_DEFUN([PKG_CHECK_EXISTS],
78b1297603Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
79b1297603Smrgif test -n "$PKG_CONFIG" && \
80b1297603Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
81b1297603Smrg  m4_ifval([$2], [$2], [:])
82b1297603Smrgm4_ifvaln([$3], [else
83b1297603Smrg  $3])dnl
84b1297603Smrgfi])
85b1297603Smrg
86b1297603Smrg
87b1297603Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
88b1297603Smrg# ---------------------------------------------
89b1297603Smrgm4_define([_PKG_CONFIG],
905b944e2aSmrg[if test -n "$$1"; then
915b944e2aSmrg    pkg_cv_[]$1="$$1"
925b944e2aSmrg elif test -n "$PKG_CONFIG"; then
935b944e2aSmrg    PKG_CHECK_EXISTS([$3],
945b944e2aSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
955b944e2aSmrg		     [pkg_failed=yes])
965b944e2aSmrg else
975b944e2aSmrg    pkg_failed=untried
98b1297603Smrgfi[]dnl
99b1297603Smrg])# _PKG_CONFIG
100b1297603Smrg
101b1297603Smrg# _PKG_SHORT_ERRORS_SUPPORTED
102b1297603Smrg# -----------------------------
103b1297603SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
104b1297603Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
105b1297603Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
106b1297603Smrg        _pkg_short_errors_supported=yes
107b1297603Smrgelse
108b1297603Smrg        _pkg_short_errors_supported=no
109b1297603Smrgfi[]dnl
110b1297603Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
111b1297603Smrg
112b1297603Smrg
113b1297603Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
114b1297603Smrg# [ACTION-IF-NOT-FOUND])
115b1297603Smrg#
116b1297603Smrg#
117b1297603Smrg# Note that if there is a possibility the first call to
118b1297603Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
119b1297603Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
120b1297603Smrg#
121b1297603Smrg#
122b1297603Smrg# --------------------------------------------------------------
123b1297603SmrgAC_DEFUN([PKG_CHECK_MODULES],
124b1297603Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
125b1297603SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
126b1297603SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
127b1297603Smrg
128b1297603Smrgpkg_failed=no
129b1297603SmrgAC_MSG_CHECKING([for $1])
130b1297603Smrg
131b1297603Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
132b1297603Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
133b1297603Smrg
134b1297603Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
135b1297603Smrgand $1[]_LIBS to avoid the need to call pkg-config.
136b1297603SmrgSee the pkg-config man page for more details.])
137b1297603Smrg
138b1297603Smrgif test $pkg_failed = yes; then
139b1297603Smrg        _PKG_SHORT_ERRORS_SUPPORTED
140b1297603Smrg        if test $_pkg_short_errors_supported = yes; then
1415b944e2aSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
142b1297603Smrg        else 
1435b944e2aSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
144b1297603Smrg        fi
145b1297603Smrg	# Put the nasty error message in config.log where it belongs
146b1297603Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
147b1297603Smrg
148b1297603Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
149b1297603Smrg[Package requirements ($2) were not met:
150b1297603Smrg
151b1297603Smrg$$1_PKG_ERRORS
152b1297603Smrg
153b1297603SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
154b1297603Smrginstalled software in a non-standard prefix.
155b1297603Smrg
156b1297603Smrg_PKG_TEXT
157b1297603Smrg])],
158b1297603Smrg		[AC_MSG_RESULT([no])
159b1297603Smrg                $4])
160b1297603Smrgelif test $pkg_failed = untried; then
161b1297603Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
162b1297603Smrg[The pkg-config script could not be found or is too old.  Make sure it
163b1297603Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
164b1297603Smrgpath to pkg-config.
165b1297603Smrg
166b1297603Smrg_PKG_TEXT
167b1297603Smrg
1685b944e2aSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
169b1297603Smrg		[$4])
170b1297603Smrgelse
171b1297603Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
172b1297603Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
173b1297603Smrg        AC_MSG_RESULT([yes])
174b1297603Smrg	ifelse([$3], , :, [$3])
175b1297603Smrgfi[]dnl
176b1297603Smrg])# PKG_CHECK_MODULES
177b1297603Smrg
178d3263506Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
1795b944e2aSmrg#
1805b944e2aSmrg# This file is free software; the Free Software Foundation
1815b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
1825b944e2aSmrg# with or without modifications, as long as this notice is preserved.
183b1297603Smrg
1845b944e2aSmrg# AM_AUTOMAKE_VERSION(VERSION)
1855b944e2aSmrg# ----------------------------
1865b944e2aSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
1875b944e2aSmrg# generated from the m4 files accompanying Automake X.Y.
1885b944e2aSmrg# (This private macro should not be called outside this file.)
1895b944e2aSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
1905b944e2aSmrg[am__api_version='1.10'
1915b944e2aSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1925b944e2aSmrgdnl require some minimum version.  Point them to the right macro.
193d3263506Smrgm4_if([$1], [1.10.2], [],
1945b944e2aSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1955b944e2aSmrg])
1965b944e2aSmrg
1975b944e2aSmrg# _AM_AUTOCONF_VERSION(VERSION)
1985b944e2aSmrg# -----------------------------
1995b944e2aSmrg# aclocal traces this macro to find the Autoconf version.
2005b944e2aSmrg# This is a private macro too.  Using m4_define simplifies
2015b944e2aSmrg# the logic in aclocal, which can simply ignore this definition.
2025b944e2aSmrgm4_define([_AM_AUTOCONF_VERSION], [])
2035b944e2aSmrg
2045b944e2aSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
2055b944e2aSmrg# -------------------------------
2065b944e2aSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
207d3263506Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
2085b944e2aSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
209d3263506Smrg[AM_AUTOMAKE_VERSION([1.10.2])dnl
2105b944e2aSmrgm4_ifndef([AC_AUTOCONF_VERSION],
2115b944e2aSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
212d3263506Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
2135b944e2aSmrg
2145b944e2aSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
2155b944e2aSmrg
2165b944e2aSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
217b1297603Smrg#
2185b944e2aSmrg# This file is free software; the Free Software Foundation
2195b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
2205b944e2aSmrg# with or without modifications, as long as this notice is preserved.
2215b944e2aSmrg
2225b944e2aSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
2235b944e2aSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
2245b944e2aSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
225b1297603Smrg#
2265b944e2aSmrg# Of course, Automake must honor this variable whenever it calls a
2275b944e2aSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
2285b944e2aSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
2295b944e2aSmrg# depending on how configure is run.  This is pretty annoying, since
2305b944e2aSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
2315b944e2aSmrg# source directory, any form will work fine, but in subdirectories a
2325b944e2aSmrg# relative path needs to be adjusted first.
233b1297603Smrg#
2345b944e2aSmrg# $ac_aux_dir/missing
2355b944e2aSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
2365b944e2aSmrg# $top_srcdir/$ac_aux_dir/missing
2375b944e2aSmrg#    fails if $ac_aux_dir is absolute,
2385b944e2aSmrg#    fails when called from a subdirectory in a VPATH build with
2395b944e2aSmrg#          a relative $ac_aux_dir
240b1297603Smrg#
2415b944e2aSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
2425b944e2aSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
2435b944e2aSmrg# harmless because $srcdir is `.', but things will broke when you
2445b944e2aSmrg# start a VPATH build or use an absolute $srcdir.
2455b944e2aSmrg#
2465b944e2aSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
2475b944e2aSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
2485b944e2aSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
2495b944e2aSmrg# and then we would define $MISSING as
2505b944e2aSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
2515b944e2aSmrg# This will work as long as MISSING is not called from configure, because
2525b944e2aSmrg# unfortunately $(top_srcdir) has no meaning in configure.
2535b944e2aSmrg# However there are other variables, like CC, which are often used in
2545b944e2aSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
2555b944e2aSmrg#
2565b944e2aSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
2575b944e2aSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
2585b944e2aSmrg# configured tree to be moved without reconfiguration.
259b1297603Smrg
2605b944e2aSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
2615b944e2aSmrg[dnl Rely on autoconf to set up CDPATH properly.
2625b944e2aSmrgAC_PREREQ([2.50])dnl
2635b944e2aSmrg# expand $ac_aux_dir to an absolute path
2645b944e2aSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
2655b944e2aSmrg])
2665b944e2aSmrg
2675b944e2aSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
2685b944e2aSmrg
2695b944e2aSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
2705b944e2aSmrg# Free Software Foundation, Inc.
271b1297603Smrg#
2725b944e2aSmrg# This file is free software; the Free Software Foundation
2735b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
2745b944e2aSmrg# with or without modifications, as long as this notice is preserved.
275b1297603Smrg
2765b944e2aSmrg# serial 8
277b1297603Smrg
2785b944e2aSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
2795b944e2aSmrg# -------------------------------------
2805b944e2aSmrg# Define a conditional.
2815b944e2aSmrgAC_DEFUN([AM_CONDITIONAL],
2825b944e2aSmrg[AC_PREREQ(2.52)dnl
2835b944e2aSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
2845b944e2aSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
2855b944e2aSmrgAC_SUBST([$1_TRUE])dnl
2865b944e2aSmrgAC_SUBST([$1_FALSE])dnl
2875b944e2aSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
2885b944e2aSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
2895b944e2aSmrgif $2; then
2905b944e2aSmrg  $1_TRUE=
2915b944e2aSmrg  $1_FALSE='#'
292b1297603Smrgelse
2935b944e2aSmrg  $1_TRUE='#'
2945b944e2aSmrg  $1_FALSE=
295b1297603Smrgfi
2965b944e2aSmrgAC_CONFIG_COMMANDS_PRE(
2975b944e2aSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
2985b944e2aSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
2995b944e2aSmrgUsually this means the macro was only invoked conditionally.]])
3005b944e2aSmrgfi])])
301b1297603Smrg
3025b944e2aSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
3035b944e2aSmrg# Free Software Foundation, Inc.
304b1297603Smrg#
3055b944e2aSmrg# This file is free software; the Free Software Foundation
3065b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
3075b944e2aSmrg# with or without modifications, as long as this notice is preserved.
308b1297603Smrg
3095b944e2aSmrg# serial 9
310b1297603Smrg
3115b944e2aSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
3125b944e2aSmrg# written in clear, in which case automake, when reading aclocal.m4,
3135b944e2aSmrg# will think it sees a *use*, and therefore will trigger all it's
3145b944e2aSmrg# C support machinery.  Also note that it means that autoscan, seeing
3155b944e2aSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
316b1297603Smrg
317b1297603Smrg
3185b944e2aSmrg# _AM_DEPENDENCIES(NAME)
3195b944e2aSmrg# ----------------------
3205b944e2aSmrg# See how the compiler implements dependency checking.
3215b944e2aSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
3225b944e2aSmrg# We try a few techniques and use that to set a single cache variable.
3235b944e2aSmrg#
3245b944e2aSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
3255b944e2aSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
3265b944e2aSmrg# dependency, and given that the user is not expected to run this macro,
3275b944e2aSmrg# just rely on AC_PROG_CC.
3285b944e2aSmrgAC_DEFUN([_AM_DEPENDENCIES],
3295b944e2aSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
3305b944e2aSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
3315b944e2aSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
3325b944e2aSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
333b1297603Smrg
3345b944e2aSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
3355b944e2aSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
3365b944e2aSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
3375b944e2aSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
3385b944e2aSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
3395b944e2aSmrg                   [depcc="$$1"   am_compiler_list=])
340b1297603Smrg
3415b944e2aSmrgAC_CACHE_CHECK([dependency style of $depcc],
3425b944e2aSmrg               [am_cv_$1_dependencies_compiler_type],
3435b944e2aSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
3445b944e2aSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
3455b944e2aSmrg  # making bogus files that we don't know about and never remove.  For
3465b944e2aSmrg  # instance it was reported that on HP-UX the gcc test will end up
3475b944e2aSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
3485b944e2aSmrg  # in D'.
3495b944e2aSmrg  mkdir conftest.dir
3505b944e2aSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
3515b944e2aSmrg  # using a relative directory.
3525b944e2aSmrg  cp "$am_depcomp" conftest.dir
3535b944e2aSmrg  cd conftest.dir
3545b944e2aSmrg  # We will build objects and dependencies in a subdirectory because
3555b944e2aSmrg  # it helps to detect inapplicable dependency modes.  For instance
3565b944e2aSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
3575b944e2aSmrg  # side effect of compilation, but ICC will put the dependencies in
3585b944e2aSmrg  # the current directory while Tru64 will put them in the object
3595b944e2aSmrg  # directory.
3605b944e2aSmrg  mkdir sub
361b1297603Smrg
3625b944e2aSmrg  am_cv_$1_dependencies_compiler_type=none
3635b944e2aSmrg  if test "$am_compiler_list" = ""; then
3645b944e2aSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
3655b944e2aSmrg  fi
3665b944e2aSmrg  for depmode in $am_compiler_list; do
3675b944e2aSmrg    # Setup a source with many dependencies, because some compilers
3685b944e2aSmrg    # like to wrap large dependency lists on column 80 (with \), and
3695b944e2aSmrg    # we should not choose a depcomp mode which is confused by this.
3705b944e2aSmrg    #
3715b944e2aSmrg    # We need to recreate these files for each test, as the compiler may
3725b944e2aSmrg    # overwrite some of them when testing with obscure command lines.
3735b944e2aSmrg    # This happens at least with the AIX C compiler.
3745b944e2aSmrg    : > sub/conftest.c
3755b944e2aSmrg    for i in 1 2 3 4 5 6; do
3765b944e2aSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
3775b944e2aSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
3785b944e2aSmrg      # Solaris 8's {/usr,}/bin/sh.
3795b944e2aSmrg      touch sub/conftst$i.h
3805b944e2aSmrg    done
3815b944e2aSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
382b1297603Smrg
3835b944e2aSmrg    case $depmode in
3845b944e2aSmrg    nosideeffect)
3855b944e2aSmrg      # after this tag, mechanisms are not by side-effect, so they'll
3865b944e2aSmrg      # only be used when explicitly requested
3875b944e2aSmrg      if test "x$enable_dependency_tracking" = xyes; then
3885b944e2aSmrg	continue
3895b944e2aSmrg      else
3905b944e2aSmrg	break
3915b944e2aSmrg      fi
3925b944e2aSmrg      ;;
3935b944e2aSmrg    none) break ;;
3945b944e2aSmrg    esac
3955b944e2aSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
3965b944e2aSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
3975b944e2aSmrg    # handle `-M -o', and we need to detect this.
3985b944e2aSmrg    if depmode=$depmode \
3995b944e2aSmrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
4005b944e2aSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
4015b944e2aSmrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
4025b944e2aSmrg         >/dev/null 2>conftest.err &&
4035b944e2aSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
4045b944e2aSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
4055b944e2aSmrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
4065b944e2aSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
4075b944e2aSmrg      # icc doesn't choke on unknown options, it will just issue warnings
4085b944e2aSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
4095b944e2aSmrg      # that says an option was ignored or not supported.
4105b944e2aSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
4115b944e2aSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
4125b944e2aSmrg      # The diagnosis changed in icc 8.0:
4135b944e2aSmrg      #   icc: Command line remark: option '-MP' not supported
4145b944e2aSmrg      if (grep 'ignoring option' conftest.err ||
4155b944e2aSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
4165b944e2aSmrg        am_cv_$1_dependencies_compiler_type=$depmode
4175b944e2aSmrg        break
4185b944e2aSmrg      fi
4195b944e2aSmrg    fi
4205b944e2aSmrg  done
421b1297603Smrg
4225b944e2aSmrg  cd ..
4235b944e2aSmrg  rm -rf conftest.dir
424b1297603Smrgelse
4255b944e2aSmrg  am_cv_$1_dependencies_compiler_type=none
426b1297603Smrgfi
4275b944e2aSmrg])
4285b944e2aSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
4295b944e2aSmrgAM_CONDITIONAL([am__fastdep$1], [
4305b944e2aSmrg  test "x$enable_dependency_tracking" != xno \
4315b944e2aSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
4325b944e2aSmrg])
433b1297603Smrg
434b1297603Smrg
4355b944e2aSmrg# AM_SET_DEPDIR
4365b944e2aSmrg# -------------
4375b944e2aSmrg# Choose a directory name for dependency files.
4385b944e2aSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
4395b944e2aSmrgAC_DEFUN([AM_SET_DEPDIR],
4405b944e2aSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
4415b944e2aSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
4425b944e2aSmrg])
443b1297603Smrg
444b1297603Smrg
4455b944e2aSmrg# AM_DEP_TRACK
4465b944e2aSmrg# ------------
4475b944e2aSmrgAC_DEFUN([AM_DEP_TRACK],
4485b944e2aSmrg[AC_ARG_ENABLE(dependency-tracking,
4495b944e2aSmrg[  --disable-dependency-tracking  speeds up one-time build
4505b944e2aSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
4515b944e2aSmrgif test "x$enable_dependency_tracking" != xno; then
4525b944e2aSmrg  am_depcomp="$ac_aux_dir/depcomp"
4535b944e2aSmrg  AMDEPBACKSLASH='\'
454b1297603Smrgfi
4555b944e2aSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
4565b944e2aSmrgAC_SUBST([AMDEPBACKSLASH])dnl
4575b944e2aSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
4585b944e2aSmrg])
459b1297603Smrg
4605b944e2aSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
461b1297603Smrg
462d3263506Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
4635b944e2aSmrg# Free Software Foundation, Inc.
4645b944e2aSmrg#
4655b944e2aSmrg# This file is free software; the Free Software Foundation
4665b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
4675b944e2aSmrg# with or without modifications, as long as this notice is preserved.
468b1297603Smrg
469d3263506Smrg#serial 4
470b1297603Smrg
4715b944e2aSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
4725b944e2aSmrg# ------------------------------
4735b944e2aSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
474d3263506Smrg[# Autoconf 2.62 quotes --file arguments for eval, but not when files
475d3263506Smrg# are listed without --file.  Let's play safe and only enable the eval
476d3263506Smrg# if we detect the quoting.
477d3263506Smrgcase $CONFIG_FILES in
478d3263506Smrg*\'*) eval set x "$CONFIG_FILES" ;;
479d3263506Smrg*)   set x $CONFIG_FILES ;;
480d3263506Smrgesac
481d3263506Smrgshift
482d3263506Smrgfor mf
483d3263506Smrgdo
4845b944e2aSmrg  # Strip MF so we end up with the name of the file.
4855b944e2aSmrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
4865b944e2aSmrg  # Check whether this is an Automake generated Makefile or not.
4875b944e2aSmrg  # We used to match only the files named `Makefile.in', but
4885b944e2aSmrg  # some people rename them; so instead we look at the file content.
4895b944e2aSmrg  # Grep'ing the first line is not enough: some people post-process
4905b944e2aSmrg  # each Makefile.in and add a new line on top of each file to say so.
4915b944e2aSmrg  # Grep'ing the whole file is not good either: AIX grep has a line
4925b944e2aSmrg  # limit of 2048, but all sed's we know have understand at least 4000.
4935b944e2aSmrg  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
4945b944e2aSmrg    dirpart=`AS_DIRNAME("$mf")`
4955b944e2aSmrg  else
4965b944e2aSmrg    continue
4975b944e2aSmrg  fi
4985b944e2aSmrg  # Extract the definition of DEPDIR, am__include, and am__quote
4995b944e2aSmrg  # from the Makefile without running `make'.
5005b944e2aSmrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
5015b944e2aSmrg  test -z "$DEPDIR" && continue
5025b944e2aSmrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
5035b944e2aSmrg  test -z "am__include" && continue
5045b944e2aSmrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
5055b944e2aSmrg  # When using ansi2knr, U may be empty or an underscore; expand it
5065b944e2aSmrg  U=`sed -n 's/^U = //p' < "$mf"`
5075b944e2aSmrg  # Find all dependency output files, they are included files with
5085b944e2aSmrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
5095b944e2aSmrg  # simplest approach to changing $(DEPDIR) to its actual value in the
5105b944e2aSmrg  # expansion.
5115b944e2aSmrg  for file in `sed -n "
5125b944e2aSmrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
5135b944e2aSmrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
5145b944e2aSmrg    # Make sure the directory exists.
5155b944e2aSmrg    test -f "$dirpart/$file" && continue
5165b944e2aSmrg    fdir=`AS_DIRNAME(["$file"])`
5175b944e2aSmrg    AS_MKDIR_P([$dirpart/$fdir])
5185b944e2aSmrg    # echo "creating $dirpart/$file"
5195b944e2aSmrg    echo '# dummy' > "$dirpart/$file"
5205b944e2aSmrg  done
5215b944e2aSmrgdone
5225b944e2aSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
523b1297603Smrg
5245b944e2aSmrg
5255b944e2aSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
5265b944e2aSmrg# -----------------------------
5275b944e2aSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
528b1297603Smrg#
5295b944e2aSmrg# This code is only required when automatic dependency tracking
5305b944e2aSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
5315b944e2aSmrg# need in order to bootstrap the dependency handling code.
5325b944e2aSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
5335b944e2aSmrg[AC_CONFIG_COMMANDS([depfiles],
5345b944e2aSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
5355b944e2aSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
5365b944e2aSmrg])
537b1297603Smrg
5385b944e2aSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
5395b944e2aSmrg# Free Software Foundation, Inc.
5405b944e2aSmrg#
5415b944e2aSmrg# This file is free software; the Free Software Foundation
5425b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
5435b944e2aSmrg# with or without modifications, as long as this notice is preserved.
544b1297603Smrg
5455b944e2aSmrg# serial 8
546b1297603Smrg
5475b944e2aSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
5485b944e2aSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
549b1297603Smrg
5505b944e2aSmrg# Do all the work for Automake.                             -*- Autoconf -*-
551b1297603Smrg
5525b944e2aSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5535b944e2aSmrg# 2005, 2006, 2008 Free Software Foundation, Inc.
5545b944e2aSmrg#
5555b944e2aSmrg# This file is free software; the Free Software Foundation
5565b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
5575b944e2aSmrg# with or without modifications, as long as this notice is preserved.
5585b944e2aSmrg
5595b944e2aSmrg# serial 13
5605b944e2aSmrg
5615b944e2aSmrg# This macro actually does too much.  Some checks are only needed if
5625b944e2aSmrg# your package does certain things.  But this isn't really a big deal.
5635b944e2aSmrg
5645b944e2aSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
5655b944e2aSmrg# AM_INIT_AUTOMAKE([OPTIONS])
5665b944e2aSmrg# -----------------------------------------------
5675b944e2aSmrg# The call with PACKAGE and VERSION arguments is the old style
5685b944e2aSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
5695b944e2aSmrg# and VERSION should now be passed to AC_INIT and removed from
5705b944e2aSmrg# the call to AM_INIT_AUTOMAKE.
5715b944e2aSmrg# We support both call styles for the transition.  After
5725b944e2aSmrg# the next Automake release, Autoconf can make the AC_INIT
5735b944e2aSmrg# arguments mandatory, and then we can depend on a new Autoconf
5745b944e2aSmrg# release and drop the old call support.
5755b944e2aSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
5765b944e2aSmrg[AC_PREREQ([2.60])dnl
5775b944e2aSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
5785b944e2aSmrgdnl the ones we care about.
5795b944e2aSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
5805b944e2aSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
5815b944e2aSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
5825b944e2aSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
5835b944e2aSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
5845b944e2aSmrg  # is not polluted with repeated "-I."
5855b944e2aSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
5865b944e2aSmrg  # test to see if srcdir already configured
5875b944e2aSmrg  if test -f $srcdir/config.status; then
5885b944e2aSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
5895b944e2aSmrg  fi
590b1297603Smrgfi
591b1297603Smrg
5925b944e2aSmrg# test whether we have cygpath
5935b944e2aSmrgif test -z "$CYGPATH_W"; then
5945b944e2aSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
5955b944e2aSmrg    CYGPATH_W='cygpath -w'
5965b944e2aSmrg  else
5975b944e2aSmrg    CYGPATH_W=echo
5985b944e2aSmrg  fi
599b1297603Smrgfi
6005b944e2aSmrgAC_SUBST([CYGPATH_W])
601b1297603Smrg
6025b944e2aSmrg# Define the identity of the package.
6035b944e2aSmrgdnl Distinguish between old-style and new-style calls.
6045b944e2aSmrgm4_ifval([$2],
6055b944e2aSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
6065b944e2aSmrg AC_SUBST([PACKAGE], [$1])dnl
6075b944e2aSmrg AC_SUBST([VERSION], [$2])],
6085b944e2aSmrg[_AM_SET_OPTIONS([$1])dnl
6095b944e2aSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
6105b944e2aSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
6115b944e2aSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
6125b944e2aSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
6135b944e2aSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
614b1297603Smrg
6155b944e2aSmrg_AM_IF_OPTION([no-define],,
6165b944e2aSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
6175b944e2aSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
618b1297603Smrg
6195b944e2aSmrg# Some tools Automake needs.
6205b944e2aSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
6215b944e2aSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
6225b944e2aSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
6235b944e2aSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
6245b944e2aSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
6255b944e2aSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
6265b944e2aSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
6275b944e2aSmrgAM_PROG_INSTALL_SH
6285b944e2aSmrgAM_PROG_INSTALL_STRIP
6295b944e2aSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
6305b944e2aSmrg# We need awk for the "check" target.  The system "awk" is bad on
6315b944e2aSmrg# some platforms.
6325b944e2aSmrgAC_REQUIRE([AC_PROG_AWK])dnl
6335b944e2aSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
6345b944e2aSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
6355b944e2aSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
6365b944e2aSmrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
6375b944e2aSmrg	      		     [_AM_PROG_TAR([v7])])])
6385b944e2aSmrg_AM_IF_OPTION([no-dependencies],,
6395b944e2aSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
6405b944e2aSmrg                  [_AM_DEPENDENCIES(CC)],
6415b944e2aSmrg                  [define([AC_PROG_CC],
6425b944e2aSmrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
6435b944e2aSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
6445b944e2aSmrg                  [_AM_DEPENDENCIES(CXX)],
6455b944e2aSmrg                  [define([AC_PROG_CXX],
6465b944e2aSmrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
6475b944e2aSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
6485b944e2aSmrg                  [_AM_DEPENDENCIES(OBJC)],
6495b944e2aSmrg                  [define([AC_PROG_OBJC],
6505b944e2aSmrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
6515b944e2aSmrg])
6525b944e2aSmrg])
653b1297603Smrg
654b1297603Smrg
6555b944e2aSmrg# When config.status generates a header, we must update the stamp-h file.
6565b944e2aSmrg# This file resides in the same directory as the config header
6575b944e2aSmrg# that is generated.  The stamp files are numbered to have different names.
658b1297603Smrg
6595b944e2aSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
6605b944e2aSmrg# loop where config.status creates the headers, so we can generate
6615b944e2aSmrg# our stamp files there.
6625b944e2aSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
6635b944e2aSmrg[# Compute $1's index in $config_headers.
6645b944e2aSmrg_am_arg=$1
6655b944e2aSmrg_am_stamp_count=1
6665b944e2aSmrgfor _am_header in $config_headers :; do
6675b944e2aSmrg  case $_am_header in
6685b944e2aSmrg    $_am_arg | $_am_arg:* )
6695b944e2aSmrg      break ;;
6705b944e2aSmrg    * )
6715b944e2aSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
6725b944e2aSmrg  esac
6735b944e2aSmrgdone
6745b944e2aSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
675b1297603Smrg
6765b944e2aSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
677b1297603Smrg#
6785b944e2aSmrg# This file is free software; the Free Software Foundation
6795b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
6805b944e2aSmrg# with or without modifications, as long as this notice is preserved.
6815b944e2aSmrg
6825b944e2aSmrg# AM_PROG_INSTALL_SH
6835b944e2aSmrg# ------------------
6845b944e2aSmrg# Define $install_sh.
6855b944e2aSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
6865b944e2aSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6875b944e2aSmrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
6885b944e2aSmrgAC_SUBST(install_sh)])
6895b944e2aSmrg
6905b944e2aSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
691b1297603Smrg#
6925b944e2aSmrg# This file is free software; the Free Software Foundation
6935b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
6945b944e2aSmrg# with or without modifications, as long as this notice is preserved.
695b1297603Smrg
6965b944e2aSmrg# serial 2
6975b944e2aSmrg
6985b944e2aSmrg# Check whether the underlying file-system supports filenames
6995b944e2aSmrg# with a leading dot.  For instance MS-DOS doesn't.
7005b944e2aSmrgAC_DEFUN([AM_SET_LEADING_DOT],
7015b944e2aSmrg[rm -rf .tst 2>/dev/null
7025b944e2aSmrgmkdir .tst 2>/dev/null
7035b944e2aSmrgif test -d .tst; then
7045b944e2aSmrg  am__leading_dot=.
705b1297603Smrgelse
7065b944e2aSmrg  am__leading_dot=_
707b1297603Smrgfi
7085b944e2aSmrgrmdir .tst 2>/dev/null
7095b944e2aSmrgAC_SUBST([am__leading_dot])])
710b1297603Smrg
7115b944e2aSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
7125b944e2aSmrg# From Jim Meyering
713b1297603Smrg
7145b944e2aSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
7155b944e2aSmrg# Free Software Foundation, Inc.
716b1297603Smrg#
7175b944e2aSmrg# This file is free software; the Free Software Foundation
7185b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
7195b944e2aSmrg# with or without modifications, as long as this notice is preserved.
720b1297603Smrg
7215b944e2aSmrg# serial 4
722b1297603Smrg
7235b944e2aSmrgAC_DEFUN([AM_MAINTAINER_MODE],
7245b944e2aSmrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
7255b944e2aSmrg  dnl maintainer-mode is disabled by default
7265b944e2aSmrg  AC_ARG_ENABLE(maintainer-mode,
7275b944e2aSmrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
7285b944e2aSmrg			  (and sometimes confusing) to the casual installer],
7295b944e2aSmrg      USE_MAINTAINER_MODE=$enableval,
7305b944e2aSmrg      USE_MAINTAINER_MODE=no)
7315b944e2aSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
7325b944e2aSmrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
7335b944e2aSmrg  MAINT=$MAINTAINER_MODE_TRUE
7345b944e2aSmrg  AC_SUBST(MAINT)dnl
7355b944e2aSmrg]
7365b944e2aSmrg)
737b1297603Smrg
7385b944e2aSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
739b1297603Smrg
7405b944e2aSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
741b1297603Smrg
7425b944e2aSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
743b1297603Smrg#
744b1297603Smrg# This file is free software; the Free Software Foundation
745b1297603Smrg# gives unlimited permission to copy and/or distribute it,
746b1297603Smrg# with or without modifications, as long as this notice is preserved.
747b1297603Smrg
7485b944e2aSmrg# serial 3
749b1297603Smrg
7505b944e2aSmrg# AM_MAKE_INCLUDE()
7515b944e2aSmrg# -----------------
7525b944e2aSmrg# Check to see how make treats includes.
7535b944e2aSmrgAC_DEFUN([AM_MAKE_INCLUDE],
7545b944e2aSmrg[am_make=${MAKE-make}
7555b944e2aSmrgcat > confinc << 'END'
7565b944e2aSmrgam__doit:
7575b944e2aSmrg	@echo done
7585b944e2aSmrg.PHONY: am__doit
7595b944e2aSmrgEND
7605b944e2aSmrg# If we don't find an include directive, just comment out the code.
7615b944e2aSmrgAC_MSG_CHECKING([for style of include used by $am_make])
7625b944e2aSmrgam__include="#"
7635b944e2aSmrgam__quote=
7645b944e2aSmrg_am_result=none
7655b944e2aSmrg# First try GNU make style include.
7665b944e2aSmrgecho "include confinc" > confmf
7675b944e2aSmrg# We grep out `Entering directory' and `Leaving directory'
7685b944e2aSmrg# messages which can occur if `w' ends up in MAKEFLAGS.
7695b944e2aSmrg# In particular we don't look at `^make:' because GNU make might
7705b944e2aSmrg# be invoked under some other name (usually "gmake"), in which
7715b944e2aSmrg# case it prints its new name instead of `make'.
7725b944e2aSmrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
7735b944e2aSmrg   am__include=include
7745b944e2aSmrg   am__quote=
7755b944e2aSmrg   _am_result=GNU
7765b944e2aSmrgfi
7775b944e2aSmrg# Now try BSD make style include.
7785b944e2aSmrgif test "$am__include" = "#"; then
7795b944e2aSmrg   echo '.include "confinc"' > confmf
7805b944e2aSmrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
7815b944e2aSmrg      am__include=.include
7825b944e2aSmrg      am__quote="\""
7835b944e2aSmrg      _am_result=BSD
7845b944e2aSmrg   fi
7855b944e2aSmrgfi
7865b944e2aSmrgAC_SUBST([am__include])
7875b944e2aSmrgAC_SUBST([am__quote])
7885b944e2aSmrgAC_MSG_RESULT([$_am_result])
7895b944e2aSmrgrm -f confinc confmf
7905b944e2aSmrg])
791b1297603Smrg
7925b944e2aSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
793b1297603Smrg
7945b944e2aSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
7955b944e2aSmrg# Free Software Foundation, Inc.
796b1297603Smrg#
797b1297603Smrg# This file is free software; the Free Software Foundation
798b1297603Smrg# gives unlimited permission to copy and/or distribute it,
799b1297603Smrg# with or without modifications, as long as this notice is preserved.
800b1297603Smrg
8015b944e2aSmrg# serial 5
802b1297603Smrg
8035b944e2aSmrg# AM_MISSING_PROG(NAME, PROGRAM)
8045b944e2aSmrg# ------------------------------
8055b944e2aSmrgAC_DEFUN([AM_MISSING_PROG],
8065b944e2aSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
8075b944e2aSmrg$1=${$1-"${am_missing_run}$2"}
8085b944e2aSmrgAC_SUBST($1)])
809b1297603Smrg
810b1297603Smrg
8115b944e2aSmrg# AM_MISSING_HAS_RUN
8125b944e2aSmrg# ------------------
8135b944e2aSmrg# Define MISSING if not defined so far and test if it supports --run.
8145b944e2aSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
8155b944e2aSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
8165b944e2aSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8175b944e2aSmrgAC_REQUIRE_AUX_FILE([missing])dnl
8185b944e2aSmrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
8195b944e2aSmrg# Use eval to expand $SHELL
8205b944e2aSmrgif eval "$MISSING --run true"; then
8215b944e2aSmrg  am_missing_run="$MISSING --run "
8225b944e2aSmrgelse
8235b944e2aSmrg  am_missing_run=
8245b944e2aSmrg  AC_MSG_WARN([`missing' script is too old or missing])
8255b944e2aSmrgfi
8265b944e2aSmrg])
8275b944e2aSmrg
8285b944e2aSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
829b1297603Smrg#
830b1297603Smrg# This file is free software; the Free Software Foundation
831b1297603Smrg# gives unlimited permission to copy and/or distribute it,
832b1297603Smrg# with or without modifications, as long as this notice is preserved.
833b1297603Smrg
8345b944e2aSmrg# AM_PROG_MKDIR_P
8355b944e2aSmrg# ---------------
8365b944e2aSmrg# Check for `mkdir -p'.
8375b944e2aSmrgAC_DEFUN([AM_PROG_MKDIR_P],
8385b944e2aSmrg[AC_PREREQ([2.60])dnl
8395b944e2aSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
8405b944e2aSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
8415b944e2aSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
8425b944e2aSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
8435b944e2aSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
8445b944e2aSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
8455b944e2aSmrgdnl adjustment using top_builddir (which is defined more often than
8465b944e2aSmrgdnl MKDIR_P).
8475b944e2aSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
8485b944e2aSmrgcase $mkdir_p in
8495b944e2aSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
8505b944e2aSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
8515b944e2aSmrgesac
8525b944e2aSmrg])
853b1297603Smrg
8545b944e2aSmrg# Helper functions for option handling.                     -*- Autoconf -*-
855b1297603Smrg
856d3263506Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
857b1297603Smrg#
858b1297603Smrg# This file is free software; the Free Software Foundation
859b1297603Smrg# gives unlimited permission to copy and/or distribute it,
860b1297603Smrg# with or without modifications, as long as this notice is preserved.
861b1297603Smrg
862d3263506Smrg# serial 4
863b1297603Smrg
8645b944e2aSmrg# _AM_MANGLE_OPTION(NAME)
8655b944e2aSmrg# -----------------------
8665b944e2aSmrgAC_DEFUN([_AM_MANGLE_OPTION],
8675b944e2aSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
868b1297603Smrg
8695b944e2aSmrg# _AM_SET_OPTION(NAME)
8705b944e2aSmrg# ------------------------------
8715b944e2aSmrg# Set option NAME.  Presently that only means defining a flag for this option.
8725b944e2aSmrgAC_DEFUN([_AM_SET_OPTION],
8735b944e2aSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
874b1297603Smrg
8755b944e2aSmrg# _AM_SET_OPTIONS(OPTIONS)
8765b944e2aSmrg# ----------------------------------
8775b944e2aSmrg# OPTIONS is a space-separated list of Automake options.
8785b944e2aSmrgAC_DEFUN([_AM_SET_OPTIONS],
879d3263506Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
880b1297603Smrg
8815b944e2aSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
8825b944e2aSmrg# -------------------------------------------
8835b944e2aSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8845b944e2aSmrgAC_DEFUN([_AM_IF_OPTION],
8855b944e2aSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
886b1297603Smrg
8875b944e2aSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
888b1297603Smrg
8895b944e2aSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
8905b944e2aSmrg# Free Software Foundation, Inc.
8915b944e2aSmrg#
8925b944e2aSmrg# This file is free software; the Free Software Foundation
8935b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
8945b944e2aSmrg# with or without modifications, as long as this notice is preserved.
895b1297603Smrg
8965b944e2aSmrg# serial 4
897b1297603Smrg
8985b944e2aSmrg# AM_SANITY_CHECK
8995b944e2aSmrg# ---------------
9005b944e2aSmrgAC_DEFUN([AM_SANITY_CHECK],
9015b944e2aSmrg[AC_MSG_CHECKING([whether build environment is sane])
9025b944e2aSmrg# Just in case
9035b944e2aSmrgsleep 1
9045b944e2aSmrgecho timestamp > conftest.file
9055b944e2aSmrg# Do `set' in a subshell so we don't clobber the current shell's
9065b944e2aSmrg# arguments.  Must try -L first in case configure is actually a
9075b944e2aSmrg# symlink; some systems play weird games with the mod time of symlinks
9085b944e2aSmrg# (eg FreeBSD returns the mod time of the symlink's containing
9095b944e2aSmrg# directory).
9105b944e2aSmrgif (
9115b944e2aSmrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
9125b944e2aSmrg   if test "$[*]" = "X"; then
9135b944e2aSmrg      # -L didn't work.
9145b944e2aSmrg      set X `ls -t $srcdir/configure conftest.file`
9155b944e2aSmrg   fi
9165b944e2aSmrg   rm -f conftest.file
9175b944e2aSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
9185b944e2aSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
9195b944e2aSmrg
9205b944e2aSmrg      # If neither matched, then we have a broken ls.  This can happen
9215b944e2aSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
9225b944e2aSmrg      # broken ls alias from the environment.  This has actually
9235b944e2aSmrg      # happened.  Such a system could not be considered "sane".
9245b944e2aSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
9255b944e2aSmrgalias in your environment])
9265b944e2aSmrg   fi
9275b944e2aSmrg
9285b944e2aSmrg   test "$[2]" = conftest.file
9295b944e2aSmrg   )
9305b944e2aSmrgthen
9315b944e2aSmrg   # Ok.
9325b944e2aSmrg   :
933b1297603Smrgelse
9345b944e2aSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
9355b944e2aSmrgCheck your system clock])
936b1297603Smrgfi
9375b944e2aSmrgAC_MSG_RESULT(yes)])
938b1297603Smrg
9395b944e2aSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
9405b944e2aSmrg#
9415b944e2aSmrg# This file is free software; the Free Software Foundation
9425b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
9435b944e2aSmrg# with or without modifications, as long as this notice is preserved.
944b1297603Smrg
9455b944e2aSmrg# AM_PROG_INSTALL_STRIP
9465b944e2aSmrg# ---------------------
9475b944e2aSmrg# One issue with vendor `install' (even GNU) is that you can't
9485b944e2aSmrg# specify the program used to strip binaries.  This is especially
9495b944e2aSmrg# annoying in cross-compiling environments, where the build's strip
9505b944e2aSmrg# is unlikely to handle the host's binaries.
9515b944e2aSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9525b944e2aSmrg# always use install-sh in `make install-strip', and initialize
9535b944e2aSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
9545b944e2aSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
9555b944e2aSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9565b944e2aSmrg# Installed binaries are usually stripped using `strip' when the user
9575b944e2aSmrg# run `make install-strip'.  However `strip' might not be the right
9585b944e2aSmrg# tool to use in cross-compilation environments, therefore Automake
9595b944e2aSmrg# will honor the `STRIP' environment variable to overrule this program.
9605b944e2aSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
9615b944e2aSmrgif test "$cross_compiling" != no; then
9625b944e2aSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
9635b944e2aSmrgfi
9645b944e2aSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9655b944e2aSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
966b1297603Smrg
9675b944e2aSmrg# Copyright (C) 2006  Free Software Foundation, Inc.
9685b944e2aSmrg#
9695b944e2aSmrg# This file is free software; the Free Software Foundation
9705b944e2aSmrg# gives unlimited permission to copy and/or distribute it,
9715b944e2aSmrg# with or without modifications, as long as this notice is preserved.
972b1297603Smrg
9735b944e2aSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
9745b944e2aSmrg# ---------------------------
9755b944e2aSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9765b944e2aSmrg# This macro is traced by Automake.
9775b944e2aSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
978b1297603Smrg
9795b944e2aSmrg# Check how to create a tarball.                            -*- Autoconf -*-
980b1297603Smrg
9815b944e2aSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
982b1297603Smrg#
983b1297603Smrg# This file is free software; the Free Software Foundation
984b1297603Smrg# gives unlimited permission to copy and/or distribute it,
985b1297603Smrg# with or without modifications, as long as this notice is preserved.
986b1297603Smrg
9875b944e2aSmrg# serial 2
988b1297603Smrg
9895b944e2aSmrg# _AM_PROG_TAR(FORMAT)
9905b944e2aSmrg# --------------------
9915b944e2aSmrg# Check how to create a tarball in format FORMAT.
9925b944e2aSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
9935b944e2aSmrg#
9945b944e2aSmrg# Substitute a variable $(am__tar) that is a command
9955b944e2aSmrg# writing to stdout a FORMAT-tarball containing the directory
9965b944e2aSmrg# $tardir.
9975b944e2aSmrg#     tardir=directory && $(am__tar) > result.tar
9985b944e2aSmrg#
9995b944e2aSmrg# Substitute a variable $(am__untar) that extract such
10005b944e2aSmrg# a tarball read from stdin.
10015b944e2aSmrg#     $(am__untar) < result.tar
10025b944e2aSmrgAC_DEFUN([_AM_PROG_TAR],
10035b944e2aSmrg[# Always define AMTAR for backward compatibility.
10045b944e2aSmrgAM_MISSING_PROG([AMTAR], [tar])
10055b944e2aSmrgm4_if([$1], [v7],
10065b944e2aSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
10075b944e2aSmrg     [m4_case([$1], [ustar],, [pax],,
10085b944e2aSmrg              [m4_fatal([Unknown tar format])])
10095b944e2aSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
10105b944e2aSmrg# Loop over all known methods to create a tar archive until one works.
10115b944e2aSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
10125b944e2aSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
10135b944e2aSmrg# Do not fold the above two line into one, because Tru64 sh and
10145b944e2aSmrg# Solaris sh will not grok spaces in the rhs of `-'.
10155b944e2aSmrgfor _am_tool in $_am_tools
10165b944e2aSmrgdo
10175b944e2aSmrg  case $_am_tool in
10185b944e2aSmrg  gnutar)
10195b944e2aSmrg    for _am_tar in tar gnutar gtar;
10205b944e2aSmrg    do
10215b944e2aSmrg      AM_RUN_LOG([$_am_tar --version]) && break
10225b944e2aSmrg    done
10235b944e2aSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
10245b944e2aSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
10255b944e2aSmrg    am__untar="$_am_tar -xf -"
10265b944e2aSmrg    ;;
10275b944e2aSmrg  plaintar)
10285b944e2aSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
10295b944e2aSmrg    # ustar tarball either.
10305b944e2aSmrg    (tar --version) >/dev/null 2>&1 && continue
10315b944e2aSmrg    am__tar='tar chf - "$$tardir"'
10325b944e2aSmrg    am__tar_='tar chf - "$tardir"'
10335b944e2aSmrg    am__untar='tar xf -'
10345b944e2aSmrg    ;;
10355b944e2aSmrg  pax)
10365b944e2aSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
10375b944e2aSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
10385b944e2aSmrg    am__untar='pax -r'
10395b944e2aSmrg    ;;
10405b944e2aSmrg  cpio)
10415b944e2aSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
10425b944e2aSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
10435b944e2aSmrg    am__untar='cpio -i -H $1 -d'
10445b944e2aSmrg    ;;
10455b944e2aSmrg  none)
10465b944e2aSmrg    am__tar=false
10475b944e2aSmrg    am__tar_=false
10485b944e2aSmrg    am__untar=false
10495b944e2aSmrg    ;;
10505b944e2aSmrg  esac
10515b944e2aSmrg
10525b944e2aSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
10535b944e2aSmrg  # and am__untar set.
10545b944e2aSmrg  test -n "${am_cv_prog_tar_$1}" && break
10555b944e2aSmrg
10565b944e2aSmrg  # tar/untar a dummy directory, and stop if the command works
10575b944e2aSmrg  rm -rf conftest.dir
10585b944e2aSmrg  mkdir conftest.dir
10595b944e2aSmrg  echo GrepMe > conftest.dir/file
10605b944e2aSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10615b944e2aSmrg  rm -rf conftest.dir
10625b944e2aSmrg  if test -s conftest.tar; then
10635b944e2aSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
10645b944e2aSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
10655b944e2aSmrg  fi
1066b1297603Smrgdone
10675b944e2aSmrgrm -rf conftest.dir
1068b1297603Smrg
10695b944e2aSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10705b944e2aSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
10715b944e2aSmrgAC_SUBST([am__tar])
10725b944e2aSmrgAC_SUBST([am__untar])
10735b944e2aSmrg]) # _AM_PROG_TAR
1074b1297603Smrg
10755b944e2aSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10765b944e2aSmrgdnl
10775b944e2aSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
10785b944e2aSmrgdnl 
10795b944e2aSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10805b944e2aSmrgdnl copy of this software and associated documentation files (the
10815b944e2aSmrgdnl "Software"), to deal in the Software without restriction, including
10825b944e2aSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
10835b944e2aSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
10845b944e2aSmrgdnl to whom the Software is furnished to do so, provided that the above
10855b944e2aSmrgdnl copyright notice(s) and this permission notice appear in all copies of
10865b944e2aSmrgdnl the Software and that both the above copyright notice(s) and this
10875b944e2aSmrgdnl permission notice appear in supporting documentation.
10885b944e2aSmrgdnl
10895b944e2aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10905b944e2aSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10915b944e2aSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
10925b944e2aSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
10935b944e2aSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
10945b944e2aSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
10955b944e2aSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
10965b944e2aSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
10975b944e2aSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
10985b944e2aSmrgdnl
10995b944e2aSmrgdnl Except as contained in this notice, the name of a copyright holder
11005b944e2aSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
11015b944e2aSmrgdnl or other dealings in this Software without prior written authorization
11025b944e2aSmrgdnl of the copyright holder.
1103b1297603Smrg
11045b944e2aSmrg# XORG_MACROS_VERSION(required-version)
11055b944e2aSmrg# -------------------------------------
11065b944e2aSmrg# Minimum version: 1.1.0
1107b1297603Smrg#
11085b944e2aSmrg# If you're using a macro added in Version 1.1 or newer, include this in
11095b944e2aSmrg# your configure.ac with the minimum required version, such as:
11105b944e2aSmrg# XORG_MACROS_VERSION(1.1)
11115b944e2aSmrg#
1112d3263506Smrg# To ensure that this macro is defined, also add:
1113d3263506Smrg# m4_ifndef([XORG_MACROS_VERSION],
1114d3263506Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
11155b944e2aSmrg#
11165b944e2aSmrg#
11175b944e2aSmrg# See the "minimum version" comment for each macro you use to see what 
11185b944e2aSmrg# version you require.
11195b944e2aSmrgAC_DEFUN([XORG_MACROS_VERSION],[
11205b944e2aSmrg	[XORG_MACROS_needed_version=$1
11215b944e2aSmrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
11225b944e2aSmrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
11235b944e2aSmrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
1124d3263506Smrg	[XORG_MACROS_version=1.2.1
11255b944e2aSmrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
11265b944e2aSmrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
11275b944e2aSmrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
1128d3263506Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_needed_major}.x])
11295b944e2aSmrg	fi
11305b944e2aSmrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
1131d3263506Smrg		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}.0 or newer])
11325b944e2aSmrg	fi
11335b944e2aSmrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
11345b944e2aSmrg]) # XORG_MACROS_VERSION
1135b1297603Smrg
11365b944e2aSmrg# XORG_PROG_RAWCPP()
11375b944e2aSmrg# ------------------
11385b944e2aSmrg# Minimum version: 1.0.0
11395b944e2aSmrg#
11405b944e2aSmrg# Find cpp program and necessary flags for use in pre-processing text files
11415b944e2aSmrg# such as man pages and config files
11425b944e2aSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
11435b944e2aSmrgAC_REQUIRE([AC_PROG_CPP])
11445b944e2aSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
11455b944e2aSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1146b1297603Smrg
11475b944e2aSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
11485b944e2aSmrg# which is not the best choice for supporting other OS'es, but covers most
11495b944e2aSmrg# of the ones we need for now.
11505b944e2aSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
11515b944e2aSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
11525b944e2aSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11535b944e2aSmrg	AC_MSG_RESULT([no])
11545b944e2aSmrgelse
11555b944e2aSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11565b944e2aSmrg		RAWCPPFLAGS=-undef
11575b944e2aSmrg		AC_MSG_RESULT([yes])
11585b944e2aSmrg	# under Cygwin unix is still defined even with -undef
11595b944e2aSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11605b944e2aSmrg		RAWCPPFLAGS="-undef -ansi"
11615b944e2aSmrg		AC_MSG_RESULT([yes, with -ansi])
11625b944e2aSmrg	else
11635b944e2aSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
11645b944e2aSmrg	fi
11655b944e2aSmrgfi
11665b944e2aSmrgrm -f conftest.$ac_ext
1167b1297603Smrg
11685b944e2aSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
11695b944e2aSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
11705b944e2aSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11715b944e2aSmrg	AC_MSG_RESULT([no])
11725b944e2aSmrgelse
11735b944e2aSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11745b944e2aSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
11755b944e2aSmrg		AC_MSG_RESULT([yes])
11765b944e2aSmrg	else
11775b944e2aSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
11785b944e2aSmrg	fi
11795b944e2aSmrgfi
11805b944e2aSmrgrm -f conftest.$ac_ext
11815b944e2aSmrgAC_SUBST(RAWCPPFLAGS)
11825b944e2aSmrg]) # XORG_PROG_RAWCPP
1183b1297603Smrg
11845b944e2aSmrg# XORG_MANPAGE_SECTIONS()
11855b944e2aSmrg# -----------------------
11865b944e2aSmrg# Minimum version: 1.0.0
1187b1297603Smrg#
11885b944e2aSmrg# Determine which sections man pages go in for the different man page types
11895b944e2aSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
11905b944e2aSmrg# Not sure if there's any better way than just hardcoding by OS name.
11915b944e2aSmrg# Override default settings by setting environment variables
1192b1297603Smrg
11935b944e2aSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
11945b944e2aSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1195b1297603Smrg
11965b944e2aSmrgif test x$APP_MAN_SUFFIX = x    ; then
11975b944e2aSmrg    APP_MAN_SUFFIX=1
11985b944e2aSmrgfi
11995b944e2aSmrgif test x$APP_MAN_DIR = x    ; then
12005b944e2aSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1201b1297603Smrgfi
1202b1297603Smrg
12035b944e2aSmrgif test x$LIB_MAN_SUFFIX = x    ; then
12045b944e2aSmrg    LIB_MAN_SUFFIX=3
12055b944e2aSmrgfi
12065b944e2aSmrgif test x$LIB_MAN_DIR = x    ; then
12075b944e2aSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1208b1297603Smrgfi
1209b1297603Smrg
12105b944e2aSmrgif test x$FILE_MAN_SUFFIX = x    ; then
12115b944e2aSmrg    case $host_os in
12125b944e2aSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
12135b944e2aSmrg	*)		FILE_MAN_SUFFIX=5  ;;
12145b944e2aSmrg    esac
12155b944e2aSmrgfi
12165b944e2aSmrgif test x$FILE_MAN_DIR = x    ; then
12175b944e2aSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
12185b944e2aSmrgfi
1219b1297603Smrg
12205b944e2aSmrgif test x$MISC_MAN_SUFFIX = x    ; then
12215b944e2aSmrg    case $host_os in
12225b944e2aSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
12235b944e2aSmrg	*)		MISC_MAN_SUFFIX=7  ;;
12245b944e2aSmrg    esac
12255b944e2aSmrgfi
12265b944e2aSmrgif test x$MISC_MAN_DIR = x    ; then
12275b944e2aSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
12285b944e2aSmrgfi
1229b1297603Smrg
12305b944e2aSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
12315b944e2aSmrg    case $host_os in
12325b944e2aSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
12335b944e2aSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
12345b944e2aSmrg    esac
12355b944e2aSmrgfi
12365b944e2aSmrgif test x$DRIVER_MAN_DIR = x    ; then
12375b944e2aSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
12385b944e2aSmrgfi
1239b1297603Smrg
12405b944e2aSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
12415b944e2aSmrg    case $host_os in
12425b944e2aSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
12435b944e2aSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
12445b944e2aSmrg    esac
12455b944e2aSmrgfi
12465b944e2aSmrgif test x$ADMIN_MAN_DIR = x    ; then
12475b944e2aSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
12485b944e2aSmrgfi
1249b1297603Smrg
1250b1297603Smrg
12515b944e2aSmrgAC_SUBST([APP_MAN_SUFFIX])
12525b944e2aSmrgAC_SUBST([LIB_MAN_SUFFIX])
12535b944e2aSmrgAC_SUBST([FILE_MAN_SUFFIX])
12545b944e2aSmrgAC_SUBST([MISC_MAN_SUFFIX])
12555b944e2aSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
12565b944e2aSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
12575b944e2aSmrgAC_SUBST([APP_MAN_DIR])
12585b944e2aSmrgAC_SUBST([LIB_MAN_DIR])
12595b944e2aSmrgAC_SUBST([FILE_MAN_DIR])
12605b944e2aSmrgAC_SUBST([MISC_MAN_DIR])
12615b944e2aSmrgAC_SUBST([DRIVER_MAN_DIR])
12625b944e2aSmrgAC_SUBST([ADMIN_MAN_DIR])
12635b944e2aSmrg]) # XORG_MANPAGE_SECTIONS
1264b1297603Smrg
12655b944e2aSmrg# XORG_CHECK_LINUXDOC
12665b944e2aSmrg# -------------------
12675b944e2aSmrg# Minimum version: 1.0.0
1268b1297603Smrg#
12695b944e2aSmrg# Defines the variable MAKE_TEXT if the necessary tools and
12705b944e2aSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
12715b944e2aSmrg# Whether or not the necessary tools and files are found can be checked
12725b944e2aSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
12735b944e2aSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12745b944e2aSmrgif test x$XORG_SGML_PATH = x ; then
12755b944e2aSmrg    XORG_SGML_PATH=$prefix/share/sgml
12765b944e2aSmrgfi
12775b944e2aSmrgHAVE_DEFS_ENT=
1278b1297603Smrg
12795b944e2aSmrgif test x"$cross_compiling" = x"yes" ; then
12805b944e2aSmrg  HAVE_DEFS_ENT=no
12815b944e2aSmrgelse
12825b944e2aSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
12835b944e2aSmrgfi
1284b1297603Smrg
12855b944e2aSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
12865b944e2aSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1287b1297603Smrg
12885b944e2aSmrgAC_MSG_CHECKING([Whether to build documentation])
1289b1297603Smrg
12905b944e2aSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
12915b944e2aSmrg   BUILDDOC=yes
1292b1297603Smrgelse
12935b944e2aSmrg   BUILDDOC=no
1294b1297603Smrgfi
1295b1297603Smrg
12965b944e2aSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1297b1297603Smrg
12985b944e2aSmrgAC_MSG_RESULT([$BUILDDOC])
1299b1297603Smrg
13005b944e2aSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1301b1297603Smrg
13025b944e2aSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
13035b944e2aSmrg   BUILDPDFDOC=yes
13045b944e2aSmrgelse
13055b944e2aSmrg   BUILDPDFDOC=no
13065b944e2aSmrgfi
1307b1297603Smrg
13085b944e2aSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1309b1297603Smrg
13105b944e2aSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1311b1297603Smrg
13125b944e2aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
13135b944e2aSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
13145b944e2aSmrgMAKE_PDF="$PS2PDF"
13155b944e2aSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1316b1297603Smrg
13175b944e2aSmrgAC_SUBST(MAKE_TEXT)
13185b944e2aSmrgAC_SUBST(MAKE_PS)
13195b944e2aSmrgAC_SUBST(MAKE_PDF)
13205b944e2aSmrgAC_SUBST(MAKE_HTML)
13215b944e2aSmrg]) # XORG_CHECK_LINUXDOC
1322b1297603Smrg
13235b944e2aSmrg# XORG_CHECK_DOCBOOK
13245b944e2aSmrg# -------------------
13255b944e2aSmrg# Minimum version: 1.0.0
13265b944e2aSmrg#
13275b944e2aSmrg# Checks for the ability to build output formats from SGML DocBook source.
13285b944e2aSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
13295b944e2aSmrg# indicates whether the necessary tools and files are found and, if set,
13305b944e2aSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
13315b944e2aSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
13325b944e2aSmrgif test x$XORG_SGML_PATH = x ; then
13335b944e2aSmrg    XORG_SGML_PATH=$prefix/share/sgml
1334b1297603Smrgfi
13355b944e2aSmrgHAVE_DEFS_ENT=
13365b944e2aSmrgBUILDTXTDOC=no
13375b944e2aSmrgBUILDPDFDOC=no
13385b944e2aSmrgBUILDPSDOC=no
13395b944e2aSmrgBUILDHTMLDOC=no
1340b1297603Smrg
13415b944e2aSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1342b1297603Smrg
13435b944e2aSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
13445b944e2aSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
13455b944e2aSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
13465b944e2aSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1347b1297603Smrg
13485b944e2aSmrgAC_MSG_CHECKING([Whether to build text documentation])
13495b944e2aSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
13505b944e2aSmrg   test x$BUILD_TXTDOC != xno; then
13515b944e2aSmrg	BUILDTXTDOC=yes
1352b1297603Smrgfi
13535b944e2aSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
13545b944e2aSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1355b1297603Smrg
13565b944e2aSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
13575b944e2aSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
13585b944e2aSmrg   test x$BUILD_PDFDOC != xno; then
13595b944e2aSmrg	BUILDPDFDOC=yes
1360b1297603Smrgfi
13615b944e2aSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13625b944e2aSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1363b1297603Smrg
13645b944e2aSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
13655b944e2aSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
13665b944e2aSmrg   test x$BUILD_PSDOC != xno; then
13675b944e2aSmrg	BUILDPSDOC=yes
13685b944e2aSmrgfi
13695b944e2aSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
13705b944e2aSmrgAC_MSG_RESULT([$BUILDPSDOC])
1371b1297603Smrg
13725b944e2aSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
13735b944e2aSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
13745b944e2aSmrg   test x$BUILD_HTMLDOC != xno; then
13755b944e2aSmrg	BUILDHTMLDOC=yes
13765b944e2aSmrgfi
13775b944e2aSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
13785b944e2aSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1379b1297603Smrg
13805b944e2aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
13815b944e2aSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
13825b944e2aSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
13835b944e2aSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1384b1297603Smrg
13855b944e2aSmrgAC_SUBST(MAKE_TEXT)
13865b944e2aSmrgAC_SUBST(MAKE_PS)
13875b944e2aSmrgAC_SUBST(MAKE_PDF)
13885b944e2aSmrgAC_SUBST(MAKE_HTML)
13895b944e2aSmrg]) # XORG_CHECK_DOCBOOK
1390b1297603Smrg
13915b944e2aSmrg# XORG_CHECK_MALLOC_ZERO
13925b944e2aSmrg# ----------------------
13935b944e2aSmrg# Minimum version: 1.0.0
13945b944e2aSmrg#
13955b944e2aSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
13965b944e2aSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
13975b944e2aSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
13985b944e2aSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
13995b944e2aSmrgAC_ARG_ENABLE(malloc0returnsnull,
14005b944e2aSmrg	AC_HELP_STRING([--enable-malloc0returnsnull],
14015b944e2aSmrg		       [malloc(0) returns NULL (default: auto)]),
14025b944e2aSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
14035b944e2aSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1404b1297603Smrg
14055b944e2aSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
14065b944e2aSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
14075b944e2aSmrg	AC_RUN_IFELSE([
14085b944e2aSmrgchar *malloc();
14095b944e2aSmrgchar *realloc();
14105b944e2aSmrgchar *calloc();
14115b944e2aSmrgmain() {
14125b944e2aSmrg    char *m0, *r0, *c0, *p;
14135b944e2aSmrg    m0 = malloc(0);
14145b944e2aSmrg    p = malloc(10);
14155b944e2aSmrg    r0 = realloc(p,0);
14165b944e2aSmrg    c0 = calloc(0);
14175b944e2aSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
14185b944e2aSmrg}],
14195b944e2aSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
14205b944e2aSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
14215b944e2aSmrgfi
14225b944e2aSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1423b1297603Smrg
14245b944e2aSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
14255b944e2aSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
14265b944e2aSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
14275b944e2aSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
14285b944e2aSmrgelse
14295b944e2aSmrg	MALLOC_ZERO_CFLAGS=""
14305b944e2aSmrg	XMALLOC_ZERO_CFLAGS=""
14315b944e2aSmrg	XTMALLOC_ZERO_CFLAGS=""
14325b944e2aSmrgfi
1433b1297603Smrg
14345b944e2aSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
14355b944e2aSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
14365b944e2aSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
14375b944e2aSmrg]) # XORG_CHECK_MALLOC_ZERO
1438b1297603Smrg
14395b944e2aSmrg# XORG_WITH_LINT()
14405b944e2aSmrg# ----------------
14415b944e2aSmrg# Minimum version: 1.1.0
1442b1297603Smrg#
14435b944e2aSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
14445b944e2aSmrg# is specified.   (Use --with-lint=sparse for sparse.)
14455b944e2aSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
14465b944e2aSmrg# Sets $LINT_FLAGS to flags to pass to source checker
14475b944e2aSmrg# Sets LINT automake conditional if enabled (default: disabled)
14485b944e2aSmrg#
14495b944e2aSmrgAC_DEFUN([XORG_WITH_LINT],[
1450b1297603Smrg
14515b944e2aSmrg# Allow checking code with lint, sparse, etc.
14525b944e2aSmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
14535b944e2aSmrg		[Use a lint-style source code checker (default: disabled)])],
14545b944e2aSmrg		[use_lint=$withval], [use_lint=no])
14555b944e2aSmrgif test "x$use_lint" = "xyes" ; then
14565b944e2aSmrg	LINT="lint"
1457b1297603Smrgelse
14585b944e2aSmrg	LINT="$use_lint"
14595b944e2aSmrgfi
14605b944e2aSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
14615b944e2aSmrg    case $LINT in
14625b944e2aSmrg	lint|*/lint)
14635b944e2aSmrg	    case $host_os in
14645b944e2aSmrg		solaris*)
14655b944e2aSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
14665b944e2aSmrg			;;
14675b944e2aSmrg	    esac
14685b944e2aSmrg	    ;;
14695b944e2aSmrg    esac
1470b1297603Smrgfi
1471b1297603Smrg
14725b944e2aSmrgAC_SUBST(LINT)
14735b944e2aSmrgAC_SUBST(LINT_FLAGS)
14745b944e2aSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
14755b944e2aSmrg
14765b944e2aSmrg]) # XORG_WITH_LINT
14775b944e2aSmrg
14785b944e2aSmrg# XORG_LINT_LIBRARY(LIBNAME)
14795b944e2aSmrg# --------------------------
14805b944e2aSmrg# Minimum version: 1.1.0
14815b944e2aSmrg#
14825b944e2aSmrg# Sets up flags for building lint libraries for checking programs that call
14835b944e2aSmrg# functions in the library.
14845b944e2aSmrg# Disabled by default, enable with --enable-lint-library
14855b944e2aSmrg# Sets: 
14865b944e2aSmrg#	@LINTLIB@		- name of lint library file to make
14875b944e2aSmrg#	MAKE_LINT_LIB		- automake conditional
1488b1297603Smrg#
1489b1297603Smrg
14905b944e2aSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
14915b944e2aSmrgAC_REQUIRE([XORG_WITH_LINT])
14925b944e2aSmrg# Build lint "library" for more indepth checks of programs calling this library
14935b944e2aSmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
14945b944e2aSmrg	[Create lint library (default: disabled)])],
14955b944e2aSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
14965b944e2aSmrgif test "x$make_lint_lib" != "xno" ; then
14975b944e2aSmrg	if test "x$LINT" = "xno" ; then
14985b944e2aSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
14995b944e2aSmrg	fi
15005b944e2aSmrg	if test "x$make_lint_lib" = "xyes" ; then
15015b944e2aSmrg		LINTLIB=llib-l$1.ln
15025b944e2aSmrg	else
15035b944e2aSmrg		LINTLIB=$make_lint_lib
15045b944e2aSmrg	fi
1505b1297603Smrgfi
15065b944e2aSmrgAC_SUBST(LINTLIB)
15075b944e2aSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1508b1297603Smrg
15095b944e2aSmrg]) # XORG_LINT_LIBRARY
1510b1297603Smrg
15115b944e2aSmrg# XORG_CWARNFLAGS
15125b944e2aSmrg# ---------------
15135b944e2aSmrg# Minimum version: 1.2.0
1514b1297603Smrg#
15155b944e2aSmrg# Defines CWARNFLAGS to enable C compiler warnings.
15165b944e2aSmrg#
15175b944e2aSmrgAC_DEFUN([XORG_CWARNFLAGS], [
15185b944e2aSmrgAC_REQUIRE([AC_PROG_CC])
15195b944e2aSmrgif  test "x$GCC" = xyes ; then
15205b944e2aSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
15215b944e2aSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
15225b944e2aSmrg-Wbad-function-cast"
15235b944e2aSmrg    case `gcc -dumpversion` in
1524d3263506Smrg    3.4.* | 4.*)
1525d3263506Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
15265b944e2aSmrg	;;
15275b944e2aSmrg    esac
15285b944e2aSmrgelse
15295b944e2aSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
15305b944e2aSmrg    if test "x$SUNCC" = "xyes"; then
15315b944e2aSmrg	CWARNFLAGS="-v"
15325b944e2aSmrg    fi
15335b944e2aSmrgfi
15345b944e2aSmrgAC_SUBST(CWARNFLAGS)
15355b944e2aSmrg]) # XORG_CWARNFLAGS
15365b944e2aSmrgdnl Copyright 2005 Red Hat, Inc
15375b944e2aSmrgdnl
15385b944e2aSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
15395b944e2aSmrgdnl documentation for any purpose is hereby granted without fee, provided that
15405b944e2aSmrgdnl the above copyright notice appear in all copies and that both that
15415b944e2aSmrgdnl copyright notice and this permission notice appear in supporting
15425b944e2aSmrgdnl documentation.
15435b944e2aSmrgdnl
15445b944e2aSmrgdnl The above copyright notice and this permission notice shall be included
15455b944e2aSmrgdnl in all copies or substantial portions of the Software.
15465b944e2aSmrgdnl
15475b944e2aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15485b944e2aSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15495b944e2aSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15505b944e2aSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
15515b944e2aSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
15525b944e2aSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
15535b944e2aSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
15545b944e2aSmrgdnl
15555b944e2aSmrgdnl Except as contained in this notice, the name of the copyright holders shall
15565b944e2aSmrgdnl not be used in advertising or otherwise to promote the sale, use or
15575b944e2aSmrgdnl other dealings in this Software without prior written authorization
15585b944e2aSmrgdnl from the copyright holders.
15595b944e2aSmrgdnl
1560b1297603Smrg
15615b944e2aSmrg# XORG_RELEASE_VERSION
1562b1297603Smrg# --------------------
15635b944e2aSmrg# Adds --with/without-release-string and changes the PACKAGE and
15645b944e2aSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
15655b944e2aSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
15665b944e2aSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
15675b944e2aSmrg 
15685b944e2aSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
15695b944e2aSmrg	AC_ARG_WITH(release-version,
15705b944e2aSmrg			AC_HELP_STRING([--with-release-version=STRING],
15715b944e2aSmrg				[Use release version string in package name]),
15725b944e2aSmrg			[RELEASE_VERSION="$withval"],
15735b944e2aSmrg			[RELEASE_VERSION=""])
15745b944e2aSmrg	if test "x$RELEASE_VERSION" != "x"; then
15755b944e2aSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
15765b944e2aSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
15775b944e2aSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
15785b944e2aSmrg	fi
15795b944e2aSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
15805b944e2aSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
15815b944e2aSmrg		[Major version of this package])
15825b944e2aSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
15835b944e2aSmrg	if test "x$PVM" = "x"; then
15845b944e2aSmrg		PVM="0"
15855b944e2aSmrg	fi
15865b944e2aSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
15875b944e2aSmrg		[$PVM],
15885b944e2aSmrg		[Minor version of this package])
15895b944e2aSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
15905b944e2aSmrg	if test "x$PVP" = "x"; then
15915b944e2aSmrg		PVP="0"
15925b944e2aSmrg	fi
15935b944e2aSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
15945b944e2aSmrg		[$PVP],
15955b944e2aSmrg		[Patch version of this package])
15965b944e2aSmrg])
15975b944e2aSmrg
15985b944e2aSmrg# XORG_CHANGELOG()
15995b944e2aSmrg# ----------------
16005b944e2aSmrg# Minimum version: 1.2.0
1601b1297603Smrg#
16025b944e2aSmrg# Defines the variable CHANGELOG_CMD as the command to generate
16035b944e2aSmrg# ChangeLog from git.
1604b1297603Smrg#
1605d3263506Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1606d3263506Smrg#
16075b944e2aSmrgAC_DEFUN([XORG_CHANGELOG], [
16085b944e2aSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
16095b944e2aSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
16105b944e2aSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
16115b944e2aSmrgAC_SUBST([CHANGELOG_CMD])
1612d3263506SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
16135b944e2aSmrg]) # XORG_CHANGELOG
1614b1297603Smrg
1615