aclocal.m4 revision f126e068
1f126e068Smrg# generated automatically by aclocal 1.14 -*- Autoconf -*-
2f126e068Smrg
3f126e068Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
48b22bf3fSmrg
58b22bf3fSmrg# This file is free software; the Free Software Foundation
68b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
78b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
88b22bf3fSmrg
98b22bf3fSmrg# This program is distributed in the hope that it will be useful,
108b22bf3fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
118b22bf3fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
128b22bf3fSmrg# PARTICULAR PURPOSE.
138b22bf3fSmrg
14f126e068Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
1596a81b41Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1696a81b41Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
175bd32fd1Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
185bd32fd1Smrg[m4_warning([this file was generated for autoconf 2.68.
1996a81b41SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
2096a81b41SmrgIf you have problems, you may need to regenerate the build system entirely.
21f126e068SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
228b22bf3fSmrg
23f126e068Smrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
24dfab2fd6Smrg#
25f126e068Smrg# This file is free software; the Free Software Foundation
26f126e068Smrg# gives unlimited permission to copy and/or distribute it,
27f126e068Smrg# with or without modifications, as long as this notice is preserved.
288b22bf3fSmrg
29f126e068Smrg# AM_AUTOMAKE_VERSION(VERSION)
30f126e068Smrg# ----------------------------
31f126e068Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
32f126e068Smrg# generated from the m4 files accompanying Automake X.Y.
33f126e068Smrg# (This private macro should not be called outside this file.)
34f126e068SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
35f126e068Smrg[am__api_version='1.14'
36f126e068Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37f126e068Smrgdnl require some minimum version.  Point them to the right macro.
38f126e068Smrgm4_if([$1], [1.14], [],
39f126e068Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40f126e068Smrg])
418b22bf3fSmrg
42f126e068Smrg# _AM_AUTOCONF_VERSION(VERSION)
43f126e068Smrg# -----------------------------
44f126e068Smrg# aclocal traces this macro to find the Autoconf version.
45f126e068Smrg# This is a private macro too.  Using m4_define simplifies
46f126e068Smrg# the logic in aclocal, which can simply ignore this definition.
47f126e068Smrgm4_define([_AM_AUTOCONF_VERSION], [])
488b22bf3fSmrg
49f126e068Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
50f126e068Smrg# -------------------------------
51f126e068Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52f126e068Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53f126e068SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
54f126e068Smrg[AM_AUTOMAKE_VERSION([1.14])dnl
55f126e068Smrgm4_ifndef([AC_AUTOCONF_VERSION],
56f126e068Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57f126e068Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
588b22bf3fSmrg
59f126e068Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
608b22bf3fSmrg
61f126e068Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
62f126e068Smrg#
63f126e068Smrg# This file is free software; the Free Software Foundation
64f126e068Smrg# gives unlimited permission to copy and/or distribute it,
65f126e068Smrg# with or without modifications, as long as this notice is preserved.
66dfab2fd6Smrg
67f126e068Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
68f126e068Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
69f126e068Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
708b22bf3fSmrg#
71f126e068Smrg# Of course, Automake must honor this variable whenever it calls a
72f126e068Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
73f126e068Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
74f126e068Smrg# depending on how configure is run.  This is pretty annoying, since
75f126e068Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
76f126e068Smrg# source directory, any form will work fine, but in subdirectories a
77f126e068Smrg# relative path needs to be adjusted first.
788b22bf3fSmrg#
79f126e068Smrg# $ac_aux_dir/missing
80f126e068Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
81f126e068Smrg# $top_srcdir/$ac_aux_dir/missing
82f126e068Smrg#    fails if $ac_aux_dir is absolute,
83f126e068Smrg#    fails when called from a subdirectory in a VPATH build with
84f126e068Smrg#          a relative $ac_aux_dir
858b22bf3fSmrg#
86f126e068Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87f126e068Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
88f126e068Smrg# harmless because $srcdir is '.', but things will broke when you
89f126e068Smrg# start a VPATH build or use an absolute $srcdir.
908b22bf3fSmrg#
91f126e068Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92f126e068Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
93f126e068Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94f126e068Smrg# and then we would define $MISSING as
95f126e068Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
96f126e068Smrg# This will work as long as MISSING is not called from configure, because
97f126e068Smrg# unfortunately $(top_srcdir) has no meaning in configure.
98f126e068Smrg# However there are other variables, like CC, which are often used in
99f126e068Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
100f126e068Smrg#
101f126e068Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
102f126e068Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
103f126e068Smrg# configured tree to be moved without reconfiguration.
1048b22bf3fSmrg
105f126e068SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
106f126e068Smrg[dnl Rely on autoconf to set up CDPATH properly.
107f126e068SmrgAC_PREREQ([2.50])dnl
108f126e068Smrg# expand $ac_aux_dir to an absolute path
109f126e068Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
110f126e068Smrg])
1118b22bf3fSmrg
112f126e068Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1138b22bf3fSmrg
114f126e068Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
115f126e068Smrg#
116f126e068Smrg# This file is free software; the Free Software Foundation
117f126e068Smrg# gives unlimited permission to copy and/or distribute it,
118f126e068Smrg# with or without modifications, as long as this notice is preserved.
1198b22bf3fSmrg
120f126e068Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
121f126e068Smrg# -------------------------------------
122f126e068Smrg# Define a conditional.
123f126e068SmrgAC_DEFUN([AM_CONDITIONAL],
124f126e068Smrg[AC_PREREQ([2.52])dnl
125f126e068Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
126f126e068Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
127f126e068SmrgAC_SUBST([$1_TRUE])dnl
128f126e068SmrgAC_SUBST([$1_FALSE])dnl
129f126e068Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
130f126e068Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
131f126e068Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
132f126e068Smrgif $2; then
133f126e068Smrg  $1_TRUE=
134f126e068Smrg  $1_FALSE='#'
135f126e068Smrgelse
136f126e068Smrg  $1_TRUE='#'
137f126e068Smrg  $1_FALSE=
138f126e068Smrgfi
139f126e068SmrgAC_CONFIG_COMMANDS_PRE(
140f126e068Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
141f126e068Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
142f126e068SmrgUsually this means the macro was only invoked conditionally.]])
143f126e068Smrgfi])])
1448b22bf3fSmrg
145f126e068Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
146f126e068Smrg#
147f126e068Smrg# This file is free software; the Free Software Foundation
148f126e068Smrg# gives unlimited permission to copy and/or distribute it,
149f126e068Smrg# with or without modifications, as long as this notice is preserved.
1508b22bf3fSmrg
1518b22bf3fSmrg
152f126e068Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
153f126e068Smrg# written in clear, in which case automake, when reading aclocal.m4,
154f126e068Smrg# will think it sees a *use*, and therefore will trigger all it's
155f126e068Smrg# C support machinery.  Also note that it means that autoscan, seeing
156f126e068Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1578b22bf3fSmrg
1588b22bf3fSmrg
159f126e068Smrg# _AM_DEPENDENCIES(NAME)
160f126e068Smrg# ----------------------
161f126e068Smrg# See how the compiler implements dependency checking.
162f126e068Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
163f126e068Smrg# We try a few techniques and use that to set a single cache variable.
164f126e068Smrg#
165f126e068Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
166f126e068Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
167f126e068Smrg# dependency, and given that the user is not expected to run this macro,
168f126e068Smrg# just rely on AC_PROG_CC.
169f126e068SmrgAC_DEFUN([_AM_DEPENDENCIES],
170f126e068Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
171f126e068SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
172f126e068SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
173f126e068SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1748b22bf3fSmrg
175f126e068Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
176f126e068Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
177f126e068Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
178f126e068Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
179f126e068Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
180f126e068Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
181f126e068Smrg                    [depcc="$$1"   am_compiler_list=])
1828b22bf3fSmrg
183f126e068SmrgAC_CACHE_CHECK([dependency style of $depcc],
184f126e068Smrg               [am_cv_$1_dependencies_compiler_type],
185f126e068Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
186f126e068Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
187f126e068Smrg  # making bogus files that we don't know about and never remove.  For
188f126e068Smrg  # instance it was reported that on HP-UX the gcc test will end up
189f126e068Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
190f126e068Smrg  # in D".
191f126e068Smrg  rm -rf conftest.dir
192f126e068Smrg  mkdir conftest.dir
193f126e068Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
194f126e068Smrg  # using a relative directory.
195f126e068Smrg  cp "$am_depcomp" conftest.dir
196f126e068Smrg  cd conftest.dir
197f126e068Smrg  # We will build objects and dependencies in a subdirectory because
198f126e068Smrg  # it helps to detect inapplicable dependency modes.  For instance
199f126e068Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
200f126e068Smrg  # side effect of compilation, but ICC will put the dependencies in
201f126e068Smrg  # the current directory while Tru64 will put them in the object
202f126e068Smrg  # directory.
203f126e068Smrg  mkdir sub
20496a81b41Smrg
205f126e068Smrg  am_cv_$1_dependencies_compiler_type=none
206f126e068Smrg  if test "$am_compiler_list" = ""; then
207f126e068Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
208f126e068Smrg  fi
209f126e068Smrg  am__universal=false
210f126e068Smrg  m4_case([$1], [CC],
211f126e068Smrg    [case " $depcc " in #(
212f126e068Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
213f126e068Smrg     esac],
214f126e068Smrg    [CXX],
215f126e068Smrg    [case " $depcc " in #(
216f126e068Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
217f126e068Smrg     esac])
2188b22bf3fSmrg
219f126e068Smrg  for depmode in $am_compiler_list; do
220f126e068Smrg    # Setup a source with many dependencies, because some compilers
221f126e068Smrg    # like to wrap large dependency lists on column 80 (with \), and
222f126e068Smrg    # we should not choose a depcomp mode which is confused by this.
223f126e068Smrg    #
224f126e068Smrg    # We need to recreate these files for each test, as the compiler may
225f126e068Smrg    # overwrite some of them when testing with obscure command lines.
226f126e068Smrg    # This happens at least with the AIX C compiler.
227f126e068Smrg    : > sub/conftest.c
228f126e068Smrg    for i in 1 2 3 4 5 6; do
229f126e068Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
230f126e068Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
231f126e068Smrg      # Solaris 10 /bin/sh.
232f126e068Smrg      echo '/* dummy */' > sub/conftst$i.h
233f126e068Smrg    done
234f126e068Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2358b22bf3fSmrg
236f126e068Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
237f126e068Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
238f126e068Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
239f126e068Smrg    # versions had trouble with output in subdirs.
240f126e068Smrg    am__obj=sub/conftest.${OBJEXT-o}
241f126e068Smrg    am__minus_obj="-o $am__obj"
242f126e068Smrg    case $depmode in
243f126e068Smrg    gcc)
244f126e068Smrg      # This depmode causes a compiler race in universal mode.
245f126e068Smrg      test "$am__universal" = false || continue
246f126e068Smrg      ;;
247f126e068Smrg    nosideeffect)
248f126e068Smrg      # After this tag, mechanisms are not by side-effect, so they'll
249f126e068Smrg      # only be used when explicitly requested.
250f126e068Smrg      if test "x$enable_dependency_tracking" = xyes; then
251f126e068Smrg	continue
252f126e068Smrg      else
253f126e068Smrg	break
254f126e068Smrg      fi
255f126e068Smrg      ;;
256f126e068Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
257f126e068Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
258f126e068Smrg      # not run yet.  These depmodes are late enough in the game, and
259f126e068Smrg      # so weak that their functioning should not be impacted.
260f126e068Smrg      am__obj=conftest.${OBJEXT-o}
261f126e068Smrg      am__minus_obj=
262f126e068Smrg      ;;
263f126e068Smrg    none) break ;;
264f126e068Smrg    esac
265f126e068Smrg    if depmode=$depmode \
266f126e068Smrg       source=sub/conftest.c object=$am__obj \
267f126e068Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
268f126e068Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
269f126e068Smrg         >/dev/null 2>conftest.err &&
270f126e068Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
271f126e068Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
272f126e068Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
273f126e068Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
274f126e068Smrg      # icc doesn't choke on unknown options, it will just issue warnings
275f126e068Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
276f126e068Smrg      # that says an option was ignored or not supported.
277f126e068Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
278f126e068Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
279f126e068Smrg      # The diagnosis changed in icc 8.0:
280f126e068Smrg      #   icc: Command line remark: option '-MP' not supported
281f126e068Smrg      if (grep 'ignoring option' conftest.err ||
282f126e068Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
283f126e068Smrg        am_cv_$1_dependencies_compiler_type=$depmode
284f126e068Smrg        break
285f126e068Smrg      fi
286f126e068Smrg    fi
287f126e068Smrg  done
2888b22bf3fSmrg
289f126e068Smrg  cd ..
290f126e068Smrg  rm -rf conftest.dir
291dfab2fd6Smrgelse
292f126e068Smrg  am_cv_$1_dependencies_compiler_type=none
293dfab2fd6Smrgfi
294f126e068Smrg])
295f126e068SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
296f126e068SmrgAM_CONDITIONAL([am__fastdep$1], [
297f126e068Smrg  test "x$enable_dependency_tracking" != xno \
298f126e068Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
299f126e068Smrg])
3008b22bf3fSmrg
3018b22bf3fSmrg
302f126e068Smrg# AM_SET_DEPDIR
303f126e068Smrg# -------------
304f126e068Smrg# Choose a directory name for dependency files.
305f126e068Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
306f126e068SmrgAC_DEFUN([AM_SET_DEPDIR],
307f126e068Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
308f126e068SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
309f126e068Smrg])
3108b22bf3fSmrg
3118b22bf3fSmrg
312f126e068Smrg# AM_DEP_TRACK
313f126e068Smrg# ------------
314f126e068SmrgAC_DEFUN([AM_DEP_TRACK],
315f126e068Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
316f126e068SmrgAS_HELP_STRING(
317f126e068Smrg  [--enable-dependency-tracking],
318f126e068Smrg  [do not reject slow dependency extractors])
319f126e068SmrgAS_HELP_STRING(
320f126e068Smrg  [--disable-dependency-tracking],
321f126e068Smrg  [speeds up one-time build])])
322f126e068Smrgif test "x$enable_dependency_tracking" != xno; then
323f126e068Smrg  am_depcomp="$ac_aux_dir/depcomp"
324f126e068Smrg  AMDEPBACKSLASH='\'
325f126e068Smrg  am__nodep='_no'
326dfab2fd6Smrgfi
327f126e068SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
328f126e068SmrgAC_SUBST([AMDEPBACKSLASH])dnl
329f126e068Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
330f126e068SmrgAC_SUBST([am__nodep])dnl
331f126e068Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
332f126e068Smrg])
3338b22bf3fSmrg
334f126e068Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3358b22bf3fSmrg
336f126e068Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
337f126e068Smrg#
338f126e068Smrg# This file is free software; the Free Software Foundation
339f126e068Smrg# gives unlimited permission to copy and/or distribute it,
340f126e068Smrg# with or without modifications, as long as this notice is preserved.
3418b22bf3fSmrg
342dfab2fd6Smrg
343f126e068Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
344f126e068Smrg# ------------------------------
345f126e068SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
346f126e068Smrg[{
347f126e068Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
348f126e068Smrg  # are listed without --file.  Let's play safe and only enable the eval
349f126e068Smrg  # if we detect the quoting.
350f126e068Smrg  case $CONFIG_FILES in
351f126e068Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
352f126e068Smrg  *)   set x $CONFIG_FILES ;;
353f126e068Smrg  esac
354f126e068Smrg  shift
355f126e068Smrg  for mf
356f126e068Smrg  do
357f126e068Smrg    # Strip MF so we end up with the name of the file.
358f126e068Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
359f126e068Smrg    # Check whether this is an Automake generated Makefile or not.
360f126e068Smrg    # We used to match only the files named 'Makefile.in', but
361f126e068Smrg    # some people rename them; so instead we look at the file content.
362f126e068Smrg    # Grep'ing the first line is not enough: some people post-process
363f126e068Smrg    # each Makefile.in and add a new line on top of each file to say so.
364f126e068Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
365f126e068Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
366f126e068Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
367f126e068Smrg      dirpart=`AS_DIRNAME("$mf")`
368f126e068Smrg    else
369f126e068Smrg      continue
370f126e068Smrg    fi
371f126e068Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
372f126e068Smrg    # from the Makefile without running 'make'.
373f126e068Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
374f126e068Smrg    test -z "$DEPDIR" && continue
375f126e068Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
376f126e068Smrg    test -z "$am__include" && continue
377f126e068Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
378f126e068Smrg    # Find all dependency output files, they are included files with
379f126e068Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
380f126e068Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
381f126e068Smrg    # expansion.
382f126e068Smrg    for file in `sed -n "
383f126e068Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
384f126e068Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
385f126e068Smrg      # Make sure the directory exists.
386f126e068Smrg      test -f "$dirpart/$file" && continue
387f126e068Smrg      fdir=`AS_DIRNAME(["$file"])`
388f126e068Smrg      AS_MKDIR_P([$dirpart/$fdir])
389f126e068Smrg      # echo "creating $dirpart/$file"
390f126e068Smrg      echo '# dummy' > "$dirpart/$file"
391f126e068Smrg    done
392f126e068Smrg  done
393f126e068Smrg}
394f126e068Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
395dfab2fd6Smrg
396dfab2fd6Smrg
397f126e068Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
398f126e068Smrg# -----------------------------
399f126e068Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
4008b22bf3fSmrg#
401f126e068Smrg# This code is only required when automatic dependency tracking
402f126e068Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
403f126e068Smrg# need in order to bootstrap the dependency handling code.
404f126e068SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
405f126e068Smrg[AC_CONFIG_COMMANDS([depfiles],
406f126e068Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
407f126e068Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
408f126e068Smrg])
4098b22bf3fSmrg
410f126e068Smrg# Do all the work for Automake.                             -*- Autoconf -*-
411dfab2fd6Smrg
412f126e068Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4138b22bf3fSmrg#
414f126e068Smrg# This file is free software; the Free Software Foundation
415f126e068Smrg# gives unlimited permission to copy and/or distribute it,
416f126e068Smrg# with or without modifications, as long as this notice is preserved.
4178b22bf3fSmrg
418f126e068Smrg# This macro actually does too much.  Some checks are only needed if
419f126e068Smrg# your package does certain things.  But this isn't really a big deal.
4208b22bf3fSmrg
421f126e068Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
422f126e068Smrgm4_define([AC_PROG_CC],
423f126e068Smrgm4_defn([AC_PROG_CC])
424f126e068Smrg[_AM_PROG_CC_C_O
425f126e068Smrg])
4268b22bf3fSmrg
427f126e068Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
428f126e068Smrg# AM_INIT_AUTOMAKE([OPTIONS])
429f126e068Smrg# -----------------------------------------------
430f126e068Smrg# The call with PACKAGE and VERSION arguments is the old style
431f126e068Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
432f126e068Smrg# and VERSION should now be passed to AC_INIT and removed from
433f126e068Smrg# the call to AM_INIT_AUTOMAKE.
434f126e068Smrg# We support both call styles for the transition.  After
435f126e068Smrg# the next Automake release, Autoconf can make the AC_INIT
436f126e068Smrg# arguments mandatory, and then we can depend on a new Autoconf
437f126e068Smrg# release and drop the old call support.
438f126e068SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
439f126e068Smrg[AC_PREREQ([2.65])dnl
440f126e068Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
441f126e068Smrgdnl the ones we care about.
442f126e068Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
443f126e068SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
444f126e068SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
445f126e068Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
446f126e068Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
447f126e068Smrg  # is not polluted with repeated "-I."
448f126e068Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
449f126e068Smrg  # test to see if srcdir already configured
450f126e068Smrg  if test -f $srcdir/config.status; then
451f126e068Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
452f126e068Smrg  fi
4538b22bf3fSmrgfi
4548b22bf3fSmrg
455f126e068Smrg# test whether we have cygpath
456f126e068Smrgif test -z "$CYGPATH_W"; then
457f126e068Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
458f126e068Smrg    CYGPATH_W='cygpath -w'
459f126e068Smrg  else
460f126e068Smrg    CYGPATH_W=echo
461f126e068Smrg  fi
462f126e068Smrgfi
463f126e068SmrgAC_SUBST([CYGPATH_W])
464dfab2fd6Smrg
465f126e068Smrg# Define the identity of the package.
466f126e068Smrgdnl Distinguish between old-style and new-style calls.
467f126e068Smrgm4_ifval([$2],
468f126e068Smrg[AC_DIAGNOSE([obsolete],
469f126e068Smrg             [$0: two- and three-arguments forms are deprecated.])
470f126e068Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
471f126e068Smrg AC_SUBST([PACKAGE], [$1])dnl
472f126e068Smrg AC_SUBST([VERSION], [$2])],
473f126e068Smrg[_AM_SET_OPTIONS([$1])dnl
474f126e068Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
475f126e068Smrgm4_if(
476f126e068Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
477f126e068Smrg  [ok:ok],,
478f126e068Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
479f126e068Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
480f126e068Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
481dfab2fd6Smrg
482f126e068Smrg_AM_IF_OPTION([no-define],,
483f126e068Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
484f126e068Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
485dfab2fd6Smrg
486f126e068Smrg# Some tools Automake needs.
487f126e068SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
488f126e068SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
489f126e068SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
490f126e068SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
491f126e068SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
492f126e068SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
493f126e068SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
494f126e068SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
495f126e068SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
496f126e068SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
497f126e068Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
498f126e068Smrg# dies out for good.  For more background, see:
499f126e068Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
500f126e068Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
501f126e068SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
502f126e068Smrg# We need awk for the "check" target.  The system "awk" is bad on
503f126e068Smrg# some platforms.
504f126e068SmrgAC_REQUIRE([AC_PROG_AWK])dnl
505f126e068SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
506f126e068SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
507f126e068Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
508f126e068Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
509f126e068Smrg			     [_AM_PROG_TAR([v7])])])
510f126e068Smrg_AM_IF_OPTION([no-dependencies],,
511f126e068Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
512f126e068Smrg		  [_AM_DEPENDENCIES([CC])],
513f126e068Smrg		  [m4_define([AC_PROG_CC],
514f126e068Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
515f126e068SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
516f126e068Smrg		  [_AM_DEPENDENCIES([CXX])],
517f126e068Smrg		  [m4_define([AC_PROG_CXX],
518f126e068Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
519f126e068SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
520f126e068Smrg		  [_AM_DEPENDENCIES([OBJC])],
521f126e068Smrg		  [m4_define([AC_PROG_OBJC],
522f126e068Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
523f126e068SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
524f126e068Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
525f126e068Smrg		  [m4_define([AC_PROG_OBJCXX],
526f126e068Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
527f126e068Smrg])
528f126e068SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
529f126e068Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
530f126e068Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
531f126e068Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
532f126e068SmrgAC_CONFIG_COMMANDS_PRE(dnl
533f126e068Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
534f126e068Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5358b22bf3fSmrg
536f126e068Smrg# POSIX will say in a future version that running "rm -f" with no argument
537f126e068Smrg# is OK; and we want to be able to make that assumption in our Makefile
538f126e068Smrg# recipes.  So use an aggressive probe to check that the usage we want is
539f126e068Smrg# actually supported "in the wild" to an acceptable degree.
540f126e068Smrg# See automake bug#10828.
541f126e068Smrg# To make any issue more visible, cause the running configure to be aborted
542f126e068Smrg# by default if the 'rm' program in use doesn't match our expectations; the
543f126e068Smrg# user can still override this though.
544f126e068Smrgif rm -f && rm -fr && rm -rf; then : OK; else
545f126e068Smrg  cat >&2 <<'END'
546f126e068SmrgOops!
547f126e068Smrg
548f126e068SmrgYour 'rm' program seems unable to run without file operands specified
549f126e068Smrgon the command line, even when the '-f' option is present.  This is contrary
550f126e068Smrgto the behaviour of most rm programs out there, and not conforming with
551f126e068Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
552f126e068Smrg
553f126e068SmrgPlease tell bug-automake@gnu.org about your system, including the value
554f126e068Smrgof your $PATH and any error possibly output before this message.  This
555f126e068Smrgcan help us improve future automake versions.
55696a81b41Smrg
557f126e068SmrgEND
558f126e068Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
559f126e068Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
560f126e068Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
561f126e068Smrg    echo >&2
562f126e068Smrg  else
563f126e068Smrg    cat >&2 <<'END'
564f126e068SmrgAborting the configuration process, to ensure you take notice of the issue.
5658b22bf3fSmrg
566f126e068SmrgYou can download and install GNU coreutils to get an 'rm' implementation
567f126e068Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
5688b22bf3fSmrg
569f126e068SmrgIf you want to complete the configuration process using your problematic
570f126e068Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
571f126e068Smrgto "yes", and re-run configure.
5728b22bf3fSmrg
573f126e068SmrgEND
574f126e068Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
575f126e068Smrg  fi
576f126e068Smrgfi])
5778b22bf3fSmrg
578f126e068Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
579f126e068Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
580f126e068Smrgdnl mangled by Autoconf and run in a shell conditional statement.
581f126e068Smrgm4_define([_AC_COMPILER_EXEEXT],
582f126e068Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5838b22bf3fSmrg
584f126e068Smrg# When config.status generates a header, we must update the stamp-h file.
585f126e068Smrg# This file resides in the same directory as the config header
586f126e068Smrg# that is generated.  The stamp files are numbered to have different names.
5878b22bf3fSmrg
588f126e068Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
589f126e068Smrg# loop where config.status creates the headers, so we can generate
590f126e068Smrg# our stamp files there.
591f126e068SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
592f126e068Smrg[# Compute $1's index in $config_headers.
593f126e068Smrg_am_arg=$1
594f126e068Smrg_am_stamp_count=1
595f126e068Smrgfor _am_header in $config_headers :; do
596f126e068Smrg  case $_am_header in
597f126e068Smrg    $_am_arg | $_am_arg:* )
598f126e068Smrg      break ;;
599f126e068Smrg    * )
600f126e068Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
601f126e068Smrg  esac
602f126e068Smrgdone
603f126e068Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
6048b22bf3fSmrg
605f126e068Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
606f126e068Smrg#
607f126e068Smrg# This file is free software; the Free Software Foundation
608f126e068Smrg# gives unlimited permission to copy and/or distribute it,
609f126e068Smrg# with or without modifications, as long as this notice is preserved.
6108b22bf3fSmrg
611f126e068Smrg# AM_PROG_INSTALL_SH
612f126e068Smrg# ------------------
613f126e068Smrg# Define $install_sh.
614f126e068SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
615f126e068Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
616f126e068Smrgif test x"${install_sh}" != xset; then
617f126e068Smrg  case $am_aux_dir in
618f126e068Smrg  *\ * | *\	*)
619f126e068Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
620f126e068Smrg  *)
621f126e068Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
622f126e068Smrg  esac
623dfab2fd6Smrgfi
624f126e068SmrgAC_SUBST([install_sh])])
6258b22bf3fSmrg
626f126e068Smrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
627f126e068Smrg#
628f126e068Smrg# This file is free software; the Free Software Foundation
629f126e068Smrg# gives unlimited permission to copy and/or distribute it,
630f126e068Smrg# with or without modifications, as long as this notice is preserved.
6318b22bf3fSmrg
632f126e068Smrg# Check whether the underlying file-system supports filenames
633f126e068Smrg# with a leading dot.  For instance MS-DOS doesn't.
634f126e068SmrgAC_DEFUN([AM_SET_LEADING_DOT],
635f126e068Smrg[rm -rf .tst 2>/dev/null
636f126e068Smrgmkdir .tst 2>/dev/null
637f126e068Smrgif test -d .tst; then
638f126e068Smrg  am__leading_dot=.
639f126e068Smrgelse
640f126e068Smrg  am__leading_dot=_
641f126e068Smrgfi
642f126e068Smrgrmdir .tst 2>/dev/null
643f126e068SmrgAC_SUBST([am__leading_dot])])
6448b22bf3fSmrg
645f126e068Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
646f126e068Smrg# From Jim Meyering
6478b22bf3fSmrg
648f126e068Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
649dfab2fd6Smrg#
650f126e068Smrg# This file is free software; the Free Software Foundation
651f126e068Smrg# gives unlimited permission to copy and/or distribute it,
652f126e068Smrg# with or without modifications, as long as this notice is preserved.
653f126e068Smrg
654f126e068Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
655f126e068Smrg# ----------------------------------
656f126e068Smrg# Control maintainer-specific portions of Makefiles.
657f126e068Smrg# Default is to disable them, unless 'enable' is passed literally.
658f126e068Smrg# For symmetry, 'disable' may be passed as well.  Anyway, the user
659f126e068Smrg# can override the default with the --enable/--disable switch.
660f126e068SmrgAC_DEFUN([AM_MAINTAINER_MODE],
661f126e068Smrg[m4_case(m4_default([$1], [disable]),
662f126e068Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
663f126e068Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
664f126e068Smrg       [m4_define([am_maintainer_other], [enable])
665f126e068Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
666f126e068SmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
667f126e068Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
668f126e068Smrg  AC_ARG_ENABLE([maintainer-mode],
669f126e068Smrg    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
670f126e068Smrg      am_maintainer_other[ make rules and dependencies not useful
671f126e068Smrg      (and sometimes confusing) to the casual installer])],
672f126e068Smrg    [USE_MAINTAINER_MODE=$enableval],
673f126e068Smrg    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
674f126e068Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
675f126e068Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
676f126e068Smrg  MAINT=$MAINTAINER_MODE_TRUE
677f126e068Smrg  AC_SUBST([MAINT])dnl
678f126e068Smrg]
679f126e068Smrg)
680f126e068Smrg
681f126e068Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
682f126e068Smrg
683f126e068Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
684dfab2fd6Smrg#
685f126e068Smrg# This file is free software; the Free Software Foundation
686f126e068Smrg# gives unlimited permission to copy and/or distribute it,
687f126e068Smrg# with or without modifications, as long as this notice is preserved.
688f126e068Smrg
689f126e068Smrg# AM_MAKE_INCLUDE()
690f126e068Smrg# -----------------
691f126e068Smrg# Check to see how make treats includes.
692f126e068SmrgAC_DEFUN([AM_MAKE_INCLUDE],
693f126e068Smrg[am_make=${MAKE-make}
694f126e068Smrgcat > confinc << 'END'
695f126e068Smrgam__doit:
696f126e068Smrg	@echo this is the am__doit target
697f126e068Smrg.PHONY: am__doit
698f126e068SmrgEND
699f126e068Smrg# If we don't find an include directive, just comment out the code.
700f126e068SmrgAC_MSG_CHECKING([for style of include used by $am_make])
701f126e068Smrgam__include="#"
702f126e068Smrgam__quote=
703f126e068Smrg_am_result=none
704f126e068Smrg# First try GNU make style include.
705f126e068Smrgecho "include confinc" > confmf
706f126e068Smrg# Ignore all kinds of additional output from 'make'.
707f126e068Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
708f126e068Smrg*the\ am__doit\ target*)
709f126e068Smrg  am__include=include
710f126e068Smrg  am__quote=
711f126e068Smrg  _am_result=GNU
712f126e068Smrg  ;;
713f126e068Smrgesac
714f126e068Smrg# Now try BSD make style include.
715f126e068Smrgif test "$am__include" = "#"; then
716f126e068Smrg   echo '.include "confinc"' > confmf
717f126e068Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
718f126e068Smrg   *the\ am__doit\ target*)
719f126e068Smrg     am__include=.include
720f126e068Smrg     am__quote="\""
721f126e068Smrg     _am_result=BSD
722f126e068Smrg     ;;
723f126e068Smrg   esac
724f126e068Smrgfi
725f126e068SmrgAC_SUBST([am__include])
726f126e068SmrgAC_SUBST([am__quote])
727f126e068SmrgAC_MSG_RESULT([$_am_result])
728f126e068Smrgrm -f confinc confmf
729f126e068Smrg])
730f126e068Smrg
731f126e068Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
732f126e068Smrg
733f126e068Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
734dfab2fd6Smrg#
735f126e068Smrg# This file is free software; the Free Software Foundation
736f126e068Smrg# gives unlimited permission to copy and/or distribute it,
737f126e068Smrg# with or without modifications, as long as this notice is preserved.
7388b22bf3fSmrg
739f126e068Smrg# AM_MISSING_PROG(NAME, PROGRAM)
740f126e068Smrg# ------------------------------
741f126e068SmrgAC_DEFUN([AM_MISSING_PROG],
742f126e068Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
743f126e068Smrg$1=${$1-"${am_missing_run}$2"}
744f126e068SmrgAC_SUBST($1)])
745f126e068Smrg
746f126e068Smrg# AM_MISSING_HAS_RUN
747f126e068Smrg# ------------------
748f126e068Smrg# Define MISSING if not defined so far and test if it is modern enough.
749f126e068Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
750f126e068SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
751f126e068Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
752f126e068SmrgAC_REQUIRE_AUX_FILE([missing])dnl
753f126e068Smrgif test x"${MISSING+set}" != xset; then
754f126e068Smrg  case $am_aux_dir in
755f126e068Smrg  *\ * | *\	*)
756f126e068Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
757f126e068Smrg  *)
758f126e068Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
759f126e068Smrg  esac
760f126e068Smrgfi
761f126e068Smrg# Use eval to expand $SHELL
762f126e068Smrgif eval "$MISSING --is-lightweight"; then
763f126e068Smrg  am_missing_run="$MISSING "
764dfab2fd6Smrgelse
765f126e068Smrg  am_missing_run=
766f126e068Smrg  AC_MSG_WARN(['missing' script is too old or missing])
7678b22bf3fSmrgfi
768f126e068Smrg])
7698b22bf3fSmrg
770f126e068Smrg# Helper functions for option handling.                     -*- Autoconf -*-
7718b22bf3fSmrg
772f126e068Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
773dfab2fd6Smrg#
774f126e068Smrg# This file is free software; the Free Software Foundation
775f126e068Smrg# gives unlimited permission to copy and/or distribute it,
776f126e068Smrg# with or without modifications, as long as this notice is preserved.
777f126e068Smrg
778f126e068Smrg# _AM_MANGLE_OPTION(NAME)
779f126e068Smrg# -----------------------
780f126e068SmrgAC_DEFUN([_AM_MANGLE_OPTION],
781f126e068Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
782f126e068Smrg
783f126e068Smrg# _AM_SET_OPTION(NAME)
784f126e068Smrg# --------------------
785f126e068Smrg# Set option NAME.  Presently that only means defining a flag for this option.
786f126e068SmrgAC_DEFUN([_AM_SET_OPTION],
787f126e068Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
788f126e068Smrg
789f126e068Smrg# _AM_SET_OPTIONS(OPTIONS)
790f126e068Smrg# ------------------------
791f126e068Smrg# OPTIONS is a space-separated list of Automake options.
792f126e068SmrgAC_DEFUN([_AM_SET_OPTIONS],
793f126e068Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
794f126e068Smrg
795f126e068Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
796f126e068Smrg# -------------------------------------------
797f126e068Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
798f126e068SmrgAC_DEFUN([_AM_IF_OPTION],
799f126e068Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
800f126e068Smrg
801f126e068Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
802dfab2fd6Smrg#
803f126e068Smrg# This file is free software; the Free Software Foundation
804f126e068Smrg# gives unlimited permission to copy and/or distribute it,
805f126e068Smrg# with or without modifications, as long as this notice is preserved.
806f126e068Smrg
807f126e068Smrg# _AM_PROG_CC_C_O
808f126e068Smrg# ---------------
809f126e068Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
810f126e068Smrg# to automatically call this.
811f126e068SmrgAC_DEFUN([_AM_PROG_CC_C_O],
812f126e068Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
813f126e068SmrgAC_REQUIRE_AUX_FILE([compile])dnl
814f126e068SmrgAC_LANG_PUSH([C])dnl
815f126e068SmrgAC_CACHE_CHECK(
816f126e068Smrg  [whether $CC understands -c and -o together],
817f126e068Smrg  [am_cv_prog_cc_c_o],
818f126e068Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
819f126e068Smrg  # Make sure it works both with $CC and with simple cc.
820f126e068Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
821f126e068Smrg  # compilers refuse to overwrite an existing .o file with -o,
822f126e068Smrg  # though they will create one.
823f126e068Smrg  am_cv_prog_cc_c_o=yes
824f126e068Smrg  for am_i in 1 2; do
825f126e068Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
826f126e068Smrg         && test -f conftest2.$ac_objext; then
827f126e068Smrg      : OK
828f126e068Smrg    else
829f126e068Smrg      am_cv_prog_cc_c_o=no
830f126e068Smrg      break
831f126e068Smrg    fi
832f126e068Smrg  done
833f126e068Smrg  rm -f core conftest*
834f126e068Smrg  unset am_i])
835f126e068Smrgif test "$am_cv_prog_cc_c_o" != yes; then
836f126e068Smrg   # Losing compiler, so override with the script.
837f126e068Smrg   # FIXME: It is wrong to rewrite CC.
838f126e068Smrg   # But if we don't then we get into trouble of one sort or another.
839f126e068Smrg   # A longer-term fix would be to have automake use am__CC in this case,
840f126e068Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
841f126e068Smrg   CC="$am_aux_dir/compile $CC"
842f126e068Smrgfi
843f126e068SmrgAC_LANG_POP([C])])
844f126e068Smrg
845f126e068Smrg# For backward compatibility.
846f126e068SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
847f126e068Smrg
848f126e068Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
849dfab2fd6Smrg#
850f126e068Smrg# This file is free software; the Free Software Foundation
851f126e068Smrg# gives unlimited permission to copy and/or distribute it,
852f126e068Smrg# with or without modifications, as long as this notice is preserved.
853f126e068Smrg
854f126e068Smrg# AM_RUN_LOG(COMMAND)
855f126e068Smrg# -------------------
856f126e068Smrg# Run COMMAND, save the exit status in ac_status, and log it.
857f126e068Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
858f126e068SmrgAC_DEFUN([AM_RUN_LOG],
859f126e068Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
860f126e068Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
861f126e068Smrg   ac_status=$?
862f126e068Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
863f126e068Smrg   (exit $ac_status); }])
864f126e068Smrg
865f126e068Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
866f126e068Smrg
867f126e068Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
868dfab2fd6Smrg#
869f126e068Smrg# This file is free software; the Free Software Foundation
870f126e068Smrg# gives unlimited permission to copy and/or distribute it,
871f126e068Smrg# with or without modifications, as long as this notice is preserved.
8728b22bf3fSmrg
873f126e068Smrg# AM_SANITY_CHECK
874f126e068Smrg# ---------------
875f126e068SmrgAC_DEFUN([AM_SANITY_CHECK],
876f126e068Smrg[AC_MSG_CHECKING([whether build environment is sane])
877f126e068Smrg# Reject unsafe characters in $srcdir or the absolute working directory
878f126e068Smrg# name.  Accept space and tab only in the latter.
879f126e068Smrgam_lf='
880f126e068Smrg'
881f126e068Smrgcase `pwd` in
882f126e068Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
883f126e068Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
884f126e068Smrgesac
885f126e068Smrgcase $srcdir in
886f126e068Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
887f126e068Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
888f126e068Smrgesac
889f126e068Smrg
890f126e068Smrg# Do 'set' in a subshell so we don't clobber the current shell's
891f126e068Smrg# arguments.  Must try -L first in case configure is actually a
892f126e068Smrg# symlink; some systems play weird games with the mod time of symlinks
893f126e068Smrg# (eg FreeBSD returns the mod time of the symlink's containing
894f126e068Smrg# directory).
895f126e068Smrgif (
896f126e068Smrg   am_has_slept=no
897f126e068Smrg   for am_try in 1 2; do
898f126e068Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
899f126e068Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
900f126e068Smrg     if test "$[*]" = "X"; then
901f126e068Smrg	# -L didn't work.
902f126e068Smrg	set X `ls -t "$srcdir/configure" conftest.file`
903f126e068Smrg     fi
904f126e068Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
905f126e068Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
906f126e068Smrg
907f126e068Smrg	# If neither matched, then we have a broken ls.  This can happen
908f126e068Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
909f126e068Smrg	# broken ls alias from the environment.  This has actually
910f126e068Smrg	# happened.  Such a system could not be considered "sane".
911f126e068Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
912f126e068Smrg  alias in your environment])
913f126e068Smrg     fi
914f126e068Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
915f126e068Smrg       break
916f126e068Smrg     fi
917f126e068Smrg     # Just in case.
918f126e068Smrg     sleep 1
919f126e068Smrg     am_has_slept=yes
920f126e068Smrg   done
921f126e068Smrg   test "$[2]" = conftest.file
922f126e068Smrg   )
923f126e068Smrgthen
924f126e068Smrg   # Ok.
925f126e068Smrg   :
9268b22bf3fSmrgelse
927f126e068Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
928f126e068SmrgCheck your system clock])
9298b22bf3fSmrgfi
930f126e068SmrgAC_MSG_RESULT([yes])
931f126e068Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
932f126e068Smrg# generated files are strictly newer.
933f126e068Smrgam_sleep_pid=
934f126e068Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
935f126e068Smrg  ( sleep 1 ) &
936f126e068Smrg  am_sleep_pid=$!
937f126e068Smrgfi
938f126e068SmrgAC_CONFIG_COMMANDS_PRE(
939f126e068Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
940f126e068Smrg   if test -n "$am_sleep_pid"; then
941f126e068Smrg     # Hide warnings about reused PIDs.
942f126e068Smrg     wait $am_sleep_pid 2>/dev/null
943f126e068Smrg   fi
944f126e068Smrg   AC_MSG_RESULT([done])])
945f126e068Smrgrm -f conftest.file
946f126e068Smrg])
9478b22bf3fSmrg
948f126e068Smrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
949dfab2fd6Smrg#
950f126e068Smrg# This file is free software; the Free Software Foundation
951f126e068Smrg# gives unlimited permission to copy and/or distribute it,
952f126e068Smrg# with or without modifications, as long as this notice is preserved.
9538b22bf3fSmrg
954f126e068Smrg# AM_SILENT_RULES([DEFAULT])
955f126e068Smrg# --------------------------
956f126e068Smrg# Enable less verbose build rules; with the default set to DEFAULT
957f126e068Smrg# ("yes" being less verbose, "no" or empty being verbose).
958f126e068SmrgAC_DEFUN([AM_SILENT_RULES],
959f126e068Smrg[AC_ARG_ENABLE([silent-rules], [dnl
960f126e068SmrgAS_HELP_STRING(
961f126e068Smrg  [--enable-silent-rules],
962f126e068Smrg  [less verbose build output (undo: "make V=1")])
963f126e068SmrgAS_HELP_STRING(
964f126e068Smrg  [--disable-silent-rules],
965f126e068Smrg  [verbose build output (undo: "make V=0")])dnl
966f126e068Smrg])
967f126e068Smrgcase $enable_silent_rules in @%:@ (((
968f126e068Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
969f126e068Smrg   no) AM_DEFAULT_VERBOSITY=1;;
970f126e068Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
971f126e068Smrgesac
972f126e068Smrgdnl
973f126e068Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
974f126e068Smrgdnl do not support nested variable expansions.
975f126e068Smrgdnl See automake bug#9928 and bug#10237.
976f126e068Smrgam_make=${MAKE-make}
977f126e068SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
978f126e068Smrg   [am_cv_make_support_nested_variables],
979f126e068Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
980f126e068SmrgBAR0=false
981f126e068SmrgBAR1=true
982f126e068SmrgV=1
983f126e068Smrgam__doit:
984f126e068Smrg	@$(TRUE)
985f126e068Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
986f126e068Smrg  am_cv_make_support_nested_variables=yes
987dfab2fd6Smrgelse
988f126e068Smrg  am_cv_make_support_nested_variables=no
989dfab2fd6Smrgfi])
990f126e068Smrgif test $am_cv_make_support_nested_variables = yes; then
991f126e068Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
992f126e068Smrg  AM_V='$(V)'
993f126e068Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
994f126e068Smrgelse
995f126e068Smrg  AM_V=$AM_DEFAULT_VERBOSITY
996f126e068Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
997f126e068Smrgfi
998f126e068SmrgAC_SUBST([AM_V])dnl
999f126e068SmrgAM_SUBST_NOTMAKE([AM_V])dnl
1000f126e068SmrgAC_SUBST([AM_DEFAULT_V])dnl
1001f126e068SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1002f126e068SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1003f126e068SmrgAM_BACKSLASH='\'
1004f126e068SmrgAC_SUBST([AM_BACKSLASH])dnl
1005f126e068Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1006f126e068Smrg])
10078b22bf3fSmrg
1008f126e068Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
10098b22bf3fSmrg#
1010f126e068Smrg# This file is free software; the Free Software Foundation
1011f126e068Smrg# gives unlimited permission to copy and/or distribute it,
1012f126e068Smrg# with or without modifications, as long as this notice is preserved.
1013f126e068Smrg
1014f126e068Smrg# AM_PROG_INSTALL_STRIP
1015f126e068Smrg# ---------------------
1016f126e068Smrg# One issue with vendor 'install' (even GNU) is that you can't
1017f126e068Smrg# specify the program used to strip binaries.  This is especially
1018f126e068Smrg# annoying in cross-compiling environments, where the build's strip
1019f126e068Smrg# is unlikely to handle the host's binaries.
1020f126e068Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
1021f126e068Smrg# always use install-sh in "make install-strip", and initialize
1022f126e068Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
1023f126e068SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
1024f126e068Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1025f126e068Smrg# Installed binaries are usually stripped using 'strip' when the user
1026f126e068Smrg# run "make install-strip".  However 'strip' might not be the right
1027f126e068Smrg# tool to use in cross-compilation environments, therefore Automake
1028f126e068Smrg# will honor the 'STRIP' environment variable to overrule this program.
1029f126e068Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
1030f126e068Smrgif test "$cross_compiling" != no; then
1031f126e068Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
1032f126e068Smrgfi
1033f126e068SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1034f126e068SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1035f126e068Smrg
1036f126e068Smrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
1037dfab2fd6Smrg#
1038f126e068Smrg# This file is free software; the Free Software Foundation
1039f126e068Smrg# gives unlimited permission to copy and/or distribute it,
1040f126e068Smrg# with or without modifications, as long as this notice is preserved.
1041f126e068Smrg
1042f126e068Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
1043f126e068Smrg# ---------------------------
1044f126e068Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1045f126e068Smrg# This macro is traced by Automake.
1046f126e068SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1047f126e068Smrg
1048f126e068Smrg# AM_SUBST_NOTMAKE(VARIABLE)
1049f126e068Smrg# --------------------------
1050f126e068Smrg# Public sister of _AM_SUBST_NOTMAKE.
1051f126e068SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1052f126e068Smrg
1053f126e068Smrg# Check how to create a tarball.                            -*- Autoconf -*-
1054f126e068Smrg
1055f126e068Smrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
1056dfab2fd6Smrg#
1057f126e068Smrg# This file is free software; the Free Software Foundation
1058f126e068Smrg# gives unlimited permission to copy and/or distribute it,
1059f126e068Smrg# with or without modifications, as long as this notice is preserved.
1060f126e068Smrg
1061f126e068Smrg# _AM_PROG_TAR(FORMAT)
1062f126e068Smrg# --------------------
1063f126e068Smrg# Check how to create a tarball in format FORMAT.
1064f126e068Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1065dfab2fd6Smrg#
1066f126e068Smrg# Substitute a variable $(am__tar) that is a command
1067f126e068Smrg# writing to stdout a FORMAT-tarball containing the directory
1068f126e068Smrg# $tardir.
1069f126e068Smrg#     tardir=directory && $(am__tar) > result.tar
1070dfab2fd6Smrg#
1071f126e068Smrg# Substitute a variable $(am__untar) that extract such
1072f126e068Smrg# a tarball read from stdin.
1073f126e068Smrg#     $(am__untar) < result.tar
1074dfab2fd6Smrg#
1075f126e068SmrgAC_DEFUN([_AM_PROG_TAR],
1076f126e068Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
1077f126e068Smrg# in the wild :-(  We should find a proper way to deprecate it ...
1078f126e068SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
107996a81b41Smrg
1080f126e068Smrg# We'll loop over all known methods to create a tar archive until one works.
1081f126e068Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
10828b22bf3fSmrg
1083f126e068Smrgm4_if([$1], [v7],
1084f126e068Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1085f126e068Smrg
1086f126e068Smrg  [m4_case([$1],
1087f126e068Smrg    [ustar],
1088f126e068Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1089f126e068Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
1090f126e068Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1091f126e068Smrg      # and bug#13588).
1092f126e068Smrg      am_max_uid=2097151 # 2^21 - 1
1093f126e068Smrg      am_max_gid=$am_max_uid
1094f126e068Smrg      # The $UID and $GID variables are not portable, so we need to resort
1095f126e068Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1096f126e068Smrg      # below are definitely unexpected, so allow the users to see them
1097f126e068Smrg      # (that is, avoid stderr redirection).
1098f126e068Smrg      am_uid=`id -u || echo unknown`
1099f126e068Smrg      am_gid=`id -g || echo unknown`
1100f126e068Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1101f126e068Smrg      if test $am_uid -le $am_max_uid; then
1102f126e068Smrg         AC_MSG_RESULT([yes])
1103f126e068Smrg      else
1104f126e068Smrg         AC_MSG_RESULT([no])
1105f126e068Smrg         _am_tools=none
1106f126e068Smrg      fi
1107f126e068Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1108f126e068Smrg      if test $am_gid -le $am_max_gid; then
1109f126e068Smrg         AC_MSG_RESULT([yes])
1110f126e068Smrg      else
1111f126e068Smrg        AC_MSG_RESULT([no])
1112f126e068Smrg        _am_tools=none
1113f126e068Smrg      fi],
1114f126e068Smrg
1115f126e068Smrg  [pax],
1116f126e068Smrg    [],
1117f126e068Smrg
1118f126e068Smrg  [m4_fatal([Unknown tar format])])
1119f126e068Smrg
1120f126e068Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
1121f126e068Smrg
1122f126e068Smrg  # Go ahead even if we have the value already cached.  We do so because we
1123f126e068Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
1124f126e068Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1125f126e068Smrg
1126f126e068Smrg  for _am_tool in $_am_tools; do
1127f126e068Smrg    case $_am_tool in
1128f126e068Smrg    gnutar)
1129f126e068Smrg      for _am_tar in tar gnutar gtar; do
1130f126e068Smrg        AM_RUN_LOG([$_am_tar --version]) && break
1131f126e068Smrg      done
1132f126e068Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1133f126e068Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1134f126e068Smrg      am__untar="$_am_tar -xf -"
1135f126e068Smrg      ;;
1136f126e068Smrg    plaintar)
1137f126e068Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
1138f126e068Smrg      # ustar tarball either.
1139f126e068Smrg      (tar --version) >/dev/null 2>&1 && continue
1140f126e068Smrg      am__tar='tar chf - "$$tardir"'
1141f126e068Smrg      am__tar_='tar chf - "$tardir"'
1142f126e068Smrg      am__untar='tar xf -'
1143f126e068Smrg      ;;
1144f126e068Smrg    pax)
1145f126e068Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
1146f126e068Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
1147f126e068Smrg      am__untar='pax -r'
1148f126e068Smrg      ;;
1149f126e068Smrg    cpio)
1150f126e068Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1151f126e068Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1152f126e068Smrg      am__untar='cpio -i -H $1 -d'
1153f126e068Smrg      ;;
1154f126e068Smrg    none)
1155f126e068Smrg      am__tar=false
1156f126e068Smrg      am__tar_=false
1157f126e068Smrg      am__untar=false
1158f126e068Smrg      ;;
1159f126e068Smrg    esac
1160f126e068Smrg
1161f126e068Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
1162f126e068Smrg    # and am__untar set.
1163f126e068Smrg    test -n "${am_cv_prog_tar_$1}" && break
1164f126e068Smrg
1165f126e068Smrg    # tar/untar a dummy directory, and stop if the command works.
1166f126e068Smrg    rm -rf conftest.dir
1167f126e068Smrg    mkdir conftest.dir
1168f126e068Smrg    echo GrepMe > conftest.dir/file
1169f126e068Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1170f126e068Smrg    rm -rf conftest.dir
1171f126e068Smrg    if test -s conftest.tar; then
1172f126e068Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
1173f126e068Smrg      AM_RUN_LOG([cat conftest.dir/file])
1174f126e068Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1175dfab2fd6Smrg    fi
1176f126e068Smrg  done
1177f126e068Smrg  rm -rf conftest.dir
117896a81b41Smrg
1179f126e068Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1180f126e068Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
118196a81b41Smrg
1182f126e068SmrgAC_SUBST([am__tar])
1183f126e068SmrgAC_SUBST([am__untar])
1184f126e068Smrg]) # _AM_PROG_TAR
118596a81b41Smrg
1186f126e068Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1187f126e068Smrg# 
1188f126e068Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
11898b22bf3fSmrg#
1190f126e068Smrg# This program is free software; you can redistribute it and/or modify
1191f126e068Smrg# it under the terms of the GNU General Public License as published by
1192f126e068Smrg# the Free Software Foundation; either version 2 of the License, or
1193f126e068Smrg# (at your option) any later version.
11948b22bf3fSmrg#
1195f126e068Smrg# This program is distributed in the hope that it will be useful, but
1196f126e068Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1197f126e068Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1198f126e068Smrg# General Public License for more details.
11998b22bf3fSmrg#
1200f126e068Smrg# You should have received a copy of the GNU General Public License
1201f126e068Smrg# along with this program; if not, write to the Free Software
1202f126e068Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
12038b22bf3fSmrg#
1204f126e068Smrg# As a special exception to the GNU General Public License, if you
1205f126e068Smrg# distribute this file as part of a program that contains a
1206f126e068Smrg# configuration script generated by Autoconf, you may include it under
1207f126e068Smrg# the same distribution terms that you use for the rest of that program.
12088b22bf3fSmrg
1209f126e068Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1210f126e068Smrg# ----------------------------------
1211f126e068SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
1212f126e068Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1213f126e068Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1214f126e068SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1215f126e068Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1216f126e068Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1217dfab2fd6Smrgfi
1218f126e068Smrgif test -n "$PKG_CONFIG"; then
1219f126e068Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
1220f126e068Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1221f126e068Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1222f126e068Smrg		AC_MSG_RESULT([yes])
1223f126e068Smrg	else
1224f126e068Smrg		AC_MSG_RESULT([no])
1225f126e068Smrg		PKG_CONFIG=""
1226f126e068Smrg	fi
1227f126e068Smrg		
1228f126e068Smrgfi[]dnl
1229f126e068Smrg])# PKG_PROG_PKG_CONFIG
12308b22bf3fSmrg
1231f126e068Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1232d13010c3Smrg#
1233f126e068Smrg# Check to see whether a particular set of modules exists.  Similar
1234f126e068Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1235d13010c3Smrg#
1236d13010c3Smrg#
1237f126e068Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1238f126e068Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
1239f126e068Smrg# PKG_CHECK_EXISTS manually
1240f126e068Smrg# --------------------------------------------------------------
1241f126e068SmrgAC_DEFUN([PKG_CHECK_EXISTS],
1242f126e068Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1243f126e068Smrgif test -n "$PKG_CONFIG" && \
1244f126e068Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1245f126e068Smrg  m4_ifval([$2], [$2], [:])
1246f126e068Smrgm4_ifvaln([$3], [else
1247f126e068Smrg  $3])dnl
1248f126e068Smrgfi])
1249d13010c3Smrg
1250f126e068Smrg
1251f126e068Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1252f126e068Smrg# ---------------------------------------------
1253f126e068Smrgm4_define([_PKG_CONFIG],
1254f126e068Smrg[if test -n "$$1"; then
1255f126e068Smrg    pkg_cv_[]$1="$$1"
1256f126e068Smrg elif test -n "$PKG_CONFIG"; then
1257f126e068Smrg    PKG_CHECK_EXISTS([$3],
1258f126e068Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1259f126e068Smrg		     [pkg_failed=yes])
1260f126e068Smrg else
1261f126e068Smrg    pkg_failed=untried
1262f126e068Smrgfi[]dnl
1263f126e068Smrg])# _PKG_CONFIG
1264f126e068Smrg
1265f126e068Smrg# _PKG_SHORT_ERRORS_SUPPORTED
1266f126e068Smrg# -----------------------------
1267f126e068SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1268f126e068Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1269f126e068Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1270f126e068Smrg        _pkg_short_errors_supported=yes
1271dfab2fd6Smrgelse
1272f126e068Smrg        _pkg_short_errors_supported=no
1273f126e068Smrgfi[]dnl
1274f126e068Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
1275d13010c3Smrg
1276d13010c3Smrg
1277f126e068Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1278f126e068Smrg# [ACTION-IF-NOT-FOUND])
1279d13010c3Smrg#
1280d13010c3Smrg#
1281f126e068Smrg# Note that if there is a possibility the first call to
1282f126e068Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
1283f126e068Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1284dfab2fd6Smrg#
1285dfab2fd6Smrg#
1286f126e068Smrg# --------------------------------------------------------------
1287f126e068SmrgAC_DEFUN([PKG_CHECK_MODULES],
1288f126e068Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1289f126e068SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1290f126e068SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1291d13010c3Smrg
1292f126e068Smrgpkg_failed=no
1293f126e068SmrgAC_MSG_CHECKING([for $1])
1294d13010c3Smrg
1295f126e068Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1296f126e068Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1297d13010c3Smrg
1298f126e068Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1299f126e068Smrgand $1[]_LIBS to avoid the need to call pkg-config.
1300f126e068SmrgSee the pkg-config man page for more details.])
1301f126e068Smrg
1302f126e068Smrgif test $pkg_failed = yes; then
1303f126e068Smrg        _PKG_SHORT_ERRORS_SUPPORTED
1304f126e068Smrg        if test $_pkg_short_errors_supported = yes; then
1305f126e068Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1306f126e068Smrg        else 
1307f126e068Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1308f126e068Smrg        fi
1309f126e068Smrg	# Put the nasty error message in config.log where it belongs
1310f126e068Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1311f126e068Smrg
1312f126e068Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
1313f126e068Smrg[Package requirements ($2) were not met:
1314f126e068Smrg
1315f126e068Smrg$$1_PKG_ERRORS
1316f126e068Smrg
1317f126e068SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1318f126e068Smrginstalled software in a non-standard prefix.
1319f126e068Smrg
1320f126e068Smrg_PKG_TEXT
1321f126e068Smrg])],
1322f126e068Smrg		[AC_MSG_RESULT([no])
1323f126e068Smrg                $4])
1324f126e068Smrgelif test $pkg_failed = untried; then
1325f126e068Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
1326f126e068Smrg[The pkg-config script could not be found or is too old.  Make sure it
1327f126e068Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
1328f126e068Smrgpath to pkg-config.
1329f126e068Smrg
1330f126e068Smrg_PKG_TEXT
1331f126e068Smrg
1332f126e068SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1333f126e068Smrg		[$4])
1334dfab2fd6Smrgelse
1335f126e068Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1336f126e068Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1337f126e068Smrg        AC_MSG_RESULT([yes])
1338f126e068Smrg	ifelse([$3], , :, [$3])
1339f126e068Smrgfi[]dnl
1340f126e068Smrg])# PKG_CHECK_MODULES
1341d13010c3Smrg
1342f126e068Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1343f126e068Smrgdnl
1344f126e068Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1345f126e068Smrgdnl
1346f126e068Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1347f126e068Smrgdnl copy of this software and associated documentation files (the "Software"),
1348f126e068Smrgdnl to deal in the Software without restriction, including without limitation
1349f126e068Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1350f126e068Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
1351f126e068Smrgdnl Software is furnished to do so, subject to the following conditions:
1352f126e068Smrgdnl
1353f126e068Smrgdnl The above copyright notice and this permission notice (including the next
1354f126e068Smrgdnl paragraph) shall be included in all copies or substantial portions of the
1355f126e068Smrgdnl Software.
1356f126e068Smrgdnl
1357f126e068Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1358f126e068Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1359f126e068Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1360f126e068Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1361f126e068Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1362f126e068Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1363f126e068Smrgdnl DEALINGS IN THE SOFTWARE.
1364d13010c3Smrg
1365f126e068Smrg# XORG_MACROS_VERSION(required-version)
1366f126e068Smrg# -------------------------------------
1367dfab2fd6Smrg# Minimum version: 1.1.0
1368dfab2fd6Smrg#
1369f126e068Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1370f126e068Smrg# your configure.ac with the minimum required version, such as:
1371f126e068Smrg# XORG_MACROS_VERSION(1.1)
1372dfab2fd6Smrg#
1373f126e068Smrg# To ensure that this macro is defined, also add:
1374f126e068Smrg# m4_ifndef([XORG_MACROS_VERSION],
1375f126e068Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1376dfab2fd6Smrg#
1377dfab2fd6Smrg#
1378f126e068Smrg# See the "minimum version" comment for each macro you use to see what
1379f126e068Smrg# version you require.
1380f126e068Smrgm4_defun([XORG_MACROS_VERSION],[
1381f126e068Smrgm4_define([vers_have], [1.17.1])
1382f126e068Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1383f126e068Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1384f126e068Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1385f126e068Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1386f126e068Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1387f126e068Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1388f126e068Smrgm4_undefine([vers_have])
1389f126e068Smrgm4_undefine([maj_have])
1390f126e068Smrgm4_undefine([maj_needed])
1391f126e068Smrg]) # XORG_MACROS_VERSION
1392d13010c3Smrg
1393f126e068Smrg# XORG_PROG_RAWCPP()
1394f126e068Smrg# ------------------
1395f126e068Smrg# Minimum version: 1.0.0
1396f126e068Smrg#
1397f126e068Smrg# Find cpp program and necessary flags for use in pre-processing text files
1398f126e068Smrg# such as man pages and config files
1399f126e068SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1400f126e068SmrgAC_REQUIRE([AC_PROG_CPP])
1401f126e068SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
1402f126e068Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1403d13010c3Smrg
1404f126e068Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1405f126e068Smrg# which is not the best choice for supporting other OS'es, but covers most
1406f126e068Smrg# of the ones we need for now.
1407f126e068SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1408f126e068SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
1409f126e068Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1410f126e068Smrg	AC_MSG_RESULT([no])
1411dfab2fd6Smrgelse
1412f126e068Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1413f126e068Smrg		RAWCPPFLAGS=-undef
1414f126e068Smrg		AC_MSG_RESULT([yes])
1415f126e068Smrg	# under Cygwin unix is still defined even with -undef
1416f126e068Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1417f126e068Smrg		RAWCPPFLAGS="-undef -ansi"
1418f126e068Smrg		AC_MSG_RESULT([yes, with -ansi])
1419f126e068Smrg	else
1420f126e068Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1421f126e068Smrg	fi
1422dfab2fd6Smrgfi
1423f126e068Smrgrm -f conftest.$ac_ext
1424d13010c3Smrg
1425f126e068SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1426f126e068SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
1427f126e068Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1428f126e068Smrg	AC_MSG_RESULT([no])
1429f126e068Smrgelse
1430f126e068Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1431f126e068Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1432f126e068Smrg		AC_MSG_RESULT([yes])
1433f126e068Smrg	else
1434f126e068Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1435f126e068Smrg	fi
1436dfab2fd6Smrgfi
1437f126e068Smrgrm -f conftest.$ac_ext
1438f126e068SmrgAC_SUBST(RAWCPPFLAGS)
1439f126e068Smrg]) # XORG_PROG_RAWCPP
1440d13010c3Smrg
1441f126e068Smrg# XORG_MANPAGE_SECTIONS()
1442f126e068Smrg# -----------------------
1443f126e068Smrg# Minimum version: 1.0.0
14448b22bf3fSmrg#
1445f126e068Smrg# Determine which sections man pages go in for the different man page types
1446f126e068Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1447f126e068Smrg# Not sure if there's any better way than just hardcoding by OS name.
1448f126e068Smrg# Override default settings by setting environment variables
1449f126e068Smrg# Added MAN_SUBSTS in version 1.8
1450f126e068Smrg# Added AC_PROG_SED in version 1.8
14518b22bf3fSmrg
1452f126e068SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1453f126e068SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1454f126e068SmrgAC_REQUIRE([AC_PROG_SED])
14558b22bf3fSmrg
1456f126e068Smrgif test x$APP_MAN_SUFFIX = x    ; then
1457f126e068Smrg    APP_MAN_SUFFIX=1
1458f126e068Smrgfi
1459f126e068Smrgif test x$APP_MAN_DIR = x    ; then
1460f126e068Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
14618b22bf3fSmrgfi
14628b22bf3fSmrg
1463f126e068Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1464f126e068Smrg    LIB_MAN_SUFFIX=3
1465f126e068Smrgfi
1466f126e068Smrgif test x$LIB_MAN_DIR = x    ; then
1467f126e068Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1468f126e068Smrgfi
1469dfab2fd6Smrg
1470f126e068Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1471f126e068Smrg    case $host_os in
1472f126e068Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1473f126e068Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1474f126e068Smrg    esac
1475f126e068Smrgfi
1476f126e068Smrgif test x$FILE_MAN_DIR = x    ; then
1477f126e068Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1478f126e068Smrgfi
1479dfab2fd6Smrg
1480f126e068Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1481f126e068Smrg    case $host_os in
1482f126e068Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1483f126e068Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1484dfab2fd6Smrg    esac
14858b22bf3fSmrgfi
1486f126e068Smrgif test x$MISC_MAN_DIR = x    ; then
1487f126e068Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1488f126e068Smrgfi
14898b22bf3fSmrg
1490f126e068Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1491f126e068Smrg    case $host_os in
1492f126e068Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1493f126e068Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1494f126e068Smrg    esac
1495f126e068Smrgfi
1496f126e068Smrgif test x$DRIVER_MAN_DIR = x    ; then
1497f126e068Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1498f126e068Smrgfi
14998b22bf3fSmrg
1500f126e068Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1501f126e068Smrg    case $host_os in
1502f126e068Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1503f126e068Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1504f126e068Smrg    esac
1505f126e068Smrgfi
1506f126e068Smrgif test x$ADMIN_MAN_DIR = x    ; then
1507f126e068Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
15088b22bf3fSmrgfi
15098b22bf3fSmrg
15108b22bf3fSmrg
1511f126e068SmrgAC_SUBST([APP_MAN_SUFFIX])
1512f126e068SmrgAC_SUBST([LIB_MAN_SUFFIX])
1513f126e068SmrgAC_SUBST([FILE_MAN_SUFFIX])
1514f126e068SmrgAC_SUBST([MISC_MAN_SUFFIX])
1515f126e068SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1516f126e068SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1517f126e068SmrgAC_SUBST([APP_MAN_DIR])
1518f126e068SmrgAC_SUBST([LIB_MAN_DIR])
1519f126e068SmrgAC_SUBST([FILE_MAN_DIR])
1520f126e068SmrgAC_SUBST([MISC_MAN_DIR])
1521f126e068SmrgAC_SUBST([DRIVER_MAN_DIR])
1522f126e068SmrgAC_SUBST([ADMIN_MAN_DIR])
15238b22bf3fSmrg
1524f126e068SmrgXORG_MAN_PAGE="X Version 11"
1525f126e068SmrgAC_SUBST([XORG_MAN_PAGE])
1526f126e068SmrgMAN_SUBSTS="\
1527f126e068Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1528f126e068Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1529f126e068Smrg	-e 's|__xservername__|Xorg|g' \
1530f126e068Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
1531f126e068Smrg	-e 's|__projectroot__|\$(prefix)|g' \
1532f126e068Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1533f126e068Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1534f126e068Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1535f126e068Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1536f126e068Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1537f126e068Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1538f126e068Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1539f126e068SmrgAC_SUBST([MAN_SUBSTS])
15408b22bf3fSmrg
1541f126e068Smrg]) # XORG_MANPAGE_SECTIONS
15425bd32fd1Smrg
1543f126e068Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1544f126e068Smrg# ------------------------
1545f126e068Smrg# Minimum version: 1.7.0
1546dfab2fd6Smrg#
1547f126e068Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1548f126e068Smrg# provided by xorg-sgml-doctools, if installed.
1549f126e068SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1550f126e068SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1551f126e068SmrgXORG_SGML_PATH=
1552f126e068SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1553f126e068Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1554f126e068Smrg    [m4_ifval([$1],[:],
1555f126e068Smrg        [if test x"$cross_compiling" != x"yes" ; then
1556f126e068Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1557f126e068Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1558f126e068Smrg         fi])
1559f126e068Smrg    ])
15605bd32fd1Smrg
1561f126e068Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1562f126e068Smrg# the path and the name of the doc stylesheet
1563f126e068Smrgif test "x$XORG_SGML_PATH" != "x" ; then
1564f126e068Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1565f126e068Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1566f126e068Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1567f126e068Smrgelse
1568f126e068Smrg   AC_MSG_RESULT([no])
1569f126e068Smrgfi
15705bd32fd1Smrg
1571f126e068SmrgAC_SUBST(XORG_SGML_PATH)
1572f126e068SmrgAC_SUBST(STYLESHEET_SRCDIR)
1573f126e068SmrgAC_SUBST(XSL_STYLESHEET)
1574f126e068SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1575f126e068Smrg]) # XORG_CHECK_SGML_DOCTOOLS
15765bd32fd1Smrg
1577f126e068Smrg# XORG_CHECK_LINUXDOC
1578f126e068Smrg# -------------------
1579f126e068Smrg# Minimum version: 1.0.0
15808b22bf3fSmrg#
1581f126e068Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1582f126e068Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1583f126e068Smrg# Whether or not the necessary tools and files are found can be checked
1584f126e068Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1585f126e068SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1586f126e068SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1587f126e068SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
15888b22bf3fSmrg
1589f126e068SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
15908b22bf3fSmrg
1591f126e068SmrgAC_MSG_CHECKING([whether to build documentation])
15928b22bf3fSmrg
1593f126e068Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1594f126e068Smrg   BUILDDOC=yes
1595f126e068Smrgelse
1596f126e068Smrg   BUILDDOC=no
1597f126e068Smrgfi
15988b22bf3fSmrg
1599f126e068SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
16008b22bf3fSmrg
1601f126e068SmrgAC_MSG_RESULT([$BUILDDOC])
16028b22bf3fSmrg
1603f126e068SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1604f126e068Smrg
1605f126e068Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1606f126e068Smrg   BUILDPDFDOC=yes
16078b22bf3fSmrgelse
1608f126e068Smrg   BUILDPDFDOC=no
16098b22bf3fSmrgfi
16108b22bf3fSmrg
1611f126e068SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
16128b22bf3fSmrg
1613f126e068SmrgAC_MSG_RESULT([$BUILDPDFDOC])
16148b22bf3fSmrg
1615f126e068SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1616f126e068SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1617f126e068SmrgMAKE_PDF="$PS2PDF"
1618f126e068SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
16198b22bf3fSmrg
1620f126e068SmrgAC_SUBST(MAKE_TEXT)
1621f126e068SmrgAC_SUBST(MAKE_PS)
1622f126e068SmrgAC_SUBST(MAKE_PDF)
1623f126e068SmrgAC_SUBST(MAKE_HTML)
1624f126e068Smrg]) # XORG_CHECK_LINUXDOC
16258b22bf3fSmrg
1626f126e068Smrg# XORG_CHECK_DOCBOOK
1627f126e068Smrg# -------------------
1628f126e068Smrg# Minimum version: 1.0.0
16298b22bf3fSmrg#
1630f126e068Smrg# Checks for the ability to build output formats from SGML DocBook source.
1631f126e068Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1632f126e068Smrg# indicates whether the necessary tools and files are found and, if set,
1633f126e068Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1634f126e068SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1635f126e068SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
16365bd32fd1Smrg
1637f126e068SmrgBUILDTXTDOC=no
1638f126e068SmrgBUILDPDFDOC=no
1639f126e068SmrgBUILDPSDOC=no
1640f126e068SmrgBUILDHTMLDOC=no
16418b22bf3fSmrg
1642f126e068SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1643f126e068SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1644f126e068SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1645f126e068SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
16468b22bf3fSmrg
1647f126e068SmrgAC_MSG_CHECKING([whether to build text documentation])
1648f126e068Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1649f126e068Smrg   test x$BUILD_TXTDOC != xno; then
1650f126e068Smrg	BUILDTXTDOC=yes
1651f126e068Smrgfi
1652f126e068SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1653f126e068SmrgAC_MSG_RESULT([$BUILDTXTDOC])
16548b22bf3fSmrg
1655f126e068SmrgAC_MSG_CHECKING([whether to build PDF documentation])
1656f126e068Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1657f126e068Smrg   test x$BUILD_PDFDOC != xno; then
1658f126e068Smrg	BUILDPDFDOC=yes
1659f126e068Smrgfi
1660f126e068SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1661f126e068SmrgAC_MSG_RESULT([$BUILDPDFDOC])
16628b22bf3fSmrg
1663f126e068SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1664f126e068Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1665f126e068Smrg   test x$BUILD_PSDOC != xno; then
1666f126e068Smrg	BUILDPSDOC=yes
1667f126e068Smrgfi
1668f126e068SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1669f126e068SmrgAC_MSG_RESULT([$BUILDPSDOC])
16708b22bf3fSmrg
1671f126e068SmrgAC_MSG_CHECKING([whether to build HTML documentation])
1672f126e068Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1673f126e068Smrg   test x$BUILD_HTMLDOC != xno; then
1674f126e068Smrg	BUILDHTMLDOC=yes
16758b22bf3fSmrgfi
1676f126e068SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1677f126e068SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
16788b22bf3fSmrg
1679f126e068SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1680f126e068SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1681f126e068SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1682f126e068SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
16838b22bf3fSmrg
1684f126e068SmrgAC_SUBST(MAKE_TEXT)
1685f126e068SmrgAC_SUBST(MAKE_PS)
1686f126e068SmrgAC_SUBST(MAKE_PDF)
1687f126e068SmrgAC_SUBST(MAKE_HTML)
1688f126e068Smrg]) # XORG_CHECK_DOCBOOK
16898b22bf3fSmrg
1690f126e068Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1691f126e068Smrg# ----------------
1692f126e068Smrg# Minimum version: 1.5.0
1693f126e068Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1694f126e068Smrg#
1695f126e068Smrg# Documentation tools are not always available on all platforms and sometimes
1696f126e068Smrg# not at the appropriate level. This macro enables a module to test for the
1697f126e068Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1698f126e068Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1699f126e068Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1700f126e068Smrg# --with-xmlto assumes 'auto'.
1701f126e068Smrg#
1702f126e068Smrg# Interface to module:
1703f126e068Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1704f126e068Smrg# XMLTO:	returns the path of the xmlto program found
1705f126e068Smrg#		returns the path set by the user in the environment
1706f126e068Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1707f126e068Smrg#		'no' user instructs the module not to use xmlto
1708f126e068Smrg#
1709f126e068Smrg# Added in version 1.10.0
1710f126e068Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1711f126e068Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1712f126e068Smrg#
1713f126e068Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1714f126e068Smrg#
1715f126e068SmrgAC_DEFUN([XORG_WITH_XMLTO],[
1716f126e068SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1717f126e068Smrgm4_define([_defopt], m4_default([$2], [auto]))
1718f126e068SmrgAC_ARG_WITH(xmlto,
1719f126e068Smrg	AS_HELP_STRING([--with-xmlto],
1720f126e068Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1721f126e068Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1722f126e068Smrgm4_undefine([_defopt])
17235bd32fd1Smrg
1724f126e068Smrgif test "x$use_xmlto" = x"auto"; then
1725f126e068Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1726f126e068Smrg   if test "x$XMLTO" = "x"; then
1727f126e068Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1728f126e068Smrg	have_xmlto=no
1729f126e068Smrg   else
1730f126e068Smrg        have_xmlto=yes
1731f126e068Smrg   fi
1732f126e068Smrgelif test "x$use_xmlto" = x"yes" ; then
1733f126e068Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1734f126e068Smrg   if test "x$XMLTO" = "x"; then
1735f126e068Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1736f126e068Smrg   fi
1737f126e068Smrg   have_xmlto=yes
1738f126e068Smrgelif test "x$use_xmlto" = x"no" ; then
1739f126e068Smrg   if test "x$XMLTO" != "x"; then
1740f126e068Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1741f126e068Smrg   fi
1742f126e068Smrg   have_xmlto=no
1743f126e068Smrgelse
1744f126e068Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
17455bd32fd1Smrgfi
17465bd32fd1Smrg
1747f126e068Smrg# Test for a minimum version of xmlto, if provided.
1748f126e068Smrgm4_ifval([$1],
1749f126e068Smrg[if test "$have_xmlto" = yes; then
1750f126e068Smrg    # scrape the xmlto version
1751f126e068Smrg    AC_MSG_CHECKING([the xmlto version])
1752f126e068Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1753f126e068Smrg    AC_MSG_RESULT([$xmlto_version])
1754f126e068Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1755f126e068Smrg        [if test "x$use_xmlto" = xauto; then
1756f126e068Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1757f126e068Smrg            have_xmlto=no
1758f126e068Smrg        else
1759f126e068Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1760f126e068Smrg        fi])
1761f126e068Smrgfi])
1762f126e068Smrg
1763f126e068Smrg# Test for the ability of xmlto to generate a text target
1764f126e068Smrghave_xmlto_text=no
1765f126e068Smrgcat > conftest.xml << "EOF"
1766f126e068SmrgEOF
1767f126e068SmrgAS_IF([test "$have_xmlto" = yes],
1768f126e068Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1769f126e068Smrg             [have_xmlto_text=yes],
1770f126e068Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1771f126e068Smrgrm -f conftest.xml
1772f126e068SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1773f126e068SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1774f126e068Smrg]) # XORG_WITH_XMLTO
17755bd32fd1Smrg
1776f126e068Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1777f126e068Smrg# --------------------------------------------
1778f126e068Smrg# Minimum version: 1.12.0
1779f126e068Smrg# Minimum version for optional DEFAULT argument: 1.12.0
17805bd32fd1Smrg#
1781f126e068Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1782f126e068Smrg# XML-based language used for the transformation of XML documents.
1783f126e068Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1784f126e068Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
1785f126e068Smrg# The XSLT processor is often used as a standalone tool for transformations.
1786f126e068Smrg# It should not be assumed that this tool is used only to work with documnetation.
1787f126e068Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
1788f126e068Smrg#
1789f126e068Smrg# Interface to module:
1790f126e068Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1791f126e068Smrg# XSLTPROC:	 returns the path of the xsltproc program found
1792f126e068Smrg#		 returns the path set by the user in the environment
1793f126e068Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1794f126e068Smrg#		  'no' user instructs the module not to use xsltproc
1795f126e068Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
1796f126e068Smrg#
1797f126e068Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
1798f126e068Smrg#
1799f126e068SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
1800f126e068SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1801f126e068Smrg# Preserves the interface, should it be implemented later
1802f126e068Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1803f126e068Smrgm4_define([_defopt], m4_default([$2], [auto]))
1804f126e068SmrgAC_ARG_WITH(xsltproc,
1805f126e068Smrg	AS_HELP_STRING([--with-xsltproc],
1806f126e068Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1807f126e068Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1808f126e068Smrgm4_undefine([_defopt])
18095bd32fd1Smrg
1810f126e068Smrgif test "x$use_xsltproc" = x"auto"; then
1811f126e068Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1812f126e068Smrg   if test "x$XSLTPROC" = "x"; then
1813f126e068Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1814f126e068Smrg	have_xsltproc=no
1815f126e068Smrg   else
1816f126e068Smrg        have_xsltproc=yes
1817f126e068Smrg   fi
1818f126e068Smrgelif test "x$use_xsltproc" = x"yes" ; then
1819f126e068Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1820f126e068Smrg   if test "x$XSLTPROC" = "x"; then
1821f126e068Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1822f126e068Smrg   fi
1823f126e068Smrg   have_xsltproc=yes
1824f126e068Smrgelif test "x$use_xsltproc" = x"no" ; then
1825f126e068Smrg   if test "x$XSLTPROC" != "x"; then
1826f126e068Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1827f126e068Smrg   fi
1828f126e068Smrg   have_xsltproc=no
1829f126e068Smrgelse
1830f126e068Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1831f126e068Smrgfi
18325bd32fd1Smrg
1833f126e068SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1834f126e068Smrg]) # XORG_WITH_XSLTPROC
1835f126e068Smrg
1836f126e068Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1837f126e068Smrg# ----------------------------------------
1838f126e068Smrg# Minimum version: 1.15.0
1839f126e068Smrg#
1840f126e068Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
1841f126e068Smrg# scanning arbitrary text files, extracting information from those text files,
1842f126e068Smrg# and printing reports based on that information.
1843f126e068Smrg#
1844f126e068Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
1845f126e068Smrg#
1846f126e068Smrg# Interface to module:
1847f126e068Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
1848f126e068Smrg# PERL:	     returns the path of the perl program found
1849f126e068Smrg#	     returns the path set by the user in the environment
1850f126e068Smrg# --with-perl: 'yes' user instructs the module to use perl
1851f126e068Smrg#	       'no' user instructs the module not to use perl
1852f126e068Smrg# have_perl: returns yes if perl found in PATH or no
1853f126e068Smrg#
1854f126e068Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1855f126e068Smrg#
1856f126e068SmrgAC_DEFUN([XORG_WITH_PERL],[
1857f126e068SmrgAC_ARG_VAR([PERL], [Path to perl command])
1858f126e068Smrg# Preserves the interface, should it be implemented later
1859f126e068Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1860f126e068Smrgm4_define([_defopt], m4_default([$2], [auto]))
1861f126e068SmrgAC_ARG_WITH(perl,
1862f126e068Smrg	AS_HELP_STRING([--with-perl],
1863f126e068Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
1864f126e068Smrg	   [use_perl=$withval], [use_perl=]_defopt)
1865f126e068Smrgm4_undefine([_defopt])
18665bd32fd1Smrg
1867f126e068Smrgif test "x$use_perl" = x"auto"; then
1868f126e068Smrg   AC_PATH_PROG([PERL], [perl])
1869f126e068Smrg   if test "x$PERL" = "x"; then
1870f126e068Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
1871f126e068Smrg	have_perl=no
1872f126e068Smrg   else
1873f126e068Smrg        have_perl=yes
1874f126e068Smrg   fi
1875f126e068Smrgelif test "x$use_perl" = x"yes" ; then
1876f126e068Smrg   AC_PATH_PROG([PERL], [perl])
1877f126e068Smrg   if test "x$PERL" = "x"; then
1878f126e068Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1879f126e068Smrg   fi
1880f126e068Smrg   have_perl=yes
1881f126e068Smrgelif test "x$use_perl" = x"no" ; then
1882f126e068Smrg   if test "x$PERL" != "x"; then
1883f126e068Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1884f126e068Smrg   fi
1885f126e068Smrg   have_perl=no
1886f126e068Smrgelse
1887f126e068Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1888f126e068Smrgfi
18895bd32fd1Smrg
1890f126e068SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
1891f126e068Smrg]) # XORG_WITH_PERL
1892f126e068Smrg
1893f126e068Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1894f126e068Smrg# ----------------
1895f126e068Smrg# Minimum version: 1.5.0
1896f126e068Smrg# Minimum version for optional DEFAULT argument: 1.11.0
18975bd32fd1Smrg#
1898f126e068Smrg# Documentation tools are not always available on all platforms and sometimes
1899f126e068Smrg# not at the appropriate level. This macro enables a module to test for the
1900f126e068Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1901f126e068Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1902f126e068Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1903f126e068Smrg# --with-asciidoc assumes 'auto'.
1904f126e068Smrg#
1905f126e068Smrg# Interface to module:
1906f126e068Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1907f126e068Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
1908f126e068Smrg#		 returns the path set by the user in the environment
1909f126e068Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1910f126e068Smrg#		  'no' user instructs the module not to use asciidoc
1911f126e068Smrg#
1912f126e068Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1913f126e068Smrg#
1914f126e068SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1915f126e068SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1916f126e068Smrgm4_define([_defopt], m4_default([$2], [auto]))
1917f126e068SmrgAC_ARG_WITH(asciidoc,
1918f126e068Smrg	AS_HELP_STRING([--with-asciidoc],
1919f126e068Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1920f126e068Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1921f126e068Smrgm4_undefine([_defopt])
1922dfab2fd6Smrg
1923f126e068Smrgif test "x$use_asciidoc" = x"auto"; then
1924f126e068Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1925f126e068Smrg   if test "x$ASCIIDOC" = "x"; then
1926f126e068Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1927f126e068Smrg	have_asciidoc=no
1928f126e068Smrg   else
1929f126e068Smrg        have_asciidoc=yes
1930f126e068Smrg   fi
1931f126e068Smrgelif test "x$use_asciidoc" = x"yes" ; then
1932f126e068Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1933f126e068Smrg   if test "x$ASCIIDOC" = "x"; then
1934f126e068Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1935f126e068Smrg   fi
1936f126e068Smrg   have_asciidoc=yes
1937f126e068Smrgelif test "x$use_asciidoc" = x"no" ; then
1938f126e068Smrg   if test "x$ASCIIDOC" != "x"; then
1939f126e068Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1940f126e068Smrg   fi
1941f126e068Smrg   have_asciidoc=no
1942f126e068Smrgelse
1943f126e068Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1944f126e068Smrgfi
1945f126e068Smrgm4_ifval([$1],
1946f126e068Smrg[if test "$have_asciidoc" = yes; then
1947f126e068Smrg    # scrape the asciidoc version
1948f126e068Smrg    AC_MSG_CHECKING([the asciidoc version])
1949f126e068Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1950f126e068Smrg    AC_MSG_RESULT([$asciidoc_version])
1951f126e068Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1952f126e068Smrg        [if test "x$use_asciidoc" = xauto; then
1953f126e068Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1954f126e068Smrg            have_asciidoc=no
1955f126e068Smrg        else
1956f126e068Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1957f126e068Smrg        fi])
1958f126e068Smrgfi])
1959f126e068SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1960f126e068Smrg]) # XORG_WITH_ASCIIDOC
1961dfab2fd6Smrg
1962f126e068Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1963f126e068Smrg# --------------------------------
1964f126e068Smrg# Minimum version: 1.5.0
1965f126e068Smrg# Minimum version for optional DEFAULT argument: 1.11.0
19665bd32fd1Smrg#
1967f126e068Smrg# Documentation tools are not always available on all platforms and sometimes
1968f126e068Smrg# not at the appropriate level. This macro enables a module to test for the
1969f126e068Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1970f126e068Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1971f126e068Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1972f126e068Smrg# --with-doxygen assumes 'auto'.
1973f126e068Smrg#
1974f126e068Smrg# Interface to module:
1975f126e068Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1976f126e068Smrg# DOXYGEN:	 returns the path of the doxygen program found
1977f126e068Smrg#		 returns the path set by the user in the environment
1978f126e068Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1979f126e068Smrg#		  'no' user instructs the module not to use doxygen
1980f126e068Smrg#
1981f126e068Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1982f126e068Smrg#
1983f126e068SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1984f126e068SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1985f126e068Smrgm4_define([_defopt], m4_default([$2], [auto]))
1986f126e068SmrgAC_ARG_WITH(doxygen,
1987f126e068Smrg	AS_HELP_STRING([--with-doxygen],
1988f126e068Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1989f126e068Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1990f126e068Smrgm4_undefine([_defopt])
19915bd32fd1Smrg
1992f126e068Smrgif test "x$use_doxygen" = x"auto"; then
1993f126e068Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1994f126e068Smrg   if test "x$DOXYGEN" = "x"; then
1995f126e068Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1996f126e068Smrg	have_doxygen=no
1997f126e068Smrg   else
1998f126e068Smrg        have_doxygen=yes
1999f126e068Smrg   fi
2000f126e068Smrgelif test "x$use_doxygen" = x"yes" ; then
2001f126e068Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
2002f126e068Smrg   if test "x$DOXYGEN" = "x"; then
2003f126e068Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
2004f126e068Smrg   fi
2005f126e068Smrg   have_doxygen=yes
2006f126e068Smrgelif test "x$use_doxygen" = x"no" ; then
2007f126e068Smrg   if test "x$DOXYGEN" != "x"; then
2008f126e068Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
2009f126e068Smrg   fi
2010f126e068Smrg   have_doxygen=no
2011f126e068Smrgelse
2012f126e068Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
2013f126e068Smrgfi
2014f126e068Smrgm4_ifval([$1],
2015f126e068Smrg[if test "$have_doxygen" = yes; then
2016f126e068Smrg    # scrape the doxygen version
2017f126e068Smrg    AC_MSG_CHECKING([the doxygen version])
2018f126e068Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
2019f126e068Smrg    AC_MSG_RESULT([$doxygen_version])
2020f126e068Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
2021f126e068Smrg        [if test "x$use_doxygen" = xauto; then
2022f126e068Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
2023f126e068Smrg            have_doxygen=no
2024f126e068Smrg        else
2025f126e068Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
2026f126e068Smrg        fi])
2027f126e068Smrgfi])
2028f126e068SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
2029f126e068Smrg]) # XORG_WITH_DOXYGEN
2030dfab2fd6Smrg
2031f126e068Smrg# XORG_WITH_GROFF([DEFAULT])
2032f126e068Smrg# ----------------
2033f126e068Smrg# Minimum version: 1.6.0
2034f126e068Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2035f126e068Smrg#
2036f126e068Smrg# Documentation tools are not always available on all platforms and sometimes
2037f126e068Smrg# not at the appropriate level. This macro enables a module to test for the
2038f126e068Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2039f126e068Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
2040f126e068Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
2041f126e068Smrg# --with-groff assumes 'auto'.
2042f126e068Smrg#
2043f126e068Smrg# Interface to module:
2044f126e068Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
2045f126e068Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
2046f126e068Smrg# HAVE_GROFF_MS: the -ms macros package
2047f126e068Smrg# GROFF:	 returns the path of the groff program found
2048f126e068Smrg#		 returns the path set by the user in the environment
2049f126e068Smrg# --with-groff:	 'yes' user instructs the module to use groff
2050f126e068Smrg#		 'no' user instructs the module not to use groff
2051f126e068Smrg#
2052f126e068Smrg# Added in version 1.9.0:
2053f126e068Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
2054f126e068Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
2055f126e068Smrg#		   psselect from the psutils package.
2056f126e068Smrg#		   the ghostcript package. Refer to the grohtml man pages
2057f126e068Smrg#
2058f126e068Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
2059f126e068Smrg#
2060f126e068Smrg# OS and distros often splits groff in a basic and full package, the former
2061f126e068Smrg# having the groff program and the later having devices, fonts and macros
2062f126e068Smrg# Checking for the groff executable is not enough.
2063f126e068Smrg#
2064f126e068Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
2065f126e068Smrg# unset HAVE_GROFF or GROFF env variables.
2066f126e068Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
2067f126e068Smrg#
2068f126e068SmrgAC_DEFUN([XORG_WITH_GROFF],[
2069f126e068SmrgAC_ARG_VAR([GROFF], [Path to groff command])
2070f126e068Smrgm4_define([_defopt], m4_default([$1], [auto]))
2071f126e068SmrgAC_ARG_WITH(groff,
2072f126e068Smrg	AS_HELP_STRING([--with-groff],
2073f126e068Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
2074f126e068Smrg	   [use_groff=$withval], [use_groff=]_defopt)
2075f126e068Smrgm4_undefine([_defopt])
2076dfab2fd6Smrg
2077f126e068Smrgif test "x$use_groff" = x"auto"; then
2078f126e068Smrg   AC_PATH_PROG([GROFF], [groff])
2079f126e068Smrg   if test "x$GROFF" = "x"; then
2080f126e068Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
2081f126e068Smrg	have_groff=no
2082f126e068Smrg   else
2083f126e068Smrg        have_groff=yes
2084f126e068Smrg   fi
2085f126e068Smrgelif test "x$use_groff" = x"yes" ; then
2086f126e068Smrg   AC_PATH_PROG([GROFF], [groff])
2087f126e068Smrg   if test "x$GROFF" = "x"; then
2088f126e068Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
2089f126e068Smrg   fi
2090f126e068Smrg   have_groff=yes
2091f126e068Smrgelif test "x$use_groff" = x"no" ; then
2092f126e068Smrg   if test "x$GROFF" != "x"; then
2093f126e068Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
2094f126e068Smrg   fi
2095f126e068Smrg   have_groff=no
2096f126e068Smrgelse
2097f126e068Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
20985bd32fd1Smrgfi
20995bd32fd1Smrg
2100f126e068Smrg# We have groff, test for the presence of the macro packages
2101f126e068Smrgif test "x$have_groff" = x"yes"; then
2102f126e068Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
2103f126e068Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
2104f126e068Smrg        groff_ms_works=yes
2105f126e068Smrg    else
2106f126e068Smrg        groff_ms_works=no
2107f126e068Smrg    fi
2108f126e068Smrg    AC_MSG_RESULT([$groff_ms_works])
2109f126e068Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
2110f126e068Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
2111f126e068Smrg        groff_mm_works=yes
2112f126e068Smrg    else
2113f126e068Smrg        groff_mm_works=no
2114f126e068Smrg    fi
2115f126e068Smrg    AC_MSG_RESULT([$groff_mm_works])
21165bd32fd1Smrgfi
21175bd32fd1Smrg
2118f126e068Smrg# We have groff, test for HTML dependencies, one command per package
2119f126e068Smrgif test "x$have_groff" = x"yes"; then
2120f126e068Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
2121f126e068Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
2122f126e068Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
2123f126e068Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
2124f126e068Smrg      have_groff_html=yes
2125f126e068Smrg   else
2126f126e068Smrg      have_groff_html=no
2127f126e068Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
2128f126e068Smrg   fi
2129f126e068Smrgfi
21305bd32fd1Smrg
2131f126e068Smrg# Set Automake conditionals for Makefiles
2132f126e068SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
2133f126e068SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
2134f126e068SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
2135f126e068SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
2136f126e068Smrg]) # XORG_WITH_GROFF
2137f126e068Smrg
2138f126e068Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
2139f126e068Smrg# ---------------------------------------
2140f126e068Smrg# Minimum version: 1.6.0
2141f126e068Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2142f126e068Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
2143f126e068Smrg#
2144f126e068Smrg# Documentation tools are not always available on all platforms and sometimes
2145f126e068Smrg# not at the appropriate level. This macro enables a module to test for the
2146f126e068Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2147f126e068Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
2148f126e068Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
2149f126e068Smrg# --with-fop assumes 'auto'.
2150f126e068Smrg#
2151f126e068Smrg# Interface to module:
2152f126e068Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
2153f126e068Smrg# FOP:	 	returns the path of the fop program found
2154f126e068Smrg#		returns the path set by the user in the environment
2155f126e068Smrg# --with-fop: 	'yes' user instructs the module to use fop
2156f126e068Smrg#		'no' user instructs the module not to use fop
2157f126e068Smrg#
2158f126e068Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
2159f126e068Smrg#
2160f126e068SmrgAC_DEFUN([XORG_WITH_FOP],[
2161f126e068SmrgAC_ARG_VAR([FOP], [Path to fop command])
2162f126e068Smrgm4_define([_defopt], m4_default([$2], [auto]))
2163f126e068SmrgAC_ARG_WITH(fop,
2164f126e068Smrg	AS_HELP_STRING([--with-fop],
2165f126e068Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
2166f126e068Smrg	   [use_fop=$withval], [use_fop=]_defopt)
2167f126e068Smrgm4_undefine([_defopt])
2168f126e068Smrg
2169f126e068Smrgif test "x$use_fop" = x"auto"; then
2170f126e068Smrg   AC_PATH_PROG([FOP], [fop])
2171f126e068Smrg   if test "x$FOP" = "x"; then
2172f126e068Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
2173f126e068Smrg	have_fop=no
2174f126e068Smrg   else
2175f126e068Smrg        have_fop=yes
2176f126e068Smrg   fi
2177f126e068Smrgelif test "x$use_fop" = x"yes" ; then
2178f126e068Smrg   AC_PATH_PROG([FOP], [fop])
2179f126e068Smrg   if test "x$FOP" = "x"; then
2180f126e068Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
2181f126e068Smrg   fi
2182f126e068Smrg   have_fop=yes
2183f126e068Smrgelif test "x$use_fop" = x"no" ; then
2184f126e068Smrg   if test "x$FOP" != "x"; then
2185f126e068Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
2186f126e068Smrg   fi
2187f126e068Smrg   have_fop=no
2188f126e068Smrgelse
2189f126e068Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
2190f126e068Smrgfi
21915bd32fd1Smrg
2192f126e068Smrg# Test for a minimum version of fop, if provided.
2193f126e068Smrgm4_ifval([$1],
2194f126e068Smrg[if test "$have_fop" = yes; then
2195f126e068Smrg    # scrape the fop version
2196f126e068Smrg    AC_MSG_CHECKING([for fop minimum version])
2197f126e068Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
2198f126e068Smrg    AC_MSG_RESULT([$fop_version])
2199f126e068Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
2200f126e068Smrg        [if test "x$use_fop" = xauto; then
2201f126e068Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
2202f126e068Smrg            have_fop=no
2203f126e068Smrg        else
2204f126e068Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
2205f126e068Smrg        fi])
2206f126e068Smrgfi])
2207f126e068SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
2208f126e068Smrg]) # XORG_WITH_FOP
2209dfab2fd6Smrg
2210f126e068Smrg# XORG_WITH_PS2PDF([DEFAULT])
2211f126e068Smrg# ----------------
2212f126e068Smrg# Minimum version: 1.6.0
2213f126e068Smrg# Minimum version for optional DEFAULT argument: 1.11.0
2214f126e068Smrg#
2215f126e068Smrg# Documentation tools are not always available on all platforms and sometimes
2216f126e068Smrg# not at the appropriate level. This macro enables a module to test for the
2217f126e068Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
2218f126e068Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
2219f126e068Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
2220f126e068Smrg# --with-ps2pdf assumes 'auto'.
2221f126e068Smrg#
2222f126e068Smrg# Interface to module:
2223f126e068Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
2224f126e068Smrg# PS2PDF:	returns the path of the ps2pdf program found
2225f126e068Smrg#		returns the path set by the user in the environment
2226f126e068Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
2227f126e068Smrg#		 'no' user instructs the module not to use ps2pdf
2228f126e068Smrg#
2229f126e068Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
2230f126e068Smrg#
2231f126e068SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
2232f126e068SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
2233f126e068Smrgm4_define([_defopt], m4_default([$1], [auto]))
2234f126e068SmrgAC_ARG_WITH(ps2pdf,
2235f126e068Smrg	AS_HELP_STRING([--with-ps2pdf],
2236f126e068Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
2237f126e068Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
2238f126e068Smrgm4_undefine([_defopt])
2239dfab2fd6Smrg
2240f126e068Smrgif test "x$use_ps2pdf" = x"auto"; then
2241f126e068Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
2242f126e068Smrg   if test "x$PS2PDF" = "x"; then
2243f126e068Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
2244f126e068Smrg	have_ps2pdf=no
2245f126e068Smrg   else
2246f126e068Smrg        have_ps2pdf=yes
2247f126e068Smrg   fi
2248f126e068Smrgelif test "x$use_ps2pdf" = x"yes" ; then
2249f126e068Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
2250f126e068Smrg   if test "x$PS2PDF" = "x"; then
2251f126e068Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
2252f126e068Smrg   fi
2253f126e068Smrg   have_ps2pdf=yes
2254f126e068Smrgelif test "x$use_ps2pdf" = x"no" ; then
2255f126e068Smrg   if test "x$PS2PDF" != "x"; then
2256f126e068Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
2257f126e068Smrg   fi
2258f126e068Smrg   have_ps2pdf=no
2259f126e068Smrgelse
2260f126e068Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
2261f126e068Smrgfi
2262f126e068SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
2263f126e068Smrg]) # XORG_WITH_PS2PDF
2264dfab2fd6Smrg
2265f126e068Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
2266f126e068Smrg# ----------------
2267f126e068Smrg# Minimum version: 1.6.0
2268f126e068Smrg#
2269f126e068Smrg# Documentation tools are not always available on all platforms and sometimes
2270f126e068Smrg# not at the appropriate level. This macro enables a builder to skip all
2271f126e068Smrg# documentation targets except traditional man pages.
2272f126e068Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2273f126e068Smrg# maximum flexibilty in controlling documentation building.
2274f126e068Smrg# Refer to:
2275f126e068Smrg# XORG_WITH_XMLTO         --with-xmlto
2276f126e068Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2277f126e068Smrg# XORG_WITH_DOXYGEN       --with-doxygen
2278f126e068Smrg# XORG_WITH_FOP           --with-fop
2279f126e068Smrg# XORG_WITH_GROFF         --with-groff
2280f126e068Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
2281f126e068Smrg#
2282f126e068Smrg# Interface to module:
2283f126e068Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
2284f126e068Smrg# --enable-docs: 'yes' user instructs the module to generate docs
2285f126e068Smrg#		 'no' user instructs the module not to generate docs
2286f126e068Smrg# parm1:	specify the default value, yes or no.
2287f126e068Smrg#
2288f126e068SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
2289f126e068Smrgm4_define([docs_default], m4_default([$1], [yes]))
2290f126e068SmrgAC_ARG_ENABLE(docs,
2291f126e068Smrg	AS_HELP_STRING([--enable-docs],
2292f126e068Smrg	   [Enable building the documentation (default: ]docs_default[)]),
2293f126e068Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
2294f126e068Smrgm4_undefine([docs_default])
2295f126e068SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
2296f126e068SmrgAC_MSG_CHECKING([whether to build documentation])
2297f126e068SmrgAC_MSG_RESULT([$build_docs])
2298f126e068Smrg]) # XORG_ENABLE_DOCS
2299dfab2fd6Smrg
2300f126e068Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
2301f126e068Smrg# ----------------
2302f126e068Smrg# Minimum version: 1.6.0
2303f126e068Smrg#
2304f126e068Smrg# This macro enables a builder to skip all developer documentation.
2305f126e068Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2306f126e068Smrg# maximum flexibilty in controlling documentation building.
2307f126e068Smrg# Refer to:
2308f126e068Smrg# XORG_WITH_XMLTO         --with-xmlto
2309f126e068Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2310f126e068Smrg# XORG_WITH_DOXYGEN       --with-doxygen
2311f126e068Smrg# XORG_WITH_FOP           --with-fop
2312f126e068Smrg# XORG_WITH_GROFF         --with-groff
2313f126e068Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
2314f126e068Smrg#
2315f126e068Smrg# Interface to module:
2316f126e068Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
2317f126e068Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
2318f126e068Smrg#			'no' user instructs the module not to generate developer docs
2319f126e068Smrg# parm1:		specify the default value, yes or no.
2320f126e068Smrg#
2321f126e068SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
2322f126e068Smrgm4_define([devel_default], m4_default([$1], [yes]))
2323f126e068SmrgAC_ARG_ENABLE(devel-docs,
2324f126e068Smrg	AS_HELP_STRING([--enable-devel-docs],
2325f126e068Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
2326f126e068Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
2327f126e068Smrgm4_undefine([devel_default])
2328f126e068SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
2329f126e068SmrgAC_MSG_CHECKING([whether to build developer documentation])
2330f126e068SmrgAC_MSG_RESULT([$build_devel_docs])
2331f126e068Smrg]) # XORG_ENABLE_DEVEL_DOCS
2332dfab2fd6Smrg
2333f126e068Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
2334f126e068Smrg# ----------------
2335f126e068Smrg# Minimum version: 1.6.0
23365bd32fd1Smrg#
2337f126e068Smrg# This macro enables a builder to skip all functional specification targets.
2338f126e068Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2339f126e068Smrg# maximum flexibilty in controlling documentation building.
2340f126e068Smrg# Refer to:
2341f126e068Smrg# XORG_WITH_XMLTO         --with-xmlto
2342f126e068Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2343f126e068Smrg# XORG_WITH_DOXYGEN       --with-doxygen
2344f126e068Smrg# XORG_WITH_FOP           --with-fop
2345f126e068Smrg# XORG_WITH_GROFF         --with-groff
2346f126e068Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
2347f126e068Smrg#
2348f126e068Smrg# Interface to module:
2349f126e068Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
2350f126e068Smrg# --enable-specs:	'yes' user instructs the module to generate specs
2351f126e068Smrg#			'no' user instructs the module not to generate specs
2352f126e068Smrg# parm1:		specify the default value, yes or no.
2353f126e068Smrg#
2354f126e068SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
2355f126e068Smrgm4_define([spec_default], m4_default([$1], [yes]))
2356f126e068SmrgAC_ARG_ENABLE(specs,
2357f126e068Smrg	AS_HELP_STRING([--enable-specs],
2358f126e068Smrg	   [Enable building the specs (default: ]spec_default[)]),
2359f126e068Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
2360f126e068Smrgm4_undefine([spec_default])
2361f126e068SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
2362f126e068SmrgAC_MSG_CHECKING([whether to build functional specifications])
2363f126e068SmrgAC_MSG_RESULT([$build_specs])
2364f126e068Smrg]) # XORG_ENABLE_SPECS
23655bd32fd1Smrg
2366f126e068Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
2367f126e068Smrg# ----------------------------------------------
2368f126e068Smrg# Minimum version: 1.13.0
2369f126e068Smrg#
2370f126e068Smrg# This macro enables a builder to enable/disable unit testing
2371f126e068Smrg# It makes no assumption about the test cases implementation
2372f126e068Smrg# Test cases may or may not use Automake "Support for test suites"
2373f126e068Smrg# They may or may not use the software utility library GLib
2374f126e068Smrg#
2375f126e068Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
2376f126e068Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
2377f126e068Smrg# The variable enable_unit_tests is used by other macros in this file.
2378f126e068Smrg#
2379f126e068Smrg# Interface to module:
2380f126e068Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
2381f126e068Smrg# enable_unit_tests:    used in configure.ac for additional configuration
2382f126e068Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
2383f126e068Smrg#			'no' user instructs the module not to build tests
2384f126e068Smrg# parm1:		specify the default value, yes or no.
2385f126e068Smrg#
2386f126e068SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2387f126e068SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
2388f126e068SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
2389f126e068SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2390f126e068Smrgm4_define([_defopt], m4_default([$1], [auto]))
2391f126e068SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2392f126e068Smrg	[Enable building unit test cases (default: ]_defopt[)]),
2393f126e068Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
2394f126e068Smrgm4_undefine([_defopt])
2395f126e068SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
2396f126e068SmrgAC_MSG_CHECKING([whether to build unit test cases])
2397f126e068SmrgAC_MSG_RESULT([$enable_unit_tests])
2398f126e068Smrg]) # XORG_ENABLE_UNIT_TESTS
23995bd32fd1Smrg
2400f126e068Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
2401f126e068Smrg# ------------------------------------------------------
2402f126e068Smrg# Minimum version: 1.17.0
24035bd32fd1Smrg#
2404f126e068Smrg# This macro enables a builder to enable/disable integration testing
2405f126e068Smrg# It makes no assumption about the test cases' implementation
2406f126e068Smrg# Test cases may or may not use Automake "Support for test suites"
2407f126e068Smrg#
2408f126e068Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
2409f126e068Smrg# usually requires less dependencies and may be built and run under less
2410f126e068Smrg# stringent environments than integration tests.
2411f126e068Smrg#
2412f126e068Smrg# Interface to module:
2413f126e068Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
2414f126e068Smrg# enable_integration_tests:   used in configure.ac for additional configuration
2415f126e068Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
2416f126e068Smrg#                             'no' user instructs the module not to build tests
2417f126e068Smrg# parm1:                      specify the default value, yes or no.
2418f126e068Smrg#
2419f126e068SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
2420f126e068SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
2421f126e068Smrgm4_define([_defopt], m4_default([$1], [auto]))
2422f126e068SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
2423f126e068Smrg	[Enable building integration test cases (default: ]_defopt[)]),
2424f126e068Smrg	[enable_integration_tests=$enableval],
2425f126e068Smrg	[enable_integration_tests=]_defopt)
2426f126e068Smrgm4_undefine([_defopt])
2427f126e068SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
2428f126e068Smrg	[test "x$enable_integration_tests" != xno])
2429f126e068SmrgAC_MSG_CHECKING([whether to build unit test cases])
2430f126e068SmrgAC_MSG_RESULT([$enable_integration_tests])
2431f126e068Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
2432dfab2fd6Smrg
2433f126e068Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2434f126e068Smrg# ----------------------------------------
2435f126e068Smrg# Minimum version: 1.13.0
2436f126e068Smrg#
2437f126e068Smrg# GLib is a library which provides advanced data structures and functions.
2438f126e068Smrg# This macro enables a module to test for the presence of Glib.
2439f126e068Smrg#
2440f126e068Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2441f126e068Smrg# Otherwise the value of $enable_unit_tests is blank.
2442f126e068Smrg#
2443f126e068Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
2444f126e068Smrg# test support usually requires less dependencies and may be built and run under
2445f126e068Smrg# less stringent environments than integration tests.
2446f126e068Smrg#
2447f126e068Smrg# Interface to module:
2448f126e068Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
2449f126e068Smrg# with_glib: used in configure.ac to know if GLib has been found
2450f126e068Smrg# --with-glib:	'yes' user instructs the module to use glib
2451f126e068Smrg#		'no' user instructs the module not to use glib
2452f126e068Smrg#
2453f126e068SmrgAC_DEFUN([XORG_WITH_GLIB],[
2454f126e068SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2455f126e068Smrgm4_define([_defopt], m4_default([$2], [auto]))
2456f126e068SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
2457f126e068Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
2458f126e068Smrg	[with_glib=$withval], [with_glib=]_defopt)
2459f126e068Smrgm4_undefine([_defopt])
2460dfab2fd6Smrg
2461f126e068Smrghave_glib=no
2462f126e068Smrg# Do not probe GLib if user explicitly disabled unit testing
2463f126e068Smrgif test "x$enable_unit_tests" != x"no"; then
2464f126e068Smrg  # Do not probe GLib if user explicitly disabled it
2465f126e068Smrg  if test "x$with_glib" != x"no"; then
2466f126e068Smrg    m4_ifval(
2467f126e068Smrg      [$1],
2468f126e068Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
2469f126e068Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
2470f126e068Smrg    )
2471f126e068Smrg  fi
2472f126e068Smrgfi
24735bd32fd1Smrg
2474f126e068Smrg# Not having GLib when unit testing has been explicitly requested is an error
2475f126e068Smrgif test "x$enable_unit_tests" = x"yes"; then
2476f126e068Smrg  if test "x$have_glib" = x"no"; then
2477f126e068Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2478f126e068Smrg  fi
2479f126e068Smrgfi
24805bd32fd1Smrg
2481f126e068Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
2482f126e068Smrgif test "x$enable_unit_tests" = x"no"; then
2483f126e068Smrg  if test "x$with_glib" = x"yes"; then
2484f126e068Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2485f126e068Smrg  fi
2486f126e068Smrgfi
24875bd32fd1Smrg
2488f126e068Smrg# Not having GLib when it has been explicitly requested is an error
2489f126e068Smrgif test "x$with_glib" = x"yes"; then
2490f126e068Smrg  if test "x$have_glib" = x"no"; then
2491f126e068Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
2492f126e068Smrg  fi
2493f126e068Smrgfi
2494dfab2fd6Smrg
2495f126e068SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2496f126e068Smrg]) # XORG_WITH_GLIB
2497dfab2fd6Smrg
2498f126e068Smrg# XORG_LD_WRAP([required|optional])
2499f126e068Smrg# ---------------------------------
2500f126e068Smrg# Minimum version: 1.13.0
2501f126e068Smrg#
2502f126e068Smrg# Check if linker supports -wrap, passed via compiler flags
2503f126e068Smrg#
2504f126e068Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2505f126e068Smrg# Otherwise the value of $enable_unit_tests is blank.
2506f126e068Smrg#
2507f126e068Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
2508f126e068Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
2509f126e068Smrg# available, an argument of "optional" allows use when some unit tests require
2510f126e068Smrg# ld -wrap and others do not.
2511f126e068Smrg#
2512f126e068SmrgAC_DEFUN([XORG_LD_WRAP],[
2513f126e068SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
2514f126e068Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
2515f126e068Smrg                      void __wrap_exit(int status) { return; }],
2516f126e068Smrg                     [exit(0);])])
2517f126e068Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
2518f126e068Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
2519f126e068Smrg  if test "x$have_ld_wrap" = x"no"; then
2520f126e068Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2521f126e068Smrg  fi
2522f126e068Smrgfi
2523f126e068SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
2524f126e068Smrg#
2525f126e068Smrg]) # XORG_LD_WRAP
2526dfab2fd6Smrg
2527f126e068Smrg# XORG_CHECK_LINKER_FLAGS
2528f126e068Smrg# -----------------------
2529f126e068Smrg# SYNOPSIS
2530f126e068Smrg#
2531f126e068Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
2532f126e068Smrg#
2533f126e068Smrg# DESCRIPTION
2534f126e068Smrg#
2535f126e068Smrg#   Check whether the given linker FLAGS work with the current language's
2536f126e068Smrg#   linker, or whether they give an error.
2537f126e068Smrg#
2538f126e068Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2539f126e068Smrg#   success/failure.
2540f126e068Smrg#
2541f126e068Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
2542f126e068Smrg#
2543f126e068Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2544f126e068Smrg#
2545f126e068Smrg# LICENSE
2546f126e068Smrg#
2547f126e068Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
2548f126e068Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
2549f126e068Smrg#   Copyright (c) 2009 Matteo Frigo
2550f126e068Smrg#
2551f126e068Smrg#   This program is free software: you can redistribute it and/or modify it
2552f126e068Smrg#   under the terms of the GNU General Public License as published by the
2553f126e068Smrg#   Free Software Foundation, either version 3 of the License, or (at your
2554f126e068Smrg#   option) any later version.
2555f126e068Smrg#
2556f126e068Smrg#   This program is distributed in the hope that it will be useful, but
2557f126e068Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
2558f126e068Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
2559f126e068Smrg#   Public License for more details.
2560f126e068Smrg#
2561f126e068Smrg#   You should have received a copy of the GNU General Public License along
2562f126e068Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
2563f126e068Smrg#
2564f126e068Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
2565f126e068Smrg#   gives unlimited permission to copy, distribute and modify the configure
2566f126e068Smrg#   scripts that are the output of Autoconf when processing the Macro. You
2567f126e068Smrg#   need not follow the terms of the GNU General Public License when using
2568f126e068Smrg#   or distributing such scripts, even though portions of the text of the
2569f126e068Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
2570f126e068Smrg#   all other use of the material that constitutes the Autoconf Macro.
2571f126e068Smrg#
2572f126e068Smrg#   This special exception to the GPL applies to versions of the Autoconf
2573f126e068Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
2574f126e068Smrg#   modified version of the Autoconf Macro, you may extend this special
2575f126e068Smrg#   exception to the GPL to apply to your modified version as well.#
2576f126e068SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
2577f126e068Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
2578f126e068Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
2579f126e068SmrgAS_LITERAL_IF([$1],
2580f126e068Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2581f126e068Smrg      ax_save_FLAGS=$LDFLAGS
2582f126e068Smrg      LDFLAGS="$1"
2583f126e068Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
2584f126e068Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2585f126e068Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2586f126e068Smrg      LDFLAGS=$ax_save_FLAGS])],
2587f126e068Smrg  [ax_save_FLAGS=$LDFLAGS
2588f126e068Smrg   LDFLAGS="$1"
2589f126e068Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2590f126e068Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2591f126e068Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2592f126e068Smrg   LDFLAGS=$ax_save_FLAGS])
2593f126e068Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
2594f126e068SmrgAC_MSG_RESULT($xorg_check_linker_flags)
2595f126e068Smrgif test "x$xorg_check_linker_flags" = xyes; then
2596f126e068Smrg	m4_default([$2], :)
2597f126e068Smrgelse
2598f126e068Smrg	m4_default([$3], :)
2599f126e068Smrgfi
2600f126e068Smrg]) # XORG_CHECK_LINKER_FLAGS
2601dfab2fd6Smrg
2602f126e068Smrg# XORG_MEMORY_CHECK_FLAGS
2603f126e068Smrg# -----------------------
2604f126e068Smrg# Minimum version: 1.16.0
26055bd32fd1Smrg#
2606f126e068Smrg# This macro attempts to find appropriate memory checking functionality
2607f126e068Smrg# for various platforms which unit testing code may use to catch various
2608f126e068Smrg# forms of memory allocation and access errors in testing.
2609f126e068Smrg#
2610f126e068Smrg# Interface to module:
2611f126e068Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
2612f126e068Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
2613f126e068Smrg#
2614f126e068Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
2615f126e068Smrg#
2616f126e068SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
26175bd32fd1Smrg
2618f126e068SmrgAC_REQUIRE([AC_CANONICAL_HOST])
2619f126e068SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
2620f126e068Smrg           [Environment variables to enable memory checking in tests])
2621dfab2fd6Smrg
2622f126e068Smrg# Check for different types of support on different platforms
2623f126e068Smrgcase $host_os in
2624f126e068Smrg    solaris*)
2625f126e068Smrg        AC_CHECK_LIB([umem], [umem_alloc],
2626f126e068Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
2627f126e068Smrg        ;;
2628f126e068Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
2629f126e068Smrg        # both directly and inverted, so should not be 0 or 255.
2630f126e068Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
2631f126e068Smrg        ;;
2632f126e068Smrg    darwin*)
2633f126e068Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
2634f126e068Smrg        ;;
2635f126e068Smrg    *bsd*)
2636f126e068Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
2637f126e068Smrg        ;;
2638dfab2fd6Smrgesac
2639f126e068Smrg
2640f126e068Smrg# User supplied flags override default flags
2641f126e068Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
2642f126e068Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
2643dfab2fd6Smrgfi
2644dfab2fd6Smrg
2645f126e068SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
2646f126e068Smrg]) # XORG_WITH_LINT
2647dfab2fd6Smrg
2648f126e068Smrg# XORG_CHECK_MALLOC_ZERO
2649f126e068Smrg# ----------------------
2650f126e068Smrg# Minimum version: 1.0.0
26518b22bf3fSmrg#
2652f126e068Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
2653f126e068Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
2654f126e068Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
2655f126e068SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
2656f126e068SmrgAC_ARG_ENABLE(malloc0returnsnull,
2657f126e068Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
2658f126e068Smrg		       [malloc(0) returns NULL (default: auto)]),
2659f126e068Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
2660f126e068Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
2661dfab2fd6Smrg
2662f126e068SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
2663f126e068Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2664f126e068Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
2665f126e068Smrg#include <stdlib.h>
2666f126e068Smrg],[
2667f126e068Smrg    char *m0, *r0, *c0, *p;
2668f126e068Smrg    m0 = malloc(0);
2669f126e068Smrg    p = malloc(10);
2670f126e068Smrg    r0 = realloc(p,0);
2671f126e068Smrg    c0 = calloc(0,10);
2672f126e068Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2673f126e068Smrg])],
2674f126e068Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
2675f126e068Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
2676f126e068Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
26778b22bf3fSmrgfi
2678f126e068SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2679f126e068Smrg
2680f126e068Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
2681f126e068Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
2682f126e068Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
2683f126e068Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
26848b22bf3fSmrgelse
2685f126e068Smrg	MALLOC_ZERO_CFLAGS=""
2686f126e068Smrg	XMALLOC_ZERO_CFLAGS=""
2687f126e068Smrg	XTMALLOC_ZERO_CFLAGS=""
26888b22bf3fSmrgfi
26898b22bf3fSmrg
2690f126e068SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
2691f126e068SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
2692f126e068SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
2693f126e068Smrg]) # XORG_CHECK_MALLOC_ZERO
2694f126e068Smrg
2695f126e068Smrg# XORG_WITH_LINT()
2696f126e068Smrg# ----------------
2697f126e068Smrg# Minimum version: 1.1.0
26985bd32fd1Smrg#
2699f126e068Smrg# This macro enables the use of a tool that flags some suspicious and
2700f126e068Smrg# non-portable constructs (likely to be bugs) in C language source code.
2701f126e068Smrg# It will attempt to locate the tool and use appropriate options.
2702f126e068Smrg# There are various lint type tools on different platforms.
2703f126e068Smrg#
2704f126e068Smrg# Interface to module:
2705f126e068Smrg# LINT:		returns the path to the tool found on the platform
2706f126e068Smrg#		or the value set to LINT on the configure cmd line
2707f126e068Smrg#		also an Automake conditional
2708f126e068Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
2709f126e068Smrg#
2710f126e068Smrg# --with-lint:	'yes' user instructs the module to use lint
2711f126e068Smrg#		'no' user instructs the module not to use lint (default)
2712f126e068Smrg#
2713f126e068Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
2714f126e068Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
2715f126e068Smrg#
2716f126e068SmrgAC_DEFUN([XORG_WITH_LINT],[
2717dfab2fd6Smrg
2718f126e068SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
2719f126e068SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
2720f126e068SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
2721f126e068Smrg		[Use a lint-style source code checker (default: disabled)])],
2722f126e068Smrg		[use_lint=$withval], [use_lint=no])
2723f126e068Smrg
2724f126e068Smrg# Obtain platform specific info like program name and options
2725f126e068Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
2726f126e068Smrgcase $host_os in
2727f126e068Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2728f126e068Smrg	lint_name=splint
2729f126e068Smrg	lint_options="-badflag"
2730f126e068Smrg	;;
2731f126e068Smrg  *freebsd* | *netbsd*)
2732f126e068Smrg	lint_name=lint
2733f126e068Smrg	lint_options="-u -b"
2734f126e068Smrg	;;
2735f126e068Smrg  *solaris*)
2736f126e068Smrg	lint_name=lint
2737f126e068Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2738f126e068Smrg	;;
2739dfab2fd6Smrgesac
2740dfab2fd6Smrg
2741f126e068Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
2742f126e068Smrgif test "x$use_lint" = x"yes" ; then
2743f126e068Smrg   AC_PATH_PROG([LINT], [$lint_name])
2744f126e068Smrg   if test "x$LINT" = "x"; then
2745f126e068Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2746f126e068Smrg   fi
2747f126e068Smrgelif test "x$use_lint" = x"no" ; then
2748f126e068Smrg   if test "x$LINT" != "x"; then
2749f126e068Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2750f126e068Smrg   fi
2751f126e068Smrgelse
2752f126e068Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2753f126e068Smrgfi
2754dfab2fd6Smrg
2755f126e068Smrg# User supplied flags override default flags
2756f126e068Smrgif test "x$LINT_FLAGS" != "x"; then
2757f126e068Smrg   lint_options=$LINT_FLAGS
2758f126e068Smrgfi
2759dfab2fd6Smrg
2760f126e068SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2761f126e068SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2762dfab2fd6Smrg
2763f126e068Smrg]) # XORG_WITH_LINT
2764dfab2fd6Smrg
2765f126e068Smrg# XORG_LINT_LIBRARY(LIBNAME)
2766f126e068Smrg# --------------------------
2767f126e068Smrg# Minimum version: 1.1.0
2768f126e068Smrg#
2769f126e068Smrg# Sets up flags for building lint libraries for checking programs that call
2770f126e068Smrg# functions in the library.
2771f126e068Smrg#
2772f126e068Smrg# Interface to module:
2773f126e068Smrg# LINTLIB		- Automake variable with the name of lint library file to make
2774f126e068Smrg# MAKE_LINT_LIB		- Automake conditional
2775f126e068Smrg#
2776f126e068Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2777f126e068Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2778dfab2fd6Smrg
2779f126e068SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2780f126e068SmrgAC_REQUIRE([XORG_WITH_LINT])
2781f126e068SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2782f126e068Smrg	[Create lint library (default: disabled)])],
2783f126e068Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2784dfab2fd6Smrg
2785f126e068Smrgif test "x$make_lint_lib" = x"yes" ; then
2786f126e068Smrg   LINTLIB=llib-l$1.ln
2787f126e068Smrg   if test "x$LINT" = "x"; then
2788f126e068Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2789f126e068Smrg   fi
2790f126e068Smrgelif test "x$make_lint_lib" != x"no" ; then
2791f126e068Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2792f126e068Smrgfi
2793dfab2fd6Smrg
2794f126e068SmrgAC_SUBST(LINTLIB)
2795f126e068SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2796dfab2fd6Smrg
2797f126e068Smrg]) # XORG_LINT_LIBRARY
27988b22bf3fSmrg
2799f126e068Smrg# XORG_COMPILER_BRAND
2800f126e068Smrg# -------------------
2801f126e068Smrg# Minimum version: 1.14.0
2802f126e068Smrg#
2803f126e068Smrg# Checks for various brands of compilers and sets flags as appropriate:
2804f126e068Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
2805f126e068Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
2806f126e068Smrg#   clang compiler - sets CLANGCC to "yes"
2807f126e068Smrg#   Intel compiler - sets INTELCC to "yes"
2808f126e068Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
2809f126e068Smrg#
2810f126e068SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
2811f126e068SmrgAC_LANG_CASE(
2812f126e068Smrg	[C], [
2813f126e068Smrg		AC_REQUIRE([AC_PROG_CC_C99])
2814f126e068Smrg	],
2815f126e068Smrg	[C++], [
2816f126e068Smrg		AC_REQUIRE([AC_PROG_CXX])
2817f126e068Smrg	]
2818f126e068Smrg)
2819f126e068SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
2820f126e068SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2821f126e068SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2822f126e068Smrg]) # XORG_COMPILER_BRAND
28235bd32fd1Smrg
2824f126e068Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
2825dfab2fd6Smrg# ---------------
2826f126e068Smrg# Minimum version: 1.16.0
2827f126e068Smrg#
2828f126e068Smrg# Test if the compiler works when passed the given flag as a command line argument.
2829f126e068Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
2830f126e068Smrg# next flag in the list until there are no more options.
2831f126e068Smrg#
2832f126e068Smrg# Note that this does not guarantee that the compiler supports the flag as some
2833f126e068Smrg# compilers will simply ignore arguments that they do not understand, but we do
2834f126e068Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
2835f126e068Smrg# -Werror=unused-command-line-argument
2836f126e068Smrg#
2837f126e068SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
2838f126e068Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2839f126e068Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
2840f126e068Smrg
2841f126e068SmrgAC_LANG_COMPILER_REQUIRE
2842f126e068Smrg
2843f126e068SmrgAC_LANG_CASE(
2844f126e068Smrg	[C], [
2845f126e068Smrg		AC_REQUIRE([AC_PROG_CC_C99])
2846f126e068Smrg		define([PREFIX], [C])
2847f126e068Smrg		define([CACHE_PREFIX], [cc])
2848f126e068Smrg		define([COMPILER], [$CC])
2849f126e068Smrg	],
2850f126e068Smrg	[C++], [
2851f126e068Smrg		define([PREFIX], [CXX])
2852f126e068Smrg		define([CACHE_PREFIX], [cxx])
2853f126e068Smrg		define([COMPILER], [$CXX])
2854f126e068Smrg	]
2855f126e068Smrg)
28565bd32fd1Smrg
2857f126e068Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
2858f126e068Smrg
2859f126e068Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
2860f126e068Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2861f126e068Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
2862f126e068Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
2863f126e068Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
2864f126e068Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
2865f126e068Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
2866f126e068Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
2867f126e068Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
28688b22bf3fSmrgfi
28698b22bf3fSmrg
2870f126e068Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
2871f126e068Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
2872f126e068Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2873f126e068Smrg	fi
2874f126e068Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
2875f126e068Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
2876f126e068Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
2877f126e068Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
2878f126e068Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
2879f126e068Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
2880f126e068Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
2881f126e068Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2882f126e068Smrgfi
28838b22bf3fSmrg
2884f126e068Smrgfound="no"
2885f126e068Smrgm4_foreach([flag], m4_cdr($@), [
2886f126e068Smrg	if test $found = "no" ; then
2887f126e068Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
2888f126e068Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
2889f126e068Smrg		fi
2890f126e068Smrg
2891f126e068Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
2892f126e068Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
2893f126e068Smrg		fi
2894f126e068Smrg
2895f126e068Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
2896f126e068Smrg
2897f126e068Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
2898f126e068Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
2899f126e068Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
2900f126e068Smrg		AC_CACHE_VAL($cacheid,
2901f126e068Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
2902f126e068Smrg					     [eval $cacheid=yes],
2903f126e068Smrg					     [eval $cacheid=no])])
2904f126e068Smrg
2905f126e068Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
2906f126e068Smrg
2907f126e068Smrg		eval supported=\$$cacheid
2908f126e068Smrg		AC_MSG_RESULT([$supported])
2909f126e068Smrg		if test "$supported" = "yes" ; then
2910f126e068Smrg			$1="$$1 ]flag["
2911f126e068Smrg			found="yes"
2912f126e068Smrg		fi
2913f126e068Smrg	fi
2914dfab2fd6Smrg])
2915f126e068Smrg]) # XORG_TESTSET_CFLAG
29168b22bf3fSmrg
2917f126e068Smrg# XORG_COMPILER_FLAGS
2918f126e068Smrg# ---------------
2919f126e068Smrg# Minimum version: 1.16.0
2920f126e068Smrg#
2921f126e068Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
2922f126e068Smrg# arguments supported by the selected compiler which do NOT alter the generated
2923f126e068Smrg# code.  These arguments will cause the compiler to print various warnings
2924f126e068Smrg# during compilation AND turn a conservative set of warnings into errors.
2925f126e068Smrg#
2926f126e068Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
2927f126e068Smrg# future versions of util-macros as options are added to new compilers.
2928f126e068Smrg#
2929f126e068SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
2930f126e068SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
2931f126e068Smrg
2932f126e068SmrgAC_ARG_ENABLE(selective-werror,
2933f126e068Smrg              AS_HELP_STRING([--disable-selective-werror],
2934f126e068Smrg                             [Turn off selective compiler errors. (default: enabled)]),
2935f126e068Smrg              [SELECTIVE_WERROR=$enableval],
2936f126e068Smrg              [SELECTIVE_WERROR=yes])
2937f126e068Smrg
2938f126e068SmrgAC_LANG_CASE(
2939f126e068Smrg        [C], [
2940f126e068Smrg                define([PREFIX], [C])
2941f126e068Smrg        ],
2942f126e068Smrg        [C++], [
2943f126e068Smrg                define([PREFIX], [CXX])
2944f126e068Smrg        ]
2945f126e068Smrg)
2946f126e068Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
2947f126e068Smrgif test "x$SUNCC" = "xyes"; then
2948f126e068Smrg    [BASE_]PREFIX[FLAGS]="-v"
2949f126e068Smrgelse
2950f126e068Smrg    [BASE_]PREFIX[FLAGS]=""
2951f126e068Smrgfi
29525bd32fd1Smrg
2953f126e068Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
2954f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
2955f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
2956f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
2957f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
2958f126e068Smrg
2959f126e068SmrgAC_LANG_CASE(
2960f126e068Smrg	[C], [
2961f126e068Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
2962f126e068Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
2963f126e068Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
2964f126e068Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
2965f126e068Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
2966f126e068Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
2967f126e068Smrg	]
2968f126e068Smrg)
2969f126e068Smrg
2970f126e068Smrg# This chunk adds additional warnings that could catch undesired effects.
2971f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
2972f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
2973f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
2974f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
2975f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
2976f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
2977f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
2978f126e068Smrg
2979f126e068Smrg# These are currently disabled because they are noisy.  They will be enabled
2980f126e068Smrg# in the future once the codebase is sufficiently modernized to silence
2981f126e068Smrg# them.  For now, I don't want them to drown out the other warnings.
2982f126e068Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
2983f126e068Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
2984f126e068Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
2985f126e068Smrg
2986f126e068Smrg# Turn some warnings into errors, so we don't accidently get successful builds
2987f126e068Smrg# when there are problems that should be fixed.
2988f126e068Smrg
2989f126e068Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
2990f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
2991f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
2992f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
2993f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
2994f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
2995f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
2996f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
2997f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
2998f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
2999f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
3000f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
3001f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
3002f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
3003f126e068Smrgelse
3004f126e068SmrgAC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
3005f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
3006f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
3007f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
3008f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
3009f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
3010f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
3011f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
3012f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
3013f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
3014f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
3015f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
3016f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
3017f126e068SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
30188b22bf3fSmrgfi
30195bd32fd1Smrg
3020f126e068SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
3021f126e068Smrg]) # XORG_COMPILER_FLAGS
3022f126e068Smrg
3023f126e068Smrg# XORG_CWARNFLAGS
3024f126e068Smrg# ---------------
3025f126e068Smrg# Minimum version: 1.2.0
3026f126e068Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
3027dfab2fd6Smrg#
3028f126e068Smrg# Defines CWARNFLAGS to enable C compiler warnings.
3029f126e068Smrg#
3030f126e068Smrg# This function is deprecated because it defines -fno-strict-aliasing
3031f126e068Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
3032f126e068Smrg# is needed, then it should be added explicitly in the module when
3033f126e068Smrg# it is updated to use BASE_CFLAGS.
3034f126e068Smrg#
3035f126e068SmrgAC_DEFUN([XORG_CWARNFLAGS], [
3036f126e068SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
3037f126e068SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
3038f126e068SmrgAC_LANG_CASE(
3039f126e068Smrg	[C], [
3040f126e068Smrg		CWARNFLAGS="$BASE_CFLAGS"
3041f126e068Smrg		if  test "x$GCC" = xyes ; then
3042f126e068Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
3043f126e068Smrg		fi
3044f126e068Smrg		AC_SUBST(CWARNFLAGS)
3045f126e068Smrg	]
3046f126e068Smrg)
3047f126e068Smrg]) # XORG_CWARNFLAGS
30488b22bf3fSmrg
3049f126e068Smrg# XORG_STRICT_OPTION
3050f126e068Smrg# -----------------------
3051f126e068Smrg# Minimum version: 1.3.0
3052f126e068Smrg#
3053f126e068Smrg# Add configure option to enable strict compilation flags, such as treating
3054f126e068Smrg# warnings as fatal errors.
3055f126e068Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
3056f126e068Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
3057f126e068Smrg#
3058f126e068Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
3059f126e068Smrg# when strict compilation is unconditionally desired.
3060f126e068SmrgAC_DEFUN([XORG_STRICT_OPTION], [
3061f126e068SmrgAC_REQUIRE([XORG_CWARNFLAGS])
3062f126e068SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
30638b22bf3fSmrg
3064f126e068SmrgAC_ARG_ENABLE(strict-compilation,
3065f126e068Smrg			  AS_HELP_STRING([--enable-strict-compilation],
3066f126e068Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
3067f126e068Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
306896a81b41Smrg
3069f126e068SmrgAC_LANG_CASE(
3070f126e068Smrg        [C], [
3071f126e068Smrg                define([PREFIX], [C])
3072f126e068Smrg        ],
3073f126e068Smrg        [C++], [
3074f126e068Smrg                define([PREFIX], [CXX])
3075f126e068Smrg        ]
3076f126e068Smrg)
3077dfab2fd6Smrg
3078f126e068Smrg[STRICT_]PREFIX[FLAGS]=""
3079f126e068SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
3080f126e068SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
3081dfab2fd6Smrg
3082f126e068Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
3083f126e068Smrg# activate it with -Werror, so we add it here explicitly.
3084f126e068SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
308596a81b41Smrg
3086f126e068Smrgif test "x$STRICT_COMPILE" = "xyes"; then
3087f126e068Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
3088f126e068Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
3089f126e068Smrgfi
3090f126e068SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
3091f126e068SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
3092f126e068SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
3093f126e068Smrg]) # XORG_STRICT_OPTION
309496a81b41Smrg
3095f126e068Smrg# XORG_DEFAULT_OPTIONS
309696a81b41Smrg# --------------------
3097f126e068Smrg# Minimum version: 1.3.0
309896a81b41Smrg#
3099f126e068Smrg# Defines default options for X.Org modules.
310096a81b41Smrg#
3101f126e068SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
3102f126e068SmrgAC_REQUIRE([AC_PROG_INSTALL])
3103f126e068SmrgXORG_COMPILER_FLAGS
3104f126e068SmrgXORG_CWARNFLAGS
3105f126e068SmrgXORG_STRICT_OPTION
3106f126e068SmrgXORG_RELEASE_VERSION
3107f126e068SmrgXORG_CHANGELOG
3108f126e068SmrgXORG_INSTALL
3109f126e068SmrgXORG_MANPAGE_SECTIONS
3110f126e068Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
3111f126e068Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
3112f126e068Smrg]) # XORG_DEFAULT_OPTIONS
3113f126e068Smrg
3114f126e068Smrg# XORG_INSTALL()
3115f126e068Smrg# ----------------
3116f126e068Smrg# Minimum version: 1.4.0
3117f126e068Smrg#
3118f126e068Smrg# Defines the variable INSTALL_CMD as the command to copy
3119f126e068Smrg# INSTALL from $prefix/share/util-macros.
3120f126e068Smrg#
3121f126e068SmrgAC_DEFUN([XORG_INSTALL], [
3122f126e068SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
3123f126e068Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
3124f126e068SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
3125f126e068Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
3126f126e068Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
3127f126e068Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
3128f126e068SmrgAC_SUBST([INSTALL_CMD])
3129f126e068Smrg]) # XORG_INSTALL
3130f126e068Smrgdnl Copyright 2005 Red Hat, Inc
3131f126e068Smrgdnl
3132f126e068Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
3133f126e068Smrgdnl documentation for any purpose is hereby granted without fee, provided that
3134f126e068Smrgdnl the above copyright notice appear in all copies and that both that
3135f126e068Smrgdnl copyright notice and this permission notice appear in supporting
3136f126e068Smrgdnl documentation.
3137f126e068Smrgdnl
3138f126e068Smrgdnl The above copyright notice and this permission notice shall be included
3139f126e068Smrgdnl in all copies or substantial portions of the Software.
3140f126e068Smrgdnl
3141f126e068Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3142f126e068Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3143f126e068Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3144f126e068Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
3145f126e068Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
3146f126e068Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3147f126e068Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
3148f126e068Smrgdnl
3149f126e068Smrgdnl Except as contained in this notice, the name of the copyright holders shall
3150f126e068Smrgdnl not be used in advertising or otherwise to promote the sale, use or
3151f126e068Smrgdnl other dealings in this Software without prior written authorization
3152f126e068Smrgdnl from the copyright holders.
3153f126e068Smrgdnl
31545bd32fd1Smrg
3155f126e068Smrg# XORG_RELEASE_VERSION
3156f126e068Smrg# --------------------
3157f126e068Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
31588b22bf3fSmrg
3159f126e068SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
3160f126e068Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
3161f126e068Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
3162f126e068Smrg		[Major version of this package])
3163f126e068Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
3164f126e068Smrg	if test "x$PVM" = "x"; then
3165f126e068Smrg		PVM="0"
3166f126e068Smrg	fi
3167f126e068Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
3168f126e068Smrg		[$PVM],
3169f126e068Smrg		[Minor version of this package])
3170f126e068Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
3171f126e068Smrg	if test "x$PVP" = "x"; then
3172f126e068Smrg		PVP="0"
3173f126e068Smrg	fi
3174f126e068Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
3175f126e068Smrg		[$PVP],
3176f126e068Smrg		[Patch version of this package])
3177f126e068Smrg])
31788b22bf3fSmrg
3179f126e068Smrg# XORG_CHANGELOG()
3180f126e068Smrg# ----------------
3181f126e068Smrg# Minimum version: 1.2.0
3182f126e068Smrg#
3183f126e068Smrg# Defines the variable CHANGELOG_CMD as the command to generate
3184f126e068Smrg# ChangeLog from git.
3185f126e068Smrg#
3186f126e068Smrg#
3187f126e068SmrgAC_DEFUN([XORG_CHANGELOG], [
3188f126e068SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
3189f126e068Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
3190f126e068Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
3191f126e068Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
3192f126e068SmrgAC_SUBST([CHANGELOG_CMD])
3193f126e068Smrg]) # XORG_CHANGELOG
319496a81b41Smrg
3195