aclocal.m4 revision 70f7c90c
170f7c90cSmrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
2a850946eSmrg
370f7c90cSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
470f7c90cSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5a850946eSmrg# This file is free software; the Free Software Foundation
6a850946eSmrg# gives unlimited permission to copy and/or distribute it,
7a850946eSmrg# with or without modifications, as long as this notice is preserved.
8a850946eSmrg
9a850946eSmrg# This program is distributed in the hope that it will be useful,
10a850946eSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11a850946eSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12a850946eSmrg# PARTICULAR PURPOSE.
13a850946eSmrg
1470f7c90cSmrgm4_ifndef([AC_AUTOCONF_VERSION],
1570f7c90cSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1670f7c90cSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
1770f7c90cSmrg[m4_warning([this file was generated for autoconf 2.63.
1870f7c90cSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
1970f7c90cSmrgIf you have problems, you may need to regenerate the build system entirely.
2070f7c90cSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21a850946eSmrg
2270f7c90cSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2370f7c90cSmrg#
2470f7c90cSmrg# This file is free software; the Free Software Foundation
2570f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
2670f7c90cSmrg# with or without modifications, as long as this notice is preserved.
27a850946eSmrg
28a850946eSmrg# AM_AUTOMAKE_VERSION(VERSION)
29a850946eSmrg# ----------------------------
30a850946eSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31a850946eSmrg# generated from the m4 files accompanying Automake X.Y.
3270f7c90cSmrg# (This private macro should not be called outside this file.)
3370f7c90cSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3470f7c90cSmrg[am__api_version='1.11'
3570f7c90cSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3670f7c90cSmrgdnl require some minimum version.  Point them to the right macro.
3770f7c90cSmrgm4_if([$1], [1.11], [],
3870f7c90cSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3970f7c90cSmrg])
4070f7c90cSmrg
4170f7c90cSmrg# _AM_AUTOCONF_VERSION(VERSION)
4270f7c90cSmrg# -----------------------------
4370f7c90cSmrg# aclocal traces this macro to find the Autoconf version.
4470f7c90cSmrg# This is a private macro too.  Using m4_define simplifies
4570f7c90cSmrg# the logic in aclocal, which can simply ignore this definition.
4670f7c90cSmrgm4_define([_AM_AUTOCONF_VERSION], [])
47a850946eSmrg
48a850946eSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49a850946eSmrg# -------------------------------
5070f7c90cSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5170f7c90cSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52a850946eSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5370f7c90cSmrg[AM_AUTOMAKE_VERSION([1.11])dnl
5470f7c90cSmrgm4_ifndef([AC_AUTOCONF_VERSION],
5570f7c90cSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5670f7c90cSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57a850946eSmrg
5870f7c90cSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59a850946eSmrg
6070f7c90cSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61a850946eSmrg#
6270f7c90cSmrg# This file is free software; the Free Software Foundation
6370f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
6470f7c90cSmrg# with or without modifications, as long as this notice is preserved.
65a850946eSmrg
66a850946eSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67a850946eSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68a850946eSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69a850946eSmrg#
70a850946eSmrg# Of course, Automake must honor this variable whenever it calls a
71a850946eSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72a850946eSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73a850946eSmrg# depending on how configure is run.  This is pretty annoying, since
74a850946eSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75a850946eSmrg# source directory, any form will work fine, but in subdirectories a
76a850946eSmrg# relative path needs to be adjusted first.
77a850946eSmrg#
78a850946eSmrg# $ac_aux_dir/missing
79a850946eSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80a850946eSmrg# $top_srcdir/$ac_aux_dir/missing
81a850946eSmrg#    fails if $ac_aux_dir is absolute,
82a850946eSmrg#    fails when called from a subdirectory in a VPATH build with
83a850946eSmrg#          a relative $ac_aux_dir
84a850946eSmrg#
85a850946eSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86a850946eSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
87a850946eSmrg# harmless because $srcdir is `.', but things will broke when you
88a850946eSmrg# start a VPATH build or use an absolute $srcdir.
89a850946eSmrg#
90a850946eSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91a850946eSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92a850946eSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93a850946eSmrg# and then we would define $MISSING as
94a850946eSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95a850946eSmrg# This will work as long as MISSING is not called from configure, because
96a850946eSmrg# unfortunately $(top_srcdir) has no meaning in configure.
97a850946eSmrg# However there are other variables, like CC, which are often used in
98a850946eSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99a850946eSmrg#
100a850946eSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
101a850946eSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
102a850946eSmrg# configured tree to be moved without reconfiguration.
103a850946eSmrg
10470f7c90cSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10570f7c90cSmrg[dnl Rely on autoconf to set up CDPATH properly.
10670f7c90cSmrgAC_PREREQ([2.50])dnl
107a850946eSmrg# expand $ac_aux_dir to an absolute path
108a850946eSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
109a850946eSmrg])
110a850946eSmrg
11170f7c90cSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112a850946eSmrg
11370f7c90cSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11470f7c90cSmrg# Free Software Foundation, Inc.
11570f7c90cSmrg#
11670f7c90cSmrg# This file is free software; the Free Software Foundation
11770f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
11870f7c90cSmrg# with or without modifications, as long as this notice is preserved.
119a850946eSmrg
12070f7c90cSmrg# serial 9
121a850946eSmrg
12270f7c90cSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12370f7c90cSmrg# -------------------------------------
12470f7c90cSmrg# Define a conditional.
12570f7c90cSmrgAC_DEFUN([AM_CONDITIONAL],
12670f7c90cSmrg[AC_PREREQ(2.52)dnl
12770f7c90cSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12870f7c90cSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12970f7c90cSmrgAC_SUBST([$1_TRUE])dnl
13070f7c90cSmrgAC_SUBST([$1_FALSE])dnl
13170f7c90cSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
13270f7c90cSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
13370f7c90cSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13470f7c90cSmrgif $2; then
13570f7c90cSmrg  $1_TRUE=
13670f7c90cSmrg  $1_FALSE='#'
137a850946eSmrgelse
13870f7c90cSmrg  $1_TRUE='#'
13970f7c90cSmrg  $1_FALSE=
140a850946eSmrgfi
14170f7c90cSmrgAC_CONFIG_COMMANDS_PRE(
14270f7c90cSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14370f7c90cSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14470f7c90cSmrgUsually this means the macro was only invoked conditionally.]])
14570f7c90cSmrgfi])])
146a850946eSmrg
14770f7c90cSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
14870f7c90cSmrg# Free Software Foundation, Inc.
14970f7c90cSmrg#
15070f7c90cSmrg# This file is free software; the Free Software Foundation
15170f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
15270f7c90cSmrg# with or without modifications, as long as this notice is preserved.
153a850946eSmrg
15470f7c90cSmrg# serial 10
155a850946eSmrg
156a850946eSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157a850946eSmrg# written in clear, in which case automake, when reading aclocal.m4,
158a850946eSmrg# will think it sees a *use*, and therefore will trigger all it's
159a850946eSmrg# C support machinery.  Also note that it means that autoscan, seeing
160a850946eSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161a850946eSmrg
162a850946eSmrg
163a850946eSmrg# _AM_DEPENDENCIES(NAME)
164a850946eSmrg# ----------------------
165a850946eSmrg# See how the compiler implements dependency checking.
166a850946eSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167a850946eSmrg# We try a few techniques and use that to set a single cache variable.
168a850946eSmrg#
169a850946eSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170a850946eSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171a850946eSmrg# dependency, and given that the user is not expected to run this macro,
172a850946eSmrg# just rely on AC_PROG_CC.
173a850946eSmrgAC_DEFUN([_AM_DEPENDENCIES],
174a850946eSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175a850946eSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176a850946eSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177a850946eSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178a850946eSmrg
179a850946eSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180a850946eSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181a850946eSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
18270f7c90cSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183a850946eSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184a850946eSmrg                   [depcc="$$1"   am_compiler_list=])
185a850946eSmrg
186a850946eSmrgAC_CACHE_CHECK([dependency style of $depcc],
187a850946eSmrg               [am_cv_$1_dependencies_compiler_type],
188a850946eSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189a850946eSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
190a850946eSmrg  # making bogus files that we don't know about and never remove.  For
191a850946eSmrg  # instance it was reported that on HP-UX the gcc test will end up
192a850946eSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
193a850946eSmrg  # in D'.
194a850946eSmrg  mkdir conftest.dir
195a850946eSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196a850946eSmrg  # using a relative directory.
197a850946eSmrg  cp "$am_depcomp" conftest.dir
198a850946eSmrg  cd conftest.dir
199a850946eSmrg  # We will build objects and dependencies in a subdirectory because
200a850946eSmrg  # it helps to detect inapplicable dependency modes.  For instance
201a850946eSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202a850946eSmrg  # side effect of compilation, but ICC will put the dependencies in
203a850946eSmrg  # the current directory while Tru64 will put them in the object
204a850946eSmrg  # directory.
205a850946eSmrg  mkdir sub
206a850946eSmrg
207a850946eSmrg  am_cv_$1_dependencies_compiler_type=none
208a850946eSmrg  if test "$am_compiler_list" = ""; then
209a850946eSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210a850946eSmrg  fi
21170f7c90cSmrg  am__universal=false
21270f7c90cSmrg  m4_case([$1], [CC],
21370f7c90cSmrg    [case " $depcc " in #(
21470f7c90cSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21570f7c90cSmrg     esac],
21670f7c90cSmrg    [CXX],
21770f7c90cSmrg    [case " $depcc " in #(
21870f7c90cSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21970f7c90cSmrg     esac])
22070f7c90cSmrg
221a850946eSmrg  for depmode in $am_compiler_list; do
222a850946eSmrg    # Setup a source with many dependencies, because some compilers
223a850946eSmrg    # like to wrap large dependency lists on column 80 (with \), and
224a850946eSmrg    # we should not choose a depcomp mode which is confused by this.
225a850946eSmrg    #
226a850946eSmrg    # We need to recreate these files for each test, as the compiler may
227a850946eSmrg    # overwrite some of them when testing with obscure command lines.
228a850946eSmrg    # This happens at least with the AIX C compiler.
229a850946eSmrg    : > sub/conftest.c
230a850946eSmrg    for i in 1 2 3 4 5 6; do
231a850946eSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23270f7c90cSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
23370f7c90cSmrg      # Solaris 8's {/usr,}/bin/sh.
23470f7c90cSmrg      touch sub/conftst$i.h
235a850946eSmrg    done
236a850946eSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237a850946eSmrg
23870f7c90cSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
23970f7c90cSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
24070f7c90cSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
24170f7c90cSmrg    # versions had trouble with output in subdirs
24270f7c90cSmrg    am__obj=sub/conftest.${OBJEXT-o}
24370f7c90cSmrg    am__minus_obj="-o $am__obj"
244a850946eSmrg    case $depmode in
24570f7c90cSmrg    gcc)
24670f7c90cSmrg      # This depmode causes a compiler race in universal mode.
24770f7c90cSmrg      test "$am__universal" = false || continue
24870f7c90cSmrg      ;;
249a850946eSmrg    nosideeffect)
250a850946eSmrg      # after this tag, mechanisms are not by side-effect, so they'll
251a850946eSmrg      # only be used when explicitly requested
252a850946eSmrg      if test "x$enable_dependency_tracking" = xyes; then
253a850946eSmrg	continue
254a850946eSmrg      else
255a850946eSmrg	break
256a850946eSmrg      fi
257a850946eSmrg      ;;
25870f7c90cSmrg    msvisualcpp | msvcmsys)
25970f7c90cSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
26070f7c90cSmrg      # not run yet.  These depmodes are late enough in the game, and
26170f7c90cSmrg      # so weak that their functioning should not be impacted.
26270f7c90cSmrg      am__obj=conftest.${OBJEXT-o}
26370f7c90cSmrg      am__minus_obj=
26470f7c90cSmrg      ;;
265a850946eSmrg    none) break ;;
266a850946eSmrg    esac
267a850946eSmrg    if depmode=$depmode \
26870f7c90cSmrg       source=sub/conftest.c object=$am__obj \
269a850946eSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
27070f7c90cSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271a850946eSmrg         >/dev/null 2>conftest.err &&
27270f7c90cSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273a850946eSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27470f7c90cSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275a850946eSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276a850946eSmrg      # icc doesn't choke on unknown options, it will just issue warnings
27770f7c90cSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
27870f7c90cSmrg      # that says an option was ignored or not supported.
27970f7c90cSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
28070f7c90cSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
28170f7c90cSmrg      # The diagnosis changed in icc 8.0:
28270f7c90cSmrg      #   icc: Command line remark: option '-MP' not supported
28370f7c90cSmrg      if (grep 'ignoring option' conftest.err ||
28470f7c90cSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285a850946eSmrg        am_cv_$1_dependencies_compiler_type=$depmode
286a850946eSmrg        break
287a850946eSmrg      fi
288a850946eSmrg    fi
289a850946eSmrg  done
290a850946eSmrg
291a850946eSmrg  cd ..
292a850946eSmrg  rm -rf conftest.dir
293a850946eSmrgelse
294a850946eSmrg  am_cv_$1_dependencies_compiler_type=none
295a850946eSmrgfi
296a850946eSmrg])
297a850946eSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298a850946eSmrgAM_CONDITIONAL([am__fastdep$1], [
299a850946eSmrg  test "x$enable_dependency_tracking" != xno \
300a850946eSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301a850946eSmrg])
302a850946eSmrg
303a850946eSmrg
304a850946eSmrg# AM_SET_DEPDIR
305a850946eSmrg# -------------
306a850946eSmrg# Choose a directory name for dependency files.
307a850946eSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308a850946eSmrgAC_DEFUN([AM_SET_DEPDIR],
309a850946eSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310a850946eSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311a850946eSmrg])
312a850946eSmrg
313a850946eSmrg
314a850946eSmrg# AM_DEP_TRACK
315a850946eSmrg# ------------
316a850946eSmrgAC_DEFUN([AM_DEP_TRACK],
317a850946eSmrg[AC_ARG_ENABLE(dependency-tracking,
31870f7c90cSmrg[  --disable-dependency-tracking  speeds up one-time build
31970f7c90cSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320a850946eSmrgif test "x$enable_dependency_tracking" != xno; then
321a850946eSmrg  am_depcomp="$ac_aux_dir/depcomp"
322a850946eSmrg  AMDEPBACKSLASH='\'
323a850946eSmrgfi
324a850946eSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
32570f7c90cSmrgAC_SUBST([AMDEPBACKSLASH])dnl
32670f7c90cSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327a850946eSmrg])
328a850946eSmrg
32970f7c90cSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330a850946eSmrg
33170f7c90cSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33270f7c90cSmrg# Free Software Foundation, Inc.
33370f7c90cSmrg#
33470f7c90cSmrg# This file is free software; the Free Software Foundation
33570f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
33670f7c90cSmrg# with or without modifications, as long as this notice is preserved.
337a850946eSmrg
33870f7c90cSmrg#serial 5
339a850946eSmrg
340a850946eSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341a850946eSmrg# ------------------------------
342a850946eSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
34370f7c90cSmrg[{
34470f7c90cSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
34570f7c90cSmrg  # are listed without --file.  Let's play safe and only enable the eval
34670f7c90cSmrg  # if we detect the quoting.
34770f7c90cSmrg  case $CONFIG_FILES in
34870f7c90cSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
34970f7c90cSmrg  *)   set x $CONFIG_FILES ;;
35070f7c90cSmrg  esac
35170f7c90cSmrg  shift
35270f7c90cSmrg  for mf
35370f7c90cSmrg  do
35470f7c90cSmrg    # Strip MF so we end up with the name of the file.
35570f7c90cSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
35670f7c90cSmrg    # Check whether this is an Automake generated Makefile or not.
35770f7c90cSmrg    # We used to match only the files named `Makefile.in', but
35870f7c90cSmrg    # some people rename them; so instead we look at the file content.
35970f7c90cSmrg    # Grep'ing the first line is not enough: some people post-process
36070f7c90cSmrg    # each Makefile.in and add a new line on top of each file to say so.
36170f7c90cSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
36270f7c90cSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
36370f7c90cSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36470f7c90cSmrg      dirpart=`AS_DIRNAME("$mf")`
36570f7c90cSmrg    else
36670f7c90cSmrg      continue
36770f7c90cSmrg    fi
36870f7c90cSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
36970f7c90cSmrg    # from the Makefile without running `make'.
37070f7c90cSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
37170f7c90cSmrg    test -z "$DEPDIR" && continue
37270f7c90cSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
37370f7c90cSmrg    test -z "am__include" && continue
37470f7c90cSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37570f7c90cSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
37670f7c90cSmrg    U=`sed -n 's/^U = //p' < "$mf"`
37770f7c90cSmrg    # Find all dependency output files, they are included files with
37870f7c90cSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
37970f7c90cSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
38070f7c90cSmrg    # expansion.
38170f7c90cSmrg    for file in `sed -n "
38270f7c90cSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
38370f7c90cSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
38470f7c90cSmrg      # Make sure the directory exists.
38570f7c90cSmrg      test -f "$dirpart/$file" && continue
38670f7c90cSmrg      fdir=`AS_DIRNAME(["$file"])`
38770f7c90cSmrg      AS_MKDIR_P([$dirpart/$fdir])
38870f7c90cSmrg      # echo "creating $dirpart/$file"
38970f7c90cSmrg      echo '# dummy' > "$dirpart/$file"
39070f7c90cSmrg    done
391a850946eSmrg  done
39270f7c90cSmrg}
393a850946eSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394a850946eSmrg
395a850946eSmrg
396a850946eSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397a850946eSmrg# -----------------------------
398a850946eSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
399a850946eSmrg#
400a850946eSmrg# This code is only required when automatic dependency tracking
401a850946eSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
402a850946eSmrg# need in order to bootstrap the dependency handling code.
403a850946eSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404a850946eSmrg[AC_CONFIG_COMMANDS([depfiles],
405a850946eSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406a850946eSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407a850946eSmrg])
408a850946eSmrg
40970f7c90cSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
41070f7c90cSmrg# Free Software Foundation, Inc.
41170f7c90cSmrg#
41270f7c90cSmrg# This file is free software; the Free Software Foundation
41370f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
41470f7c90cSmrg# with or without modifications, as long as this notice is preserved.
415a850946eSmrg
41670f7c90cSmrg# serial 8
417a850946eSmrg
41870f7c90cSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
41970f7c90cSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
420a850946eSmrg
42170f7c90cSmrg# Do all the work for Automake.                             -*- Autoconf -*-
422a850946eSmrg
42370f7c90cSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
42470f7c90cSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
42570f7c90cSmrg#
42670f7c90cSmrg# This file is free software; the Free Software Foundation
42770f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
42870f7c90cSmrg# with or without modifications, as long as this notice is preserved.
429a850946eSmrg
43070f7c90cSmrg# serial 16
431a850946eSmrg
43270f7c90cSmrg# This macro actually does too much.  Some checks are only needed if
43370f7c90cSmrg# your package does certain things.  But this isn't really a big deal.
43470f7c90cSmrg
43570f7c90cSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
43670f7c90cSmrg# AM_INIT_AUTOMAKE([OPTIONS])
43770f7c90cSmrg# -----------------------------------------------
43870f7c90cSmrg# The call with PACKAGE and VERSION arguments is the old style
43970f7c90cSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
44070f7c90cSmrg# and VERSION should now be passed to AC_INIT and removed from
44170f7c90cSmrg# the call to AM_INIT_AUTOMAKE.
44270f7c90cSmrg# We support both call styles for the transition.  After
44370f7c90cSmrg# the next Automake release, Autoconf can make the AC_INIT
44470f7c90cSmrg# arguments mandatory, and then we can depend on a new Autoconf
44570f7c90cSmrg# release and drop the old call support.
44670f7c90cSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
44770f7c90cSmrg[AC_PREREQ([2.62])dnl
44870f7c90cSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
44970f7c90cSmrgdnl the ones we care about.
45070f7c90cSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
45170f7c90cSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
45270f7c90cSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
45370f7c90cSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
45470f7c90cSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
45570f7c90cSmrg  # is not polluted with repeated "-I."
45670f7c90cSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
45770f7c90cSmrg  # test to see if srcdir already configured
45870f7c90cSmrg  if test -f $srcdir/config.status; then
45970f7c90cSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
46070f7c90cSmrg  fi
461a850946eSmrgfi
46270f7c90cSmrg
46370f7c90cSmrg# test whether we have cygpath
46470f7c90cSmrgif test -z "$CYGPATH_W"; then
46570f7c90cSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
46670f7c90cSmrg    CYGPATH_W='cygpath -w'
46770f7c90cSmrg  else
46870f7c90cSmrg    CYGPATH_W=echo
46970f7c90cSmrg  fi
470a850946eSmrgfi
47170f7c90cSmrgAC_SUBST([CYGPATH_W])
472a850946eSmrg
47370f7c90cSmrg# Define the identity of the package.
47470f7c90cSmrgdnl Distinguish between old-style and new-style calls.
47570f7c90cSmrgm4_ifval([$2],
47670f7c90cSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
47770f7c90cSmrg AC_SUBST([PACKAGE], [$1])dnl
47870f7c90cSmrg AC_SUBST([VERSION], [$2])],
47970f7c90cSmrg[_AM_SET_OPTIONS([$1])dnl
48070f7c90cSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
48170f7c90cSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
48270f7c90cSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
48370f7c90cSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
48470f7c90cSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
485a850946eSmrg
48670f7c90cSmrg_AM_IF_OPTION([no-define],,
48770f7c90cSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
48870f7c90cSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489a850946eSmrg
49070f7c90cSmrg# Some tools Automake needs.
49170f7c90cSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
49270f7c90cSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
49370f7c90cSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
49470f7c90cSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
49570f7c90cSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
49670f7c90cSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
49770f7c90cSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
49870f7c90cSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
49970f7c90cSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
50070f7c90cSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
50170f7c90cSmrg# We need awk for the "check" target.  The system "awk" is bad on
50270f7c90cSmrg# some platforms.
50370f7c90cSmrgAC_REQUIRE([AC_PROG_AWK])dnl
50470f7c90cSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
50570f7c90cSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
50670f7c90cSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
50770f7c90cSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
50870f7c90cSmrg			     [_AM_PROG_TAR([v7])])])
50970f7c90cSmrg_AM_IF_OPTION([no-dependencies],,
51070f7c90cSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
51170f7c90cSmrg		  [_AM_DEPENDENCIES(CC)],
51270f7c90cSmrg		  [define([AC_PROG_CC],
51370f7c90cSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
51470f7c90cSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
51570f7c90cSmrg		  [_AM_DEPENDENCIES(CXX)],
51670f7c90cSmrg		  [define([AC_PROG_CXX],
51770f7c90cSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
51870f7c90cSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
51970f7c90cSmrg		  [_AM_DEPENDENCIES(OBJC)],
52070f7c90cSmrg		  [define([AC_PROG_OBJC],
52170f7c90cSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
52270f7c90cSmrg])
52370f7c90cSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
52470f7c90cSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
52570f7c90cSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
52670f7c90cSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
52770f7c90cSmrgAC_CONFIG_COMMANDS_PRE(dnl
52870f7c90cSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
52970f7c90cSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
53070f7c90cSmrg])
531a850946eSmrg
53270f7c90cSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
53370f7c90cSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
53470f7c90cSmrgdnl mangled by Autoconf and run in a shell conditional statement.
53570f7c90cSmrgm4_define([_AC_COMPILER_EXEEXT],
53670f7c90cSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537a850946eSmrg
538a850946eSmrg
53970f7c90cSmrg# When config.status generates a header, we must update the stamp-h file.
54070f7c90cSmrg# This file resides in the same directory as the config header
54170f7c90cSmrg# that is generated.  The stamp files are numbered to have different names.
54270f7c90cSmrg
54370f7c90cSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
54470f7c90cSmrg# loop where config.status creates the headers, so we can generate
54570f7c90cSmrg# our stamp files there.
54670f7c90cSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
54770f7c90cSmrg[# Compute $1's index in $config_headers.
54870f7c90cSmrg_am_arg=$1
54970f7c90cSmrg_am_stamp_count=1
55070f7c90cSmrgfor _am_header in $config_headers :; do
55170f7c90cSmrg  case $_am_header in
55270f7c90cSmrg    $_am_arg | $_am_arg:* )
55370f7c90cSmrg      break ;;
55470f7c90cSmrg    * )
55570f7c90cSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
55670f7c90cSmrg  esac
55770f7c90cSmrgdone
55870f7c90cSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
559a850946eSmrg
56070f7c90cSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
56170f7c90cSmrg#
56270f7c90cSmrg# This file is free software; the Free Software Foundation
56370f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
56470f7c90cSmrg# with or without modifications, as long as this notice is preserved.
565a850946eSmrg
56670f7c90cSmrg# AM_PROG_INSTALL_SH
56770f7c90cSmrg# ------------------
56870f7c90cSmrg# Define $install_sh.
56970f7c90cSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
57070f7c90cSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
57170f7c90cSmrgif test x"${install_sh}" != xset; then
57270f7c90cSmrg  case $am_aux_dir in
57370f7c90cSmrg  *\ * | *\	*)
57470f7c90cSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
57570f7c90cSmrg  *)
57670f7c90cSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
57770f7c90cSmrg  esac
578a850946eSmrgfi
57970f7c90cSmrgAC_SUBST(install_sh)])
580a850946eSmrg
58170f7c90cSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
58270f7c90cSmrg#
58370f7c90cSmrg# This file is free software; the Free Software Foundation
58470f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
58570f7c90cSmrg# with or without modifications, as long as this notice is preserved.
586a850946eSmrg
58770f7c90cSmrg# serial 2
588a850946eSmrg
58970f7c90cSmrg# Check whether the underlying file-system supports filenames
59070f7c90cSmrg# with a leading dot.  For instance MS-DOS doesn't.
59170f7c90cSmrgAC_DEFUN([AM_SET_LEADING_DOT],
59270f7c90cSmrg[rm -rf .tst 2>/dev/null
59370f7c90cSmrgmkdir .tst 2>/dev/null
59470f7c90cSmrgif test -d .tst; then
59570f7c90cSmrg  am__leading_dot=.
59670f7c90cSmrgelse
59770f7c90cSmrg  am__leading_dot=_
59870f7c90cSmrgfi
59970f7c90cSmrgrmdir .tst 2>/dev/null
60070f7c90cSmrgAC_SUBST([am__leading_dot])])
601a850946eSmrg
60270f7c90cSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
60370f7c90cSmrg# From Jim Meyering
604a850946eSmrg
60570f7c90cSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
60670f7c90cSmrg# Free Software Foundation, Inc.
60770f7c90cSmrg#
60870f7c90cSmrg# This file is free software; the Free Software Foundation
60970f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
61070f7c90cSmrg# with or without modifications, as long as this notice is preserved.
611a850946eSmrg
61270f7c90cSmrg# serial 5
613a850946eSmrg
61470f7c90cSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
61570f7c90cSmrg# ----------------------------------
61670f7c90cSmrg# Control maintainer-specific portions of Makefiles.
61770f7c90cSmrg# Default is to disable them, unless `enable' is passed literally.
61870f7c90cSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
61970f7c90cSmrg# can override the default with the --enable/--disable switch.
620a850946eSmrgAC_DEFUN([AM_MAINTAINER_MODE],
62170f7c90cSmrg[m4_case(m4_default([$1], [disable]),
62270f7c90cSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
62370f7c90cSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
62470f7c90cSmrg       [m4_define([am_maintainer_other], [enable])
62570f7c90cSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
62670f7c90cSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
62770f7c90cSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
62870f7c90cSmrg  AC_ARG_ENABLE([maintainer-mode],
62970f7c90cSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
63070f7c90cSmrg			  (and sometimes confusing) to the casual installer],
63170f7c90cSmrg      [USE_MAINTAINER_MODE=$enableval],
63270f7c90cSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
633a850946eSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
63470f7c90cSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
635a850946eSmrg  MAINT=$MAINTAINER_MODE_TRUE
63670f7c90cSmrg  AC_SUBST([MAINT])dnl
637a850946eSmrg]
638a850946eSmrg)
639a850946eSmrg
640a850946eSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
641a850946eSmrg
64270f7c90cSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
643a850946eSmrg
64470f7c90cSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
64570f7c90cSmrg#
64670f7c90cSmrg# This file is free software; the Free Software Foundation
64770f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
64870f7c90cSmrg# with or without modifications, as long as this notice is preserved.
649a850946eSmrg
65070f7c90cSmrg# serial 4
651a850946eSmrg
65270f7c90cSmrg# AM_MAKE_INCLUDE()
65370f7c90cSmrg# -----------------
65470f7c90cSmrg# Check to see how make treats includes.
65570f7c90cSmrgAC_DEFUN([AM_MAKE_INCLUDE],
65670f7c90cSmrg[am_make=${MAKE-make}
65770f7c90cSmrgcat > confinc << 'END'
65870f7c90cSmrgam__doit:
65970f7c90cSmrg	@echo this is the am__doit target
66070f7c90cSmrg.PHONY: am__doit
66170f7c90cSmrgEND
66270f7c90cSmrg# If we don't find an include directive, just comment out the code.
66370f7c90cSmrgAC_MSG_CHECKING([for style of include used by $am_make])
66470f7c90cSmrgam__include="#"
66570f7c90cSmrgam__quote=
66670f7c90cSmrg_am_result=none
66770f7c90cSmrg# First try GNU make style include.
66870f7c90cSmrgecho "include confinc" > confmf
66970f7c90cSmrg# Ignore all kinds of additional output from `make'.
67070f7c90cSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
67170f7c90cSmrg*the\ am__doit\ target*)
67270f7c90cSmrg  am__include=include
67370f7c90cSmrg  am__quote=
67470f7c90cSmrg  _am_result=GNU
67570f7c90cSmrg  ;;
67670f7c90cSmrgesac
67770f7c90cSmrg# Now try BSD make style include.
67870f7c90cSmrgif test "$am__include" = "#"; then
67970f7c90cSmrg   echo '.include "confinc"' > confmf
68070f7c90cSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
68170f7c90cSmrg   *the\ am__doit\ target*)
68270f7c90cSmrg     am__include=.include
68370f7c90cSmrg     am__quote="\""
68470f7c90cSmrg     _am_result=BSD
68570f7c90cSmrg     ;;
68670f7c90cSmrg   esac
68770f7c90cSmrgfi
68870f7c90cSmrgAC_SUBST([am__include])
68970f7c90cSmrgAC_SUBST([am__quote])
69070f7c90cSmrgAC_MSG_RESULT([$_am_result])
69170f7c90cSmrgrm -f confinc confmf
69270f7c90cSmrg])
693a850946eSmrg
69470f7c90cSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
695a850946eSmrg
69670f7c90cSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
69770f7c90cSmrg# Free Software Foundation, Inc.
69870f7c90cSmrg#
69970f7c90cSmrg# This file is free software; the Free Software Foundation
70070f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
70170f7c90cSmrg# with or without modifications, as long as this notice is preserved.
702a850946eSmrg
703a850946eSmrg# serial 6
704a850946eSmrg
70570f7c90cSmrg# AM_MISSING_PROG(NAME, PROGRAM)
70670f7c90cSmrg# ------------------------------
70770f7c90cSmrgAC_DEFUN([AM_MISSING_PROG],
70870f7c90cSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
70970f7c90cSmrg$1=${$1-"${am_missing_run}$2"}
71070f7c90cSmrgAC_SUBST($1)])
711a850946eSmrg
712a850946eSmrg
71370f7c90cSmrg# AM_MISSING_HAS_RUN
71470f7c90cSmrg# ------------------
71570f7c90cSmrg# Define MISSING if not defined so far and test if it supports --run.
71670f7c90cSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
71770f7c90cSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
71870f7c90cSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
71970f7c90cSmrgAC_REQUIRE_AUX_FILE([missing])dnl
72070f7c90cSmrgif test x"${MISSING+set}" != xset; then
72170f7c90cSmrg  case $am_aux_dir in
72270f7c90cSmrg  *\ * | *\	*)
72370f7c90cSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
72470f7c90cSmrg  *)
72570f7c90cSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
72670f7c90cSmrg  esac
727a850946eSmrgfi
72870f7c90cSmrg# Use eval to expand $SHELL
72970f7c90cSmrgif eval "$MISSING --run true"; then
73070f7c90cSmrg  am_missing_run="$MISSING --run "
73170f7c90cSmrgelse
73270f7c90cSmrg  am_missing_run=
73370f7c90cSmrg  AC_MSG_WARN([`missing' script is too old or missing])
73470f7c90cSmrgfi
73570f7c90cSmrg])
736a850946eSmrg
73770f7c90cSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
738a850946eSmrg#
73970f7c90cSmrg# This file is free software; the Free Software Foundation
74070f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
74170f7c90cSmrg# with or without modifications, as long as this notice is preserved.
74270f7c90cSmrg
74370f7c90cSmrg# AM_PROG_MKDIR_P
74470f7c90cSmrg# ---------------
74570f7c90cSmrg# Check for `mkdir -p'.
74670f7c90cSmrgAC_DEFUN([AM_PROG_MKDIR_P],
74770f7c90cSmrg[AC_PREREQ([2.60])dnl
74870f7c90cSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
74970f7c90cSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
75070f7c90cSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
75170f7c90cSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
75270f7c90cSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
75370f7c90cSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
75470f7c90cSmrgdnl adjustment using top_builddir (which is defined more often than
75570f7c90cSmrgdnl MKDIR_P).
75670f7c90cSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
75770f7c90cSmrgcase $mkdir_p in
75870f7c90cSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
75970f7c90cSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
76070f7c90cSmrgesac
76170f7c90cSmrg])
76270f7c90cSmrg
76370f7c90cSmrg# Helper functions for option handling.                     -*- Autoconf -*-
76470f7c90cSmrg
76570f7c90cSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
766a850946eSmrg#
76770f7c90cSmrg# This file is free software; the Free Software Foundation
76870f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
76970f7c90cSmrg# with or without modifications, as long as this notice is preserved.
770a850946eSmrg
77170f7c90cSmrg# serial 4
772a850946eSmrg
77370f7c90cSmrg# _AM_MANGLE_OPTION(NAME)
77470f7c90cSmrg# -----------------------
77570f7c90cSmrgAC_DEFUN([_AM_MANGLE_OPTION],
77670f7c90cSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
777a850946eSmrg
77870f7c90cSmrg# _AM_SET_OPTION(NAME)
77970f7c90cSmrg# ------------------------------
78070f7c90cSmrg# Set option NAME.  Presently that only means defining a flag for this option.
78170f7c90cSmrgAC_DEFUN([_AM_SET_OPTION],
78270f7c90cSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
783a850946eSmrg
78470f7c90cSmrg# _AM_SET_OPTIONS(OPTIONS)
78570f7c90cSmrg# ----------------------------------
78670f7c90cSmrg# OPTIONS is a space-separated list of Automake options.
78770f7c90cSmrgAC_DEFUN([_AM_SET_OPTIONS],
78870f7c90cSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
789a850946eSmrg
79070f7c90cSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
79170f7c90cSmrg# -------------------------------------------
79270f7c90cSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
79370f7c90cSmrgAC_DEFUN([_AM_IF_OPTION],
79470f7c90cSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
79570f7c90cSmrg
79670f7c90cSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
79770f7c90cSmrg
79870f7c90cSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
79970f7c90cSmrg# Free Software Foundation, Inc.
800a850946eSmrg#
80170f7c90cSmrg# This file is free software; the Free Software Foundation
80270f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
80370f7c90cSmrg# with or without modifications, as long as this notice is preserved.
80470f7c90cSmrg
80570f7c90cSmrg# serial 5
80670f7c90cSmrg
80770f7c90cSmrg# AM_SANITY_CHECK
80870f7c90cSmrg# ---------------
80970f7c90cSmrgAC_DEFUN([AM_SANITY_CHECK],
81070f7c90cSmrg[AC_MSG_CHECKING([whether build environment is sane])
81170f7c90cSmrg# Just in case
81270f7c90cSmrgsleep 1
81370f7c90cSmrgecho timestamp > conftest.file
81470f7c90cSmrg# Reject unsafe characters in $srcdir or the absolute working directory
81570f7c90cSmrg# name.  Accept space and tab only in the latter.
81670f7c90cSmrgam_lf='
81770f7c90cSmrg'
81870f7c90cSmrgcase `pwd` in
81970f7c90cSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
82070f7c90cSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
82170f7c90cSmrgesac
82270f7c90cSmrgcase $srcdir in
82370f7c90cSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
82470f7c90cSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
82570f7c90cSmrgesac
82670f7c90cSmrg
82770f7c90cSmrg# Do `set' in a subshell so we don't clobber the current shell's
82870f7c90cSmrg# arguments.  Must try -L first in case configure is actually a
82970f7c90cSmrg# symlink; some systems play weird games with the mod time of symlinks
83070f7c90cSmrg# (eg FreeBSD returns the mod time of the symlink's containing
83170f7c90cSmrg# directory).
83270f7c90cSmrgif (
83370f7c90cSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
83470f7c90cSmrg   if test "$[*]" = "X"; then
83570f7c90cSmrg      # -L didn't work.
83670f7c90cSmrg      set X `ls -t "$srcdir/configure" conftest.file`
83770f7c90cSmrg   fi
83870f7c90cSmrg   rm -f conftest.file
83970f7c90cSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
84070f7c90cSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
84170f7c90cSmrg
84270f7c90cSmrg      # If neither matched, then we have a broken ls.  This can happen
84370f7c90cSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
84470f7c90cSmrg      # broken ls alias from the environment.  This has actually
84570f7c90cSmrg      # happened.  Such a system could not be considered "sane".
84670f7c90cSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
84770f7c90cSmrgalias in your environment])
84870f7c90cSmrg   fi
84970f7c90cSmrg
85070f7c90cSmrg   test "$[2]" = conftest.file
85170f7c90cSmrg   )
85270f7c90cSmrgthen
85370f7c90cSmrg   # Ok.
85470f7c90cSmrg   :
85570f7c90cSmrgelse
85670f7c90cSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
85770f7c90cSmrgCheck your system clock])
85870f7c90cSmrgfi
85970f7c90cSmrgAC_MSG_RESULT(yes)])
86070f7c90cSmrg
86170f7c90cSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
862a850946eSmrg#
86370f7c90cSmrg# This file is free software; the Free Software Foundation
86470f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
86570f7c90cSmrg# with or without modifications, as long as this notice is preserved.
86670f7c90cSmrg
86770f7c90cSmrg# serial 1
86870f7c90cSmrg
86970f7c90cSmrg# AM_SILENT_RULES([DEFAULT])
87070f7c90cSmrg# --------------------------
87170f7c90cSmrg# Enable less verbose build rules; with the default set to DEFAULT
87270f7c90cSmrg# (`yes' being less verbose, `no' or empty being verbose).
87370f7c90cSmrgAC_DEFUN([AM_SILENT_RULES],
87470f7c90cSmrg[AC_ARG_ENABLE([silent-rules],
87570f7c90cSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
87670f7c90cSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
87770f7c90cSmrgcase $enable_silent_rules in
87870f7c90cSmrgyes) AM_DEFAULT_VERBOSITY=0;;
87970f7c90cSmrgno)  AM_DEFAULT_VERBOSITY=1;;
88070f7c90cSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
88170f7c90cSmrgesac
88270f7c90cSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
88370f7c90cSmrgAM_BACKSLASH='\'
88470f7c90cSmrgAC_SUBST([AM_BACKSLASH])dnl
88570f7c90cSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
88670f7c90cSmrg])
88770f7c90cSmrg
88870f7c90cSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
889a850946eSmrg#
89070f7c90cSmrg# This file is free software; the Free Software Foundation
89170f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
89270f7c90cSmrg# with or without modifications, as long as this notice is preserved.
893a850946eSmrg
89470f7c90cSmrg# AM_PROG_INSTALL_STRIP
89570f7c90cSmrg# ---------------------
89670f7c90cSmrg# One issue with vendor `install' (even GNU) is that you can't
89770f7c90cSmrg# specify the program used to strip binaries.  This is especially
89870f7c90cSmrg# annoying in cross-compiling environments, where the build's strip
89970f7c90cSmrg# is unlikely to handle the host's binaries.
90070f7c90cSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
90170f7c90cSmrg# always use install-sh in `make install-strip', and initialize
90270f7c90cSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
90370f7c90cSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
90470f7c90cSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
90570f7c90cSmrg# Installed binaries are usually stripped using `strip' when the user
90670f7c90cSmrg# run `make install-strip'.  However `strip' might not be the right
90770f7c90cSmrg# tool to use in cross-compilation environments, therefore Automake
90870f7c90cSmrg# will honor the `STRIP' environment variable to overrule this program.
90970f7c90cSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
91070f7c90cSmrgif test "$cross_compiling" != no; then
91170f7c90cSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
91270f7c90cSmrgfi
91370f7c90cSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
91470f7c90cSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
915a850946eSmrg
91670f7c90cSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
91770f7c90cSmrg#
91870f7c90cSmrg# This file is free software; the Free Software Foundation
91970f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
92070f7c90cSmrg# with or without modifications, as long as this notice is preserved.
921a850946eSmrg
92270f7c90cSmrg# serial 2
923a850946eSmrg
92470f7c90cSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
92570f7c90cSmrg# ---------------------------
92670f7c90cSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
92770f7c90cSmrg# This macro is traced by Automake.
92870f7c90cSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
929a850946eSmrg
93070f7c90cSmrg# AM_SUBST_NOTMAKE(VARIABLE)
93170f7c90cSmrg# ---------------------------
93270f7c90cSmrg# Public sister of _AM_SUBST_NOTMAKE.
93370f7c90cSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
934a850946eSmrg
93570f7c90cSmrg# Check how to create a tarball.                            -*- Autoconf -*-
936a850946eSmrg
93770f7c90cSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
93870f7c90cSmrg#
93970f7c90cSmrg# This file is free software; the Free Software Foundation
94070f7c90cSmrg# gives unlimited permission to copy and/or distribute it,
94170f7c90cSmrg# with or without modifications, as long as this notice is preserved.
942a850946eSmrg
94370f7c90cSmrg# serial 2
944a850946eSmrg
94570f7c90cSmrg# _AM_PROG_TAR(FORMAT)
94670f7c90cSmrg# --------------------
94770f7c90cSmrg# Check how to create a tarball in format FORMAT.
94870f7c90cSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
94970f7c90cSmrg#
95070f7c90cSmrg# Substitute a variable $(am__tar) that is a command
95170f7c90cSmrg# writing to stdout a FORMAT-tarball containing the directory
95270f7c90cSmrg# $tardir.
95370f7c90cSmrg#     tardir=directory && $(am__tar) > result.tar
95470f7c90cSmrg#
95570f7c90cSmrg# Substitute a variable $(am__untar) that extract such
95670f7c90cSmrg# a tarball read from stdin.
95770f7c90cSmrg#     $(am__untar) < result.tar
95870f7c90cSmrgAC_DEFUN([_AM_PROG_TAR],
95970f7c90cSmrg[# Always define AMTAR for backward compatibility.
96070f7c90cSmrgAM_MISSING_PROG([AMTAR], [tar])
96170f7c90cSmrgm4_if([$1], [v7],
96270f7c90cSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
96370f7c90cSmrg     [m4_case([$1], [ustar],, [pax],,
96470f7c90cSmrg              [m4_fatal([Unknown tar format])])
96570f7c90cSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
96670f7c90cSmrg# Loop over all known methods to create a tar archive until one works.
96770f7c90cSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
96870f7c90cSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
96970f7c90cSmrg# Do not fold the above two line into one, because Tru64 sh and
97070f7c90cSmrg# Solaris sh will not grok spaces in the rhs of `-'.
97170f7c90cSmrgfor _am_tool in $_am_tools
97270f7c90cSmrgdo
97370f7c90cSmrg  case $_am_tool in
97470f7c90cSmrg  gnutar)
97570f7c90cSmrg    for _am_tar in tar gnutar gtar;
97670f7c90cSmrg    do
97770f7c90cSmrg      AM_RUN_LOG([$_am_tar --version]) && break
97870f7c90cSmrg    done
97970f7c90cSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
98070f7c90cSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
98170f7c90cSmrg    am__untar="$_am_tar -xf -"
98270f7c90cSmrg    ;;
98370f7c90cSmrg  plaintar)
98470f7c90cSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
98570f7c90cSmrg    # ustar tarball either.
98670f7c90cSmrg    (tar --version) >/dev/null 2>&1 && continue
98770f7c90cSmrg    am__tar='tar chf - "$$tardir"'
98870f7c90cSmrg    am__tar_='tar chf - "$tardir"'
98970f7c90cSmrg    am__untar='tar xf -'
99070f7c90cSmrg    ;;
99170f7c90cSmrg  pax)
99270f7c90cSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
99370f7c90cSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
99470f7c90cSmrg    am__untar='pax -r'
99570f7c90cSmrg    ;;
99670f7c90cSmrg  cpio)
99770f7c90cSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
99870f7c90cSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
99970f7c90cSmrg    am__untar='cpio -i -H $1 -d'
100070f7c90cSmrg    ;;
100170f7c90cSmrg  none)
100270f7c90cSmrg    am__tar=false
100370f7c90cSmrg    am__tar_=false
100470f7c90cSmrg    am__untar=false
100570f7c90cSmrg    ;;
100670f7c90cSmrg  esac
1007a850946eSmrg
100870f7c90cSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
100970f7c90cSmrg  # and am__untar set.
101070f7c90cSmrg  test -n "${am_cv_prog_tar_$1}" && break
101170f7c90cSmrg
101270f7c90cSmrg  # tar/untar a dummy directory, and stop if the command works
101370f7c90cSmrg  rm -rf conftest.dir
101470f7c90cSmrg  mkdir conftest.dir
101570f7c90cSmrg  echo GrepMe > conftest.dir/file
101670f7c90cSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
101770f7c90cSmrg  rm -rf conftest.dir
101870f7c90cSmrg  if test -s conftest.tar; then
101970f7c90cSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
102070f7c90cSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
102170f7c90cSmrg  fi
102270f7c90cSmrgdone
102370f7c90cSmrgrm -rf conftest.dir
1024a850946eSmrg
102570f7c90cSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
102670f7c90cSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
102770f7c90cSmrgAC_SUBST([am__tar])
102870f7c90cSmrgAC_SUBST([am__untar])
102970f7c90cSmrg]) # _AM_PROG_TAR
103070f7c90cSmrg
103170f7c90cSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1032a850946eSmrgdnl
103370f7c90cSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1034a850946eSmrgdnl 
103570f7c90cSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
103670f7c90cSmrgdnl copy of this software and associated documentation files (the
103770f7c90cSmrgdnl "Software"), to deal in the Software without restriction, including
103870f7c90cSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
103970f7c90cSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
104070f7c90cSmrgdnl to whom the Software is furnished to do so, provided that the above
104170f7c90cSmrgdnl copyright notice(s) and this permission notice appear in all copies of
104270f7c90cSmrgdnl the Software and that both the above copyright notice(s) and this
104370f7c90cSmrgdnl permission notice appear in supporting documentation.
104470f7c90cSmrgdnl
1045a850946eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1046a850946eSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
104770f7c90cSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
104870f7c90cSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
104970f7c90cSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
105070f7c90cSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
105170f7c90cSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
105270f7c90cSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
105370f7c90cSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
105470f7c90cSmrgdnl
105570f7c90cSmrgdnl Except as contained in this notice, the name of a copyright holder
105670f7c90cSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
105770f7c90cSmrgdnl or other dealings in this Software without prior written authorization
105870f7c90cSmrgdnl of the copyright holder.
105970f7c90cSmrg
106070f7c90cSmrg# XORG_MACROS_VERSION(required-version)
106170f7c90cSmrg# -------------------------------------
106270f7c90cSmrg# Minimum version: 1.1.0
106370f7c90cSmrg#
106470f7c90cSmrg# If you're using a macro added in Version 1.1 or newer, include this in
106570f7c90cSmrg# your configure.ac with the minimum required version, such as:
106670f7c90cSmrg# XORG_MACROS_VERSION(1.1)
106770f7c90cSmrg#
106870f7c90cSmrg# To ensure that this macro is defined, also add:
106970f7c90cSmrg# m4_ifndef([XORG_MACROS_VERSION],
107070f7c90cSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
107170f7c90cSmrg#
107270f7c90cSmrg#
107370f7c90cSmrg# See the "minimum version" comment for each macro you use to see what 
107470f7c90cSmrg# version you require.
107570f7c90cSmrgm4_defun([XORG_MACROS_VERSION],[
107670f7c90cSmrgm4_define([vers_have], [1.3.0])
107770f7c90cSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
107870f7c90cSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
107970f7c90cSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
108070f7c90cSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
108170f7c90cSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
108270f7c90cSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
108370f7c90cSmrgm4_undefine([vers_have])
108470f7c90cSmrgm4_undefine([maj_have])
108570f7c90cSmrgm4_undefine([maj_needed])
108670f7c90cSmrg]) # XORG_MACROS_VERSION
1087a850946eSmrg
1088a850946eSmrg# XORG_PROG_RAWCPP()
1089a850946eSmrg# ------------------
109070f7c90cSmrg# Minimum version: 1.0.0
109170f7c90cSmrg#
1092a850946eSmrg# Find cpp program and necessary flags for use in pre-processing text files
1093a850946eSmrg# such as man pages and config files
1094a850946eSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1095a850946eSmrgAC_REQUIRE([AC_PROG_CPP])
1096a850946eSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1097a850946eSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1098a850946eSmrg
1099a850946eSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1100a850946eSmrg# which is not the best choice for supporting other OS'es, but covers most
1101a850946eSmrg# of the ones we need for now.
1102a850946eSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1103a850946eSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1104a850946eSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1105a850946eSmrg	AC_MSG_RESULT([no])
1106a850946eSmrgelse
1107a850946eSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1108a850946eSmrg		RAWCPPFLAGS=-undef
1109a850946eSmrg		AC_MSG_RESULT([yes])
111070f7c90cSmrg	# under Cygwin unix is still defined even with -undef
111170f7c90cSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
111270f7c90cSmrg		RAWCPPFLAGS="-undef -ansi"
111370f7c90cSmrg		AC_MSG_RESULT([yes, with -ansi])
1114a850946eSmrg	else
1115a850946eSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1116a850946eSmrg	fi
1117a850946eSmrgfi
1118a850946eSmrgrm -f conftest.$ac_ext
1119a850946eSmrg
1120a850946eSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1121a850946eSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1122a850946eSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1123a850946eSmrg	AC_MSG_RESULT([no])
1124a850946eSmrgelse
1125a850946eSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1126a850946eSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1127a850946eSmrg		AC_MSG_RESULT([yes])
1128a850946eSmrg	else
1129a850946eSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1130a850946eSmrg	fi
1131a850946eSmrgfi
1132a850946eSmrgrm -f conftest.$ac_ext
1133a850946eSmrgAC_SUBST(RAWCPPFLAGS)
1134a850946eSmrg]) # XORG_PROG_RAWCPP
1135a850946eSmrg
1136a850946eSmrg# XORG_MANPAGE_SECTIONS()
1137a850946eSmrg# -----------------------
113870f7c90cSmrg# Minimum version: 1.0.0
113970f7c90cSmrg#
1140a850946eSmrg# Determine which sections man pages go in for the different man page types
1141a850946eSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1142a850946eSmrg# Not sure if there's any better way than just hardcoding by OS name.
1143a850946eSmrg# Override default settings by setting environment variables
1144a850946eSmrg
1145a850946eSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1146a850946eSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1147a850946eSmrg
1148a850946eSmrgif test x$APP_MAN_SUFFIX = x    ; then
114970f7c90cSmrg    APP_MAN_SUFFIX=1
1150a850946eSmrgfi
1151a850946eSmrgif test x$APP_MAN_DIR = x    ; then
115270f7c90cSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1153a850946eSmrgfi
1154a850946eSmrg
1155a850946eSmrgif test x$LIB_MAN_SUFFIX = x    ; then
115670f7c90cSmrg    LIB_MAN_SUFFIX=3
1157a850946eSmrgfi
1158a850946eSmrgif test x$LIB_MAN_DIR = x    ; then
115970f7c90cSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1160a850946eSmrgfi
1161a850946eSmrg
1162a850946eSmrgif test x$FILE_MAN_SUFFIX = x    ; then
1163a850946eSmrg    case $host_os in
1164a850946eSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1165a850946eSmrg	*)		FILE_MAN_SUFFIX=5  ;;
1166a850946eSmrg    esac
1167a850946eSmrgfi
1168a850946eSmrgif test x$FILE_MAN_DIR = x    ; then
116970f7c90cSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1170a850946eSmrgfi
1171a850946eSmrg
1172a850946eSmrgif test x$MISC_MAN_SUFFIX = x    ; then
1173a850946eSmrg    case $host_os in
1174a850946eSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1175a850946eSmrg	*)		MISC_MAN_SUFFIX=7  ;;
1176a850946eSmrg    esac
1177a850946eSmrgfi
1178a850946eSmrgif test x$MISC_MAN_DIR = x    ; then
117970f7c90cSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1180a850946eSmrgfi
1181a850946eSmrg
1182a850946eSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1183a850946eSmrg    case $host_os in
1184a850946eSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1185a850946eSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1186a850946eSmrg    esac
1187a850946eSmrgfi
1188a850946eSmrgif test x$DRIVER_MAN_DIR = x    ; then
118970f7c90cSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1190a850946eSmrgfi
1191a850946eSmrg
1192a850946eSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1193a850946eSmrg    case $host_os in
1194a850946eSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1195a850946eSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1196a850946eSmrg    esac
1197a850946eSmrgfi
1198a850946eSmrgif test x$ADMIN_MAN_DIR = x    ; then
1199a850946eSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1200a850946eSmrgfi
1201a850946eSmrg
1202a850946eSmrg
1203a850946eSmrgAC_SUBST([APP_MAN_SUFFIX])
1204a850946eSmrgAC_SUBST([LIB_MAN_SUFFIX])
1205a850946eSmrgAC_SUBST([FILE_MAN_SUFFIX])
1206a850946eSmrgAC_SUBST([MISC_MAN_SUFFIX])
1207a850946eSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1208a850946eSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1209a850946eSmrgAC_SUBST([APP_MAN_DIR])
1210a850946eSmrgAC_SUBST([LIB_MAN_DIR])
1211a850946eSmrgAC_SUBST([FILE_MAN_DIR])
1212a850946eSmrgAC_SUBST([MISC_MAN_DIR])
1213a850946eSmrgAC_SUBST([DRIVER_MAN_DIR])
1214a850946eSmrgAC_SUBST([ADMIN_MAN_DIR])
1215a850946eSmrg]) # XORG_MANPAGE_SECTIONS
1216a850946eSmrg
1217a850946eSmrg# XORG_CHECK_LINUXDOC
1218a850946eSmrg# -------------------
121970f7c90cSmrg# Minimum version: 1.0.0
122070f7c90cSmrg#
1221a850946eSmrg# Defines the variable MAKE_TEXT if the necessary tools and
1222a850946eSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1223a850946eSmrg# Whether or not the necessary tools and files are found can be checked
1224a850946eSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1225a850946eSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
122670f7c90cSmrgif test x$XORG_SGML_PATH = x ; then
122770f7c90cSmrg    XORG_SGML_PATH=$prefix/share/sgml
122870f7c90cSmrgfi
122970f7c90cSmrgHAVE_DEFS_ENT=
123070f7c90cSmrg
123170f7c90cSmrgif test x"$cross_compiling" = x"yes" ; then
123270f7c90cSmrg  HAVE_DEFS_ENT=no
123370f7c90cSmrgelse
123470f7c90cSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
123570f7c90cSmrgfi
1236a850946eSmrg
1237a850946eSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1238a850946eSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1239a850946eSmrg
1240a850946eSmrgAC_MSG_CHECKING([Whether to build documentation])
1241a850946eSmrg
124270f7c90cSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1243a850946eSmrg   BUILDDOC=yes
1244a850946eSmrgelse
1245a850946eSmrg   BUILDDOC=no
1246a850946eSmrgfi
1247a850946eSmrg
1248a850946eSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1249a850946eSmrg
1250a850946eSmrgAC_MSG_RESULT([$BUILDDOC])
1251a850946eSmrg
1252a850946eSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1253a850946eSmrg
125470f7c90cSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1255a850946eSmrg   BUILDPDFDOC=yes
1256a850946eSmrgelse
1257a850946eSmrg   BUILDPDFDOC=no
1258a850946eSmrgfi
1259a850946eSmrg
1260a850946eSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1261a850946eSmrg
1262a850946eSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1263a850946eSmrg
126470f7c90cSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
126570f7c90cSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1266a850946eSmrgMAKE_PDF="$PS2PDF"
126770f7c90cSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1268a850946eSmrg
1269a850946eSmrgAC_SUBST(MAKE_TEXT)
1270a850946eSmrgAC_SUBST(MAKE_PS)
1271a850946eSmrgAC_SUBST(MAKE_PDF)
1272a850946eSmrgAC_SUBST(MAKE_HTML)
1273a850946eSmrg]) # XORG_CHECK_LINUXDOC
1274a850946eSmrg
127570f7c90cSmrg# XORG_CHECK_DOCBOOK
127670f7c90cSmrg# -------------------
127770f7c90cSmrg# Minimum version: 1.0.0
127870f7c90cSmrg#
127970f7c90cSmrg# Checks for the ability to build output formats from SGML DocBook source.
128070f7c90cSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
128170f7c90cSmrg# indicates whether the necessary tools and files are found and, if set,
128270f7c90cSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
128370f7c90cSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
128470f7c90cSmrgif test x$XORG_SGML_PATH = x ; then
128570f7c90cSmrg    XORG_SGML_PATH=$prefix/share/sgml
128670f7c90cSmrgfi
128770f7c90cSmrgHAVE_DEFS_ENT=
128870f7c90cSmrgBUILDTXTDOC=no
128970f7c90cSmrgBUILDPDFDOC=no
129070f7c90cSmrgBUILDPSDOC=no
129170f7c90cSmrgBUILDHTMLDOC=no
129270f7c90cSmrg
129370f7c90cSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
129470f7c90cSmrg
129570f7c90cSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
129670f7c90cSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
129770f7c90cSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
129870f7c90cSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
129970f7c90cSmrg
130070f7c90cSmrgAC_MSG_CHECKING([Whether to build text documentation])
130170f7c90cSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
130270f7c90cSmrg   test x$BUILD_TXTDOC != xno; then
130370f7c90cSmrg	BUILDTXTDOC=yes
130470f7c90cSmrgfi
130570f7c90cSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
130670f7c90cSmrgAC_MSG_RESULT([$BUILDTXTDOC])
130770f7c90cSmrg
130870f7c90cSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
130970f7c90cSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
131070f7c90cSmrg   test x$BUILD_PDFDOC != xno; then
131170f7c90cSmrg	BUILDPDFDOC=yes
131270f7c90cSmrgfi
131370f7c90cSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
131470f7c90cSmrgAC_MSG_RESULT([$BUILDPDFDOC])
131570f7c90cSmrg
131670f7c90cSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
131770f7c90cSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
131870f7c90cSmrg   test x$BUILD_PSDOC != xno; then
131970f7c90cSmrg	BUILDPSDOC=yes
132070f7c90cSmrgfi
132170f7c90cSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
132270f7c90cSmrgAC_MSG_RESULT([$BUILDPSDOC])
132370f7c90cSmrg
132470f7c90cSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
132570f7c90cSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
132670f7c90cSmrg   test x$BUILD_HTMLDOC != xno; then
132770f7c90cSmrg	BUILDHTMLDOC=yes
132870f7c90cSmrgfi
132970f7c90cSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
133070f7c90cSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
133170f7c90cSmrg
133270f7c90cSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
133370f7c90cSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
133470f7c90cSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
133570f7c90cSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
133670f7c90cSmrg
133770f7c90cSmrgAC_SUBST(MAKE_TEXT)
133870f7c90cSmrgAC_SUBST(MAKE_PS)
133970f7c90cSmrgAC_SUBST(MAKE_PDF)
134070f7c90cSmrgAC_SUBST(MAKE_HTML)
134170f7c90cSmrg]) # XORG_CHECK_DOCBOOK
134270f7c90cSmrg
1343a850946eSmrg# XORG_CHECK_MALLOC_ZERO
1344a850946eSmrg# ----------------------
134570f7c90cSmrg# Minimum version: 1.0.0
134670f7c90cSmrg#
1347a850946eSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1348a850946eSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1349a850946eSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1350a850946eSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1351a850946eSmrgAC_ARG_ENABLE(malloc0returnsnull,
135270f7c90cSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1353a850946eSmrg		       [malloc(0) returns NULL (default: auto)]),
1354a850946eSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1355a850946eSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1356a850946eSmrg
1357a850946eSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1358a850946eSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1359a850946eSmrg	AC_RUN_IFELSE([
1360a850946eSmrgchar *malloc();
1361a850946eSmrgchar *realloc();
1362a850946eSmrgchar *calloc();
1363a850946eSmrgmain() {
1364a850946eSmrg    char *m0, *r0, *c0, *p;
1365a850946eSmrg    m0 = malloc(0);
1366a850946eSmrg    p = malloc(10);
1367a850946eSmrg    r0 = realloc(p,0);
1368a850946eSmrg    c0 = calloc(0);
1369a850946eSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1370a850946eSmrg}],
1371a850946eSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1372a850946eSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
1373a850946eSmrgfi
1374a850946eSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1375a850946eSmrg
1376a850946eSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1377a850946eSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1378a850946eSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1379a850946eSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1380a850946eSmrgelse
1381a850946eSmrg	MALLOC_ZERO_CFLAGS=""
1382a850946eSmrg	XMALLOC_ZERO_CFLAGS=""
1383a850946eSmrg	XTMALLOC_ZERO_CFLAGS=""
1384a850946eSmrgfi
1385a850946eSmrg
1386a850946eSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1387a850946eSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1388a850946eSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1389a850946eSmrg]) # XORG_CHECK_MALLOC_ZERO
1390a850946eSmrg
139170f7c90cSmrg# XORG_WITH_LINT()
139270f7c90cSmrg# ----------------
139370f7c90cSmrg# Minimum version: 1.1.0
139470f7c90cSmrg#
139570f7c90cSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
139670f7c90cSmrg# is specified.   (Use --with-lint=sparse for sparse.)
139770f7c90cSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
139870f7c90cSmrg# Sets $LINT_FLAGS to flags to pass to source checker
139970f7c90cSmrg# Sets LINT automake conditional if enabled (default: disabled)
140070f7c90cSmrg#
140170f7c90cSmrgAC_DEFUN([XORG_WITH_LINT],[
140270f7c90cSmrg
140370f7c90cSmrg# Allow checking code with lint, sparse, etc.
140470f7c90cSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
140570f7c90cSmrg		[Use a lint-style source code checker (default: disabled)])],
140670f7c90cSmrg		[use_lint=$withval], [use_lint=no])
140770f7c90cSmrgif test "x$use_lint" = "xyes" ; then
140870f7c90cSmrg	LINT="lint"
140970f7c90cSmrgelse
141070f7c90cSmrg	LINT="$use_lint"
141170f7c90cSmrgfi
141270f7c90cSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
141370f7c90cSmrg    case $LINT in
141470f7c90cSmrg	lint|*/lint)
141570f7c90cSmrg	    case $host_os in
141670f7c90cSmrg		solaris*)
141770f7c90cSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
141870f7c90cSmrg			;;
141970f7c90cSmrg	    esac
142070f7c90cSmrg	    ;;
142170f7c90cSmrg    esac
142270f7c90cSmrgfi
142370f7c90cSmrg
142470f7c90cSmrgAC_SUBST(LINT)
142570f7c90cSmrgAC_SUBST(LINT_FLAGS)
142670f7c90cSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
142770f7c90cSmrg
142870f7c90cSmrg]) # XORG_WITH_LINT
142970f7c90cSmrg
143070f7c90cSmrg# XORG_LINT_LIBRARY(LIBNAME)
143170f7c90cSmrg# --------------------------
143270f7c90cSmrg# Minimum version: 1.1.0
143370f7c90cSmrg#
143470f7c90cSmrg# Sets up flags for building lint libraries for checking programs that call
143570f7c90cSmrg# functions in the library.
143670f7c90cSmrg# Disabled by default, enable with --enable-lint-library
143770f7c90cSmrg# Sets: 
143870f7c90cSmrg#	@LINTLIB@		- name of lint library file to make
143970f7c90cSmrg#	MAKE_LINT_LIB		- automake conditional
144070f7c90cSmrg#
144170f7c90cSmrg
144270f7c90cSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
144370f7c90cSmrgAC_REQUIRE([XORG_WITH_LINT])
144470f7c90cSmrg# Build lint "library" for more indepth checks of programs calling this library
144570f7c90cSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
144670f7c90cSmrg	[Create lint library (default: disabled)])],
144770f7c90cSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
144870f7c90cSmrgif test "x$make_lint_lib" != "xno" ; then
144970f7c90cSmrg	if test "x$LINT" = "xno" ; then
145070f7c90cSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
145170f7c90cSmrg	fi
145270f7c90cSmrg	if test "x$make_lint_lib" = "xyes" ; then
145370f7c90cSmrg		LINTLIB=llib-l$1.ln
145470f7c90cSmrg	else
145570f7c90cSmrg		LINTLIB=$make_lint_lib
145670f7c90cSmrg	fi
145770f7c90cSmrgfi
145870f7c90cSmrgAC_SUBST(LINTLIB)
145970f7c90cSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
146070f7c90cSmrg
146170f7c90cSmrg]) # XORG_LINT_LIBRARY
146270f7c90cSmrg
146370f7c90cSmrg# XORG_CWARNFLAGS
146470f7c90cSmrg# ---------------
146570f7c90cSmrg# Minimum version: 1.2.0
146670f7c90cSmrg#
146770f7c90cSmrg# Defines CWARNFLAGS to enable C compiler warnings.
146870f7c90cSmrg#
146970f7c90cSmrgAC_DEFUN([XORG_CWARNFLAGS], [
147070f7c90cSmrgAC_REQUIRE([AC_PROG_CC])
147170f7c90cSmrgif  test "x$GCC" = xyes ; then
147270f7c90cSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
147370f7c90cSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
147470f7c90cSmrg-Wbad-function-cast"
147570f7c90cSmrg    case `$CC -dumpversion` in
147670f7c90cSmrg    3.4.* | 4.*)
147770f7c90cSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
147870f7c90cSmrg	;;
147970f7c90cSmrg    esac
148070f7c90cSmrgelse
148170f7c90cSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
148270f7c90cSmrg    if test "x$SUNCC" = "xyes"; then
148370f7c90cSmrg	CWARNFLAGS="-v"
148470f7c90cSmrg    fi
148570f7c90cSmrgfi
148670f7c90cSmrgAC_SUBST(CWARNFLAGS)
148770f7c90cSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
148870f7c90cSmrg]) # XORG_CWARNFLAGS
148970f7c90cSmrg
149070f7c90cSmrg# XORG_STRICT_OPTION
149170f7c90cSmrg# -----------------------
149270f7c90cSmrg# Minimum version: 1.3.0
149370f7c90cSmrg#
149470f7c90cSmrg# Add configure option to enable strict compilation
149570f7c90cSmrgAC_DEFUN([XORG_STRICT_OPTION], [
149670f7c90cSmrgAC_REQUIRE([AC_PROG_CC])
149770f7c90cSmrgAC_REQUIRE([AC_PROG_CC_C99])
149870f7c90cSmrgAC_REQUIRE([XORG_CWARNFLAGS])
149970f7c90cSmrg
150070f7c90cSmrgAC_ARG_ENABLE(strict-compilation,
150170f7c90cSmrg			  AS_HELP_STRING([--enable-strict-compilation],
150270f7c90cSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
150370f7c90cSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
150470f7c90cSmrgif test "x$STRICT_COMPILE" = "xyes"; then
150570f7c90cSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
150670f7c90cSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
150770f7c90cSmrg	if test "x$GCC" = xyes ; then
150870f7c90cSmrg		STRICT_CFLAGS="-pedantic -Werror"
150970f7c90cSmrg	elif test "x$SUNCC" = "xyes"; then
151070f7c90cSmrg		STRICT_CFLAGS="-errwarn"
151170f7c90cSmrg    elif test "x$INTELCC" = "xyes"; then
151270f7c90cSmrg		STRICT_CFLAGS="-Werror"
151370f7c90cSmrg	fi
151470f7c90cSmrgfi
151570f7c90cSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
151670f7c90cSmrgAC_SUBST([CWARNFLAGS])
151770f7c90cSmrg]) # XORG_STRICT_OPTION
151870f7c90cSmrg
151970f7c90cSmrg# XORG_DEFAULT_OPTIONS
152070f7c90cSmrg# --------------------
152170f7c90cSmrg# Minimum version: 1.3.0
152270f7c90cSmrg#
152370f7c90cSmrg# Defines default options for X.Org modules.
152470f7c90cSmrg#
152570f7c90cSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
152670f7c90cSmrgXORG_CWARNFLAGS
152770f7c90cSmrgXORG_STRICT_OPTION
152870f7c90cSmrgXORG_RELEASE_VERSION
152970f7c90cSmrgXORG_CHANGELOG
153070f7c90cSmrgXORG_MANPAGE_SECTIONS
153170f7c90cSmrg]) # XORG_DEFAULT_OPTIONS
1532a850946eSmrgdnl Copyright 2005 Red Hat, Inc
1533a850946eSmrgdnl
1534a850946eSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1535a850946eSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1536a850946eSmrgdnl the above copyright notice appear in all copies and that both that
1537a850946eSmrgdnl copyright notice and this permission notice appear in supporting
1538a850946eSmrgdnl documentation.
1539a850946eSmrgdnl
1540a850946eSmrgdnl The above copyright notice and this permission notice shall be included
1541a850946eSmrgdnl in all copies or substantial portions of the Software.
1542a850946eSmrgdnl
1543a850946eSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1544a850946eSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1545a850946eSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1546a850946eSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1547a850946eSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1548a850946eSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1549a850946eSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1550a850946eSmrgdnl
1551a850946eSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1552a850946eSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1553a850946eSmrgdnl other dealings in this Software without prior written authorization
1554a850946eSmrgdnl from the copyright holders.
1555a850946eSmrgdnl
1556a850946eSmrg
1557a850946eSmrg# XORG_RELEASE_VERSION
1558a850946eSmrg# --------------------
1559a850946eSmrg# Adds --with/without-release-string and changes the PACKAGE and
1560a850946eSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
156170f7c90cSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
156270f7c90cSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1563a850946eSmrg 
1564a850946eSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1565a850946eSmrg	AC_ARG_WITH(release-version,
156670f7c90cSmrg			AS_HELP_STRING([--with-release-version=STRING],
1567a850946eSmrg				[Use release version string in package name]),
1568a850946eSmrg			[RELEASE_VERSION="$withval"],
1569a850946eSmrg			[RELEASE_VERSION=""])
1570a850946eSmrg	if test "x$RELEASE_VERSION" != "x"; then
1571a850946eSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1572a850946eSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1573a850946eSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1574a850946eSmrg	fi
157570f7c90cSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
157670f7c90cSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
157770f7c90cSmrg		[Major version of this package])
157870f7c90cSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
157970f7c90cSmrg	if test "x$PVM" = "x"; then
158070f7c90cSmrg		PVM="0"
158170f7c90cSmrg	fi
158270f7c90cSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
158370f7c90cSmrg		[$PVM],
158470f7c90cSmrg		[Minor version of this package])
158570f7c90cSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
158670f7c90cSmrg	if test "x$PVP" = "x"; then
158770f7c90cSmrg		PVP="0"
158870f7c90cSmrg	fi
158970f7c90cSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
159070f7c90cSmrg		[$PVP],
159170f7c90cSmrg		[Patch version of this package])
1592a850946eSmrg])
1593a850946eSmrg
159470f7c90cSmrg# XORG_CHANGELOG()
159570f7c90cSmrg# ----------------
159670f7c90cSmrg# Minimum version: 1.2.0
159770f7c90cSmrg#
159870f7c90cSmrg# Defines the variable CHANGELOG_CMD as the command to generate
159970f7c90cSmrg# ChangeLog from git.
160070f7c90cSmrg#
160170f7c90cSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
160270f7c90cSmrg#
160370f7c90cSmrgAC_DEFUN([XORG_CHANGELOG], [
160470f7c90cSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
160570f7c90cSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
160670f7c90cSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
160770f7c90cSmrgAC_SUBST([CHANGELOG_CMD])
160870f7c90cSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
160970f7c90cSmrg]) # XORG_CHANGELOG
161070f7c90cSmrg
161170f7c90cSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
161270f7c90cSmrg# 
161370f7c90cSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
161470f7c90cSmrg#
161570f7c90cSmrg# This program is free software; you can redistribute it and/or modify
161670f7c90cSmrg# it under the terms of the GNU General Public License as published by
161770f7c90cSmrg# the Free Software Foundation; either version 2 of the License, or
161870f7c90cSmrg# (at your option) any later version.
161970f7c90cSmrg#
162070f7c90cSmrg# This program is distributed in the hope that it will be useful, but
162170f7c90cSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
162270f7c90cSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
162370f7c90cSmrg# General Public License for more details.
162470f7c90cSmrg#
162570f7c90cSmrg# You should have received a copy of the GNU General Public License
162670f7c90cSmrg# along with this program; if not, write to the Free Software
162770f7c90cSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
162870f7c90cSmrg#
162970f7c90cSmrg# As a special exception to the GNU General Public License, if you
163070f7c90cSmrg# distribute this file as part of a program that contains a
163170f7c90cSmrg# configuration script generated by Autoconf, you may include it under
163270f7c90cSmrg# the same distribution terms that you use for the rest of that program.
163370f7c90cSmrg
163470f7c90cSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
163570f7c90cSmrg# ----------------------------------
163670f7c90cSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
163770f7c90cSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
163870f7c90cSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
163970f7c90cSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
164070f7c90cSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
164170f7c90cSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
164270f7c90cSmrgfi
164370f7c90cSmrgif test -n "$PKG_CONFIG"; then
164470f7c90cSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
164570f7c90cSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
164670f7c90cSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
164770f7c90cSmrg		AC_MSG_RESULT([yes])
164870f7c90cSmrg	else
164970f7c90cSmrg		AC_MSG_RESULT([no])
165070f7c90cSmrg		PKG_CONFIG=""
165170f7c90cSmrg	fi
165270f7c90cSmrg		
165370f7c90cSmrgfi[]dnl
165470f7c90cSmrg])# PKG_PROG_PKG_CONFIG
165570f7c90cSmrg
165670f7c90cSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
165770f7c90cSmrg#
165870f7c90cSmrg# Check to see whether a particular set of modules exists.  Similar
165970f7c90cSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
166070f7c90cSmrg#
166170f7c90cSmrg#
166270f7c90cSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
166370f7c90cSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
166470f7c90cSmrg# PKG_CHECK_EXISTS manually
166570f7c90cSmrg# --------------------------------------------------------------
166670f7c90cSmrgAC_DEFUN([PKG_CHECK_EXISTS],
166770f7c90cSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
166870f7c90cSmrgif test -n "$PKG_CONFIG" && \
166970f7c90cSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
167070f7c90cSmrg  m4_ifval([$2], [$2], [:])
167170f7c90cSmrgm4_ifvaln([$3], [else
167270f7c90cSmrg  $3])dnl
167370f7c90cSmrgfi])
167470f7c90cSmrg
167570f7c90cSmrg
167670f7c90cSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
167770f7c90cSmrg# ---------------------------------------------
167870f7c90cSmrgm4_define([_PKG_CONFIG],
167970f7c90cSmrg[if test -n "$$1"; then
168070f7c90cSmrg    pkg_cv_[]$1="$$1"
168170f7c90cSmrg elif test -n "$PKG_CONFIG"; then
168270f7c90cSmrg    PKG_CHECK_EXISTS([$3],
168370f7c90cSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
168470f7c90cSmrg		     [pkg_failed=yes])
168570f7c90cSmrg else
168670f7c90cSmrg    pkg_failed=untried
168770f7c90cSmrgfi[]dnl
168870f7c90cSmrg])# _PKG_CONFIG
168970f7c90cSmrg
169070f7c90cSmrg# _PKG_SHORT_ERRORS_SUPPORTED
169170f7c90cSmrg# -----------------------------
169270f7c90cSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
169370f7c90cSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
169470f7c90cSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
169570f7c90cSmrg        _pkg_short_errors_supported=yes
169670f7c90cSmrgelse
169770f7c90cSmrg        _pkg_short_errors_supported=no
169870f7c90cSmrgfi[]dnl
169970f7c90cSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
170070f7c90cSmrg
170170f7c90cSmrg
170270f7c90cSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
170370f7c90cSmrg# [ACTION-IF-NOT-FOUND])
170470f7c90cSmrg#
170570f7c90cSmrg#
170670f7c90cSmrg# Note that if there is a possibility the first call to
170770f7c90cSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
170870f7c90cSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
170970f7c90cSmrg#
171070f7c90cSmrg#
171170f7c90cSmrg# --------------------------------------------------------------
171270f7c90cSmrgAC_DEFUN([PKG_CHECK_MODULES],
171370f7c90cSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
171470f7c90cSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
171570f7c90cSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
171670f7c90cSmrg
171770f7c90cSmrgpkg_failed=no
171870f7c90cSmrgAC_MSG_CHECKING([for $1])
171970f7c90cSmrg
172070f7c90cSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
172170f7c90cSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
172270f7c90cSmrg
172370f7c90cSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
172470f7c90cSmrgand $1[]_LIBS to avoid the need to call pkg-config.
172570f7c90cSmrgSee the pkg-config man page for more details.])
172670f7c90cSmrg
172770f7c90cSmrgif test $pkg_failed = yes; then
172870f7c90cSmrg        _PKG_SHORT_ERRORS_SUPPORTED
172970f7c90cSmrg        if test $_pkg_short_errors_supported = yes; then
173070f7c90cSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
173170f7c90cSmrg        else 
173270f7c90cSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
173370f7c90cSmrg        fi
173470f7c90cSmrg	# Put the nasty error message in config.log where it belongs
173570f7c90cSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
173670f7c90cSmrg
173770f7c90cSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
173870f7c90cSmrg[Package requirements ($2) were not met:
173970f7c90cSmrg
174070f7c90cSmrg$$1_PKG_ERRORS
174170f7c90cSmrg
174270f7c90cSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
174370f7c90cSmrginstalled software in a non-standard prefix.
174470f7c90cSmrg
174570f7c90cSmrg_PKG_TEXT
174670f7c90cSmrg])],
174770f7c90cSmrg		[AC_MSG_RESULT([no])
174870f7c90cSmrg                $4])
174970f7c90cSmrgelif test $pkg_failed = untried; then
175070f7c90cSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
175170f7c90cSmrg[The pkg-config script could not be found or is too old.  Make sure it
175270f7c90cSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
175370f7c90cSmrgpath to pkg-config.
175470f7c90cSmrg
175570f7c90cSmrg_PKG_TEXT
175670f7c90cSmrg
175770f7c90cSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
175870f7c90cSmrg		[$4])
175970f7c90cSmrgelse
176070f7c90cSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
176170f7c90cSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
176270f7c90cSmrg        AC_MSG_RESULT([yes])
176370f7c90cSmrg	ifelse([$3], , :, [$3])
176470f7c90cSmrgfi[]dnl
176570f7c90cSmrg])# PKG_CHECK_MODULES
176670f7c90cSmrg
1767