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