aclocal.m4 revision 1cca5e29
11cca5e29Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2d838582fSmrg
3d838582fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4d466db85Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5d838582fSmrg# This file is free software; the Free Software Foundation
6d838582fSmrg# gives unlimited permission to copy and/or distribute it,
7d838582fSmrg# with or without modifications, as long as this notice is preserved.
8d838582fSmrg
9d838582fSmrg# This program is distributed in the hope that it will be useful,
10d838582fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11d838582fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12d838582fSmrg# PARTICULAR PURPOSE.
13d838582fSmrg
14d838582fSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15d838582fSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
161cca5e29Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
171cca5e29Smrg[m4_warning([this file was generated for autoconf 2.68.
18d838582fSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19d838582fSmrgIf you have problems, you may need to regenerate the build system entirely.
20d838582fSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21d838582fSmrg
22d466db85Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23d466db85Smrg#
24d466db85Smrg# This file is free software; the Free Software Foundation
25d466db85Smrg# gives unlimited permission to copy and/or distribute it,
26d466db85Smrg# with or without modifications, as long as this notice is preserved.
27d838582fSmrg
28d466db85Smrg# AM_AUTOMAKE_VERSION(VERSION)
29d466db85Smrg# ----------------------------
30d466db85Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31d466db85Smrg# generated from the m4 files accompanying Automake X.Y.
32d466db85Smrg# (This private macro should not be called outside this file.)
33d466db85SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34d466db85Smrg[am__api_version='1.11'
35d466db85Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36d466db85Smrgdnl require some minimum version.  Point them to the right macro.
371cca5e29Smrgm4_if([$1], [1.11.1], [],
38d466db85Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39d466db85Smrg])
40d466db85Smrg
41d466db85Smrg# _AM_AUTOCONF_VERSION(VERSION)
42d466db85Smrg# -----------------------------
43d466db85Smrg# aclocal traces this macro to find the Autoconf version.
44d466db85Smrg# This is a private macro too.  Using m4_define simplifies
45d466db85Smrg# the logic in aclocal, which can simply ignore this definition.
46d466db85Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47d466db85Smrg
48d466db85Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49d466db85Smrg# -------------------------------
50d466db85Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51d466db85Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52d466db85SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
531cca5e29Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
54d466db85Smrgm4_ifndef([AC_AUTOCONF_VERSION],
55d466db85Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56d466db85Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57d466db85Smrg
58d466db85Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59d466db85Smrg
60d466db85Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61d838582fSmrg#
62d466db85Smrg# This file is free software; the Free Software Foundation
63d466db85Smrg# gives unlimited permission to copy and/or distribute it,
64d466db85Smrg# with or without modifications, as long as this notice is preserved.
65d466db85Smrg
66d466db85Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67d466db85Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68d466db85Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69d466db85Smrg#
70d466db85Smrg# Of course, Automake must honor this variable whenever it calls a
71d466db85Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72d466db85Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73d466db85Smrg# depending on how configure is run.  This is pretty annoying, since
74d466db85Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75d466db85Smrg# source directory, any form will work fine, but in subdirectories a
76d466db85Smrg# relative path needs to be adjusted first.
77d838582fSmrg#
78d466db85Smrg# $ac_aux_dir/missing
79d466db85Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80d466db85Smrg# $top_srcdir/$ac_aux_dir/missing
81d466db85Smrg#    fails if $ac_aux_dir is absolute,
82d466db85Smrg#    fails when called from a subdirectory in a VPATH build with
83d466db85Smrg#          a relative $ac_aux_dir
84d838582fSmrg#
85d466db85Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86d466db85Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
87d466db85Smrg# harmless because $srcdir is `.', but things will broke when you
88d466db85Smrg# start a VPATH build or use an absolute $srcdir.
89d838582fSmrg#
90d466db85Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91d466db85Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92d466db85Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93d466db85Smrg# and then we would define $MISSING as
94d466db85Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95d466db85Smrg# This will work as long as MISSING is not called from configure, because
96d466db85Smrg# unfortunately $(top_srcdir) has no meaning in configure.
97d466db85Smrg# However there are other variables, like CC, which are often used in
98d466db85Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99d466db85Smrg#
100d466db85Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
101d466db85Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
102d466db85Smrg# configured tree to be moved without reconfiguration.
103d838582fSmrg
104d466db85SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105d466db85Smrg[dnl Rely on autoconf to set up CDPATH properly.
106d466db85SmrgAC_PREREQ([2.50])dnl
107d466db85Smrg# expand $ac_aux_dir to an absolute path
108d466db85Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
109d466db85Smrg])
110d466db85Smrg
111d466db85Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112d466db85Smrg
113d466db85Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114d466db85Smrg# Free Software Foundation, Inc.
115d838582fSmrg#
116d466db85Smrg# This file is free software; the Free Software Foundation
117d466db85Smrg# gives unlimited permission to copy and/or distribute it,
118d466db85Smrg# with or without modifications, as long as this notice is preserved.
119d838582fSmrg
120d466db85Smrg# serial 9
121d838582fSmrg
122d466db85Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123d466db85Smrg# -------------------------------------
124d466db85Smrg# Define a conditional.
125d466db85SmrgAC_DEFUN([AM_CONDITIONAL],
126d466db85Smrg[AC_PREREQ(2.52)dnl
127d466db85Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128d466db85Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129d466db85SmrgAC_SUBST([$1_TRUE])dnl
130d466db85SmrgAC_SUBST([$1_FALSE])dnl
131d466db85Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132d466db85Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133d466db85Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134d466db85Smrgif $2; then
135d466db85Smrg  $1_TRUE=
136d466db85Smrg  $1_FALSE='#'
137d838582fSmrgelse
138d466db85Smrg  $1_TRUE='#'
139d466db85Smrg  $1_FALSE=
140d838582fSmrgfi
141d466db85SmrgAC_CONFIG_COMMANDS_PRE(
142d466db85Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143d466db85Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144d466db85SmrgUsually this means the macro was only invoked conditionally.]])
145d466db85Smrgfi])])
146d838582fSmrg
147d466db85Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148d466db85Smrg# Free Software Foundation, Inc.
149d838582fSmrg#
150d466db85Smrg# This file is free software; the Free Software Foundation
151d466db85Smrg# gives unlimited permission to copy and/or distribute it,
152d466db85Smrg# with or without modifications, as long as this notice is preserved.
153d838582fSmrg
154d466db85Smrg# serial 10
155d838582fSmrg
156d466db85Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157d466db85Smrg# written in clear, in which case automake, when reading aclocal.m4,
158d466db85Smrg# will think it sees a *use*, and therefore will trigger all it's
159d466db85Smrg# C support machinery.  Also note that it means that autoscan, seeing
160d466db85Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161d838582fSmrg
162d838582fSmrg
163d466db85Smrg# _AM_DEPENDENCIES(NAME)
164d466db85Smrg# ----------------------
165d466db85Smrg# See how the compiler implements dependency checking.
166d466db85Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167d466db85Smrg# We try a few techniques and use that to set a single cache variable.
168d466db85Smrg#
169d466db85Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170d466db85Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171d466db85Smrg# dependency, and given that the user is not expected to run this macro,
172d466db85Smrg# just rely on AC_PROG_CC.
173d466db85SmrgAC_DEFUN([_AM_DEPENDENCIES],
174d466db85Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175d466db85SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176d466db85SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177d466db85SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178d466db85Smrg
179d466db85Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180d466db85Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181d466db85Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182d466db85Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183d466db85Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184d466db85Smrg                   [depcc="$$1"   am_compiler_list=])
185d466db85Smrg
186d466db85SmrgAC_CACHE_CHECK([dependency style of $depcc],
187d466db85Smrg               [am_cv_$1_dependencies_compiler_type],
188d466db85Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189d466db85Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
190d466db85Smrg  # making bogus files that we don't know about and never remove.  For
191d466db85Smrg  # instance it was reported that on HP-UX the gcc test will end up
192d466db85Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
193d466db85Smrg  # in D'.
194d466db85Smrg  mkdir conftest.dir
195d466db85Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196d466db85Smrg  # using a relative directory.
197d466db85Smrg  cp "$am_depcomp" conftest.dir
198d466db85Smrg  cd conftest.dir
199d466db85Smrg  # We will build objects and dependencies in a subdirectory because
200d466db85Smrg  # it helps to detect inapplicable dependency modes.  For instance
201d466db85Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202d466db85Smrg  # side effect of compilation, but ICC will put the dependencies in
203d466db85Smrg  # the current directory while Tru64 will put them in the object
204d466db85Smrg  # directory.
205d466db85Smrg  mkdir sub
206d466db85Smrg
207d466db85Smrg  am_cv_$1_dependencies_compiler_type=none
208d466db85Smrg  if test "$am_compiler_list" = ""; then
209d466db85Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210d466db85Smrg  fi
211d466db85Smrg  am__universal=false
212d466db85Smrg  m4_case([$1], [CC],
213d466db85Smrg    [case " $depcc " in #(
214d466db85Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215d466db85Smrg     esac],
216d466db85Smrg    [CXX],
217d466db85Smrg    [case " $depcc " in #(
218d466db85Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219d466db85Smrg     esac])
220d466db85Smrg
221d466db85Smrg  for depmode in $am_compiler_list; do
222d466db85Smrg    # Setup a source with many dependencies, because some compilers
223d466db85Smrg    # like to wrap large dependency lists on column 80 (with \), and
224d466db85Smrg    # we should not choose a depcomp mode which is confused by this.
225d466db85Smrg    #
226d466db85Smrg    # We need to recreate these files for each test, as the compiler may
227d466db85Smrg    # overwrite some of them when testing with obscure command lines.
228d466db85Smrg    # This happens at least with the AIX C compiler.
229d466db85Smrg    : > sub/conftest.c
230d466db85Smrg    for i in 1 2 3 4 5 6; do
231d466db85Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232d466db85Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233d466db85Smrg      # Solaris 8's {/usr,}/bin/sh.
234d466db85Smrg      touch sub/conftst$i.h
235d466db85Smrg    done
236d466db85Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237d466db85Smrg
238d466db85Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239d466db85Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240d466db85Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241d466db85Smrg    # versions had trouble with output in subdirs
242d466db85Smrg    am__obj=sub/conftest.${OBJEXT-o}
243d466db85Smrg    am__minus_obj="-o $am__obj"
244d466db85Smrg    case $depmode in
245d466db85Smrg    gcc)
246d466db85Smrg      # This depmode causes a compiler race in universal mode.
247d466db85Smrg      test "$am__universal" = false || continue
248d466db85Smrg      ;;
249d466db85Smrg    nosideeffect)
250d466db85Smrg      # after this tag, mechanisms are not by side-effect, so they'll
251d466db85Smrg      # only be used when explicitly requested
252d466db85Smrg      if test "x$enable_dependency_tracking" = xyes; then
253d466db85Smrg	continue
254d466db85Smrg      else
255d466db85Smrg	break
256d466db85Smrg      fi
257d466db85Smrg      ;;
258d466db85Smrg    msvisualcpp | msvcmsys)
259d466db85Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
260d466db85Smrg      # not run yet.  These depmodes are late enough in the game, and
261d466db85Smrg      # so weak that their functioning should not be impacted.
262d466db85Smrg      am__obj=conftest.${OBJEXT-o}
263d466db85Smrg      am__minus_obj=
264d466db85Smrg      ;;
265d466db85Smrg    none) break ;;
266d838582fSmrg    esac
267d466db85Smrg    if depmode=$depmode \
268d466db85Smrg       source=sub/conftest.c object=$am__obj \
269d466db85Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270d466db85Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271d466db85Smrg         >/dev/null 2>conftest.err &&
272d466db85Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273d466db85Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274d466db85Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275d466db85Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276d466db85Smrg      # icc doesn't choke on unknown options, it will just issue warnings
277d466db85Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
278d466db85Smrg      # that says an option was ignored or not supported.
279d466db85Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280d466db85Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281d466db85Smrg      # The diagnosis changed in icc 8.0:
282d466db85Smrg      #   icc: Command line remark: option '-MP' not supported
283d466db85Smrg      if (grep 'ignoring option' conftest.err ||
284d466db85Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285d466db85Smrg        am_cv_$1_dependencies_compiler_type=$depmode
286d466db85Smrg        break
287d466db85Smrg      fi
288d466db85Smrg    fi
289d466db85Smrg  done
290d466db85Smrg
291d466db85Smrg  cd ..
292d466db85Smrg  rm -rf conftest.dir
293d466db85Smrgelse
294d466db85Smrg  am_cv_$1_dependencies_compiler_type=none
295d838582fSmrgfi
296d466db85Smrg])
297d466db85SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298d466db85SmrgAM_CONDITIONAL([am__fastdep$1], [
299d466db85Smrg  test "x$enable_dependency_tracking" != xno \
300d466db85Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301d466db85Smrg])
302d838582fSmrg
303d838582fSmrg
304d466db85Smrg# AM_SET_DEPDIR
305d466db85Smrg# -------------
306d466db85Smrg# Choose a directory name for dependency files.
307d466db85Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308d466db85SmrgAC_DEFUN([AM_SET_DEPDIR],
309d466db85Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310d466db85SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311d466db85Smrg])
312d838582fSmrg
313d466db85Smrg
314d466db85Smrg# AM_DEP_TRACK
315d466db85Smrg# ------------
316d466db85SmrgAC_DEFUN([AM_DEP_TRACK],
317d466db85Smrg[AC_ARG_ENABLE(dependency-tracking,
318d466db85Smrg[  --disable-dependency-tracking  speeds up one-time build
319d466db85Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320d466db85Smrgif test "x$enable_dependency_tracking" != xno; then
321d466db85Smrg  am_depcomp="$ac_aux_dir/depcomp"
322d466db85Smrg  AMDEPBACKSLASH='\'
323d838582fSmrgfi
324d466db85SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325d466db85SmrgAC_SUBST([AMDEPBACKSLASH])dnl
326d466db85Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327d466db85Smrg])
328d838582fSmrg
329d466db85Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330d838582fSmrg
331d466db85Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332d466db85Smrg# Free Software Foundation, Inc.
333d466db85Smrg#
334d466db85Smrg# This file is free software; the Free Software Foundation
335d466db85Smrg# gives unlimited permission to copy and/or distribute it,
336d466db85Smrg# with or without modifications, as long as this notice is preserved.
337d838582fSmrg
338d466db85Smrg#serial 5
339d466db85Smrg
340d466db85Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341d466db85Smrg# ------------------------------
342d466db85SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343d466db85Smrg[{
344d466db85Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345d466db85Smrg  # are listed without --file.  Let's play safe and only enable the eval
346d466db85Smrg  # if we detect the quoting.
347d466db85Smrg  case $CONFIG_FILES in
348d466db85Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
349d466db85Smrg  *)   set x $CONFIG_FILES ;;
350d466db85Smrg  esac
351d466db85Smrg  shift
352d466db85Smrg  for mf
353d466db85Smrg  do
354d466db85Smrg    # Strip MF so we end up with the name of the file.
355d466db85Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356d466db85Smrg    # Check whether this is an Automake generated Makefile or not.
357d466db85Smrg    # We used to match only the files named `Makefile.in', but
358d466db85Smrg    # some people rename them; so instead we look at the file content.
359d466db85Smrg    # Grep'ing the first line is not enough: some people post-process
360d466db85Smrg    # each Makefile.in and add a new line on top of each file to say so.
361d466db85Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
362d466db85Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
363d466db85Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364d466db85Smrg      dirpart=`AS_DIRNAME("$mf")`
365d466db85Smrg    else
366d466db85Smrg      continue
367d466db85Smrg    fi
368d466db85Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
369d466db85Smrg    # from the Makefile without running `make'.
370d466db85Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371d466db85Smrg    test -z "$DEPDIR" && continue
372d466db85Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373d466db85Smrg    test -z "am__include" && continue
374d466db85Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375d466db85Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
376d466db85Smrg    U=`sed -n 's/^U = //p' < "$mf"`
377d466db85Smrg    # Find all dependency output files, they are included files with
378d466db85Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379d466db85Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380d466db85Smrg    # expansion.
381d466db85Smrg    for file in `sed -n "
382d466db85Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383d466db85Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384d466db85Smrg      # Make sure the directory exists.
385d466db85Smrg      test -f "$dirpart/$file" && continue
386d466db85Smrg      fdir=`AS_DIRNAME(["$file"])`
387d466db85Smrg      AS_MKDIR_P([$dirpart/$fdir])
388d466db85Smrg      # echo "creating $dirpart/$file"
389d466db85Smrg      echo '# dummy' > "$dirpart/$file"
390d466db85Smrg    done
391d466db85Smrg  done
392d466db85Smrg}
393d466db85Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394d466db85Smrg
395d466db85Smrg
396d466db85Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397d466db85Smrg# -----------------------------
398d466db85Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
399d838582fSmrg#
400d466db85Smrg# This code is only required when automatic dependency tracking
401d466db85Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
402d466db85Smrg# need in order to bootstrap the dependency handling code.
403d466db85SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404d466db85Smrg[AC_CONFIG_COMMANDS([depfiles],
405d466db85Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406d466db85Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407d466db85Smrg])
408d838582fSmrg
409d466db85Smrg# Do all the work for Automake.                             -*- Autoconf -*-
410d838582fSmrg
411d466db85Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
412d466db85Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
413d466db85Smrg#
414d466db85Smrg# This file is free software; the Free Software Foundation
415d466db85Smrg# gives unlimited permission to copy and/or distribute it,
416d466db85Smrg# with or without modifications, as long as this notice is preserved.
417d838582fSmrg
418d466db85Smrg# serial 16
419d838582fSmrg
420d466db85Smrg# This macro actually does too much.  Some checks are only needed if
421d466db85Smrg# your package does certain things.  But this isn't really a big deal.
422d466db85Smrg
423d466db85Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
424d466db85Smrg# AM_INIT_AUTOMAKE([OPTIONS])
425d466db85Smrg# -----------------------------------------------
426d466db85Smrg# The call with PACKAGE and VERSION arguments is the old style
427d466db85Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
428d466db85Smrg# and VERSION should now be passed to AC_INIT and removed from
429d466db85Smrg# the call to AM_INIT_AUTOMAKE.
430d466db85Smrg# We support both call styles for the transition.  After
431d466db85Smrg# the next Automake release, Autoconf can make the AC_INIT
432d466db85Smrg# arguments mandatory, and then we can depend on a new Autoconf
433d466db85Smrg# release and drop the old call support.
434d466db85SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
435d466db85Smrg[AC_PREREQ([2.62])dnl
436d466db85Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
437d466db85Smrgdnl the ones we care about.
438d466db85Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
439d466db85SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
440d466db85SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
441d466db85Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
442d466db85Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
443d466db85Smrg  # is not polluted with repeated "-I."
444d466db85Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
445d466db85Smrg  # test to see if srcdir already configured
446d466db85Smrg  if test -f $srcdir/config.status; then
447d466db85Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
448d466db85Smrg  fi
449d838582fSmrgfi
450d838582fSmrg
451d466db85Smrg# test whether we have cygpath
452d466db85Smrgif test -z "$CYGPATH_W"; then
453d466db85Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
454d466db85Smrg    CYGPATH_W='cygpath -w'
455d466db85Smrg  else
456d466db85Smrg    CYGPATH_W=echo
457d466db85Smrg  fi
458d466db85Smrgfi
459d466db85SmrgAC_SUBST([CYGPATH_W])
460d838582fSmrg
461d466db85Smrg# Define the identity of the package.
462d466db85Smrgdnl Distinguish between old-style and new-style calls.
463d466db85Smrgm4_ifval([$2],
464d466db85Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465d466db85Smrg AC_SUBST([PACKAGE], [$1])dnl
466d466db85Smrg AC_SUBST([VERSION], [$2])],
467d466db85Smrg[_AM_SET_OPTIONS([$1])dnl
468d466db85Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469d466db85Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
470d466db85Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471d466db85Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472d466db85Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473d838582fSmrg
474d466db85Smrg_AM_IF_OPTION([no-define],,
475d466db85Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
476d466db85Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
477d838582fSmrg
478d466db85Smrg# Some tools Automake needs.
479d466db85SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
480d466db85SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
481d466db85SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
482d466db85SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
483d466db85SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
484d466db85SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
485d466db85SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
486d466db85SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487d466db85SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488d466db85SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
489d466db85Smrg# We need awk for the "check" target.  The system "awk" is bad on
490d466db85Smrg# some platforms.
491d466db85SmrgAC_REQUIRE([AC_PROG_AWK])dnl
492d466db85SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
493d466db85SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
494d466db85Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
495d466db85Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
496d466db85Smrg			     [_AM_PROG_TAR([v7])])])
497d466db85Smrg_AM_IF_OPTION([no-dependencies],,
498d466db85Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
499d466db85Smrg		  [_AM_DEPENDENCIES(CC)],
500d466db85Smrg		  [define([AC_PROG_CC],
501d466db85Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
502d466db85SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
503d466db85Smrg		  [_AM_DEPENDENCIES(CXX)],
504d466db85Smrg		  [define([AC_PROG_CXX],
505d466db85Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
506d466db85SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
507d466db85Smrg		  [_AM_DEPENDENCIES(OBJC)],
508d466db85Smrg		  [define([AC_PROG_OBJC],
509d466db85Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
510d466db85Smrg])
511d466db85Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
512d466db85Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
513d466db85Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
514d466db85Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
515d466db85SmrgAC_CONFIG_COMMANDS_PRE(dnl
516d466db85Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
517d466db85Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
518d466db85Smrg])
519d838582fSmrg
520d466db85Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
521d466db85Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522d466db85Smrgdnl mangled by Autoconf and run in a shell conditional statement.
523d466db85Smrgm4_define([_AC_COMPILER_EXEEXT],
524d466db85Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525d838582fSmrg
526d838582fSmrg
527d466db85Smrg# When config.status generates a header, we must update the stamp-h file.
528d466db85Smrg# This file resides in the same directory as the config header
529d466db85Smrg# that is generated.  The stamp files are numbered to have different names.
530d838582fSmrg
531d466db85Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
532d466db85Smrg# loop where config.status creates the headers, so we can generate
533d466db85Smrg# our stamp files there.
534d466db85SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
535d466db85Smrg[# Compute $1's index in $config_headers.
536d466db85Smrg_am_arg=$1
537d466db85Smrg_am_stamp_count=1
538d466db85Smrgfor _am_header in $config_headers :; do
539d466db85Smrg  case $_am_header in
540d466db85Smrg    $_am_arg | $_am_arg:* )
541d466db85Smrg      break ;;
542d466db85Smrg    * )
543d466db85Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
544d466db85Smrg  esac
545d466db85Smrgdone
546d466db85Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547d838582fSmrg
548d466db85Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
549d838582fSmrg#
550d466db85Smrg# This file is free software; the Free Software Foundation
551d466db85Smrg# gives unlimited permission to copy and/or distribute it,
552d466db85Smrg# with or without modifications, as long as this notice is preserved.
553d838582fSmrg
554d466db85Smrg# AM_PROG_INSTALL_SH
555d466db85Smrg# ------------------
556d466db85Smrg# Define $install_sh.
557d466db85SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
558d466db85Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
559d466db85Smrgif test x"${install_sh}" != xset; then
560d466db85Smrg  case $am_aux_dir in
561d466db85Smrg  *\ * | *\	*)
562d466db85Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
563d466db85Smrg  *)
564d466db85Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
565d466db85Smrg  esac
566d466db85Smrgfi
567d466db85SmrgAC_SUBST(install_sh)])
568d838582fSmrg
569d466db85Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
570d466db85Smrg#
571d466db85Smrg# This file is free software; the Free Software Foundation
572d466db85Smrg# gives unlimited permission to copy and/or distribute it,
573d466db85Smrg# with or without modifications, as long as this notice is preserved.
574d838582fSmrg
575d466db85Smrg# serial 2
576d838582fSmrg
577d466db85Smrg# Check whether the underlying file-system supports filenames
578d466db85Smrg# with a leading dot.  For instance MS-DOS doesn't.
579d466db85SmrgAC_DEFUN([AM_SET_LEADING_DOT],
580d466db85Smrg[rm -rf .tst 2>/dev/null
581d466db85Smrgmkdir .tst 2>/dev/null
582d466db85Smrgif test -d .tst; then
583d466db85Smrg  am__leading_dot=.
584d466db85Smrgelse
585d466db85Smrg  am__leading_dot=_
586d838582fSmrgfi
587d466db85Smrgrmdir .tst 2>/dev/null
588d466db85SmrgAC_SUBST([am__leading_dot])])
589d838582fSmrg
590d466db85Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
591d466db85Smrg# From Jim Meyering
592d838582fSmrg
593d466db85Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
594d466db85Smrg# Free Software Foundation, Inc.
595d466db85Smrg#
596d466db85Smrg# This file is free software; the Free Software Foundation
597d466db85Smrg# gives unlimited permission to copy and/or distribute it,
598d466db85Smrg# with or without modifications, as long as this notice is preserved.
599d838582fSmrg
600d466db85Smrg# serial 5
601d838582fSmrg
602d466db85Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
603d466db85Smrg# ----------------------------------
604d466db85Smrg# Control maintainer-specific portions of Makefiles.
605d466db85Smrg# Default is to disable them, unless `enable' is passed literally.
606d466db85Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
607d466db85Smrg# can override the default with the --enable/--disable switch.
608d466db85SmrgAC_DEFUN([AM_MAINTAINER_MODE],
609d466db85Smrg[m4_case(m4_default([$1], [disable]),
610d466db85Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
611d466db85Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
612d466db85Smrg       [m4_define([am_maintainer_other], [enable])
613d466db85Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
614d466db85SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
615d466db85Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
616d466db85Smrg  AC_ARG_ENABLE([maintainer-mode],
617d466db85Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
618d466db85Smrg			  (and sometimes confusing) to the casual installer],
619d466db85Smrg      [USE_MAINTAINER_MODE=$enableval],
620d466db85Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
621d466db85Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
622d466db85Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
623d466db85Smrg  MAINT=$MAINTAINER_MODE_TRUE
624d466db85Smrg  AC_SUBST([MAINT])dnl
625d466db85Smrg]
626d466db85Smrg)
627d838582fSmrg
628d466db85SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
629d838582fSmrg
630d466db85Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
631d838582fSmrg
632d466db85Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
633d838582fSmrg#
634d466db85Smrg# This file is free software; the Free Software Foundation
635d466db85Smrg# gives unlimited permission to copy and/or distribute it,
636d466db85Smrg# with or without modifications, as long as this notice is preserved.
637d838582fSmrg
638d466db85Smrg# serial 4
639d838582fSmrg
640d466db85Smrg# AM_MAKE_INCLUDE()
641d466db85Smrg# -----------------
642d466db85Smrg# Check to see how make treats includes.
643d466db85SmrgAC_DEFUN([AM_MAKE_INCLUDE],
644d466db85Smrg[am_make=${MAKE-make}
645d466db85Smrgcat > confinc << 'END'
646d466db85Smrgam__doit:
647d466db85Smrg	@echo this is the am__doit target
648d466db85Smrg.PHONY: am__doit
649d466db85SmrgEND
650d466db85Smrg# If we don't find an include directive, just comment out the code.
651d466db85SmrgAC_MSG_CHECKING([for style of include used by $am_make])
652d466db85Smrgam__include="#"
653d466db85Smrgam__quote=
654d466db85Smrg_am_result=none
655d466db85Smrg# First try GNU make style include.
656d466db85Smrgecho "include confinc" > confmf
657d466db85Smrg# Ignore all kinds of additional output from `make'.
658d466db85Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
659d466db85Smrg*the\ am__doit\ target*)
660d466db85Smrg  am__include=include
661d466db85Smrg  am__quote=
662d466db85Smrg  _am_result=GNU
663d466db85Smrg  ;;
664d466db85Smrgesac
665d466db85Smrg# Now try BSD make style include.
666d466db85Smrgif test "$am__include" = "#"; then
667d466db85Smrg   echo '.include "confinc"' > confmf
668d466db85Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
669d466db85Smrg   *the\ am__doit\ target*)
670d466db85Smrg     am__include=.include
671d466db85Smrg     am__quote="\""
672d466db85Smrg     _am_result=BSD
673d466db85Smrg     ;;
674d466db85Smrg   esac
675d466db85Smrgfi
676d466db85SmrgAC_SUBST([am__include])
677d466db85SmrgAC_SUBST([am__quote])
678d466db85SmrgAC_MSG_RESULT([$_am_result])
679d466db85Smrgrm -f confinc confmf
680d466db85Smrg])
681d838582fSmrg
682d466db85Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
683d838582fSmrg
684d466db85Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
685d466db85Smrg# Free Software Foundation, Inc.
686d838582fSmrg#
687d466db85Smrg# This file is free software; the Free Software Foundation
688d466db85Smrg# gives unlimited permission to copy and/or distribute it,
689d466db85Smrg# with or without modifications, as long as this notice is preserved.
690d838582fSmrg
691d466db85Smrg# serial 6
692d838582fSmrg
693d466db85Smrg# AM_MISSING_PROG(NAME, PROGRAM)
694d466db85Smrg# ------------------------------
695d466db85SmrgAC_DEFUN([AM_MISSING_PROG],
696d466db85Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
697d466db85Smrg$1=${$1-"${am_missing_run}$2"}
698d466db85SmrgAC_SUBST($1)])
699d838582fSmrg
700d838582fSmrg
701d466db85Smrg# AM_MISSING_HAS_RUN
702d466db85Smrg# ------------------
703d466db85Smrg# Define MISSING if not defined so far and test if it supports --run.
704d466db85Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
705d466db85SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
706d466db85Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
707d466db85SmrgAC_REQUIRE_AUX_FILE([missing])dnl
708d466db85Smrgif test x"${MISSING+set}" != xset; then
709d466db85Smrg  case $am_aux_dir in
710d466db85Smrg  *\ * | *\	*)
711d466db85Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
712d466db85Smrg  *)
713d466db85Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
714d466db85Smrg  esac
715d466db85Smrgfi
716d466db85Smrg# Use eval to expand $SHELL
717d466db85Smrgif eval "$MISSING --run true"; then
718d466db85Smrg  am_missing_run="$MISSING --run "
719d466db85Smrgelse
720d466db85Smrg  am_missing_run=
721d466db85Smrg  AC_MSG_WARN([`missing' script is too old or missing])
722d466db85Smrgfi
723d838582fSmrg])
724d838582fSmrg
725d466db85Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726d838582fSmrg#
727d838582fSmrg# This file is free software; the Free Software Foundation
728d838582fSmrg# gives unlimited permission to copy and/or distribute it,
729d838582fSmrg# with or without modifications, as long as this notice is preserved.
730d838582fSmrg
731d466db85Smrg# AM_PROG_MKDIR_P
732d466db85Smrg# ---------------
733d466db85Smrg# Check for `mkdir -p'.
734d466db85SmrgAC_DEFUN([AM_PROG_MKDIR_P],
735d466db85Smrg[AC_PREREQ([2.60])dnl
736d466db85SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
737d466db85Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
738d466db85Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
739d466db85Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
740d466db85Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
741d466db85Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
742d466db85Smrgdnl adjustment using top_builddir (which is defined more often than
743d466db85Smrgdnl MKDIR_P).
744d466db85SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
745d466db85Smrgcase $mkdir_p in
746d466db85Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
747d466db85Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
748d466db85Smrgesac
749d838582fSmrg])
750d838582fSmrg
751d466db85Smrg# Helper functions for option handling.                     -*- Autoconf -*-
752d838582fSmrg
753d466db85Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
754d838582fSmrg#
755d838582fSmrg# This file is free software; the Free Software Foundation
756d838582fSmrg# gives unlimited permission to copy and/or distribute it,
757d838582fSmrg# with or without modifications, as long as this notice is preserved.
758d838582fSmrg
759d466db85Smrg# serial 4
760d838582fSmrg
761d466db85Smrg# _AM_MANGLE_OPTION(NAME)
762d466db85Smrg# -----------------------
763d466db85SmrgAC_DEFUN([_AM_MANGLE_OPTION],
764d466db85Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765d838582fSmrg
766d466db85Smrg# _AM_SET_OPTION(NAME)
767d466db85Smrg# ------------------------------
768d466db85Smrg# Set option NAME.  Presently that only means defining a flag for this option.
769d466db85SmrgAC_DEFUN([_AM_SET_OPTION],
770d466db85Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
771d466db85Smrg
772d466db85Smrg# _AM_SET_OPTIONS(OPTIONS)
773d466db85Smrg# ----------------------------------
774d466db85Smrg# OPTIONS is a space-separated list of Automake options.
775d466db85SmrgAC_DEFUN([_AM_SET_OPTIONS],
776d466db85Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
777d466db85Smrg
778d466db85Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
779d466db85Smrg# -------------------------------------------
780d466db85Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
781d466db85SmrgAC_DEFUN([_AM_IF_OPTION],
782d466db85Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783d838582fSmrg
784d466db85Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785d466db85Smrg
786d466db85Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
787d838582fSmrg# Free Software Foundation, Inc.
788d838582fSmrg#
789d838582fSmrg# This file is free software; the Free Software Foundation
790d838582fSmrg# gives unlimited permission to copy and/or distribute it,
791d838582fSmrg# with or without modifications, as long as this notice is preserved.
792d838582fSmrg
793d466db85Smrg# serial 5
794d838582fSmrg
795d466db85Smrg# AM_SANITY_CHECK
796d466db85Smrg# ---------------
797d466db85SmrgAC_DEFUN([AM_SANITY_CHECK],
798d466db85Smrg[AC_MSG_CHECKING([whether build environment is sane])
799d466db85Smrg# Just in case
800d466db85Smrgsleep 1
801d466db85Smrgecho timestamp > conftest.file
802d466db85Smrg# Reject unsafe characters in $srcdir or the absolute working directory
803d466db85Smrg# name.  Accept space and tab only in the latter.
804d466db85Smrgam_lf='
805d466db85Smrg'
806d466db85Smrgcase `pwd` in
807d466db85Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
808d466db85Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
809d466db85Smrgesac
810d466db85Smrgcase $srcdir in
811d466db85Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
812d466db85Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
813d466db85Smrgesac
814d466db85Smrg
815d466db85Smrg# Do `set' in a subshell so we don't clobber the current shell's
816d466db85Smrg# arguments.  Must try -L first in case configure is actually a
817d466db85Smrg# symlink; some systems play weird games with the mod time of symlinks
818d466db85Smrg# (eg FreeBSD returns the mod time of the symlink's containing
819d466db85Smrg# directory).
820d466db85Smrgif (
821d466db85Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
822d466db85Smrg   if test "$[*]" = "X"; then
823d466db85Smrg      # -L didn't work.
824d466db85Smrg      set X `ls -t "$srcdir/configure" conftest.file`
825d466db85Smrg   fi
826d466db85Smrg   rm -f conftest.file
827d466db85Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
828d466db85Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
829d466db85Smrg
830d466db85Smrg      # If neither matched, then we have a broken ls.  This can happen
831d466db85Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
832d466db85Smrg      # broken ls alias from the environment.  This has actually
833d466db85Smrg      # happened.  Such a system could not be considered "sane".
834d466db85Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
835d466db85Smrgalias in your environment])
836d466db85Smrg   fi
837d466db85Smrg
838d466db85Smrg   test "$[2]" = conftest.file
839d466db85Smrg   )
840d466db85Smrgthen
841d466db85Smrg   # Ok.
842d466db85Smrg   :
843d838582fSmrgelse
844d466db85Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
845d466db85SmrgCheck your system clock])
846d838582fSmrgfi
847d466db85SmrgAC_MSG_RESULT(yes)])
848d838582fSmrg
849d466db85Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
850d838582fSmrg#
851d838582fSmrg# This file is free software; the Free Software Foundation
852d838582fSmrg# gives unlimited permission to copy and/or distribute it,
853d838582fSmrg# with or without modifications, as long as this notice is preserved.
854d838582fSmrg
855d466db85Smrg# serial 1
856d838582fSmrg
857d466db85Smrg# AM_SILENT_RULES([DEFAULT])
858d466db85Smrg# --------------------------
859d466db85Smrg# Enable less verbose build rules; with the default set to DEFAULT
860d466db85Smrg# (`yes' being less verbose, `no' or empty being verbose).
861d466db85SmrgAC_DEFUN([AM_SILENT_RULES],
862d466db85Smrg[AC_ARG_ENABLE([silent-rules],
863d466db85Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
864d466db85Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
865d466db85Smrgcase $enable_silent_rules in
866d466db85Smrgyes) AM_DEFAULT_VERBOSITY=0;;
867d466db85Smrgno)  AM_DEFAULT_VERBOSITY=1;;
868d466db85Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
869d466db85Smrgesac
870d466db85SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
871d466db85SmrgAM_BACKSLASH='\'
872d466db85SmrgAC_SUBST([AM_BACKSLASH])dnl
873d466db85Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
874d838582fSmrg])
875d838582fSmrg
876d838582fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
877d838582fSmrg#
878d838582fSmrg# This file is free software; the Free Software Foundation
879d838582fSmrg# gives unlimited permission to copy and/or distribute it,
880d838582fSmrg# with or without modifications, as long as this notice is preserved.
881d838582fSmrg
882d466db85Smrg# AM_PROG_INSTALL_STRIP
883d466db85Smrg# ---------------------
884d466db85Smrg# One issue with vendor `install' (even GNU) is that you can't
885d466db85Smrg# specify the program used to strip binaries.  This is especially
886d466db85Smrg# annoying in cross-compiling environments, where the build's strip
887d466db85Smrg# is unlikely to handle the host's binaries.
888d466db85Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
889d466db85Smrg# always use install-sh in `make install-strip', and initialize
890d466db85Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
891d466db85SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
892d466db85Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
893d466db85Smrg# Installed binaries are usually stripped using `strip' when the user
894d466db85Smrg# run `make install-strip'.  However `strip' might not be the right
895d466db85Smrg# tool to use in cross-compilation environments, therefore Automake
896d466db85Smrg# will honor the `STRIP' environment variable to overrule this program.
897d466db85Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
898d466db85Smrgif test "$cross_compiling" != no; then
899d466db85Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
900d466db85Smrgfi
901d466db85SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
902d466db85SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
903d838582fSmrg
904d466db85Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
905d838582fSmrg#
906d838582fSmrg# This file is free software; the Free Software Foundation
907d838582fSmrg# gives unlimited permission to copy and/or distribute it,
908d838582fSmrg# with or without modifications, as long as this notice is preserved.
909d838582fSmrg
910d838582fSmrg# serial 2
911d838582fSmrg
912d838582fSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
913d838582fSmrg# ---------------------------
914d838582fSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
915d838582fSmrg# This macro is traced by Automake.
916d838582fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
917d838582fSmrg
918d466db85Smrg# AM_SUBST_NOTMAKE(VARIABLE)
919d466db85Smrg# ---------------------------
920d466db85Smrg# Public sister of _AM_SUBST_NOTMAKE.
921d466db85SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
922d466db85Smrg
923d838582fSmrg# Check how to create a tarball.                            -*- Autoconf -*-
924d838582fSmrg
925d838582fSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
926d838582fSmrg#
927d838582fSmrg# This file is free software; the Free Software Foundation
928d838582fSmrg# gives unlimited permission to copy and/or distribute it,
929d838582fSmrg# with or without modifications, as long as this notice is preserved.
930d838582fSmrg
931d838582fSmrg# serial 2
932d838582fSmrg
933d838582fSmrg# _AM_PROG_TAR(FORMAT)
934d838582fSmrg# --------------------
935d838582fSmrg# Check how to create a tarball in format FORMAT.
936d838582fSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
937d838582fSmrg#
938d838582fSmrg# Substitute a variable $(am__tar) that is a command
939d838582fSmrg# writing to stdout a FORMAT-tarball containing the directory
940d838582fSmrg# $tardir.
941d838582fSmrg#     tardir=directory && $(am__tar) > result.tar
942d838582fSmrg#
943d838582fSmrg# Substitute a variable $(am__untar) that extract such
944d838582fSmrg# a tarball read from stdin.
945d838582fSmrg#     $(am__untar) < result.tar
946d838582fSmrgAC_DEFUN([_AM_PROG_TAR],
947d838582fSmrg[# Always define AMTAR for backward compatibility.
948d838582fSmrgAM_MISSING_PROG([AMTAR], [tar])
949d838582fSmrgm4_if([$1], [v7],
950d838582fSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
951d838582fSmrg     [m4_case([$1], [ustar],, [pax],,
952d838582fSmrg              [m4_fatal([Unknown tar format])])
953d838582fSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
954d838582fSmrg# Loop over all known methods to create a tar archive until one works.
955d838582fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
956d838582fSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
957d838582fSmrg# Do not fold the above two line into one, because Tru64 sh and
958d838582fSmrg# Solaris sh will not grok spaces in the rhs of `-'.
959d838582fSmrgfor _am_tool in $_am_tools
960d838582fSmrgdo
961d838582fSmrg  case $_am_tool in
962d838582fSmrg  gnutar)
963d838582fSmrg    for _am_tar in tar gnutar gtar;
964d838582fSmrg    do
965d838582fSmrg      AM_RUN_LOG([$_am_tar --version]) && break
966d838582fSmrg    done
967d838582fSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
968d838582fSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
969d838582fSmrg    am__untar="$_am_tar -xf -"
970d838582fSmrg    ;;
971d838582fSmrg  plaintar)
972d838582fSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
973d838582fSmrg    # ustar tarball either.
974d838582fSmrg    (tar --version) >/dev/null 2>&1 && continue
975d838582fSmrg    am__tar='tar chf - "$$tardir"'
976d838582fSmrg    am__tar_='tar chf - "$tardir"'
977d838582fSmrg    am__untar='tar xf -'
978d838582fSmrg    ;;
979d838582fSmrg  pax)
980d838582fSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
981d838582fSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
982d838582fSmrg    am__untar='pax -r'
983d838582fSmrg    ;;
984d838582fSmrg  cpio)
985d838582fSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
986d838582fSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987d838582fSmrg    am__untar='cpio -i -H $1 -d'
988d838582fSmrg    ;;
989d838582fSmrg  none)
990d838582fSmrg    am__tar=false
991d838582fSmrg    am__tar_=false
992d838582fSmrg    am__untar=false
993d838582fSmrg    ;;
994d838582fSmrg  esac
995d838582fSmrg
996d838582fSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
997d838582fSmrg  # and am__untar set.
998d838582fSmrg  test -n "${am_cv_prog_tar_$1}" && break
999d838582fSmrg
1000d838582fSmrg  # tar/untar a dummy directory, and stop if the command works
1001d838582fSmrg  rm -rf conftest.dir
1002d838582fSmrg  mkdir conftest.dir
1003d838582fSmrg  echo GrepMe > conftest.dir/file
1004d838582fSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1005d838582fSmrg  rm -rf conftest.dir
1006d838582fSmrg  if test -s conftest.tar; then
1007d838582fSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1008d838582fSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1009d838582fSmrg  fi
1010d838582fSmrgdone
1011d838582fSmrgrm -rf conftest.dir
1012d838582fSmrg
1013d838582fSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1014d838582fSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1015d838582fSmrgAC_SUBST([am__tar])
1016d838582fSmrgAC_SUBST([am__untar])
1017d838582fSmrg]) # _AM_PROG_TAR
1018d838582fSmrg
1019d466db85Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1020d466db85Smrgdnl
10211cca5e29Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1022d466db85Smrgdnl 
1023d466db85Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10241cca5e29Smrgdnl copy of this software and associated documentation files (the "Software"),
10251cca5e29Smrgdnl to deal in the Software without restriction, including without limitation
10261cca5e29Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
10271cca5e29Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
10281cca5e29Smrgdnl Software is furnished to do so, subject to the following conditions:
1029d466db85Smrgdnl
10301cca5e29Smrgdnl The above copyright notice and this permission notice (including the next
10311cca5e29Smrgdnl paragraph) shall be included in all copies or substantial portions of the
10321cca5e29Smrgdnl Software.
1033d466db85Smrgdnl
10341cca5e29Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10351cca5e29Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10361cca5e29Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
10371cca5e29Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10381cca5e29Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
10391cca5e29Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
10401cca5e29Smrgdnl DEALINGS IN THE SOFTWARE.
1041d466db85Smrg
1042d466db85Smrg# XORG_MACROS_VERSION(required-version)
1043d466db85Smrg# -------------------------------------
1044d466db85Smrg# Minimum version: 1.1.0
1045d466db85Smrg#
1046d466db85Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1047d466db85Smrg# your configure.ac with the minimum required version, such as:
1048d466db85Smrg# XORG_MACROS_VERSION(1.1)
1049d466db85Smrg#
1050d466db85Smrg# To ensure that this macro is defined, also add:
1051d466db85Smrg# m4_ifndef([XORG_MACROS_VERSION],
1052d466db85Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1053d466db85Smrg#
1054d466db85Smrg#
1055d466db85Smrg# See the "minimum version" comment for each macro you use to see what 
1056d466db85Smrg# version you require.
1057d466db85Smrgm4_defun([XORG_MACROS_VERSION],[
10581cca5e29Smrgm4_define([vers_have], [1.11.0])
1059d466db85Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1060d466db85Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1061d466db85Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1062d466db85Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1063d466db85Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1064d466db85Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1065d466db85Smrgm4_undefine([vers_have])
1066d466db85Smrgm4_undefine([maj_have])
1067d466db85Smrgm4_undefine([maj_needed])
1068d466db85Smrg]) # XORG_MACROS_VERSION
1069d466db85Smrg
1070d466db85Smrg# XORG_PROG_RAWCPP()
1071d466db85Smrg# ------------------
1072d466db85Smrg# Minimum version: 1.0.0
1073d466db85Smrg#
1074d466db85Smrg# Find cpp program and necessary flags for use in pre-processing text files
1075d466db85Smrg# such as man pages and config files
1076d466db85SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1077d466db85SmrgAC_REQUIRE([AC_PROG_CPP])
1078d466db85SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1079d466db85Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1080d466db85Smrg
1081d466db85Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1082d466db85Smrg# which is not the best choice for supporting other OS'es, but covers most
1083d466db85Smrg# of the ones we need for now.
1084d466db85SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1085d466db85SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1086d466db85Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1087d466db85Smrg	AC_MSG_RESULT([no])
1088d466db85Smrgelse
1089d466db85Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1090d466db85Smrg		RAWCPPFLAGS=-undef
1091d466db85Smrg		AC_MSG_RESULT([yes])
1092d466db85Smrg	# under Cygwin unix is still defined even with -undef
1093d466db85Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1094d466db85Smrg		RAWCPPFLAGS="-undef -ansi"
1095d466db85Smrg		AC_MSG_RESULT([yes, with -ansi])
1096d466db85Smrg	else
1097d466db85Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1098d466db85Smrg	fi
1099d466db85Smrgfi
1100d466db85Smrgrm -f conftest.$ac_ext
1101d466db85Smrg
1102d466db85SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1103d466db85SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1104d466db85Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1105d466db85Smrg	AC_MSG_RESULT([no])
1106d466db85Smrgelse
1107d466db85Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1108d466db85Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1109d466db85Smrg		AC_MSG_RESULT([yes])
1110d466db85Smrg	else
1111d466db85Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1112d466db85Smrg	fi
1113d466db85Smrgfi
1114d466db85Smrgrm -f conftest.$ac_ext
1115d466db85SmrgAC_SUBST(RAWCPPFLAGS)
1116d466db85Smrg]) # XORG_PROG_RAWCPP
1117d466db85Smrg
1118d466db85Smrg# XORG_MANPAGE_SECTIONS()
1119d466db85Smrg# -----------------------
1120d466db85Smrg# Minimum version: 1.0.0
1121d466db85Smrg#
1122d466db85Smrg# Determine which sections man pages go in for the different man page types
1123d466db85Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1124d466db85Smrg# Not sure if there's any better way than just hardcoding by OS name.
1125d466db85Smrg# Override default settings by setting environment variables
11261cca5e29Smrg# Added MAN_SUBSTS in version 1.8
11271cca5e29Smrg# Added AC_PROG_SED in version 1.8
1128d466db85Smrg
1129d466db85SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1130d466db85SmrgAC_REQUIRE([AC_CANONICAL_HOST])
11311cca5e29SmrgAC_REQUIRE([AC_PROG_SED])
1132d466db85Smrg
1133d466db85Smrgif test x$APP_MAN_SUFFIX = x    ; then
1134d466db85Smrg    APP_MAN_SUFFIX=1
1135d466db85Smrgfi
1136d466db85Smrgif test x$APP_MAN_DIR = x    ; then
1137d466db85Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1138d466db85Smrgfi
1139d466db85Smrg
1140d466db85Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1141d466db85Smrg    LIB_MAN_SUFFIX=3
1142d466db85Smrgfi
1143d466db85Smrgif test x$LIB_MAN_DIR = x    ; then
1144d466db85Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1145d466db85Smrgfi
1146d466db85Smrg
1147d466db85Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1148d466db85Smrg    case $host_os in
1149d466db85Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1150d466db85Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1151d466db85Smrg    esac
1152d466db85Smrgfi
1153d466db85Smrgif test x$FILE_MAN_DIR = x    ; then
1154d466db85Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1155d466db85Smrgfi
1156d466db85Smrg
1157d466db85Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1158d466db85Smrg    case $host_os in
1159d466db85Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1160d466db85Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1161d466db85Smrg    esac
1162d466db85Smrgfi
1163d466db85Smrgif test x$MISC_MAN_DIR = x    ; then
1164d466db85Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1165d466db85Smrgfi
1166d466db85Smrg
1167d466db85Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1168d466db85Smrg    case $host_os in
1169d466db85Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1170d466db85Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1171d466db85Smrg    esac
1172d466db85Smrgfi
1173d466db85Smrgif test x$DRIVER_MAN_DIR = x    ; then
1174d466db85Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1175d466db85Smrgfi
1176d466db85Smrg
1177d466db85Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1178d466db85Smrg    case $host_os in
1179d466db85Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1180d466db85Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1181d466db85Smrg    esac
1182d466db85Smrgfi
1183d466db85Smrgif test x$ADMIN_MAN_DIR = x    ; then
1184d466db85Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1185d466db85Smrgfi
1186d466db85Smrg
1187d466db85Smrg
1188d466db85SmrgAC_SUBST([APP_MAN_SUFFIX])
1189d466db85SmrgAC_SUBST([LIB_MAN_SUFFIX])
1190d466db85SmrgAC_SUBST([FILE_MAN_SUFFIX])
1191d466db85SmrgAC_SUBST([MISC_MAN_SUFFIX])
1192d466db85SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1193d466db85SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1194d466db85SmrgAC_SUBST([APP_MAN_DIR])
1195d466db85SmrgAC_SUBST([LIB_MAN_DIR])
1196d466db85SmrgAC_SUBST([FILE_MAN_DIR])
1197d466db85SmrgAC_SUBST([MISC_MAN_DIR])
1198d466db85SmrgAC_SUBST([DRIVER_MAN_DIR])
1199d466db85SmrgAC_SUBST([ADMIN_MAN_DIR])
12001cca5e29Smrg
12011cca5e29SmrgXORG_MAN_PAGE="X Version 11"
12021cca5e29SmrgAC_SUBST([XORG_MAN_PAGE])
12031cca5e29SmrgMAN_SUBSTS="\
12041cca5e29Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12051cca5e29Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12061cca5e29Smrg	-e 's|__xservername__|Xorg|g' \
12071cca5e29Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
12081cca5e29Smrg	-e 's|__projectroot__|\$(prefix)|g' \
12091cca5e29Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
12101cca5e29Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
12111cca5e29Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
12121cca5e29Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
12131cca5e29Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
12141cca5e29Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
12151cca5e29Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
12161cca5e29SmrgAC_SUBST([MAN_SUBSTS])
12171cca5e29Smrg
1218d466db85Smrg]) # XORG_MANPAGE_SECTIONS
1219d466db85Smrg
12201cca5e29Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
12211cca5e29Smrg# ------------------------
12221cca5e29Smrg# Minimum version: 1.7.0
12231cca5e29Smrg#
12241cca5e29Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
12251cca5e29Smrg# provided by xorg-sgml-doctools, if installed.
12261cca5e29SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
12271cca5e29SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
12281cca5e29SmrgXORG_SGML_PATH=
12291cca5e29SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
12301cca5e29Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
12311cca5e29Smrg    [m4_ifval([$1],[:],
12321cca5e29Smrg        [if test x"$cross_compiling" != x"yes" ; then
12331cca5e29Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
12341cca5e29Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
12351cca5e29Smrg         fi])
12361cca5e29Smrg    ])
12371cca5e29Smrg
12381cca5e29Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
12391cca5e29Smrg# the path and the name of the doc stylesheet
12401cca5e29Smrgif test "x$XORG_SGML_PATH" != "x" ; then
12411cca5e29Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
12421cca5e29Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
12431cca5e29Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
12441cca5e29Smrgelse
12451cca5e29Smrg   AC_MSG_RESULT([no])
12461cca5e29Smrgfi
12471cca5e29Smrg
12481cca5e29SmrgAC_SUBST(XORG_SGML_PATH)
12491cca5e29SmrgAC_SUBST(STYLESHEET_SRCDIR)
12501cca5e29SmrgAC_SUBST(XSL_STYLESHEET)
12511cca5e29SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
12521cca5e29Smrg]) # XORG_CHECK_SGML_DOCTOOLS
12531cca5e29Smrg
1254d466db85Smrg# XORG_CHECK_LINUXDOC
1255d466db85Smrg# -------------------
1256d466db85Smrg# Minimum version: 1.0.0
1257d466db85Smrg#
1258d466db85Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1259d466db85Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1260d466db85Smrg# Whether or not the necessary tools and files are found can be checked
1261d466db85Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1262d466db85SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12631cca5e29SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
12641cca5e29SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1265d466db85Smrg
1266d466db85SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1267d466db85Smrg
12681cca5e29SmrgAC_MSG_CHECKING([whether to build documentation])
1269d466db85Smrg
12701cca5e29Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1271d466db85Smrg   BUILDDOC=yes
1272d466db85Smrgelse
1273d466db85Smrg   BUILDDOC=no
1274d466db85Smrgfi
1275d466db85Smrg
1276d466db85SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1277d466db85Smrg
1278d466db85SmrgAC_MSG_RESULT([$BUILDDOC])
1279d466db85Smrg
12801cca5e29SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1281d466db85Smrg
12821cca5e29Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1283d466db85Smrg   BUILDPDFDOC=yes
1284d466db85Smrgelse
1285d466db85Smrg   BUILDPDFDOC=no
1286d466db85Smrgfi
1287d466db85Smrg
1288d466db85SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1289d466db85Smrg
1290d466db85SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1291d466db85Smrg
12921cca5e29SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1293d466db85SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1294d466db85SmrgMAKE_PDF="$PS2PDF"
1295d466db85SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1296d466db85Smrg
1297d466db85SmrgAC_SUBST(MAKE_TEXT)
1298d466db85SmrgAC_SUBST(MAKE_PS)
1299d466db85SmrgAC_SUBST(MAKE_PDF)
1300d466db85SmrgAC_SUBST(MAKE_HTML)
1301d466db85Smrg]) # XORG_CHECK_LINUXDOC
1302d466db85Smrg
1303d466db85Smrg# XORG_CHECK_DOCBOOK
1304d466db85Smrg# -------------------
1305d466db85Smrg# Minimum version: 1.0.0
1306d466db85Smrg#
1307d466db85Smrg# Checks for the ability to build output formats from SGML DocBook source.
1308d466db85Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1309d466db85Smrg# indicates whether the necessary tools and files are found and, if set,
1310d466db85Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1311d466db85SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
13121cca5e29SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
13131cca5e29Smrg
1314d466db85SmrgBUILDTXTDOC=no
1315d466db85SmrgBUILDPDFDOC=no
1316d466db85SmrgBUILDPSDOC=no
1317d466db85SmrgBUILDHTMLDOC=no
1318d466db85Smrg
1319d466db85SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1320d466db85SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1321d466db85SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1322d466db85SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1323d466db85Smrg
13241cca5e29SmrgAC_MSG_CHECKING([whether to build text documentation])
13251cca5e29Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1326d466db85Smrg   test x$BUILD_TXTDOC != xno; then
1327d466db85Smrg	BUILDTXTDOC=yes
1328d466db85Smrgfi
1329d466db85SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1330d466db85SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1331d466db85Smrg
13321cca5e29SmrgAC_MSG_CHECKING([whether to build PDF documentation])
13331cca5e29Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1334d466db85Smrg   test x$BUILD_PDFDOC != xno; then
1335d466db85Smrg	BUILDPDFDOC=yes
1336d466db85Smrgfi
1337d466db85SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1338d466db85SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1339d466db85Smrg
13401cca5e29SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
13411cca5e29Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1342d466db85Smrg   test x$BUILD_PSDOC != xno; then
1343d466db85Smrg	BUILDPSDOC=yes
1344d466db85Smrgfi
1345d466db85SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1346d466db85SmrgAC_MSG_RESULT([$BUILDPSDOC])
1347d466db85Smrg
13481cca5e29SmrgAC_MSG_CHECKING([whether to build HTML documentation])
13491cca5e29Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1350d466db85Smrg   test x$BUILD_HTMLDOC != xno; then
1351d466db85Smrg	BUILDHTMLDOC=yes
1352d466db85Smrgfi
1353d466db85SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1354d466db85SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1355d466db85Smrg
1356d466db85SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1357d466db85SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1358d466db85SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1359d466db85SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1360d466db85Smrg
1361d466db85SmrgAC_SUBST(MAKE_TEXT)
1362d466db85SmrgAC_SUBST(MAKE_PS)
1363d466db85SmrgAC_SUBST(MAKE_PDF)
1364d466db85SmrgAC_SUBST(MAKE_HTML)
1365d466db85Smrg]) # XORG_CHECK_DOCBOOK
1366d466db85Smrg
13671cca5e29Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
13681cca5e29Smrg# ----------------
13691cca5e29Smrg# Minimum version: 1.5.0
13701cca5e29Smrg# Minimum version for optional DEFAULT argument: 1.11.0
13711cca5e29Smrg#
13721cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes
13731cca5e29Smrg# not at the appropriate level. This macro enables a module to test for the
13741cca5e29Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
13751cca5e29Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
13761cca5e29Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
13771cca5e29Smrg# --with-xmlto assumes 'auto'.
13781cca5e29Smrg#
13791cca5e29Smrg# Interface to module:
13801cca5e29Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
13811cca5e29Smrg# XMLTO:	returns the path of the xmlto program found
13821cca5e29Smrg#		returns the path set by the user in the environment
13831cca5e29Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
13841cca5e29Smrg#		'no' user instructs the module not to use xmlto
13851cca5e29Smrg#
13861cca5e29Smrg# Added in version 1.10.0
13871cca5e29Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
13881cca5e29Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
13891cca5e29Smrg#
13901cca5e29Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
13911cca5e29Smrg#
13921cca5e29SmrgAC_DEFUN([XORG_WITH_XMLTO],[
13931cca5e29SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
13941cca5e29Smrgm4_define([_defopt], m4_default([$2], [auto]))
13951cca5e29SmrgAC_ARG_WITH(xmlto,
13961cca5e29Smrg	AS_HELP_STRING([--with-xmlto],
13971cca5e29Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
13981cca5e29Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
13991cca5e29Smrgm4_undefine([_defopt])
14001cca5e29Smrg
14011cca5e29Smrgif test "x$use_xmlto" = x"auto"; then
14021cca5e29Smrg   AC_PATH_PROG([XMLTO], [xmlto])
14031cca5e29Smrg   if test "x$XMLTO" = "x"; then
14041cca5e29Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
14051cca5e29Smrg	have_xmlto=no
14061cca5e29Smrg   else
14071cca5e29Smrg        have_xmlto=yes
14081cca5e29Smrg   fi
14091cca5e29Smrgelif test "x$use_xmlto" = x"yes" ; then
14101cca5e29Smrg   AC_PATH_PROG([XMLTO], [xmlto])
14111cca5e29Smrg   if test "x$XMLTO" = "x"; then
14121cca5e29Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
14131cca5e29Smrg   fi
14141cca5e29Smrg   have_xmlto=yes
14151cca5e29Smrgelif test "x$use_xmlto" = x"no" ; then
14161cca5e29Smrg   if test "x$XMLTO" != "x"; then
14171cca5e29Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
14181cca5e29Smrg   fi
14191cca5e29Smrg   have_xmlto=no
14201cca5e29Smrgelse
14211cca5e29Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
14221cca5e29Smrgfi
14231cca5e29Smrg
14241cca5e29Smrg# Test for a minimum version of xmlto, if provided.
14251cca5e29Smrgm4_ifval([$1],
14261cca5e29Smrg[if test "$have_xmlto" = yes; then
14271cca5e29Smrg    # scrape the xmlto version
14281cca5e29Smrg    AC_MSG_CHECKING([the xmlto version])
14291cca5e29Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
14301cca5e29Smrg    AC_MSG_RESULT([$xmlto_version])
14311cca5e29Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
14321cca5e29Smrg        [if test "x$use_xmlto" = xauto; then
14331cca5e29Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
14341cca5e29Smrg            have_xmlto=no
14351cca5e29Smrg        else
14361cca5e29Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
14371cca5e29Smrg        fi])
14381cca5e29Smrgfi])
14391cca5e29Smrg
14401cca5e29Smrg# Test for the ability of xmlto to generate a text target
14411cca5e29Smrghave_xmlto_text=no
14421cca5e29Smrgcat > conftest.xml << "EOF"
14431cca5e29SmrgEOF
14441cca5e29SmrgAS_IF([test "$have_xmlto" = yes],
14451cca5e29Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
14461cca5e29Smrg             [have_xmlto_text=yes],
14471cca5e29Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
14481cca5e29Smrgrm -f conftest.xml
14491cca5e29SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
14501cca5e29SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
14511cca5e29Smrg]) # XORG_WITH_XMLTO
14521cca5e29Smrg
14531cca5e29Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
14541cca5e29Smrg# ----------------
14551cca5e29Smrg# Minimum version: 1.5.0
14561cca5e29Smrg# Minimum version for optional DEFAULT argument: 1.11.0
14571cca5e29Smrg#
14581cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes
14591cca5e29Smrg# not at the appropriate level. This macro enables a module to test for the
14601cca5e29Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
14611cca5e29Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
14621cca5e29Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
14631cca5e29Smrg# --with-asciidoc assumes 'auto'.
14641cca5e29Smrg#
14651cca5e29Smrg# Interface to module:
14661cca5e29Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
14671cca5e29Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
14681cca5e29Smrg#		 returns the path set by the user in the environment
14691cca5e29Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
14701cca5e29Smrg#		  'no' user instructs the module not to use asciidoc
14711cca5e29Smrg#
14721cca5e29Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
14731cca5e29Smrg#
14741cca5e29SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
14751cca5e29SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
14761cca5e29Smrgm4_define([_defopt], m4_default([$2], [auto]))
14771cca5e29SmrgAC_ARG_WITH(asciidoc,
14781cca5e29Smrg	AS_HELP_STRING([--with-asciidoc],
14791cca5e29Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
14801cca5e29Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
14811cca5e29Smrgm4_undefine([_defopt])
14821cca5e29Smrg
14831cca5e29Smrgif test "x$use_asciidoc" = x"auto"; then
14841cca5e29Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
14851cca5e29Smrg   if test "x$ASCIIDOC" = "x"; then
14861cca5e29Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
14871cca5e29Smrg	have_asciidoc=no
14881cca5e29Smrg   else
14891cca5e29Smrg        have_asciidoc=yes
14901cca5e29Smrg   fi
14911cca5e29Smrgelif test "x$use_asciidoc" = x"yes" ; then
14921cca5e29Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
14931cca5e29Smrg   if test "x$ASCIIDOC" = "x"; then
14941cca5e29Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
14951cca5e29Smrg   fi
14961cca5e29Smrg   have_asciidoc=yes
14971cca5e29Smrgelif test "x$use_asciidoc" = x"no" ; then
14981cca5e29Smrg   if test "x$ASCIIDOC" != "x"; then
14991cca5e29Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
15001cca5e29Smrg   fi
15011cca5e29Smrg   have_asciidoc=no
15021cca5e29Smrgelse
15031cca5e29Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
15041cca5e29Smrgfi
15051cca5e29Smrgm4_ifval([$1],
15061cca5e29Smrg[if test "$have_asciidoc" = yes; then
15071cca5e29Smrg    # scrape the asciidoc version
15081cca5e29Smrg    AC_MSG_CHECKING([the asciidoc version])
15091cca5e29Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
15101cca5e29Smrg    AC_MSG_RESULT([$asciidoc_version])
15111cca5e29Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
15121cca5e29Smrg        [if test "x$use_asciidoc" = xauto; then
15131cca5e29Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
15141cca5e29Smrg            have_asciidoc=no
15151cca5e29Smrg        else
15161cca5e29Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
15171cca5e29Smrg        fi])
15181cca5e29Smrgfi])
15191cca5e29SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
15201cca5e29Smrg]) # XORG_WITH_ASCIIDOC
15211cca5e29Smrg
15221cca5e29Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
15231cca5e29Smrg# --------------------------------
15241cca5e29Smrg# Minimum version: 1.5.0
15251cca5e29Smrg# Minimum version for optional DEFAULT argument: 1.11.0
15261cca5e29Smrg#
15271cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes
15281cca5e29Smrg# not at the appropriate level. This macro enables a module to test for the
15291cca5e29Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
15301cca5e29Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
15311cca5e29Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
15321cca5e29Smrg# --with-doxygen assumes 'auto'.
15331cca5e29Smrg#
15341cca5e29Smrg# Interface to module:
15351cca5e29Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
15361cca5e29Smrg# DOXYGEN:	 returns the path of the doxygen program found
15371cca5e29Smrg#		 returns the path set by the user in the environment
15381cca5e29Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
15391cca5e29Smrg#		  'no' user instructs the module not to use doxygen
15401cca5e29Smrg#
15411cca5e29Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
15421cca5e29Smrg#
15431cca5e29SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
15441cca5e29SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
15451cca5e29Smrgm4_define([_defopt], m4_default([$2], [auto]))
15461cca5e29SmrgAC_ARG_WITH(doxygen,
15471cca5e29Smrg	AS_HELP_STRING([--with-doxygen],
15481cca5e29Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
15491cca5e29Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
15501cca5e29Smrgm4_undefine([_defopt])
15511cca5e29Smrg
15521cca5e29Smrgif test "x$use_doxygen" = x"auto"; then
15531cca5e29Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15541cca5e29Smrg   if test "x$DOXYGEN" = "x"; then
15551cca5e29Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
15561cca5e29Smrg	have_doxygen=no
15571cca5e29Smrg   else
15581cca5e29Smrg        have_doxygen=yes
15591cca5e29Smrg   fi
15601cca5e29Smrgelif test "x$use_doxygen" = x"yes" ; then
15611cca5e29Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15621cca5e29Smrg   if test "x$DOXYGEN" = "x"; then
15631cca5e29Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
15641cca5e29Smrg   fi
15651cca5e29Smrg   have_doxygen=yes
15661cca5e29Smrgelif test "x$use_doxygen" = x"no" ; then
15671cca5e29Smrg   if test "x$DOXYGEN" != "x"; then
15681cca5e29Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
15691cca5e29Smrg   fi
15701cca5e29Smrg   have_doxygen=no
15711cca5e29Smrgelse
15721cca5e29Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
15731cca5e29Smrgfi
15741cca5e29Smrgm4_ifval([$1],
15751cca5e29Smrg[if test "$have_doxygen" = yes; then
15761cca5e29Smrg    # scrape the doxygen version
15771cca5e29Smrg    AC_MSG_CHECKING([the doxygen version])
15781cca5e29Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
15791cca5e29Smrg    AC_MSG_RESULT([$doxygen_version])
15801cca5e29Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
15811cca5e29Smrg        [if test "x$use_doxygen" = xauto; then
15821cca5e29Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
15831cca5e29Smrg            have_doxygen=no
15841cca5e29Smrg        else
15851cca5e29Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
15861cca5e29Smrg        fi])
15871cca5e29Smrgfi])
15881cca5e29SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
15891cca5e29Smrg]) # XORG_WITH_DOXYGEN
15901cca5e29Smrg
15911cca5e29Smrg# XORG_WITH_GROFF([DEFAULT])
15921cca5e29Smrg# ----------------
15931cca5e29Smrg# Minimum version: 1.6.0
15941cca5e29Smrg# Minimum version for optional DEFAULT argument: 1.11.0
15951cca5e29Smrg#
15961cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes
15971cca5e29Smrg# not at the appropriate level. This macro enables a module to test for the
15981cca5e29Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
15991cca5e29Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
16001cca5e29Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
16011cca5e29Smrg# --with-groff assumes 'auto'.
16021cca5e29Smrg#
16031cca5e29Smrg# Interface to module:
16041cca5e29Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
16051cca5e29Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
16061cca5e29Smrg# HAVE_GROFF_MS: the -ms macros package
16071cca5e29Smrg# GROFF:	 returns the path of the groff program found
16081cca5e29Smrg#		 returns the path set by the user in the environment
16091cca5e29Smrg# --with-groff:	 'yes' user instructs the module to use groff
16101cca5e29Smrg#		 'no' user instructs the module not to use groff
16111cca5e29Smrg#
16121cca5e29Smrg# Added in version 1.9.0:
16131cca5e29Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
16141cca5e29Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
16151cca5e29Smrg#		   psselect from the psutils package.
16161cca5e29Smrg#		   the ghostcript package. Refer to the grohtml man pages
16171cca5e29Smrg#
16181cca5e29Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
16191cca5e29Smrg#
16201cca5e29Smrg# OS and distros often splits groff in a basic and full package, the former
16211cca5e29Smrg# having the groff program and the later having devices, fonts and macros
16221cca5e29Smrg# Checking for the groff executable is not enough.
16231cca5e29Smrg#
16241cca5e29Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
16251cca5e29Smrg# unset HAVE_GROFF or GROFF env variables.
16261cca5e29Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
16271cca5e29Smrg#
16281cca5e29SmrgAC_DEFUN([XORG_WITH_GROFF],[
16291cca5e29SmrgAC_ARG_VAR([GROFF], [Path to groff command])
16301cca5e29Smrgm4_define([_defopt], m4_default([$1], [auto]))
16311cca5e29SmrgAC_ARG_WITH(groff,
16321cca5e29Smrg	AS_HELP_STRING([--with-groff],
16331cca5e29Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
16341cca5e29Smrg	   [use_groff=$withval], [use_groff=]_defopt)
16351cca5e29Smrgm4_undefine([_defopt])
16361cca5e29Smrg
16371cca5e29Smrgif test "x$use_groff" = x"auto"; then
16381cca5e29Smrg   AC_PATH_PROG([GROFF], [groff])
16391cca5e29Smrg   if test "x$GROFF" = "x"; then
16401cca5e29Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
16411cca5e29Smrg	have_groff=no
16421cca5e29Smrg   else
16431cca5e29Smrg        have_groff=yes
16441cca5e29Smrg   fi
16451cca5e29Smrgelif test "x$use_groff" = x"yes" ; then
16461cca5e29Smrg   AC_PATH_PROG([GROFF], [groff])
16471cca5e29Smrg   if test "x$GROFF" = "x"; then
16481cca5e29Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
16491cca5e29Smrg   fi
16501cca5e29Smrg   have_groff=yes
16511cca5e29Smrgelif test "x$use_groff" = x"no" ; then
16521cca5e29Smrg   if test "x$GROFF" != "x"; then
16531cca5e29Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
16541cca5e29Smrg   fi
16551cca5e29Smrg   have_groff=no
16561cca5e29Smrgelse
16571cca5e29Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
16581cca5e29Smrgfi
16591cca5e29Smrg
16601cca5e29Smrg# We have groff, test for the presence of the macro packages
16611cca5e29Smrgif test "x$have_groff" = x"yes"; then
16621cca5e29Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
16631cca5e29Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
16641cca5e29Smrg        groff_ms_works=yes
16651cca5e29Smrg    else
16661cca5e29Smrg        groff_ms_works=no
16671cca5e29Smrg    fi
16681cca5e29Smrg    AC_MSG_RESULT([$groff_ms_works])
16691cca5e29Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
16701cca5e29Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
16711cca5e29Smrg        groff_mm_works=yes
16721cca5e29Smrg    else
16731cca5e29Smrg        groff_mm_works=no
16741cca5e29Smrg    fi
16751cca5e29Smrg    AC_MSG_RESULT([$groff_mm_works])
16761cca5e29Smrgfi
16771cca5e29Smrg
16781cca5e29Smrg# We have groff, test for HTML dependencies, one command per package
16791cca5e29Smrgif test "x$have_groff" = x"yes"; then
16801cca5e29Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
16811cca5e29Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
16821cca5e29Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
16831cca5e29Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
16841cca5e29Smrg      have_groff_html=yes
16851cca5e29Smrg   else
16861cca5e29Smrg      have_groff_html=no
16871cca5e29Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
16881cca5e29Smrg   fi
16891cca5e29Smrgfi
16901cca5e29Smrg
16911cca5e29Smrg# Set Automake conditionals for Makefiles
16921cca5e29SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
16931cca5e29SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
16941cca5e29SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
16951cca5e29SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
16961cca5e29Smrg]) # XORG_WITH_GROFF
16971cca5e29Smrg
16981cca5e29Smrg# XORG_WITH_FOP([DEFAULT])
16991cca5e29Smrg# ----------------
17001cca5e29Smrg# Minimum version: 1.6.0
17011cca5e29Smrg# Minimum version for optional DEFAULT argument: 1.11.0
17021cca5e29Smrg#
17031cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes
17041cca5e29Smrg# not at the appropriate level. This macro enables a module to test for the
17051cca5e29Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
17061cca5e29Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
17071cca5e29Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
17081cca5e29Smrg# --with-fop assumes 'auto'.
17091cca5e29Smrg#
17101cca5e29Smrg# Interface to module:
17111cca5e29Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
17121cca5e29Smrg# FOP:	 	returns the path of the fop program found
17131cca5e29Smrg#		returns the path set by the user in the environment
17141cca5e29Smrg# --with-fop: 	'yes' user instructs the module to use fop
17151cca5e29Smrg#		'no' user instructs the module not to use fop
17161cca5e29Smrg#
17171cca5e29Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
17181cca5e29Smrg#
17191cca5e29SmrgAC_DEFUN([XORG_WITH_FOP],[
17201cca5e29SmrgAC_ARG_VAR([FOP], [Path to fop command])
17211cca5e29Smrgm4_define([_defopt], m4_default([$1], [auto]))
17221cca5e29SmrgAC_ARG_WITH(fop,
17231cca5e29Smrg	AS_HELP_STRING([--with-fop],
17241cca5e29Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
17251cca5e29Smrg	   [use_fop=$withval], [use_fop=]_defopt)
17261cca5e29Smrgm4_undefine([_defopt])
17271cca5e29Smrg
17281cca5e29Smrgif test "x$use_fop" = x"auto"; then
17291cca5e29Smrg   AC_PATH_PROG([FOP], [fop])
17301cca5e29Smrg   if test "x$FOP" = "x"; then
17311cca5e29Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
17321cca5e29Smrg	have_fop=no
17331cca5e29Smrg   else
17341cca5e29Smrg        have_fop=yes
17351cca5e29Smrg   fi
17361cca5e29Smrgelif test "x$use_fop" = x"yes" ; then
17371cca5e29Smrg   AC_PATH_PROG([FOP], [fop])
17381cca5e29Smrg   if test "x$FOP" = "x"; then
17391cca5e29Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
17401cca5e29Smrg   fi
17411cca5e29Smrg   have_fop=yes
17421cca5e29Smrgelif test "x$use_fop" = x"no" ; then
17431cca5e29Smrg   if test "x$FOP" != "x"; then
17441cca5e29Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
17451cca5e29Smrg   fi
17461cca5e29Smrg   have_fop=no
17471cca5e29Smrgelse
17481cca5e29Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
17491cca5e29Smrgfi
17501cca5e29SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
17511cca5e29Smrg]) # XORG_WITH_FOP
17521cca5e29Smrg
17531cca5e29Smrg# XORG_WITH_PS2PDF([DEFAULT])
17541cca5e29Smrg# ----------------
17551cca5e29Smrg# Minimum version: 1.6.0
17561cca5e29Smrg# Minimum version for optional DEFAULT argument: 1.11.0
17571cca5e29Smrg#
17581cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes
17591cca5e29Smrg# not at the appropriate level. This macro enables a module to test for the
17601cca5e29Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
17611cca5e29Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
17621cca5e29Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
17631cca5e29Smrg# --with-ps2pdf assumes 'auto'.
17641cca5e29Smrg#
17651cca5e29Smrg# Interface to module:
17661cca5e29Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
17671cca5e29Smrg# PS2PDF:	returns the path of the ps2pdf program found
17681cca5e29Smrg#		returns the path set by the user in the environment
17691cca5e29Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
17701cca5e29Smrg#		 'no' user instructs the module not to use ps2pdf
17711cca5e29Smrg#
17721cca5e29Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
17731cca5e29Smrg#
17741cca5e29SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
17751cca5e29SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
17761cca5e29Smrgm4_define([_defopt], m4_default([$1], [auto]))
17771cca5e29SmrgAC_ARG_WITH(ps2pdf,
17781cca5e29Smrg	AS_HELP_STRING([--with-ps2pdf],
17791cca5e29Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
17801cca5e29Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
17811cca5e29Smrgm4_undefine([_defopt])
17821cca5e29Smrg
17831cca5e29Smrgif test "x$use_ps2pdf" = x"auto"; then
17841cca5e29Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
17851cca5e29Smrg   if test "x$PS2PDF" = "x"; then
17861cca5e29Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
17871cca5e29Smrg	have_ps2pdf=no
17881cca5e29Smrg   else
17891cca5e29Smrg        have_ps2pdf=yes
17901cca5e29Smrg   fi
17911cca5e29Smrgelif test "x$use_ps2pdf" = x"yes" ; then
17921cca5e29Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
17931cca5e29Smrg   if test "x$PS2PDF" = "x"; then
17941cca5e29Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
17951cca5e29Smrg   fi
17961cca5e29Smrg   have_ps2pdf=yes
17971cca5e29Smrgelif test "x$use_ps2pdf" = x"no" ; then
17981cca5e29Smrg   if test "x$PS2PDF" != "x"; then
17991cca5e29Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
18001cca5e29Smrg   fi
18011cca5e29Smrg   have_ps2pdf=no
18021cca5e29Smrgelse
18031cca5e29Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
18041cca5e29Smrgfi
18051cca5e29SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
18061cca5e29Smrg]) # XORG_WITH_PS2PDF
18071cca5e29Smrg
18081cca5e29Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
18091cca5e29Smrg# ----------------
18101cca5e29Smrg# Minimum version: 1.6.0
18111cca5e29Smrg#
18121cca5e29Smrg# Documentation tools are not always available on all platforms and sometimes
18131cca5e29Smrg# not at the appropriate level. This macro enables a builder to skip all
18141cca5e29Smrg# documentation targets except traditional man pages.
18151cca5e29Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18161cca5e29Smrg# maximum flexibilty in controlling documentation building.
18171cca5e29Smrg# Refer to:
18181cca5e29Smrg# XORG_WITH_XMLTO         --with-xmlto
18191cca5e29Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18201cca5e29Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18211cca5e29Smrg# XORG_WITH_FOP           --with-fop
18221cca5e29Smrg# XORG_WITH_GROFF         --with-groff
18231cca5e29Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18241cca5e29Smrg#
18251cca5e29Smrg# Interface to module:
18261cca5e29Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
18271cca5e29Smrg# --enable-docs: 'yes' user instructs the module to generate docs
18281cca5e29Smrg#		 'no' user instructs the module not to generate docs
18291cca5e29Smrg# parm1:	specify the default value, yes or no.
18301cca5e29Smrg#
18311cca5e29SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
18321cca5e29Smrgm4_define([default], m4_default([$1], [yes]))
18331cca5e29SmrgAC_ARG_ENABLE(docs,
18341cca5e29Smrg	AS_HELP_STRING([--enable-docs],
18351cca5e29Smrg	   [Enable building the documentation (default: ]default[)]),
18361cca5e29Smrg	   [build_docs=$enableval], [build_docs=]default)
18371cca5e29Smrgm4_undefine([default])
18381cca5e29SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
18391cca5e29SmrgAC_MSG_CHECKING([whether to build documentation])
18401cca5e29SmrgAC_MSG_RESULT([$build_docs])
18411cca5e29Smrg]) # XORG_ENABLE_DOCS
18421cca5e29Smrg
18431cca5e29Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
18441cca5e29Smrg# ----------------
18451cca5e29Smrg# Minimum version: 1.6.0
18461cca5e29Smrg#
18471cca5e29Smrg# This macro enables a builder to skip all developer documentation.
18481cca5e29Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18491cca5e29Smrg# maximum flexibilty in controlling documentation building.
18501cca5e29Smrg# Refer to:
18511cca5e29Smrg# XORG_WITH_XMLTO         --with-xmlto
18521cca5e29Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18531cca5e29Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18541cca5e29Smrg# XORG_WITH_FOP           --with-fop
18551cca5e29Smrg# XORG_WITH_GROFF         --with-groff
18561cca5e29Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18571cca5e29Smrg#
18581cca5e29Smrg# Interface to module:
18591cca5e29Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
18601cca5e29Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
18611cca5e29Smrg#			'no' user instructs the module not to generate developer docs
18621cca5e29Smrg# parm1:		specify the default value, yes or no.
18631cca5e29Smrg#
18641cca5e29SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
18651cca5e29Smrgm4_define([devel_default], m4_default([$1], [yes]))
18661cca5e29SmrgAC_ARG_ENABLE(devel-docs,
18671cca5e29Smrg	AS_HELP_STRING([--enable-devel-docs],
18681cca5e29Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
18691cca5e29Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
18701cca5e29Smrgm4_undefine([devel_default])
18711cca5e29SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
18721cca5e29SmrgAC_MSG_CHECKING([whether to build developer documentation])
18731cca5e29SmrgAC_MSG_RESULT([$build_devel_docs])
18741cca5e29Smrg]) # XORG_ENABLE_DEVEL_DOCS
18751cca5e29Smrg
18761cca5e29Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
18771cca5e29Smrg# ----------------
18781cca5e29Smrg# Minimum version: 1.6.0
18791cca5e29Smrg#
18801cca5e29Smrg# This macro enables a builder to skip all functional specification targets.
18811cca5e29Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18821cca5e29Smrg# maximum flexibilty in controlling documentation building.
18831cca5e29Smrg# Refer to:
18841cca5e29Smrg# XORG_WITH_XMLTO         --with-xmlto
18851cca5e29Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18861cca5e29Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18871cca5e29Smrg# XORG_WITH_FOP           --with-fop
18881cca5e29Smrg# XORG_WITH_GROFF         --with-groff
18891cca5e29Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18901cca5e29Smrg#
18911cca5e29Smrg# Interface to module:
18921cca5e29Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
18931cca5e29Smrg# --enable-specs:	'yes' user instructs the module to generate specs
18941cca5e29Smrg#			'no' user instructs the module not to generate specs
18951cca5e29Smrg# parm1:		specify the default value, yes or no.
18961cca5e29Smrg#
18971cca5e29SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
18981cca5e29Smrgm4_define([spec_default], m4_default([$1], [yes]))
18991cca5e29SmrgAC_ARG_ENABLE(specs,
19001cca5e29Smrg	AS_HELP_STRING([--enable-specs],
19011cca5e29Smrg	   [Enable building the specs (default: ]spec_default[)]),
19021cca5e29Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
19031cca5e29Smrgm4_undefine([spec_default])
19041cca5e29SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
19051cca5e29SmrgAC_MSG_CHECKING([whether to build functional specifications])
19061cca5e29SmrgAC_MSG_RESULT([$build_specs])
19071cca5e29Smrg]) # XORG_ENABLE_SPECS
19081cca5e29Smrg
1909d466db85Smrg# XORG_CHECK_MALLOC_ZERO
1910d466db85Smrg# ----------------------
1911d466db85Smrg# Minimum version: 1.0.0
1912d466db85Smrg#
1913d466db85Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1914d466db85Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1915d466db85Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1916d466db85SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1917d466db85SmrgAC_ARG_ENABLE(malloc0returnsnull,
1918d466db85Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1919d466db85Smrg		       [malloc(0) returns NULL (default: auto)]),
1920d466db85Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1921d466db85Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1922d466db85Smrg
1923d466db85SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1924d466db85Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1925d466db85Smrg	AC_RUN_IFELSE([
1926d466db85Smrgchar *malloc();
1927d466db85Smrgchar *realloc();
1928d466db85Smrgchar *calloc();
1929d466db85Smrgmain() {
1930d466db85Smrg    char *m0, *r0, *c0, *p;
1931d466db85Smrg    m0 = malloc(0);
1932d466db85Smrg    p = malloc(10);
1933d466db85Smrg    r0 = realloc(p,0);
1934d466db85Smrg    c0 = calloc(0);
1935d466db85Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1936d466db85Smrg}],
1937d466db85Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
19381cca5e29Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
19391cca5e29Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1940d466db85Smrgfi
1941d466db85SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1942d466db85Smrg
1943d466db85Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1944d466db85Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1945d466db85Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1946d466db85Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1947d466db85Smrgelse
1948d466db85Smrg	MALLOC_ZERO_CFLAGS=""
1949d466db85Smrg	XMALLOC_ZERO_CFLAGS=""
1950d466db85Smrg	XTMALLOC_ZERO_CFLAGS=""
1951d466db85Smrgfi
1952d466db85Smrg
1953d466db85SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1954d466db85SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1955d466db85SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1956d466db85Smrg]) # XORG_CHECK_MALLOC_ZERO
1957d466db85Smrg
1958d466db85Smrg# XORG_WITH_LINT()
1959d466db85Smrg# ----------------
1960d466db85Smrg# Minimum version: 1.1.0
1961d466db85Smrg#
19621cca5e29Smrg# This macro enables the use of a tool that flags some suspicious and
19631cca5e29Smrg# non-portable constructs (likely to be bugs) in C language source code.
19641cca5e29Smrg# It will attempt to locate the tool and use appropriate options.
19651cca5e29Smrg# There are various lint type tools on different platforms.
19661cca5e29Smrg#
19671cca5e29Smrg# Interface to module:
19681cca5e29Smrg# LINT:		returns the path to the tool found on the platform
19691cca5e29Smrg#		or the value set to LINT on the configure cmd line
19701cca5e29Smrg#		also an Automake conditional
19711cca5e29Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
19721cca5e29Smrg#
19731cca5e29Smrg# --with-lint:	'yes' user instructs the module to use lint
19741cca5e29Smrg#		'no' user instructs the module not to use lint (default)
19751cca5e29Smrg#
19761cca5e29Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
19771cca5e29Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1978d466db85Smrg#
1979d466db85SmrgAC_DEFUN([XORG_WITH_LINT],[
1980d466db85Smrg
19811cca5e29SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
19821cca5e29SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1983d466db85SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1984d466db85Smrg		[Use a lint-style source code checker (default: disabled)])],
1985d466db85Smrg		[use_lint=$withval], [use_lint=no])
19861cca5e29Smrg
19871cca5e29Smrg# Obtain platform specific info like program name and options
19881cca5e29Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
19891cca5e29Smrgcase $host_os in
19901cca5e29Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
19911cca5e29Smrg	lint_name=splint
19921cca5e29Smrg	lint_options="-badflag"
19931cca5e29Smrg	;;
19941cca5e29Smrg  *freebsd* | *netbsd*)
19951cca5e29Smrg	lint_name=lint
19961cca5e29Smrg	lint_options="-u -b"
19971cca5e29Smrg	;;
19981cca5e29Smrg  *solaris*)
19991cca5e29Smrg	lint_name=lint
20001cca5e29Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
20011cca5e29Smrg	;;
20021cca5e29Smrgesac
20031cca5e29Smrg
20041cca5e29Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
20051cca5e29Smrgif test "x$use_lint" = x"yes" ; then
20061cca5e29Smrg   AC_PATH_PROG([LINT], [$lint_name])
20071cca5e29Smrg   if test "x$LINT" = "x"; then
20081cca5e29Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
20091cca5e29Smrg   fi
20101cca5e29Smrgelif test "x$use_lint" = x"no" ; then
20111cca5e29Smrg   if test "x$LINT" != "x"; then
20121cca5e29Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
20131cca5e29Smrg   fi
2014d466db85Smrgelse
20151cca5e29Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2016d466db85Smrgfi
20171cca5e29Smrg
20181cca5e29Smrg# User supplied flags override default flags
20191cca5e29Smrgif test "x$LINT_FLAGS" != "x"; then
20201cca5e29Smrg   lint_options=$LINT_FLAGS
2021d466db85Smrgfi
2022d466db85Smrg
20231cca5e29SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
20241cca5e29SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2025d466db85Smrg
2026d466db85Smrg]) # XORG_WITH_LINT
2027d466db85Smrg
2028d466db85Smrg# XORG_LINT_LIBRARY(LIBNAME)
2029d466db85Smrg# --------------------------
2030d466db85Smrg# Minimum version: 1.1.0
2031d466db85Smrg#
2032d466db85Smrg# Sets up flags for building lint libraries for checking programs that call
2033d466db85Smrg# functions in the library.
2034d466db85Smrg#
20351cca5e29Smrg# Interface to module:
20361cca5e29Smrg# LINTLIB		- Automake variable with the name of lint library file to make
20371cca5e29Smrg# MAKE_LINT_LIB		- Automake conditional
20381cca5e29Smrg#
20391cca5e29Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
20401cca5e29Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2041d466db85Smrg
2042d466db85SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2043d466db85SmrgAC_REQUIRE([XORG_WITH_LINT])
2044d466db85SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2045d466db85Smrg	[Create lint library (default: disabled)])],
2046d466db85Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
20471cca5e29Smrg
20481cca5e29Smrgif test "x$make_lint_lib" = x"yes" ; then
20491cca5e29Smrg   LINTLIB=llib-l$1.ln
20501cca5e29Smrg   if test "x$LINT" = "x"; then
20511cca5e29Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
20521cca5e29Smrg   fi
20531cca5e29Smrgelif test "x$make_lint_lib" != x"no" ; then
20541cca5e29Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2055d466db85Smrgfi
20561cca5e29Smrg
2057d466db85SmrgAC_SUBST(LINTLIB)
2058d466db85SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2059d466db85Smrg
2060d466db85Smrg]) # XORG_LINT_LIBRARY
2061d466db85Smrg
2062d466db85Smrg# XORG_CWARNFLAGS
2063d466db85Smrg# ---------------
2064d466db85Smrg# Minimum version: 1.2.0
2065d466db85Smrg#
2066d466db85Smrg# Defines CWARNFLAGS to enable C compiler warnings.
2067d466db85Smrg#
2068d466db85SmrgAC_DEFUN([XORG_CWARNFLAGS], [
20691cca5e29SmrgAC_REQUIRE([AC_PROG_CC_C99])
2070d466db85Smrgif  test "x$GCC" = xyes ; then
2071d466db85Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
2072d466db85Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
20731cca5e29Smrg-Wbad-function-cast -Wformat=2"
2074d466db85Smrg    case `$CC -dumpversion` in
2075d466db85Smrg    3.4.* | 4.*)
2076d466db85Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
2077d466db85Smrg	;;
2078d466db85Smrg    esac
2079d466db85Smrgelse
2080d466db85Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2081d466db85Smrg    if test "x$SUNCC" = "xyes"; then
2082d466db85Smrg	CWARNFLAGS="-v"
2083d466db85Smrg    fi
2084d466db85Smrgfi
2085d466db85SmrgAC_SUBST(CWARNFLAGS)
2086d466db85Smrg]) # XORG_CWARNFLAGS
2087d466db85Smrg
2088d466db85Smrg# XORG_STRICT_OPTION
2089d466db85Smrg# -----------------------
2090d466db85Smrg# Minimum version: 1.3.0
2091d466db85Smrg#
2092d466db85Smrg# Add configure option to enable strict compilation
2093d466db85SmrgAC_DEFUN([XORG_STRICT_OPTION], [
20941cca5e29Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
2095d466db85SmrgAC_REQUIRE([AC_PROG_CC_C99])
2096d466db85SmrgAC_REQUIRE([XORG_CWARNFLAGS])
2097d466db85Smrg
2098d466db85SmrgAC_ARG_ENABLE(strict-compilation,
2099d466db85Smrg			  AS_HELP_STRING([--enable-strict-compilation],
2100d466db85Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
2101d466db85Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2102d466db85Smrgif test "x$STRICT_COMPILE" = "xyes"; then
2103d466db85Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2104d466db85Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2105d466db85Smrg	if test "x$GCC" = xyes ; then
2106d466db85Smrg		STRICT_CFLAGS="-pedantic -Werror"
2107d466db85Smrg	elif test "x$SUNCC" = "xyes"; then
2108d466db85Smrg		STRICT_CFLAGS="-errwarn"
2109d466db85Smrg    elif test "x$INTELCC" = "xyes"; then
2110d466db85Smrg		STRICT_CFLAGS="-Werror"
2111d466db85Smrg	fi
2112d466db85Smrgfi
2113d466db85SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
2114d466db85SmrgAC_SUBST([CWARNFLAGS])
2115d466db85Smrg]) # XORG_STRICT_OPTION
2116d466db85Smrg
2117d466db85Smrg# XORG_DEFAULT_OPTIONS
2118d466db85Smrg# --------------------
2119d466db85Smrg# Minimum version: 1.3.0
2120d466db85Smrg#
2121d466db85Smrg# Defines default options for X.Org modules.
2122d466db85Smrg#
2123d466db85SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
21241cca5e29SmrgAC_REQUIRE([AC_PROG_INSTALL])
2125d466db85SmrgXORG_CWARNFLAGS
2126d466db85SmrgXORG_STRICT_OPTION
2127d466db85SmrgXORG_RELEASE_VERSION
2128d466db85SmrgXORG_CHANGELOG
21291cca5e29SmrgXORG_INSTALL
2130d466db85SmrgXORG_MANPAGE_SECTIONS
21311cca5e29Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
21321cca5e29Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2133d466db85Smrg]) # XORG_DEFAULT_OPTIONS
21341cca5e29Smrg
21351cca5e29Smrg# XORG_INSTALL()
21361cca5e29Smrg# ----------------
21371cca5e29Smrg# Minimum version: 1.4.0
21381cca5e29Smrg#
21391cca5e29Smrg# Defines the variable INSTALL_CMD as the command to copy
21401cca5e29Smrg# INSTALL from $prefix/share/util-macros.
21411cca5e29Smrg#
21421cca5e29SmrgAC_DEFUN([XORG_INSTALL], [
21431cca5e29SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
21441cca5e29Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
21451cca5e29SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
21461cca5e29Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
21471cca5e29Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
21481cca5e29Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
21491cca5e29SmrgAC_SUBST([INSTALL_CMD])
21501cca5e29Smrg]) # XORG_INSTALL
2151d466db85Smrgdnl Copyright 2005 Red Hat, Inc
2152d466db85Smrgdnl
2153d466db85Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
2154d466db85Smrgdnl documentation for any purpose is hereby granted without fee, provided that
2155d466db85Smrgdnl the above copyright notice appear in all copies and that both that
2156d466db85Smrgdnl copyright notice and this permission notice appear in supporting
2157d466db85Smrgdnl documentation.
2158d466db85Smrgdnl
2159d466db85Smrgdnl The above copyright notice and this permission notice shall be included
2160d466db85Smrgdnl in all copies or substantial portions of the Software.
2161d466db85Smrgdnl
2162d466db85Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2163d466db85Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2164d466db85Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2165d466db85Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2166d466db85Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2167d466db85Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2168d466db85Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
2169d466db85Smrgdnl
2170d466db85Smrgdnl Except as contained in this notice, the name of the copyright holders shall
2171d466db85Smrgdnl not be used in advertising or otherwise to promote the sale, use or
2172d466db85Smrgdnl other dealings in this Software without prior written authorization
2173d466db85Smrgdnl from the copyright holders.
2174d466db85Smrgdnl
2175d466db85Smrg
2176d466db85Smrg# XORG_RELEASE_VERSION
2177d466db85Smrg# --------------------
21781cca5e29Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2179d466db85Smrg 
2180d466db85SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
2181d466db85Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2182d466db85Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2183d466db85Smrg		[Major version of this package])
2184d466db85Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2185d466db85Smrg	if test "x$PVM" = "x"; then
2186d466db85Smrg		PVM="0"
2187d466db85Smrg	fi
2188d466db85Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2189d466db85Smrg		[$PVM],
2190d466db85Smrg		[Minor version of this package])
2191d466db85Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2192d466db85Smrg	if test "x$PVP" = "x"; then
2193d466db85Smrg		PVP="0"
2194d466db85Smrg	fi
2195d466db85Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2196d466db85Smrg		[$PVP],
2197d466db85Smrg		[Patch version of this package])
2198d466db85Smrg])
2199d466db85Smrg
2200d466db85Smrg# XORG_CHANGELOG()
2201d466db85Smrg# ----------------
2202d466db85Smrg# Minimum version: 1.2.0
2203d466db85Smrg#
2204d466db85Smrg# Defines the variable CHANGELOG_CMD as the command to generate
2205d466db85Smrg# ChangeLog from git.
2206d466db85Smrg#
2207d466db85Smrg#
2208d466db85SmrgAC_DEFUN([XORG_CHANGELOG], [
22091cca5e29SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
22101cca5e29Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
22111cca5e29Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2212d466db85Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
2213d466db85SmrgAC_SUBST([CHANGELOG_CMD])
2214d466db85Smrg]) # XORG_CHANGELOG
2215d466db85Smrg
22161cca5e29Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
22171cca5e29Smrg# 
22181cca5e29Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
22191cca5e29Smrg#
22201cca5e29Smrg# This program is free software; you can redistribute it and/or modify
22211cca5e29Smrg# it under the terms of the GNU General Public License as published by
22221cca5e29Smrg# the Free Software Foundation; either version 2 of the License, or
22231cca5e29Smrg# (at your option) any later version.
22241cca5e29Smrg#
22251cca5e29Smrg# This program is distributed in the hope that it will be useful, but
22261cca5e29Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
22271cca5e29Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22281cca5e29Smrg# General Public License for more details.
22291cca5e29Smrg#
22301cca5e29Smrg# You should have received a copy of the GNU General Public License
22311cca5e29Smrg# along with this program; if not, write to the Free Software
22321cca5e29Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22331cca5e29Smrg#
22341cca5e29Smrg# As a special exception to the GNU General Public License, if you
22351cca5e29Smrg# distribute this file as part of a program that contains a
22361cca5e29Smrg# configuration script generated by Autoconf, you may include it under
22371cca5e29Smrg# the same distribution terms that you use for the rest of that program.
22381cca5e29Smrg
22391cca5e29Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
22401cca5e29Smrg# ----------------------------------
22411cca5e29SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
22421cca5e29Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
22431cca5e29Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
22441cca5e29SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
22451cca5e29Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
22461cca5e29Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
22471cca5e29Smrgfi
22481cca5e29Smrgif test -n "$PKG_CONFIG"; then
22491cca5e29Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
22501cca5e29Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
22511cca5e29Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
22521cca5e29Smrg		AC_MSG_RESULT([yes])
22531cca5e29Smrg	else
22541cca5e29Smrg		AC_MSG_RESULT([no])
22551cca5e29Smrg		PKG_CONFIG=""
22561cca5e29Smrg	fi
22571cca5e29Smrg		
22581cca5e29Smrgfi[]dnl
22591cca5e29Smrg])# PKG_PROG_PKG_CONFIG
22601cca5e29Smrg
22611cca5e29Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
22621cca5e29Smrg#
22631cca5e29Smrg# Check to see whether a particular set of modules exists.  Similar
22641cca5e29Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
22651cca5e29Smrg#
22661cca5e29Smrg#
22671cca5e29Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
22681cca5e29Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
22691cca5e29Smrg# PKG_CHECK_EXISTS manually
22701cca5e29Smrg# --------------------------------------------------------------
22711cca5e29SmrgAC_DEFUN([PKG_CHECK_EXISTS],
22721cca5e29Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
22731cca5e29Smrgif test -n "$PKG_CONFIG" && \
22741cca5e29Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
22751cca5e29Smrg  m4_ifval([$2], [$2], [:])
22761cca5e29Smrgm4_ifvaln([$3], [else
22771cca5e29Smrg  $3])dnl
22781cca5e29Smrgfi])
22791cca5e29Smrg
22801cca5e29Smrg
22811cca5e29Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
22821cca5e29Smrg# ---------------------------------------------
22831cca5e29Smrgm4_define([_PKG_CONFIG],
22841cca5e29Smrg[if test -n "$$1"; then
22851cca5e29Smrg    pkg_cv_[]$1="$$1"
22861cca5e29Smrg elif test -n "$PKG_CONFIG"; then
22871cca5e29Smrg    PKG_CHECK_EXISTS([$3],
22881cca5e29Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
22891cca5e29Smrg		     [pkg_failed=yes])
22901cca5e29Smrg else
22911cca5e29Smrg    pkg_failed=untried
22921cca5e29Smrgfi[]dnl
22931cca5e29Smrg])# _PKG_CONFIG
22941cca5e29Smrg
22951cca5e29Smrg# _PKG_SHORT_ERRORS_SUPPORTED
22961cca5e29Smrg# -----------------------------
22971cca5e29SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
22981cca5e29Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
22991cca5e29Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
23001cca5e29Smrg        _pkg_short_errors_supported=yes
23011cca5e29Smrgelse
23021cca5e29Smrg        _pkg_short_errors_supported=no
23031cca5e29Smrgfi[]dnl
23041cca5e29Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
23051cca5e29Smrg
23061cca5e29Smrg
23071cca5e29Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
23081cca5e29Smrg# [ACTION-IF-NOT-FOUND])
23091cca5e29Smrg#
23101cca5e29Smrg#
23111cca5e29Smrg# Note that if there is a possibility the first call to
23121cca5e29Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
23131cca5e29Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
23141cca5e29Smrg#
23151cca5e29Smrg#
23161cca5e29Smrg# --------------------------------------------------------------
23171cca5e29SmrgAC_DEFUN([PKG_CHECK_MODULES],
23181cca5e29Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
23191cca5e29SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
23201cca5e29SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
23211cca5e29Smrg
23221cca5e29Smrgpkg_failed=no
23231cca5e29SmrgAC_MSG_CHECKING([for $1])
23241cca5e29Smrg
23251cca5e29Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
23261cca5e29Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
23271cca5e29Smrg
23281cca5e29Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
23291cca5e29Smrgand $1[]_LIBS to avoid the need to call pkg-config.
23301cca5e29SmrgSee the pkg-config man page for more details.])
23311cca5e29Smrg
23321cca5e29Smrgif test $pkg_failed = yes; then
23331cca5e29Smrg        _PKG_SHORT_ERRORS_SUPPORTED
23341cca5e29Smrg        if test $_pkg_short_errors_supported = yes; then
23351cca5e29Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
23361cca5e29Smrg        else 
23371cca5e29Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
23381cca5e29Smrg        fi
23391cca5e29Smrg	# Put the nasty error message in config.log where it belongs
23401cca5e29Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
23411cca5e29Smrg
23421cca5e29Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
23431cca5e29Smrg[Package requirements ($2) were not met:
23441cca5e29Smrg
23451cca5e29Smrg$$1_PKG_ERRORS
23461cca5e29Smrg
23471cca5e29SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
23481cca5e29Smrginstalled software in a non-standard prefix.
23491cca5e29Smrg
23501cca5e29Smrg_PKG_TEXT
23511cca5e29Smrg])],
23521cca5e29Smrg		[AC_MSG_RESULT([no])
23531cca5e29Smrg                $4])
23541cca5e29Smrgelif test $pkg_failed = untried; then
23551cca5e29Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
23561cca5e29Smrg[The pkg-config script could not be found or is too old.  Make sure it
23571cca5e29Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
23581cca5e29Smrgpath to pkg-config.
23591cca5e29Smrg
23601cca5e29Smrg_PKG_TEXT
23611cca5e29Smrg
23621cca5e29SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
23631cca5e29Smrg		[$4])
23641cca5e29Smrgelse
23651cca5e29Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
23661cca5e29Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
23671cca5e29Smrg        AC_MSG_RESULT([yes])
23681cca5e29Smrg	ifelse([$3], , :, [$3])
23691cca5e29Smrgfi[]dnl
23701cca5e29Smrg])# PKG_CHECK_MODULES
23711cca5e29Smrg
2372