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