aclocal.m4 revision 4f9ac78a
14f9ac78aSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2d1333322Smrg
3d1333322Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
44f9ac78aSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5d1333322Smrg# This file is free software; the Free Software Foundation
6d1333322Smrg# gives unlimited permission to copy and/or distribute it,
7d1333322Smrg# with or without modifications, as long as this notice is preserved.
8d1333322Smrg
9d1333322Smrg# This program is distributed in the hope that it will be useful,
10d1333322Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11d1333322Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12d1333322Smrg# PARTICULAR PURPOSE.
13d1333322Smrg
144f9ac78aSmrgm4_ifndef([AC_AUTOCONF_VERSION],
154f9ac78aSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
164f9ac78aSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
174f9ac78aSmrg[m4_warning([this file was generated for autoconf 2.68.
184f9ac78aSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
194f9ac78aSmrgIf you have problems, you may need to regenerate the build system entirely.
204f9ac78aSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21d1333322Smrg
224f9ac78aSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23d1333322Smrg#
24d1333322Smrg# This file is free software; the Free Software Foundation
25d1333322Smrg# gives unlimited permission to copy and/or distribute it,
26d1333322Smrg# with or without modifications, as long as this notice is preserved.
27d1333322Smrg
28d1333322Smrg# AM_AUTOMAKE_VERSION(VERSION)
29d1333322Smrg# ----------------------------
30d1333322Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31d1333322Smrg# generated from the m4 files accompanying Automake X.Y.
32d1333322Smrg# (This private macro should not be called outside this file.)
33d1333322SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
344f9ac78aSmrg[am__api_version='1.11'
35d1333322Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36d1333322Smrgdnl require some minimum version.  Point them to the right macro.
374f9ac78aSmrgm4_if([$1], [1.11.1], [],
38d1333322Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39d1333322Smrg])
40d1333322Smrg
41d1333322Smrg# _AM_AUTOCONF_VERSION(VERSION)
42d1333322Smrg# -----------------------------
43d1333322Smrg# aclocal traces this macro to find the Autoconf version.
44d1333322Smrg# This is a private macro too.  Using m4_define simplifies
45d1333322Smrg# the logic in aclocal, which can simply ignore this definition.
46d1333322Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47d1333322Smrg
48d1333322Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49d1333322Smrg# -------------------------------
50d1333322Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
514f9ac78aSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52d1333322SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
534f9ac78aSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
544f9ac78aSmrgm4_ifndef([AC_AUTOCONF_VERSION],
554f9ac78aSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
564f9ac78aSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57d1333322Smrg
58d1333322Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59d1333322Smrg
60d1333322Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61d1333322Smrg#
62d1333322Smrg# This file is free software; the Free Software Foundation
63d1333322Smrg# gives unlimited permission to copy and/or distribute it,
64d1333322Smrg# with or without modifications, as long as this notice is preserved.
65d1333322Smrg
66d1333322Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67d1333322Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68d1333322Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69d1333322Smrg#
70d1333322Smrg# Of course, Automake must honor this variable whenever it calls a
71d1333322Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72d1333322Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73d1333322Smrg# depending on how configure is run.  This is pretty annoying, since
74d1333322Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75d1333322Smrg# source directory, any form will work fine, but in subdirectories a
76d1333322Smrg# relative path needs to be adjusted first.
77d1333322Smrg#
78d1333322Smrg# $ac_aux_dir/missing
79d1333322Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80d1333322Smrg# $top_srcdir/$ac_aux_dir/missing
81d1333322Smrg#    fails if $ac_aux_dir is absolute,
82d1333322Smrg#    fails when called from a subdirectory in a VPATH build with
83d1333322Smrg#          a relative $ac_aux_dir
84d1333322Smrg#
85d1333322Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86d1333322Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
87d1333322Smrg# harmless because $srcdir is `.', but things will broke when you
88d1333322Smrg# start a VPATH build or use an absolute $srcdir.
89d1333322Smrg#
90d1333322Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91d1333322Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92d1333322Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93d1333322Smrg# and then we would define $MISSING as
94d1333322Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95d1333322Smrg# This will work as long as MISSING is not called from configure, because
96d1333322Smrg# unfortunately $(top_srcdir) has no meaning in configure.
97d1333322Smrg# However there are other variables, like CC, which are often used in
98d1333322Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99d1333322Smrg#
100d1333322Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
101d1333322Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
102d1333322Smrg# configured tree to be moved without reconfiguration.
103d1333322Smrg
104d1333322SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105d1333322Smrg[dnl Rely on autoconf to set up CDPATH properly.
106d1333322SmrgAC_PREREQ([2.50])dnl
107d1333322Smrg# expand $ac_aux_dir to an absolute path
108d1333322Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
109d1333322Smrg])
110d1333322Smrg
111d1333322Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112d1333322Smrg
1134f9ac78aSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114d1333322Smrg# Free Software Foundation, Inc.
115d1333322Smrg#
116d1333322Smrg# This file is free software; the Free Software Foundation
117d1333322Smrg# gives unlimited permission to copy and/or distribute it,
118d1333322Smrg# with or without modifications, as long as this notice is preserved.
119d1333322Smrg
1204f9ac78aSmrg# serial 9
121d1333322Smrg
122d1333322Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123d1333322Smrg# -------------------------------------
124d1333322Smrg# Define a conditional.
125d1333322SmrgAC_DEFUN([AM_CONDITIONAL],
126d1333322Smrg[AC_PREREQ(2.52)dnl
127d1333322Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128d1333322Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129d1333322SmrgAC_SUBST([$1_TRUE])dnl
130d1333322SmrgAC_SUBST([$1_FALSE])dnl
131d1333322Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132d1333322Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1334f9ac78aSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134d1333322Smrgif $2; then
135d1333322Smrg  $1_TRUE=
136d1333322Smrg  $1_FALSE='#'
137d1333322Smrgelse
138d1333322Smrg  $1_TRUE='#'
139d1333322Smrg  $1_FALSE=
140d1333322Smrgfi
141d1333322SmrgAC_CONFIG_COMMANDS_PRE(
142d1333322Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143d1333322Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144d1333322SmrgUsually this means the macro was only invoked conditionally.]])
145d1333322Smrgfi])])
146d1333322Smrg
1474f9ac78aSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148d1333322Smrg# Free Software Foundation, Inc.
149d1333322Smrg#
150d1333322Smrg# This file is free software; the Free Software Foundation
151d1333322Smrg# gives unlimited permission to copy and/or distribute it,
152d1333322Smrg# with or without modifications, as long as this notice is preserved.
153d1333322Smrg
1544f9ac78aSmrg# serial 10
155d1333322Smrg
156d1333322Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157d1333322Smrg# written in clear, in which case automake, when reading aclocal.m4,
158d1333322Smrg# will think it sees a *use*, and therefore will trigger all it's
159d1333322Smrg# C support machinery.  Also note that it means that autoscan, seeing
160d1333322Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161d1333322Smrg
162d1333322Smrg
163d1333322Smrg# _AM_DEPENDENCIES(NAME)
164d1333322Smrg# ----------------------
165d1333322Smrg# See how the compiler implements dependency checking.
166d1333322Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167d1333322Smrg# We try a few techniques and use that to set a single cache variable.
168d1333322Smrg#
169d1333322Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170d1333322Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171d1333322Smrg# dependency, and given that the user is not expected to run this macro,
172d1333322Smrg# just rely on AC_PROG_CC.
173d1333322SmrgAC_DEFUN([_AM_DEPENDENCIES],
174d1333322Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175d1333322SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176d1333322SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177d1333322SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178d1333322Smrg
179d1333322Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180d1333322Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181d1333322Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182d1333322Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183d1333322Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184d1333322Smrg                   [depcc="$$1"   am_compiler_list=])
185d1333322Smrg
186d1333322SmrgAC_CACHE_CHECK([dependency style of $depcc],
187d1333322Smrg               [am_cv_$1_dependencies_compiler_type],
188d1333322Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189d1333322Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
190d1333322Smrg  # making bogus files that we don't know about and never remove.  For
191d1333322Smrg  # instance it was reported that on HP-UX the gcc test will end up
192d1333322Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
193d1333322Smrg  # in D'.
194d1333322Smrg  mkdir conftest.dir
195d1333322Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196d1333322Smrg  # using a relative directory.
197d1333322Smrg  cp "$am_depcomp" conftest.dir
198d1333322Smrg  cd conftest.dir
199d1333322Smrg  # We will build objects and dependencies in a subdirectory because
200d1333322Smrg  # it helps to detect inapplicable dependency modes.  For instance
201d1333322Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202d1333322Smrg  # side effect of compilation, but ICC will put the dependencies in
203d1333322Smrg  # the current directory while Tru64 will put them in the object
204d1333322Smrg  # directory.
205d1333322Smrg  mkdir sub
206d1333322Smrg
207d1333322Smrg  am_cv_$1_dependencies_compiler_type=none
208d1333322Smrg  if test "$am_compiler_list" = ""; then
209d1333322Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210d1333322Smrg  fi
2114f9ac78aSmrg  am__universal=false
2124f9ac78aSmrg  m4_case([$1], [CC],
2134f9ac78aSmrg    [case " $depcc " in #(
2144f9ac78aSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2154f9ac78aSmrg     esac],
2164f9ac78aSmrg    [CXX],
2174f9ac78aSmrg    [case " $depcc " in #(
2184f9ac78aSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2194f9ac78aSmrg     esac])
2204f9ac78aSmrg
221d1333322Smrg  for depmode in $am_compiler_list; do
222d1333322Smrg    # Setup a source with many dependencies, because some compilers
223d1333322Smrg    # like to wrap large dependency lists on column 80 (with \), and
224d1333322Smrg    # we should not choose a depcomp mode which is confused by this.
225d1333322Smrg    #
226d1333322Smrg    # We need to recreate these files for each test, as the compiler may
227d1333322Smrg    # overwrite some of them when testing with obscure command lines.
228d1333322Smrg    # This happens at least with the AIX C compiler.
229d1333322Smrg    : > sub/conftest.c
230d1333322Smrg    for i in 1 2 3 4 5 6; do
231d1333322Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232d1333322Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233d1333322Smrg      # Solaris 8's {/usr,}/bin/sh.
234d1333322Smrg      touch sub/conftst$i.h
235d1333322Smrg    done
236d1333322Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237d1333322Smrg
2384f9ac78aSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2394f9ac78aSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2404f9ac78aSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
2414f9ac78aSmrg    # versions had trouble with output in subdirs
2424f9ac78aSmrg    am__obj=sub/conftest.${OBJEXT-o}
2434f9ac78aSmrg    am__minus_obj="-o $am__obj"
244d1333322Smrg    case $depmode in
2454f9ac78aSmrg    gcc)
2464f9ac78aSmrg      # This depmode causes a compiler race in universal mode.
2474f9ac78aSmrg      test "$am__universal" = false || continue
2484f9ac78aSmrg      ;;
249d1333322Smrg    nosideeffect)
250d1333322Smrg      # after this tag, mechanisms are not by side-effect, so they'll
251d1333322Smrg      # only be used when explicitly requested
252d1333322Smrg      if test "x$enable_dependency_tracking" = xyes; then
253d1333322Smrg	continue
254d1333322Smrg      else
255d1333322Smrg	break
256d1333322Smrg      fi
257d1333322Smrg      ;;
2584f9ac78aSmrg    msvisualcpp | msvcmsys)
2594f9ac78aSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
2604f9ac78aSmrg      # not run yet.  These depmodes are late enough in the game, and
2614f9ac78aSmrg      # so weak that their functioning should not be impacted.
2624f9ac78aSmrg      am__obj=conftest.${OBJEXT-o}
2634f9ac78aSmrg      am__minus_obj=
2644f9ac78aSmrg      ;;
265d1333322Smrg    none) break ;;
266d1333322Smrg    esac
267d1333322Smrg    if depmode=$depmode \
2684f9ac78aSmrg       source=sub/conftest.c object=$am__obj \
269d1333322Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2704f9ac78aSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271d1333322Smrg         >/dev/null 2>conftest.err &&
272d1333322Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273d1333322Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2744f9ac78aSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275d1333322Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276d1333322Smrg      # icc doesn't choke on unknown options, it will just issue warnings
277d1333322Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
278d1333322Smrg      # that says an option was ignored or not supported.
279d1333322Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280d1333322Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281d1333322Smrg      # The diagnosis changed in icc 8.0:
282d1333322Smrg      #   icc: Command line remark: option '-MP' not supported
283d1333322Smrg      if (grep 'ignoring option' conftest.err ||
284d1333322Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285d1333322Smrg        am_cv_$1_dependencies_compiler_type=$depmode
286d1333322Smrg        break
287d1333322Smrg      fi
288d1333322Smrg    fi
289d1333322Smrg  done
290d1333322Smrg
291d1333322Smrg  cd ..
292d1333322Smrg  rm -rf conftest.dir
293d1333322Smrgelse
294d1333322Smrg  am_cv_$1_dependencies_compiler_type=none
295d1333322Smrgfi
296d1333322Smrg])
297d1333322SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298d1333322SmrgAM_CONDITIONAL([am__fastdep$1], [
299d1333322Smrg  test "x$enable_dependency_tracking" != xno \
300d1333322Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301d1333322Smrg])
302d1333322Smrg
303d1333322Smrg
304d1333322Smrg# AM_SET_DEPDIR
305d1333322Smrg# -------------
306d1333322Smrg# Choose a directory name for dependency files.
307d1333322Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308d1333322SmrgAC_DEFUN([AM_SET_DEPDIR],
309d1333322Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310d1333322SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311d1333322Smrg])
312d1333322Smrg
313d1333322Smrg
314d1333322Smrg# AM_DEP_TRACK
315d1333322Smrg# ------------
316d1333322SmrgAC_DEFUN([AM_DEP_TRACK],
317d1333322Smrg[AC_ARG_ENABLE(dependency-tracking,
318d1333322Smrg[  --disable-dependency-tracking  speeds up one-time build
319d1333322Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320d1333322Smrgif test "x$enable_dependency_tracking" != xno; then
321d1333322Smrg  am_depcomp="$ac_aux_dir/depcomp"
322d1333322Smrg  AMDEPBACKSLASH='\'
323d1333322Smrgfi
324d1333322SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325d1333322SmrgAC_SUBST([AMDEPBACKSLASH])dnl
326d1333322Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327d1333322Smrg])
328d1333322Smrg
329d1333322Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330d1333322Smrg
3314f9ac78aSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332d1333322Smrg# Free Software Foundation, Inc.
333d1333322Smrg#
334d1333322Smrg# This file is free software; the Free Software Foundation
335d1333322Smrg# gives unlimited permission to copy and/or distribute it,
336d1333322Smrg# with or without modifications, as long as this notice is preserved.
337d1333322Smrg
3384f9ac78aSmrg#serial 5
339d1333322Smrg
340d1333322Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341d1333322Smrg# ------------------------------
342d1333322SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3434f9ac78aSmrg[{
3444f9ac78aSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
3454f9ac78aSmrg  # are listed without --file.  Let's play safe and only enable the eval
3464f9ac78aSmrg  # if we detect the quoting.
3474f9ac78aSmrg  case $CONFIG_FILES in
3484f9ac78aSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
3494f9ac78aSmrg  *)   set x $CONFIG_FILES ;;
3504f9ac78aSmrg  esac
3514f9ac78aSmrg  shift
3524f9ac78aSmrg  for mf
3534f9ac78aSmrg  do
3544f9ac78aSmrg    # Strip MF so we end up with the name of the file.
3554f9ac78aSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3564f9ac78aSmrg    # Check whether this is an Automake generated Makefile or not.
3574f9ac78aSmrg    # We used to match only the files named `Makefile.in', but
3584f9ac78aSmrg    # some people rename them; so instead we look at the file content.
3594f9ac78aSmrg    # Grep'ing the first line is not enough: some people post-process
3604f9ac78aSmrg    # each Makefile.in and add a new line on top of each file to say so.
3614f9ac78aSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
3624f9ac78aSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
3634f9ac78aSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3644f9ac78aSmrg      dirpart=`AS_DIRNAME("$mf")`
3654f9ac78aSmrg    else
3664f9ac78aSmrg      continue
3674f9ac78aSmrg    fi
3684f9ac78aSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
3694f9ac78aSmrg    # from the Makefile without running `make'.
3704f9ac78aSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3714f9ac78aSmrg    test -z "$DEPDIR" && continue
3724f9ac78aSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3734f9ac78aSmrg    test -z "am__include" && continue
3744f9ac78aSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3754f9ac78aSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
3764f9ac78aSmrg    U=`sed -n 's/^U = //p' < "$mf"`
3774f9ac78aSmrg    # Find all dependency output files, they are included files with
3784f9ac78aSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3794f9ac78aSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3804f9ac78aSmrg    # expansion.
3814f9ac78aSmrg    for file in `sed -n "
3824f9ac78aSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3834f9ac78aSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3844f9ac78aSmrg      # Make sure the directory exists.
3854f9ac78aSmrg      test -f "$dirpart/$file" && continue
3864f9ac78aSmrg      fdir=`AS_DIRNAME(["$file"])`
3874f9ac78aSmrg      AS_MKDIR_P([$dirpart/$fdir])
3884f9ac78aSmrg      # echo "creating $dirpart/$file"
3894f9ac78aSmrg      echo '# dummy' > "$dirpart/$file"
3904f9ac78aSmrg    done
391d1333322Smrg  done
3924f9ac78aSmrg}
393d1333322Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394d1333322Smrg
395d1333322Smrg
396d1333322Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397d1333322Smrg# -----------------------------
398d1333322Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
399d1333322Smrg#
400d1333322Smrg# This code is only required when automatic dependency tracking
401d1333322Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
402d1333322Smrg# need in order to bootstrap the dependency handling code.
403d1333322SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404d1333322Smrg[AC_CONFIG_COMMANDS([depfiles],
405d1333322Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406d1333322Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407d1333322Smrg])
408d1333322Smrg
409d1333322Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
410d1333322Smrg# Free Software Foundation, Inc.
411d1333322Smrg#
412d1333322Smrg# This file is free software; the Free Software Foundation
413d1333322Smrg# gives unlimited permission to copy and/or distribute it,
414d1333322Smrg# with or without modifications, as long as this notice is preserved.
415d1333322Smrg
416d1333322Smrg# serial 8
417d1333322Smrg
418d1333322Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
419d1333322SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
420d1333322Smrg
421d1333322Smrg# Do all the work for Automake.                             -*- Autoconf -*-
422d1333322Smrg
423d1333322Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4244f9ac78aSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
425d1333322Smrg#
426d1333322Smrg# This file is free software; the Free Software Foundation
427d1333322Smrg# gives unlimited permission to copy and/or distribute it,
428d1333322Smrg# with or without modifications, as long as this notice is preserved.
429d1333322Smrg
4304f9ac78aSmrg# serial 16
431d1333322Smrg
432d1333322Smrg# This macro actually does too much.  Some checks are only needed if
433d1333322Smrg# your package does certain things.  But this isn't really a big deal.
434d1333322Smrg
435d1333322Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
436d1333322Smrg# AM_INIT_AUTOMAKE([OPTIONS])
437d1333322Smrg# -----------------------------------------------
438d1333322Smrg# The call with PACKAGE and VERSION arguments is the old style
439d1333322Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
440d1333322Smrg# and VERSION should now be passed to AC_INIT and removed from
441d1333322Smrg# the call to AM_INIT_AUTOMAKE.
442d1333322Smrg# We support both call styles for the transition.  After
443d1333322Smrg# the next Automake release, Autoconf can make the AC_INIT
444d1333322Smrg# arguments mandatory, and then we can depend on a new Autoconf
445d1333322Smrg# release and drop the old call support.
446d1333322SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4474f9ac78aSmrg[AC_PREREQ([2.62])dnl
448d1333322Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
449d1333322Smrgdnl the ones we care about.
450d1333322Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
451d1333322SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
452d1333322SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
453d1333322Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
454d1333322Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
455d1333322Smrg  # is not polluted with repeated "-I."
456d1333322Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
457d1333322Smrg  # test to see if srcdir already configured
458d1333322Smrg  if test -f $srcdir/config.status; then
459d1333322Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
460d1333322Smrg  fi
461d1333322Smrgfi
462d1333322Smrg
463d1333322Smrg# test whether we have cygpath
464d1333322Smrgif test -z "$CYGPATH_W"; then
465d1333322Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
466d1333322Smrg    CYGPATH_W='cygpath -w'
467d1333322Smrg  else
468d1333322Smrg    CYGPATH_W=echo
469d1333322Smrg  fi
470d1333322Smrgfi
471d1333322SmrgAC_SUBST([CYGPATH_W])
472d1333322Smrg
473d1333322Smrg# Define the identity of the package.
474d1333322Smrgdnl Distinguish between old-style and new-style calls.
475d1333322Smrgm4_ifval([$2],
476d1333322Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
477d1333322Smrg AC_SUBST([PACKAGE], [$1])dnl
478d1333322Smrg AC_SUBST([VERSION], [$2])],
479d1333322Smrg[_AM_SET_OPTIONS([$1])dnl
480d1333322Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
481d1333322Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
482d1333322Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
483d1333322Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
484d1333322Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
485d1333322Smrg
486d1333322Smrg_AM_IF_OPTION([no-define],,
487d1333322Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
488d1333322Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489d1333322Smrg
490d1333322Smrg# Some tools Automake needs.
491d1333322SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
492d1333322SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
493d1333322SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
494d1333322SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
495d1333322SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
496d1333322SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
497d1333322SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4984f9ac78aSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4994f9ac78aSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
500d1333322SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
501d1333322Smrg# We need awk for the "check" target.  The system "awk" is bad on
502d1333322Smrg# some platforms.
503d1333322SmrgAC_REQUIRE([AC_PROG_AWK])dnl
504d1333322SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
505d1333322SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
506d1333322Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
5074f9ac78aSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
5084f9ac78aSmrg			     [_AM_PROG_TAR([v7])])])
509d1333322Smrg_AM_IF_OPTION([no-dependencies],,
510d1333322Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
5114f9ac78aSmrg		  [_AM_DEPENDENCIES(CC)],
5124f9ac78aSmrg		  [define([AC_PROG_CC],
5134f9ac78aSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
514d1333322SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5154f9ac78aSmrg		  [_AM_DEPENDENCIES(CXX)],
5164f9ac78aSmrg		  [define([AC_PROG_CXX],
5174f9ac78aSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
518d1333322SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5194f9ac78aSmrg		  [_AM_DEPENDENCIES(OBJC)],
5204f9ac78aSmrg		  [define([AC_PROG_OBJC],
5214f9ac78aSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
522d1333322Smrg])
5234f9ac78aSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5244f9ac78aSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5254f9ac78aSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5264f9ac78aSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5274f9ac78aSmrgAC_CONFIG_COMMANDS_PRE(dnl
5284f9ac78aSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5294f9ac78aSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
530d1333322Smrg])
531d1333322Smrg
5324f9ac78aSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5334f9ac78aSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5344f9ac78aSmrgdnl mangled by Autoconf and run in a shell conditional statement.
5354f9ac78aSmrgm4_define([_AC_COMPILER_EXEEXT],
5364f9ac78aSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5374f9ac78aSmrg
538d1333322Smrg
539d1333322Smrg# When config.status generates a header, we must update the stamp-h file.
540d1333322Smrg# This file resides in the same directory as the config header
541d1333322Smrg# that is generated.  The stamp files are numbered to have different names.
542d1333322Smrg
543d1333322Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
544d1333322Smrg# loop where config.status creates the headers, so we can generate
545d1333322Smrg# our stamp files there.
546d1333322SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
547d1333322Smrg[# Compute $1's index in $config_headers.
5484f9ac78aSmrg_am_arg=$1
549d1333322Smrg_am_stamp_count=1
550d1333322Smrgfor _am_header in $config_headers :; do
551d1333322Smrg  case $_am_header in
5524f9ac78aSmrg    $_am_arg | $_am_arg:* )
553d1333322Smrg      break ;;
554d1333322Smrg    * )
555d1333322Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
556d1333322Smrg  esac
557d1333322Smrgdone
5584f9ac78aSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
559d1333322Smrg
5604f9ac78aSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
561d1333322Smrg#
562d1333322Smrg# This file is free software; the Free Software Foundation
563d1333322Smrg# gives unlimited permission to copy and/or distribute it,
564d1333322Smrg# with or without modifications, as long as this notice is preserved.
565d1333322Smrg
566d1333322Smrg# AM_PROG_INSTALL_SH
567d1333322Smrg# ------------------
568d1333322Smrg# Define $install_sh.
569d1333322SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
570d1333322Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5714f9ac78aSmrgif test x"${install_sh}" != xset; then
5724f9ac78aSmrg  case $am_aux_dir in
5734f9ac78aSmrg  *\ * | *\	*)
5744f9ac78aSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5754f9ac78aSmrg  *)
5764f9ac78aSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5774f9ac78aSmrg  esac
5784f9ac78aSmrgfi
579d1333322SmrgAC_SUBST(install_sh)])
580d1333322Smrg
581d1333322Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
582d1333322Smrg#
583d1333322Smrg# This file is free software; the Free Software Foundation
584d1333322Smrg# gives unlimited permission to copy and/or distribute it,
585d1333322Smrg# with or without modifications, as long as this notice is preserved.
586d1333322Smrg
587d1333322Smrg# serial 2
588d1333322Smrg
589d1333322Smrg# Check whether the underlying file-system supports filenames
590d1333322Smrg# with a leading dot.  For instance MS-DOS doesn't.
591d1333322SmrgAC_DEFUN([AM_SET_LEADING_DOT],
592d1333322Smrg[rm -rf .tst 2>/dev/null
593d1333322Smrgmkdir .tst 2>/dev/null
594d1333322Smrgif test -d .tst; then
595d1333322Smrg  am__leading_dot=.
596d1333322Smrgelse
597d1333322Smrg  am__leading_dot=_
598d1333322Smrgfi
599d1333322Smrgrmdir .tst 2>/dev/null
600d1333322SmrgAC_SUBST([am__leading_dot])])
601d1333322Smrg
602d1333322Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
603d1333322Smrg# From Jim Meyering
604d1333322Smrg
6054f9ac78aSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
606d1333322Smrg# Free Software Foundation, Inc.
607d1333322Smrg#
608d1333322Smrg# This file is free software; the Free Software Foundation
609d1333322Smrg# gives unlimited permission to copy and/or distribute it,
610d1333322Smrg# with or without modifications, as long as this notice is preserved.
611d1333322Smrg
6124f9ac78aSmrg# serial 5
613d1333322Smrg
6144f9ac78aSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6154f9ac78aSmrg# ----------------------------------
6164f9ac78aSmrg# Control maintainer-specific portions of Makefiles.
6174f9ac78aSmrg# Default is to disable them, unless `enable' is passed literally.
6184f9ac78aSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6194f9ac78aSmrg# can override the default with the --enable/--disable switch.
620d1333322SmrgAC_DEFUN([AM_MAINTAINER_MODE],
6214f9ac78aSmrg[m4_case(m4_default([$1], [disable]),
6224f9ac78aSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
6234f9ac78aSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
6244f9ac78aSmrg       [m4_define([am_maintainer_other], [enable])
6254f9ac78aSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6264f9ac78aSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6274f9ac78aSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6284f9ac78aSmrg  AC_ARG_ENABLE([maintainer-mode],
6294f9ac78aSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
630d1333322Smrg			  (and sometimes confusing) to the casual installer],
6314f9ac78aSmrg      [USE_MAINTAINER_MODE=$enableval],
6324f9ac78aSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
633d1333322Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6344f9ac78aSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
635d1333322Smrg  MAINT=$MAINTAINER_MODE_TRUE
6364f9ac78aSmrg  AC_SUBST([MAINT])dnl
637d1333322Smrg]
638d1333322Smrg)
639d1333322Smrg
640d1333322SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
641d1333322Smrg
642d1333322Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
643d1333322Smrg
6444f9ac78aSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
645d1333322Smrg#
646d1333322Smrg# This file is free software; the Free Software Foundation
647d1333322Smrg# gives unlimited permission to copy and/or distribute it,
648d1333322Smrg# with or without modifications, as long as this notice is preserved.
649d1333322Smrg
6504f9ac78aSmrg# serial 4
651d1333322Smrg
652d1333322Smrg# AM_MAKE_INCLUDE()
653d1333322Smrg# -----------------
654d1333322Smrg# Check to see how make treats includes.
655d1333322SmrgAC_DEFUN([AM_MAKE_INCLUDE],
656d1333322Smrg[am_make=${MAKE-make}
657d1333322Smrgcat > confinc << 'END'
658d1333322Smrgam__doit:
6594f9ac78aSmrg	@echo this is the am__doit target
660d1333322Smrg.PHONY: am__doit
661d1333322SmrgEND
662d1333322Smrg# If we don't find an include directive, just comment out the code.
663d1333322SmrgAC_MSG_CHECKING([for style of include used by $am_make])
664d1333322Smrgam__include="#"
665d1333322Smrgam__quote=
666d1333322Smrg_am_result=none
667d1333322Smrg# First try GNU make style include.
668d1333322Smrgecho "include confinc" > confmf
6694f9ac78aSmrg# Ignore all kinds of additional output from `make'.
6704f9ac78aSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6714f9ac78aSmrg*the\ am__doit\ target*)
6724f9ac78aSmrg  am__include=include
6734f9ac78aSmrg  am__quote=
6744f9ac78aSmrg  _am_result=GNU
6754f9ac78aSmrg  ;;
6764f9ac78aSmrgesac
677d1333322Smrg# Now try BSD make style include.
678d1333322Smrgif test "$am__include" = "#"; then
679d1333322Smrg   echo '.include "confinc"' > confmf
6804f9ac78aSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6814f9ac78aSmrg   *the\ am__doit\ target*)
6824f9ac78aSmrg     am__include=.include
6834f9ac78aSmrg     am__quote="\""
6844f9ac78aSmrg     _am_result=BSD
6854f9ac78aSmrg     ;;
6864f9ac78aSmrg   esac
687d1333322Smrgfi
688d1333322SmrgAC_SUBST([am__include])
689d1333322SmrgAC_SUBST([am__quote])
690d1333322SmrgAC_MSG_RESULT([$_am_result])
691d1333322Smrgrm -f confinc confmf
692d1333322Smrg])
693d1333322Smrg
694d1333322Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
695d1333322Smrg
6964f9ac78aSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
697d1333322Smrg# Free Software Foundation, Inc.
698d1333322Smrg#
699d1333322Smrg# This file is free software; the Free Software Foundation
700d1333322Smrg# gives unlimited permission to copy and/or distribute it,
701d1333322Smrg# with or without modifications, as long as this notice is preserved.
702d1333322Smrg
7034f9ac78aSmrg# serial 6
704d1333322Smrg
705d1333322Smrg# AM_MISSING_PROG(NAME, PROGRAM)
706d1333322Smrg# ------------------------------
707d1333322SmrgAC_DEFUN([AM_MISSING_PROG],
708d1333322Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
709d1333322Smrg$1=${$1-"${am_missing_run}$2"}
710d1333322SmrgAC_SUBST($1)])
711d1333322Smrg
712d1333322Smrg
713d1333322Smrg# AM_MISSING_HAS_RUN
714d1333322Smrg# ------------------
715d1333322Smrg# Define MISSING if not defined so far and test if it supports --run.
716d1333322Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
717d1333322SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
718d1333322Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
719d1333322SmrgAC_REQUIRE_AUX_FILE([missing])dnl
7204f9ac78aSmrgif test x"${MISSING+set}" != xset; then
7214f9ac78aSmrg  case $am_aux_dir in
7224f9ac78aSmrg  *\ * | *\	*)
7234f9ac78aSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7244f9ac78aSmrg  *)
7254f9ac78aSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7264f9ac78aSmrg  esac
7274f9ac78aSmrgfi
728d1333322Smrg# Use eval to expand $SHELL
729d1333322Smrgif eval "$MISSING --run true"; then
730d1333322Smrg  am_missing_run="$MISSING --run "
731d1333322Smrgelse
732d1333322Smrg  am_missing_run=
733d1333322Smrg  AC_MSG_WARN([`missing' script is too old or missing])
734d1333322Smrgfi
735d1333322Smrg])
736d1333322Smrg
737d1333322Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
738d1333322Smrg#
739d1333322Smrg# This file is free software; the Free Software Foundation
740d1333322Smrg# gives unlimited permission to copy and/or distribute it,
741d1333322Smrg# with or without modifications, as long as this notice is preserved.
742d1333322Smrg
743d1333322Smrg# AM_PROG_MKDIR_P
744d1333322Smrg# ---------------
745d1333322Smrg# Check for `mkdir -p'.
746d1333322SmrgAC_DEFUN([AM_PROG_MKDIR_P],
747d1333322Smrg[AC_PREREQ([2.60])dnl
748d1333322SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
749d1333322Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
750d1333322Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
751d1333322Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
752d1333322Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
753d1333322Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
754d1333322Smrgdnl adjustment using top_builddir (which is defined more often than
755d1333322Smrgdnl MKDIR_P).
756d1333322SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
757d1333322Smrgcase $mkdir_p in
758d1333322Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
759d1333322Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
760d1333322Smrgesac
761d1333322Smrg])
762d1333322Smrg
763d1333322Smrg# Helper functions for option handling.                     -*- Autoconf -*-
764d1333322Smrg
7654f9ac78aSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
766d1333322Smrg#
767d1333322Smrg# This file is free software; the Free Software Foundation
768d1333322Smrg# gives unlimited permission to copy and/or distribute it,
769d1333322Smrg# with or without modifications, as long as this notice is preserved.
770d1333322Smrg
7714f9ac78aSmrg# serial 4
772d1333322Smrg
773d1333322Smrg# _AM_MANGLE_OPTION(NAME)
774d1333322Smrg# -----------------------
775d1333322SmrgAC_DEFUN([_AM_MANGLE_OPTION],
776d1333322Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
777d1333322Smrg
778d1333322Smrg# _AM_SET_OPTION(NAME)
779d1333322Smrg# ------------------------------
780d1333322Smrg# Set option NAME.  Presently that only means defining a flag for this option.
781d1333322SmrgAC_DEFUN([_AM_SET_OPTION],
782d1333322Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
783d1333322Smrg
784d1333322Smrg# _AM_SET_OPTIONS(OPTIONS)
785d1333322Smrg# ----------------------------------
786d1333322Smrg# OPTIONS is a space-separated list of Automake options.
787d1333322SmrgAC_DEFUN([_AM_SET_OPTIONS],
7884f9ac78aSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
789d1333322Smrg
790d1333322Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
791d1333322Smrg# -------------------------------------------
792d1333322Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
793d1333322SmrgAC_DEFUN([_AM_IF_OPTION],
794d1333322Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
795d1333322Smrg
796d1333322Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
797d1333322Smrg
7984f9ac78aSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
799d1333322Smrg# Free Software Foundation, Inc.
800d1333322Smrg#
801d1333322Smrg# This file is free software; the Free Software Foundation
802d1333322Smrg# gives unlimited permission to copy and/or distribute it,
803d1333322Smrg# with or without modifications, as long as this notice is preserved.
804d1333322Smrg
8054f9ac78aSmrg# serial 5
806d1333322Smrg
807d1333322Smrg# AM_SANITY_CHECK
808d1333322Smrg# ---------------
809d1333322SmrgAC_DEFUN([AM_SANITY_CHECK],
810d1333322Smrg[AC_MSG_CHECKING([whether build environment is sane])
811d1333322Smrg# Just in case
812d1333322Smrgsleep 1
813d1333322Smrgecho timestamp > conftest.file
8144f9ac78aSmrg# Reject unsafe characters in $srcdir or the absolute working directory
8154f9ac78aSmrg# name.  Accept space and tab only in the latter.
8164f9ac78aSmrgam_lf='
8174f9ac78aSmrg'
8184f9ac78aSmrgcase `pwd` in
8194f9ac78aSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8204f9ac78aSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8214f9ac78aSmrgesac
8224f9ac78aSmrgcase $srcdir in
8234f9ac78aSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8244f9ac78aSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8254f9ac78aSmrgesac
8264f9ac78aSmrg
827d1333322Smrg# Do `set' in a subshell so we don't clobber the current shell's
828d1333322Smrg# arguments.  Must try -L first in case configure is actually a
829d1333322Smrg# symlink; some systems play weird games with the mod time of symlinks
830d1333322Smrg# (eg FreeBSD returns the mod time of the symlink's containing
831d1333322Smrg# directory).
832d1333322Smrgif (
8334f9ac78aSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
834d1333322Smrg   if test "$[*]" = "X"; then
835d1333322Smrg      # -L didn't work.
8364f9ac78aSmrg      set X `ls -t "$srcdir/configure" conftest.file`
837d1333322Smrg   fi
838d1333322Smrg   rm -f conftest.file
839d1333322Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
840d1333322Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
841d1333322Smrg
842d1333322Smrg      # If neither matched, then we have a broken ls.  This can happen
843d1333322Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
844d1333322Smrg      # broken ls alias from the environment.  This has actually
845d1333322Smrg      # happened.  Such a system could not be considered "sane".
846d1333322Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
847d1333322Smrgalias in your environment])
848d1333322Smrg   fi
849d1333322Smrg
850d1333322Smrg   test "$[2]" = conftest.file
851d1333322Smrg   )
852d1333322Smrgthen
853d1333322Smrg   # Ok.
854d1333322Smrg   :
855d1333322Smrgelse
856d1333322Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
857d1333322SmrgCheck your system clock])
858d1333322Smrgfi
859d1333322SmrgAC_MSG_RESULT(yes)])
860d1333322Smrg
8614f9ac78aSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
8624f9ac78aSmrg#
8634f9ac78aSmrg# This file is free software; the Free Software Foundation
8644f9ac78aSmrg# gives unlimited permission to copy and/or distribute it,
8654f9ac78aSmrg# with or without modifications, as long as this notice is preserved.
8664f9ac78aSmrg
8674f9ac78aSmrg# serial 1
8684f9ac78aSmrg
8694f9ac78aSmrg# AM_SILENT_RULES([DEFAULT])
8704f9ac78aSmrg# --------------------------
8714f9ac78aSmrg# Enable less verbose build rules; with the default set to DEFAULT
8724f9ac78aSmrg# (`yes' being less verbose, `no' or empty being verbose).
8734f9ac78aSmrgAC_DEFUN([AM_SILENT_RULES],
8744f9ac78aSmrg[AC_ARG_ENABLE([silent-rules],
8754f9ac78aSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8764f9ac78aSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8774f9ac78aSmrgcase $enable_silent_rules in
8784f9ac78aSmrgyes) AM_DEFAULT_VERBOSITY=0;;
8794f9ac78aSmrgno)  AM_DEFAULT_VERBOSITY=1;;
8804f9ac78aSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8814f9ac78aSmrgesac
8824f9ac78aSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8834f9ac78aSmrgAM_BACKSLASH='\'
8844f9ac78aSmrgAC_SUBST([AM_BACKSLASH])dnl
8854f9ac78aSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8864f9ac78aSmrg])
8874f9ac78aSmrg
888d1333322Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
889d1333322Smrg#
890d1333322Smrg# This file is free software; the Free Software Foundation
891d1333322Smrg# gives unlimited permission to copy and/or distribute it,
892d1333322Smrg# with or without modifications, as long as this notice is preserved.
893d1333322Smrg
894d1333322Smrg# AM_PROG_INSTALL_STRIP
895d1333322Smrg# ---------------------
896d1333322Smrg# One issue with vendor `install' (even GNU) is that you can't
897d1333322Smrg# specify the program used to strip binaries.  This is especially
898d1333322Smrg# annoying in cross-compiling environments, where the build's strip
899d1333322Smrg# is unlikely to handle the host's binaries.
900d1333322Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
901d1333322Smrg# always use install-sh in `make install-strip', and initialize
902d1333322Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
903d1333322SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
904d1333322Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
905d1333322Smrg# Installed binaries are usually stripped using `strip' when the user
906d1333322Smrg# run `make install-strip'.  However `strip' might not be the right
907d1333322Smrg# tool to use in cross-compilation environments, therefore Automake
908d1333322Smrg# will honor the `STRIP' environment variable to overrule this program.
909d1333322Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
910d1333322Smrgif test "$cross_compiling" != no; then
911d1333322Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
912d1333322Smrgfi
913d1333322SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
914d1333322SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
915d1333322Smrg
9164f9ac78aSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
917d1333322Smrg#
918d1333322Smrg# This file is free software; the Free Software Foundation
919d1333322Smrg# gives unlimited permission to copy and/or distribute it,
920d1333322Smrg# with or without modifications, as long as this notice is preserved.
921d1333322Smrg
9224f9ac78aSmrg# serial 2
9234f9ac78aSmrg
924d1333322Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
925d1333322Smrg# ---------------------------
9264f9ac78aSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
927d1333322Smrg# This macro is traced by Automake.
928d1333322SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
929d1333322Smrg
9304f9ac78aSmrg# AM_SUBST_NOTMAKE(VARIABLE)
9314f9ac78aSmrg# ---------------------------
9324f9ac78aSmrg# Public sister of _AM_SUBST_NOTMAKE.
9334f9ac78aSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9344f9ac78aSmrg
935d1333322Smrg# Check how to create a tarball.                            -*- Autoconf -*-
936d1333322Smrg
937d1333322Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
938d1333322Smrg#
939d1333322Smrg# This file is free software; the Free Software Foundation
940d1333322Smrg# gives unlimited permission to copy and/or distribute it,
941d1333322Smrg# with or without modifications, as long as this notice is preserved.
942d1333322Smrg
943d1333322Smrg# serial 2
944d1333322Smrg
945d1333322Smrg# _AM_PROG_TAR(FORMAT)
946d1333322Smrg# --------------------
947d1333322Smrg# Check how to create a tarball in format FORMAT.
948d1333322Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
949d1333322Smrg#
950d1333322Smrg# Substitute a variable $(am__tar) that is a command
951d1333322Smrg# writing to stdout a FORMAT-tarball containing the directory
952d1333322Smrg# $tardir.
953d1333322Smrg#     tardir=directory && $(am__tar) > result.tar
954d1333322Smrg#
955d1333322Smrg# Substitute a variable $(am__untar) that extract such
956d1333322Smrg# a tarball read from stdin.
957d1333322Smrg#     $(am__untar) < result.tar
958d1333322SmrgAC_DEFUN([_AM_PROG_TAR],
959d1333322Smrg[# Always define AMTAR for backward compatibility.
960d1333322SmrgAM_MISSING_PROG([AMTAR], [tar])
961d1333322Smrgm4_if([$1], [v7],
962d1333322Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
963d1333322Smrg     [m4_case([$1], [ustar],, [pax],,
964d1333322Smrg              [m4_fatal([Unknown tar format])])
965d1333322SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
966d1333322Smrg# Loop over all known methods to create a tar archive until one works.
967d1333322Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
968d1333322Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
969d1333322Smrg# Do not fold the above two line into one, because Tru64 sh and
970d1333322Smrg# Solaris sh will not grok spaces in the rhs of `-'.
971d1333322Smrgfor _am_tool in $_am_tools
972d1333322Smrgdo
973d1333322Smrg  case $_am_tool in
974d1333322Smrg  gnutar)
975d1333322Smrg    for _am_tar in tar gnutar gtar;
976d1333322Smrg    do
977d1333322Smrg      AM_RUN_LOG([$_am_tar --version]) && break
978d1333322Smrg    done
979d1333322Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
980d1333322Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
981d1333322Smrg    am__untar="$_am_tar -xf -"
982d1333322Smrg    ;;
983d1333322Smrg  plaintar)
984d1333322Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
985d1333322Smrg    # ustar tarball either.
986d1333322Smrg    (tar --version) >/dev/null 2>&1 && continue
987d1333322Smrg    am__tar='tar chf - "$$tardir"'
988d1333322Smrg    am__tar_='tar chf - "$tardir"'
989d1333322Smrg    am__untar='tar xf -'
990d1333322Smrg    ;;
991d1333322Smrg  pax)
992d1333322Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
993d1333322Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
994d1333322Smrg    am__untar='pax -r'
995d1333322Smrg    ;;
996d1333322Smrg  cpio)
997d1333322Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
998d1333322Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
999d1333322Smrg    am__untar='cpio -i -H $1 -d'
1000d1333322Smrg    ;;
1001d1333322Smrg  none)
1002d1333322Smrg    am__tar=false
1003d1333322Smrg    am__tar_=false
1004d1333322Smrg    am__untar=false
1005d1333322Smrg    ;;
1006d1333322Smrg  esac
1007d1333322Smrg
1008d1333322Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
1009d1333322Smrg  # and am__untar set.
1010d1333322Smrg  test -n "${am_cv_prog_tar_$1}" && break
1011d1333322Smrg
1012d1333322Smrg  # tar/untar a dummy directory, and stop if the command works
1013d1333322Smrg  rm -rf conftest.dir
1014d1333322Smrg  mkdir conftest.dir
1015d1333322Smrg  echo GrepMe > conftest.dir/file
1016d1333322Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1017d1333322Smrg  rm -rf conftest.dir
1018d1333322Smrg  if test -s conftest.tar; then
1019d1333322Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
1020d1333322Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1021d1333322Smrg  fi
1022d1333322Smrgdone
1023d1333322Smrgrm -rf conftest.dir
1024d1333322Smrg
1025d1333322SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1026d1333322SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1027d1333322SmrgAC_SUBST([am__tar])
1028d1333322SmrgAC_SUBST([am__untar])
1029d1333322Smrg]) # _AM_PROG_TAR
1030d1333322Smrg
10314f9ac78aSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1032d1333322Smrgdnl
10334f9ac78aSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1034d1333322Smrgdnl 
1035d1333322Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10364f9ac78aSmrgdnl copy of this software and associated documentation files (the "Software"),
10374f9ac78aSmrgdnl to deal in the Software without restriction, including without limitation
10384f9ac78aSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
10394f9ac78aSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
10404f9ac78aSmrgdnl Software is furnished to do so, subject to the following conditions:
1041d1333322Smrgdnl
10424f9ac78aSmrgdnl The above copyright notice and this permission notice (including the next
10434f9ac78aSmrgdnl paragraph) shall be included in all copies or substantial portions of the
10444f9ac78aSmrgdnl Software.
1045d1333322Smrgdnl
10464f9ac78aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10474f9ac78aSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10484f9ac78aSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
10494f9ac78aSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10504f9ac78aSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
10514f9ac78aSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
10524f9ac78aSmrgdnl DEALINGS IN THE SOFTWARE.
1053d1333322Smrg
1054d1333322Smrg# XORG_MACROS_VERSION(required-version)
1055d1333322Smrg# -------------------------------------
1056d1333322Smrg# Minimum version: 1.1.0
1057d1333322Smrg#
1058d1333322Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1059d1333322Smrg# your configure.ac with the minimum required version, such as:
1060d1333322Smrg# XORG_MACROS_VERSION(1.1)
1061d1333322Smrg#
10624f9ac78aSmrg# To ensure that this macro is defined, also add:
10634f9ac78aSmrg# m4_ifndef([XORG_MACROS_VERSION],
10644f9ac78aSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1065d1333322Smrg#
1066d1333322Smrg#
1067d1333322Smrg# See the "minimum version" comment for each macro you use to see what 
1068d1333322Smrg# version you require.
10694f9ac78aSmrgm4_defun([XORG_MACROS_VERSION],[
10704f9ac78aSmrgm4_define([vers_have], [1.11.0])
10714f9ac78aSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10724f9ac78aSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10734f9ac78aSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
10744f9ac78aSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
10754f9ac78aSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
10764f9ac78aSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
10774f9ac78aSmrgm4_undefine([vers_have])
10784f9ac78aSmrgm4_undefine([maj_have])
10794f9ac78aSmrgm4_undefine([maj_needed])
1080d1333322Smrg]) # XORG_MACROS_VERSION
1081d1333322Smrg
1082d1333322Smrg# XORG_PROG_RAWCPP()
1083d1333322Smrg# ------------------
1084d1333322Smrg# Minimum version: 1.0.0
1085d1333322Smrg#
1086d1333322Smrg# Find cpp program and necessary flags for use in pre-processing text files
1087d1333322Smrg# such as man pages and config files
1088d1333322SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1089d1333322SmrgAC_REQUIRE([AC_PROG_CPP])
1090d1333322SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1091d1333322Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1092d1333322Smrg
1093d1333322Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1094d1333322Smrg# which is not the best choice for supporting other OS'es, but covers most
1095d1333322Smrg# of the ones we need for now.
1096d1333322SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1097d1333322SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1098d1333322Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1099d1333322Smrg	AC_MSG_RESULT([no])
1100d1333322Smrgelse
1101d1333322Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1102d1333322Smrg		RAWCPPFLAGS=-undef
1103d1333322Smrg		AC_MSG_RESULT([yes])
11044f9ac78aSmrg	# under Cygwin unix is still defined even with -undef
11054f9ac78aSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11064f9ac78aSmrg		RAWCPPFLAGS="-undef -ansi"
11074f9ac78aSmrg		AC_MSG_RESULT([yes, with -ansi])
1108d1333322Smrg	else
1109d1333322Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1110d1333322Smrg	fi
1111d1333322Smrgfi
1112d1333322Smrgrm -f conftest.$ac_ext
1113d1333322Smrg
1114d1333322SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1115d1333322SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1116d1333322Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1117d1333322Smrg	AC_MSG_RESULT([no])
1118d1333322Smrgelse
1119d1333322Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1120d1333322Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1121d1333322Smrg		AC_MSG_RESULT([yes])
1122d1333322Smrg	else
1123d1333322Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1124d1333322Smrg	fi
1125d1333322Smrgfi
1126d1333322Smrgrm -f conftest.$ac_ext
1127d1333322SmrgAC_SUBST(RAWCPPFLAGS)
1128d1333322Smrg]) # XORG_PROG_RAWCPP
1129d1333322Smrg
1130d1333322Smrg# XORG_MANPAGE_SECTIONS()
1131d1333322Smrg# -----------------------
1132d1333322Smrg# Minimum version: 1.0.0
1133d1333322Smrg#
1134d1333322Smrg# Determine which sections man pages go in for the different man page types
1135d1333322Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1136d1333322Smrg# Not sure if there's any better way than just hardcoding by OS name.
1137d1333322Smrg# Override default settings by setting environment variables
11384f9ac78aSmrg# Added MAN_SUBSTS in version 1.8
11394f9ac78aSmrg# Added AC_PROG_SED in version 1.8
1140d1333322Smrg
1141d1333322SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1142d1333322SmrgAC_REQUIRE([AC_CANONICAL_HOST])
11434f9ac78aSmrgAC_REQUIRE([AC_PROG_SED])
1144d1333322Smrg
1145d1333322Smrgif test x$APP_MAN_SUFFIX = x    ; then
1146d1333322Smrg    APP_MAN_SUFFIX=1
1147d1333322Smrgfi
1148d1333322Smrgif test x$APP_MAN_DIR = x    ; then
1149d1333322Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1150d1333322Smrgfi
1151d1333322Smrg
1152d1333322Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1153d1333322Smrg    LIB_MAN_SUFFIX=3
1154d1333322Smrgfi
1155d1333322Smrgif test x$LIB_MAN_DIR = x    ; then
1156d1333322Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1157d1333322Smrgfi
1158d1333322Smrg
1159d1333322Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1160d1333322Smrg    case $host_os in
1161d1333322Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1162d1333322Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1163d1333322Smrg    esac
1164d1333322Smrgfi
1165d1333322Smrgif test x$FILE_MAN_DIR = x    ; then
1166d1333322Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1167d1333322Smrgfi
1168d1333322Smrg
1169d1333322Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1170d1333322Smrg    case $host_os in
1171d1333322Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1172d1333322Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1173d1333322Smrg    esac
1174d1333322Smrgfi
1175d1333322Smrgif test x$MISC_MAN_DIR = x    ; then
1176d1333322Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1177d1333322Smrgfi
1178d1333322Smrg
1179d1333322Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1180d1333322Smrg    case $host_os in
1181d1333322Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1182d1333322Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1183d1333322Smrg    esac
1184d1333322Smrgfi
1185d1333322Smrgif test x$DRIVER_MAN_DIR = x    ; then
1186d1333322Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1187d1333322Smrgfi
1188d1333322Smrg
1189d1333322Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1190d1333322Smrg    case $host_os in
1191d1333322Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1192d1333322Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1193d1333322Smrg    esac
1194d1333322Smrgfi
1195d1333322Smrgif test x$ADMIN_MAN_DIR = x    ; then
1196d1333322Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1197d1333322Smrgfi
1198d1333322Smrg
1199d1333322Smrg
1200d1333322SmrgAC_SUBST([APP_MAN_SUFFIX])
1201d1333322SmrgAC_SUBST([LIB_MAN_SUFFIX])
1202d1333322SmrgAC_SUBST([FILE_MAN_SUFFIX])
1203d1333322SmrgAC_SUBST([MISC_MAN_SUFFIX])
1204d1333322SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1205d1333322SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1206d1333322SmrgAC_SUBST([APP_MAN_DIR])
1207d1333322SmrgAC_SUBST([LIB_MAN_DIR])
1208d1333322SmrgAC_SUBST([FILE_MAN_DIR])
1209d1333322SmrgAC_SUBST([MISC_MAN_DIR])
1210d1333322SmrgAC_SUBST([DRIVER_MAN_DIR])
1211d1333322SmrgAC_SUBST([ADMIN_MAN_DIR])
12124f9ac78aSmrg
12134f9ac78aSmrgXORG_MAN_PAGE="X Version 11"
12144f9ac78aSmrgAC_SUBST([XORG_MAN_PAGE])
12154f9ac78aSmrgMAN_SUBSTS="\
12164f9ac78aSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12174f9ac78aSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12184f9ac78aSmrg	-e 's|__xservername__|Xorg|g' \
12194f9ac78aSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
12204f9ac78aSmrg	-e 's|__projectroot__|\$(prefix)|g' \
12214f9ac78aSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
12224f9ac78aSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
12234f9ac78aSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
12244f9ac78aSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
12254f9ac78aSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
12264f9ac78aSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
12274f9ac78aSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
12284f9ac78aSmrgAC_SUBST([MAN_SUBSTS])
12294f9ac78aSmrg
1230d1333322Smrg]) # XORG_MANPAGE_SECTIONS
1231d1333322Smrg
12324f9ac78aSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
12334f9ac78aSmrg# ------------------------
12344f9ac78aSmrg# Minimum version: 1.7.0
12354f9ac78aSmrg#
12364f9ac78aSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
12374f9ac78aSmrg# provided by xorg-sgml-doctools, if installed.
12384f9ac78aSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
12394f9ac78aSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
12404f9ac78aSmrgXORG_SGML_PATH=
12414f9ac78aSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
12424f9ac78aSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
12434f9ac78aSmrg    [m4_ifval([$1],[:],
12444f9ac78aSmrg        [if test x"$cross_compiling" != x"yes" ; then
12454f9ac78aSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
12464f9ac78aSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
12474f9ac78aSmrg         fi])
12484f9ac78aSmrg    ])
12494f9ac78aSmrg
12504f9ac78aSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
12514f9ac78aSmrg# the path and the name of the doc stylesheet
12524f9ac78aSmrgif test "x$XORG_SGML_PATH" != "x" ; then
12534f9ac78aSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
12544f9ac78aSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
12554f9ac78aSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
12564f9ac78aSmrgelse
12574f9ac78aSmrg   AC_MSG_RESULT([no])
12584f9ac78aSmrgfi
12594f9ac78aSmrg
12604f9ac78aSmrgAC_SUBST(XORG_SGML_PATH)
12614f9ac78aSmrgAC_SUBST(STYLESHEET_SRCDIR)
12624f9ac78aSmrgAC_SUBST(XSL_STYLESHEET)
12634f9ac78aSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
12644f9ac78aSmrg]) # XORG_CHECK_SGML_DOCTOOLS
12654f9ac78aSmrg
1266d1333322Smrg# XORG_CHECK_LINUXDOC
1267d1333322Smrg# -------------------
1268d1333322Smrg# Minimum version: 1.0.0
1269d1333322Smrg#
1270d1333322Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1271d1333322Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1272d1333322Smrg# Whether or not the necessary tools and files are found can be checked
1273d1333322Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1274d1333322SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12754f9ac78aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
12764f9ac78aSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1277d1333322Smrg
1278d1333322SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1279d1333322Smrg
12804f9ac78aSmrgAC_MSG_CHECKING([whether to build documentation])
1281d1333322Smrg
12824f9ac78aSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1283d1333322Smrg   BUILDDOC=yes
1284d1333322Smrgelse
1285d1333322Smrg   BUILDDOC=no
1286d1333322Smrgfi
1287d1333322Smrg
1288d1333322SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1289d1333322Smrg
1290d1333322SmrgAC_MSG_RESULT([$BUILDDOC])
1291d1333322Smrg
12924f9ac78aSmrgAC_MSG_CHECKING([whether to build pdf documentation])
1293d1333322Smrg
12944f9ac78aSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1295d1333322Smrg   BUILDPDFDOC=yes
1296d1333322Smrgelse
1297d1333322Smrg   BUILDPDFDOC=no
1298d1333322Smrgfi
1299d1333322Smrg
1300d1333322SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1301d1333322Smrg
1302d1333322SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1303d1333322Smrg
13044f9ac78aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1305d1333322SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1306d1333322SmrgMAKE_PDF="$PS2PDF"
1307d1333322SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1308d1333322Smrg
1309d1333322SmrgAC_SUBST(MAKE_TEXT)
1310d1333322SmrgAC_SUBST(MAKE_PS)
1311d1333322SmrgAC_SUBST(MAKE_PDF)
1312d1333322SmrgAC_SUBST(MAKE_HTML)
1313d1333322Smrg]) # XORG_CHECK_LINUXDOC
1314d1333322Smrg
1315d1333322Smrg# XORG_CHECK_DOCBOOK
1316d1333322Smrg# -------------------
1317d1333322Smrg# Minimum version: 1.0.0
1318d1333322Smrg#
1319d1333322Smrg# Checks for the ability to build output formats from SGML DocBook source.
1320d1333322Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1321d1333322Smrg# indicates whether the necessary tools and files are found and, if set,
1322d1333322Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1323d1333322SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
13244f9ac78aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
13254f9ac78aSmrg
1326d1333322SmrgBUILDTXTDOC=no
1327d1333322SmrgBUILDPDFDOC=no
1328d1333322SmrgBUILDPSDOC=no
1329d1333322SmrgBUILDHTMLDOC=no
1330d1333322Smrg
1331d1333322SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1332d1333322SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1333d1333322SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1334d1333322SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1335d1333322Smrg
13364f9ac78aSmrgAC_MSG_CHECKING([whether to build text documentation])
13374f9ac78aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1338d1333322Smrg   test x$BUILD_TXTDOC != xno; then
1339d1333322Smrg	BUILDTXTDOC=yes
1340d1333322Smrgfi
1341d1333322SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1342d1333322SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1343d1333322Smrg
13444f9ac78aSmrgAC_MSG_CHECKING([whether to build PDF documentation])
13454f9ac78aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1346d1333322Smrg   test x$BUILD_PDFDOC != xno; then
1347d1333322Smrg	BUILDPDFDOC=yes
1348d1333322Smrgfi
1349d1333322SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1350d1333322SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1351d1333322Smrg
13524f9ac78aSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
13534f9ac78aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1354d1333322Smrg   test x$BUILD_PSDOC != xno; then
1355d1333322Smrg	BUILDPSDOC=yes
1356d1333322Smrgfi
1357d1333322SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1358d1333322SmrgAC_MSG_RESULT([$BUILDPSDOC])
1359d1333322Smrg
13604f9ac78aSmrgAC_MSG_CHECKING([whether to build HTML documentation])
13614f9ac78aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1362d1333322Smrg   test x$BUILD_HTMLDOC != xno; then
1363d1333322Smrg	BUILDHTMLDOC=yes
1364d1333322Smrgfi
1365d1333322SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1366d1333322SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1367d1333322Smrg
1368d1333322SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1369d1333322SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1370d1333322SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1371d1333322SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1372d1333322Smrg
1373d1333322SmrgAC_SUBST(MAKE_TEXT)
1374d1333322SmrgAC_SUBST(MAKE_PS)
1375d1333322SmrgAC_SUBST(MAKE_PDF)
1376d1333322SmrgAC_SUBST(MAKE_HTML)
1377d1333322Smrg]) # XORG_CHECK_DOCBOOK
1378d1333322Smrg
13794f9ac78aSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
13804f9ac78aSmrg# ----------------
13814f9ac78aSmrg# Minimum version: 1.5.0
13824f9ac78aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
13834f9ac78aSmrg#
13844f9ac78aSmrg# Documentation tools are not always available on all platforms and sometimes
13854f9ac78aSmrg# not at the appropriate level. This macro enables a module to test for the
13864f9ac78aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
13874f9ac78aSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
13884f9ac78aSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
13894f9ac78aSmrg# --with-xmlto assumes 'auto'.
13904f9ac78aSmrg#
13914f9ac78aSmrg# Interface to module:
13924f9ac78aSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
13934f9ac78aSmrg# XMLTO:	returns the path of the xmlto program found
13944f9ac78aSmrg#		returns the path set by the user in the environment
13954f9ac78aSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
13964f9ac78aSmrg#		'no' user instructs the module not to use xmlto
13974f9ac78aSmrg#
13984f9ac78aSmrg# Added in version 1.10.0
13994f9ac78aSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
14004f9ac78aSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
14014f9ac78aSmrg#
14024f9ac78aSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
14034f9ac78aSmrg#
14044f9ac78aSmrgAC_DEFUN([XORG_WITH_XMLTO],[
14054f9ac78aSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
14064f9ac78aSmrgm4_define([_defopt], m4_default([$2], [auto]))
14074f9ac78aSmrgAC_ARG_WITH(xmlto,
14084f9ac78aSmrg	AS_HELP_STRING([--with-xmlto],
14094f9ac78aSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
14104f9ac78aSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
14114f9ac78aSmrgm4_undefine([_defopt])
14124f9ac78aSmrg
14134f9ac78aSmrgif test "x$use_xmlto" = x"auto"; then
14144f9ac78aSmrg   AC_PATH_PROG([XMLTO], [xmlto])
14154f9ac78aSmrg   if test "x$XMLTO" = "x"; then
14164f9ac78aSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
14174f9ac78aSmrg	have_xmlto=no
14184f9ac78aSmrg   else
14194f9ac78aSmrg        have_xmlto=yes
14204f9ac78aSmrg   fi
14214f9ac78aSmrgelif test "x$use_xmlto" = x"yes" ; then
14224f9ac78aSmrg   AC_PATH_PROG([XMLTO], [xmlto])
14234f9ac78aSmrg   if test "x$XMLTO" = "x"; then
14244f9ac78aSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
14254f9ac78aSmrg   fi
14264f9ac78aSmrg   have_xmlto=yes
14274f9ac78aSmrgelif test "x$use_xmlto" = x"no" ; then
14284f9ac78aSmrg   if test "x$XMLTO" != "x"; then
14294f9ac78aSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
14304f9ac78aSmrg   fi
14314f9ac78aSmrg   have_xmlto=no
14324f9ac78aSmrgelse
14334f9ac78aSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
14344f9ac78aSmrgfi
14354f9ac78aSmrg
14364f9ac78aSmrg# Test for a minimum version of xmlto, if provided.
14374f9ac78aSmrgm4_ifval([$1],
14384f9ac78aSmrg[if test "$have_xmlto" = yes; then
14394f9ac78aSmrg    # scrape the xmlto version
14404f9ac78aSmrg    AC_MSG_CHECKING([the xmlto version])
14414f9ac78aSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
14424f9ac78aSmrg    AC_MSG_RESULT([$xmlto_version])
14434f9ac78aSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
14444f9ac78aSmrg        [if test "x$use_xmlto" = xauto; then
14454f9ac78aSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
14464f9ac78aSmrg            have_xmlto=no
14474f9ac78aSmrg        else
14484f9ac78aSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
14494f9ac78aSmrg        fi])
14504f9ac78aSmrgfi])
14514f9ac78aSmrg
14524f9ac78aSmrg# Test for the ability of xmlto to generate a text target
14534f9ac78aSmrghave_xmlto_text=no
14544f9ac78aSmrgcat > conftest.xml << "EOF"
14554f9ac78aSmrgEOF
14564f9ac78aSmrgAS_IF([test "$have_xmlto" = yes],
14574f9ac78aSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
14584f9ac78aSmrg             [have_xmlto_text=yes],
14594f9ac78aSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
14604f9ac78aSmrgrm -f conftest.xml
14614f9ac78aSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
14624f9ac78aSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
14634f9ac78aSmrg]) # XORG_WITH_XMLTO
14644f9ac78aSmrg
14654f9ac78aSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
14664f9ac78aSmrg# ----------------
14674f9ac78aSmrg# Minimum version: 1.5.0
14684f9ac78aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
14694f9ac78aSmrg#
14704f9ac78aSmrg# Documentation tools are not always available on all platforms and sometimes
14714f9ac78aSmrg# not at the appropriate level. This macro enables a module to test for the
14724f9ac78aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
14734f9ac78aSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
14744f9ac78aSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
14754f9ac78aSmrg# --with-asciidoc assumes 'auto'.
14764f9ac78aSmrg#
14774f9ac78aSmrg# Interface to module:
14784f9ac78aSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
14794f9ac78aSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
14804f9ac78aSmrg#		 returns the path set by the user in the environment
14814f9ac78aSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
14824f9ac78aSmrg#		  'no' user instructs the module not to use asciidoc
14834f9ac78aSmrg#
14844f9ac78aSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
14854f9ac78aSmrg#
14864f9ac78aSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
14874f9ac78aSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
14884f9ac78aSmrgm4_define([_defopt], m4_default([$2], [auto]))
14894f9ac78aSmrgAC_ARG_WITH(asciidoc,
14904f9ac78aSmrg	AS_HELP_STRING([--with-asciidoc],
14914f9ac78aSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
14924f9ac78aSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
14934f9ac78aSmrgm4_undefine([_defopt])
14944f9ac78aSmrg
14954f9ac78aSmrgif test "x$use_asciidoc" = x"auto"; then
14964f9ac78aSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
14974f9ac78aSmrg   if test "x$ASCIIDOC" = "x"; then
14984f9ac78aSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
14994f9ac78aSmrg	have_asciidoc=no
15004f9ac78aSmrg   else
15014f9ac78aSmrg        have_asciidoc=yes
15024f9ac78aSmrg   fi
15034f9ac78aSmrgelif test "x$use_asciidoc" = x"yes" ; then
15044f9ac78aSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
15054f9ac78aSmrg   if test "x$ASCIIDOC" = "x"; then
15064f9ac78aSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
15074f9ac78aSmrg   fi
15084f9ac78aSmrg   have_asciidoc=yes
15094f9ac78aSmrgelif test "x$use_asciidoc" = x"no" ; then
15104f9ac78aSmrg   if test "x$ASCIIDOC" != "x"; then
15114f9ac78aSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
15124f9ac78aSmrg   fi
15134f9ac78aSmrg   have_asciidoc=no
15144f9ac78aSmrgelse
15154f9ac78aSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
15164f9ac78aSmrgfi
15174f9ac78aSmrgm4_ifval([$1],
15184f9ac78aSmrg[if test "$have_asciidoc" = yes; then
15194f9ac78aSmrg    # scrape the asciidoc version
15204f9ac78aSmrg    AC_MSG_CHECKING([the asciidoc version])
15214f9ac78aSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
15224f9ac78aSmrg    AC_MSG_RESULT([$asciidoc_version])
15234f9ac78aSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
15244f9ac78aSmrg        [if test "x$use_asciidoc" = xauto; then
15254f9ac78aSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
15264f9ac78aSmrg            have_asciidoc=no
15274f9ac78aSmrg        else
15284f9ac78aSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
15294f9ac78aSmrg        fi])
15304f9ac78aSmrgfi])
15314f9ac78aSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
15324f9ac78aSmrg]) # XORG_WITH_ASCIIDOC
15334f9ac78aSmrg
15344f9ac78aSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
15354f9ac78aSmrg# --------------------------------
15364f9ac78aSmrg# Minimum version: 1.5.0
15374f9ac78aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
15384f9ac78aSmrg#
15394f9ac78aSmrg# Documentation tools are not always available on all platforms and sometimes
15404f9ac78aSmrg# not at the appropriate level. This macro enables a module to test for the
15414f9ac78aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
15424f9ac78aSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
15434f9ac78aSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
15444f9ac78aSmrg# --with-doxygen assumes 'auto'.
15454f9ac78aSmrg#
15464f9ac78aSmrg# Interface to module:
15474f9ac78aSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
15484f9ac78aSmrg# DOXYGEN:	 returns the path of the doxygen program found
15494f9ac78aSmrg#		 returns the path set by the user in the environment
15504f9ac78aSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
15514f9ac78aSmrg#		  'no' user instructs the module not to use doxygen
15524f9ac78aSmrg#
15534f9ac78aSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
15544f9ac78aSmrg#
15554f9ac78aSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
15564f9ac78aSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
15574f9ac78aSmrgm4_define([_defopt], m4_default([$2], [auto]))
15584f9ac78aSmrgAC_ARG_WITH(doxygen,
15594f9ac78aSmrg	AS_HELP_STRING([--with-doxygen],
15604f9ac78aSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
15614f9ac78aSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
15624f9ac78aSmrgm4_undefine([_defopt])
15634f9ac78aSmrg
15644f9ac78aSmrgif test "x$use_doxygen" = x"auto"; then
15654f9ac78aSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15664f9ac78aSmrg   if test "x$DOXYGEN" = "x"; then
15674f9ac78aSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
15684f9ac78aSmrg	have_doxygen=no
15694f9ac78aSmrg   else
15704f9ac78aSmrg        have_doxygen=yes
15714f9ac78aSmrg   fi
15724f9ac78aSmrgelif test "x$use_doxygen" = x"yes" ; then
15734f9ac78aSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15744f9ac78aSmrg   if test "x$DOXYGEN" = "x"; then
15754f9ac78aSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
15764f9ac78aSmrg   fi
15774f9ac78aSmrg   have_doxygen=yes
15784f9ac78aSmrgelif test "x$use_doxygen" = x"no" ; then
15794f9ac78aSmrg   if test "x$DOXYGEN" != "x"; then
15804f9ac78aSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
15814f9ac78aSmrg   fi
15824f9ac78aSmrg   have_doxygen=no
15834f9ac78aSmrgelse
15844f9ac78aSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
15854f9ac78aSmrgfi
15864f9ac78aSmrgm4_ifval([$1],
15874f9ac78aSmrg[if test "$have_doxygen" = yes; then
15884f9ac78aSmrg    # scrape the doxygen version
15894f9ac78aSmrg    AC_MSG_CHECKING([the doxygen version])
15904f9ac78aSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
15914f9ac78aSmrg    AC_MSG_RESULT([$doxygen_version])
15924f9ac78aSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
15934f9ac78aSmrg        [if test "x$use_doxygen" = xauto; then
15944f9ac78aSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
15954f9ac78aSmrg            have_doxygen=no
15964f9ac78aSmrg        else
15974f9ac78aSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
15984f9ac78aSmrg        fi])
15994f9ac78aSmrgfi])
16004f9ac78aSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
16014f9ac78aSmrg]) # XORG_WITH_DOXYGEN
16024f9ac78aSmrg
16034f9ac78aSmrg# XORG_WITH_GROFF([DEFAULT])
16044f9ac78aSmrg# ----------------
16054f9ac78aSmrg# Minimum version: 1.6.0
16064f9ac78aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
16074f9ac78aSmrg#
16084f9ac78aSmrg# Documentation tools are not always available on all platforms and sometimes
16094f9ac78aSmrg# not at the appropriate level. This macro enables a module to test for the
16104f9ac78aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
16114f9ac78aSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
16124f9ac78aSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
16134f9ac78aSmrg# --with-groff assumes 'auto'.
16144f9ac78aSmrg#
16154f9ac78aSmrg# Interface to module:
16164f9ac78aSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
16174f9ac78aSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
16184f9ac78aSmrg# HAVE_GROFF_MS: the -ms macros package
16194f9ac78aSmrg# GROFF:	 returns the path of the groff program found
16204f9ac78aSmrg#		 returns the path set by the user in the environment
16214f9ac78aSmrg# --with-groff:	 'yes' user instructs the module to use groff
16224f9ac78aSmrg#		 'no' user instructs the module not to use groff
16234f9ac78aSmrg#
16244f9ac78aSmrg# Added in version 1.9.0:
16254f9ac78aSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
16264f9ac78aSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
16274f9ac78aSmrg#		   psselect from the psutils package.
16284f9ac78aSmrg#		   the ghostcript package. Refer to the grohtml man pages
16294f9ac78aSmrg#
16304f9ac78aSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
16314f9ac78aSmrg#
16324f9ac78aSmrg# OS and distros often splits groff in a basic and full package, the former
16334f9ac78aSmrg# having the groff program and the later having devices, fonts and macros
16344f9ac78aSmrg# Checking for the groff executable is not enough.
16354f9ac78aSmrg#
16364f9ac78aSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
16374f9ac78aSmrg# unset HAVE_GROFF or GROFF env variables.
16384f9ac78aSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
16394f9ac78aSmrg#
16404f9ac78aSmrgAC_DEFUN([XORG_WITH_GROFF],[
16414f9ac78aSmrgAC_ARG_VAR([GROFF], [Path to groff command])
16424f9ac78aSmrgm4_define([_defopt], m4_default([$1], [auto]))
16434f9ac78aSmrgAC_ARG_WITH(groff,
16444f9ac78aSmrg	AS_HELP_STRING([--with-groff],
16454f9ac78aSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
16464f9ac78aSmrg	   [use_groff=$withval], [use_groff=]_defopt)
16474f9ac78aSmrgm4_undefine([_defopt])
16484f9ac78aSmrg
16494f9ac78aSmrgif test "x$use_groff" = x"auto"; then
16504f9ac78aSmrg   AC_PATH_PROG([GROFF], [groff])
16514f9ac78aSmrg   if test "x$GROFF" = "x"; then
16524f9ac78aSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
16534f9ac78aSmrg	have_groff=no
16544f9ac78aSmrg   else
16554f9ac78aSmrg        have_groff=yes
16564f9ac78aSmrg   fi
16574f9ac78aSmrgelif test "x$use_groff" = x"yes" ; then
16584f9ac78aSmrg   AC_PATH_PROG([GROFF], [groff])
16594f9ac78aSmrg   if test "x$GROFF" = "x"; then
16604f9ac78aSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
16614f9ac78aSmrg   fi
16624f9ac78aSmrg   have_groff=yes
16634f9ac78aSmrgelif test "x$use_groff" = x"no" ; then
16644f9ac78aSmrg   if test "x$GROFF" != "x"; then
16654f9ac78aSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
16664f9ac78aSmrg   fi
16674f9ac78aSmrg   have_groff=no
16684f9ac78aSmrgelse
16694f9ac78aSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
16704f9ac78aSmrgfi
16714f9ac78aSmrg
16724f9ac78aSmrg# We have groff, test for the presence of the macro packages
16734f9ac78aSmrgif test "x$have_groff" = x"yes"; then
16744f9ac78aSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
16754f9ac78aSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
16764f9ac78aSmrg        groff_ms_works=yes
16774f9ac78aSmrg    else
16784f9ac78aSmrg        groff_ms_works=no
16794f9ac78aSmrg    fi
16804f9ac78aSmrg    AC_MSG_RESULT([$groff_ms_works])
16814f9ac78aSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
16824f9ac78aSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
16834f9ac78aSmrg        groff_mm_works=yes
16844f9ac78aSmrg    else
16854f9ac78aSmrg        groff_mm_works=no
16864f9ac78aSmrg    fi
16874f9ac78aSmrg    AC_MSG_RESULT([$groff_mm_works])
16884f9ac78aSmrgfi
16894f9ac78aSmrg
16904f9ac78aSmrg# We have groff, test for HTML dependencies, one command per package
16914f9ac78aSmrgif test "x$have_groff" = x"yes"; then
16924f9ac78aSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
16934f9ac78aSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
16944f9ac78aSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
16954f9ac78aSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
16964f9ac78aSmrg      have_groff_html=yes
16974f9ac78aSmrg   else
16984f9ac78aSmrg      have_groff_html=no
16994f9ac78aSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
17004f9ac78aSmrg   fi
17014f9ac78aSmrgfi
17024f9ac78aSmrg
17034f9ac78aSmrg# Set Automake conditionals for Makefiles
17044f9ac78aSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
17054f9ac78aSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
17064f9ac78aSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
17074f9ac78aSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
17084f9ac78aSmrg]) # XORG_WITH_GROFF
17094f9ac78aSmrg
17104f9ac78aSmrg# XORG_WITH_FOP([DEFAULT])
17114f9ac78aSmrg# ----------------
17124f9ac78aSmrg# Minimum version: 1.6.0
17134f9ac78aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
17144f9ac78aSmrg#
17154f9ac78aSmrg# Documentation tools are not always available on all platforms and sometimes
17164f9ac78aSmrg# not at the appropriate level. This macro enables a module to test for the
17174f9ac78aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
17184f9ac78aSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
17194f9ac78aSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
17204f9ac78aSmrg# --with-fop assumes 'auto'.
17214f9ac78aSmrg#
17224f9ac78aSmrg# Interface to module:
17234f9ac78aSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
17244f9ac78aSmrg# FOP:	 	returns the path of the fop program found
17254f9ac78aSmrg#		returns the path set by the user in the environment
17264f9ac78aSmrg# --with-fop: 	'yes' user instructs the module to use fop
17274f9ac78aSmrg#		'no' user instructs the module not to use fop
17284f9ac78aSmrg#
17294f9ac78aSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
17304f9ac78aSmrg#
17314f9ac78aSmrgAC_DEFUN([XORG_WITH_FOP],[
17324f9ac78aSmrgAC_ARG_VAR([FOP], [Path to fop command])
17334f9ac78aSmrgm4_define([_defopt], m4_default([$1], [auto]))
17344f9ac78aSmrgAC_ARG_WITH(fop,
17354f9ac78aSmrg	AS_HELP_STRING([--with-fop],
17364f9ac78aSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
17374f9ac78aSmrg	   [use_fop=$withval], [use_fop=]_defopt)
17384f9ac78aSmrgm4_undefine([_defopt])
17394f9ac78aSmrg
17404f9ac78aSmrgif test "x$use_fop" = x"auto"; then
17414f9ac78aSmrg   AC_PATH_PROG([FOP], [fop])
17424f9ac78aSmrg   if test "x$FOP" = "x"; then
17434f9ac78aSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
17444f9ac78aSmrg	have_fop=no
17454f9ac78aSmrg   else
17464f9ac78aSmrg        have_fop=yes
17474f9ac78aSmrg   fi
17484f9ac78aSmrgelif test "x$use_fop" = x"yes" ; then
17494f9ac78aSmrg   AC_PATH_PROG([FOP], [fop])
17504f9ac78aSmrg   if test "x$FOP" = "x"; then
17514f9ac78aSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
17524f9ac78aSmrg   fi
17534f9ac78aSmrg   have_fop=yes
17544f9ac78aSmrgelif test "x$use_fop" = x"no" ; then
17554f9ac78aSmrg   if test "x$FOP" != "x"; then
17564f9ac78aSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
17574f9ac78aSmrg   fi
17584f9ac78aSmrg   have_fop=no
17594f9ac78aSmrgelse
17604f9ac78aSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
17614f9ac78aSmrgfi
17624f9ac78aSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
17634f9ac78aSmrg]) # XORG_WITH_FOP
17644f9ac78aSmrg
17654f9ac78aSmrg# XORG_WITH_PS2PDF([DEFAULT])
17664f9ac78aSmrg# ----------------
17674f9ac78aSmrg# Minimum version: 1.6.0
17684f9ac78aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
17694f9ac78aSmrg#
17704f9ac78aSmrg# Documentation tools are not always available on all platforms and sometimes
17714f9ac78aSmrg# not at the appropriate level. This macro enables a module to test for the
17724f9ac78aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
17734f9ac78aSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
17744f9ac78aSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
17754f9ac78aSmrg# --with-ps2pdf assumes 'auto'.
17764f9ac78aSmrg#
17774f9ac78aSmrg# Interface to module:
17784f9ac78aSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
17794f9ac78aSmrg# PS2PDF:	returns the path of the ps2pdf program found
17804f9ac78aSmrg#		returns the path set by the user in the environment
17814f9ac78aSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
17824f9ac78aSmrg#		 'no' user instructs the module not to use ps2pdf
17834f9ac78aSmrg#
17844f9ac78aSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
17854f9ac78aSmrg#
17864f9ac78aSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
17874f9ac78aSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
17884f9ac78aSmrgm4_define([_defopt], m4_default([$1], [auto]))
17894f9ac78aSmrgAC_ARG_WITH(ps2pdf,
17904f9ac78aSmrg	AS_HELP_STRING([--with-ps2pdf],
17914f9ac78aSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
17924f9ac78aSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
17934f9ac78aSmrgm4_undefine([_defopt])
17944f9ac78aSmrg
17954f9ac78aSmrgif test "x$use_ps2pdf" = x"auto"; then
17964f9ac78aSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
17974f9ac78aSmrg   if test "x$PS2PDF" = "x"; then
17984f9ac78aSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
17994f9ac78aSmrg	have_ps2pdf=no
18004f9ac78aSmrg   else
18014f9ac78aSmrg        have_ps2pdf=yes
18024f9ac78aSmrg   fi
18034f9ac78aSmrgelif test "x$use_ps2pdf" = x"yes" ; then
18044f9ac78aSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
18054f9ac78aSmrg   if test "x$PS2PDF" = "x"; then
18064f9ac78aSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
18074f9ac78aSmrg   fi
18084f9ac78aSmrg   have_ps2pdf=yes
18094f9ac78aSmrgelif test "x$use_ps2pdf" = x"no" ; then
18104f9ac78aSmrg   if test "x$PS2PDF" != "x"; then
18114f9ac78aSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
18124f9ac78aSmrg   fi
18134f9ac78aSmrg   have_ps2pdf=no
18144f9ac78aSmrgelse
18154f9ac78aSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
18164f9ac78aSmrgfi
18174f9ac78aSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
18184f9ac78aSmrg]) # XORG_WITH_PS2PDF
18194f9ac78aSmrg
18204f9ac78aSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
18214f9ac78aSmrg# ----------------
18224f9ac78aSmrg# Minimum version: 1.6.0
18234f9ac78aSmrg#
18244f9ac78aSmrg# Documentation tools are not always available on all platforms and sometimes
18254f9ac78aSmrg# not at the appropriate level. This macro enables a builder to skip all
18264f9ac78aSmrg# documentation targets except traditional man pages.
18274f9ac78aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18284f9ac78aSmrg# maximum flexibilty in controlling documentation building.
18294f9ac78aSmrg# Refer to:
18304f9ac78aSmrg# XORG_WITH_XMLTO         --with-xmlto
18314f9ac78aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18324f9ac78aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
18334f9ac78aSmrg# XORG_WITH_FOP           --with-fop
18344f9ac78aSmrg# XORG_WITH_GROFF         --with-groff
18354f9ac78aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
18364f9ac78aSmrg#
18374f9ac78aSmrg# Interface to module:
18384f9ac78aSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
18394f9ac78aSmrg# --enable-docs: 'yes' user instructs the module to generate docs
18404f9ac78aSmrg#		 'no' user instructs the module not to generate docs
18414f9ac78aSmrg# parm1:	specify the default value, yes or no.
18424f9ac78aSmrg#
18434f9ac78aSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
18444f9ac78aSmrgm4_define([default], m4_default([$1], [yes]))
18454f9ac78aSmrgAC_ARG_ENABLE(docs,
18464f9ac78aSmrg	AS_HELP_STRING([--enable-docs],
18474f9ac78aSmrg	   [Enable building the documentation (default: ]default[)]),
18484f9ac78aSmrg	   [build_docs=$enableval], [build_docs=]default)
18494f9ac78aSmrgm4_undefine([default])
18504f9ac78aSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
18514f9ac78aSmrgAC_MSG_CHECKING([whether to build documentation])
18524f9ac78aSmrgAC_MSG_RESULT([$build_docs])
18534f9ac78aSmrg]) # XORG_ENABLE_DOCS
18544f9ac78aSmrg
18554f9ac78aSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
18564f9ac78aSmrg# ----------------
18574f9ac78aSmrg# Minimum version: 1.6.0
18584f9ac78aSmrg#
18594f9ac78aSmrg# This macro enables a builder to skip all developer documentation.
18604f9ac78aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18614f9ac78aSmrg# maximum flexibilty in controlling documentation building.
18624f9ac78aSmrg# Refer to:
18634f9ac78aSmrg# XORG_WITH_XMLTO         --with-xmlto
18644f9ac78aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18654f9ac78aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
18664f9ac78aSmrg# XORG_WITH_FOP           --with-fop
18674f9ac78aSmrg# XORG_WITH_GROFF         --with-groff
18684f9ac78aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
18694f9ac78aSmrg#
18704f9ac78aSmrg# Interface to module:
18714f9ac78aSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
18724f9ac78aSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
18734f9ac78aSmrg#			'no' user instructs the module not to generate developer docs
18744f9ac78aSmrg# parm1:		specify the default value, yes or no.
18754f9ac78aSmrg#
18764f9ac78aSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
18774f9ac78aSmrgm4_define([devel_default], m4_default([$1], [yes]))
18784f9ac78aSmrgAC_ARG_ENABLE(devel-docs,
18794f9ac78aSmrg	AS_HELP_STRING([--enable-devel-docs],
18804f9ac78aSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
18814f9ac78aSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
18824f9ac78aSmrgm4_undefine([devel_default])
18834f9ac78aSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
18844f9ac78aSmrgAC_MSG_CHECKING([whether to build developer documentation])
18854f9ac78aSmrgAC_MSG_RESULT([$build_devel_docs])
18864f9ac78aSmrg]) # XORG_ENABLE_DEVEL_DOCS
18874f9ac78aSmrg
18884f9ac78aSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
18894f9ac78aSmrg# ----------------
18904f9ac78aSmrg# Minimum version: 1.6.0
18914f9ac78aSmrg#
18924f9ac78aSmrg# This macro enables a builder to skip all functional specification targets.
18934f9ac78aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18944f9ac78aSmrg# maximum flexibilty in controlling documentation building.
18954f9ac78aSmrg# Refer to:
18964f9ac78aSmrg# XORG_WITH_XMLTO         --with-xmlto
18974f9ac78aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18984f9ac78aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
18994f9ac78aSmrg# XORG_WITH_FOP           --with-fop
19004f9ac78aSmrg# XORG_WITH_GROFF         --with-groff
19014f9ac78aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
19024f9ac78aSmrg#
19034f9ac78aSmrg# Interface to module:
19044f9ac78aSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
19054f9ac78aSmrg# --enable-specs:	'yes' user instructs the module to generate specs
19064f9ac78aSmrg#			'no' user instructs the module not to generate specs
19074f9ac78aSmrg# parm1:		specify the default value, yes or no.
19084f9ac78aSmrg#
19094f9ac78aSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
19104f9ac78aSmrgm4_define([spec_default], m4_default([$1], [yes]))
19114f9ac78aSmrgAC_ARG_ENABLE(specs,
19124f9ac78aSmrg	AS_HELP_STRING([--enable-specs],
19134f9ac78aSmrg	   [Enable building the specs (default: ]spec_default[)]),
19144f9ac78aSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
19154f9ac78aSmrgm4_undefine([spec_default])
19164f9ac78aSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
19174f9ac78aSmrgAC_MSG_CHECKING([whether to build functional specifications])
19184f9ac78aSmrgAC_MSG_RESULT([$build_specs])
19194f9ac78aSmrg]) # XORG_ENABLE_SPECS
19204f9ac78aSmrg
1921d1333322Smrg# XORG_CHECK_MALLOC_ZERO
1922d1333322Smrg# ----------------------
1923d1333322Smrg# Minimum version: 1.0.0
1924d1333322Smrg#
1925d1333322Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1926d1333322Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1927d1333322Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1928d1333322SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1929d1333322SmrgAC_ARG_ENABLE(malloc0returnsnull,
19304f9ac78aSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1931d1333322Smrg		       [malloc(0) returns NULL (default: auto)]),
1932d1333322Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1933d1333322Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1934d1333322Smrg
1935d1333322SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1936d1333322Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1937d1333322Smrg	AC_RUN_IFELSE([
1938d1333322Smrgchar *malloc();
1939d1333322Smrgchar *realloc();
1940d1333322Smrgchar *calloc();
1941d1333322Smrgmain() {
1942d1333322Smrg    char *m0, *r0, *c0, *p;
1943d1333322Smrg    m0 = malloc(0);
1944d1333322Smrg    p = malloc(10);
1945d1333322Smrg    r0 = realloc(p,0);
1946d1333322Smrg    c0 = calloc(0);
1947d1333322Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1948d1333322Smrg}],
1949d1333322Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
19504f9ac78aSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
19514f9ac78aSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1952d1333322Smrgfi
1953d1333322SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1954d1333322Smrg
1955d1333322Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1956d1333322Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1957d1333322Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1958d1333322Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1959d1333322Smrgelse
1960d1333322Smrg	MALLOC_ZERO_CFLAGS=""
1961d1333322Smrg	XMALLOC_ZERO_CFLAGS=""
1962d1333322Smrg	XTMALLOC_ZERO_CFLAGS=""
1963d1333322Smrgfi
1964d1333322Smrg
1965d1333322SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1966d1333322SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1967d1333322SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1968d1333322Smrg]) # XORG_CHECK_MALLOC_ZERO
1969d1333322Smrg
1970d1333322Smrg# XORG_WITH_LINT()
1971d1333322Smrg# ----------------
1972d1333322Smrg# Minimum version: 1.1.0
1973d1333322Smrg#
19744f9ac78aSmrg# This macro enables the use of a tool that flags some suspicious and
19754f9ac78aSmrg# non-portable constructs (likely to be bugs) in C language source code.
19764f9ac78aSmrg# It will attempt to locate the tool and use appropriate options.
19774f9ac78aSmrg# There are various lint type tools on different platforms.
19784f9ac78aSmrg#
19794f9ac78aSmrg# Interface to module:
19804f9ac78aSmrg# LINT:		returns the path to the tool found on the platform
19814f9ac78aSmrg#		or the value set to LINT on the configure cmd line
19824f9ac78aSmrg#		also an Automake conditional
19834f9ac78aSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
19844f9ac78aSmrg#
19854f9ac78aSmrg# --with-lint:	'yes' user instructs the module to use lint
19864f9ac78aSmrg#		'no' user instructs the module not to use lint (default)
19874f9ac78aSmrg#
19884f9ac78aSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
19894f9ac78aSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1990d1333322Smrg#
1991d1333322SmrgAC_DEFUN([XORG_WITH_LINT],[
1992d1333322Smrg
19934f9ac78aSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
19944f9ac78aSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
19954f9ac78aSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1996d1333322Smrg		[Use a lint-style source code checker (default: disabled)])],
1997d1333322Smrg		[use_lint=$withval], [use_lint=no])
19984f9ac78aSmrg
19994f9ac78aSmrg# Obtain platform specific info like program name and options
20004f9ac78aSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
20014f9ac78aSmrgcase $host_os in
20024f9ac78aSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
20034f9ac78aSmrg	lint_name=splint
20044f9ac78aSmrg	lint_options="-badflag"
20054f9ac78aSmrg	;;
20064f9ac78aSmrg  *freebsd* | *netbsd*)
20074f9ac78aSmrg	lint_name=lint
20084f9ac78aSmrg	lint_options="-u -b"
20094f9ac78aSmrg	;;
20104f9ac78aSmrg  *solaris*)
20114f9ac78aSmrg	lint_name=lint
20124f9ac78aSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
20134f9ac78aSmrg	;;
20144f9ac78aSmrgesac
20154f9ac78aSmrg
20164f9ac78aSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
20174f9ac78aSmrgif test "x$use_lint" = x"yes" ; then
20184f9ac78aSmrg   AC_PATH_PROG([LINT], [$lint_name])
20194f9ac78aSmrg   if test "x$LINT" = "x"; then
20204f9ac78aSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
20214f9ac78aSmrg   fi
20224f9ac78aSmrgelif test "x$use_lint" = x"no" ; then
20234f9ac78aSmrg   if test "x$LINT" != "x"; then
20244f9ac78aSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
20254f9ac78aSmrg   fi
2026d1333322Smrgelse
20274f9ac78aSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2028d1333322Smrgfi
20294f9ac78aSmrg
20304f9ac78aSmrg# User supplied flags override default flags
20314f9ac78aSmrgif test "x$LINT_FLAGS" != "x"; then
20324f9ac78aSmrg   lint_options=$LINT_FLAGS
2033d1333322Smrgfi
2034d1333322Smrg
20354f9ac78aSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
20364f9ac78aSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2037d1333322Smrg
2038d1333322Smrg]) # XORG_WITH_LINT
2039d1333322Smrg
2040d1333322Smrg# XORG_LINT_LIBRARY(LIBNAME)
2041d1333322Smrg# --------------------------
2042d1333322Smrg# Minimum version: 1.1.0
2043d1333322Smrg#
2044d1333322Smrg# Sets up flags for building lint libraries for checking programs that call
2045d1333322Smrg# functions in the library.
2046d1333322Smrg#
20474f9ac78aSmrg# Interface to module:
20484f9ac78aSmrg# LINTLIB		- Automake variable with the name of lint library file to make
20494f9ac78aSmrg# MAKE_LINT_LIB		- Automake conditional
20504f9ac78aSmrg#
20514f9ac78aSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
20524f9ac78aSmrg#			  - 'no' user instructs the module not to create a lint library (default)
2053d1333322Smrg
2054d1333322SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2055d1333322SmrgAC_REQUIRE([XORG_WITH_LINT])
20564f9ac78aSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2057d1333322Smrg	[Create lint library (default: disabled)])],
2058d1333322Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
20594f9ac78aSmrg
20604f9ac78aSmrgif test "x$make_lint_lib" = x"yes" ; then
20614f9ac78aSmrg   LINTLIB=llib-l$1.ln
20624f9ac78aSmrg   if test "x$LINT" = "x"; then
20634f9ac78aSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
20644f9ac78aSmrg   fi
20654f9ac78aSmrgelif test "x$make_lint_lib" != x"no" ; then
20664f9ac78aSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2067d1333322Smrgfi
20684f9ac78aSmrg
2069d1333322SmrgAC_SUBST(LINTLIB)
2070d1333322SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2071d1333322Smrg
2072d1333322Smrg]) # XORG_LINT_LIBRARY
2073d1333322Smrg
20744f9ac78aSmrg# XORG_CWARNFLAGS
20754f9ac78aSmrg# ---------------
20764f9ac78aSmrg# Minimum version: 1.2.0
20774f9ac78aSmrg#
20784f9ac78aSmrg# Defines CWARNFLAGS to enable C compiler warnings.
20794f9ac78aSmrg#
20804f9ac78aSmrgAC_DEFUN([XORG_CWARNFLAGS], [
20814f9ac78aSmrgAC_REQUIRE([AC_PROG_CC_C99])
20824f9ac78aSmrgif  test "x$GCC" = xyes ; then
20834f9ac78aSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
20844f9ac78aSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
20854f9ac78aSmrg-Wbad-function-cast -Wformat=2"
20864f9ac78aSmrg    case `$CC -dumpversion` in
20874f9ac78aSmrg    3.4.* | 4.*)
20884f9ac78aSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
20894f9ac78aSmrg	;;
20904f9ac78aSmrg    esac
20914f9ac78aSmrgelse
20924f9ac78aSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
20934f9ac78aSmrg    if test "x$SUNCC" = "xyes"; then
20944f9ac78aSmrg	CWARNFLAGS="-v"
20954f9ac78aSmrg    fi
20964f9ac78aSmrgfi
20974f9ac78aSmrgAC_SUBST(CWARNFLAGS)
20984f9ac78aSmrg]) # XORG_CWARNFLAGS
20994f9ac78aSmrg
21004f9ac78aSmrg# XORG_STRICT_OPTION
21014f9ac78aSmrg# -----------------------
21024f9ac78aSmrg# Minimum version: 1.3.0
21034f9ac78aSmrg#
21044f9ac78aSmrg# Add configure option to enable strict compilation
21054f9ac78aSmrgAC_DEFUN([XORG_STRICT_OPTION], [
21064f9ac78aSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
21074f9ac78aSmrgAC_REQUIRE([AC_PROG_CC_C99])
21084f9ac78aSmrgAC_REQUIRE([XORG_CWARNFLAGS])
21094f9ac78aSmrg
21104f9ac78aSmrgAC_ARG_ENABLE(strict-compilation,
21114f9ac78aSmrg			  AS_HELP_STRING([--enable-strict-compilation],
21124f9ac78aSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
21134f9ac78aSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
21144f9ac78aSmrgif test "x$STRICT_COMPILE" = "xyes"; then
21154f9ac78aSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
21164f9ac78aSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
21174f9ac78aSmrg	if test "x$GCC" = xyes ; then
21184f9ac78aSmrg		STRICT_CFLAGS="-pedantic -Werror"
21194f9ac78aSmrg	elif test "x$SUNCC" = "xyes"; then
21204f9ac78aSmrg		STRICT_CFLAGS="-errwarn"
21214f9ac78aSmrg    elif test "x$INTELCC" = "xyes"; then
21224f9ac78aSmrg		STRICT_CFLAGS="-Werror"
21234f9ac78aSmrg	fi
21244f9ac78aSmrgfi
21254f9ac78aSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
21264f9ac78aSmrgAC_SUBST([CWARNFLAGS])
21274f9ac78aSmrg]) # XORG_STRICT_OPTION
21284f9ac78aSmrg
21294f9ac78aSmrg# XORG_DEFAULT_OPTIONS
21304f9ac78aSmrg# --------------------
21314f9ac78aSmrg# Minimum version: 1.3.0
21324f9ac78aSmrg#
21334f9ac78aSmrg# Defines default options for X.Org modules.
21344f9ac78aSmrg#
21354f9ac78aSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
21364f9ac78aSmrgAC_REQUIRE([AC_PROG_INSTALL])
21374f9ac78aSmrgXORG_CWARNFLAGS
21384f9ac78aSmrgXORG_STRICT_OPTION
21394f9ac78aSmrgXORG_RELEASE_VERSION
21404f9ac78aSmrgXORG_CHANGELOG
21414f9ac78aSmrgXORG_INSTALL
21424f9ac78aSmrgXORG_MANPAGE_SECTIONS
21434f9ac78aSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
21444f9ac78aSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
21454f9ac78aSmrg]) # XORG_DEFAULT_OPTIONS
21464f9ac78aSmrg
21474f9ac78aSmrg# XORG_INSTALL()
21484f9ac78aSmrg# ----------------
21494f9ac78aSmrg# Minimum version: 1.4.0
21504f9ac78aSmrg#
21514f9ac78aSmrg# Defines the variable INSTALL_CMD as the command to copy
21524f9ac78aSmrg# INSTALL from $prefix/share/util-macros.
21534f9ac78aSmrg#
21544f9ac78aSmrgAC_DEFUN([XORG_INSTALL], [
21554f9ac78aSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
21564f9ac78aSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
21574f9ac78aSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
21584f9ac78aSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
21594f9ac78aSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
21604f9ac78aSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
21614f9ac78aSmrgAC_SUBST([INSTALL_CMD])
21624f9ac78aSmrg]) # XORG_INSTALL
2163d1333322Smrgdnl Copyright 2005 Red Hat, Inc
2164d1333322Smrgdnl
2165d1333322Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
2166d1333322Smrgdnl documentation for any purpose is hereby granted without fee, provided that
2167d1333322Smrgdnl the above copyright notice appear in all copies and that both that
2168d1333322Smrgdnl copyright notice and this permission notice appear in supporting
2169d1333322Smrgdnl documentation.
2170d1333322Smrgdnl
2171d1333322Smrgdnl The above copyright notice and this permission notice shall be included
2172d1333322Smrgdnl in all copies or substantial portions of the Software.
2173d1333322Smrgdnl
2174d1333322Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2175d1333322Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2176d1333322Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2177d1333322Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2178d1333322Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2179d1333322Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2180d1333322Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
2181d1333322Smrgdnl
2182d1333322Smrgdnl Except as contained in this notice, the name of the copyright holders shall
2183d1333322Smrgdnl not be used in advertising or otherwise to promote the sale, use or
2184d1333322Smrgdnl other dealings in this Software without prior written authorization
2185d1333322Smrgdnl from the copyright holders.
2186d1333322Smrgdnl
2187d1333322Smrg
2188d1333322Smrg# XORG_RELEASE_VERSION
2189d1333322Smrg# --------------------
21904f9ac78aSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2191d1333322Smrg 
2192d1333322SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
2193d1333322Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2194d1333322Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2195d1333322Smrg		[Major version of this package])
2196d1333322Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2197d1333322Smrg	if test "x$PVM" = "x"; then
2198d1333322Smrg		PVM="0"
2199d1333322Smrg	fi
2200d1333322Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2201d1333322Smrg		[$PVM],
2202d1333322Smrg		[Minor version of this package])
2203d1333322Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2204d1333322Smrg	if test "x$PVP" = "x"; then
2205d1333322Smrg		PVP="0"
2206d1333322Smrg	fi
2207d1333322Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2208d1333322Smrg		[$PVP],
2209d1333322Smrg		[Patch version of this package])
2210d1333322Smrg])
2211d1333322Smrg
22124f9ac78aSmrg# XORG_CHANGELOG()
22134f9ac78aSmrg# ----------------
22144f9ac78aSmrg# Minimum version: 1.2.0
22154f9ac78aSmrg#
22164f9ac78aSmrg# Defines the variable CHANGELOG_CMD as the command to generate
22174f9ac78aSmrg# ChangeLog from git.
22184f9ac78aSmrg#
22194f9ac78aSmrg#
22204f9ac78aSmrgAC_DEFUN([XORG_CHANGELOG], [
22214f9ac78aSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
22224f9ac78aSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
22234f9ac78aSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
22244f9ac78aSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
22254f9ac78aSmrgAC_SUBST([CHANGELOG_CMD])
22264f9ac78aSmrg]) # XORG_CHANGELOG
22274f9ac78aSmrg
2228d1333322Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2229d1333322Smrg# 
2230d1333322Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2231d1333322Smrg#
2232d1333322Smrg# This program is free software; you can redistribute it and/or modify
2233d1333322Smrg# it under the terms of the GNU General Public License as published by
2234d1333322Smrg# the Free Software Foundation; either version 2 of the License, or
2235d1333322Smrg# (at your option) any later version.
2236d1333322Smrg#
2237d1333322Smrg# This program is distributed in the hope that it will be useful, but
2238d1333322Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2239d1333322Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2240d1333322Smrg# General Public License for more details.
2241d1333322Smrg#
2242d1333322Smrg# You should have received a copy of the GNU General Public License
2243d1333322Smrg# along with this program; if not, write to the Free Software
2244d1333322Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2245d1333322Smrg#
2246d1333322Smrg# As a special exception to the GNU General Public License, if you
2247d1333322Smrg# distribute this file as part of a program that contains a
2248d1333322Smrg# configuration script generated by Autoconf, you may include it under
2249d1333322Smrg# the same distribution terms that you use for the rest of that program.
2250d1333322Smrg
2251d1333322Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2252d1333322Smrg# ----------------------------------
2253d1333322SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
2254d1333322Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2255d1333322Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2256d1333322SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2257d1333322Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2258d1333322Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2259d1333322Smrgfi
2260d1333322Smrgif test -n "$PKG_CONFIG"; then
22614f9ac78aSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
2262d1333322Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2263d1333322Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2264d1333322Smrg		AC_MSG_RESULT([yes])
2265d1333322Smrg	else
2266d1333322Smrg		AC_MSG_RESULT([no])
2267d1333322Smrg		PKG_CONFIG=""
2268d1333322Smrg	fi
2269d1333322Smrg		
2270d1333322Smrgfi[]dnl
2271d1333322Smrg])# PKG_PROG_PKG_CONFIG
2272d1333322Smrg
2273d1333322Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2274d1333322Smrg#
2275d1333322Smrg# Check to see whether a particular set of modules exists.  Similar
2276d1333322Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2277d1333322Smrg#
2278d1333322Smrg#
2279d1333322Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
2280d1333322Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
2281d1333322Smrg# PKG_CHECK_EXISTS manually
2282d1333322Smrg# --------------------------------------------------------------
2283d1333322SmrgAC_DEFUN([PKG_CHECK_EXISTS],
2284d1333322Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2285d1333322Smrgif test -n "$PKG_CONFIG" && \
2286d1333322Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2287d1333322Smrg  m4_ifval([$2], [$2], [:])
2288d1333322Smrgm4_ifvaln([$3], [else
2289d1333322Smrg  $3])dnl
2290d1333322Smrgfi])
2291d1333322Smrg
2292d1333322Smrg
2293d1333322Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2294d1333322Smrg# ---------------------------------------------
2295d1333322Smrgm4_define([_PKG_CONFIG],
22964f9ac78aSmrg[if test -n "$$1"; then
22974f9ac78aSmrg    pkg_cv_[]$1="$$1"
22984f9ac78aSmrg elif test -n "$PKG_CONFIG"; then
22994f9ac78aSmrg    PKG_CHECK_EXISTS([$3],
23004f9ac78aSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
23014f9ac78aSmrg		     [pkg_failed=yes])
23024f9ac78aSmrg else
23034f9ac78aSmrg    pkg_failed=untried
2304d1333322Smrgfi[]dnl
2305d1333322Smrg])# _PKG_CONFIG
2306d1333322Smrg
23074f9ac78aSmrg# _PKG_SHORT_ERRORS_SUPPORTED
23084f9ac78aSmrg# -----------------------------
23094f9ac78aSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
23104f9ac78aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
23114f9ac78aSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
23124f9ac78aSmrg        _pkg_short_errors_supported=yes
23134f9ac78aSmrgelse
23144f9ac78aSmrg        _pkg_short_errors_supported=no
23154f9ac78aSmrgfi[]dnl
23164f9ac78aSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
23174f9ac78aSmrg
23184f9ac78aSmrg
2319d1333322Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2320d1333322Smrg# [ACTION-IF-NOT-FOUND])
2321d1333322Smrg#
2322d1333322Smrg#
2323d1333322Smrg# Note that if there is a possibility the first call to
2324d1333322Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
2325d1333322Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2326d1333322Smrg#
2327d1333322Smrg#
2328d1333322Smrg# --------------------------------------------------------------
2329d1333322SmrgAC_DEFUN([PKG_CHECK_MODULES],
2330d1333322Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2331d1333322SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2332d1333322SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2333d1333322Smrg
2334d1333322Smrgpkg_failed=no
2335d1333322SmrgAC_MSG_CHECKING([for $1])
2336d1333322Smrg
2337d1333322Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2338d1333322Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2339d1333322Smrg
23404f9ac78aSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
23414f9ac78aSmrgand $1[]_LIBS to avoid the need to call pkg-config.
23424f9ac78aSmrgSee the pkg-config man page for more details.])
23434f9ac78aSmrg
2344d1333322Smrgif test $pkg_failed = yes; then
23454f9ac78aSmrg        _PKG_SHORT_ERRORS_SUPPORTED
23464f9ac78aSmrg        if test $_pkg_short_errors_supported = yes; then
23474f9ac78aSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
23484f9ac78aSmrg        else 
23494f9ac78aSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
23504f9ac78aSmrg        fi
2351d1333322Smrg	# Put the nasty error message in config.log where it belongs
23524f9ac78aSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2353d1333322Smrg
2354d1333322Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
23554f9ac78aSmrg[Package requirements ($2) were not met:
23564f9ac78aSmrg
23574f9ac78aSmrg$$1_PKG_ERRORS
23584f9ac78aSmrg
2359d1333322SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
2360d1333322Smrginstalled software in a non-standard prefix.
2361d1333322Smrg
23624f9ac78aSmrg_PKG_TEXT
23634f9ac78aSmrg])],
23644f9ac78aSmrg		[AC_MSG_RESULT([no])
23654f9ac78aSmrg                $4])
2366d1333322Smrgelif test $pkg_failed = untried; then
2367d1333322Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
2368d1333322Smrg[The pkg-config script could not be found or is too old.  Make sure it
2369d1333322Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
2370d1333322Smrgpath to pkg-config.
2371d1333322Smrg
23724f9ac78aSmrg_PKG_TEXT
2373d1333322Smrg
23744f9ac78aSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
2375d1333322Smrg		[$4])
2376d1333322Smrgelse
2377d1333322Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2378d1333322Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2379d1333322Smrg        AC_MSG_RESULT([yes])
2380d1333322Smrg	ifelse([$3], , :, [$3])
2381d1333322Smrgfi[]dnl
2382d1333322Smrg])# PKG_CHECK_MODULES
2383d1333322Smrg
2384