aclocal.m4 revision 48af84fa
148af84faSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
266fe65f6Smrg
366fe65f6Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4a9274bcdSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
566fe65f6Smrg# This file is free software; the Free Software Foundation
666fe65f6Smrg# gives unlimited permission to copy and/or distribute it,
766fe65f6Smrg# with or without modifications, as long as this notice is preserved.
866fe65f6Smrg
966fe65f6Smrg# This program is distributed in the hope that it will be useful,
1066fe65f6Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1166fe65f6Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1266fe65f6Smrg# PARTICULAR PURPOSE.
1366fe65f6Smrg
1489d09728Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1589d09728Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1648af84faSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
1748af84faSmrg[m4_warning([this file was generated for autoconf 2.68.
1889d09728SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
1989d09728SmrgIf you have problems, you may need to regenerate the build system entirely.
2089d09728SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
2189d09728Smrg
22a9274bcdSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23a9274bcdSmrg#
24a9274bcdSmrg# This file is free software; the Free Software Foundation
25a9274bcdSmrg# gives unlimited permission to copy and/or distribute it,
26a9274bcdSmrg# with or without modifications, as long as this notice is preserved.
2789d09728Smrg
28a9274bcdSmrg# AM_AUTOMAKE_VERSION(VERSION)
29a9274bcdSmrg# ----------------------------
30a9274bcdSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31a9274bcdSmrg# generated from the m4 files accompanying Automake X.Y.
32a9274bcdSmrg# (This private macro should not be called outside this file.)
33a9274bcdSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34a9274bcdSmrg[am__api_version='1.11'
35a9274bcdSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36a9274bcdSmrgdnl require some minimum version.  Point them to the right macro.
3748af84faSmrgm4_if([$1], [1.11.1], [],
38a9274bcdSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39a9274bcdSmrg])
40a9274bcdSmrg
41a9274bcdSmrg# _AM_AUTOCONF_VERSION(VERSION)
42a9274bcdSmrg# -----------------------------
43a9274bcdSmrg# aclocal traces this macro to find the Autoconf version.
44a9274bcdSmrg# This is a private macro too.  Using m4_define simplifies
45a9274bcdSmrg# the logic in aclocal, which can simply ignore this definition.
46a9274bcdSmrgm4_define([_AM_AUTOCONF_VERSION], [])
47a9274bcdSmrg
48a9274bcdSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49a9274bcdSmrg# -------------------------------
50a9274bcdSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51a9274bcdSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52a9274bcdSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5348af84faSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
54a9274bcdSmrgm4_ifndef([AC_AUTOCONF_VERSION],
55a9274bcdSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56a9274bcdSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57a9274bcdSmrg
58a9274bcdSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59a9274bcdSmrg
60a9274bcdSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6189d09728Smrg#
62a9274bcdSmrg# This file is free software; the Free Software Foundation
63a9274bcdSmrg# gives unlimited permission to copy and/or distribute it,
64a9274bcdSmrg# with or without modifications, as long as this notice is preserved.
65a9274bcdSmrg
66a9274bcdSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67a9274bcdSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68a9274bcdSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6989d09728Smrg#
70a9274bcdSmrg# Of course, Automake must honor this variable whenever it calls a
71a9274bcdSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72a9274bcdSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73a9274bcdSmrg# depending on how configure is run.  This is pretty annoying, since
74a9274bcdSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75a9274bcdSmrg# source directory, any form will work fine, but in subdirectories a
76a9274bcdSmrg# relative path needs to be adjusted first.
7789d09728Smrg#
78a9274bcdSmrg# $ac_aux_dir/missing
79a9274bcdSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80a9274bcdSmrg# $top_srcdir/$ac_aux_dir/missing
81a9274bcdSmrg#    fails if $ac_aux_dir is absolute,
82a9274bcdSmrg#    fails when called from a subdirectory in a VPATH build with
83a9274bcdSmrg#          a relative $ac_aux_dir
8489d09728Smrg#
85a9274bcdSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86a9274bcdSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
87a9274bcdSmrg# harmless because $srcdir is `.', but things will broke when you
88a9274bcdSmrg# start a VPATH build or use an absolute $srcdir.
8989d09728Smrg#
90a9274bcdSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91a9274bcdSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92a9274bcdSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93a9274bcdSmrg# and then we would define $MISSING as
94a9274bcdSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95a9274bcdSmrg# This will work as long as MISSING is not called from configure, because
96a9274bcdSmrg# unfortunately $(top_srcdir) has no meaning in configure.
97a9274bcdSmrg# However there are other variables, like CC, which are often used in
98a9274bcdSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99a9274bcdSmrg#
100a9274bcdSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
101a9274bcdSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
102a9274bcdSmrg# configured tree to be moved without reconfiguration.
10366fe65f6Smrg
104a9274bcdSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105a9274bcdSmrg[dnl Rely on autoconf to set up CDPATH properly.
106a9274bcdSmrgAC_PREREQ([2.50])dnl
107a9274bcdSmrg# expand $ac_aux_dir to an absolute path
108a9274bcdSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
109a9274bcdSmrg])
11066fe65f6Smrg
111a9274bcdSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11266fe65f6Smrg
113a9274bcdSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114a9274bcdSmrg# Free Software Foundation, Inc.
11589d09728Smrg#
116a9274bcdSmrg# This file is free software; the Free Software Foundation
117a9274bcdSmrg# gives unlimited permission to copy and/or distribute it,
118a9274bcdSmrg# with or without modifications, as long as this notice is preserved.
11966fe65f6Smrg
120a9274bcdSmrg# serial 9
12166fe65f6Smrg
122a9274bcdSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123a9274bcdSmrg# -------------------------------------
124a9274bcdSmrg# Define a conditional.
125a9274bcdSmrgAC_DEFUN([AM_CONDITIONAL],
126a9274bcdSmrg[AC_PREREQ(2.52)dnl
127a9274bcdSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128a9274bcdSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129a9274bcdSmrgAC_SUBST([$1_TRUE])dnl
130a9274bcdSmrgAC_SUBST([$1_FALSE])dnl
131a9274bcdSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132a9274bcdSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133a9274bcdSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134a9274bcdSmrgif $2; then
135a9274bcdSmrg  $1_TRUE=
136a9274bcdSmrg  $1_FALSE='#'
137a9274bcdSmrgelse
138a9274bcdSmrg  $1_TRUE='#'
139a9274bcdSmrg  $1_FALSE=
14066fe65f6Smrgfi
141a9274bcdSmrgAC_CONFIG_COMMANDS_PRE(
142a9274bcdSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143a9274bcdSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144a9274bcdSmrgUsually this means the macro was only invoked conditionally.]])
145a9274bcdSmrgfi])])
14666fe65f6Smrg
147a9274bcdSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148a9274bcdSmrg# Free Software Foundation, Inc.
149a9274bcdSmrg#
150a9274bcdSmrg# This file is free software; the Free Software Foundation
151a9274bcdSmrg# gives unlimited permission to copy and/or distribute it,
152a9274bcdSmrg# with or without modifications, as long as this notice is preserved.
15366fe65f6Smrg
154a9274bcdSmrg# serial 10
15566fe65f6Smrg
156a9274bcdSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157a9274bcdSmrg# written in clear, in which case automake, when reading aclocal.m4,
158a9274bcdSmrg# will think it sees a *use*, and therefore will trigger all it's
159a9274bcdSmrg# C support machinery.  Also note that it means that autoscan, seeing
160a9274bcdSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
16166fe65f6Smrg
16266fe65f6Smrg
163a9274bcdSmrg# _AM_DEPENDENCIES(NAME)
164a9274bcdSmrg# ----------------------
165a9274bcdSmrg# See how the compiler implements dependency checking.
166a9274bcdSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167a9274bcdSmrg# We try a few techniques and use that to set a single cache variable.
168a9274bcdSmrg#
169a9274bcdSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170a9274bcdSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171a9274bcdSmrg# dependency, and given that the user is not expected to run this macro,
172a9274bcdSmrg# just rely on AC_PROG_CC.
173a9274bcdSmrgAC_DEFUN([_AM_DEPENDENCIES],
174a9274bcdSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175a9274bcdSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176a9274bcdSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177a9274bcdSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
17866fe65f6Smrg
179a9274bcdSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180a9274bcdSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181a9274bcdSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182a9274bcdSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183a9274bcdSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184a9274bcdSmrg                   [depcc="$$1"   am_compiler_list=])
18566fe65f6Smrg
186a9274bcdSmrgAC_CACHE_CHECK([dependency style of $depcc],
187a9274bcdSmrg               [am_cv_$1_dependencies_compiler_type],
188a9274bcdSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189a9274bcdSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
190a9274bcdSmrg  # making bogus files that we don't know about and never remove.  For
191a9274bcdSmrg  # instance it was reported that on HP-UX the gcc test will end up
192a9274bcdSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
193a9274bcdSmrg  # in D'.
194a9274bcdSmrg  mkdir conftest.dir
195a9274bcdSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196a9274bcdSmrg  # using a relative directory.
197a9274bcdSmrg  cp "$am_depcomp" conftest.dir
198a9274bcdSmrg  cd conftest.dir
199a9274bcdSmrg  # We will build objects and dependencies in a subdirectory because
200a9274bcdSmrg  # it helps to detect inapplicable dependency modes.  For instance
201a9274bcdSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202a9274bcdSmrg  # side effect of compilation, but ICC will put the dependencies in
203a9274bcdSmrg  # the current directory while Tru64 will put them in the object
204a9274bcdSmrg  # directory.
205a9274bcdSmrg  mkdir sub
20689d09728Smrg
207a9274bcdSmrg  am_cv_$1_dependencies_compiler_type=none
208a9274bcdSmrg  if test "$am_compiler_list" = ""; then
209a9274bcdSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210a9274bcdSmrg  fi
211a9274bcdSmrg  am__universal=false
212a9274bcdSmrg  m4_case([$1], [CC],
213a9274bcdSmrg    [case " $depcc " in #(
214a9274bcdSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215a9274bcdSmrg     esac],
216a9274bcdSmrg    [CXX],
217a9274bcdSmrg    [case " $depcc " in #(
218a9274bcdSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219a9274bcdSmrg     esac])
22066fe65f6Smrg
221a9274bcdSmrg  for depmode in $am_compiler_list; do
222a9274bcdSmrg    # Setup a source with many dependencies, because some compilers
223a9274bcdSmrg    # like to wrap large dependency lists on column 80 (with \), and
224a9274bcdSmrg    # we should not choose a depcomp mode which is confused by this.
225a9274bcdSmrg    #
226a9274bcdSmrg    # We need to recreate these files for each test, as the compiler may
227a9274bcdSmrg    # overwrite some of them when testing with obscure command lines.
228a9274bcdSmrg    # This happens at least with the AIX C compiler.
229a9274bcdSmrg    : > sub/conftest.c
230a9274bcdSmrg    for i in 1 2 3 4 5 6; do
231a9274bcdSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232a9274bcdSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233a9274bcdSmrg      # Solaris 8's {/usr,}/bin/sh.
234a9274bcdSmrg      touch sub/conftst$i.h
235a9274bcdSmrg    done
236a9274bcdSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
23766fe65f6Smrg
238a9274bcdSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239a9274bcdSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240a9274bcdSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241a9274bcdSmrg    # versions had trouble with output in subdirs
242a9274bcdSmrg    am__obj=sub/conftest.${OBJEXT-o}
243a9274bcdSmrg    am__minus_obj="-o $am__obj"
244a9274bcdSmrg    case $depmode in
245a9274bcdSmrg    gcc)
246a9274bcdSmrg      # This depmode causes a compiler race in universal mode.
247a9274bcdSmrg      test "$am__universal" = false || continue
248a9274bcdSmrg      ;;
249a9274bcdSmrg    nosideeffect)
250a9274bcdSmrg      # after this tag, mechanisms are not by side-effect, so they'll
251a9274bcdSmrg      # only be used when explicitly requested
252a9274bcdSmrg      if test "x$enable_dependency_tracking" = xyes; then
253a9274bcdSmrg	continue
254a9274bcdSmrg      else
255a9274bcdSmrg	break
256a9274bcdSmrg      fi
257a9274bcdSmrg      ;;
258a9274bcdSmrg    msvisualcpp | msvcmsys)
259a9274bcdSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
260a9274bcdSmrg      # not run yet.  These depmodes are late enough in the game, and
261a9274bcdSmrg      # so weak that their functioning should not be impacted.
262a9274bcdSmrg      am__obj=conftest.${OBJEXT-o}
263a9274bcdSmrg      am__minus_obj=
264a9274bcdSmrg      ;;
265a9274bcdSmrg    none) break ;;
266a9274bcdSmrg    esac
267a9274bcdSmrg    if depmode=$depmode \
268a9274bcdSmrg       source=sub/conftest.c object=$am__obj \
269a9274bcdSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270a9274bcdSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271a9274bcdSmrg         >/dev/null 2>conftest.err &&
272a9274bcdSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273a9274bcdSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274a9274bcdSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275a9274bcdSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276a9274bcdSmrg      # icc doesn't choke on unknown options, it will just issue warnings
277a9274bcdSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
278a9274bcdSmrg      # that says an option was ignored or not supported.
279a9274bcdSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280a9274bcdSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281a9274bcdSmrg      # The diagnosis changed in icc 8.0:
282a9274bcdSmrg      #   icc: Command line remark: option '-MP' not supported
283a9274bcdSmrg      if (grep 'ignoring option' conftest.err ||
284a9274bcdSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285a9274bcdSmrg        am_cv_$1_dependencies_compiler_type=$depmode
286a9274bcdSmrg        break
287a9274bcdSmrg      fi
288a9274bcdSmrg    fi
289a9274bcdSmrg  done
29066fe65f6Smrg
291a9274bcdSmrg  cd ..
292a9274bcdSmrg  rm -rf conftest.dir
29366fe65f6Smrgelse
294a9274bcdSmrg  am_cv_$1_dependencies_compiler_type=none
29566fe65f6Smrgfi
296a9274bcdSmrg])
297a9274bcdSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298a9274bcdSmrgAM_CONDITIONAL([am__fastdep$1], [
299a9274bcdSmrg  test "x$enable_dependency_tracking" != xno \
300a9274bcdSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301a9274bcdSmrg])
30266fe65f6Smrg
30366fe65f6Smrg
304a9274bcdSmrg# AM_SET_DEPDIR
305a9274bcdSmrg# -------------
306a9274bcdSmrg# Choose a directory name for dependency files.
307a9274bcdSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308a9274bcdSmrgAC_DEFUN([AM_SET_DEPDIR],
309a9274bcdSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310a9274bcdSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311a9274bcdSmrg])
31266fe65f6Smrg
31366fe65f6Smrg
314a9274bcdSmrg# AM_DEP_TRACK
315a9274bcdSmrg# ------------
316a9274bcdSmrgAC_DEFUN([AM_DEP_TRACK],
317a9274bcdSmrg[AC_ARG_ENABLE(dependency-tracking,
318a9274bcdSmrg[  --disable-dependency-tracking  speeds up one-time build
319a9274bcdSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320a9274bcdSmrgif test "x$enable_dependency_tracking" != xno; then
321a9274bcdSmrg  am_depcomp="$ac_aux_dir/depcomp"
322a9274bcdSmrg  AMDEPBACKSLASH='\'
32366fe65f6Smrgfi
324a9274bcdSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325a9274bcdSmrgAC_SUBST([AMDEPBACKSLASH])dnl
326a9274bcdSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327a9274bcdSmrg])
32866fe65f6Smrg
329a9274bcdSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
33066fe65f6Smrg
331a9274bcdSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332a9274bcdSmrg# Free Software Foundation, Inc.
333a9274bcdSmrg#
334a9274bcdSmrg# This file is free software; the Free Software Foundation
335a9274bcdSmrg# gives unlimited permission to copy and/or distribute it,
336a9274bcdSmrg# with or without modifications, as long as this notice is preserved.
33766fe65f6Smrg
338a9274bcdSmrg#serial 5
33966fe65f6Smrg
340a9274bcdSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341a9274bcdSmrg# ------------------------------
342a9274bcdSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343a9274bcdSmrg[{
344a9274bcdSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345a9274bcdSmrg  # are listed without --file.  Let's play safe and only enable the eval
346a9274bcdSmrg  # if we detect the quoting.
347a9274bcdSmrg  case $CONFIG_FILES in
348a9274bcdSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
349a9274bcdSmrg  *)   set x $CONFIG_FILES ;;
350a9274bcdSmrg  esac
351a9274bcdSmrg  shift
352a9274bcdSmrg  for mf
353a9274bcdSmrg  do
354a9274bcdSmrg    # Strip MF so we end up with the name of the file.
355a9274bcdSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356a9274bcdSmrg    # Check whether this is an Automake generated Makefile or not.
357a9274bcdSmrg    # We used to match only the files named `Makefile.in', but
358a9274bcdSmrg    # some people rename them; so instead we look at the file content.
359a9274bcdSmrg    # Grep'ing the first line is not enough: some people post-process
360a9274bcdSmrg    # each Makefile.in and add a new line on top of each file to say so.
361a9274bcdSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
362a9274bcdSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
363a9274bcdSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364a9274bcdSmrg      dirpart=`AS_DIRNAME("$mf")`
365a9274bcdSmrg    else
366a9274bcdSmrg      continue
367a9274bcdSmrg    fi
368a9274bcdSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
369a9274bcdSmrg    # from the Makefile without running `make'.
370a9274bcdSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371a9274bcdSmrg    test -z "$DEPDIR" && continue
372a9274bcdSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373a9274bcdSmrg    test -z "am__include" && continue
374a9274bcdSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375a9274bcdSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
376a9274bcdSmrg    U=`sed -n 's/^U = //p' < "$mf"`
377a9274bcdSmrg    # Find all dependency output files, they are included files with
378a9274bcdSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379a9274bcdSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380a9274bcdSmrg    # expansion.
381a9274bcdSmrg    for file in `sed -n "
382a9274bcdSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383a9274bcdSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384a9274bcdSmrg      # Make sure the directory exists.
385a9274bcdSmrg      test -f "$dirpart/$file" && continue
386a9274bcdSmrg      fdir=`AS_DIRNAME(["$file"])`
387a9274bcdSmrg      AS_MKDIR_P([$dirpart/$fdir])
388a9274bcdSmrg      # echo "creating $dirpart/$file"
389a9274bcdSmrg      echo '# dummy' > "$dirpart/$file"
390a9274bcdSmrg    done
391a9274bcdSmrg  done
392a9274bcdSmrg}
393a9274bcdSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
39466fe65f6Smrg
395a9274bcdSmrg
396a9274bcdSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397a9274bcdSmrg# -----------------------------
398a9274bcdSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
39989d09728Smrg#
400a9274bcdSmrg# This code is only required when automatic dependency tracking
401a9274bcdSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
402a9274bcdSmrg# need in order to bootstrap the dependency handling code.
403a9274bcdSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404a9274bcdSmrg[AC_CONFIG_COMMANDS([depfiles],
405a9274bcdSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406a9274bcdSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407a9274bcdSmrg])
40889d09728Smrg
409a9274bcdSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
410a9274bcdSmrg# Free Software Foundation, Inc.
411a9274bcdSmrg#
412a9274bcdSmrg# This file is free software; the Free Software Foundation
413a9274bcdSmrg# gives unlimited permission to copy and/or distribute it,
414a9274bcdSmrg# with or without modifications, as long as this notice is preserved.
41589d09728Smrg
416a9274bcdSmrg# serial 8
41789d09728Smrg
418a9274bcdSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
419a9274bcdSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
42089d09728Smrg
421a9274bcdSmrg# Do all the work for Automake.                             -*- Autoconf -*-
42289d09728Smrg
423a9274bcdSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
424a9274bcdSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
425a9274bcdSmrg#
426a9274bcdSmrg# This file is free software; the Free Software Foundation
427a9274bcdSmrg# gives unlimited permission to copy and/or distribute it,
428a9274bcdSmrg# with or without modifications, as long as this notice is preserved.
429a9274bcdSmrg
430a9274bcdSmrg# serial 16
431a9274bcdSmrg
432a9274bcdSmrg# This macro actually does too much.  Some checks are only needed if
433a9274bcdSmrg# your package does certain things.  But this isn't really a big deal.
434a9274bcdSmrg
435a9274bcdSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
436a9274bcdSmrg# AM_INIT_AUTOMAKE([OPTIONS])
437a9274bcdSmrg# -----------------------------------------------
438a9274bcdSmrg# The call with PACKAGE and VERSION arguments is the old style
439a9274bcdSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
440a9274bcdSmrg# and VERSION should now be passed to AC_INIT and removed from
441a9274bcdSmrg# the call to AM_INIT_AUTOMAKE.
442a9274bcdSmrg# We support both call styles for the transition.  After
443a9274bcdSmrg# the next Automake release, Autoconf can make the AC_INIT
444a9274bcdSmrg# arguments mandatory, and then we can depend on a new Autoconf
445a9274bcdSmrg# release and drop the old call support.
446a9274bcdSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
447a9274bcdSmrg[AC_PREREQ([2.62])dnl
448a9274bcdSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
449a9274bcdSmrgdnl the ones we care about.
450a9274bcdSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
451a9274bcdSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
452a9274bcdSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
453a9274bcdSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
454a9274bcdSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
455a9274bcdSmrg  # is not polluted with repeated "-I."
456a9274bcdSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
457a9274bcdSmrg  # test to see if srcdir already configured
458a9274bcdSmrg  if test -f $srcdir/config.status; then
459a9274bcdSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
460a9274bcdSmrg  fi
46189d09728Smrgfi
46289d09728Smrg
463a9274bcdSmrg# test whether we have cygpath
464a9274bcdSmrgif test -z "$CYGPATH_W"; then
465a9274bcdSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
466a9274bcdSmrg    CYGPATH_W='cygpath -w'
467a9274bcdSmrg  else
468a9274bcdSmrg    CYGPATH_W=echo
469a9274bcdSmrg  fi
47089d09728Smrgfi
471a9274bcdSmrgAC_SUBST([CYGPATH_W])
47289d09728Smrg
473a9274bcdSmrg# Define the identity of the package.
474a9274bcdSmrgdnl Distinguish between old-style and new-style calls.
475a9274bcdSmrgm4_ifval([$2],
476a9274bcdSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
477a9274bcdSmrg AC_SUBST([PACKAGE], [$1])dnl
478a9274bcdSmrg AC_SUBST([VERSION], [$2])],
479a9274bcdSmrg[_AM_SET_OPTIONS([$1])dnl
480a9274bcdSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
481a9274bcdSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
482a9274bcdSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
483a9274bcdSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
484a9274bcdSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
48589d09728Smrg
486a9274bcdSmrg_AM_IF_OPTION([no-define],,
487a9274bcdSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
488a9274bcdSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
48989d09728Smrg
490a9274bcdSmrg# Some tools Automake needs.
491a9274bcdSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
492a9274bcdSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
493a9274bcdSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
494a9274bcdSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
495a9274bcdSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
496a9274bcdSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
497a9274bcdSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
498a9274bcdSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
499a9274bcdSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
500a9274bcdSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
501a9274bcdSmrg# We need awk for the "check" target.  The system "awk" is bad on
502a9274bcdSmrg# some platforms.
503a9274bcdSmrgAC_REQUIRE([AC_PROG_AWK])dnl
504a9274bcdSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
505a9274bcdSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
506a9274bcdSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
507a9274bcdSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
508a9274bcdSmrg			     [_AM_PROG_TAR([v7])])])
509a9274bcdSmrg_AM_IF_OPTION([no-dependencies],,
510a9274bcdSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
511a9274bcdSmrg		  [_AM_DEPENDENCIES(CC)],
512a9274bcdSmrg		  [define([AC_PROG_CC],
513a9274bcdSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
514a9274bcdSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
515a9274bcdSmrg		  [_AM_DEPENDENCIES(CXX)],
516a9274bcdSmrg		  [define([AC_PROG_CXX],
517a9274bcdSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
518a9274bcdSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
519a9274bcdSmrg		  [_AM_DEPENDENCIES(OBJC)],
520a9274bcdSmrg		  [define([AC_PROG_OBJC],
521a9274bcdSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
522a9274bcdSmrg])
523a9274bcdSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
524a9274bcdSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
525a9274bcdSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
526a9274bcdSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
527a9274bcdSmrgAC_CONFIG_COMMANDS_PRE(dnl
528a9274bcdSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
529a9274bcdSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
530a9274bcdSmrg])
531a9274bcdSmrg
532a9274bcdSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
533a9274bcdSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
534a9274bcdSmrgdnl mangled by Autoconf and run in a shell conditional statement.
535a9274bcdSmrgm4_define([_AC_COMPILER_EXEEXT],
536a9274bcdSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537a9274bcdSmrg
538a9274bcdSmrg
539a9274bcdSmrg# When config.status generates a header, we must update the stamp-h file.
540a9274bcdSmrg# This file resides in the same directory as the config header
541a9274bcdSmrg# that is generated.  The stamp files are numbered to have different names.
542a9274bcdSmrg
543a9274bcdSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
544a9274bcdSmrg# loop where config.status creates the headers, so we can generate
545a9274bcdSmrg# our stamp files there.
546a9274bcdSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
547a9274bcdSmrg[# Compute $1's index in $config_headers.
548a9274bcdSmrg_am_arg=$1
549a9274bcdSmrg_am_stamp_count=1
550a9274bcdSmrgfor _am_header in $config_headers :; do
551a9274bcdSmrg  case $_am_header in
552a9274bcdSmrg    $_am_arg | $_am_arg:* )
553a9274bcdSmrg      break ;;
554a9274bcdSmrg    * )
555a9274bcdSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
556a9274bcdSmrg  esac
557a9274bcdSmrgdone
558a9274bcdSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
559a9274bcdSmrg
560a9274bcdSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
56189d09728Smrg#
562a9274bcdSmrg# This file is free software; the Free Software Foundation
563a9274bcdSmrg# gives unlimited permission to copy and/or distribute it,
564a9274bcdSmrg# with or without modifications, as long as this notice is preserved.
56566fe65f6Smrg
566a9274bcdSmrg# AM_PROG_INSTALL_SH
567a9274bcdSmrg# ------------------
568a9274bcdSmrg# Define $install_sh.
569a9274bcdSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
570a9274bcdSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
571a9274bcdSmrgif test x"${install_sh}" != xset; then
572a9274bcdSmrg  case $am_aux_dir in
573a9274bcdSmrg  *\ * | *\	*)
574a9274bcdSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
575a9274bcdSmrg  *)
576a9274bcdSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
577a9274bcdSmrg  esac
57866fe65f6Smrgfi
579a9274bcdSmrgAC_SUBST(install_sh)])
58066fe65f6Smrg
581a9274bcdSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
582a9274bcdSmrg#
583a9274bcdSmrg# This file is free software; the Free Software Foundation
584a9274bcdSmrg# gives unlimited permission to copy and/or distribute it,
585a9274bcdSmrg# with or without modifications, as long as this notice is preserved.
586a9274bcdSmrg
587a9274bcdSmrg# serial 2
588a9274bcdSmrg
589a9274bcdSmrg# Check whether the underlying file-system supports filenames
590a9274bcdSmrg# with a leading dot.  For instance MS-DOS doesn't.
591a9274bcdSmrgAC_DEFUN([AM_SET_LEADING_DOT],
592a9274bcdSmrg[rm -rf .tst 2>/dev/null
593a9274bcdSmrgmkdir .tst 2>/dev/null
594a9274bcdSmrgif test -d .tst; then
595a9274bcdSmrg  am__leading_dot=.
59666fe65f6Smrgelse
597a9274bcdSmrg  am__leading_dot=_
59866fe65f6Smrgfi
599a9274bcdSmrgrmdir .tst 2>/dev/null
600a9274bcdSmrgAC_SUBST([am__leading_dot])])
60166fe65f6Smrg
602a9274bcdSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
603a9274bcdSmrg# From Jim Meyering
60466fe65f6Smrg
605a9274bcdSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
606a9274bcdSmrg# Free Software Foundation, Inc.
60789d09728Smrg#
608a9274bcdSmrg# This file is free software; the Free Software Foundation
609a9274bcdSmrg# gives unlimited permission to copy and/or distribute it,
610a9274bcdSmrg# with or without modifications, as long as this notice is preserved.
61189d09728Smrg
612a9274bcdSmrg# serial 5
61389d09728Smrg
614a9274bcdSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
615a9274bcdSmrg# ----------------------------------
616a9274bcdSmrg# Control maintainer-specific portions of Makefiles.
617a9274bcdSmrg# Default is to disable them, unless `enable' is passed literally.
618a9274bcdSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
619a9274bcdSmrg# can override the default with the --enable/--disable switch.
620a9274bcdSmrgAC_DEFUN([AM_MAINTAINER_MODE],
621a9274bcdSmrg[m4_case(m4_default([$1], [disable]),
622a9274bcdSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
623a9274bcdSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
624a9274bcdSmrg       [m4_define([am_maintainer_other], [enable])
625a9274bcdSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
626a9274bcdSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
627a9274bcdSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
628a9274bcdSmrg  AC_ARG_ENABLE([maintainer-mode],
629a9274bcdSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
630a9274bcdSmrg			  (and sometimes confusing) to the casual installer],
631a9274bcdSmrg      [USE_MAINTAINER_MODE=$enableval],
632a9274bcdSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
633a9274bcdSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
634a9274bcdSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
635a9274bcdSmrg  MAINT=$MAINTAINER_MODE_TRUE
636a9274bcdSmrg  AC_SUBST([MAINT])dnl
637a9274bcdSmrg]
638a9274bcdSmrg)
63989d09728Smrg
640a9274bcdSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
64189d09728Smrg
642a9274bcdSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
643a9274bcdSmrg
644a9274bcdSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
64589d09728Smrg#
646a9274bcdSmrg# This file is free software; the Free Software Foundation
647a9274bcdSmrg# gives unlimited permission to copy and/or distribute it,
648a9274bcdSmrg# with or without modifications, as long as this notice is preserved.
64989d09728Smrg
650a9274bcdSmrg# serial 4
65189d09728Smrg
652a9274bcdSmrg# AM_MAKE_INCLUDE()
653a9274bcdSmrg# -----------------
654a9274bcdSmrg# Check to see how make treats includes.
655a9274bcdSmrgAC_DEFUN([AM_MAKE_INCLUDE],
656a9274bcdSmrg[am_make=${MAKE-make}
657a9274bcdSmrgcat > confinc << 'END'
658a9274bcdSmrgam__doit:
659a9274bcdSmrg	@echo this is the am__doit target
660a9274bcdSmrg.PHONY: am__doit
661a9274bcdSmrgEND
662a9274bcdSmrg# If we don't find an include directive, just comment out the code.
663a9274bcdSmrgAC_MSG_CHECKING([for style of include used by $am_make])
664a9274bcdSmrgam__include="#"
665a9274bcdSmrgam__quote=
666a9274bcdSmrg_am_result=none
667a9274bcdSmrg# First try GNU make style include.
668a9274bcdSmrgecho "include confinc" > confmf
669a9274bcdSmrg# Ignore all kinds of additional output from `make'.
670a9274bcdSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
671a9274bcdSmrg*the\ am__doit\ target*)
672a9274bcdSmrg  am__include=include
673a9274bcdSmrg  am__quote=
674a9274bcdSmrg  _am_result=GNU
675a9274bcdSmrg  ;;
676a9274bcdSmrgesac
677a9274bcdSmrg# Now try BSD make style include.
678a9274bcdSmrgif test "$am__include" = "#"; then
679a9274bcdSmrg   echo '.include "confinc"' > confmf
680a9274bcdSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
681a9274bcdSmrg   *the\ am__doit\ target*)
682a9274bcdSmrg     am__include=.include
683a9274bcdSmrg     am__quote="\""
684a9274bcdSmrg     _am_result=BSD
685a9274bcdSmrg     ;;
686a9274bcdSmrg   esac
68789d09728Smrgfi
688a9274bcdSmrgAC_SUBST([am__include])
689a9274bcdSmrgAC_SUBST([am__quote])
690a9274bcdSmrgAC_MSG_RESULT([$_am_result])
691a9274bcdSmrgrm -f confinc confmf
69266fe65f6Smrg])
69366fe65f6Smrg
694a9274bcdSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
69589d09728Smrg
696a9274bcdSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
697a9274bcdSmrg# Free Software Foundation, Inc.
69866fe65f6Smrg#
69966fe65f6Smrg# This file is free software; the Free Software Foundation
70066fe65f6Smrg# gives unlimited permission to copy and/or distribute it,
70166fe65f6Smrg# with or without modifications, as long as this notice is preserved.
70266fe65f6Smrg
703a9274bcdSmrg# serial 6
70489d09728Smrg
705a9274bcdSmrg# AM_MISSING_PROG(NAME, PROGRAM)
706a9274bcdSmrg# ------------------------------
707a9274bcdSmrgAC_DEFUN([AM_MISSING_PROG],
708a9274bcdSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
709a9274bcdSmrg$1=${$1-"${am_missing_run}$2"}
710a9274bcdSmrgAC_SUBST($1)])
71166fe65f6Smrg
71266fe65f6Smrg
713a9274bcdSmrg# AM_MISSING_HAS_RUN
714a9274bcdSmrg# ------------------
715a9274bcdSmrg# Define MISSING if not defined so far and test if it supports --run.
716a9274bcdSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
717a9274bcdSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
718a9274bcdSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
719a9274bcdSmrgAC_REQUIRE_AUX_FILE([missing])dnl
720a9274bcdSmrgif test x"${MISSING+set}" != xset; then
721a9274bcdSmrg  case $am_aux_dir in
722a9274bcdSmrg  *\ * | *\	*)
723a9274bcdSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
724a9274bcdSmrg  *)
725a9274bcdSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
726a9274bcdSmrg  esac
727a9274bcdSmrgfi
728a9274bcdSmrg# Use eval to expand $SHELL
729a9274bcdSmrgif eval "$MISSING --run true"; then
730a9274bcdSmrg  am_missing_run="$MISSING --run "
731a9274bcdSmrgelse
732a9274bcdSmrg  am_missing_run=
733a9274bcdSmrg  AC_MSG_WARN([`missing' script is too old or missing])
734a9274bcdSmrgfi
735a9274bcdSmrg])
73666fe65f6Smrg
737a9274bcdSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
73866fe65f6Smrg#
73966fe65f6Smrg# This file is free software; the Free Software Foundation
74066fe65f6Smrg# gives unlimited permission to copy and/or distribute it,
74166fe65f6Smrg# with or without modifications, as long as this notice is preserved.
74266fe65f6Smrg
743a9274bcdSmrg# AM_PROG_MKDIR_P
744a9274bcdSmrg# ---------------
745a9274bcdSmrg# Check for `mkdir -p'.
746a9274bcdSmrgAC_DEFUN([AM_PROG_MKDIR_P],
747a9274bcdSmrg[AC_PREREQ([2.60])dnl
748a9274bcdSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
749a9274bcdSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
750a9274bcdSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
751a9274bcdSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
752a9274bcdSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
753a9274bcdSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
754a9274bcdSmrgdnl adjustment using top_builddir (which is defined more often than
755a9274bcdSmrgdnl MKDIR_P).
756a9274bcdSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
757a9274bcdSmrgcase $mkdir_p in
758a9274bcdSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
759a9274bcdSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
760a9274bcdSmrgesac
76166fe65f6Smrg])
76266fe65f6Smrg
763a9274bcdSmrg# Helper functions for option handling.                     -*- Autoconf -*-
76466fe65f6Smrg
765a9274bcdSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
76666fe65f6Smrg#
76766fe65f6Smrg# This file is free software; the Free Software Foundation
76866fe65f6Smrg# gives unlimited permission to copy and/or distribute it,
76966fe65f6Smrg# with or without modifications, as long as this notice is preserved.
77066fe65f6Smrg
771a9274bcdSmrg# serial 4
77266fe65f6Smrg
773a9274bcdSmrg# _AM_MANGLE_OPTION(NAME)
774a9274bcdSmrg# -----------------------
775a9274bcdSmrgAC_DEFUN([_AM_MANGLE_OPTION],
776a9274bcdSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
77766fe65f6Smrg
778a9274bcdSmrg# _AM_SET_OPTION(NAME)
779a9274bcdSmrg# ------------------------------
780a9274bcdSmrg# Set option NAME.  Presently that only means defining a flag for this option.
781a9274bcdSmrgAC_DEFUN([_AM_SET_OPTION],
782a9274bcdSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
78366fe65f6Smrg
784a9274bcdSmrg# _AM_SET_OPTIONS(OPTIONS)
785a9274bcdSmrg# ----------------------------------
786a9274bcdSmrg# OPTIONS is a space-separated list of Automake options.
787a9274bcdSmrgAC_DEFUN([_AM_SET_OPTIONS],
788a9274bcdSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
78966fe65f6Smrg
790a9274bcdSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
791a9274bcdSmrg# -------------------------------------------
792a9274bcdSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
793a9274bcdSmrgAC_DEFUN([_AM_IF_OPTION],
794a9274bcdSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
79566fe65f6Smrg
796a9274bcdSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
79766fe65f6Smrg
798a9274bcdSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
799a9274bcdSmrg# Free Software Foundation, Inc.
80066fe65f6Smrg#
801a9274bcdSmrg# This file is free software; the Free Software Foundation
802a9274bcdSmrg# gives unlimited permission to copy and/or distribute it,
803a9274bcdSmrg# with or without modifications, as long as this notice is preserved.
80466fe65f6Smrg
805a9274bcdSmrg# serial 5
80666fe65f6Smrg
807a9274bcdSmrg# AM_SANITY_CHECK
808a9274bcdSmrg# ---------------
809a9274bcdSmrgAC_DEFUN([AM_SANITY_CHECK],
810a9274bcdSmrg[AC_MSG_CHECKING([whether build environment is sane])
811a9274bcdSmrg# Just in case
812a9274bcdSmrgsleep 1
813a9274bcdSmrgecho timestamp > conftest.file
814a9274bcdSmrg# Reject unsafe characters in $srcdir or the absolute working directory
815a9274bcdSmrg# name.  Accept space and tab only in the latter.
816a9274bcdSmrgam_lf='
817a9274bcdSmrg'
818a9274bcdSmrgcase `pwd` in
819a9274bcdSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
820a9274bcdSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
821a9274bcdSmrgesac
822a9274bcdSmrgcase $srcdir in
823a9274bcdSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
824a9274bcdSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
825a9274bcdSmrgesac
82666fe65f6Smrg
827a9274bcdSmrg# Do `set' in a subshell so we don't clobber the current shell's
828a9274bcdSmrg# arguments.  Must try -L first in case configure is actually a
829a9274bcdSmrg# symlink; some systems play weird games with the mod time of symlinks
830a9274bcdSmrg# (eg FreeBSD returns the mod time of the symlink's containing
831a9274bcdSmrg# directory).
832a9274bcdSmrgif (
833a9274bcdSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
834a9274bcdSmrg   if test "$[*]" = "X"; then
835a9274bcdSmrg      # -L didn't work.
836a9274bcdSmrg      set X `ls -t "$srcdir/configure" conftest.file`
837a9274bcdSmrg   fi
838a9274bcdSmrg   rm -f conftest.file
839a9274bcdSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
840a9274bcdSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
84166fe65f6Smrg
842a9274bcdSmrg      # If neither matched, then we have a broken ls.  This can happen
843a9274bcdSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
844a9274bcdSmrg      # broken ls alias from the environment.  This has actually
845a9274bcdSmrg      # happened.  Such a system could not be considered "sane".
846a9274bcdSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
847a9274bcdSmrgalias in your environment])
848a9274bcdSmrg   fi
84966fe65f6Smrg
850a9274bcdSmrg   test "$[2]" = conftest.file
851a9274bcdSmrg   )
852a9274bcdSmrgthen
853a9274bcdSmrg   # Ok.
854a9274bcdSmrg   :
85566fe65f6Smrgelse
856a9274bcdSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
857a9274bcdSmrgCheck your system clock])
85866fe65f6Smrgfi
859a9274bcdSmrgAC_MSG_RESULT(yes)])
86066fe65f6Smrg
861a9274bcdSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
86266fe65f6Smrg#
86366fe65f6Smrg# This file is free software; the Free Software Foundation
86466fe65f6Smrg# gives unlimited permission to copy and/or distribute it,
86566fe65f6Smrg# with or without modifications, as long as this notice is preserved.
86666fe65f6Smrg
867a9274bcdSmrg# serial 1
86866fe65f6Smrg
869a9274bcdSmrg# AM_SILENT_RULES([DEFAULT])
870a9274bcdSmrg# --------------------------
871a9274bcdSmrg# Enable less verbose build rules; with the default set to DEFAULT
872a9274bcdSmrg# (`yes' being less verbose, `no' or empty being verbose).
873a9274bcdSmrgAC_DEFUN([AM_SILENT_RULES],
874a9274bcdSmrg[AC_ARG_ENABLE([silent-rules],
875a9274bcdSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
876a9274bcdSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
877a9274bcdSmrgcase $enable_silent_rules in
878a9274bcdSmrgyes) AM_DEFAULT_VERBOSITY=0;;
879a9274bcdSmrgno)  AM_DEFAULT_VERBOSITY=1;;
880a9274bcdSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
88189d09728Smrgesac
882a9274bcdSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
883a9274bcdSmrgAM_BACKSLASH='\'
884a9274bcdSmrgAC_SUBST([AM_BACKSLASH])dnl
885a9274bcdSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
88666fe65f6Smrg])
88766fe65f6Smrg
888a9274bcdSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
88966fe65f6Smrg#
89066fe65f6Smrg# This file is free software; the Free Software Foundation
89166fe65f6Smrg# gives unlimited permission to copy and/or distribute it,
89266fe65f6Smrg# with or without modifications, as long as this notice is preserved.
89366fe65f6Smrg
894a9274bcdSmrg# AM_PROG_INSTALL_STRIP
895a9274bcdSmrg# ---------------------
896a9274bcdSmrg# One issue with vendor `install' (even GNU) is that you can't
897a9274bcdSmrg# specify the program used to strip binaries.  This is especially
898a9274bcdSmrg# annoying in cross-compiling environments, where the build's strip
899a9274bcdSmrg# is unlikely to handle the host's binaries.
900a9274bcdSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
901a9274bcdSmrg# always use install-sh in `make install-strip', and initialize
902a9274bcdSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
903a9274bcdSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
904a9274bcdSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
905a9274bcdSmrg# Installed binaries are usually stripped using `strip' when the user
906a9274bcdSmrg# run `make install-strip'.  However `strip' might not be the right
907a9274bcdSmrg# tool to use in cross-compilation environments, therefore Automake
908a9274bcdSmrg# will honor the `STRIP' environment variable to overrule this program.
909a9274bcdSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
910a9274bcdSmrgif test "$cross_compiling" != no; then
911a9274bcdSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
912a9274bcdSmrgfi
913a9274bcdSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
914a9274bcdSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
91566fe65f6Smrg
916a9274bcdSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
91766fe65f6Smrg#
91866fe65f6Smrg# This file is free software; the Free Software Foundation
91966fe65f6Smrg# gives unlimited permission to copy and/or distribute it,
92066fe65f6Smrg# with or without modifications, as long as this notice is preserved.
92166fe65f6Smrg
922a9274bcdSmrg# serial 2
92366fe65f6Smrg
924a9274bcdSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
925a9274bcdSmrg# ---------------------------
926a9274bcdSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
927a9274bcdSmrg# This macro is traced by Automake.
928a9274bcdSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
92966fe65f6Smrg
930a9274bcdSmrg# AM_SUBST_NOTMAKE(VARIABLE)
931a9274bcdSmrg# ---------------------------
932a9274bcdSmrg# Public sister of _AM_SUBST_NOTMAKE.
933a9274bcdSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
93466fe65f6Smrg
935a9274bcdSmrg# Check how to create a tarball.                            -*- Autoconf -*-
93666fe65f6Smrg
937a9274bcdSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
93866fe65f6Smrg#
93966fe65f6Smrg# This file is free software; the Free Software Foundation
94066fe65f6Smrg# gives unlimited permission to copy and/or distribute it,
94166fe65f6Smrg# with or without modifications, as long as this notice is preserved.
94266fe65f6Smrg
94366fe65f6Smrg# serial 2
94466fe65f6Smrg
945a9274bcdSmrg# _AM_PROG_TAR(FORMAT)
946a9274bcdSmrg# --------------------
947a9274bcdSmrg# Check how to create a tarball in format FORMAT.
948a9274bcdSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
94966fe65f6Smrg#
950a9274bcdSmrg# Substitute a variable $(am__tar) that is a command
951a9274bcdSmrg# writing to stdout a FORMAT-tarball containing the directory
952a9274bcdSmrg# $tardir.
953a9274bcdSmrg#     tardir=directory && $(am__tar) > result.tar
95466fe65f6Smrg#
955a9274bcdSmrg# Substitute a variable $(am__untar) that extract such
956a9274bcdSmrg# a tarball read from stdin.
957a9274bcdSmrg#     $(am__untar) < result.tar
958a9274bcdSmrgAC_DEFUN([_AM_PROG_TAR],
959a9274bcdSmrg[# Always define AMTAR for backward compatibility.
960a9274bcdSmrgAM_MISSING_PROG([AMTAR], [tar])
961a9274bcdSmrgm4_if([$1], [v7],
962a9274bcdSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
963a9274bcdSmrg     [m4_case([$1], [ustar],, [pax],,
964a9274bcdSmrg              [m4_fatal([Unknown tar format])])
965a9274bcdSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
966a9274bcdSmrg# Loop over all known methods to create a tar archive until one works.
967a9274bcdSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
968a9274bcdSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
969a9274bcdSmrg# Do not fold the above two line into one, because Tru64 sh and
970a9274bcdSmrg# Solaris sh will not grok spaces in the rhs of `-'.
971a9274bcdSmrgfor _am_tool in $_am_tools
972a9274bcdSmrgdo
973a9274bcdSmrg  case $_am_tool in
974a9274bcdSmrg  gnutar)
975a9274bcdSmrg    for _am_tar in tar gnutar gtar;
976a9274bcdSmrg    do
977a9274bcdSmrg      AM_RUN_LOG([$_am_tar --version]) && break
978a9274bcdSmrg    done
979a9274bcdSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
980a9274bcdSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
981a9274bcdSmrg    am__untar="$_am_tar -xf -"
982a9274bcdSmrg    ;;
983a9274bcdSmrg  plaintar)
984a9274bcdSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
985a9274bcdSmrg    # ustar tarball either.
986a9274bcdSmrg    (tar --version) >/dev/null 2>&1 && continue
987a9274bcdSmrg    am__tar='tar chf - "$$tardir"'
988a9274bcdSmrg    am__tar_='tar chf - "$tardir"'
989a9274bcdSmrg    am__untar='tar xf -'
990a9274bcdSmrg    ;;
991a9274bcdSmrg  pax)
992a9274bcdSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
993a9274bcdSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
994a9274bcdSmrg    am__untar='pax -r'
995a9274bcdSmrg    ;;
996a9274bcdSmrg  cpio)
997a9274bcdSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
998a9274bcdSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
999a9274bcdSmrg    am__untar='cpio -i -H $1 -d'
1000a9274bcdSmrg    ;;
1001a9274bcdSmrg  none)
1002a9274bcdSmrg    am__tar=false
1003a9274bcdSmrg    am__tar_=false
1004a9274bcdSmrg    am__untar=false
1005a9274bcdSmrg    ;;
1006a9274bcdSmrg  esac
100766fe65f6Smrg
1008a9274bcdSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
1009a9274bcdSmrg  # and am__untar set.
1010a9274bcdSmrg  test -n "${am_cv_prog_tar_$1}" && break
101166fe65f6Smrg
1012a9274bcdSmrg  # tar/untar a dummy directory, and stop if the command works
1013a9274bcdSmrg  rm -rf conftest.dir
1014a9274bcdSmrg  mkdir conftest.dir
1015a9274bcdSmrg  echo GrepMe > conftest.dir/file
1016a9274bcdSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1017a9274bcdSmrg  rm -rf conftest.dir
1018a9274bcdSmrg  if test -s conftest.tar; then
1019a9274bcdSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1020a9274bcdSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1021a9274bcdSmrg  fi
1022a9274bcdSmrgdone
1023a9274bcdSmrgrm -rf conftest.dir
102466fe65f6Smrg
1025a9274bcdSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1026a9274bcdSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1027a9274bcdSmrgAC_SUBST([am__tar])
1028a9274bcdSmrgAC_SUBST([am__untar])
1029a9274bcdSmrg]) # _AM_PROG_TAR
103066fe65f6Smrg
1031a9274bcdSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1032a9274bcdSmrgdnl
103348af84faSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1034a9274bcdSmrgdnl 
1035a9274bcdSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
103648af84faSmrgdnl copy of this software and associated documentation files (the "Software"),
103748af84faSmrgdnl to deal in the Software without restriction, including without limitation
103848af84faSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
103948af84faSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
104048af84faSmrgdnl Software is furnished to do so, subject to the following conditions:
1041a9274bcdSmrgdnl
104248af84faSmrgdnl The above copyright notice and this permission notice (including the next
104348af84faSmrgdnl paragraph) shall be included in all copies or substantial portions of the
104448af84faSmrgdnl Software.
1045a9274bcdSmrgdnl
104648af84faSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
104748af84faSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
104848af84faSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
104948af84faSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
105048af84faSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
105148af84faSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
105248af84faSmrgdnl DEALINGS IN THE SOFTWARE.
105366fe65f6Smrg
1054a9274bcdSmrg# XORG_MACROS_VERSION(required-version)
1055a9274bcdSmrg# -------------------------------------
1056a9274bcdSmrg# Minimum version: 1.1.0
1057a9274bcdSmrg#
1058a9274bcdSmrg# If you're using a macro added in Version 1.1 or newer, include this in
1059a9274bcdSmrg# your configure.ac with the minimum required version, such as:
1060a9274bcdSmrg# XORG_MACROS_VERSION(1.1)
1061a9274bcdSmrg#
1062a9274bcdSmrg# To ensure that this macro is defined, also add:
1063a9274bcdSmrg# m4_ifndef([XORG_MACROS_VERSION],
1064a9274bcdSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1065a9274bcdSmrg#
1066a9274bcdSmrg#
1067a9274bcdSmrg# See the "minimum version" comment for each macro you use to see what 
1068a9274bcdSmrg# version you require.
1069a9274bcdSmrgm4_defun([XORG_MACROS_VERSION],[
107048af84faSmrgm4_define([vers_have], [1.10.1])
1071a9274bcdSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1072a9274bcdSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1073a9274bcdSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1074a9274bcdSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1075a9274bcdSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1076a9274bcdSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1077a9274bcdSmrgm4_undefine([vers_have])
1078a9274bcdSmrgm4_undefine([maj_have])
1079a9274bcdSmrgm4_undefine([maj_needed])
1080a9274bcdSmrg]) # XORG_MACROS_VERSION
108166fe65f6Smrg
1082a9274bcdSmrg# XORG_PROG_RAWCPP()
1083a9274bcdSmrg# ------------------
1084a9274bcdSmrg# Minimum version: 1.0.0
1085a9274bcdSmrg#
1086a9274bcdSmrg# Find cpp program and necessary flags for use in pre-processing text files
1087a9274bcdSmrg# such as man pages and config files
1088a9274bcdSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1089a9274bcdSmrgAC_REQUIRE([AC_PROG_CPP])
1090a9274bcdSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1091a9274bcdSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
109266fe65f6Smrg
1093a9274bcdSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1094a9274bcdSmrg# which is not the best choice for supporting other OS'es, but covers most
1095a9274bcdSmrg# of the ones we need for now.
1096a9274bcdSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1097a9274bcdSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1098a9274bcdSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1099a9274bcdSmrg	AC_MSG_RESULT([no])
1100a9274bcdSmrgelse
1101a9274bcdSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1102a9274bcdSmrg		RAWCPPFLAGS=-undef
1103a9274bcdSmrg		AC_MSG_RESULT([yes])
1104a9274bcdSmrg	# under Cygwin unix is still defined even with -undef
1105a9274bcdSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1106a9274bcdSmrg		RAWCPPFLAGS="-undef -ansi"
1107a9274bcdSmrg		AC_MSG_RESULT([yes, with -ansi])
1108a9274bcdSmrg	else
1109a9274bcdSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1110a9274bcdSmrg	fi
1111a9274bcdSmrgfi
1112a9274bcdSmrgrm -f conftest.$ac_ext
111366fe65f6Smrg
1114a9274bcdSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1115a9274bcdSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1116a9274bcdSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1117a9274bcdSmrg	AC_MSG_RESULT([no])
111866fe65f6Smrgelse
1119a9274bcdSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1120a9274bcdSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1121a9274bcdSmrg		AC_MSG_RESULT([yes])
1122a9274bcdSmrg	else
1123a9274bcdSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1124a9274bcdSmrg	fi
112566fe65f6Smrgfi
1126a9274bcdSmrgrm -f conftest.$ac_ext
1127a9274bcdSmrgAC_SUBST(RAWCPPFLAGS)
1128a9274bcdSmrg]) # XORG_PROG_RAWCPP
112966fe65f6Smrg
1130a9274bcdSmrg# XORG_MANPAGE_SECTIONS()
1131a9274bcdSmrg# -----------------------
1132a9274bcdSmrg# Minimum version: 1.0.0
113366fe65f6Smrg#
1134a9274bcdSmrg# Determine which sections man pages go in for the different man page types
1135a9274bcdSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1136a9274bcdSmrg# Not sure if there's any better way than just hardcoding by OS name.
1137a9274bcdSmrg# Override default settings by setting environment variables
113848af84faSmrg# Added MAN_SUBSTS in version 1.8
113948af84faSmrg# Added AC_PROG_SED in version 1.8
114066fe65f6Smrg
1141a9274bcdSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1142a9274bcdSmrgAC_REQUIRE([AC_CANONICAL_HOST])
114348af84faSmrgAC_REQUIRE([AC_PROG_SED])
114466fe65f6Smrg
1145a9274bcdSmrgif test x$APP_MAN_SUFFIX = x    ; then
1146a9274bcdSmrg    APP_MAN_SUFFIX=1
1147a9274bcdSmrgfi
1148a9274bcdSmrgif test x$APP_MAN_DIR = x    ; then
1149a9274bcdSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1150a9274bcdSmrgfi
115166fe65f6Smrg
1152a9274bcdSmrgif test x$LIB_MAN_SUFFIX = x    ; then
1153a9274bcdSmrg    LIB_MAN_SUFFIX=3
1154a9274bcdSmrgfi
1155a9274bcdSmrgif test x$LIB_MAN_DIR = x    ; then
1156a9274bcdSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1157a9274bcdSmrgfi
115866fe65f6Smrg
1159a9274bcdSmrgif test x$FILE_MAN_SUFFIX = x    ; then
1160a9274bcdSmrg    case $host_os in
1161a9274bcdSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1162a9274bcdSmrg	*)		FILE_MAN_SUFFIX=5  ;;
1163a9274bcdSmrg    esac
1164a9274bcdSmrgfi
1165a9274bcdSmrgif test x$FILE_MAN_DIR = x    ; then
1166a9274bcdSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1167a9274bcdSmrgfi
116866fe65f6Smrg
1169a9274bcdSmrgif test x$MISC_MAN_SUFFIX = x    ; then
1170a9274bcdSmrg    case $host_os in
1171a9274bcdSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1172a9274bcdSmrg	*)		MISC_MAN_SUFFIX=7  ;;
1173a9274bcdSmrg    esac
1174a9274bcdSmrgfi
1175a9274bcdSmrgif test x$MISC_MAN_DIR = x    ; then
1176a9274bcdSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1177a9274bcdSmrgfi
117866fe65f6Smrg
1179a9274bcdSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1180a9274bcdSmrg    case $host_os in
1181a9274bcdSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1182a9274bcdSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1183a9274bcdSmrg    esac
1184a9274bcdSmrgfi
1185a9274bcdSmrgif test x$DRIVER_MAN_DIR = x    ; then
1186a9274bcdSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1187a9274bcdSmrgfi
118866fe65f6Smrg
1189a9274bcdSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1190a9274bcdSmrg    case $host_os in
1191a9274bcdSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1192a9274bcdSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1193a9274bcdSmrg    esac
1194a9274bcdSmrgfi
1195a9274bcdSmrgif test x$ADMIN_MAN_DIR = x    ; then
1196a9274bcdSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1197a9274bcdSmrgfi
119866fe65f6Smrg
119966fe65f6Smrg
1200a9274bcdSmrgAC_SUBST([APP_MAN_SUFFIX])
1201a9274bcdSmrgAC_SUBST([LIB_MAN_SUFFIX])
1202a9274bcdSmrgAC_SUBST([FILE_MAN_SUFFIX])
1203a9274bcdSmrgAC_SUBST([MISC_MAN_SUFFIX])
1204a9274bcdSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1205a9274bcdSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1206a9274bcdSmrgAC_SUBST([APP_MAN_DIR])
1207a9274bcdSmrgAC_SUBST([LIB_MAN_DIR])
1208a9274bcdSmrgAC_SUBST([FILE_MAN_DIR])
1209a9274bcdSmrgAC_SUBST([MISC_MAN_DIR])
1210a9274bcdSmrgAC_SUBST([DRIVER_MAN_DIR])
1211a9274bcdSmrgAC_SUBST([ADMIN_MAN_DIR])
121248af84faSmrg
121348af84faSmrgXORG_MAN_PAGE="X Version 11"
121448af84faSmrgAC_SUBST([XORG_MAN_PAGE])
121548af84faSmrgMAN_SUBSTS="\
121648af84faSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
121748af84faSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
121848af84faSmrg	-e 's|__xservername__|Xorg|g' \
121948af84faSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
122048af84faSmrg	-e 's|__projectroot__|\$(prefix)|g' \
122148af84faSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
122248af84faSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
122348af84faSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
122448af84faSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
122548af84faSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
122648af84faSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
122748af84faSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
122848af84faSmrgAC_SUBST([MAN_SUBSTS])
122948af84faSmrg
1230a9274bcdSmrg]) # XORG_MANPAGE_SECTIONS
1231a9274bcdSmrg
123248af84faSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
123348af84faSmrg# ------------------------
123448af84faSmrg# Minimum version: 1.7.0
123548af84faSmrg#
123648af84faSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
123748af84faSmrg# provided by xorg-sgml-doctools, if installed.
123848af84faSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
123948af84faSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
124048af84faSmrgXORG_SGML_PATH=
124148af84faSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
124248af84faSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
124348af84faSmrg    [m4_ifval([$1],[:],
124448af84faSmrg        [if test x"$cross_compiling" != x"yes" ; then
124548af84faSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
124648af84faSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
124748af84faSmrg         fi])
124848af84faSmrg    ])
124948af84faSmrg
125048af84faSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
125148af84faSmrg# the path and the name of the doc stylesheet
125248af84faSmrgif test "x$XORG_SGML_PATH" != "x" ; then
125348af84faSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
125448af84faSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
125548af84faSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
125648af84faSmrgelse
125748af84faSmrg   AC_MSG_RESULT([no])
125848af84faSmrgfi
125948af84faSmrg
126048af84faSmrgAC_SUBST(XORG_SGML_PATH)
126148af84faSmrgAC_SUBST(STYLESHEET_SRCDIR)
126248af84faSmrgAC_SUBST(XSL_STYLESHEET)
126348af84faSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
126448af84faSmrg]) # XORG_CHECK_SGML_DOCTOOLS
126548af84faSmrg
1266a9274bcdSmrg# XORG_CHECK_LINUXDOC
1267a9274bcdSmrg# -------------------
1268a9274bcdSmrg# Minimum version: 1.0.0
126966fe65f6Smrg#
1270a9274bcdSmrg# Defines the variable MAKE_TEXT if the necessary tools and
1271a9274bcdSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1272a9274bcdSmrg# Whether or not the necessary tools and files are found can be checked
1273a9274bcdSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1274a9274bcdSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
127548af84faSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
127648af84faSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
127766fe65f6Smrg
1278a9274bcdSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
127966fe65f6Smrg
128048af84faSmrgAC_MSG_CHECKING([whether to build documentation])
128166fe65f6Smrg
128248af84faSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1283a9274bcdSmrg   BUILDDOC=yes
128466fe65f6Smrgelse
1285a9274bcdSmrg   BUILDDOC=no
128666fe65f6Smrgfi
128766fe65f6Smrg
1288a9274bcdSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1289a9274bcdSmrg
1290a9274bcdSmrgAC_MSG_RESULT([$BUILDDOC])
1291a9274bcdSmrg
129248af84faSmrgAC_MSG_CHECKING([whether to build pdf documentation])
1293a9274bcdSmrg
129448af84faSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1295a9274bcdSmrg   BUILDPDFDOC=yes
1296a9274bcdSmrgelse
1297a9274bcdSmrg   BUILDPDFDOC=no
1298a9274bcdSmrgfi
1299a9274bcdSmrg
1300a9274bcdSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1301a9274bcdSmrg
1302a9274bcdSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1303a9274bcdSmrg
130448af84faSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1305a9274bcdSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1306a9274bcdSmrgMAKE_PDF="$PS2PDF"
1307a9274bcdSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1308a9274bcdSmrg
1309a9274bcdSmrgAC_SUBST(MAKE_TEXT)
1310a9274bcdSmrgAC_SUBST(MAKE_PS)
1311a9274bcdSmrgAC_SUBST(MAKE_PDF)
1312a9274bcdSmrgAC_SUBST(MAKE_HTML)
1313a9274bcdSmrg]) # XORG_CHECK_LINUXDOC
1314a9274bcdSmrg
1315a9274bcdSmrg# XORG_CHECK_DOCBOOK
1316a9274bcdSmrg# -------------------
1317a9274bcdSmrg# Minimum version: 1.0.0
131866fe65f6Smrg#
1319a9274bcdSmrg# Checks for the ability to build output formats from SGML DocBook source.
1320a9274bcdSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1321a9274bcdSmrg# indicates whether the necessary tools and files are found and, if set,
1322a9274bcdSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1323a9274bcdSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
132448af84faSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
132548af84faSmrg
1326a9274bcdSmrgBUILDTXTDOC=no
1327a9274bcdSmrgBUILDPDFDOC=no
1328a9274bcdSmrgBUILDPSDOC=no
1329a9274bcdSmrgBUILDHTMLDOC=no
133066fe65f6Smrg
1331a9274bcdSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1332a9274bcdSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1333a9274bcdSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1334a9274bcdSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1335a9274bcdSmrg
133648af84faSmrgAC_MSG_CHECKING([whether to build text documentation])
133748af84faSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1338a9274bcdSmrg   test x$BUILD_TXTDOC != xno; then
1339a9274bcdSmrg	BUILDTXTDOC=yes
134066fe65f6Smrgfi
1341a9274bcdSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1342a9274bcdSmrgAC_MSG_RESULT([$BUILDTXTDOC])
134366fe65f6Smrg
134448af84faSmrgAC_MSG_CHECKING([whether to build PDF documentation])
134548af84faSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1346a9274bcdSmrg   test x$BUILD_PDFDOC != xno; then
1347a9274bcdSmrg	BUILDPDFDOC=yes
1348a9274bcdSmrgfi
1349a9274bcdSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1350a9274bcdSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1351a9274bcdSmrg
135248af84faSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
135348af84faSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1354a9274bcdSmrg   test x$BUILD_PSDOC != xno; then
1355a9274bcdSmrg	BUILDPSDOC=yes
1356a9274bcdSmrgfi
1357a9274bcdSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1358a9274bcdSmrgAC_MSG_RESULT([$BUILDPSDOC])
1359a9274bcdSmrg
136048af84faSmrgAC_MSG_CHECKING([whether to build HTML documentation])
136148af84faSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1362a9274bcdSmrg   test x$BUILD_HTMLDOC != xno; then
1363a9274bcdSmrg	BUILDHTMLDOC=yes
1364a9274bcdSmrgfi
1365a9274bcdSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1366a9274bcdSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1367a9274bcdSmrg
1368a9274bcdSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1369a9274bcdSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1370a9274bcdSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1371a9274bcdSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1372a9274bcdSmrg
1373a9274bcdSmrgAC_SUBST(MAKE_TEXT)
1374a9274bcdSmrgAC_SUBST(MAKE_PS)
1375a9274bcdSmrgAC_SUBST(MAKE_PDF)
1376a9274bcdSmrgAC_SUBST(MAKE_HTML)
1377a9274bcdSmrg]) # XORG_CHECK_DOCBOOK
1378a9274bcdSmrg
137948af84faSmrg# XORG_WITH_XMLTO([MIN-VERSION])
138048af84faSmrg# ----------------
138148af84faSmrg# Minimum version: 1.5.0
138248af84faSmrg#
138348af84faSmrg# Documentation tools are not always available on all platforms and sometimes
138448af84faSmrg# not at the appropriate level. This macro enables a module to test for the
138548af84faSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
138648af84faSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
138748af84faSmrg# as whether or not to use the xmlto package.
138848af84faSmrg#
138948af84faSmrg# Interface to module:
139048af84faSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
139148af84faSmrg# XMLTO:	returns the path of the xmlto program found
139248af84faSmrg#		returns the path set by the user in the environment
139348af84faSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
139448af84faSmrg#		'no' user instructs the module not to use xmlto
139548af84faSmrg#
139648af84faSmrg# Added in version 1.10.0
139748af84faSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
139848af84faSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
139948af84faSmrg#
140048af84faSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
140148af84faSmrg#
140248af84faSmrgAC_DEFUN([XORG_WITH_XMLTO],[
140348af84faSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
140448af84faSmrgAC_ARG_WITH(xmlto,
140548af84faSmrg	AS_HELP_STRING([--with-xmlto],
140648af84faSmrg	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
140748af84faSmrg	   [use_xmlto=$withval], [use_xmlto=auto])
140848af84faSmrg
140948af84faSmrgif test "x$use_xmlto" = x"auto"; then
141048af84faSmrg   AC_PATH_PROG([XMLTO], [xmlto])
141148af84faSmrg   if test "x$XMLTO" = "x"; then
141248af84faSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
141348af84faSmrg	have_xmlto=no
141448af84faSmrg   else
141548af84faSmrg        have_xmlto=yes
141648af84faSmrg   fi
141748af84faSmrgelif test "x$use_xmlto" = x"yes" ; then
141848af84faSmrg   AC_PATH_PROG([XMLTO], [xmlto])
141948af84faSmrg   if test "x$XMLTO" = "x"; then
142048af84faSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
142148af84faSmrg   fi
142248af84faSmrg   have_xmlto=yes
142348af84faSmrgelif test "x$use_xmlto" = x"no" ; then
142448af84faSmrg   if test "x$XMLTO" != "x"; then
142548af84faSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
142648af84faSmrg   fi
142748af84faSmrg   have_xmlto=no
142848af84faSmrgelse
142948af84faSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
143048af84faSmrgfi
143148af84faSmrg
143248af84faSmrg# Test for a minimum version of xmlto, if provided.
143348af84faSmrgm4_ifval([$1],
143448af84faSmrg[if test "$have_xmlto" = yes; then
143548af84faSmrg    # scrape the xmlto version
143648af84faSmrg    AC_MSG_CHECKING([the xmlto version])
143748af84faSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
143848af84faSmrg    AC_MSG_RESULT([$xmlto_version])
143948af84faSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
144048af84faSmrg        [if test "x$use_xmlto" = xauto; then
144148af84faSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
144248af84faSmrg            have_xmlto=no
144348af84faSmrg        else
144448af84faSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
144548af84faSmrg        fi])
144648af84faSmrgfi])
144748af84faSmrg
144848af84faSmrg# Test for the ability of xmlto to generate a text target
144948af84faSmrghave_xmlto_text=no
145048af84faSmrgcat > conftest.xml << "EOF"
145148af84faSmrgEOF
145248af84faSmrgAS_IF([test "$have_xmlto" = yes],
145348af84faSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
145448af84faSmrg             [have_xmlto_text=yes],
145548af84faSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
145648af84faSmrgrm -f conftest.xml
145748af84faSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
145848af84faSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
145948af84faSmrg]) # XORG_WITH_XMLTO
146048af84faSmrg
146148af84faSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION])
146248af84faSmrg# ----------------
146348af84faSmrg# Minimum version: 1.5.0
146448af84faSmrg#
146548af84faSmrg# Documentation tools are not always available on all platforms and sometimes
146648af84faSmrg# not at the appropriate level. This macro enables a module to test for the
146748af84faSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
146848af84faSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
146948af84faSmrg# as whether or not to use the asciidoc package.
147048af84faSmrg#
147148af84faSmrg# Interface to module:
147248af84faSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
147348af84faSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
147448af84faSmrg#		 returns the path set by the user in the environment
147548af84faSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
147648af84faSmrg#		  'no' user instructs the module not to use asciidoc
147748af84faSmrg#
147848af84faSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
147948af84faSmrg#
148048af84faSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
148148af84faSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
148248af84faSmrgAC_ARG_WITH(asciidoc,
148348af84faSmrg	AS_HELP_STRING([--with-asciidoc],
148448af84faSmrg	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
148548af84faSmrg	   [use_asciidoc=$withval], [use_asciidoc=auto])
148648af84faSmrg
148748af84faSmrgif test "x$use_asciidoc" = x"auto"; then
148848af84faSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
148948af84faSmrg   if test "x$ASCIIDOC" = "x"; then
149048af84faSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
149148af84faSmrg	have_asciidoc=no
149248af84faSmrg   else
149348af84faSmrg        have_asciidoc=yes
149448af84faSmrg   fi
149548af84faSmrgelif test "x$use_asciidoc" = x"yes" ; then
149648af84faSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
149748af84faSmrg   if test "x$ASCIIDOC" = "x"; then
149848af84faSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
149948af84faSmrg   fi
150048af84faSmrg   have_asciidoc=yes
150148af84faSmrgelif test "x$use_asciidoc" = x"no" ; then
150248af84faSmrg   if test "x$ASCIIDOC" != "x"; then
150348af84faSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
150448af84faSmrg   fi
150548af84faSmrg   have_asciidoc=no
150648af84faSmrgelse
150748af84faSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
150848af84faSmrgfi
150948af84faSmrgm4_ifval([$1],
151048af84faSmrg[if test "$have_asciidoc" = yes; then
151148af84faSmrg    # scrape the asciidoc version
151248af84faSmrg    AC_MSG_CHECKING([the asciidoc version])
151348af84faSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
151448af84faSmrg    AC_MSG_RESULT([$asciidoc_version])
151548af84faSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
151648af84faSmrg        [if test "x$use_asciidoc" = xauto; then
151748af84faSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
151848af84faSmrg            have_asciidoc=no
151948af84faSmrg        else
152048af84faSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
152148af84faSmrg        fi])
152248af84faSmrgfi])
152348af84faSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
152448af84faSmrg]) # XORG_WITH_ASCIIDOC
152548af84faSmrg
152648af84faSmrg# XORG_WITH_DOXYGEN([MIN-VERSION])
152748af84faSmrg# --------------------------------
152848af84faSmrg# Minimum version: 1.5.0
152948af84faSmrg#
153048af84faSmrg# Documentation tools are not always available on all platforms and sometimes
153148af84faSmrg# not at the appropriate level. This macro enables a module to test for the
153248af84faSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
153348af84faSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
153448af84faSmrg# as whether or not to use the doxygen package.
153548af84faSmrg#
153648af84faSmrg# Interface to module:
153748af84faSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
153848af84faSmrg# DOXYGEN:	 returns the path of the doxygen program found
153948af84faSmrg#		 returns the path set by the user in the environment
154048af84faSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
154148af84faSmrg#		  'no' user instructs the module not to use doxygen
154248af84faSmrg#
154348af84faSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
154448af84faSmrg#
154548af84faSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
154648af84faSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
154748af84faSmrgAC_ARG_WITH(doxygen,
154848af84faSmrg	AS_HELP_STRING([--with-doxygen],
154948af84faSmrg	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
155048af84faSmrg	   [use_doxygen=$withval], [use_doxygen=auto])
155148af84faSmrg
155248af84faSmrgif test "x$use_doxygen" = x"auto"; then
155348af84faSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
155448af84faSmrg   if test "x$DOXYGEN" = "x"; then
155548af84faSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
155648af84faSmrg	have_doxygen=no
155748af84faSmrg   else
155848af84faSmrg        have_doxygen=yes
155948af84faSmrg   fi
156048af84faSmrgelif test "x$use_doxygen" = x"yes" ; then
156148af84faSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
156248af84faSmrg   if test "x$DOXYGEN" = "x"; then
156348af84faSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
156448af84faSmrg   fi
156548af84faSmrg   have_doxygen=yes
156648af84faSmrgelif test "x$use_doxygen" = x"no" ; then
156748af84faSmrg   if test "x$DOXYGEN" != "x"; then
156848af84faSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
156948af84faSmrg   fi
157048af84faSmrg   have_doxygen=no
157148af84faSmrgelse
157248af84faSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
157348af84faSmrgfi
157448af84faSmrgm4_ifval([$1],
157548af84faSmrg[if test "$have_doxygen" = yes; then
157648af84faSmrg    # scrape the doxygen version
157748af84faSmrg    AC_MSG_CHECKING([the doxygen version])
157848af84faSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
157948af84faSmrg    AC_MSG_RESULT([$doxygen_version])
158048af84faSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
158148af84faSmrg        [if test "x$use_doxygen" = xauto; then
158248af84faSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
158348af84faSmrg            have_doxygen=no
158448af84faSmrg        else
158548af84faSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
158648af84faSmrg        fi])
158748af84faSmrgfi])
158848af84faSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
158948af84faSmrg]) # XORG_WITH_DOXYGEN
159048af84faSmrg
159148af84faSmrg# XORG_WITH_GROFF
159248af84faSmrg# ----------------
159348af84faSmrg# Minimum version: 1.6.0
159448af84faSmrg#
159548af84faSmrg# Documentation tools are not always available on all platforms and sometimes
159648af84faSmrg# not at the appropriate level. This macro enables a module to test for the
159748af84faSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
159848af84faSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
159948af84faSmrg# as whether or not to use the groff package.
160048af84faSmrg#
160148af84faSmrg# Interface to module:
160248af84faSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
160348af84faSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
160448af84faSmrg# HAVE_GROFF_MS: the -ms macros package
160548af84faSmrg# GROFF:	 returns the path of the groff program found
160648af84faSmrg#		 returns the path set by the user in the environment
160748af84faSmrg# --with-groff:	 'yes' user instructs the module to use groff
160848af84faSmrg#		 'no' user instructs the module not to use groff
160948af84faSmrg#
161048af84faSmrg# Added in version 1.9.0:
161148af84faSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
161248af84faSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
161348af84faSmrg#		   psselect from the psutils package.
161448af84faSmrg#		   the ghostcript package. Refer to the grohtml man pages
161548af84faSmrg#
161648af84faSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
161748af84faSmrg#
161848af84faSmrg# OS and distros often splits groff in a basic and full package, the former
161948af84faSmrg# having the groff program and the later having devices, fonts and macros
162048af84faSmrg# Checking for the groff executable is not enough.
162148af84faSmrg#
162248af84faSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
162348af84faSmrg# unset HAVE_GROFF or GROFF env variables.
162448af84faSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
162548af84faSmrg#
162648af84faSmrgAC_DEFUN([XORG_WITH_GROFF],[
162748af84faSmrgAC_ARG_VAR([GROFF], [Path to groff command])
162848af84faSmrgAC_ARG_WITH(groff,
162948af84faSmrg	AS_HELP_STRING([--with-groff],
163048af84faSmrg	   [Use groff to regenerate documentation (default: yes, if installed)]),
163148af84faSmrg	   [use_groff=$withval], [use_groff=auto])
163248af84faSmrg
163348af84faSmrgif test "x$use_groff" = x"auto"; then
163448af84faSmrg   AC_PATH_PROG([GROFF], [groff])
163548af84faSmrg   if test "x$GROFF" = "x"; then
163648af84faSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
163748af84faSmrg	have_groff=no
163848af84faSmrg   else
163948af84faSmrg        have_groff=yes
164048af84faSmrg   fi
164148af84faSmrgelif test "x$use_groff" = x"yes" ; then
164248af84faSmrg   AC_PATH_PROG([GROFF], [groff])
164348af84faSmrg   if test "x$GROFF" = "x"; then
164448af84faSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
164548af84faSmrg   fi
164648af84faSmrg   have_groff=yes
164748af84faSmrgelif test "x$use_groff" = x"no" ; then
164848af84faSmrg   if test "x$GROFF" != "x"; then
164948af84faSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
165048af84faSmrg   fi
165148af84faSmrg   have_groff=no
165248af84faSmrgelse
165348af84faSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
165448af84faSmrgfi
165548af84faSmrg
165648af84faSmrg# We have groff, test for the presence of the macro packages
165748af84faSmrgif test "x$have_groff" = x"yes"; then
165848af84faSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
165948af84faSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
166048af84faSmrg        groff_ms_works=yes
166148af84faSmrg    else
166248af84faSmrg        groff_ms_works=no
166348af84faSmrg    fi
166448af84faSmrg    AC_MSG_RESULT([$groff_ms_works])
166548af84faSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
166648af84faSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
166748af84faSmrg        groff_mm_works=yes
166848af84faSmrg    else
166948af84faSmrg        groff_mm_works=no
167048af84faSmrg    fi
167148af84faSmrg    AC_MSG_RESULT([$groff_mm_works])
167248af84faSmrgfi
167348af84faSmrg
167448af84faSmrg# We have groff, test for HTML dependencies, one command per package
167548af84faSmrgif test "x$have_groff" = x"yes"; then
167648af84faSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
167748af84faSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
167848af84faSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
167948af84faSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
168048af84faSmrg      have_groff_html=yes
168148af84faSmrg   else
168248af84faSmrg      have_groff_html=no
168348af84faSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
168448af84faSmrg   fi
168548af84faSmrgfi
168648af84faSmrg
168748af84faSmrg# Set Automake conditionals for Makefiles
168848af84faSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
168948af84faSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
169048af84faSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
169148af84faSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
169248af84faSmrg]) # XORG_WITH_GROFF
169348af84faSmrg
169448af84faSmrg# XORG_WITH_FOP
169548af84faSmrg# ----------------
169648af84faSmrg# Minimum version: 1.6.0
169748af84faSmrg#
169848af84faSmrg# Documentation tools are not always available on all platforms and sometimes
169948af84faSmrg# not at the appropriate level. This macro enables a module to test for the
170048af84faSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
170148af84faSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
170248af84faSmrg# as whether or not to use the fop package.
170348af84faSmrg#
170448af84faSmrg# Interface to module:
170548af84faSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
170648af84faSmrg# FOP:	 	returns the path of the fop program found
170748af84faSmrg#		returns the path set by the user in the environment
170848af84faSmrg# --with-fop: 	'yes' user instructs the module to use fop
170948af84faSmrg#		'no' user instructs the module not to use fop
171048af84faSmrg#
171148af84faSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
171248af84faSmrg#
171348af84faSmrgAC_DEFUN([XORG_WITH_FOP],[
171448af84faSmrgAC_ARG_VAR([FOP], [Path to fop command])
171548af84faSmrgAC_ARG_WITH(fop,
171648af84faSmrg	AS_HELP_STRING([--with-fop],
171748af84faSmrg	   [Use fop to regenerate documentation (default: yes, if installed)]),
171848af84faSmrg	   [use_fop=$withval], [use_fop=auto])
171948af84faSmrg
172048af84faSmrgif test "x$use_fop" = x"auto"; then
172148af84faSmrg   AC_PATH_PROG([FOP], [fop])
172248af84faSmrg   if test "x$FOP" = "x"; then
172348af84faSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
172448af84faSmrg	have_fop=no
172548af84faSmrg   else
172648af84faSmrg        have_fop=yes
172748af84faSmrg   fi
172848af84faSmrgelif test "x$use_fop" = x"yes" ; then
172948af84faSmrg   AC_PATH_PROG([FOP], [fop])
173048af84faSmrg   if test "x$FOP" = "x"; then
173148af84faSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
173248af84faSmrg   fi
173348af84faSmrg   have_fop=yes
173448af84faSmrgelif test "x$use_fop" = x"no" ; then
173548af84faSmrg   if test "x$FOP" != "x"; then
173648af84faSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
173748af84faSmrg   fi
173848af84faSmrg   have_fop=no
173948af84faSmrgelse
174048af84faSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
174148af84faSmrgfi
174248af84faSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
174348af84faSmrg]) # XORG_WITH_FOP
174448af84faSmrg
174548af84faSmrg# XORG_WITH_PS2PDF
174648af84faSmrg# ----------------
174748af84faSmrg# Minimum version: 1.6.0
174848af84faSmrg#
174948af84faSmrg# Documentation tools are not always available on all platforms and sometimes
175048af84faSmrg# not at the appropriate level. This macro enables a module to test for the
175148af84faSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
175248af84faSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
175348af84faSmrg# as whether or not to use the ps2pdf package.
175448af84faSmrg#
175548af84faSmrg# Interface to module:
175648af84faSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
175748af84faSmrg# PS2PDF:	returns the path of the ps2pdf program found
175848af84faSmrg#		returns the path set by the user in the environment
175948af84faSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
176048af84faSmrg#		 'no' user instructs the module not to use ps2pdf
176148af84faSmrg#
176248af84faSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
176348af84faSmrg#
176448af84faSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
176548af84faSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
176648af84faSmrgAC_ARG_WITH(ps2pdf,
176748af84faSmrg	AS_HELP_STRING([--with-ps2pdf],
176848af84faSmrg	   [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
176948af84faSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=auto])
177048af84faSmrg
177148af84faSmrgif test "x$use_ps2pdf" = x"auto"; then
177248af84faSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
177348af84faSmrg   if test "x$PS2PDF" = "x"; then
177448af84faSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
177548af84faSmrg	have_ps2pdf=no
177648af84faSmrg   else
177748af84faSmrg        have_ps2pdf=yes
177848af84faSmrg   fi
177948af84faSmrgelif test "x$use_ps2pdf" = x"yes" ; then
178048af84faSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
178148af84faSmrg   if test "x$PS2PDF" = "x"; then
178248af84faSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
178348af84faSmrg   fi
178448af84faSmrg   have_ps2pdf=yes
178548af84faSmrgelif test "x$use_ps2pdf" = x"no" ; then
178648af84faSmrg   if test "x$PS2PDF" != "x"; then
178748af84faSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
178848af84faSmrg   fi
178948af84faSmrg   have_ps2pdf=no
179048af84faSmrgelse
179148af84faSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
179248af84faSmrgfi
179348af84faSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
179448af84faSmrg]) # XORG_WITH_PS2PDF
179548af84faSmrg
179648af84faSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
179748af84faSmrg# ----------------
179848af84faSmrg# Minimum version: 1.6.0
179948af84faSmrg#
180048af84faSmrg# Documentation tools are not always available on all platforms and sometimes
180148af84faSmrg# not at the appropriate level. This macro enables a builder to skip all
180248af84faSmrg# documentation targets except traditional man pages.
180348af84faSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
180448af84faSmrg# maximum flexibilty in controlling documentation building.
180548af84faSmrg# Refer to:
180648af84faSmrg# XORG_WITH_XMLTO         --with-xmlto
180748af84faSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
180848af84faSmrg# XORG_WITH_DOXYGEN       --with-doxygen
180948af84faSmrg# XORG_WITH_FOP           --with-fop
181048af84faSmrg# XORG_WITH_GROFF         --with-groff
181148af84faSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
181248af84faSmrg#
181348af84faSmrg# Interface to module:
181448af84faSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
181548af84faSmrg# --enable-docs: 'yes' user instructs the module to generate docs
181648af84faSmrg#		 'no' user instructs the module not to generate docs
181748af84faSmrg# parm1:	specify the default value, yes or no.
181848af84faSmrg#
181948af84faSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
182048af84faSmrgdefault=$1
182148af84faSmrgif test "x$default" = x ; then
182248af84faSmrg  default="yes"
182348af84faSmrgfi
182448af84faSmrgAC_ARG_ENABLE(docs,
182548af84faSmrg	AS_HELP_STRING([--enable-docs],
182648af84faSmrg	   [Enable building the documentation (default: yes)]),
182748af84faSmrg	   [build_docs=$enableval], [build_docs=$default])
182848af84faSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
182948af84faSmrgAC_MSG_CHECKING([whether to build documentation])
183048af84faSmrgAC_MSG_RESULT([$build_docs])
183148af84faSmrg]) # XORG_ENABLE_DOCS
183248af84faSmrg
183348af84faSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
183448af84faSmrg# ----------------
183548af84faSmrg# Minimum version: 1.6.0
183648af84faSmrg#
183748af84faSmrg# This macro enables a builder to skip all developer documentation.
183848af84faSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
183948af84faSmrg# maximum flexibilty in controlling documentation building.
184048af84faSmrg# Refer to:
184148af84faSmrg# XORG_WITH_XMLTO         --with-xmlto
184248af84faSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
184348af84faSmrg# XORG_WITH_DOXYGEN       --with-doxygen
184448af84faSmrg# XORG_WITH_FOP           --with-fop
184548af84faSmrg# XORG_WITH_GROFF         --with-groff
184648af84faSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
184748af84faSmrg#
184848af84faSmrg# Interface to module:
184948af84faSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
185048af84faSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
185148af84faSmrg#			'no' user instructs the module not to generate developer docs
185248af84faSmrg# parm1:		specify the default value, yes or no.
185348af84faSmrg#
185448af84faSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
185548af84faSmrgdevel_default=$1
185648af84faSmrgif test "x$devel_default" = x ; then
185748af84faSmrg  devel_default="yes"
185848af84faSmrgfi
185948af84faSmrgAC_ARG_ENABLE(devel-docs,
186048af84faSmrg	AS_HELP_STRING([--enable-devel-docs],
186148af84faSmrg	   [Enable building the developer documentation (default: yes)]),
186248af84faSmrg	   [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
186348af84faSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
186448af84faSmrgAC_MSG_CHECKING([whether to build developer documentation])
186548af84faSmrgAC_MSG_RESULT([$build_devel_docs])
186648af84faSmrg]) # XORG_ENABLE_DEVEL_DOCS
186748af84faSmrg
186848af84faSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
186948af84faSmrg# ----------------
187048af84faSmrg# Minimum version: 1.6.0
187148af84faSmrg#
187248af84faSmrg# This macro enables a builder to skip all functional specification targets.
187348af84faSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
187448af84faSmrg# maximum flexibilty in controlling documentation building.
187548af84faSmrg# Refer to:
187648af84faSmrg# XORG_WITH_XMLTO         --with-xmlto
187748af84faSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
187848af84faSmrg# XORG_WITH_DOXYGEN       --with-doxygen
187948af84faSmrg# XORG_WITH_FOP           --with-fop
188048af84faSmrg# XORG_WITH_GROFF         --with-groff
188148af84faSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
188248af84faSmrg#
188348af84faSmrg# Interface to module:
188448af84faSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
188548af84faSmrg# --enable-specs:	'yes' user instructs the module to generate specs
188648af84faSmrg#			'no' user instructs the module not to generate specs
188748af84faSmrg# parm1:		specify the default value, yes or no.
188848af84faSmrg#
188948af84faSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
189048af84faSmrgspec_default=$1
189148af84faSmrgif test "x$spec_default" = x ; then
189248af84faSmrg  spec_default="yes"
189348af84faSmrgfi
189448af84faSmrgAC_ARG_ENABLE(specs,
189548af84faSmrg	AS_HELP_STRING([--enable-specs],
189648af84faSmrg	   [Enable building the specs (default: yes)]),
189748af84faSmrg	   [build_specs=$enableval], [build_specs=$spec_default])
189848af84faSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
189948af84faSmrgAC_MSG_CHECKING([whether to build functional specifications])
190048af84faSmrgAC_MSG_RESULT([$build_specs])
190148af84faSmrg]) # XORG_ENABLE_SPECS
190248af84faSmrg
1903a9274bcdSmrg# XORG_CHECK_MALLOC_ZERO
1904a9274bcdSmrg# ----------------------
1905a9274bcdSmrg# Minimum version: 1.0.0
190689d09728Smrg#
1907a9274bcdSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1908a9274bcdSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1909a9274bcdSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1910a9274bcdSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1911a9274bcdSmrgAC_ARG_ENABLE(malloc0returnsnull,
1912a9274bcdSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1913a9274bcdSmrg		       [malloc(0) returns NULL (default: auto)]),
1914a9274bcdSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1915a9274bcdSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
191689d09728Smrg
1917a9274bcdSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1918a9274bcdSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1919a9274bcdSmrg	AC_RUN_IFELSE([
1920a9274bcdSmrgchar *malloc();
1921a9274bcdSmrgchar *realloc();
1922a9274bcdSmrgchar *calloc();
1923a9274bcdSmrgmain() {
1924a9274bcdSmrg    char *m0, *r0, *c0, *p;
1925a9274bcdSmrg    m0 = malloc(0);
1926a9274bcdSmrg    p = malloc(10);
1927a9274bcdSmrg    r0 = realloc(p,0);
1928a9274bcdSmrg    c0 = calloc(0);
1929a9274bcdSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1930a9274bcdSmrg}],
1931a9274bcdSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
193248af84faSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
193348af84faSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1934a9274bcdSmrgfi
1935a9274bcdSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
193689d09728Smrg
1937a9274bcdSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1938a9274bcdSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1939a9274bcdSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1940a9274bcdSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1941a9274bcdSmrgelse
1942a9274bcdSmrg	MALLOC_ZERO_CFLAGS=""
1943a9274bcdSmrg	XMALLOC_ZERO_CFLAGS=""
1944a9274bcdSmrg	XTMALLOC_ZERO_CFLAGS=""
1945a9274bcdSmrgfi
194666fe65f6Smrg
1947a9274bcdSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1948a9274bcdSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1949a9274bcdSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1950a9274bcdSmrg]) # XORG_CHECK_MALLOC_ZERO
1951a9274bcdSmrg
1952a9274bcdSmrg# XORG_WITH_LINT()
1953a9274bcdSmrg# ----------------
1954a9274bcdSmrg# Minimum version: 1.1.0
195566fe65f6Smrg#
195648af84faSmrg# This macro enables the use of a tool that flags some suspicious and
195748af84faSmrg# non-portable constructs (likely to be bugs) in C language source code.
195848af84faSmrg# It will attempt to locate the tool and use appropriate options.
195948af84faSmrg# There are various lint type tools on different platforms.
196048af84faSmrg#
196148af84faSmrg# Interface to module:
196248af84faSmrg# LINT:		returns the path to the tool found on the platform
196348af84faSmrg#		or the value set to LINT on the configure cmd line
196448af84faSmrg#		also an Automake conditional
196548af84faSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
196648af84faSmrg#
196748af84faSmrg# --with-lint:	'yes' user instructs the module to use lint
196848af84faSmrg#		'no' user instructs the module not to use lint (default)
196948af84faSmrg#
197048af84faSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
197148af84faSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1972a9274bcdSmrg#
1973a9274bcdSmrgAC_DEFUN([XORG_WITH_LINT],[
197466fe65f6Smrg
197548af84faSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
197648af84faSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1977a9274bcdSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1978a9274bcdSmrg		[Use a lint-style source code checker (default: disabled)])],
1979a9274bcdSmrg		[use_lint=$withval], [use_lint=no])
198048af84faSmrg
198148af84faSmrg# Obtain platform specific info like program name and options
198248af84faSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
198348af84faSmrgcase $host_os in
198448af84faSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
198548af84faSmrg	lint_name=splint
198648af84faSmrg	lint_options="-badflag"
198748af84faSmrg	;;
198848af84faSmrg  *freebsd* | *netbsd*)
198948af84faSmrg	lint_name=lint
199048af84faSmrg	lint_options="-u -b"
199148af84faSmrg	;;
199248af84faSmrg  *solaris*)
199348af84faSmrg	lint_name=lint
199448af84faSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
199548af84faSmrg	;;
199648af84faSmrgesac
199748af84faSmrg
199848af84faSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
199948af84faSmrgif test "x$use_lint" = x"yes" ; then
200048af84faSmrg   AC_PATH_PROG([LINT], [$lint_name])
200148af84faSmrg   if test "x$LINT" = "x"; then
200248af84faSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
200348af84faSmrg   fi
200448af84faSmrgelif test "x$use_lint" = x"no" ; then
200548af84faSmrg   if test "x$LINT" != "x"; then
200648af84faSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
200748af84faSmrg   fi
2008a9274bcdSmrgelse
200948af84faSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2010a9274bcdSmrgfi
201148af84faSmrg
201248af84faSmrg# User supplied flags override default flags
201348af84faSmrgif test "x$LINT_FLAGS" != "x"; then
201448af84faSmrg   lint_options=$LINT_FLAGS
2015a9274bcdSmrgfi
201666fe65f6Smrg
201748af84faSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
201848af84faSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2019a9274bcdSmrg
2020a9274bcdSmrg]) # XORG_WITH_LINT
2021a9274bcdSmrg
2022a9274bcdSmrg# XORG_LINT_LIBRARY(LIBNAME)
2023a9274bcdSmrg# --------------------------
2024a9274bcdSmrg# Minimum version: 1.1.0
202566fe65f6Smrg#
2026a9274bcdSmrg# Sets up flags for building lint libraries for checking programs that call
2027a9274bcdSmrg# functions in the library.
202866fe65f6Smrg#
202948af84faSmrg# Interface to module:
203048af84faSmrg# LINTLIB		- Automake variable with the name of lint library file to make
203148af84faSmrg# MAKE_LINT_LIB		- Automake conditional
203248af84faSmrg#
203348af84faSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
203448af84faSmrg#			  - 'no' user instructs the module not to create a lint library (default)
203566fe65f6Smrg
2036a9274bcdSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2037a9274bcdSmrgAC_REQUIRE([XORG_WITH_LINT])
2038a9274bcdSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2039a9274bcdSmrg	[Create lint library (default: disabled)])],
2040a9274bcdSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
204148af84faSmrg
204248af84faSmrgif test "x$make_lint_lib" = x"yes" ; then
204348af84faSmrg   LINTLIB=llib-l$1.ln
204448af84faSmrg   if test "x$LINT" = "x"; then
204548af84faSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
204648af84faSmrg   fi
204748af84faSmrgelif test "x$make_lint_lib" != x"no" ; then
204848af84faSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2049a9274bcdSmrgfi
205048af84faSmrg
2051a9274bcdSmrgAC_SUBST(LINTLIB)
2052a9274bcdSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
205366fe65f6Smrg
2054a9274bcdSmrg]) # XORG_LINT_LIBRARY
205566fe65f6Smrg
2056a9274bcdSmrg# XORG_CWARNFLAGS
2057a9274bcdSmrg# ---------------
2058a9274bcdSmrg# Minimum version: 1.2.0
2059a9274bcdSmrg#
2060a9274bcdSmrg# Defines CWARNFLAGS to enable C compiler warnings.
2061a9274bcdSmrg#
2062a9274bcdSmrgAC_DEFUN([XORG_CWARNFLAGS], [
206348af84faSmrgAC_REQUIRE([AC_PROG_CC_C99])
2064a9274bcdSmrgif  test "x$GCC" = xyes ; then
2065a9274bcdSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
2066a9274bcdSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
206748af84faSmrg-Wbad-function-cast -Wformat=2"
2068a9274bcdSmrg    case `$CC -dumpversion` in
2069a9274bcdSmrg    3.4.* | 4.*)
2070a9274bcdSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
2071a9274bcdSmrg	;;
2072a9274bcdSmrg    esac
2073a9274bcdSmrgelse
2074a9274bcdSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2075a9274bcdSmrg    if test "x$SUNCC" = "xyes"; then
2076a9274bcdSmrg	CWARNFLAGS="-v"
2077a9274bcdSmrg    fi
2078a9274bcdSmrgfi
2079a9274bcdSmrgAC_SUBST(CWARNFLAGS)
2080a9274bcdSmrg]) # XORG_CWARNFLAGS
2081a9274bcdSmrg
2082a9274bcdSmrg# XORG_STRICT_OPTION
2083a9274bcdSmrg# -----------------------
2084a9274bcdSmrg# Minimum version: 1.3.0
2085a9274bcdSmrg#
2086a9274bcdSmrg# Add configure option to enable strict compilation
2087a9274bcdSmrgAC_DEFUN([XORG_STRICT_OPTION], [
208848af84faSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
2089a9274bcdSmrgAC_REQUIRE([AC_PROG_CC_C99])
2090a9274bcdSmrgAC_REQUIRE([XORG_CWARNFLAGS])
2091a9274bcdSmrg
2092a9274bcdSmrgAC_ARG_ENABLE(strict-compilation,
2093a9274bcdSmrg			  AS_HELP_STRING([--enable-strict-compilation],
2094a9274bcdSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
2095a9274bcdSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2096a9274bcdSmrgif test "x$STRICT_COMPILE" = "xyes"; then
2097a9274bcdSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2098a9274bcdSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2099a9274bcdSmrg	if test "x$GCC" = xyes ; then
2100a9274bcdSmrg		STRICT_CFLAGS="-pedantic -Werror"
2101a9274bcdSmrg	elif test "x$SUNCC" = "xyes"; then
2102a9274bcdSmrg		STRICT_CFLAGS="-errwarn"
2103a9274bcdSmrg    elif test "x$INTELCC" = "xyes"; then
2104a9274bcdSmrg		STRICT_CFLAGS="-Werror"
2105a9274bcdSmrg	fi
2106a9274bcdSmrgfi
2107a9274bcdSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
2108a9274bcdSmrgAC_SUBST([CWARNFLAGS])
2109a9274bcdSmrg]) # XORG_STRICT_OPTION
2110a9274bcdSmrg
2111a9274bcdSmrg# XORG_DEFAULT_OPTIONS
2112a9274bcdSmrg# --------------------
2113a9274bcdSmrg# Minimum version: 1.3.0
2114a9274bcdSmrg#
2115a9274bcdSmrg# Defines default options for X.Org modules.
2116a9274bcdSmrg#
2117a9274bcdSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
211848af84faSmrgAC_REQUIRE([AC_PROG_INSTALL])
2119a9274bcdSmrgXORG_CWARNFLAGS
2120a9274bcdSmrgXORG_STRICT_OPTION
2121a9274bcdSmrgXORG_RELEASE_VERSION
2122a9274bcdSmrgXORG_CHANGELOG
212348af84faSmrgXORG_INSTALL
2124a9274bcdSmrgXORG_MANPAGE_SECTIONS
212548af84faSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
212648af84faSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2127a9274bcdSmrg]) # XORG_DEFAULT_OPTIONS
212848af84faSmrg
212948af84faSmrg# XORG_INSTALL()
213048af84faSmrg# ----------------
213148af84faSmrg# Minimum version: 1.4.0
213248af84faSmrg#
213348af84faSmrg# Defines the variable INSTALL_CMD as the command to copy
213448af84faSmrg# INSTALL from $prefix/share/util-macros.
213548af84faSmrg#
213648af84faSmrgAC_DEFUN([XORG_INSTALL], [
213748af84faSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
213848af84faSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
213948af84faSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
214048af84faSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
214148af84faSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
214248af84faSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
214348af84faSmrgAC_SUBST([INSTALL_CMD])
214448af84faSmrg]) # XORG_INSTALL
2145a9274bcdSmrgdnl Copyright 2005 Red Hat, Inc
2146a9274bcdSmrgdnl
2147a9274bcdSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
2148a9274bcdSmrgdnl documentation for any purpose is hereby granted without fee, provided that
2149a9274bcdSmrgdnl the above copyright notice appear in all copies and that both that
2150a9274bcdSmrgdnl copyright notice and this permission notice appear in supporting
2151a9274bcdSmrgdnl documentation.
2152a9274bcdSmrgdnl
2153a9274bcdSmrgdnl The above copyright notice and this permission notice shall be included
2154a9274bcdSmrgdnl in all copies or substantial portions of the Software.
2155a9274bcdSmrgdnl
2156a9274bcdSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2157a9274bcdSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2158a9274bcdSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2159a9274bcdSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2160a9274bcdSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2161a9274bcdSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2162a9274bcdSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
2163a9274bcdSmrgdnl
2164a9274bcdSmrgdnl Except as contained in this notice, the name of the copyright holders shall
2165a9274bcdSmrgdnl not be used in advertising or otherwise to promote the sale, use or
2166a9274bcdSmrgdnl other dealings in this Software without prior written authorization
2167a9274bcdSmrgdnl from the copyright holders.
2168a9274bcdSmrgdnl
2169a9274bcdSmrg
2170a9274bcdSmrg# XORG_RELEASE_VERSION
2171a9274bcdSmrg# --------------------
217248af84faSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2173a9274bcdSmrg 
2174a9274bcdSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
2175a9274bcdSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2176a9274bcdSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2177a9274bcdSmrg		[Major version of this package])
2178a9274bcdSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2179a9274bcdSmrg	if test "x$PVM" = "x"; then
2180a9274bcdSmrg		PVM="0"
2181a9274bcdSmrg	fi
2182a9274bcdSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2183a9274bcdSmrg		[$PVM],
2184a9274bcdSmrg		[Minor version of this package])
2185a9274bcdSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2186a9274bcdSmrg	if test "x$PVP" = "x"; then
2187a9274bcdSmrg		PVP="0"
2188a9274bcdSmrg	fi
2189a9274bcdSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2190a9274bcdSmrg		[$PVP],
2191a9274bcdSmrg		[Patch version of this package])
2192a9274bcdSmrg])
2193a9274bcdSmrg
2194a9274bcdSmrg# XORG_CHANGELOG()
2195a9274bcdSmrg# ----------------
2196a9274bcdSmrg# Minimum version: 1.2.0
2197a9274bcdSmrg#
2198a9274bcdSmrg# Defines the variable CHANGELOG_CMD as the command to generate
2199a9274bcdSmrg# ChangeLog from git.
2200a9274bcdSmrg#
2201a9274bcdSmrg#
2202a9274bcdSmrgAC_DEFUN([XORG_CHANGELOG], [
220348af84faSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
220448af84faSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
220548af84faSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2206a9274bcdSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
2207a9274bcdSmrgAC_SUBST([CHANGELOG_CMD])
2208a9274bcdSmrg]) # XORG_CHANGELOG
220966fe65f6Smrg
221048af84faSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
221148af84faSmrg# 
221248af84faSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
221348af84faSmrg#
221448af84faSmrg# This program is free software; you can redistribute it and/or modify
221548af84faSmrg# it under the terms of the GNU General Public License as published by
221648af84faSmrg# the Free Software Foundation; either version 2 of the License, or
221748af84faSmrg# (at your option) any later version.
221848af84faSmrg#
221948af84faSmrg# This program is distributed in the hope that it will be useful, but
222048af84faSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
222148af84faSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
222248af84faSmrg# General Public License for more details.
222348af84faSmrg#
222448af84faSmrg# You should have received a copy of the GNU General Public License
222548af84faSmrg# along with this program; if not, write to the Free Software
222648af84faSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
222748af84faSmrg#
222848af84faSmrg# As a special exception to the GNU General Public License, if you
222948af84faSmrg# distribute this file as part of a program that contains a
223048af84faSmrg# configuration script generated by Autoconf, you may include it under
223148af84faSmrg# the same distribution terms that you use for the rest of that program.
223248af84faSmrg
223348af84faSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
223448af84faSmrg# ----------------------------------
223548af84faSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
223648af84faSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
223748af84faSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
223848af84faSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
223948af84faSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
224048af84faSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
224148af84faSmrgfi
224248af84faSmrgif test -n "$PKG_CONFIG"; then
224348af84faSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
224448af84faSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
224548af84faSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
224648af84faSmrg		AC_MSG_RESULT([yes])
224748af84faSmrg	else
224848af84faSmrg		AC_MSG_RESULT([no])
224948af84faSmrg		PKG_CONFIG=""
225048af84faSmrg	fi
225148af84faSmrg		
225248af84faSmrgfi[]dnl
225348af84faSmrg])# PKG_PROG_PKG_CONFIG
225448af84faSmrg
225548af84faSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
225648af84faSmrg#
225748af84faSmrg# Check to see whether a particular set of modules exists.  Similar
225848af84faSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
225948af84faSmrg#
226048af84faSmrg#
226148af84faSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
226248af84faSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
226348af84faSmrg# PKG_CHECK_EXISTS manually
226448af84faSmrg# --------------------------------------------------------------
226548af84faSmrgAC_DEFUN([PKG_CHECK_EXISTS],
226648af84faSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
226748af84faSmrgif test -n "$PKG_CONFIG" && \
226848af84faSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
226948af84faSmrg  m4_ifval([$2], [$2], [:])
227048af84faSmrgm4_ifvaln([$3], [else
227148af84faSmrg  $3])dnl
227248af84faSmrgfi])
227348af84faSmrg
227448af84faSmrg
227548af84faSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
227648af84faSmrg# ---------------------------------------------
227748af84faSmrgm4_define([_PKG_CONFIG],
227848af84faSmrg[if test -n "$$1"; then
227948af84faSmrg    pkg_cv_[]$1="$$1"
228048af84faSmrg elif test -n "$PKG_CONFIG"; then
228148af84faSmrg    PKG_CHECK_EXISTS([$3],
228248af84faSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
228348af84faSmrg		     [pkg_failed=yes])
228448af84faSmrg else
228548af84faSmrg    pkg_failed=untried
228648af84faSmrgfi[]dnl
228748af84faSmrg])# _PKG_CONFIG
228848af84faSmrg
228948af84faSmrg# _PKG_SHORT_ERRORS_SUPPORTED
229048af84faSmrg# -----------------------------
229148af84faSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
229248af84faSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
229348af84faSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
229448af84faSmrg        _pkg_short_errors_supported=yes
229548af84faSmrgelse
229648af84faSmrg        _pkg_short_errors_supported=no
229748af84faSmrgfi[]dnl
229848af84faSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
229948af84faSmrg
230048af84faSmrg
230148af84faSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
230248af84faSmrg# [ACTION-IF-NOT-FOUND])
230348af84faSmrg#
230448af84faSmrg#
230548af84faSmrg# Note that if there is a possibility the first call to
230648af84faSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
230748af84faSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
230848af84faSmrg#
230948af84faSmrg#
231048af84faSmrg# --------------------------------------------------------------
231148af84faSmrgAC_DEFUN([PKG_CHECK_MODULES],
231248af84faSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
231348af84faSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
231448af84faSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
231548af84faSmrg
231648af84faSmrgpkg_failed=no
231748af84faSmrgAC_MSG_CHECKING([for $1])
231848af84faSmrg
231948af84faSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
232048af84faSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
232148af84faSmrg
232248af84faSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
232348af84faSmrgand $1[]_LIBS to avoid the need to call pkg-config.
232448af84faSmrgSee the pkg-config man page for more details.])
232548af84faSmrg
232648af84faSmrgif test $pkg_failed = yes; then
232748af84faSmrg        _PKG_SHORT_ERRORS_SUPPORTED
232848af84faSmrg        if test $_pkg_short_errors_supported = yes; then
232948af84faSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
233048af84faSmrg        else 
233148af84faSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
233248af84faSmrg        fi
233348af84faSmrg	# Put the nasty error message in config.log where it belongs
233448af84faSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
233548af84faSmrg
233648af84faSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
233748af84faSmrg[Package requirements ($2) were not met:
233848af84faSmrg
233948af84faSmrg$$1_PKG_ERRORS
234048af84faSmrg
234148af84faSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
234248af84faSmrginstalled software in a non-standard prefix.
234348af84faSmrg
234448af84faSmrg_PKG_TEXT
234548af84faSmrg])],
234648af84faSmrg		[AC_MSG_RESULT([no])
234748af84faSmrg                $4])
234848af84faSmrgelif test $pkg_failed = untried; then
234948af84faSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
235048af84faSmrg[The pkg-config script could not be found or is too old.  Make sure it
235148af84faSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
235248af84faSmrgpath to pkg-config.
235348af84faSmrg
235448af84faSmrg_PKG_TEXT
235548af84faSmrg
235648af84faSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
235748af84faSmrg		[$4])
235848af84faSmrgelse
235948af84faSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
236048af84faSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
236148af84faSmrg        AC_MSG_RESULT([yes])
236248af84faSmrg	ifelse([$3], , :, [$3])
236348af84faSmrgfi[]dnl
236448af84faSmrg])# PKG_CHECK_MODULES
236548af84faSmrg
2366