aclocal.m4 revision cea37944
153719b08Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2b1297603Smrg
3b1297603Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
453719b08Smrg# 2005, 2006, 2007, 2008, 2009  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
178cea37944Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
179cea37944Smrg#
180cea37944Smrg# This file is free software; the Free Software Foundation
181cea37944Smrg# gives unlimited permission to copy and/or distribute it,
182cea37944Smrg# with or without modifications, as long as this notice is preserved.
1835b944e2aSmrg
184cea37944Smrg# AM_AUTOMAKE_VERSION(VERSION)
185cea37944Smrg# ----------------------------
186cea37944Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
187cea37944Smrg# generated from the m4 files accompanying Automake X.Y.
188cea37944Smrg# (This private macro should not be called outside this file.)
189cea37944SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
190cea37944Smrg[am__api_version='1.11'
191cea37944Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
192cea37944Smrgdnl require some minimum version.  Point them to the right macro.
193cea37944Smrgm4_if([$1], [1.11.1], [],
194cea37944Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
195cea37944Smrg])
196cea37944Smrg
197cea37944Smrg# _AM_AUTOCONF_VERSION(VERSION)
198cea37944Smrg# -----------------------------
199cea37944Smrg# aclocal traces this macro to find the Autoconf version.
200cea37944Smrg# This is a private macro too.  Using m4_define simplifies
201cea37944Smrg# the logic in aclocal, which can simply ignore this definition.
202cea37944Smrgm4_define([_AM_AUTOCONF_VERSION], [])
203cea37944Smrg
204cea37944Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
205cea37944Smrg# -------------------------------
206cea37944Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
207cea37944Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
208cea37944SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
209cea37944Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
210cea37944Smrgm4_ifndef([AC_AUTOCONF_VERSION],
211cea37944Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
212cea37944Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
213cea37944Smrg
214cea37944Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
215cea37944Smrg
216cea37944Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
217b1297603Smrg#
218cea37944Smrg# This file is free software; the Free Software Foundation
219cea37944Smrg# gives unlimited permission to copy and/or distribute it,
220cea37944Smrg# with or without modifications, as long as this notice is preserved.
221cea37944Smrg
222cea37944Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
223cea37944Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
224cea37944Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
225b1297603Smrg#
226cea37944Smrg# Of course, Automake must honor this variable whenever it calls a
227cea37944Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
228cea37944Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
229cea37944Smrg# depending on how configure is run.  This is pretty annoying, since
230cea37944Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
231cea37944Smrg# source directory, any form will work fine, but in subdirectories a
232cea37944Smrg# relative path needs to be adjusted first.
2335b944e2aSmrg#
234cea37944Smrg# $ac_aux_dir/missing
235cea37944Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
236cea37944Smrg# $top_srcdir/$ac_aux_dir/missing
237cea37944Smrg#    fails if $ac_aux_dir is absolute,
238cea37944Smrg#    fails when called from a subdirectory in a VPATH build with
239cea37944Smrg#          a relative $ac_aux_dir
2405b944e2aSmrg#
241cea37944Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
242cea37944Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
243cea37944Smrg# harmless because $srcdir is `.', but things will broke when you
244cea37944Smrg# start a VPATH build or use an absolute $srcdir.
245cea37944Smrg#
246cea37944Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
247cea37944Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
248cea37944Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
249cea37944Smrg# and then we would define $MISSING as
250cea37944Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
251cea37944Smrg# This will work as long as MISSING is not called from configure, because
252cea37944Smrg# unfortunately $(top_srcdir) has no meaning in configure.
253cea37944Smrg# However there are other variables, like CC, which are often used in
254cea37944Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
255cea37944Smrg#
256cea37944Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
257cea37944Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
258cea37944Smrg# configured tree to be moved without reconfiguration.
2595b944e2aSmrg
260cea37944SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
261cea37944Smrg[dnl Rely on autoconf to set up CDPATH properly.
262cea37944SmrgAC_PREREQ([2.50])dnl
263cea37944Smrg# expand $ac_aux_dir to an absolute path
264cea37944Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
265cea37944Smrg])
266cea37944Smrg
267cea37944Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
268cea37944Smrg
269cea37944Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
270cea37944Smrg# Free Software Foundation, Inc.
271b1297603Smrg#
272cea37944Smrg# This file is free software; the Free Software Foundation
273cea37944Smrg# gives unlimited permission to copy and/or distribute it,
274cea37944Smrg# with or without modifications, as long as this notice is preserved.
275b1297603Smrg
276cea37944Smrg# serial 9
277b1297603Smrg
278cea37944Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
279cea37944Smrg# -------------------------------------
280cea37944Smrg# Define a conditional.
281cea37944SmrgAC_DEFUN([AM_CONDITIONAL],
282cea37944Smrg[AC_PREREQ(2.52)dnl
283cea37944Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
284cea37944Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
285cea37944SmrgAC_SUBST([$1_TRUE])dnl
286cea37944SmrgAC_SUBST([$1_FALSE])dnl
287cea37944Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
288cea37944Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
289cea37944Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
290cea37944Smrgif $2; then
291cea37944Smrg  $1_TRUE=
292cea37944Smrg  $1_FALSE='#'
293b1297603Smrgelse
294cea37944Smrg  $1_TRUE='#'
295cea37944Smrg  $1_FALSE=
296b1297603Smrgfi
297cea37944SmrgAC_CONFIG_COMMANDS_PRE(
298cea37944Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
299cea37944Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
300cea37944SmrgUsually this means the macro was only invoked conditionally.]])
301cea37944Smrgfi])])
302b1297603Smrg
303cea37944Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
304cea37944Smrg# Free Software Foundation, Inc.
305b1297603Smrg#
306cea37944Smrg# This file is free software; the Free Software Foundation
307cea37944Smrg# gives unlimited permission to copy and/or distribute it,
308cea37944Smrg# with or without modifications, as long as this notice is preserved.
309b1297603Smrg
310cea37944Smrg# serial 10
311b1297603Smrg
312cea37944Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
313cea37944Smrg# written in clear, in which case automake, when reading aclocal.m4,
314cea37944Smrg# will think it sees a *use*, and therefore will trigger all it's
315cea37944Smrg# C support machinery.  Also note that it means that autoscan, seeing
316cea37944Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
317b1297603Smrg
318b1297603Smrg
319cea37944Smrg# _AM_DEPENDENCIES(NAME)
320cea37944Smrg# ----------------------
321cea37944Smrg# See how the compiler implements dependency checking.
322cea37944Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
323cea37944Smrg# We try a few techniques and use that to set a single cache variable.
324cea37944Smrg#
325cea37944Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
326cea37944Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
327cea37944Smrg# dependency, and given that the user is not expected to run this macro,
328cea37944Smrg# just rely on AC_PROG_CC.
329cea37944SmrgAC_DEFUN([_AM_DEPENDENCIES],
330cea37944Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
331cea37944SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
332cea37944SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
333cea37944SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
334b1297603Smrg
335cea37944Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
336cea37944Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
337cea37944Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
338cea37944Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
339cea37944Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
340cea37944Smrg                   [depcc="$$1"   am_compiler_list=])
341b1297603Smrg
342cea37944SmrgAC_CACHE_CHECK([dependency style of $depcc],
343cea37944Smrg               [am_cv_$1_dependencies_compiler_type],
344cea37944Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
345cea37944Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
346cea37944Smrg  # making bogus files that we don't know about and never remove.  For
347cea37944Smrg  # instance it was reported that on HP-UX the gcc test will end up
348cea37944Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
349cea37944Smrg  # in D'.
350cea37944Smrg  mkdir conftest.dir
351cea37944Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
352cea37944Smrg  # using a relative directory.
353cea37944Smrg  cp "$am_depcomp" conftest.dir
354cea37944Smrg  cd conftest.dir
355cea37944Smrg  # We will build objects and dependencies in a subdirectory because
356cea37944Smrg  # it helps to detect inapplicable dependency modes.  For instance
357cea37944Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
358cea37944Smrg  # side effect of compilation, but ICC will put the dependencies in
359cea37944Smrg  # the current directory while Tru64 will put them in the object
360cea37944Smrg  # directory.
361cea37944Smrg  mkdir sub
362b1297603Smrg
363cea37944Smrg  am_cv_$1_dependencies_compiler_type=none
364cea37944Smrg  if test "$am_compiler_list" = ""; then
365cea37944Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
366cea37944Smrg  fi
367cea37944Smrg  am__universal=false
368cea37944Smrg  m4_case([$1], [CC],
369cea37944Smrg    [case " $depcc " in #(
370cea37944Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
371cea37944Smrg     esac],
372cea37944Smrg    [CXX],
373cea37944Smrg    [case " $depcc " in #(
374cea37944Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
375cea37944Smrg     esac])
376b1297603Smrg
377cea37944Smrg  for depmode in $am_compiler_list; do
378cea37944Smrg    # Setup a source with many dependencies, because some compilers
379cea37944Smrg    # like to wrap large dependency lists on column 80 (with \), and
380cea37944Smrg    # we should not choose a depcomp mode which is confused by this.
381cea37944Smrg    #
382cea37944Smrg    # We need to recreate these files for each test, as the compiler may
383cea37944Smrg    # overwrite some of them when testing with obscure command lines.
384cea37944Smrg    # This happens at least with the AIX C compiler.
385cea37944Smrg    : > sub/conftest.c
386cea37944Smrg    for i in 1 2 3 4 5 6; do
387cea37944Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
388cea37944Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
389cea37944Smrg      # Solaris 8's {/usr,}/bin/sh.
390cea37944Smrg      touch sub/conftst$i.h
391cea37944Smrg    done
392cea37944Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
393b1297603Smrg
394cea37944Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
395cea37944Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
396cea37944Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
397cea37944Smrg    # versions had trouble with output in subdirs
398cea37944Smrg    am__obj=sub/conftest.${OBJEXT-o}
399cea37944Smrg    am__minus_obj="-o $am__obj"
400cea37944Smrg    case $depmode in
401cea37944Smrg    gcc)
402cea37944Smrg      # This depmode causes a compiler race in universal mode.
403cea37944Smrg      test "$am__universal" = false || continue
404cea37944Smrg      ;;
405cea37944Smrg    nosideeffect)
406cea37944Smrg      # after this tag, mechanisms are not by side-effect, so they'll
407cea37944Smrg      # only be used when explicitly requested
408cea37944Smrg      if test "x$enable_dependency_tracking" = xyes; then
409cea37944Smrg	continue
410cea37944Smrg      else
411cea37944Smrg	break
412cea37944Smrg      fi
413cea37944Smrg      ;;
414cea37944Smrg    msvisualcpp | msvcmsys)
415cea37944Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
416cea37944Smrg      # not run yet.  These depmodes are late enough in the game, and
417cea37944Smrg      # so weak that their functioning should not be impacted.
418cea37944Smrg      am__obj=conftest.${OBJEXT-o}
419cea37944Smrg      am__minus_obj=
420cea37944Smrg      ;;
421cea37944Smrg    none) break ;;
422cea37944Smrg    esac
423cea37944Smrg    if depmode=$depmode \
424cea37944Smrg       source=sub/conftest.c object=$am__obj \
425cea37944Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
426cea37944Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
427cea37944Smrg         >/dev/null 2>conftest.err &&
428cea37944Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
429cea37944Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
430cea37944Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
431cea37944Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
432cea37944Smrg      # icc doesn't choke on unknown options, it will just issue warnings
433cea37944Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
434cea37944Smrg      # that says an option was ignored or not supported.
435cea37944Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
436cea37944Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
437cea37944Smrg      # The diagnosis changed in icc 8.0:
438cea37944Smrg      #   icc: Command line remark: option '-MP' not supported
439cea37944Smrg      if (grep 'ignoring option' conftest.err ||
440cea37944Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
441cea37944Smrg        am_cv_$1_dependencies_compiler_type=$depmode
442cea37944Smrg        break
443cea37944Smrg      fi
444cea37944Smrg    fi
445cea37944Smrg  done
446b1297603Smrg
447cea37944Smrg  cd ..
448cea37944Smrg  rm -rf conftest.dir
44953719b08Smrgelse
450cea37944Smrg  am_cv_$1_dependencies_compiler_type=none
45153719b08Smrgfi
452cea37944Smrg])
453cea37944SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
454cea37944SmrgAM_CONDITIONAL([am__fastdep$1], [
455cea37944Smrg  test "x$enable_dependency_tracking" != xno \
456cea37944Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
457cea37944Smrg])
458b1297603Smrg
459b1297603Smrg
460cea37944Smrg# AM_SET_DEPDIR
461cea37944Smrg# -------------
462cea37944Smrg# Choose a directory name for dependency files.
463cea37944Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
464cea37944SmrgAC_DEFUN([AM_SET_DEPDIR],
465cea37944Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
466cea37944SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
467cea37944Smrg])
4685b944e2aSmrg
469b1297603Smrg
470cea37944Smrg# AM_DEP_TRACK
471cea37944Smrg# ------------
472cea37944SmrgAC_DEFUN([AM_DEP_TRACK],
473cea37944Smrg[AC_ARG_ENABLE(dependency-tracking,
474cea37944Smrg[  --disable-dependency-tracking  speeds up one-time build
475cea37944Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
476cea37944Smrgif test "x$enable_dependency_tracking" != xno; then
477cea37944Smrg  am_depcomp="$ac_aux_dir/depcomp"
478cea37944Smrg  AMDEPBACKSLASH='\'
47953719b08Smrgfi
480cea37944SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
481cea37944SmrgAC_SUBST([AMDEPBACKSLASH])dnl
482cea37944Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
483cea37944Smrg])
484b1297603Smrg
485cea37944Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
48653719b08Smrg
487cea37944Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
488cea37944Smrg# Free Software Foundation, Inc.
4895b944e2aSmrg#
490cea37944Smrg# This file is free software; the Free Software Foundation
491cea37944Smrg# gives unlimited permission to copy and/or distribute it,
492cea37944Smrg# with or without modifications, as long as this notice is preserved.
493b1297603Smrg
494cea37944Smrg#serial 5
495b1297603Smrg
496cea37944Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
497cea37944Smrg# ------------------------------
498cea37944SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
499cea37944Smrg[{
500cea37944Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
501cea37944Smrg  # are listed without --file.  Let's play safe and only enable the eval
502cea37944Smrg  # if we detect the quoting.
503cea37944Smrg  case $CONFIG_FILES in
504cea37944Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
505cea37944Smrg  *)   set x $CONFIG_FILES ;;
506cea37944Smrg  esac
507cea37944Smrg  shift
508cea37944Smrg  for mf
509cea37944Smrg  do
510cea37944Smrg    # Strip MF so we end up with the name of the file.
511cea37944Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
512cea37944Smrg    # Check whether this is an Automake generated Makefile or not.
513cea37944Smrg    # We used to match only the files named `Makefile.in', but
514cea37944Smrg    # some people rename them; so instead we look at the file content.
515cea37944Smrg    # Grep'ing the first line is not enough: some people post-process
516cea37944Smrg    # each Makefile.in and add a new line on top of each file to say so.
517cea37944Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
518cea37944Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
519cea37944Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
520cea37944Smrg      dirpart=`AS_DIRNAME("$mf")`
521cea37944Smrg    else
522cea37944Smrg      continue
523cea37944Smrg    fi
524cea37944Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
525cea37944Smrg    # from the Makefile without running `make'.
526cea37944Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
527cea37944Smrg    test -z "$DEPDIR" && continue
528cea37944Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
529cea37944Smrg    test -z "am__include" && continue
530cea37944Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
531cea37944Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
532cea37944Smrg    U=`sed -n 's/^U = //p' < "$mf"`
533cea37944Smrg    # Find all dependency output files, they are included files with
534cea37944Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
535cea37944Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
536cea37944Smrg    # expansion.
537cea37944Smrg    for file in `sed -n "
538cea37944Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
539cea37944Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
540cea37944Smrg      # Make sure the directory exists.
541cea37944Smrg      test -f "$dirpart/$file" && continue
542cea37944Smrg      fdir=`AS_DIRNAME(["$file"])`
543cea37944Smrg      AS_MKDIR_P([$dirpart/$fdir])
544cea37944Smrg      # echo "creating $dirpart/$file"
545cea37944Smrg      echo '# dummy' > "$dirpart/$file"
546cea37944Smrg    done
547cea37944Smrg  done
548cea37944Smrg}
549cea37944Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
550b1297603Smrg
551b1297603Smrg
552cea37944Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
553cea37944Smrg# -----------------------------
554cea37944Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
55553719b08Smrg#
556cea37944Smrg# This code is only required when automatic dependency tracking
557cea37944Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
558cea37944Smrg# need in order to bootstrap the dependency handling code.
559cea37944SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
560cea37944Smrg[AC_CONFIG_COMMANDS([depfiles],
561cea37944Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
562cea37944Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
563cea37944Smrg])
564cea37944Smrg
565cea37944Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
566cea37944Smrg# Free Software Foundation, Inc.
56753719b08Smrg#
568cea37944Smrg# This file is free software; the Free Software Foundation
569cea37944Smrg# gives unlimited permission to copy and/or distribute it,
570cea37944Smrg# with or without modifications, as long as this notice is preserved.
571cea37944Smrg
572cea37944Smrg# serial 8
573cea37944Smrg
574cea37944Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
575cea37944SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
576cea37944Smrg
577cea37944Smrg# Do all the work for Automake.                             -*- Autoconf -*-
578cea37944Smrg
579cea37944Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
580cea37944Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
58153719b08Smrg#
582cea37944Smrg# This file is free software; the Free Software Foundation
583cea37944Smrg# gives unlimited permission to copy and/or distribute it,
584cea37944Smrg# with or without modifications, as long as this notice is preserved.
58553719b08Smrg
586cea37944Smrg# serial 16
587cea37944Smrg
588cea37944Smrg# This macro actually does too much.  Some checks are only needed if
589cea37944Smrg# your package does certain things.  But this isn't really a big deal.
590cea37944Smrg
591cea37944Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
592cea37944Smrg# AM_INIT_AUTOMAKE([OPTIONS])
593cea37944Smrg# -----------------------------------------------
594cea37944Smrg# The call with PACKAGE and VERSION arguments is the old style
595cea37944Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
596cea37944Smrg# and VERSION should now be passed to AC_INIT and removed from
597cea37944Smrg# the call to AM_INIT_AUTOMAKE.
598cea37944Smrg# We support both call styles for the transition.  After
599cea37944Smrg# the next Automake release, Autoconf can make the AC_INIT
600cea37944Smrg# arguments mandatory, and then we can depend on a new Autoconf
601cea37944Smrg# release and drop the old call support.
602cea37944SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
603cea37944Smrg[AC_PREREQ([2.62])dnl
604cea37944Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
605cea37944Smrgdnl the ones we care about.
606cea37944Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
607cea37944SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
608cea37944SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
609cea37944Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
610cea37944Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
611cea37944Smrg  # is not polluted with repeated "-I."
612cea37944Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
613cea37944Smrg  # test to see if srcdir already configured
614cea37944Smrg  if test -f $srcdir/config.status; then
615cea37944Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
616cea37944Smrg  fi
61753719b08Smrgfi
618b1297603Smrg
619cea37944Smrg# test whether we have cygpath
620cea37944Smrgif test -z "$CYGPATH_W"; then
621cea37944Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
622cea37944Smrg    CYGPATH_W='cygpath -w'
623cea37944Smrg  else
624cea37944Smrg    CYGPATH_W=echo
625cea37944Smrg  fi
626cea37944Smrgfi
627cea37944SmrgAC_SUBST([CYGPATH_W])
628cea37944Smrg
629cea37944Smrg# Define the identity of the package.
630cea37944Smrgdnl Distinguish between old-style and new-style calls.
631cea37944Smrgm4_ifval([$2],
632cea37944Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
633cea37944Smrg AC_SUBST([PACKAGE], [$1])dnl
634cea37944Smrg AC_SUBST([VERSION], [$2])],
635cea37944Smrg[_AM_SET_OPTIONS([$1])dnl
636cea37944Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
637cea37944Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
638cea37944Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
639cea37944Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
640cea37944Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
641cea37944Smrg
642cea37944Smrg_AM_IF_OPTION([no-define],,
643cea37944Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
644cea37944Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
645cea37944Smrg
646cea37944Smrg# Some tools Automake needs.
647cea37944SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
648cea37944SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
649cea37944SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
650cea37944SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
651cea37944SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
652cea37944SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
653cea37944SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
654cea37944SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
655cea37944SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
656cea37944SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
657cea37944Smrg# We need awk for the "check" target.  The system "awk" is bad on
658cea37944Smrg# some platforms.
659cea37944SmrgAC_REQUIRE([AC_PROG_AWK])dnl
660cea37944SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
661cea37944SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
662cea37944Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
663cea37944Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
664cea37944Smrg			     [_AM_PROG_TAR([v7])])])
665cea37944Smrg_AM_IF_OPTION([no-dependencies],,
666cea37944Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
667cea37944Smrg		  [_AM_DEPENDENCIES(CC)],
668cea37944Smrg		  [define([AC_PROG_CC],
669cea37944Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
670cea37944SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
671cea37944Smrg		  [_AM_DEPENDENCIES(CXX)],
672cea37944Smrg		  [define([AC_PROG_CXX],
673cea37944Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
674cea37944SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
675cea37944Smrg		  [_AM_DEPENDENCIES(OBJC)],
676cea37944Smrg		  [define([AC_PROG_OBJC],
677cea37944Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
678cea37944Smrg])
679cea37944Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
680cea37944Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
681cea37944Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
682cea37944Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
683cea37944SmrgAC_CONFIG_COMMANDS_PRE(dnl
684cea37944Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
685cea37944Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
686cea37944Smrg])
687cea37944Smrg
688cea37944Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
689cea37944Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
690cea37944Smrgdnl mangled by Autoconf and run in a shell conditional statement.
691cea37944Smrgm4_define([_AC_COMPILER_EXEEXT],
692cea37944Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
693cea37944Smrg
694cea37944Smrg
695cea37944Smrg# When config.status generates a header, we must update the stamp-h file.
696cea37944Smrg# This file resides in the same directory as the config header
697cea37944Smrg# that is generated.  The stamp files are numbered to have different names.
698cea37944Smrg
699cea37944Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
700cea37944Smrg# loop where config.status creates the headers, so we can generate
701cea37944Smrg# our stamp files there.
702cea37944SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
703cea37944Smrg[# Compute $1's index in $config_headers.
704cea37944Smrg_am_arg=$1
705cea37944Smrg_am_stamp_count=1
706cea37944Smrgfor _am_header in $config_headers :; do
707cea37944Smrg  case $_am_header in
708cea37944Smrg    $_am_arg | $_am_arg:* )
709cea37944Smrg      break ;;
710cea37944Smrg    * )
711cea37944Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
712cea37944Smrg  esac
713cea37944Smrgdone
714cea37944Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
715cea37944Smrg
716cea37944Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
71753719b08Smrg#
718cea37944Smrg# This file is free software; the Free Software Foundation
719cea37944Smrg# gives unlimited permission to copy and/or distribute it,
720cea37944Smrg# with or without modifications, as long as this notice is preserved.
721cea37944Smrg
722cea37944Smrg# AM_PROG_INSTALL_SH
723cea37944Smrg# ------------------
724cea37944Smrg# Define $install_sh.
725cea37944SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
726cea37944Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
727cea37944Smrgif test x"${install_sh}" != xset; then
728cea37944Smrg  case $am_aux_dir in
729cea37944Smrg  *\ * | *\	*)
730cea37944Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
731cea37944Smrg  *)
732cea37944Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
733cea37944Smrg  esac
734cea37944Smrgfi
735cea37944SmrgAC_SUBST(install_sh)])
736cea37944Smrg
737cea37944Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
73853719b08Smrg#
739cea37944Smrg# This file is free software; the Free Software Foundation
740cea37944Smrg# gives unlimited permission to copy and/or distribute it,
741cea37944Smrg# with or without modifications, as long as this notice is preserved.
74253719b08Smrg
743cea37944Smrg# serial 2
744cea37944Smrg
745cea37944Smrg# Check whether the underlying file-system supports filenames
746cea37944Smrg# with a leading dot.  For instance MS-DOS doesn't.
747cea37944SmrgAC_DEFUN([AM_SET_LEADING_DOT],
748cea37944Smrg[rm -rf .tst 2>/dev/null
749cea37944Smrgmkdir .tst 2>/dev/null
750cea37944Smrgif test -d .tst; then
751cea37944Smrg  am__leading_dot=.
75253719b08Smrgelse
753cea37944Smrg  am__leading_dot=_
75453719b08Smrgfi
755cea37944Smrgrmdir .tst 2>/dev/null
756cea37944SmrgAC_SUBST([am__leading_dot])])
7575b944e2aSmrg
758cea37944Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
759cea37944Smrg# From Jim Meyering
760cea37944Smrg
761cea37944Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
762cea37944Smrg# Free Software Foundation, Inc.
76353719b08Smrg#
764cea37944Smrg# This file is free software; the Free Software Foundation
765cea37944Smrg# gives unlimited permission to copy and/or distribute it,
766cea37944Smrg# with or without modifications, as long as this notice is preserved.
767cea37944Smrg
768cea37944Smrg# serial 5
769cea37944Smrg
770cea37944Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
771cea37944Smrg# ----------------------------------
772cea37944Smrg# Control maintainer-specific portions of Makefiles.
773cea37944Smrg# Default is to disable them, unless `enable' is passed literally.
774cea37944Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
775cea37944Smrg# can override the default with the --enable/--disable switch.
776cea37944SmrgAC_DEFUN([AM_MAINTAINER_MODE],
777cea37944Smrg[m4_case(m4_default([$1], [disable]),
778cea37944Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
779cea37944Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
780cea37944Smrg       [m4_define([am_maintainer_other], [enable])
781cea37944Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
782cea37944SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
783cea37944Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
784cea37944Smrg  AC_ARG_ENABLE([maintainer-mode],
785cea37944Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
786cea37944Smrg			  (and sometimes confusing) to the casual installer],
787cea37944Smrg      [USE_MAINTAINER_MODE=$enableval],
788cea37944Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
789cea37944Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
790cea37944Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
791cea37944Smrg  MAINT=$MAINTAINER_MODE_TRUE
792cea37944Smrg  AC_SUBST([MAINT])dnl
793cea37944Smrg]
794cea37944Smrg)
795cea37944Smrg
796cea37944SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
797cea37944Smrg
798cea37944Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
799cea37944Smrg
800cea37944Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
80153719b08Smrg#
802cea37944Smrg# This file is free software; the Free Software Foundation
803cea37944Smrg# gives unlimited permission to copy and/or distribute it,
804cea37944Smrg# with or without modifications, as long as this notice is preserved.
80553719b08Smrg
806cea37944Smrg# serial 4
807cea37944Smrg
808cea37944Smrg# AM_MAKE_INCLUDE()
809cea37944Smrg# -----------------
810cea37944Smrg# Check to see how make treats includes.
811cea37944SmrgAC_DEFUN([AM_MAKE_INCLUDE],
812cea37944Smrg[am_make=${MAKE-make}
813cea37944Smrgcat > confinc << 'END'
814cea37944Smrgam__doit:
815cea37944Smrg	@echo this is the am__doit target
816cea37944Smrg.PHONY: am__doit
817cea37944SmrgEND
818cea37944Smrg# If we don't find an include directive, just comment out the code.
819cea37944SmrgAC_MSG_CHECKING([for style of include used by $am_make])
820cea37944Smrgam__include="#"
821cea37944Smrgam__quote=
822cea37944Smrg_am_result=none
823cea37944Smrg# First try GNU make style include.
824cea37944Smrgecho "include confinc" > confmf
825cea37944Smrg# Ignore all kinds of additional output from `make'.
826cea37944Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
827cea37944Smrg*the\ am__doit\ target*)
828cea37944Smrg  am__include=include
829cea37944Smrg  am__quote=
830cea37944Smrg  _am_result=GNU
831cea37944Smrg  ;;
832cea37944Smrgesac
833cea37944Smrg# Now try BSD make style include.
834cea37944Smrgif test "$am__include" = "#"; then
835cea37944Smrg   echo '.include "confinc"' > confmf
836cea37944Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
837cea37944Smrg   *the\ am__doit\ target*)
838cea37944Smrg     am__include=.include
839cea37944Smrg     am__quote="\""
840cea37944Smrg     _am_result=BSD
841cea37944Smrg     ;;
842cea37944Smrg   esac
84353719b08Smrgfi
844cea37944SmrgAC_SUBST([am__include])
845cea37944SmrgAC_SUBST([am__quote])
846cea37944SmrgAC_MSG_RESULT([$_am_result])
847cea37944Smrgrm -f confinc confmf
848cea37944Smrg])
8495b944e2aSmrg
850cea37944Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
851cea37944Smrg
852cea37944Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
853cea37944Smrg# Free Software Foundation, Inc.
854b1297603Smrg#
855cea37944Smrg# This file is free software; the Free Software Foundation
856cea37944Smrg# gives unlimited permission to copy and/or distribute it,
857cea37944Smrg# with or without modifications, as long as this notice is preserved.
858b1297603Smrg
859cea37944Smrg# serial 6
8605b944e2aSmrg
861cea37944Smrg# AM_MISSING_PROG(NAME, PROGRAM)
862cea37944Smrg# ------------------------------
863cea37944SmrgAC_DEFUN([AM_MISSING_PROG],
864cea37944Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
865cea37944Smrg$1=${$1-"${am_missing_run}$2"}
866cea37944SmrgAC_SUBST($1)])
867cea37944Smrg
868cea37944Smrg
869cea37944Smrg# AM_MISSING_HAS_RUN
870cea37944Smrg# ------------------
871cea37944Smrg# Define MISSING if not defined so far and test if it supports --run.
872cea37944Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
873cea37944SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
874cea37944Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
875cea37944SmrgAC_REQUIRE_AUX_FILE([missing])dnl
876cea37944Smrgif test x"${MISSING+set}" != xset; then
877cea37944Smrg  case $am_aux_dir in
878cea37944Smrg  *\ * | *\	*)
879cea37944Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
880cea37944Smrg  *)
881cea37944Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
882cea37944Smrg  esac
883cea37944Smrgfi
884cea37944Smrg# Use eval to expand $SHELL
885cea37944Smrgif eval "$MISSING --run true"; then
886cea37944Smrg  am_missing_run="$MISSING --run "
887b1297603Smrgelse
888cea37944Smrg  am_missing_run=
889cea37944Smrg  AC_MSG_WARN([`missing' script is too old or missing])
890b1297603Smrgfi
891cea37944Smrg])
892b1297603Smrg
893cea37944Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
894b1297603Smrg#
895cea37944Smrg# This file is free software; the Free Software Foundation
896cea37944Smrg# gives unlimited permission to copy and/or distribute it,
897cea37944Smrg# with or without modifications, as long as this notice is preserved.
898cea37944Smrg
899cea37944Smrg# AM_PROG_MKDIR_P
900cea37944Smrg# ---------------
901cea37944Smrg# Check for `mkdir -p'.
902cea37944SmrgAC_DEFUN([AM_PROG_MKDIR_P],
903cea37944Smrg[AC_PREREQ([2.60])dnl
904cea37944SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
905cea37944Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
906cea37944Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
907cea37944Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
908cea37944Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
909cea37944Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
910cea37944Smrgdnl adjustment using top_builddir (which is defined more often than
911cea37944Smrgdnl MKDIR_P).
912cea37944SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
913cea37944Smrgcase $mkdir_p in
914cea37944Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
915cea37944Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
916cea37944Smrgesac
917cea37944Smrg])
918cea37944Smrg
919cea37944Smrg# Helper functions for option handling.                     -*- Autoconf -*-
920cea37944Smrg
921cea37944Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
92253719b08Smrg#
923cea37944Smrg# This file is free software; the Free Software Foundation
924cea37944Smrg# gives unlimited permission to copy and/or distribute it,
925cea37944Smrg# with or without modifications, as long as this notice is preserved.
926b1297603Smrg
927cea37944Smrg# serial 4
928b1297603Smrg
929cea37944Smrg# _AM_MANGLE_OPTION(NAME)
930cea37944Smrg# -----------------------
931cea37944SmrgAC_DEFUN([_AM_MANGLE_OPTION],
932cea37944Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
933b1297603Smrg
934cea37944Smrg# _AM_SET_OPTION(NAME)
935cea37944Smrg# ------------------------------
936cea37944Smrg# Set option NAME.  Presently that only means defining a flag for this option.
937cea37944SmrgAC_DEFUN([_AM_SET_OPTION],
938cea37944Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
939b1297603Smrg
940cea37944Smrg# _AM_SET_OPTIONS(OPTIONS)
941cea37944Smrg# ----------------------------------
942cea37944Smrg# OPTIONS is a space-separated list of Automake options.
943cea37944SmrgAC_DEFUN([_AM_SET_OPTIONS],
944cea37944Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
945b1297603Smrg
946cea37944Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
947cea37944Smrg# -------------------------------------------
948cea37944Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
949cea37944SmrgAC_DEFUN([_AM_IF_OPTION],
950cea37944Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
951b1297603Smrg
952cea37944Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
953b1297603Smrg
954cea37944Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
955cea37944Smrg# Free Software Foundation, Inc.
95653719b08Smrg#
957cea37944Smrg# This file is free software; the Free Software Foundation
958cea37944Smrg# gives unlimited permission to copy and/or distribute it,
959cea37944Smrg# with or without modifications, as long as this notice is preserved.
9605b944e2aSmrg
961cea37944Smrg# serial 5
96253719b08Smrg
963cea37944Smrg# AM_SANITY_CHECK
964cea37944Smrg# ---------------
965cea37944SmrgAC_DEFUN([AM_SANITY_CHECK],
966cea37944Smrg[AC_MSG_CHECKING([whether build environment is sane])
967cea37944Smrg# Just in case
968cea37944Smrgsleep 1
969cea37944Smrgecho timestamp > conftest.file
970cea37944Smrg# Reject unsafe characters in $srcdir or the absolute working directory
971cea37944Smrg# name.  Accept space and tab only in the latter.
972cea37944Smrgam_lf='
973cea37944Smrg'
974cea37944Smrgcase `pwd` in
975cea37944Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
976cea37944Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
977cea37944Smrgesac
978cea37944Smrgcase $srcdir in
979cea37944Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
980cea37944Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
981cea37944Smrgesac
982cea37944Smrg
983cea37944Smrg# Do `set' in a subshell so we don't clobber the current shell's
984cea37944Smrg# arguments.  Must try -L first in case configure is actually a
985cea37944Smrg# symlink; some systems play weird games with the mod time of symlinks
986cea37944Smrg# (eg FreeBSD returns the mod time of the symlink's containing
987cea37944Smrg# directory).
988cea37944Smrgif (
989cea37944Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
990cea37944Smrg   if test "$[*]" = "X"; then
991cea37944Smrg      # -L didn't work.
992cea37944Smrg      set X `ls -t "$srcdir/configure" conftest.file`
993cea37944Smrg   fi
994cea37944Smrg   rm -f conftest.file
995cea37944Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
996cea37944Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
997cea37944Smrg
998cea37944Smrg      # If neither matched, then we have a broken ls.  This can happen
999cea37944Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
1000cea37944Smrg      # broken ls alias from the environment.  This has actually
1001cea37944Smrg      # happened.  Such a system could not be considered "sane".
1002cea37944Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1003cea37944Smrgalias in your environment])
1004cea37944Smrg   fi
1005cea37944Smrg
1006cea37944Smrg   test "$[2]" = conftest.file
1007cea37944Smrg   )
1008cea37944Smrgthen
1009cea37944Smrg   # Ok.
1010cea37944Smrg   :
1011cea37944Smrgelse
1012cea37944Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
1013cea37944SmrgCheck your system clock])
101453719b08Smrgfi
1015cea37944SmrgAC_MSG_RESULT(yes)])
1016b1297603Smrg
1017cea37944Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
101853719b08Smrg#
1019cea37944Smrg# This file is free software; the Free Software Foundation
1020cea37944Smrg# gives unlimited permission to copy and/or distribute it,
1021cea37944Smrg# with or without modifications, as long as this notice is preserved.
102253719b08Smrg
1023cea37944Smrg# serial 1
102453719b08Smrg
1025cea37944Smrg# AM_SILENT_RULES([DEFAULT])
1026cea37944Smrg# --------------------------
1027cea37944Smrg# Enable less verbose build rules; with the default set to DEFAULT
1028cea37944Smrg# (`yes' being less verbose, `no' or empty being verbose).
1029cea37944SmrgAC_DEFUN([AM_SILENT_RULES],
1030cea37944Smrg[AC_ARG_ENABLE([silent-rules],
1031cea37944Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
1032cea37944Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
1033cea37944Smrgcase $enable_silent_rules in
1034cea37944Smrgyes) AM_DEFAULT_VERBOSITY=0;;
1035cea37944Smrgno)  AM_DEFAULT_VERBOSITY=1;;
1036cea37944Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1037cea37944Smrgesac
1038cea37944SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1039cea37944SmrgAM_BACKSLASH='\'
1040cea37944SmrgAC_SUBST([AM_BACKSLASH])dnl
1041cea37944Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
10425b944e2aSmrg])
1043b1297603Smrg
1044cea37944Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
104553719b08Smrg#
1046cea37944Smrg# This file is free software; the Free Software Foundation
1047cea37944Smrg# gives unlimited permission to copy and/or distribute it,
1048cea37944Smrg# with or without modifications, as long as this notice is preserved.
1049cea37944Smrg
1050cea37944Smrg# AM_PROG_INSTALL_STRIP
1051cea37944Smrg# ---------------------
1052cea37944Smrg# One issue with vendor `install' (even GNU) is that you can't
1053cea37944Smrg# specify the program used to strip binaries.  This is especially
1054cea37944Smrg# annoying in cross-compiling environments, where the build's strip
1055cea37944Smrg# is unlikely to handle the host's binaries.
1056cea37944Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
1057cea37944Smrg# always use install-sh in `make install-strip', and initialize
1058cea37944Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
1059cea37944SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
1060cea37944Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1061cea37944Smrg# Installed binaries are usually stripped using `strip' when the user
1062cea37944Smrg# run `make install-strip'.  However `strip' might not be the right
1063cea37944Smrg# tool to use in cross-compilation environments, therefore Automake
1064cea37944Smrg# will honor the `STRIP' environment variable to overrule this program.
1065cea37944Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1066cea37944Smrgif test "$cross_compiling" != no; then
1067cea37944Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
1068cea37944Smrgfi
1069cea37944SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1070cea37944SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1071cea37944Smrg
1072cea37944Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
107353719b08Smrg#
1074cea37944Smrg# This file is free software; the Free Software Foundation
1075cea37944Smrg# gives unlimited permission to copy and/or distribute it,
1076cea37944Smrg# with or without modifications, as long as this notice is preserved.
1077b1297603Smrg
1078cea37944Smrg# serial 2
1079cea37944Smrg
1080cea37944Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
1081cea37944Smrg# ---------------------------
1082cea37944Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1083cea37944Smrg# This macro is traced by Automake.
1084cea37944SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1085cea37944Smrg
1086cea37944Smrg# AM_SUBST_NOTMAKE(VARIABLE)
1087cea37944Smrg# ---------------------------
1088cea37944Smrg# Public sister of _AM_SUBST_NOTMAKE.
1089cea37944SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1090cea37944Smrg
1091cea37944Smrg# Check how to create a tarball.                            -*- Autoconf -*-
1092cea37944Smrg
1093cea37944Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1094b1297603Smrg#
1095b1297603Smrg# This file is free software; the Free Software Foundation
1096b1297603Smrg# gives unlimited permission to copy and/or distribute it,
1097b1297603Smrg# with or without modifications, as long as this notice is preserved.
1098b1297603Smrg
1099cea37944Smrg# serial 2
1100b1297603Smrg
1101cea37944Smrg# _AM_PROG_TAR(FORMAT)
1102cea37944Smrg# --------------------
1103cea37944Smrg# Check how to create a tarball in format FORMAT.
1104cea37944Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
1105cea37944Smrg#
1106cea37944Smrg# Substitute a variable $(am__tar) that is a command
1107cea37944Smrg# writing to stdout a FORMAT-tarball containing the directory
1108cea37944Smrg# $tardir.
1109cea37944Smrg#     tardir=directory && $(am__tar) > result.tar
1110cea37944Smrg#
1111cea37944Smrg# Substitute a variable $(am__untar) that extract such
1112cea37944Smrg# a tarball read from stdin.
1113cea37944Smrg#     $(am__untar) < result.tar
1114cea37944SmrgAC_DEFUN([_AM_PROG_TAR],
1115cea37944Smrg[# Always define AMTAR for backward compatibility.
1116cea37944SmrgAM_MISSING_PROG([AMTAR], [tar])
1117cea37944Smrgm4_if([$1], [v7],
1118cea37944Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1119cea37944Smrg     [m4_case([$1], [ustar],, [pax],,
1120cea37944Smrg              [m4_fatal([Unknown tar format])])
1121cea37944SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
1122cea37944Smrg# Loop over all known methods to create a tar archive until one works.
1123cea37944Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1124cea37944Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1125cea37944Smrg# Do not fold the above two line into one, because Tru64 sh and
1126cea37944Smrg# Solaris sh will not grok spaces in the rhs of `-'.
1127cea37944Smrgfor _am_tool in $_am_tools
1128cea37944Smrgdo
1129cea37944Smrg  case $_am_tool in
1130cea37944Smrg  gnutar)
1131cea37944Smrg    for _am_tar in tar gnutar gtar;
1132cea37944Smrg    do
1133cea37944Smrg      AM_RUN_LOG([$_am_tar --version]) && break
1134cea37944Smrg    done
1135cea37944Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1136cea37944Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1137cea37944Smrg    am__untar="$_am_tar -xf -"
1138cea37944Smrg    ;;
1139cea37944Smrg  plaintar)
1140cea37944Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
1141cea37944Smrg    # ustar tarball either.
1142cea37944Smrg    (tar --version) >/dev/null 2>&1 && continue
1143cea37944Smrg    am__tar='tar chf - "$$tardir"'
1144cea37944Smrg    am__tar_='tar chf - "$tardir"'
1145cea37944Smrg    am__untar='tar xf -'
1146cea37944Smrg    ;;
1147cea37944Smrg  pax)
1148cea37944Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
1149cea37944Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
1150cea37944Smrg    am__untar='pax -r'
1151cea37944Smrg    ;;
1152cea37944Smrg  cpio)
1153cea37944Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1154cea37944Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1155cea37944Smrg    am__untar='cpio -i -H $1 -d'
1156cea37944Smrg    ;;
1157cea37944Smrg  none)
1158cea37944Smrg    am__tar=false
1159cea37944Smrg    am__tar_=false
1160cea37944Smrg    am__untar=false
1161cea37944Smrg    ;;
1162cea37944Smrg  esac
1163b1297603Smrg
1164cea37944Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
1165cea37944Smrg  # and am__untar set.
1166cea37944Smrg  test -n "${am_cv_prog_tar_$1}" && break
1167b1297603Smrg
1168cea37944Smrg  # tar/untar a dummy directory, and stop if the command works
1169cea37944Smrg  rm -rf conftest.dir
1170cea37944Smrg  mkdir conftest.dir
1171cea37944Smrg  echo GrepMe > conftest.dir/file
1172cea37944Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1173cea37944Smrg  rm -rf conftest.dir
1174cea37944Smrg  if test -s conftest.tar; then
1175cea37944Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
1176cea37944Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1177cea37944Smrg  fi
1178cea37944Smrgdone
1179cea37944Smrgrm -rf conftest.dir
1180b1297603Smrg
1181cea37944SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1182cea37944SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1183cea37944SmrgAC_SUBST([am__tar])
1184cea37944SmrgAC_SUBST([am__untar])
1185cea37944Smrg]) # _AM_PROG_TAR
1186b1297603Smrg
1187cea37944Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1188cea37944Smrgdnl
1189cea37944Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1190cea37944Smrgdnl 
1191cea37944Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1192cea37944Smrgdnl copy of this software and associated documentation files (the "Software"),
1193cea37944Smrgdnl to deal in the Software without restriction, including without limitation
1194cea37944Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1195cea37944Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
1196cea37944Smrgdnl Software is furnished to do so, subject to the following conditions:
1197cea37944Smrgdnl
1198cea37944Smrgdnl The above copyright notice and this permission notice (including the next
1199cea37944Smrgdnl paragraph) shall be included in all copies or substantial portions of the
1200cea37944Smrgdnl Software.
1201cea37944Smrgdnl
1202cea37944Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1203cea37944Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1204cea37944Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1205cea37944Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1206cea37944Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1207cea37944Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1208cea37944Smrgdnl DEALINGS IN THE SOFTWARE.
1209cea37944Smrg
1210cea37944Smrg# XORG_MACROS_VERSION(required-version)
1211cea37944Smrg# -------------------------------------
1212cea37944Smrg# Minimum version: 1.1.0
121353719b08Smrg#
1214cea37944Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1215cea37944Smrg# your configure.ac with the minimum required version, such as:
1216cea37944Smrg# XORG_MACROS_VERSION(1.1)
121753719b08Smrg#
1218cea37944Smrg# To ensure that this macro is defined, also add:
1219cea37944Smrg# m4_ifndef([XORG_MACROS_VERSION],
1220cea37944Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
122153719b08Smrg#
122253719b08Smrg#
1223cea37944Smrg# See the "minimum version" comment for each macro you use to see what 
1224cea37944Smrg# version you require.
1225cea37944Smrgm4_defun([XORG_MACROS_VERSION],[
1226cea37944Smrgm4_define([vers_have], [1.8.0])
1227cea37944Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1228cea37944Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1229cea37944Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1230cea37944Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1231cea37944Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1232cea37944Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1233cea37944Smrgm4_undefine([vers_have])
1234cea37944Smrgm4_undefine([maj_have])
1235cea37944Smrgm4_undefine([maj_needed])
1236cea37944Smrg]) # XORG_MACROS_VERSION
1237b1297603Smrg
1238cea37944Smrg# XORG_PROG_RAWCPP()
1239cea37944Smrg# ------------------
1240cea37944Smrg# Minimum version: 1.0.0
12415b944e2aSmrg#
1242cea37944Smrg# Find cpp program and necessary flags for use in pre-processing text files
1243cea37944Smrg# such as man pages and config files
1244cea37944SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1245cea37944SmrgAC_REQUIRE([AC_PROG_CPP])
1246cea37944SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1247cea37944Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
124853719b08Smrg
1249cea37944Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1250cea37944Smrg# which is not the best choice for supporting other OS'es, but covers most
1251cea37944Smrg# of the ones we need for now.
1252cea37944SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1253cea37944SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1254cea37944Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1255cea37944Smrg	AC_MSG_RESULT([no])
125653719b08Smrgelse
1257cea37944Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1258cea37944Smrg		RAWCPPFLAGS=-undef
1259cea37944Smrg		AC_MSG_RESULT([yes])
1260cea37944Smrg	# under Cygwin unix is still defined even with -undef
1261cea37944Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1262cea37944Smrg		RAWCPPFLAGS="-undef -ansi"
1263cea37944Smrg		AC_MSG_RESULT([yes, with -ansi])
1264cea37944Smrg	else
1265cea37944Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1266cea37944Smrg	fi
12675b944e2aSmrgfi
1268cea37944Smrgrm -f conftest.$ac_ext
12695b944e2aSmrg
1270cea37944SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1271cea37944SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1272cea37944Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1273cea37944Smrg	AC_MSG_RESULT([no])
1274cea37944Smrgelse
1275cea37944Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1276cea37944Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1277cea37944Smrg		AC_MSG_RESULT([yes])
1278cea37944Smrg	else
1279cea37944Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1280cea37944Smrg	fi
1281cea37944Smrgfi
1282cea37944Smrgrm -f conftest.$ac_ext
1283cea37944SmrgAC_SUBST(RAWCPPFLAGS)
1284cea37944Smrg]) # XORG_PROG_RAWCPP
1285b1297603Smrg
1286cea37944Smrg# XORG_MANPAGE_SECTIONS()
1287cea37944Smrg# -----------------------
1288cea37944Smrg# Minimum version: 1.0.0
1289cea37944Smrg#
1290cea37944Smrg# Determine which sections man pages go in for the different man page types
1291cea37944Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1292cea37944Smrg# Not sure if there's any better way than just hardcoding by OS name.
1293cea37944Smrg# Override default settings by setting environment variables
1294cea37944Smrg# Added MAN_SUBSTS in version 1.8
1295cea37944Smrg# Added AC_PROG_SED in version 1.8
1296b1297603Smrg
1297cea37944SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1298cea37944SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1299cea37944SmrgAC_REQUIRE([AC_PROG_SED])
1300b1297603Smrg
1301cea37944Smrgif test x$APP_MAN_SUFFIX = x    ; then
1302cea37944Smrg    APP_MAN_SUFFIX=1
1303cea37944Smrgfi
1304cea37944Smrgif test x$APP_MAN_DIR = x    ; then
1305cea37944Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1306cea37944Smrgfi
1307b1297603Smrg
1308cea37944Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1309cea37944Smrg    LIB_MAN_SUFFIX=3
1310cea37944Smrgfi
1311cea37944Smrgif test x$LIB_MAN_DIR = x    ; then
1312cea37944Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
13135b944e2aSmrgfi
1314b1297603Smrg
1315cea37944Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1316cea37944Smrg    case $host_os in
1317cea37944Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1318cea37944Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1319cea37944Smrg    esac
1320cea37944Smrgfi
1321cea37944Smrgif test x$FILE_MAN_DIR = x    ; then
1322cea37944Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1323cea37944Smrgfi
1324b1297603Smrg
1325cea37944Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1326cea37944Smrg    case $host_os in
1327cea37944Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1328cea37944Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1329cea37944Smrg    esac
1330cea37944Smrgfi
1331cea37944Smrgif test x$MISC_MAN_DIR = x    ; then
1332cea37944Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1333cea37944Smrgfi
1334b1297603Smrg
1335cea37944Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1336cea37944Smrg    case $host_os in
1337cea37944Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1338cea37944Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1339cea37944Smrg    esac
1340cea37944Smrgfi
1341cea37944Smrgif test x$DRIVER_MAN_DIR = x    ; then
1342cea37944Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1343cea37944Smrgfi
1344b1297603Smrg
1345cea37944Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1346cea37944Smrg    case $host_os in
1347cea37944Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1348cea37944Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1349cea37944Smrg    esac
1350cea37944Smrgfi
1351cea37944Smrgif test x$ADMIN_MAN_DIR = x    ; then
1352cea37944Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
13535b944e2aSmrgfi
1354b1297603Smrg
1355b1297603Smrg
1356cea37944SmrgAC_SUBST([APP_MAN_SUFFIX])
1357cea37944SmrgAC_SUBST([LIB_MAN_SUFFIX])
1358cea37944SmrgAC_SUBST([FILE_MAN_SUFFIX])
1359cea37944SmrgAC_SUBST([MISC_MAN_SUFFIX])
1360cea37944SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1361cea37944SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1362cea37944SmrgAC_SUBST([APP_MAN_DIR])
1363cea37944SmrgAC_SUBST([LIB_MAN_DIR])
1364cea37944SmrgAC_SUBST([FILE_MAN_DIR])
1365cea37944SmrgAC_SUBST([MISC_MAN_DIR])
1366cea37944SmrgAC_SUBST([DRIVER_MAN_DIR])
1367cea37944SmrgAC_SUBST([ADMIN_MAN_DIR])
1368b1297603Smrg
1369cea37944SmrgXORG_MAN_PAGE="X Version 11"
1370cea37944SmrgAC_SUBST([XORG_MAN_PAGE])
1371cea37944SmrgMAN_SUBSTS="\
1372cea37944Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1373cea37944Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1374cea37944Smrg	-e 's|__xservername__|Xorg|g' \
1375cea37944Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
1376cea37944Smrg	-e 's|__projectroot__|\$(prefix)|g' \
1377cea37944Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1378cea37944Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1379cea37944Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1380cea37944Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1381cea37944Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1382cea37944Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1383cea37944SmrgAC_SUBST([MAN_SUBSTS])
1384b1297603Smrg
1385cea37944Smrg]) # XORG_MANPAGE_SECTIONS
1386b1297603Smrg
1387cea37944Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1388cea37944Smrg# ------------------------
1389cea37944Smrg# Minimum version: 1.7.0
1390cea37944Smrg#
1391cea37944Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1392cea37944Smrg# provided by xorg-sgml-doctools, if installed.
1393cea37944SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1394cea37944SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1395cea37944SmrgXORG_SGML_PATH=
1396cea37944SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1397cea37944Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1398cea37944Smrg    [m4_ifval([$1],[:],
1399cea37944Smrg        [if test x"$cross_compiling" != x"yes" ; then
1400cea37944Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1401cea37944Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1402cea37944Smrg         fi])
1403cea37944Smrg    ])
1404cea37944Smrg
1405cea37944Smrgif test "x$XORG_SGML_PATH" != "x" ; then
1406cea37944Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1407cea37944Smrgelse
1408cea37944Smrg   AC_MSG_RESULT([no])
1409cea37944Smrgfi
1410b1297603Smrg
1411cea37944SmrgAC_SUBST(XORG_SGML_PATH)
1412cea37944Smrg]) # XORG_CHECK_SGML_DOCTOOLS
1413b1297603Smrg
1414cea37944Smrg# XORG_CHECK_LINUXDOC
1415cea37944Smrg# -------------------
1416cea37944Smrg# Minimum version: 1.0.0
141753719b08Smrg#
1418cea37944Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1419cea37944Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1420cea37944Smrg# Whether or not the necessary tools and files are found can be checked
1421cea37944Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1422cea37944SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1423cea37944SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1424cea37944SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1425b1297603Smrg
1426cea37944SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1427b1297603Smrg
1428cea37944SmrgAC_MSG_CHECKING([whether to build documentation])
1429b1297603Smrg
1430cea37944Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1431cea37944Smrg   BUILDDOC=yes
1432cea37944Smrgelse
1433cea37944Smrg   BUILDDOC=no
1434cea37944Smrgfi
1435b1297603Smrg
1436cea37944SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1437b1297603Smrg
1438cea37944SmrgAC_MSG_RESULT([$BUILDDOC])
1439b1297603Smrg
1440cea37944SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1441b1297603Smrg
1442cea37944Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1443cea37944Smrg   BUILDPDFDOC=yes
1444cea37944Smrgelse
1445cea37944Smrg   BUILDPDFDOC=no
14465b944e2aSmrgfi
1447b1297603Smrg
1448cea37944SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1449b1297603Smrg
1450cea37944SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1451b1297603Smrg
1452cea37944SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1453cea37944SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1454cea37944SmrgMAKE_PDF="$PS2PDF"
1455cea37944SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1456b1297603Smrg
1457cea37944SmrgAC_SUBST(MAKE_TEXT)
1458cea37944SmrgAC_SUBST(MAKE_PS)
1459cea37944SmrgAC_SUBST(MAKE_PDF)
1460cea37944SmrgAC_SUBST(MAKE_HTML)
1461cea37944Smrg]) # XORG_CHECK_LINUXDOC
1462b1297603Smrg
1463cea37944Smrg# XORG_CHECK_DOCBOOK
1464cea37944Smrg# -------------------
1465cea37944Smrg# Minimum version: 1.0.0
1466cea37944Smrg#
1467cea37944Smrg# Checks for the ability to build output formats from SGML DocBook source.
1468cea37944Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1469cea37944Smrg# indicates whether the necessary tools and files are found and, if set,
1470cea37944Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1471cea37944SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1472cea37944SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
147353719b08Smrg
1474cea37944SmrgBUILDTXTDOC=no
1475cea37944SmrgBUILDPDFDOC=no
1476cea37944SmrgBUILDPSDOC=no
1477cea37944SmrgBUILDHTMLDOC=no
147853719b08Smrg
1479cea37944SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1480cea37944SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1481cea37944SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1482cea37944SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
148353719b08Smrg
1484cea37944SmrgAC_MSG_CHECKING([whether to build text documentation])
1485cea37944Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1486cea37944Smrg   test x$BUILD_TXTDOC != xno; then
1487cea37944Smrg	BUILDTXTDOC=yes
1488cea37944Smrgfi
1489cea37944SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1490cea37944SmrgAC_MSG_RESULT([$BUILDTXTDOC])
149153719b08Smrg
1492cea37944SmrgAC_MSG_CHECKING([whether to build PDF documentation])
1493cea37944Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1494cea37944Smrg   test x$BUILD_PDFDOC != xno; then
1495cea37944Smrg	BUILDPDFDOC=yes
1496cea37944Smrgfi
1497cea37944SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1498cea37944SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1499cea37944Smrg
1500cea37944SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1501cea37944Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1502cea37944Smrg   test x$BUILD_PSDOC != xno; then
1503cea37944Smrg	BUILDPSDOC=yes
1504cea37944Smrgfi
1505cea37944SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1506cea37944SmrgAC_MSG_RESULT([$BUILDPSDOC])
1507cea37944Smrg
1508cea37944SmrgAC_MSG_CHECKING([whether to build HTML documentation])
1509cea37944Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1510cea37944Smrg   test x$BUILD_HTMLDOC != xno; then
1511cea37944Smrg	BUILDHTMLDOC=yes
1512cea37944Smrgfi
1513cea37944SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1514cea37944SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1515cea37944Smrg
1516cea37944SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1517cea37944SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1518cea37944SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1519cea37944SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1520cea37944Smrg
1521cea37944SmrgAC_SUBST(MAKE_TEXT)
1522cea37944SmrgAC_SUBST(MAKE_PS)
1523cea37944SmrgAC_SUBST(MAKE_PDF)
1524cea37944SmrgAC_SUBST(MAKE_HTML)
1525cea37944Smrg]) # XORG_CHECK_DOCBOOK
1526cea37944Smrg
1527cea37944Smrg# XORG_WITH_XMLTO([MIN-VERSION])
1528cea37944Smrg# ----------------
1529cea37944Smrg# Minimum version: 1.5.0
15305b944e2aSmrg#
1531cea37944Smrg# Documentation tools are not always available on all platforms and sometimes
1532cea37944Smrg# not at the appropriate level. This macro enables a module to test for the
1533cea37944Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1534cea37944Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1535cea37944Smrg# as whether or not to use the xmlto package.
1536cea37944Smrg#
1537cea37944Smrg# Interface to module:
1538cea37944Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1539cea37944Smrg# XMLTO:	returns the path of the xmlto program found
1540cea37944Smrg#		returns the path set by the user in the environment
1541cea37944Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1542cea37944Smrg#		'no' user instructs the module not to use xmlto
1543cea37944Smrg#
1544cea37944Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1545cea37944Smrg#
1546cea37944SmrgAC_DEFUN([XORG_WITH_XMLTO],[
1547cea37944SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1548cea37944SmrgAC_ARG_WITH(xmlto,
1549cea37944Smrg	AS_HELP_STRING([--with-xmlto],
1550cea37944Smrg	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
1551cea37944Smrg	   [use_xmlto=$withval], [use_xmlto=auto])
155253719b08Smrg
1553cea37944Smrgif test "x$use_xmlto" = x"auto"; then
1554cea37944Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1555cea37944Smrg   if test "x$XMLTO" = "x"; then
1556cea37944Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1557cea37944Smrg	have_xmlto=no
1558cea37944Smrg   else
1559cea37944Smrg        have_xmlto=yes
1560cea37944Smrg   fi
1561cea37944Smrgelif test "x$use_xmlto" = x"yes" ; then
1562cea37944Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1563cea37944Smrg   if test "x$XMLTO" = "x"; then
1564cea37944Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1565cea37944Smrg   fi
1566cea37944Smrg   have_xmlto=yes
1567cea37944Smrgelif test "x$use_xmlto" = x"no" ; then
1568cea37944Smrg   if test "x$XMLTO" != "x"; then
1569cea37944Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1570cea37944Smrg   fi
1571cea37944Smrg   have_xmlto=no
1572cea37944Smrgelse
1573cea37944Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1574b1297603Smrgfi
1575cea37944Smrgm4_ifval([$1],
1576cea37944Smrg[if test "$have_xmlto" = yes; then
1577cea37944Smrg    # scrape the xmlto version
1578cea37944Smrg    AC_MSG_CHECKING([the xmlto version])
1579cea37944Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1580cea37944Smrg    AC_MSG_RESULT([$xmlto_version])
1581cea37944Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1582cea37944Smrg        [if test "x$use_xmlto" = xauto; then
1583cea37944Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1584cea37944Smrg            have_xmlto=no
1585cea37944Smrg        else
1586cea37944Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1587cea37944Smrg        fi])
1588cea37944Smrgfi])
1589cea37944SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1590cea37944Smrg]) # XORG_WITH_XMLTO
1591b1297603Smrg
1592cea37944Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION])
1593cea37944Smrg# ----------------
1594cea37944Smrg# Minimum version: 1.5.0
159553719b08Smrg#
1596cea37944Smrg# Documentation tools are not always available on all platforms and sometimes
1597cea37944Smrg# not at the appropriate level. This macro enables a module to test for the
1598cea37944Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1599cea37944Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1600cea37944Smrg# as whether or not to use the asciidoc package.
1601cea37944Smrg#
1602cea37944Smrg# Interface to module:
1603cea37944Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1604cea37944Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
1605cea37944Smrg#		 returns the path set by the user in the environment
1606cea37944Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1607cea37944Smrg#		  'no' user instructs the module not to use asciidoc
1608cea37944Smrg#
1609cea37944Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1610cea37944Smrg#
1611cea37944SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1612cea37944SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1613cea37944SmrgAC_ARG_WITH(asciidoc,
1614cea37944Smrg	AS_HELP_STRING([--with-asciidoc],
1615cea37944Smrg	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
1616cea37944Smrg	   [use_asciidoc=$withval], [use_asciidoc=auto])
1617b1297603Smrg
1618cea37944Smrgif test "x$use_asciidoc" = x"auto"; then
1619cea37944Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1620cea37944Smrg   if test "x$ASCIIDOC" = "x"; then
1621cea37944Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1622cea37944Smrg	have_asciidoc=no
1623cea37944Smrg   else
1624cea37944Smrg        have_asciidoc=yes
1625cea37944Smrg   fi
1626cea37944Smrgelif test "x$use_asciidoc" = x"yes" ; then
1627cea37944Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1628cea37944Smrg   if test "x$ASCIIDOC" = "x"; then
1629cea37944Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1630cea37944Smrg   fi
1631cea37944Smrg   have_asciidoc=yes
1632cea37944Smrgelif test "x$use_asciidoc" = x"no" ; then
1633cea37944Smrg   if test "x$ASCIIDOC" != "x"; then
1634cea37944Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1635cea37944Smrg   fi
1636cea37944Smrg   have_asciidoc=no
163753719b08Smrgelse
1638cea37944Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1639b1297603Smrgfi
1640cea37944Smrgm4_ifval([$1],
1641cea37944Smrg[if test "$have_asciidoc" = yes; then
1642cea37944Smrg    # scrape the asciidoc version
1643cea37944Smrg    AC_MSG_CHECKING([the asciidoc version])
1644cea37944Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1645cea37944Smrg    AC_MSG_RESULT([$asciidoc_version])
1646cea37944Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1647cea37944Smrg        [if test "x$use_asciidoc" = xauto; then
1648cea37944Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1649cea37944Smrg            have_asciidoc=no
1650cea37944Smrg        else
1651cea37944Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1652cea37944Smrg        fi])
1653cea37944Smrgfi])
1654cea37944SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1655cea37944Smrg]) # XORG_WITH_ASCIIDOC
1656b1297603Smrg
1657cea37944Smrg# XORG_WITH_DOXYGEN([MIN-VERSION])
1658cea37944Smrg# --------------------------------
1659cea37944Smrg# Minimum version: 1.5.0
166053719b08Smrg#
1661cea37944Smrg# Documentation tools are not always available on all platforms and sometimes
1662cea37944Smrg# not at the appropriate level. This macro enables a module to test for the
1663cea37944Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1664cea37944Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1665cea37944Smrg# as whether or not to use the doxygen package.
16665b944e2aSmrg#
1667cea37944Smrg# Interface to module:
1668cea37944Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1669cea37944Smrg# DOXYGEN:	 returns the path of the doxygen program found
1670cea37944Smrg#		 returns the path set by the user in the environment
1671cea37944Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1672cea37944Smrg#		  'no' user instructs the module not to use doxygen
1673cea37944Smrg#
1674cea37944Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1675cea37944Smrg#
1676cea37944SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1677cea37944SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1678cea37944SmrgAC_ARG_WITH(doxygen,
1679cea37944Smrg	AS_HELP_STRING([--with-doxygen],
1680cea37944Smrg	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
1681cea37944Smrg	   [use_doxygen=$withval], [use_doxygen=auto])
168253719b08Smrg
1683cea37944Smrgif test "x$use_doxygen" = x"auto"; then
1684cea37944Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1685cea37944Smrg   if test "x$DOXYGEN" = "x"; then
1686cea37944Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1687cea37944Smrg	have_doxygen=no
1688cea37944Smrg   else
1689cea37944Smrg        have_doxygen=yes
1690cea37944Smrg   fi
1691cea37944Smrgelif test "x$use_doxygen" = x"yes" ; then
1692cea37944Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1693cea37944Smrg   if test "x$DOXYGEN" = "x"; then
1694cea37944Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1695cea37944Smrg   fi
1696cea37944Smrg   have_doxygen=yes
1697cea37944Smrgelif test "x$use_doxygen" = x"no" ; then
1698cea37944Smrg   if test "x$DOXYGEN" != "x"; then
1699cea37944Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1700cea37944Smrg   fi
1701cea37944Smrg   have_doxygen=no
1702cea37944Smrgelse
1703cea37944Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
17045b944e2aSmrgfi
1705cea37944Smrgm4_ifval([$1],
1706cea37944Smrg[if test "$have_doxygen" = yes; then
1707cea37944Smrg    # scrape the doxygen version
1708cea37944Smrg    AC_MSG_CHECKING([the doxygen version])
1709cea37944Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1710cea37944Smrg    AC_MSG_RESULT([$doxygen_version])
1711cea37944Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1712cea37944Smrg        [if test "x$use_doxygen" = xauto; then
1713cea37944Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1714cea37944Smrg            have_doxygen=no
1715cea37944Smrg        else
1716cea37944Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1717cea37944Smrg        fi])
1718cea37944Smrgfi])
1719cea37944SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1720cea37944Smrg]) # XORG_WITH_DOXYGEN
172153719b08Smrg
1722cea37944Smrg# XORG_WITH_GROFF
1723cea37944Smrg# ----------------
1724cea37944Smrg# Minimum version: 1.6.0
172553719b08Smrg#
1726cea37944Smrg# Documentation tools are not always available on all platforms and sometimes
1727cea37944Smrg# not at the appropriate level. This macro enables a module to test for the
1728cea37944Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1729cea37944Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
1730cea37944Smrg# as whether or not to use the groff package.
1731cea37944Smrg#
1732cea37944Smrg# Interface to module:
1733cea37944Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1734cea37944Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1735cea37944Smrg# HAVE_GROFF_MS: the -ms macros package
1736cea37944Smrg# GROFF:	 returns the path of the groff program found
1737cea37944Smrg#		 returns the path set by the user in the environment
1738cea37944Smrg# --with-groff:	 'yes' user instructs the module to use groff
1739cea37944Smrg#		 'no' user instructs the module not to use groff
1740cea37944Smrg#
1741cea37944Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1742cea37944Smrg#
1743cea37944Smrg# OS and distros often splits groff in a basic and full package, the former
1744cea37944Smrg# having the groff program and the later having devices, fonts and macros
1745cea37944Smrg# Checking for the groff executable is not enough.
1746cea37944Smrg#
1747cea37944Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
1748cea37944Smrg# unset HAVE_GROFF or GROFF env variables.
1749cea37944Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1750cea37944Smrg#
1751cea37944SmrgAC_DEFUN([XORG_WITH_GROFF],[
1752cea37944SmrgAC_ARG_VAR([GROFF], [Path to groff command])
1753cea37944SmrgAC_ARG_WITH(groff,
1754cea37944Smrg	AS_HELP_STRING([--with-groff],
1755cea37944Smrg	   [Use groff to regenerate documentation (default: yes, if installed)]),
1756cea37944Smrg	   [use_groff=$withval], [use_groff=auto])
1757cea37944Smrg
1758cea37944Smrgif test "x$use_groff" = x"auto"; then
1759cea37944Smrg   AC_PATH_PROG([GROFF], [groff])
1760cea37944Smrg   if test "x$GROFF" = "x"; then
1761cea37944Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1762cea37944Smrg	have_groff=no
1763cea37944Smrg   else
1764cea37944Smrg        have_groff=yes
1765cea37944Smrg   fi
1766cea37944Smrgelif test "x$use_groff" = x"yes" ; then
1767cea37944Smrg   AC_PATH_PROG([GROFF], [groff])
1768cea37944Smrg   if test "x$GROFF" = "x"; then
1769cea37944Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1770cea37944Smrg   fi
1771cea37944Smrg   have_groff=yes
1772cea37944Smrgelif test "x$use_groff" = x"no" ; then
1773cea37944Smrg   if test "x$GROFF" != "x"; then
1774cea37944Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1775cea37944Smrg   fi
1776cea37944Smrg   have_groff=no
1777cea37944Smrgelse
1778cea37944Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
177953719b08Smrgfi
1780cea37944Smrg# We have groff, test for the presence of the macro packages
1781cea37944Smrgif test "x$have_groff" = x"yes"; then
1782cea37944Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1783cea37944Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1784cea37944Smrg        groff_ms_works=yes
1785cea37944Smrg    else
1786cea37944Smrg        groff_ms_works=no
1787cea37944Smrg    fi
1788cea37944Smrg    AC_MSG_RESULT([$groff_ms_works])
1789cea37944Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1790cea37944Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1791cea37944Smrg        groff_mm_works=yes
1792cea37944Smrg    else
1793cea37944Smrg        groff_mm_works=no
1794cea37944Smrg    fi
1795cea37944Smrg    AC_MSG_RESULT([$groff_mm_works])
1796cea37944Smrgfi
1797cea37944SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1798cea37944SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1799cea37944SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1800cea37944Smrg]) # XORG_WITH_GROFF
1801cea37944Smrg
1802cea37944Smrg# XORG_WITH_FOP
1803cea37944Smrg# ----------------
1804cea37944Smrg# Minimum version: 1.6.0
1805cea37944Smrg#
1806cea37944Smrg# Documentation tools are not always available on all platforms and sometimes
1807cea37944Smrg# not at the appropriate level. This macro enables a module to test for the
1808cea37944Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1809cea37944Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
1810cea37944Smrg# as whether or not to use the fop package.
1811cea37944Smrg#
1812cea37944Smrg# Interface to module:
1813cea37944Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1814cea37944Smrg# FOP:	 	returns the path of the fop program found
1815cea37944Smrg#		returns the path set by the user in the environment
1816cea37944Smrg# --with-fop: 	'yes' user instructs the module to use fop
1817cea37944Smrg#		'no' user instructs the module not to use fop
1818cea37944Smrg#
1819cea37944Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1820cea37944Smrg#
1821cea37944SmrgAC_DEFUN([XORG_WITH_FOP],[
1822cea37944SmrgAC_ARG_VAR([FOP], [Path to fop command])
1823cea37944SmrgAC_ARG_WITH(fop,
1824cea37944Smrg	AS_HELP_STRING([--with-fop],
1825cea37944Smrg	   [Use fop to regenerate documentation (default: yes, if installed)]),
1826cea37944Smrg	   [use_fop=$withval], [use_fop=auto])
1827cea37944Smrg
1828cea37944Smrgif test "x$use_fop" = x"auto"; then
1829cea37944Smrg   AC_PATH_PROG([FOP], [fop])
1830cea37944Smrg   if test "x$FOP" = "x"; then
1831cea37944Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1832cea37944Smrg	have_fop=no
1833cea37944Smrg   else
1834cea37944Smrg        have_fop=yes
1835cea37944Smrg   fi
1836cea37944Smrgelif test "x$use_fop" = x"yes" ; then
1837cea37944Smrg   AC_PATH_PROG([FOP], [fop])
1838cea37944Smrg   if test "x$FOP" = "x"; then
1839cea37944Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1840cea37944Smrg   fi
1841cea37944Smrg   have_fop=yes
1842cea37944Smrgelif test "x$use_fop" = x"no" ; then
1843cea37944Smrg   if test "x$FOP" != "x"; then
1844cea37944Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1845cea37944Smrg   fi
1846cea37944Smrg   have_fop=no
18475b944e2aSmrgelse
1848cea37944Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
18495b944e2aSmrgfi
1850cea37944SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1851cea37944Smrg]) # XORG_WITH_FOP
1852b1297603Smrg
1853cea37944Smrg# XORG_WITH_PS2PDF
1854cea37944Smrg# ----------------
1855cea37944Smrg# Minimum version: 1.6.0
185653719b08Smrg#
1857cea37944Smrg# Documentation tools are not always available on all platforms and sometimes
1858cea37944Smrg# not at the appropriate level. This macro enables a module to test for the
1859cea37944Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1860cea37944Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1861cea37944Smrg# as whether or not to use the ps2pdf package.
1862b1297603Smrg#
1863cea37944Smrg# Interface to module:
1864cea37944Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1865cea37944Smrg# PS2PDF:	returns the path of the ps2pdf program found
1866cea37944Smrg#		returns the path set by the user in the environment
1867cea37944Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1868cea37944Smrg#		 'no' user instructs the module not to use ps2pdf
1869cea37944Smrg#
1870cea37944Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1871cea37944Smrg#
1872cea37944SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1873cea37944SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1874cea37944SmrgAC_ARG_WITH(ps2pdf,
1875cea37944Smrg	AS_HELP_STRING([--with-ps2pdf],
1876cea37944Smrg	   [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
1877cea37944Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=auto])
1878cea37944Smrg
1879cea37944Smrgif test "x$use_ps2pdf" = x"auto"; then
1880cea37944Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1881cea37944Smrg   if test "x$PS2PDF" = "x"; then
1882cea37944Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1883cea37944Smrg	have_ps2pdf=no
1884cea37944Smrg   else
1885cea37944Smrg        have_ps2pdf=yes
1886cea37944Smrg   fi
1887cea37944Smrgelif test "x$use_ps2pdf" = x"yes" ; then
1888cea37944Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1889cea37944Smrg   if test "x$PS2PDF" = "x"; then
1890cea37944Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1891cea37944Smrg   fi
1892cea37944Smrg   have_ps2pdf=yes
1893cea37944Smrgelif test "x$use_ps2pdf" = x"no" ; then
1894cea37944Smrg   if test "x$PS2PDF" != "x"; then
1895cea37944Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1896cea37944Smrg   fi
1897cea37944Smrg   have_ps2pdf=no
1898cea37944Smrgelse
1899cea37944Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1900cea37944Smrgfi
1901cea37944SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1902cea37944Smrg]) # XORG_WITH_PS2PDF
190353719b08Smrg
1904cea37944Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
1905cea37944Smrg# ----------------
1906cea37944Smrg# Minimum version: 1.6.0
1907cea37944Smrg#
1908cea37944Smrg# Documentation tools are not always available on all platforms and sometimes
1909cea37944Smrg# not at the appropriate level. This macro enables a builder to skip all
1910cea37944Smrg# documentation targets except traditional man pages.
1911cea37944Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1912cea37944Smrg# maximum flexibilty in controlling documentation building.
1913cea37944Smrg# Refer to:
1914cea37944Smrg# XORG_WITH_XMLTO         --with-xmlto
1915cea37944Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1916cea37944Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1917cea37944Smrg# XORG_WITH_FOP           --with-fop
1918cea37944Smrg# XORG_WITH_GROFF         --with-groff
1919cea37944Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1920cea37944Smrg#
1921cea37944Smrg# Interface to module:
1922cea37944Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1923cea37944Smrg# --enable-docs: 'yes' user instructs the module to generate docs
1924cea37944Smrg#		 'no' user instructs the module not to generate docs
1925cea37944Smrg# parm1:	specify the default value, yes or no.
1926cea37944Smrg#
1927cea37944SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1928cea37944Smrgdefault=$1
1929cea37944Smrgif test "x$default" = x ; then
1930cea37944Smrg  default="yes"
1931cea37944Smrgfi
1932cea37944SmrgAC_ARG_ENABLE(docs,
1933cea37944Smrg	AS_HELP_STRING([--enable-docs],
1934cea37944Smrg	   [Enable building the documentation (default: yes)]),
1935cea37944Smrg	   [build_docs=$enableval], [build_docs=$default])
1936cea37944SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1937cea37944SmrgAC_MSG_CHECKING([whether to build documentation])
1938cea37944SmrgAC_MSG_RESULT([$build_docs])
1939cea37944Smrg]) # XORG_ENABLE_DOCS
1940cea37944Smrg
1941cea37944Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1942cea37944Smrg# ----------------
1943cea37944Smrg# Minimum version: 1.6.0
1944cea37944Smrg#
1945cea37944Smrg# This macro enables a builder to skip all developer documentation.
1946cea37944Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1947cea37944Smrg# maximum flexibilty in controlling documentation building.
1948cea37944Smrg# Refer to:
1949cea37944Smrg# XORG_WITH_XMLTO         --with-xmlto
1950cea37944Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1951cea37944Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1952cea37944Smrg# XORG_WITH_FOP           --with-fop
1953cea37944Smrg# XORG_WITH_GROFF         --with-groff
1954cea37944Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1955cea37944Smrg#
1956cea37944Smrg# Interface to module:
1957cea37944Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1958cea37944Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1959cea37944Smrg#			'no' user instructs the module not to generate developer docs
1960cea37944Smrg# parm1:		specify the default value, yes or no.
1961cea37944Smrg#
1962cea37944SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1963cea37944Smrgdevel_default=$1
1964cea37944Smrgif test "x$devel_default" = x ; then
1965cea37944Smrg  devel_default="yes"
1966cea37944Smrgfi
1967cea37944SmrgAC_ARG_ENABLE(devel-docs,
1968cea37944Smrg	AS_HELP_STRING([--enable-devel-docs],
1969cea37944Smrg	   [Enable building the developer documentation (default: yes)]),
1970cea37944Smrg	   [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
1971cea37944SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1972cea37944SmrgAC_MSG_CHECKING([whether to build developer documentation])
1973cea37944SmrgAC_MSG_RESULT([$build_devel_docs])
1974cea37944Smrg]) # XORG_ENABLE_DEVEL_DOCS
1975cea37944Smrg
1976cea37944Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
1977cea37944Smrg# ----------------
1978cea37944Smrg# Minimum version: 1.6.0
1979cea37944Smrg#
1980cea37944Smrg# This macro enables a builder to skip all functional specification targets.
1981cea37944Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1982cea37944Smrg# maximum flexibilty in controlling documentation building.
1983cea37944Smrg# Refer to:
1984cea37944Smrg# XORG_WITH_XMLTO         --with-xmlto
1985cea37944Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1986cea37944Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1987cea37944Smrg# XORG_WITH_FOP           --with-fop
1988cea37944Smrg# XORG_WITH_GROFF         --with-groff
1989cea37944Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1990cea37944Smrg#
1991cea37944Smrg# Interface to module:
1992cea37944Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1993cea37944Smrg# --enable-specs:	'yes' user instructs the module to generate specs
1994cea37944Smrg#			'no' user instructs the module not to generate specs
1995cea37944Smrg# parm1:		specify the default value, yes or no.
1996cea37944Smrg#
1997cea37944SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1998cea37944Smrgspec_default=$1
1999cea37944Smrgif test "x$spec_default" = x ; then
2000cea37944Smrg  spec_default="yes"
2001cea37944Smrgfi
2002cea37944SmrgAC_ARG_ENABLE(specs,
2003cea37944Smrg	AS_HELP_STRING([--enable-specs],
2004cea37944Smrg	   [Enable building the specs (default: yes)]),
2005cea37944Smrg	   [build_specs=$enableval], [build_specs=$spec_default])
2006cea37944SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
2007cea37944SmrgAC_MSG_CHECKING([whether to build functional specifications])
2008cea37944SmrgAC_MSG_RESULT([$build_specs])
2009cea37944Smrg]) # XORG_ENABLE_SPECS
201053719b08Smrg
2011cea37944Smrg# XORG_CHECK_MALLOC_ZERO
2012cea37944Smrg# ----------------------
2013cea37944Smrg# Minimum version: 1.0.0
2014cea37944Smrg#
2015cea37944Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2016cea37944Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
2017cea37944Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2018cea37944SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
2019cea37944SmrgAC_ARG_ENABLE(malloc0returnsnull,
2020cea37944Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
2021cea37944Smrg		       [malloc(0) returns NULL (default: auto)]),
2022cea37944Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
2023cea37944Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
202453719b08Smrg
2025cea37944SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
2026cea37944Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2027cea37944Smrg	AC_RUN_IFELSE([
2028cea37944Smrgchar *malloc();
2029cea37944Smrgchar *realloc();
2030cea37944Smrgchar *calloc();
2031cea37944Smrgmain() {
2032cea37944Smrg    char *m0, *r0, *c0, *p;
2033cea37944Smrg    m0 = malloc(0);
2034cea37944Smrg    p = malloc(10);
2035cea37944Smrg    r0 = realloc(p,0);
2036cea37944Smrg    c0 = calloc(0);
2037cea37944Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
2038cea37944Smrg}],
2039cea37944Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
2040cea37944Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
2041cea37944Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
2042cea37944Smrgfi
2043cea37944SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
204453719b08Smrg
2045cea37944Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
2046cea37944Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
2047cea37944Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
2048cea37944Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
2049cea37944Smrgelse
2050cea37944Smrg	MALLOC_ZERO_CFLAGS=""
2051cea37944Smrg	XMALLOC_ZERO_CFLAGS=""
2052cea37944Smrg	XTMALLOC_ZERO_CFLAGS=""
2053cea37944Smrgfi
205453719b08Smrg
2055cea37944SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
2056cea37944SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
2057cea37944SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
2058cea37944Smrg]) # XORG_CHECK_MALLOC_ZERO
205953719b08Smrg
2060cea37944Smrg# XORG_WITH_LINT()
2061cea37944Smrg# ----------------
2062cea37944Smrg# Minimum version: 1.1.0
20635b944e2aSmrg#
2064cea37944Smrg# This macro enables the use of a tool that flags some suspicious and
2065cea37944Smrg# non-portable constructs (likely to be bugs) in C language source code.
2066cea37944Smrg# It will attempt to locate the tool and use appropriate options.
2067cea37944Smrg# There are various lint type tools on different platforms.
2068cea37944Smrg#
2069cea37944Smrg# Interface to module:
2070cea37944Smrg# LINT:		returns the path to the tool found on the platform
2071cea37944Smrg#		or the value set to LINT on the configure cmd line
2072cea37944Smrg#		also an Automake conditional
2073cea37944Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
2074cea37944Smrg#
2075cea37944Smrg# --with-lint:	'yes' user instructs the module to use lint
2076cea37944Smrg#		'no' user instructs the module not to use lint (default)
2077cea37944Smrg#
2078cea37944Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
2079cea37944Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
2080cea37944Smrg#
2081cea37944SmrgAC_DEFUN([XORG_WITH_LINT],[
2082b1297603Smrg
2083cea37944SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
2084cea37944SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
2085cea37944SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
2086cea37944Smrg		[Use a lint-style source code checker (default: disabled)])],
2087cea37944Smrg		[use_lint=$withval], [use_lint=no])
208853719b08Smrg
2089cea37944Smrg# Obtain platform specific info like program name and options
2090cea37944Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
2091cea37944Smrgcase $host_os in
2092cea37944Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2093cea37944Smrg	lint_name=splint
2094cea37944Smrg	lint_options="-badflag"
2095cea37944Smrg	;;
2096cea37944Smrg  *freebsd* | *netbsd*)
2097cea37944Smrg	lint_name=lint
2098cea37944Smrg	lint_options="-u -b"
2099cea37944Smrg	;;
2100cea37944Smrg  *solaris*)
2101cea37944Smrg	lint_name=lint
2102cea37944Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2103cea37944Smrg	;;
210453719b08Smrgesac
210553719b08Smrg
2106cea37944Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
2107cea37944Smrgif test "x$use_lint" = x"yes" ; then
2108cea37944Smrg   AC_PATH_PROG([LINT], [$lint_name])
2109cea37944Smrg   if test "x$LINT" = "x"; then
2110cea37944Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
211153719b08Smrg   fi
2112cea37944Smrgelif test "x$use_lint" = x"no" ; then
2113cea37944Smrg   if test "x$LINT" != "x"; then
2114cea37944Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
211553719b08Smrg   fi
2116b1297603Smrgelse
2117cea37944Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2118b1297603Smrgfi
21195b944e2aSmrg
2120cea37944Smrg# User supplied flags override default flags
2121cea37944Smrgif test "x$LINT_FLAGS" != "x"; then
2122cea37944Smrg   lint_options=$LINT_FLAGS
2123cea37944Smrgfi
212453719b08Smrg
2125cea37944SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2126cea37944SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2127b1297603Smrg
2128cea37944Smrg]) # XORG_WITH_LINT
2129b1297603Smrg
2130cea37944Smrg# XORG_LINT_LIBRARY(LIBNAME)
2131cea37944Smrg# --------------------------
2132cea37944Smrg# Minimum version: 1.1.0
21335b944e2aSmrg#
2134cea37944Smrg# Sets up flags for building lint libraries for checking programs that call
2135cea37944Smrg# functions in the library.
2136cea37944Smrg#
2137cea37944Smrg# Interface to module:
2138cea37944Smrg# LINTLIB		- Automake variable with the name of lint library file to make
2139cea37944Smrg# MAKE_LINT_LIB		- Automake conditional
2140cea37944Smrg#
2141cea37944Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2142cea37944Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2143b1297603Smrg
2144cea37944SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2145cea37944SmrgAC_REQUIRE([XORG_WITH_LINT])
2146cea37944SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2147cea37944Smrg	[Create lint library (default: disabled)])],
2148cea37944Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
21495b944e2aSmrg
2150cea37944Smrgif test "x$make_lint_lib" = x"yes" ; then
2151cea37944Smrg   LINTLIB=llib-l$1.ln
2152cea37944Smrg   if test "x$LINT" = "x"; then
2153cea37944Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2154cea37944Smrg   fi
2155cea37944Smrgelif test "x$make_lint_lib" != x"no" ; then
2156cea37944Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2157cea37944Smrgfi
215853719b08Smrg
2159cea37944SmrgAC_SUBST(LINTLIB)
2160cea37944SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
216153719b08Smrg
2162cea37944Smrg]) # XORG_LINT_LIBRARY
216353719b08Smrg
2164cea37944Smrg# XORG_CWARNFLAGS
2165cea37944Smrg# ---------------
2166cea37944Smrg# Minimum version: 1.2.0
2167b1297603Smrg#
2168cea37944Smrg# Defines CWARNFLAGS to enable C compiler warnings.
2169cea37944Smrg#
2170cea37944SmrgAC_DEFUN([XORG_CWARNFLAGS], [
2171cea37944SmrgAC_REQUIRE([AC_PROG_CC_C99])
2172cea37944Smrgif  test "x$GCC" = xyes ; then
2173cea37944Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
2174cea37944Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
2175cea37944Smrg-Wbad-function-cast -Wformat=2"
2176cea37944Smrg    case `$CC -dumpversion` in
2177cea37944Smrg    3.4.* | 4.*)
2178cea37944Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
2179cea37944Smrg	;;
2180cea37944Smrg    esac
2181cea37944Smrgelse
2182cea37944Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2183cea37944Smrg    if test "x$SUNCC" = "xyes"; then
2184cea37944Smrg	CWARNFLAGS="-v"
2185cea37944Smrg    fi
2186cea37944Smrgfi
2187cea37944SmrgAC_SUBST(CWARNFLAGS)
2188cea37944Smrg]) # XORG_CWARNFLAGS
218953719b08Smrg
2190cea37944Smrg# XORG_STRICT_OPTION
2191cea37944Smrg# -----------------------
2192cea37944Smrg# Minimum version: 1.3.0
2193cea37944Smrg#
2194cea37944Smrg# Add configure option to enable strict compilation
2195cea37944SmrgAC_DEFUN([XORG_STRICT_OPTION], [
2196cea37944Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
2197cea37944SmrgAC_REQUIRE([AC_PROG_CC_C99])
2198cea37944SmrgAC_REQUIRE([XORG_CWARNFLAGS])
219953719b08Smrg
2200cea37944SmrgAC_ARG_ENABLE(strict-compilation,
2201cea37944Smrg			  AS_HELP_STRING([--enable-strict-compilation],
2202cea37944Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
2203cea37944Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2204cea37944Smrgif test "x$STRICT_COMPILE" = "xyes"; then
2205cea37944Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2206cea37944Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2207cea37944Smrg	if test "x$GCC" = xyes ; then
2208cea37944Smrg		STRICT_CFLAGS="-pedantic -Werror"
2209cea37944Smrg	elif test "x$SUNCC" = "xyes"; then
2210cea37944Smrg		STRICT_CFLAGS="-errwarn"
2211cea37944Smrg    elif test "x$INTELCC" = "xyes"; then
2212cea37944Smrg		STRICT_CFLAGS="-Werror"
2213cea37944Smrg	fi
2214cea37944Smrgfi
2215cea37944SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
2216cea37944SmrgAC_SUBST([CWARNFLAGS])
2217cea37944Smrg]) # XORG_STRICT_OPTION
2218cea37944Smrg
2219cea37944Smrg# XORG_DEFAULT_OPTIONS
222053719b08Smrg# --------------------
2221cea37944Smrg# Minimum version: 1.3.0
2222b1297603Smrg#
2223cea37944Smrg# Defines default options for X.Org modules.
2224d3263506Smrg#
2225cea37944SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
2226cea37944SmrgAC_REQUIRE([AC_PROG_INSTALL])
2227cea37944SmrgXORG_CWARNFLAGS
2228cea37944SmrgXORG_STRICT_OPTION
2229cea37944SmrgXORG_RELEASE_VERSION
2230cea37944SmrgXORG_CHANGELOG
2231cea37944SmrgXORG_INSTALL
2232cea37944SmrgXORG_MANPAGE_SECTIONS
2233cea37944Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2234cea37944Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2235cea37944Smrg]) # XORG_DEFAULT_OPTIONS
223653719b08Smrg
2237cea37944Smrg# XORG_INSTALL()
2238cea37944Smrg# ----------------
2239cea37944Smrg# Minimum version: 1.4.0
2240cea37944Smrg#
2241cea37944Smrg# Defines the variable INSTALL_CMD as the command to copy
2242cea37944Smrg# INSTALL from $prefix/share/util-macros.
2243cea37944Smrg#
2244cea37944SmrgAC_DEFUN([XORG_INSTALL], [
2245cea37944SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2246cea37944Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2247cea37944SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2248cea37944Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2249cea37944Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
2250cea37944Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
2251cea37944SmrgAC_SUBST([INSTALL_CMD])
2252cea37944Smrg]) # XORG_INSTALL
2253cea37944Smrgdnl Copyright 2005 Red Hat, Inc
2254cea37944Smrgdnl
2255cea37944Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
2256cea37944Smrgdnl documentation for any purpose is hereby granted without fee, provided that
2257cea37944Smrgdnl the above copyright notice appear in all copies and that both that
2258cea37944Smrgdnl copyright notice and this permission notice appear in supporting
2259cea37944Smrgdnl documentation.
2260cea37944Smrgdnl
2261cea37944Smrgdnl The above copyright notice and this permission notice shall be included
2262cea37944Smrgdnl in all copies or substantial portions of the Software.
2263cea37944Smrgdnl
2264cea37944Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2265cea37944Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2266cea37944Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2267cea37944Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2268cea37944Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2269cea37944Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2270cea37944Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
2271cea37944Smrgdnl
2272cea37944Smrgdnl Except as contained in this notice, the name of the copyright holders shall
2273cea37944Smrgdnl not be used in advertising or otherwise to promote the sale, use or
2274cea37944Smrgdnl other dealings in this Software without prior written authorization
2275cea37944Smrgdnl from the copyright holders.
2276cea37944Smrgdnl
227753719b08Smrg
2278cea37944Smrg# XORG_RELEASE_VERSION
2279cea37944Smrg# --------------------
2280cea37944Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2281cea37944Smrg 
2282cea37944SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
2283cea37944Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2284cea37944Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2285cea37944Smrg		[Major version of this package])
2286cea37944Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2287cea37944Smrg	if test "x$PVM" = "x"; then
2288cea37944Smrg		PVM="0"
2289cea37944Smrg	fi
2290cea37944Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2291cea37944Smrg		[$PVM],
2292cea37944Smrg		[Minor version of this package])
2293cea37944Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2294cea37944Smrg	if test "x$PVP" = "x"; then
2295cea37944Smrg		PVP="0"
2296cea37944Smrg	fi
2297cea37944Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2298cea37944Smrg		[$PVP],
2299cea37944Smrg		[Patch version of this package])
2300cea37944Smrg])
230153719b08Smrg
2302cea37944Smrg# XORG_CHANGELOG()
2303cea37944Smrg# ----------------
2304cea37944Smrg# Minimum version: 1.2.0
2305cea37944Smrg#
2306cea37944Smrg# Defines the variable CHANGELOG_CMD as the command to generate
2307cea37944Smrg# ChangeLog from git.
2308cea37944Smrg#
2309cea37944Smrg#
2310cea37944SmrgAC_DEFUN([XORG_CHANGELOG], [
2311cea37944SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
2312cea37944Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2313cea37944Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2314cea37944Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
2315cea37944SmrgAC_SUBST([CHANGELOG_CMD])
2316cea37944Smrg]) # XORG_CHANGELOG
2317b1297603Smrg
2318