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