aclocal.m4 revision 96a81b41
196a81b41Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
28b22bf3fSmrg
38b22bf3fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
496a81b41Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
58b22bf3fSmrg# This file is free software; the Free Software Foundation
68b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
78b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
88b22bf3fSmrg
98b22bf3fSmrg# This program is distributed in the hope that it will be useful,
108b22bf3fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
118b22bf3fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
128b22bf3fSmrg# PARTICULAR PURPOSE.
138b22bf3fSmrg
1496a81b41Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1596a81b41Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1696a81b41Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
1796a81b41Smrg[m4_warning([this file was generated for autoconf 2.63.
1896a81b41SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
1996a81b41SmrgIf you have problems, you may need to regenerate the build system entirely.
2096a81b41SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
218b22bf3fSmrg
2296a81b41Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
238b22bf3fSmrg#
248b22bf3fSmrg# This file is free software; the Free Software Foundation
258b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
268b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
278b22bf3fSmrg
288b22bf3fSmrg# AM_AUTOMAKE_VERSION(VERSION)
298b22bf3fSmrg# ----------------------------
308b22bf3fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
318b22bf3fSmrg# generated from the m4 files accompanying Automake X.Y.
328b22bf3fSmrg# (This private macro should not be called outside this file.)
338b22bf3fSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3496a81b41Smrg[am__api_version='1.11'
358b22bf3fSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
368b22bf3fSmrgdnl require some minimum version.  Point them to the right macro.
3796a81b41Smrgm4_if([$1], [1.11], [],
388b22bf3fSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
398b22bf3fSmrg])
408b22bf3fSmrg
418b22bf3fSmrg# _AM_AUTOCONF_VERSION(VERSION)
428b22bf3fSmrg# -----------------------------
438b22bf3fSmrg# aclocal traces this macro to find the Autoconf version.
448b22bf3fSmrg# This is a private macro too.  Using m4_define simplifies
458b22bf3fSmrg# the logic in aclocal, which can simply ignore this definition.
468b22bf3fSmrgm4_define([_AM_AUTOCONF_VERSION], [])
478b22bf3fSmrg
488b22bf3fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
498b22bf3fSmrg# -------------------------------
508b22bf3fSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5196a81b41Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
528b22bf3fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5396a81b41Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
5496a81b41Smrgm4_ifndef([AC_AUTOCONF_VERSION],
5596a81b41Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5696a81b41Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
578b22bf3fSmrg
588b22bf3fSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
598b22bf3fSmrg
608b22bf3fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
618b22bf3fSmrg#
628b22bf3fSmrg# This file is free software; the Free Software Foundation
638b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
648b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
658b22bf3fSmrg
668b22bf3fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
678b22bf3fSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
688b22bf3fSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
698b22bf3fSmrg#
708b22bf3fSmrg# Of course, Automake must honor this variable whenever it calls a
718b22bf3fSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
728b22bf3fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
738b22bf3fSmrg# depending on how configure is run.  This is pretty annoying, since
748b22bf3fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
758b22bf3fSmrg# source directory, any form will work fine, but in subdirectories a
768b22bf3fSmrg# relative path needs to be adjusted first.
778b22bf3fSmrg#
788b22bf3fSmrg# $ac_aux_dir/missing
798b22bf3fSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
808b22bf3fSmrg# $top_srcdir/$ac_aux_dir/missing
818b22bf3fSmrg#    fails if $ac_aux_dir is absolute,
828b22bf3fSmrg#    fails when called from a subdirectory in a VPATH build with
838b22bf3fSmrg#          a relative $ac_aux_dir
848b22bf3fSmrg#
858b22bf3fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
868b22bf3fSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
878b22bf3fSmrg# harmless because $srcdir is `.', but things will broke when you
888b22bf3fSmrg# start a VPATH build or use an absolute $srcdir.
898b22bf3fSmrg#
908b22bf3fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
918b22bf3fSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
928b22bf3fSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
938b22bf3fSmrg# and then we would define $MISSING as
948b22bf3fSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
958b22bf3fSmrg# This will work as long as MISSING is not called from configure, because
968b22bf3fSmrg# unfortunately $(top_srcdir) has no meaning in configure.
978b22bf3fSmrg# However there are other variables, like CC, which are often used in
988b22bf3fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
998b22bf3fSmrg#
1008b22bf3fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
1018b22bf3fSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
1028b22bf3fSmrg# configured tree to be moved without reconfiguration.
1038b22bf3fSmrg
1048b22bf3fSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1058b22bf3fSmrg[dnl Rely on autoconf to set up CDPATH properly.
1068b22bf3fSmrgAC_PREREQ([2.50])dnl
1078b22bf3fSmrg# expand $ac_aux_dir to an absolute path
1088b22bf3fSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
1098b22bf3fSmrg])
1108b22bf3fSmrg
1118b22bf3fSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1128b22bf3fSmrg
11396a81b41Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1148b22bf3fSmrg# Free Software Foundation, Inc.
1158b22bf3fSmrg#
1168b22bf3fSmrg# This file is free software; the Free Software Foundation
1178b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
1188b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
1198b22bf3fSmrg
12096a81b41Smrg# serial 9
1218b22bf3fSmrg
1228b22bf3fSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1238b22bf3fSmrg# -------------------------------------
1248b22bf3fSmrg# Define a conditional.
1258b22bf3fSmrgAC_DEFUN([AM_CONDITIONAL],
1268b22bf3fSmrg[AC_PREREQ(2.52)dnl
1278b22bf3fSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1288b22bf3fSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1298b22bf3fSmrgAC_SUBST([$1_TRUE])dnl
1308b22bf3fSmrgAC_SUBST([$1_FALSE])dnl
1318b22bf3fSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1328b22bf3fSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
13396a81b41Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1348b22bf3fSmrgif $2; then
1358b22bf3fSmrg  $1_TRUE=
1368b22bf3fSmrg  $1_FALSE='#'
1378b22bf3fSmrgelse
1388b22bf3fSmrg  $1_TRUE='#'
1398b22bf3fSmrg  $1_FALSE=
1408b22bf3fSmrgfi
1418b22bf3fSmrgAC_CONFIG_COMMANDS_PRE(
1428b22bf3fSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1438b22bf3fSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1448b22bf3fSmrgUsually this means the macro was only invoked conditionally.]])
1458b22bf3fSmrgfi])])
1468b22bf3fSmrg
14796a81b41Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1488b22bf3fSmrg# Free Software Foundation, Inc.
1498b22bf3fSmrg#
1508b22bf3fSmrg# This file is free software; the Free Software Foundation
1518b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
1528b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
1538b22bf3fSmrg
15496a81b41Smrg# serial 10
1558b22bf3fSmrg
1568b22bf3fSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1578b22bf3fSmrg# written in clear, in which case automake, when reading aclocal.m4,
1588b22bf3fSmrg# will think it sees a *use*, and therefore will trigger all it's
1598b22bf3fSmrg# C support machinery.  Also note that it means that autoscan, seeing
1608b22bf3fSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1618b22bf3fSmrg
1628b22bf3fSmrg
1638b22bf3fSmrg# _AM_DEPENDENCIES(NAME)
1648b22bf3fSmrg# ----------------------
1658b22bf3fSmrg# See how the compiler implements dependency checking.
1668b22bf3fSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1678b22bf3fSmrg# We try a few techniques and use that to set a single cache variable.
1688b22bf3fSmrg#
1698b22bf3fSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1708b22bf3fSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1718b22bf3fSmrg# dependency, and given that the user is not expected to run this macro,
1728b22bf3fSmrg# just rely on AC_PROG_CC.
1738b22bf3fSmrgAC_DEFUN([_AM_DEPENDENCIES],
1748b22bf3fSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1758b22bf3fSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1768b22bf3fSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1778b22bf3fSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1788b22bf3fSmrg
1798b22bf3fSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1808b22bf3fSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1818b22bf3fSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1828b22bf3fSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1838b22bf3fSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1848b22bf3fSmrg                   [depcc="$$1"   am_compiler_list=])
1858b22bf3fSmrg
1868b22bf3fSmrgAC_CACHE_CHECK([dependency style of $depcc],
1878b22bf3fSmrg               [am_cv_$1_dependencies_compiler_type],
1888b22bf3fSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1898b22bf3fSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1908b22bf3fSmrg  # making bogus files that we don't know about and never remove.  For
1918b22bf3fSmrg  # instance it was reported that on HP-UX the gcc test will end up
1928b22bf3fSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1938b22bf3fSmrg  # in D'.
1948b22bf3fSmrg  mkdir conftest.dir
1958b22bf3fSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1968b22bf3fSmrg  # using a relative directory.
1978b22bf3fSmrg  cp "$am_depcomp" conftest.dir
1988b22bf3fSmrg  cd conftest.dir
1998b22bf3fSmrg  # We will build objects and dependencies in a subdirectory because
2008b22bf3fSmrg  # it helps to detect inapplicable dependency modes.  For instance
2018b22bf3fSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2028b22bf3fSmrg  # side effect of compilation, but ICC will put the dependencies in
2038b22bf3fSmrg  # the current directory while Tru64 will put them in the object
2048b22bf3fSmrg  # directory.
2058b22bf3fSmrg  mkdir sub
2068b22bf3fSmrg
2078b22bf3fSmrg  am_cv_$1_dependencies_compiler_type=none
2088b22bf3fSmrg  if test "$am_compiler_list" = ""; then
2098b22bf3fSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2108b22bf3fSmrg  fi
21196a81b41Smrg  am__universal=false
21296a81b41Smrg  m4_case([$1], [CC],
21396a81b41Smrg    [case " $depcc " in #(
21496a81b41Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21596a81b41Smrg     esac],
21696a81b41Smrg    [CXX],
21796a81b41Smrg    [case " $depcc " in #(
21896a81b41Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21996a81b41Smrg     esac])
22096a81b41Smrg
2218b22bf3fSmrg  for depmode in $am_compiler_list; do
2228b22bf3fSmrg    # Setup a source with many dependencies, because some compilers
2238b22bf3fSmrg    # like to wrap large dependency lists on column 80 (with \), and
2248b22bf3fSmrg    # we should not choose a depcomp mode which is confused by this.
2258b22bf3fSmrg    #
2268b22bf3fSmrg    # We need to recreate these files for each test, as the compiler may
2278b22bf3fSmrg    # overwrite some of them when testing with obscure command lines.
2288b22bf3fSmrg    # This happens at least with the AIX C compiler.
2298b22bf3fSmrg    : > sub/conftest.c
2308b22bf3fSmrg    for i in 1 2 3 4 5 6; do
2318b22bf3fSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2328b22bf3fSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2338b22bf3fSmrg      # Solaris 8's {/usr,}/bin/sh.
2348b22bf3fSmrg      touch sub/conftst$i.h
2358b22bf3fSmrg    done
2368b22bf3fSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2378b22bf3fSmrg
23896a81b41Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
23996a81b41Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
24096a81b41Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
24196a81b41Smrg    # versions had trouble with output in subdirs
24296a81b41Smrg    am__obj=sub/conftest.${OBJEXT-o}
24396a81b41Smrg    am__minus_obj="-o $am__obj"
2448b22bf3fSmrg    case $depmode in
24596a81b41Smrg    gcc)
24696a81b41Smrg      # This depmode causes a compiler race in universal mode.
24796a81b41Smrg      test "$am__universal" = false || continue
24896a81b41Smrg      ;;
2498b22bf3fSmrg    nosideeffect)
2508b22bf3fSmrg      # after this tag, mechanisms are not by side-effect, so they'll
2518b22bf3fSmrg      # only be used when explicitly requested
2528b22bf3fSmrg      if test "x$enable_dependency_tracking" = xyes; then
2538b22bf3fSmrg	continue
2548b22bf3fSmrg      else
2558b22bf3fSmrg	break
2568b22bf3fSmrg      fi
2578b22bf3fSmrg      ;;
25896a81b41Smrg    msvisualcpp | msvcmsys)
25996a81b41Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
26096a81b41Smrg      # not run yet.  These depmodes are late enough in the game, and
26196a81b41Smrg      # so weak that their functioning should not be impacted.
26296a81b41Smrg      am__obj=conftest.${OBJEXT-o}
26396a81b41Smrg      am__minus_obj=
26496a81b41Smrg      ;;
2658b22bf3fSmrg    none) break ;;
2668b22bf3fSmrg    esac
2678b22bf3fSmrg    if depmode=$depmode \
26896a81b41Smrg       source=sub/conftest.c object=$am__obj \
2698b22bf3fSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
27096a81b41Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2718b22bf3fSmrg         >/dev/null 2>conftest.err &&
2728b22bf3fSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2738b22bf3fSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27496a81b41Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2758b22bf3fSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2768b22bf3fSmrg      # icc doesn't choke on unknown options, it will just issue warnings
2778b22bf3fSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
2788b22bf3fSmrg      # that says an option was ignored or not supported.
2798b22bf3fSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2808b22bf3fSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2818b22bf3fSmrg      # The diagnosis changed in icc 8.0:
2828b22bf3fSmrg      #   icc: Command line remark: option '-MP' not supported
2838b22bf3fSmrg      if (grep 'ignoring option' conftest.err ||
2848b22bf3fSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2858b22bf3fSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2868b22bf3fSmrg        break
2878b22bf3fSmrg      fi
2888b22bf3fSmrg    fi
2898b22bf3fSmrg  done
2908b22bf3fSmrg
2918b22bf3fSmrg  cd ..
2928b22bf3fSmrg  rm -rf conftest.dir
2938b22bf3fSmrgelse
2948b22bf3fSmrg  am_cv_$1_dependencies_compiler_type=none
2958b22bf3fSmrgfi
2968b22bf3fSmrg])
2978b22bf3fSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2988b22bf3fSmrgAM_CONDITIONAL([am__fastdep$1], [
2998b22bf3fSmrg  test "x$enable_dependency_tracking" != xno \
3008b22bf3fSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3018b22bf3fSmrg])
3028b22bf3fSmrg
3038b22bf3fSmrg
3048b22bf3fSmrg# AM_SET_DEPDIR
3058b22bf3fSmrg# -------------
3068b22bf3fSmrg# Choose a directory name for dependency files.
3078b22bf3fSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3088b22bf3fSmrgAC_DEFUN([AM_SET_DEPDIR],
3098b22bf3fSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3108b22bf3fSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3118b22bf3fSmrg])
3128b22bf3fSmrg
3138b22bf3fSmrg
3148b22bf3fSmrg# AM_DEP_TRACK
3158b22bf3fSmrg# ------------
3168b22bf3fSmrgAC_DEFUN([AM_DEP_TRACK],
3178b22bf3fSmrg[AC_ARG_ENABLE(dependency-tracking,
3188b22bf3fSmrg[  --disable-dependency-tracking  speeds up one-time build
3198b22bf3fSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3208b22bf3fSmrgif test "x$enable_dependency_tracking" != xno; then
3218b22bf3fSmrg  am_depcomp="$ac_aux_dir/depcomp"
3228b22bf3fSmrg  AMDEPBACKSLASH='\'
3238b22bf3fSmrgfi
3248b22bf3fSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3258b22bf3fSmrgAC_SUBST([AMDEPBACKSLASH])dnl
3268b22bf3fSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3278b22bf3fSmrg])
3288b22bf3fSmrg
3298b22bf3fSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3308b22bf3fSmrg
33196a81b41Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
3328b22bf3fSmrg# Free Software Foundation, Inc.
3338b22bf3fSmrg#
3348b22bf3fSmrg# This file is free software; the Free Software Foundation
3358b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
3368b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
3378b22bf3fSmrg
33896a81b41Smrg#serial 5
3398b22bf3fSmrg
3408b22bf3fSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3418b22bf3fSmrg# ------------------------------
3428b22bf3fSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
34396a81b41Smrg[{
34496a81b41Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
34596a81b41Smrg  # are listed without --file.  Let's play safe and only enable the eval
34696a81b41Smrg  # if we detect the quoting.
34796a81b41Smrg  case $CONFIG_FILES in
34896a81b41Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
34996a81b41Smrg  *)   set x $CONFIG_FILES ;;
35096a81b41Smrg  esac
35196a81b41Smrg  shift
35296a81b41Smrg  for mf
35396a81b41Smrg  do
35496a81b41Smrg    # Strip MF so we end up with the name of the file.
35596a81b41Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
35696a81b41Smrg    # Check whether this is an Automake generated Makefile or not.
35796a81b41Smrg    # We used to match only the files named `Makefile.in', but
35896a81b41Smrg    # some people rename them; so instead we look at the file content.
35996a81b41Smrg    # Grep'ing the first line is not enough: some people post-process
36096a81b41Smrg    # each Makefile.in and add a new line on top of each file to say so.
36196a81b41Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
36296a81b41Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
36396a81b41Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36496a81b41Smrg      dirpart=`AS_DIRNAME("$mf")`
36596a81b41Smrg    else
36696a81b41Smrg      continue
36796a81b41Smrg    fi
36896a81b41Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
36996a81b41Smrg    # from the Makefile without running `make'.
37096a81b41Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
37196a81b41Smrg    test -z "$DEPDIR" && continue
37296a81b41Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
37396a81b41Smrg    test -z "am__include" && continue
37496a81b41Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37596a81b41Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
37696a81b41Smrg    U=`sed -n 's/^U = //p' < "$mf"`
37796a81b41Smrg    # Find all dependency output files, they are included files with
37896a81b41Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
37996a81b41Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
38096a81b41Smrg    # expansion.
38196a81b41Smrg    for file in `sed -n "
38296a81b41Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
38396a81b41Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
38496a81b41Smrg      # Make sure the directory exists.
38596a81b41Smrg      test -f "$dirpart/$file" && continue
38696a81b41Smrg      fdir=`AS_DIRNAME(["$file"])`
38796a81b41Smrg      AS_MKDIR_P([$dirpart/$fdir])
38896a81b41Smrg      # echo "creating $dirpart/$file"
38996a81b41Smrg      echo '# dummy' > "$dirpart/$file"
39096a81b41Smrg    done
3918b22bf3fSmrg  done
39296a81b41Smrg}
3938b22bf3fSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3948b22bf3fSmrg
3958b22bf3fSmrg
3968b22bf3fSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3978b22bf3fSmrg# -----------------------------
3988b22bf3fSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
3998b22bf3fSmrg#
4008b22bf3fSmrg# This code is only required when automatic dependency tracking
4018b22bf3fSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
4028b22bf3fSmrg# need in order to bootstrap the dependency handling code.
4038b22bf3fSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4048b22bf3fSmrg[AC_CONFIG_COMMANDS([depfiles],
4058b22bf3fSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4068b22bf3fSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4078b22bf3fSmrg])
4088b22bf3fSmrg
4098b22bf3fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
4108b22bf3fSmrg# Free Software Foundation, Inc.
4118b22bf3fSmrg#
4128b22bf3fSmrg# This file is free software; the Free Software Foundation
4138b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
4148b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
4158b22bf3fSmrg
4168b22bf3fSmrg# serial 8
4178b22bf3fSmrg
4188b22bf3fSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
4198b22bf3fSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
4208b22bf3fSmrg
4218b22bf3fSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4228b22bf3fSmrg
4238b22bf3fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
42496a81b41Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4258b22bf3fSmrg#
4268b22bf3fSmrg# This file is free software; the Free Software Foundation
4278b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
4288b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
4298b22bf3fSmrg
43096a81b41Smrg# serial 16
4318b22bf3fSmrg
4328b22bf3fSmrg# This macro actually does too much.  Some checks are only needed if
4338b22bf3fSmrg# your package does certain things.  But this isn't really a big deal.
4348b22bf3fSmrg
4358b22bf3fSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4368b22bf3fSmrg# AM_INIT_AUTOMAKE([OPTIONS])
4378b22bf3fSmrg# -----------------------------------------------
4388b22bf3fSmrg# The call with PACKAGE and VERSION arguments is the old style
4398b22bf3fSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
4408b22bf3fSmrg# and VERSION should now be passed to AC_INIT and removed from
4418b22bf3fSmrg# the call to AM_INIT_AUTOMAKE.
4428b22bf3fSmrg# We support both call styles for the transition.  After
4438b22bf3fSmrg# the next Automake release, Autoconf can make the AC_INIT
4448b22bf3fSmrg# arguments mandatory, and then we can depend on a new Autoconf
4458b22bf3fSmrg# release and drop the old call support.
4468b22bf3fSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
44796a81b41Smrg[AC_PREREQ([2.62])dnl
4488b22bf3fSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4498b22bf3fSmrgdnl the ones we care about.
4508b22bf3fSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4518b22bf3fSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4528b22bf3fSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4538b22bf3fSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4548b22bf3fSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4558b22bf3fSmrg  # is not polluted with repeated "-I."
4568b22bf3fSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4578b22bf3fSmrg  # test to see if srcdir already configured
4588b22bf3fSmrg  if test -f $srcdir/config.status; then
4598b22bf3fSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4608b22bf3fSmrg  fi
4618b22bf3fSmrgfi
4628b22bf3fSmrg
4638b22bf3fSmrg# test whether we have cygpath
4648b22bf3fSmrgif test -z "$CYGPATH_W"; then
4658b22bf3fSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4668b22bf3fSmrg    CYGPATH_W='cygpath -w'
4678b22bf3fSmrg  else
4688b22bf3fSmrg    CYGPATH_W=echo
4698b22bf3fSmrg  fi
4708b22bf3fSmrgfi
4718b22bf3fSmrgAC_SUBST([CYGPATH_W])
4728b22bf3fSmrg
4738b22bf3fSmrg# Define the identity of the package.
4748b22bf3fSmrgdnl Distinguish between old-style and new-style calls.
4758b22bf3fSmrgm4_ifval([$2],
4768b22bf3fSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4778b22bf3fSmrg AC_SUBST([PACKAGE], [$1])dnl
4788b22bf3fSmrg AC_SUBST([VERSION], [$2])],
4798b22bf3fSmrg[_AM_SET_OPTIONS([$1])dnl
4808b22bf3fSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4818b22bf3fSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4828b22bf3fSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4838b22bf3fSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4848b22bf3fSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4858b22bf3fSmrg
4868b22bf3fSmrg_AM_IF_OPTION([no-define],,
4878b22bf3fSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4888b22bf3fSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4898b22bf3fSmrg
4908b22bf3fSmrg# Some tools Automake needs.
4918b22bf3fSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4928b22bf3fSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4938b22bf3fSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4948b22bf3fSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4958b22bf3fSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4968b22bf3fSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4978b22bf3fSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
49896a81b41SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
49996a81b41SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
5008b22bf3fSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
5018b22bf3fSmrg# We need awk for the "check" target.  The system "awk" is bad on
5028b22bf3fSmrg# some platforms.
5038b22bf3fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
5048b22bf3fSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
5058b22bf3fSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
5068b22bf3fSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
50796a81b41Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
50896a81b41Smrg			     [_AM_PROG_TAR([v7])])])
5098b22bf3fSmrg_AM_IF_OPTION([no-dependencies],,
5108b22bf3fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
51196a81b41Smrg		  [_AM_DEPENDENCIES(CC)],
51296a81b41Smrg		  [define([AC_PROG_CC],
51396a81b41Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
5148b22bf3fSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
51596a81b41Smrg		  [_AM_DEPENDENCIES(CXX)],
51696a81b41Smrg		  [define([AC_PROG_CXX],
51796a81b41Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5188b22bf3fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
51996a81b41Smrg		  [_AM_DEPENDENCIES(OBJC)],
52096a81b41Smrg		  [define([AC_PROG_OBJC],
52196a81b41Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
5228b22bf3fSmrg])
52396a81b41Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
52496a81b41Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
52596a81b41Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
52696a81b41Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
52796a81b41SmrgAC_CONFIG_COMMANDS_PRE(dnl
52896a81b41Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
52996a81b41Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5308b22bf3fSmrg])
5318b22bf3fSmrg
53296a81b41Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
53396a81b41Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
53496a81b41Smrgdnl mangled by Autoconf and run in a shell conditional statement.
53596a81b41Smrgm4_define([_AC_COMPILER_EXEEXT],
53696a81b41Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
53796a81b41Smrg
5388b22bf3fSmrg
5398b22bf3fSmrg# When config.status generates a header, we must update the stamp-h file.
5408b22bf3fSmrg# This file resides in the same directory as the config header
5418b22bf3fSmrg# that is generated.  The stamp files are numbered to have different names.
5428b22bf3fSmrg
5438b22bf3fSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
5448b22bf3fSmrg# loop where config.status creates the headers, so we can generate
5458b22bf3fSmrg# our stamp files there.
5468b22bf3fSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
5478b22bf3fSmrg[# Compute $1's index in $config_headers.
54896a81b41Smrg_am_arg=$1
5498b22bf3fSmrg_am_stamp_count=1
5508b22bf3fSmrgfor _am_header in $config_headers :; do
5518b22bf3fSmrg  case $_am_header in
55296a81b41Smrg    $_am_arg | $_am_arg:* )
5538b22bf3fSmrg      break ;;
5548b22bf3fSmrg    * )
5558b22bf3fSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5568b22bf3fSmrg  esac
5578b22bf3fSmrgdone
55896a81b41Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
5598b22bf3fSmrg
56096a81b41Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
5618b22bf3fSmrg#
5628b22bf3fSmrg# This file is free software; the Free Software Foundation
5638b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
5648b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
5658b22bf3fSmrg
5668b22bf3fSmrg# AM_PROG_INSTALL_SH
5678b22bf3fSmrg# ------------------
5688b22bf3fSmrg# Define $install_sh.
5698b22bf3fSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5708b22bf3fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
57196a81b41Smrgif test x"${install_sh}" != xset; then
57296a81b41Smrg  case $am_aux_dir in
57396a81b41Smrg  *\ * | *\	*)
57496a81b41Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
57596a81b41Smrg  *)
57696a81b41Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
57796a81b41Smrg  esac
57896a81b41Smrgfi
5798b22bf3fSmrgAC_SUBST(install_sh)])
5808b22bf3fSmrg
5818b22bf3fSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5828b22bf3fSmrg#
5838b22bf3fSmrg# This file is free software; the Free Software Foundation
5848b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
5858b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
5868b22bf3fSmrg
5878b22bf3fSmrg# serial 2
5888b22bf3fSmrg
5898b22bf3fSmrg# Check whether the underlying file-system supports filenames
5908b22bf3fSmrg# with a leading dot.  For instance MS-DOS doesn't.
5918b22bf3fSmrgAC_DEFUN([AM_SET_LEADING_DOT],
5928b22bf3fSmrg[rm -rf .tst 2>/dev/null
5938b22bf3fSmrgmkdir .tst 2>/dev/null
5948b22bf3fSmrgif test -d .tst; then
5958b22bf3fSmrg  am__leading_dot=.
5968b22bf3fSmrgelse
5978b22bf3fSmrg  am__leading_dot=_
5988b22bf3fSmrgfi
5998b22bf3fSmrgrmdir .tst 2>/dev/null
6008b22bf3fSmrgAC_SUBST([am__leading_dot])])
6018b22bf3fSmrg
6028b22bf3fSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
6038b22bf3fSmrg# From Jim Meyering
6048b22bf3fSmrg
60596a81b41Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
6068b22bf3fSmrg# Free Software Foundation, Inc.
6078b22bf3fSmrg#
6088b22bf3fSmrg# This file is free software; the Free Software Foundation
6098b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
6108b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
6118b22bf3fSmrg
61296a81b41Smrg# serial 5
6138b22bf3fSmrg
61496a81b41Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
61596a81b41Smrg# ----------------------------------
61696a81b41Smrg# Control maintainer-specific portions of Makefiles.
61796a81b41Smrg# Default is to disable them, unless `enable' is passed literally.
61896a81b41Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
61996a81b41Smrg# can override the default with the --enable/--disable switch.
6208b22bf3fSmrgAC_DEFUN([AM_MAINTAINER_MODE],
62196a81b41Smrg[m4_case(m4_default([$1], [disable]),
62296a81b41Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
62396a81b41Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
62496a81b41Smrg       [m4_define([am_maintainer_other], [enable])
62596a81b41Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
62696a81b41SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
62796a81b41Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
62896a81b41Smrg  AC_ARG_ENABLE([maintainer-mode],
62996a81b41Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
6308b22bf3fSmrg			  (and sometimes confusing) to the casual installer],
63196a81b41Smrg      [USE_MAINTAINER_MODE=$enableval],
63296a81b41Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
6338b22bf3fSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
63496a81b41Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
6358b22bf3fSmrg  MAINT=$MAINTAINER_MODE_TRUE
63696a81b41Smrg  AC_SUBST([MAINT])dnl
6378b22bf3fSmrg]
6388b22bf3fSmrg)
6398b22bf3fSmrg
6408b22bf3fSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
6418b22bf3fSmrg
6428b22bf3fSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6438b22bf3fSmrg
64496a81b41Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
6458b22bf3fSmrg#
6468b22bf3fSmrg# This file is free software; the Free Software Foundation
6478b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
6488b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
6498b22bf3fSmrg
65096a81b41Smrg# serial 4
6518b22bf3fSmrg
6528b22bf3fSmrg# AM_MAKE_INCLUDE()
6538b22bf3fSmrg# -----------------
6548b22bf3fSmrg# Check to see how make treats includes.
6558b22bf3fSmrgAC_DEFUN([AM_MAKE_INCLUDE],
6568b22bf3fSmrg[am_make=${MAKE-make}
6578b22bf3fSmrgcat > confinc << 'END'
6588b22bf3fSmrgam__doit:
65996a81b41Smrg	@echo this is the am__doit target
6608b22bf3fSmrg.PHONY: am__doit
6618b22bf3fSmrgEND
6628b22bf3fSmrg# If we don't find an include directive, just comment out the code.
6638b22bf3fSmrgAC_MSG_CHECKING([for style of include used by $am_make])
6648b22bf3fSmrgam__include="#"
6658b22bf3fSmrgam__quote=
6668b22bf3fSmrg_am_result=none
6678b22bf3fSmrg# First try GNU make style include.
6688b22bf3fSmrgecho "include confinc" > confmf
66996a81b41Smrg# Ignore all kinds of additional output from `make'.
67096a81b41Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
67196a81b41Smrg*the\ am__doit\ target*)
67296a81b41Smrg  am__include=include
67396a81b41Smrg  am__quote=
67496a81b41Smrg  _am_result=GNU
67596a81b41Smrg  ;;
67696a81b41Smrgesac
6778b22bf3fSmrg# Now try BSD make style include.
6788b22bf3fSmrgif test "$am__include" = "#"; then
6798b22bf3fSmrg   echo '.include "confinc"' > confmf
68096a81b41Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
68196a81b41Smrg   *the\ am__doit\ target*)
68296a81b41Smrg     am__include=.include
68396a81b41Smrg     am__quote="\""
68496a81b41Smrg     _am_result=BSD
68596a81b41Smrg     ;;
68696a81b41Smrg   esac
6878b22bf3fSmrgfi
6888b22bf3fSmrgAC_SUBST([am__include])
6898b22bf3fSmrgAC_SUBST([am__quote])
6908b22bf3fSmrgAC_MSG_RESULT([$_am_result])
6918b22bf3fSmrgrm -f confinc confmf
6928b22bf3fSmrg])
6938b22bf3fSmrg
6948b22bf3fSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6958b22bf3fSmrg
69696a81b41Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
6978b22bf3fSmrg# Free Software Foundation, Inc.
6988b22bf3fSmrg#
6998b22bf3fSmrg# This file is free software; the Free Software Foundation
7008b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
7018b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
7028b22bf3fSmrg
70396a81b41Smrg# serial 6
7048b22bf3fSmrg
7058b22bf3fSmrg# AM_MISSING_PROG(NAME, PROGRAM)
7068b22bf3fSmrg# ------------------------------
7078b22bf3fSmrgAC_DEFUN([AM_MISSING_PROG],
7088b22bf3fSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
7098b22bf3fSmrg$1=${$1-"${am_missing_run}$2"}
7108b22bf3fSmrgAC_SUBST($1)])
7118b22bf3fSmrg
7128b22bf3fSmrg
7138b22bf3fSmrg# AM_MISSING_HAS_RUN
7148b22bf3fSmrg# ------------------
7158b22bf3fSmrg# Define MISSING if not defined so far and test if it supports --run.
7168b22bf3fSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
7178b22bf3fSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7188b22bf3fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7198b22bf3fSmrgAC_REQUIRE_AUX_FILE([missing])dnl
72096a81b41Smrgif test x"${MISSING+set}" != xset; then
72196a81b41Smrg  case $am_aux_dir in
72296a81b41Smrg  *\ * | *\	*)
72396a81b41Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
72496a81b41Smrg  *)
72596a81b41Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
72696a81b41Smrg  esac
72796a81b41Smrgfi
7288b22bf3fSmrg# Use eval to expand $SHELL
7298b22bf3fSmrgif eval "$MISSING --run true"; then
7308b22bf3fSmrg  am_missing_run="$MISSING --run "
7318b22bf3fSmrgelse
7328b22bf3fSmrg  am_missing_run=
7338b22bf3fSmrg  AC_MSG_WARN([`missing' script is too old or missing])
7348b22bf3fSmrgfi
7358b22bf3fSmrg])
7368b22bf3fSmrg
7378b22bf3fSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
7388b22bf3fSmrg#
7398b22bf3fSmrg# This file is free software; the Free Software Foundation
7408b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
7418b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
7428b22bf3fSmrg
7438b22bf3fSmrg# AM_PROG_MKDIR_P
7448b22bf3fSmrg# ---------------
7458b22bf3fSmrg# Check for `mkdir -p'.
7468b22bf3fSmrgAC_DEFUN([AM_PROG_MKDIR_P],
7478b22bf3fSmrg[AC_PREREQ([2.60])dnl
7488b22bf3fSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7498b22bf3fSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7508b22bf3fSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
7518b22bf3fSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7528b22bf3fSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7538b22bf3fSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7548b22bf3fSmrgdnl adjustment using top_builddir (which is defined more often than
7558b22bf3fSmrgdnl MKDIR_P).
7568b22bf3fSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7578b22bf3fSmrgcase $mkdir_p in
7588b22bf3fSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7598b22bf3fSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7608b22bf3fSmrgesac
7618b22bf3fSmrg])
7628b22bf3fSmrg
7638b22bf3fSmrg# Helper functions for option handling.                     -*- Autoconf -*-
7648b22bf3fSmrg
76596a81b41Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
7668b22bf3fSmrg#
7678b22bf3fSmrg# This file is free software; the Free Software Foundation
7688b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
7698b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
7708b22bf3fSmrg
77196a81b41Smrg# serial 4
7728b22bf3fSmrg
7738b22bf3fSmrg# _AM_MANGLE_OPTION(NAME)
7748b22bf3fSmrg# -----------------------
7758b22bf3fSmrgAC_DEFUN([_AM_MANGLE_OPTION],
7768b22bf3fSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7778b22bf3fSmrg
7788b22bf3fSmrg# _AM_SET_OPTION(NAME)
7798b22bf3fSmrg# ------------------------------
7808b22bf3fSmrg# Set option NAME.  Presently that only means defining a flag for this option.
7818b22bf3fSmrgAC_DEFUN([_AM_SET_OPTION],
7828b22bf3fSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7838b22bf3fSmrg
7848b22bf3fSmrg# _AM_SET_OPTIONS(OPTIONS)
7858b22bf3fSmrg# ----------------------------------
7868b22bf3fSmrg# OPTIONS is a space-separated list of Automake options.
7878b22bf3fSmrgAC_DEFUN([_AM_SET_OPTIONS],
78896a81b41Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7898b22bf3fSmrg
7908b22bf3fSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7918b22bf3fSmrg# -------------------------------------------
7928b22bf3fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7938b22bf3fSmrgAC_DEFUN([_AM_IF_OPTION],
7948b22bf3fSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7958b22bf3fSmrg
7968b22bf3fSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7978b22bf3fSmrg
79896a81b41Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
7998b22bf3fSmrg# Free Software Foundation, Inc.
8008b22bf3fSmrg#
8018b22bf3fSmrg# This file is free software; the Free Software Foundation
8028b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
8038b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
8048b22bf3fSmrg
80596a81b41Smrg# serial 5
8068b22bf3fSmrg
8078b22bf3fSmrg# AM_SANITY_CHECK
8088b22bf3fSmrg# ---------------
8098b22bf3fSmrgAC_DEFUN([AM_SANITY_CHECK],
8108b22bf3fSmrg[AC_MSG_CHECKING([whether build environment is sane])
8118b22bf3fSmrg# Just in case
8128b22bf3fSmrgsleep 1
8138b22bf3fSmrgecho timestamp > conftest.file
81496a81b41Smrg# Reject unsafe characters in $srcdir or the absolute working directory
81596a81b41Smrg# name.  Accept space and tab only in the latter.
81696a81b41Smrgam_lf='
81796a81b41Smrg'
81896a81b41Smrgcase `pwd` in
81996a81b41Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
82096a81b41Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
82196a81b41Smrgesac
82296a81b41Smrgcase $srcdir in
82396a81b41Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
82496a81b41Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
82596a81b41Smrgesac
82696a81b41Smrg
8278b22bf3fSmrg# Do `set' in a subshell so we don't clobber the current shell's
8288b22bf3fSmrg# arguments.  Must try -L first in case configure is actually a
8298b22bf3fSmrg# symlink; some systems play weird games with the mod time of symlinks
8308b22bf3fSmrg# (eg FreeBSD returns the mod time of the symlink's containing
8318b22bf3fSmrg# directory).
8328b22bf3fSmrgif (
83396a81b41Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8348b22bf3fSmrg   if test "$[*]" = "X"; then
8358b22bf3fSmrg      # -L didn't work.
83696a81b41Smrg      set X `ls -t "$srcdir/configure" conftest.file`
8378b22bf3fSmrg   fi
8388b22bf3fSmrg   rm -f conftest.file
8398b22bf3fSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
8408b22bf3fSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8418b22bf3fSmrg
8428b22bf3fSmrg      # If neither matched, then we have a broken ls.  This can happen
8438b22bf3fSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
8448b22bf3fSmrg      # broken ls alias from the environment.  This has actually
8458b22bf3fSmrg      # happened.  Such a system could not be considered "sane".
8468b22bf3fSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8478b22bf3fSmrgalias in your environment])
8488b22bf3fSmrg   fi
8498b22bf3fSmrg
8508b22bf3fSmrg   test "$[2]" = conftest.file
8518b22bf3fSmrg   )
8528b22bf3fSmrgthen
8538b22bf3fSmrg   # Ok.
8548b22bf3fSmrg   :
8558b22bf3fSmrgelse
8568b22bf3fSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
8578b22bf3fSmrgCheck your system clock])
8588b22bf3fSmrgfi
8598b22bf3fSmrgAC_MSG_RESULT(yes)])
8608b22bf3fSmrg
86196a81b41Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
86296a81b41Smrg#
86396a81b41Smrg# This file is free software; the Free Software Foundation
86496a81b41Smrg# gives unlimited permission to copy and/or distribute it,
86596a81b41Smrg# with or without modifications, as long as this notice is preserved.
86696a81b41Smrg
86796a81b41Smrg# serial 1
86896a81b41Smrg
86996a81b41Smrg# AM_SILENT_RULES([DEFAULT])
87096a81b41Smrg# --------------------------
87196a81b41Smrg# Enable less verbose build rules; with the default set to DEFAULT
87296a81b41Smrg# (`yes' being less verbose, `no' or empty being verbose).
87396a81b41SmrgAC_DEFUN([AM_SILENT_RULES],
87496a81b41Smrg[AC_ARG_ENABLE([silent-rules],
87596a81b41Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
87696a81b41Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
87796a81b41Smrgcase $enable_silent_rules in
87896a81b41Smrgyes) AM_DEFAULT_VERBOSITY=0;;
87996a81b41Smrgno)  AM_DEFAULT_VERBOSITY=1;;
88096a81b41Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
88196a81b41Smrgesac
88296a81b41SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
88396a81b41SmrgAM_BACKSLASH='\'
88496a81b41SmrgAC_SUBST([AM_BACKSLASH])dnl
88596a81b41Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
88696a81b41Smrg])
88796a81b41Smrg
8888b22bf3fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8898b22bf3fSmrg#
8908b22bf3fSmrg# This file is free software; the Free Software Foundation
8918b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
8928b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
8938b22bf3fSmrg
8948b22bf3fSmrg# AM_PROG_INSTALL_STRIP
8958b22bf3fSmrg# ---------------------
8968b22bf3fSmrg# One issue with vendor `install' (even GNU) is that you can't
8978b22bf3fSmrg# specify the program used to strip binaries.  This is especially
8988b22bf3fSmrg# annoying in cross-compiling environments, where the build's strip
8998b22bf3fSmrg# is unlikely to handle the host's binaries.
9008b22bf3fSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9018b22bf3fSmrg# always use install-sh in `make install-strip', and initialize
9028b22bf3fSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
9038b22bf3fSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
9048b22bf3fSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9058b22bf3fSmrg# Installed binaries are usually stripped using `strip' when the user
9068b22bf3fSmrg# run `make install-strip'.  However `strip' might not be the right
9078b22bf3fSmrg# tool to use in cross-compilation environments, therefore Automake
9088b22bf3fSmrg# will honor the `STRIP' environment variable to overrule this program.
9098b22bf3fSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
9108b22bf3fSmrgif test "$cross_compiling" != no; then
9118b22bf3fSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
9128b22bf3fSmrgfi
9138b22bf3fSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9148b22bf3fSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9158b22bf3fSmrg
91696a81b41Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9178b22bf3fSmrg#
9188b22bf3fSmrg# This file is free software; the Free Software Foundation
9198b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
9208b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
9218b22bf3fSmrg
92296a81b41Smrg# serial 2
92396a81b41Smrg
9248b22bf3fSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
9258b22bf3fSmrg# ---------------------------
92696a81b41Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9278b22bf3fSmrg# This macro is traced by Automake.
9288b22bf3fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9298b22bf3fSmrg
93096a81b41Smrg# AM_SUBST_NOTMAKE(VARIABLE)
93196a81b41Smrg# ---------------------------
93296a81b41Smrg# Public sister of _AM_SUBST_NOTMAKE.
93396a81b41SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
93496a81b41Smrg
9358b22bf3fSmrg# Check how to create a tarball.                            -*- Autoconf -*-
9368b22bf3fSmrg
9378b22bf3fSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9388b22bf3fSmrg#
9398b22bf3fSmrg# This file is free software; the Free Software Foundation
9408b22bf3fSmrg# gives unlimited permission to copy and/or distribute it,
9418b22bf3fSmrg# with or without modifications, as long as this notice is preserved.
9428b22bf3fSmrg
9438b22bf3fSmrg# serial 2
9448b22bf3fSmrg
9458b22bf3fSmrg# _AM_PROG_TAR(FORMAT)
9468b22bf3fSmrg# --------------------
9478b22bf3fSmrg# Check how to create a tarball in format FORMAT.
9488b22bf3fSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
9498b22bf3fSmrg#
9508b22bf3fSmrg# Substitute a variable $(am__tar) that is a command
9518b22bf3fSmrg# writing to stdout a FORMAT-tarball containing the directory
9528b22bf3fSmrg# $tardir.
9538b22bf3fSmrg#     tardir=directory && $(am__tar) > result.tar
9548b22bf3fSmrg#
9558b22bf3fSmrg# Substitute a variable $(am__untar) that extract such
9568b22bf3fSmrg# a tarball read from stdin.
9578b22bf3fSmrg#     $(am__untar) < result.tar
9588b22bf3fSmrgAC_DEFUN([_AM_PROG_TAR],
9598b22bf3fSmrg[# Always define AMTAR for backward compatibility.
9608b22bf3fSmrgAM_MISSING_PROG([AMTAR], [tar])
9618b22bf3fSmrgm4_if([$1], [v7],
9628b22bf3fSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
9638b22bf3fSmrg     [m4_case([$1], [ustar],, [pax],,
9648b22bf3fSmrg              [m4_fatal([Unknown tar format])])
9658b22bf3fSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
9668b22bf3fSmrg# Loop over all known methods to create a tar archive until one works.
9678b22bf3fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9688b22bf3fSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
9698b22bf3fSmrg# Do not fold the above two line into one, because Tru64 sh and
9708b22bf3fSmrg# Solaris sh will not grok spaces in the rhs of `-'.
9718b22bf3fSmrgfor _am_tool in $_am_tools
9728b22bf3fSmrgdo
9738b22bf3fSmrg  case $_am_tool in
9748b22bf3fSmrg  gnutar)
9758b22bf3fSmrg    for _am_tar in tar gnutar gtar;
9768b22bf3fSmrg    do
9778b22bf3fSmrg      AM_RUN_LOG([$_am_tar --version]) && break
9788b22bf3fSmrg    done
9798b22bf3fSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9808b22bf3fSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9818b22bf3fSmrg    am__untar="$_am_tar -xf -"
9828b22bf3fSmrg    ;;
9838b22bf3fSmrg  plaintar)
9848b22bf3fSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
9858b22bf3fSmrg    # ustar tarball either.
9868b22bf3fSmrg    (tar --version) >/dev/null 2>&1 && continue
9878b22bf3fSmrg    am__tar='tar chf - "$$tardir"'
9888b22bf3fSmrg    am__tar_='tar chf - "$tardir"'
9898b22bf3fSmrg    am__untar='tar xf -'
9908b22bf3fSmrg    ;;
9918b22bf3fSmrg  pax)
9928b22bf3fSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
9938b22bf3fSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
9948b22bf3fSmrg    am__untar='pax -r'
9958b22bf3fSmrg    ;;
9968b22bf3fSmrg  cpio)
9978b22bf3fSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9988b22bf3fSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9998b22bf3fSmrg    am__untar='cpio -i -H $1 -d'
10008b22bf3fSmrg    ;;
10018b22bf3fSmrg  none)
10028b22bf3fSmrg    am__tar=false
10038b22bf3fSmrg    am__tar_=false
10048b22bf3fSmrg    am__untar=false
10058b22bf3fSmrg    ;;
10068b22bf3fSmrg  esac
10078b22bf3fSmrg
10088b22bf3fSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
10098b22bf3fSmrg  # and am__untar set.
10108b22bf3fSmrg  test -n "${am_cv_prog_tar_$1}" && break
10118b22bf3fSmrg
10128b22bf3fSmrg  # tar/untar a dummy directory, and stop if the command works
10138b22bf3fSmrg  rm -rf conftest.dir
10148b22bf3fSmrg  mkdir conftest.dir
10158b22bf3fSmrg  echo GrepMe > conftest.dir/file
10168b22bf3fSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10178b22bf3fSmrg  rm -rf conftest.dir
10188b22bf3fSmrg  if test -s conftest.tar; then
10198b22bf3fSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
10208b22bf3fSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
10218b22bf3fSmrg  fi
10228b22bf3fSmrgdone
10238b22bf3fSmrgrm -rf conftest.dir
10248b22bf3fSmrg
10258b22bf3fSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10268b22bf3fSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
10278b22bf3fSmrgAC_SUBST([am__tar])
10288b22bf3fSmrgAC_SUBST([am__untar])
10298b22bf3fSmrg]) # _AM_PROG_TAR
10308b22bf3fSmrg
103196a81b41Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10328b22bf3fSmrgdnl
10338b22bf3fSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
10348b22bf3fSmrgdnl 
10358b22bf3fSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10368b22bf3fSmrgdnl copy of this software and associated documentation files (the
10378b22bf3fSmrgdnl "Software"), to deal in the Software without restriction, including
10388b22bf3fSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
10398b22bf3fSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
10408b22bf3fSmrgdnl to whom the Software is furnished to do so, provided that the above
10418b22bf3fSmrgdnl copyright notice(s) and this permission notice appear in all copies of
10428b22bf3fSmrgdnl the Software and that both the above copyright notice(s) and this
10438b22bf3fSmrgdnl permission notice appear in supporting documentation.
10448b22bf3fSmrgdnl
10458b22bf3fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10468b22bf3fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10478b22bf3fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
10488b22bf3fSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
10498b22bf3fSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
10508b22bf3fSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
10518b22bf3fSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
10528b22bf3fSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
10538b22bf3fSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
10548b22bf3fSmrgdnl
10558b22bf3fSmrgdnl Except as contained in this notice, the name of a copyright holder
10568b22bf3fSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
10578b22bf3fSmrgdnl or other dealings in this Software without prior written authorization
10588b22bf3fSmrgdnl of the copyright holder.
10598b22bf3fSmrg
10608b22bf3fSmrg# XORG_MACROS_VERSION(required-version)
10618b22bf3fSmrg# -------------------------------------
10628b22bf3fSmrg# Minimum version: 1.1.0
10638b22bf3fSmrg#
10648b22bf3fSmrg# If you're using a macro added in Version 1.1 or newer, include this in
10658b22bf3fSmrg# your configure.ac with the minimum required version, such as:
10668b22bf3fSmrg# XORG_MACROS_VERSION(1.1)
10678b22bf3fSmrg#
106896a81b41Smrg# To ensure that this macro is defined, also add:
106996a81b41Smrg# m4_ifndef([XORG_MACROS_VERSION],
107096a81b41Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10718b22bf3fSmrg#
10728b22bf3fSmrg#
10738b22bf3fSmrg# See the "minimum version" comment for each macro you use to see what 
10748b22bf3fSmrg# version you require.
107596a81b41Smrgm4_defun([XORG_MACROS_VERSION],[
107696a81b41Smrgm4_define([vers_have], [1.3.0])
107796a81b41Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
107896a81b41Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
107996a81b41Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
108096a81b41Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
108196a81b41Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
108296a81b41Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
108396a81b41Smrgm4_undefine([vers_have])
108496a81b41Smrgm4_undefine([maj_have])
108596a81b41Smrgm4_undefine([maj_needed])
10868b22bf3fSmrg]) # XORG_MACROS_VERSION
10878b22bf3fSmrg
10888b22bf3fSmrg# XORG_PROG_RAWCPP()
10898b22bf3fSmrg# ------------------
10908b22bf3fSmrg# Minimum version: 1.0.0
10918b22bf3fSmrg#
10928b22bf3fSmrg# Find cpp program and necessary flags for use in pre-processing text files
10938b22bf3fSmrg# such as man pages and config files
10948b22bf3fSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
10958b22bf3fSmrgAC_REQUIRE([AC_PROG_CPP])
10968b22bf3fSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
10978b22bf3fSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
10988b22bf3fSmrg
10998b22bf3fSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
11008b22bf3fSmrg# which is not the best choice for supporting other OS'es, but covers most
11018b22bf3fSmrg# of the ones we need for now.
11028b22bf3fSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
11038b22bf3fSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
11048b22bf3fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11058b22bf3fSmrg	AC_MSG_RESULT([no])
11068b22bf3fSmrgelse
11078b22bf3fSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11088b22bf3fSmrg		RAWCPPFLAGS=-undef
11098b22bf3fSmrg		AC_MSG_RESULT([yes])
111096a81b41Smrg	# under Cygwin unix is still defined even with -undef
111196a81b41Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
111296a81b41Smrg		RAWCPPFLAGS="-undef -ansi"
111396a81b41Smrg		AC_MSG_RESULT([yes, with -ansi])
11148b22bf3fSmrg	else
11158b22bf3fSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
11168b22bf3fSmrg	fi
11178b22bf3fSmrgfi
11188b22bf3fSmrgrm -f conftest.$ac_ext
11198b22bf3fSmrg
11208b22bf3fSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
11218b22bf3fSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
11228b22bf3fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11238b22bf3fSmrg	AC_MSG_RESULT([no])
11248b22bf3fSmrgelse
11258b22bf3fSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11268b22bf3fSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
11278b22bf3fSmrg		AC_MSG_RESULT([yes])
11288b22bf3fSmrg	else
11298b22bf3fSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
11308b22bf3fSmrg	fi
11318b22bf3fSmrgfi
11328b22bf3fSmrgrm -f conftest.$ac_ext
11338b22bf3fSmrgAC_SUBST(RAWCPPFLAGS)
11348b22bf3fSmrg]) # XORG_PROG_RAWCPP
11358b22bf3fSmrg
11368b22bf3fSmrg# XORG_MANPAGE_SECTIONS()
11378b22bf3fSmrg# -----------------------
11388b22bf3fSmrg# Minimum version: 1.0.0
11398b22bf3fSmrg#
11408b22bf3fSmrg# Determine which sections man pages go in for the different man page types
11418b22bf3fSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
11428b22bf3fSmrg# Not sure if there's any better way than just hardcoding by OS name.
11438b22bf3fSmrg# Override default settings by setting environment variables
11448b22bf3fSmrg
11458b22bf3fSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
11468b22bf3fSmrgAC_REQUIRE([AC_CANONICAL_HOST])
11478b22bf3fSmrg
11488b22bf3fSmrgif test x$APP_MAN_SUFFIX = x    ; then
11498b22bf3fSmrg    APP_MAN_SUFFIX=1
11508b22bf3fSmrgfi
11518b22bf3fSmrgif test x$APP_MAN_DIR = x    ; then
11528b22bf3fSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
11538b22bf3fSmrgfi
11548b22bf3fSmrg
11558b22bf3fSmrgif test x$LIB_MAN_SUFFIX = x    ; then
11568b22bf3fSmrg    LIB_MAN_SUFFIX=3
11578b22bf3fSmrgfi
11588b22bf3fSmrgif test x$LIB_MAN_DIR = x    ; then
11598b22bf3fSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
11608b22bf3fSmrgfi
11618b22bf3fSmrg
11628b22bf3fSmrgif test x$FILE_MAN_SUFFIX = x    ; then
11638b22bf3fSmrg    case $host_os in
11648b22bf3fSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
11658b22bf3fSmrg	*)		FILE_MAN_SUFFIX=5  ;;
11668b22bf3fSmrg    esac
11678b22bf3fSmrgfi
11688b22bf3fSmrgif test x$FILE_MAN_DIR = x    ; then
11698b22bf3fSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
11708b22bf3fSmrgfi
11718b22bf3fSmrg
11728b22bf3fSmrgif test x$MISC_MAN_SUFFIX = x    ; then
11738b22bf3fSmrg    case $host_os in
11748b22bf3fSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
11758b22bf3fSmrg	*)		MISC_MAN_SUFFIX=7  ;;
11768b22bf3fSmrg    esac
11778b22bf3fSmrgfi
11788b22bf3fSmrgif test x$MISC_MAN_DIR = x    ; then
11798b22bf3fSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
11808b22bf3fSmrgfi
11818b22bf3fSmrg
11828b22bf3fSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
11838b22bf3fSmrg    case $host_os in
11848b22bf3fSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
11858b22bf3fSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
11868b22bf3fSmrg    esac
11878b22bf3fSmrgfi
11888b22bf3fSmrgif test x$DRIVER_MAN_DIR = x    ; then
11898b22bf3fSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
11908b22bf3fSmrgfi
11918b22bf3fSmrg
11928b22bf3fSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
11938b22bf3fSmrg    case $host_os in
11948b22bf3fSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
11958b22bf3fSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
11968b22bf3fSmrg    esac
11978b22bf3fSmrgfi
11988b22bf3fSmrgif test x$ADMIN_MAN_DIR = x    ; then
11998b22bf3fSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
12008b22bf3fSmrgfi
12018b22bf3fSmrg
12028b22bf3fSmrg
12038b22bf3fSmrgAC_SUBST([APP_MAN_SUFFIX])
12048b22bf3fSmrgAC_SUBST([LIB_MAN_SUFFIX])
12058b22bf3fSmrgAC_SUBST([FILE_MAN_SUFFIX])
12068b22bf3fSmrgAC_SUBST([MISC_MAN_SUFFIX])
12078b22bf3fSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
12088b22bf3fSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
12098b22bf3fSmrgAC_SUBST([APP_MAN_DIR])
12108b22bf3fSmrgAC_SUBST([LIB_MAN_DIR])
12118b22bf3fSmrgAC_SUBST([FILE_MAN_DIR])
12128b22bf3fSmrgAC_SUBST([MISC_MAN_DIR])
12138b22bf3fSmrgAC_SUBST([DRIVER_MAN_DIR])
12148b22bf3fSmrgAC_SUBST([ADMIN_MAN_DIR])
12158b22bf3fSmrg]) # XORG_MANPAGE_SECTIONS
12168b22bf3fSmrg
12178b22bf3fSmrg# XORG_CHECK_LINUXDOC
12188b22bf3fSmrg# -------------------
12198b22bf3fSmrg# Minimum version: 1.0.0
12208b22bf3fSmrg#
12218b22bf3fSmrg# Defines the variable MAKE_TEXT if the necessary tools and
12228b22bf3fSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
12238b22bf3fSmrg# Whether or not the necessary tools and files are found can be checked
12248b22bf3fSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
12258b22bf3fSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
122696a81b41Smrgif test x$XORG_SGML_PATH = x ; then
122796a81b41Smrg    XORG_SGML_PATH=$prefix/share/sgml
122896a81b41Smrgfi
12298b22bf3fSmrgHAVE_DEFS_ENT=
12308b22bf3fSmrg
12318b22bf3fSmrgif test x"$cross_compiling" = x"yes" ; then
12328b22bf3fSmrg  HAVE_DEFS_ENT=no
12338b22bf3fSmrgelse
12348b22bf3fSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
12358b22bf3fSmrgfi
12368b22bf3fSmrg
12378b22bf3fSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
12388b22bf3fSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
12398b22bf3fSmrg
12408b22bf3fSmrgAC_MSG_CHECKING([Whether to build documentation])
12418b22bf3fSmrg
12428b22bf3fSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
12438b22bf3fSmrg   BUILDDOC=yes
12448b22bf3fSmrgelse
12458b22bf3fSmrg   BUILDDOC=no
12468b22bf3fSmrgfi
12478b22bf3fSmrg
12488b22bf3fSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
12498b22bf3fSmrg
12508b22bf3fSmrgAC_MSG_RESULT([$BUILDDOC])
12518b22bf3fSmrg
12528b22bf3fSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
12538b22bf3fSmrg
12548b22bf3fSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
12558b22bf3fSmrg   BUILDPDFDOC=yes
12568b22bf3fSmrgelse
12578b22bf3fSmrg   BUILDPDFDOC=no
12588b22bf3fSmrgfi
12598b22bf3fSmrg
12608b22bf3fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
12618b22bf3fSmrg
12628b22bf3fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
12638b22bf3fSmrg
12648b22bf3fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
12658b22bf3fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
12668b22bf3fSmrgMAKE_PDF="$PS2PDF"
12678b22bf3fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
12688b22bf3fSmrg
12698b22bf3fSmrgAC_SUBST(MAKE_TEXT)
12708b22bf3fSmrgAC_SUBST(MAKE_PS)
12718b22bf3fSmrgAC_SUBST(MAKE_PDF)
12728b22bf3fSmrgAC_SUBST(MAKE_HTML)
12738b22bf3fSmrg]) # XORG_CHECK_LINUXDOC
12748b22bf3fSmrg
12758b22bf3fSmrg# XORG_CHECK_DOCBOOK
12768b22bf3fSmrg# -------------------
12778b22bf3fSmrg# Minimum version: 1.0.0
12788b22bf3fSmrg#
12798b22bf3fSmrg# Checks for the ability to build output formats from SGML DocBook source.
12808b22bf3fSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
12818b22bf3fSmrg# indicates whether the necessary tools and files are found and, if set,
12828b22bf3fSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
12838b22bf3fSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
128496a81b41Smrgif test x$XORG_SGML_PATH = x ; then
128596a81b41Smrg    XORG_SGML_PATH=$prefix/share/sgml
128696a81b41Smrgfi
12878b22bf3fSmrgHAVE_DEFS_ENT=
12888b22bf3fSmrgBUILDTXTDOC=no
12898b22bf3fSmrgBUILDPDFDOC=no
12908b22bf3fSmrgBUILDPSDOC=no
12918b22bf3fSmrgBUILDHTMLDOC=no
12928b22bf3fSmrg
12938b22bf3fSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
12948b22bf3fSmrg
12958b22bf3fSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
12968b22bf3fSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
12978b22bf3fSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
12988b22bf3fSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
12998b22bf3fSmrg
13008b22bf3fSmrgAC_MSG_CHECKING([Whether to build text documentation])
13018b22bf3fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
13028b22bf3fSmrg   test x$BUILD_TXTDOC != xno; then
13038b22bf3fSmrg	BUILDTXTDOC=yes
13048b22bf3fSmrgfi
13058b22bf3fSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
13068b22bf3fSmrgAC_MSG_RESULT([$BUILDTXTDOC])
13078b22bf3fSmrg
13088b22bf3fSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
13098b22bf3fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
13108b22bf3fSmrg   test x$BUILD_PDFDOC != xno; then
13118b22bf3fSmrg	BUILDPDFDOC=yes
13128b22bf3fSmrgfi
13138b22bf3fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13148b22bf3fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
13158b22bf3fSmrg
13168b22bf3fSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
13178b22bf3fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
13188b22bf3fSmrg   test x$BUILD_PSDOC != xno; then
13198b22bf3fSmrg	BUILDPSDOC=yes
13208b22bf3fSmrgfi
13218b22bf3fSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
13228b22bf3fSmrgAC_MSG_RESULT([$BUILDPSDOC])
13238b22bf3fSmrg
13248b22bf3fSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
13258b22bf3fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
13268b22bf3fSmrg   test x$BUILD_HTMLDOC != xno; then
13278b22bf3fSmrg	BUILDHTMLDOC=yes
13288b22bf3fSmrgfi
13298b22bf3fSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
13308b22bf3fSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
13318b22bf3fSmrg
13328b22bf3fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
13338b22bf3fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
13348b22bf3fSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
13358b22bf3fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
13368b22bf3fSmrg
13378b22bf3fSmrgAC_SUBST(MAKE_TEXT)
13388b22bf3fSmrgAC_SUBST(MAKE_PS)
13398b22bf3fSmrgAC_SUBST(MAKE_PDF)
13408b22bf3fSmrgAC_SUBST(MAKE_HTML)
13418b22bf3fSmrg]) # XORG_CHECK_DOCBOOK
13428b22bf3fSmrg
13438b22bf3fSmrg# XORG_CHECK_MALLOC_ZERO
13448b22bf3fSmrg# ----------------------
13458b22bf3fSmrg# Minimum version: 1.0.0
13468b22bf3fSmrg#
13478b22bf3fSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
13488b22bf3fSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
13498b22bf3fSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
13508b22bf3fSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
13518b22bf3fSmrgAC_ARG_ENABLE(malloc0returnsnull,
135296a81b41Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
13538b22bf3fSmrg		       [malloc(0) returns NULL (default: auto)]),
13548b22bf3fSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
13558b22bf3fSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
13568b22bf3fSmrg
13578b22bf3fSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
13588b22bf3fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
13598b22bf3fSmrg	AC_RUN_IFELSE([
13608b22bf3fSmrgchar *malloc();
13618b22bf3fSmrgchar *realloc();
13628b22bf3fSmrgchar *calloc();
13638b22bf3fSmrgmain() {
13648b22bf3fSmrg    char *m0, *r0, *c0, *p;
13658b22bf3fSmrg    m0 = malloc(0);
13668b22bf3fSmrg    p = malloc(10);
13678b22bf3fSmrg    r0 = realloc(p,0);
13688b22bf3fSmrg    c0 = calloc(0);
13698b22bf3fSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
13708b22bf3fSmrg}],
13718b22bf3fSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
13728b22bf3fSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
13738b22bf3fSmrgfi
13748b22bf3fSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
13758b22bf3fSmrg
13768b22bf3fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
13778b22bf3fSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
13788b22bf3fSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
13798b22bf3fSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
13808b22bf3fSmrgelse
13818b22bf3fSmrg	MALLOC_ZERO_CFLAGS=""
13828b22bf3fSmrg	XMALLOC_ZERO_CFLAGS=""
13838b22bf3fSmrg	XTMALLOC_ZERO_CFLAGS=""
13848b22bf3fSmrgfi
13858b22bf3fSmrg
13868b22bf3fSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
13878b22bf3fSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
13888b22bf3fSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
13898b22bf3fSmrg]) # XORG_CHECK_MALLOC_ZERO
13908b22bf3fSmrg
13918b22bf3fSmrg# XORG_WITH_LINT()
13928b22bf3fSmrg# ----------------
13938b22bf3fSmrg# Minimum version: 1.1.0
13948b22bf3fSmrg#
13958b22bf3fSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
13968b22bf3fSmrg# is specified.   (Use --with-lint=sparse for sparse.)
13978b22bf3fSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
13988b22bf3fSmrg# Sets $LINT_FLAGS to flags to pass to source checker
13998b22bf3fSmrg# Sets LINT automake conditional if enabled (default: disabled)
14008b22bf3fSmrg#
14018b22bf3fSmrgAC_DEFUN([XORG_WITH_LINT],[
14028b22bf3fSmrg
14038b22bf3fSmrg# Allow checking code with lint, sparse, etc.
140496a81b41SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
14058b22bf3fSmrg		[Use a lint-style source code checker (default: disabled)])],
14068b22bf3fSmrg		[use_lint=$withval], [use_lint=no])
14078b22bf3fSmrgif test "x$use_lint" = "xyes" ; then
14088b22bf3fSmrg	LINT="lint"
14098b22bf3fSmrgelse
14108b22bf3fSmrg	LINT="$use_lint"
14118b22bf3fSmrgfi
14128b22bf3fSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
14138b22bf3fSmrg    case $LINT in
14148b22bf3fSmrg	lint|*/lint)
14158b22bf3fSmrg	    case $host_os in
14168b22bf3fSmrg		solaris*)
14178b22bf3fSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
14188b22bf3fSmrg			;;
14198b22bf3fSmrg	    esac
14208b22bf3fSmrg	    ;;
14218b22bf3fSmrg    esac
14228b22bf3fSmrgfi
14238b22bf3fSmrg
14248b22bf3fSmrgAC_SUBST(LINT)
14258b22bf3fSmrgAC_SUBST(LINT_FLAGS)
14268b22bf3fSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
14278b22bf3fSmrg
14288b22bf3fSmrg]) # XORG_WITH_LINT
14298b22bf3fSmrg
14308b22bf3fSmrg# XORG_LINT_LIBRARY(LIBNAME)
14318b22bf3fSmrg# --------------------------
14328b22bf3fSmrg# Minimum version: 1.1.0
14338b22bf3fSmrg#
14348b22bf3fSmrg# Sets up flags for building lint libraries for checking programs that call
14358b22bf3fSmrg# functions in the library.
14368b22bf3fSmrg# Disabled by default, enable with --enable-lint-library
14378b22bf3fSmrg# Sets: 
14388b22bf3fSmrg#	@LINTLIB@		- name of lint library file to make
14398b22bf3fSmrg#	MAKE_LINT_LIB		- automake conditional
14408b22bf3fSmrg#
14418b22bf3fSmrg
14428b22bf3fSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
14438b22bf3fSmrgAC_REQUIRE([XORG_WITH_LINT])
14448b22bf3fSmrg# Build lint "library" for more indepth checks of programs calling this library
144596a81b41SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
14468b22bf3fSmrg	[Create lint library (default: disabled)])],
14478b22bf3fSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
14488b22bf3fSmrgif test "x$make_lint_lib" != "xno" ; then
14498b22bf3fSmrg	if test "x$LINT" = "xno" ; then
14508b22bf3fSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
14518b22bf3fSmrg	fi
14528b22bf3fSmrg	if test "x$make_lint_lib" = "xyes" ; then
14538b22bf3fSmrg		LINTLIB=llib-l$1.ln
14548b22bf3fSmrg	else
14558b22bf3fSmrg		LINTLIB=$make_lint_lib
14568b22bf3fSmrg	fi
14578b22bf3fSmrgfi
14588b22bf3fSmrgAC_SUBST(LINTLIB)
14598b22bf3fSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
14608b22bf3fSmrg
14618b22bf3fSmrg]) # XORG_LINT_LIBRARY
14628b22bf3fSmrg
146396a81b41Smrg# XORG_CWARNFLAGS
146496a81b41Smrg# ---------------
146596a81b41Smrg# Minimum version: 1.2.0
146696a81b41Smrg#
146796a81b41Smrg# Defines CWARNFLAGS to enable C compiler warnings.
146896a81b41Smrg#
146996a81b41SmrgAC_DEFUN([XORG_CWARNFLAGS], [
147096a81b41SmrgAC_REQUIRE([AC_PROG_CC])
147196a81b41Smrgif  test "x$GCC" = xyes ; then
147296a81b41Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
147396a81b41Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
147496a81b41Smrg-Wbad-function-cast"
147596a81b41Smrg    case `$CC -dumpversion` in
147696a81b41Smrg    3.4.* | 4.*)
147796a81b41Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
147896a81b41Smrg	;;
147996a81b41Smrg    esac
148096a81b41Smrgelse
148196a81b41Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
148296a81b41Smrg    if test "x$SUNCC" = "xyes"; then
148396a81b41Smrg	CWARNFLAGS="-v"
148496a81b41Smrg    fi
148596a81b41Smrgfi
148696a81b41SmrgAC_SUBST(CWARNFLAGS)
148796a81b41Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
148896a81b41Smrg]) # XORG_CWARNFLAGS
148996a81b41Smrg
149096a81b41Smrg# XORG_STRICT_OPTION
149196a81b41Smrg# -----------------------
149296a81b41Smrg# Minimum version: 1.3.0
149396a81b41Smrg#
149496a81b41Smrg# Add configure option to enable strict compilation
149596a81b41SmrgAC_DEFUN([XORG_STRICT_OPTION], [
149696a81b41SmrgAC_REQUIRE([AC_PROG_CC])
149796a81b41SmrgAC_REQUIRE([AC_PROG_CC_C99])
149896a81b41SmrgAC_REQUIRE([XORG_CWARNFLAGS])
149996a81b41Smrg
150096a81b41SmrgAC_ARG_ENABLE(strict-compilation,
150196a81b41Smrg			  AS_HELP_STRING([--enable-strict-compilation],
150296a81b41Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
150396a81b41Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
150496a81b41Smrgif test "x$STRICT_COMPILE" = "xyes"; then
150596a81b41Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
150696a81b41Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
150796a81b41Smrg	if test "x$GCC" = xyes ; then
150896a81b41Smrg		STRICT_CFLAGS="-pedantic -Werror"
150996a81b41Smrg	elif test "x$SUNCC" = "xyes"; then
151096a81b41Smrg		STRICT_CFLAGS="-errwarn"
151196a81b41Smrg    elif test "x$INTELCC" = "xyes"; then
151296a81b41Smrg		STRICT_CFLAGS="-Werror"
151396a81b41Smrg	fi
151496a81b41Smrgfi
151596a81b41SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
151696a81b41SmrgAC_SUBST([CWARNFLAGS])
151796a81b41Smrg]) # XORG_STRICT_OPTION
151896a81b41Smrg
151996a81b41Smrg# XORG_DEFAULT_OPTIONS
152096a81b41Smrg# --------------------
152196a81b41Smrg# Minimum version: 1.3.0
152296a81b41Smrg#
152396a81b41Smrg# Defines default options for X.Org modules.
152496a81b41Smrg#
152596a81b41SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
152696a81b41SmrgXORG_CWARNFLAGS
152796a81b41SmrgXORG_STRICT_OPTION
152896a81b41SmrgXORG_RELEASE_VERSION
152996a81b41SmrgXORG_CHANGELOG
153096a81b41SmrgXORG_MANPAGE_SECTIONS
153196a81b41Smrg]) # XORG_DEFAULT_OPTIONS
15328b22bf3fSmrgdnl Copyright 2005 Red Hat, Inc
15338b22bf3fSmrgdnl
15348b22bf3fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
15358b22bf3fSmrgdnl documentation for any purpose is hereby granted without fee, provided that
15368b22bf3fSmrgdnl the above copyright notice appear in all copies and that both that
15378b22bf3fSmrgdnl copyright notice and this permission notice appear in supporting
15388b22bf3fSmrgdnl documentation.
15398b22bf3fSmrgdnl
15408b22bf3fSmrgdnl The above copyright notice and this permission notice shall be included
15418b22bf3fSmrgdnl in all copies or substantial portions of the Software.
15428b22bf3fSmrgdnl
15438b22bf3fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15448b22bf3fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15458b22bf3fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15468b22bf3fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
15478b22bf3fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
15488b22bf3fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
15498b22bf3fSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
15508b22bf3fSmrgdnl
15518b22bf3fSmrgdnl Except as contained in this notice, the name of the copyright holders shall
15528b22bf3fSmrgdnl not be used in advertising or otherwise to promote the sale, use or
15538b22bf3fSmrgdnl other dealings in this Software without prior written authorization
15548b22bf3fSmrgdnl from the copyright holders.
15558b22bf3fSmrgdnl
15568b22bf3fSmrg
15578b22bf3fSmrg# XORG_RELEASE_VERSION
15588b22bf3fSmrg# --------------------
15598b22bf3fSmrg# Adds --with/without-release-string and changes the PACKAGE and
15608b22bf3fSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
15618b22bf3fSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
15628b22bf3fSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
15638b22bf3fSmrg 
15648b22bf3fSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
15658b22bf3fSmrg	AC_ARG_WITH(release-version,
156696a81b41Smrg			AS_HELP_STRING([--with-release-version=STRING],
15678b22bf3fSmrg				[Use release version string in package name]),
15688b22bf3fSmrg			[RELEASE_VERSION="$withval"],
15698b22bf3fSmrg			[RELEASE_VERSION=""])
15708b22bf3fSmrg	if test "x$RELEASE_VERSION" != "x"; then
15718b22bf3fSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
15728b22bf3fSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
15738b22bf3fSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
15748b22bf3fSmrg	fi
15758b22bf3fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
15768b22bf3fSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
15778b22bf3fSmrg		[Major version of this package])
157896a81b41Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
15798b22bf3fSmrg	if test "x$PVM" = "x"; then
15808b22bf3fSmrg		PVM="0"
15818b22bf3fSmrg	fi
15828b22bf3fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
15838b22bf3fSmrg		[$PVM],
15848b22bf3fSmrg		[Minor version of this package])
158596a81b41Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
15868b22bf3fSmrg	if test "x$PVP" = "x"; then
15878b22bf3fSmrg		PVP="0"
15888b22bf3fSmrg	fi
15898b22bf3fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
15908b22bf3fSmrg		[$PVP],
15918b22bf3fSmrg		[Patch version of this package])
15928b22bf3fSmrg])
15938b22bf3fSmrg
159496a81b41Smrg# XORG_CHANGELOG()
159596a81b41Smrg# ----------------
159696a81b41Smrg# Minimum version: 1.2.0
159796a81b41Smrg#
159896a81b41Smrg# Defines the variable CHANGELOG_CMD as the command to generate
159996a81b41Smrg# ChangeLog from git.
160096a81b41Smrg#
160196a81b41Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
160296a81b41Smrg#
160396a81b41SmrgAC_DEFUN([XORG_CHANGELOG], [
160496a81b41SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
160596a81b41Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
160696a81b41Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
160796a81b41SmrgAC_SUBST([CHANGELOG_CMD])
160896a81b41SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
160996a81b41Smrg]) # XORG_CHANGELOG
161096a81b41Smrg
16118b22bf3fSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
16128b22bf3fSmrg# 
16138b22bf3fSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
16148b22bf3fSmrg#
16158b22bf3fSmrg# This program is free software; you can redistribute it and/or modify
16168b22bf3fSmrg# it under the terms of the GNU General Public License as published by
16178b22bf3fSmrg# the Free Software Foundation; either version 2 of the License, or
16188b22bf3fSmrg# (at your option) any later version.
16198b22bf3fSmrg#
16208b22bf3fSmrg# This program is distributed in the hope that it will be useful, but
16218b22bf3fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
16228b22bf3fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16238b22bf3fSmrg# General Public License for more details.
16248b22bf3fSmrg#
16258b22bf3fSmrg# You should have received a copy of the GNU General Public License
16268b22bf3fSmrg# along with this program; if not, write to the Free Software
16278b22bf3fSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16288b22bf3fSmrg#
16298b22bf3fSmrg# As a special exception to the GNU General Public License, if you
16308b22bf3fSmrg# distribute this file as part of a program that contains a
16318b22bf3fSmrg# configuration script generated by Autoconf, you may include it under
16328b22bf3fSmrg# the same distribution terms that you use for the rest of that program.
16338b22bf3fSmrg
16348b22bf3fSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
16358b22bf3fSmrg# ----------------------------------
16368b22bf3fSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
16378b22bf3fSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
16388b22bf3fSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
16398b22bf3fSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
16408b22bf3fSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
16418b22bf3fSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
16428b22bf3fSmrgfi
16438b22bf3fSmrgif test -n "$PKG_CONFIG"; then
164496a81b41Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
16458b22bf3fSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
16468b22bf3fSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
16478b22bf3fSmrg		AC_MSG_RESULT([yes])
16488b22bf3fSmrg	else
16498b22bf3fSmrg		AC_MSG_RESULT([no])
16508b22bf3fSmrg		PKG_CONFIG=""
16518b22bf3fSmrg	fi
16528b22bf3fSmrg		
16538b22bf3fSmrgfi[]dnl
16548b22bf3fSmrg])# PKG_PROG_PKG_CONFIG
16558b22bf3fSmrg
16568b22bf3fSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
16578b22bf3fSmrg#
16588b22bf3fSmrg# Check to see whether a particular set of modules exists.  Similar
16598b22bf3fSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
16608b22bf3fSmrg#
16618b22bf3fSmrg#
16628b22bf3fSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
16638b22bf3fSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
16648b22bf3fSmrg# PKG_CHECK_EXISTS manually
16658b22bf3fSmrg# --------------------------------------------------------------
16668b22bf3fSmrgAC_DEFUN([PKG_CHECK_EXISTS],
16678b22bf3fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
16688b22bf3fSmrgif test -n "$PKG_CONFIG" && \
16698b22bf3fSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
16708b22bf3fSmrg  m4_ifval([$2], [$2], [:])
16718b22bf3fSmrgm4_ifvaln([$3], [else
16728b22bf3fSmrg  $3])dnl
16738b22bf3fSmrgfi])
16748b22bf3fSmrg
16758b22bf3fSmrg
16768b22bf3fSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
16778b22bf3fSmrg# ---------------------------------------------
16788b22bf3fSmrgm4_define([_PKG_CONFIG],
167996a81b41Smrg[if test -n "$$1"; then
168096a81b41Smrg    pkg_cv_[]$1="$$1"
168196a81b41Smrg elif test -n "$PKG_CONFIG"; then
168296a81b41Smrg    PKG_CHECK_EXISTS([$3],
168396a81b41Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
168496a81b41Smrg		     [pkg_failed=yes])
168596a81b41Smrg else
168696a81b41Smrg    pkg_failed=untried
16878b22bf3fSmrgfi[]dnl
16888b22bf3fSmrg])# _PKG_CONFIG
16898b22bf3fSmrg
169096a81b41Smrg# _PKG_SHORT_ERRORS_SUPPORTED
169196a81b41Smrg# -----------------------------
169296a81b41SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
169396a81b41Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
169496a81b41Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
169596a81b41Smrg        _pkg_short_errors_supported=yes
169696a81b41Smrgelse
169796a81b41Smrg        _pkg_short_errors_supported=no
169896a81b41Smrgfi[]dnl
169996a81b41Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
170096a81b41Smrg
170196a81b41Smrg
17028b22bf3fSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
17038b22bf3fSmrg# [ACTION-IF-NOT-FOUND])
17048b22bf3fSmrg#
17058b22bf3fSmrg#
17068b22bf3fSmrg# Note that if there is a possibility the first call to
17078b22bf3fSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
17088b22bf3fSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
17098b22bf3fSmrg#
17108b22bf3fSmrg#
17118b22bf3fSmrg# --------------------------------------------------------------
17128b22bf3fSmrgAC_DEFUN([PKG_CHECK_MODULES],
17138b22bf3fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
17148b22bf3fSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
17158b22bf3fSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
17168b22bf3fSmrg
17178b22bf3fSmrgpkg_failed=no
17188b22bf3fSmrgAC_MSG_CHECKING([for $1])
17198b22bf3fSmrg
17208b22bf3fSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
17218b22bf3fSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
17228b22bf3fSmrg
172396a81b41Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
172496a81b41Smrgand $1[]_LIBS to avoid the need to call pkg-config.
172596a81b41SmrgSee the pkg-config man page for more details.])
172696a81b41Smrg
17278b22bf3fSmrgif test $pkg_failed = yes; then
172896a81b41Smrg        _PKG_SHORT_ERRORS_SUPPORTED
172996a81b41Smrg        if test $_pkg_short_errors_supported = yes; then
173096a81b41Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
173196a81b41Smrg        else 
173296a81b41Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
173396a81b41Smrg        fi
17348b22bf3fSmrg	# Put the nasty error message in config.log where it belongs
173596a81b41Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
17368b22bf3fSmrg
17378b22bf3fSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
173896a81b41Smrg[Package requirements ($2) were not met:
173996a81b41Smrg
174096a81b41Smrg$$1_PKG_ERRORS
174196a81b41Smrg
17428b22bf3fSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
17438b22bf3fSmrginstalled software in a non-standard prefix.
17448b22bf3fSmrg
174596a81b41Smrg_PKG_TEXT
174696a81b41Smrg])],
174796a81b41Smrg		[AC_MSG_RESULT([no])
174896a81b41Smrg                $4])
17498b22bf3fSmrgelif test $pkg_failed = untried; then
17508b22bf3fSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
17518b22bf3fSmrg[The pkg-config script could not be found or is too old.  Make sure it
17528b22bf3fSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
17538b22bf3fSmrgpath to pkg-config.
17548b22bf3fSmrg
175596a81b41Smrg_PKG_TEXT
17568b22bf3fSmrg
175796a81b41SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
17588b22bf3fSmrg		[$4])
17598b22bf3fSmrgelse
17608b22bf3fSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
17618b22bf3fSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
17628b22bf3fSmrg        AC_MSG_RESULT([yes])
17638b22bf3fSmrg	ifelse([$3], , :, [$3])
17648b22bf3fSmrgfi[]dnl
17658b22bf3fSmrg])# PKG_CHECK_MODULES
17668b22bf3fSmrg
1767