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