aclocal.m4 revision 8903d43a
18903d43aSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2e9554658Smrg
3e9554658Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4c2b339b4Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5e9554658Smrg# This file is free software; the Free Software Foundation
6e9554658Smrg# gives unlimited permission to copy and/or distribute it,
7e9554658Smrg# with or without modifications, as long as this notice is preserved.
8e9554658Smrg
9e9554658Smrg# This program is distributed in the hope that it will be useful,
10e9554658Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11e9554658Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12e9554658Smrg# PARTICULAR PURPOSE.
13e9554658Smrg
14c2b339b4Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15c2b339b4Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
168903d43aSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
178903d43aSmrg[m4_warning([this file was generated for autoconf 2.68.
18c2b339b4SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19c2b339b4SmrgIf you have problems, you may need to regenerate the build system entirely.
20c2b339b4SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21e9554658Smrg
22c2b339b4Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23e9554658Smrg#
24e9554658Smrg# This file is free software; the Free Software Foundation
25e9554658Smrg# gives unlimited permission to copy and/or distribute it,
26e9554658Smrg# with or without modifications, as long as this notice is preserved.
27e9554658Smrg
28e9554658Smrg# AM_AUTOMAKE_VERSION(VERSION)
29e9554658Smrg# ----------------------------
30e9554658Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31e9554658Smrg# generated from the m4 files accompanying Automake X.Y.
32e9554658Smrg# (This private macro should not be called outside this file.)
33e9554658SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34c2b339b4Smrg[am__api_version='1.11'
35e9554658Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36e9554658Smrgdnl require some minimum version.  Point them to the right macro.
378903d43aSmrgm4_if([$1], [1.11.1], [],
38e9554658Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39e9554658Smrg])
40e9554658Smrg
41e9554658Smrg# _AM_AUTOCONF_VERSION(VERSION)
42e9554658Smrg# -----------------------------
43e9554658Smrg# aclocal traces this macro to find the Autoconf version.
44e9554658Smrg# This is a private macro too.  Using m4_define simplifies
45e9554658Smrg# the logic in aclocal, which can simply ignore this definition.
46e9554658Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47e9554658Smrg
48e9554658Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49e9554658Smrg# -------------------------------
50e9554658Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51c2b339b4Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52e9554658SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
538903d43aSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
54c2b339b4Smrgm4_ifndef([AC_AUTOCONF_VERSION],
55c2b339b4Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56c2b339b4Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57e9554658Smrg
58e9554658Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59e9554658Smrg
60e9554658Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61e9554658Smrg#
62e9554658Smrg# This file is free software; the Free Software Foundation
63e9554658Smrg# gives unlimited permission to copy and/or distribute it,
64e9554658Smrg# with or without modifications, as long as this notice is preserved.
65e9554658Smrg
66e9554658Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67e9554658Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68e9554658Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69e9554658Smrg#
70e9554658Smrg# Of course, Automake must honor this variable whenever it calls a
71e9554658Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72e9554658Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73e9554658Smrg# depending on how configure is run.  This is pretty annoying, since
74e9554658Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75e9554658Smrg# source directory, any form will work fine, but in subdirectories a
76e9554658Smrg# relative path needs to be adjusted first.
77e9554658Smrg#
78e9554658Smrg# $ac_aux_dir/missing
79e9554658Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80e9554658Smrg# $top_srcdir/$ac_aux_dir/missing
81e9554658Smrg#    fails if $ac_aux_dir is absolute,
82e9554658Smrg#    fails when called from a subdirectory in a VPATH build with
83e9554658Smrg#          a relative $ac_aux_dir
84e9554658Smrg#
85e9554658Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86e9554658Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
87e9554658Smrg# harmless because $srcdir is `.', but things will broke when you
88e9554658Smrg# start a VPATH build or use an absolute $srcdir.
89e9554658Smrg#
90e9554658Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91e9554658Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92e9554658Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93e9554658Smrg# and then we would define $MISSING as
94e9554658Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95e9554658Smrg# This will work as long as MISSING is not called from configure, because
96e9554658Smrg# unfortunately $(top_srcdir) has no meaning in configure.
97e9554658Smrg# However there are other variables, like CC, which are often used in
98e9554658Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99e9554658Smrg#
100e9554658Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
101e9554658Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
102e9554658Smrg# configured tree to be moved without reconfiguration.
103e9554658Smrg
104e9554658SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105e9554658Smrg[dnl Rely on autoconf to set up CDPATH properly.
106e9554658SmrgAC_PREREQ([2.50])dnl
107e9554658Smrg# expand $ac_aux_dir to an absolute path
108e9554658Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
109e9554658Smrg])
110e9554658Smrg
111e9554658Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112e9554658Smrg
113c2b339b4Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114e9554658Smrg# Free Software Foundation, Inc.
115e9554658Smrg#
116e9554658Smrg# This file is free software; the Free Software Foundation
117e9554658Smrg# gives unlimited permission to copy and/or distribute it,
118e9554658Smrg# with or without modifications, as long as this notice is preserved.
119e9554658Smrg
120c2b339b4Smrg# serial 9
121e9554658Smrg
122e9554658Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123e9554658Smrg# -------------------------------------
124e9554658Smrg# Define a conditional.
125e9554658SmrgAC_DEFUN([AM_CONDITIONAL],
126e9554658Smrg[AC_PREREQ(2.52)dnl
127e9554658Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128e9554658Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129e9554658SmrgAC_SUBST([$1_TRUE])dnl
130e9554658SmrgAC_SUBST([$1_FALSE])dnl
131e9554658Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132e9554658Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133c2b339b4Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134e9554658Smrgif $2; then
135e9554658Smrg  $1_TRUE=
136e9554658Smrg  $1_FALSE='#'
137e9554658Smrgelse
138e9554658Smrg  $1_TRUE='#'
139e9554658Smrg  $1_FALSE=
140e9554658Smrgfi
141e9554658SmrgAC_CONFIG_COMMANDS_PRE(
142e9554658Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143e9554658Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144e9554658SmrgUsually this means the macro was only invoked conditionally.]])
145e9554658Smrgfi])])
146e9554658Smrg
147c2b339b4Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148e9554658Smrg# Free Software Foundation, Inc.
149e9554658Smrg#
150e9554658Smrg# This file is free software; the Free Software Foundation
151e9554658Smrg# gives unlimited permission to copy and/or distribute it,
152e9554658Smrg# with or without modifications, as long as this notice is preserved.
153e9554658Smrg
154c2b339b4Smrg# serial 10
155e9554658Smrg
156e9554658Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157e9554658Smrg# written in clear, in which case automake, when reading aclocal.m4,
158e9554658Smrg# will think it sees a *use*, and therefore will trigger all it's
159e9554658Smrg# C support machinery.  Also note that it means that autoscan, seeing
160e9554658Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161e9554658Smrg
162e9554658Smrg
163e9554658Smrg# _AM_DEPENDENCIES(NAME)
164e9554658Smrg# ----------------------
165e9554658Smrg# See how the compiler implements dependency checking.
166e9554658Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167e9554658Smrg# We try a few techniques and use that to set a single cache variable.
168e9554658Smrg#
169e9554658Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170e9554658Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171e9554658Smrg# dependency, and given that the user is not expected to run this macro,
172e9554658Smrg# just rely on AC_PROG_CC.
173e9554658SmrgAC_DEFUN([_AM_DEPENDENCIES],
174e9554658Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175e9554658SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176e9554658SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177e9554658SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178e9554658Smrg
179e9554658Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180e9554658Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181e9554658Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182e9554658Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183e9554658Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184e9554658Smrg                   [depcc="$$1"   am_compiler_list=])
185e9554658Smrg
186e9554658SmrgAC_CACHE_CHECK([dependency style of $depcc],
187e9554658Smrg               [am_cv_$1_dependencies_compiler_type],
188e9554658Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189e9554658Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
190e9554658Smrg  # making bogus files that we don't know about and never remove.  For
191e9554658Smrg  # instance it was reported that on HP-UX the gcc test will end up
192e9554658Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
193e9554658Smrg  # in D'.
194e9554658Smrg  mkdir conftest.dir
195e9554658Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196e9554658Smrg  # using a relative directory.
197e9554658Smrg  cp "$am_depcomp" conftest.dir
198e9554658Smrg  cd conftest.dir
199e9554658Smrg  # We will build objects and dependencies in a subdirectory because
200e9554658Smrg  # it helps to detect inapplicable dependency modes.  For instance
201e9554658Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202e9554658Smrg  # side effect of compilation, but ICC will put the dependencies in
203e9554658Smrg  # the current directory while Tru64 will put them in the object
204e9554658Smrg  # directory.
205e9554658Smrg  mkdir sub
206e9554658Smrg
207e9554658Smrg  am_cv_$1_dependencies_compiler_type=none
208e9554658Smrg  if test "$am_compiler_list" = ""; then
209e9554658Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210e9554658Smrg  fi
211c2b339b4Smrg  am__universal=false
212c2b339b4Smrg  m4_case([$1], [CC],
213c2b339b4Smrg    [case " $depcc " in #(
214c2b339b4Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215c2b339b4Smrg     esac],
216c2b339b4Smrg    [CXX],
217c2b339b4Smrg    [case " $depcc " in #(
218c2b339b4Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219c2b339b4Smrg     esac])
220c2b339b4Smrg
221e9554658Smrg  for depmode in $am_compiler_list; do
222e9554658Smrg    # Setup a source with many dependencies, because some compilers
223e9554658Smrg    # like to wrap large dependency lists on column 80 (with \), and
224e9554658Smrg    # we should not choose a depcomp mode which is confused by this.
225e9554658Smrg    #
226e9554658Smrg    # We need to recreate these files for each test, as the compiler may
227e9554658Smrg    # overwrite some of them when testing with obscure command lines.
228e9554658Smrg    # This happens at least with the AIX C compiler.
229e9554658Smrg    : > sub/conftest.c
230e9554658Smrg    for i in 1 2 3 4 5 6; do
231e9554658Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232e9554658Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233e9554658Smrg      # Solaris 8's {/usr,}/bin/sh.
234e9554658Smrg      touch sub/conftst$i.h
235e9554658Smrg    done
236e9554658Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237e9554658Smrg
238c2b339b4Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239c2b339b4Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240c2b339b4Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241c2b339b4Smrg    # versions had trouble with output in subdirs
242c2b339b4Smrg    am__obj=sub/conftest.${OBJEXT-o}
243c2b339b4Smrg    am__minus_obj="-o $am__obj"
244e9554658Smrg    case $depmode in
245c2b339b4Smrg    gcc)
246c2b339b4Smrg      # This depmode causes a compiler race in universal mode.
247c2b339b4Smrg      test "$am__universal" = false || continue
248c2b339b4Smrg      ;;
249e9554658Smrg    nosideeffect)
250e9554658Smrg      # after this tag, mechanisms are not by side-effect, so they'll
251e9554658Smrg      # only be used when explicitly requested
252e9554658Smrg      if test "x$enable_dependency_tracking" = xyes; then
253e9554658Smrg	continue
254e9554658Smrg      else
255e9554658Smrg	break
256e9554658Smrg      fi
257e9554658Smrg      ;;
258c2b339b4Smrg    msvisualcpp | msvcmsys)
259c2b339b4Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
260c2b339b4Smrg      # not run yet.  These depmodes are late enough in the game, and
261c2b339b4Smrg      # so weak that their functioning should not be impacted.
262c2b339b4Smrg      am__obj=conftest.${OBJEXT-o}
263c2b339b4Smrg      am__minus_obj=
264c2b339b4Smrg      ;;
265e9554658Smrg    none) break ;;
266e9554658Smrg    esac
267e9554658Smrg    if depmode=$depmode \
268c2b339b4Smrg       source=sub/conftest.c object=$am__obj \
269e9554658Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270c2b339b4Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271e9554658Smrg         >/dev/null 2>conftest.err &&
272e9554658Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273e9554658Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274c2b339b4Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275e9554658Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276e9554658Smrg      # icc doesn't choke on unknown options, it will just issue warnings
277e9554658Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
278e9554658Smrg      # that says an option was ignored or not supported.
279e9554658Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280e9554658Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281e9554658Smrg      # The diagnosis changed in icc 8.0:
282e9554658Smrg      #   icc: Command line remark: option '-MP' not supported
283e9554658Smrg      if (grep 'ignoring option' conftest.err ||
284e9554658Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285e9554658Smrg        am_cv_$1_dependencies_compiler_type=$depmode
286e9554658Smrg        break
287e9554658Smrg      fi
288e9554658Smrg    fi
289e9554658Smrg  done
290e9554658Smrg
291e9554658Smrg  cd ..
292e9554658Smrg  rm -rf conftest.dir
293e9554658Smrgelse
294e9554658Smrg  am_cv_$1_dependencies_compiler_type=none
295e9554658Smrgfi
296e9554658Smrg])
297e9554658SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298e9554658SmrgAM_CONDITIONAL([am__fastdep$1], [
299e9554658Smrg  test "x$enable_dependency_tracking" != xno \
300e9554658Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301e9554658Smrg])
302e9554658Smrg
303e9554658Smrg
304e9554658Smrg# AM_SET_DEPDIR
305e9554658Smrg# -------------
306e9554658Smrg# Choose a directory name for dependency files.
307e9554658Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308e9554658SmrgAC_DEFUN([AM_SET_DEPDIR],
309e9554658Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310e9554658SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311e9554658Smrg])
312e9554658Smrg
313e9554658Smrg
314e9554658Smrg# AM_DEP_TRACK
315e9554658Smrg# ------------
316e9554658SmrgAC_DEFUN([AM_DEP_TRACK],
317e9554658Smrg[AC_ARG_ENABLE(dependency-tracking,
318e9554658Smrg[  --disable-dependency-tracking  speeds up one-time build
319e9554658Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320e9554658Smrgif test "x$enable_dependency_tracking" != xno; then
321e9554658Smrg  am_depcomp="$ac_aux_dir/depcomp"
322e9554658Smrg  AMDEPBACKSLASH='\'
323e9554658Smrgfi
324e9554658SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325e9554658SmrgAC_SUBST([AMDEPBACKSLASH])dnl
326e9554658Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327e9554658Smrg])
328e9554658Smrg
329e9554658Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330e9554658Smrg
331c2b339b4Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332e9554658Smrg# Free Software Foundation, Inc.
333e9554658Smrg#
334e9554658Smrg# This file is free software; the Free Software Foundation
335e9554658Smrg# gives unlimited permission to copy and/or distribute it,
336e9554658Smrg# with or without modifications, as long as this notice is preserved.
337e9554658Smrg
338c2b339b4Smrg#serial 5
339e9554658Smrg
340e9554658Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341e9554658Smrg# ------------------------------
342e9554658SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343c2b339b4Smrg[{
344c2b339b4Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345c2b339b4Smrg  # are listed without --file.  Let's play safe and only enable the eval
346c2b339b4Smrg  # if we detect the quoting.
347c2b339b4Smrg  case $CONFIG_FILES in
348c2b339b4Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
349c2b339b4Smrg  *)   set x $CONFIG_FILES ;;
350c2b339b4Smrg  esac
351c2b339b4Smrg  shift
352c2b339b4Smrg  for mf
353c2b339b4Smrg  do
354c2b339b4Smrg    # Strip MF so we end up with the name of the file.
355c2b339b4Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356c2b339b4Smrg    # Check whether this is an Automake generated Makefile or not.
357c2b339b4Smrg    # We used to match only the files named `Makefile.in', but
358c2b339b4Smrg    # some people rename them; so instead we look at the file content.
359c2b339b4Smrg    # Grep'ing the first line is not enough: some people post-process
360c2b339b4Smrg    # each Makefile.in and add a new line on top of each file to say so.
361c2b339b4Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
362c2b339b4Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
363c2b339b4Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364c2b339b4Smrg      dirpart=`AS_DIRNAME("$mf")`
365c2b339b4Smrg    else
366c2b339b4Smrg      continue
367c2b339b4Smrg    fi
368c2b339b4Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
369c2b339b4Smrg    # from the Makefile without running `make'.
370c2b339b4Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371c2b339b4Smrg    test -z "$DEPDIR" && continue
372c2b339b4Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373c2b339b4Smrg    test -z "am__include" && continue
374c2b339b4Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375c2b339b4Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
376c2b339b4Smrg    U=`sed -n 's/^U = //p' < "$mf"`
377c2b339b4Smrg    # Find all dependency output files, they are included files with
378c2b339b4Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379c2b339b4Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380c2b339b4Smrg    # expansion.
381c2b339b4Smrg    for file in `sed -n "
382c2b339b4Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383c2b339b4Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384c2b339b4Smrg      # Make sure the directory exists.
385c2b339b4Smrg      test -f "$dirpart/$file" && continue
386c2b339b4Smrg      fdir=`AS_DIRNAME(["$file"])`
387c2b339b4Smrg      AS_MKDIR_P([$dirpart/$fdir])
388c2b339b4Smrg      # echo "creating $dirpart/$file"
389c2b339b4Smrg      echo '# dummy' > "$dirpart/$file"
390c2b339b4Smrg    done
391e9554658Smrg  done
392c2b339b4Smrg}
393e9554658Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394e9554658Smrg
395e9554658Smrg
396e9554658Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397e9554658Smrg# -----------------------------
398e9554658Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
399e9554658Smrg#
400e9554658Smrg# This code is only required when automatic dependency tracking
401e9554658Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
402e9554658Smrg# need in order to bootstrap the dependency handling code.
403e9554658SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404e9554658Smrg[AC_CONFIG_COMMANDS([depfiles],
405e9554658Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406e9554658Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407e9554658Smrg])
408e9554658Smrg
409e9554658Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
410e9554658Smrg# Free Software Foundation, Inc.
411e9554658Smrg#
412e9554658Smrg# This file is free software; the Free Software Foundation
413e9554658Smrg# gives unlimited permission to copy and/or distribute it,
414e9554658Smrg# with or without modifications, as long as this notice is preserved.
415e9554658Smrg
416e9554658Smrg# serial 8
417e9554658Smrg
418e9554658Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
419e9554658SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
420e9554658Smrg
421e9554658Smrg# Do all the work for Automake.                             -*- Autoconf -*-
422e9554658Smrg
423e9554658Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
424c2b339b4Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
425e9554658Smrg#
426e9554658Smrg# This file is free software; the Free Software Foundation
427e9554658Smrg# gives unlimited permission to copy and/or distribute it,
428e9554658Smrg# with or without modifications, as long as this notice is preserved.
429e9554658Smrg
430c2b339b4Smrg# serial 16
431e9554658Smrg
432e9554658Smrg# This macro actually does too much.  Some checks are only needed if
433e9554658Smrg# your package does certain things.  But this isn't really a big deal.
434e9554658Smrg
435e9554658Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
436e9554658Smrg# AM_INIT_AUTOMAKE([OPTIONS])
437e9554658Smrg# -----------------------------------------------
438e9554658Smrg# The call with PACKAGE and VERSION arguments is the old style
439e9554658Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
440e9554658Smrg# and VERSION should now be passed to AC_INIT and removed from
441e9554658Smrg# the call to AM_INIT_AUTOMAKE.
442e9554658Smrg# We support both call styles for the transition.  After
443e9554658Smrg# the next Automake release, Autoconf can make the AC_INIT
444e9554658Smrg# arguments mandatory, and then we can depend on a new Autoconf
445e9554658Smrg# release and drop the old call support.
446e9554658SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
447c2b339b4Smrg[AC_PREREQ([2.62])dnl
448e9554658Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
449e9554658Smrgdnl the ones we care about.
450e9554658Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
451e9554658SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
452e9554658SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
453e9554658Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
454e9554658Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
455e9554658Smrg  # is not polluted with repeated "-I."
456e9554658Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
457e9554658Smrg  # test to see if srcdir already configured
458e9554658Smrg  if test -f $srcdir/config.status; then
459e9554658Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
460e9554658Smrg  fi
461e9554658Smrgfi
462e9554658Smrg
463e9554658Smrg# test whether we have cygpath
464e9554658Smrgif test -z "$CYGPATH_W"; then
465e9554658Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
466e9554658Smrg    CYGPATH_W='cygpath -w'
467e9554658Smrg  else
468e9554658Smrg    CYGPATH_W=echo
469e9554658Smrg  fi
470e9554658Smrgfi
471e9554658SmrgAC_SUBST([CYGPATH_W])
472e9554658Smrg
473e9554658Smrg# Define the identity of the package.
474e9554658Smrgdnl Distinguish between old-style and new-style calls.
475e9554658Smrgm4_ifval([$2],
476e9554658Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
477e9554658Smrg AC_SUBST([PACKAGE], [$1])dnl
478e9554658Smrg AC_SUBST([VERSION], [$2])],
479e9554658Smrg[_AM_SET_OPTIONS([$1])dnl
480e9554658Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
481e9554658Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
482e9554658Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
483e9554658Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
484e9554658Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
485e9554658Smrg
486e9554658Smrg_AM_IF_OPTION([no-define],,
487e9554658Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
488e9554658Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489e9554658Smrg
490e9554658Smrg# Some tools Automake needs.
491e9554658SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
492e9554658SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
493e9554658SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
494e9554658SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
495e9554658SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
496e9554658SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
497e9554658SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
498c2b339b4SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
499c2b339b4SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
500e9554658SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
501e9554658Smrg# We need awk for the "check" target.  The system "awk" is bad on
502e9554658Smrg# some platforms.
503e9554658SmrgAC_REQUIRE([AC_PROG_AWK])dnl
504e9554658SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
505e9554658SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
506e9554658Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
507c2b339b4Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
508c2b339b4Smrg			     [_AM_PROG_TAR([v7])])])
509e9554658Smrg_AM_IF_OPTION([no-dependencies],,
510e9554658Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
511c2b339b4Smrg		  [_AM_DEPENDENCIES(CC)],
512c2b339b4Smrg		  [define([AC_PROG_CC],
513c2b339b4Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
514e9554658SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
515c2b339b4Smrg		  [_AM_DEPENDENCIES(CXX)],
516c2b339b4Smrg		  [define([AC_PROG_CXX],
517c2b339b4Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
518e9554658SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
519c2b339b4Smrg		  [_AM_DEPENDENCIES(OBJC)],
520c2b339b4Smrg		  [define([AC_PROG_OBJC],
521c2b339b4Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
522e9554658Smrg])
523c2b339b4Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
524c2b339b4Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
525c2b339b4Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
526c2b339b4Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
527c2b339b4SmrgAC_CONFIG_COMMANDS_PRE(dnl
528c2b339b4Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
529c2b339b4Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
530e9554658Smrg])
531e9554658Smrg
532c2b339b4Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
533c2b339b4Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
534c2b339b4Smrgdnl mangled by Autoconf and run in a shell conditional statement.
535c2b339b4Smrgm4_define([_AC_COMPILER_EXEEXT],
536c2b339b4Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537c2b339b4Smrg
538e9554658Smrg
539e9554658Smrg# When config.status generates a header, we must update the stamp-h file.
540e9554658Smrg# This file resides in the same directory as the config header
541e9554658Smrg# that is generated.  The stamp files are numbered to have different names.
542e9554658Smrg
543e9554658Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
544e9554658Smrg# loop where config.status creates the headers, so we can generate
545e9554658Smrg# our stamp files there.
546e9554658SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
547e9554658Smrg[# Compute $1's index in $config_headers.
548c2b339b4Smrg_am_arg=$1
549e9554658Smrg_am_stamp_count=1
550e9554658Smrgfor _am_header in $config_headers :; do
551e9554658Smrg  case $_am_header in
552c2b339b4Smrg    $_am_arg | $_am_arg:* )
553e9554658Smrg      break ;;
554e9554658Smrg    * )
555e9554658Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
556e9554658Smrg  esac
557e9554658Smrgdone
558c2b339b4Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
559e9554658Smrg
560c2b339b4Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
561e9554658Smrg#
562e9554658Smrg# This file is free software; the Free Software Foundation
563e9554658Smrg# gives unlimited permission to copy and/or distribute it,
564e9554658Smrg# with or without modifications, as long as this notice is preserved.
565e9554658Smrg
566e9554658Smrg# AM_PROG_INSTALL_SH
567e9554658Smrg# ------------------
568e9554658Smrg# Define $install_sh.
569e9554658SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
570e9554658Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
571c2b339b4Smrgif test x"${install_sh}" != xset; then
572c2b339b4Smrg  case $am_aux_dir in
573c2b339b4Smrg  *\ * | *\	*)
574c2b339b4Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
575c2b339b4Smrg  *)
576c2b339b4Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
577c2b339b4Smrg  esac
578c2b339b4Smrgfi
579e9554658SmrgAC_SUBST(install_sh)])
580e9554658Smrg
581e9554658Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
582e9554658Smrg#
583e9554658Smrg# This file is free software; the Free Software Foundation
584e9554658Smrg# gives unlimited permission to copy and/or distribute it,
585e9554658Smrg# with or without modifications, as long as this notice is preserved.
586e9554658Smrg
587e9554658Smrg# serial 2
588e9554658Smrg
589e9554658Smrg# Check whether the underlying file-system supports filenames
590e9554658Smrg# with a leading dot.  For instance MS-DOS doesn't.
591e9554658SmrgAC_DEFUN([AM_SET_LEADING_DOT],
592e9554658Smrg[rm -rf .tst 2>/dev/null
593e9554658Smrgmkdir .tst 2>/dev/null
594e9554658Smrgif test -d .tst; then
595e9554658Smrg  am__leading_dot=.
596e9554658Smrgelse
597e9554658Smrg  am__leading_dot=_
598e9554658Smrgfi
599e9554658Smrgrmdir .tst 2>/dev/null
600e9554658SmrgAC_SUBST([am__leading_dot])])
601e9554658Smrg
602e9554658Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
603e9554658Smrg# From Jim Meyering
604e9554658Smrg
605c2b339b4Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
606e9554658Smrg# Free Software Foundation, Inc.
607e9554658Smrg#
608e9554658Smrg# This file is free software; the Free Software Foundation
609e9554658Smrg# gives unlimited permission to copy and/or distribute it,
610e9554658Smrg# with or without modifications, as long as this notice is preserved.
611e9554658Smrg
612c2b339b4Smrg# serial 5
613e9554658Smrg
614c2b339b4Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
615c2b339b4Smrg# ----------------------------------
616c2b339b4Smrg# Control maintainer-specific portions of Makefiles.
617c2b339b4Smrg# Default is to disable them, unless `enable' is passed literally.
618c2b339b4Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
619c2b339b4Smrg# can override the default with the --enable/--disable switch.
620e9554658SmrgAC_DEFUN([AM_MAINTAINER_MODE],
621c2b339b4Smrg[m4_case(m4_default([$1], [disable]),
622c2b339b4Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
623c2b339b4Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
624c2b339b4Smrg       [m4_define([am_maintainer_other], [enable])
625c2b339b4Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
626c2b339b4SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
627c2b339b4Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
628c2b339b4Smrg  AC_ARG_ENABLE([maintainer-mode],
629c2b339b4Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
630e9554658Smrg			  (and sometimes confusing) to the casual installer],
631c2b339b4Smrg      [USE_MAINTAINER_MODE=$enableval],
632c2b339b4Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
633e9554658Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
634c2b339b4Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
635e9554658Smrg  MAINT=$MAINTAINER_MODE_TRUE
636c2b339b4Smrg  AC_SUBST([MAINT])dnl
637e9554658Smrg]
638e9554658Smrg)
639e9554658Smrg
640e9554658SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
641e9554658Smrg
642e9554658Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
643e9554658Smrg
644c2b339b4Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
645e9554658Smrg#
646e9554658Smrg# This file is free software; the Free Software Foundation
647e9554658Smrg# gives unlimited permission to copy and/or distribute it,
648e9554658Smrg# with or without modifications, as long as this notice is preserved.
649e9554658Smrg
650c2b339b4Smrg# serial 4
651e9554658Smrg
652e9554658Smrg# AM_MAKE_INCLUDE()
653e9554658Smrg# -----------------
654e9554658Smrg# Check to see how make treats includes.
655e9554658SmrgAC_DEFUN([AM_MAKE_INCLUDE],
656e9554658Smrg[am_make=${MAKE-make}
657e9554658Smrgcat > confinc << 'END'
658e9554658Smrgam__doit:
659c2b339b4Smrg	@echo this is the am__doit target
660e9554658Smrg.PHONY: am__doit
661e9554658SmrgEND
662e9554658Smrg# If we don't find an include directive, just comment out the code.
663e9554658SmrgAC_MSG_CHECKING([for style of include used by $am_make])
664e9554658Smrgam__include="#"
665e9554658Smrgam__quote=
666e9554658Smrg_am_result=none
667e9554658Smrg# First try GNU make style include.
668e9554658Smrgecho "include confinc" > confmf
669c2b339b4Smrg# Ignore all kinds of additional output from `make'.
670c2b339b4Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
671c2b339b4Smrg*the\ am__doit\ target*)
672c2b339b4Smrg  am__include=include
673c2b339b4Smrg  am__quote=
674c2b339b4Smrg  _am_result=GNU
675c2b339b4Smrg  ;;
676c2b339b4Smrgesac
677e9554658Smrg# Now try BSD make style include.
678e9554658Smrgif test "$am__include" = "#"; then
679e9554658Smrg   echo '.include "confinc"' > confmf
680c2b339b4Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
681c2b339b4Smrg   *the\ am__doit\ target*)
682c2b339b4Smrg     am__include=.include
683c2b339b4Smrg     am__quote="\""
684c2b339b4Smrg     _am_result=BSD
685c2b339b4Smrg     ;;
686c2b339b4Smrg   esac
687e9554658Smrgfi
688e9554658SmrgAC_SUBST([am__include])
689e9554658SmrgAC_SUBST([am__quote])
690e9554658SmrgAC_MSG_RESULT([$_am_result])
691e9554658Smrgrm -f confinc confmf
692e9554658Smrg])
693e9554658Smrg
694e9554658Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
695e9554658Smrg
696c2b339b4Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
697e9554658Smrg# Free Software Foundation, Inc.
698e9554658Smrg#
699e9554658Smrg# This file is free software; the Free Software Foundation
700e9554658Smrg# gives unlimited permission to copy and/or distribute it,
701e9554658Smrg# with or without modifications, as long as this notice is preserved.
702e9554658Smrg
703c2b339b4Smrg# serial 6
704e9554658Smrg
705e9554658Smrg# AM_MISSING_PROG(NAME, PROGRAM)
706e9554658Smrg# ------------------------------
707e9554658SmrgAC_DEFUN([AM_MISSING_PROG],
708e9554658Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
709e9554658Smrg$1=${$1-"${am_missing_run}$2"}
710e9554658SmrgAC_SUBST($1)])
711e9554658Smrg
712e9554658Smrg
713e9554658Smrg# AM_MISSING_HAS_RUN
714e9554658Smrg# ------------------
715e9554658Smrg# Define MISSING if not defined so far and test if it supports --run.
716e9554658Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
717e9554658SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
718e9554658Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
719e9554658SmrgAC_REQUIRE_AUX_FILE([missing])dnl
720c2b339b4Smrgif test x"${MISSING+set}" != xset; then
721c2b339b4Smrg  case $am_aux_dir in
722c2b339b4Smrg  *\ * | *\	*)
723c2b339b4Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
724c2b339b4Smrg  *)
725c2b339b4Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
726c2b339b4Smrg  esac
727c2b339b4Smrgfi
728e9554658Smrg# Use eval to expand $SHELL
729e9554658Smrgif eval "$MISSING --run true"; then
730e9554658Smrg  am_missing_run="$MISSING --run "
731e9554658Smrgelse
732e9554658Smrg  am_missing_run=
733e9554658Smrg  AC_MSG_WARN([`missing' script is too old or missing])
734e9554658Smrgfi
735e9554658Smrg])
736e9554658Smrg
737e9554658Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
738e9554658Smrg#
739e9554658Smrg# This file is free software; the Free Software Foundation
740e9554658Smrg# gives unlimited permission to copy and/or distribute it,
741e9554658Smrg# with or without modifications, as long as this notice is preserved.
742e9554658Smrg
743e9554658Smrg# AM_PROG_MKDIR_P
744e9554658Smrg# ---------------
745e9554658Smrg# Check for `mkdir -p'.
746e9554658SmrgAC_DEFUN([AM_PROG_MKDIR_P],
747e9554658Smrg[AC_PREREQ([2.60])dnl
748e9554658SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
749e9554658Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
750e9554658Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
751e9554658Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
752e9554658Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
753e9554658Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
754e9554658Smrgdnl adjustment using top_builddir (which is defined more often than
755e9554658Smrgdnl MKDIR_P).
756e9554658SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
757e9554658Smrgcase $mkdir_p in
758e9554658Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
759e9554658Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
760e9554658Smrgesac
761e9554658Smrg])
762e9554658Smrg
763e9554658Smrg# Helper functions for option handling.                     -*- Autoconf -*-
764e9554658Smrg
765c2b339b4Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
766e9554658Smrg#
767e9554658Smrg# This file is free software; the Free Software Foundation
768e9554658Smrg# gives unlimited permission to copy and/or distribute it,
769e9554658Smrg# with or without modifications, as long as this notice is preserved.
770e9554658Smrg
771c2b339b4Smrg# serial 4
772e9554658Smrg
773e9554658Smrg# _AM_MANGLE_OPTION(NAME)
774e9554658Smrg# -----------------------
775e9554658SmrgAC_DEFUN([_AM_MANGLE_OPTION],
776e9554658Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
777e9554658Smrg
778e9554658Smrg# _AM_SET_OPTION(NAME)
779e9554658Smrg# ------------------------------
780e9554658Smrg# Set option NAME.  Presently that only means defining a flag for this option.
781e9554658SmrgAC_DEFUN([_AM_SET_OPTION],
782e9554658Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
783e9554658Smrg
784e9554658Smrg# _AM_SET_OPTIONS(OPTIONS)
785e9554658Smrg# ----------------------------------
786e9554658Smrg# OPTIONS is a space-separated list of Automake options.
787e9554658SmrgAC_DEFUN([_AM_SET_OPTIONS],
788c2b339b4Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
789e9554658Smrg
790e9554658Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
791e9554658Smrg# -------------------------------------------
792e9554658Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
793e9554658SmrgAC_DEFUN([_AM_IF_OPTION],
794e9554658Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
795e9554658Smrg
796e9554658Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
797e9554658Smrg
798c2b339b4Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
799e9554658Smrg# Free Software Foundation, Inc.
800e9554658Smrg#
801e9554658Smrg# This file is free software; the Free Software Foundation
802e9554658Smrg# gives unlimited permission to copy and/or distribute it,
803e9554658Smrg# with or without modifications, as long as this notice is preserved.
804e9554658Smrg
805c2b339b4Smrg# serial 5
806e9554658Smrg
807e9554658Smrg# AM_SANITY_CHECK
808e9554658Smrg# ---------------
809e9554658SmrgAC_DEFUN([AM_SANITY_CHECK],
810e9554658Smrg[AC_MSG_CHECKING([whether build environment is sane])
811e9554658Smrg# Just in case
812e9554658Smrgsleep 1
813e9554658Smrgecho timestamp > conftest.file
814c2b339b4Smrg# Reject unsafe characters in $srcdir or the absolute working directory
815c2b339b4Smrg# name.  Accept space and tab only in the latter.
816c2b339b4Smrgam_lf='
817c2b339b4Smrg'
818c2b339b4Smrgcase `pwd` in
819c2b339b4Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
820c2b339b4Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
821c2b339b4Smrgesac
822c2b339b4Smrgcase $srcdir in
823c2b339b4Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
824c2b339b4Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
825c2b339b4Smrgesac
826c2b339b4Smrg
827e9554658Smrg# Do `set' in a subshell so we don't clobber the current shell's
828e9554658Smrg# arguments.  Must try -L first in case configure is actually a
829e9554658Smrg# symlink; some systems play weird games with the mod time of symlinks
830e9554658Smrg# (eg FreeBSD returns the mod time of the symlink's containing
831e9554658Smrg# directory).
832e9554658Smrgif (
833c2b339b4Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
834e9554658Smrg   if test "$[*]" = "X"; then
835e9554658Smrg      # -L didn't work.
836c2b339b4Smrg      set X `ls -t "$srcdir/configure" conftest.file`
837e9554658Smrg   fi
838e9554658Smrg   rm -f conftest.file
839e9554658Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
840e9554658Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
841e9554658Smrg
842e9554658Smrg      # If neither matched, then we have a broken ls.  This can happen
843e9554658Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
844e9554658Smrg      # broken ls alias from the environment.  This has actually
845e9554658Smrg      # happened.  Such a system could not be considered "sane".
846e9554658Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
847e9554658Smrgalias in your environment])
848e9554658Smrg   fi
849e9554658Smrg
850e9554658Smrg   test "$[2]" = conftest.file
851e9554658Smrg   )
852e9554658Smrgthen
853e9554658Smrg   # Ok.
854e9554658Smrg   :
855e9554658Smrgelse
856e9554658Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
857e9554658SmrgCheck your system clock])
858e9554658Smrgfi
859e9554658SmrgAC_MSG_RESULT(yes)])
860e9554658Smrg
861c2b339b4Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
862c2b339b4Smrg#
863c2b339b4Smrg# This file is free software; the Free Software Foundation
864c2b339b4Smrg# gives unlimited permission to copy and/or distribute it,
865c2b339b4Smrg# with or without modifications, as long as this notice is preserved.
866c2b339b4Smrg
867c2b339b4Smrg# serial 1
868c2b339b4Smrg
869c2b339b4Smrg# AM_SILENT_RULES([DEFAULT])
870c2b339b4Smrg# --------------------------
871c2b339b4Smrg# Enable less verbose build rules; with the default set to DEFAULT
872c2b339b4Smrg# (`yes' being less verbose, `no' or empty being verbose).
873c2b339b4SmrgAC_DEFUN([AM_SILENT_RULES],
874c2b339b4Smrg[AC_ARG_ENABLE([silent-rules],
875c2b339b4Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
876c2b339b4Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
877c2b339b4Smrgcase $enable_silent_rules in
878c2b339b4Smrgyes) AM_DEFAULT_VERBOSITY=0;;
879c2b339b4Smrgno)  AM_DEFAULT_VERBOSITY=1;;
880c2b339b4Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
881c2b339b4Smrgesac
882c2b339b4SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
883c2b339b4SmrgAM_BACKSLASH='\'
884c2b339b4SmrgAC_SUBST([AM_BACKSLASH])dnl
885c2b339b4Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
886c2b339b4Smrg])
887c2b339b4Smrg
888e9554658Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
889e9554658Smrg#
890e9554658Smrg# This file is free software; the Free Software Foundation
891e9554658Smrg# gives unlimited permission to copy and/or distribute it,
892e9554658Smrg# with or without modifications, as long as this notice is preserved.
893e9554658Smrg
894e9554658Smrg# AM_PROG_INSTALL_STRIP
895e9554658Smrg# ---------------------
896e9554658Smrg# One issue with vendor `install' (even GNU) is that you can't
897e9554658Smrg# specify the program used to strip binaries.  This is especially
898e9554658Smrg# annoying in cross-compiling environments, where the build's strip
899e9554658Smrg# is unlikely to handle the host's binaries.
900e9554658Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
901e9554658Smrg# always use install-sh in `make install-strip', and initialize
902e9554658Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
903e9554658SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
904e9554658Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
905e9554658Smrg# Installed binaries are usually stripped using `strip' when the user
906e9554658Smrg# run `make install-strip'.  However `strip' might not be the right
907e9554658Smrg# tool to use in cross-compilation environments, therefore Automake
908e9554658Smrg# will honor the `STRIP' environment variable to overrule this program.
909e9554658Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
910e9554658Smrgif test "$cross_compiling" != no; then
911e9554658Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
912e9554658Smrgfi
913e9554658SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
914e9554658SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
915e9554658Smrg
916c2b339b4Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
917e9554658Smrg#
918e9554658Smrg# This file is free software; the Free Software Foundation
919e9554658Smrg# gives unlimited permission to copy and/or distribute it,
920e9554658Smrg# with or without modifications, as long as this notice is preserved.
921e9554658Smrg
922c2b339b4Smrg# serial 2
923c2b339b4Smrg
924e9554658Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
925e9554658Smrg# ---------------------------
926c2b339b4Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
927e9554658Smrg# This macro is traced by Automake.
928e9554658SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
929e9554658Smrg
930c2b339b4Smrg# AM_SUBST_NOTMAKE(VARIABLE)
931c2b339b4Smrg# ---------------------------
932c2b339b4Smrg# Public sister of _AM_SUBST_NOTMAKE.
933c2b339b4SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
934c2b339b4Smrg
935e9554658Smrg# Check how to create a tarball.                            -*- Autoconf -*-
936e9554658Smrg
937e9554658Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
938e9554658Smrg#
939e9554658Smrg# This file is free software; the Free Software Foundation
940e9554658Smrg# gives unlimited permission to copy and/or distribute it,
941e9554658Smrg# with or without modifications, as long as this notice is preserved.
942e9554658Smrg
943e9554658Smrg# serial 2
944e9554658Smrg
945e9554658Smrg# _AM_PROG_TAR(FORMAT)
946e9554658Smrg# --------------------
947e9554658Smrg# Check how to create a tarball in format FORMAT.
948e9554658Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
949e9554658Smrg#
950e9554658Smrg# Substitute a variable $(am__tar) that is a command
951e9554658Smrg# writing to stdout a FORMAT-tarball containing the directory
952e9554658Smrg# $tardir.
953e9554658Smrg#     tardir=directory && $(am__tar) > result.tar
954e9554658Smrg#
955e9554658Smrg# Substitute a variable $(am__untar) that extract such
956e9554658Smrg# a tarball read from stdin.
957e9554658Smrg#     $(am__untar) < result.tar
958e9554658SmrgAC_DEFUN([_AM_PROG_TAR],
959e9554658Smrg[# Always define AMTAR for backward compatibility.
960e9554658SmrgAM_MISSING_PROG([AMTAR], [tar])
961e9554658Smrgm4_if([$1], [v7],
962e9554658Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
963e9554658Smrg     [m4_case([$1], [ustar],, [pax],,
964e9554658Smrg              [m4_fatal([Unknown tar format])])
965e9554658SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
966e9554658Smrg# Loop over all known methods to create a tar archive until one works.
967e9554658Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
968e9554658Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
969e9554658Smrg# Do not fold the above two line into one, because Tru64 sh and
970e9554658Smrg# Solaris sh will not grok spaces in the rhs of `-'.
971e9554658Smrgfor _am_tool in $_am_tools
972e9554658Smrgdo
973e9554658Smrg  case $_am_tool in
974e9554658Smrg  gnutar)
975e9554658Smrg    for _am_tar in tar gnutar gtar;
976e9554658Smrg    do
977e9554658Smrg      AM_RUN_LOG([$_am_tar --version]) && break
978e9554658Smrg    done
979e9554658Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
980e9554658Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
981e9554658Smrg    am__untar="$_am_tar -xf -"
982e9554658Smrg    ;;
983e9554658Smrg  plaintar)
984e9554658Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
985e9554658Smrg    # ustar tarball either.
986e9554658Smrg    (tar --version) >/dev/null 2>&1 && continue
987e9554658Smrg    am__tar='tar chf - "$$tardir"'
988e9554658Smrg    am__tar_='tar chf - "$tardir"'
989e9554658Smrg    am__untar='tar xf -'
990e9554658Smrg    ;;
991e9554658Smrg  pax)
992e9554658Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
993e9554658Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
994e9554658Smrg    am__untar='pax -r'
995e9554658Smrg    ;;
996e9554658Smrg  cpio)
997e9554658Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
998e9554658Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
999e9554658Smrg    am__untar='cpio -i -H $1 -d'
1000e9554658Smrg    ;;
1001e9554658Smrg  none)
1002e9554658Smrg    am__tar=false
1003e9554658Smrg    am__tar_=false
1004e9554658Smrg    am__untar=false
1005e9554658Smrg    ;;
1006e9554658Smrg  esac
1007e9554658Smrg
1008e9554658Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
1009e9554658Smrg  # and am__untar set.
1010e9554658Smrg  test -n "${am_cv_prog_tar_$1}" && break
1011e9554658Smrg
1012e9554658Smrg  # tar/untar a dummy directory, and stop if the command works
1013e9554658Smrg  rm -rf conftest.dir
1014e9554658Smrg  mkdir conftest.dir
1015e9554658Smrg  echo GrepMe > conftest.dir/file
1016e9554658Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1017e9554658Smrg  rm -rf conftest.dir
1018e9554658Smrg  if test -s conftest.tar; then
1019e9554658Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
1020e9554658Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1021e9554658Smrg  fi
1022e9554658Smrgdone
1023e9554658Smrgrm -rf conftest.dir
1024e9554658Smrg
1025e9554658SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1026e9554658SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1027e9554658SmrgAC_SUBST([am__tar])
1028e9554658SmrgAC_SUBST([am__untar])
1029e9554658Smrg]) # _AM_PROG_TAR
1030e9554658Smrg
1031c2b339b4Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1032e9554658Smrgdnl
10338903d43aSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1034e9554658Smrgdnl 
1035e9554658Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10368903d43aSmrgdnl copy of this software and associated documentation files (the "Software"),
10378903d43aSmrgdnl to deal in the Software without restriction, including without limitation
10388903d43aSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
10398903d43aSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
10408903d43aSmrgdnl Software is furnished to do so, subject to the following conditions:
1041e9554658Smrgdnl
10428903d43aSmrgdnl The above copyright notice and this permission notice (including the next
10438903d43aSmrgdnl paragraph) shall be included in all copies or substantial portions of the
10448903d43aSmrgdnl Software.
1045e9554658Smrgdnl
10468903d43aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10478903d43aSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10488903d43aSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
10498903d43aSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10508903d43aSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
10518903d43aSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
10528903d43aSmrgdnl DEALINGS IN THE SOFTWARE.
1053e9554658Smrg
1054e9554658Smrg# XORG_MACROS_VERSION(required-version)
1055e9554658Smrg# -------------------------------------
1056e9554658Smrg# Minimum version: 1.1.0
1057e9554658Smrg#
1058e9554658Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1059e9554658Smrg# your configure.ac with the minimum required version, such as:
1060e9554658Smrg# XORG_MACROS_VERSION(1.1)
1061e9554658Smrg#
1062c2b339b4Smrg# To ensure that this macro is defined, also add:
1063c2b339b4Smrg# m4_ifndef([XORG_MACROS_VERSION],
1064c2b339b4Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1065e9554658Smrg#
1066e9554658Smrg#
1067e9554658Smrg# See the "minimum version" comment for each macro you use to see what 
1068e9554658Smrg# version you require.
1069c2b339b4Smrgm4_defun([XORG_MACROS_VERSION],[
10708903d43aSmrgm4_define([vers_have], [1.10.0])
1071c2b339b4Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1072c2b339b4Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1073c2b339b4Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1074c2b339b4Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1075c2b339b4Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1076c2b339b4Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1077c2b339b4Smrgm4_undefine([vers_have])
1078c2b339b4Smrgm4_undefine([maj_have])
1079c2b339b4Smrgm4_undefine([maj_needed])
1080e9554658Smrg]) # XORG_MACROS_VERSION
1081e9554658Smrg
1082e9554658Smrg# XORG_PROG_RAWCPP()
1083e9554658Smrg# ------------------
1084e9554658Smrg# Minimum version: 1.0.0
1085e9554658Smrg#
1086e9554658Smrg# Find cpp program and necessary flags for use in pre-processing text files
1087e9554658Smrg# such as man pages and config files
1088e9554658SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1089e9554658SmrgAC_REQUIRE([AC_PROG_CPP])
1090e9554658SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1091e9554658Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1092e9554658Smrg
1093e9554658Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1094e9554658Smrg# which is not the best choice for supporting other OS'es, but covers most
1095e9554658Smrg# of the ones we need for now.
1096e9554658SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1097e9554658SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1098e9554658Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1099e9554658Smrg	AC_MSG_RESULT([no])
1100e9554658Smrgelse
1101e9554658Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1102e9554658Smrg		RAWCPPFLAGS=-undef
1103e9554658Smrg		AC_MSG_RESULT([yes])
1104c2b339b4Smrg	# under Cygwin unix is still defined even with -undef
1105c2b339b4Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1106c2b339b4Smrg		RAWCPPFLAGS="-undef -ansi"
1107c2b339b4Smrg		AC_MSG_RESULT([yes, with -ansi])
1108e9554658Smrg	else
1109e9554658Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1110e9554658Smrg	fi
1111e9554658Smrgfi
1112e9554658Smrgrm -f conftest.$ac_ext
1113e9554658Smrg
1114e9554658SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1115e9554658SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1116e9554658Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1117e9554658Smrg	AC_MSG_RESULT([no])
1118e9554658Smrgelse
1119e9554658Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1120e9554658Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1121e9554658Smrg		AC_MSG_RESULT([yes])
1122e9554658Smrg	else
1123e9554658Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1124e9554658Smrg	fi
1125e9554658Smrgfi
1126e9554658Smrgrm -f conftest.$ac_ext
1127e9554658SmrgAC_SUBST(RAWCPPFLAGS)
1128e9554658Smrg]) # XORG_PROG_RAWCPP
1129e9554658Smrg
1130e9554658Smrg# XORG_MANPAGE_SECTIONS()
1131e9554658Smrg# -----------------------
1132e9554658Smrg# Minimum version: 1.0.0
1133e9554658Smrg#
1134e9554658Smrg# Determine which sections man pages go in for the different man page types
1135e9554658Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1136e9554658Smrg# Not sure if there's any better way than just hardcoding by OS name.
1137e9554658Smrg# Override default settings by setting environment variables
11388903d43aSmrg# Added MAN_SUBSTS in version 1.8
11398903d43aSmrg# Added AC_PROG_SED in version 1.8
1140e9554658Smrg
1141e9554658SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1142e9554658SmrgAC_REQUIRE([AC_CANONICAL_HOST])
11438903d43aSmrgAC_REQUIRE([AC_PROG_SED])
1144e9554658Smrg
1145e9554658Smrgif test x$APP_MAN_SUFFIX = x    ; then
1146e9554658Smrg    APP_MAN_SUFFIX=1
1147e9554658Smrgfi
1148e9554658Smrgif test x$APP_MAN_DIR = x    ; then
1149e9554658Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1150e9554658Smrgfi
1151e9554658Smrg
1152e9554658Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1153e9554658Smrg    LIB_MAN_SUFFIX=3
1154e9554658Smrgfi
1155e9554658Smrgif test x$LIB_MAN_DIR = x    ; then
1156e9554658Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1157e9554658Smrgfi
1158e9554658Smrg
1159e9554658Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1160e9554658Smrg    case $host_os in
1161e9554658Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1162e9554658Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1163e9554658Smrg    esac
1164e9554658Smrgfi
1165e9554658Smrgif test x$FILE_MAN_DIR = x    ; then
1166e9554658Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1167e9554658Smrgfi
1168e9554658Smrg
1169e9554658Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1170e9554658Smrg    case $host_os in
1171e9554658Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1172e9554658Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1173e9554658Smrg    esac
1174e9554658Smrgfi
1175e9554658Smrgif test x$MISC_MAN_DIR = x    ; then
1176e9554658Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1177e9554658Smrgfi
1178e9554658Smrg
1179e9554658Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1180e9554658Smrg    case $host_os in
1181e9554658Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1182e9554658Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1183e9554658Smrg    esac
1184e9554658Smrgfi
1185e9554658Smrgif test x$DRIVER_MAN_DIR = x    ; then
1186e9554658Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1187e9554658Smrgfi
1188e9554658Smrg
1189e9554658Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1190e9554658Smrg    case $host_os in
1191e9554658Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1192e9554658Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1193e9554658Smrg    esac
1194e9554658Smrgfi
1195e9554658Smrgif test x$ADMIN_MAN_DIR = x    ; then
1196e9554658Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1197e9554658Smrgfi
1198e9554658Smrg
1199e9554658Smrg
1200e9554658SmrgAC_SUBST([APP_MAN_SUFFIX])
1201e9554658SmrgAC_SUBST([LIB_MAN_SUFFIX])
1202e9554658SmrgAC_SUBST([FILE_MAN_SUFFIX])
1203e9554658SmrgAC_SUBST([MISC_MAN_SUFFIX])
1204e9554658SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1205e9554658SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1206e9554658SmrgAC_SUBST([APP_MAN_DIR])
1207e9554658SmrgAC_SUBST([LIB_MAN_DIR])
1208e9554658SmrgAC_SUBST([FILE_MAN_DIR])
1209e9554658SmrgAC_SUBST([MISC_MAN_DIR])
1210e9554658SmrgAC_SUBST([DRIVER_MAN_DIR])
1211e9554658SmrgAC_SUBST([ADMIN_MAN_DIR])
12128903d43aSmrg
12138903d43aSmrgXORG_MAN_PAGE="X Version 11"
12148903d43aSmrgAC_SUBST([XORG_MAN_PAGE])
12158903d43aSmrgMAN_SUBSTS="\
12168903d43aSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12178903d43aSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12188903d43aSmrg	-e 's|__xservername__|Xorg|g' \
12198903d43aSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
12208903d43aSmrg	-e 's|__projectroot__|\$(prefix)|g' \
12218903d43aSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
12228903d43aSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
12238903d43aSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
12248903d43aSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
12258903d43aSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
12268903d43aSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
12278903d43aSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
12288903d43aSmrgAC_SUBST([MAN_SUBSTS])
12298903d43aSmrg
1230e9554658Smrg]) # XORG_MANPAGE_SECTIONS
1231e9554658Smrg
12328903d43aSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
12338903d43aSmrg# ------------------------
12348903d43aSmrg# Minimum version: 1.7.0
12358903d43aSmrg#
12368903d43aSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
12378903d43aSmrg# provided by xorg-sgml-doctools, if installed.
12388903d43aSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
12398903d43aSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
12408903d43aSmrgXORG_SGML_PATH=
12418903d43aSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
12428903d43aSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
12438903d43aSmrg    [m4_ifval([$1],[:],
12448903d43aSmrg        [if test x"$cross_compiling" != x"yes" ; then
12458903d43aSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
12468903d43aSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
12478903d43aSmrg         fi])
12488903d43aSmrg    ])
12498903d43aSmrg
12508903d43aSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
12518903d43aSmrg# the path and the name of the doc stylesheet
12528903d43aSmrgif test "x$XORG_SGML_PATH" != "x" ; then
12538903d43aSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
12548903d43aSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
12558903d43aSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
12568903d43aSmrgelse
12578903d43aSmrg   AC_MSG_RESULT([no])
12588903d43aSmrgfi
12598903d43aSmrg
12608903d43aSmrgAC_SUBST(XORG_SGML_PATH)
12618903d43aSmrgAC_SUBST(STYLESHEET_SRCDIR)
12628903d43aSmrgAC_SUBST(XSL_STYLESHEET)
12638903d43aSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
12648903d43aSmrg]) # XORG_CHECK_SGML_DOCTOOLS
12658903d43aSmrg
1266e9554658Smrg# XORG_CHECK_LINUXDOC
1267e9554658Smrg# -------------------
1268e9554658Smrg# Minimum version: 1.0.0
1269e9554658Smrg#
1270e9554658Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1271e9554658Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1272e9554658Smrg# Whether or not the necessary tools and files are found can be checked
1273e9554658Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1274e9554658SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12758903d43aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
12768903d43aSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1277e9554658Smrg
1278e9554658SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1279e9554658Smrg
12808903d43aSmrgAC_MSG_CHECKING([whether to build documentation])
1281e9554658Smrg
12828903d43aSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1283e9554658Smrg   BUILDDOC=yes
1284e9554658Smrgelse
1285e9554658Smrg   BUILDDOC=no
1286e9554658Smrgfi
1287e9554658Smrg
1288e9554658SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1289e9554658Smrg
1290e9554658SmrgAC_MSG_RESULT([$BUILDDOC])
1291e9554658Smrg
12928903d43aSmrgAC_MSG_CHECKING([whether to build pdf documentation])
1293e9554658Smrg
12948903d43aSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1295e9554658Smrg   BUILDPDFDOC=yes
1296e9554658Smrgelse
1297e9554658Smrg   BUILDPDFDOC=no
1298e9554658Smrgfi
1299e9554658Smrg
1300e9554658SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1301e9554658Smrg
1302e9554658SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1303e9554658Smrg
13048903d43aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1305e9554658SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1306e9554658SmrgMAKE_PDF="$PS2PDF"
1307e9554658SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1308e9554658Smrg
1309e9554658SmrgAC_SUBST(MAKE_TEXT)
1310e9554658SmrgAC_SUBST(MAKE_PS)
1311e9554658SmrgAC_SUBST(MAKE_PDF)
1312e9554658SmrgAC_SUBST(MAKE_HTML)
1313e9554658Smrg]) # XORG_CHECK_LINUXDOC
1314e9554658Smrg
1315e9554658Smrg# XORG_CHECK_DOCBOOK
1316e9554658Smrg# -------------------
1317e9554658Smrg# Minimum version: 1.0.0
1318e9554658Smrg#
1319e9554658Smrg# Checks for the ability to build output formats from SGML DocBook source.
1320e9554658Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1321e9554658Smrg# indicates whether the necessary tools and files are found and, if set,
1322e9554658Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1323e9554658SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
13248903d43aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
13258903d43aSmrg
1326e9554658SmrgBUILDTXTDOC=no
1327e9554658SmrgBUILDPDFDOC=no
1328e9554658SmrgBUILDPSDOC=no
1329e9554658SmrgBUILDHTMLDOC=no
1330e9554658Smrg
1331e9554658SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1332e9554658SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1333e9554658SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1334e9554658SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1335e9554658Smrg
13368903d43aSmrgAC_MSG_CHECKING([whether to build text documentation])
13378903d43aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1338e9554658Smrg   test x$BUILD_TXTDOC != xno; then
1339e9554658Smrg	BUILDTXTDOC=yes
1340e9554658Smrgfi
1341e9554658SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1342e9554658SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1343e9554658Smrg
13448903d43aSmrgAC_MSG_CHECKING([whether to build PDF documentation])
13458903d43aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1346e9554658Smrg   test x$BUILD_PDFDOC != xno; then
1347e9554658Smrg	BUILDPDFDOC=yes
1348e9554658Smrgfi
1349e9554658SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1350e9554658SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1351e9554658Smrg
13528903d43aSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
13538903d43aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1354e9554658Smrg   test x$BUILD_PSDOC != xno; then
1355e9554658Smrg	BUILDPSDOC=yes
1356e9554658Smrgfi
1357e9554658SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1358e9554658SmrgAC_MSG_RESULT([$BUILDPSDOC])
1359e9554658Smrg
13608903d43aSmrgAC_MSG_CHECKING([whether to build HTML documentation])
13618903d43aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1362e9554658Smrg   test x$BUILD_HTMLDOC != xno; then
1363e9554658Smrg	BUILDHTMLDOC=yes
1364e9554658Smrgfi
1365e9554658SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1366e9554658SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1367e9554658Smrg
1368e9554658SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1369e9554658SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1370e9554658SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1371e9554658SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1372e9554658Smrg
1373e9554658SmrgAC_SUBST(MAKE_TEXT)
1374e9554658SmrgAC_SUBST(MAKE_PS)
1375e9554658SmrgAC_SUBST(MAKE_PDF)
1376e9554658SmrgAC_SUBST(MAKE_HTML)
1377e9554658Smrg]) # XORG_CHECK_DOCBOOK
1378e9554658Smrg
13798903d43aSmrg# XORG_WITH_XMLTO([MIN-VERSION])
13808903d43aSmrg# ----------------
13818903d43aSmrg# Minimum version: 1.5.0
13828903d43aSmrg#
13838903d43aSmrg# Documentation tools are not always available on all platforms and sometimes
13848903d43aSmrg# not at the appropriate level. This macro enables a module to test for the
13858903d43aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
13868903d43aSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
13878903d43aSmrg# as whether or not to use the xmlto package.
13888903d43aSmrg#
13898903d43aSmrg# Interface to module:
13908903d43aSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
13918903d43aSmrg# XMLTO:	returns the path of the xmlto program found
13928903d43aSmrg#		returns the path set by the user in the environment
13938903d43aSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
13948903d43aSmrg#		'no' user instructs the module not to use xmlto
13958903d43aSmrg#
13968903d43aSmrg# Added in version 1.10.0
13978903d43aSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
13988903d43aSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
13998903d43aSmrg#
14008903d43aSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
14018903d43aSmrg#
14028903d43aSmrgAC_DEFUN([XORG_WITH_XMLTO],[
14038903d43aSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
14048903d43aSmrgAC_ARG_WITH(xmlto,
14058903d43aSmrg	AS_HELP_STRING([--with-xmlto],
14068903d43aSmrg	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
14078903d43aSmrg	   [use_xmlto=$withval], [use_xmlto=auto])
14088903d43aSmrg
14098903d43aSmrgif test "x$use_xmlto" = x"auto"; then
14108903d43aSmrg   AC_PATH_PROG([XMLTO], [xmlto])
14118903d43aSmrg   if test "x$XMLTO" = "x"; then
14128903d43aSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
14138903d43aSmrg	have_xmlto=no
14148903d43aSmrg   else
14158903d43aSmrg        have_xmlto=yes
14168903d43aSmrg   fi
14178903d43aSmrgelif test "x$use_xmlto" = x"yes" ; then
14188903d43aSmrg   AC_PATH_PROG([XMLTO], [xmlto])
14198903d43aSmrg   if test "x$XMLTO" = "x"; then
14208903d43aSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
14218903d43aSmrg   fi
14228903d43aSmrg   have_xmlto=yes
14238903d43aSmrgelif test "x$use_xmlto" = x"no" ; then
14248903d43aSmrg   if test "x$XMLTO" != "x"; then
14258903d43aSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
14268903d43aSmrg   fi
14278903d43aSmrg   have_xmlto=no
14288903d43aSmrgelse
14298903d43aSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
14308903d43aSmrgfi
14318903d43aSmrg
14328903d43aSmrg# Test for a minimum version of xmlto, if provided.
14338903d43aSmrgm4_ifval([$1],
14348903d43aSmrg[if test "$have_xmlto" = yes; then
14358903d43aSmrg    # scrape the xmlto version
14368903d43aSmrg    AC_MSG_CHECKING([the xmlto version])
14378903d43aSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
14388903d43aSmrg    AC_MSG_RESULT([$xmlto_version])
14398903d43aSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
14408903d43aSmrg        [if test "x$use_xmlto" = xauto; then
14418903d43aSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
14428903d43aSmrg            have_xmlto=no
14438903d43aSmrg        else
14448903d43aSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
14458903d43aSmrg        fi])
14468903d43aSmrgfi])
14478903d43aSmrg
14488903d43aSmrg# Test for the ability of xmlto to generate a text target
14498903d43aSmrghave_xmlto_text=no
14508903d43aSmrgcat > conftest.xml << "EOF"
14518903d43aSmrgEOF
14528903d43aSmrgAS_IF([test "$have_xmlto" = yes],
14538903d43aSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
14548903d43aSmrg             [have_xmlto_text=yes],
14558903d43aSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
14568903d43aSmrgrm -f conftest.xml
14578903d43aSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
14588903d43aSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
14598903d43aSmrg]) # XORG_WITH_XMLTO
14608903d43aSmrg
14618903d43aSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION])
14628903d43aSmrg# ----------------
14638903d43aSmrg# Minimum version: 1.5.0
14648903d43aSmrg#
14658903d43aSmrg# Documentation tools are not always available on all platforms and sometimes
14668903d43aSmrg# not at the appropriate level. This macro enables a module to test for the
14678903d43aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
14688903d43aSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
14698903d43aSmrg# as whether or not to use the asciidoc package.
14708903d43aSmrg#
14718903d43aSmrg# Interface to module:
14728903d43aSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
14738903d43aSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
14748903d43aSmrg#		 returns the path set by the user in the environment
14758903d43aSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
14768903d43aSmrg#		  'no' user instructs the module not to use asciidoc
14778903d43aSmrg#
14788903d43aSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
14798903d43aSmrg#
14808903d43aSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
14818903d43aSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
14828903d43aSmrgAC_ARG_WITH(asciidoc,
14838903d43aSmrg	AS_HELP_STRING([--with-asciidoc],
14848903d43aSmrg	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
14858903d43aSmrg	   [use_asciidoc=$withval], [use_asciidoc=auto])
14868903d43aSmrg
14878903d43aSmrgif test "x$use_asciidoc" = x"auto"; then
14888903d43aSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
14898903d43aSmrg   if test "x$ASCIIDOC" = "x"; then
14908903d43aSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
14918903d43aSmrg	have_asciidoc=no
14928903d43aSmrg   else
14938903d43aSmrg        have_asciidoc=yes
14948903d43aSmrg   fi
14958903d43aSmrgelif test "x$use_asciidoc" = x"yes" ; then
14968903d43aSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
14978903d43aSmrg   if test "x$ASCIIDOC" = "x"; then
14988903d43aSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
14998903d43aSmrg   fi
15008903d43aSmrg   have_asciidoc=yes
15018903d43aSmrgelif test "x$use_asciidoc" = x"no" ; then
15028903d43aSmrg   if test "x$ASCIIDOC" != "x"; then
15038903d43aSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
15048903d43aSmrg   fi
15058903d43aSmrg   have_asciidoc=no
15068903d43aSmrgelse
15078903d43aSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
15088903d43aSmrgfi
15098903d43aSmrgm4_ifval([$1],
15108903d43aSmrg[if test "$have_asciidoc" = yes; then
15118903d43aSmrg    # scrape the asciidoc version
15128903d43aSmrg    AC_MSG_CHECKING([the asciidoc version])
15138903d43aSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
15148903d43aSmrg    AC_MSG_RESULT([$asciidoc_version])
15158903d43aSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
15168903d43aSmrg        [if test "x$use_asciidoc" = xauto; then
15178903d43aSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
15188903d43aSmrg            have_asciidoc=no
15198903d43aSmrg        else
15208903d43aSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
15218903d43aSmrg        fi])
15228903d43aSmrgfi])
15238903d43aSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
15248903d43aSmrg]) # XORG_WITH_ASCIIDOC
15258903d43aSmrg
15268903d43aSmrg# XORG_WITH_DOXYGEN([MIN-VERSION])
15278903d43aSmrg# --------------------------------
15288903d43aSmrg# Minimum version: 1.5.0
15298903d43aSmrg#
15308903d43aSmrg# Documentation tools are not always available on all platforms and sometimes
15318903d43aSmrg# not at the appropriate level. This macro enables a module to test for the
15328903d43aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
15338903d43aSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
15348903d43aSmrg# as whether or not to use the doxygen package.
15358903d43aSmrg#
15368903d43aSmrg# Interface to module:
15378903d43aSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
15388903d43aSmrg# DOXYGEN:	 returns the path of the doxygen program found
15398903d43aSmrg#		 returns the path set by the user in the environment
15408903d43aSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
15418903d43aSmrg#		  'no' user instructs the module not to use doxygen
15428903d43aSmrg#
15438903d43aSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
15448903d43aSmrg#
15458903d43aSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
15468903d43aSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
15478903d43aSmrgAC_ARG_WITH(doxygen,
15488903d43aSmrg	AS_HELP_STRING([--with-doxygen],
15498903d43aSmrg	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
15508903d43aSmrg	   [use_doxygen=$withval], [use_doxygen=auto])
15518903d43aSmrg
15528903d43aSmrgif test "x$use_doxygen" = x"auto"; then
15538903d43aSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15548903d43aSmrg   if test "x$DOXYGEN" = "x"; then
15558903d43aSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
15568903d43aSmrg	have_doxygen=no
15578903d43aSmrg   else
15588903d43aSmrg        have_doxygen=yes
15598903d43aSmrg   fi
15608903d43aSmrgelif test "x$use_doxygen" = x"yes" ; then
15618903d43aSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15628903d43aSmrg   if test "x$DOXYGEN" = "x"; then
15638903d43aSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
15648903d43aSmrg   fi
15658903d43aSmrg   have_doxygen=yes
15668903d43aSmrgelif test "x$use_doxygen" = x"no" ; then
15678903d43aSmrg   if test "x$DOXYGEN" != "x"; then
15688903d43aSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
15698903d43aSmrg   fi
15708903d43aSmrg   have_doxygen=no
15718903d43aSmrgelse
15728903d43aSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
15738903d43aSmrgfi
15748903d43aSmrgm4_ifval([$1],
15758903d43aSmrg[if test "$have_doxygen" = yes; then
15768903d43aSmrg    # scrape the doxygen version
15778903d43aSmrg    AC_MSG_CHECKING([the doxygen version])
15788903d43aSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
15798903d43aSmrg    AC_MSG_RESULT([$doxygen_version])
15808903d43aSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
15818903d43aSmrg        [if test "x$use_doxygen" = xauto; then
15828903d43aSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
15838903d43aSmrg            have_doxygen=no
15848903d43aSmrg        else
15858903d43aSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
15868903d43aSmrg        fi])
15878903d43aSmrgfi])
15888903d43aSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
15898903d43aSmrg]) # XORG_WITH_DOXYGEN
15908903d43aSmrg
15918903d43aSmrg# XORG_WITH_GROFF
15928903d43aSmrg# ----------------
15938903d43aSmrg# Minimum version: 1.6.0
15948903d43aSmrg#
15958903d43aSmrg# Documentation tools are not always available on all platforms and sometimes
15968903d43aSmrg# not at the appropriate level. This macro enables a module to test for the
15978903d43aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
15988903d43aSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
15998903d43aSmrg# as whether or not to use the groff package.
16008903d43aSmrg#
16018903d43aSmrg# Interface to module:
16028903d43aSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
16038903d43aSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
16048903d43aSmrg# HAVE_GROFF_MS: the -ms macros package
16058903d43aSmrg# GROFF:	 returns the path of the groff program found
16068903d43aSmrg#		 returns the path set by the user in the environment
16078903d43aSmrg# --with-groff:	 'yes' user instructs the module to use groff
16088903d43aSmrg#		 'no' user instructs the module not to use groff
16098903d43aSmrg#
16108903d43aSmrg# Added in version 1.9.0:
16118903d43aSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
16128903d43aSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
16138903d43aSmrg#		   psselect from the psutils package.
16148903d43aSmrg#		   the ghostcript package. Refer to the grohtml man pages
16158903d43aSmrg#
16168903d43aSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
16178903d43aSmrg#
16188903d43aSmrg# OS and distros often splits groff in a basic and full package, the former
16198903d43aSmrg# having the groff program and the later having devices, fonts and macros
16208903d43aSmrg# Checking for the groff executable is not enough.
16218903d43aSmrg#
16228903d43aSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
16238903d43aSmrg# unset HAVE_GROFF or GROFF env variables.
16248903d43aSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
16258903d43aSmrg#
16268903d43aSmrgAC_DEFUN([XORG_WITH_GROFF],[
16278903d43aSmrgAC_ARG_VAR([GROFF], [Path to groff command])
16288903d43aSmrgAC_ARG_WITH(groff,
16298903d43aSmrg	AS_HELP_STRING([--with-groff],
16308903d43aSmrg	   [Use groff to regenerate documentation (default: yes, if installed)]),
16318903d43aSmrg	   [use_groff=$withval], [use_groff=auto])
16328903d43aSmrg
16338903d43aSmrgif test "x$use_groff" = x"auto"; then
16348903d43aSmrg   AC_PATH_PROG([GROFF], [groff])
16358903d43aSmrg   if test "x$GROFF" = "x"; then
16368903d43aSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
16378903d43aSmrg	have_groff=no
16388903d43aSmrg   else
16398903d43aSmrg        have_groff=yes
16408903d43aSmrg   fi
16418903d43aSmrgelif test "x$use_groff" = x"yes" ; then
16428903d43aSmrg   AC_PATH_PROG([GROFF], [groff])
16438903d43aSmrg   if test "x$GROFF" = "x"; then
16448903d43aSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
16458903d43aSmrg   fi
16468903d43aSmrg   have_groff=yes
16478903d43aSmrgelif test "x$use_groff" = x"no" ; then
16488903d43aSmrg   if test "x$GROFF" != "x"; then
16498903d43aSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
16508903d43aSmrg   fi
16518903d43aSmrg   have_groff=no
16528903d43aSmrgelse
16538903d43aSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
16548903d43aSmrgfi
16558903d43aSmrg
16568903d43aSmrg# We have groff, test for the presence of the macro packages
16578903d43aSmrgif test "x$have_groff" = x"yes"; then
16588903d43aSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
16598903d43aSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
16608903d43aSmrg        groff_ms_works=yes
16618903d43aSmrg    else
16628903d43aSmrg        groff_ms_works=no
16638903d43aSmrg    fi
16648903d43aSmrg    AC_MSG_RESULT([$groff_ms_works])
16658903d43aSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
16668903d43aSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
16678903d43aSmrg        groff_mm_works=yes
16688903d43aSmrg    else
16698903d43aSmrg        groff_mm_works=no
16708903d43aSmrg    fi
16718903d43aSmrg    AC_MSG_RESULT([$groff_mm_works])
16728903d43aSmrgfi
16738903d43aSmrg
16748903d43aSmrg# We have groff, test for HTML dependencies, one command per package
16758903d43aSmrgif test "x$have_groff" = x"yes"; then
16768903d43aSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
16778903d43aSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
16788903d43aSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
16798903d43aSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
16808903d43aSmrg      have_groff_html=yes
16818903d43aSmrg   else
16828903d43aSmrg      have_groff_html=no
16838903d43aSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
16848903d43aSmrg   fi
16858903d43aSmrgfi
16868903d43aSmrg
16878903d43aSmrg# Set Automake conditionals for Makefiles
16888903d43aSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
16898903d43aSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
16908903d43aSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
16918903d43aSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
16928903d43aSmrg]) # XORG_WITH_GROFF
16938903d43aSmrg
16948903d43aSmrg# XORG_WITH_FOP
16958903d43aSmrg# ----------------
16968903d43aSmrg# Minimum version: 1.6.0
16978903d43aSmrg#
16988903d43aSmrg# Documentation tools are not always available on all platforms and sometimes
16998903d43aSmrg# not at the appropriate level. This macro enables a module to test for the
17008903d43aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
17018903d43aSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
17028903d43aSmrg# as whether or not to use the fop package.
17038903d43aSmrg#
17048903d43aSmrg# Interface to module:
17058903d43aSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
17068903d43aSmrg# FOP:	 	returns the path of the fop program found
17078903d43aSmrg#		returns the path set by the user in the environment
17088903d43aSmrg# --with-fop: 	'yes' user instructs the module to use fop
17098903d43aSmrg#		'no' user instructs the module not to use fop
17108903d43aSmrg#
17118903d43aSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
17128903d43aSmrg#
17138903d43aSmrgAC_DEFUN([XORG_WITH_FOP],[
17148903d43aSmrgAC_ARG_VAR([FOP], [Path to fop command])
17158903d43aSmrgAC_ARG_WITH(fop,
17168903d43aSmrg	AS_HELP_STRING([--with-fop],
17178903d43aSmrg	   [Use fop to regenerate documentation (default: yes, if installed)]),
17188903d43aSmrg	   [use_fop=$withval], [use_fop=auto])
17198903d43aSmrg
17208903d43aSmrgif test "x$use_fop" = x"auto"; then
17218903d43aSmrg   AC_PATH_PROG([FOP], [fop])
17228903d43aSmrg   if test "x$FOP" = "x"; then
17238903d43aSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
17248903d43aSmrg	have_fop=no
17258903d43aSmrg   else
17268903d43aSmrg        have_fop=yes
17278903d43aSmrg   fi
17288903d43aSmrgelif test "x$use_fop" = x"yes" ; then
17298903d43aSmrg   AC_PATH_PROG([FOP], [fop])
17308903d43aSmrg   if test "x$FOP" = "x"; then
17318903d43aSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
17328903d43aSmrg   fi
17338903d43aSmrg   have_fop=yes
17348903d43aSmrgelif test "x$use_fop" = x"no" ; then
17358903d43aSmrg   if test "x$FOP" != "x"; then
17368903d43aSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
17378903d43aSmrg   fi
17388903d43aSmrg   have_fop=no
17398903d43aSmrgelse
17408903d43aSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
17418903d43aSmrgfi
17428903d43aSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
17438903d43aSmrg]) # XORG_WITH_FOP
17448903d43aSmrg
17458903d43aSmrg# XORG_WITH_PS2PDF
17468903d43aSmrg# ----------------
17478903d43aSmrg# Minimum version: 1.6.0
17488903d43aSmrg#
17498903d43aSmrg# Documentation tools are not always available on all platforms and sometimes
17508903d43aSmrg# not at the appropriate level. This macro enables a module to test for the
17518903d43aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
17528903d43aSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
17538903d43aSmrg# as whether or not to use the ps2pdf package.
17548903d43aSmrg#
17558903d43aSmrg# Interface to module:
17568903d43aSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
17578903d43aSmrg# PS2PDF:	returns the path of the ps2pdf program found
17588903d43aSmrg#		returns the path set by the user in the environment
17598903d43aSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
17608903d43aSmrg#		 'no' user instructs the module not to use ps2pdf
17618903d43aSmrg#
17628903d43aSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
17638903d43aSmrg#
17648903d43aSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
17658903d43aSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
17668903d43aSmrgAC_ARG_WITH(ps2pdf,
17678903d43aSmrg	AS_HELP_STRING([--with-ps2pdf],
17688903d43aSmrg	   [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
17698903d43aSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=auto])
17708903d43aSmrg
17718903d43aSmrgif test "x$use_ps2pdf" = x"auto"; then
17728903d43aSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
17738903d43aSmrg   if test "x$PS2PDF" = "x"; then
17748903d43aSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
17758903d43aSmrg	have_ps2pdf=no
17768903d43aSmrg   else
17778903d43aSmrg        have_ps2pdf=yes
17788903d43aSmrg   fi
17798903d43aSmrgelif test "x$use_ps2pdf" = x"yes" ; then
17808903d43aSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
17818903d43aSmrg   if test "x$PS2PDF" = "x"; then
17828903d43aSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
17838903d43aSmrg   fi
17848903d43aSmrg   have_ps2pdf=yes
17858903d43aSmrgelif test "x$use_ps2pdf" = x"no" ; then
17868903d43aSmrg   if test "x$PS2PDF" != "x"; then
17878903d43aSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
17888903d43aSmrg   fi
17898903d43aSmrg   have_ps2pdf=no
17908903d43aSmrgelse
17918903d43aSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
17928903d43aSmrgfi
17938903d43aSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
17948903d43aSmrg]) # XORG_WITH_PS2PDF
17958903d43aSmrg
17968903d43aSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
17978903d43aSmrg# ----------------
17988903d43aSmrg# Minimum version: 1.6.0
17998903d43aSmrg#
18008903d43aSmrg# Documentation tools are not always available on all platforms and sometimes
18018903d43aSmrg# not at the appropriate level. This macro enables a builder to skip all
18028903d43aSmrg# documentation targets except traditional man pages.
18038903d43aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18048903d43aSmrg# maximum flexibilty in controlling documentation building.
18058903d43aSmrg# Refer to:
18068903d43aSmrg# XORG_WITH_XMLTO         --with-xmlto
18078903d43aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18088903d43aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
18098903d43aSmrg# XORG_WITH_FOP           --with-fop
18108903d43aSmrg# XORG_WITH_GROFF         --with-groff
18118903d43aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
18128903d43aSmrg#
18138903d43aSmrg# Interface to module:
18148903d43aSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
18158903d43aSmrg# --enable-docs: 'yes' user instructs the module to generate docs
18168903d43aSmrg#		 'no' user instructs the module not to generate docs
18178903d43aSmrg# parm1:	specify the default value, yes or no.
18188903d43aSmrg#
18198903d43aSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
18208903d43aSmrgdefault=$1
18218903d43aSmrgif test "x$default" = x ; then
18228903d43aSmrg  default="yes"
18238903d43aSmrgfi
18248903d43aSmrgAC_ARG_ENABLE(docs,
18258903d43aSmrg	AS_HELP_STRING([--enable-docs],
18268903d43aSmrg	   [Enable building the documentation (default: yes)]),
18278903d43aSmrg	   [build_docs=$enableval], [build_docs=$default])
18288903d43aSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
18298903d43aSmrgAC_MSG_CHECKING([whether to build documentation])
18308903d43aSmrgAC_MSG_RESULT([$build_docs])
18318903d43aSmrg]) # XORG_ENABLE_DOCS
18328903d43aSmrg
18338903d43aSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
18348903d43aSmrg# ----------------
18358903d43aSmrg# Minimum version: 1.6.0
18368903d43aSmrg#
18378903d43aSmrg# This macro enables a builder to skip all developer documentation.
18388903d43aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18398903d43aSmrg# maximum flexibilty in controlling documentation building.
18408903d43aSmrg# Refer to:
18418903d43aSmrg# XORG_WITH_XMLTO         --with-xmlto
18428903d43aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18438903d43aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
18448903d43aSmrg# XORG_WITH_FOP           --with-fop
18458903d43aSmrg# XORG_WITH_GROFF         --with-groff
18468903d43aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
18478903d43aSmrg#
18488903d43aSmrg# Interface to module:
18498903d43aSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
18508903d43aSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
18518903d43aSmrg#			'no' user instructs the module not to generate developer docs
18528903d43aSmrg# parm1:		specify the default value, yes or no.
18538903d43aSmrg#
18548903d43aSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
18558903d43aSmrgdevel_default=$1
18568903d43aSmrgif test "x$devel_default" = x ; then
18578903d43aSmrg  devel_default="yes"
18588903d43aSmrgfi
18598903d43aSmrgAC_ARG_ENABLE(devel-docs,
18608903d43aSmrg	AS_HELP_STRING([--enable-devel-docs],
18618903d43aSmrg	   [Enable building the developer documentation (default: yes)]),
18628903d43aSmrg	   [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
18638903d43aSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
18648903d43aSmrgAC_MSG_CHECKING([whether to build developer documentation])
18658903d43aSmrgAC_MSG_RESULT([$build_devel_docs])
18668903d43aSmrg]) # XORG_ENABLE_DEVEL_DOCS
18678903d43aSmrg
18688903d43aSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
18698903d43aSmrg# ----------------
18708903d43aSmrg# Minimum version: 1.6.0
18718903d43aSmrg#
18728903d43aSmrg# This macro enables a builder to skip all functional specification targets.
18738903d43aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18748903d43aSmrg# maximum flexibilty in controlling documentation building.
18758903d43aSmrg# Refer to:
18768903d43aSmrg# XORG_WITH_XMLTO         --with-xmlto
18778903d43aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18788903d43aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
18798903d43aSmrg# XORG_WITH_FOP           --with-fop
18808903d43aSmrg# XORG_WITH_GROFF         --with-groff
18818903d43aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
18828903d43aSmrg#
18838903d43aSmrg# Interface to module:
18848903d43aSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
18858903d43aSmrg# --enable-specs:	'yes' user instructs the module to generate specs
18868903d43aSmrg#			'no' user instructs the module not to generate specs
18878903d43aSmrg# parm1:		specify the default value, yes or no.
18888903d43aSmrg#
18898903d43aSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
18908903d43aSmrgspec_default=$1
18918903d43aSmrgif test "x$spec_default" = x ; then
18928903d43aSmrg  spec_default="yes"
18938903d43aSmrgfi
18948903d43aSmrgAC_ARG_ENABLE(specs,
18958903d43aSmrg	AS_HELP_STRING([--enable-specs],
18968903d43aSmrg	   [Enable building the specs (default: yes)]),
18978903d43aSmrg	   [build_specs=$enableval], [build_specs=$spec_default])
18988903d43aSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
18998903d43aSmrgAC_MSG_CHECKING([whether to build functional specifications])
19008903d43aSmrgAC_MSG_RESULT([$build_specs])
19018903d43aSmrg]) # XORG_ENABLE_SPECS
19028903d43aSmrg
1903e9554658Smrg# XORG_CHECK_MALLOC_ZERO
1904e9554658Smrg# ----------------------
1905e9554658Smrg# Minimum version: 1.0.0
1906e9554658Smrg#
1907e9554658Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1908e9554658Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1909e9554658Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1910e9554658SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1911e9554658SmrgAC_ARG_ENABLE(malloc0returnsnull,
1912c2b339b4Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1913e9554658Smrg		       [malloc(0) returns NULL (default: auto)]),
1914e9554658Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1915e9554658Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1916e9554658Smrg
1917e9554658SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1918e9554658Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1919e9554658Smrg	AC_RUN_IFELSE([
1920e9554658Smrgchar *malloc();
1921e9554658Smrgchar *realloc();
1922e9554658Smrgchar *calloc();
1923e9554658Smrgmain() {
1924e9554658Smrg    char *m0, *r0, *c0, *p;
1925e9554658Smrg    m0 = malloc(0);
1926e9554658Smrg    p = malloc(10);
1927e9554658Smrg    r0 = realloc(p,0);
1928e9554658Smrg    c0 = calloc(0);
1929e9554658Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1930e9554658Smrg}],
1931e9554658Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
19328903d43aSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
19338903d43aSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1934e9554658Smrgfi
1935e9554658SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1936e9554658Smrg
1937e9554658Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1938e9554658Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1939e9554658Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1940e9554658Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1941e9554658Smrgelse
1942e9554658Smrg	MALLOC_ZERO_CFLAGS=""
1943e9554658Smrg	XMALLOC_ZERO_CFLAGS=""
1944e9554658Smrg	XTMALLOC_ZERO_CFLAGS=""
1945e9554658Smrgfi
1946e9554658Smrg
1947e9554658SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1948e9554658SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1949e9554658SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1950e9554658Smrg]) # XORG_CHECK_MALLOC_ZERO
1951e9554658Smrg
1952e9554658Smrg# XORG_WITH_LINT()
1953e9554658Smrg# ----------------
1954e9554658Smrg# Minimum version: 1.1.0
1955e9554658Smrg#
19568903d43aSmrg# This macro enables the use of a tool that flags some suspicious and
19578903d43aSmrg# non-portable constructs (likely to be bugs) in C language source code.
19588903d43aSmrg# It will attempt to locate the tool and use appropriate options.
19598903d43aSmrg# There are various lint type tools on different platforms.
19608903d43aSmrg#
19618903d43aSmrg# Interface to module:
19628903d43aSmrg# LINT:		returns the path to the tool found on the platform
19638903d43aSmrg#		or the value set to LINT on the configure cmd line
19648903d43aSmrg#		also an Automake conditional
19658903d43aSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
19668903d43aSmrg#
19678903d43aSmrg# --with-lint:	'yes' user instructs the module to use lint
19688903d43aSmrg#		'no' user instructs the module not to use lint (default)
19698903d43aSmrg#
19708903d43aSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
19718903d43aSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1972e9554658Smrg#
1973e9554658SmrgAC_DEFUN([XORG_WITH_LINT],[
1974e9554658Smrg
19758903d43aSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
19768903d43aSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1977c2b339b4SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1978e9554658Smrg		[Use a lint-style source code checker (default: disabled)])],
1979e9554658Smrg		[use_lint=$withval], [use_lint=no])
19808903d43aSmrg
19818903d43aSmrg# Obtain platform specific info like program name and options
19828903d43aSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
19838903d43aSmrgcase $host_os in
19848903d43aSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
19858903d43aSmrg	lint_name=splint
19868903d43aSmrg	lint_options="-badflag"
19878903d43aSmrg	;;
19888903d43aSmrg  *freebsd* | *netbsd*)
19898903d43aSmrg	lint_name=lint
19908903d43aSmrg	lint_options="-u -b"
19918903d43aSmrg	;;
19928903d43aSmrg  *solaris*)
19938903d43aSmrg	lint_name=lint
19948903d43aSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
19958903d43aSmrg	;;
19968903d43aSmrgesac
19978903d43aSmrg
19988903d43aSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
19998903d43aSmrgif test "x$use_lint" = x"yes" ; then
20008903d43aSmrg   AC_PATH_PROG([LINT], [$lint_name])
20018903d43aSmrg   if test "x$LINT" = "x"; then
20028903d43aSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
20038903d43aSmrg   fi
20048903d43aSmrgelif test "x$use_lint" = x"no" ; then
20058903d43aSmrg   if test "x$LINT" != "x"; then
20068903d43aSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
20078903d43aSmrg   fi
2008e9554658Smrgelse
20098903d43aSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2010e9554658Smrgfi
20118903d43aSmrg
20128903d43aSmrg# User supplied flags override default flags
20138903d43aSmrgif test "x$LINT_FLAGS" != "x"; then
20148903d43aSmrg   lint_options=$LINT_FLAGS
2015e9554658Smrgfi
2016e9554658Smrg
20178903d43aSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
20188903d43aSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2019e9554658Smrg
2020e9554658Smrg]) # XORG_WITH_LINT
2021e9554658Smrg
2022e9554658Smrg# XORG_LINT_LIBRARY(LIBNAME)
2023e9554658Smrg# --------------------------
2024e9554658Smrg# Minimum version: 1.1.0
2025e9554658Smrg#
2026e9554658Smrg# Sets up flags for building lint libraries for checking programs that call
2027e9554658Smrg# functions in the library.
2028e9554658Smrg#
20298903d43aSmrg# Interface to module:
20308903d43aSmrg# LINTLIB		- Automake variable with the name of lint library file to make
20318903d43aSmrg# MAKE_LINT_LIB		- Automake conditional
20328903d43aSmrg#
20338903d43aSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
20348903d43aSmrg#			  - 'no' user instructs the module not to create a lint library (default)
2035e9554658Smrg
2036e9554658SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2037e9554658SmrgAC_REQUIRE([XORG_WITH_LINT])
2038c2b339b4SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2039e9554658Smrg	[Create lint library (default: disabled)])],
2040e9554658Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
20418903d43aSmrg
20428903d43aSmrgif test "x$make_lint_lib" = x"yes" ; then
20438903d43aSmrg   LINTLIB=llib-l$1.ln
20448903d43aSmrg   if test "x$LINT" = "x"; then
20458903d43aSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
20468903d43aSmrg   fi
20478903d43aSmrgelif test "x$make_lint_lib" != x"no" ; then
20488903d43aSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2049e9554658Smrgfi
20508903d43aSmrg
2051e9554658SmrgAC_SUBST(LINTLIB)
2052e9554658SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2053e9554658Smrg
2054e9554658Smrg]) # XORG_LINT_LIBRARY
2055e9554658Smrg
2056c2b339b4Smrg# XORG_CWARNFLAGS
2057c2b339b4Smrg# ---------------
2058c2b339b4Smrg# Minimum version: 1.2.0
2059c2b339b4Smrg#
2060c2b339b4Smrg# Defines CWARNFLAGS to enable C compiler warnings.
2061c2b339b4Smrg#
2062c2b339b4SmrgAC_DEFUN([XORG_CWARNFLAGS], [
20638903d43aSmrgAC_REQUIRE([AC_PROG_CC_C99])
2064c2b339b4Smrgif  test "x$GCC" = xyes ; then
2065c2b339b4Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
2066c2b339b4Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
20678903d43aSmrg-Wbad-function-cast -Wformat=2"
2068c2b339b4Smrg    case `$CC -dumpversion` in
2069c2b339b4Smrg    3.4.* | 4.*)
2070c2b339b4Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
2071c2b339b4Smrg	;;
2072c2b339b4Smrg    esac
2073c2b339b4Smrgelse
2074c2b339b4Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2075c2b339b4Smrg    if test "x$SUNCC" = "xyes"; then
2076c2b339b4Smrg	CWARNFLAGS="-v"
2077c2b339b4Smrg    fi
2078c2b339b4Smrgfi
2079c2b339b4SmrgAC_SUBST(CWARNFLAGS)
2080c2b339b4Smrg]) # XORG_CWARNFLAGS
2081c2b339b4Smrg
2082c2b339b4Smrg# XORG_STRICT_OPTION
2083c2b339b4Smrg# -----------------------
2084c2b339b4Smrg# Minimum version: 1.3.0
2085c2b339b4Smrg#
2086c2b339b4Smrg# Add configure option to enable strict compilation
2087c2b339b4SmrgAC_DEFUN([XORG_STRICT_OPTION], [
20888903d43aSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
2089c2b339b4SmrgAC_REQUIRE([AC_PROG_CC_C99])
2090c2b339b4SmrgAC_REQUIRE([XORG_CWARNFLAGS])
2091c2b339b4Smrg
2092c2b339b4SmrgAC_ARG_ENABLE(strict-compilation,
2093c2b339b4Smrg			  AS_HELP_STRING([--enable-strict-compilation],
2094c2b339b4Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
2095c2b339b4Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2096c2b339b4Smrgif test "x$STRICT_COMPILE" = "xyes"; then
2097c2b339b4Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2098c2b339b4Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2099c2b339b4Smrg	if test "x$GCC" = xyes ; then
2100c2b339b4Smrg		STRICT_CFLAGS="-pedantic -Werror"
2101c2b339b4Smrg	elif test "x$SUNCC" = "xyes"; then
2102c2b339b4Smrg		STRICT_CFLAGS="-errwarn"
2103c2b339b4Smrg    elif test "x$INTELCC" = "xyes"; then
2104c2b339b4Smrg		STRICT_CFLAGS="-Werror"
2105c2b339b4Smrg	fi
2106c2b339b4Smrgfi
2107c2b339b4SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
2108c2b339b4SmrgAC_SUBST([CWARNFLAGS])
2109c2b339b4Smrg]) # XORG_STRICT_OPTION
2110c2b339b4Smrg
2111c2b339b4Smrg# XORG_DEFAULT_OPTIONS
2112c2b339b4Smrg# --------------------
2113c2b339b4Smrg# Minimum version: 1.3.0
2114c2b339b4Smrg#
2115c2b339b4Smrg# Defines default options for X.Org modules.
2116c2b339b4Smrg#
2117c2b339b4SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
21188903d43aSmrgAC_REQUIRE([AC_PROG_INSTALL])
2119c2b339b4SmrgXORG_CWARNFLAGS
2120c2b339b4SmrgXORG_STRICT_OPTION
2121c2b339b4SmrgXORG_RELEASE_VERSION
2122c2b339b4SmrgXORG_CHANGELOG
21238903d43aSmrgXORG_INSTALL
2124c2b339b4SmrgXORG_MANPAGE_SECTIONS
21258903d43aSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
21268903d43aSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2127c2b339b4Smrg]) # XORG_DEFAULT_OPTIONS
21288903d43aSmrg
21298903d43aSmrg# XORG_INSTALL()
21308903d43aSmrg# ----------------
21318903d43aSmrg# Minimum version: 1.4.0
21328903d43aSmrg#
21338903d43aSmrg# Defines the variable INSTALL_CMD as the command to copy
21348903d43aSmrg# INSTALL from $prefix/share/util-macros.
21358903d43aSmrg#
21368903d43aSmrgAC_DEFUN([XORG_INSTALL], [
21378903d43aSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
21388903d43aSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
21398903d43aSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
21408903d43aSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
21418903d43aSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
21428903d43aSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
21438903d43aSmrgAC_SUBST([INSTALL_CMD])
21448903d43aSmrg]) # XORG_INSTALL
2145e9554658Smrgdnl Copyright 2005 Red Hat, Inc
2146e9554658Smrgdnl
2147e9554658Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
2148e9554658Smrgdnl documentation for any purpose is hereby granted without fee, provided that
2149e9554658Smrgdnl the above copyright notice appear in all copies and that both that
2150e9554658Smrgdnl copyright notice and this permission notice appear in supporting
2151e9554658Smrgdnl documentation.
2152e9554658Smrgdnl
2153e9554658Smrgdnl The above copyright notice and this permission notice shall be included
2154e9554658Smrgdnl in all copies or substantial portions of the Software.
2155e9554658Smrgdnl
2156e9554658Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2157e9554658Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2158e9554658Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2159e9554658Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2160e9554658Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2161e9554658Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2162e9554658Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
2163e9554658Smrgdnl
2164e9554658Smrgdnl Except as contained in this notice, the name of the copyright holders shall
2165e9554658Smrgdnl not be used in advertising or otherwise to promote the sale, use or
2166e9554658Smrgdnl other dealings in this Software without prior written authorization
2167e9554658Smrgdnl from the copyright holders.
2168e9554658Smrgdnl
2169e9554658Smrg
2170e9554658Smrg# XORG_RELEASE_VERSION
2171e9554658Smrg# --------------------
21728903d43aSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2173e9554658Smrg 
2174e9554658SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
2175e9554658Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2176e9554658Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2177e9554658Smrg		[Major version of this package])
2178c2b339b4Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2179e9554658Smrg	if test "x$PVM" = "x"; then
2180e9554658Smrg		PVM="0"
2181e9554658Smrg	fi
2182e9554658Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2183e9554658Smrg		[$PVM],
2184e9554658Smrg		[Minor version of this package])
2185c2b339b4Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2186e9554658Smrg	if test "x$PVP" = "x"; then
2187e9554658Smrg		PVP="0"
2188e9554658Smrg	fi
2189e9554658Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2190e9554658Smrg		[$PVP],
2191e9554658Smrg		[Patch version of this package])
2192e9554658Smrg])
2193e9554658Smrg
2194c2b339b4Smrg# XORG_CHANGELOG()
2195c2b339b4Smrg# ----------------
2196c2b339b4Smrg# Minimum version: 1.2.0
2197c2b339b4Smrg#
2198c2b339b4Smrg# Defines the variable CHANGELOG_CMD as the command to generate
2199c2b339b4Smrg# ChangeLog from git.
2200c2b339b4Smrg#
2201c2b339b4Smrg#
2202c2b339b4SmrgAC_DEFUN([XORG_CHANGELOG], [
22038903d43aSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
22048903d43aSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
22058903d43aSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2206c2b339b4Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
2207c2b339b4SmrgAC_SUBST([CHANGELOG_CMD])
2208c2b339b4Smrg]) # XORG_CHANGELOG
2209c2b339b4Smrg
2210e9554658Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2211e9554658Smrg# 
2212e9554658Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2213e9554658Smrg#
2214e9554658Smrg# This program is free software; you can redistribute it and/or modify
2215e9554658Smrg# it under the terms of the GNU General Public License as published by
2216e9554658Smrg# the Free Software Foundation; either version 2 of the License, or
2217e9554658Smrg# (at your option) any later version.
2218e9554658Smrg#
2219e9554658Smrg# This program is distributed in the hope that it will be useful, but
2220e9554658Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2221e9554658Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2222e9554658Smrg# General Public License for more details.
2223e9554658Smrg#
2224e9554658Smrg# You should have received a copy of the GNU General Public License
2225e9554658Smrg# along with this program; if not, write to the Free Software
2226e9554658Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2227e9554658Smrg#
2228e9554658Smrg# As a special exception to the GNU General Public License, if you
2229e9554658Smrg# distribute this file as part of a program that contains a
2230e9554658Smrg# configuration script generated by Autoconf, you may include it under
2231e9554658Smrg# the same distribution terms that you use for the rest of that program.
2232e9554658Smrg
2233e9554658Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2234e9554658Smrg# ----------------------------------
2235e9554658SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
2236e9554658Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2237e9554658Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2238e9554658SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2239e9554658Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2240e9554658Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2241e9554658Smrgfi
2242e9554658Smrgif test -n "$PKG_CONFIG"; then
2243c2b339b4Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
2244e9554658Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2245e9554658Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2246e9554658Smrg		AC_MSG_RESULT([yes])
2247e9554658Smrg	else
2248e9554658Smrg		AC_MSG_RESULT([no])
2249e9554658Smrg		PKG_CONFIG=""
2250e9554658Smrg	fi
2251e9554658Smrg		
2252e9554658Smrgfi[]dnl
2253e9554658Smrg])# PKG_PROG_PKG_CONFIG
2254e9554658Smrg
2255e9554658Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2256e9554658Smrg#
2257e9554658Smrg# Check to see whether a particular set of modules exists.  Similar
2258e9554658Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2259e9554658Smrg#
2260e9554658Smrg#
2261e9554658Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
2262e9554658Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
2263e9554658Smrg# PKG_CHECK_EXISTS manually
2264e9554658Smrg# --------------------------------------------------------------
2265e9554658SmrgAC_DEFUN([PKG_CHECK_EXISTS],
2266e9554658Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2267e9554658Smrgif test -n "$PKG_CONFIG" && \
2268e9554658Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2269e9554658Smrg  m4_ifval([$2], [$2], [:])
2270e9554658Smrgm4_ifvaln([$3], [else
2271e9554658Smrg  $3])dnl
2272e9554658Smrgfi])
2273e9554658Smrg
2274e9554658Smrg
2275e9554658Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2276e9554658Smrg# ---------------------------------------------
2277e9554658Smrgm4_define([_PKG_CONFIG],
2278c2b339b4Smrg[if test -n "$$1"; then
2279c2b339b4Smrg    pkg_cv_[]$1="$$1"
2280c2b339b4Smrg elif test -n "$PKG_CONFIG"; then
2281c2b339b4Smrg    PKG_CHECK_EXISTS([$3],
2282c2b339b4Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
2283c2b339b4Smrg		     [pkg_failed=yes])
2284c2b339b4Smrg else
2285c2b339b4Smrg    pkg_failed=untried
2286e9554658Smrgfi[]dnl
2287e9554658Smrg])# _PKG_CONFIG
2288e9554658Smrg
2289c2b339b4Smrg# _PKG_SHORT_ERRORS_SUPPORTED
2290c2b339b4Smrg# -----------------------------
2291c2b339b4SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2292c2b339b4Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2293c2b339b4Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2294c2b339b4Smrg        _pkg_short_errors_supported=yes
2295c2b339b4Smrgelse
2296c2b339b4Smrg        _pkg_short_errors_supported=no
2297c2b339b4Smrgfi[]dnl
2298c2b339b4Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
2299c2b339b4Smrg
2300c2b339b4Smrg
2301e9554658Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2302e9554658Smrg# [ACTION-IF-NOT-FOUND])
2303e9554658Smrg#
2304e9554658Smrg#
2305e9554658Smrg# Note that if there is a possibility the first call to
2306e9554658Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
2307e9554658Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2308e9554658Smrg#
2309e9554658Smrg#
2310e9554658Smrg# --------------------------------------------------------------
2311e9554658SmrgAC_DEFUN([PKG_CHECK_MODULES],
2312e9554658Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2313e9554658SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2314e9554658SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2315e9554658Smrg
2316e9554658Smrgpkg_failed=no
2317e9554658SmrgAC_MSG_CHECKING([for $1])
2318e9554658Smrg
2319e9554658Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2320e9554658Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2321e9554658Smrg
2322c2b339b4Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2323c2b339b4Smrgand $1[]_LIBS to avoid the need to call pkg-config.
2324c2b339b4SmrgSee the pkg-config man page for more details.])
2325c2b339b4Smrg
2326e9554658Smrgif test $pkg_failed = yes; then
2327c2b339b4Smrg        _PKG_SHORT_ERRORS_SUPPORTED
2328c2b339b4Smrg        if test $_pkg_short_errors_supported = yes; then
2329c2b339b4Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
2330c2b339b4Smrg        else 
2331c2b339b4Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
2332c2b339b4Smrg        fi
2333e9554658Smrg	# Put the nasty error message in config.log where it belongs
2334c2b339b4Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2335e9554658Smrg
2336e9554658Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
2337c2b339b4Smrg[Package requirements ($2) were not met:
2338c2b339b4Smrg
2339c2b339b4Smrg$$1_PKG_ERRORS
2340c2b339b4Smrg
2341e9554658SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
2342e9554658Smrginstalled software in a non-standard prefix.
2343e9554658Smrg
2344c2b339b4Smrg_PKG_TEXT
2345c2b339b4Smrg])],
2346c2b339b4Smrg		[AC_MSG_RESULT([no])
2347c2b339b4Smrg                $4])
2348e9554658Smrgelif test $pkg_failed = untried; then
2349e9554658Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
2350e9554658Smrg[The pkg-config script could not be found or is too old.  Make sure it
2351e9554658Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
2352e9554658Smrgpath to pkg-config.
2353e9554658Smrg
2354c2b339b4Smrg_PKG_TEXT
2355e9554658Smrg
2356c2b339b4SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
2357e9554658Smrg		[$4])
2358e9554658Smrgelse
2359e9554658Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2360e9554658Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2361e9554658Smrg        AC_MSG_RESULT([yes])
2362e9554658Smrg	ifelse([$3], , :, [$3])
2363e9554658Smrgfi[]dnl
2364e9554658Smrg])# PKG_CHECK_MODULES
2365e9554658Smrg
2366