aclocal.m4 revision c95b42ba
1c95b42baSmrg# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
2c95b42baSmrg
3c95b42baSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4c95b42baSmrg# 2005  Free Software Foundation, Inc.
5c95b42baSmrg# This file is free software; the Free Software Foundation
6c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
7c95b42baSmrg# with or without modifications, as long as this notice is preserved.
8c95b42baSmrg
9c95b42baSmrg# This program is distributed in the hope that it will be useful,
10c95b42baSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11c95b42baSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12c95b42baSmrg# PARTICULAR PURPOSE.
13c95b42baSmrg
14c95b42baSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
15c95b42baSmrg# 
16c95b42baSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
17c95b42baSmrg#
18c95b42baSmrg# This program is free software; you can redistribute it and/or modify
19c95b42baSmrg# it under the terms of the GNU General Public License as published by
20c95b42baSmrg# the Free Software Foundation; either version 2 of the License, or
21c95b42baSmrg# (at your option) any later version.
22c95b42baSmrg#
23c95b42baSmrg# This program is distributed in the hope that it will be useful, but
24c95b42baSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
25c95b42baSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
26c95b42baSmrg# General Public License for more details.
27c95b42baSmrg#
28c95b42baSmrg# You should have received a copy of the GNU General Public License
29c95b42baSmrg# along with this program; if not, write to the Free Software
30c95b42baSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31c95b42baSmrg#
32c95b42baSmrg# As a special exception to the GNU General Public License, if you
33c95b42baSmrg# distribute this file as part of a program that contains a
34c95b42baSmrg# configuration script generated by Autoconf, you may include it under
35c95b42baSmrg# the same distribution terms that you use for the rest of that program.
36c95b42baSmrg
37c95b42baSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
38c95b42baSmrg# ----------------------------------
39c95b42baSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
40c95b42baSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
41c95b42baSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
42c95b42baSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
43c95b42baSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
44c95b42baSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
45c95b42baSmrgfi
46c95b42baSmrgif test -n "$PKG_CONFIG"; then
47c95b42baSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
48c95b42baSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
49c95b42baSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
50c95b42baSmrg		AC_MSG_RESULT([yes])
51c95b42baSmrg	else
52c95b42baSmrg		AC_MSG_RESULT([no])
53c95b42baSmrg		PKG_CONFIG=""
54c95b42baSmrg	fi
55c95b42baSmrg		
56c95b42baSmrgfi[]dnl
57c95b42baSmrg])# PKG_PROG_PKG_CONFIG
58c95b42baSmrg
59c95b42baSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
60c95b42baSmrg#
61c95b42baSmrg# Check to see whether a particular set of modules exists.  Similar
62c95b42baSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
63c95b42baSmrg#
64c95b42baSmrg#
65c95b42baSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
66c95b42baSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
67c95b42baSmrg# PKG_CHECK_EXISTS manually
68c95b42baSmrg# --------------------------------------------------------------
69c95b42baSmrgAC_DEFUN([PKG_CHECK_EXISTS],
70c95b42baSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
71c95b42baSmrgif test -n "$PKG_CONFIG" && \
72c95b42baSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
73c95b42baSmrg  m4_ifval([$2], [$2], [:])
74c95b42baSmrgm4_ifvaln([$3], [else
75c95b42baSmrg  $3])dnl
76c95b42baSmrgfi])
77c95b42baSmrg
78c95b42baSmrg
79c95b42baSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
80c95b42baSmrg# ---------------------------------------------
81c95b42baSmrgm4_define([_PKG_CONFIG],
82c95b42baSmrg[if test -n "$PKG_CONFIG"; then
83c95b42baSmrg    if test -n "$$1"; then
84c95b42baSmrg        pkg_cv_[]$1="$$1"
85c95b42baSmrg    else
86c95b42baSmrg        PKG_CHECK_EXISTS([$3],
87c95b42baSmrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
88c95b42baSmrg			 [pkg_failed=yes])
89c95b42baSmrg    fi
90c95b42baSmrgelse
91c95b42baSmrg	pkg_failed=untried
92c95b42baSmrgfi[]dnl
93c95b42baSmrg])# _PKG_CONFIG
94c95b42baSmrg
95c95b42baSmrg# _PKG_SHORT_ERRORS_SUPPORTED
96c95b42baSmrg# -----------------------------
97c95b42baSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
98c95b42baSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
99c95b42baSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
100c95b42baSmrg        _pkg_short_errors_supported=yes
101c95b42baSmrgelse
102c95b42baSmrg        _pkg_short_errors_supported=no
103c95b42baSmrgfi[]dnl
104c95b42baSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
105c95b42baSmrg
106c95b42baSmrg
107c95b42baSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
108c95b42baSmrg# [ACTION-IF-NOT-FOUND])
109c95b42baSmrg#
110c95b42baSmrg#
111c95b42baSmrg# Note that if there is a possibility the first call to
112c95b42baSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
113c95b42baSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
114c95b42baSmrg#
115c95b42baSmrg#
116c95b42baSmrg# --------------------------------------------------------------
117c95b42baSmrgAC_DEFUN([PKG_CHECK_MODULES],
118c95b42baSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
119c95b42baSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
120c95b42baSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
121c95b42baSmrg
122c95b42baSmrgpkg_failed=no
123c95b42baSmrgAC_MSG_CHECKING([for $1])
124c95b42baSmrg
125c95b42baSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
126c95b42baSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
127c95b42baSmrg
128c95b42baSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
129c95b42baSmrgand $1[]_LIBS to avoid the need to call pkg-config.
130c95b42baSmrgSee the pkg-config man page for more details.])
131c95b42baSmrg
132c95b42baSmrgif test $pkg_failed = yes; then
133c95b42baSmrg        _PKG_SHORT_ERRORS_SUPPORTED
134c95b42baSmrg        if test $_pkg_short_errors_supported = yes; then
135c95b42baSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
136c95b42baSmrg        else 
137c95b42baSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
138c95b42baSmrg        fi
139c95b42baSmrg	# Put the nasty error message in config.log where it belongs
140c95b42baSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
141c95b42baSmrg
142c95b42baSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
143c95b42baSmrg[Package requirements ($2) were not met:
144c95b42baSmrg
145c95b42baSmrg$$1_PKG_ERRORS
146c95b42baSmrg
147c95b42baSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
148c95b42baSmrginstalled software in a non-standard prefix.
149c95b42baSmrg
150c95b42baSmrg_PKG_TEXT
151c95b42baSmrg])],
152c95b42baSmrg		[AC_MSG_RESULT([no])
153c95b42baSmrg                $4])
154c95b42baSmrgelif test $pkg_failed = untried; then
155c95b42baSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
156c95b42baSmrg[The pkg-config script could not be found or is too old.  Make sure it
157c95b42baSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
158c95b42baSmrgpath to pkg-config.
159c95b42baSmrg
160c95b42baSmrg_PKG_TEXT
161c95b42baSmrg
162c95b42baSmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
163c95b42baSmrg		[$4])
164c95b42baSmrgelse
165c95b42baSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
166c95b42baSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
167c95b42baSmrg        AC_MSG_RESULT([yes])
168c95b42baSmrg	ifelse([$3], , :, [$3])
169c95b42baSmrgfi[]dnl
170c95b42baSmrg])# PKG_CHECK_MODULES
171c95b42baSmrg
172c95b42baSmrg# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
173c95b42baSmrg#
174c95b42baSmrg# This file is free software; the Free Software Foundation
175c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
176c95b42baSmrg# with or without modifications, as long as this notice is preserved.
177c95b42baSmrg
178c95b42baSmrg# AM_AUTOMAKE_VERSION(VERSION)
179c95b42baSmrg# ----------------------------
180c95b42baSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
181c95b42baSmrg# generated from the m4 files accompanying Automake X.Y.
182c95b42baSmrgAC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
183c95b42baSmrg
184c95b42baSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
185c95b42baSmrg# -------------------------------
186c95b42baSmrg# Call AM_AUTOMAKE_VERSION so it can be traced.
187c95b42baSmrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
188c95b42baSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
189c95b42baSmrg	 [AM_AUTOMAKE_VERSION([1.9.6])])
190c95b42baSmrg
191c95b42baSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
192c95b42baSmrg
193c95b42baSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
194c95b42baSmrg#
195c95b42baSmrg# This file is free software; the Free Software Foundation
196c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
197c95b42baSmrg# with or without modifications, as long as this notice is preserved.
198c95b42baSmrg
199c95b42baSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
200c95b42baSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
201c95b42baSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
202c95b42baSmrg#
203c95b42baSmrg# Of course, Automake must honor this variable whenever it calls a
204c95b42baSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
205c95b42baSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
206c95b42baSmrg# depending on how configure is run.  This is pretty annoying, since
207c95b42baSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
208c95b42baSmrg# source directory, any form will work fine, but in subdirectories a
209c95b42baSmrg# relative path needs to be adjusted first.
210c95b42baSmrg#
211c95b42baSmrg# $ac_aux_dir/missing
212c95b42baSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
213c95b42baSmrg# $top_srcdir/$ac_aux_dir/missing
214c95b42baSmrg#    fails if $ac_aux_dir is absolute,
215c95b42baSmrg#    fails when called from a subdirectory in a VPATH build with
216c95b42baSmrg#          a relative $ac_aux_dir
217c95b42baSmrg#
218c95b42baSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
219c95b42baSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
220c95b42baSmrg# harmless because $srcdir is `.', but things will broke when you
221c95b42baSmrg# start a VPATH build or use an absolute $srcdir.
222c95b42baSmrg#
223c95b42baSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
224c95b42baSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
225c95b42baSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
226c95b42baSmrg# and then we would define $MISSING as
227c95b42baSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
228c95b42baSmrg# This will work as long as MISSING is not called from configure, because
229c95b42baSmrg# unfortunately $(top_srcdir) has no meaning in configure.
230c95b42baSmrg# However there are other variables, like CC, which are often used in
231c95b42baSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
232c95b42baSmrg#
233c95b42baSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
234c95b42baSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
235c95b42baSmrg# configured tree to be moved without reconfiguration.
236c95b42baSmrg
237c95b42baSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
238c95b42baSmrg[dnl Rely on autoconf to set up CDPATH properly.
239c95b42baSmrgAC_PREREQ([2.50])dnl
240c95b42baSmrg# expand $ac_aux_dir to an absolute path
241c95b42baSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
242c95b42baSmrg])
243c95b42baSmrg
244c95b42baSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
245c95b42baSmrg
246c95b42baSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
247c95b42baSmrg# Free Software Foundation, Inc.
248c95b42baSmrg#
249c95b42baSmrg# This file is free software; the Free Software Foundation
250c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
251c95b42baSmrg# with or without modifications, as long as this notice is preserved.
252c95b42baSmrg
253c95b42baSmrg# serial 7
254c95b42baSmrg
255c95b42baSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
256c95b42baSmrg# -------------------------------------
257c95b42baSmrg# Define a conditional.
258c95b42baSmrgAC_DEFUN([AM_CONDITIONAL],
259c95b42baSmrg[AC_PREREQ(2.52)dnl
260c95b42baSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
261c95b42baSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
262c95b42baSmrgAC_SUBST([$1_TRUE])
263c95b42baSmrgAC_SUBST([$1_FALSE])
264c95b42baSmrgif $2; then
265c95b42baSmrg  $1_TRUE=
266c95b42baSmrg  $1_FALSE='#'
267c95b42baSmrgelse
268c95b42baSmrg  $1_TRUE='#'
269c95b42baSmrg  $1_FALSE=
270c95b42baSmrgfi
271c95b42baSmrgAC_CONFIG_COMMANDS_PRE(
272c95b42baSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
273c95b42baSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
274c95b42baSmrgUsually this means the macro was only invoked conditionally.]])
275c95b42baSmrgfi])])
276c95b42baSmrg
277c95b42baSmrg
278c95b42baSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
279c95b42baSmrg# Free Software Foundation, Inc.
280c95b42baSmrg#
281c95b42baSmrg# This file is free software; the Free Software Foundation
282c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
283c95b42baSmrg# with or without modifications, as long as this notice is preserved.
284c95b42baSmrg
285c95b42baSmrg# serial 8
286c95b42baSmrg
287c95b42baSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
288c95b42baSmrg# written in clear, in which case automake, when reading aclocal.m4,
289c95b42baSmrg# will think it sees a *use*, and therefore will trigger all it's
290c95b42baSmrg# C support machinery.  Also note that it means that autoscan, seeing
291c95b42baSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
292c95b42baSmrg
293c95b42baSmrg
294c95b42baSmrg# _AM_DEPENDENCIES(NAME)
295c95b42baSmrg# ----------------------
296c95b42baSmrg# See how the compiler implements dependency checking.
297c95b42baSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
298c95b42baSmrg# We try a few techniques and use that to set a single cache variable.
299c95b42baSmrg#
300c95b42baSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
301c95b42baSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
302c95b42baSmrg# dependency, and given that the user is not expected to run this macro,
303c95b42baSmrg# just rely on AC_PROG_CC.
304c95b42baSmrgAC_DEFUN([_AM_DEPENDENCIES],
305c95b42baSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
306c95b42baSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
307c95b42baSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
308c95b42baSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
309c95b42baSmrg
310c95b42baSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
311c95b42baSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
312c95b42baSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
313c95b42baSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
314c95b42baSmrg                   [depcc="$$1"   am_compiler_list=])
315c95b42baSmrg
316c95b42baSmrgAC_CACHE_CHECK([dependency style of $depcc],
317c95b42baSmrg               [am_cv_$1_dependencies_compiler_type],
318c95b42baSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
319c95b42baSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
320c95b42baSmrg  # making bogus files that we don't know about and never remove.  For
321c95b42baSmrg  # instance it was reported that on HP-UX the gcc test will end up
322c95b42baSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
323c95b42baSmrg  # in D'.
324c95b42baSmrg  mkdir conftest.dir
325c95b42baSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
326c95b42baSmrg  # using a relative directory.
327c95b42baSmrg  cp "$am_depcomp" conftest.dir
328c95b42baSmrg  cd conftest.dir
329c95b42baSmrg  # We will build objects and dependencies in a subdirectory because
330c95b42baSmrg  # it helps to detect inapplicable dependency modes.  For instance
331c95b42baSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
332c95b42baSmrg  # side effect of compilation, but ICC will put the dependencies in
333c95b42baSmrg  # the current directory while Tru64 will put them in the object
334c95b42baSmrg  # directory.
335c95b42baSmrg  mkdir sub
336c95b42baSmrg
337c95b42baSmrg  am_cv_$1_dependencies_compiler_type=none
338c95b42baSmrg  if test "$am_compiler_list" = ""; then
339c95b42baSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
340c95b42baSmrg  fi
341c95b42baSmrg  for depmode in $am_compiler_list; do
342c95b42baSmrg    # Setup a source with many dependencies, because some compilers
343c95b42baSmrg    # like to wrap large dependency lists on column 80 (with \), and
344c95b42baSmrg    # we should not choose a depcomp mode which is confused by this.
345c95b42baSmrg    #
346c95b42baSmrg    # We need to recreate these files for each test, as the compiler may
347c95b42baSmrg    # overwrite some of them when testing with obscure command lines.
348c95b42baSmrg    # This happens at least with the AIX C compiler.
349c95b42baSmrg    : > sub/conftest.c
350c95b42baSmrg    for i in 1 2 3 4 5 6; do
351c95b42baSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
352c95b42baSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
353c95b42baSmrg      # Solaris 8's {/usr,}/bin/sh.
354c95b42baSmrg      touch sub/conftst$i.h
355c95b42baSmrg    done
356c95b42baSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
357c95b42baSmrg
358c95b42baSmrg    case $depmode in
359c95b42baSmrg    nosideeffect)
360c95b42baSmrg      # after this tag, mechanisms are not by side-effect, so they'll
361c95b42baSmrg      # only be used when explicitly requested
362c95b42baSmrg      if test "x$enable_dependency_tracking" = xyes; then
363c95b42baSmrg	continue
364c95b42baSmrg      else
365c95b42baSmrg	break
366c95b42baSmrg      fi
367c95b42baSmrg      ;;
368c95b42baSmrg    none) break ;;
369c95b42baSmrg    esac
370c95b42baSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
371c95b42baSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
372c95b42baSmrg    # handle `-M -o', and we need to detect this.
373c95b42baSmrg    if depmode=$depmode \
374c95b42baSmrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
375c95b42baSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
376c95b42baSmrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
377c95b42baSmrg         >/dev/null 2>conftest.err &&
378c95b42baSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
379c95b42baSmrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
380c95b42baSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
381c95b42baSmrg      # icc doesn't choke on unknown options, it will just issue warnings
382c95b42baSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
383c95b42baSmrg      # that says an option was ignored or not supported.
384c95b42baSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
385c95b42baSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
386c95b42baSmrg      # The diagnosis changed in icc 8.0:
387c95b42baSmrg      #   icc: Command line remark: option '-MP' not supported
388c95b42baSmrg      if (grep 'ignoring option' conftest.err ||
389c95b42baSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
390c95b42baSmrg        am_cv_$1_dependencies_compiler_type=$depmode
391c95b42baSmrg        break
392c95b42baSmrg      fi
393c95b42baSmrg    fi
394c95b42baSmrg  done
395c95b42baSmrg
396c95b42baSmrg  cd ..
397c95b42baSmrg  rm -rf conftest.dir
398c95b42baSmrgelse
399c95b42baSmrg  am_cv_$1_dependencies_compiler_type=none
400c95b42baSmrgfi
401c95b42baSmrg])
402c95b42baSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
403c95b42baSmrgAM_CONDITIONAL([am__fastdep$1], [
404c95b42baSmrg  test "x$enable_dependency_tracking" != xno \
405c95b42baSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
406c95b42baSmrg])
407c95b42baSmrg
408c95b42baSmrg
409c95b42baSmrg# AM_SET_DEPDIR
410c95b42baSmrg# -------------
411c95b42baSmrg# Choose a directory name for dependency files.
412c95b42baSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
413c95b42baSmrgAC_DEFUN([AM_SET_DEPDIR],
414c95b42baSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
415c95b42baSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
416c95b42baSmrg])
417c95b42baSmrg
418c95b42baSmrg
419c95b42baSmrg# AM_DEP_TRACK
420c95b42baSmrg# ------------
421c95b42baSmrgAC_DEFUN([AM_DEP_TRACK],
422c95b42baSmrg[AC_ARG_ENABLE(dependency-tracking,
423c95b42baSmrg[  --disable-dependency-tracking  speeds up one-time build
424c95b42baSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
425c95b42baSmrgif test "x$enable_dependency_tracking" != xno; then
426c95b42baSmrg  am_depcomp="$ac_aux_dir/depcomp"
427c95b42baSmrg  AMDEPBACKSLASH='\'
428c95b42baSmrgfi
429c95b42baSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
430c95b42baSmrgAC_SUBST([AMDEPBACKSLASH])
431c95b42baSmrg])
432c95b42baSmrg
433c95b42baSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
434c95b42baSmrg
435c95b42baSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
436c95b42baSmrg# Free Software Foundation, Inc.
437c95b42baSmrg#
438c95b42baSmrg# This file is free software; the Free Software Foundation
439c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
440c95b42baSmrg# with or without modifications, as long as this notice is preserved.
441c95b42baSmrg
442c95b42baSmrg#serial 3
443c95b42baSmrg
444c95b42baSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
445c95b42baSmrg# ------------------------------
446c95b42baSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
447c95b42baSmrg[for mf in $CONFIG_FILES; do
448c95b42baSmrg  # Strip MF so we end up with the name of the file.
449c95b42baSmrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
450c95b42baSmrg  # Check whether this is an Automake generated Makefile or not.
451c95b42baSmrg  # We used to match only the files named `Makefile.in', but
452c95b42baSmrg  # some people rename them; so instead we look at the file content.
453c95b42baSmrg  # Grep'ing the first line is not enough: some people post-process
454c95b42baSmrg  # each Makefile.in and add a new line on top of each file to say so.
455c95b42baSmrg  # So let's grep whole file.
456c95b42baSmrg  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
457c95b42baSmrg    dirpart=`AS_DIRNAME("$mf")`
458c95b42baSmrg  else
459c95b42baSmrg    continue
460c95b42baSmrg  fi
461c95b42baSmrg  # Extract the definition of DEPDIR, am__include, and am__quote
462c95b42baSmrg  # from the Makefile without running `make'.
463c95b42baSmrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
464c95b42baSmrg  test -z "$DEPDIR" && continue
465c95b42baSmrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
466c95b42baSmrg  test -z "am__include" && continue
467c95b42baSmrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
468c95b42baSmrg  # When using ansi2knr, U may be empty or an underscore; expand it
469c95b42baSmrg  U=`sed -n 's/^U = //p' < "$mf"`
470c95b42baSmrg  # Find all dependency output files, they are included files with
471c95b42baSmrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
472c95b42baSmrg  # simplest approach to changing $(DEPDIR) to its actual value in the
473c95b42baSmrg  # expansion.
474c95b42baSmrg  for file in `sed -n "
475c95b42baSmrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
476c95b42baSmrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
477c95b42baSmrg    # Make sure the directory exists.
478c95b42baSmrg    test -f "$dirpart/$file" && continue
479c95b42baSmrg    fdir=`AS_DIRNAME(["$file"])`
480c95b42baSmrg    AS_MKDIR_P([$dirpart/$fdir])
481c95b42baSmrg    # echo "creating $dirpart/$file"
482c95b42baSmrg    echo '# dummy' > "$dirpart/$file"
483c95b42baSmrg  done
484c95b42baSmrgdone
485c95b42baSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
486c95b42baSmrg
487c95b42baSmrg
488c95b42baSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
489c95b42baSmrg# -----------------------------
490c95b42baSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
491c95b42baSmrg#
492c95b42baSmrg# This code is only required when automatic dependency tracking
493c95b42baSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
494c95b42baSmrg# need in order to bootstrap the dependency handling code.
495c95b42baSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
496c95b42baSmrg[AC_CONFIG_COMMANDS([depfiles],
497c95b42baSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
498c95b42baSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
499c95b42baSmrg])
500c95b42baSmrg
501c95b42baSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
502c95b42baSmrg# Free Software Foundation, Inc.
503c95b42baSmrg#
504c95b42baSmrg# This file is free software; the Free Software Foundation
505c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
506c95b42baSmrg# with or without modifications, as long as this notice is preserved.
507c95b42baSmrg
508c95b42baSmrg# serial 8
509c95b42baSmrg
510c95b42baSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
511c95b42baSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
512c95b42baSmrg
513c95b42baSmrg# Do all the work for Automake.                             -*- Autoconf -*-
514c95b42baSmrg
515c95b42baSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
516c95b42baSmrg# Free Software Foundation, Inc.
517c95b42baSmrg#
518c95b42baSmrg# This file is free software; the Free Software Foundation
519c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
520c95b42baSmrg# with or without modifications, as long as this notice is preserved.
521c95b42baSmrg
522c95b42baSmrg# serial 12
523c95b42baSmrg
524c95b42baSmrg# This macro actually does too much.  Some checks are only needed if
525c95b42baSmrg# your package does certain things.  But this isn't really a big deal.
526c95b42baSmrg
527c95b42baSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
528c95b42baSmrg# AM_INIT_AUTOMAKE([OPTIONS])
529c95b42baSmrg# -----------------------------------------------
530c95b42baSmrg# The call with PACKAGE and VERSION arguments is the old style
531c95b42baSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
532c95b42baSmrg# and VERSION should now be passed to AC_INIT and removed from
533c95b42baSmrg# the call to AM_INIT_AUTOMAKE.
534c95b42baSmrg# We support both call styles for the transition.  After
535c95b42baSmrg# the next Automake release, Autoconf can make the AC_INIT
536c95b42baSmrg# arguments mandatory, and then we can depend on a new Autoconf
537c95b42baSmrg# release and drop the old call support.
538c95b42baSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
539c95b42baSmrg[AC_PREREQ([2.58])dnl
540c95b42baSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
541c95b42baSmrgdnl the ones we care about.
542c95b42baSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
543c95b42baSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
544c95b42baSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
545c95b42baSmrg# test to see if srcdir already configured
546c95b42baSmrgif test "`cd $srcdir && pwd`" != "`pwd`" &&
547c95b42baSmrg   test -f $srcdir/config.status; then
548c95b42baSmrg  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
549c95b42baSmrgfi
550c95b42baSmrg
551c95b42baSmrg# test whether we have cygpath
552c95b42baSmrgif test -z "$CYGPATH_W"; then
553c95b42baSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
554c95b42baSmrg    CYGPATH_W='cygpath -w'
555c95b42baSmrg  else
556c95b42baSmrg    CYGPATH_W=echo
557c95b42baSmrg  fi
558c95b42baSmrgfi
559c95b42baSmrgAC_SUBST([CYGPATH_W])
560c95b42baSmrg
561c95b42baSmrg# Define the identity of the package.
562c95b42baSmrgdnl Distinguish between old-style and new-style calls.
563c95b42baSmrgm4_ifval([$2],
564c95b42baSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
565c95b42baSmrg AC_SUBST([PACKAGE], [$1])dnl
566c95b42baSmrg AC_SUBST([VERSION], [$2])],
567c95b42baSmrg[_AM_SET_OPTIONS([$1])dnl
568c95b42baSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
569c95b42baSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
570c95b42baSmrg
571c95b42baSmrg_AM_IF_OPTION([no-define],,
572c95b42baSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
573c95b42baSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
574c95b42baSmrg
575c95b42baSmrg# Some tools Automake needs.
576c95b42baSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
577c95b42baSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
578c95b42baSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
579c95b42baSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
580c95b42baSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
581c95b42baSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
582c95b42baSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
583c95b42baSmrgAM_PROG_INSTALL_SH
584c95b42baSmrgAM_PROG_INSTALL_STRIP
585c95b42baSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
586c95b42baSmrg# We need awk for the "check" target.  The system "awk" is bad on
587c95b42baSmrg# some platforms.
588c95b42baSmrgAC_REQUIRE([AC_PROG_AWK])dnl
589c95b42baSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
590c95b42baSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
591c95b42baSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
592c95b42baSmrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
593c95b42baSmrg	      		     [_AM_PROG_TAR([v7])])])
594c95b42baSmrg_AM_IF_OPTION([no-dependencies],,
595c95b42baSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
596c95b42baSmrg                  [_AM_DEPENDENCIES(CC)],
597c95b42baSmrg                  [define([AC_PROG_CC],
598c95b42baSmrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
599c95b42baSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
600c95b42baSmrg                  [_AM_DEPENDENCIES(CXX)],
601c95b42baSmrg                  [define([AC_PROG_CXX],
602c95b42baSmrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
603c95b42baSmrg])
604c95b42baSmrg])
605c95b42baSmrg
606c95b42baSmrg
607c95b42baSmrg# When config.status generates a header, we must update the stamp-h file.
608c95b42baSmrg# This file resides in the same directory as the config header
609c95b42baSmrg# that is generated.  The stamp files are numbered to have different names.
610c95b42baSmrg
611c95b42baSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
612c95b42baSmrg# loop where config.status creates the headers, so we can generate
613c95b42baSmrg# our stamp files there.
614c95b42baSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
615c95b42baSmrg[# Compute $1's index in $config_headers.
616c95b42baSmrg_am_stamp_count=1
617c95b42baSmrgfor _am_header in $config_headers :; do
618c95b42baSmrg  case $_am_header in
619c95b42baSmrg    $1 | $1:* )
620c95b42baSmrg      break ;;
621c95b42baSmrg    * )
622c95b42baSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
623c95b42baSmrg  esac
624c95b42baSmrgdone
625c95b42baSmrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
626c95b42baSmrg
627c95b42baSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
628c95b42baSmrg#
629c95b42baSmrg# This file is free software; the Free Software Foundation
630c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
631c95b42baSmrg# with or without modifications, as long as this notice is preserved.
632c95b42baSmrg
633c95b42baSmrg# AM_PROG_INSTALL_SH
634c95b42baSmrg# ------------------
635c95b42baSmrg# Define $install_sh.
636c95b42baSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
637c95b42baSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
638c95b42baSmrginstall_sh=${install_sh-"$am_aux_dir/install-sh"}
639c95b42baSmrgAC_SUBST(install_sh)])
640c95b42baSmrg
641c95b42baSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
642c95b42baSmrg#
643c95b42baSmrg# This file is free software; the Free Software Foundation
644c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
645c95b42baSmrg# with or without modifications, as long as this notice is preserved.
646c95b42baSmrg
647c95b42baSmrg# serial 2
648c95b42baSmrg
649c95b42baSmrg# Check whether the underlying file-system supports filenames
650c95b42baSmrg# with a leading dot.  For instance MS-DOS doesn't.
651c95b42baSmrgAC_DEFUN([AM_SET_LEADING_DOT],
652c95b42baSmrg[rm -rf .tst 2>/dev/null
653c95b42baSmrgmkdir .tst 2>/dev/null
654c95b42baSmrgif test -d .tst; then
655c95b42baSmrg  am__leading_dot=.
656c95b42baSmrgelse
657c95b42baSmrg  am__leading_dot=_
658c95b42baSmrgfi
659c95b42baSmrgrmdir .tst 2>/dev/null
660c95b42baSmrgAC_SUBST([am__leading_dot])])
661c95b42baSmrg
662c95b42baSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
663c95b42baSmrg# From Jim Meyering
664c95b42baSmrg
665c95b42baSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
666c95b42baSmrg# Free Software Foundation, Inc.
667c95b42baSmrg#
668c95b42baSmrg# This file is free software; the Free Software Foundation
669c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
670c95b42baSmrg# with or without modifications, as long as this notice is preserved.
671c95b42baSmrg
672c95b42baSmrg# serial 4
673c95b42baSmrg
674c95b42baSmrgAC_DEFUN([AM_MAINTAINER_MODE],
675c95b42baSmrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
676c95b42baSmrg  dnl maintainer-mode is disabled by default
677c95b42baSmrg  AC_ARG_ENABLE(maintainer-mode,
678c95b42baSmrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
679c95b42baSmrg			  (and sometimes confusing) to the casual installer],
680c95b42baSmrg      USE_MAINTAINER_MODE=$enableval,
681c95b42baSmrg      USE_MAINTAINER_MODE=no)
682c95b42baSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
683c95b42baSmrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
684c95b42baSmrg  MAINT=$MAINTAINER_MODE_TRUE
685c95b42baSmrg  AC_SUBST(MAINT)dnl
686c95b42baSmrg]
687c95b42baSmrg)
688c95b42baSmrg
689c95b42baSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
690c95b42baSmrg
691c95b42baSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
692c95b42baSmrg
693c95b42baSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
694c95b42baSmrg#
695c95b42baSmrg# This file is free software; the Free Software Foundation
696c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
697c95b42baSmrg# with or without modifications, as long as this notice is preserved.
698c95b42baSmrg
699c95b42baSmrg# serial 3
700c95b42baSmrg
701c95b42baSmrg# AM_MAKE_INCLUDE()
702c95b42baSmrg# -----------------
703c95b42baSmrg# Check to see how make treats includes.
704c95b42baSmrgAC_DEFUN([AM_MAKE_INCLUDE],
705c95b42baSmrg[am_make=${MAKE-make}
706c95b42baSmrgcat > confinc << 'END'
707c95b42baSmrgam__doit:
708c95b42baSmrg	@echo done
709c95b42baSmrg.PHONY: am__doit
710c95b42baSmrgEND
711c95b42baSmrg# If we don't find an include directive, just comment out the code.
712c95b42baSmrgAC_MSG_CHECKING([for style of include used by $am_make])
713c95b42baSmrgam__include="#"
714c95b42baSmrgam__quote=
715c95b42baSmrg_am_result=none
716c95b42baSmrg# First try GNU make style include.
717c95b42baSmrgecho "include confinc" > confmf
718c95b42baSmrg# We grep out `Entering directory' and `Leaving directory'
719c95b42baSmrg# messages which can occur if `w' ends up in MAKEFLAGS.
720c95b42baSmrg# In particular we don't look at `^make:' because GNU make might
721c95b42baSmrg# be invoked under some other name (usually "gmake"), in which
722c95b42baSmrg# case it prints its new name instead of `make'.
723c95b42baSmrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
724c95b42baSmrg   am__include=include
725c95b42baSmrg   am__quote=
726c95b42baSmrg   _am_result=GNU
727c95b42baSmrgfi
728c95b42baSmrg# Now try BSD make style include.
729c95b42baSmrgif test "$am__include" = "#"; then
730c95b42baSmrg   echo '.include "confinc"' > confmf
731c95b42baSmrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
732c95b42baSmrg      am__include=.include
733c95b42baSmrg      am__quote="\""
734c95b42baSmrg      _am_result=BSD
735c95b42baSmrg   fi
736c95b42baSmrgfi
737c95b42baSmrgAC_SUBST([am__include])
738c95b42baSmrgAC_SUBST([am__quote])
739c95b42baSmrgAC_MSG_RESULT([$_am_result])
740c95b42baSmrgrm -f confinc confmf
741c95b42baSmrg])
742c95b42baSmrg
743c95b42baSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
744c95b42baSmrg
745c95b42baSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
746c95b42baSmrg# Free Software Foundation, Inc.
747c95b42baSmrg#
748c95b42baSmrg# This file is free software; the Free Software Foundation
749c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
750c95b42baSmrg# with or without modifications, as long as this notice is preserved.
751c95b42baSmrg
752c95b42baSmrg# serial 4
753c95b42baSmrg
754c95b42baSmrg# AM_MISSING_PROG(NAME, PROGRAM)
755c95b42baSmrg# ------------------------------
756c95b42baSmrgAC_DEFUN([AM_MISSING_PROG],
757c95b42baSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
758c95b42baSmrg$1=${$1-"${am_missing_run}$2"}
759c95b42baSmrgAC_SUBST($1)])
760c95b42baSmrg
761c95b42baSmrg
762c95b42baSmrg# AM_MISSING_HAS_RUN
763c95b42baSmrg# ------------------
764c95b42baSmrg# Define MISSING if not defined so far and test if it supports --run.
765c95b42baSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
766c95b42baSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
767c95b42baSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
768c95b42baSmrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
769c95b42baSmrg# Use eval to expand $SHELL
770c95b42baSmrgif eval "$MISSING --run true"; then
771c95b42baSmrg  am_missing_run="$MISSING --run "
772c95b42baSmrgelse
773c95b42baSmrg  am_missing_run=
774c95b42baSmrg  AC_MSG_WARN([`missing' script is too old or missing])
775c95b42baSmrgfi
776c95b42baSmrg])
777c95b42baSmrg
778c95b42baSmrg# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
779c95b42baSmrg#
780c95b42baSmrg# This file is free software; the Free Software Foundation
781c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
782c95b42baSmrg# with or without modifications, as long as this notice is preserved.
783c95b42baSmrg
784c95b42baSmrg# AM_PROG_MKDIR_P
785c95b42baSmrg# ---------------
786c95b42baSmrg# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
787c95b42baSmrg#
788c95b42baSmrg# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
789c95b42baSmrg# created by `make install' are always world readable, even if the
790c95b42baSmrg# installer happens to have an overly restrictive umask (e.g. 077).
791c95b42baSmrg# This was a mistake.  There are at least two reasons why we must not
792c95b42baSmrg# use `-m 0755':
793c95b42baSmrg#   - it causes special bits like SGID to be ignored,
794c95b42baSmrg#   - it may be too restrictive (some setups expect 775 directories).
795c95b42baSmrg#
796c95b42baSmrg# Do not use -m 0755 and let people choose whatever they expect by
797c95b42baSmrg# setting umask.
798c95b42baSmrg#
799c95b42baSmrg# We cannot accept any implementation of `mkdir' that recognizes `-p'.
800c95b42baSmrg# Some implementations (such as Solaris 8's) are not thread-safe: if a
801c95b42baSmrg# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
802c95b42baSmrg# concurrently, both version can detect that a/ is missing, but only
803c95b42baSmrg# one can create it and the other will error out.  Consequently we
804c95b42baSmrg# restrict ourselves to GNU make (using the --version option ensures
805c95b42baSmrg# this.)
806c95b42baSmrgAC_DEFUN([AM_PROG_MKDIR_P],
807c95b42baSmrg[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
808c95b42baSmrg  # We used to keeping the `.' as first argument, in order to
809c95b42baSmrg  # allow $(mkdir_p) to be used without argument.  As in
810c95b42baSmrg  #   $(mkdir_p) $(somedir)
811c95b42baSmrg  # where $(somedir) is conditionally defined.  However this is wrong
812c95b42baSmrg  # for two reasons:
813c95b42baSmrg  #  1. if the package is installed by a user who cannot write `.'
814c95b42baSmrg  #     make install will fail,
815c95b42baSmrg  #  2. the above comment should most certainly read
816c95b42baSmrg  #     $(mkdir_p) $(DESTDIR)$(somedir)
817c95b42baSmrg  #     so it does not work when $(somedir) is undefined and
818c95b42baSmrg  #     $(DESTDIR) is not.
819c95b42baSmrg  #  To support the latter case, we have to write
820c95b42baSmrg  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
821c95b42baSmrg  #  so the `.' trick is pointless.
822c95b42baSmrg  mkdir_p='mkdir -p --'
823c95b42baSmrgelse
824c95b42baSmrg  # On NextStep and OpenStep, the `mkdir' command does not
825c95b42baSmrg  # recognize any option.  It will interpret all options as
826c95b42baSmrg  # directories to create, and then abort because `.' already
827c95b42baSmrg  # exists.
828c95b42baSmrg  for d in ./-p ./--version;
829c95b42baSmrg  do
830c95b42baSmrg    test -d $d && rmdir $d
831c95b42baSmrg  done
832c95b42baSmrg  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
833c95b42baSmrg  if test -f "$ac_aux_dir/mkinstalldirs"; then
834c95b42baSmrg    mkdir_p='$(mkinstalldirs)'
835c95b42baSmrg  else
836c95b42baSmrg    mkdir_p='$(SHELL) $(install_sh) -d'
837c95b42baSmrg  fi
838c95b42baSmrgfi
839c95b42baSmrgAC_SUBST([mkdir_p])])
840c95b42baSmrg
841c95b42baSmrg# Helper functions for option handling.                     -*- Autoconf -*-
842c95b42baSmrg
843c95b42baSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
844c95b42baSmrg#
845c95b42baSmrg# This file is free software; the Free Software Foundation
846c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
847c95b42baSmrg# with or without modifications, as long as this notice is preserved.
848c95b42baSmrg
849c95b42baSmrg# serial 3
850c95b42baSmrg
851c95b42baSmrg# _AM_MANGLE_OPTION(NAME)
852c95b42baSmrg# -----------------------
853c95b42baSmrgAC_DEFUN([_AM_MANGLE_OPTION],
854c95b42baSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
855c95b42baSmrg
856c95b42baSmrg# _AM_SET_OPTION(NAME)
857c95b42baSmrg# ------------------------------
858c95b42baSmrg# Set option NAME.  Presently that only means defining a flag for this option.
859c95b42baSmrgAC_DEFUN([_AM_SET_OPTION],
860c95b42baSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
861c95b42baSmrg
862c95b42baSmrg# _AM_SET_OPTIONS(OPTIONS)
863c95b42baSmrg# ----------------------------------
864c95b42baSmrg# OPTIONS is a space-separated list of Automake options.
865c95b42baSmrgAC_DEFUN([_AM_SET_OPTIONS],
866c95b42baSmrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
867c95b42baSmrg
868c95b42baSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
869c95b42baSmrg# -------------------------------------------
870c95b42baSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
871c95b42baSmrgAC_DEFUN([_AM_IF_OPTION],
872c95b42baSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
873c95b42baSmrg
874c95b42baSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
875c95b42baSmrg
876c95b42baSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
877c95b42baSmrg# Free Software Foundation, Inc.
878c95b42baSmrg#
879c95b42baSmrg# This file is free software; the Free Software Foundation
880c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
881c95b42baSmrg# with or without modifications, as long as this notice is preserved.
882c95b42baSmrg
883c95b42baSmrg# serial 4
884c95b42baSmrg
885c95b42baSmrg# AM_SANITY_CHECK
886c95b42baSmrg# ---------------
887c95b42baSmrgAC_DEFUN([AM_SANITY_CHECK],
888c95b42baSmrg[AC_MSG_CHECKING([whether build environment is sane])
889c95b42baSmrg# Just in case
890c95b42baSmrgsleep 1
891c95b42baSmrgecho timestamp > conftest.file
892c95b42baSmrg# Do `set' in a subshell so we don't clobber the current shell's
893c95b42baSmrg# arguments.  Must try -L first in case configure is actually a
894c95b42baSmrg# symlink; some systems play weird games with the mod time of symlinks
895c95b42baSmrg# (eg FreeBSD returns the mod time of the symlink's containing
896c95b42baSmrg# directory).
897c95b42baSmrgif (
898c95b42baSmrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
899c95b42baSmrg   if test "$[*]" = "X"; then
900c95b42baSmrg      # -L didn't work.
901c95b42baSmrg      set X `ls -t $srcdir/configure conftest.file`
902c95b42baSmrg   fi
903c95b42baSmrg   rm -f conftest.file
904c95b42baSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
905c95b42baSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
906c95b42baSmrg
907c95b42baSmrg      # If neither matched, then we have a broken ls.  This can happen
908c95b42baSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
909c95b42baSmrg      # broken ls alias from the environment.  This has actually
910c95b42baSmrg      # happened.  Such a system could not be considered "sane".
911c95b42baSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
912c95b42baSmrgalias in your environment])
913c95b42baSmrg   fi
914c95b42baSmrg
915c95b42baSmrg   test "$[2]" = conftest.file
916c95b42baSmrg   )
917c95b42baSmrgthen
918c95b42baSmrg   # Ok.
919c95b42baSmrg   :
920c95b42baSmrgelse
921c95b42baSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
922c95b42baSmrgCheck your system clock])
923c95b42baSmrgfi
924c95b42baSmrgAC_MSG_RESULT(yes)])
925c95b42baSmrg
926c95b42baSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
927c95b42baSmrg#
928c95b42baSmrg# This file is free software; the Free Software Foundation
929c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
930c95b42baSmrg# with or without modifications, as long as this notice is preserved.
931c95b42baSmrg
932c95b42baSmrg# AM_PROG_INSTALL_STRIP
933c95b42baSmrg# ---------------------
934c95b42baSmrg# One issue with vendor `install' (even GNU) is that you can't
935c95b42baSmrg# specify the program used to strip binaries.  This is especially
936c95b42baSmrg# annoying in cross-compiling environments, where the build's strip
937c95b42baSmrg# is unlikely to handle the host's binaries.
938c95b42baSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
939c95b42baSmrg# always use install-sh in `make install-strip', and initialize
940c95b42baSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
941c95b42baSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
942c95b42baSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
943c95b42baSmrg# Installed binaries are usually stripped using `strip' when the user
944c95b42baSmrg# run `make install-strip'.  However `strip' might not be the right
945c95b42baSmrg# tool to use in cross-compilation environments, therefore Automake
946c95b42baSmrg# will honor the `STRIP' environment variable to overrule this program.
947c95b42baSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
948c95b42baSmrgif test "$cross_compiling" != no; then
949c95b42baSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
950c95b42baSmrgfi
951c95b42baSmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
952c95b42baSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
953c95b42baSmrg
954c95b42baSmrg# Check how to create a tarball.                            -*- Autoconf -*-
955c95b42baSmrg
956c95b42baSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
957c95b42baSmrg#
958c95b42baSmrg# This file is free software; the Free Software Foundation
959c95b42baSmrg# gives unlimited permission to copy and/or distribute it,
960c95b42baSmrg# with or without modifications, as long as this notice is preserved.
961c95b42baSmrg
962c95b42baSmrg# serial 2
963c95b42baSmrg
964c95b42baSmrg# _AM_PROG_TAR(FORMAT)
965c95b42baSmrg# --------------------
966c95b42baSmrg# Check how to create a tarball in format FORMAT.
967c95b42baSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
968c95b42baSmrg#
969c95b42baSmrg# Substitute a variable $(am__tar) that is a command
970c95b42baSmrg# writing to stdout a FORMAT-tarball containing the directory
971c95b42baSmrg# $tardir.
972c95b42baSmrg#     tardir=directory && $(am__tar) > result.tar
973c95b42baSmrg#
974c95b42baSmrg# Substitute a variable $(am__untar) that extract such
975c95b42baSmrg# a tarball read from stdin.
976c95b42baSmrg#     $(am__untar) < result.tar
977c95b42baSmrgAC_DEFUN([_AM_PROG_TAR],
978c95b42baSmrg[# Always define AMTAR for backward compatibility.
979c95b42baSmrgAM_MISSING_PROG([AMTAR], [tar])
980c95b42baSmrgm4_if([$1], [v7],
981c95b42baSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
982c95b42baSmrg     [m4_case([$1], [ustar],, [pax],,
983c95b42baSmrg              [m4_fatal([Unknown tar format])])
984c95b42baSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
985c95b42baSmrg# Loop over all known methods to create a tar archive until one works.
986c95b42baSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
987c95b42baSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
988c95b42baSmrg# Do not fold the above two line into one, because Tru64 sh and
989c95b42baSmrg# Solaris sh will not grok spaces in the rhs of `-'.
990c95b42baSmrgfor _am_tool in $_am_tools
991c95b42baSmrgdo
992c95b42baSmrg  case $_am_tool in
993c95b42baSmrg  gnutar)
994c95b42baSmrg    for _am_tar in tar gnutar gtar;
995c95b42baSmrg    do
996c95b42baSmrg      AM_RUN_LOG([$_am_tar --version]) && break
997c95b42baSmrg    done
998c95b42baSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
999c95b42baSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1000c95b42baSmrg    am__untar="$_am_tar -xf -"
1001c95b42baSmrg    ;;
1002c95b42baSmrg  plaintar)
1003c95b42baSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
1004c95b42baSmrg    # ustar tarball either.
1005c95b42baSmrg    (tar --version) >/dev/null 2>&1 && continue
1006c95b42baSmrg    am__tar='tar chf - "$$tardir"'
1007c95b42baSmrg    am__tar_='tar chf - "$tardir"'
1008c95b42baSmrg    am__untar='tar xf -'
1009c95b42baSmrg    ;;
1010c95b42baSmrg  pax)
1011c95b42baSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
1012c95b42baSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
1013c95b42baSmrg    am__untar='pax -r'
1014c95b42baSmrg    ;;
1015c95b42baSmrg  cpio)
1016c95b42baSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1017c95b42baSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1018c95b42baSmrg    am__untar='cpio -i -H $1 -d'
1019c95b42baSmrg    ;;
1020c95b42baSmrg  none)
1021c95b42baSmrg    am__tar=false
1022c95b42baSmrg    am__tar_=false
1023c95b42baSmrg    am__untar=false
1024c95b42baSmrg    ;;
1025c95b42baSmrg  esac
1026c95b42baSmrg
1027c95b42baSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
1028c95b42baSmrg  # and am__untar set.
1029c95b42baSmrg  test -n "${am_cv_prog_tar_$1}" && break
1030c95b42baSmrg
1031c95b42baSmrg  # tar/untar a dummy directory, and stop if the command works
1032c95b42baSmrg  rm -rf conftest.dir
1033c95b42baSmrg  mkdir conftest.dir
1034c95b42baSmrg  echo GrepMe > conftest.dir/file
1035c95b42baSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1036c95b42baSmrg  rm -rf conftest.dir
1037c95b42baSmrg  if test -s conftest.tar; then
1038c95b42baSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1039c95b42baSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1040c95b42baSmrg  fi
1041c95b42baSmrgdone
1042c95b42baSmrgrm -rf conftest.dir
1043c95b42baSmrg
1044c95b42baSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1045c95b42baSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1046c95b42baSmrgAC_SUBST([am__tar])
1047c95b42baSmrgAC_SUBST([am__untar])
1048c95b42baSmrg]) # _AM_PROG_TAR
1049c95b42baSmrg
1050c95b42baSmrgdnl
1051c95b42baSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1052c95b42baSmrgdnl 
1053c95b42baSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1054c95b42baSmrgdnl copy of this software and associated documentation files (the
1055c95b42baSmrgdnl "Software"), to deal in the Software without restriction, including
1056c95b42baSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
1057c95b42baSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
1058c95b42baSmrgdnl to whom the Software is furnished to do so, provided that the above
1059c95b42baSmrgdnl copyright notice(s) and this permission notice appear in all copies of
1060c95b42baSmrgdnl the Software and that both the above copyright notice(s) and this
1061c95b42baSmrgdnl permission notice appear in supporting documentation.
1062c95b42baSmrgdnl
1063c95b42baSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1064c95b42baSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1065c95b42baSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1066c95b42baSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1067c95b42baSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1068c95b42baSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1069c95b42baSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1070c95b42baSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1071c95b42baSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1072c95b42baSmrgdnl
1073c95b42baSmrgdnl Except as contained in this notice, the name of a copyright holder
1074c95b42baSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
1075c95b42baSmrgdnl or other dealings in this Software without prior written authorization
1076c95b42baSmrgdnl of the copyright holder.
1077c95b42baSmrg
1078c95b42baSmrg# XORG_MACROS_VERSION(required-version)
1079c95b42baSmrg# -------------------------------------
1080c95b42baSmrg# Minimum version: 1.1.0
1081c95b42baSmrg#
1082c95b42baSmrg# If you're using a macro added in Version 1.1 or newer, include this in
1083c95b42baSmrg# your configure.ac with the minimum required version, such as:
1084c95b42baSmrg# XORG_MACROS_VERSION(1.1)
1085c95b42baSmrg#
1086c95b42baSmrg# To force at least a version with this macro defined, also add:
1087c95b42baSmrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1088c95b42baSmrg#
1089c95b42baSmrg#
1090c95b42baSmrg# See the "minimum version" comment for each macro you use to see what 
1091c95b42baSmrg# version you require.
1092c95b42baSmrgAC_DEFUN([XORG_MACROS_VERSION],[
1093c95b42baSmrg	[XORG_MACROS_needed_version=$1
1094c95b42baSmrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
1095c95b42baSmrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
1096c95b42baSmrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
1097c95b42baSmrg	[XORG_MACROS_version=1.1.5
1098c95b42baSmrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
1099c95b42baSmrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
1100c95b42baSmrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
1101c95b42baSmrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
1102c95b42baSmrg	fi
1103c95b42baSmrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
1104c95b42baSmrg		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
1105c95b42baSmrg	fi
1106c95b42baSmrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
1107c95b42baSmrg]) # XORG_MACROS_VERSION
1108c95b42baSmrg
1109c95b42baSmrg# XORG_PROG_RAWCPP()
1110c95b42baSmrg# ------------------
1111c95b42baSmrg# Minimum version: 1.0.0
1112c95b42baSmrg#
1113c95b42baSmrg# Find cpp program and necessary flags for use in pre-processing text files
1114c95b42baSmrg# such as man pages and config files
1115c95b42baSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1116c95b42baSmrgAC_REQUIRE([AC_PROG_CPP])
1117c95b42baSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1118c95b42baSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1119c95b42baSmrg
1120c95b42baSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1121c95b42baSmrg# which is not the best choice for supporting other OS'es, but covers most
1122c95b42baSmrg# of the ones we need for now.
1123c95b42baSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1124c95b42baSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1125c95b42baSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1126c95b42baSmrg	AC_MSG_RESULT([no])
1127c95b42baSmrgelse
1128c95b42baSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1129c95b42baSmrg		RAWCPPFLAGS=-undef
1130c95b42baSmrg		AC_MSG_RESULT([yes])
1131c95b42baSmrg	else
1132c95b42baSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1133c95b42baSmrg	fi
1134c95b42baSmrgfi
1135c95b42baSmrgrm -f conftest.$ac_ext
1136c95b42baSmrg
1137c95b42baSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1138c95b42baSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1139c95b42baSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1140c95b42baSmrg	AC_MSG_RESULT([no])
1141c95b42baSmrgelse
1142c95b42baSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1143c95b42baSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1144c95b42baSmrg		AC_MSG_RESULT([yes])
1145c95b42baSmrg	else
1146c95b42baSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1147c95b42baSmrg	fi
1148c95b42baSmrgfi
1149c95b42baSmrgrm -f conftest.$ac_ext
1150c95b42baSmrgAC_SUBST(RAWCPPFLAGS)
1151c95b42baSmrg]) # XORG_PROG_RAWCPP
1152c95b42baSmrg
1153c95b42baSmrg# XORG_MANPAGE_SECTIONS()
1154c95b42baSmrg# -----------------------
1155c95b42baSmrg# Minimum version: 1.0.0
1156c95b42baSmrg#
1157c95b42baSmrg# Determine which sections man pages go in for the different man page types
1158c95b42baSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1159c95b42baSmrg# Not sure if there's any better way than just hardcoding by OS name.
1160c95b42baSmrg# Override default settings by setting environment variables
1161c95b42baSmrg
1162c95b42baSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1163c95b42baSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1164c95b42baSmrg
1165c95b42baSmrgif test x$APP_MAN_SUFFIX = x    ; then
1166c95b42baSmrg    APP_MAN_SUFFIX=1
1167c95b42baSmrgfi
1168c95b42baSmrgif test x$APP_MAN_DIR = x    ; then
1169c95b42baSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1170c95b42baSmrgfi
1171c95b42baSmrg
1172c95b42baSmrgif test x$LIB_MAN_SUFFIX = x    ; then
1173c95b42baSmrg    LIB_MAN_SUFFIX=3
1174c95b42baSmrgfi
1175c95b42baSmrgif test x$LIB_MAN_DIR = x    ; then
1176c95b42baSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1177c95b42baSmrgfi
1178c95b42baSmrg
1179c95b42baSmrgif test x$FILE_MAN_SUFFIX = x    ; then
1180c95b42baSmrg    case $host_os in
1181c95b42baSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1182c95b42baSmrg	*)		FILE_MAN_SUFFIX=5  ;;
1183c95b42baSmrg    esac
1184c95b42baSmrgfi
1185c95b42baSmrgif test x$FILE_MAN_DIR = x    ; then
1186c95b42baSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1187c95b42baSmrgfi
1188c95b42baSmrg
1189c95b42baSmrgif test x$MISC_MAN_SUFFIX = x    ; then
1190c95b42baSmrg    case $host_os in
1191c95b42baSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1192c95b42baSmrg	*)		MISC_MAN_SUFFIX=7  ;;
1193c95b42baSmrg    esac
1194c95b42baSmrgfi
1195c95b42baSmrgif test x$MISC_MAN_DIR = x    ; then
1196c95b42baSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1197c95b42baSmrgfi
1198c95b42baSmrg
1199c95b42baSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1200c95b42baSmrg    case $host_os in
1201c95b42baSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1202c95b42baSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1203c95b42baSmrg    esac
1204c95b42baSmrgfi
1205c95b42baSmrgif test x$DRIVER_MAN_DIR = x    ; then
1206c95b42baSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1207c95b42baSmrgfi
1208c95b42baSmrg
1209c95b42baSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1210c95b42baSmrg    case $host_os in
1211c95b42baSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1212c95b42baSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1213c95b42baSmrg    esac
1214c95b42baSmrgfi
1215c95b42baSmrgif test x$ADMIN_MAN_DIR = x    ; then
1216c95b42baSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1217c95b42baSmrgfi
1218c95b42baSmrg
1219c95b42baSmrg
1220c95b42baSmrgAC_SUBST([APP_MAN_SUFFIX])
1221c95b42baSmrgAC_SUBST([LIB_MAN_SUFFIX])
1222c95b42baSmrgAC_SUBST([FILE_MAN_SUFFIX])
1223c95b42baSmrgAC_SUBST([MISC_MAN_SUFFIX])
1224c95b42baSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1225c95b42baSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1226c95b42baSmrgAC_SUBST([APP_MAN_DIR])
1227c95b42baSmrgAC_SUBST([LIB_MAN_DIR])
1228c95b42baSmrgAC_SUBST([FILE_MAN_DIR])
1229c95b42baSmrgAC_SUBST([MISC_MAN_DIR])
1230c95b42baSmrgAC_SUBST([DRIVER_MAN_DIR])
1231c95b42baSmrgAC_SUBST([ADMIN_MAN_DIR])
1232c95b42baSmrg]) # XORG_MANPAGE_SECTIONS
1233c95b42baSmrg
1234c95b42baSmrg# XORG_CHECK_LINUXDOC
1235c95b42baSmrg# -------------------
1236c95b42baSmrg# Minimum version: 1.0.0
1237c95b42baSmrg#
1238c95b42baSmrg# Defines the variable MAKE_TEXT if the necessary tools and
1239c95b42baSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1240c95b42baSmrg# Whether or not the necessary tools and files are found can be checked
1241c95b42baSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1242c95b42baSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1243c95b42baSmrgXORG_SGML_PATH=$prefix/share/sgml
1244c95b42baSmrgHAVE_DEFS_ENT=
1245c95b42baSmrg
1246c95b42baSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1247c95b42baSmrg
1248c95b42baSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1249c95b42baSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1250c95b42baSmrg
1251c95b42baSmrgAC_MSG_CHECKING([Whether to build documentation])
1252c95b42baSmrg
1253c95b42baSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1254c95b42baSmrg   BUILDDOC=yes
1255c95b42baSmrgelse
1256c95b42baSmrg   BUILDDOC=no
1257c95b42baSmrgfi
1258c95b42baSmrg
1259c95b42baSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1260c95b42baSmrg
1261c95b42baSmrgAC_MSG_RESULT([$BUILDDOC])
1262c95b42baSmrg
1263c95b42baSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1264c95b42baSmrg
1265c95b42baSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1266c95b42baSmrg   BUILDPDFDOC=yes
1267c95b42baSmrgelse
1268c95b42baSmrg   BUILDPDFDOC=no
1269c95b42baSmrgfi
1270c95b42baSmrg
1271c95b42baSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1272c95b42baSmrg
1273c95b42baSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1274c95b42baSmrg
1275c95b42baSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1276c95b42baSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1277c95b42baSmrgMAKE_PDF="$PS2PDF"
1278c95b42baSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1279c95b42baSmrg
1280c95b42baSmrgAC_SUBST(MAKE_TEXT)
1281c95b42baSmrgAC_SUBST(MAKE_PS)
1282c95b42baSmrgAC_SUBST(MAKE_PDF)
1283c95b42baSmrgAC_SUBST(MAKE_HTML)
1284c95b42baSmrg]) # XORG_CHECK_LINUXDOC
1285c95b42baSmrg
1286c95b42baSmrg# XORG_CHECK_DOCBOOK
1287c95b42baSmrg# -------------------
1288c95b42baSmrg# Minimum version: 1.0.0
1289c95b42baSmrg#
1290c95b42baSmrg# Checks for the ability to build output formats from SGML DocBook source.
1291c95b42baSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1292c95b42baSmrg# indicates whether the necessary tools and files are found and, if set,
1293c95b42baSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1294c95b42baSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1295c95b42baSmrgXORG_SGML_PATH=$prefix/share/sgml
1296c95b42baSmrgHAVE_DEFS_ENT=
1297c95b42baSmrgBUILDTXTDOC=no
1298c95b42baSmrgBUILDPDFDOC=no
1299c95b42baSmrgBUILDPSDOC=no
1300c95b42baSmrgBUILDHTMLDOC=no
1301c95b42baSmrg
1302c95b42baSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1303c95b42baSmrg
1304c95b42baSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1305c95b42baSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1306c95b42baSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1307c95b42baSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1308c95b42baSmrg
1309c95b42baSmrgAC_MSG_CHECKING([Whether to build text documentation])
1310c95b42baSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1311c95b42baSmrg   test x$BUILD_TXTDOC != xno; then
1312c95b42baSmrg	BUILDTXTDOC=yes
1313c95b42baSmrgfi
1314c95b42baSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1315c95b42baSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1316c95b42baSmrg
1317c95b42baSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
1318c95b42baSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1319c95b42baSmrg   test x$BUILD_PDFDOC != xno; then
1320c95b42baSmrg	BUILDPDFDOC=yes
1321c95b42baSmrgfi
1322c95b42baSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1323c95b42baSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1324c95b42baSmrg
1325c95b42baSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
1326c95b42baSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1327c95b42baSmrg   test x$BUILD_PSDOC != xno; then
1328c95b42baSmrg	BUILDPSDOC=yes
1329c95b42baSmrgfi
1330c95b42baSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1331c95b42baSmrgAC_MSG_RESULT([$BUILDPSDOC])
1332c95b42baSmrg
1333c95b42baSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
1334c95b42baSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1335c95b42baSmrg   test x$BUILD_HTMLDOC != xno; then
1336c95b42baSmrg	BUILDHTMLDOC=yes
1337c95b42baSmrgfi
1338c95b42baSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1339c95b42baSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1340c95b42baSmrg
1341c95b42baSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1342c95b42baSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1343c95b42baSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1344c95b42baSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1345c95b42baSmrg
1346c95b42baSmrgAC_SUBST(MAKE_TEXT)
1347c95b42baSmrgAC_SUBST(MAKE_PS)
1348c95b42baSmrgAC_SUBST(MAKE_PDF)
1349c95b42baSmrgAC_SUBST(MAKE_HTML)
1350c95b42baSmrg]) # XORG_CHECK_DOCBOOK
1351c95b42baSmrg
1352c95b42baSmrg# XORG_CHECK_MALLOC_ZERO
1353c95b42baSmrg# ----------------------
1354c95b42baSmrg# Minimum version: 1.0.0
1355c95b42baSmrg#
1356c95b42baSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1357c95b42baSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1358c95b42baSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1359c95b42baSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1360c95b42baSmrgAC_ARG_ENABLE(malloc0returnsnull,
1361c95b42baSmrg	AC_HELP_STRING([--enable-malloc0returnsnull],
1362c95b42baSmrg		       [malloc(0) returns NULL (default: auto)]),
1363c95b42baSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1364c95b42baSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1365c95b42baSmrg
1366c95b42baSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1367c95b42baSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1368c95b42baSmrg	AC_RUN_IFELSE([
1369c95b42baSmrgchar *malloc();
1370c95b42baSmrgchar *realloc();
1371c95b42baSmrgchar *calloc();
1372c95b42baSmrgmain() {
1373c95b42baSmrg    char *m0, *r0, *c0, *p;
1374c95b42baSmrg    m0 = malloc(0);
1375c95b42baSmrg    p = malloc(10);
1376c95b42baSmrg    r0 = realloc(p,0);
1377c95b42baSmrg    c0 = calloc(0);
1378c95b42baSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1379c95b42baSmrg}],
1380c95b42baSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1381c95b42baSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
1382c95b42baSmrgfi
1383c95b42baSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1384c95b42baSmrg
1385c95b42baSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1386c95b42baSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1387c95b42baSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1388c95b42baSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1389c95b42baSmrgelse
1390c95b42baSmrg	MALLOC_ZERO_CFLAGS=""
1391c95b42baSmrg	XMALLOC_ZERO_CFLAGS=""
1392c95b42baSmrg	XTMALLOC_ZERO_CFLAGS=""
1393c95b42baSmrgfi
1394c95b42baSmrg
1395c95b42baSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1396c95b42baSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1397c95b42baSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1398c95b42baSmrg]) # XORG_CHECK_MALLOC_ZERO
1399c95b42baSmrg
1400c95b42baSmrg# XORG_WITH_LINT()
1401c95b42baSmrg# ----------------
1402c95b42baSmrg# Minimum version: 1.1.0
1403c95b42baSmrg#
1404c95b42baSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
1405c95b42baSmrg# is specified.   (Use --with-lint=sparse for sparse.)
1406c95b42baSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1407c95b42baSmrg# Sets $LINT_FLAGS to flags to pass to source checker
1408c95b42baSmrg# Sets LINT automake conditional if enabled (default: disabled)
1409c95b42baSmrg#
1410c95b42baSmrgAC_DEFUN([XORG_WITH_LINT],[
1411c95b42baSmrg
1412c95b42baSmrg# Allow checking code with lint, sparse, etc.
1413c95b42baSmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
1414c95b42baSmrg		[Use a lint-style source code checker (default: disabled)])],
1415c95b42baSmrg		[use_lint=$withval], [use_lint=no])
1416c95b42baSmrgif test "x$use_lint" = "xyes" ; then
1417c95b42baSmrg	LINT="lint"
1418c95b42baSmrgelse
1419c95b42baSmrg	LINT="$use_lint"
1420c95b42baSmrgfi
1421c95b42baSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1422c95b42baSmrg    case $LINT in
1423c95b42baSmrg	lint|*/lint)
1424c95b42baSmrg	    case $host_os in
1425c95b42baSmrg		solaris*)
1426c95b42baSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1427c95b42baSmrg			;;
1428c95b42baSmrg	    esac
1429c95b42baSmrg	    ;;
1430c95b42baSmrg    esac
1431c95b42baSmrgfi
1432c95b42baSmrg
1433c95b42baSmrgAC_SUBST(LINT)
1434c95b42baSmrgAC_SUBST(LINT_FLAGS)
1435c95b42baSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
1436c95b42baSmrg
1437c95b42baSmrg]) # XORG_WITH_LINT
1438c95b42baSmrg
1439c95b42baSmrg# XORG_LINT_LIBRARY(LIBNAME)
1440c95b42baSmrg# --------------------------
1441c95b42baSmrg# Minimum version: 1.1.0
1442c95b42baSmrg#
1443c95b42baSmrg# Sets up flags for building lint libraries for checking programs that call
1444c95b42baSmrg# functions in the library.
1445c95b42baSmrg# Disabled by default, enable with --enable-lint-library
1446c95b42baSmrg# Sets: 
1447c95b42baSmrg#	@LINTLIB@		- name of lint library file to make
1448c95b42baSmrg#	MAKE_LINT_LIB		- automake conditional
1449c95b42baSmrg#
1450c95b42baSmrg
1451c95b42baSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1452c95b42baSmrgAC_REQUIRE([XORG_WITH_LINT])
1453c95b42baSmrg# Build lint "library" for more indepth checks of programs calling this library
1454c95b42baSmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
1455c95b42baSmrg	[Create lint library (default: disabled)])],
1456c95b42baSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1457c95b42baSmrgif test "x$make_lint_lib" != "xno" ; then
1458c95b42baSmrg	if test "x$LINT" = "xno" ; then
1459c95b42baSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1460c95b42baSmrg	fi
1461c95b42baSmrg	if test "x$make_lint_lib" = "xyes" ; then
1462c95b42baSmrg		LINTLIB=llib-l$1.ln
1463c95b42baSmrg	else
1464c95b42baSmrg		LINTLIB=$make_lint_lib
1465c95b42baSmrg	fi
1466c95b42baSmrgfi
1467c95b42baSmrgAC_SUBST(LINTLIB)
1468c95b42baSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1469c95b42baSmrg
1470c95b42baSmrg]) # XORG_LINT_LIBRARY
1471c95b42baSmrg
1472c95b42baSmrgdnl Copyright 2005 Red Hat, Inc
1473c95b42baSmrgdnl
1474c95b42baSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1475c95b42baSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1476c95b42baSmrgdnl the above copyright notice appear in all copies and that both that
1477c95b42baSmrgdnl copyright notice and this permission notice appear in supporting
1478c95b42baSmrgdnl documentation.
1479c95b42baSmrgdnl
1480c95b42baSmrgdnl The above copyright notice and this permission notice shall be included
1481c95b42baSmrgdnl in all copies or substantial portions of the Software.
1482c95b42baSmrgdnl
1483c95b42baSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1484c95b42baSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1485c95b42baSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1486c95b42baSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1487c95b42baSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1488c95b42baSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1489c95b42baSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1490c95b42baSmrgdnl
1491c95b42baSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1492c95b42baSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1493c95b42baSmrgdnl other dealings in this Software without prior written authorization
1494c95b42baSmrgdnl from the copyright holders.
1495c95b42baSmrgdnl
1496c95b42baSmrg
1497c95b42baSmrg# XORG_RELEASE_VERSION
1498c95b42baSmrg# --------------------
1499c95b42baSmrg# Adds --with/without-release-string and changes the PACKAGE and
1500c95b42baSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1501c95b42baSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1502c95b42baSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1503c95b42baSmrg 
1504c95b42baSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1505c95b42baSmrg	AC_ARG_WITH(release-version,
1506c95b42baSmrg			AC_HELP_STRING([--with-release-version=STRING],
1507c95b42baSmrg				[Use release version string in package name]),
1508c95b42baSmrg			[RELEASE_VERSION="$withval"],
1509c95b42baSmrg			[RELEASE_VERSION=""])
1510c95b42baSmrg	if test "x$RELEASE_VERSION" != "x"; then
1511c95b42baSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1512c95b42baSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1513c95b42baSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1514c95b42baSmrg	fi
1515c95b42baSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1516c95b42baSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1517c95b42baSmrg		[Major version of this package])
1518c95b42baSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
1519c95b42baSmrg	if test "x$PVM" = "x"; then
1520c95b42baSmrg		PVM="0"
1521c95b42baSmrg	fi
1522c95b42baSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1523c95b42baSmrg		[$PVM],
1524c95b42baSmrg		[Minor version of this package])
1525c95b42baSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
1526c95b42baSmrg	if test "x$PVP" = "x"; then
1527c95b42baSmrg		PVP="0"
1528c95b42baSmrg	fi
1529c95b42baSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1530c95b42baSmrg		[$PVP],
1531c95b42baSmrg		[Patch version of this package])
1532c95b42baSmrg])
1533c95b42baSmrg
1534