aclocal.m4 revision d466db85
1d466db85Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
2d838582fSmrg
3d838582fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4d466db85Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5d838582fSmrg# This file is free software; the Free Software Foundation
6d838582fSmrg# gives unlimited permission to copy and/or distribute it,
7d838582fSmrg# with or without modifications, as long as this notice is preserved.
8d838582fSmrg
9d838582fSmrg# This program is distributed in the hope that it will be useful,
10d838582fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11d838582fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12d838582fSmrg# PARTICULAR PURPOSE.
13d838582fSmrg
14d838582fSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15d838582fSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16d466db85Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17d466db85Smrg[m4_warning([this file was generated for autoconf 2.63.
18d838582fSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19d838582fSmrgIf you have problems, you may need to regenerate the build system entirely.
20d838582fSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21d838582fSmrg
22d466db85Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23d466db85Smrg#
24d466db85Smrg# This file is free software; the Free Software Foundation
25d466db85Smrg# gives unlimited permission to copy and/or distribute it,
26d466db85Smrg# with or without modifications, as long as this notice is preserved.
27d838582fSmrg
28d466db85Smrg# AM_AUTOMAKE_VERSION(VERSION)
29d466db85Smrg# ----------------------------
30d466db85Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31d466db85Smrg# generated from the m4 files accompanying Automake X.Y.
32d466db85Smrg# (This private macro should not be called outside this file.)
33d466db85SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34d466db85Smrg[am__api_version='1.11'
35d466db85Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36d466db85Smrgdnl require some minimum version.  Point them to the right macro.
37d466db85Smrgm4_if([$1], [1.11], [],
38d466db85Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39d466db85Smrg])
40d466db85Smrg
41d466db85Smrg# _AM_AUTOCONF_VERSION(VERSION)
42d466db85Smrg# -----------------------------
43d466db85Smrg# aclocal traces this macro to find the Autoconf version.
44d466db85Smrg# This is a private macro too.  Using m4_define simplifies
45d466db85Smrg# the logic in aclocal, which can simply ignore this definition.
46d466db85Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47d466db85Smrg
48d466db85Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49d466db85Smrg# -------------------------------
50d466db85Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51d466db85Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52d466db85SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53d466db85Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
54d466db85Smrgm4_ifndef([AC_AUTOCONF_VERSION],
55d466db85Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56d466db85Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57d466db85Smrg
58d466db85Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59d466db85Smrg
60d466db85Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61d838582fSmrg#
62d466db85Smrg# This file is free software; the Free Software Foundation
63d466db85Smrg# gives unlimited permission to copy and/or distribute it,
64d466db85Smrg# with or without modifications, as long as this notice is preserved.
65d466db85Smrg
66d466db85Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67d466db85Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68d466db85Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69d466db85Smrg#
70d466db85Smrg# Of course, Automake must honor this variable whenever it calls a
71d466db85Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72d466db85Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73d466db85Smrg# depending on how configure is run.  This is pretty annoying, since
74d466db85Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75d466db85Smrg# source directory, any form will work fine, but in subdirectories a
76d466db85Smrg# relative path needs to be adjusted first.
77d838582fSmrg#
78d466db85Smrg# $ac_aux_dir/missing
79d466db85Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80d466db85Smrg# $top_srcdir/$ac_aux_dir/missing
81d466db85Smrg#    fails if $ac_aux_dir is absolute,
82d466db85Smrg#    fails when called from a subdirectory in a VPATH build with
83d466db85Smrg#          a relative $ac_aux_dir
84d838582fSmrg#
85d466db85Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86d466db85Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
87d466db85Smrg# harmless because $srcdir is `.', but things will broke when you
88d466db85Smrg# start a VPATH build or use an absolute $srcdir.
89d838582fSmrg#
90d466db85Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91d466db85Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92d466db85Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93d466db85Smrg# and then we would define $MISSING as
94d466db85Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95d466db85Smrg# This will work as long as MISSING is not called from configure, because
96d466db85Smrg# unfortunately $(top_srcdir) has no meaning in configure.
97d466db85Smrg# However there are other variables, like CC, which are often used in
98d466db85Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99d466db85Smrg#
100d466db85Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
101d466db85Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
102d466db85Smrg# configured tree to be moved without reconfiguration.
103d838582fSmrg
104d466db85SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105d466db85Smrg[dnl Rely on autoconf to set up CDPATH properly.
106d466db85SmrgAC_PREREQ([2.50])dnl
107d466db85Smrg# expand $ac_aux_dir to an absolute path
108d466db85Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
109d466db85Smrg])
110d466db85Smrg
111d466db85Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112d466db85Smrg
113d466db85Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114d466db85Smrg# Free Software Foundation, Inc.
115d838582fSmrg#
116d466db85Smrg# This file is free software; the Free Software Foundation
117d466db85Smrg# gives unlimited permission to copy and/or distribute it,
118d466db85Smrg# with or without modifications, as long as this notice is preserved.
119d838582fSmrg
120d466db85Smrg# serial 9
121d838582fSmrg
122d466db85Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123d466db85Smrg# -------------------------------------
124d466db85Smrg# Define a conditional.
125d466db85SmrgAC_DEFUN([AM_CONDITIONAL],
126d466db85Smrg[AC_PREREQ(2.52)dnl
127d466db85Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128d466db85Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129d466db85SmrgAC_SUBST([$1_TRUE])dnl
130d466db85SmrgAC_SUBST([$1_FALSE])dnl
131d466db85Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132d466db85Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133d466db85Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134d466db85Smrgif $2; then
135d466db85Smrg  $1_TRUE=
136d466db85Smrg  $1_FALSE='#'
137d838582fSmrgelse
138d466db85Smrg  $1_TRUE='#'
139d466db85Smrg  $1_FALSE=
140d838582fSmrgfi
141d466db85SmrgAC_CONFIG_COMMANDS_PRE(
142d466db85Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143d466db85Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144d466db85SmrgUsually this means the macro was only invoked conditionally.]])
145d466db85Smrgfi])])
146d838582fSmrg
147d466db85Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148d466db85Smrg# Free Software Foundation, Inc.
149d838582fSmrg#
150d466db85Smrg# This file is free software; the Free Software Foundation
151d466db85Smrg# gives unlimited permission to copy and/or distribute it,
152d466db85Smrg# with or without modifications, as long as this notice is preserved.
153d838582fSmrg
154d466db85Smrg# serial 10
155d838582fSmrg
156d466db85Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157d466db85Smrg# written in clear, in which case automake, when reading aclocal.m4,
158d466db85Smrg# will think it sees a *use*, and therefore will trigger all it's
159d466db85Smrg# C support machinery.  Also note that it means that autoscan, seeing
160d466db85Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161d838582fSmrg
162d838582fSmrg
163d466db85Smrg# _AM_DEPENDENCIES(NAME)
164d466db85Smrg# ----------------------
165d466db85Smrg# See how the compiler implements dependency checking.
166d466db85Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167d466db85Smrg# We try a few techniques and use that to set a single cache variable.
168d466db85Smrg#
169d466db85Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170d466db85Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171d466db85Smrg# dependency, and given that the user is not expected to run this macro,
172d466db85Smrg# just rely on AC_PROG_CC.
173d466db85SmrgAC_DEFUN([_AM_DEPENDENCIES],
174d466db85Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175d466db85SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176d466db85SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177d466db85SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178d466db85Smrg
179d466db85Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180d466db85Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181d466db85Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182d466db85Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183d466db85Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184d466db85Smrg                   [depcc="$$1"   am_compiler_list=])
185d466db85Smrg
186d466db85SmrgAC_CACHE_CHECK([dependency style of $depcc],
187d466db85Smrg               [am_cv_$1_dependencies_compiler_type],
188d466db85Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189d466db85Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
190d466db85Smrg  # making bogus files that we don't know about and never remove.  For
191d466db85Smrg  # instance it was reported that on HP-UX the gcc test will end up
192d466db85Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
193d466db85Smrg  # in D'.
194d466db85Smrg  mkdir conftest.dir
195d466db85Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196d466db85Smrg  # using a relative directory.
197d466db85Smrg  cp "$am_depcomp" conftest.dir
198d466db85Smrg  cd conftest.dir
199d466db85Smrg  # We will build objects and dependencies in a subdirectory because
200d466db85Smrg  # it helps to detect inapplicable dependency modes.  For instance
201d466db85Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202d466db85Smrg  # side effect of compilation, but ICC will put the dependencies in
203d466db85Smrg  # the current directory while Tru64 will put them in the object
204d466db85Smrg  # directory.
205d466db85Smrg  mkdir sub
206d466db85Smrg
207d466db85Smrg  am_cv_$1_dependencies_compiler_type=none
208d466db85Smrg  if test "$am_compiler_list" = ""; then
209d466db85Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210d466db85Smrg  fi
211d466db85Smrg  am__universal=false
212d466db85Smrg  m4_case([$1], [CC],
213d466db85Smrg    [case " $depcc " in #(
214d466db85Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215d466db85Smrg     esac],
216d466db85Smrg    [CXX],
217d466db85Smrg    [case " $depcc " in #(
218d466db85Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219d466db85Smrg     esac])
220d466db85Smrg
221d466db85Smrg  for depmode in $am_compiler_list; do
222d466db85Smrg    # Setup a source with many dependencies, because some compilers
223d466db85Smrg    # like to wrap large dependency lists on column 80 (with \), and
224d466db85Smrg    # we should not choose a depcomp mode which is confused by this.
225d466db85Smrg    #
226d466db85Smrg    # We need to recreate these files for each test, as the compiler may
227d466db85Smrg    # overwrite some of them when testing with obscure command lines.
228d466db85Smrg    # This happens at least with the AIX C compiler.
229d466db85Smrg    : > sub/conftest.c
230d466db85Smrg    for i in 1 2 3 4 5 6; do
231d466db85Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232d466db85Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233d466db85Smrg      # Solaris 8's {/usr,}/bin/sh.
234d466db85Smrg      touch sub/conftst$i.h
235d466db85Smrg    done
236d466db85Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237d466db85Smrg
238d466db85Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239d466db85Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240d466db85Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241d466db85Smrg    # versions had trouble with output in subdirs
242d466db85Smrg    am__obj=sub/conftest.${OBJEXT-o}
243d466db85Smrg    am__minus_obj="-o $am__obj"
244d466db85Smrg    case $depmode in
245d466db85Smrg    gcc)
246d466db85Smrg      # This depmode causes a compiler race in universal mode.
247d466db85Smrg      test "$am__universal" = false || continue
248d466db85Smrg      ;;
249d466db85Smrg    nosideeffect)
250d466db85Smrg      # after this tag, mechanisms are not by side-effect, so they'll
251d466db85Smrg      # only be used when explicitly requested
252d466db85Smrg      if test "x$enable_dependency_tracking" = xyes; then
253d466db85Smrg	continue
254d466db85Smrg      else
255d466db85Smrg	break
256d466db85Smrg      fi
257d466db85Smrg      ;;
258d466db85Smrg    msvisualcpp | msvcmsys)
259d466db85Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
260d466db85Smrg      # not run yet.  These depmodes are late enough in the game, and
261d466db85Smrg      # so weak that their functioning should not be impacted.
262d466db85Smrg      am__obj=conftest.${OBJEXT-o}
263d466db85Smrg      am__minus_obj=
264d466db85Smrg      ;;
265d466db85Smrg    none) break ;;
266d838582fSmrg    esac
267d466db85Smrg    if depmode=$depmode \
268d466db85Smrg       source=sub/conftest.c object=$am__obj \
269d466db85Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270d466db85Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271d466db85Smrg         >/dev/null 2>conftest.err &&
272d466db85Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273d466db85Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274d466db85Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275d466db85Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276d466db85Smrg      # icc doesn't choke on unknown options, it will just issue warnings
277d466db85Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
278d466db85Smrg      # that says an option was ignored or not supported.
279d466db85Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280d466db85Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281d466db85Smrg      # The diagnosis changed in icc 8.0:
282d466db85Smrg      #   icc: Command line remark: option '-MP' not supported
283d466db85Smrg      if (grep 'ignoring option' conftest.err ||
284d466db85Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285d466db85Smrg        am_cv_$1_dependencies_compiler_type=$depmode
286d466db85Smrg        break
287d466db85Smrg      fi
288d466db85Smrg    fi
289d466db85Smrg  done
290d466db85Smrg
291d466db85Smrg  cd ..
292d466db85Smrg  rm -rf conftest.dir
293d466db85Smrgelse
294d466db85Smrg  am_cv_$1_dependencies_compiler_type=none
295d838582fSmrgfi
296d466db85Smrg])
297d466db85SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298d466db85SmrgAM_CONDITIONAL([am__fastdep$1], [
299d466db85Smrg  test "x$enable_dependency_tracking" != xno \
300d466db85Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301d466db85Smrg])
302d838582fSmrg
303d838582fSmrg
304d466db85Smrg# AM_SET_DEPDIR
305d466db85Smrg# -------------
306d466db85Smrg# Choose a directory name for dependency files.
307d466db85Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308d466db85SmrgAC_DEFUN([AM_SET_DEPDIR],
309d466db85Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310d466db85SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311d466db85Smrg])
312d838582fSmrg
313d466db85Smrg
314d466db85Smrg# AM_DEP_TRACK
315d466db85Smrg# ------------
316d466db85SmrgAC_DEFUN([AM_DEP_TRACK],
317d466db85Smrg[AC_ARG_ENABLE(dependency-tracking,
318d466db85Smrg[  --disable-dependency-tracking  speeds up one-time build
319d466db85Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320d466db85Smrgif test "x$enable_dependency_tracking" != xno; then
321d466db85Smrg  am_depcomp="$ac_aux_dir/depcomp"
322d466db85Smrg  AMDEPBACKSLASH='\'
323d838582fSmrgfi
324d466db85SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325d466db85SmrgAC_SUBST([AMDEPBACKSLASH])dnl
326d466db85Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327d466db85Smrg])
328d838582fSmrg
329d466db85Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330d838582fSmrg
331d466db85Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332d466db85Smrg# Free Software Foundation, Inc.
333d466db85Smrg#
334d466db85Smrg# This file is free software; the Free Software Foundation
335d466db85Smrg# gives unlimited permission to copy and/or distribute it,
336d466db85Smrg# with or without modifications, as long as this notice is preserved.
337d838582fSmrg
338d466db85Smrg#serial 5
339d466db85Smrg
340d466db85Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341d466db85Smrg# ------------------------------
342d466db85SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343d466db85Smrg[{
344d466db85Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345d466db85Smrg  # are listed without --file.  Let's play safe and only enable the eval
346d466db85Smrg  # if we detect the quoting.
347d466db85Smrg  case $CONFIG_FILES in
348d466db85Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
349d466db85Smrg  *)   set x $CONFIG_FILES ;;
350d466db85Smrg  esac
351d466db85Smrg  shift
352d466db85Smrg  for mf
353d466db85Smrg  do
354d466db85Smrg    # Strip MF so we end up with the name of the file.
355d466db85Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356d466db85Smrg    # Check whether this is an Automake generated Makefile or not.
357d466db85Smrg    # We used to match only the files named `Makefile.in', but
358d466db85Smrg    # some people rename them; so instead we look at the file content.
359d466db85Smrg    # Grep'ing the first line is not enough: some people post-process
360d466db85Smrg    # each Makefile.in and add a new line on top of each file to say so.
361d466db85Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
362d466db85Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
363d466db85Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364d466db85Smrg      dirpart=`AS_DIRNAME("$mf")`
365d466db85Smrg    else
366d466db85Smrg      continue
367d466db85Smrg    fi
368d466db85Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
369d466db85Smrg    # from the Makefile without running `make'.
370d466db85Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371d466db85Smrg    test -z "$DEPDIR" && continue
372d466db85Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373d466db85Smrg    test -z "am__include" && continue
374d466db85Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375d466db85Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
376d466db85Smrg    U=`sed -n 's/^U = //p' < "$mf"`
377d466db85Smrg    # Find all dependency output files, they are included files with
378d466db85Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379d466db85Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380d466db85Smrg    # expansion.
381d466db85Smrg    for file in `sed -n "
382d466db85Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383d466db85Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384d466db85Smrg      # Make sure the directory exists.
385d466db85Smrg      test -f "$dirpart/$file" && continue
386d466db85Smrg      fdir=`AS_DIRNAME(["$file"])`
387d466db85Smrg      AS_MKDIR_P([$dirpart/$fdir])
388d466db85Smrg      # echo "creating $dirpart/$file"
389d466db85Smrg      echo '# dummy' > "$dirpart/$file"
390d466db85Smrg    done
391d466db85Smrg  done
392d466db85Smrg}
393d466db85Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394d466db85Smrg
395d466db85Smrg
396d466db85Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397d466db85Smrg# -----------------------------
398d466db85Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
399d838582fSmrg#
400d466db85Smrg# This code is only required when automatic dependency tracking
401d466db85Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
402d466db85Smrg# need in order to bootstrap the dependency handling code.
403d466db85SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404d466db85Smrg[AC_CONFIG_COMMANDS([depfiles],
405d466db85Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406d466db85Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407d466db85Smrg])
408d838582fSmrg
409d466db85Smrg# Do all the work for Automake.                             -*- Autoconf -*-
410d838582fSmrg
411d466db85Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
412d466db85Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
413d466db85Smrg#
414d466db85Smrg# This file is free software; the Free Software Foundation
415d466db85Smrg# gives unlimited permission to copy and/or distribute it,
416d466db85Smrg# with or without modifications, as long as this notice is preserved.
417d838582fSmrg
418d466db85Smrg# serial 16
419d838582fSmrg
420d466db85Smrg# This macro actually does too much.  Some checks are only needed if
421d466db85Smrg# your package does certain things.  But this isn't really a big deal.
422d466db85Smrg
423d466db85Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
424d466db85Smrg# AM_INIT_AUTOMAKE([OPTIONS])
425d466db85Smrg# -----------------------------------------------
426d466db85Smrg# The call with PACKAGE and VERSION arguments is the old style
427d466db85Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
428d466db85Smrg# and VERSION should now be passed to AC_INIT and removed from
429d466db85Smrg# the call to AM_INIT_AUTOMAKE.
430d466db85Smrg# We support both call styles for the transition.  After
431d466db85Smrg# the next Automake release, Autoconf can make the AC_INIT
432d466db85Smrg# arguments mandatory, and then we can depend on a new Autoconf
433d466db85Smrg# release and drop the old call support.
434d466db85SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
435d466db85Smrg[AC_PREREQ([2.62])dnl
436d466db85Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
437d466db85Smrgdnl the ones we care about.
438d466db85Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
439d466db85SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
440d466db85SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
441d466db85Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
442d466db85Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
443d466db85Smrg  # is not polluted with repeated "-I."
444d466db85Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
445d466db85Smrg  # test to see if srcdir already configured
446d466db85Smrg  if test -f $srcdir/config.status; then
447d466db85Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
448d466db85Smrg  fi
449d838582fSmrgfi
450d838582fSmrg
451d466db85Smrg# test whether we have cygpath
452d466db85Smrgif test -z "$CYGPATH_W"; then
453d466db85Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
454d466db85Smrg    CYGPATH_W='cygpath -w'
455d466db85Smrg  else
456d466db85Smrg    CYGPATH_W=echo
457d466db85Smrg  fi
458d466db85Smrgfi
459d466db85SmrgAC_SUBST([CYGPATH_W])
460d838582fSmrg
461d466db85Smrg# Define the identity of the package.
462d466db85Smrgdnl Distinguish between old-style and new-style calls.
463d466db85Smrgm4_ifval([$2],
464d466db85Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465d466db85Smrg AC_SUBST([PACKAGE], [$1])dnl
466d466db85Smrg AC_SUBST([VERSION], [$2])],
467d466db85Smrg[_AM_SET_OPTIONS([$1])dnl
468d466db85Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469d466db85Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
470d466db85Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471d466db85Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472d466db85Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473d838582fSmrg
474d466db85Smrg_AM_IF_OPTION([no-define],,
475d466db85Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
476d466db85Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
477d838582fSmrg
478d466db85Smrg# Some tools Automake needs.
479d466db85SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
480d466db85SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
481d466db85SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
482d466db85SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
483d466db85SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
484d466db85SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
485d466db85SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
486d466db85SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487d466db85SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488d466db85SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
489d466db85Smrg# We need awk for the "check" target.  The system "awk" is bad on
490d466db85Smrg# some platforms.
491d466db85SmrgAC_REQUIRE([AC_PROG_AWK])dnl
492d466db85SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
493d466db85SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
494d466db85Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
495d466db85Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
496d466db85Smrg			     [_AM_PROG_TAR([v7])])])
497d466db85Smrg_AM_IF_OPTION([no-dependencies],,
498d466db85Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
499d466db85Smrg		  [_AM_DEPENDENCIES(CC)],
500d466db85Smrg		  [define([AC_PROG_CC],
501d466db85Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
502d466db85SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
503d466db85Smrg		  [_AM_DEPENDENCIES(CXX)],
504d466db85Smrg		  [define([AC_PROG_CXX],
505d466db85Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
506d466db85SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
507d466db85Smrg		  [_AM_DEPENDENCIES(OBJC)],
508d466db85Smrg		  [define([AC_PROG_OBJC],
509d466db85Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
510d466db85Smrg])
511d466db85Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
512d466db85Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
513d466db85Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
514d466db85Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
515d466db85SmrgAC_CONFIG_COMMANDS_PRE(dnl
516d466db85Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
517d466db85Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
518d466db85Smrg])
519d838582fSmrg
520d466db85Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
521d466db85Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522d466db85Smrgdnl mangled by Autoconf and run in a shell conditional statement.
523d466db85Smrgm4_define([_AC_COMPILER_EXEEXT],
524d466db85Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525d838582fSmrg
526d838582fSmrg
527d466db85Smrg# When config.status generates a header, we must update the stamp-h file.
528d466db85Smrg# This file resides in the same directory as the config header
529d466db85Smrg# that is generated.  The stamp files are numbered to have different names.
530d838582fSmrg
531d466db85Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
532d466db85Smrg# loop where config.status creates the headers, so we can generate
533d466db85Smrg# our stamp files there.
534d466db85SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
535d466db85Smrg[# Compute $1's index in $config_headers.
536d466db85Smrg_am_arg=$1
537d466db85Smrg_am_stamp_count=1
538d466db85Smrgfor _am_header in $config_headers :; do
539d466db85Smrg  case $_am_header in
540d466db85Smrg    $_am_arg | $_am_arg:* )
541d466db85Smrg      break ;;
542d466db85Smrg    * )
543d466db85Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
544d466db85Smrg  esac
545d466db85Smrgdone
546d466db85Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547d838582fSmrg
548d466db85Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
549d838582fSmrg#
550d466db85Smrg# This file is free software; the Free Software Foundation
551d466db85Smrg# gives unlimited permission to copy and/or distribute it,
552d466db85Smrg# with or without modifications, as long as this notice is preserved.
553d838582fSmrg
554d466db85Smrg# AM_PROG_INSTALL_SH
555d466db85Smrg# ------------------
556d466db85Smrg# Define $install_sh.
557d466db85SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
558d466db85Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
559d466db85Smrgif test x"${install_sh}" != xset; then
560d466db85Smrg  case $am_aux_dir in
561d466db85Smrg  *\ * | *\	*)
562d466db85Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
563d466db85Smrg  *)
564d466db85Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
565d466db85Smrg  esac
566d466db85Smrgfi
567d466db85SmrgAC_SUBST(install_sh)])
568d838582fSmrg
569d466db85Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
570d466db85Smrg#
571d466db85Smrg# This file is free software; the Free Software Foundation
572d466db85Smrg# gives unlimited permission to copy and/or distribute it,
573d466db85Smrg# with or without modifications, as long as this notice is preserved.
574d838582fSmrg
575d466db85Smrg# serial 2
576d838582fSmrg
577d466db85Smrg# Check whether the underlying file-system supports filenames
578d466db85Smrg# with a leading dot.  For instance MS-DOS doesn't.
579d466db85SmrgAC_DEFUN([AM_SET_LEADING_DOT],
580d466db85Smrg[rm -rf .tst 2>/dev/null
581d466db85Smrgmkdir .tst 2>/dev/null
582d466db85Smrgif test -d .tst; then
583d466db85Smrg  am__leading_dot=.
584d466db85Smrgelse
585d466db85Smrg  am__leading_dot=_
586d838582fSmrgfi
587d466db85Smrgrmdir .tst 2>/dev/null
588d466db85SmrgAC_SUBST([am__leading_dot])])
589d838582fSmrg
590d466db85Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
591d466db85Smrg# From Jim Meyering
592d838582fSmrg
593d466db85Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
594d466db85Smrg# Free Software Foundation, Inc.
595d466db85Smrg#
596d466db85Smrg# This file is free software; the Free Software Foundation
597d466db85Smrg# gives unlimited permission to copy and/or distribute it,
598d466db85Smrg# with or without modifications, as long as this notice is preserved.
599d838582fSmrg
600d466db85Smrg# serial 5
601d838582fSmrg
602d466db85Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
603d466db85Smrg# ----------------------------------
604d466db85Smrg# Control maintainer-specific portions of Makefiles.
605d466db85Smrg# Default is to disable them, unless `enable' is passed literally.
606d466db85Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
607d466db85Smrg# can override the default with the --enable/--disable switch.
608d466db85SmrgAC_DEFUN([AM_MAINTAINER_MODE],
609d466db85Smrg[m4_case(m4_default([$1], [disable]),
610d466db85Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
611d466db85Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
612d466db85Smrg       [m4_define([am_maintainer_other], [enable])
613d466db85Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
614d466db85SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
615d466db85Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
616d466db85Smrg  AC_ARG_ENABLE([maintainer-mode],
617d466db85Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
618d466db85Smrg			  (and sometimes confusing) to the casual installer],
619d466db85Smrg      [USE_MAINTAINER_MODE=$enableval],
620d466db85Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
621d466db85Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
622d466db85Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
623d466db85Smrg  MAINT=$MAINTAINER_MODE_TRUE
624d466db85Smrg  AC_SUBST([MAINT])dnl
625d466db85Smrg]
626d466db85Smrg)
627d838582fSmrg
628d466db85SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
629d838582fSmrg
630d466db85Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
631d838582fSmrg
632d466db85Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
633d838582fSmrg#
634d466db85Smrg# This file is free software; the Free Software Foundation
635d466db85Smrg# gives unlimited permission to copy and/or distribute it,
636d466db85Smrg# with or without modifications, as long as this notice is preserved.
637d838582fSmrg
638d466db85Smrg# serial 4
639d838582fSmrg
640d466db85Smrg# AM_MAKE_INCLUDE()
641d466db85Smrg# -----------------
642d466db85Smrg# Check to see how make treats includes.
643d466db85SmrgAC_DEFUN([AM_MAKE_INCLUDE],
644d466db85Smrg[am_make=${MAKE-make}
645d466db85Smrgcat > confinc << 'END'
646d466db85Smrgam__doit:
647d466db85Smrg	@echo this is the am__doit target
648d466db85Smrg.PHONY: am__doit
649d466db85SmrgEND
650d466db85Smrg# If we don't find an include directive, just comment out the code.
651d466db85SmrgAC_MSG_CHECKING([for style of include used by $am_make])
652d466db85Smrgam__include="#"
653d466db85Smrgam__quote=
654d466db85Smrg_am_result=none
655d466db85Smrg# First try GNU make style include.
656d466db85Smrgecho "include confinc" > confmf
657d466db85Smrg# Ignore all kinds of additional output from `make'.
658d466db85Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
659d466db85Smrg*the\ am__doit\ target*)
660d466db85Smrg  am__include=include
661d466db85Smrg  am__quote=
662d466db85Smrg  _am_result=GNU
663d466db85Smrg  ;;
664d466db85Smrgesac
665d466db85Smrg# Now try BSD make style include.
666d466db85Smrgif test "$am__include" = "#"; then
667d466db85Smrg   echo '.include "confinc"' > confmf
668d466db85Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
669d466db85Smrg   *the\ am__doit\ target*)
670d466db85Smrg     am__include=.include
671d466db85Smrg     am__quote="\""
672d466db85Smrg     _am_result=BSD
673d466db85Smrg     ;;
674d466db85Smrg   esac
675d466db85Smrgfi
676d466db85SmrgAC_SUBST([am__include])
677d466db85SmrgAC_SUBST([am__quote])
678d466db85SmrgAC_MSG_RESULT([$_am_result])
679d466db85Smrgrm -f confinc confmf
680d466db85Smrg])
681d838582fSmrg
682d466db85Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
683d838582fSmrg
684d466db85Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
685d466db85Smrg# Free Software Foundation, Inc.
686d838582fSmrg#
687d466db85Smrg# This file is free software; the Free Software Foundation
688d466db85Smrg# gives unlimited permission to copy and/or distribute it,
689d466db85Smrg# with or without modifications, as long as this notice is preserved.
690d838582fSmrg
691d466db85Smrg# serial 6
692d838582fSmrg
693d466db85Smrg# AM_MISSING_PROG(NAME, PROGRAM)
694d466db85Smrg# ------------------------------
695d466db85SmrgAC_DEFUN([AM_MISSING_PROG],
696d466db85Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
697d466db85Smrg$1=${$1-"${am_missing_run}$2"}
698d466db85SmrgAC_SUBST($1)])
699d838582fSmrg
700d838582fSmrg
701d466db85Smrg# AM_MISSING_HAS_RUN
702d466db85Smrg# ------------------
703d466db85Smrg# Define MISSING if not defined so far and test if it supports --run.
704d466db85Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
705d466db85SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
706d466db85Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
707d466db85SmrgAC_REQUIRE_AUX_FILE([missing])dnl
708d466db85Smrgif test x"${MISSING+set}" != xset; then
709d466db85Smrg  case $am_aux_dir in
710d466db85Smrg  *\ * | *\	*)
711d466db85Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
712d466db85Smrg  *)
713d466db85Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
714d466db85Smrg  esac
715d466db85Smrgfi
716d466db85Smrg# Use eval to expand $SHELL
717d466db85Smrgif eval "$MISSING --run true"; then
718d466db85Smrg  am_missing_run="$MISSING --run "
719d466db85Smrgelse
720d466db85Smrg  am_missing_run=
721d466db85Smrg  AC_MSG_WARN([`missing' script is too old or missing])
722d466db85Smrgfi
723d838582fSmrg])
724d838582fSmrg
725d466db85Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726d838582fSmrg#
727d838582fSmrg# This file is free software; the Free Software Foundation
728d838582fSmrg# gives unlimited permission to copy and/or distribute it,
729d838582fSmrg# with or without modifications, as long as this notice is preserved.
730d838582fSmrg
731d466db85Smrg# AM_PROG_MKDIR_P
732d466db85Smrg# ---------------
733d466db85Smrg# Check for `mkdir -p'.
734d466db85SmrgAC_DEFUN([AM_PROG_MKDIR_P],
735d466db85Smrg[AC_PREREQ([2.60])dnl
736d466db85SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
737d466db85Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
738d466db85Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
739d466db85Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
740d466db85Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
741d466db85Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
742d466db85Smrgdnl adjustment using top_builddir (which is defined more often than
743d466db85Smrgdnl MKDIR_P).
744d466db85SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
745d466db85Smrgcase $mkdir_p in
746d466db85Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
747d466db85Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
748d466db85Smrgesac
749d838582fSmrg])
750d838582fSmrg
751d466db85Smrg# Helper functions for option handling.                     -*- Autoconf -*-
752d838582fSmrg
753d466db85Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
754d838582fSmrg#
755d838582fSmrg# This file is free software; the Free Software Foundation
756d838582fSmrg# gives unlimited permission to copy and/or distribute it,
757d838582fSmrg# with or without modifications, as long as this notice is preserved.
758d838582fSmrg
759d466db85Smrg# serial 4
760d838582fSmrg
761d466db85Smrg# _AM_MANGLE_OPTION(NAME)
762d466db85Smrg# -----------------------
763d466db85SmrgAC_DEFUN([_AM_MANGLE_OPTION],
764d466db85Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765d838582fSmrg
766d466db85Smrg# _AM_SET_OPTION(NAME)
767d466db85Smrg# ------------------------------
768d466db85Smrg# Set option NAME.  Presently that only means defining a flag for this option.
769d466db85SmrgAC_DEFUN([_AM_SET_OPTION],
770d466db85Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
771d466db85Smrg
772d466db85Smrg# _AM_SET_OPTIONS(OPTIONS)
773d466db85Smrg# ----------------------------------
774d466db85Smrg# OPTIONS is a space-separated list of Automake options.
775d466db85SmrgAC_DEFUN([_AM_SET_OPTIONS],
776d466db85Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
777d466db85Smrg
778d466db85Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
779d466db85Smrg# -------------------------------------------
780d466db85Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
781d466db85SmrgAC_DEFUN([_AM_IF_OPTION],
782d466db85Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783d838582fSmrg
784d466db85Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785d466db85Smrg
786d466db85Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
787d838582fSmrg# Free Software Foundation, Inc.
788d838582fSmrg#
789d838582fSmrg# This file is free software; the Free Software Foundation
790d838582fSmrg# gives unlimited permission to copy and/or distribute it,
791d838582fSmrg# with or without modifications, as long as this notice is preserved.
792d838582fSmrg
793d466db85Smrg# serial 5
794d838582fSmrg
795d466db85Smrg# AM_SANITY_CHECK
796d466db85Smrg# ---------------
797d466db85SmrgAC_DEFUN([AM_SANITY_CHECK],
798d466db85Smrg[AC_MSG_CHECKING([whether build environment is sane])
799d466db85Smrg# Just in case
800d466db85Smrgsleep 1
801d466db85Smrgecho timestamp > conftest.file
802d466db85Smrg# Reject unsafe characters in $srcdir or the absolute working directory
803d466db85Smrg# name.  Accept space and tab only in the latter.
804d466db85Smrgam_lf='
805d466db85Smrg'
806d466db85Smrgcase `pwd` in
807d466db85Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
808d466db85Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
809d466db85Smrgesac
810d466db85Smrgcase $srcdir in
811d466db85Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
812d466db85Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
813d466db85Smrgesac
814d466db85Smrg
815d466db85Smrg# Do `set' in a subshell so we don't clobber the current shell's
816d466db85Smrg# arguments.  Must try -L first in case configure is actually a
817d466db85Smrg# symlink; some systems play weird games with the mod time of symlinks
818d466db85Smrg# (eg FreeBSD returns the mod time of the symlink's containing
819d466db85Smrg# directory).
820d466db85Smrgif (
821d466db85Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
822d466db85Smrg   if test "$[*]" = "X"; then
823d466db85Smrg      # -L didn't work.
824d466db85Smrg      set X `ls -t "$srcdir/configure" conftest.file`
825d466db85Smrg   fi
826d466db85Smrg   rm -f conftest.file
827d466db85Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
828d466db85Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
829d466db85Smrg
830d466db85Smrg      # If neither matched, then we have a broken ls.  This can happen
831d466db85Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
832d466db85Smrg      # broken ls alias from the environment.  This has actually
833d466db85Smrg      # happened.  Such a system could not be considered "sane".
834d466db85Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
835d466db85Smrgalias in your environment])
836d466db85Smrg   fi
837d466db85Smrg
838d466db85Smrg   test "$[2]" = conftest.file
839d466db85Smrg   )
840d466db85Smrgthen
841d466db85Smrg   # Ok.
842d466db85Smrg   :
843d838582fSmrgelse
844d466db85Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
845d466db85SmrgCheck your system clock])
846d838582fSmrgfi
847d466db85SmrgAC_MSG_RESULT(yes)])
848d838582fSmrg
849d466db85Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
850d838582fSmrg#
851d838582fSmrg# This file is free software; the Free Software Foundation
852d838582fSmrg# gives unlimited permission to copy and/or distribute it,
853d838582fSmrg# with or without modifications, as long as this notice is preserved.
854d838582fSmrg
855d466db85Smrg# serial 1
856d838582fSmrg
857d466db85Smrg# AM_SILENT_RULES([DEFAULT])
858d466db85Smrg# --------------------------
859d466db85Smrg# Enable less verbose build rules; with the default set to DEFAULT
860d466db85Smrg# (`yes' being less verbose, `no' or empty being verbose).
861d466db85SmrgAC_DEFUN([AM_SILENT_RULES],
862d466db85Smrg[AC_ARG_ENABLE([silent-rules],
863d466db85Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
864d466db85Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
865d466db85Smrgcase $enable_silent_rules in
866d466db85Smrgyes) AM_DEFAULT_VERBOSITY=0;;
867d466db85Smrgno)  AM_DEFAULT_VERBOSITY=1;;
868d466db85Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
869d466db85Smrgesac
870d466db85SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
871d466db85SmrgAM_BACKSLASH='\'
872d466db85SmrgAC_SUBST([AM_BACKSLASH])dnl
873d466db85Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
874d838582fSmrg])
875d838582fSmrg
876d838582fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
877d838582fSmrg#
878d838582fSmrg# This file is free software; the Free Software Foundation
879d838582fSmrg# gives unlimited permission to copy and/or distribute it,
880d838582fSmrg# with or without modifications, as long as this notice is preserved.
881d838582fSmrg
882d466db85Smrg# AM_PROG_INSTALL_STRIP
883d466db85Smrg# ---------------------
884d466db85Smrg# One issue with vendor `install' (even GNU) is that you can't
885d466db85Smrg# specify the program used to strip binaries.  This is especially
886d466db85Smrg# annoying in cross-compiling environments, where the build's strip
887d466db85Smrg# is unlikely to handle the host's binaries.
888d466db85Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
889d466db85Smrg# always use install-sh in `make install-strip', and initialize
890d466db85Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
891d466db85SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
892d466db85Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
893d466db85Smrg# Installed binaries are usually stripped using `strip' when the user
894d466db85Smrg# run `make install-strip'.  However `strip' might not be the right
895d466db85Smrg# tool to use in cross-compilation environments, therefore Automake
896d466db85Smrg# will honor the `STRIP' environment variable to overrule this program.
897d466db85Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
898d466db85Smrgif test "$cross_compiling" != no; then
899d466db85Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
900d466db85Smrgfi
901d466db85SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
902d466db85SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
903d838582fSmrg
904d466db85Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
905d838582fSmrg#
906d838582fSmrg# This file is free software; the Free Software Foundation
907d838582fSmrg# gives unlimited permission to copy and/or distribute it,
908d838582fSmrg# with or without modifications, as long as this notice is preserved.
909d838582fSmrg
910d838582fSmrg# serial 2
911d838582fSmrg
912d838582fSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
913d838582fSmrg# ---------------------------
914d838582fSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
915d838582fSmrg# This macro is traced by Automake.
916d838582fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
917d838582fSmrg
918d466db85Smrg# AM_SUBST_NOTMAKE(VARIABLE)
919d466db85Smrg# ---------------------------
920d466db85Smrg# Public sister of _AM_SUBST_NOTMAKE.
921d466db85SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
922d466db85Smrg
923d838582fSmrg# Check how to create a tarball.                            -*- Autoconf -*-
924d838582fSmrg
925d838582fSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
926d838582fSmrg#
927d838582fSmrg# This file is free software; the Free Software Foundation
928d838582fSmrg# gives unlimited permission to copy and/or distribute it,
929d838582fSmrg# with or without modifications, as long as this notice is preserved.
930d838582fSmrg
931d838582fSmrg# serial 2
932d838582fSmrg
933d838582fSmrg# _AM_PROG_TAR(FORMAT)
934d838582fSmrg# --------------------
935d838582fSmrg# Check how to create a tarball in format FORMAT.
936d838582fSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
937d838582fSmrg#
938d838582fSmrg# Substitute a variable $(am__tar) that is a command
939d838582fSmrg# writing to stdout a FORMAT-tarball containing the directory
940d838582fSmrg# $tardir.
941d838582fSmrg#     tardir=directory && $(am__tar) > result.tar
942d838582fSmrg#
943d838582fSmrg# Substitute a variable $(am__untar) that extract such
944d838582fSmrg# a tarball read from stdin.
945d838582fSmrg#     $(am__untar) < result.tar
946d838582fSmrgAC_DEFUN([_AM_PROG_TAR],
947d838582fSmrg[# Always define AMTAR for backward compatibility.
948d838582fSmrgAM_MISSING_PROG([AMTAR], [tar])
949d838582fSmrgm4_if([$1], [v7],
950d838582fSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
951d838582fSmrg     [m4_case([$1], [ustar],, [pax],,
952d838582fSmrg              [m4_fatal([Unknown tar format])])
953d838582fSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
954d838582fSmrg# Loop over all known methods to create a tar archive until one works.
955d838582fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
956d838582fSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
957d838582fSmrg# Do not fold the above two line into one, because Tru64 sh and
958d838582fSmrg# Solaris sh will not grok spaces in the rhs of `-'.
959d838582fSmrgfor _am_tool in $_am_tools
960d838582fSmrgdo
961d838582fSmrg  case $_am_tool in
962d838582fSmrg  gnutar)
963d838582fSmrg    for _am_tar in tar gnutar gtar;
964d838582fSmrg    do
965d838582fSmrg      AM_RUN_LOG([$_am_tar --version]) && break
966d838582fSmrg    done
967d838582fSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
968d838582fSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
969d838582fSmrg    am__untar="$_am_tar -xf -"
970d838582fSmrg    ;;
971d838582fSmrg  plaintar)
972d838582fSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
973d838582fSmrg    # ustar tarball either.
974d838582fSmrg    (tar --version) >/dev/null 2>&1 && continue
975d838582fSmrg    am__tar='tar chf - "$$tardir"'
976d838582fSmrg    am__tar_='tar chf - "$tardir"'
977d838582fSmrg    am__untar='tar xf -'
978d838582fSmrg    ;;
979d838582fSmrg  pax)
980d838582fSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
981d838582fSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
982d838582fSmrg    am__untar='pax -r'
983d838582fSmrg    ;;
984d838582fSmrg  cpio)
985d838582fSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
986d838582fSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987d838582fSmrg    am__untar='cpio -i -H $1 -d'
988d838582fSmrg    ;;
989d838582fSmrg  none)
990d838582fSmrg    am__tar=false
991d838582fSmrg    am__tar_=false
992d838582fSmrg    am__untar=false
993d838582fSmrg    ;;
994d838582fSmrg  esac
995d838582fSmrg
996d838582fSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
997d838582fSmrg  # and am__untar set.
998d838582fSmrg  test -n "${am_cv_prog_tar_$1}" && break
999d838582fSmrg
1000d838582fSmrg  # tar/untar a dummy directory, and stop if the command works
1001d838582fSmrg  rm -rf conftest.dir
1002d838582fSmrg  mkdir conftest.dir
1003d838582fSmrg  echo GrepMe > conftest.dir/file
1004d838582fSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1005d838582fSmrg  rm -rf conftest.dir
1006d838582fSmrg  if test -s conftest.tar; then
1007d838582fSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1008d838582fSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1009d838582fSmrg  fi
1010d838582fSmrgdone
1011d838582fSmrgrm -rf conftest.dir
1012d838582fSmrg
1013d838582fSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1014d838582fSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1015d838582fSmrgAC_SUBST([am__tar])
1016d838582fSmrgAC_SUBST([am__untar])
1017d838582fSmrg]) # _AM_PROG_TAR
1018d838582fSmrg
1019d466db85Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1020d466db85Smrgdnl
1021d466db85Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1022d466db85Smrgdnl 
1023d466db85Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1024d466db85Smrgdnl copy of this software and associated documentation files (the
1025d466db85Smrgdnl "Software"), to deal in the Software without restriction, including
1026d466db85Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
1027d466db85Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
1028d466db85Smrgdnl to whom the Software is furnished to do so, provided that the above
1029d466db85Smrgdnl copyright notice(s) and this permission notice appear in all copies of
1030d466db85Smrgdnl the Software and that both the above copyright notice(s) and this
1031d466db85Smrgdnl permission notice appear in supporting documentation.
1032d466db85Smrgdnl
1033d466db85Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1034d466db85Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1035d466db85Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1036d466db85Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1037d466db85Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1038d466db85Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1039d466db85Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1040d466db85Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1041d466db85Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1042d466db85Smrgdnl
1043d466db85Smrgdnl Except as contained in this notice, the name of a copyright holder
1044d466db85Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
1045d466db85Smrgdnl or other dealings in this Software without prior written authorization
1046d466db85Smrgdnl of the copyright holder.
1047d466db85Smrg
1048d466db85Smrg# XORG_MACROS_VERSION(required-version)
1049d466db85Smrg# -------------------------------------
1050d466db85Smrg# Minimum version: 1.1.0
1051d466db85Smrg#
1052d466db85Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1053d466db85Smrg# your configure.ac with the minimum required version, such as:
1054d466db85Smrg# XORG_MACROS_VERSION(1.1)
1055d466db85Smrg#
1056d466db85Smrg# To ensure that this macro is defined, also add:
1057d466db85Smrg# m4_ifndef([XORG_MACROS_VERSION],
1058d466db85Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1059d466db85Smrg#
1060d466db85Smrg#
1061d466db85Smrg# See the "minimum version" comment for each macro you use to see what 
1062d466db85Smrg# version you require.
1063d466db85Smrgm4_defun([XORG_MACROS_VERSION],[
1064d466db85Smrgm4_define([vers_have], [1.3.0])
1065d466db85Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1066d466db85Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1067d466db85Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1068d466db85Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1069d466db85Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1070d466db85Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1071d466db85Smrgm4_undefine([vers_have])
1072d466db85Smrgm4_undefine([maj_have])
1073d466db85Smrgm4_undefine([maj_needed])
1074d466db85Smrg]) # XORG_MACROS_VERSION
1075d466db85Smrg
1076d466db85Smrg# XORG_PROG_RAWCPP()
1077d466db85Smrg# ------------------
1078d466db85Smrg# Minimum version: 1.0.0
1079d466db85Smrg#
1080d466db85Smrg# Find cpp program and necessary flags for use in pre-processing text files
1081d466db85Smrg# such as man pages and config files
1082d466db85SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1083d466db85SmrgAC_REQUIRE([AC_PROG_CPP])
1084d466db85SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1085d466db85Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1086d466db85Smrg
1087d466db85Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1088d466db85Smrg# which is not the best choice for supporting other OS'es, but covers most
1089d466db85Smrg# of the ones we need for now.
1090d466db85SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1091d466db85SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1092d466db85Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1093d466db85Smrg	AC_MSG_RESULT([no])
1094d466db85Smrgelse
1095d466db85Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1096d466db85Smrg		RAWCPPFLAGS=-undef
1097d466db85Smrg		AC_MSG_RESULT([yes])
1098d466db85Smrg	# under Cygwin unix is still defined even with -undef
1099d466db85Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1100d466db85Smrg		RAWCPPFLAGS="-undef -ansi"
1101d466db85Smrg		AC_MSG_RESULT([yes, with -ansi])
1102d466db85Smrg	else
1103d466db85Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1104d466db85Smrg	fi
1105d466db85Smrgfi
1106d466db85Smrgrm -f conftest.$ac_ext
1107d466db85Smrg
1108d466db85SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1109d466db85SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1110d466db85Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1111d466db85Smrg	AC_MSG_RESULT([no])
1112d466db85Smrgelse
1113d466db85Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1114d466db85Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1115d466db85Smrg		AC_MSG_RESULT([yes])
1116d466db85Smrg	else
1117d466db85Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1118d466db85Smrg	fi
1119d466db85Smrgfi
1120d466db85Smrgrm -f conftest.$ac_ext
1121d466db85SmrgAC_SUBST(RAWCPPFLAGS)
1122d466db85Smrg]) # XORG_PROG_RAWCPP
1123d466db85Smrg
1124d466db85Smrg# XORG_MANPAGE_SECTIONS()
1125d466db85Smrg# -----------------------
1126d466db85Smrg# Minimum version: 1.0.0
1127d466db85Smrg#
1128d466db85Smrg# Determine which sections man pages go in for the different man page types
1129d466db85Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1130d466db85Smrg# Not sure if there's any better way than just hardcoding by OS name.
1131d466db85Smrg# Override default settings by setting environment variables
1132d466db85Smrg
1133d466db85SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1134d466db85SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1135d466db85Smrg
1136d466db85Smrgif test x$APP_MAN_SUFFIX = x    ; then
1137d466db85Smrg    APP_MAN_SUFFIX=1
1138d466db85Smrgfi
1139d466db85Smrgif test x$APP_MAN_DIR = x    ; then
1140d466db85Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1141d466db85Smrgfi
1142d466db85Smrg
1143d466db85Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1144d466db85Smrg    LIB_MAN_SUFFIX=3
1145d466db85Smrgfi
1146d466db85Smrgif test x$LIB_MAN_DIR = x    ; then
1147d466db85Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1148d466db85Smrgfi
1149d466db85Smrg
1150d466db85Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1151d466db85Smrg    case $host_os in
1152d466db85Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1153d466db85Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1154d466db85Smrg    esac
1155d466db85Smrgfi
1156d466db85Smrgif test x$FILE_MAN_DIR = x    ; then
1157d466db85Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1158d466db85Smrgfi
1159d466db85Smrg
1160d466db85Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1161d466db85Smrg    case $host_os in
1162d466db85Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1163d466db85Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1164d466db85Smrg    esac
1165d466db85Smrgfi
1166d466db85Smrgif test x$MISC_MAN_DIR = x    ; then
1167d466db85Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1168d466db85Smrgfi
1169d466db85Smrg
1170d466db85Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1171d466db85Smrg    case $host_os in
1172d466db85Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1173d466db85Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1174d466db85Smrg    esac
1175d466db85Smrgfi
1176d466db85Smrgif test x$DRIVER_MAN_DIR = x    ; then
1177d466db85Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1178d466db85Smrgfi
1179d466db85Smrg
1180d466db85Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1181d466db85Smrg    case $host_os in
1182d466db85Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1183d466db85Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1184d466db85Smrg    esac
1185d466db85Smrgfi
1186d466db85Smrgif test x$ADMIN_MAN_DIR = x    ; then
1187d466db85Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1188d466db85Smrgfi
1189d466db85Smrg
1190d466db85Smrg
1191d466db85SmrgAC_SUBST([APP_MAN_SUFFIX])
1192d466db85SmrgAC_SUBST([LIB_MAN_SUFFIX])
1193d466db85SmrgAC_SUBST([FILE_MAN_SUFFIX])
1194d466db85SmrgAC_SUBST([MISC_MAN_SUFFIX])
1195d466db85SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1196d466db85SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1197d466db85SmrgAC_SUBST([APP_MAN_DIR])
1198d466db85SmrgAC_SUBST([LIB_MAN_DIR])
1199d466db85SmrgAC_SUBST([FILE_MAN_DIR])
1200d466db85SmrgAC_SUBST([MISC_MAN_DIR])
1201d466db85SmrgAC_SUBST([DRIVER_MAN_DIR])
1202d466db85SmrgAC_SUBST([ADMIN_MAN_DIR])
1203d466db85Smrg]) # XORG_MANPAGE_SECTIONS
1204d466db85Smrg
1205d466db85Smrg# XORG_CHECK_LINUXDOC
1206d466db85Smrg# -------------------
1207d466db85Smrg# Minimum version: 1.0.0
1208d466db85Smrg#
1209d466db85Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1210d466db85Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1211d466db85Smrg# Whether or not the necessary tools and files are found can be checked
1212d466db85Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1213d466db85SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1214d466db85Smrgif test x$XORG_SGML_PATH = x ; then
1215d466db85Smrg    XORG_SGML_PATH=$prefix/share/sgml
1216d466db85Smrgfi
1217d466db85SmrgHAVE_DEFS_ENT=
1218d466db85Smrg
1219d466db85Smrgif test x"$cross_compiling" = x"yes" ; then
1220d466db85Smrg  HAVE_DEFS_ENT=no
1221d466db85Smrgelse
1222d466db85Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1223d466db85Smrgfi
1224d466db85Smrg
1225d466db85SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1226d466db85SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1227d466db85Smrg
1228d466db85SmrgAC_MSG_CHECKING([Whether to build documentation])
1229d466db85Smrg
1230d466db85Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1231d466db85Smrg   BUILDDOC=yes
1232d466db85Smrgelse
1233d466db85Smrg   BUILDDOC=no
1234d466db85Smrgfi
1235d466db85Smrg
1236d466db85SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1237d466db85Smrg
1238d466db85SmrgAC_MSG_RESULT([$BUILDDOC])
1239d466db85Smrg
1240d466db85SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1241d466db85Smrg
1242d466db85Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1243d466db85Smrg   BUILDPDFDOC=yes
1244d466db85Smrgelse
1245d466db85Smrg   BUILDPDFDOC=no
1246d466db85Smrgfi
1247d466db85Smrg
1248d466db85SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1249d466db85Smrg
1250d466db85SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1251d466db85Smrg
1252d466db85SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1253d466db85SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1254d466db85SmrgMAKE_PDF="$PS2PDF"
1255d466db85SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1256d466db85Smrg
1257d466db85SmrgAC_SUBST(MAKE_TEXT)
1258d466db85SmrgAC_SUBST(MAKE_PS)
1259d466db85SmrgAC_SUBST(MAKE_PDF)
1260d466db85SmrgAC_SUBST(MAKE_HTML)
1261d466db85Smrg]) # XORG_CHECK_LINUXDOC
1262d466db85Smrg
1263d466db85Smrg# XORG_CHECK_DOCBOOK
1264d466db85Smrg# -------------------
1265d466db85Smrg# Minimum version: 1.0.0
1266d466db85Smrg#
1267d466db85Smrg# Checks for the ability to build output formats from SGML DocBook source.
1268d466db85Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1269d466db85Smrg# indicates whether the necessary tools and files are found and, if set,
1270d466db85Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1271d466db85SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1272d466db85Smrgif test x$XORG_SGML_PATH = x ; then
1273d466db85Smrg    XORG_SGML_PATH=$prefix/share/sgml
1274d466db85Smrgfi
1275d466db85SmrgHAVE_DEFS_ENT=
1276d466db85SmrgBUILDTXTDOC=no
1277d466db85SmrgBUILDPDFDOC=no
1278d466db85SmrgBUILDPSDOC=no
1279d466db85SmrgBUILDHTMLDOC=no
1280d466db85Smrg
1281d466db85SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1282d466db85Smrg
1283d466db85SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1284d466db85SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1285d466db85SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1286d466db85SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1287d466db85Smrg
1288d466db85SmrgAC_MSG_CHECKING([Whether to build text documentation])
1289d466db85Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1290d466db85Smrg   test x$BUILD_TXTDOC != xno; then
1291d466db85Smrg	BUILDTXTDOC=yes
1292d466db85Smrgfi
1293d466db85SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1294d466db85SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1295d466db85Smrg
1296d466db85SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
1297d466db85Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1298d466db85Smrg   test x$BUILD_PDFDOC != xno; then
1299d466db85Smrg	BUILDPDFDOC=yes
1300d466db85Smrgfi
1301d466db85SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1302d466db85SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1303d466db85Smrg
1304d466db85SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
1305d466db85Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1306d466db85Smrg   test x$BUILD_PSDOC != xno; then
1307d466db85Smrg	BUILDPSDOC=yes
1308d466db85Smrgfi
1309d466db85SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1310d466db85SmrgAC_MSG_RESULT([$BUILDPSDOC])
1311d466db85Smrg
1312d466db85SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
1313d466db85Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1314d466db85Smrg   test x$BUILD_HTMLDOC != xno; then
1315d466db85Smrg	BUILDHTMLDOC=yes
1316d466db85Smrgfi
1317d466db85SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1318d466db85SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1319d466db85Smrg
1320d466db85SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1321d466db85SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1322d466db85SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1323d466db85SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1324d466db85Smrg
1325d466db85SmrgAC_SUBST(MAKE_TEXT)
1326d466db85SmrgAC_SUBST(MAKE_PS)
1327d466db85SmrgAC_SUBST(MAKE_PDF)
1328d466db85SmrgAC_SUBST(MAKE_HTML)
1329d466db85Smrg]) # XORG_CHECK_DOCBOOK
1330d466db85Smrg
1331d466db85Smrg# XORG_CHECK_MALLOC_ZERO
1332d466db85Smrg# ----------------------
1333d466db85Smrg# Minimum version: 1.0.0
1334d466db85Smrg#
1335d466db85Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1336d466db85Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1337d466db85Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1338d466db85SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1339d466db85SmrgAC_ARG_ENABLE(malloc0returnsnull,
1340d466db85Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1341d466db85Smrg		       [malloc(0) returns NULL (default: auto)]),
1342d466db85Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1343d466db85Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1344d466db85Smrg
1345d466db85SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1346d466db85Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1347d466db85Smrg	AC_RUN_IFELSE([
1348d466db85Smrgchar *malloc();
1349d466db85Smrgchar *realloc();
1350d466db85Smrgchar *calloc();
1351d466db85Smrgmain() {
1352d466db85Smrg    char *m0, *r0, *c0, *p;
1353d466db85Smrg    m0 = malloc(0);
1354d466db85Smrg    p = malloc(10);
1355d466db85Smrg    r0 = realloc(p,0);
1356d466db85Smrg    c0 = calloc(0);
1357d466db85Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1358d466db85Smrg}],
1359d466db85Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1360d466db85Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
1361d466db85Smrgfi
1362d466db85SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1363d466db85Smrg
1364d466db85Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1365d466db85Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1366d466db85Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1367d466db85Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1368d466db85Smrgelse
1369d466db85Smrg	MALLOC_ZERO_CFLAGS=""
1370d466db85Smrg	XMALLOC_ZERO_CFLAGS=""
1371d466db85Smrg	XTMALLOC_ZERO_CFLAGS=""
1372d466db85Smrgfi
1373d466db85Smrg
1374d466db85SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1375d466db85SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1376d466db85SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1377d466db85Smrg]) # XORG_CHECK_MALLOC_ZERO
1378d466db85Smrg
1379d466db85Smrg# XORG_WITH_LINT()
1380d466db85Smrg# ----------------
1381d466db85Smrg# Minimum version: 1.1.0
1382d466db85Smrg#
1383d466db85Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
1384d466db85Smrg# is specified.   (Use --with-lint=sparse for sparse.)
1385d466db85Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1386d466db85Smrg# Sets $LINT_FLAGS to flags to pass to source checker
1387d466db85Smrg# Sets LINT automake conditional if enabled (default: disabled)
1388d466db85Smrg#
1389d466db85SmrgAC_DEFUN([XORG_WITH_LINT],[
1390d466db85Smrg
1391d466db85Smrg# Allow checking code with lint, sparse, etc.
1392d466db85SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1393d466db85Smrg		[Use a lint-style source code checker (default: disabled)])],
1394d466db85Smrg		[use_lint=$withval], [use_lint=no])
1395d466db85Smrgif test "x$use_lint" = "xyes" ; then
1396d466db85Smrg	LINT="lint"
1397d466db85Smrgelse
1398d466db85Smrg	LINT="$use_lint"
1399d466db85Smrgfi
1400d466db85Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1401d466db85Smrg    case $LINT in
1402d466db85Smrg	lint|*/lint)
1403d466db85Smrg	    case $host_os in
1404d466db85Smrg		solaris*)
1405d466db85Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1406d466db85Smrg			;;
1407d466db85Smrg	    esac
1408d466db85Smrg	    ;;
1409d466db85Smrg    esac
1410d466db85Smrgfi
1411d466db85Smrg
1412d466db85SmrgAC_SUBST(LINT)
1413d466db85SmrgAC_SUBST(LINT_FLAGS)
1414d466db85SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
1415d466db85Smrg
1416d466db85Smrg]) # XORG_WITH_LINT
1417d466db85Smrg
1418d466db85Smrg# XORG_LINT_LIBRARY(LIBNAME)
1419d466db85Smrg# --------------------------
1420d466db85Smrg# Minimum version: 1.1.0
1421d466db85Smrg#
1422d466db85Smrg# Sets up flags for building lint libraries for checking programs that call
1423d466db85Smrg# functions in the library.
1424d466db85Smrg# Disabled by default, enable with --enable-lint-library
1425d466db85Smrg# Sets: 
1426d466db85Smrg#	@LINTLIB@		- name of lint library file to make
1427d466db85Smrg#	MAKE_LINT_LIB		- automake conditional
1428d466db85Smrg#
1429d466db85Smrg
1430d466db85SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1431d466db85SmrgAC_REQUIRE([XORG_WITH_LINT])
1432d466db85Smrg# Build lint "library" for more indepth checks of programs calling this library
1433d466db85SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1434d466db85Smrg	[Create lint library (default: disabled)])],
1435d466db85Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1436d466db85Smrgif test "x$make_lint_lib" != "xno" ; then
1437d466db85Smrg	if test "x$LINT" = "xno" ; then
1438d466db85Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1439d466db85Smrg	fi
1440d466db85Smrg	if test "x$make_lint_lib" = "xyes" ; then
1441d466db85Smrg		LINTLIB=llib-l$1.ln
1442d466db85Smrg	else
1443d466db85Smrg		LINTLIB=$make_lint_lib
1444d466db85Smrg	fi
1445d466db85Smrgfi
1446d466db85SmrgAC_SUBST(LINTLIB)
1447d466db85SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1448d466db85Smrg
1449d466db85Smrg]) # XORG_LINT_LIBRARY
1450d466db85Smrg
1451d466db85Smrg# XORG_CWARNFLAGS
1452d466db85Smrg# ---------------
1453d466db85Smrg# Minimum version: 1.2.0
1454d466db85Smrg#
1455d466db85Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1456d466db85Smrg#
1457d466db85SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1458d466db85SmrgAC_REQUIRE([AC_PROG_CC])
1459d466db85Smrgif  test "x$GCC" = xyes ; then
1460d466db85Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1461d466db85Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1462d466db85Smrg-Wbad-function-cast"
1463d466db85Smrg    case `$CC -dumpversion` in
1464d466db85Smrg    3.4.* | 4.*)
1465d466db85Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1466d466db85Smrg	;;
1467d466db85Smrg    esac
1468d466db85Smrgelse
1469d466db85Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1470d466db85Smrg    if test "x$SUNCC" = "xyes"; then
1471d466db85Smrg	CWARNFLAGS="-v"
1472d466db85Smrg    fi
1473d466db85Smrgfi
1474d466db85SmrgAC_SUBST(CWARNFLAGS)
1475d466db85Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
1476d466db85Smrg]) # XORG_CWARNFLAGS
1477d466db85Smrg
1478d466db85Smrg# XORG_STRICT_OPTION
1479d466db85Smrg# -----------------------
1480d466db85Smrg# Minimum version: 1.3.0
1481d466db85Smrg#
1482d466db85Smrg# Add configure option to enable strict compilation
1483d466db85SmrgAC_DEFUN([XORG_STRICT_OPTION], [
1484d466db85SmrgAC_REQUIRE([AC_PROG_CC])
1485d466db85SmrgAC_REQUIRE([AC_PROG_CC_C99])
1486d466db85SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1487d466db85Smrg
1488d466db85SmrgAC_ARG_ENABLE(strict-compilation,
1489d466db85Smrg			  AS_HELP_STRING([--enable-strict-compilation],
1490d466db85Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1491d466db85Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1492d466db85Smrgif test "x$STRICT_COMPILE" = "xyes"; then
1493d466db85Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1494d466db85Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1495d466db85Smrg	if test "x$GCC" = xyes ; then
1496d466db85Smrg		STRICT_CFLAGS="-pedantic -Werror"
1497d466db85Smrg	elif test "x$SUNCC" = "xyes"; then
1498d466db85Smrg		STRICT_CFLAGS="-errwarn"
1499d466db85Smrg    elif test "x$INTELCC" = "xyes"; then
1500d466db85Smrg		STRICT_CFLAGS="-Werror"
1501d466db85Smrg	fi
1502d466db85Smrgfi
1503d466db85SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1504d466db85SmrgAC_SUBST([CWARNFLAGS])
1505d466db85Smrg]) # XORG_STRICT_OPTION
1506d466db85Smrg
1507d466db85Smrg# XORG_DEFAULT_OPTIONS
1508d466db85Smrg# --------------------
1509d466db85Smrg# Minimum version: 1.3.0
1510d466db85Smrg#
1511d466db85Smrg# Defines default options for X.Org modules.
1512d466db85Smrg#
1513d466db85SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1514d466db85SmrgXORG_CWARNFLAGS
1515d466db85SmrgXORG_STRICT_OPTION
1516d466db85SmrgXORG_RELEASE_VERSION
1517d466db85SmrgXORG_CHANGELOG
1518d466db85SmrgXORG_MANPAGE_SECTIONS
1519d466db85Smrg]) # XORG_DEFAULT_OPTIONS
1520d466db85Smrgdnl Copyright 2005 Red Hat, Inc
1521d466db85Smrgdnl
1522d466db85Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1523d466db85Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1524d466db85Smrgdnl the above copyright notice appear in all copies and that both that
1525d466db85Smrgdnl copyright notice and this permission notice appear in supporting
1526d466db85Smrgdnl documentation.
1527d466db85Smrgdnl
1528d466db85Smrgdnl The above copyright notice and this permission notice shall be included
1529d466db85Smrgdnl in all copies or substantial portions of the Software.
1530d466db85Smrgdnl
1531d466db85Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1532d466db85Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1533d466db85Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1534d466db85Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1535d466db85Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1536d466db85Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1537d466db85Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1538d466db85Smrgdnl
1539d466db85Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1540d466db85Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1541d466db85Smrgdnl other dealings in this Software without prior written authorization
1542d466db85Smrgdnl from the copyright holders.
1543d466db85Smrgdnl
1544d466db85Smrg
1545d466db85Smrg# XORG_RELEASE_VERSION
1546d466db85Smrg# --------------------
1547d466db85Smrg# Adds --with/without-release-string and changes the PACKAGE and
1548d466db85Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1549d466db85Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1550d466db85Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1551d466db85Smrg 
1552d466db85SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1553d466db85Smrg	AC_ARG_WITH(release-version,
1554d466db85Smrg			AS_HELP_STRING([--with-release-version=STRING],
1555d466db85Smrg				[Use release version string in package name]),
1556d466db85Smrg			[RELEASE_VERSION="$withval"],
1557d466db85Smrg			[RELEASE_VERSION=""])
1558d466db85Smrg	if test "x$RELEASE_VERSION" != "x"; then
1559d466db85Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1560d466db85Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1561d466db85Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1562d466db85Smrg	fi
1563d466db85Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1564d466db85Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1565d466db85Smrg		[Major version of this package])
1566d466db85Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1567d466db85Smrg	if test "x$PVM" = "x"; then
1568d466db85Smrg		PVM="0"
1569d466db85Smrg	fi
1570d466db85Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1571d466db85Smrg		[$PVM],
1572d466db85Smrg		[Minor version of this package])
1573d466db85Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1574d466db85Smrg	if test "x$PVP" = "x"; then
1575d466db85Smrg		PVP="0"
1576d466db85Smrg	fi
1577d466db85Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1578d466db85Smrg		[$PVP],
1579d466db85Smrg		[Patch version of this package])
1580d466db85Smrg])
1581d466db85Smrg
1582d466db85Smrg# XORG_CHANGELOG()
1583d466db85Smrg# ----------------
1584d466db85Smrg# Minimum version: 1.2.0
1585d466db85Smrg#
1586d466db85Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1587d466db85Smrg# ChangeLog from git.
1588d466db85Smrg#
1589d466db85Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1590d466db85Smrg#
1591d466db85SmrgAC_DEFUN([XORG_CHANGELOG], [
1592d466db85SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
1593d466db85Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
1594d466db85Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1595d466db85SmrgAC_SUBST([CHANGELOG_CMD])
1596d466db85SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
1597d466db85Smrg]) # XORG_CHANGELOG
1598d466db85Smrg
1599