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