aclocal.m4 revision 9ef7378b
19ef7378bSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2c19de146Smrg
39ef7378bSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
49ef7378bSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5c19de146Smrg# This file is free software; the Free Software Foundation
6c19de146Smrg# gives unlimited permission to copy and/or distribute it,
7c19de146Smrg# with or without modifications, as long as this notice is preserved.
8c19de146Smrg
9c19de146Smrg# This program is distributed in the hope that it will be useful,
10c19de146Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11c19de146Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12c19de146Smrg# PARTICULAR PURPOSE.
13c19de146Smrg
149ef7378bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
159ef7378bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
169ef7378bSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
179ef7378bSmrg[m4_warning([this file was generated for autoconf 2.65.
189ef7378bSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
199ef7378bSmrgIf you have problems, you may need to regenerate the build system entirely.
209ef7378bSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21c19de146Smrg
229ef7378bSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
239ef7378bSmrg#
249ef7378bSmrg# This file is free software; the Free Software Foundation
259ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
269ef7378bSmrg# with or without modifications, as long as this notice is preserved.
27c19de146Smrg
28c19de146Smrg# AM_AUTOMAKE_VERSION(VERSION)
29c19de146Smrg# ----------------------------
30c19de146Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31c19de146Smrg# generated from the m4 files accompanying Automake X.Y.
329ef7378bSmrg# (This private macro should not be called outside this file.)
339ef7378bSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
349ef7378bSmrg[am__api_version='1.11'
359ef7378bSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
369ef7378bSmrgdnl require some minimum version.  Point them to the right macro.
379ef7378bSmrgm4_if([$1], [1.11.1], [],
389ef7378bSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
399ef7378bSmrg])
409ef7378bSmrg
419ef7378bSmrg# _AM_AUTOCONF_VERSION(VERSION)
429ef7378bSmrg# -----------------------------
439ef7378bSmrg# aclocal traces this macro to find the Autoconf version.
449ef7378bSmrg# This is a private macro too.  Using m4_define simplifies
459ef7378bSmrg# the logic in aclocal, which can simply ignore this definition.
469ef7378bSmrgm4_define([_AM_AUTOCONF_VERSION], [])
47c19de146Smrg
48c19de146Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49c19de146Smrg# -------------------------------
509ef7378bSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
519ef7378bSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52c19de146SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
539ef7378bSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
549ef7378bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
559ef7378bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
569ef7378bSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57c19de146Smrg
589ef7378bSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59c19de146Smrg
609ef7378bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61c19de146Smrg#
629ef7378bSmrg# This file is free software; the Free Software Foundation
639ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
649ef7378bSmrg# with or without modifications, as long as this notice is preserved.
65c19de146Smrg
66c19de146Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67c19de146Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68c19de146Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69c19de146Smrg#
70c19de146Smrg# Of course, Automake must honor this variable whenever it calls a
71c19de146Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72c19de146Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73c19de146Smrg# depending on how configure is run.  This is pretty annoying, since
74c19de146Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75c19de146Smrg# source directory, any form will work fine, but in subdirectories a
76c19de146Smrg# relative path needs to be adjusted first.
77c19de146Smrg#
78c19de146Smrg# $ac_aux_dir/missing
79c19de146Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80c19de146Smrg# $top_srcdir/$ac_aux_dir/missing
81c19de146Smrg#    fails if $ac_aux_dir is absolute,
82c19de146Smrg#    fails when called from a subdirectory in a VPATH build with
83c19de146Smrg#          a relative $ac_aux_dir
84c19de146Smrg#
85c19de146Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86c19de146Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
87c19de146Smrg# harmless because $srcdir is `.', but things will broke when you
88c19de146Smrg# start a VPATH build or use an absolute $srcdir.
89c19de146Smrg#
90c19de146Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91c19de146Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92c19de146Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93c19de146Smrg# and then we would define $MISSING as
94c19de146Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95c19de146Smrg# This will work as long as MISSING is not called from configure, because
96c19de146Smrg# unfortunately $(top_srcdir) has no meaning in configure.
97c19de146Smrg# However there are other variables, like CC, which are often used in
98c19de146Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99c19de146Smrg#
100c19de146Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
101c19de146Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
102c19de146Smrg# configured tree to be moved without reconfiguration.
103c19de146Smrg
1049ef7378bSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1059ef7378bSmrg[dnl Rely on autoconf to set up CDPATH properly.
1069ef7378bSmrgAC_PREREQ([2.50])dnl
107c19de146Smrg# expand $ac_aux_dir to an absolute path
108c19de146Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
109c19de146Smrg])
110c19de146Smrg
1119ef7378bSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112c19de146Smrg
1139ef7378bSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1149ef7378bSmrg# Free Software Foundation, Inc.
1159ef7378bSmrg#
1169ef7378bSmrg# This file is free software; the Free Software Foundation
1179ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
1189ef7378bSmrg# with or without modifications, as long as this notice is preserved.
119c19de146Smrg
1209ef7378bSmrg# serial 9
121c19de146Smrg
1229ef7378bSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1239ef7378bSmrg# -------------------------------------
1249ef7378bSmrg# Define a conditional.
1259ef7378bSmrgAC_DEFUN([AM_CONDITIONAL],
1269ef7378bSmrg[AC_PREREQ(2.52)dnl
1279ef7378bSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1289ef7378bSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1299ef7378bSmrgAC_SUBST([$1_TRUE])dnl
1309ef7378bSmrgAC_SUBST([$1_FALSE])dnl
1319ef7378bSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1329ef7378bSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1339ef7378bSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1349ef7378bSmrgif $2; then
1359ef7378bSmrg  $1_TRUE=
1369ef7378bSmrg  $1_FALSE='#'
137c19de146Smrgelse
1389ef7378bSmrg  $1_TRUE='#'
1399ef7378bSmrg  $1_FALSE=
140c19de146Smrgfi
1419ef7378bSmrgAC_CONFIG_COMMANDS_PRE(
1429ef7378bSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1439ef7378bSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1449ef7378bSmrgUsually this means the macro was only invoked conditionally.]])
1459ef7378bSmrgfi])])
146c19de146Smrg
1479ef7378bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1489ef7378bSmrg# Free Software Foundation, Inc.
1499ef7378bSmrg#
1509ef7378bSmrg# This file is free software; the Free Software Foundation
1519ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
1529ef7378bSmrg# with or without modifications, as long as this notice is preserved.
153c19de146Smrg
1549ef7378bSmrg# serial 10
155c19de146Smrg
156c19de146Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157c19de146Smrg# written in clear, in which case automake, when reading aclocal.m4,
158c19de146Smrg# will think it sees a *use*, and therefore will trigger all it's
159c19de146Smrg# C support machinery.  Also note that it means that autoscan, seeing
160c19de146Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161c19de146Smrg
162c19de146Smrg
163c19de146Smrg# _AM_DEPENDENCIES(NAME)
164c19de146Smrg# ----------------------
165c19de146Smrg# See how the compiler implements dependency checking.
166c19de146Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167c19de146Smrg# We try a few techniques and use that to set a single cache variable.
168c19de146Smrg#
169c19de146Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170c19de146Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171c19de146Smrg# dependency, and given that the user is not expected to run this macro,
172c19de146Smrg# just rely on AC_PROG_CC.
173c19de146SmrgAC_DEFUN([_AM_DEPENDENCIES],
174c19de146Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175c19de146SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176c19de146SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177c19de146SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178c19de146Smrg
179c19de146Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180c19de146Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181c19de146Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1829ef7378bSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183c19de146Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184c19de146Smrg                   [depcc="$$1"   am_compiler_list=])
185c19de146Smrg
186c19de146SmrgAC_CACHE_CHECK([dependency style of $depcc],
187c19de146Smrg               [am_cv_$1_dependencies_compiler_type],
188c19de146Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189c19de146Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
190c19de146Smrg  # making bogus files that we don't know about and never remove.  For
191c19de146Smrg  # instance it was reported that on HP-UX the gcc test will end up
192c19de146Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
193c19de146Smrg  # in D'.
194c19de146Smrg  mkdir conftest.dir
195c19de146Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196c19de146Smrg  # using a relative directory.
197c19de146Smrg  cp "$am_depcomp" conftest.dir
198c19de146Smrg  cd conftest.dir
199c19de146Smrg  # We will build objects and dependencies in a subdirectory because
200c19de146Smrg  # it helps to detect inapplicable dependency modes.  For instance
201c19de146Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202c19de146Smrg  # side effect of compilation, but ICC will put the dependencies in
203c19de146Smrg  # the current directory while Tru64 will put them in the object
204c19de146Smrg  # directory.
205c19de146Smrg  mkdir sub
206c19de146Smrg
207c19de146Smrg  am_cv_$1_dependencies_compiler_type=none
208c19de146Smrg  if test "$am_compiler_list" = ""; then
209c19de146Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210c19de146Smrg  fi
2119ef7378bSmrg  am__universal=false
2129ef7378bSmrg  m4_case([$1], [CC],
2139ef7378bSmrg    [case " $depcc " in #(
2149ef7378bSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2159ef7378bSmrg     esac],
2169ef7378bSmrg    [CXX],
2179ef7378bSmrg    [case " $depcc " in #(
2189ef7378bSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2199ef7378bSmrg     esac])
2209ef7378bSmrg
221c19de146Smrg  for depmode in $am_compiler_list; do
222c19de146Smrg    # Setup a source with many dependencies, because some compilers
223c19de146Smrg    # like to wrap large dependency lists on column 80 (with \), and
224c19de146Smrg    # we should not choose a depcomp mode which is confused by this.
225c19de146Smrg    #
226c19de146Smrg    # We need to recreate these files for each test, as the compiler may
227c19de146Smrg    # overwrite some of them when testing with obscure command lines.
228c19de146Smrg    # This happens at least with the AIX C compiler.
229c19de146Smrg    : > sub/conftest.c
230c19de146Smrg    for i in 1 2 3 4 5 6; do
231c19de146Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2329ef7378bSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2339ef7378bSmrg      # Solaris 8's {/usr,}/bin/sh.
2349ef7378bSmrg      touch sub/conftst$i.h
235c19de146Smrg    done
236c19de146Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237c19de146Smrg
2389ef7378bSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2399ef7378bSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2409ef7378bSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
2419ef7378bSmrg    # versions had trouble with output in subdirs
2429ef7378bSmrg    am__obj=sub/conftest.${OBJEXT-o}
2439ef7378bSmrg    am__minus_obj="-o $am__obj"
244c19de146Smrg    case $depmode in
2459ef7378bSmrg    gcc)
2469ef7378bSmrg      # This depmode causes a compiler race in universal mode.
2479ef7378bSmrg      test "$am__universal" = false || continue
2489ef7378bSmrg      ;;
249c19de146Smrg    nosideeffect)
250c19de146Smrg      # after this tag, mechanisms are not by side-effect, so they'll
251c19de146Smrg      # only be used when explicitly requested
252c19de146Smrg      if test "x$enable_dependency_tracking" = xyes; then
253c19de146Smrg	continue
254c19de146Smrg      else
255c19de146Smrg	break
256c19de146Smrg      fi
257c19de146Smrg      ;;
2589ef7378bSmrg    msvisualcpp | msvcmsys)
2599ef7378bSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
2609ef7378bSmrg      # not run yet.  These depmodes are late enough in the game, and
2619ef7378bSmrg      # so weak that their functioning should not be impacted.
2629ef7378bSmrg      am__obj=conftest.${OBJEXT-o}
2639ef7378bSmrg      am__minus_obj=
2649ef7378bSmrg      ;;
265c19de146Smrg    none) break ;;
266c19de146Smrg    esac
267c19de146Smrg    if depmode=$depmode \
2689ef7378bSmrg       source=sub/conftest.c object=$am__obj \
269c19de146Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2709ef7378bSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271c19de146Smrg         >/dev/null 2>conftest.err &&
2729ef7378bSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273c19de146Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2749ef7378bSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275c19de146Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276c19de146Smrg      # icc doesn't choke on unknown options, it will just issue warnings
2779ef7378bSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
2789ef7378bSmrg      # that says an option was ignored or not supported.
2799ef7378bSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2809ef7378bSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2819ef7378bSmrg      # The diagnosis changed in icc 8.0:
2829ef7378bSmrg      #   icc: Command line remark: option '-MP' not supported
2839ef7378bSmrg      if (grep 'ignoring option' conftest.err ||
2849ef7378bSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285c19de146Smrg        am_cv_$1_dependencies_compiler_type=$depmode
286c19de146Smrg        break
287c19de146Smrg      fi
288c19de146Smrg    fi
289c19de146Smrg  done
290c19de146Smrg
291c19de146Smrg  cd ..
292c19de146Smrg  rm -rf conftest.dir
293c19de146Smrgelse
294c19de146Smrg  am_cv_$1_dependencies_compiler_type=none
295c19de146Smrgfi
296c19de146Smrg])
297c19de146SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298c19de146SmrgAM_CONDITIONAL([am__fastdep$1], [
299c19de146Smrg  test "x$enable_dependency_tracking" != xno \
300c19de146Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301c19de146Smrg])
302c19de146Smrg
303c19de146Smrg
304c19de146Smrg# AM_SET_DEPDIR
305c19de146Smrg# -------------
306c19de146Smrg# Choose a directory name for dependency files.
307c19de146Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308c19de146SmrgAC_DEFUN([AM_SET_DEPDIR],
309c19de146Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310c19de146SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311c19de146Smrg])
312c19de146Smrg
313c19de146Smrg
314c19de146Smrg# AM_DEP_TRACK
315c19de146Smrg# ------------
316c19de146SmrgAC_DEFUN([AM_DEP_TRACK],
317c19de146Smrg[AC_ARG_ENABLE(dependency-tracking,
3189ef7378bSmrg[  --disable-dependency-tracking  speeds up one-time build
3199ef7378bSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320c19de146Smrgif test "x$enable_dependency_tracking" != xno; then
321c19de146Smrg  am_depcomp="$ac_aux_dir/depcomp"
322c19de146Smrg  AMDEPBACKSLASH='\'
323c19de146Smrgfi
324c19de146SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3259ef7378bSmrgAC_SUBST([AMDEPBACKSLASH])dnl
3269ef7378bSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327c19de146Smrg])
328c19de146Smrg
3299ef7378bSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330c19de146Smrg
3319ef7378bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
3329ef7378bSmrg# Free Software Foundation, Inc.
3339ef7378bSmrg#
3349ef7378bSmrg# This file is free software; the Free Software Foundation
3359ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
3369ef7378bSmrg# with or without modifications, as long as this notice is preserved.
337c19de146Smrg
3389ef7378bSmrg#serial 5
339c19de146Smrg
340c19de146Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341c19de146Smrg# ------------------------------
342c19de146SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3439ef7378bSmrg[{
3449ef7378bSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
3459ef7378bSmrg  # are listed without --file.  Let's play safe and only enable the eval
3469ef7378bSmrg  # if we detect the quoting.
3479ef7378bSmrg  case $CONFIG_FILES in
3489ef7378bSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
3499ef7378bSmrg  *)   set x $CONFIG_FILES ;;
3509ef7378bSmrg  esac
3519ef7378bSmrg  shift
3529ef7378bSmrg  for mf
3539ef7378bSmrg  do
3549ef7378bSmrg    # Strip MF so we end up with the name of the file.
3559ef7378bSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3569ef7378bSmrg    # Check whether this is an Automake generated Makefile or not.
3579ef7378bSmrg    # We used to match only the files named `Makefile.in', but
3589ef7378bSmrg    # some people rename them; so instead we look at the file content.
3599ef7378bSmrg    # Grep'ing the first line is not enough: some people post-process
3609ef7378bSmrg    # each Makefile.in and add a new line on top of each file to say so.
3619ef7378bSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
3629ef7378bSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
3639ef7378bSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3649ef7378bSmrg      dirpart=`AS_DIRNAME("$mf")`
3659ef7378bSmrg    else
3669ef7378bSmrg      continue
3679ef7378bSmrg    fi
3689ef7378bSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
3699ef7378bSmrg    # from the Makefile without running `make'.
3709ef7378bSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3719ef7378bSmrg    test -z "$DEPDIR" && continue
3729ef7378bSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3739ef7378bSmrg    test -z "am__include" && continue
3749ef7378bSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3759ef7378bSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
3769ef7378bSmrg    U=`sed -n 's/^U = //p' < "$mf"`
3779ef7378bSmrg    # Find all dependency output files, they are included files with
3789ef7378bSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3799ef7378bSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3809ef7378bSmrg    # expansion.
3819ef7378bSmrg    for file in `sed -n "
3829ef7378bSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3839ef7378bSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3849ef7378bSmrg      # Make sure the directory exists.
3859ef7378bSmrg      test -f "$dirpart/$file" && continue
3869ef7378bSmrg      fdir=`AS_DIRNAME(["$file"])`
3879ef7378bSmrg      AS_MKDIR_P([$dirpart/$fdir])
3889ef7378bSmrg      # echo "creating $dirpart/$file"
3899ef7378bSmrg      echo '# dummy' > "$dirpart/$file"
3909ef7378bSmrg    done
391c19de146Smrg  done
3929ef7378bSmrg}
393c19de146Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394c19de146Smrg
395c19de146Smrg
396c19de146Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397c19de146Smrg# -----------------------------
398c19de146Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
399c19de146Smrg#
400c19de146Smrg# This code is only required when automatic dependency tracking
401c19de146Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
402c19de146Smrg# need in order to bootstrap the dependency handling code.
403c19de146SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404c19de146Smrg[AC_CONFIG_COMMANDS([depfiles],
405c19de146Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406c19de146Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407c19de146Smrg])
408c19de146Smrg
4099ef7378bSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
4109ef7378bSmrg# Free Software Foundation, Inc.
4119ef7378bSmrg#
4129ef7378bSmrg# This file is free software; the Free Software Foundation
4139ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
4149ef7378bSmrg# with or without modifications, as long as this notice is preserved.
415c19de146Smrg
4169ef7378bSmrg# serial 8
417c19de146Smrg
4189ef7378bSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
4199ef7378bSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
420c19de146Smrg
4219ef7378bSmrg# Do all the work for Automake.                             -*- Autoconf -*-
422c19de146Smrg
4239ef7378bSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4249ef7378bSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4259ef7378bSmrg#
4269ef7378bSmrg# This file is free software; the Free Software Foundation
4279ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
4289ef7378bSmrg# with or without modifications, as long as this notice is preserved.
429c19de146Smrg
4309ef7378bSmrg# serial 16
431c19de146Smrg
4329ef7378bSmrg# This macro actually does too much.  Some checks are only needed if
4339ef7378bSmrg# your package does certain things.  But this isn't really a big deal.
4349ef7378bSmrg
4359ef7378bSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4369ef7378bSmrg# AM_INIT_AUTOMAKE([OPTIONS])
4379ef7378bSmrg# -----------------------------------------------
4389ef7378bSmrg# The call with PACKAGE and VERSION arguments is the old style
4399ef7378bSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
4409ef7378bSmrg# and VERSION should now be passed to AC_INIT and removed from
4419ef7378bSmrg# the call to AM_INIT_AUTOMAKE.
4429ef7378bSmrg# We support both call styles for the transition.  After
4439ef7378bSmrg# the next Automake release, Autoconf can make the AC_INIT
4449ef7378bSmrg# arguments mandatory, and then we can depend on a new Autoconf
4459ef7378bSmrg# release and drop the old call support.
4469ef7378bSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4479ef7378bSmrg[AC_PREREQ([2.62])dnl
4489ef7378bSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4499ef7378bSmrgdnl the ones we care about.
4509ef7378bSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4519ef7378bSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4529ef7378bSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4539ef7378bSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4549ef7378bSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4559ef7378bSmrg  # is not polluted with repeated "-I."
4569ef7378bSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4579ef7378bSmrg  # test to see if srcdir already configured
4589ef7378bSmrg  if test -f $srcdir/config.status; then
4599ef7378bSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4609ef7378bSmrg  fi
461c19de146Smrgfi
4629ef7378bSmrg
4639ef7378bSmrg# test whether we have cygpath
4649ef7378bSmrgif test -z "$CYGPATH_W"; then
4659ef7378bSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4669ef7378bSmrg    CYGPATH_W='cygpath -w'
4679ef7378bSmrg  else
4689ef7378bSmrg    CYGPATH_W=echo
4699ef7378bSmrg  fi
470c19de146Smrgfi
4719ef7378bSmrgAC_SUBST([CYGPATH_W])
472c19de146Smrg
4739ef7378bSmrg# Define the identity of the package.
4749ef7378bSmrgdnl Distinguish between old-style and new-style calls.
4759ef7378bSmrgm4_ifval([$2],
4769ef7378bSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4779ef7378bSmrg AC_SUBST([PACKAGE], [$1])dnl
4789ef7378bSmrg AC_SUBST([VERSION], [$2])],
4799ef7378bSmrg[_AM_SET_OPTIONS([$1])dnl
4809ef7378bSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4819ef7378bSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4829ef7378bSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4839ef7378bSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4849ef7378bSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
485c19de146Smrg
4869ef7378bSmrg_AM_IF_OPTION([no-define],,
4879ef7378bSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4889ef7378bSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489c19de146Smrg
4909ef7378bSmrg# Some tools Automake needs.
4919ef7378bSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4929ef7378bSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4939ef7378bSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4949ef7378bSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4959ef7378bSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4969ef7378bSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4979ef7378bSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4989ef7378bSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4999ef7378bSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
5009ef7378bSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
5019ef7378bSmrg# We need awk for the "check" target.  The system "awk" is bad on
5029ef7378bSmrg# some platforms.
5039ef7378bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
5049ef7378bSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
5059ef7378bSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
5069ef7378bSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
5079ef7378bSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
5089ef7378bSmrg			     [_AM_PROG_TAR([v7])])])
5099ef7378bSmrg_AM_IF_OPTION([no-dependencies],,
5109ef7378bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
5119ef7378bSmrg		  [_AM_DEPENDENCIES(CC)],
5129ef7378bSmrg		  [define([AC_PROG_CC],
5139ef7378bSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
5149ef7378bSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5159ef7378bSmrg		  [_AM_DEPENDENCIES(CXX)],
5169ef7378bSmrg		  [define([AC_PROG_CXX],
5179ef7378bSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5189ef7378bSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5199ef7378bSmrg		  [_AM_DEPENDENCIES(OBJC)],
5209ef7378bSmrg		  [define([AC_PROG_OBJC],
5219ef7378bSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
5229ef7378bSmrg])
5239ef7378bSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5249ef7378bSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5259ef7378bSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5269ef7378bSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5279ef7378bSmrgAC_CONFIG_COMMANDS_PRE(dnl
5289ef7378bSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5299ef7378bSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5309ef7378bSmrg])
531c19de146Smrg
5329ef7378bSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5339ef7378bSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5349ef7378bSmrgdnl mangled by Autoconf and run in a shell conditional statement.
5359ef7378bSmrgm4_define([_AC_COMPILER_EXEEXT],
5369ef7378bSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537c19de146Smrg
538c19de146Smrg
5399ef7378bSmrg# When config.status generates a header, we must update the stamp-h file.
5409ef7378bSmrg# This file resides in the same directory as the config header
5419ef7378bSmrg# that is generated.  The stamp files are numbered to have different names.
5429ef7378bSmrg
5439ef7378bSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
5449ef7378bSmrg# loop where config.status creates the headers, so we can generate
5459ef7378bSmrg# our stamp files there.
5469ef7378bSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
5479ef7378bSmrg[# Compute $1's index in $config_headers.
5489ef7378bSmrg_am_arg=$1
5499ef7378bSmrg_am_stamp_count=1
5509ef7378bSmrgfor _am_header in $config_headers :; do
5519ef7378bSmrg  case $_am_header in
5529ef7378bSmrg    $_am_arg | $_am_arg:* )
5539ef7378bSmrg      break ;;
5549ef7378bSmrg    * )
5559ef7378bSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5569ef7378bSmrg  esac
5579ef7378bSmrgdone
5589ef7378bSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
559c19de146Smrg
5609ef7378bSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
5619ef7378bSmrg#
5629ef7378bSmrg# This file is free software; the Free Software Foundation
5639ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
5649ef7378bSmrg# with or without modifications, as long as this notice is preserved.
565c19de146Smrg
5669ef7378bSmrg# AM_PROG_INSTALL_SH
5679ef7378bSmrg# ------------------
5689ef7378bSmrg# Define $install_sh.
5699ef7378bSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5709ef7378bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5719ef7378bSmrgif test x"${install_sh}" != xset; then
5729ef7378bSmrg  case $am_aux_dir in
5739ef7378bSmrg  *\ * | *\	*)
5749ef7378bSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5759ef7378bSmrg  *)
5769ef7378bSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5779ef7378bSmrg  esac
578c19de146Smrgfi
5799ef7378bSmrgAC_SUBST(install_sh)])
580c19de146Smrg
5819ef7378bSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5829ef7378bSmrg#
5839ef7378bSmrg# This file is free software; the Free Software Foundation
5849ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
5859ef7378bSmrg# with or without modifications, as long as this notice is preserved.
586c19de146Smrg
5879ef7378bSmrg# serial 2
588c19de146Smrg
5899ef7378bSmrg# Check whether the underlying file-system supports filenames
5909ef7378bSmrg# with a leading dot.  For instance MS-DOS doesn't.
5919ef7378bSmrgAC_DEFUN([AM_SET_LEADING_DOT],
5929ef7378bSmrg[rm -rf .tst 2>/dev/null
5939ef7378bSmrgmkdir .tst 2>/dev/null
5949ef7378bSmrgif test -d .tst; then
5959ef7378bSmrg  am__leading_dot=.
5969ef7378bSmrgelse
5979ef7378bSmrg  am__leading_dot=_
5989ef7378bSmrgfi
5999ef7378bSmrgrmdir .tst 2>/dev/null
6009ef7378bSmrgAC_SUBST([am__leading_dot])])
601c19de146Smrg
6029ef7378bSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
6039ef7378bSmrg# From Jim Meyering
604c19de146Smrg
6059ef7378bSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
6069ef7378bSmrg# Free Software Foundation, Inc.
6079ef7378bSmrg#
6089ef7378bSmrg# This file is free software; the Free Software Foundation
6099ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
6109ef7378bSmrg# with or without modifications, as long as this notice is preserved.
611c19de146Smrg
6129ef7378bSmrg# serial 5
613c19de146Smrg
6149ef7378bSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6159ef7378bSmrg# ----------------------------------
6169ef7378bSmrg# Control maintainer-specific portions of Makefiles.
6179ef7378bSmrg# Default is to disable them, unless `enable' is passed literally.
6189ef7378bSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6199ef7378bSmrg# can override the default with the --enable/--disable switch.
620c19de146SmrgAC_DEFUN([AM_MAINTAINER_MODE],
6219ef7378bSmrg[m4_case(m4_default([$1], [disable]),
6229ef7378bSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
6239ef7378bSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
6249ef7378bSmrg       [m4_define([am_maintainer_other], [enable])
6259ef7378bSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6269ef7378bSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6279ef7378bSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6289ef7378bSmrg  AC_ARG_ENABLE([maintainer-mode],
6299ef7378bSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
6309ef7378bSmrg			  (and sometimes confusing) to the casual installer],
6319ef7378bSmrg      [USE_MAINTAINER_MODE=$enableval],
6329ef7378bSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
633c19de146Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6349ef7378bSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
635c19de146Smrg  MAINT=$MAINTAINER_MODE_TRUE
6369ef7378bSmrg  AC_SUBST([MAINT])dnl
637c19de146Smrg]
638c19de146Smrg)
639c19de146Smrg
640c19de146SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
641c19de146Smrg
6429ef7378bSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
643c19de146Smrg
6449ef7378bSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
6459ef7378bSmrg#
6469ef7378bSmrg# This file is free software; the Free Software Foundation
6479ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
6489ef7378bSmrg# with or without modifications, as long as this notice is preserved.
649c19de146Smrg
6509ef7378bSmrg# serial 4
651c19de146Smrg
6529ef7378bSmrg# AM_MAKE_INCLUDE()
6539ef7378bSmrg# -----------------
6549ef7378bSmrg# Check to see how make treats includes.
6559ef7378bSmrgAC_DEFUN([AM_MAKE_INCLUDE],
6569ef7378bSmrg[am_make=${MAKE-make}
6579ef7378bSmrgcat > confinc << 'END'
6589ef7378bSmrgam__doit:
6599ef7378bSmrg	@echo this is the am__doit target
6609ef7378bSmrg.PHONY: am__doit
6619ef7378bSmrgEND
6629ef7378bSmrg# If we don't find an include directive, just comment out the code.
6639ef7378bSmrgAC_MSG_CHECKING([for style of include used by $am_make])
6649ef7378bSmrgam__include="#"
6659ef7378bSmrgam__quote=
6669ef7378bSmrg_am_result=none
6679ef7378bSmrg# First try GNU make style include.
6689ef7378bSmrgecho "include confinc" > confmf
6699ef7378bSmrg# Ignore all kinds of additional output from `make'.
6709ef7378bSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6719ef7378bSmrg*the\ am__doit\ target*)
6729ef7378bSmrg  am__include=include
6739ef7378bSmrg  am__quote=
6749ef7378bSmrg  _am_result=GNU
6759ef7378bSmrg  ;;
6769ef7378bSmrgesac
6779ef7378bSmrg# Now try BSD make style include.
6789ef7378bSmrgif test "$am__include" = "#"; then
6799ef7378bSmrg   echo '.include "confinc"' > confmf
6809ef7378bSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6819ef7378bSmrg   *the\ am__doit\ target*)
6829ef7378bSmrg     am__include=.include
6839ef7378bSmrg     am__quote="\""
6849ef7378bSmrg     _am_result=BSD
6859ef7378bSmrg     ;;
6869ef7378bSmrg   esac
6879ef7378bSmrgfi
6889ef7378bSmrgAC_SUBST([am__include])
6899ef7378bSmrgAC_SUBST([am__quote])
6909ef7378bSmrgAC_MSG_RESULT([$_am_result])
6919ef7378bSmrgrm -f confinc confmf
6929ef7378bSmrg])
693c19de146Smrg
6949ef7378bSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
695c19de146Smrg
6969ef7378bSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
6979ef7378bSmrg# Free Software Foundation, Inc.
6989ef7378bSmrg#
6999ef7378bSmrg# This file is free software; the Free Software Foundation
7009ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
7019ef7378bSmrg# with or without modifications, as long as this notice is preserved.
702c19de146Smrg
703c19de146Smrg# serial 6
704c19de146Smrg
7059ef7378bSmrg# AM_MISSING_PROG(NAME, PROGRAM)
7069ef7378bSmrg# ------------------------------
7079ef7378bSmrgAC_DEFUN([AM_MISSING_PROG],
7089ef7378bSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
7099ef7378bSmrg$1=${$1-"${am_missing_run}$2"}
7109ef7378bSmrgAC_SUBST($1)])
711c19de146Smrg
712c19de146Smrg
7139ef7378bSmrg# AM_MISSING_HAS_RUN
7149ef7378bSmrg# ------------------
7159ef7378bSmrg# Define MISSING if not defined so far and test if it supports --run.
7169ef7378bSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
7179ef7378bSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7189ef7378bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7199ef7378bSmrgAC_REQUIRE_AUX_FILE([missing])dnl
7209ef7378bSmrgif test x"${MISSING+set}" != xset; then
7219ef7378bSmrg  case $am_aux_dir in
7229ef7378bSmrg  *\ * | *\	*)
7239ef7378bSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7249ef7378bSmrg  *)
7259ef7378bSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7269ef7378bSmrg  esac
7279ef7378bSmrgfi
7289ef7378bSmrg# Use eval to expand $SHELL
7299ef7378bSmrgif eval "$MISSING --run true"; then
7309ef7378bSmrg  am_missing_run="$MISSING --run "
7319ef7378bSmrgelse
7329ef7378bSmrg  am_missing_run=
7339ef7378bSmrg  AC_MSG_WARN([`missing' script is too old or missing])
7349ef7378bSmrgfi
7359ef7378bSmrg])
736c19de146Smrg
7379ef7378bSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
7389ef7378bSmrg#
7399ef7378bSmrg# This file is free software; the Free Software Foundation
7409ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
7419ef7378bSmrg# with or without modifications, as long as this notice is preserved.
742c19de146Smrg
7439ef7378bSmrg# AM_PROG_MKDIR_P
7449ef7378bSmrg# ---------------
7459ef7378bSmrg# Check for `mkdir -p'.
7469ef7378bSmrgAC_DEFUN([AM_PROG_MKDIR_P],
7479ef7378bSmrg[AC_PREREQ([2.60])dnl
7489ef7378bSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7499ef7378bSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7509ef7378bSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
7519ef7378bSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7529ef7378bSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7539ef7378bSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7549ef7378bSmrgdnl adjustment using top_builddir (which is defined more often than
7559ef7378bSmrgdnl MKDIR_P).
7569ef7378bSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7579ef7378bSmrgcase $mkdir_p in
7589ef7378bSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7599ef7378bSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7609ef7378bSmrgesac
761c19de146Smrg])
762c19de146Smrg
7639ef7378bSmrg# Helper functions for option handling.                     -*- Autoconf -*-
7649ef7378bSmrg
7659ef7378bSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
766c19de146Smrg#
7679ef7378bSmrg# This file is free software; the Free Software Foundation
7689ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
7699ef7378bSmrg# with or without modifications, as long as this notice is preserved.
770c19de146Smrg
7719ef7378bSmrg# serial 4
7729ef7378bSmrg
7739ef7378bSmrg# _AM_MANGLE_OPTION(NAME)
7749ef7378bSmrg# -----------------------
7759ef7378bSmrgAC_DEFUN([_AM_MANGLE_OPTION],
7769ef7378bSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7779ef7378bSmrg
7789ef7378bSmrg# _AM_SET_OPTION(NAME)
7799ef7378bSmrg# ------------------------------
7809ef7378bSmrg# Set option NAME.  Presently that only means defining a flag for this option.
7819ef7378bSmrgAC_DEFUN([_AM_SET_OPTION],
7829ef7378bSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7839ef7378bSmrg
7849ef7378bSmrg# _AM_SET_OPTIONS(OPTIONS)
785c19de146Smrg# ----------------------------------
7869ef7378bSmrg# OPTIONS is a space-separated list of Automake options.
7879ef7378bSmrgAC_DEFUN([_AM_SET_OPTIONS],
7889ef7378bSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
789c19de146Smrg
7909ef7378bSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7919ef7378bSmrg# -------------------------------------------
7929ef7378bSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7939ef7378bSmrgAC_DEFUN([_AM_IF_OPTION],
7949ef7378bSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7959ef7378bSmrg
7969ef7378bSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7979ef7378bSmrg
7989ef7378bSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
7999ef7378bSmrg# Free Software Foundation, Inc.
800c19de146Smrg#
8019ef7378bSmrg# This file is free software; the Free Software Foundation
8029ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
8039ef7378bSmrg# with or without modifications, as long as this notice is preserved.
804c19de146Smrg
8059ef7378bSmrg# serial 5
806c19de146Smrg
8079ef7378bSmrg# AM_SANITY_CHECK
8089ef7378bSmrg# ---------------
8099ef7378bSmrgAC_DEFUN([AM_SANITY_CHECK],
8109ef7378bSmrg[AC_MSG_CHECKING([whether build environment is sane])
8119ef7378bSmrg# Just in case
8129ef7378bSmrgsleep 1
8139ef7378bSmrgecho timestamp > conftest.file
8149ef7378bSmrg# Reject unsafe characters in $srcdir or the absolute working directory
8159ef7378bSmrg# name.  Accept space and tab only in the latter.
8169ef7378bSmrgam_lf='
8179ef7378bSmrg'
8189ef7378bSmrgcase `pwd` in
8199ef7378bSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8209ef7378bSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8219ef7378bSmrgesac
8229ef7378bSmrgcase $srcdir in
8239ef7378bSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8249ef7378bSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8259ef7378bSmrgesac
826c19de146Smrg
8279ef7378bSmrg# Do `set' in a subshell so we don't clobber the current shell's
8289ef7378bSmrg# arguments.  Must try -L first in case configure is actually a
8299ef7378bSmrg# symlink; some systems play weird games with the mod time of symlinks
8309ef7378bSmrg# (eg FreeBSD returns the mod time of the symlink's containing
8319ef7378bSmrg# directory).
8329ef7378bSmrgif (
8339ef7378bSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8349ef7378bSmrg   if test "$[*]" = "X"; then
8359ef7378bSmrg      # -L didn't work.
8369ef7378bSmrg      set X `ls -t "$srcdir/configure" conftest.file`
8379ef7378bSmrg   fi
8389ef7378bSmrg   rm -f conftest.file
8399ef7378bSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
8409ef7378bSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8419ef7378bSmrg
8429ef7378bSmrg      # If neither matched, then we have a broken ls.  This can happen
8439ef7378bSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
8449ef7378bSmrg      # broken ls alias from the environment.  This has actually
8459ef7378bSmrg      # happened.  Such a system could not be considered "sane".
8469ef7378bSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8479ef7378bSmrgalias in your environment])
8489ef7378bSmrg   fi
849c19de146Smrg
8509ef7378bSmrg   test "$[2]" = conftest.file
8519ef7378bSmrg   )
8529ef7378bSmrgthen
8539ef7378bSmrg   # Ok.
8549ef7378bSmrg   :
8559ef7378bSmrgelse
8569ef7378bSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
8579ef7378bSmrgCheck your system clock])
8589ef7378bSmrgfi
8599ef7378bSmrgAC_MSG_RESULT(yes)])
860c19de146Smrg
8619ef7378bSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
862c19de146Smrg#
8639ef7378bSmrg# This file is free software; the Free Software Foundation
8649ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
8659ef7378bSmrg# with or without modifications, as long as this notice is preserved.
8669ef7378bSmrg
8679ef7378bSmrg# serial 1
8689ef7378bSmrg
8699ef7378bSmrg# AM_SILENT_RULES([DEFAULT])
8709ef7378bSmrg# --------------------------
8719ef7378bSmrg# Enable less verbose build rules; with the default set to DEFAULT
8729ef7378bSmrg# (`yes' being less verbose, `no' or empty being verbose).
8739ef7378bSmrgAC_DEFUN([AM_SILENT_RULES],
8749ef7378bSmrg[AC_ARG_ENABLE([silent-rules],
8759ef7378bSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8769ef7378bSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8779ef7378bSmrgcase $enable_silent_rules in
8789ef7378bSmrgyes) AM_DEFAULT_VERBOSITY=0;;
8799ef7378bSmrgno)  AM_DEFAULT_VERBOSITY=1;;
8809ef7378bSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8819ef7378bSmrgesac
8829ef7378bSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8839ef7378bSmrgAM_BACKSLASH='\'
8849ef7378bSmrgAC_SUBST([AM_BACKSLASH])dnl
8859ef7378bSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8869ef7378bSmrg])
8879ef7378bSmrg
8889ef7378bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
889c19de146Smrg#
8909ef7378bSmrg# This file is free software; the Free Software Foundation
8919ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
8929ef7378bSmrg# with or without modifications, as long as this notice is preserved.
8939ef7378bSmrg
8949ef7378bSmrg# AM_PROG_INSTALL_STRIP
8959ef7378bSmrg# ---------------------
8969ef7378bSmrg# One issue with vendor `install' (even GNU) is that you can't
8979ef7378bSmrg# specify the program used to strip binaries.  This is especially
8989ef7378bSmrg# annoying in cross-compiling environments, where the build's strip
8999ef7378bSmrg# is unlikely to handle the host's binaries.
9009ef7378bSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9019ef7378bSmrg# always use install-sh in `make install-strip', and initialize
9029ef7378bSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
9039ef7378bSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
9049ef7378bSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9059ef7378bSmrg# Installed binaries are usually stripped using `strip' when the user
9069ef7378bSmrg# run `make install-strip'.  However `strip' might not be the right
9079ef7378bSmrg# tool to use in cross-compilation environments, therefore Automake
9089ef7378bSmrg# will honor the `STRIP' environment variable to overrule this program.
9099ef7378bSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
9109ef7378bSmrgif test "$cross_compiling" != no; then
9119ef7378bSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
9129ef7378bSmrgfi
9139ef7378bSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9149ef7378bSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9159ef7378bSmrg
9169ef7378bSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
917c19de146Smrg#
9189ef7378bSmrg# This file is free software; the Free Software Foundation
9199ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
9209ef7378bSmrg# with or without modifications, as long as this notice is preserved.
921c19de146Smrg
9229ef7378bSmrg# serial 2
923c19de146Smrg
9249ef7378bSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
9259ef7378bSmrg# ---------------------------
9269ef7378bSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9279ef7378bSmrg# This macro is traced by Automake.
9289ef7378bSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
929c19de146Smrg
9309ef7378bSmrg# AM_SUBST_NOTMAKE(VARIABLE)
9319ef7378bSmrg# ---------------------------
9329ef7378bSmrg# Public sister of _AM_SUBST_NOTMAKE.
9339ef7378bSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
934c19de146Smrg
9359ef7378bSmrg# Check how to create a tarball.                            -*- Autoconf -*-
936c19de146Smrg
9379ef7378bSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9389ef7378bSmrg#
9399ef7378bSmrg# This file is free software; the Free Software Foundation
9409ef7378bSmrg# gives unlimited permission to copy and/or distribute it,
9419ef7378bSmrg# with or without modifications, as long as this notice is preserved.
942c19de146Smrg
9439ef7378bSmrg# serial 2
944c19de146Smrg
9459ef7378bSmrg# _AM_PROG_TAR(FORMAT)
9469ef7378bSmrg# --------------------
9479ef7378bSmrg# Check how to create a tarball in format FORMAT.
9489ef7378bSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
9499ef7378bSmrg#
9509ef7378bSmrg# Substitute a variable $(am__tar) that is a command
9519ef7378bSmrg# writing to stdout a FORMAT-tarball containing the directory
9529ef7378bSmrg# $tardir.
9539ef7378bSmrg#     tardir=directory && $(am__tar) > result.tar
9549ef7378bSmrg#
9559ef7378bSmrg# Substitute a variable $(am__untar) that extract such
9569ef7378bSmrg# a tarball read from stdin.
9579ef7378bSmrg#     $(am__untar) < result.tar
9589ef7378bSmrgAC_DEFUN([_AM_PROG_TAR],
9599ef7378bSmrg[# Always define AMTAR for backward compatibility.
9609ef7378bSmrgAM_MISSING_PROG([AMTAR], [tar])
9619ef7378bSmrgm4_if([$1], [v7],
9629ef7378bSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
9639ef7378bSmrg     [m4_case([$1], [ustar],, [pax],,
9649ef7378bSmrg              [m4_fatal([Unknown tar format])])
9659ef7378bSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
9669ef7378bSmrg# Loop over all known methods to create a tar archive until one works.
9679ef7378bSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9689ef7378bSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
9699ef7378bSmrg# Do not fold the above two line into one, because Tru64 sh and
9709ef7378bSmrg# Solaris sh will not grok spaces in the rhs of `-'.
9719ef7378bSmrgfor _am_tool in $_am_tools
9729ef7378bSmrgdo
9739ef7378bSmrg  case $_am_tool in
9749ef7378bSmrg  gnutar)
9759ef7378bSmrg    for _am_tar in tar gnutar gtar;
9769ef7378bSmrg    do
9779ef7378bSmrg      AM_RUN_LOG([$_am_tar --version]) && break
9789ef7378bSmrg    done
9799ef7378bSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9809ef7378bSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9819ef7378bSmrg    am__untar="$_am_tar -xf -"
9829ef7378bSmrg    ;;
9839ef7378bSmrg  plaintar)
9849ef7378bSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
9859ef7378bSmrg    # ustar tarball either.
9869ef7378bSmrg    (tar --version) >/dev/null 2>&1 && continue
9879ef7378bSmrg    am__tar='tar chf - "$$tardir"'
9889ef7378bSmrg    am__tar_='tar chf - "$tardir"'
9899ef7378bSmrg    am__untar='tar xf -'
9909ef7378bSmrg    ;;
9919ef7378bSmrg  pax)
9929ef7378bSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
9939ef7378bSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
9949ef7378bSmrg    am__untar='pax -r'
9959ef7378bSmrg    ;;
9969ef7378bSmrg  cpio)
9979ef7378bSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9989ef7378bSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9999ef7378bSmrg    am__untar='cpio -i -H $1 -d'
10009ef7378bSmrg    ;;
10019ef7378bSmrg  none)
10029ef7378bSmrg    am__tar=false
10039ef7378bSmrg    am__tar_=false
10049ef7378bSmrg    am__untar=false
10059ef7378bSmrg    ;;
10069ef7378bSmrg  esac
1007c19de146Smrg
10089ef7378bSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
10099ef7378bSmrg  # and am__untar set.
10109ef7378bSmrg  test -n "${am_cv_prog_tar_$1}" && break
1011c19de146Smrg
10129ef7378bSmrg  # tar/untar a dummy directory, and stop if the command works
10139ef7378bSmrg  rm -rf conftest.dir
10149ef7378bSmrg  mkdir conftest.dir
10159ef7378bSmrg  echo GrepMe > conftest.dir/file
10169ef7378bSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10179ef7378bSmrg  rm -rf conftest.dir
10189ef7378bSmrg  if test -s conftest.tar; then
10199ef7378bSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
10209ef7378bSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
10219ef7378bSmrg  fi
10229ef7378bSmrgdone
10239ef7378bSmrgrm -rf conftest.dir
1024c19de146Smrg
10259ef7378bSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10269ef7378bSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
10279ef7378bSmrgAC_SUBST([am__tar])
10289ef7378bSmrgAC_SUBST([am__untar])
10299ef7378bSmrg]) # _AM_PROG_TAR
1030c19de146Smrg
10319ef7378bSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1032c19de146Smrgdnl
10339ef7378bSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1034c19de146Smrgdnl 
10359ef7378bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10369ef7378bSmrgdnl copy of this software and associated documentation files (the
10379ef7378bSmrgdnl "Software"), to deal in the Software without restriction, including
10389ef7378bSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
10399ef7378bSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
10409ef7378bSmrgdnl to whom the Software is furnished to do so, provided that the above
10419ef7378bSmrgdnl copyright notice(s) and this permission notice appear in all copies of
10429ef7378bSmrgdnl the Software and that both the above copyright notice(s) and this
10439ef7378bSmrgdnl permission notice appear in supporting documentation.
10449ef7378bSmrgdnl
1045c19de146Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1046c19de146Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10479ef7378bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
10489ef7378bSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
10499ef7378bSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
10509ef7378bSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
10519ef7378bSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
10529ef7378bSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
10539ef7378bSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
10549ef7378bSmrgdnl
10559ef7378bSmrgdnl Except as contained in this notice, the name of a copyright holder
10569ef7378bSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
10579ef7378bSmrgdnl or other dealings in this Software without prior written authorization
10589ef7378bSmrgdnl of the copyright holder.
10599ef7378bSmrg
10609ef7378bSmrg# XORG_MACROS_VERSION(required-version)
10619ef7378bSmrg# -------------------------------------
10629ef7378bSmrg# Minimum version: 1.1.0
10639ef7378bSmrg#
10649ef7378bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
10659ef7378bSmrg# your configure.ac with the minimum required version, such as:
10669ef7378bSmrg# XORG_MACROS_VERSION(1.1)
10679ef7378bSmrg#
10689ef7378bSmrg# To ensure that this macro is defined, also add:
10699ef7378bSmrg# m4_ifndef([XORG_MACROS_VERSION],
10709ef7378bSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10719ef7378bSmrg#
10729ef7378bSmrg#
10739ef7378bSmrg# See the "minimum version" comment for each macro you use to see what 
10749ef7378bSmrg# version you require.
10759ef7378bSmrgm4_defun([XORG_MACROS_VERSION],[
10769ef7378bSmrgm4_define([vers_have], [1.4.1])
10779ef7378bSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10789ef7378bSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10799ef7378bSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
10809ef7378bSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
10819ef7378bSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
10829ef7378bSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
10839ef7378bSmrgm4_undefine([vers_have])
10849ef7378bSmrgm4_undefine([maj_have])
10859ef7378bSmrgm4_undefine([maj_needed])
10869ef7378bSmrg]) # XORG_MACROS_VERSION
1087c19de146Smrg
1088c19de146Smrg# XORG_PROG_RAWCPP()
1089c19de146Smrg# ------------------
10909ef7378bSmrg# Minimum version: 1.0.0
10919ef7378bSmrg#
1092c19de146Smrg# Find cpp program and necessary flags for use in pre-processing text files
1093c19de146Smrg# such as man pages and config files
1094c19de146SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1095c19de146SmrgAC_REQUIRE([AC_PROG_CPP])
1096c19de146SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1097c19de146Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1098c19de146Smrg
1099c19de146Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1100c19de146Smrg# which is not the best choice for supporting other OS'es, but covers most
1101c19de146Smrg# of the ones we need for now.
1102c19de146SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1103c19de146SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1104c19de146Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1105c19de146Smrg	AC_MSG_RESULT([no])
1106c19de146Smrgelse
1107c19de146Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1108c19de146Smrg		RAWCPPFLAGS=-undef
1109c19de146Smrg		AC_MSG_RESULT([yes])
11109ef7378bSmrg	# under Cygwin unix is still defined even with -undef
11119ef7378bSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11129ef7378bSmrg		RAWCPPFLAGS="-undef -ansi"
11139ef7378bSmrg		AC_MSG_RESULT([yes, with -ansi])
1114c19de146Smrg	else
1115c19de146Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1116c19de146Smrg	fi
1117c19de146Smrgfi
1118c19de146Smrgrm -f conftest.$ac_ext
1119c19de146Smrg
1120c19de146SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1121c19de146SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1122c19de146Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1123c19de146Smrg	AC_MSG_RESULT([no])
1124c19de146Smrgelse
1125c19de146Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1126c19de146Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1127c19de146Smrg		AC_MSG_RESULT([yes])
1128c19de146Smrg	else
1129c19de146Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1130c19de146Smrg	fi
1131c19de146Smrgfi
1132c19de146Smrgrm -f conftest.$ac_ext
1133c19de146SmrgAC_SUBST(RAWCPPFLAGS)
1134c19de146Smrg]) # XORG_PROG_RAWCPP
1135c19de146Smrg
1136c19de146Smrg# XORG_MANPAGE_SECTIONS()
1137c19de146Smrg# -----------------------
11389ef7378bSmrg# Minimum version: 1.0.0
11399ef7378bSmrg#
1140c19de146Smrg# Determine which sections man pages go in for the different man page types
1141c19de146Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1142c19de146Smrg# Not sure if there's any better way than just hardcoding by OS name.
1143c19de146Smrg# Override default settings by setting environment variables
1144c19de146Smrg
1145c19de146SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1146c19de146SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1147c19de146Smrg
1148c19de146Smrgif test x$APP_MAN_SUFFIX = x    ; then
11499ef7378bSmrg    APP_MAN_SUFFIX=1
1150c19de146Smrgfi
1151c19de146Smrgif test x$APP_MAN_DIR = x    ; then
11529ef7378bSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1153c19de146Smrgfi
1154c19de146Smrg
1155c19de146Smrgif test x$LIB_MAN_SUFFIX = x    ; then
11569ef7378bSmrg    LIB_MAN_SUFFIX=3
1157c19de146Smrgfi
1158c19de146Smrgif test x$LIB_MAN_DIR = x    ; then
11599ef7378bSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1160c19de146Smrgfi
1161c19de146Smrg
1162c19de146Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1163c19de146Smrg    case $host_os in
1164c19de146Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1165c19de146Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1166c19de146Smrg    esac
1167c19de146Smrgfi
1168c19de146Smrgif test x$FILE_MAN_DIR = x    ; then
11699ef7378bSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1170c19de146Smrgfi
1171c19de146Smrg
1172c19de146Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1173c19de146Smrg    case $host_os in
1174c19de146Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1175c19de146Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1176c19de146Smrg    esac
1177c19de146Smrgfi
1178c19de146Smrgif test x$MISC_MAN_DIR = x    ; then
11799ef7378bSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1180c19de146Smrgfi
1181c19de146Smrg
1182c19de146Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1183c19de146Smrg    case $host_os in
1184c19de146Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1185c19de146Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1186c19de146Smrg    esac
1187c19de146Smrgfi
1188c19de146Smrgif test x$DRIVER_MAN_DIR = x    ; then
11899ef7378bSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1190c19de146Smrgfi
1191c19de146Smrg
1192c19de146Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1193c19de146Smrg    case $host_os in
1194c19de146Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1195c19de146Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1196c19de146Smrg    esac
1197c19de146Smrgfi
1198c19de146Smrgif test x$ADMIN_MAN_DIR = x    ; then
1199c19de146Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1200c19de146Smrgfi
1201c19de146Smrg
1202c19de146Smrg
1203c19de146SmrgAC_SUBST([APP_MAN_SUFFIX])
1204c19de146SmrgAC_SUBST([LIB_MAN_SUFFIX])
1205c19de146SmrgAC_SUBST([FILE_MAN_SUFFIX])
1206c19de146SmrgAC_SUBST([MISC_MAN_SUFFIX])
1207c19de146SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1208c19de146SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1209c19de146SmrgAC_SUBST([APP_MAN_DIR])
1210c19de146SmrgAC_SUBST([LIB_MAN_DIR])
1211c19de146SmrgAC_SUBST([FILE_MAN_DIR])
1212c19de146SmrgAC_SUBST([MISC_MAN_DIR])
1213c19de146SmrgAC_SUBST([DRIVER_MAN_DIR])
1214c19de146SmrgAC_SUBST([ADMIN_MAN_DIR])
1215c19de146Smrg]) # XORG_MANPAGE_SECTIONS
1216c19de146Smrg
1217c19de146Smrg# XORG_CHECK_LINUXDOC
1218c19de146Smrg# -------------------
12199ef7378bSmrg# Minimum version: 1.0.0
12209ef7378bSmrg#
1221c19de146Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1222c19de146Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1223c19de146Smrg# Whether or not the necessary tools and files are found can be checked
1224c19de146Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1225c19de146SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12269ef7378bSmrgif test x$XORG_SGML_PATH = x ; then
12279ef7378bSmrg    XORG_SGML_PATH=$prefix/share/sgml
12289ef7378bSmrgfi
12299ef7378bSmrgHAVE_DEFS_ENT=
12309ef7378bSmrg
12319ef7378bSmrgif test x"$cross_compiling" = x"yes" ; then
12329ef7378bSmrg  HAVE_DEFS_ENT=no
12339ef7378bSmrgelse
12349ef7378bSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
12359ef7378bSmrgfi
1236c19de146Smrg
1237c19de146SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1238c19de146SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1239c19de146Smrg
1240c19de146SmrgAC_MSG_CHECKING([Whether to build documentation])
1241c19de146Smrg
12429ef7378bSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1243c19de146Smrg   BUILDDOC=yes
1244c19de146Smrgelse
1245c19de146Smrg   BUILDDOC=no
1246c19de146Smrgfi
1247c19de146Smrg
1248c19de146SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1249c19de146Smrg
1250c19de146SmrgAC_MSG_RESULT([$BUILDDOC])
1251c19de146Smrg
1252c19de146SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1253c19de146Smrg
12549ef7378bSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1255c19de146Smrg   BUILDPDFDOC=yes
1256c19de146Smrgelse
1257c19de146Smrg   BUILDPDFDOC=no
1258c19de146Smrgfi
1259c19de146Smrg
1260c19de146SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1261c19de146Smrg
1262c19de146SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1263c19de146Smrg
12649ef7378bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
12659ef7378bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1266c19de146SmrgMAKE_PDF="$PS2PDF"
12679ef7378bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1268c19de146Smrg
1269c19de146SmrgAC_SUBST(MAKE_TEXT)
1270c19de146SmrgAC_SUBST(MAKE_PS)
1271c19de146SmrgAC_SUBST(MAKE_PDF)
1272c19de146SmrgAC_SUBST(MAKE_HTML)
1273c19de146Smrg]) # XORG_CHECK_LINUXDOC
1274c19de146Smrg
12759ef7378bSmrg# XORG_CHECK_DOCBOOK
12769ef7378bSmrg# -------------------
12779ef7378bSmrg# Minimum version: 1.0.0
12789ef7378bSmrg#
12799ef7378bSmrg# Checks for the ability to build output formats from SGML DocBook source.
12809ef7378bSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
12819ef7378bSmrg# indicates whether the necessary tools and files are found and, if set,
12829ef7378bSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
12839ef7378bSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
12849ef7378bSmrgif test x$XORG_SGML_PATH = x ; then
12859ef7378bSmrg    XORG_SGML_PATH=$prefix/share/sgml
12869ef7378bSmrgfi
12879ef7378bSmrgHAVE_DEFS_ENT=
12889ef7378bSmrgBUILDTXTDOC=no
12899ef7378bSmrgBUILDPDFDOC=no
12909ef7378bSmrgBUILDPSDOC=no
12919ef7378bSmrgBUILDHTMLDOC=no
12929ef7378bSmrg
12939ef7378bSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
12949ef7378bSmrg
12959ef7378bSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
12969ef7378bSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
12979ef7378bSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
12989ef7378bSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
12999ef7378bSmrg
13009ef7378bSmrgAC_MSG_CHECKING([Whether to build text documentation])
13019ef7378bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
13029ef7378bSmrg   test x$BUILD_TXTDOC != xno; then
13039ef7378bSmrg	BUILDTXTDOC=yes
13049ef7378bSmrgfi
13059ef7378bSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
13069ef7378bSmrgAC_MSG_RESULT([$BUILDTXTDOC])
13079ef7378bSmrg
13089ef7378bSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
13099ef7378bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
13109ef7378bSmrg   test x$BUILD_PDFDOC != xno; then
13119ef7378bSmrg	BUILDPDFDOC=yes
13129ef7378bSmrgfi
13139ef7378bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13149ef7378bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
13159ef7378bSmrg
13169ef7378bSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
13179ef7378bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
13189ef7378bSmrg   test x$BUILD_PSDOC != xno; then
13199ef7378bSmrg	BUILDPSDOC=yes
13209ef7378bSmrgfi
13219ef7378bSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
13229ef7378bSmrgAC_MSG_RESULT([$BUILDPSDOC])
13239ef7378bSmrg
13249ef7378bSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
13259ef7378bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
13269ef7378bSmrg   test x$BUILD_HTMLDOC != xno; then
13279ef7378bSmrg	BUILDHTMLDOC=yes
13289ef7378bSmrgfi
13299ef7378bSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
13309ef7378bSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
13319ef7378bSmrg
13329ef7378bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
13339ef7378bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
13349ef7378bSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
13359ef7378bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
13369ef7378bSmrg
13379ef7378bSmrgAC_SUBST(MAKE_TEXT)
13389ef7378bSmrgAC_SUBST(MAKE_PS)
13399ef7378bSmrgAC_SUBST(MAKE_PDF)
13409ef7378bSmrgAC_SUBST(MAKE_HTML)
13419ef7378bSmrg]) # XORG_CHECK_DOCBOOK
13429ef7378bSmrg
1343c19de146Smrg# XORG_CHECK_MALLOC_ZERO
1344c19de146Smrg# ----------------------
13459ef7378bSmrg# Minimum version: 1.0.0
13469ef7378bSmrg#
1347c19de146Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1348c19de146Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1349c19de146Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1350c19de146SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1351c19de146SmrgAC_ARG_ENABLE(malloc0returnsnull,
13529ef7378bSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1353c19de146Smrg		       [malloc(0) returns NULL (default: auto)]),
1354c19de146Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1355c19de146Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1356c19de146Smrg
1357c19de146SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1358c19de146Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1359c19de146Smrg	AC_RUN_IFELSE([
1360c19de146Smrgchar *malloc();
1361c19de146Smrgchar *realloc();
1362c19de146Smrgchar *calloc();
1363c19de146Smrgmain() {
1364c19de146Smrg    char *m0, *r0, *c0, *p;
1365c19de146Smrg    m0 = malloc(0);
1366c19de146Smrg    p = malloc(10);
1367c19de146Smrg    r0 = realloc(p,0);
1368c19de146Smrg    c0 = calloc(0);
1369c19de146Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1370c19de146Smrg}],
1371c19de146Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
13729ef7378bSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
13739ef7378bSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1374c19de146Smrgfi
1375c19de146SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1376c19de146Smrg
1377c19de146Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1378c19de146Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1379c19de146Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1380c19de146Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1381c19de146Smrgelse
1382c19de146Smrg	MALLOC_ZERO_CFLAGS=""
1383c19de146Smrg	XMALLOC_ZERO_CFLAGS=""
1384c19de146Smrg	XTMALLOC_ZERO_CFLAGS=""
1385c19de146Smrgfi
1386c19de146Smrg
1387c19de146SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1388c19de146SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1389c19de146SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1390c19de146Smrg]) # XORG_CHECK_MALLOC_ZERO
1391c19de146Smrg
13929ef7378bSmrg# XORG_WITH_LINT()
13939ef7378bSmrg# ----------------
13949ef7378bSmrg# Minimum version: 1.1.0
13959ef7378bSmrg#
13969ef7378bSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
13979ef7378bSmrg# is specified.   (Use --with-lint=sparse for sparse.)
13989ef7378bSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
13999ef7378bSmrg# Sets $LINT_FLAGS to flags to pass to source checker
14009ef7378bSmrg# Sets LINT automake conditional if enabled (default: disabled)
14019ef7378bSmrg#
14029ef7378bSmrgAC_DEFUN([XORG_WITH_LINT],[
14039ef7378bSmrg
14049ef7378bSmrg# Allow checking code with lint, sparse, etc.
14059ef7378bSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
14069ef7378bSmrg		[Use a lint-style source code checker (default: disabled)])],
14079ef7378bSmrg		[use_lint=$withval], [use_lint=no])
14089ef7378bSmrgif test "x$use_lint" = "xyes" ; then
14099ef7378bSmrg	LINT="lint"
14109ef7378bSmrgelse
14119ef7378bSmrg	LINT="$use_lint"
14129ef7378bSmrgfi
14139ef7378bSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
14149ef7378bSmrg    case $LINT in
14159ef7378bSmrg	lint|*/lint)
14169ef7378bSmrg	    case $host_os in
14179ef7378bSmrg		solaris*)
14189ef7378bSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
14199ef7378bSmrg			;;
14209ef7378bSmrg	    esac
14219ef7378bSmrg	    ;;
14229ef7378bSmrg    esac
14239ef7378bSmrgfi
14249ef7378bSmrg
14259ef7378bSmrgAC_SUBST(LINT)
14269ef7378bSmrgAC_SUBST(LINT_FLAGS)
14279ef7378bSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
14289ef7378bSmrg
14299ef7378bSmrg]) # XORG_WITH_LINT
14309ef7378bSmrg
14319ef7378bSmrg# XORG_LINT_LIBRARY(LIBNAME)
14329ef7378bSmrg# --------------------------
14339ef7378bSmrg# Minimum version: 1.1.0
14349ef7378bSmrg#
14359ef7378bSmrg# Sets up flags for building lint libraries for checking programs that call
14369ef7378bSmrg# functions in the library.
14379ef7378bSmrg# Disabled by default, enable with --enable-lint-library
14389ef7378bSmrg# Sets: 
14399ef7378bSmrg#	@LINTLIB@		- name of lint library file to make
14409ef7378bSmrg#	MAKE_LINT_LIB		- automake conditional
14419ef7378bSmrg#
14429ef7378bSmrg
14439ef7378bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
14449ef7378bSmrgAC_REQUIRE([XORG_WITH_LINT])
14459ef7378bSmrg# Build lint "library" for more indepth checks of programs calling this library
14469ef7378bSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
14479ef7378bSmrg	[Create lint library (default: disabled)])],
14489ef7378bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
14499ef7378bSmrgif test "x$make_lint_lib" != "xno" ; then
14509ef7378bSmrg	if test "x$LINT" = "xno" ; then
14519ef7378bSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
14529ef7378bSmrg	fi
14539ef7378bSmrg	if test "x$make_lint_lib" = "xyes" ; then
14549ef7378bSmrg		LINTLIB=llib-l$1.ln
14559ef7378bSmrg	else
14569ef7378bSmrg		LINTLIB=$make_lint_lib
14579ef7378bSmrg	fi
14589ef7378bSmrgfi
14599ef7378bSmrgAC_SUBST(LINTLIB)
14609ef7378bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
14619ef7378bSmrg
14629ef7378bSmrg]) # XORG_LINT_LIBRARY
14639ef7378bSmrg
14649ef7378bSmrg# XORG_CWARNFLAGS
14659ef7378bSmrg# ---------------
14669ef7378bSmrg# Minimum version: 1.2.0
14679ef7378bSmrg#
14689ef7378bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
14699ef7378bSmrg#
14709ef7378bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
14719ef7378bSmrgAC_REQUIRE([AC_PROG_CC])
14729ef7378bSmrgif  test "x$GCC" = xyes ; then
14739ef7378bSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
14749ef7378bSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
14759ef7378bSmrg-Wbad-function-cast"
14769ef7378bSmrg    case `$CC -dumpversion` in
14779ef7378bSmrg    3.4.* | 4.*)
14789ef7378bSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
14799ef7378bSmrg	;;
14809ef7378bSmrg    esac
14819ef7378bSmrgelse
14829ef7378bSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
14839ef7378bSmrg    if test "x$SUNCC" = "xyes"; then
14849ef7378bSmrg	CWARNFLAGS="-v"
14859ef7378bSmrg    fi
14869ef7378bSmrgfi
14879ef7378bSmrgAC_SUBST(CWARNFLAGS)
14889ef7378bSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
14899ef7378bSmrg]) # XORG_CWARNFLAGS
14909ef7378bSmrg
14919ef7378bSmrg# XORG_STRICT_OPTION
14929ef7378bSmrg# -----------------------
14939ef7378bSmrg# Minimum version: 1.3.0
14949ef7378bSmrg#
14959ef7378bSmrg# Add configure option to enable strict compilation
14969ef7378bSmrgAC_DEFUN([XORG_STRICT_OPTION], [
14979ef7378bSmrgAC_REQUIRE([AC_PROG_CC])
14989ef7378bSmrgAC_REQUIRE([AC_PROG_CC_C99])
14999ef7378bSmrgAC_REQUIRE([XORG_CWARNFLAGS])
15009ef7378bSmrg
15019ef7378bSmrgAC_ARG_ENABLE(strict-compilation,
15029ef7378bSmrg			  AS_HELP_STRING([--enable-strict-compilation],
15039ef7378bSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
15049ef7378bSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
15059ef7378bSmrgif test "x$STRICT_COMPILE" = "xyes"; then
15069ef7378bSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
15079ef7378bSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
15089ef7378bSmrg	if test "x$GCC" = xyes ; then
15099ef7378bSmrg		STRICT_CFLAGS="-pedantic -Werror"
15109ef7378bSmrg	elif test "x$SUNCC" = "xyes"; then
15119ef7378bSmrg		STRICT_CFLAGS="-errwarn"
15129ef7378bSmrg    elif test "x$INTELCC" = "xyes"; then
15139ef7378bSmrg		STRICT_CFLAGS="-Werror"
15149ef7378bSmrg	fi
15159ef7378bSmrgfi
15169ef7378bSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
15179ef7378bSmrgAC_SUBST([CWARNFLAGS])
15189ef7378bSmrg]) # XORG_STRICT_OPTION
15199ef7378bSmrg
15209ef7378bSmrg# XORG_DEFAULT_OPTIONS
15219ef7378bSmrg# --------------------
15229ef7378bSmrg# Minimum version: 1.3.0
15239ef7378bSmrg#
15249ef7378bSmrg# Defines default options for X.Org modules.
15259ef7378bSmrg#
15269ef7378bSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
15279ef7378bSmrgXORG_CWARNFLAGS
15289ef7378bSmrgXORG_STRICT_OPTION
15299ef7378bSmrgXORG_RELEASE_VERSION
15309ef7378bSmrgXORG_CHANGELOG
15319ef7378bSmrgXORG_INSTALL
15329ef7378bSmrgXORG_MANPAGE_SECTIONS
15339ef7378bSmrg]) # XORG_DEFAULT_OPTIONS
15349ef7378bSmrg
15359ef7378bSmrg# XORG_INSTALL()
15369ef7378bSmrg# ----------------
15379ef7378bSmrg# Minimum version: 1.4.0
15389ef7378bSmrg#
15399ef7378bSmrg# Defines the variable INSTALL_CMD as the command to copy
15409ef7378bSmrg# INSTALL from $prefix/share/doc/util-macros.
15419ef7378bSmrg#
15429ef7378bSmrgAC_DEFUN([XORG_INSTALL], [
15439ef7378bSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
15449ef7378bSmrgmacros_docdir=$($PKG_CONFIG --print-errors --variable=docdir xorg-macros)
15459ef7378bSmrgINSTALL_CMD="(cp -f "$macros_docdir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
15469ef7378bSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
15479ef7378bSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
15489ef7378bSmrgecho 'util-macros \"docdir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
15499ef7378bSmrgAC_SUBST([INSTALL_CMD])
15509ef7378bSmrg]) # XORG_INSTALL
1551c19de146Smrgdnl Copyright 2005 Red Hat, Inc
1552c19de146Smrgdnl
1553c19de146Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1554c19de146Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1555c19de146Smrgdnl the above copyright notice appear in all copies and that both that
1556c19de146Smrgdnl copyright notice and this permission notice appear in supporting
1557c19de146Smrgdnl documentation.
1558c19de146Smrgdnl
1559c19de146Smrgdnl The above copyright notice and this permission notice shall be included
1560c19de146Smrgdnl in all copies or substantial portions of the Software.
1561c19de146Smrgdnl
1562c19de146Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1563c19de146Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1564c19de146Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1565c19de146Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1566c19de146Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1567c19de146Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1568c19de146Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1569c19de146Smrgdnl
1570c19de146Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1571c19de146Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1572c19de146Smrgdnl other dealings in this Software without prior written authorization
1573c19de146Smrgdnl from the copyright holders.
1574c19de146Smrgdnl
1575c19de146Smrg
1576c19de146Smrg# XORG_RELEASE_VERSION
1577c19de146Smrg# --------------------
1578c19de146Smrg# Adds --with/without-release-string and changes the PACKAGE and
1579c19de146Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
15809ef7378bSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
15819ef7378bSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1582c19de146Smrg 
1583c19de146SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1584c19de146Smrg	AC_ARG_WITH(release-version,
15859ef7378bSmrg			AS_HELP_STRING([--with-release-version=STRING],
1586c19de146Smrg				[Use release version string in package name]),
1587c19de146Smrg			[RELEASE_VERSION="$withval"],
1588c19de146Smrg			[RELEASE_VERSION=""])
1589c19de146Smrg	if test "x$RELEASE_VERSION" != "x"; then
1590c19de146Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1591c19de146Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1592c19de146Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1593c19de146Smrg	fi
15949ef7378bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
15959ef7378bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
15969ef7378bSmrg		[Major version of this package])
15979ef7378bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
15989ef7378bSmrg	if test "x$PVM" = "x"; then
15999ef7378bSmrg		PVM="0"
16009ef7378bSmrg	fi
16019ef7378bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
16029ef7378bSmrg		[$PVM],
16039ef7378bSmrg		[Minor version of this package])
16049ef7378bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
16059ef7378bSmrg	if test "x$PVP" = "x"; then
16069ef7378bSmrg		PVP="0"
16079ef7378bSmrg	fi
16089ef7378bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
16099ef7378bSmrg		[$PVP],
16109ef7378bSmrg		[Patch version of this package])
1611c19de146Smrg])
1612c19de146Smrg
16139ef7378bSmrg# XORG_CHANGELOG()
16149ef7378bSmrg# ----------------
16159ef7378bSmrg# Minimum version: 1.2.0
16169ef7378bSmrg#
16179ef7378bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
16189ef7378bSmrg# ChangeLog from git.
16199ef7378bSmrg#
16209ef7378bSmrg#
16219ef7378bSmrgAC_DEFUN([XORG_CHANGELOG], [
16229ef7378bSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
16239ef7378bSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
16249ef7378bSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
16259ef7378bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
16269ef7378bSmrgAC_SUBST([CHANGELOG_CMD])
16279ef7378bSmrg]) # XORG_CHANGELOG
16289ef7378bSmrg
16299ef7378bSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
16309ef7378bSmrg# 
16319ef7378bSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
16329ef7378bSmrg#
16339ef7378bSmrg# This program is free software; you can redistribute it and/or modify
16349ef7378bSmrg# it under the terms of the GNU General Public License as published by
16359ef7378bSmrg# the Free Software Foundation; either version 2 of the License, or
16369ef7378bSmrg# (at your option) any later version.
16379ef7378bSmrg#
16389ef7378bSmrg# This program is distributed in the hope that it will be useful, but
16399ef7378bSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
16409ef7378bSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16419ef7378bSmrg# General Public License for more details.
16429ef7378bSmrg#
16439ef7378bSmrg# You should have received a copy of the GNU General Public License
16449ef7378bSmrg# along with this program; if not, write to the Free Software
16459ef7378bSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16469ef7378bSmrg#
16479ef7378bSmrg# As a special exception to the GNU General Public License, if you
16489ef7378bSmrg# distribute this file as part of a program that contains a
16499ef7378bSmrg# configuration script generated by Autoconf, you may include it under
16509ef7378bSmrg# the same distribution terms that you use for the rest of that program.
16519ef7378bSmrg
16529ef7378bSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
16539ef7378bSmrg# ----------------------------------
16549ef7378bSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
16559ef7378bSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
16569ef7378bSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
16579ef7378bSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
16589ef7378bSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
16599ef7378bSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
16609ef7378bSmrgfi
16619ef7378bSmrgif test -n "$PKG_CONFIG"; then
16629ef7378bSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
16639ef7378bSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
16649ef7378bSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
16659ef7378bSmrg		AC_MSG_RESULT([yes])
16669ef7378bSmrg	else
16679ef7378bSmrg		AC_MSG_RESULT([no])
16689ef7378bSmrg		PKG_CONFIG=""
16699ef7378bSmrg	fi
16709ef7378bSmrg		
16719ef7378bSmrgfi[]dnl
16729ef7378bSmrg])# PKG_PROG_PKG_CONFIG
16739ef7378bSmrg
16749ef7378bSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
16759ef7378bSmrg#
16769ef7378bSmrg# Check to see whether a particular set of modules exists.  Similar
16779ef7378bSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
16789ef7378bSmrg#
16799ef7378bSmrg#
16809ef7378bSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
16819ef7378bSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
16829ef7378bSmrg# PKG_CHECK_EXISTS manually
16839ef7378bSmrg# --------------------------------------------------------------
16849ef7378bSmrgAC_DEFUN([PKG_CHECK_EXISTS],
16859ef7378bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
16869ef7378bSmrgif test -n "$PKG_CONFIG" && \
16879ef7378bSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
16889ef7378bSmrg  m4_ifval([$2], [$2], [:])
16899ef7378bSmrgm4_ifvaln([$3], [else
16909ef7378bSmrg  $3])dnl
16919ef7378bSmrgfi])
16929ef7378bSmrg
16939ef7378bSmrg
16949ef7378bSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
16959ef7378bSmrg# ---------------------------------------------
16969ef7378bSmrgm4_define([_PKG_CONFIG],
16979ef7378bSmrg[if test -n "$$1"; then
16989ef7378bSmrg    pkg_cv_[]$1="$$1"
16999ef7378bSmrg elif test -n "$PKG_CONFIG"; then
17009ef7378bSmrg    PKG_CHECK_EXISTS([$3],
17019ef7378bSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
17029ef7378bSmrg		     [pkg_failed=yes])
17039ef7378bSmrg else
17049ef7378bSmrg    pkg_failed=untried
17059ef7378bSmrgfi[]dnl
17069ef7378bSmrg])# _PKG_CONFIG
17079ef7378bSmrg
17089ef7378bSmrg# _PKG_SHORT_ERRORS_SUPPORTED
17099ef7378bSmrg# -----------------------------
17109ef7378bSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
17119ef7378bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
17129ef7378bSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
17139ef7378bSmrg        _pkg_short_errors_supported=yes
17149ef7378bSmrgelse
17159ef7378bSmrg        _pkg_short_errors_supported=no
17169ef7378bSmrgfi[]dnl
17179ef7378bSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
17189ef7378bSmrg
17199ef7378bSmrg
17209ef7378bSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
17219ef7378bSmrg# [ACTION-IF-NOT-FOUND])
17229ef7378bSmrg#
17239ef7378bSmrg#
17249ef7378bSmrg# Note that if there is a possibility the first call to
17259ef7378bSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
17269ef7378bSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
17279ef7378bSmrg#
17289ef7378bSmrg#
17299ef7378bSmrg# --------------------------------------------------------------
17309ef7378bSmrgAC_DEFUN([PKG_CHECK_MODULES],
17319ef7378bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
17329ef7378bSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
17339ef7378bSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
17349ef7378bSmrg
17359ef7378bSmrgpkg_failed=no
17369ef7378bSmrgAC_MSG_CHECKING([for $1])
17379ef7378bSmrg
17389ef7378bSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
17399ef7378bSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
17409ef7378bSmrg
17419ef7378bSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
17429ef7378bSmrgand $1[]_LIBS to avoid the need to call pkg-config.
17439ef7378bSmrgSee the pkg-config man page for more details.])
17449ef7378bSmrg
17459ef7378bSmrgif test $pkg_failed = yes; then
17469ef7378bSmrg        _PKG_SHORT_ERRORS_SUPPORTED
17479ef7378bSmrg        if test $_pkg_short_errors_supported = yes; then
17489ef7378bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
17499ef7378bSmrg        else 
17509ef7378bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
17519ef7378bSmrg        fi
17529ef7378bSmrg	# Put the nasty error message in config.log where it belongs
17539ef7378bSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
17549ef7378bSmrg
17559ef7378bSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
17569ef7378bSmrg[Package requirements ($2) were not met:
17579ef7378bSmrg
17589ef7378bSmrg$$1_PKG_ERRORS
17599ef7378bSmrg
17609ef7378bSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
17619ef7378bSmrginstalled software in a non-standard prefix.
17629ef7378bSmrg
17639ef7378bSmrg_PKG_TEXT
17649ef7378bSmrg])],
17659ef7378bSmrg		[AC_MSG_RESULT([no])
17669ef7378bSmrg                $4])
17679ef7378bSmrgelif test $pkg_failed = untried; then
17689ef7378bSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
17699ef7378bSmrg[The pkg-config script could not be found or is too old.  Make sure it
17709ef7378bSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
17719ef7378bSmrgpath to pkg-config.
17729ef7378bSmrg
17739ef7378bSmrg_PKG_TEXT
17749ef7378bSmrg
17759ef7378bSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
17769ef7378bSmrg		[$4])
17779ef7378bSmrgelse
17789ef7378bSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
17799ef7378bSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
17809ef7378bSmrg        AC_MSG_RESULT([yes])
17819ef7378bSmrg	ifelse([$3], , :, [$3])
17829ef7378bSmrgfi[]dnl
17839ef7378bSmrg])# PKG_CHECK_MODULES
17849ef7378bSmrg
1785