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