aclocal.m4 revision a9a39c43
1a9a39c43Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
2129be1b7Smrg
3a9a39c43Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4a9a39c43Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5129be1b7Smrg# This file is free software; the Free Software Foundation
6129be1b7Smrg# gives unlimited permission to copy and/or distribute it,
7129be1b7Smrg# with or without modifications, as long as this notice is preserved.
8129be1b7Smrg
9129be1b7Smrg# This program is distributed in the hope that it will be useful,
10129be1b7Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11129be1b7Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12129be1b7Smrg# PARTICULAR PURPOSE.
13129be1b7Smrg
14a9a39c43Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15a9a39c43Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16a9a39c43Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17a9a39c43Smrg[m4_warning([this file was generated for autoconf 2.63.
18a9a39c43SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19a9a39c43SmrgIf you have problems, you may need to regenerate the build system entirely.
20a9a39c43SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21129be1b7Smrg
22a9a39c43Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23a9a39c43Smrg#
24a9a39c43Smrg# This file is free software; the Free Software Foundation
25a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
26a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
27129be1b7Smrg
28129be1b7Smrg# AM_AUTOMAKE_VERSION(VERSION)
29129be1b7Smrg# ----------------------------
30129be1b7Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31129be1b7Smrg# generated from the m4 files accompanying Automake X.Y.
32a9a39c43Smrg# (This private macro should not be called outside this file.)
33a9a39c43SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34a9a39c43Smrg[am__api_version='1.11'
35a9a39c43Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36a9a39c43Smrgdnl require some minimum version.  Point them to the right macro.
37a9a39c43Smrgm4_if([$1], [1.11], [],
38a9a39c43Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39a9a39c43Smrg])
40a9a39c43Smrg
41a9a39c43Smrg# _AM_AUTOCONF_VERSION(VERSION)
42a9a39c43Smrg# -----------------------------
43a9a39c43Smrg# aclocal traces this macro to find the Autoconf version.
44a9a39c43Smrg# This is a private macro too.  Using m4_define simplifies
45a9a39c43Smrg# the logic in aclocal, which can simply ignore this definition.
46a9a39c43Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47129be1b7Smrg
48129be1b7Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49129be1b7Smrg# -------------------------------
50a9a39c43Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51a9a39c43Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52129be1b7SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53a9a39c43Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
54a9a39c43Smrgm4_ifndef([AC_AUTOCONF_VERSION],
55a9a39c43Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56a9a39c43Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57129be1b7Smrg
58a9a39c43Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59129be1b7Smrg
60a9a39c43Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61129be1b7Smrg#
62a9a39c43Smrg# This file is free software; the Free Software Foundation
63a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
64a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
65129be1b7Smrg
66129be1b7Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67129be1b7Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68129be1b7Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69129be1b7Smrg#
70129be1b7Smrg# Of course, Automake must honor this variable whenever it calls a
71129be1b7Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72129be1b7Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73129be1b7Smrg# depending on how configure is run.  This is pretty annoying, since
74129be1b7Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75129be1b7Smrg# source directory, any form will work fine, but in subdirectories a
76129be1b7Smrg# relative path needs to be adjusted first.
77129be1b7Smrg#
78129be1b7Smrg# $ac_aux_dir/missing
79129be1b7Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80129be1b7Smrg# $top_srcdir/$ac_aux_dir/missing
81129be1b7Smrg#    fails if $ac_aux_dir is absolute,
82129be1b7Smrg#    fails when called from a subdirectory in a VPATH build with
83129be1b7Smrg#          a relative $ac_aux_dir
84129be1b7Smrg#
85129be1b7Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86129be1b7Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
87129be1b7Smrg# harmless because $srcdir is `.', but things will broke when you
88129be1b7Smrg# start a VPATH build or use an absolute $srcdir.
89129be1b7Smrg#
90129be1b7Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91129be1b7Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92129be1b7Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93129be1b7Smrg# and then we would define $MISSING as
94129be1b7Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95129be1b7Smrg# This will work as long as MISSING is not called from configure, because
96129be1b7Smrg# unfortunately $(top_srcdir) has no meaning in configure.
97129be1b7Smrg# However there are other variables, like CC, which are often used in
98129be1b7Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99129be1b7Smrg#
100129be1b7Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
101129be1b7Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
102129be1b7Smrg# configured tree to be moved without reconfiguration.
103129be1b7Smrg
104a9a39c43SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105a9a39c43Smrg[dnl Rely on autoconf to set up CDPATH properly.
106a9a39c43SmrgAC_PREREQ([2.50])dnl
107129be1b7Smrg# expand $ac_aux_dir to an absolute path
108129be1b7Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
109129be1b7Smrg])
110129be1b7Smrg
111a9a39c43Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112129be1b7Smrg
113a9a39c43Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114a9a39c43Smrg# Free Software Foundation, Inc.
115a9a39c43Smrg#
116a9a39c43Smrg# This file is free software; the Free Software Foundation
117a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
118a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
119129be1b7Smrg
120a9a39c43Smrg# serial 9
121129be1b7Smrg
122a9a39c43Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123a9a39c43Smrg# -------------------------------------
124a9a39c43Smrg# Define a conditional.
125a9a39c43SmrgAC_DEFUN([AM_CONDITIONAL],
126a9a39c43Smrg[AC_PREREQ(2.52)dnl
127a9a39c43Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128a9a39c43Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129a9a39c43SmrgAC_SUBST([$1_TRUE])dnl
130a9a39c43SmrgAC_SUBST([$1_FALSE])dnl
131a9a39c43Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132a9a39c43Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133a9a39c43Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134a9a39c43Smrgif $2; then
135a9a39c43Smrg  $1_TRUE=
136a9a39c43Smrg  $1_FALSE='#'
137a9a39c43Smrgelse
138a9a39c43Smrg  $1_TRUE='#'
139a9a39c43Smrg  $1_FALSE=
140a9a39c43Smrgfi
141a9a39c43SmrgAC_CONFIG_COMMANDS_PRE(
142a9a39c43Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143a9a39c43Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144a9a39c43SmrgUsually this means the macro was only invoked conditionally.]])
145a9a39c43Smrgfi])])
146129be1b7Smrg
147a9a39c43Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148a9a39c43Smrg# Free Software Foundation, Inc.
149a9a39c43Smrg#
150a9a39c43Smrg# This file is free software; the Free Software Foundation
151a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
152a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
153129be1b7Smrg
154a9a39c43Smrg# serial 10
155129be1b7Smrg
156a9a39c43Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157a9a39c43Smrg# written in clear, in which case automake, when reading aclocal.m4,
158a9a39c43Smrg# will think it sees a *use*, and therefore will trigger all it's
159a9a39c43Smrg# C support machinery.  Also note that it means that autoscan, seeing
160a9a39c43Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161129be1b7Smrg
162129be1b7Smrg
163129be1b7Smrg# _AM_DEPENDENCIES(NAME)
164129be1b7Smrg# ----------------------
165129be1b7Smrg# See how the compiler implements dependency checking.
166129be1b7Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167129be1b7Smrg# We try a few techniques and use that to set a single cache variable.
168129be1b7Smrg#
169129be1b7Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170129be1b7Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171129be1b7Smrg# dependency, and given that the user is not expected to run this macro,
172129be1b7Smrg# just rely on AC_PROG_CC.
173129be1b7SmrgAC_DEFUN([_AM_DEPENDENCIES],
174129be1b7Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175129be1b7SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176129be1b7SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177129be1b7SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178129be1b7Smrg
179129be1b7Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180129be1b7Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181129be1b7Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182a9a39c43Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183129be1b7Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184129be1b7Smrg                   [depcc="$$1"   am_compiler_list=])
185129be1b7Smrg
186129be1b7SmrgAC_CACHE_CHECK([dependency style of $depcc],
187129be1b7Smrg               [am_cv_$1_dependencies_compiler_type],
188129be1b7Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189129be1b7Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
190129be1b7Smrg  # making bogus files that we don't know about and never remove.  For
191129be1b7Smrg  # instance it was reported that on HP-UX the gcc test will end up
192129be1b7Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
193129be1b7Smrg  # in D'.
194129be1b7Smrg  mkdir conftest.dir
195129be1b7Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196129be1b7Smrg  # using a relative directory.
197129be1b7Smrg  cp "$am_depcomp" conftest.dir
198129be1b7Smrg  cd conftest.dir
199129be1b7Smrg  # We will build objects and dependencies in a subdirectory because
200129be1b7Smrg  # it helps to detect inapplicable dependency modes.  For instance
201129be1b7Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202129be1b7Smrg  # side effect of compilation, but ICC will put the dependencies in
203129be1b7Smrg  # the current directory while Tru64 will put them in the object
204129be1b7Smrg  # directory.
205129be1b7Smrg  mkdir sub
206129be1b7Smrg
207129be1b7Smrg  am_cv_$1_dependencies_compiler_type=none
208129be1b7Smrg  if test "$am_compiler_list" = ""; then
209129be1b7Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210129be1b7Smrg  fi
211a9a39c43Smrg  am__universal=false
212a9a39c43Smrg  m4_case([$1], [CC],
213a9a39c43Smrg    [case " $depcc " in #(
214a9a39c43Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215a9a39c43Smrg     esac],
216a9a39c43Smrg    [CXX],
217a9a39c43Smrg    [case " $depcc " in #(
218a9a39c43Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219a9a39c43Smrg     esac])
220a9a39c43Smrg
221129be1b7Smrg  for depmode in $am_compiler_list; do
222129be1b7Smrg    # Setup a source with many dependencies, because some compilers
223129be1b7Smrg    # like to wrap large dependency lists on column 80 (with \), and
224129be1b7Smrg    # we should not choose a depcomp mode which is confused by this.
225129be1b7Smrg    #
226129be1b7Smrg    # We need to recreate these files for each test, as the compiler may
227129be1b7Smrg    # overwrite some of them when testing with obscure command lines.
228129be1b7Smrg    # This happens at least with the AIX C compiler.
229129be1b7Smrg    : > sub/conftest.c
230129be1b7Smrg    for i in 1 2 3 4 5 6; do
231129be1b7Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232a9a39c43Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233a9a39c43Smrg      # Solaris 8's {/usr,}/bin/sh.
234a9a39c43Smrg      touch sub/conftst$i.h
235129be1b7Smrg    done
236129be1b7Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237129be1b7Smrg
238a9a39c43Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239a9a39c43Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240a9a39c43Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241a9a39c43Smrg    # versions had trouble with output in subdirs
242a9a39c43Smrg    am__obj=sub/conftest.${OBJEXT-o}
243a9a39c43Smrg    am__minus_obj="-o $am__obj"
244129be1b7Smrg    case $depmode in
245a9a39c43Smrg    gcc)
246a9a39c43Smrg      # This depmode causes a compiler race in universal mode.
247a9a39c43Smrg      test "$am__universal" = false || continue
248a9a39c43Smrg      ;;
249129be1b7Smrg    nosideeffect)
250129be1b7Smrg      # after this tag, mechanisms are not by side-effect, so they'll
251129be1b7Smrg      # only be used when explicitly requested
252129be1b7Smrg      if test "x$enable_dependency_tracking" = xyes; then
253129be1b7Smrg	continue
254129be1b7Smrg      else
255129be1b7Smrg	break
256129be1b7Smrg      fi
257129be1b7Smrg      ;;
258a9a39c43Smrg    msvisualcpp | msvcmsys)
259a9a39c43Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
260a9a39c43Smrg      # not run yet.  These depmodes are late enough in the game, and
261a9a39c43Smrg      # so weak that their functioning should not be impacted.
262a9a39c43Smrg      am__obj=conftest.${OBJEXT-o}
263a9a39c43Smrg      am__minus_obj=
264a9a39c43Smrg      ;;
265129be1b7Smrg    none) break ;;
266129be1b7Smrg    esac
267129be1b7Smrg    if depmode=$depmode \
268a9a39c43Smrg       source=sub/conftest.c object=$am__obj \
269129be1b7Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270a9a39c43Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271129be1b7Smrg         >/dev/null 2>conftest.err &&
272a9a39c43Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273129be1b7Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274a9a39c43Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275129be1b7Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276129be1b7Smrg      # icc doesn't choke on unknown options, it will just issue warnings
277a9a39c43Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
278a9a39c43Smrg      # that says an option was ignored or not supported.
279a9a39c43Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280a9a39c43Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281a9a39c43Smrg      # The diagnosis changed in icc 8.0:
282a9a39c43Smrg      #   icc: Command line remark: option '-MP' not supported
283a9a39c43Smrg      if (grep 'ignoring option' conftest.err ||
284a9a39c43Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285129be1b7Smrg        am_cv_$1_dependencies_compiler_type=$depmode
286129be1b7Smrg        break
287129be1b7Smrg      fi
288129be1b7Smrg    fi
289129be1b7Smrg  done
290129be1b7Smrg
291a9a39c43Smrg  cd ..
292a9a39c43Smrg  rm -rf conftest.dir
293a9a39c43Smrgelse
294a9a39c43Smrg  am_cv_$1_dependencies_compiler_type=none
295a9a39c43Smrgfi
296a9a39c43Smrg])
297a9a39c43SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298a9a39c43SmrgAM_CONDITIONAL([am__fastdep$1], [
299a9a39c43Smrg  test "x$enable_dependency_tracking" != xno \
300a9a39c43Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301a9a39c43Smrg])
302a9a39c43Smrg
303a9a39c43Smrg
304a9a39c43Smrg# AM_SET_DEPDIR
305a9a39c43Smrg# -------------
306a9a39c43Smrg# Choose a directory name for dependency files.
307a9a39c43Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308a9a39c43SmrgAC_DEFUN([AM_SET_DEPDIR],
309a9a39c43Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310a9a39c43SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311a9a39c43Smrg])
312a9a39c43Smrg
313a9a39c43Smrg
314a9a39c43Smrg# AM_DEP_TRACK
315a9a39c43Smrg# ------------
316a9a39c43SmrgAC_DEFUN([AM_DEP_TRACK],
317a9a39c43Smrg[AC_ARG_ENABLE(dependency-tracking,
318a9a39c43Smrg[  --disable-dependency-tracking  speeds up one-time build
319a9a39c43Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320a9a39c43Smrgif test "x$enable_dependency_tracking" != xno; then
321a9a39c43Smrg  am_depcomp="$ac_aux_dir/depcomp"
322a9a39c43Smrg  AMDEPBACKSLASH='\'
323a9a39c43Smrgfi
324a9a39c43SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325a9a39c43SmrgAC_SUBST([AMDEPBACKSLASH])dnl
326a9a39c43Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327a9a39c43Smrg])
328a9a39c43Smrg
329a9a39c43Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330a9a39c43Smrg
331a9a39c43Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332a9a39c43Smrg# Free Software Foundation, Inc.
333a9a39c43Smrg#
334a9a39c43Smrg# This file is free software; the Free Software Foundation
335a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
336a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
337a9a39c43Smrg
338a9a39c43Smrg#serial 5
339a9a39c43Smrg
340a9a39c43Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341a9a39c43Smrg# ------------------------------
342a9a39c43SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343a9a39c43Smrg[{
344a9a39c43Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345a9a39c43Smrg  # are listed without --file.  Let's play safe and only enable the eval
346a9a39c43Smrg  # if we detect the quoting.
347a9a39c43Smrg  case $CONFIG_FILES in
348a9a39c43Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
349a9a39c43Smrg  *)   set x $CONFIG_FILES ;;
350a9a39c43Smrg  esac
351a9a39c43Smrg  shift
352a9a39c43Smrg  for mf
353a9a39c43Smrg  do
354a9a39c43Smrg    # Strip MF so we end up with the name of the file.
355a9a39c43Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356a9a39c43Smrg    # Check whether this is an Automake generated Makefile or not.
357a9a39c43Smrg    # We used to match only the files named `Makefile.in', but
358a9a39c43Smrg    # some people rename them; so instead we look at the file content.
359a9a39c43Smrg    # Grep'ing the first line is not enough: some people post-process
360a9a39c43Smrg    # each Makefile.in and add a new line on top of each file to say so.
361a9a39c43Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
362a9a39c43Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
363a9a39c43Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364a9a39c43Smrg      dirpart=`AS_DIRNAME("$mf")`
365a9a39c43Smrg    else
366a9a39c43Smrg      continue
367a9a39c43Smrg    fi
368a9a39c43Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
369a9a39c43Smrg    # from the Makefile without running `make'.
370a9a39c43Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371a9a39c43Smrg    test -z "$DEPDIR" && continue
372a9a39c43Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373a9a39c43Smrg    test -z "am__include" && continue
374a9a39c43Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375a9a39c43Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
376a9a39c43Smrg    U=`sed -n 's/^U = //p' < "$mf"`
377a9a39c43Smrg    # Find all dependency output files, they are included files with
378a9a39c43Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379a9a39c43Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380a9a39c43Smrg    # expansion.
381a9a39c43Smrg    for file in `sed -n "
382a9a39c43Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383a9a39c43Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384a9a39c43Smrg      # Make sure the directory exists.
385a9a39c43Smrg      test -f "$dirpart/$file" && continue
386a9a39c43Smrg      fdir=`AS_DIRNAME(["$file"])`
387a9a39c43Smrg      AS_MKDIR_P([$dirpart/$fdir])
388a9a39c43Smrg      # echo "creating $dirpart/$file"
389a9a39c43Smrg      echo '# dummy' > "$dirpart/$file"
390a9a39c43Smrg    done
391a9a39c43Smrg  done
392a9a39c43Smrg}
393a9a39c43Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394a9a39c43Smrg
395a9a39c43Smrg
396a9a39c43Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397a9a39c43Smrg# -----------------------------
398a9a39c43Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
399a9a39c43Smrg#
400a9a39c43Smrg# This code is only required when automatic dependency tracking
401a9a39c43Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
402a9a39c43Smrg# need in order to bootstrap the dependency handling code.
403a9a39c43SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404a9a39c43Smrg[AC_CONFIG_COMMANDS([depfiles],
405a9a39c43Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406a9a39c43Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407a9a39c43Smrg])
408a9a39c43Smrg
409a9a39c43Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
410a9a39c43Smrg# Free Software Foundation, Inc.
411a9a39c43Smrg#
412a9a39c43Smrg# This file is free software; the Free Software Foundation
413a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
414a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
415a9a39c43Smrg
416a9a39c43Smrg# serial 8
417a9a39c43Smrg
418a9a39c43Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
419a9a39c43SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
420a9a39c43Smrg
421a9a39c43Smrg# Do all the work for Automake.                             -*- Autoconf -*-
422a9a39c43Smrg
423a9a39c43Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
424a9a39c43Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
425a9a39c43Smrg#
426a9a39c43Smrg# This file is free software; the Free Software Foundation
427a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
428a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
429a9a39c43Smrg
430a9a39c43Smrg# serial 16
431a9a39c43Smrg
432a9a39c43Smrg# This macro actually does too much.  Some checks are only needed if
433a9a39c43Smrg# your package does certain things.  But this isn't really a big deal.
434a9a39c43Smrg
435a9a39c43Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
436a9a39c43Smrg# AM_INIT_AUTOMAKE([OPTIONS])
437a9a39c43Smrg# -----------------------------------------------
438a9a39c43Smrg# The call with PACKAGE and VERSION arguments is the old style
439a9a39c43Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
440a9a39c43Smrg# and VERSION should now be passed to AC_INIT and removed from
441a9a39c43Smrg# the call to AM_INIT_AUTOMAKE.
442a9a39c43Smrg# We support both call styles for the transition.  After
443a9a39c43Smrg# the next Automake release, Autoconf can make the AC_INIT
444a9a39c43Smrg# arguments mandatory, and then we can depend on a new Autoconf
445a9a39c43Smrg# release and drop the old call support.
446a9a39c43SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
447a9a39c43Smrg[AC_PREREQ([2.62])dnl
448a9a39c43Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
449a9a39c43Smrgdnl the ones we care about.
450a9a39c43Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
451a9a39c43SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
452a9a39c43SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
453a9a39c43Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
454a9a39c43Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
455a9a39c43Smrg  # is not polluted with repeated "-I."
456a9a39c43Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
457a9a39c43Smrg  # test to see if srcdir already configured
458a9a39c43Smrg  if test -f $srcdir/config.status; then
459a9a39c43Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
460a9a39c43Smrg  fi
461a9a39c43Smrgfi
462a9a39c43Smrg
463a9a39c43Smrg# test whether we have cygpath
464a9a39c43Smrgif test -z "$CYGPATH_W"; then
465a9a39c43Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
466a9a39c43Smrg    CYGPATH_W='cygpath -w'
467a9a39c43Smrg  else
468a9a39c43Smrg    CYGPATH_W=echo
469a9a39c43Smrg  fi
470a9a39c43Smrgfi
471a9a39c43SmrgAC_SUBST([CYGPATH_W])
472a9a39c43Smrg
473a9a39c43Smrg# Define the identity of the package.
474a9a39c43Smrgdnl Distinguish between old-style and new-style calls.
475a9a39c43Smrgm4_ifval([$2],
476a9a39c43Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
477a9a39c43Smrg AC_SUBST([PACKAGE], [$1])dnl
478a9a39c43Smrg AC_SUBST([VERSION], [$2])],
479a9a39c43Smrg[_AM_SET_OPTIONS([$1])dnl
480a9a39c43Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
481a9a39c43Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
482a9a39c43Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
483a9a39c43Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
484a9a39c43Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
485a9a39c43Smrg
486a9a39c43Smrg_AM_IF_OPTION([no-define],,
487a9a39c43Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
488a9a39c43Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489a9a39c43Smrg
490a9a39c43Smrg# Some tools Automake needs.
491a9a39c43SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
492a9a39c43SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
493a9a39c43SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
494a9a39c43SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
495a9a39c43SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
496a9a39c43SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
497a9a39c43SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
498a9a39c43SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
499a9a39c43SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
500a9a39c43SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
501a9a39c43Smrg# We need awk for the "check" target.  The system "awk" is bad on
502a9a39c43Smrg# some platforms.
503a9a39c43SmrgAC_REQUIRE([AC_PROG_AWK])dnl
504a9a39c43SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
505a9a39c43SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
506a9a39c43Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
507a9a39c43Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
508a9a39c43Smrg			     [_AM_PROG_TAR([v7])])])
509a9a39c43Smrg_AM_IF_OPTION([no-dependencies],,
510a9a39c43Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
511a9a39c43Smrg		  [_AM_DEPENDENCIES(CC)],
512a9a39c43Smrg		  [define([AC_PROG_CC],
513a9a39c43Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
514a9a39c43SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
515a9a39c43Smrg		  [_AM_DEPENDENCIES(CXX)],
516a9a39c43Smrg		  [define([AC_PROG_CXX],
517a9a39c43Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
518a9a39c43SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
519a9a39c43Smrg		  [_AM_DEPENDENCIES(OBJC)],
520a9a39c43Smrg		  [define([AC_PROG_OBJC],
521a9a39c43Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
522a9a39c43Smrg])
523a9a39c43Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
524a9a39c43Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
525a9a39c43Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
526a9a39c43Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
527a9a39c43SmrgAC_CONFIG_COMMANDS_PRE(dnl
528a9a39c43Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
529a9a39c43Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
530a9a39c43Smrg])
531a9a39c43Smrg
532a9a39c43Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
533a9a39c43Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
534a9a39c43Smrgdnl mangled by Autoconf and run in a shell conditional statement.
535a9a39c43Smrgm4_define([_AC_COMPILER_EXEEXT],
536a9a39c43Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537a9a39c43Smrg
538a9a39c43Smrg
539a9a39c43Smrg# When config.status generates a header, we must update the stamp-h file.
540a9a39c43Smrg# This file resides in the same directory as the config header
541a9a39c43Smrg# that is generated.  The stamp files are numbered to have different names.
542a9a39c43Smrg
543a9a39c43Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
544a9a39c43Smrg# loop where config.status creates the headers, so we can generate
545a9a39c43Smrg# our stamp files there.
546a9a39c43SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
547a9a39c43Smrg[# Compute $1's index in $config_headers.
548a9a39c43Smrg_am_arg=$1
549a9a39c43Smrg_am_stamp_count=1
550a9a39c43Smrgfor _am_header in $config_headers :; do
551a9a39c43Smrg  case $_am_header in
552a9a39c43Smrg    $_am_arg | $_am_arg:* )
553a9a39c43Smrg      break ;;
554a9a39c43Smrg    * )
555a9a39c43Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
556a9a39c43Smrg  esac
557a9a39c43Smrgdone
558a9a39c43Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
559a9a39c43Smrg
560a9a39c43Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
561a9a39c43Smrg#
562a9a39c43Smrg# This file is free software; the Free Software Foundation
563a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
564a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
565a9a39c43Smrg
566a9a39c43Smrg# AM_PROG_INSTALL_SH
567a9a39c43Smrg# ------------------
568a9a39c43Smrg# Define $install_sh.
569a9a39c43SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
570a9a39c43Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
571a9a39c43Smrgif test x"${install_sh}" != xset; then
572a9a39c43Smrg  case $am_aux_dir in
573a9a39c43Smrg  *\ * | *\	*)
574a9a39c43Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
575a9a39c43Smrg  *)
576a9a39c43Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
577a9a39c43Smrg  esac
578a9a39c43Smrgfi
579a9a39c43SmrgAC_SUBST(install_sh)])
580a9a39c43Smrg
581a9a39c43Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
582a9a39c43Smrg#
583a9a39c43Smrg# This file is free software; the Free Software Foundation
584a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
585a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
586a9a39c43Smrg
587a9a39c43Smrg# serial 2
588a9a39c43Smrg
589a9a39c43Smrg# Check whether the underlying file-system supports filenames
590a9a39c43Smrg# with a leading dot.  For instance MS-DOS doesn't.
591a9a39c43SmrgAC_DEFUN([AM_SET_LEADING_DOT],
592a9a39c43Smrg[rm -rf .tst 2>/dev/null
593a9a39c43Smrgmkdir .tst 2>/dev/null
594a9a39c43Smrgif test -d .tst; then
595a9a39c43Smrg  am__leading_dot=.
596a9a39c43Smrgelse
597a9a39c43Smrg  am__leading_dot=_
598a9a39c43Smrgfi
599a9a39c43Smrgrmdir .tst 2>/dev/null
600a9a39c43SmrgAC_SUBST([am__leading_dot])])
601a9a39c43Smrg
602a9a39c43Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
603a9a39c43Smrg# From Jim Meyering
604a9a39c43Smrg
605a9a39c43Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
606a9a39c43Smrg# Free Software Foundation, Inc.
607a9a39c43Smrg#
608a9a39c43Smrg# This file is free software; the Free Software Foundation
609a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
610a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
611a9a39c43Smrg
612a9a39c43Smrg# serial 5
613a9a39c43Smrg
614a9a39c43Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
615a9a39c43Smrg# ----------------------------------
616a9a39c43Smrg# Control maintainer-specific portions of Makefiles.
617a9a39c43Smrg# Default is to disable them, unless `enable' is passed literally.
618a9a39c43Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
619a9a39c43Smrg# can override the default with the --enable/--disable switch.
620a9a39c43SmrgAC_DEFUN([AM_MAINTAINER_MODE],
621a9a39c43Smrg[m4_case(m4_default([$1], [disable]),
622a9a39c43Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
623a9a39c43Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
624a9a39c43Smrg       [m4_define([am_maintainer_other], [enable])
625a9a39c43Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
626a9a39c43SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
627a9a39c43Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
628a9a39c43Smrg  AC_ARG_ENABLE([maintainer-mode],
629a9a39c43Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
630a9a39c43Smrg			  (and sometimes confusing) to the casual installer],
631a9a39c43Smrg      [USE_MAINTAINER_MODE=$enableval],
632a9a39c43Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
633a9a39c43Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
634a9a39c43Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
635a9a39c43Smrg  MAINT=$MAINTAINER_MODE_TRUE
636a9a39c43Smrg  AC_SUBST([MAINT])dnl
637a9a39c43Smrg]
638a9a39c43Smrg)
639a9a39c43Smrg
640a9a39c43SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
641a9a39c43Smrg
642a9a39c43Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
643a9a39c43Smrg
644a9a39c43Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
645a9a39c43Smrg#
646a9a39c43Smrg# This file is free software; the Free Software Foundation
647a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
648a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
649a9a39c43Smrg
650a9a39c43Smrg# serial 4
651a9a39c43Smrg
652a9a39c43Smrg# AM_MAKE_INCLUDE()
653a9a39c43Smrg# -----------------
654a9a39c43Smrg# Check to see how make treats includes.
655a9a39c43SmrgAC_DEFUN([AM_MAKE_INCLUDE],
656a9a39c43Smrg[am_make=${MAKE-make}
657a9a39c43Smrgcat > confinc << 'END'
658a9a39c43Smrgam__doit:
659a9a39c43Smrg	@echo this is the am__doit target
660a9a39c43Smrg.PHONY: am__doit
661a9a39c43SmrgEND
662a9a39c43Smrg# If we don't find an include directive, just comment out the code.
663a9a39c43SmrgAC_MSG_CHECKING([for style of include used by $am_make])
664a9a39c43Smrgam__include="#"
665a9a39c43Smrgam__quote=
666a9a39c43Smrg_am_result=none
667a9a39c43Smrg# First try GNU make style include.
668a9a39c43Smrgecho "include confinc" > confmf
669a9a39c43Smrg# Ignore all kinds of additional output from `make'.
670a9a39c43Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
671a9a39c43Smrg*the\ am__doit\ target*)
672a9a39c43Smrg  am__include=include
673a9a39c43Smrg  am__quote=
674a9a39c43Smrg  _am_result=GNU
675a9a39c43Smrg  ;;
676a9a39c43Smrgesac
677a9a39c43Smrg# Now try BSD make style include.
678a9a39c43Smrgif test "$am__include" = "#"; then
679a9a39c43Smrg   echo '.include "confinc"' > confmf
680a9a39c43Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
681a9a39c43Smrg   *the\ am__doit\ target*)
682a9a39c43Smrg     am__include=.include
683a9a39c43Smrg     am__quote="\""
684a9a39c43Smrg     _am_result=BSD
685a9a39c43Smrg     ;;
686a9a39c43Smrg   esac
687a9a39c43Smrgfi
688a9a39c43SmrgAC_SUBST([am__include])
689a9a39c43SmrgAC_SUBST([am__quote])
690a9a39c43SmrgAC_MSG_RESULT([$_am_result])
691a9a39c43Smrgrm -f confinc confmf
692a9a39c43Smrg])
693a9a39c43Smrg
694a9a39c43Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
695a9a39c43Smrg
696a9a39c43Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
697a9a39c43Smrg# Free Software Foundation, Inc.
698a9a39c43Smrg#
699a9a39c43Smrg# This file is free software; the Free Software Foundation
700a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
701a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
702a9a39c43Smrg
703a9a39c43Smrg# serial 6
704a9a39c43Smrg
705a9a39c43Smrg# AM_MISSING_PROG(NAME, PROGRAM)
706a9a39c43Smrg# ------------------------------
707a9a39c43SmrgAC_DEFUN([AM_MISSING_PROG],
708a9a39c43Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
709a9a39c43Smrg$1=${$1-"${am_missing_run}$2"}
710a9a39c43SmrgAC_SUBST($1)])
711a9a39c43Smrg
712a9a39c43Smrg
713a9a39c43Smrg# AM_MISSING_HAS_RUN
714a9a39c43Smrg# ------------------
715a9a39c43Smrg# Define MISSING if not defined so far and test if it supports --run.
716a9a39c43Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
717a9a39c43SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
718a9a39c43Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
719a9a39c43SmrgAC_REQUIRE_AUX_FILE([missing])dnl
720a9a39c43Smrgif test x"${MISSING+set}" != xset; then
721a9a39c43Smrg  case $am_aux_dir in
722a9a39c43Smrg  *\ * | *\	*)
723a9a39c43Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
724a9a39c43Smrg  *)
725a9a39c43Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
726a9a39c43Smrg  esac
727a9a39c43Smrgfi
728a9a39c43Smrg# Use eval to expand $SHELL
729a9a39c43Smrgif eval "$MISSING --run true"; then
730a9a39c43Smrg  am_missing_run="$MISSING --run "
731a9a39c43Smrgelse
732a9a39c43Smrg  am_missing_run=
733a9a39c43Smrg  AC_MSG_WARN([`missing' script is too old or missing])
734a9a39c43Smrgfi
735a9a39c43Smrg])
736a9a39c43Smrg
737a9a39c43Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
738a9a39c43Smrg#
739a9a39c43Smrg# This file is free software; the Free Software Foundation
740a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
741a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
742a9a39c43Smrg
743a9a39c43Smrg# AM_PROG_MKDIR_P
744a9a39c43Smrg# ---------------
745a9a39c43Smrg# Check for `mkdir -p'.
746a9a39c43SmrgAC_DEFUN([AM_PROG_MKDIR_P],
747a9a39c43Smrg[AC_PREREQ([2.60])dnl
748a9a39c43SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
749a9a39c43Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
750a9a39c43Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
751a9a39c43Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
752a9a39c43Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
753a9a39c43Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
754a9a39c43Smrgdnl adjustment using top_builddir (which is defined more often than
755a9a39c43Smrgdnl MKDIR_P).
756a9a39c43SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
757a9a39c43Smrgcase $mkdir_p in
758a9a39c43Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
759a9a39c43Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
760a9a39c43Smrgesac
761a9a39c43Smrg])
762a9a39c43Smrg
763a9a39c43Smrg# Helper functions for option handling.                     -*- Autoconf -*-
764a9a39c43Smrg
765a9a39c43Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
766a9a39c43Smrg#
767a9a39c43Smrg# This file is free software; the Free Software Foundation
768a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
769a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
770a9a39c43Smrg
771a9a39c43Smrg# serial 4
772a9a39c43Smrg
773a9a39c43Smrg# _AM_MANGLE_OPTION(NAME)
774a9a39c43Smrg# -----------------------
775a9a39c43SmrgAC_DEFUN([_AM_MANGLE_OPTION],
776a9a39c43Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
777a9a39c43Smrg
778a9a39c43Smrg# _AM_SET_OPTION(NAME)
779a9a39c43Smrg# ------------------------------
780a9a39c43Smrg# Set option NAME.  Presently that only means defining a flag for this option.
781a9a39c43SmrgAC_DEFUN([_AM_SET_OPTION],
782a9a39c43Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
783a9a39c43Smrg
784a9a39c43Smrg# _AM_SET_OPTIONS(OPTIONS)
785a9a39c43Smrg# ----------------------------------
786a9a39c43Smrg# OPTIONS is a space-separated list of Automake options.
787a9a39c43SmrgAC_DEFUN([_AM_SET_OPTIONS],
788a9a39c43Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
789a9a39c43Smrg
790a9a39c43Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
791a9a39c43Smrg# -------------------------------------------
792a9a39c43Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
793a9a39c43SmrgAC_DEFUN([_AM_IF_OPTION],
794a9a39c43Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
795a9a39c43Smrg
796a9a39c43Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
797a9a39c43Smrg
798a9a39c43Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
799a9a39c43Smrg# Free Software Foundation, Inc.
800a9a39c43Smrg#
801a9a39c43Smrg# This file is free software; the Free Software Foundation
802a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
803a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
804a9a39c43Smrg
805a9a39c43Smrg# serial 5
806a9a39c43Smrg
807a9a39c43Smrg# AM_SANITY_CHECK
808a9a39c43Smrg# ---------------
809a9a39c43SmrgAC_DEFUN([AM_SANITY_CHECK],
810a9a39c43Smrg[AC_MSG_CHECKING([whether build environment is sane])
811a9a39c43Smrg# Just in case
812a9a39c43Smrgsleep 1
813a9a39c43Smrgecho timestamp > conftest.file
814a9a39c43Smrg# Reject unsafe characters in $srcdir or the absolute working directory
815a9a39c43Smrg# name.  Accept space and tab only in the latter.
816a9a39c43Smrgam_lf='
817a9a39c43Smrg'
818a9a39c43Smrgcase `pwd` in
819a9a39c43Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
820a9a39c43Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
821a9a39c43Smrgesac
822a9a39c43Smrgcase $srcdir in
823a9a39c43Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
824a9a39c43Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
825a9a39c43Smrgesac
826a9a39c43Smrg
827a9a39c43Smrg# Do `set' in a subshell so we don't clobber the current shell's
828a9a39c43Smrg# arguments.  Must try -L first in case configure is actually a
829a9a39c43Smrg# symlink; some systems play weird games with the mod time of symlinks
830a9a39c43Smrg# (eg FreeBSD returns the mod time of the symlink's containing
831a9a39c43Smrg# directory).
832a9a39c43Smrgif (
833a9a39c43Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
834a9a39c43Smrg   if test "$[*]" = "X"; then
835a9a39c43Smrg      # -L didn't work.
836a9a39c43Smrg      set X `ls -t "$srcdir/configure" conftest.file`
837a9a39c43Smrg   fi
838a9a39c43Smrg   rm -f conftest.file
839a9a39c43Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
840a9a39c43Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
841a9a39c43Smrg
842a9a39c43Smrg      # If neither matched, then we have a broken ls.  This can happen
843a9a39c43Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
844a9a39c43Smrg      # broken ls alias from the environment.  This has actually
845a9a39c43Smrg      # happened.  Such a system could not be considered "sane".
846a9a39c43Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
847a9a39c43Smrgalias in your environment])
848a9a39c43Smrg   fi
849a9a39c43Smrg
850a9a39c43Smrg   test "$[2]" = conftest.file
851a9a39c43Smrg   )
852a9a39c43Smrgthen
853a9a39c43Smrg   # Ok.
854a9a39c43Smrg   :
855129be1b7Smrgelse
856a9a39c43Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
857a9a39c43SmrgCheck your system clock])
858129be1b7Smrgfi
859a9a39c43SmrgAC_MSG_RESULT(yes)])
860a9a39c43Smrg
861a9a39c43Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
862a9a39c43Smrg#
863a9a39c43Smrg# This file is free software; the Free Software Foundation
864a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
865a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
866129be1b7Smrg
867a9a39c43Smrg# serial 1
868129be1b7Smrg
869a9a39c43Smrg# AM_SILENT_RULES([DEFAULT])
870a9a39c43Smrg# --------------------------
871a9a39c43Smrg# Enable less verbose build rules; with the default set to DEFAULT
872a9a39c43Smrg# (`yes' being less verbose, `no' or empty being verbose).
873a9a39c43SmrgAC_DEFUN([AM_SILENT_RULES],
874a9a39c43Smrg[AC_ARG_ENABLE([silent-rules],
875a9a39c43Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
876a9a39c43Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
877a9a39c43Smrgcase $enable_silent_rules in
878a9a39c43Smrgyes) AM_DEFAULT_VERBOSITY=0;;
879a9a39c43Smrgno)  AM_DEFAULT_VERBOSITY=1;;
880a9a39c43Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
881a9a39c43Smrgesac
882a9a39c43SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
883a9a39c43SmrgAM_BACKSLASH='\'
884a9a39c43SmrgAC_SUBST([AM_BACKSLASH])dnl
885a9a39c43Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
886129be1b7Smrg])
887129be1b7Smrg
888a9a39c43Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
889a9a39c43Smrg#
890a9a39c43Smrg# This file is free software; the Free Software Foundation
891a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
892a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
893129be1b7Smrg
894a9a39c43Smrg# AM_PROG_INSTALL_STRIP
895a9a39c43Smrg# ---------------------
896a9a39c43Smrg# One issue with vendor `install' (even GNU) is that you can't
897a9a39c43Smrg# specify the program used to strip binaries.  This is especially
898a9a39c43Smrg# annoying in cross-compiling environments, where the build's strip
899a9a39c43Smrg# is unlikely to handle the host's binaries.
900a9a39c43Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
901a9a39c43Smrg# always use install-sh in `make install-strip', and initialize
902a9a39c43Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
903a9a39c43SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
904a9a39c43Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
905a9a39c43Smrg# Installed binaries are usually stripped using `strip' when the user
906a9a39c43Smrg# run `make install-strip'.  However `strip' might not be the right
907a9a39c43Smrg# tool to use in cross-compilation environments, therefore Automake
908a9a39c43Smrg# will honor the `STRIP' environment variable to overrule this program.
909a9a39c43Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
910a9a39c43Smrgif test "$cross_compiling" != no; then
911a9a39c43Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
912129be1b7Smrgfi
913a9a39c43SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
914a9a39c43SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
915129be1b7Smrg
916a9a39c43Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
917a9a39c43Smrg#
918a9a39c43Smrg# This file is free software; the Free Software Foundation
919a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
920a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
921129be1b7Smrg
922a9a39c43Smrg# serial 2
923129be1b7Smrg
924a9a39c43Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
925a9a39c43Smrg# ---------------------------
926a9a39c43Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
927a9a39c43Smrg# This macro is traced by Automake.
928a9a39c43SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
929129be1b7Smrg
930a9a39c43Smrg# AM_SUBST_NOTMAKE(VARIABLE)
931a9a39c43Smrg# ---------------------------
932a9a39c43Smrg# Public sister of _AM_SUBST_NOTMAKE.
933a9a39c43SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
934a9a39c43Smrg
935a9a39c43Smrg# Check how to create a tarball.                            -*- Autoconf -*-
936a9a39c43Smrg
937a9a39c43Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
938a9a39c43Smrg#
939a9a39c43Smrg# This file is free software; the Free Software Foundation
940a9a39c43Smrg# gives unlimited permission to copy and/or distribute it,
941a9a39c43Smrg# with or without modifications, as long as this notice is preserved.
942129be1b7Smrg
943a9a39c43Smrg# serial 2
944a9a39c43Smrg
945a9a39c43Smrg# _AM_PROG_TAR(FORMAT)
946a9a39c43Smrg# --------------------
947a9a39c43Smrg# Check how to create a tarball in format FORMAT.
948a9a39c43Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
949a9a39c43Smrg#
950a9a39c43Smrg# Substitute a variable $(am__tar) that is a command
951a9a39c43Smrg# writing to stdout a FORMAT-tarball containing the directory
952a9a39c43Smrg# $tardir.
953a9a39c43Smrg#     tardir=directory && $(am__tar) > result.tar
954a9a39c43Smrg#
955a9a39c43Smrg# Substitute a variable $(am__untar) that extract such
956a9a39c43Smrg# a tarball read from stdin.
957a9a39c43Smrg#     $(am__untar) < result.tar
958a9a39c43SmrgAC_DEFUN([_AM_PROG_TAR],
959a9a39c43Smrg[# Always define AMTAR for backward compatibility.
960a9a39c43SmrgAM_MISSING_PROG([AMTAR], [tar])
961a9a39c43Smrgm4_if([$1], [v7],
962a9a39c43Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
963a9a39c43Smrg     [m4_case([$1], [ustar],, [pax],,
964a9a39c43Smrg              [m4_fatal([Unknown tar format])])
965a9a39c43SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
966a9a39c43Smrg# Loop over all known methods to create a tar archive until one works.
967a9a39c43Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
968a9a39c43Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
969a9a39c43Smrg# Do not fold the above two line into one, because Tru64 sh and
970a9a39c43Smrg# Solaris sh will not grok spaces in the rhs of `-'.
971a9a39c43Smrgfor _am_tool in $_am_tools
972a9a39c43Smrgdo
973a9a39c43Smrg  case $_am_tool in
974a9a39c43Smrg  gnutar)
975a9a39c43Smrg    for _am_tar in tar gnutar gtar;
976a9a39c43Smrg    do
977a9a39c43Smrg      AM_RUN_LOG([$_am_tar --version]) && break
978a9a39c43Smrg    done
979a9a39c43Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
980a9a39c43Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
981a9a39c43Smrg    am__untar="$_am_tar -xf -"
982a9a39c43Smrg    ;;
983a9a39c43Smrg  plaintar)
984a9a39c43Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
985a9a39c43Smrg    # ustar tarball either.
986a9a39c43Smrg    (tar --version) >/dev/null 2>&1 && continue
987a9a39c43Smrg    am__tar='tar chf - "$$tardir"'
988a9a39c43Smrg    am__tar_='tar chf - "$tardir"'
989a9a39c43Smrg    am__untar='tar xf -'
990a9a39c43Smrg    ;;
991a9a39c43Smrg  pax)
992a9a39c43Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
993a9a39c43Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
994a9a39c43Smrg    am__untar='pax -r'
995a9a39c43Smrg    ;;
996a9a39c43Smrg  cpio)
997a9a39c43Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
998a9a39c43Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
999a9a39c43Smrg    am__untar='cpio -i -H $1 -d'
1000a9a39c43Smrg    ;;
1001a9a39c43Smrg  none)
1002a9a39c43Smrg    am__tar=false
1003a9a39c43Smrg    am__tar_=false
1004a9a39c43Smrg    am__untar=false
1005a9a39c43Smrg    ;;
1006a9a39c43Smrg  esac
1007129be1b7Smrg
1008a9a39c43Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
1009a9a39c43Smrg  # and am__untar set.
1010a9a39c43Smrg  test -n "${am_cv_prog_tar_$1}" && break
1011129be1b7Smrg
1012a9a39c43Smrg  # tar/untar a dummy directory, and stop if the command works
1013a9a39c43Smrg  rm -rf conftest.dir
1014a9a39c43Smrg  mkdir conftest.dir
1015a9a39c43Smrg  echo GrepMe > conftest.dir/file
1016a9a39c43Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1017a9a39c43Smrg  rm -rf conftest.dir
1018a9a39c43Smrg  if test -s conftest.tar; then
1019a9a39c43Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
1020a9a39c43Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1021129be1b7Smrg  fi
1022129be1b7Smrgdone
1023a9a39c43Smrgrm -rf conftest.dir
1024129be1b7Smrg
1025a9a39c43SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1026a9a39c43SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1027a9a39c43SmrgAC_SUBST([am__tar])
1028a9a39c43SmrgAC_SUBST([am__untar])
1029a9a39c43Smrg]) # _AM_PROG_TAR
1030129be1b7Smrg
1031a9a39c43Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1032a9a39c43Smrgdnl
1033a9a39c43Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1034a9a39c43Smrgdnl 
1035a9a39c43Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1036a9a39c43Smrgdnl copy of this software and associated documentation files (the
1037a9a39c43Smrgdnl "Software"), to deal in the Software without restriction, including
1038a9a39c43Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
1039a9a39c43Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
1040a9a39c43Smrgdnl to whom the Software is furnished to do so, provided that the above
1041a9a39c43Smrgdnl copyright notice(s) and this permission notice appear in all copies of
1042a9a39c43Smrgdnl the Software and that both the above copyright notice(s) and this
1043a9a39c43Smrgdnl permission notice appear in supporting documentation.
1044a9a39c43Smrgdnl
1045a9a39c43Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1046a9a39c43Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1047a9a39c43Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1048a9a39c43Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1049a9a39c43Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1050a9a39c43Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1051a9a39c43Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1052a9a39c43Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1053a9a39c43Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1054a9a39c43Smrgdnl
1055a9a39c43Smrgdnl Except as contained in this notice, the name of a copyright holder
1056a9a39c43Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
1057a9a39c43Smrgdnl or other dealings in this Software without prior written authorization
1058a9a39c43Smrgdnl of the copyright holder.
1059a9a39c43Smrg
1060a9a39c43Smrg# XORG_MACROS_VERSION(required-version)
1061a9a39c43Smrg# -------------------------------------
1062a9a39c43Smrg# Minimum version: 1.1.0
1063129be1b7Smrg#
1064a9a39c43Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1065a9a39c43Smrg# your configure.ac with the minimum required version, such as:
1066a9a39c43Smrg# XORG_MACROS_VERSION(1.1)
1067a9a39c43Smrg#
1068a9a39c43Smrg# To ensure that this macro is defined, also add:
1069a9a39c43Smrg# m4_ifndef([XORG_MACROS_VERSION],
1070a9a39c43Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1071a9a39c43Smrg#
1072a9a39c43Smrg#
1073a9a39c43Smrg# See the "minimum version" comment for each macro you use to see what 
1074a9a39c43Smrg# version you require.
1075a9a39c43Smrgm4_defun([XORG_MACROS_VERSION],[
1076a9a39c43Smrgm4_define([vers_have], [1.3.0])
1077a9a39c43Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1078a9a39c43Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1079a9a39c43Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1080a9a39c43Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1081a9a39c43Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1082a9a39c43Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1083a9a39c43Smrgm4_undefine([vers_have])
1084a9a39c43Smrgm4_undefine([maj_have])
1085a9a39c43Smrgm4_undefine([maj_needed])
1086a9a39c43Smrg]) # XORG_MACROS_VERSION
1087a9a39c43Smrg
1088a9a39c43Smrg# XORG_PROG_RAWCPP()
1089a9a39c43Smrg# ------------------
1090a9a39c43Smrg# Minimum version: 1.0.0
1091a9a39c43Smrg#
1092a9a39c43Smrg# Find cpp program and necessary flags for use in pre-processing text files
1093a9a39c43Smrg# such as man pages and config files
1094a9a39c43SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1095a9a39c43SmrgAC_REQUIRE([AC_PROG_CPP])
1096a9a39c43SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1097a9a39c43Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1098a9a39c43Smrg
1099a9a39c43Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1100a9a39c43Smrg# which is not the best choice for supporting other OS'es, but covers most
1101a9a39c43Smrg# of the ones we need for now.
1102a9a39c43SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1103a9a39c43SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1104a9a39c43Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1105a9a39c43Smrg	AC_MSG_RESULT([no])
1106a9a39c43Smrgelse
1107a9a39c43Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1108a9a39c43Smrg		RAWCPPFLAGS=-undef
1109a9a39c43Smrg		AC_MSG_RESULT([yes])
1110a9a39c43Smrg	# under Cygwin unix is still defined even with -undef
1111a9a39c43Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1112a9a39c43Smrg		RAWCPPFLAGS="-undef -ansi"
1113a9a39c43Smrg		AC_MSG_RESULT([yes, with -ansi])
1114a9a39c43Smrg	else
1115a9a39c43Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1116a9a39c43Smrg	fi
1117a9a39c43Smrgfi
1118a9a39c43Smrgrm -f conftest.$ac_ext
1119a9a39c43Smrg
1120a9a39c43SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1121a9a39c43SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1122a9a39c43Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1123a9a39c43Smrg	AC_MSG_RESULT([no])
1124a9a39c43Smrgelse
1125a9a39c43Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1126a9a39c43Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1127a9a39c43Smrg		AC_MSG_RESULT([yes])
1128a9a39c43Smrg	else
1129a9a39c43Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1130a9a39c43Smrg	fi
1131a9a39c43Smrgfi
1132a9a39c43Smrgrm -f conftest.$ac_ext
1133a9a39c43SmrgAC_SUBST(RAWCPPFLAGS)
1134a9a39c43Smrg]) # XORG_PROG_RAWCPP
1135129be1b7Smrg
1136a9a39c43Smrg# XORG_MANPAGE_SECTIONS()
1137a9a39c43Smrg# -----------------------
1138a9a39c43Smrg# Minimum version: 1.0.0
1139a9a39c43Smrg#
1140a9a39c43Smrg# Determine which sections man pages go in for the different man page types
1141a9a39c43Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1142a9a39c43Smrg# Not sure if there's any better way than just hardcoding by OS name.
1143a9a39c43Smrg# Override default settings by setting environment variables
1144129be1b7Smrg
1145a9a39c43SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1146a9a39c43SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1147129be1b7Smrg
1148a9a39c43Smrgif test x$APP_MAN_SUFFIX = x    ; then
1149a9a39c43Smrg    APP_MAN_SUFFIX=1
1150a9a39c43Smrgfi
1151a9a39c43Smrgif test x$APP_MAN_DIR = x    ; then
1152a9a39c43Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1153a9a39c43Smrgfi
1154129be1b7Smrg
1155a9a39c43Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1156a9a39c43Smrg    LIB_MAN_SUFFIX=3
1157a9a39c43Smrgfi
1158a9a39c43Smrgif test x$LIB_MAN_DIR = x    ; then
1159a9a39c43Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1160a9a39c43Smrgfi
1161129be1b7Smrg
1162a9a39c43Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1163a9a39c43Smrg    case $host_os in
1164a9a39c43Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1165a9a39c43Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1166a9a39c43Smrg    esac
1167a9a39c43Smrgfi
1168a9a39c43Smrgif test x$FILE_MAN_DIR = x    ; then
1169a9a39c43Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1170a9a39c43Smrgfi
1171129be1b7Smrg
1172a9a39c43Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1173a9a39c43Smrg    case $host_os in
1174a9a39c43Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1175a9a39c43Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1176a9a39c43Smrg    esac
1177a9a39c43Smrgfi
1178a9a39c43Smrgif test x$MISC_MAN_DIR = x    ; then
1179a9a39c43Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1180a9a39c43Smrgfi
1181129be1b7Smrg
1182a9a39c43Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1183a9a39c43Smrg    case $host_os in
1184a9a39c43Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1185a9a39c43Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1186a9a39c43Smrg    esac
1187129be1b7Smrgfi
1188a9a39c43Smrgif test x$DRIVER_MAN_DIR = x    ; then
1189a9a39c43Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1190129be1b7Smrgfi
1191129be1b7Smrg
1192a9a39c43Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1193a9a39c43Smrg    case $host_os in
1194a9a39c43Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1195a9a39c43Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1196a9a39c43Smrg    esac
1197a9a39c43Smrgfi
1198a9a39c43Smrgif test x$ADMIN_MAN_DIR = x    ; then
1199a9a39c43Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1200a9a39c43Smrgfi
1201129be1b7Smrg
1202129be1b7Smrg
1203a9a39c43SmrgAC_SUBST([APP_MAN_SUFFIX])
1204a9a39c43SmrgAC_SUBST([LIB_MAN_SUFFIX])
1205a9a39c43SmrgAC_SUBST([FILE_MAN_SUFFIX])
1206a9a39c43SmrgAC_SUBST([MISC_MAN_SUFFIX])
1207a9a39c43SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1208a9a39c43SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1209a9a39c43SmrgAC_SUBST([APP_MAN_DIR])
1210a9a39c43SmrgAC_SUBST([LIB_MAN_DIR])
1211a9a39c43SmrgAC_SUBST([FILE_MAN_DIR])
1212a9a39c43SmrgAC_SUBST([MISC_MAN_DIR])
1213a9a39c43SmrgAC_SUBST([DRIVER_MAN_DIR])
1214a9a39c43SmrgAC_SUBST([ADMIN_MAN_DIR])
1215a9a39c43Smrg]) # XORG_MANPAGE_SECTIONS
1216a9a39c43Smrg
1217a9a39c43Smrg# XORG_CHECK_LINUXDOC
1218a9a39c43Smrg# -------------------
1219a9a39c43Smrg# Minimum version: 1.0.0
1220a9a39c43Smrg#
1221a9a39c43Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1222a9a39c43Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1223a9a39c43Smrg# Whether or not the necessary tools and files are found can be checked
1224a9a39c43Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1225a9a39c43SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1226a9a39c43Smrgif test x$XORG_SGML_PATH = x ; then
1227a9a39c43Smrg    XORG_SGML_PATH=$prefix/share/sgml
1228a9a39c43Smrgfi
1229a9a39c43SmrgHAVE_DEFS_ENT=
1230129be1b7Smrg
1231a9a39c43Smrgif test x"$cross_compiling" = x"yes" ; then
1232a9a39c43Smrg  HAVE_DEFS_ENT=no
1233a9a39c43Smrgelse
1234a9a39c43Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1235a9a39c43Smrgfi
1236129be1b7Smrg
1237a9a39c43SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1238a9a39c43SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1239129be1b7Smrg
1240a9a39c43SmrgAC_MSG_CHECKING([Whether to build documentation])
1241129be1b7Smrg
1242a9a39c43Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1243a9a39c43Smrg   BUILDDOC=yes
1244a9a39c43Smrgelse
1245a9a39c43Smrg   BUILDDOC=no
1246a9a39c43Smrgfi
1247129be1b7Smrg
1248a9a39c43SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1249a9a39c43Smrg
1250a9a39c43SmrgAC_MSG_RESULT([$BUILDDOC])
1251a9a39c43Smrg
1252a9a39c43SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1253a9a39c43Smrg
1254a9a39c43Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1255a9a39c43Smrg   BUILDPDFDOC=yes
1256129be1b7Smrgelse
1257a9a39c43Smrg   BUILDPDFDOC=no
1258129be1b7Smrgfi
1259129be1b7Smrg
1260a9a39c43SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1261129be1b7Smrg
1262a9a39c43SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1263129be1b7Smrg
1264a9a39c43SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1265a9a39c43SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1266a9a39c43SmrgMAKE_PDF="$PS2PDF"
1267a9a39c43SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1268129be1b7Smrg
1269a9a39c43SmrgAC_SUBST(MAKE_TEXT)
1270a9a39c43SmrgAC_SUBST(MAKE_PS)
1271a9a39c43SmrgAC_SUBST(MAKE_PDF)
1272a9a39c43SmrgAC_SUBST(MAKE_HTML)
1273a9a39c43Smrg]) # XORG_CHECK_LINUXDOC
1274129be1b7Smrg
1275a9a39c43Smrg# XORG_CHECK_DOCBOOK
1276a9a39c43Smrg# -------------------
1277a9a39c43Smrg# Minimum version: 1.0.0
1278a9a39c43Smrg#
1279a9a39c43Smrg# Checks for the ability to build output formats from SGML DocBook source.
1280a9a39c43Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1281a9a39c43Smrg# indicates whether the necessary tools and files are found and, if set,
1282a9a39c43Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1283a9a39c43SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1284a9a39c43Smrgif test x$XORG_SGML_PATH = x ; then
1285a9a39c43Smrg    XORG_SGML_PATH=$prefix/share/sgml
1286a9a39c43Smrgfi
1287a9a39c43SmrgHAVE_DEFS_ENT=
1288a9a39c43SmrgBUILDTXTDOC=no
1289a9a39c43SmrgBUILDPDFDOC=no
1290a9a39c43SmrgBUILDPSDOC=no
1291a9a39c43SmrgBUILDHTMLDOC=no
1292a9a39c43Smrg
1293a9a39c43SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1294a9a39c43Smrg
1295a9a39c43SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1296a9a39c43SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1297a9a39c43SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1298a9a39c43SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1299a9a39c43Smrg
1300a9a39c43SmrgAC_MSG_CHECKING([Whether to build text documentation])
1301a9a39c43Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1302a9a39c43Smrg   test x$BUILD_TXTDOC != xno; then
1303a9a39c43Smrg	BUILDTXTDOC=yes
1304a9a39c43Smrgfi
1305a9a39c43SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1306a9a39c43SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1307129be1b7Smrg
1308a9a39c43SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
1309a9a39c43Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1310a9a39c43Smrg   test x$BUILD_PDFDOC != xno; then
1311a9a39c43Smrg	BUILDPDFDOC=yes
1312a9a39c43Smrgfi
1313a9a39c43SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1314a9a39c43SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1315129be1b7Smrg
1316a9a39c43SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
1317a9a39c43Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1318a9a39c43Smrg   test x$BUILD_PSDOC != xno; then
1319a9a39c43Smrg	BUILDPSDOC=yes
1320a9a39c43Smrgfi
1321a9a39c43SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1322a9a39c43SmrgAC_MSG_RESULT([$BUILDPSDOC])
1323129be1b7Smrg
1324a9a39c43SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
1325a9a39c43Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1326a9a39c43Smrg   test x$BUILD_HTMLDOC != xno; then
1327a9a39c43Smrg	BUILDHTMLDOC=yes
1328a9a39c43Smrgfi
1329a9a39c43SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1330a9a39c43SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1331129be1b7Smrg
1332a9a39c43SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1333a9a39c43SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1334a9a39c43SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1335a9a39c43SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1336129be1b7Smrg
1337a9a39c43SmrgAC_SUBST(MAKE_TEXT)
1338a9a39c43SmrgAC_SUBST(MAKE_PS)
1339a9a39c43SmrgAC_SUBST(MAKE_PDF)
1340a9a39c43SmrgAC_SUBST(MAKE_HTML)
1341a9a39c43Smrg]) # XORG_CHECK_DOCBOOK
1342129be1b7Smrg
1343a9a39c43Smrg# XORG_CHECK_MALLOC_ZERO
1344a9a39c43Smrg# ----------------------
1345a9a39c43Smrg# Minimum version: 1.0.0
1346a9a39c43Smrg#
1347a9a39c43Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1348a9a39c43Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1349a9a39c43Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1350a9a39c43SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1351a9a39c43SmrgAC_ARG_ENABLE(malloc0returnsnull,
1352a9a39c43Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1353a9a39c43Smrg		       [malloc(0) returns NULL (default: auto)]),
1354a9a39c43Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1355a9a39c43Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1356a9a39c43Smrg
1357a9a39c43SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1358a9a39c43Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1359a9a39c43Smrg	AC_RUN_IFELSE([
1360a9a39c43Smrgchar *malloc();
1361a9a39c43Smrgchar *realloc();
1362a9a39c43Smrgchar *calloc();
1363a9a39c43Smrgmain() {
1364a9a39c43Smrg    char *m0, *r0, *c0, *p;
1365a9a39c43Smrg    m0 = malloc(0);
1366a9a39c43Smrg    p = malloc(10);
1367a9a39c43Smrg    r0 = realloc(p,0);
1368a9a39c43Smrg    c0 = calloc(0);
1369a9a39c43Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1370a9a39c43Smrg}],
1371a9a39c43Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1372a9a39c43Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
1373a9a39c43Smrgfi
1374a9a39c43SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1375129be1b7Smrg
1376a9a39c43Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1377a9a39c43Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1378a9a39c43Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1379a9a39c43Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1380a9a39c43Smrgelse
1381a9a39c43Smrg	MALLOC_ZERO_CFLAGS=""
1382a9a39c43Smrg	XMALLOC_ZERO_CFLAGS=""
1383a9a39c43Smrg	XTMALLOC_ZERO_CFLAGS=""
1384a9a39c43Smrgfi
1385129be1b7Smrg
1386a9a39c43SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1387a9a39c43SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1388a9a39c43SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1389a9a39c43Smrg]) # XORG_CHECK_MALLOC_ZERO
1390129be1b7Smrg
1391a9a39c43Smrg# XORG_WITH_LINT()
1392a9a39c43Smrg# ----------------
1393a9a39c43Smrg# Minimum version: 1.1.0
1394a9a39c43Smrg#
1395a9a39c43Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
1396a9a39c43Smrg# is specified.   (Use --with-lint=sparse for sparse.)
1397a9a39c43Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1398a9a39c43Smrg# Sets $LINT_FLAGS to flags to pass to source checker
1399a9a39c43Smrg# Sets LINT automake conditional if enabled (default: disabled)
1400a9a39c43Smrg#
1401a9a39c43SmrgAC_DEFUN([XORG_WITH_LINT],[
1402a9a39c43Smrg
1403a9a39c43Smrg# Allow checking code with lint, sparse, etc.
1404a9a39c43SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1405a9a39c43Smrg		[Use a lint-style source code checker (default: disabled)])],
1406a9a39c43Smrg		[use_lint=$withval], [use_lint=no])
1407a9a39c43Smrgif test "x$use_lint" = "xyes" ; then
1408a9a39c43Smrg	LINT="lint"
1409a9a39c43Smrgelse
1410a9a39c43Smrg	LINT="$use_lint"
1411a9a39c43Smrgfi
1412a9a39c43Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1413a9a39c43Smrg    case $LINT in
1414a9a39c43Smrg	lint|*/lint)
1415a9a39c43Smrg	    case $host_os in
1416a9a39c43Smrg		solaris*)
1417a9a39c43Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1418a9a39c43Smrg			;;
1419a9a39c43Smrg	    esac
1420a9a39c43Smrg	    ;;
1421a9a39c43Smrg    esac
1422a9a39c43Smrgfi
1423129be1b7Smrg
1424a9a39c43SmrgAC_SUBST(LINT)
1425a9a39c43SmrgAC_SUBST(LINT_FLAGS)
1426a9a39c43SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
1427129be1b7Smrg
1428a9a39c43Smrg]) # XORG_WITH_LINT
1429a9a39c43Smrg
1430a9a39c43Smrg# XORG_LINT_LIBRARY(LIBNAME)
1431a9a39c43Smrg# --------------------------
1432a9a39c43Smrg# Minimum version: 1.1.0
1433a9a39c43Smrg#
1434a9a39c43Smrg# Sets up flags for building lint libraries for checking programs that call
1435a9a39c43Smrg# functions in the library.
1436a9a39c43Smrg# Disabled by default, enable with --enable-lint-library
1437a9a39c43Smrg# Sets: 
1438a9a39c43Smrg#	@LINTLIB@		- name of lint library file to make
1439a9a39c43Smrg#	MAKE_LINT_LIB		- automake conditional
1440a9a39c43Smrg#
1441a9a39c43Smrg
1442a9a39c43SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1443a9a39c43SmrgAC_REQUIRE([XORG_WITH_LINT])
1444a9a39c43Smrg# Build lint "library" for more indepth checks of programs calling this library
1445a9a39c43SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1446a9a39c43Smrg	[Create lint library (default: disabled)])],
1447a9a39c43Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1448a9a39c43Smrgif test "x$make_lint_lib" != "xno" ; then
1449a9a39c43Smrg	if test "x$LINT" = "xno" ; then
1450a9a39c43Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1451a9a39c43Smrg	fi
1452a9a39c43Smrg	if test "x$make_lint_lib" = "xyes" ; then
1453a9a39c43Smrg		LINTLIB=llib-l$1.ln
1454a9a39c43Smrg	else
1455a9a39c43Smrg		LINTLIB=$make_lint_lib
1456a9a39c43Smrg	fi
1457a9a39c43Smrgfi
1458a9a39c43SmrgAC_SUBST(LINTLIB)
1459a9a39c43SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1460a9a39c43Smrg
1461a9a39c43Smrg]) # XORG_LINT_LIBRARY
1462a9a39c43Smrg
1463a9a39c43Smrg# XORG_CWARNFLAGS
1464a9a39c43Smrg# ---------------
1465a9a39c43Smrg# Minimum version: 1.2.0
1466a9a39c43Smrg#
1467a9a39c43Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1468a9a39c43Smrg#
1469a9a39c43SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1470a9a39c43SmrgAC_REQUIRE([AC_PROG_CC])
1471a9a39c43Smrgif  test "x$GCC" = xyes ; then
1472a9a39c43Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1473a9a39c43Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1474a9a39c43Smrg-Wbad-function-cast"
1475a9a39c43Smrg    case `$CC -dumpversion` in
1476a9a39c43Smrg    3.4.* | 4.*)
1477a9a39c43Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1478a9a39c43Smrg	;;
1479a9a39c43Smrg    esac
1480a9a39c43Smrgelse
1481a9a39c43Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1482a9a39c43Smrg    if test "x$SUNCC" = "xyes"; then
1483a9a39c43Smrg	CWARNFLAGS="-v"
1484a9a39c43Smrg    fi
1485a9a39c43Smrgfi
1486a9a39c43SmrgAC_SUBST(CWARNFLAGS)
1487a9a39c43Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
1488a9a39c43Smrg]) # XORG_CWARNFLAGS
1489a9a39c43Smrg
1490a9a39c43Smrg# XORG_STRICT_OPTION
1491a9a39c43Smrg# -----------------------
1492a9a39c43Smrg# Minimum version: 1.3.0
1493a9a39c43Smrg#
1494a9a39c43Smrg# Add configure option to enable strict compilation
1495a9a39c43SmrgAC_DEFUN([XORG_STRICT_OPTION], [
1496a9a39c43SmrgAC_REQUIRE([AC_PROG_CC])
1497a9a39c43SmrgAC_REQUIRE([AC_PROG_CC_C99])
1498a9a39c43SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1499a9a39c43Smrg
1500a9a39c43SmrgAC_ARG_ENABLE(strict-compilation,
1501a9a39c43Smrg			  AS_HELP_STRING([--enable-strict-compilation],
1502a9a39c43Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1503a9a39c43Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1504a9a39c43Smrgif test "x$STRICT_COMPILE" = "xyes"; then
1505a9a39c43Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1506a9a39c43Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1507a9a39c43Smrg	if test "x$GCC" = xyes ; then
1508a9a39c43Smrg		STRICT_CFLAGS="-pedantic -Werror"
1509a9a39c43Smrg	elif test "x$SUNCC" = "xyes"; then
1510a9a39c43Smrg		STRICT_CFLAGS="-errwarn"
1511a9a39c43Smrg    elif test "x$INTELCC" = "xyes"; then
1512a9a39c43Smrg		STRICT_CFLAGS="-Werror"
1513a9a39c43Smrg	fi
1514a9a39c43Smrgfi
1515a9a39c43SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1516a9a39c43SmrgAC_SUBST([CWARNFLAGS])
1517a9a39c43Smrg]) # XORG_STRICT_OPTION
1518129be1b7Smrg
1519a9a39c43Smrg# XORG_DEFAULT_OPTIONS
1520a9a39c43Smrg# --------------------
1521a9a39c43Smrg# Minimum version: 1.3.0
1522a9a39c43Smrg#
1523a9a39c43Smrg# Defines default options for X.Org modules.
1524a9a39c43Smrg#
1525a9a39c43SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1526a9a39c43SmrgXORG_CWARNFLAGS
1527a9a39c43SmrgXORG_STRICT_OPTION
1528a9a39c43SmrgXORG_RELEASE_VERSION
1529a9a39c43SmrgXORG_CHANGELOG
1530a9a39c43SmrgXORG_MANPAGE_SECTIONS
1531a9a39c43Smrg]) # XORG_DEFAULT_OPTIONS
1532129be1b7Smrgdnl Copyright 2005 Red Hat, Inc
1533129be1b7Smrgdnl
1534129be1b7Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1535129be1b7Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1536129be1b7Smrgdnl the above copyright notice appear in all copies and that both that
1537129be1b7Smrgdnl copyright notice and this permission notice appear in supporting
1538129be1b7Smrgdnl documentation.
1539129be1b7Smrgdnl
1540129be1b7Smrgdnl The above copyright notice and this permission notice shall be included
1541129be1b7Smrgdnl in all copies or substantial portions of the Software.
1542129be1b7Smrgdnl
1543129be1b7Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1544129be1b7Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1545129be1b7Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1546129be1b7Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1547129be1b7Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1548129be1b7Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1549129be1b7Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1550129be1b7Smrgdnl
1551129be1b7Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1552129be1b7Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1553129be1b7Smrgdnl other dealings in this Software without prior written authorization
1554129be1b7Smrgdnl from the copyright holders.
1555129be1b7Smrgdnl
1556129be1b7Smrg
1557129be1b7Smrg# XORG_RELEASE_VERSION
1558129be1b7Smrg# --------------------
1559129be1b7Smrg# Adds --with/without-release-string and changes the PACKAGE and
1560129be1b7Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1561a9a39c43Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1562a9a39c43Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1563129be1b7Smrg 
1564129be1b7SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1565129be1b7Smrg	AC_ARG_WITH(release-version,
1566a9a39c43Smrg			AS_HELP_STRING([--with-release-version=STRING],
1567129be1b7Smrg				[Use release version string in package name]),
1568129be1b7Smrg			[RELEASE_VERSION="$withval"],
1569129be1b7Smrg			[RELEASE_VERSION=""])
1570129be1b7Smrg	if test "x$RELEASE_VERSION" != "x"; then
1571129be1b7Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1572129be1b7Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1573129be1b7Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1574129be1b7Smrg	fi
1575a9a39c43Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1576a9a39c43Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1577a9a39c43Smrg		[Major version of this package])
1578a9a39c43Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1579a9a39c43Smrg	if test "x$PVM" = "x"; then
1580a9a39c43Smrg		PVM="0"
1581a9a39c43Smrg	fi
1582a9a39c43Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1583a9a39c43Smrg		[$PVM],
1584a9a39c43Smrg		[Minor version of this package])
1585a9a39c43Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1586a9a39c43Smrg	if test "x$PVP" = "x"; then
1587a9a39c43Smrg		PVP="0"
1588a9a39c43Smrg	fi
1589a9a39c43Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1590a9a39c43Smrg		[$PVP],
1591a9a39c43Smrg		[Patch version of this package])
1592129be1b7Smrg])
1593129be1b7Smrg
1594a9a39c43Smrg# XORG_CHANGELOG()
1595a9a39c43Smrg# ----------------
1596a9a39c43Smrg# Minimum version: 1.2.0
1597a9a39c43Smrg#
1598a9a39c43Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1599a9a39c43Smrg# ChangeLog from git.
1600a9a39c43Smrg#
1601a9a39c43Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1602a9a39c43Smrg#
1603a9a39c43SmrgAC_DEFUN([XORG_CHANGELOG], [
1604a9a39c43SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
1605a9a39c43Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
1606a9a39c43Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1607a9a39c43SmrgAC_SUBST([CHANGELOG_CMD])
1608a9a39c43SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
1609a9a39c43Smrg]) # XORG_CHANGELOG
1610a9a39c43Smrg
1611