aclocal.m4 revision 123e2cc7
1123e2cc7Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
27da8b7e3Smrg
37da8b7e3Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4123e2cc7Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
57da8b7e3Smrg# This file is free software; the Free Software Foundation
67da8b7e3Smrg# gives unlimited permission to copy and/or distribute it,
77da8b7e3Smrg# with or without modifications, as long as this notice is preserved.
87da8b7e3Smrg
97da8b7e3Smrg# This program is distributed in the hope that it will be useful,
107da8b7e3Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
117da8b7e3Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
127da8b7e3Smrg# PARTICULAR PURPOSE.
137da8b7e3Smrg
14123e2cc7Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15123e2cc7Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16123e2cc7Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17123e2cc7Smrg[m4_warning([this file was generated for autoconf 2.63.
18123e2cc7SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19123e2cc7SmrgIf you have problems, you may need to regenerate the build system entirely.
20123e2cc7SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
217da8b7e3Smrg
22123e2cc7Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
237da8b7e3Smrg#
24123e2cc7Smrg# This file is free software; the Free Software Foundation
25123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
26123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
277da8b7e3Smrg
28123e2cc7Smrg# AM_AUTOMAKE_VERSION(VERSION)
29123e2cc7Smrg# ----------------------------
30123e2cc7Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31123e2cc7Smrg# generated from the m4 files accompanying Automake X.Y.
32123e2cc7Smrg# (This private macro should not be called outside this file.)
33123e2cc7SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34123e2cc7Smrg[am__api_version='1.11'
35123e2cc7Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36123e2cc7Smrgdnl require some minimum version.  Point them to the right macro.
37123e2cc7Smrgm4_if([$1], [1.11], [],
38123e2cc7Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39123e2cc7Smrg])
407da8b7e3Smrg
41123e2cc7Smrg# _AM_AUTOCONF_VERSION(VERSION)
427da8b7e3Smrg# -----------------------------
43123e2cc7Smrg# aclocal traces this macro to find the Autoconf version.
44123e2cc7Smrg# This is a private macro too.  Using m4_define simplifies
45123e2cc7Smrg# the logic in aclocal, which can simply ignore this definition.
46123e2cc7Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47123e2cc7Smrg
48123e2cc7Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49123e2cc7Smrg# -------------------------------
50123e2cc7Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51123e2cc7Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52123e2cc7SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53123e2cc7Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
54123e2cc7Smrgm4_ifndef([AC_AUTOCONF_VERSION],
55123e2cc7Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56123e2cc7Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
577da8b7e3Smrg
58123e2cc7Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
597da8b7e3Smrg
60123e2cc7Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61123e2cc7Smrg#
62123e2cc7Smrg# This file is free software; the Free Software Foundation
63123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
64123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
65123e2cc7Smrg
66123e2cc7Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67123e2cc7Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68123e2cc7Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
697da8b7e3Smrg#
70123e2cc7Smrg# Of course, Automake must honor this variable whenever it calls a
71123e2cc7Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72123e2cc7Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73123e2cc7Smrg# depending on how configure is run.  This is pretty annoying, since
74123e2cc7Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75123e2cc7Smrg# source directory, any form will work fine, but in subdirectories a
76123e2cc7Smrg# relative path needs to be adjusted first.
777da8b7e3Smrg#
78123e2cc7Smrg# $ac_aux_dir/missing
79123e2cc7Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80123e2cc7Smrg# $top_srcdir/$ac_aux_dir/missing
81123e2cc7Smrg#    fails if $ac_aux_dir is absolute,
82123e2cc7Smrg#    fails when called from a subdirectory in a VPATH build with
83123e2cc7Smrg#          a relative $ac_aux_dir
847da8b7e3Smrg#
85123e2cc7Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86123e2cc7Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
87123e2cc7Smrg# harmless because $srcdir is `.', but things will broke when you
88123e2cc7Smrg# start a VPATH build or use an absolute $srcdir.
897da8b7e3Smrg#
90123e2cc7Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91123e2cc7Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92123e2cc7Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93123e2cc7Smrg# and then we would define $MISSING as
94123e2cc7Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95123e2cc7Smrg# This will work as long as MISSING is not called from configure, because
96123e2cc7Smrg# unfortunately $(top_srcdir) has no meaning in configure.
97123e2cc7Smrg# However there are other variables, like CC, which are often used in
98123e2cc7Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99123e2cc7Smrg#
100123e2cc7Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
101123e2cc7Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
102123e2cc7Smrg# configured tree to be moved without reconfiguration.
1037da8b7e3Smrg
104123e2cc7SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105123e2cc7Smrg[dnl Rely on autoconf to set up CDPATH properly.
106123e2cc7SmrgAC_PREREQ([2.50])dnl
107123e2cc7Smrg# expand $ac_aux_dir to an absolute path
108123e2cc7Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
109123e2cc7Smrg])
1107da8b7e3Smrg
111123e2cc7Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1127da8b7e3Smrg
113123e2cc7Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114123e2cc7Smrg# Free Software Foundation, Inc.
115123e2cc7Smrg#
116123e2cc7Smrg# This file is free software; the Free Software Foundation
117123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
118123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
1197da8b7e3Smrg
120123e2cc7Smrg# serial 9
1217da8b7e3Smrg
122123e2cc7Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123123e2cc7Smrg# -------------------------------------
124123e2cc7Smrg# Define a conditional.
125123e2cc7SmrgAC_DEFUN([AM_CONDITIONAL],
126123e2cc7Smrg[AC_PREREQ(2.52)dnl
127123e2cc7Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128123e2cc7Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129123e2cc7SmrgAC_SUBST([$1_TRUE])dnl
130123e2cc7SmrgAC_SUBST([$1_FALSE])dnl
131123e2cc7Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132123e2cc7Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133123e2cc7Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134123e2cc7Smrgif $2; then
135123e2cc7Smrg  $1_TRUE=
136123e2cc7Smrg  $1_FALSE='#'
137123e2cc7Smrgelse
138123e2cc7Smrg  $1_TRUE='#'
139123e2cc7Smrg  $1_FALSE=
140123e2cc7Smrgfi
141123e2cc7SmrgAC_CONFIG_COMMANDS_PRE(
142123e2cc7Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143123e2cc7Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144123e2cc7SmrgUsually this means the macro was only invoked conditionally.]])
145123e2cc7Smrgfi])])
1467da8b7e3Smrg
147123e2cc7Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148123e2cc7Smrg# Free Software Foundation, Inc.
149123e2cc7Smrg#
150123e2cc7Smrg# This file is free software; the Free Software Foundation
151123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
152123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
1537da8b7e3Smrg
154123e2cc7Smrg# serial 10
1557da8b7e3Smrg
156123e2cc7Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157123e2cc7Smrg# written in clear, in which case automake, when reading aclocal.m4,
158123e2cc7Smrg# will think it sees a *use*, and therefore will trigger all it's
159123e2cc7Smrg# C support machinery.  Also note that it means that autoscan, seeing
160123e2cc7Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1617da8b7e3Smrg
1627da8b7e3Smrg
163123e2cc7Smrg# _AM_DEPENDENCIES(NAME)
164123e2cc7Smrg# ----------------------
165123e2cc7Smrg# See how the compiler implements dependency checking.
166123e2cc7Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167123e2cc7Smrg# We try a few techniques and use that to set a single cache variable.
168123e2cc7Smrg#
169123e2cc7Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170123e2cc7Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171123e2cc7Smrg# dependency, and given that the user is not expected to run this macro,
172123e2cc7Smrg# just rely on AC_PROG_CC.
173123e2cc7SmrgAC_DEFUN([_AM_DEPENDENCIES],
174123e2cc7Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175123e2cc7SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176123e2cc7SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177123e2cc7SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1787da8b7e3Smrg
179123e2cc7Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180123e2cc7Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181123e2cc7Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182123e2cc7Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183123e2cc7Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184123e2cc7Smrg                   [depcc="$$1"   am_compiler_list=])
1857da8b7e3Smrg
186123e2cc7SmrgAC_CACHE_CHECK([dependency style of $depcc],
187123e2cc7Smrg               [am_cv_$1_dependencies_compiler_type],
188123e2cc7Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189123e2cc7Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
190123e2cc7Smrg  # making bogus files that we don't know about and never remove.  For
191123e2cc7Smrg  # instance it was reported that on HP-UX the gcc test will end up
192123e2cc7Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
193123e2cc7Smrg  # in D'.
194123e2cc7Smrg  mkdir conftest.dir
195123e2cc7Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196123e2cc7Smrg  # using a relative directory.
197123e2cc7Smrg  cp "$am_depcomp" conftest.dir
198123e2cc7Smrg  cd conftest.dir
199123e2cc7Smrg  # We will build objects and dependencies in a subdirectory because
200123e2cc7Smrg  # it helps to detect inapplicable dependency modes.  For instance
201123e2cc7Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202123e2cc7Smrg  # side effect of compilation, but ICC will put the dependencies in
203123e2cc7Smrg  # the current directory while Tru64 will put them in the object
204123e2cc7Smrg  # directory.
205123e2cc7Smrg  mkdir sub
2067da8b7e3Smrg
207123e2cc7Smrg  am_cv_$1_dependencies_compiler_type=none
208123e2cc7Smrg  if test "$am_compiler_list" = ""; then
209123e2cc7Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210123e2cc7Smrg  fi
211123e2cc7Smrg  am__universal=false
212123e2cc7Smrg  m4_case([$1], [CC],
213123e2cc7Smrg    [case " $depcc " in #(
214123e2cc7Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215123e2cc7Smrg     esac],
216123e2cc7Smrg    [CXX],
217123e2cc7Smrg    [case " $depcc " in #(
218123e2cc7Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219123e2cc7Smrg     esac])
2207da8b7e3Smrg
221123e2cc7Smrg  for depmode in $am_compiler_list; do
222123e2cc7Smrg    # Setup a source with many dependencies, because some compilers
223123e2cc7Smrg    # like to wrap large dependency lists on column 80 (with \), and
224123e2cc7Smrg    # we should not choose a depcomp mode which is confused by this.
225123e2cc7Smrg    #
226123e2cc7Smrg    # We need to recreate these files for each test, as the compiler may
227123e2cc7Smrg    # overwrite some of them when testing with obscure command lines.
228123e2cc7Smrg    # This happens at least with the AIX C compiler.
229123e2cc7Smrg    : > sub/conftest.c
230123e2cc7Smrg    for i in 1 2 3 4 5 6; do
231123e2cc7Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232123e2cc7Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233123e2cc7Smrg      # Solaris 8's {/usr,}/bin/sh.
234123e2cc7Smrg      touch sub/conftst$i.h
235123e2cc7Smrg    done
236123e2cc7Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237123e2cc7Smrg
238123e2cc7Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239123e2cc7Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240123e2cc7Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241123e2cc7Smrg    # versions had trouble with output in subdirs
242123e2cc7Smrg    am__obj=sub/conftest.${OBJEXT-o}
243123e2cc7Smrg    am__minus_obj="-o $am__obj"
244123e2cc7Smrg    case $depmode in
245123e2cc7Smrg    gcc)
246123e2cc7Smrg      # This depmode causes a compiler race in universal mode.
247123e2cc7Smrg      test "$am__universal" = false || continue
248123e2cc7Smrg      ;;
249123e2cc7Smrg    nosideeffect)
250123e2cc7Smrg      # after this tag, mechanisms are not by side-effect, so they'll
251123e2cc7Smrg      # only be used when explicitly requested
252123e2cc7Smrg      if test "x$enable_dependency_tracking" = xyes; then
253123e2cc7Smrg	continue
254123e2cc7Smrg      else
255123e2cc7Smrg	break
256123e2cc7Smrg      fi
257123e2cc7Smrg      ;;
258123e2cc7Smrg    msvisualcpp | msvcmsys)
259123e2cc7Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
260123e2cc7Smrg      # not run yet.  These depmodes are late enough in the game, and
261123e2cc7Smrg      # so weak that their functioning should not be impacted.
262123e2cc7Smrg      am__obj=conftest.${OBJEXT-o}
263123e2cc7Smrg      am__minus_obj=
264123e2cc7Smrg      ;;
265123e2cc7Smrg    none) break ;;
266123e2cc7Smrg    esac
267123e2cc7Smrg    if depmode=$depmode \
268123e2cc7Smrg       source=sub/conftest.c object=$am__obj \
269123e2cc7Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270123e2cc7Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271123e2cc7Smrg         >/dev/null 2>conftest.err &&
272123e2cc7Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273123e2cc7Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274123e2cc7Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275123e2cc7Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276123e2cc7Smrg      # icc doesn't choke on unknown options, it will just issue warnings
277123e2cc7Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
278123e2cc7Smrg      # that says an option was ignored or not supported.
279123e2cc7Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280123e2cc7Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281123e2cc7Smrg      # The diagnosis changed in icc 8.0:
282123e2cc7Smrg      #   icc: Command line remark: option '-MP' not supported
283123e2cc7Smrg      if (grep 'ignoring option' conftest.err ||
284123e2cc7Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285123e2cc7Smrg        am_cv_$1_dependencies_compiler_type=$depmode
286123e2cc7Smrg        break
287123e2cc7Smrg      fi
288123e2cc7Smrg    fi
289123e2cc7Smrg  done
290123e2cc7Smrg
291123e2cc7Smrg  cd ..
292123e2cc7Smrg  rm -rf conftest.dir
2937da8b7e3Smrgelse
294123e2cc7Smrg  am_cv_$1_dependencies_compiler_type=none
2957da8b7e3Smrgfi
296123e2cc7Smrg])
297123e2cc7SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298123e2cc7SmrgAM_CONDITIONAL([am__fastdep$1], [
299123e2cc7Smrg  test "x$enable_dependency_tracking" != xno \
300123e2cc7Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301123e2cc7Smrg])
3027da8b7e3Smrg
3037da8b7e3Smrg
304123e2cc7Smrg# AM_SET_DEPDIR
305123e2cc7Smrg# -------------
306123e2cc7Smrg# Choose a directory name for dependency files.
307123e2cc7Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308123e2cc7SmrgAC_DEFUN([AM_SET_DEPDIR],
309123e2cc7Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310123e2cc7SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311123e2cc7Smrg])
3127da8b7e3Smrg
3137da8b7e3Smrg
314123e2cc7Smrg# AM_DEP_TRACK
315123e2cc7Smrg# ------------
316123e2cc7SmrgAC_DEFUN([AM_DEP_TRACK],
317123e2cc7Smrg[AC_ARG_ENABLE(dependency-tracking,
318123e2cc7Smrg[  --disable-dependency-tracking  speeds up one-time build
319123e2cc7Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320123e2cc7Smrgif test "x$enable_dependency_tracking" != xno; then
321123e2cc7Smrg  am_depcomp="$ac_aux_dir/depcomp"
322123e2cc7Smrg  AMDEPBACKSLASH='\'
3237da8b7e3Smrgfi
324123e2cc7SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325123e2cc7SmrgAC_SUBST([AMDEPBACKSLASH])dnl
326123e2cc7Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327123e2cc7Smrg])
3287da8b7e3Smrg
329123e2cc7Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330123e2cc7Smrg
331123e2cc7Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332123e2cc7Smrg# Free Software Foundation, Inc.
333123e2cc7Smrg#
334123e2cc7Smrg# This file is free software; the Free Software Foundation
335123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
336123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
337123e2cc7Smrg
338123e2cc7Smrg#serial 5
339123e2cc7Smrg
340123e2cc7Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341123e2cc7Smrg# ------------------------------
342123e2cc7SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343123e2cc7Smrg[{
344123e2cc7Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345123e2cc7Smrg  # are listed without --file.  Let's play safe and only enable the eval
346123e2cc7Smrg  # if we detect the quoting.
347123e2cc7Smrg  case $CONFIG_FILES in
348123e2cc7Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
349123e2cc7Smrg  *)   set x $CONFIG_FILES ;;
350123e2cc7Smrg  esac
351123e2cc7Smrg  shift
352123e2cc7Smrg  for mf
353123e2cc7Smrg  do
354123e2cc7Smrg    # Strip MF so we end up with the name of the file.
355123e2cc7Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356123e2cc7Smrg    # Check whether this is an Automake generated Makefile or not.
357123e2cc7Smrg    # We used to match only the files named `Makefile.in', but
358123e2cc7Smrg    # some people rename them; so instead we look at the file content.
359123e2cc7Smrg    # Grep'ing the first line is not enough: some people post-process
360123e2cc7Smrg    # each Makefile.in and add a new line on top of each file to say so.
361123e2cc7Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
362123e2cc7Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
363123e2cc7Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364123e2cc7Smrg      dirpart=`AS_DIRNAME("$mf")`
365123e2cc7Smrg    else
366123e2cc7Smrg      continue
367123e2cc7Smrg    fi
368123e2cc7Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
369123e2cc7Smrg    # from the Makefile without running `make'.
370123e2cc7Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371123e2cc7Smrg    test -z "$DEPDIR" && continue
372123e2cc7Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373123e2cc7Smrg    test -z "am__include" && continue
374123e2cc7Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375123e2cc7Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
376123e2cc7Smrg    U=`sed -n 's/^U = //p' < "$mf"`
377123e2cc7Smrg    # Find all dependency output files, they are included files with
378123e2cc7Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379123e2cc7Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380123e2cc7Smrg    # expansion.
381123e2cc7Smrg    for file in `sed -n "
382123e2cc7Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383123e2cc7Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384123e2cc7Smrg      # Make sure the directory exists.
385123e2cc7Smrg      test -f "$dirpart/$file" && continue
386123e2cc7Smrg      fdir=`AS_DIRNAME(["$file"])`
387123e2cc7Smrg      AS_MKDIR_P([$dirpart/$fdir])
388123e2cc7Smrg      # echo "creating $dirpart/$file"
389123e2cc7Smrg      echo '# dummy' > "$dirpart/$file"
390123e2cc7Smrg    done
391123e2cc7Smrg  done
392123e2cc7Smrg}
393123e2cc7Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394123e2cc7Smrg
395123e2cc7Smrg
396123e2cc7Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397123e2cc7Smrg# -----------------------------
398123e2cc7Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
399123e2cc7Smrg#
400123e2cc7Smrg# This code is only required when automatic dependency tracking
401123e2cc7Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
402123e2cc7Smrg# need in order to bootstrap the dependency handling code.
403123e2cc7SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404123e2cc7Smrg[AC_CONFIG_COMMANDS([depfiles],
405123e2cc7Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406123e2cc7Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407123e2cc7Smrg])
408123e2cc7Smrg
409123e2cc7Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
410123e2cc7Smrg# Free Software Foundation, Inc.
411123e2cc7Smrg#
412123e2cc7Smrg# This file is free software; the Free Software Foundation
413123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
414123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
415123e2cc7Smrg
416123e2cc7Smrg# serial 8
417123e2cc7Smrg
418123e2cc7Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
419123e2cc7SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
420123e2cc7Smrg
421123e2cc7Smrg# Do all the work for Automake.                             -*- Autoconf -*-
422123e2cc7Smrg
423123e2cc7Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
424123e2cc7Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
425123e2cc7Smrg#
426123e2cc7Smrg# This file is free software; the Free Software Foundation
427123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
428123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
429123e2cc7Smrg
430123e2cc7Smrg# serial 16
431123e2cc7Smrg
432123e2cc7Smrg# This macro actually does too much.  Some checks are only needed if
433123e2cc7Smrg# your package does certain things.  But this isn't really a big deal.
434123e2cc7Smrg
435123e2cc7Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
436123e2cc7Smrg# AM_INIT_AUTOMAKE([OPTIONS])
437123e2cc7Smrg# -----------------------------------------------
438123e2cc7Smrg# The call with PACKAGE and VERSION arguments is the old style
439123e2cc7Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
440123e2cc7Smrg# and VERSION should now be passed to AC_INIT and removed from
441123e2cc7Smrg# the call to AM_INIT_AUTOMAKE.
442123e2cc7Smrg# We support both call styles for the transition.  After
443123e2cc7Smrg# the next Automake release, Autoconf can make the AC_INIT
444123e2cc7Smrg# arguments mandatory, and then we can depend on a new Autoconf
445123e2cc7Smrg# release and drop the old call support.
446123e2cc7SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
447123e2cc7Smrg[AC_PREREQ([2.62])dnl
448123e2cc7Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
449123e2cc7Smrgdnl the ones we care about.
450123e2cc7Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
451123e2cc7SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
452123e2cc7SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
453123e2cc7Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
454123e2cc7Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
455123e2cc7Smrg  # is not polluted with repeated "-I."
456123e2cc7Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
457123e2cc7Smrg  # test to see if srcdir already configured
458123e2cc7Smrg  if test -f $srcdir/config.status; then
459123e2cc7Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
460123e2cc7Smrg  fi
4617da8b7e3Smrgfi
4627da8b7e3Smrg
463123e2cc7Smrg# test whether we have cygpath
464123e2cc7Smrgif test -z "$CYGPATH_W"; then
465123e2cc7Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
466123e2cc7Smrg    CYGPATH_W='cygpath -w'
467123e2cc7Smrg  else
468123e2cc7Smrg    CYGPATH_W=echo
469123e2cc7Smrg  fi
4707da8b7e3Smrgfi
471123e2cc7SmrgAC_SUBST([CYGPATH_W])
472123e2cc7Smrg
473123e2cc7Smrg# Define the identity of the package.
474123e2cc7Smrgdnl Distinguish between old-style and new-style calls.
475123e2cc7Smrgm4_ifval([$2],
476123e2cc7Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
477123e2cc7Smrg AC_SUBST([PACKAGE], [$1])dnl
478123e2cc7Smrg AC_SUBST([VERSION], [$2])],
479123e2cc7Smrg[_AM_SET_OPTIONS([$1])dnl
480123e2cc7Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
481123e2cc7Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
482123e2cc7Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
483123e2cc7Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
484123e2cc7Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
485123e2cc7Smrg
486123e2cc7Smrg_AM_IF_OPTION([no-define],,
487123e2cc7Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
488123e2cc7Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489123e2cc7Smrg
490123e2cc7Smrg# Some tools Automake needs.
491123e2cc7SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
492123e2cc7SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
493123e2cc7SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
494123e2cc7SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
495123e2cc7SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
496123e2cc7SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
497123e2cc7SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
498123e2cc7SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
499123e2cc7SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
500123e2cc7SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
501123e2cc7Smrg# We need awk for the "check" target.  The system "awk" is bad on
502123e2cc7Smrg# some platforms.
503123e2cc7SmrgAC_REQUIRE([AC_PROG_AWK])dnl
504123e2cc7SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
505123e2cc7SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
506123e2cc7Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
507123e2cc7Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
508123e2cc7Smrg			     [_AM_PROG_TAR([v7])])])
509123e2cc7Smrg_AM_IF_OPTION([no-dependencies],,
510123e2cc7Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
511123e2cc7Smrg		  [_AM_DEPENDENCIES(CC)],
512123e2cc7Smrg		  [define([AC_PROG_CC],
513123e2cc7Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
514123e2cc7SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
515123e2cc7Smrg		  [_AM_DEPENDENCIES(CXX)],
516123e2cc7Smrg		  [define([AC_PROG_CXX],
517123e2cc7Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
518123e2cc7SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
519123e2cc7Smrg		  [_AM_DEPENDENCIES(OBJC)],
520123e2cc7Smrg		  [define([AC_PROG_OBJC],
521123e2cc7Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
522123e2cc7Smrg])
523123e2cc7Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
524123e2cc7Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
525123e2cc7Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
526123e2cc7Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
527123e2cc7SmrgAC_CONFIG_COMMANDS_PRE(dnl
528123e2cc7Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
529123e2cc7Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
530123e2cc7Smrg])
531123e2cc7Smrg
532123e2cc7Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
533123e2cc7Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
534123e2cc7Smrgdnl mangled by Autoconf and run in a shell conditional statement.
535123e2cc7Smrgm4_define([_AC_COMPILER_EXEEXT],
536123e2cc7Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537123e2cc7Smrg
538123e2cc7Smrg
539123e2cc7Smrg# When config.status generates a header, we must update the stamp-h file.
540123e2cc7Smrg# This file resides in the same directory as the config header
541123e2cc7Smrg# that is generated.  The stamp files are numbered to have different names.
542123e2cc7Smrg
543123e2cc7Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
544123e2cc7Smrg# loop where config.status creates the headers, so we can generate
545123e2cc7Smrg# our stamp files there.
546123e2cc7SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
547123e2cc7Smrg[# Compute $1's index in $config_headers.
548123e2cc7Smrg_am_arg=$1
549123e2cc7Smrg_am_stamp_count=1
550123e2cc7Smrgfor _am_header in $config_headers :; do
551123e2cc7Smrg  case $_am_header in
552123e2cc7Smrg    $_am_arg | $_am_arg:* )
553123e2cc7Smrg      break ;;
554123e2cc7Smrg    * )
555123e2cc7Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
556123e2cc7Smrg  esac
557123e2cc7Smrgdone
558123e2cc7Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
559123e2cc7Smrg
560123e2cc7Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
561123e2cc7Smrg#
562123e2cc7Smrg# This file is free software; the Free Software Foundation
563123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
564123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
565123e2cc7Smrg
566123e2cc7Smrg# AM_PROG_INSTALL_SH
567123e2cc7Smrg# ------------------
568123e2cc7Smrg# Define $install_sh.
569123e2cc7SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
570123e2cc7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
571123e2cc7Smrgif test x"${install_sh}" != xset; then
572123e2cc7Smrg  case $am_aux_dir in
573123e2cc7Smrg  *\ * | *\	*)
574123e2cc7Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
575123e2cc7Smrg  *)
576123e2cc7Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
577123e2cc7Smrg  esac
5787da8b7e3Smrgfi
579123e2cc7SmrgAC_SUBST(install_sh)])
5807da8b7e3Smrg
581123e2cc7Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
582123e2cc7Smrg#
583123e2cc7Smrg# This file is free software; the Free Software Foundation
584123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
585123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
586123e2cc7Smrg
587123e2cc7Smrg# serial 2
588123e2cc7Smrg
589123e2cc7Smrg# Check whether the underlying file-system supports filenames
590123e2cc7Smrg# with a leading dot.  For instance MS-DOS doesn't.
591123e2cc7SmrgAC_DEFUN([AM_SET_LEADING_DOT],
592123e2cc7Smrg[rm -rf .tst 2>/dev/null
593123e2cc7Smrgmkdir .tst 2>/dev/null
594123e2cc7Smrgif test -d .tst; then
595123e2cc7Smrg  am__leading_dot=.
596123e2cc7Smrgelse
597123e2cc7Smrg  am__leading_dot=_
5987da8b7e3Smrgfi
599123e2cc7Smrgrmdir .tst 2>/dev/null
600123e2cc7SmrgAC_SUBST([am__leading_dot])])
601123e2cc7Smrg
602123e2cc7Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
603123e2cc7Smrg# From Jim Meyering
604123e2cc7Smrg
605123e2cc7Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
606123e2cc7Smrg# Free Software Foundation, Inc.
607123e2cc7Smrg#
608123e2cc7Smrg# This file is free software; the Free Software Foundation
609123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
610123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
611123e2cc7Smrg
612123e2cc7Smrg# serial 5
613123e2cc7Smrg
614123e2cc7Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
615123e2cc7Smrg# ----------------------------------
616123e2cc7Smrg# Control maintainer-specific portions of Makefiles.
617123e2cc7Smrg# Default is to disable them, unless `enable' is passed literally.
618123e2cc7Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
619123e2cc7Smrg# can override the default with the --enable/--disable switch.
620123e2cc7SmrgAC_DEFUN([AM_MAINTAINER_MODE],
621123e2cc7Smrg[m4_case(m4_default([$1], [disable]),
622123e2cc7Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
623123e2cc7Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
624123e2cc7Smrg       [m4_define([am_maintainer_other], [enable])
625123e2cc7Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
626123e2cc7SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
627123e2cc7Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
628123e2cc7Smrg  AC_ARG_ENABLE([maintainer-mode],
629123e2cc7Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
630123e2cc7Smrg			  (and sometimes confusing) to the casual installer],
631123e2cc7Smrg      [USE_MAINTAINER_MODE=$enableval],
632123e2cc7Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
633123e2cc7Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
634123e2cc7Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
635123e2cc7Smrg  MAINT=$MAINTAINER_MODE_TRUE
636123e2cc7Smrg  AC_SUBST([MAINT])dnl
637123e2cc7Smrg]
638123e2cc7Smrg)
639123e2cc7Smrg
640123e2cc7SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
641123e2cc7Smrg
642123e2cc7Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
643123e2cc7Smrg
644123e2cc7Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
645123e2cc7Smrg#
646123e2cc7Smrg# This file is free software; the Free Software Foundation
647123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
648123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
649123e2cc7Smrg
650123e2cc7Smrg# serial 4
651123e2cc7Smrg
652123e2cc7Smrg# AM_MAKE_INCLUDE()
653123e2cc7Smrg# -----------------
654123e2cc7Smrg# Check to see how make treats includes.
655123e2cc7SmrgAC_DEFUN([AM_MAKE_INCLUDE],
656123e2cc7Smrg[am_make=${MAKE-make}
657123e2cc7Smrgcat > confinc << 'END'
658123e2cc7Smrgam__doit:
659123e2cc7Smrg	@echo this is the am__doit target
660123e2cc7Smrg.PHONY: am__doit
661123e2cc7SmrgEND
662123e2cc7Smrg# If we don't find an include directive, just comment out the code.
663123e2cc7SmrgAC_MSG_CHECKING([for style of include used by $am_make])
664123e2cc7Smrgam__include="#"
665123e2cc7Smrgam__quote=
666123e2cc7Smrg_am_result=none
667123e2cc7Smrg# First try GNU make style include.
668123e2cc7Smrgecho "include confinc" > confmf
669123e2cc7Smrg# Ignore all kinds of additional output from `make'.
670123e2cc7Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
671123e2cc7Smrg*the\ am__doit\ target*)
672123e2cc7Smrg  am__include=include
673123e2cc7Smrg  am__quote=
674123e2cc7Smrg  _am_result=GNU
675123e2cc7Smrg  ;;
676123e2cc7Smrgesac
677123e2cc7Smrg# Now try BSD make style include.
678123e2cc7Smrgif test "$am__include" = "#"; then
679123e2cc7Smrg   echo '.include "confinc"' > confmf
680123e2cc7Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
681123e2cc7Smrg   *the\ am__doit\ target*)
682123e2cc7Smrg     am__include=.include
683123e2cc7Smrg     am__quote="\""
684123e2cc7Smrg     _am_result=BSD
685123e2cc7Smrg     ;;
686123e2cc7Smrg   esac
6877da8b7e3Smrgfi
688123e2cc7SmrgAC_SUBST([am__include])
689123e2cc7SmrgAC_SUBST([am__quote])
690123e2cc7SmrgAC_MSG_RESULT([$_am_result])
691123e2cc7Smrgrm -f confinc confmf
692123e2cc7Smrg])
6937da8b7e3Smrg
694123e2cc7Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
695123e2cc7Smrg
696123e2cc7Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
697123e2cc7Smrg# Free Software Foundation, Inc.
698123e2cc7Smrg#
699123e2cc7Smrg# This file is free software; the Free Software Foundation
700123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
701123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
702123e2cc7Smrg
703123e2cc7Smrg# serial 6
704123e2cc7Smrg
705123e2cc7Smrg# AM_MISSING_PROG(NAME, PROGRAM)
706123e2cc7Smrg# ------------------------------
707123e2cc7SmrgAC_DEFUN([AM_MISSING_PROG],
708123e2cc7Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
709123e2cc7Smrg$1=${$1-"${am_missing_run}$2"}
710123e2cc7SmrgAC_SUBST($1)])
711123e2cc7Smrg
712123e2cc7Smrg
713123e2cc7Smrg# AM_MISSING_HAS_RUN
714123e2cc7Smrg# ------------------
715123e2cc7Smrg# Define MISSING if not defined so far and test if it supports --run.
716123e2cc7Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
717123e2cc7SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
718123e2cc7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
719123e2cc7SmrgAC_REQUIRE_AUX_FILE([missing])dnl
720123e2cc7Smrgif test x"${MISSING+set}" != xset; then
721123e2cc7Smrg  case $am_aux_dir in
722123e2cc7Smrg  *\ * | *\	*)
723123e2cc7Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
724123e2cc7Smrg  *)
725123e2cc7Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
726123e2cc7Smrg  esac
7277da8b7e3Smrgfi
728123e2cc7Smrg# Use eval to expand $SHELL
729123e2cc7Smrgif eval "$MISSING --run true"; then
730123e2cc7Smrg  am_missing_run="$MISSING --run "
731123e2cc7Smrgelse
732123e2cc7Smrg  am_missing_run=
733123e2cc7Smrg  AC_MSG_WARN([`missing' script is too old or missing])
7347da8b7e3Smrgfi
735123e2cc7Smrg])
7367da8b7e3Smrg
737123e2cc7Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
738123e2cc7Smrg#
739123e2cc7Smrg# This file is free software; the Free Software Foundation
740123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
741123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
7427da8b7e3Smrg
743123e2cc7Smrg# AM_PROG_MKDIR_P
744123e2cc7Smrg# ---------------
745123e2cc7Smrg# Check for `mkdir -p'.
746123e2cc7SmrgAC_DEFUN([AM_PROG_MKDIR_P],
747123e2cc7Smrg[AC_PREREQ([2.60])dnl
748123e2cc7SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
749123e2cc7Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
750123e2cc7Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
751123e2cc7Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
752123e2cc7Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
753123e2cc7Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
754123e2cc7Smrgdnl adjustment using top_builddir (which is defined more often than
755123e2cc7Smrgdnl MKDIR_P).
756123e2cc7SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
757123e2cc7Smrgcase $mkdir_p in
758123e2cc7Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
759123e2cc7Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
760123e2cc7Smrgesac
761123e2cc7Smrg])
7627da8b7e3Smrg
763123e2cc7Smrg# Helper functions for option handling.                     -*- Autoconf -*-
764123e2cc7Smrg
765123e2cc7Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
766123e2cc7Smrg#
767123e2cc7Smrg# This file is free software; the Free Software Foundation
768123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
769123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
770123e2cc7Smrg
771123e2cc7Smrg# serial 4
772123e2cc7Smrg
773123e2cc7Smrg# _AM_MANGLE_OPTION(NAME)
774123e2cc7Smrg# -----------------------
775123e2cc7SmrgAC_DEFUN([_AM_MANGLE_OPTION],
776123e2cc7Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
777123e2cc7Smrg
778123e2cc7Smrg# _AM_SET_OPTION(NAME)
779123e2cc7Smrg# ------------------------------
780123e2cc7Smrg# Set option NAME.  Presently that only means defining a flag for this option.
781123e2cc7SmrgAC_DEFUN([_AM_SET_OPTION],
782123e2cc7Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
783123e2cc7Smrg
784123e2cc7Smrg# _AM_SET_OPTIONS(OPTIONS)
785123e2cc7Smrg# ----------------------------------
786123e2cc7Smrg# OPTIONS is a space-separated list of Automake options.
787123e2cc7SmrgAC_DEFUN([_AM_SET_OPTIONS],
788123e2cc7Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7897da8b7e3Smrg
790123e2cc7Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
791123e2cc7Smrg# -------------------------------------------
792123e2cc7Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
793123e2cc7SmrgAC_DEFUN([_AM_IF_OPTION],
794123e2cc7Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7957da8b7e3Smrg
796123e2cc7Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7977da8b7e3Smrg
798123e2cc7Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
799123e2cc7Smrg# Free Software Foundation, Inc.
800123e2cc7Smrg#
801123e2cc7Smrg# This file is free software; the Free Software Foundation
802123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
803123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
8047da8b7e3Smrg
805123e2cc7Smrg# serial 5
8067da8b7e3Smrg
807123e2cc7Smrg# AM_SANITY_CHECK
808123e2cc7Smrg# ---------------
809123e2cc7SmrgAC_DEFUN([AM_SANITY_CHECK],
810123e2cc7Smrg[AC_MSG_CHECKING([whether build environment is sane])
811123e2cc7Smrg# Just in case
812123e2cc7Smrgsleep 1
813123e2cc7Smrgecho timestamp > conftest.file
814123e2cc7Smrg# Reject unsafe characters in $srcdir or the absolute working directory
815123e2cc7Smrg# name.  Accept space and tab only in the latter.
816123e2cc7Smrgam_lf='
817123e2cc7Smrg'
818123e2cc7Smrgcase `pwd` in
819123e2cc7Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
820123e2cc7Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
821123e2cc7Smrgesac
822123e2cc7Smrgcase $srcdir in
823123e2cc7Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
824123e2cc7Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
825123e2cc7Smrgesac
8267da8b7e3Smrg
827123e2cc7Smrg# Do `set' in a subshell so we don't clobber the current shell's
828123e2cc7Smrg# arguments.  Must try -L first in case configure is actually a
829123e2cc7Smrg# symlink; some systems play weird games with the mod time of symlinks
830123e2cc7Smrg# (eg FreeBSD returns the mod time of the symlink's containing
831123e2cc7Smrg# directory).
832123e2cc7Smrgif (
833123e2cc7Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
834123e2cc7Smrg   if test "$[*]" = "X"; then
835123e2cc7Smrg      # -L didn't work.
836123e2cc7Smrg      set X `ls -t "$srcdir/configure" conftest.file`
837123e2cc7Smrg   fi
838123e2cc7Smrg   rm -f conftest.file
839123e2cc7Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
840123e2cc7Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8417da8b7e3Smrg
842123e2cc7Smrg      # If neither matched, then we have a broken ls.  This can happen
843123e2cc7Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
844123e2cc7Smrg      # broken ls alias from the environment.  This has actually
845123e2cc7Smrg      # happened.  Such a system could not be considered "sane".
846123e2cc7Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
847123e2cc7Smrgalias in your environment])
848123e2cc7Smrg   fi
849123e2cc7Smrg
850123e2cc7Smrg   test "$[2]" = conftest.file
851123e2cc7Smrg   )
852123e2cc7Smrgthen
853123e2cc7Smrg   # Ok.
854123e2cc7Smrg   :
8557da8b7e3Smrgelse
856123e2cc7Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
857123e2cc7SmrgCheck your system clock])
8587da8b7e3Smrgfi
859123e2cc7SmrgAC_MSG_RESULT(yes)])
8607da8b7e3Smrg
861123e2cc7Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
862123e2cc7Smrg#
863123e2cc7Smrg# This file is free software; the Free Software Foundation
864123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
865123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
8667da8b7e3Smrg
867123e2cc7Smrg# serial 1
868123e2cc7Smrg
869123e2cc7Smrg# AM_SILENT_RULES([DEFAULT])
870123e2cc7Smrg# --------------------------
871123e2cc7Smrg# Enable less verbose build rules; with the default set to DEFAULT
872123e2cc7Smrg# (`yes' being less verbose, `no' or empty being verbose).
873123e2cc7SmrgAC_DEFUN([AM_SILENT_RULES],
874123e2cc7Smrg[AC_ARG_ENABLE([silent-rules],
875123e2cc7Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
876123e2cc7Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
877123e2cc7Smrgcase $enable_silent_rules in
878123e2cc7Smrgyes) AM_DEFAULT_VERBOSITY=0;;
879123e2cc7Smrgno)  AM_DEFAULT_VERBOSITY=1;;
880123e2cc7Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
881123e2cc7Smrgesac
882123e2cc7SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
883123e2cc7SmrgAM_BACKSLASH='\'
884123e2cc7SmrgAC_SUBST([AM_BACKSLASH])dnl
885123e2cc7Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
886123e2cc7Smrg])
8877da8b7e3Smrg
888123e2cc7Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
889123e2cc7Smrg#
890123e2cc7Smrg# This file is free software; the Free Software Foundation
891123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
892123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
8937da8b7e3Smrg
894123e2cc7Smrg# AM_PROG_INSTALL_STRIP
895123e2cc7Smrg# ---------------------
896123e2cc7Smrg# One issue with vendor `install' (even GNU) is that you can't
897123e2cc7Smrg# specify the program used to strip binaries.  This is especially
898123e2cc7Smrg# annoying in cross-compiling environments, where the build's strip
899123e2cc7Smrg# is unlikely to handle the host's binaries.
900123e2cc7Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
901123e2cc7Smrg# always use install-sh in `make install-strip', and initialize
902123e2cc7Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
903123e2cc7SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
904123e2cc7Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
905123e2cc7Smrg# Installed binaries are usually stripped using `strip' when the user
906123e2cc7Smrg# run `make install-strip'.  However `strip' might not be the right
907123e2cc7Smrg# tool to use in cross-compilation environments, therefore Automake
908123e2cc7Smrg# will honor the `STRIP' environment variable to overrule this program.
909123e2cc7Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
910123e2cc7Smrgif test "$cross_compiling" != no; then
911123e2cc7Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
9127da8b7e3Smrgfi
913123e2cc7SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
914123e2cc7SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9157da8b7e3Smrg
916123e2cc7Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
917123e2cc7Smrg#
918123e2cc7Smrg# This file is free software; the Free Software Foundation
919123e2cc7Smrg# gives unlimited permission to copy and/or distribute it,
920123e2cc7Smrg# with or without modifications, as long as this notice is preserved.
9217da8b7e3Smrg
922123e2cc7Smrg# serial 2
9237da8b7e3Smrg
924123e2cc7Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
925123e2cc7Smrg# ---------------------------
926123e2cc7Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
927123e2cc7Smrg# This macro is traced by Automake.
928123e2cc7SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9297da8b7e3Smrg
930123e2cc7Smrg# AM_SUBST_NOTMAKE(VARIABLE)
931123e2cc7Smrg# ---------------------------
932123e2cc7Smrg# Public sister of _AM_SUBST_NOTMAKE.
933123e2cc7SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9347da8b7e3Smrg
935123e2cc7Smrg# Check how to create a tarball.                            -*- Autoconf -*-
936123e2cc7Smrg
937123e2cc7Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9387da8b7e3Smrg#
9397da8b7e3Smrg# This file is free software; the Free Software Foundation
9407da8b7e3Smrg# gives unlimited permission to copy and/or distribute it,
9417da8b7e3Smrg# with or without modifications, as long as this notice is preserved.
9427da8b7e3Smrg
943123e2cc7Smrg# serial 2
944123e2cc7Smrg
945123e2cc7Smrg# _AM_PROG_TAR(FORMAT)
946123e2cc7Smrg# --------------------
947123e2cc7Smrg# Check how to create a tarball in format FORMAT.
948123e2cc7Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
949123e2cc7Smrg#
950123e2cc7Smrg# Substitute a variable $(am__tar) that is a command
951123e2cc7Smrg# writing to stdout a FORMAT-tarball containing the directory
952123e2cc7Smrg# $tardir.
953123e2cc7Smrg#     tardir=directory && $(am__tar) > result.tar
954123e2cc7Smrg#
955123e2cc7Smrg# Substitute a variable $(am__untar) that extract such
956123e2cc7Smrg# a tarball read from stdin.
957123e2cc7Smrg#     $(am__untar) < result.tar
958123e2cc7SmrgAC_DEFUN([_AM_PROG_TAR],
959123e2cc7Smrg[# Always define AMTAR for backward compatibility.
960123e2cc7SmrgAM_MISSING_PROG([AMTAR], [tar])
961123e2cc7Smrgm4_if([$1], [v7],
962123e2cc7Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
963123e2cc7Smrg     [m4_case([$1], [ustar],, [pax],,
964123e2cc7Smrg              [m4_fatal([Unknown tar format])])
965123e2cc7SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
966123e2cc7Smrg# Loop over all known methods to create a tar archive until one works.
967123e2cc7Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
968123e2cc7Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
969123e2cc7Smrg# Do not fold the above two line into one, because Tru64 sh and
970123e2cc7Smrg# Solaris sh will not grok spaces in the rhs of `-'.
971123e2cc7Smrgfor _am_tool in $_am_tools
972123e2cc7Smrgdo
973123e2cc7Smrg  case $_am_tool in
974123e2cc7Smrg  gnutar)
975123e2cc7Smrg    for _am_tar in tar gnutar gtar;
976123e2cc7Smrg    do
977123e2cc7Smrg      AM_RUN_LOG([$_am_tar --version]) && break
978123e2cc7Smrg    done
979123e2cc7Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
980123e2cc7Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
981123e2cc7Smrg    am__untar="$_am_tar -xf -"
982123e2cc7Smrg    ;;
983123e2cc7Smrg  plaintar)
984123e2cc7Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
985123e2cc7Smrg    # ustar tarball either.
986123e2cc7Smrg    (tar --version) >/dev/null 2>&1 && continue
987123e2cc7Smrg    am__tar='tar chf - "$$tardir"'
988123e2cc7Smrg    am__tar_='tar chf - "$tardir"'
989123e2cc7Smrg    am__untar='tar xf -'
990123e2cc7Smrg    ;;
991123e2cc7Smrg  pax)
992123e2cc7Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
993123e2cc7Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
994123e2cc7Smrg    am__untar='pax -r'
995123e2cc7Smrg    ;;
996123e2cc7Smrg  cpio)
997123e2cc7Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
998123e2cc7Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
999123e2cc7Smrg    am__untar='cpio -i -H $1 -d'
1000123e2cc7Smrg    ;;
1001123e2cc7Smrg  none)
1002123e2cc7Smrg    am__tar=false
1003123e2cc7Smrg    am__tar_=false
1004123e2cc7Smrg    am__untar=false
1005123e2cc7Smrg    ;;
1006123e2cc7Smrg  esac
1007123e2cc7Smrg
1008123e2cc7Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
1009123e2cc7Smrg  # and am__untar set.
1010123e2cc7Smrg  test -n "${am_cv_prog_tar_$1}" && break
10117da8b7e3Smrg
1012123e2cc7Smrg  # tar/untar a dummy directory, and stop if the command works
1013123e2cc7Smrg  rm -rf conftest.dir
1014123e2cc7Smrg  mkdir conftest.dir
1015123e2cc7Smrg  echo GrepMe > conftest.dir/file
1016123e2cc7Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1017123e2cc7Smrg  rm -rf conftest.dir
1018123e2cc7Smrg  if test -s conftest.tar; then
1019123e2cc7Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
1020123e2cc7Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1021123e2cc7Smrg  fi
1022123e2cc7Smrgdone
1023123e2cc7Smrgrm -rf conftest.dir
10247da8b7e3Smrg
1025123e2cc7SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1026123e2cc7SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1027123e2cc7SmrgAC_SUBST([am__tar])
1028123e2cc7SmrgAC_SUBST([am__untar])
1029123e2cc7Smrg]) # _AM_PROG_TAR
10307da8b7e3Smrg
1031123e2cc7Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1032123e2cc7Smrgdnl
1033123e2cc7Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1034123e2cc7Smrgdnl 
1035123e2cc7Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1036123e2cc7Smrgdnl copy of this software and associated documentation files (the
1037123e2cc7Smrgdnl "Software"), to deal in the Software without restriction, including
1038123e2cc7Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
1039123e2cc7Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
1040123e2cc7Smrgdnl to whom the Software is furnished to do so, provided that the above
1041123e2cc7Smrgdnl copyright notice(s) and this permission notice appear in all copies of
1042123e2cc7Smrgdnl the Software and that both the above copyright notice(s) and this
1043123e2cc7Smrgdnl permission notice appear in supporting documentation.
1044123e2cc7Smrgdnl
1045123e2cc7Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1046123e2cc7Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1047123e2cc7Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1048123e2cc7Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1049123e2cc7Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1050123e2cc7Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1051123e2cc7Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1052123e2cc7Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1053123e2cc7Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1054123e2cc7Smrgdnl
1055123e2cc7Smrgdnl Except as contained in this notice, the name of a copyright holder
1056123e2cc7Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
1057123e2cc7Smrgdnl or other dealings in this Software without prior written authorization
1058123e2cc7Smrgdnl of the copyright holder.
10597da8b7e3Smrg
1060123e2cc7Smrg# XORG_MACROS_VERSION(required-version)
1061123e2cc7Smrg# -------------------------------------
1062123e2cc7Smrg# Minimum version: 1.1.0
10637da8b7e3Smrg#
1064123e2cc7Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1065123e2cc7Smrg# your configure.ac with the minimum required version, such as:
1066123e2cc7Smrg# XORG_MACROS_VERSION(1.1)
10677da8b7e3Smrg#
1068123e2cc7Smrg# To ensure that this macro is defined, also add:
1069123e2cc7Smrg# m4_ifndef([XORG_MACROS_VERSION],
1070123e2cc7Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10717da8b7e3Smrg#
10727da8b7e3Smrg#
1073123e2cc7Smrg# See the "minimum version" comment for each macro you use to see what 
1074123e2cc7Smrg# version you require.
1075123e2cc7Smrgm4_defun([XORG_MACROS_VERSION],[
1076123e2cc7Smrgm4_define([vers_have], [1.3.0])
1077123e2cc7Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1078123e2cc7Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1079123e2cc7Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1080123e2cc7Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1081123e2cc7Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1082123e2cc7Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1083123e2cc7Smrgm4_undefine([vers_have])
1084123e2cc7Smrgm4_undefine([maj_have])
1085123e2cc7Smrgm4_undefine([maj_needed])
1086123e2cc7Smrg]) # XORG_MACROS_VERSION
10877da8b7e3Smrg
1088123e2cc7Smrg# XORG_PROG_RAWCPP()
1089123e2cc7Smrg# ------------------
1090123e2cc7Smrg# Minimum version: 1.0.0
10917da8b7e3Smrg#
1092123e2cc7Smrg# Find cpp program and necessary flags for use in pre-processing text files
1093123e2cc7Smrg# such as man pages and config files
1094123e2cc7SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1095123e2cc7SmrgAC_REQUIRE([AC_PROG_CPP])
1096123e2cc7SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1097123e2cc7Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
10987da8b7e3Smrg
1099123e2cc7Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1100123e2cc7Smrg# which is not the best choice for supporting other OS'es, but covers most
1101123e2cc7Smrg# of the ones we need for now.
1102123e2cc7SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1103123e2cc7SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1104123e2cc7Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1105123e2cc7Smrg	AC_MSG_RESULT([no])
11067da8b7e3Smrgelse
1107123e2cc7Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1108123e2cc7Smrg		RAWCPPFLAGS=-undef
1109123e2cc7Smrg		AC_MSG_RESULT([yes])
1110123e2cc7Smrg	# under Cygwin unix is still defined even with -undef
1111123e2cc7Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1112123e2cc7Smrg		RAWCPPFLAGS="-undef -ansi"
1113123e2cc7Smrg		AC_MSG_RESULT([yes, with -ansi])
1114123e2cc7Smrg	else
1115123e2cc7Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1116123e2cc7Smrg	fi
11177da8b7e3Smrgfi
1118123e2cc7Smrgrm -f conftest.$ac_ext
11197da8b7e3Smrg
1120123e2cc7SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1121123e2cc7SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1122123e2cc7Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1123123e2cc7Smrg	AC_MSG_RESULT([no])
1124123e2cc7Smrgelse
1125123e2cc7Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1126123e2cc7Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1127123e2cc7Smrg		AC_MSG_RESULT([yes])
1128123e2cc7Smrg	else
1129123e2cc7Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1130123e2cc7Smrg	fi
1131123e2cc7Smrgfi
1132123e2cc7Smrgrm -f conftest.$ac_ext
1133123e2cc7SmrgAC_SUBST(RAWCPPFLAGS)
1134123e2cc7Smrg]) # XORG_PROG_RAWCPP
11357da8b7e3Smrg
1136123e2cc7Smrg# XORG_MANPAGE_SECTIONS()
1137123e2cc7Smrg# -----------------------
1138123e2cc7Smrg# Minimum version: 1.0.0
11397da8b7e3Smrg#
1140123e2cc7Smrg# Determine which sections man pages go in for the different man page types
1141123e2cc7Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1142123e2cc7Smrg# Not sure if there's any better way than just hardcoding by OS name.
1143123e2cc7Smrg# Override default settings by setting environment variables
11447da8b7e3Smrg
1145123e2cc7SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1146123e2cc7SmrgAC_REQUIRE([AC_CANONICAL_HOST])
11477da8b7e3Smrg
1148123e2cc7Smrgif test x$APP_MAN_SUFFIX = x    ; then
1149123e2cc7Smrg    APP_MAN_SUFFIX=1
1150123e2cc7Smrgfi
1151123e2cc7Smrgif test x$APP_MAN_DIR = x    ; then
1152123e2cc7Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1153123e2cc7Smrgfi
11547da8b7e3Smrg
1155123e2cc7Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1156123e2cc7Smrg    LIB_MAN_SUFFIX=3
1157123e2cc7Smrgfi
1158123e2cc7Smrgif test x$LIB_MAN_DIR = x    ; then
1159123e2cc7Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
11607da8b7e3Smrgfi
11617da8b7e3Smrg
1162123e2cc7Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1163123e2cc7Smrg    case $host_os in
1164123e2cc7Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1165123e2cc7Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1166123e2cc7Smrg    esac
1167123e2cc7Smrgfi
1168123e2cc7Smrgif test x$FILE_MAN_DIR = x    ; then
1169123e2cc7Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1170123e2cc7Smrgfi
11717da8b7e3Smrg
1172123e2cc7Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1173123e2cc7Smrg    case $host_os in
1174123e2cc7Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1175123e2cc7Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1176123e2cc7Smrg    esac
1177123e2cc7Smrgfi
1178123e2cc7Smrgif test x$MISC_MAN_DIR = x    ; then
1179123e2cc7Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1180123e2cc7Smrgfi
11817da8b7e3Smrg
1182123e2cc7Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1183123e2cc7Smrg    case $host_os in
1184123e2cc7Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1185123e2cc7Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1186123e2cc7Smrg    esac
1187123e2cc7Smrgfi
1188123e2cc7Smrgif test x$DRIVER_MAN_DIR = x    ; then
1189123e2cc7Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1190123e2cc7Smrgfi
11917da8b7e3Smrg
1192123e2cc7Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1193123e2cc7Smrg    case $host_os in
1194123e2cc7Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1195123e2cc7Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1196123e2cc7Smrg    esac
1197123e2cc7Smrgfi
1198123e2cc7Smrgif test x$ADMIN_MAN_DIR = x    ; then
1199123e2cc7Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
12007da8b7e3Smrgfi
12017da8b7e3Smrg
12027da8b7e3Smrg
1203123e2cc7SmrgAC_SUBST([APP_MAN_SUFFIX])
1204123e2cc7SmrgAC_SUBST([LIB_MAN_SUFFIX])
1205123e2cc7SmrgAC_SUBST([FILE_MAN_SUFFIX])
1206123e2cc7SmrgAC_SUBST([MISC_MAN_SUFFIX])
1207123e2cc7SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1208123e2cc7SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1209123e2cc7SmrgAC_SUBST([APP_MAN_DIR])
1210123e2cc7SmrgAC_SUBST([LIB_MAN_DIR])
1211123e2cc7SmrgAC_SUBST([FILE_MAN_DIR])
1212123e2cc7SmrgAC_SUBST([MISC_MAN_DIR])
1213123e2cc7SmrgAC_SUBST([DRIVER_MAN_DIR])
1214123e2cc7SmrgAC_SUBST([ADMIN_MAN_DIR])
1215123e2cc7Smrg]) # XORG_MANPAGE_SECTIONS
1216123e2cc7Smrg
1217123e2cc7Smrg# XORG_CHECK_LINUXDOC
1218123e2cc7Smrg# -------------------
1219123e2cc7Smrg# Minimum version: 1.0.0
12207da8b7e3Smrg#
1221123e2cc7Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1222123e2cc7Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1223123e2cc7Smrg# Whether or not the necessary tools and files are found can be checked
1224123e2cc7Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1225123e2cc7SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1226123e2cc7Smrgif test x$XORG_SGML_PATH = x ; then
1227123e2cc7Smrg    XORG_SGML_PATH=$prefix/share/sgml
1228123e2cc7Smrgfi
1229123e2cc7SmrgHAVE_DEFS_ENT=
12307da8b7e3Smrg
1231123e2cc7Smrgif test x"$cross_compiling" = x"yes" ; then
1232123e2cc7Smrg  HAVE_DEFS_ENT=no
1233123e2cc7Smrgelse
1234123e2cc7Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1235123e2cc7Smrgfi
12367da8b7e3Smrg
1237123e2cc7SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1238123e2cc7SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
12397da8b7e3Smrg
1240123e2cc7SmrgAC_MSG_CHECKING([Whether to build documentation])
12417da8b7e3Smrg
1242123e2cc7Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1243123e2cc7Smrg   BUILDDOC=yes
1244123e2cc7Smrgelse
1245123e2cc7Smrg   BUILDDOC=no
1246123e2cc7Smrgfi
12477da8b7e3Smrg
1248123e2cc7SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
12497da8b7e3Smrg
1250123e2cc7SmrgAC_MSG_RESULT([$BUILDDOC])
12517da8b7e3Smrg
1252123e2cc7SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
12537da8b7e3Smrg
1254123e2cc7Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1255123e2cc7Smrg   BUILDPDFDOC=yes
1256123e2cc7Smrgelse
1257123e2cc7Smrg   BUILDPDFDOC=no
1258123e2cc7Smrgfi
12597da8b7e3Smrg
1260123e2cc7SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
12617da8b7e3Smrg
1262123e2cc7SmrgAC_MSG_RESULT([$BUILDPDFDOC])
12637da8b7e3Smrg
1264123e2cc7SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1265123e2cc7SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1266123e2cc7SmrgMAKE_PDF="$PS2PDF"
1267123e2cc7SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
12687da8b7e3Smrg
1269123e2cc7SmrgAC_SUBST(MAKE_TEXT)
1270123e2cc7SmrgAC_SUBST(MAKE_PS)
1271123e2cc7SmrgAC_SUBST(MAKE_PDF)
1272123e2cc7SmrgAC_SUBST(MAKE_HTML)
1273123e2cc7Smrg]) # XORG_CHECK_LINUXDOC
1274123e2cc7Smrg
1275123e2cc7Smrg# XORG_CHECK_DOCBOOK
1276123e2cc7Smrg# -------------------
1277123e2cc7Smrg# Minimum version: 1.0.0
1278123e2cc7Smrg#
1279123e2cc7Smrg# Checks for the ability to build output formats from SGML DocBook source.
1280123e2cc7Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1281123e2cc7Smrg# indicates whether the necessary tools and files are found and, if set,
1282123e2cc7Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1283123e2cc7SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1284123e2cc7Smrgif test x$XORG_SGML_PATH = x ; then
1285123e2cc7Smrg    XORG_SGML_PATH=$prefix/share/sgml
12867da8b7e3Smrgfi
1287123e2cc7SmrgHAVE_DEFS_ENT=
1288123e2cc7SmrgBUILDTXTDOC=no
1289123e2cc7SmrgBUILDPDFDOC=no
1290123e2cc7SmrgBUILDPSDOC=no
1291123e2cc7SmrgBUILDHTMLDOC=no
1292123e2cc7Smrg
1293123e2cc7SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1294123e2cc7Smrg
1295123e2cc7SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1296123e2cc7SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1297123e2cc7SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1298123e2cc7SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1299123e2cc7Smrg
1300123e2cc7SmrgAC_MSG_CHECKING([Whether to build text documentation])
1301123e2cc7Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1302123e2cc7Smrg   test x$BUILD_TXTDOC != xno; then
1303123e2cc7Smrg	BUILDTXTDOC=yes
1304123e2cc7Smrgfi
1305123e2cc7SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1306123e2cc7SmrgAC_MSG_RESULT([$BUILDTXTDOC])
13077da8b7e3Smrg
1308123e2cc7SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
1309123e2cc7Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1310123e2cc7Smrg   test x$BUILD_PDFDOC != xno; then
1311123e2cc7Smrg	BUILDPDFDOC=yes
13127da8b7e3Smrgfi
1313123e2cc7SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1314123e2cc7SmrgAC_MSG_RESULT([$BUILDPDFDOC])
13157da8b7e3Smrg
1316123e2cc7SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
1317123e2cc7Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1318123e2cc7Smrg   test x$BUILD_PSDOC != xno; then
1319123e2cc7Smrg	BUILDPSDOC=yes
1320123e2cc7Smrgfi
1321123e2cc7SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1322123e2cc7SmrgAC_MSG_RESULT([$BUILDPSDOC])
13237da8b7e3Smrg
1324123e2cc7SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
1325123e2cc7Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1326123e2cc7Smrg   test x$BUILD_HTMLDOC != xno; then
1327123e2cc7Smrg	BUILDHTMLDOC=yes
1328123e2cc7Smrgfi
1329123e2cc7SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1330123e2cc7SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
13317da8b7e3Smrg
1332123e2cc7SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1333123e2cc7SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1334123e2cc7SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1335123e2cc7SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
13367da8b7e3Smrg
1337123e2cc7SmrgAC_SUBST(MAKE_TEXT)
1338123e2cc7SmrgAC_SUBST(MAKE_PS)
1339123e2cc7SmrgAC_SUBST(MAKE_PDF)
1340123e2cc7SmrgAC_SUBST(MAKE_HTML)
1341123e2cc7Smrg]) # XORG_CHECK_DOCBOOK
13427da8b7e3Smrg
1343123e2cc7Smrg# XORG_CHECK_MALLOC_ZERO
1344123e2cc7Smrg# ----------------------
1345123e2cc7Smrg# Minimum version: 1.0.0
1346123e2cc7Smrg#
1347123e2cc7Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1348123e2cc7Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1349123e2cc7Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1350123e2cc7SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1351123e2cc7SmrgAC_ARG_ENABLE(malloc0returnsnull,
1352123e2cc7Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1353123e2cc7Smrg		       [malloc(0) returns NULL (default: auto)]),
1354123e2cc7Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1355123e2cc7Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
13567da8b7e3Smrg
1357123e2cc7SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1358123e2cc7Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1359123e2cc7Smrg	AC_RUN_IFELSE([
1360123e2cc7Smrgchar *malloc();
1361123e2cc7Smrgchar *realloc();
1362123e2cc7Smrgchar *calloc();
1363123e2cc7Smrgmain() {
1364123e2cc7Smrg    char *m0, *r0, *c0, *p;
1365123e2cc7Smrg    m0 = malloc(0);
1366123e2cc7Smrg    p = malloc(10);
1367123e2cc7Smrg    r0 = realloc(p,0);
1368123e2cc7Smrg    c0 = calloc(0);
1369123e2cc7Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1370123e2cc7Smrg}],
1371123e2cc7Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1372123e2cc7Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
1373123e2cc7Smrgfi
1374123e2cc7SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
13757da8b7e3Smrg
1376123e2cc7Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1377123e2cc7Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1378123e2cc7Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1379123e2cc7Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1380123e2cc7Smrgelse
1381123e2cc7Smrg	MALLOC_ZERO_CFLAGS=""
1382123e2cc7Smrg	XMALLOC_ZERO_CFLAGS=""
1383123e2cc7Smrg	XTMALLOC_ZERO_CFLAGS=""
1384123e2cc7Smrgfi
13857da8b7e3Smrg
1386123e2cc7SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1387123e2cc7SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1388123e2cc7SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1389123e2cc7Smrg]) # XORG_CHECK_MALLOC_ZERO
13907da8b7e3Smrg
1391123e2cc7Smrg# XORG_WITH_LINT()
1392123e2cc7Smrg# ----------------
1393123e2cc7Smrg# Minimum version: 1.1.0
13947da8b7e3Smrg#
1395123e2cc7Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
1396123e2cc7Smrg# is specified.   (Use --with-lint=sparse for sparse.)
1397123e2cc7Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1398123e2cc7Smrg# Sets $LINT_FLAGS to flags to pass to source checker
1399123e2cc7Smrg# Sets LINT automake conditional if enabled (default: disabled)
1400123e2cc7Smrg#
1401123e2cc7SmrgAC_DEFUN([XORG_WITH_LINT],[
1402123e2cc7Smrg
1403123e2cc7Smrg# Allow checking code with lint, sparse, etc.
1404123e2cc7SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1405123e2cc7Smrg		[Use a lint-style source code checker (default: disabled)])],
1406123e2cc7Smrg		[use_lint=$withval], [use_lint=no])
1407123e2cc7Smrgif test "x$use_lint" = "xyes" ; then
1408123e2cc7Smrg	LINT="lint"
14097da8b7e3Smrgelse
1410123e2cc7Smrg	LINT="$use_lint"
1411123e2cc7Smrgfi
1412123e2cc7Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1413123e2cc7Smrg    case $LINT in
1414123e2cc7Smrg	lint|*/lint)
1415123e2cc7Smrg	    case $host_os in
1416123e2cc7Smrg		solaris*)
1417123e2cc7Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1418123e2cc7Smrg			;;
1419123e2cc7Smrg	    esac
1420123e2cc7Smrg	    ;;
1421123e2cc7Smrg    esac
14227da8b7e3Smrgfi
14237da8b7e3Smrg
1424123e2cc7SmrgAC_SUBST(LINT)
1425123e2cc7SmrgAC_SUBST(LINT_FLAGS)
1426123e2cc7SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
14277da8b7e3Smrg
1428123e2cc7Smrg]) # XORG_WITH_LINT
14297da8b7e3Smrg
1430123e2cc7Smrg# XORG_LINT_LIBRARY(LIBNAME)
1431123e2cc7Smrg# --------------------------
1432123e2cc7Smrg# Minimum version: 1.1.0
1433123e2cc7Smrg#
1434123e2cc7Smrg# Sets up flags for building lint libraries for checking programs that call
1435123e2cc7Smrg# functions in the library.
1436123e2cc7Smrg# Disabled by default, enable with --enable-lint-library
1437123e2cc7Smrg# Sets: 
1438123e2cc7Smrg#	@LINTLIB@		- name of lint library file to make
1439123e2cc7Smrg#	MAKE_LINT_LIB		- automake conditional
1440123e2cc7Smrg#
14417da8b7e3Smrg
1442123e2cc7SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1443123e2cc7SmrgAC_REQUIRE([XORG_WITH_LINT])
1444123e2cc7Smrg# Build lint "library" for more indepth checks of programs calling this library
1445123e2cc7SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1446123e2cc7Smrg	[Create lint library (default: disabled)])],
1447123e2cc7Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1448123e2cc7Smrgif test "x$make_lint_lib" != "xno" ; then
1449123e2cc7Smrg	if test "x$LINT" = "xno" ; then
1450123e2cc7Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1451123e2cc7Smrg	fi
1452123e2cc7Smrg	if test "x$make_lint_lib" = "xyes" ; then
1453123e2cc7Smrg		LINTLIB=llib-l$1.ln
1454123e2cc7Smrg	else
1455123e2cc7Smrg		LINTLIB=$make_lint_lib
1456123e2cc7Smrg	fi
1457123e2cc7Smrgfi
1458123e2cc7SmrgAC_SUBST(LINTLIB)
1459123e2cc7SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
14607da8b7e3Smrg
1461123e2cc7Smrg]) # XORG_LINT_LIBRARY
14627da8b7e3Smrg
1463123e2cc7Smrg# XORG_CWARNFLAGS
1464123e2cc7Smrg# ---------------
1465123e2cc7Smrg# Minimum version: 1.2.0
1466123e2cc7Smrg#
1467123e2cc7Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1468123e2cc7Smrg#
1469123e2cc7SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1470123e2cc7SmrgAC_REQUIRE([AC_PROG_CC])
1471123e2cc7Smrgif  test "x$GCC" = xyes ; then
1472123e2cc7Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1473123e2cc7Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1474123e2cc7Smrg-Wbad-function-cast"
1475123e2cc7Smrg    case `$CC -dumpversion` in
1476123e2cc7Smrg    3.4.* | 4.*)
1477123e2cc7Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1478123e2cc7Smrg	;;
1479123e2cc7Smrg    esac
1480123e2cc7Smrgelse
1481123e2cc7Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1482123e2cc7Smrg    if test "x$SUNCC" = "xyes"; then
1483123e2cc7Smrg	CWARNFLAGS="-v"
1484123e2cc7Smrg    fi
1485123e2cc7Smrgfi
1486123e2cc7SmrgAC_SUBST(CWARNFLAGS)
1487123e2cc7Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
1488123e2cc7Smrg]) # XORG_CWARNFLAGS
14897da8b7e3Smrg
1490123e2cc7Smrg# XORG_STRICT_OPTION
1491123e2cc7Smrg# -----------------------
1492123e2cc7Smrg# Minimum version: 1.3.0
14937da8b7e3Smrg#
1494123e2cc7Smrg# Add configure option to enable strict compilation
1495123e2cc7SmrgAC_DEFUN([XORG_STRICT_OPTION], [
1496123e2cc7SmrgAC_REQUIRE([AC_PROG_CC])
1497123e2cc7SmrgAC_REQUIRE([AC_PROG_CC_C99])
1498123e2cc7SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1499123e2cc7Smrg
1500123e2cc7SmrgAC_ARG_ENABLE(strict-compilation,
1501123e2cc7Smrg			  AS_HELP_STRING([--enable-strict-compilation],
1502123e2cc7Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1503123e2cc7Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1504123e2cc7Smrgif test "x$STRICT_COMPILE" = "xyes"; then
1505123e2cc7Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1506123e2cc7Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1507123e2cc7Smrg	if test "x$GCC" = xyes ; then
1508123e2cc7Smrg		STRICT_CFLAGS="-pedantic -Werror"
1509123e2cc7Smrg	elif test "x$SUNCC" = "xyes"; then
1510123e2cc7Smrg		STRICT_CFLAGS="-errwarn"
1511123e2cc7Smrg    elif test "x$INTELCC" = "xyes"; then
1512123e2cc7Smrg		STRICT_CFLAGS="-Werror"
1513123e2cc7Smrg	fi
1514123e2cc7Smrgfi
1515123e2cc7SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1516123e2cc7SmrgAC_SUBST([CWARNFLAGS])
1517123e2cc7Smrg]) # XORG_STRICT_OPTION
15187da8b7e3Smrg
1519123e2cc7Smrg# XORG_DEFAULT_OPTIONS
1520123e2cc7Smrg# --------------------
1521123e2cc7Smrg# Minimum version: 1.3.0
1522123e2cc7Smrg#
1523123e2cc7Smrg# Defines default options for X.Org modules.
1524123e2cc7Smrg#
1525123e2cc7SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1526123e2cc7SmrgXORG_CWARNFLAGS
1527123e2cc7SmrgXORG_STRICT_OPTION
1528123e2cc7SmrgXORG_RELEASE_VERSION
1529123e2cc7SmrgXORG_CHANGELOG
1530123e2cc7SmrgXORG_MANPAGE_SECTIONS
1531123e2cc7Smrg]) # XORG_DEFAULT_OPTIONS
1532123e2cc7Smrgdnl Copyright 2005 Red Hat, Inc
1533123e2cc7Smrgdnl
1534123e2cc7Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1535123e2cc7Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1536123e2cc7Smrgdnl the above copyright notice appear in all copies and that both that
1537123e2cc7Smrgdnl copyright notice and this permission notice appear in supporting
1538123e2cc7Smrgdnl documentation.
1539123e2cc7Smrgdnl
1540123e2cc7Smrgdnl The above copyright notice and this permission notice shall be included
1541123e2cc7Smrgdnl in all copies or substantial portions of the Software.
1542123e2cc7Smrgdnl
1543123e2cc7Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1544123e2cc7Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1545123e2cc7Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1546123e2cc7Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1547123e2cc7Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1548123e2cc7Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1549123e2cc7Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1550123e2cc7Smrgdnl
1551123e2cc7Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1552123e2cc7Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1553123e2cc7Smrgdnl other dealings in this Software without prior written authorization
1554123e2cc7Smrgdnl from the copyright holders.
1555123e2cc7Smrgdnl
15567da8b7e3Smrg
1557123e2cc7Smrg# XORG_RELEASE_VERSION
1558123e2cc7Smrg# --------------------
1559123e2cc7Smrg# Adds --with/without-release-string and changes the PACKAGE and
1560123e2cc7Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1561123e2cc7Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1562123e2cc7Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1563123e2cc7Smrg 
1564123e2cc7SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1565123e2cc7Smrg	AC_ARG_WITH(release-version,
1566123e2cc7Smrg			AS_HELP_STRING([--with-release-version=STRING],
1567123e2cc7Smrg				[Use release version string in package name]),
1568123e2cc7Smrg			[RELEASE_VERSION="$withval"],
1569123e2cc7Smrg			[RELEASE_VERSION=""])
1570123e2cc7Smrg	if test "x$RELEASE_VERSION" != "x"; then
1571123e2cc7Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1572123e2cc7Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1573123e2cc7Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1574123e2cc7Smrg	fi
1575123e2cc7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1576123e2cc7Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1577123e2cc7Smrg		[Major version of this package])
1578123e2cc7Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1579123e2cc7Smrg	if test "x$PVM" = "x"; then
1580123e2cc7Smrg		PVM="0"
1581123e2cc7Smrg	fi
1582123e2cc7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1583123e2cc7Smrg		[$PVM],
1584123e2cc7Smrg		[Minor version of this package])
1585123e2cc7Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1586123e2cc7Smrg	if test "x$PVP" = "x"; then
1587123e2cc7Smrg		PVP="0"
1588123e2cc7Smrg	fi
1589123e2cc7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1590123e2cc7Smrg		[$PVP],
1591123e2cc7Smrg		[Patch version of this package])
15927da8b7e3Smrg])
15937da8b7e3Smrg
1594123e2cc7Smrg# XORG_CHANGELOG()
1595123e2cc7Smrg# ----------------
1596123e2cc7Smrg# Minimum version: 1.2.0
1597123e2cc7Smrg#
1598123e2cc7Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1599123e2cc7Smrg# ChangeLog from git.
1600123e2cc7Smrg#
1601123e2cc7Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1602123e2cc7Smrg#
1603123e2cc7SmrgAC_DEFUN([XORG_CHANGELOG], [
1604123e2cc7SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
1605123e2cc7Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
1606123e2cc7Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1607123e2cc7SmrgAC_SUBST([CHANGELOG_CMD])
1608123e2cc7SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
1609123e2cc7Smrg]) # XORG_CHANGELOG
16107da8b7e3Smrg
1611123e2cc7Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1612123e2cc7Smrg# 
1613123e2cc7Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
16147da8b7e3Smrg#
1615123e2cc7Smrg# This program is free software; you can redistribute it and/or modify
1616123e2cc7Smrg# it under the terms of the GNU General Public License as published by
1617123e2cc7Smrg# the Free Software Foundation; either version 2 of the License, or
1618123e2cc7Smrg# (at your option) any later version.
1619123e2cc7Smrg#
1620123e2cc7Smrg# This program is distributed in the hope that it will be useful, but
1621123e2cc7Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1622123e2cc7Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1623123e2cc7Smrg# General Public License for more details.
1624123e2cc7Smrg#
1625123e2cc7Smrg# You should have received a copy of the GNU General Public License
1626123e2cc7Smrg# along with this program; if not, write to the Free Software
1627123e2cc7Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1628123e2cc7Smrg#
1629123e2cc7Smrg# As a special exception to the GNU General Public License, if you
1630123e2cc7Smrg# distribute this file as part of a program that contains a
1631123e2cc7Smrg# configuration script generated by Autoconf, you may include it under
1632123e2cc7Smrg# the same distribution terms that you use for the rest of that program.
16337da8b7e3Smrg
1634123e2cc7Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1635123e2cc7Smrg# ----------------------------------
1636123e2cc7SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
1637123e2cc7Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1638123e2cc7Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1639123e2cc7SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1640123e2cc7Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1641123e2cc7Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1642123e2cc7Smrgfi
1643123e2cc7Smrgif test -n "$PKG_CONFIG"; then
1644123e2cc7Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
1645123e2cc7Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1646123e2cc7Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1647123e2cc7Smrg		AC_MSG_RESULT([yes])
1648123e2cc7Smrg	else
1649123e2cc7Smrg		AC_MSG_RESULT([no])
1650123e2cc7Smrg		PKG_CONFIG=""
1651123e2cc7Smrg	fi
1652123e2cc7Smrg		
1653123e2cc7Smrgfi[]dnl
1654123e2cc7Smrg])# PKG_PROG_PKG_CONFIG
16557da8b7e3Smrg
1656123e2cc7Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1657123e2cc7Smrg#
1658123e2cc7Smrg# Check to see whether a particular set of modules exists.  Similar
1659123e2cc7Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1660123e2cc7Smrg#
1661123e2cc7Smrg#
1662123e2cc7Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1663123e2cc7Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
1664123e2cc7Smrg# PKG_CHECK_EXISTS manually
1665123e2cc7Smrg# --------------------------------------------------------------
1666123e2cc7SmrgAC_DEFUN([PKG_CHECK_EXISTS],
1667123e2cc7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1668123e2cc7Smrgif test -n "$PKG_CONFIG" && \
1669123e2cc7Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1670123e2cc7Smrg  m4_ifval([$2], [$2], [:])
1671123e2cc7Smrgm4_ifvaln([$3], [else
1672123e2cc7Smrg  $3])dnl
1673123e2cc7Smrgfi])
16747da8b7e3Smrg
16757da8b7e3Smrg
1676123e2cc7Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1677123e2cc7Smrg# ---------------------------------------------
1678123e2cc7Smrgm4_define([_PKG_CONFIG],
1679123e2cc7Smrg[if test -n "$$1"; then
1680123e2cc7Smrg    pkg_cv_[]$1="$$1"
1681123e2cc7Smrg elif test -n "$PKG_CONFIG"; then
1682123e2cc7Smrg    PKG_CHECK_EXISTS([$3],
1683123e2cc7Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1684123e2cc7Smrg		     [pkg_failed=yes])
1685123e2cc7Smrg else
1686123e2cc7Smrg    pkg_failed=untried
1687123e2cc7Smrgfi[]dnl
1688123e2cc7Smrg])# _PKG_CONFIG
1689123e2cc7Smrg
1690123e2cc7Smrg# _PKG_SHORT_ERRORS_SUPPORTED
1691123e2cc7Smrg# -----------------------------
1692123e2cc7SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1693123e2cc7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1694123e2cc7Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1695123e2cc7Smrg        _pkg_short_errors_supported=yes
16967da8b7e3Smrgelse
1697123e2cc7Smrg        _pkg_short_errors_supported=no
1698123e2cc7Smrgfi[]dnl
1699123e2cc7Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
17007da8b7e3Smrg
17017da8b7e3Smrg
1702123e2cc7Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1703123e2cc7Smrg# [ACTION-IF-NOT-FOUND])
17047da8b7e3Smrg#
17057da8b7e3Smrg#
1706123e2cc7Smrg# Note that if there is a possibility the first call to
1707123e2cc7Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
1708123e2cc7Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
17097da8b7e3Smrg#
17107da8b7e3Smrg#
1711123e2cc7Smrg# --------------------------------------------------------------
1712123e2cc7SmrgAC_DEFUN([PKG_CHECK_MODULES],
1713123e2cc7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1714123e2cc7SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1715123e2cc7SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
17167da8b7e3Smrg
1717123e2cc7Smrgpkg_failed=no
1718123e2cc7SmrgAC_MSG_CHECKING([for $1])
17197da8b7e3Smrg
1720123e2cc7Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1721123e2cc7Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
17227da8b7e3Smrg
1723123e2cc7Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1724123e2cc7Smrgand $1[]_LIBS to avoid the need to call pkg-config.
1725123e2cc7SmrgSee the pkg-config man page for more details.])
17267da8b7e3Smrg
1727123e2cc7Smrgif test $pkg_failed = yes; then
1728123e2cc7Smrg        _PKG_SHORT_ERRORS_SUPPORTED
1729123e2cc7Smrg        if test $_pkg_short_errors_supported = yes; then
1730123e2cc7Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1731123e2cc7Smrg        else 
1732123e2cc7Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1733123e2cc7Smrg        fi
1734123e2cc7Smrg	# Put the nasty error message in config.log where it belongs
1735123e2cc7Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
17367da8b7e3Smrg
1737123e2cc7Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
1738123e2cc7Smrg[Package requirements ($2) were not met:
17397da8b7e3Smrg
1740123e2cc7Smrg$$1_PKG_ERRORS
17417da8b7e3Smrg
1742123e2cc7SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1743123e2cc7Smrginstalled software in a non-standard prefix.
17447da8b7e3Smrg
1745123e2cc7Smrg_PKG_TEXT
1746123e2cc7Smrg])],
1747123e2cc7Smrg		[AC_MSG_RESULT([no])
1748123e2cc7Smrg                $4])
1749123e2cc7Smrgelif test $pkg_failed = untried; then
1750123e2cc7Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
1751123e2cc7Smrg[The pkg-config script could not be found or is too old.  Make sure it
1752123e2cc7Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
1753123e2cc7Smrgpath to pkg-config.
17547da8b7e3Smrg
1755123e2cc7Smrg_PKG_TEXT
17567da8b7e3Smrg
1757123e2cc7SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1758123e2cc7Smrg		[$4])
17597da8b7e3Smrgelse
1760123e2cc7Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1761123e2cc7Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1762123e2cc7Smrg        AC_MSG_RESULT([yes])
1763123e2cc7Smrg	ifelse([$3], , :, [$3])
1764123e2cc7Smrgfi[]dnl
1765123e2cc7Smrg])# PKG_CHECK_MODULES
17667da8b7e3Smrg
1767