aclocal.m4 revision b7fb5eac
1b7fb5eacSmrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
21a30de1fSmrg
31a30de1fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4b7fb5eacSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
51a30de1fSmrg# This file is free software; the Free Software Foundation
61a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
71a30de1fSmrg# with or without modifications, as long as this notice is preserved.
81a30de1fSmrg
91a30de1fSmrg# This program is distributed in the hope that it will be useful,
101a30de1fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
111a30de1fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
121a30de1fSmrg# PARTICULAR PURPOSE.
131a30de1fSmrg
14b7fb5eacSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15b7fb5eacSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16b7fb5eacSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17b7fb5eacSmrg[m4_warning([this file was generated for autoconf 2.63.
18b7fb5eacSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19b7fb5eacSmrgIf you have problems, you may need to regenerate the build system entirely.
20b7fb5eacSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
211a30de1fSmrg
22b7fb5eacSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
231a30de1fSmrg#
241a30de1fSmrg# This file is free software; the Free Software Foundation
251a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
261a30de1fSmrg# with or without modifications, as long as this notice is preserved.
271a30de1fSmrg
281a30de1fSmrg# AM_AUTOMAKE_VERSION(VERSION)
291a30de1fSmrg# ----------------------------
301a30de1fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
311a30de1fSmrg# generated from the m4 files accompanying Automake X.Y.
321a30de1fSmrg# (This private macro should not be called outside this file.)
331a30de1fSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34b7fb5eacSmrg[am__api_version='1.11'
351a30de1fSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
361a30de1fSmrgdnl require some minimum version.  Point them to the right macro.
37b7fb5eacSmrgm4_if([$1], [1.11], [],
381a30de1fSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
391a30de1fSmrg])
401a30de1fSmrg
411a30de1fSmrg# _AM_AUTOCONF_VERSION(VERSION)
421a30de1fSmrg# -----------------------------
431a30de1fSmrg# aclocal traces this macro to find the Autoconf version.
441a30de1fSmrg# This is a private macro too.  Using m4_define simplifies
451a30de1fSmrg# the logic in aclocal, which can simply ignore this definition.
461a30de1fSmrgm4_define([_AM_AUTOCONF_VERSION], [])
471a30de1fSmrg
481a30de1fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
491a30de1fSmrg# -------------------------------
501a30de1fSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51b7fb5eacSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
521a30de1fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53b7fb5eacSmrg[AM_AUTOMAKE_VERSION([1.11])dnl
54b7fb5eacSmrgm4_ifndef([AC_AUTOCONF_VERSION],
55b7fb5eacSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56b7fb5eacSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
571a30de1fSmrg
581a30de1fSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
591a30de1fSmrg
601a30de1fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
611a30de1fSmrg#
621a30de1fSmrg# This file is free software; the Free Software Foundation
631a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
641a30de1fSmrg# with or without modifications, as long as this notice is preserved.
651a30de1fSmrg
661a30de1fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
671a30de1fSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
681a30de1fSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
691a30de1fSmrg#
701a30de1fSmrg# Of course, Automake must honor this variable whenever it calls a
711a30de1fSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
721a30de1fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
731a30de1fSmrg# depending on how configure is run.  This is pretty annoying, since
741a30de1fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
751a30de1fSmrg# source directory, any form will work fine, but in subdirectories a
761a30de1fSmrg# relative path needs to be adjusted first.
771a30de1fSmrg#
781a30de1fSmrg# $ac_aux_dir/missing
791a30de1fSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
801a30de1fSmrg# $top_srcdir/$ac_aux_dir/missing
811a30de1fSmrg#    fails if $ac_aux_dir is absolute,
821a30de1fSmrg#    fails when called from a subdirectory in a VPATH build with
831a30de1fSmrg#          a relative $ac_aux_dir
841a30de1fSmrg#
851a30de1fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
861a30de1fSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
871a30de1fSmrg# harmless because $srcdir is `.', but things will broke when you
881a30de1fSmrg# start a VPATH build or use an absolute $srcdir.
891a30de1fSmrg#
901a30de1fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
911a30de1fSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
921a30de1fSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
931a30de1fSmrg# and then we would define $MISSING as
941a30de1fSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
951a30de1fSmrg# This will work as long as MISSING is not called from configure, because
961a30de1fSmrg# unfortunately $(top_srcdir) has no meaning in configure.
971a30de1fSmrg# However there are other variables, like CC, which are often used in
981a30de1fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
991a30de1fSmrg#
1001a30de1fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
1011a30de1fSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
1021a30de1fSmrg# configured tree to be moved without reconfiguration.
1031a30de1fSmrg
1041a30de1fSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1051a30de1fSmrg[dnl Rely on autoconf to set up CDPATH properly.
1061a30de1fSmrgAC_PREREQ([2.50])dnl
1071a30de1fSmrg# expand $ac_aux_dir to an absolute path
1081a30de1fSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
1091a30de1fSmrg])
1101a30de1fSmrg
1111a30de1fSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1121a30de1fSmrg
113b7fb5eacSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1141a30de1fSmrg# Free Software Foundation, Inc.
1151a30de1fSmrg#
1161a30de1fSmrg# This file is free software; the Free Software Foundation
1171a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
1181a30de1fSmrg# with or without modifications, as long as this notice is preserved.
1191a30de1fSmrg
120b7fb5eacSmrg# serial 9
1211a30de1fSmrg
1221a30de1fSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1231a30de1fSmrg# -------------------------------------
1241a30de1fSmrg# Define a conditional.
1251a30de1fSmrgAC_DEFUN([AM_CONDITIONAL],
1261a30de1fSmrg[AC_PREREQ(2.52)dnl
1271a30de1fSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1281a30de1fSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1291a30de1fSmrgAC_SUBST([$1_TRUE])dnl
1301a30de1fSmrgAC_SUBST([$1_FALSE])dnl
1311a30de1fSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1321a30de1fSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133b7fb5eacSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1341a30de1fSmrgif $2; then
1351a30de1fSmrg  $1_TRUE=
1361a30de1fSmrg  $1_FALSE='#'
1371a30de1fSmrgelse
1381a30de1fSmrg  $1_TRUE='#'
1391a30de1fSmrg  $1_FALSE=
1401a30de1fSmrgfi
1411a30de1fSmrgAC_CONFIG_COMMANDS_PRE(
1421a30de1fSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1431a30de1fSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1441a30de1fSmrgUsually this means the macro was only invoked conditionally.]])
1451a30de1fSmrgfi])])
1461a30de1fSmrg
147b7fb5eacSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1481a30de1fSmrg# Free Software Foundation, Inc.
1491a30de1fSmrg#
1501a30de1fSmrg# This file is free software; the Free Software Foundation
1511a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
1521a30de1fSmrg# with or without modifications, as long as this notice is preserved.
1531a30de1fSmrg
154b7fb5eacSmrg# serial 10
1551a30de1fSmrg
1561a30de1fSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1571a30de1fSmrg# written in clear, in which case automake, when reading aclocal.m4,
1581a30de1fSmrg# will think it sees a *use*, and therefore will trigger all it's
1591a30de1fSmrg# C support machinery.  Also note that it means that autoscan, seeing
1601a30de1fSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1611a30de1fSmrg
1621a30de1fSmrg
1631a30de1fSmrg# _AM_DEPENDENCIES(NAME)
1641a30de1fSmrg# ----------------------
1651a30de1fSmrg# See how the compiler implements dependency checking.
1661a30de1fSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1671a30de1fSmrg# We try a few techniques and use that to set a single cache variable.
1681a30de1fSmrg#
1691a30de1fSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1701a30de1fSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1711a30de1fSmrg# dependency, and given that the user is not expected to run this macro,
1721a30de1fSmrg# just rely on AC_PROG_CC.
1731a30de1fSmrgAC_DEFUN([_AM_DEPENDENCIES],
1741a30de1fSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1751a30de1fSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1761a30de1fSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1771a30de1fSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1781a30de1fSmrg
1791a30de1fSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1801a30de1fSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1811a30de1fSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1821a30de1fSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1831a30de1fSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1841a30de1fSmrg                   [depcc="$$1"   am_compiler_list=])
1851a30de1fSmrg
1861a30de1fSmrgAC_CACHE_CHECK([dependency style of $depcc],
1871a30de1fSmrg               [am_cv_$1_dependencies_compiler_type],
1881a30de1fSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1891a30de1fSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1901a30de1fSmrg  # making bogus files that we don't know about and never remove.  For
1911a30de1fSmrg  # instance it was reported that on HP-UX the gcc test will end up
1921a30de1fSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1931a30de1fSmrg  # in D'.
1941a30de1fSmrg  mkdir conftest.dir
1951a30de1fSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1961a30de1fSmrg  # using a relative directory.
1971a30de1fSmrg  cp "$am_depcomp" conftest.dir
1981a30de1fSmrg  cd conftest.dir
1991a30de1fSmrg  # We will build objects and dependencies in a subdirectory because
2001a30de1fSmrg  # it helps to detect inapplicable dependency modes.  For instance
2011a30de1fSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2021a30de1fSmrg  # side effect of compilation, but ICC will put the dependencies in
2031a30de1fSmrg  # the current directory while Tru64 will put them in the object
2041a30de1fSmrg  # directory.
2051a30de1fSmrg  mkdir sub
2061a30de1fSmrg
2071a30de1fSmrg  am_cv_$1_dependencies_compiler_type=none
2081a30de1fSmrg  if test "$am_compiler_list" = ""; then
2091a30de1fSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2101a30de1fSmrg  fi
211b7fb5eacSmrg  am__universal=false
212b7fb5eacSmrg  m4_case([$1], [CC],
213b7fb5eacSmrg    [case " $depcc " in #(
214b7fb5eacSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215b7fb5eacSmrg     esac],
216b7fb5eacSmrg    [CXX],
217b7fb5eacSmrg    [case " $depcc " in #(
218b7fb5eacSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219b7fb5eacSmrg     esac])
220b7fb5eacSmrg
2211a30de1fSmrg  for depmode in $am_compiler_list; do
2221a30de1fSmrg    # Setup a source with many dependencies, because some compilers
2231a30de1fSmrg    # like to wrap large dependency lists on column 80 (with \), and
2241a30de1fSmrg    # we should not choose a depcomp mode which is confused by this.
2251a30de1fSmrg    #
2261a30de1fSmrg    # We need to recreate these files for each test, as the compiler may
2271a30de1fSmrg    # overwrite some of them when testing with obscure command lines.
2281a30de1fSmrg    # This happens at least with the AIX C compiler.
2291a30de1fSmrg    : > sub/conftest.c
2301a30de1fSmrg    for i in 1 2 3 4 5 6; do
2311a30de1fSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2321a30de1fSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2331a30de1fSmrg      # Solaris 8's {/usr,}/bin/sh.
2341a30de1fSmrg      touch sub/conftst$i.h
2351a30de1fSmrg    done
2361a30de1fSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2371a30de1fSmrg
238b7fb5eacSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239b7fb5eacSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240b7fb5eacSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241b7fb5eacSmrg    # versions had trouble with output in subdirs
242b7fb5eacSmrg    am__obj=sub/conftest.${OBJEXT-o}
243b7fb5eacSmrg    am__minus_obj="-o $am__obj"
2441a30de1fSmrg    case $depmode in
245b7fb5eacSmrg    gcc)
246b7fb5eacSmrg      # This depmode causes a compiler race in universal mode.
247b7fb5eacSmrg      test "$am__universal" = false || continue
248b7fb5eacSmrg      ;;
2491a30de1fSmrg    nosideeffect)
2501a30de1fSmrg      # after this tag, mechanisms are not by side-effect, so they'll
2511a30de1fSmrg      # only be used when explicitly requested
2521a30de1fSmrg      if test "x$enable_dependency_tracking" = xyes; then
2531a30de1fSmrg	continue
2541a30de1fSmrg      else
2551a30de1fSmrg	break
2561a30de1fSmrg      fi
2571a30de1fSmrg      ;;
258b7fb5eacSmrg    msvisualcpp | msvcmsys)
259b7fb5eacSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
260b7fb5eacSmrg      # not run yet.  These depmodes are late enough in the game, and
261b7fb5eacSmrg      # so weak that their functioning should not be impacted.
262b7fb5eacSmrg      am__obj=conftest.${OBJEXT-o}
263b7fb5eacSmrg      am__minus_obj=
264b7fb5eacSmrg      ;;
2651a30de1fSmrg    none) break ;;
2661a30de1fSmrg    esac
2671a30de1fSmrg    if depmode=$depmode \
268b7fb5eacSmrg       source=sub/conftest.c object=$am__obj \
2691a30de1fSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270b7fb5eacSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2711a30de1fSmrg         >/dev/null 2>conftest.err &&
2721a30de1fSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2731a30de1fSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274b7fb5eacSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2751a30de1fSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2761a30de1fSmrg      # icc doesn't choke on unknown options, it will just issue warnings
2771a30de1fSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
2781a30de1fSmrg      # that says an option was ignored or not supported.
2791a30de1fSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2801a30de1fSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2811a30de1fSmrg      # The diagnosis changed in icc 8.0:
2821a30de1fSmrg      #   icc: Command line remark: option '-MP' not supported
2831a30de1fSmrg      if (grep 'ignoring option' conftest.err ||
2841a30de1fSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2851a30de1fSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2861a30de1fSmrg        break
2871a30de1fSmrg      fi
2881a30de1fSmrg    fi
2891a30de1fSmrg  done
2901a30de1fSmrg
2911a30de1fSmrg  cd ..
2921a30de1fSmrg  rm -rf conftest.dir
2931a30de1fSmrgelse
2941a30de1fSmrg  am_cv_$1_dependencies_compiler_type=none
2951a30de1fSmrgfi
2961a30de1fSmrg])
2971a30de1fSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2981a30de1fSmrgAM_CONDITIONAL([am__fastdep$1], [
2991a30de1fSmrg  test "x$enable_dependency_tracking" != xno \
3001a30de1fSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3011a30de1fSmrg])
3021a30de1fSmrg
3031a30de1fSmrg
3041a30de1fSmrg# AM_SET_DEPDIR
3051a30de1fSmrg# -------------
3061a30de1fSmrg# Choose a directory name for dependency files.
3071a30de1fSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3081a30de1fSmrgAC_DEFUN([AM_SET_DEPDIR],
3091a30de1fSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3101a30de1fSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3111a30de1fSmrg])
3121a30de1fSmrg
3131a30de1fSmrg
3141a30de1fSmrg# AM_DEP_TRACK
3151a30de1fSmrg# ------------
3161a30de1fSmrgAC_DEFUN([AM_DEP_TRACK],
3171a30de1fSmrg[AC_ARG_ENABLE(dependency-tracking,
3181a30de1fSmrg[  --disable-dependency-tracking  speeds up one-time build
3191a30de1fSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3201a30de1fSmrgif test "x$enable_dependency_tracking" != xno; then
3211a30de1fSmrg  am_depcomp="$ac_aux_dir/depcomp"
3221a30de1fSmrg  AMDEPBACKSLASH='\'
3231a30de1fSmrgfi
3241a30de1fSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3251a30de1fSmrgAC_SUBST([AMDEPBACKSLASH])dnl
3261a30de1fSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3271a30de1fSmrg])
3281a30de1fSmrg
3291a30de1fSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3301a30de1fSmrg
331b7fb5eacSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
3321a30de1fSmrg# Free Software Foundation, Inc.
3331a30de1fSmrg#
3341a30de1fSmrg# This file is free software; the Free Software Foundation
3351a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
3361a30de1fSmrg# with or without modifications, as long as this notice is preserved.
3371a30de1fSmrg
338b7fb5eacSmrg#serial 5
3391a30de1fSmrg
3401a30de1fSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3411a30de1fSmrg# ------------------------------
3421a30de1fSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343b7fb5eacSmrg[{
344b7fb5eacSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345b7fb5eacSmrg  # are listed without --file.  Let's play safe and only enable the eval
346b7fb5eacSmrg  # if we detect the quoting.
347b7fb5eacSmrg  case $CONFIG_FILES in
348b7fb5eacSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
349b7fb5eacSmrg  *)   set x $CONFIG_FILES ;;
350b7fb5eacSmrg  esac
351b7fb5eacSmrg  shift
352b7fb5eacSmrg  for mf
353b7fb5eacSmrg  do
354b7fb5eacSmrg    # Strip MF so we end up with the name of the file.
355b7fb5eacSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356b7fb5eacSmrg    # Check whether this is an Automake generated Makefile or not.
357b7fb5eacSmrg    # We used to match only the files named `Makefile.in', but
358b7fb5eacSmrg    # some people rename them; so instead we look at the file content.
359b7fb5eacSmrg    # Grep'ing the first line is not enough: some people post-process
360b7fb5eacSmrg    # each Makefile.in and add a new line on top of each file to say so.
361b7fb5eacSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
362b7fb5eacSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
363b7fb5eacSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364b7fb5eacSmrg      dirpart=`AS_DIRNAME("$mf")`
365b7fb5eacSmrg    else
366b7fb5eacSmrg      continue
367b7fb5eacSmrg    fi
368b7fb5eacSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
369b7fb5eacSmrg    # from the Makefile without running `make'.
370b7fb5eacSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371b7fb5eacSmrg    test -z "$DEPDIR" && continue
372b7fb5eacSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373b7fb5eacSmrg    test -z "am__include" && continue
374b7fb5eacSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375b7fb5eacSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
376b7fb5eacSmrg    U=`sed -n 's/^U = //p' < "$mf"`
377b7fb5eacSmrg    # Find all dependency output files, they are included files with
378b7fb5eacSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379b7fb5eacSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380b7fb5eacSmrg    # expansion.
381b7fb5eacSmrg    for file in `sed -n "
382b7fb5eacSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383b7fb5eacSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384b7fb5eacSmrg      # Make sure the directory exists.
385b7fb5eacSmrg      test -f "$dirpart/$file" && continue
386b7fb5eacSmrg      fdir=`AS_DIRNAME(["$file"])`
387b7fb5eacSmrg      AS_MKDIR_P([$dirpart/$fdir])
388b7fb5eacSmrg      # echo "creating $dirpart/$file"
389b7fb5eacSmrg      echo '# dummy' > "$dirpart/$file"
390b7fb5eacSmrg    done
3911a30de1fSmrg  done
392b7fb5eacSmrg}
3931a30de1fSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3941a30de1fSmrg
3951a30de1fSmrg
3961a30de1fSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3971a30de1fSmrg# -----------------------------
3981a30de1fSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
3991a30de1fSmrg#
4001a30de1fSmrg# This code is only required when automatic dependency tracking
4011a30de1fSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
4021a30de1fSmrg# need in order to bootstrap the dependency handling code.
4031a30de1fSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4041a30de1fSmrg[AC_CONFIG_COMMANDS([depfiles],
4051a30de1fSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4061a30de1fSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4071a30de1fSmrg])
4081a30de1fSmrg
4091a30de1fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
4101a30de1fSmrg# Free Software Foundation, Inc.
4111a30de1fSmrg#
4121a30de1fSmrg# This file is free software; the Free Software Foundation
4131a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
4141a30de1fSmrg# with or without modifications, as long as this notice is preserved.
4151a30de1fSmrg
4161a30de1fSmrg# serial 8
4171a30de1fSmrg
4181a30de1fSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
4191a30de1fSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
4201a30de1fSmrg
4211a30de1fSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4221a30de1fSmrg
4231a30de1fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
424b7fb5eacSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4251a30de1fSmrg#
4261a30de1fSmrg# This file is free software; the Free Software Foundation
4271a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
4281a30de1fSmrg# with or without modifications, as long as this notice is preserved.
4291a30de1fSmrg
430b7fb5eacSmrg# serial 16
4311a30de1fSmrg
4321a30de1fSmrg# This macro actually does too much.  Some checks are only needed if
4331a30de1fSmrg# your package does certain things.  But this isn't really a big deal.
4341a30de1fSmrg
4351a30de1fSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4361a30de1fSmrg# AM_INIT_AUTOMAKE([OPTIONS])
4371a30de1fSmrg# -----------------------------------------------
4381a30de1fSmrg# The call with PACKAGE and VERSION arguments is the old style
4391a30de1fSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
4401a30de1fSmrg# and VERSION should now be passed to AC_INIT and removed from
4411a30de1fSmrg# the call to AM_INIT_AUTOMAKE.
4421a30de1fSmrg# We support both call styles for the transition.  After
4431a30de1fSmrg# the next Automake release, Autoconf can make the AC_INIT
4441a30de1fSmrg# arguments mandatory, and then we can depend on a new Autoconf
4451a30de1fSmrg# release and drop the old call support.
4461a30de1fSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
447b7fb5eacSmrg[AC_PREREQ([2.62])dnl
4481a30de1fSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4491a30de1fSmrgdnl the ones we care about.
4501a30de1fSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4511a30de1fSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4521a30de1fSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4531a30de1fSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4541a30de1fSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4551a30de1fSmrg  # is not polluted with repeated "-I."
4561a30de1fSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4571a30de1fSmrg  # test to see if srcdir already configured
4581a30de1fSmrg  if test -f $srcdir/config.status; then
4591a30de1fSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4601a30de1fSmrg  fi
4611a30de1fSmrgfi
4621a30de1fSmrg
4631a30de1fSmrg# test whether we have cygpath
4641a30de1fSmrgif test -z "$CYGPATH_W"; then
4651a30de1fSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4661a30de1fSmrg    CYGPATH_W='cygpath -w'
4671a30de1fSmrg  else
4681a30de1fSmrg    CYGPATH_W=echo
4691a30de1fSmrg  fi
4701a30de1fSmrgfi
4711a30de1fSmrgAC_SUBST([CYGPATH_W])
4721a30de1fSmrg
4731a30de1fSmrg# Define the identity of the package.
4741a30de1fSmrgdnl Distinguish between old-style and new-style calls.
4751a30de1fSmrgm4_ifval([$2],
4761a30de1fSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4771a30de1fSmrg AC_SUBST([PACKAGE], [$1])dnl
4781a30de1fSmrg AC_SUBST([VERSION], [$2])],
4791a30de1fSmrg[_AM_SET_OPTIONS([$1])dnl
4801a30de1fSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4811a30de1fSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4821a30de1fSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4831a30de1fSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4841a30de1fSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4851a30de1fSmrg
4861a30de1fSmrg_AM_IF_OPTION([no-define],,
4871a30de1fSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4881a30de1fSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4891a30de1fSmrg
4901a30de1fSmrg# Some tools Automake needs.
4911a30de1fSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4921a30de1fSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4931a30de1fSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4941a30de1fSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4951a30de1fSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4961a30de1fSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4971a30de1fSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
498b7fb5eacSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
499b7fb5eacSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
5001a30de1fSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
5011a30de1fSmrg# We need awk for the "check" target.  The system "awk" is bad on
5021a30de1fSmrg# some platforms.
5031a30de1fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
5041a30de1fSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
5051a30de1fSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
5061a30de1fSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
507b7fb5eacSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
508b7fb5eacSmrg			     [_AM_PROG_TAR([v7])])])
5091a30de1fSmrg_AM_IF_OPTION([no-dependencies],,
5101a30de1fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
511b7fb5eacSmrg		  [_AM_DEPENDENCIES(CC)],
512b7fb5eacSmrg		  [define([AC_PROG_CC],
513b7fb5eacSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
5141a30de1fSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
515b7fb5eacSmrg		  [_AM_DEPENDENCIES(CXX)],
516b7fb5eacSmrg		  [define([AC_PROG_CXX],
517b7fb5eacSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5181a30de1fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
519b7fb5eacSmrg		  [_AM_DEPENDENCIES(OBJC)],
520b7fb5eacSmrg		  [define([AC_PROG_OBJC],
521b7fb5eacSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
5221a30de1fSmrg])
523b7fb5eacSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
524b7fb5eacSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
525b7fb5eacSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
526b7fb5eacSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
527b7fb5eacSmrgAC_CONFIG_COMMANDS_PRE(dnl
528b7fb5eacSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
529b7fb5eacSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5301a30de1fSmrg])
5311a30de1fSmrg
532b7fb5eacSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
533b7fb5eacSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
534b7fb5eacSmrgdnl mangled by Autoconf and run in a shell conditional statement.
535b7fb5eacSmrgm4_define([_AC_COMPILER_EXEEXT],
536b7fb5eacSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537b7fb5eacSmrg
5381a30de1fSmrg
5391a30de1fSmrg# When config.status generates a header, we must update the stamp-h file.
5401a30de1fSmrg# This file resides in the same directory as the config header
5411a30de1fSmrg# that is generated.  The stamp files are numbered to have different names.
5421a30de1fSmrg
5431a30de1fSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
5441a30de1fSmrg# loop where config.status creates the headers, so we can generate
5451a30de1fSmrg# our stamp files there.
5461a30de1fSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
5471a30de1fSmrg[# Compute $1's index in $config_headers.
548b7fb5eacSmrg_am_arg=$1
5491a30de1fSmrg_am_stamp_count=1
5501a30de1fSmrgfor _am_header in $config_headers :; do
5511a30de1fSmrg  case $_am_header in
552b7fb5eacSmrg    $_am_arg | $_am_arg:* )
5531a30de1fSmrg      break ;;
5541a30de1fSmrg    * )
5551a30de1fSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5561a30de1fSmrg  esac
5571a30de1fSmrgdone
558b7fb5eacSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
5591a30de1fSmrg
560b7fb5eacSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
5611a30de1fSmrg#
5621a30de1fSmrg# This file is free software; the Free Software Foundation
5631a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
5641a30de1fSmrg# with or without modifications, as long as this notice is preserved.
5651a30de1fSmrg
5661a30de1fSmrg# AM_PROG_INSTALL_SH
5671a30de1fSmrg# ------------------
5681a30de1fSmrg# Define $install_sh.
5691a30de1fSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5701a30de1fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
571b7fb5eacSmrgif test x"${install_sh}" != xset; then
572b7fb5eacSmrg  case $am_aux_dir in
573b7fb5eacSmrg  *\ * | *\	*)
574b7fb5eacSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
575b7fb5eacSmrg  *)
576b7fb5eacSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
577b7fb5eacSmrg  esac
578b7fb5eacSmrgfi
5791a30de1fSmrgAC_SUBST(install_sh)])
5801a30de1fSmrg
5811a30de1fSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5821a30de1fSmrg#
5831a30de1fSmrg# This file is free software; the Free Software Foundation
5841a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
5851a30de1fSmrg# with or without modifications, as long as this notice is preserved.
5861a30de1fSmrg
5871a30de1fSmrg# serial 2
5881a30de1fSmrg
5891a30de1fSmrg# Check whether the underlying file-system supports filenames
5901a30de1fSmrg# with a leading dot.  For instance MS-DOS doesn't.
5911a30de1fSmrgAC_DEFUN([AM_SET_LEADING_DOT],
5921a30de1fSmrg[rm -rf .tst 2>/dev/null
5931a30de1fSmrgmkdir .tst 2>/dev/null
5941a30de1fSmrgif test -d .tst; then
5951a30de1fSmrg  am__leading_dot=.
5961a30de1fSmrgelse
5971a30de1fSmrg  am__leading_dot=_
5981a30de1fSmrgfi
5991a30de1fSmrgrmdir .tst 2>/dev/null
6001a30de1fSmrgAC_SUBST([am__leading_dot])])
6011a30de1fSmrg
6021a30de1fSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
6031a30de1fSmrg# From Jim Meyering
6041a30de1fSmrg
605b7fb5eacSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
6061a30de1fSmrg# Free Software Foundation, Inc.
6071a30de1fSmrg#
6081a30de1fSmrg# This file is free software; the Free Software Foundation
6091a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
6101a30de1fSmrg# with or without modifications, as long as this notice is preserved.
6111a30de1fSmrg
612b7fb5eacSmrg# serial 5
6131a30de1fSmrg
614b7fb5eacSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
615b7fb5eacSmrg# ----------------------------------
616b7fb5eacSmrg# Control maintainer-specific portions of Makefiles.
617b7fb5eacSmrg# Default is to disable them, unless `enable' is passed literally.
618b7fb5eacSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
619b7fb5eacSmrg# can override the default with the --enable/--disable switch.
6201a30de1fSmrgAC_DEFUN([AM_MAINTAINER_MODE],
621b7fb5eacSmrg[m4_case(m4_default([$1], [disable]),
622b7fb5eacSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
623b7fb5eacSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
624b7fb5eacSmrg       [m4_define([am_maintainer_other], [enable])
625b7fb5eacSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
626b7fb5eacSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
627b7fb5eacSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
628b7fb5eacSmrg  AC_ARG_ENABLE([maintainer-mode],
629b7fb5eacSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
6301a30de1fSmrg			  (and sometimes confusing) to the casual installer],
631b7fb5eacSmrg      [USE_MAINTAINER_MODE=$enableval],
632b7fb5eacSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
6331a30de1fSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
634b7fb5eacSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
6351a30de1fSmrg  MAINT=$MAINTAINER_MODE_TRUE
636b7fb5eacSmrg  AC_SUBST([MAINT])dnl
6371a30de1fSmrg]
6381a30de1fSmrg)
6391a30de1fSmrg
6401a30de1fSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
6411a30de1fSmrg
6421a30de1fSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6431a30de1fSmrg
644b7fb5eacSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
6451a30de1fSmrg#
6461a30de1fSmrg# This file is free software; the Free Software Foundation
6471a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
6481a30de1fSmrg# with or without modifications, as long as this notice is preserved.
6491a30de1fSmrg
650b7fb5eacSmrg# serial 4
6511a30de1fSmrg
6521a30de1fSmrg# AM_MAKE_INCLUDE()
6531a30de1fSmrg# -----------------
6541a30de1fSmrg# Check to see how make treats includes.
6551a30de1fSmrgAC_DEFUN([AM_MAKE_INCLUDE],
6561a30de1fSmrg[am_make=${MAKE-make}
6571a30de1fSmrgcat > confinc << 'END'
6581a30de1fSmrgam__doit:
659b7fb5eacSmrg	@echo this is the am__doit target
6601a30de1fSmrg.PHONY: am__doit
6611a30de1fSmrgEND
6621a30de1fSmrg# If we don't find an include directive, just comment out the code.
6631a30de1fSmrgAC_MSG_CHECKING([for style of include used by $am_make])
6641a30de1fSmrgam__include="#"
6651a30de1fSmrgam__quote=
6661a30de1fSmrg_am_result=none
6671a30de1fSmrg# First try GNU make style include.
6681a30de1fSmrgecho "include confinc" > confmf
669b7fb5eacSmrg# Ignore all kinds of additional output from `make'.
670b7fb5eacSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
671b7fb5eacSmrg*the\ am__doit\ target*)
672b7fb5eacSmrg  am__include=include
673b7fb5eacSmrg  am__quote=
674b7fb5eacSmrg  _am_result=GNU
675b7fb5eacSmrg  ;;
676b7fb5eacSmrgesac
6771a30de1fSmrg# Now try BSD make style include.
6781a30de1fSmrgif test "$am__include" = "#"; then
6791a30de1fSmrg   echo '.include "confinc"' > confmf
680b7fb5eacSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
681b7fb5eacSmrg   *the\ am__doit\ target*)
682b7fb5eacSmrg     am__include=.include
683b7fb5eacSmrg     am__quote="\""
684b7fb5eacSmrg     _am_result=BSD
685b7fb5eacSmrg     ;;
686b7fb5eacSmrg   esac
6871a30de1fSmrgfi
6881a30de1fSmrgAC_SUBST([am__include])
6891a30de1fSmrgAC_SUBST([am__quote])
6901a30de1fSmrgAC_MSG_RESULT([$_am_result])
6911a30de1fSmrgrm -f confinc confmf
6921a30de1fSmrg])
6931a30de1fSmrg
6941a30de1fSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6951a30de1fSmrg
696b7fb5eacSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
6971a30de1fSmrg# Free Software Foundation, Inc.
6981a30de1fSmrg#
6991a30de1fSmrg# This file is free software; the Free Software Foundation
7001a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
7011a30de1fSmrg# with or without modifications, as long as this notice is preserved.
7021a30de1fSmrg
703b7fb5eacSmrg# serial 6
7041a30de1fSmrg
7051a30de1fSmrg# AM_MISSING_PROG(NAME, PROGRAM)
7061a30de1fSmrg# ------------------------------
7071a30de1fSmrgAC_DEFUN([AM_MISSING_PROG],
7081a30de1fSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
7091a30de1fSmrg$1=${$1-"${am_missing_run}$2"}
7101a30de1fSmrgAC_SUBST($1)])
7111a30de1fSmrg
7121a30de1fSmrg
7131a30de1fSmrg# AM_MISSING_HAS_RUN
7141a30de1fSmrg# ------------------
7151a30de1fSmrg# Define MISSING if not defined so far and test if it supports --run.
7161a30de1fSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
7171a30de1fSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7181a30de1fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7191a30de1fSmrgAC_REQUIRE_AUX_FILE([missing])dnl
720b7fb5eacSmrgif test x"${MISSING+set}" != xset; then
721b7fb5eacSmrg  case $am_aux_dir in
722b7fb5eacSmrg  *\ * | *\	*)
723b7fb5eacSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
724b7fb5eacSmrg  *)
725b7fb5eacSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
726b7fb5eacSmrg  esac
727b7fb5eacSmrgfi
7281a30de1fSmrg# Use eval to expand $SHELL
7291a30de1fSmrgif eval "$MISSING --run true"; then
7301a30de1fSmrg  am_missing_run="$MISSING --run "
7311a30de1fSmrgelse
7321a30de1fSmrg  am_missing_run=
7331a30de1fSmrg  AC_MSG_WARN([`missing' script is too old or missing])
7341a30de1fSmrgfi
7351a30de1fSmrg])
7361a30de1fSmrg
7371a30de1fSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
7381a30de1fSmrg#
7391a30de1fSmrg# This file is free software; the Free Software Foundation
7401a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
7411a30de1fSmrg# with or without modifications, as long as this notice is preserved.
7421a30de1fSmrg
7431a30de1fSmrg# AM_PROG_MKDIR_P
7441a30de1fSmrg# ---------------
7451a30de1fSmrg# Check for `mkdir -p'.
7461a30de1fSmrgAC_DEFUN([AM_PROG_MKDIR_P],
7471a30de1fSmrg[AC_PREREQ([2.60])dnl
7481a30de1fSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7491a30de1fSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7501a30de1fSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
7511a30de1fSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7521a30de1fSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7531a30de1fSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7541a30de1fSmrgdnl adjustment using top_builddir (which is defined more often than
7551a30de1fSmrgdnl MKDIR_P).
7561a30de1fSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7571a30de1fSmrgcase $mkdir_p in
7581a30de1fSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7591a30de1fSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7601a30de1fSmrgesac
7611a30de1fSmrg])
7621a30de1fSmrg
7631a30de1fSmrg# Helper functions for option handling.                     -*- Autoconf -*-
7641a30de1fSmrg
765b7fb5eacSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
7661a30de1fSmrg#
7671a30de1fSmrg# This file is free software; the Free Software Foundation
7681a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
7691a30de1fSmrg# with or without modifications, as long as this notice is preserved.
7701a30de1fSmrg
771b7fb5eacSmrg# serial 4
7721a30de1fSmrg
7731a30de1fSmrg# _AM_MANGLE_OPTION(NAME)
7741a30de1fSmrg# -----------------------
7751a30de1fSmrgAC_DEFUN([_AM_MANGLE_OPTION],
7761a30de1fSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7771a30de1fSmrg
7781a30de1fSmrg# _AM_SET_OPTION(NAME)
7791a30de1fSmrg# ------------------------------
7801a30de1fSmrg# Set option NAME.  Presently that only means defining a flag for this option.
7811a30de1fSmrgAC_DEFUN([_AM_SET_OPTION],
7821a30de1fSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7831a30de1fSmrg
7841a30de1fSmrg# _AM_SET_OPTIONS(OPTIONS)
7851a30de1fSmrg# ----------------------------------
7861a30de1fSmrg# OPTIONS is a space-separated list of Automake options.
7871a30de1fSmrgAC_DEFUN([_AM_SET_OPTIONS],
788b7fb5eacSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7891a30de1fSmrg
7901a30de1fSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7911a30de1fSmrg# -------------------------------------------
7921a30de1fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7931a30de1fSmrgAC_DEFUN([_AM_IF_OPTION],
7941a30de1fSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7951a30de1fSmrg
7961a30de1fSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7971a30de1fSmrg
798b7fb5eacSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
7991a30de1fSmrg# Free Software Foundation, Inc.
8001a30de1fSmrg#
8011a30de1fSmrg# This file is free software; the Free Software Foundation
8021a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
8031a30de1fSmrg# with or without modifications, as long as this notice is preserved.
8041a30de1fSmrg
805b7fb5eacSmrg# serial 5
8061a30de1fSmrg
8071a30de1fSmrg# AM_SANITY_CHECK
8081a30de1fSmrg# ---------------
8091a30de1fSmrgAC_DEFUN([AM_SANITY_CHECK],
8101a30de1fSmrg[AC_MSG_CHECKING([whether build environment is sane])
8111a30de1fSmrg# Just in case
8121a30de1fSmrgsleep 1
8131a30de1fSmrgecho timestamp > conftest.file
814b7fb5eacSmrg# Reject unsafe characters in $srcdir or the absolute working directory
815b7fb5eacSmrg# name.  Accept space and tab only in the latter.
816b7fb5eacSmrgam_lf='
817b7fb5eacSmrg'
818b7fb5eacSmrgcase `pwd` in
819b7fb5eacSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
820b7fb5eacSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
821b7fb5eacSmrgesac
822b7fb5eacSmrgcase $srcdir in
823b7fb5eacSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
824b7fb5eacSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
825b7fb5eacSmrgesac
826b7fb5eacSmrg
8271a30de1fSmrg# Do `set' in a subshell so we don't clobber the current shell's
8281a30de1fSmrg# arguments.  Must try -L first in case configure is actually a
8291a30de1fSmrg# symlink; some systems play weird games with the mod time of symlinks
8301a30de1fSmrg# (eg FreeBSD returns the mod time of the symlink's containing
8311a30de1fSmrg# directory).
8321a30de1fSmrgif (
833b7fb5eacSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8341a30de1fSmrg   if test "$[*]" = "X"; then
8351a30de1fSmrg      # -L didn't work.
836b7fb5eacSmrg      set X `ls -t "$srcdir/configure" conftest.file`
8371a30de1fSmrg   fi
8381a30de1fSmrg   rm -f conftest.file
8391a30de1fSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
8401a30de1fSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8411a30de1fSmrg
8421a30de1fSmrg      # If neither matched, then we have a broken ls.  This can happen
8431a30de1fSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
8441a30de1fSmrg      # broken ls alias from the environment.  This has actually
8451a30de1fSmrg      # happened.  Such a system could not be considered "sane".
8461a30de1fSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8471a30de1fSmrgalias in your environment])
8481a30de1fSmrg   fi
8491a30de1fSmrg
8501a30de1fSmrg   test "$[2]" = conftest.file
8511a30de1fSmrg   )
8521a30de1fSmrgthen
8531a30de1fSmrg   # Ok.
8541a30de1fSmrg   :
8551a30de1fSmrgelse
8561a30de1fSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
8571a30de1fSmrgCheck your system clock])
8581a30de1fSmrgfi
8591a30de1fSmrgAC_MSG_RESULT(yes)])
8601a30de1fSmrg
861b7fb5eacSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
862b7fb5eacSmrg#
863b7fb5eacSmrg# This file is free software; the Free Software Foundation
864b7fb5eacSmrg# gives unlimited permission to copy and/or distribute it,
865b7fb5eacSmrg# with or without modifications, as long as this notice is preserved.
866b7fb5eacSmrg
867b7fb5eacSmrg# serial 1
868b7fb5eacSmrg
869b7fb5eacSmrg# AM_SILENT_RULES([DEFAULT])
870b7fb5eacSmrg# --------------------------
871b7fb5eacSmrg# Enable less verbose build rules; with the default set to DEFAULT
872b7fb5eacSmrg# (`yes' being less verbose, `no' or empty being verbose).
873b7fb5eacSmrgAC_DEFUN([AM_SILENT_RULES],
874b7fb5eacSmrg[AC_ARG_ENABLE([silent-rules],
875b7fb5eacSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
876b7fb5eacSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
877b7fb5eacSmrgcase $enable_silent_rules in
878b7fb5eacSmrgyes) AM_DEFAULT_VERBOSITY=0;;
879b7fb5eacSmrgno)  AM_DEFAULT_VERBOSITY=1;;
880b7fb5eacSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
881b7fb5eacSmrgesac
882b7fb5eacSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
883b7fb5eacSmrgAM_BACKSLASH='\'
884b7fb5eacSmrgAC_SUBST([AM_BACKSLASH])dnl
885b7fb5eacSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
886b7fb5eacSmrg])
887b7fb5eacSmrg
8881a30de1fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8891a30de1fSmrg#
8901a30de1fSmrg# This file is free software; the Free Software Foundation
8911a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
8921a30de1fSmrg# with or without modifications, as long as this notice is preserved.
8931a30de1fSmrg
8941a30de1fSmrg# AM_PROG_INSTALL_STRIP
8951a30de1fSmrg# ---------------------
8961a30de1fSmrg# One issue with vendor `install' (even GNU) is that you can't
8971a30de1fSmrg# specify the program used to strip binaries.  This is especially
8981a30de1fSmrg# annoying in cross-compiling environments, where the build's strip
8991a30de1fSmrg# is unlikely to handle the host's binaries.
9001a30de1fSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9011a30de1fSmrg# always use install-sh in `make install-strip', and initialize
9021a30de1fSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
9031a30de1fSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
9041a30de1fSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9051a30de1fSmrg# Installed binaries are usually stripped using `strip' when the user
9061a30de1fSmrg# run `make install-strip'.  However `strip' might not be the right
9071a30de1fSmrg# tool to use in cross-compilation environments, therefore Automake
9081a30de1fSmrg# will honor the `STRIP' environment variable to overrule this program.
9091a30de1fSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
9101a30de1fSmrgif test "$cross_compiling" != no; then
9111a30de1fSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
9121a30de1fSmrgfi
9131a30de1fSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9141a30de1fSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9151a30de1fSmrg
916b7fb5eacSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9171a30de1fSmrg#
9181a30de1fSmrg# This file is free software; the Free Software Foundation
9191a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
9201a30de1fSmrg# with or without modifications, as long as this notice is preserved.
9211a30de1fSmrg
922b7fb5eacSmrg# serial 2
923b7fb5eacSmrg
9241a30de1fSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
9251a30de1fSmrg# ---------------------------
926b7fb5eacSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9271a30de1fSmrg# This macro is traced by Automake.
9281a30de1fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9291a30de1fSmrg
930b7fb5eacSmrg# AM_SUBST_NOTMAKE(VARIABLE)
931b7fb5eacSmrg# ---------------------------
932b7fb5eacSmrg# Public sister of _AM_SUBST_NOTMAKE.
933b7fb5eacSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
934b7fb5eacSmrg
9351a30de1fSmrg# Check how to create a tarball.                            -*- Autoconf -*-
9361a30de1fSmrg
9371a30de1fSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9381a30de1fSmrg#
9391a30de1fSmrg# This file is free software; the Free Software Foundation
9401a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
9411a30de1fSmrg# with or without modifications, as long as this notice is preserved.
9421a30de1fSmrg
9431a30de1fSmrg# serial 2
9441a30de1fSmrg
9451a30de1fSmrg# _AM_PROG_TAR(FORMAT)
9461a30de1fSmrg# --------------------
9471a30de1fSmrg# Check how to create a tarball in format FORMAT.
9481a30de1fSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
9491a30de1fSmrg#
9501a30de1fSmrg# Substitute a variable $(am__tar) that is a command
9511a30de1fSmrg# writing to stdout a FORMAT-tarball containing the directory
9521a30de1fSmrg# $tardir.
9531a30de1fSmrg#     tardir=directory && $(am__tar) > result.tar
9541a30de1fSmrg#
9551a30de1fSmrg# Substitute a variable $(am__untar) that extract such
9561a30de1fSmrg# a tarball read from stdin.
9571a30de1fSmrg#     $(am__untar) < result.tar
9581a30de1fSmrgAC_DEFUN([_AM_PROG_TAR],
9591a30de1fSmrg[# Always define AMTAR for backward compatibility.
9601a30de1fSmrgAM_MISSING_PROG([AMTAR], [tar])
9611a30de1fSmrgm4_if([$1], [v7],
9621a30de1fSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
9631a30de1fSmrg     [m4_case([$1], [ustar],, [pax],,
9641a30de1fSmrg              [m4_fatal([Unknown tar format])])
9651a30de1fSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
9661a30de1fSmrg# Loop over all known methods to create a tar archive until one works.
9671a30de1fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9681a30de1fSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
9691a30de1fSmrg# Do not fold the above two line into one, because Tru64 sh and
9701a30de1fSmrg# Solaris sh will not grok spaces in the rhs of `-'.
9711a30de1fSmrgfor _am_tool in $_am_tools
9721a30de1fSmrgdo
9731a30de1fSmrg  case $_am_tool in
9741a30de1fSmrg  gnutar)
9751a30de1fSmrg    for _am_tar in tar gnutar gtar;
9761a30de1fSmrg    do
9771a30de1fSmrg      AM_RUN_LOG([$_am_tar --version]) && break
9781a30de1fSmrg    done
9791a30de1fSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9801a30de1fSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9811a30de1fSmrg    am__untar="$_am_tar -xf -"
9821a30de1fSmrg    ;;
9831a30de1fSmrg  plaintar)
9841a30de1fSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
9851a30de1fSmrg    # ustar tarball either.
9861a30de1fSmrg    (tar --version) >/dev/null 2>&1 && continue
9871a30de1fSmrg    am__tar='tar chf - "$$tardir"'
9881a30de1fSmrg    am__tar_='tar chf - "$tardir"'
9891a30de1fSmrg    am__untar='tar xf -'
9901a30de1fSmrg    ;;
9911a30de1fSmrg  pax)
9921a30de1fSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
9931a30de1fSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
9941a30de1fSmrg    am__untar='pax -r'
9951a30de1fSmrg    ;;
9961a30de1fSmrg  cpio)
9971a30de1fSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9981a30de1fSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9991a30de1fSmrg    am__untar='cpio -i -H $1 -d'
10001a30de1fSmrg    ;;
10011a30de1fSmrg  none)
10021a30de1fSmrg    am__tar=false
10031a30de1fSmrg    am__tar_=false
10041a30de1fSmrg    am__untar=false
10051a30de1fSmrg    ;;
10061a30de1fSmrg  esac
10071a30de1fSmrg
10081a30de1fSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
10091a30de1fSmrg  # and am__untar set.
10101a30de1fSmrg  test -n "${am_cv_prog_tar_$1}" && break
10111a30de1fSmrg
10121a30de1fSmrg  # tar/untar a dummy directory, and stop if the command works
10131a30de1fSmrg  rm -rf conftest.dir
10141a30de1fSmrg  mkdir conftest.dir
10151a30de1fSmrg  echo GrepMe > conftest.dir/file
10161a30de1fSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10171a30de1fSmrg  rm -rf conftest.dir
10181a30de1fSmrg  if test -s conftest.tar; then
10191a30de1fSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
10201a30de1fSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
10211a30de1fSmrg  fi
10221a30de1fSmrgdone
10231a30de1fSmrgrm -rf conftest.dir
10241a30de1fSmrg
10251a30de1fSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10261a30de1fSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
10271a30de1fSmrgAC_SUBST([am__tar])
10281a30de1fSmrgAC_SUBST([am__untar])
10291a30de1fSmrg]) # _AM_PROG_TAR
10301a30de1fSmrg
1031b7fb5eacSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10321a30de1fSmrgdnl
10331a30de1fSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
10341a30de1fSmrgdnl 
10351a30de1fSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10361a30de1fSmrgdnl copy of this software and associated documentation files (the
10371a30de1fSmrgdnl "Software"), to deal in the Software without restriction, including
10381a30de1fSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
10391a30de1fSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
10401a30de1fSmrgdnl to whom the Software is furnished to do so, provided that the above
10411a30de1fSmrgdnl copyright notice(s) and this permission notice appear in all copies of
10421a30de1fSmrgdnl the Software and that both the above copyright notice(s) and this
10431a30de1fSmrgdnl permission notice appear in supporting documentation.
10441a30de1fSmrgdnl
10451a30de1fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10461a30de1fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10471a30de1fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
10481a30de1fSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
10491a30de1fSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
10501a30de1fSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
10511a30de1fSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
10521a30de1fSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
10531a30de1fSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
10541a30de1fSmrgdnl
10551a30de1fSmrgdnl Except as contained in this notice, the name of a copyright holder
10561a30de1fSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
10571a30de1fSmrgdnl or other dealings in this Software without prior written authorization
10581a30de1fSmrgdnl of the copyright holder.
10591a30de1fSmrg
10601a30de1fSmrg# XORG_MACROS_VERSION(required-version)
10611a30de1fSmrg# -------------------------------------
10621a30de1fSmrg# Minimum version: 1.1.0
10631a30de1fSmrg#
10641a30de1fSmrg# If you're using a macro added in Version 1.1 or newer, include this in
10651a30de1fSmrg# your configure.ac with the minimum required version, such as:
10661a30de1fSmrg# XORG_MACROS_VERSION(1.1)
10671a30de1fSmrg#
1068b7fb5eacSmrg# To ensure that this macro is defined, also add:
1069b7fb5eacSmrg# m4_ifndef([XORG_MACROS_VERSION],
1070b7fb5eacSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10711a30de1fSmrg#
10721a30de1fSmrg#
10731a30de1fSmrg# See the "minimum version" comment for each macro you use to see what 
10741a30de1fSmrg# version you require.
1075b7fb5eacSmrgm4_defun([XORG_MACROS_VERSION],[
1076b7fb5eacSmrgm4_define([vers_have], [1.3.0])
1077b7fb5eacSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1078b7fb5eacSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1079b7fb5eacSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1080b7fb5eacSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1081b7fb5eacSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1082b7fb5eacSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1083b7fb5eacSmrgm4_undefine([vers_have])
1084b7fb5eacSmrgm4_undefine([maj_have])
1085b7fb5eacSmrgm4_undefine([maj_needed])
10861a30de1fSmrg]) # XORG_MACROS_VERSION
10871a30de1fSmrg
10881a30de1fSmrg# XORG_PROG_RAWCPP()
10891a30de1fSmrg# ------------------
10901a30de1fSmrg# Minimum version: 1.0.0
10911a30de1fSmrg#
10921a30de1fSmrg# Find cpp program and necessary flags for use in pre-processing text files
10931a30de1fSmrg# such as man pages and config files
10941a30de1fSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
10951a30de1fSmrgAC_REQUIRE([AC_PROG_CPP])
10961a30de1fSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
10971a30de1fSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
10981a30de1fSmrg
10991a30de1fSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
11001a30de1fSmrg# which is not the best choice for supporting other OS'es, but covers most
11011a30de1fSmrg# of the ones we need for now.
11021a30de1fSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
11031a30de1fSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
11041a30de1fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11051a30de1fSmrg	AC_MSG_RESULT([no])
11061a30de1fSmrgelse
11071a30de1fSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11081a30de1fSmrg		RAWCPPFLAGS=-undef
11091a30de1fSmrg		AC_MSG_RESULT([yes])
1110b7fb5eacSmrg	# under Cygwin unix is still defined even with -undef
1111b7fb5eacSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1112b7fb5eacSmrg		RAWCPPFLAGS="-undef -ansi"
1113b7fb5eacSmrg		AC_MSG_RESULT([yes, with -ansi])
11141a30de1fSmrg	else
11151a30de1fSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
11161a30de1fSmrg	fi
11171a30de1fSmrgfi
11181a30de1fSmrgrm -f conftest.$ac_ext
11191a30de1fSmrg
11201a30de1fSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
11211a30de1fSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
11221a30de1fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11231a30de1fSmrg	AC_MSG_RESULT([no])
11241a30de1fSmrgelse
11251a30de1fSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11261a30de1fSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
11271a30de1fSmrg		AC_MSG_RESULT([yes])
11281a30de1fSmrg	else
11291a30de1fSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
11301a30de1fSmrg	fi
11311a30de1fSmrgfi
11321a30de1fSmrgrm -f conftest.$ac_ext
11331a30de1fSmrgAC_SUBST(RAWCPPFLAGS)
11341a30de1fSmrg]) # XORG_PROG_RAWCPP
11351a30de1fSmrg
11361a30de1fSmrg# XORG_MANPAGE_SECTIONS()
11371a30de1fSmrg# -----------------------
11381a30de1fSmrg# Minimum version: 1.0.0
11391a30de1fSmrg#
11401a30de1fSmrg# Determine which sections man pages go in for the different man page types
11411a30de1fSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
11421a30de1fSmrg# Not sure if there's any better way than just hardcoding by OS name.
11431a30de1fSmrg# Override default settings by setting environment variables
11441a30de1fSmrg
11451a30de1fSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
11461a30de1fSmrgAC_REQUIRE([AC_CANONICAL_HOST])
11471a30de1fSmrg
11481a30de1fSmrgif test x$APP_MAN_SUFFIX = x    ; then
11491a30de1fSmrg    APP_MAN_SUFFIX=1
11501a30de1fSmrgfi
11511a30de1fSmrgif test x$APP_MAN_DIR = x    ; then
11521a30de1fSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
11531a30de1fSmrgfi
11541a30de1fSmrg
11551a30de1fSmrgif test x$LIB_MAN_SUFFIX = x    ; then
11561a30de1fSmrg    LIB_MAN_SUFFIX=3
11571a30de1fSmrgfi
11581a30de1fSmrgif test x$LIB_MAN_DIR = x    ; then
11591a30de1fSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
11601a30de1fSmrgfi
11611a30de1fSmrg
11621a30de1fSmrgif test x$FILE_MAN_SUFFIX = x    ; then
11631a30de1fSmrg    case $host_os in
11641a30de1fSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
11651a30de1fSmrg	*)		FILE_MAN_SUFFIX=5  ;;
11661a30de1fSmrg    esac
11671a30de1fSmrgfi
11681a30de1fSmrgif test x$FILE_MAN_DIR = x    ; then
11691a30de1fSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
11701a30de1fSmrgfi
11711a30de1fSmrg
11721a30de1fSmrgif test x$MISC_MAN_SUFFIX = x    ; then
11731a30de1fSmrg    case $host_os in
11741a30de1fSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
11751a30de1fSmrg	*)		MISC_MAN_SUFFIX=7  ;;
11761a30de1fSmrg    esac
11771a30de1fSmrgfi
11781a30de1fSmrgif test x$MISC_MAN_DIR = x    ; then
11791a30de1fSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
11801a30de1fSmrgfi
11811a30de1fSmrg
11821a30de1fSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
11831a30de1fSmrg    case $host_os in
11841a30de1fSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
11851a30de1fSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
11861a30de1fSmrg    esac
11871a30de1fSmrgfi
11881a30de1fSmrgif test x$DRIVER_MAN_DIR = x    ; then
11891a30de1fSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
11901a30de1fSmrgfi
11911a30de1fSmrg
11921a30de1fSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
11931a30de1fSmrg    case $host_os in
11941a30de1fSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
11951a30de1fSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
11961a30de1fSmrg    esac
11971a30de1fSmrgfi
11981a30de1fSmrgif test x$ADMIN_MAN_DIR = x    ; then
11991a30de1fSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
12001a30de1fSmrgfi
12011a30de1fSmrg
12021a30de1fSmrg
12031a30de1fSmrgAC_SUBST([APP_MAN_SUFFIX])
12041a30de1fSmrgAC_SUBST([LIB_MAN_SUFFIX])
12051a30de1fSmrgAC_SUBST([FILE_MAN_SUFFIX])
12061a30de1fSmrgAC_SUBST([MISC_MAN_SUFFIX])
12071a30de1fSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
12081a30de1fSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
12091a30de1fSmrgAC_SUBST([APP_MAN_DIR])
12101a30de1fSmrgAC_SUBST([LIB_MAN_DIR])
12111a30de1fSmrgAC_SUBST([FILE_MAN_DIR])
12121a30de1fSmrgAC_SUBST([MISC_MAN_DIR])
12131a30de1fSmrgAC_SUBST([DRIVER_MAN_DIR])
12141a30de1fSmrgAC_SUBST([ADMIN_MAN_DIR])
12151a30de1fSmrg]) # XORG_MANPAGE_SECTIONS
12161a30de1fSmrg
12171a30de1fSmrg# XORG_CHECK_LINUXDOC
12181a30de1fSmrg# -------------------
12191a30de1fSmrg# Minimum version: 1.0.0
12201a30de1fSmrg#
12211a30de1fSmrg# Defines the variable MAKE_TEXT if the necessary tools and
12221a30de1fSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
12231a30de1fSmrg# Whether or not the necessary tools and files are found can be checked
12241a30de1fSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
12251a30de1fSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1226b7fb5eacSmrgif test x$XORG_SGML_PATH = x ; then
1227b7fb5eacSmrg    XORG_SGML_PATH=$prefix/share/sgml
1228b7fb5eacSmrgfi
12291a30de1fSmrgHAVE_DEFS_ENT=
12301a30de1fSmrg
1231b7fb5eacSmrgif test x"$cross_compiling" = x"yes" ; then
1232b7fb5eacSmrg  HAVE_DEFS_ENT=no
1233b7fb5eacSmrgelse
1234b7fb5eacSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1235b7fb5eacSmrgfi
12361a30de1fSmrg
12371a30de1fSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
12381a30de1fSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
12391a30de1fSmrg
12401a30de1fSmrgAC_MSG_CHECKING([Whether to build documentation])
12411a30de1fSmrg
12421a30de1fSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
12431a30de1fSmrg   BUILDDOC=yes
12441a30de1fSmrgelse
12451a30de1fSmrg   BUILDDOC=no
12461a30de1fSmrgfi
12471a30de1fSmrg
12481a30de1fSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
12491a30de1fSmrg
12501a30de1fSmrgAC_MSG_RESULT([$BUILDDOC])
12511a30de1fSmrg
12521a30de1fSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
12531a30de1fSmrg
12541a30de1fSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
12551a30de1fSmrg   BUILDPDFDOC=yes
12561a30de1fSmrgelse
12571a30de1fSmrg   BUILDPDFDOC=no
12581a30de1fSmrgfi
12591a30de1fSmrg
12601a30de1fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
12611a30de1fSmrg
12621a30de1fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
12631a30de1fSmrg
12641a30de1fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
12651a30de1fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
12661a30de1fSmrgMAKE_PDF="$PS2PDF"
12671a30de1fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
12681a30de1fSmrg
12691a30de1fSmrgAC_SUBST(MAKE_TEXT)
12701a30de1fSmrgAC_SUBST(MAKE_PS)
12711a30de1fSmrgAC_SUBST(MAKE_PDF)
12721a30de1fSmrgAC_SUBST(MAKE_HTML)
12731a30de1fSmrg]) # XORG_CHECK_LINUXDOC
12741a30de1fSmrg
12751a30de1fSmrg# XORG_CHECK_DOCBOOK
12761a30de1fSmrg# -------------------
12771a30de1fSmrg# Minimum version: 1.0.0
12781a30de1fSmrg#
12791a30de1fSmrg# Checks for the ability to build output formats from SGML DocBook source.
12801a30de1fSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
12811a30de1fSmrg# indicates whether the necessary tools and files are found and, if set,
12821a30de1fSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
12831a30de1fSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1284b7fb5eacSmrgif test x$XORG_SGML_PATH = x ; then
1285b7fb5eacSmrg    XORG_SGML_PATH=$prefix/share/sgml
1286b7fb5eacSmrgfi
12871a30de1fSmrgHAVE_DEFS_ENT=
12881a30de1fSmrgBUILDTXTDOC=no
12891a30de1fSmrgBUILDPDFDOC=no
12901a30de1fSmrgBUILDPSDOC=no
12911a30de1fSmrgBUILDHTMLDOC=no
12921a30de1fSmrg
12931a30de1fSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
12941a30de1fSmrg
12951a30de1fSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
12961a30de1fSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
12971a30de1fSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
12981a30de1fSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
12991a30de1fSmrg
13001a30de1fSmrgAC_MSG_CHECKING([Whether to build text documentation])
13011a30de1fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
13021a30de1fSmrg   test x$BUILD_TXTDOC != xno; then
13031a30de1fSmrg	BUILDTXTDOC=yes
13041a30de1fSmrgfi
13051a30de1fSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
13061a30de1fSmrgAC_MSG_RESULT([$BUILDTXTDOC])
13071a30de1fSmrg
13081a30de1fSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
13091a30de1fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
13101a30de1fSmrg   test x$BUILD_PDFDOC != xno; then
13111a30de1fSmrg	BUILDPDFDOC=yes
13121a30de1fSmrgfi
13131a30de1fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13141a30de1fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
13151a30de1fSmrg
13161a30de1fSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
13171a30de1fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
13181a30de1fSmrg   test x$BUILD_PSDOC != xno; then
13191a30de1fSmrg	BUILDPSDOC=yes
13201a30de1fSmrgfi
13211a30de1fSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
13221a30de1fSmrgAC_MSG_RESULT([$BUILDPSDOC])
13231a30de1fSmrg
13241a30de1fSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
13251a30de1fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
13261a30de1fSmrg   test x$BUILD_HTMLDOC != xno; then
13271a30de1fSmrg	BUILDHTMLDOC=yes
13281a30de1fSmrgfi
13291a30de1fSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
13301a30de1fSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
13311a30de1fSmrg
13321a30de1fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
13331a30de1fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
13341a30de1fSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
13351a30de1fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
13361a30de1fSmrg
13371a30de1fSmrgAC_SUBST(MAKE_TEXT)
13381a30de1fSmrgAC_SUBST(MAKE_PS)
13391a30de1fSmrgAC_SUBST(MAKE_PDF)
13401a30de1fSmrgAC_SUBST(MAKE_HTML)
13411a30de1fSmrg]) # XORG_CHECK_DOCBOOK
13421a30de1fSmrg
13431a30de1fSmrg# XORG_CHECK_MALLOC_ZERO
13441a30de1fSmrg# ----------------------
13451a30de1fSmrg# Minimum version: 1.0.0
13461a30de1fSmrg#
13471a30de1fSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
13481a30de1fSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
13491a30de1fSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
13501a30de1fSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
13511a30de1fSmrgAC_ARG_ENABLE(malloc0returnsnull,
1352b7fb5eacSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
13531a30de1fSmrg		       [malloc(0) returns NULL (default: auto)]),
13541a30de1fSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
13551a30de1fSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
13561a30de1fSmrg
13571a30de1fSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
13581a30de1fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
13591a30de1fSmrg	AC_RUN_IFELSE([
13601a30de1fSmrgchar *malloc();
13611a30de1fSmrgchar *realloc();
13621a30de1fSmrgchar *calloc();
13631a30de1fSmrgmain() {
13641a30de1fSmrg    char *m0, *r0, *c0, *p;
13651a30de1fSmrg    m0 = malloc(0);
13661a30de1fSmrg    p = malloc(10);
13671a30de1fSmrg    r0 = realloc(p,0);
13681a30de1fSmrg    c0 = calloc(0);
13691a30de1fSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
13701a30de1fSmrg}],
13711a30de1fSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
13721a30de1fSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
13731a30de1fSmrgfi
13741a30de1fSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
13751a30de1fSmrg
13761a30de1fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
13771a30de1fSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
13781a30de1fSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
13791a30de1fSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
13801a30de1fSmrgelse
13811a30de1fSmrg	MALLOC_ZERO_CFLAGS=""
13821a30de1fSmrg	XMALLOC_ZERO_CFLAGS=""
13831a30de1fSmrg	XTMALLOC_ZERO_CFLAGS=""
13841a30de1fSmrgfi
13851a30de1fSmrg
13861a30de1fSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
13871a30de1fSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
13881a30de1fSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
13891a30de1fSmrg]) # XORG_CHECK_MALLOC_ZERO
13901a30de1fSmrg
13911a30de1fSmrg# XORG_WITH_LINT()
13921a30de1fSmrg# ----------------
13931a30de1fSmrg# Minimum version: 1.1.0
13941a30de1fSmrg#
13951a30de1fSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
13961a30de1fSmrg# is specified.   (Use --with-lint=sparse for sparse.)
13971a30de1fSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
13981a30de1fSmrg# Sets $LINT_FLAGS to flags to pass to source checker
13991a30de1fSmrg# Sets LINT automake conditional if enabled (default: disabled)
14001a30de1fSmrg#
14011a30de1fSmrgAC_DEFUN([XORG_WITH_LINT],[
14021a30de1fSmrg
14031a30de1fSmrg# Allow checking code with lint, sparse, etc.
1404b7fb5eacSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
14051a30de1fSmrg		[Use a lint-style source code checker (default: disabled)])],
14061a30de1fSmrg		[use_lint=$withval], [use_lint=no])
14071a30de1fSmrgif test "x$use_lint" = "xyes" ; then
14081a30de1fSmrg	LINT="lint"
14091a30de1fSmrgelse
14101a30de1fSmrg	LINT="$use_lint"
14111a30de1fSmrgfi
14121a30de1fSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
14131a30de1fSmrg    case $LINT in
14141a30de1fSmrg	lint|*/lint)
14151a30de1fSmrg	    case $host_os in
14161a30de1fSmrg		solaris*)
14171a30de1fSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
14181a30de1fSmrg			;;
14191a30de1fSmrg	    esac
14201a30de1fSmrg	    ;;
14211a30de1fSmrg    esac
14221a30de1fSmrgfi
14231a30de1fSmrg
14241a30de1fSmrgAC_SUBST(LINT)
14251a30de1fSmrgAC_SUBST(LINT_FLAGS)
14261a30de1fSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
14271a30de1fSmrg
14281a30de1fSmrg]) # XORG_WITH_LINT
14291a30de1fSmrg
14301a30de1fSmrg# XORG_LINT_LIBRARY(LIBNAME)
14311a30de1fSmrg# --------------------------
14321a30de1fSmrg# Minimum version: 1.1.0
14331a30de1fSmrg#
14341a30de1fSmrg# Sets up flags for building lint libraries for checking programs that call
14351a30de1fSmrg# functions in the library.
14361a30de1fSmrg# Disabled by default, enable with --enable-lint-library
14371a30de1fSmrg# Sets: 
14381a30de1fSmrg#	@LINTLIB@		- name of lint library file to make
14391a30de1fSmrg#	MAKE_LINT_LIB		- automake conditional
14401a30de1fSmrg#
14411a30de1fSmrg
14421a30de1fSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
14431a30de1fSmrgAC_REQUIRE([XORG_WITH_LINT])
14441a30de1fSmrg# Build lint "library" for more indepth checks of programs calling this library
1445b7fb5eacSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
14461a30de1fSmrg	[Create lint library (default: disabled)])],
14471a30de1fSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
14481a30de1fSmrgif test "x$make_lint_lib" != "xno" ; then
14491a30de1fSmrg	if test "x$LINT" = "xno" ; then
14501a30de1fSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
14511a30de1fSmrg	fi
14521a30de1fSmrg	if test "x$make_lint_lib" = "xyes" ; then
14531a30de1fSmrg		LINTLIB=llib-l$1.ln
14541a30de1fSmrg	else
14551a30de1fSmrg		LINTLIB=$make_lint_lib
14561a30de1fSmrg	fi
14571a30de1fSmrgfi
14581a30de1fSmrgAC_SUBST(LINTLIB)
14591a30de1fSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
14601a30de1fSmrg
14611a30de1fSmrg]) # XORG_LINT_LIBRARY
14621a30de1fSmrg
1463b7fb5eacSmrg# XORG_CWARNFLAGS
1464b7fb5eacSmrg# ---------------
1465b7fb5eacSmrg# Minimum version: 1.2.0
1466b7fb5eacSmrg#
1467b7fb5eacSmrg# Defines CWARNFLAGS to enable C compiler warnings.
1468b7fb5eacSmrg#
1469b7fb5eacSmrgAC_DEFUN([XORG_CWARNFLAGS], [
1470b7fb5eacSmrgAC_REQUIRE([AC_PROG_CC])
1471b7fb5eacSmrgif  test "x$GCC" = xyes ; then
1472b7fb5eacSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1473b7fb5eacSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1474b7fb5eacSmrg-Wbad-function-cast"
1475b7fb5eacSmrg    case `$CC -dumpversion` in
1476b7fb5eacSmrg    3.4.* | 4.*)
1477b7fb5eacSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1478b7fb5eacSmrg	;;
1479b7fb5eacSmrg    esac
1480b7fb5eacSmrgelse
1481b7fb5eacSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1482b7fb5eacSmrg    if test "x$SUNCC" = "xyes"; then
1483b7fb5eacSmrg	CWARNFLAGS="-v"
1484b7fb5eacSmrg    fi
1485b7fb5eacSmrgfi
1486b7fb5eacSmrgAC_SUBST(CWARNFLAGS)
1487b7fb5eacSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
1488b7fb5eacSmrg]) # XORG_CWARNFLAGS
1489b7fb5eacSmrg
1490b7fb5eacSmrg# XORG_STRICT_OPTION
1491b7fb5eacSmrg# -----------------------
1492b7fb5eacSmrg# Minimum version: 1.3.0
1493b7fb5eacSmrg#
1494b7fb5eacSmrg# Add configure option to enable strict compilation
1495b7fb5eacSmrgAC_DEFUN([XORG_STRICT_OPTION], [
1496b7fb5eacSmrgAC_REQUIRE([AC_PROG_CC])
1497b7fb5eacSmrgAC_REQUIRE([AC_PROG_CC_C99])
1498b7fb5eacSmrgAC_REQUIRE([XORG_CWARNFLAGS])
1499b7fb5eacSmrg
1500b7fb5eacSmrgAC_ARG_ENABLE(strict-compilation,
1501b7fb5eacSmrg			  AS_HELP_STRING([--enable-strict-compilation],
1502b7fb5eacSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1503b7fb5eacSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1504b7fb5eacSmrgif test "x$STRICT_COMPILE" = "xyes"; then
1505b7fb5eacSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1506b7fb5eacSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1507b7fb5eacSmrg	if test "x$GCC" = xyes ; then
1508b7fb5eacSmrg		STRICT_CFLAGS="-pedantic -Werror"
1509b7fb5eacSmrg	elif test "x$SUNCC" = "xyes"; then
1510b7fb5eacSmrg		STRICT_CFLAGS="-errwarn"
1511b7fb5eacSmrg    elif test "x$INTELCC" = "xyes"; then
1512b7fb5eacSmrg		STRICT_CFLAGS="-Werror"
1513b7fb5eacSmrg	fi
1514b7fb5eacSmrgfi
1515b7fb5eacSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1516b7fb5eacSmrgAC_SUBST([CWARNFLAGS])
1517b7fb5eacSmrg]) # XORG_STRICT_OPTION
1518b7fb5eacSmrg
1519b7fb5eacSmrg# XORG_DEFAULT_OPTIONS
1520b7fb5eacSmrg# --------------------
1521b7fb5eacSmrg# Minimum version: 1.3.0
1522b7fb5eacSmrg#
1523b7fb5eacSmrg# Defines default options for X.Org modules.
1524b7fb5eacSmrg#
1525b7fb5eacSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1526b7fb5eacSmrgXORG_CWARNFLAGS
1527b7fb5eacSmrgXORG_STRICT_OPTION
1528b7fb5eacSmrgXORG_RELEASE_VERSION
1529b7fb5eacSmrgXORG_CHANGELOG
1530b7fb5eacSmrgXORG_MANPAGE_SECTIONS
1531b7fb5eacSmrg]) # XORG_DEFAULT_OPTIONS
15321a30de1fSmrgdnl Copyright 2005 Red Hat, Inc
15331a30de1fSmrgdnl
15341a30de1fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
15351a30de1fSmrgdnl documentation for any purpose is hereby granted without fee, provided that
15361a30de1fSmrgdnl the above copyright notice appear in all copies and that both that
15371a30de1fSmrgdnl copyright notice and this permission notice appear in supporting
15381a30de1fSmrgdnl documentation.
15391a30de1fSmrgdnl
15401a30de1fSmrgdnl The above copyright notice and this permission notice shall be included
15411a30de1fSmrgdnl in all copies or substantial portions of the Software.
15421a30de1fSmrgdnl
15431a30de1fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15441a30de1fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15451a30de1fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15461a30de1fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
15471a30de1fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
15481a30de1fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
15491a30de1fSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
15501a30de1fSmrgdnl
15511a30de1fSmrgdnl Except as contained in this notice, the name of the copyright holders shall
15521a30de1fSmrgdnl not be used in advertising or otherwise to promote the sale, use or
15531a30de1fSmrgdnl other dealings in this Software without prior written authorization
15541a30de1fSmrgdnl from the copyright holders.
15551a30de1fSmrgdnl
15561a30de1fSmrg
15571a30de1fSmrg# XORG_RELEASE_VERSION
15581a30de1fSmrg# --------------------
15591a30de1fSmrg# Adds --with/without-release-string and changes the PACKAGE and
15601a30de1fSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
15611a30de1fSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
15621a30de1fSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
15631a30de1fSmrg 
15641a30de1fSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
15651a30de1fSmrg	AC_ARG_WITH(release-version,
1566b7fb5eacSmrg			AS_HELP_STRING([--with-release-version=STRING],
15671a30de1fSmrg				[Use release version string in package name]),
15681a30de1fSmrg			[RELEASE_VERSION="$withval"],
15691a30de1fSmrg			[RELEASE_VERSION=""])
15701a30de1fSmrg	if test "x$RELEASE_VERSION" != "x"; then
15711a30de1fSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
15721a30de1fSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
15731a30de1fSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
15741a30de1fSmrg	fi
15751a30de1fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
15761a30de1fSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
15771a30de1fSmrg		[Major version of this package])
1578b7fb5eacSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
15791a30de1fSmrg	if test "x$PVM" = "x"; then
15801a30de1fSmrg		PVM="0"
15811a30de1fSmrg	fi
15821a30de1fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
15831a30de1fSmrg		[$PVM],
15841a30de1fSmrg		[Minor version of this package])
1585b7fb5eacSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
15861a30de1fSmrg	if test "x$PVP" = "x"; then
15871a30de1fSmrg		PVP="0"
15881a30de1fSmrg	fi
15891a30de1fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
15901a30de1fSmrg		[$PVP],
15911a30de1fSmrg		[Patch version of this package])
15921a30de1fSmrg])
15931a30de1fSmrg
1594b7fb5eacSmrg# XORG_CHANGELOG()
1595b7fb5eacSmrg# ----------------
1596b7fb5eacSmrg# Minimum version: 1.2.0
1597b7fb5eacSmrg#
1598b7fb5eacSmrg# Defines the variable CHANGELOG_CMD as the command to generate
1599b7fb5eacSmrg# ChangeLog from git.
1600b7fb5eacSmrg#
1601b7fb5eacSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1602b7fb5eacSmrg#
1603b7fb5eacSmrgAC_DEFUN([XORG_CHANGELOG], [
1604b7fb5eacSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
1605b7fb5eacSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
1606b7fb5eacSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1607b7fb5eacSmrgAC_SUBST([CHANGELOG_CMD])
1608b7fb5eacSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
1609b7fb5eacSmrg]) # XORG_CHANGELOG
1610b7fb5eacSmrg
16111a30de1fSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
16121a30de1fSmrg# 
16131a30de1fSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
16141a30de1fSmrg#
16151a30de1fSmrg# This program is free software; you can redistribute it and/or modify
16161a30de1fSmrg# it under the terms of the GNU General Public License as published by
16171a30de1fSmrg# the Free Software Foundation; either version 2 of the License, or
16181a30de1fSmrg# (at your option) any later version.
16191a30de1fSmrg#
16201a30de1fSmrg# This program is distributed in the hope that it will be useful, but
16211a30de1fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
16221a30de1fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16231a30de1fSmrg# General Public License for more details.
16241a30de1fSmrg#
16251a30de1fSmrg# You should have received a copy of the GNU General Public License
16261a30de1fSmrg# along with this program; if not, write to the Free Software
16271a30de1fSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16281a30de1fSmrg#
16291a30de1fSmrg# As a special exception to the GNU General Public License, if you
16301a30de1fSmrg# distribute this file as part of a program that contains a
16311a30de1fSmrg# configuration script generated by Autoconf, you may include it under
16321a30de1fSmrg# the same distribution terms that you use for the rest of that program.
16331a30de1fSmrg
16341a30de1fSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
16351a30de1fSmrg# ----------------------------------
16361a30de1fSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
16371a30de1fSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
16381a30de1fSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
16391a30de1fSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
16401a30de1fSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
16411a30de1fSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
16421a30de1fSmrgfi
16431a30de1fSmrgif test -n "$PKG_CONFIG"; then
1644b7fb5eacSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
16451a30de1fSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
16461a30de1fSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
16471a30de1fSmrg		AC_MSG_RESULT([yes])
16481a30de1fSmrg	else
16491a30de1fSmrg		AC_MSG_RESULT([no])
16501a30de1fSmrg		PKG_CONFIG=""
16511a30de1fSmrg	fi
16521a30de1fSmrg		
16531a30de1fSmrgfi[]dnl
16541a30de1fSmrg])# PKG_PROG_PKG_CONFIG
16551a30de1fSmrg
16561a30de1fSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
16571a30de1fSmrg#
16581a30de1fSmrg# Check to see whether a particular set of modules exists.  Similar
16591a30de1fSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
16601a30de1fSmrg#
16611a30de1fSmrg#
16621a30de1fSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
16631a30de1fSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
16641a30de1fSmrg# PKG_CHECK_EXISTS manually
16651a30de1fSmrg# --------------------------------------------------------------
16661a30de1fSmrgAC_DEFUN([PKG_CHECK_EXISTS],
16671a30de1fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
16681a30de1fSmrgif test -n "$PKG_CONFIG" && \
16691a30de1fSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
16701a30de1fSmrg  m4_ifval([$2], [$2], [:])
16711a30de1fSmrgm4_ifvaln([$3], [else
16721a30de1fSmrg  $3])dnl
16731a30de1fSmrgfi])
16741a30de1fSmrg
16751a30de1fSmrg
16761a30de1fSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
16771a30de1fSmrg# ---------------------------------------------
16781a30de1fSmrgm4_define([_PKG_CONFIG],
1679b7fb5eacSmrg[if test -n "$$1"; then
1680b7fb5eacSmrg    pkg_cv_[]$1="$$1"
1681b7fb5eacSmrg elif test -n "$PKG_CONFIG"; then
1682b7fb5eacSmrg    PKG_CHECK_EXISTS([$3],
1683b7fb5eacSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1684b7fb5eacSmrg		     [pkg_failed=yes])
1685b7fb5eacSmrg else
1686b7fb5eacSmrg    pkg_failed=untried
16871a30de1fSmrgfi[]dnl
16881a30de1fSmrg])# _PKG_CONFIG
16891a30de1fSmrg
1690b7fb5eacSmrg# _PKG_SHORT_ERRORS_SUPPORTED
1691b7fb5eacSmrg# -----------------------------
1692b7fb5eacSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1693b7fb5eacSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1694b7fb5eacSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1695b7fb5eacSmrg        _pkg_short_errors_supported=yes
1696b7fb5eacSmrgelse
1697b7fb5eacSmrg        _pkg_short_errors_supported=no
1698b7fb5eacSmrgfi[]dnl
1699b7fb5eacSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
1700b7fb5eacSmrg
1701b7fb5eacSmrg
17021a30de1fSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
17031a30de1fSmrg# [ACTION-IF-NOT-FOUND])
17041a30de1fSmrg#
17051a30de1fSmrg#
17061a30de1fSmrg# Note that if there is a possibility the first call to
17071a30de1fSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
17081a30de1fSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
17091a30de1fSmrg#
17101a30de1fSmrg#
17111a30de1fSmrg# --------------------------------------------------------------
17121a30de1fSmrgAC_DEFUN([PKG_CHECK_MODULES],
17131a30de1fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
17141a30de1fSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
17151a30de1fSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
17161a30de1fSmrg
17171a30de1fSmrgpkg_failed=no
17181a30de1fSmrgAC_MSG_CHECKING([for $1])
17191a30de1fSmrg
17201a30de1fSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
17211a30de1fSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
17221a30de1fSmrg
1723b7fb5eacSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1724b7fb5eacSmrgand $1[]_LIBS to avoid the need to call pkg-config.
1725b7fb5eacSmrgSee the pkg-config man page for more details.])
1726b7fb5eacSmrg
17271a30de1fSmrgif test $pkg_failed = yes; then
1728b7fb5eacSmrg        _PKG_SHORT_ERRORS_SUPPORTED
1729b7fb5eacSmrg        if test $_pkg_short_errors_supported = yes; then
1730b7fb5eacSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1731b7fb5eacSmrg        else 
1732b7fb5eacSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1733b7fb5eacSmrg        fi
17341a30de1fSmrg	# Put the nasty error message in config.log where it belongs
1735b7fb5eacSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
17361a30de1fSmrg
17371a30de1fSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
1738b7fb5eacSmrg[Package requirements ($2) were not met:
1739b7fb5eacSmrg
1740b7fb5eacSmrg$$1_PKG_ERRORS
1741b7fb5eacSmrg
17421a30de1fSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
17431a30de1fSmrginstalled software in a non-standard prefix.
17441a30de1fSmrg
1745b7fb5eacSmrg_PKG_TEXT
1746b7fb5eacSmrg])],
1747b7fb5eacSmrg		[AC_MSG_RESULT([no])
1748b7fb5eacSmrg                $4])
17491a30de1fSmrgelif test $pkg_failed = untried; then
17501a30de1fSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
17511a30de1fSmrg[The pkg-config script could not be found or is too old.  Make sure it
17521a30de1fSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
17531a30de1fSmrgpath to pkg-config.
17541a30de1fSmrg
1755b7fb5eacSmrg_PKG_TEXT
17561a30de1fSmrg
1757b7fb5eacSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
17581a30de1fSmrg		[$4])
17591a30de1fSmrgelse
17601a30de1fSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
17611a30de1fSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
17621a30de1fSmrg        AC_MSG_RESULT([yes])
17631a30de1fSmrg	ifelse([$3], , :, [$3])
17641a30de1fSmrgfi[]dnl
17651a30de1fSmrg])# PKG_CHECK_MODULES
17661a30de1fSmrg
1767