aclocal.m4 revision 4def10e6
1f8a31ee4Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2a0d3b6eaSmrg
3a0d3b6eaSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4f8a31ee4Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5a0d3b6eaSmrg# This file is free software; the Free Software Foundation
6a0d3b6eaSmrg# gives unlimited permission to copy and/or distribute it,
7a0d3b6eaSmrg# with or without modifications, as long as this notice is preserved.
8a0d3b6eaSmrg
9a0d3b6eaSmrg# This program is distributed in the hope that it will be useful,
10a0d3b6eaSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11a0d3b6eaSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12a0d3b6eaSmrg# PARTICULAR PURPOSE.
13a0d3b6eaSmrg
14a0d3b6eaSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15a0d3b6eaSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
164def10e6Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
174def10e6Smrg[m4_warning([this file was generated for autoconf 2.68.
18a0d3b6eaSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19a0d3b6eaSmrgIf you have problems, you may need to regenerate the build system entirely.
20a0d3b6eaSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21a0d3b6eaSmrg
224def10e6Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23a0d3b6eaSmrg#
244def10e6Smrg# This file is free software; the Free Software Foundation
254def10e6Smrg# gives unlimited permission to copy and/or distribute it,
264def10e6Smrg# with or without modifications, as long as this notice is preserved.
27f8a31ee4Smrg
284def10e6Smrg# AM_AUTOMAKE_VERSION(VERSION)
294def10e6Smrg# ----------------------------
304def10e6Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
314def10e6Smrg# generated from the m4 files accompanying Automake X.Y.
324def10e6Smrg# (This private macro should not be called outside this file.)
334def10e6SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
344def10e6Smrg[am__api_version='1.11'
354def10e6Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
364def10e6Smrgdnl require some minimum version.  Point them to the right macro.
374def10e6Smrgm4_if([$1], [1.11.1], [],
384def10e6Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
394def10e6Smrg])
40a0d3b6eaSmrg
414def10e6Smrg# _AM_AUTOCONF_VERSION(VERSION)
424def10e6Smrg# -----------------------------
434def10e6Smrg# aclocal traces this macro to find the Autoconf version.
444def10e6Smrg# This is a private macro too.  Using m4_define simplifies
454def10e6Smrg# the logic in aclocal, which can simply ignore this definition.
464def10e6Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47a0d3b6eaSmrg
484def10e6Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
494def10e6Smrg# -------------------------------
504def10e6Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
514def10e6Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
524def10e6SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
534def10e6Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
544def10e6Smrgm4_ifndef([AC_AUTOCONF_VERSION],
554def10e6Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
564def10e6Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57a0d3b6eaSmrg
584def10e6Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59a0d3b6eaSmrg
604def10e6Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
614def10e6Smrg#
624def10e6Smrg# This file is free software; the Free Software Foundation
634def10e6Smrg# gives unlimited permission to copy and/or distribute it,
644def10e6Smrg# with or without modifications, as long as this notice is preserved.
65a0d3b6eaSmrg
664def10e6Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
674def10e6Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
684def10e6Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69a0d3b6eaSmrg#
704def10e6Smrg# Of course, Automake must honor this variable whenever it calls a
714def10e6Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
724def10e6Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
734def10e6Smrg# depending on how configure is run.  This is pretty annoying, since
744def10e6Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
754def10e6Smrg# source directory, any form will work fine, but in subdirectories a
764def10e6Smrg# relative path needs to be adjusted first.
77a0d3b6eaSmrg#
784def10e6Smrg# $ac_aux_dir/missing
794def10e6Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
804def10e6Smrg# $top_srcdir/$ac_aux_dir/missing
814def10e6Smrg#    fails if $ac_aux_dir is absolute,
824def10e6Smrg#    fails when called from a subdirectory in a VPATH build with
834def10e6Smrg#          a relative $ac_aux_dir
84a0d3b6eaSmrg#
854def10e6Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
864def10e6Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
874def10e6Smrg# harmless because $srcdir is `.', but things will broke when you
884def10e6Smrg# start a VPATH build or use an absolute $srcdir.
89a0d3b6eaSmrg#
904def10e6Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
914def10e6Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
924def10e6Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
934def10e6Smrg# and then we would define $MISSING as
944def10e6Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
954def10e6Smrg# This will work as long as MISSING is not called from configure, because
964def10e6Smrg# unfortunately $(top_srcdir) has no meaning in configure.
974def10e6Smrg# However there are other variables, like CC, which are often used in
984def10e6Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
994def10e6Smrg#
1004def10e6Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
1014def10e6Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
1024def10e6Smrg# configured tree to be moved without reconfiguration.
103a0d3b6eaSmrg
1044def10e6SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1054def10e6Smrg[dnl Rely on autoconf to set up CDPATH properly.
1064def10e6SmrgAC_PREREQ([2.50])dnl
1074def10e6Smrg# expand $ac_aux_dir to an absolute path
1084def10e6Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
1094def10e6Smrg])
110a0d3b6eaSmrg
1114def10e6Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112a0d3b6eaSmrg
1134def10e6Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1144def10e6Smrg# Free Software Foundation, Inc.
1154def10e6Smrg#
1164def10e6Smrg# This file is free software; the Free Software Foundation
1174def10e6Smrg# gives unlimited permission to copy and/or distribute it,
1184def10e6Smrg# with or without modifications, as long as this notice is preserved.
119a0d3b6eaSmrg
1204def10e6Smrg# serial 9
121a0d3b6eaSmrg
1224def10e6Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1234def10e6Smrg# -------------------------------------
1244def10e6Smrg# Define a conditional.
1254def10e6SmrgAC_DEFUN([AM_CONDITIONAL],
1264def10e6Smrg[AC_PREREQ(2.52)dnl
1274def10e6Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1284def10e6Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1294def10e6SmrgAC_SUBST([$1_TRUE])dnl
1304def10e6SmrgAC_SUBST([$1_FALSE])dnl
1314def10e6Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1324def10e6Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1334def10e6Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1344def10e6Smrgif $2; then
1354def10e6Smrg  $1_TRUE=
1364def10e6Smrg  $1_FALSE='#'
1374def10e6Smrgelse
1384def10e6Smrg  $1_TRUE='#'
1394def10e6Smrg  $1_FALSE=
1404def10e6Smrgfi
1414def10e6SmrgAC_CONFIG_COMMANDS_PRE(
1424def10e6Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1434def10e6Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1444def10e6SmrgUsually this means the macro was only invoked conditionally.]])
1454def10e6Smrgfi])])
146a0d3b6eaSmrg
1474def10e6Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1484def10e6Smrg# Free Software Foundation, Inc.
1494def10e6Smrg#
1504def10e6Smrg# This file is free software; the Free Software Foundation
1514def10e6Smrg# gives unlimited permission to copy and/or distribute it,
1524def10e6Smrg# with or without modifications, as long as this notice is preserved.
153a0d3b6eaSmrg
1544def10e6Smrg# serial 10
155a0d3b6eaSmrg
1564def10e6Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1574def10e6Smrg# written in clear, in which case automake, when reading aclocal.m4,
1584def10e6Smrg# will think it sees a *use*, and therefore will trigger all it's
1594def10e6Smrg# C support machinery.  Also note that it means that autoscan, seeing
1604def10e6Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161a0d3b6eaSmrg
162a0d3b6eaSmrg
1634def10e6Smrg# _AM_DEPENDENCIES(NAME)
1644def10e6Smrg# ----------------------
1654def10e6Smrg# See how the compiler implements dependency checking.
1664def10e6Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1674def10e6Smrg# We try a few techniques and use that to set a single cache variable.
1684def10e6Smrg#
1694def10e6Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1704def10e6Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1714def10e6Smrg# dependency, and given that the user is not expected to run this macro,
1724def10e6Smrg# just rely on AC_PROG_CC.
1734def10e6SmrgAC_DEFUN([_AM_DEPENDENCIES],
1744def10e6Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1754def10e6SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1764def10e6SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1774def10e6SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178a0d3b6eaSmrg
1794def10e6Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1804def10e6Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1814def10e6Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1824def10e6Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1834def10e6Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1844def10e6Smrg                   [depcc="$$1"   am_compiler_list=])
185a0d3b6eaSmrg
1864def10e6SmrgAC_CACHE_CHECK([dependency style of $depcc],
1874def10e6Smrg               [am_cv_$1_dependencies_compiler_type],
1884def10e6Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1894def10e6Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1904def10e6Smrg  # making bogus files that we don't know about and never remove.  For
1914def10e6Smrg  # instance it was reported that on HP-UX the gcc test will end up
1924def10e6Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
1934def10e6Smrg  # in D'.
1944def10e6Smrg  mkdir conftest.dir
1954def10e6Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1964def10e6Smrg  # using a relative directory.
1974def10e6Smrg  cp "$am_depcomp" conftest.dir
1984def10e6Smrg  cd conftest.dir
1994def10e6Smrg  # We will build objects and dependencies in a subdirectory because
2004def10e6Smrg  # it helps to detect inapplicable dependency modes.  For instance
2014def10e6Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2024def10e6Smrg  # side effect of compilation, but ICC will put the dependencies in
2034def10e6Smrg  # the current directory while Tru64 will put them in the object
2044def10e6Smrg  # directory.
2054def10e6Smrg  mkdir sub
206a0d3b6eaSmrg
2074def10e6Smrg  am_cv_$1_dependencies_compiler_type=none
2084def10e6Smrg  if test "$am_compiler_list" = ""; then
2094def10e6Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2104def10e6Smrg  fi
2114def10e6Smrg  am__universal=false
2124def10e6Smrg  m4_case([$1], [CC],
2134def10e6Smrg    [case " $depcc " in #(
2144def10e6Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2154def10e6Smrg     esac],
2164def10e6Smrg    [CXX],
2174def10e6Smrg    [case " $depcc " in #(
2184def10e6Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2194def10e6Smrg     esac])
220a0d3b6eaSmrg
2214def10e6Smrg  for depmode in $am_compiler_list; do
2224def10e6Smrg    # Setup a source with many dependencies, because some compilers
2234def10e6Smrg    # like to wrap large dependency lists on column 80 (with \), and
2244def10e6Smrg    # we should not choose a depcomp mode which is confused by this.
2254def10e6Smrg    #
2264def10e6Smrg    # We need to recreate these files for each test, as the compiler may
2274def10e6Smrg    # overwrite some of them when testing with obscure command lines.
2284def10e6Smrg    # This happens at least with the AIX C compiler.
2294def10e6Smrg    : > sub/conftest.c
2304def10e6Smrg    for i in 1 2 3 4 5 6; do
2314def10e6Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2324def10e6Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2334def10e6Smrg      # Solaris 8's {/usr,}/bin/sh.
2344def10e6Smrg      touch sub/conftst$i.h
2354def10e6Smrg    done
2364def10e6Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237a0d3b6eaSmrg
2384def10e6Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2394def10e6Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2404def10e6Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
2414def10e6Smrg    # versions had trouble with output in subdirs
2424def10e6Smrg    am__obj=sub/conftest.${OBJEXT-o}
2434def10e6Smrg    am__minus_obj="-o $am__obj"
2444def10e6Smrg    case $depmode in
2454def10e6Smrg    gcc)
2464def10e6Smrg      # This depmode causes a compiler race in universal mode.
2474def10e6Smrg      test "$am__universal" = false || continue
2484def10e6Smrg      ;;
2494def10e6Smrg    nosideeffect)
2504def10e6Smrg      # after this tag, mechanisms are not by side-effect, so they'll
2514def10e6Smrg      # only be used when explicitly requested
2524def10e6Smrg      if test "x$enable_dependency_tracking" = xyes; then
2534def10e6Smrg	continue
2544def10e6Smrg      else
2554def10e6Smrg	break
2564def10e6Smrg      fi
2574def10e6Smrg      ;;
2584def10e6Smrg    msvisualcpp | msvcmsys)
2594def10e6Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
2604def10e6Smrg      # not run yet.  These depmodes are late enough in the game, and
2614def10e6Smrg      # so weak that their functioning should not be impacted.
2624def10e6Smrg      am__obj=conftest.${OBJEXT-o}
2634def10e6Smrg      am__minus_obj=
2644def10e6Smrg      ;;
2654def10e6Smrg    none) break ;;
2664def10e6Smrg    esac
2674def10e6Smrg    if depmode=$depmode \
2684def10e6Smrg       source=sub/conftest.c object=$am__obj \
2694def10e6Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2704def10e6Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2714def10e6Smrg         >/dev/null 2>conftest.err &&
2724def10e6Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2734def10e6Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2744def10e6Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2754def10e6Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2764def10e6Smrg      # icc doesn't choke on unknown options, it will just issue warnings
2774def10e6Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
2784def10e6Smrg      # that says an option was ignored or not supported.
2794def10e6Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2804def10e6Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2814def10e6Smrg      # The diagnosis changed in icc 8.0:
2824def10e6Smrg      #   icc: Command line remark: option '-MP' not supported
2834def10e6Smrg      if (grep 'ignoring option' conftest.err ||
2844def10e6Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2854def10e6Smrg        am_cv_$1_dependencies_compiler_type=$depmode
2864def10e6Smrg        break
2874def10e6Smrg      fi
2884def10e6Smrg    fi
2894def10e6Smrg  done
2904def10e6Smrg
2914def10e6Smrg  cd ..
2924def10e6Smrg  rm -rf conftest.dir
293a0d3b6eaSmrgelse
2944def10e6Smrg  am_cv_$1_dependencies_compiler_type=none
295a0d3b6eaSmrgfi
2964def10e6Smrg])
2974def10e6SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2984def10e6SmrgAM_CONDITIONAL([am__fastdep$1], [
2994def10e6Smrg  test "x$enable_dependency_tracking" != xno \
3004def10e6Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3014def10e6Smrg])
302a0d3b6eaSmrg
303a0d3b6eaSmrg
3044def10e6Smrg# AM_SET_DEPDIR
3054def10e6Smrg# -------------
3064def10e6Smrg# Choose a directory name for dependency files.
3074def10e6Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3084def10e6SmrgAC_DEFUN([AM_SET_DEPDIR],
3094def10e6Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3104def10e6SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3114def10e6Smrg])
312a0d3b6eaSmrg
313a0d3b6eaSmrg
3144def10e6Smrg# AM_DEP_TRACK
3154def10e6Smrg# ------------
3164def10e6SmrgAC_DEFUN([AM_DEP_TRACK],
3174def10e6Smrg[AC_ARG_ENABLE(dependency-tracking,
3184def10e6Smrg[  --disable-dependency-tracking  speeds up one-time build
3194def10e6Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3204def10e6Smrgif test "x$enable_dependency_tracking" != xno; then
3214def10e6Smrg  am_depcomp="$ac_aux_dir/depcomp"
3224def10e6Smrg  AMDEPBACKSLASH='\'
323a0d3b6eaSmrgfi
3244def10e6SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3254def10e6SmrgAC_SUBST([AMDEPBACKSLASH])dnl
3264def10e6Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3274def10e6Smrg])
328a0d3b6eaSmrg
3294def10e6Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330a0d3b6eaSmrg
3314def10e6Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
3324def10e6Smrg# Free Software Foundation, Inc.
3334def10e6Smrg#
3344def10e6Smrg# This file is free software; the Free Software Foundation
3354def10e6Smrg# gives unlimited permission to copy and/or distribute it,
3364def10e6Smrg# with or without modifications, as long as this notice is preserved.
337a0d3b6eaSmrg
3384def10e6Smrg#serial 5
339f8a31ee4Smrg
3404def10e6Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3414def10e6Smrg# ------------------------------
3424def10e6SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3434def10e6Smrg[{
3444def10e6Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
3454def10e6Smrg  # are listed without --file.  Let's play safe and only enable the eval
3464def10e6Smrg  # if we detect the quoting.
3474def10e6Smrg  case $CONFIG_FILES in
3484def10e6Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
3494def10e6Smrg  *)   set x $CONFIG_FILES ;;
3504def10e6Smrg  esac
3514def10e6Smrg  shift
3524def10e6Smrg  for mf
3534def10e6Smrg  do
3544def10e6Smrg    # Strip MF so we end up with the name of the file.
3554def10e6Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3564def10e6Smrg    # Check whether this is an Automake generated Makefile or not.
3574def10e6Smrg    # We used to match only the files named `Makefile.in', but
3584def10e6Smrg    # some people rename them; so instead we look at the file content.
3594def10e6Smrg    # Grep'ing the first line is not enough: some people post-process
3604def10e6Smrg    # each Makefile.in and add a new line on top of each file to say so.
3614def10e6Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
3624def10e6Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
3634def10e6Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3644def10e6Smrg      dirpart=`AS_DIRNAME("$mf")`
3654def10e6Smrg    else
3664def10e6Smrg      continue
3674def10e6Smrg    fi
3684def10e6Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
3694def10e6Smrg    # from the Makefile without running `make'.
3704def10e6Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3714def10e6Smrg    test -z "$DEPDIR" && continue
3724def10e6Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3734def10e6Smrg    test -z "am__include" && continue
3744def10e6Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3754def10e6Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
3764def10e6Smrg    U=`sed -n 's/^U = //p' < "$mf"`
3774def10e6Smrg    # Find all dependency output files, they are included files with
3784def10e6Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3794def10e6Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3804def10e6Smrg    # expansion.
3814def10e6Smrg    for file in `sed -n "
3824def10e6Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3834def10e6Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3844def10e6Smrg      # Make sure the directory exists.
3854def10e6Smrg      test -f "$dirpart/$file" && continue
3864def10e6Smrg      fdir=`AS_DIRNAME(["$file"])`
3874def10e6Smrg      AS_MKDIR_P([$dirpart/$fdir])
3884def10e6Smrg      # echo "creating $dirpart/$file"
3894def10e6Smrg      echo '# dummy' > "$dirpart/$file"
3904def10e6Smrg    done
3914def10e6Smrg  done
3924def10e6Smrg}
3934def10e6Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394f8a31ee4Smrg
395a0d3b6eaSmrg
3964def10e6Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3974def10e6Smrg# -----------------------------
3984def10e6Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
399f8a31ee4Smrg#
4004def10e6Smrg# This code is only required when automatic dependency tracking
4014def10e6Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
4024def10e6Smrg# need in order to bootstrap the dependency handling code.
4034def10e6SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4044def10e6Smrg[AC_CONFIG_COMMANDS([depfiles],
4054def10e6Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4064def10e6Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4074def10e6Smrg])
408f8a31ee4Smrg
4094def10e6Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
4104def10e6Smrg# Free Software Foundation, Inc.
411a0d3b6eaSmrg#
4124def10e6Smrg# This file is free software; the Free Software Foundation
4134def10e6Smrg# gives unlimited permission to copy and/or distribute it,
4144def10e6Smrg# with or without modifications, as long as this notice is preserved.
415a0d3b6eaSmrg
4164def10e6Smrg# serial 8
417a0d3b6eaSmrg
4184def10e6Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
4194def10e6SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
420a0d3b6eaSmrg
4214def10e6Smrg# Do all the work for Automake.                             -*- Autoconf -*-
422a0d3b6eaSmrg
4234def10e6Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4244def10e6Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4254def10e6Smrg#
4264def10e6Smrg# This file is free software; the Free Software Foundation
4274def10e6Smrg# gives unlimited permission to copy and/or distribute it,
4284def10e6Smrg# with or without modifications, as long as this notice is preserved.
429a0d3b6eaSmrg
4304def10e6Smrg# serial 16
431a0d3b6eaSmrg
4324def10e6Smrg# This macro actually does too much.  Some checks are only needed if
4334def10e6Smrg# your package does certain things.  But this isn't really a big deal.
434a0d3b6eaSmrg
4354def10e6Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4364def10e6Smrg# AM_INIT_AUTOMAKE([OPTIONS])
4374def10e6Smrg# -----------------------------------------------
4384def10e6Smrg# The call with PACKAGE and VERSION arguments is the old style
4394def10e6Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
4404def10e6Smrg# and VERSION should now be passed to AC_INIT and removed from
4414def10e6Smrg# the call to AM_INIT_AUTOMAKE.
4424def10e6Smrg# We support both call styles for the transition.  After
4434def10e6Smrg# the next Automake release, Autoconf can make the AC_INIT
4444def10e6Smrg# arguments mandatory, and then we can depend on a new Autoconf
4454def10e6Smrg# release and drop the old call support.
4464def10e6SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4474def10e6Smrg[AC_PREREQ([2.62])dnl
4484def10e6Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4494def10e6Smrgdnl the ones we care about.
4504def10e6Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4514def10e6SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4524def10e6SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4534def10e6Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4544def10e6Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4554def10e6Smrg  # is not polluted with repeated "-I."
4564def10e6Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4574def10e6Smrg  # test to see if srcdir already configured
4584def10e6Smrg  if test -f $srcdir/config.status; then
4594def10e6Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4604def10e6Smrg  fi
461a0d3b6eaSmrgfi
462a0d3b6eaSmrg
4634def10e6Smrg# test whether we have cygpath
4644def10e6Smrgif test -z "$CYGPATH_W"; then
4654def10e6Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4664def10e6Smrg    CYGPATH_W='cygpath -w'
4674def10e6Smrg  else
4684def10e6Smrg    CYGPATH_W=echo
4694def10e6Smrg  fi
4704def10e6Smrgfi
4714def10e6SmrgAC_SUBST([CYGPATH_W])
472a0d3b6eaSmrg
4734def10e6Smrg# Define the identity of the package.
4744def10e6Smrgdnl Distinguish between old-style and new-style calls.
4754def10e6Smrgm4_ifval([$2],
4764def10e6Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4774def10e6Smrg AC_SUBST([PACKAGE], [$1])dnl
4784def10e6Smrg AC_SUBST([VERSION], [$2])],
4794def10e6Smrg[_AM_SET_OPTIONS([$1])dnl
4804def10e6Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4814def10e6Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4824def10e6Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4834def10e6Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4844def10e6Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
485a0d3b6eaSmrg
4864def10e6Smrg_AM_IF_OPTION([no-define],,
4874def10e6Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4884def10e6Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489a0d3b6eaSmrg
4904def10e6Smrg# Some tools Automake needs.
4914def10e6SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4924def10e6SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4934def10e6SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4944def10e6SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4954def10e6SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4964def10e6SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4974def10e6SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4984def10e6SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4994def10e6SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
5004def10e6SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
5014def10e6Smrg# We need awk for the "check" target.  The system "awk" is bad on
5024def10e6Smrg# some platforms.
5034def10e6SmrgAC_REQUIRE([AC_PROG_AWK])dnl
5044def10e6SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
5054def10e6SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
5064def10e6Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
5074def10e6Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
5084def10e6Smrg			     [_AM_PROG_TAR([v7])])])
5094def10e6Smrg_AM_IF_OPTION([no-dependencies],,
5104def10e6Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
5114def10e6Smrg		  [_AM_DEPENDENCIES(CC)],
5124def10e6Smrg		  [define([AC_PROG_CC],
5134def10e6Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
5144def10e6SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5154def10e6Smrg		  [_AM_DEPENDENCIES(CXX)],
5164def10e6Smrg		  [define([AC_PROG_CXX],
5174def10e6Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5184def10e6SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5194def10e6Smrg		  [_AM_DEPENDENCIES(OBJC)],
5204def10e6Smrg		  [define([AC_PROG_OBJC],
5214def10e6Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
5224def10e6Smrg])
5234def10e6Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5244def10e6Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5254def10e6Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5264def10e6Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5274def10e6SmrgAC_CONFIG_COMMANDS_PRE(dnl
5284def10e6Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5294def10e6Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5304def10e6Smrg])
531f8a31ee4Smrg
5324def10e6Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5334def10e6Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5344def10e6Smrgdnl mangled by Autoconf and run in a shell conditional statement.
5354def10e6Smrgm4_define([_AC_COMPILER_EXEEXT],
5364def10e6Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537a0d3b6eaSmrg
538a0d3b6eaSmrg
5394def10e6Smrg# When config.status generates a header, we must update the stamp-h file.
5404def10e6Smrg# This file resides in the same directory as the config header
5414def10e6Smrg# that is generated.  The stamp files are numbered to have different names.
542a0d3b6eaSmrg
5434def10e6Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
5444def10e6Smrg# loop where config.status creates the headers, so we can generate
5454def10e6Smrg# our stamp files there.
5464def10e6SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
5474def10e6Smrg[# Compute $1's index in $config_headers.
5484def10e6Smrg_am_arg=$1
5494def10e6Smrg_am_stamp_count=1
5504def10e6Smrgfor _am_header in $config_headers :; do
5514def10e6Smrg  case $_am_header in
5524def10e6Smrg    $_am_arg | $_am_arg:* )
5534def10e6Smrg      break ;;
5544def10e6Smrg    * )
5554def10e6Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5564def10e6Smrg  esac
5574def10e6Smrgdone
5584def10e6Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
559a0d3b6eaSmrg
5604def10e6Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
5614def10e6Smrg#
5624def10e6Smrg# This file is free software; the Free Software Foundation
5634def10e6Smrg# gives unlimited permission to copy and/or distribute it,
5644def10e6Smrg# with or without modifications, as long as this notice is preserved.
565a0d3b6eaSmrg
5664def10e6Smrg# AM_PROG_INSTALL_SH
5674def10e6Smrg# ------------------
5684def10e6Smrg# Define $install_sh.
5694def10e6SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5704def10e6Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5714def10e6Smrgif test x"${install_sh}" != xset; then
5724def10e6Smrg  case $am_aux_dir in
5734def10e6Smrg  *\ * | *\	*)
5744def10e6Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5754def10e6Smrg  *)
5764def10e6Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5774def10e6Smrg  esac
578a0d3b6eaSmrgfi
5794def10e6SmrgAC_SUBST(install_sh)])
580a0d3b6eaSmrg
5814def10e6Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
582f8a31ee4Smrg#
5834def10e6Smrg# This file is free software; the Free Software Foundation
5844def10e6Smrg# gives unlimited permission to copy and/or distribute it,
5854def10e6Smrg# with or without modifications, as long as this notice is preserved.
586f8a31ee4Smrg
5874def10e6Smrg# serial 2
5884def10e6Smrg
5894def10e6Smrg# Check whether the underlying file-system supports filenames
5904def10e6Smrg# with a leading dot.  For instance MS-DOS doesn't.
5914def10e6SmrgAC_DEFUN([AM_SET_LEADING_DOT],
5924def10e6Smrg[rm -rf .tst 2>/dev/null
5934def10e6Smrgmkdir .tst 2>/dev/null
5944def10e6Smrgif test -d .tst; then
5954def10e6Smrg  am__leading_dot=.
596f8a31ee4Smrgelse
5974def10e6Smrg  am__leading_dot=_
598f8a31ee4Smrgfi
5994def10e6Smrgrmdir .tst 2>/dev/null
6004def10e6SmrgAC_SUBST([am__leading_dot])])
601f8a31ee4Smrg
6024def10e6Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
6034def10e6Smrg# From Jim Meyering
604f8a31ee4Smrg
6054def10e6Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
6064def10e6Smrg# Free Software Foundation, Inc.
607f8a31ee4Smrg#
6084def10e6Smrg# This file is free software; the Free Software Foundation
6094def10e6Smrg# gives unlimited permission to copy and/or distribute it,
6104def10e6Smrg# with or without modifications, as long as this notice is preserved.
6114def10e6Smrg
6124def10e6Smrg# serial 5
6134def10e6Smrg
6144def10e6Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6154def10e6Smrg# ----------------------------------
6164def10e6Smrg# Control maintainer-specific portions of Makefiles.
6174def10e6Smrg# Default is to disable them, unless `enable' is passed literally.
6184def10e6Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6194def10e6Smrg# can override the default with the --enable/--disable switch.
6204def10e6SmrgAC_DEFUN([AM_MAINTAINER_MODE],
6214def10e6Smrg[m4_case(m4_default([$1], [disable]),
6224def10e6Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
6234def10e6Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
6244def10e6Smrg       [m4_define([am_maintainer_other], [enable])
6254def10e6Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6264def10e6SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6274def10e6Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6284def10e6Smrg  AC_ARG_ENABLE([maintainer-mode],
6294def10e6Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
6304def10e6Smrg			  (and sometimes confusing) to the casual installer],
6314def10e6Smrg      [USE_MAINTAINER_MODE=$enableval],
6324def10e6Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
6334def10e6Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6344def10e6Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
6354def10e6Smrg  MAINT=$MAINTAINER_MODE_TRUE
6364def10e6Smrg  AC_SUBST([MAINT])dnl
6374def10e6Smrg]
6384def10e6Smrg)
6394def10e6Smrg
6404def10e6SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
6414def10e6Smrg
6424def10e6Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6434def10e6Smrg
6444def10e6Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
645f8a31ee4Smrg#
6464def10e6Smrg# This file is free software; the Free Software Foundation
6474def10e6Smrg# gives unlimited permission to copy and/or distribute it,
6484def10e6Smrg# with or without modifications, as long as this notice is preserved.
649f8a31ee4Smrg
6504def10e6Smrg# serial 4
6514def10e6Smrg
6524def10e6Smrg# AM_MAKE_INCLUDE()
6534def10e6Smrg# -----------------
6544def10e6Smrg# Check to see how make treats includes.
6554def10e6SmrgAC_DEFUN([AM_MAKE_INCLUDE],
6564def10e6Smrg[am_make=${MAKE-make}
6574def10e6Smrgcat > confinc << 'END'
6584def10e6Smrgam__doit:
6594def10e6Smrg	@echo this is the am__doit target
6604def10e6Smrg.PHONY: am__doit
6614def10e6SmrgEND
6624def10e6Smrg# If we don't find an include directive, just comment out the code.
6634def10e6SmrgAC_MSG_CHECKING([for style of include used by $am_make])
6644def10e6Smrgam__include="#"
6654def10e6Smrgam__quote=
6664def10e6Smrg_am_result=none
6674def10e6Smrg# First try GNU make style include.
6684def10e6Smrgecho "include confinc" > confmf
6694def10e6Smrg# Ignore all kinds of additional output from `make'.
6704def10e6Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6714def10e6Smrg*the\ am__doit\ target*)
6724def10e6Smrg  am__include=include
6734def10e6Smrg  am__quote=
6744def10e6Smrg  _am_result=GNU
6754def10e6Smrg  ;;
6764def10e6Smrgesac
6774def10e6Smrg# Now try BSD make style include.
6784def10e6Smrgif test "$am__include" = "#"; then
6794def10e6Smrg   echo '.include "confinc"' > confmf
6804def10e6Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6814def10e6Smrg   *the\ am__doit\ target*)
6824def10e6Smrg     am__include=.include
6834def10e6Smrg     am__quote="\""
6844def10e6Smrg     _am_result=BSD
6854def10e6Smrg     ;;
6864def10e6Smrg   esac
687f8a31ee4Smrgfi
6884def10e6SmrgAC_SUBST([am__include])
6894def10e6SmrgAC_SUBST([am__quote])
6904def10e6SmrgAC_MSG_RESULT([$_am_result])
6914def10e6Smrgrm -f confinc confmf
6924def10e6Smrg])
693f8a31ee4Smrg
6944def10e6Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6954def10e6Smrg
6964def10e6Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
6974def10e6Smrg# Free Software Foundation, Inc.
698f8a31ee4Smrg#
6994def10e6Smrg# This file is free software; the Free Software Foundation
7004def10e6Smrg# gives unlimited permission to copy and/or distribute it,
7014def10e6Smrg# with or without modifications, as long as this notice is preserved.
702f8a31ee4Smrg
7034def10e6Smrg# serial 6
7044def10e6Smrg
7054def10e6Smrg# AM_MISSING_PROG(NAME, PROGRAM)
7064def10e6Smrg# ------------------------------
7074def10e6SmrgAC_DEFUN([AM_MISSING_PROG],
7084def10e6Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
7094def10e6Smrg$1=${$1-"${am_missing_run}$2"}
7104def10e6SmrgAC_SUBST($1)])
7114def10e6Smrg
7124def10e6Smrg
7134def10e6Smrg# AM_MISSING_HAS_RUN
7144def10e6Smrg# ------------------
7154def10e6Smrg# Define MISSING if not defined so far and test if it supports --run.
7164def10e6Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
7174def10e6SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7184def10e6Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7194def10e6SmrgAC_REQUIRE_AUX_FILE([missing])dnl
7204def10e6Smrgif test x"${MISSING+set}" != xset; then
7214def10e6Smrg  case $am_aux_dir in
7224def10e6Smrg  *\ * | *\	*)
7234def10e6Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7244def10e6Smrg  *)
7254def10e6Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7264def10e6Smrg  esac
7274def10e6Smrgfi
7284def10e6Smrg# Use eval to expand $SHELL
7294def10e6Smrgif eval "$MISSING --run true"; then
7304def10e6Smrg  am_missing_run="$MISSING --run "
731f8a31ee4Smrgelse
7324def10e6Smrg  am_missing_run=
7334def10e6Smrg  AC_MSG_WARN([`missing' script is too old or missing])
734f8a31ee4Smrgfi
7354def10e6Smrg])
736f8a31ee4Smrg
7374def10e6Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
738f8a31ee4Smrg#
7394def10e6Smrg# This file is free software; the Free Software Foundation
7404def10e6Smrg# gives unlimited permission to copy and/or distribute it,
7414def10e6Smrg# with or without modifications, as long as this notice is preserved.
7424def10e6Smrg
7434def10e6Smrg# AM_PROG_MKDIR_P
7444def10e6Smrg# ---------------
7454def10e6Smrg# Check for `mkdir -p'.
7464def10e6SmrgAC_DEFUN([AM_PROG_MKDIR_P],
7474def10e6Smrg[AC_PREREQ([2.60])dnl
7484def10e6SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7494def10e6Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7504def10e6Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
7514def10e6Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7524def10e6Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7534def10e6Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7544def10e6Smrgdnl adjustment using top_builddir (which is defined more often than
7554def10e6Smrgdnl MKDIR_P).
7564def10e6SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7574def10e6Smrgcase $mkdir_p in
7584def10e6Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7594def10e6Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7604def10e6Smrgesac
7614def10e6Smrg])
7624def10e6Smrg
7634def10e6Smrg# Helper functions for option handling.                     -*- Autoconf -*-
7644def10e6Smrg
7654def10e6Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
766f8a31ee4Smrg#
7674def10e6Smrg# This file is free software; the Free Software Foundation
7684def10e6Smrg# gives unlimited permission to copy and/or distribute it,
7694def10e6Smrg# with or without modifications, as long as this notice is preserved.
770f8a31ee4Smrg
7714def10e6Smrg# serial 4
772f8a31ee4Smrg
7734def10e6Smrg# _AM_MANGLE_OPTION(NAME)
7744def10e6Smrg# -----------------------
7754def10e6SmrgAC_DEFUN([_AM_MANGLE_OPTION],
7764def10e6Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
777f8a31ee4Smrg
7784def10e6Smrg# _AM_SET_OPTION(NAME)
7794def10e6Smrg# ------------------------------
7804def10e6Smrg# Set option NAME.  Presently that only means defining a flag for this option.
7814def10e6SmrgAC_DEFUN([_AM_SET_OPTION],
7824def10e6Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
783f8a31ee4Smrg
7844def10e6Smrg# _AM_SET_OPTIONS(OPTIONS)
7854def10e6Smrg# ----------------------------------
7864def10e6Smrg# OPTIONS is a space-separated list of Automake options.
7874def10e6SmrgAC_DEFUN([_AM_SET_OPTIONS],
7884def10e6Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
789f8a31ee4Smrg
7904def10e6Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7914def10e6Smrg# -------------------------------------------
7924def10e6Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7934def10e6SmrgAC_DEFUN([_AM_IF_OPTION],
7944def10e6Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
795f8a31ee4Smrg
7964def10e6Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
797f8a31ee4Smrg
7984def10e6Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
7994def10e6Smrg# Free Software Foundation, Inc.
800f8a31ee4Smrg#
8014def10e6Smrg# This file is free software; the Free Software Foundation
8024def10e6Smrg# gives unlimited permission to copy and/or distribute it,
8034def10e6Smrg# with or without modifications, as long as this notice is preserved.
804f8a31ee4Smrg
8054def10e6Smrg# serial 5
8064def10e6Smrg
8074def10e6Smrg# AM_SANITY_CHECK
8084def10e6Smrg# ---------------
8094def10e6SmrgAC_DEFUN([AM_SANITY_CHECK],
8104def10e6Smrg[AC_MSG_CHECKING([whether build environment is sane])
8114def10e6Smrg# Just in case
8124def10e6Smrgsleep 1
8134def10e6Smrgecho timestamp > conftest.file
8144def10e6Smrg# Reject unsafe characters in $srcdir or the absolute working directory
8154def10e6Smrg# name.  Accept space and tab only in the latter.
8164def10e6Smrgam_lf='
8174def10e6Smrg'
8184def10e6Smrgcase `pwd` in
8194def10e6Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8204def10e6Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8214def10e6Smrgesac
8224def10e6Smrgcase $srcdir in
8234def10e6Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8244def10e6Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8254def10e6Smrgesac
8264def10e6Smrg
8274def10e6Smrg# Do `set' in a subshell so we don't clobber the current shell's
8284def10e6Smrg# arguments.  Must try -L first in case configure is actually a
8294def10e6Smrg# symlink; some systems play weird games with the mod time of symlinks
8304def10e6Smrg# (eg FreeBSD returns the mod time of the symlink's containing
8314def10e6Smrg# directory).
8324def10e6Smrgif (
8334def10e6Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8344def10e6Smrg   if test "$[*]" = "X"; then
8354def10e6Smrg      # -L didn't work.
8364def10e6Smrg      set X `ls -t "$srcdir/configure" conftest.file`
837f8a31ee4Smrg   fi
8384def10e6Smrg   rm -f conftest.file
8394def10e6Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
8404def10e6Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8414def10e6Smrg
8424def10e6Smrg      # If neither matched, then we have a broken ls.  This can happen
8434def10e6Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
8444def10e6Smrg      # broken ls alias from the environment.  This has actually
8454def10e6Smrg      # happened.  Such a system could not be considered "sane".
8464def10e6Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8474def10e6Smrgalias in your environment])
848f8a31ee4Smrg   fi
8494def10e6Smrg
8504def10e6Smrg   test "$[2]" = conftest.file
8514def10e6Smrg   )
8524def10e6Smrgthen
8534def10e6Smrg   # Ok.
8544def10e6Smrg   :
855f8a31ee4Smrgelse
8564def10e6Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
8574def10e6SmrgCheck your system clock])
858f8a31ee4Smrgfi
8594def10e6SmrgAC_MSG_RESULT(yes)])
860f8a31ee4Smrg
8614def10e6Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
862f8a31ee4Smrg#
8634def10e6Smrg# This file is free software; the Free Software Foundation
8644def10e6Smrg# gives unlimited permission to copy and/or distribute it,
8654def10e6Smrg# with or without modifications, as long as this notice is preserved.
866f8a31ee4Smrg
8674def10e6Smrg# serial 1
868f8a31ee4Smrg
8694def10e6Smrg# AM_SILENT_RULES([DEFAULT])
8704def10e6Smrg# --------------------------
8714def10e6Smrg# Enable less verbose build rules; with the default set to DEFAULT
8724def10e6Smrg# (`yes' being less verbose, `no' or empty being verbose).
8734def10e6SmrgAC_DEFUN([AM_SILENT_RULES],
8744def10e6Smrg[AC_ARG_ENABLE([silent-rules],
8754def10e6Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8764def10e6Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8774def10e6Smrgcase $enable_silent_rules in
8784def10e6Smrgyes) AM_DEFAULT_VERBOSITY=0;;
8794def10e6Smrgno)  AM_DEFAULT_VERBOSITY=1;;
8804def10e6Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8814def10e6Smrgesac
8824def10e6SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8834def10e6SmrgAM_BACKSLASH='\'
8844def10e6SmrgAC_SUBST([AM_BACKSLASH])dnl
8854def10e6Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8864def10e6Smrg])
887f8a31ee4Smrg
8884def10e6Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
889a0d3b6eaSmrg#
8904def10e6Smrg# This file is free software; the Free Software Foundation
8914def10e6Smrg# gives unlimited permission to copy and/or distribute it,
8924def10e6Smrg# with or without modifications, as long as this notice is preserved.
893a0d3b6eaSmrg
8944def10e6Smrg# AM_PROG_INSTALL_STRIP
8954def10e6Smrg# ---------------------
8964def10e6Smrg# One issue with vendor `install' (even GNU) is that you can't
8974def10e6Smrg# specify the program used to strip binaries.  This is especially
8984def10e6Smrg# annoying in cross-compiling environments, where the build's strip
8994def10e6Smrg# is unlikely to handle the host's binaries.
9004def10e6Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9014def10e6Smrg# always use install-sh in `make install-strip', and initialize
9024def10e6Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
9034def10e6SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
9044def10e6Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9054def10e6Smrg# Installed binaries are usually stripped using `strip' when the user
9064def10e6Smrg# run `make install-strip'.  However `strip' might not be the right
9074def10e6Smrg# tool to use in cross-compilation environments, therefore Automake
9084def10e6Smrg# will honor the `STRIP' environment variable to overrule this program.
9094def10e6Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
9104def10e6Smrgif test "$cross_compiling" != no; then
9114def10e6Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
912a0d3b6eaSmrgfi
9134def10e6SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9144def10e6SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
915a0d3b6eaSmrg
9164def10e6Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
917a0d3b6eaSmrg#
9184def10e6Smrg# This file is free software; the Free Software Foundation
9194def10e6Smrg# gives unlimited permission to copy and/or distribute it,
9204def10e6Smrg# with or without modifications, as long as this notice is preserved.
921a0d3b6eaSmrg
9224def10e6Smrg# serial 2
923f8a31ee4Smrg
9244def10e6Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
9254def10e6Smrg# ---------------------------
9264def10e6Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9274def10e6Smrg# This macro is traced by Automake.
9284def10e6SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
929f8a31ee4Smrg
9304def10e6Smrg# AM_SUBST_NOTMAKE(VARIABLE)
9314def10e6Smrg# ---------------------------
9324def10e6Smrg# Public sister of _AM_SUBST_NOTMAKE.
9334def10e6SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
934f8a31ee4Smrg
9354def10e6Smrg# Check how to create a tarball.                            -*- Autoconf -*-
936a0d3b6eaSmrg
9374def10e6Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9384def10e6Smrg#
9394def10e6Smrg# This file is free software; the Free Software Foundation
9404def10e6Smrg# gives unlimited permission to copy and/or distribute it,
9414def10e6Smrg# with or without modifications, as long as this notice is preserved.
942a0d3b6eaSmrg
9434def10e6Smrg# serial 2
944a0d3b6eaSmrg
9454def10e6Smrg# _AM_PROG_TAR(FORMAT)
9464def10e6Smrg# --------------------
9474def10e6Smrg# Check how to create a tarball in format FORMAT.
9484def10e6Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
949a0d3b6eaSmrg#
9504def10e6Smrg# Substitute a variable $(am__tar) that is a command
9514def10e6Smrg# writing to stdout a FORMAT-tarball containing the directory
9524def10e6Smrg# $tardir.
9534def10e6Smrg#     tardir=directory && $(am__tar) > result.tar
954f8a31ee4Smrg#
9554def10e6Smrg# Substitute a variable $(am__untar) that extract such
9564def10e6Smrg# a tarball read from stdin.
9574def10e6Smrg#     $(am__untar) < result.tar
9584def10e6SmrgAC_DEFUN([_AM_PROG_TAR],
9594def10e6Smrg[# Always define AMTAR for backward compatibility.
9604def10e6SmrgAM_MISSING_PROG([AMTAR], [tar])
9614def10e6Smrgm4_if([$1], [v7],
9624def10e6Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
9634def10e6Smrg     [m4_case([$1], [ustar],, [pax],,
9644def10e6Smrg              [m4_fatal([Unknown tar format])])
9654def10e6SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
9664def10e6Smrg# Loop over all known methods to create a tar archive until one works.
9674def10e6Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9684def10e6Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
9694def10e6Smrg# Do not fold the above two line into one, because Tru64 sh and
9704def10e6Smrg# Solaris sh will not grok spaces in the rhs of `-'.
9714def10e6Smrgfor _am_tool in $_am_tools
9724def10e6Smrgdo
9734def10e6Smrg  case $_am_tool in
9744def10e6Smrg  gnutar)
9754def10e6Smrg    for _am_tar in tar gnutar gtar;
9764def10e6Smrg    do
9774def10e6Smrg      AM_RUN_LOG([$_am_tar --version]) && break
9784def10e6Smrg    done
9794def10e6Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9804def10e6Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9814def10e6Smrg    am__untar="$_am_tar -xf -"
9824def10e6Smrg    ;;
9834def10e6Smrg  plaintar)
9844def10e6Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
9854def10e6Smrg    # ustar tarball either.
9864def10e6Smrg    (tar --version) >/dev/null 2>&1 && continue
9874def10e6Smrg    am__tar='tar chf - "$$tardir"'
9884def10e6Smrg    am__tar_='tar chf - "$tardir"'
9894def10e6Smrg    am__untar='tar xf -'
9904def10e6Smrg    ;;
9914def10e6Smrg  pax)
9924def10e6Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
9934def10e6Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
9944def10e6Smrg    am__untar='pax -r'
9954def10e6Smrg    ;;
9964def10e6Smrg  cpio)
9974def10e6Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9984def10e6Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9994def10e6Smrg    am__untar='cpio -i -H $1 -d'
10004def10e6Smrg    ;;
10014def10e6Smrg  none)
10024def10e6Smrg    am__tar=false
10034def10e6Smrg    am__tar_=false
10044def10e6Smrg    am__untar=false
10054def10e6Smrg    ;;
10064def10e6Smrg  esac
1007a0d3b6eaSmrg
10084def10e6Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
10094def10e6Smrg  # and am__untar set.
10104def10e6Smrg  test -n "${am_cv_prog_tar_$1}" && break
1011f8a31ee4Smrg
10124def10e6Smrg  # tar/untar a dummy directory, and stop if the command works
10134def10e6Smrg  rm -rf conftest.dir
10144def10e6Smrg  mkdir conftest.dir
10154def10e6Smrg  echo GrepMe > conftest.dir/file
10164def10e6Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10174def10e6Smrg  rm -rf conftest.dir
10184def10e6Smrg  if test -s conftest.tar; then
10194def10e6Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
10204def10e6Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
10214def10e6Smrg  fi
10224def10e6Smrgdone
10234def10e6Smrgrm -rf conftest.dir
1024f8a31ee4Smrg
10254def10e6SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10264def10e6SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
10274def10e6SmrgAC_SUBST([am__tar])
10284def10e6SmrgAC_SUBST([am__untar])
10294def10e6Smrg]) # _AM_PROG_TAR
1030a0d3b6eaSmrg
10314def10e6Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10324def10e6Smrgdnl
10334def10e6Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
10344def10e6Smrgdnl 
10354def10e6Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10364def10e6Smrgdnl copy of this software and associated documentation files (the "Software"),
10374def10e6Smrgdnl to deal in the Software without restriction, including without limitation
10384def10e6Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
10394def10e6Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
10404def10e6Smrgdnl Software is furnished to do so, subject to the following conditions:
10414def10e6Smrgdnl
10424def10e6Smrgdnl The above copyright notice and this permission notice (including the next
10434def10e6Smrgdnl paragraph) shall be included in all copies or substantial portions of the
10444def10e6Smrgdnl Software.
10454def10e6Smrgdnl
10464def10e6Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10474def10e6Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10484def10e6Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
10494def10e6Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10504def10e6Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
10514def10e6Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
10524def10e6Smrgdnl DEALINGS IN THE SOFTWARE.
1053a0d3b6eaSmrg
10544def10e6Smrg# XORG_MACROS_VERSION(required-version)
10554def10e6Smrg# -------------------------------------
10564def10e6Smrg# Minimum version: 1.1.0
1057f8a31ee4Smrg#
10584def10e6Smrg# If you're using a macro added in Version 1.1 or newer, include this in
10594def10e6Smrg# your configure.ac with the minimum required version, such as:
10604def10e6Smrg# XORG_MACROS_VERSION(1.1)
1061f8a31ee4Smrg#
10624def10e6Smrg# To ensure that this macro is defined, also add:
10634def10e6Smrg# m4_ifndef([XORG_MACROS_VERSION],
10644def10e6Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10654def10e6Smrg#
10664def10e6Smrg#
10674def10e6Smrg# See the "minimum version" comment for each macro you use to see what 
10684def10e6Smrg# version you require.
10694def10e6Smrgm4_defun([XORG_MACROS_VERSION],[
10704def10e6Smrgm4_define([vers_have], [1.11.0])
10714def10e6Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10724def10e6Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10734def10e6Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
10744def10e6Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
10754def10e6Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
10764def10e6Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
10774def10e6Smrgm4_undefine([vers_have])
10784def10e6Smrgm4_undefine([maj_have])
10794def10e6Smrgm4_undefine([maj_needed])
10804def10e6Smrg]) # XORG_MACROS_VERSION
1081f8a31ee4Smrg
10824def10e6Smrg# XORG_PROG_RAWCPP()
10834def10e6Smrg# ------------------
10844def10e6Smrg# Minimum version: 1.0.0
1085f8a31ee4Smrg#
10864def10e6Smrg# Find cpp program and necessary flags for use in pre-processing text files
10874def10e6Smrg# such as man pages and config files
10884def10e6SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
10894def10e6SmrgAC_REQUIRE([AC_PROG_CPP])
10904def10e6SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
10914def10e6Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1092f8a31ee4Smrg
10934def10e6Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
10944def10e6Smrg# which is not the best choice for supporting other OS'es, but covers most
10954def10e6Smrg# of the ones we need for now.
10964def10e6SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
10974def10e6SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
10984def10e6Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10994def10e6Smrg	AC_MSG_RESULT([no])
11004def10e6Smrgelse
11014def10e6Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11024def10e6Smrg		RAWCPPFLAGS=-undef
11034def10e6Smrg		AC_MSG_RESULT([yes])
11044def10e6Smrg	# under Cygwin unix is still defined even with -undef
11054def10e6Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11064def10e6Smrg		RAWCPPFLAGS="-undef -ansi"
11074def10e6Smrg		AC_MSG_RESULT([yes, with -ansi])
11084def10e6Smrg	else
11094def10e6Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1110f8a31ee4Smrg	fi
1111f8a31ee4Smrgfi
11124def10e6Smrgrm -f conftest.$ac_ext
1113f8a31ee4Smrg
11144def10e6SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
11154def10e6SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
11164def10e6Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11174def10e6Smrg	AC_MSG_RESULT([no])
11184def10e6Smrgelse
11194def10e6Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11204def10e6Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
11214def10e6Smrg		AC_MSG_RESULT([yes])
11224def10e6Smrg	else
11234def10e6Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
11244def10e6Smrg	fi
11254def10e6Smrgfi
11264def10e6Smrgrm -f conftest.$ac_ext
11274def10e6SmrgAC_SUBST(RAWCPPFLAGS)
11284def10e6Smrg]) # XORG_PROG_RAWCPP
11294def10e6Smrg
11304def10e6Smrg# XORG_MANPAGE_SECTIONS()
11314def10e6Smrg# -----------------------
11324def10e6Smrg# Minimum version: 1.0.0
1133f8a31ee4Smrg#
11344def10e6Smrg# Determine which sections man pages go in for the different man page types
11354def10e6Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
11364def10e6Smrg# Not sure if there's any better way than just hardcoding by OS name.
11374def10e6Smrg# Override default settings by setting environment variables
11384def10e6Smrg# Added MAN_SUBSTS in version 1.8
11394def10e6Smrg# Added AC_PROG_SED in version 1.8
1140f8a31ee4Smrg
11414def10e6SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
11424def10e6SmrgAC_REQUIRE([AC_CANONICAL_HOST])
11434def10e6SmrgAC_REQUIRE([AC_PROG_SED])
1144f8a31ee4Smrg
11454def10e6Smrgif test x$APP_MAN_SUFFIX = x    ; then
11464def10e6Smrg    APP_MAN_SUFFIX=1
11474def10e6Smrgfi
11484def10e6Smrgif test x$APP_MAN_DIR = x    ; then
11494def10e6Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
11504def10e6Smrgfi
1151f8a31ee4Smrg
11524def10e6Smrgif test x$LIB_MAN_SUFFIX = x    ; then
11534def10e6Smrg    LIB_MAN_SUFFIX=3
11544def10e6Smrgfi
11554def10e6Smrgif test x$LIB_MAN_DIR = x    ; then
11564def10e6Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
11574def10e6Smrgfi
1158a0d3b6eaSmrg
11594def10e6Smrgif test x$FILE_MAN_SUFFIX = x    ; then
11604def10e6Smrg    case $host_os in
11614def10e6Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
11624def10e6Smrg	*)		FILE_MAN_SUFFIX=5  ;;
11634def10e6Smrg    esac
11644def10e6Smrgfi
11654def10e6Smrgif test x$FILE_MAN_DIR = x    ; then
11664def10e6Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
11674def10e6Smrgfi
1168a0d3b6eaSmrg
11694def10e6Smrgif test x$MISC_MAN_SUFFIX = x    ; then
11704def10e6Smrg    case $host_os in
11714def10e6Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
11724def10e6Smrg	*)		MISC_MAN_SUFFIX=7  ;;
11734def10e6Smrg    esac
11744def10e6Smrgfi
11754def10e6Smrgif test x$MISC_MAN_DIR = x    ; then
11764def10e6Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
11774def10e6Smrgfi
1178a0d3b6eaSmrg
11794def10e6Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
11804def10e6Smrg    case $host_os in
11814def10e6Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
11824def10e6Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
11834def10e6Smrg    esac
11844def10e6Smrgfi
11854def10e6Smrgif test x$DRIVER_MAN_DIR = x    ; then
11864def10e6Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
11874def10e6Smrgfi
1188a0d3b6eaSmrg
11894def10e6Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
11904def10e6Smrg    case $host_os in
11914def10e6Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
11924def10e6Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
11934def10e6Smrg    esac
11944def10e6Smrgfi
11954def10e6Smrgif test x$ADMIN_MAN_DIR = x    ; then
11964def10e6Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
11974def10e6Smrgfi
1198a0d3b6eaSmrg
1199a0d3b6eaSmrg
12004def10e6SmrgAC_SUBST([APP_MAN_SUFFIX])
12014def10e6SmrgAC_SUBST([LIB_MAN_SUFFIX])
12024def10e6SmrgAC_SUBST([FILE_MAN_SUFFIX])
12034def10e6SmrgAC_SUBST([MISC_MAN_SUFFIX])
12044def10e6SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
12054def10e6SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
12064def10e6SmrgAC_SUBST([APP_MAN_DIR])
12074def10e6SmrgAC_SUBST([LIB_MAN_DIR])
12084def10e6SmrgAC_SUBST([FILE_MAN_DIR])
12094def10e6SmrgAC_SUBST([MISC_MAN_DIR])
12104def10e6SmrgAC_SUBST([DRIVER_MAN_DIR])
12114def10e6SmrgAC_SUBST([ADMIN_MAN_DIR])
1212a0d3b6eaSmrg
12134def10e6SmrgXORG_MAN_PAGE="X Version 11"
12144def10e6SmrgAC_SUBST([XORG_MAN_PAGE])
12154def10e6SmrgMAN_SUBSTS="\
12164def10e6Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12174def10e6Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12184def10e6Smrg	-e 's|__xservername__|Xorg|g' \
12194def10e6Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
12204def10e6Smrg	-e 's|__projectroot__|\$(prefix)|g' \
12214def10e6Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
12224def10e6Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
12234def10e6Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
12244def10e6Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
12254def10e6Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
12264def10e6Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
12274def10e6Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
12284def10e6SmrgAC_SUBST([MAN_SUBSTS])
1229a0d3b6eaSmrg
12304def10e6Smrg]) # XORG_MANPAGE_SECTIONS
1231a0d3b6eaSmrg
12324def10e6Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
12334def10e6Smrg# ------------------------
12344def10e6Smrg# Minimum version: 1.7.0
1235a0d3b6eaSmrg#
12364def10e6Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
12374def10e6Smrg# provided by xorg-sgml-doctools, if installed.
12384def10e6SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
12394def10e6SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
12404def10e6SmrgXORG_SGML_PATH=
12414def10e6SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
12424def10e6Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
12434def10e6Smrg    [m4_ifval([$1],[:],
12444def10e6Smrg        [if test x"$cross_compiling" != x"yes" ; then
12454def10e6Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
12464def10e6Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
12474def10e6Smrg         fi])
12484def10e6Smrg    ])
1249a0d3b6eaSmrg
12504def10e6Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
12514def10e6Smrg# the path and the name of the doc stylesheet
12524def10e6Smrgif test "x$XORG_SGML_PATH" != "x" ; then
12534def10e6Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
12544def10e6Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
12554def10e6Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1256a0d3b6eaSmrgelse
12574def10e6Smrg   AC_MSG_RESULT([no])
1258a0d3b6eaSmrgfi
1259a0d3b6eaSmrg
12604def10e6SmrgAC_SUBST(XORG_SGML_PATH)
12614def10e6SmrgAC_SUBST(STYLESHEET_SRCDIR)
12624def10e6SmrgAC_SUBST(XSL_STYLESHEET)
12634def10e6SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
12644def10e6Smrg]) # XORG_CHECK_SGML_DOCTOOLS
1265a0d3b6eaSmrg
12664def10e6Smrg# XORG_CHECK_LINUXDOC
12674def10e6Smrg# -------------------
12684def10e6Smrg# Minimum version: 1.0.0
1269a0d3b6eaSmrg#
12704def10e6Smrg# Defines the variable MAKE_TEXT if the necessary tools and
12714def10e6Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
12724def10e6Smrg# Whether or not the necessary tools and files are found can be checked
12734def10e6Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
12744def10e6SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12754def10e6SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
12764def10e6SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1277f8a31ee4Smrg
12784def10e6SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1279a0d3b6eaSmrg
12804def10e6SmrgAC_MSG_CHECKING([whether to build documentation])
1281a0d3b6eaSmrg
12824def10e6Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
12834def10e6Smrg   BUILDDOC=yes
1284a0d3b6eaSmrgelse
12854def10e6Smrg   BUILDDOC=no
1286a0d3b6eaSmrgfi
1287a0d3b6eaSmrg
12884def10e6SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1289a0d3b6eaSmrg
12904def10e6SmrgAC_MSG_RESULT([$BUILDDOC])
1291a0d3b6eaSmrg
12924def10e6SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1293a0d3b6eaSmrg
12944def10e6Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
12954def10e6Smrg   BUILDPDFDOC=yes
12964def10e6Smrgelse
12974def10e6Smrg   BUILDPDFDOC=no
1298a0d3b6eaSmrgfi
1299a0d3b6eaSmrg
13004def10e6SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1301a0d3b6eaSmrg
13024def10e6SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1303a0d3b6eaSmrg
13044def10e6SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
13054def10e6SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
13064def10e6SmrgMAKE_PDF="$PS2PDF"
13074def10e6SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1308a0d3b6eaSmrg
13094def10e6SmrgAC_SUBST(MAKE_TEXT)
13104def10e6SmrgAC_SUBST(MAKE_PS)
13114def10e6SmrgAC_SUBST(MAKE_PDF)
13124def10e6SmrgAC_SUBST(MAKE_HTML)
13134def10e6Smrg]) # XORG_CHECK_LINUXDOC
1314a0d3b6eaSmrg
13154def10e6Smrg# XORG_CHECK_DOCBOOK
13164def10e6Smrg# -------------------
13174def10e6Smrg# Minimum version: 1.0.0
1318a0d3b6eaSmrg#
13194def10e6Smrg# Checks for the ability to build output formats from SGML DocBook source.
13204def10e6Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
13214def10e6Smrg# indicates whether the necessary tools and files are found and, if set,
13224def10e6Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
13234def10e6SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
13244def10e6SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1325a0d3b6eaSmrg
13264def10e6SmrgBUILDTXTDOC=no
13274def10e6SmrgBUILDPDFDOC=no
13284def10e6SmrgBUILDPSDOC=no
13294def10e6SmrgBUILDHTMLDOC=no
1330a0d3b6eaSmrg
13314def10e6SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
13324def10e6SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
13334def10e6SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
13344def10e6SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1335a0d3b6eaSmrg
13364def10e6SmrgAC_MSG_CHECKING([whether to build text documentation])
13374def10e6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
13384def10e6Smrg   test x$BUILD_TXTDOC != xno; then
13394def10e6Smrg	BUILDTXTDOC=yes
13404def10e6Smrgfi
13414def10e6SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
13424def10e6SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1343a0d3b6eaSmrg
13444def10e6SmrgAC_MSG_CHECKING([whether to build PDF documentation])
13454def10e6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
13464def10e6Smrg   test x$BUILD_PDFDOC != xno; then
13474def10e6Smrg	BUILDPDFDOC=yes
13484def10e6Smrgfi
13494def10e6SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13504def10e6SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1351a0d3b6eaSmrg
13524def10e6SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
13534def10e6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
13544def10e6Smrg   test x$BUILD_PSDOC != xno; then
13554def10e6Smrg	BUILDPSDOC=yes
13564def10e6Smrgfi
13574def10e6SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
13584def10e6SmrgAC_MSG_RESULT([$BUILDPSDOC])
1359a0d3b6eaSmrg
13604def10e6SmrgAC_MSG_CHECKING([whether to build HTML documentation])
13614def10e6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
13624def10e6Smrg   test x$BUILD_HTMLDOC != xno; then
13634def10e6Smrg	BUILDHTMLDOC=yes
13644def10e6Smrgfi
13654def10e6SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
13664def10e6SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1367a0d3b6eaSmrg
13684def10e6SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
13694def10e6SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
13704def10e6SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
13714def10e6SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1372a0d3b6eaSmrg
13734def10e6SmrgAC_SUBST(MAKE_TEXT)
13744def10e6SmrgAC_SUBST(MAKE_PS)
13754def10e6SmrgAC_SUBST(MAKE_PDF)
13764def10e6SmrgAC_SUBST(MAKE_HTML)
13774def10e6Smrg]) # XORG_CHECK_DOCBOOK
13784def10e6Smrg
13794def10e6Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
13804def10e6Smrg# ----------------
13814def10e6Smrg# Minimum version: 1.5.0
13824def10e6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
13834def10e6Smrg#
13844def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
13854def10e6Smrg# not at the appropriate level. This macro enables a module to test for the
13864def10e6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
13874def10e6Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
13884def10e6Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
13894def10e6Smrg# --with-xmlto assumes 'auto'.
13904def10e6Smrg#
13914def10e6Smrg# Interface to module:
13924def10e6Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
13934def10e6Smrg# XMLTO:	returns the path of the xmlto program found
13944def10e6Smrg#		returns the path set by the user in the environment
13954def10e6Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
13964def10e6Smrg#		'no' user instructs the module not to use xmlto
13974def10e6Smrg#
13984def10e6Smrg# Added in version 1.10.0
13994def10e6Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
14004def10e6Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
14014def10e6Smrg#
14024def10e6Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
14034def10e6Smrg#
14044def10e6SmrgAC_DEFUN([XORG_WITH_XMLTO],[
14054def10e6SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
14064def10e6Smrgm4_define([_defopt], m4_default([$2], [auto]))
14074def10e6SmrgAC_ARG_WITH(xmlto,
14084def10e6Smrg	AS_HELP_STRING([--with-xmlto],
14094def10e6Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
14104def10e6Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
14114def10e6Smrgm4_undefine([_defopt])
14124def10e6Smrg
14134def10e6Smrgif test "x$use_xmlto" = x"auto"; then
14144def10e6Smrg   AC_PATH_PROG([XMLTO], [xmlto])
14154def10e6Smrg   if test "x$XMLTO" = "x"; then
14164def10e6Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
14174def10e6Smrg	have_xmlto=no
14184def10e6Smrg   else
14194def10e6Smrg        have_xmlto=yes
14204def10e6Smrg   fi
14214def10e6Smrgelif test "x$use_xmlto" = x"yes" ; then
14224def10e6Smrg   AC_PATH_PROG([XMLTO], [xmlto])
14234def10e6Smrg   if test "x$XMLTO" = "x"; then
14244def10e6Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
14254def10e6Smrg   fi
14264def10e6Smrg   have_xmlto=yes
14274def10e6Smrgelif test "x$use_xmlto" = x"no" ; then
14284def10e6Smrg   if test "x$XMLTO" != "x"; then
14294def10e6Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
14304def10e6Smrg   fi
14314def10e6Smrg   have_xmlto=no
14324def10e6Smrgelse
14334def10e6Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1434a0d3b6eaSmrgfi
1435a0d3b6eaSmrg
14364def10e6Smrg# Test for a minimum version of xmlto, if provided.
14374def10e6Smrgm4_ifval([$1],
14384def10e6Smrg[if test "$have_xmlto" = yes; then
14394def10e6Smrg    # scrape the xmlto version
14404def10e6Smrg    AC_MSG_CHECKING([the xmlto version])
14414def10e6Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
14424def10e6Smrg    AC_MSG_RESULT([$xmlto_version])
14434def10e6Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
14444def10e6Smrg        [if test "x$use_xmlto" = xauto; then
14454def10e6Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
14464def10e6Smrg            have_xmlto=no
14474def10e6Smrg        else
14484def10e6Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
14494def10e6Smrg        fi])
14504def10e6Smrgfi])
14514def10e6Smrg
14524def10e6Smrg# Test for the ability of xmlto to generate a text target
14534def10e6Smrghave_xmlto_text=no
14544def10e6Smrgcat > conftest.xml << "EOF"
14554def10e6SmrgEOF
14564def10e6SmrgAS_IF([test "$have_xmlto" = yes],
14574def10e6Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
14584def10e6Smrg             [have_xmlto_text=yes],
14594def10e6Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
14604def10e6Smrgrm -f conftest.xml
14614def10e6SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
14624def10e6SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
14634def10e6Smrg]) # XORG_WITH_XMLTO
14644def10e6Smrg
14654def10e6Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
14664def10e6Smrg# ----------------
14674def10e6Smrg# Minimum version: 1.5.0
14684def10e6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
14694def10e6Smrg#
14704def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
14714def10e6Smrg# not at the appropriate level. This macro enables a module to test for the
14724def10e6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
14734def10e6Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
14744def10e6Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
14754def10e6Smrg# --with-asciidoc assumes 'auto'.
14764def10e6Smrg#
14774def10e6Smrg# Interface to module:
14784def10e6Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
14794def10e6Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
14804def10e6Smrg#		 returns the path set by the user in the environment
14814def10e6Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
14824def10e6Smrg#		  'no' user instructs the module not to use asciidoc
14834def10e6Smrg#
14844def10e6Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
14854def10e6Smrg#
14864def10e6SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
14874def10e6SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
14884def10e6Smrgm4_define([_defopt], m4_default([$2], [auto]))
14894def10e6SmrgAC_ARG_WITH(asciidoc,
14904def10e6Smrg	AS_HELP_STRING([--with-asciidoc],
14914def10e6Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
14924def10e6Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
14934def10e6Smrgm4_undefine([_defopt])
14944def10e6Smrg
14954def10e6Smrgif test "x$use_asciidoc" = x"auto"; then
14964def10e6Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
14974def10e6Smrg   if test "x$ASCIIDOC" = "x"; then
14984def10e6Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
14994def10e6Smrg	have_asciidoc=no
15004def10e6Smrg   else
15014def10e6Smrg        have_asciidoc=yes
15024def10e6Smrg   fi
15034def10e6Smrgelif test "x$use_asciidoc" = x"yes" ; then
15044def10e6Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
15054def10e6Smrg   if test "x$ASCIIDOC" = "x"; then
15064def10e6Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
15074def10e6Smrg   fi
15084def10e6Smrg   have_asciidoc=yes
15094def10e6Smrgelif test "x$use_asciidoc" = x"no" ; then
15104def10e6Smrg   if test "x$ASCIIDOC" != "x"; then
15114def10e6Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
15124def10e6Smrg   fi
15134def10e6Smrg   have_asciidoc=no
15144def10e6Smrgelse
15154def10e6Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1516a0d3b6eaSmrgfi
15174def10e6Smrgm4_ifval([$1],
15184def10e6Smrg[if test "$have_asciidoc" = yes; then
15194def10e6Smrg    # scrape the asciidoc version
15204def10e6Smrg    AC_MSG_CHECKING([the asciidoc version])
15214def10e6Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
15224def10e6Smrg    AC_MSG_RESULT([$asciidoc_version])
15234def10e6Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
15244def10e6Smrg        [if test "x$use_asciidoc" = xauto; then
15254def10e6Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
15264def10e6Smrg            have_asciidoc=no
15274def10e6Smrg        else
15284def10e6Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
15294def10e6Smrg        fi])
15304def10e6Smrgfi])
15314def10e6SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
15324def10e6Smrg]) # XORG_WITH_ASCIIDOC
1533a0d3b6eaSmrg
15344def10e6Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
15354def10e6Smrg# --------------------------------
15364def10e6Smrg# Minimum version: 1.5.0
15374def10e6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
15384def10e6Smrg#
15394def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
15404def10e6Smrg# not at the appropriate level. This macro enables a module to test for the
15414def10e6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
15424def10e6Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
15434def10e6Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
15444def10e6Smrg# --with-doxygen assumes 'auto'.
15454def10e6Smrg#
15464def10e6Smrg# Interface to module:
15474def10e6Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
15484def10e6Smrg# DOXYGEN:	 returns the path of the doxygen program found
15494def10e6Smrg#		 returns the path set by the user in the environment
15504def10e6Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
15514def10e6Smrg#		  'no' user instructs the module not to use doxygen
15524def10e6Smrg#
15534def10e6Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
15544def10e6Smrg#
15554def10e6SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
15564def10e6SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
15574def10e6Smrgm4_define([_defopt], m4_default([$2], [auto]))
15584def10e6SmrgAC_ARG_WITH(doxygen,
15594def10e6Smrg	AS_HELP_STRING([--with-doxygen],
15604def10e6Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
15614def10e6Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
15624def10e6Smrgm4_undefine([_defopt])
1563a0d3b6eaSmrg
15644def10e6Smrgif test "x$use_doxygen" = x"auto"; then
15654def10e6Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15664def10e6Smrg   if test "x$DOXYGEN" = "x"; then
15674def10e6Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
15684def10e6Smrg	have_doxygen=no
15694def10e6Smrg   else
15704def10e6Smrg        have_doxygen=yes
15714def10e6Smrg   fi
15724def10e6Smrgelif test "x$use_doxygen" = x"yes" ; then
15734def10e6Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15744def10e6Smrg   if test "x$DOXYGEN" = "x"; then
15754def10e6Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
15764def10e6Smrg   fi
15774def10e6Smrg   have_doxygen=yes
15784def10e6Smrgelif test "x$use_doxygen" = x"no" ; then
15794def10e6Smrg   if test "x$DOXYGEN" != "x"; then
15804def10e6Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
15814def10e6Smrg   fi
15824def10e6Smrg   have_doxygen=no
15834def10e6Smrgelse
15844def10e6Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
15854def10e6Smrgfi
15864def10e6Smrgm4_ifval([$1],
15874def10e6Smrg[if test "$have_doxygen" = yes; then
15884def10e6Smrg    # scrape the doxygen version
15894def10e6Smrg    AC_MSG_CHECKING([the doxygen version])
15904def10e6Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
15914def10e6Smrg    AC_MSG_RESULT([$doxygen_version])
15924def10e6Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
15934def10e6Smrg        [if test "x$use_doxygen" = xauto; then
15944def10e6Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
15954def10e6Smrg            have_doxygen=no
15964def10e6Smrg        else
15974def10e6Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
15984def10e6Smrg        fi])
15994def10e6Smrgfi])
16004def10e6SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
16014def10e6Smrg]) # XORG_WITH_DOXYGEN
1602a0d3b6eaSmrg
16034def10e6Smrg# XORG_WITH_GROFF([DEFAULT])
16044def10e6Smrg# ----------------
16054def10e6Smrg# Minimum version: 1.6.0
16064def10e6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
16074def10e6Smrg#
16084def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
16094def10e6Smrg# not at the appropriate level. This macro enables a module to test for the
16104def10e6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
16114def10e6Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
16124def10e6Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
16134def10e6Smrg# --with-groff assumes 'auto'.
16144def10e6Smrg#
16154def10e6Smrg# Interface to module:
16164def10e6Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
16174def10e6Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
16184def10e6Smrg# HAVE_GROFF_MS: the -ms macros package
16194def10e6Smrg# GROFF:	 returns the path of the groff program found
16204def10e6Smrg#		 returns the path set by the user in the environment
16214def10e6Smrg# --with-groff:	 'yes' user instructs the module to use groff
16224def10e6Smrg#		 'no' user instructs the module not to use groff
16234def10e6Smrg#
16244def10e6Smrg# Added in version 1.9.0:
16254def10e6Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
16264def10e6Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
16274def10e6Smrg#		   psselect from the psutils package.
16284def10e6Smrg#		   the ghostcript package. Refer to the grohtml man pages
16294def10e6Smrg#
16304def10e6Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
16314def10e6Smrg#
16324def10e6Smrg# OS and distros often splits groff in a basic and full package, the former
16334def10e6Smrg# having the groff program and the later having devices, fonts and macros
16344def10e6Smrg# Checking for the groff executable is not enough.
16354def10e6Smrg#
16364def10e6Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
16374def10e6Smrg# unset HAVE_GROFF or GROFF env variables.
16384def10e6Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
16394def10e6Smrg#
16404def10e6SmrgAC_DEFUN([XORG_WITH_GROFF],[
16414def10e6SmrgAC_ARG_VAR([GROFF], [Path to groff command])
16424def10e6Smrgm4_define([_defopt], m4_default([$1], [auto]))
16434def10e6SmrgAC_ARG_WITH(groff,
16444def10e6Smrg	AS_HELP_STRING([--with-groff],
16454def10e6Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
16464def10e6Smrg	   [use_groff=$withval], [use_groff=]_defopt)
16474def10e6Smrgm4_undefine([_defopt])
1648a0d3b6eaSmrg
16494def10e6Smrgif test "x$use_groff" = x"auto"; then
16504def10e6Smrg   AC_PATH_PROG([GROFF], [groff])
16514def10e6Smrg   if test "x$GROFF" = "x"; then
16524def10e6Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
16534def10e6Smrg	have_groff=no
16544def10e6Smrg   else
16554def10e6Smrg        have_groff=yes
16564def10e6Smrg   fi
16574def10e6Smrgelif test "x$use_groff" = x"yes" ; then
16584def10e6Smrg   AC_PATH_PROG([GROFF], [groff])
16594def10e6Smrg   if test "x$GROFF" = "x"; then
16604def10e6Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
16614def10e6Smrg   fi
16624def10e6Smrg   have_groff=yes
16634def10e6Smrgelif test "x$use_groff" = x"no" ; then
16644def10e6Smrg   if test "x$GROFF" != "x"; then
16654def10e6Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
16664def10e6Smrg   fi
16674def10e6Smrg   have_groff=no
16684def10e6Smrgelse
16694def10e6Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
16704def10e6Smrgfi
1671f8a31ee4Smrg
16724def10e6Smrg# We have groff, test for the presence of the macro packages
16734def10e6Smrgif test "x$have_groff" = x"yes"; then
16744def10e6Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
16754def10e6Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
16764def10e6Smrg        groff_ms_works=yes
16774def10e6Smrg    else
16784def10e6Smrg        groff_ms_works=no
16794def10e6Smrg    fi
16804def10e6Smrg    AC_MSG_RESULT([$groff_ms_works])
16814def10e6Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
16824def10e6Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
16834def10e6Smrg        groff_mm_works=yes
16844def10e6Smrg    else
16854def10e6Smrg        groff_mm_works=no
16864def10e6Smrg    fi
16874def10e6Smrg    AC_MSG_RESULT([$groff_mm_works])
16884def10e6Smrgfi
1689a0d3b6eaSmrg
16904def10e6Smrg# We have groff, test for HTML dependencies, one command per package
16914def10e6Smrgif test "x$have_groff" = x"yes"; then
16924def10e6Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
16934def10e6Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
16944def10e6Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
16954def10e6Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
16964def10e6Smrg      have_groff_html=yes
16974def10e6Smrg   else
16984def10e6Smrg      have_groff_html=no
16994def10e6Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
17004def10e6Smrg   fi
17014def10e6Smrgfi
1702a0d3b6eaSmrg
17034def10e6Smrg# Set Automake conditionals for Makefiles
17044def10e6SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
17054def10e6SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
17064def10e6SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
17074def10e6SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
17084def10e6Smrg]) # XORG_WITH_GROFF
1709a0d3b6eaSmrg
17104def10e6Smrg# XORG_WITH_FOP([DEFAULT])
17114def10e6Smrg# ----------------
17124def10e6Smrg# Minimum version: 1.6.0
17134def10e6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1714a0d3b6eaSmrg#
17154def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
17164def10e6Smrg# not at the appropriate level. This macro enables a module to test for the
17174def10e6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
17184def10e6Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
17194def10e6Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
17204def10e6Smrg# --with-fop assumes 'auto'.
17214def10e6Smrg#
17224def10e6Smrg# Interface to module:
17234def10e6Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
17244def10e6Smrg# FOP:	 	returns the path of the fop program found
17254def10e6Smrg#		returns the path set by the user in the environment
17264def10e6Smrg# --with-fop: 	'yes' user instructs the module to use fop
17274def10e6Smrg#		'no' user instructs the module not to use fop
17284def10e6Smrg#
17294def10e6Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
17304def10e6Smrg#
17314def10e6SmrgAC_DEFUN([XORG_WITH_FOP],[
17324def10e6SmrgAC_ARG_VAR([FOP], [Path to fop command])
17334def10e6Smrgm4_define([_defopt], m4_default([$1], [auto]))
17344def10e6SmrgAC_ARG_WITH(fop,
17354def10e6Smrg	AS_HELP_STRING([--with-fop],
17364def10e6Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
17374def10e6Smrg	   [use_fop=$withval], [use_fop=]_defopt)
17384def10e6Smrgm4_undefine([_defopt])
1739a0d3b6eaSmrg
17404def10e6Smrgif test "x$use_fop" = x"auto"; then
17414def10e6Smrg   AC_PATH_PROG([FOP], [fop])
17424def10e6Smrg   if test "x$FOP" = "x"; then
17434def10e6Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
17444def10e6Smrg	have_fop=no
17454def10e6Smrg   else
17464def10e6Smrg        have_fop=yes
17474def10e6Smrg   fi
17484def10e6Smrgelif test "x$use_fop" = x"yes" ; then
17494def10e6Smrg   AC_PATH_PROG([FOP], [fop])
17504def10e6Smrg   if test "x$FOP" = "x"; then
17514def10e6Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
17524def10e6Smrg   fi
17534def10e6Smrg   have_fop=yes
17544def10e6Smrgelif test "x$use_fop" = x"no" ; then
17554def10e6Smrg   if test "x$FOP" != "x"; then
17564def10e6Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
17574def10e6Smrg   fi
17584def10e6Smrg   have_fop=no
17594def10e6Smrgelse
17604def10e6Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1761f8a31ee4Smrgfi
17624def10e6SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
17634def10e6Smrg]) # XORG_WITH_FOP
1764a0d3b6eaSmrg
17654def10e6Smrg# XORG_WITH_PS2PDF([DEFAULT])
17664def10e6Smrg# ----------------
17674def10e6Smrg# Minimum version: 1.6.0
17684def10e6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1769a0d3b6eaSmrg#
17704def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
17714def10e6Smrg# not at the appropriate level. This macro enables a module to test for the
17724def10e6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
17734def10e6Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
17744def10e6Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
17754def10e6Smrg# --with-ps2pdf assumes 'auto'.
17764def10e6Smrg#
17774def10e6Smrg# Interface to module:
17784def10e6Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
17794def10e6Smrg# PS2PDF:	returns the path of the ps2pdf program found
17804def10e6Smrg#		returns the path set by the user in the environment
17814def10e6Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
17824def10e6Smrg#		 'no' user instructs the module not to use ps2pdf
17834def10e6Smrg#
17844def10e6Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
17854def10e6Smrg#
17864def10e6SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
17874def10e6SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
17884def10e6Smrgm4_define([_defopt], m4_default([$1], [auto]))
17894def10e6SmrgAC_ARG_WITH(ps2pdf,
17904def10e6Smrg	AS_HELP_STRING([--with-ps2pdf],
17914def10e6Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
17924def10e6Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
17934def10e6Smrgm4_undefine([_defopt])
1794a0d3b6eaSmrg
17954def10e6Smrgif test "x$use_ps2pdf" = x"auto"; then
17964def10e6Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
17974def10e6Smrg   if test "x$PS2PDF" = "x"; then
17984def10e6Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
17994def10e6Smrg	have_ps2pdf=no
18004def10e6Smrg   else
18014def10e6Smrg        have_ps2pdf=yes
18024def10e6Smrg   fi
18034def10e6Smrgelif test "x$use_ps2pdf" = x"yes" ; then
18044def10e6Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
18054def10e6Smrg   if test "x$PS2PDF" = "x"; then
18064def10e6Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
18074def10e6Smrg   fi
18084def10e6Smrg   have_ps2pdf=yes
18094def10e6Smrgelif test "x$use_ps2pdf" = x"no" ; then
18104def10e6Smrg   if test "x$PS2PDF" != "x"; then
18114def10e6Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
18124def10e6Smrg   fi
18134def10e6Smrg   have_ps2pdf=no
1814a0d3b6eaSmrgelse
18154def10e6Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1816a0d3b6eaSmrgfi
18174def10e6SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
18184def10e6Smrg]) # XORG_WITH_PS2PDF
1819a0d3b6eaSmrg
18204def10e6Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
18214def10e6Smrg# ----------------
18224def10e6Smrg# Minimum version: 1.6.0
1823a0d3b6eaSmrg#
18244def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
18254def10e6Smrg# not at the appropriate level. This macro enables a builder to skip all
18264def10e6Smrg# documentation targets except traditional man pages.
18274def10e6Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18284def10e6Smrg# maximum flexibilty in controlling documentation building.
18294def10e6Smrg# Refer to:
18304def10e6Smrg# XORG_WITH_XMLTO         --with-xmlto
18314def10e6Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18324def10e6Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18334def10e6Smrg# XORG_WITH_FOP           --with-fop
18344def10e6Smrg# XORG_WITH_GROFF         --with-groff
18354def10e6Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18364def10e6Smrg#
18374def10e6Smrg# Interface to module:
18384def10e6Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
18394def10e6Smrg# --enable-docs: 'yes' user instructs the module to generate docs
18404def10e6Smrg#		 'no' user instructs the module not to generate docs
18414def10e6Smrg# parm1:	specify the default value, yes or no.
18424def10e6Smrg#
18434def10e6SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
18444def10e6Smrgm4_define([default], m4_default([$1], [yes]))
18454def10e6SmrgAC_ARG_ENABLE(docs,
18464def10e6Smrg	AS_HELP_STRING([--enable-docs],
18474def10e6Smrg	   [Enable building the documentation (default: ]default[)]),
18484def10e6Smrg	   [build_docs=$enableval], [build_docs=]default)
18494def10e6Smrgm4_undefine([default])
18504def10e6SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
18514def10e6SmrgAC_MSG_CHECKING([whether to build documentation])
18524def10e6SmrgAC_MSG_RESULT([$build_docs])
18534def10e6Smrg]) # XORG_ENABLE_DOCS
1854a0d3b6eaSmrg
18554def10e6Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
18564def10e6Smrg# ----------------
18574def10e6Smrg# Minimum version: 1.6.0
18584def10e6Smrg#
18594def10e6Smrg# This macro enables a builder to skip all developer documentation.
18604def10e6Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18614def10e6Smrg# maximum flexibilty in controlling documentation building.
18624def10e6Smrg# Refer to:
18634def10e6Smrg# XORG_WITH_XMLTO         --with-xmlto
18644def10e6Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18654def10e6Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18664def10e6Smrg# XORG_WITH_FOP           --with-fop
18674def10e6Smrg# XORG_WITH_GROFF         --with-groff
18684def10e6Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18694def10e6Smrg#
18704def10e6Smrg# Interface to module:
18714def10e6Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
18724def10e6Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
18734def10e6Smrg#			'no' user instructs the module not to generate developer docs
18744def10e6Smrg# parm1:		specify the default value, yes or no.
18754def10e6Smrg#
18764def10e6SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
18774def10e6Smrgm4_define([devel_default], m4_default([$1], [yes]))
18784def10e6SmrgAC_ARG_ENABLE(devel-docs,
18794def10e6Smrg	AS_HELP_STRING([--enable-devel-docs],
18804def10e6Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
18814def10e6Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
18824def10e6Smrgm4_undefine([devel_default])
18834def10e6SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
18844def10e6SmrgAC_MSG_CHECKING([whether to build developer documentation])
18854def10e6SmrgAC_MSG_RESULT([$build_devel_docs])
18864def10e6Smrg]) # XORG_ENABLE_DEVEL_DOCS
1887a0d3b6eaSmrg
18884def10e6Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
18894def10e6Smrg# ----------------
18904def10e6Smrg# Minimum version: 1.6.0
18914def10e6Smrg#
18924def10e6Smrg# This macro enables a builder to skip all functional specification targets.
18934def10e6Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18944def10e6Smrg# maximum flexibilty in controlling documentation building.
18954def10e6Smrg# Refer to:
18964def10e6Smrg# XORG_WITH_XMLTO         --with-xmlto
18974def10e6Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18984def10e6Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18994def10e6Smrg# XORG_WITH_FOP           --with-fop
19004def10e6Smrg# XORG_WITH_GROFF         --with-groff
19014def10e6Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
19024def10e6Smrg#
19034def10e6Smrg# Interface to module:
19044def10e6Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
19054def10e6Smrg# --enable-specs:	'yes' user instructs the module to generate specs
19064def10e6Smrg#			'no' user instructs the module not to generate specs
19074def10e6Smrg# parm1:		specify the default value, yes or no.
19084def10e6Smrg#
19094def10e6SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
19104def10e6Smrgm4_define([spec_default], m4_default([$1], [yes]))
19114def10e6SmrgAC_ARG_ENABLE(specs,
19124def10e6Smrg	AS_HELP_STRING([--enable-specs],
19134def10e6Smrg	   [Enable building the specs (default: ]spec_default[)]),
19144def10e6Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
19154def10e6Smrgm4_undefine([spec_default])
19164def10e6SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
19174def10e6SmrgAC_MSG_CHECKING([whether to build functional specifications])
19184def10e6SmrgAC_MSG_RESULT([$build_specs])
19194def10e6Smrg]) # XORG_ENABLE_SPECS
1920a0d3b6eaSmrg
19214def10e6Smrg# XORG_CHECK_MALLOC_ZERO
19224def10e6Smrg# ----------------------
19234def10e6Smrg# Minimum version: 1.0.0
1924a0d3b6eaSmrg#
19254def10e6Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
19264def10e6Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
19274def10e6Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
19284def10e6SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
19294def10e6SmrgAC_ARG_ENABLE(malloc0returnsnull,
19304def10e6Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
19314def10e6Smrg		       [malloc(0) returns NULL (default: auto)]),
19324def10e6Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
19334def10e6Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1934a0d3b6eaSmrg
19354def10e6SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
19364def10e6Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
19374def10e6Smrg	AC_RUN_IFELSE([
19384def10e6Smrgchar *malloc();
19394def10e6Smrgchar *realloc();
19404def10e6Smrgchar *calloc();
19414def10e6Smrgmain() {
19424def10e6Smrg    char *m0, *r0, *c0, *p;
19434def10e6Smrg    m0 = malloc(0);
19444def10e6Smrg    p = malloc(10);
19454def10e6Smrg    r0 = realloc(p,0);
19464def10e6Smrg    c0 = calloc(0);
19474def10e6Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
19484def10e6Smrg}],
19494def10e6Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
19504def10e6Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
19514def10e6Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
19524def10e6Smrgfi
19534def10e6SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1954a0d3b6eaSmrg
19554def10e6Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
19564def10e6Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
19574def10e6Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
19584def10e6Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
19594def10e6Smrgelse
19604def10e6Smrg	MALLOC_ZERO_CFLAGS=""
19614def10e6Smrg	XMALLOC_ZERO_CFLAGS=""
19624def10e6Smrg	XTMALLOC_ZERO_CFLAGS=""
1963a0d3b6eaSmrgfi
1964a0d3b6eaSmrg
19654def10e6SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
19664def10e6SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
19674def10e6SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
19684def10e6Smrg]) # XORG_CHECK_MALLOC_ZERO
1969a0d3b6eaSmrg
19704def10e6Smrg# XORG_WITH_LINT()
19714def10e6Smrg# ----------------
19724def10e6Smrg# Minimum version: 1.1.0
1973a0d3b6eaSmrg#
19744def10e6Smrg# This macro enables the use of a tool that flags some suspicious and
19754def10e6Smrg# non-portable constructs (likely to be bugs) in C language source code.
19764def10e6Smrg# It will attempt to locate the tool and use appropriate options.
19774def10e6Smrg# There are various lint type tools on different platforms.
19784def10e6Smrg#
19794def10e6Smrg# Interface to module:
19804def10e6Smrg# LINT:		returns the path to the tool found on the platform
19814def10e6Smrg#		or the value set to LINT on the configure cmd line
19824def10e6Smrg#		also an Automake conditional
19834def10e6Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
19844def10e6Smrg#
19854def10e6Smrg# --with-lint:	'yes' user instructs the module to use lint
19864def10e6Smrg#		'no' user instructs the module not to use lint (default)
19874def10e6Smrg#
19884def10e6Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
19894def10e6Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
19904def10e6Smrg#
19914def10e6SmrgAC_DEFUN([XORG_WITH_LINT],[
1992a0d3b6eaSmrg
19934def10e6SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
19944def10e6SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
19954def10e6SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
19964def10e6Smrg		[Use a lint-style source code checker (default: disabled)])],
19974def10e6Smrg		[use_lint=$withval], [use_lint=no])
1998a0d3b6eaSmrg
19994def10e6Smrg# Obtain platform specific info like program name and options
20004def10e6Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
20014def10e6Smrgcase $host_os in
20024def10e6Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
20034def10e6Smrg	lint_name=splint
20044def10e6Smrg	lint_options="-badflag"
20054def10e6Smrg	;;
20064def10e6Smrg  *freebsd* | *netbsd*)
20074def10e6Smrg	lint_name=lint
20084def10e6Smrg	lint_options="-u -b"
20094def10e6Smrg	;;
20104def10e6Smrg  *solaris*)
20114def10e6Smrg	lint_name=lint
20124def10e6Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
20134def10e6Smrg	;;
20144def10e6Smrgesac
2015a0d3b6eaSmrg
20164def10e6Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
20174def10e6Smrgif test "x$use_lint" = x"yes" ; then
20184def10e6Smrg   AC_PATH_PROG([LINT], [$lint_name])
20194def10e6Smrg   if test "x$LINT" = "x"; then
20204def10e6Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
20214def10e6Smrg   fi
20224def10e6Smrgelif test "x$use_lint" = x"no" ; then
20234def10e6Smrg   if test "x$LINT" != "x"; then
20244def10e6Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
20254def10e6Smrg   fi
2026a0d3b6eaSmrgelse
20274def10e6Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2028a0d3b6eaSmrgfi
2029a0d3b6eaSmrg
20304def10e6Smrg# User supplied flags override default flags
20314def10e6Smrgif test "x$LINT_FLAGS" != "x"; then
20324def10e6Smrg   lint_options=$LINT_FLAGS
20334def10e6Smrgfi
2034a0d3b6eaSmrg
20354def10e6SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
20364def10e6SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2037a0d3b6eaSmrg
20384def10e6Smrg]) # XORG_WITH_LINT
2039a0d3b6eaSmrg
20404def10e6Smrg# XORG_LINT_LIBRARY(LIBNAME)
20414def10e6Smrg# --------------------------
20424def10e6Smrg# Minimum version: 1.1.0
2043a0d3b6eaSmrg#
20444def10e6Smrg# Sets up flags for building lint libraries for checking programs that call
20454def10e6Smrg# functions in the library.
20464def10e6Smrg#
20474def10e6Smrg# Interface to module:
20484def10e6Smrg# LINTLIB		- Automake variable with the name of lint library file to make
20494def10e6Smrg# MAKE_LINT_LIB		- Automake conditional
20504def10e6Smrg#
20514def10e6Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
20524def10e6Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2053a0d3b6eaSmrg
20544def10e6SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
20554def10e6SmrgAC_REQUIRE([XORG_WITH_LINT])
20564def10e6SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
20574def10e6Smrg	[Create lint library (default: disabled)])],
20584def10e6Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2059a0d3b6eaSmrg
20604def10e6Smrgif test "x$make_lint_lib" = x"yes" ; then
20614def10e6Smrg   LINTLIB=llib-l$1.ln
20624def10e6Smrg   if test "x$LINT" = "x"; then
20634def10e6Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
20644def10e6Smrg   fi
20654def10e6Smrgelif test "x$make_lint_lib" != x"no" ; then
20664def10e6Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
20674def10e6Smrgfi
2068a0d3b6eaSmrg
20694def10e6SmrgAC_SUBST(LINTLIB)
20704def10e6SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2071a0d3b6eaSmrg
20724def10e6Smrg]) # XORG_LINT_LIBRARY
2073a0d3b6eaSmrg
20744def10e6Smrg# XORG_CWARNFLAGS
20754def10e6Smrg# ---------------
20764def10e6Smrg# Minimum version: 1.2.0
20774def10e6Smrg#
20784def10e6Smrg# Defines CWARNFLAGS to enable C compiler warnings.
20794def10e6Smrg#
20804def10e6SmrgAC_DEFUN([XORG_CWARNFLAGS], [
20814def10e6SmrgAC_REQUIRE([AC_PROG_CC_C99])
20824def10e6Smrgif  test "x$GCC" = xyes ; then
20834def10e6Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
20844def10e6Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
20854def10e6Smrg-Wbad-function-cast -Wformat=2"
20864def10e6Smrg    case `$CC -dumpversion` in
20874def10e6Smrg    3.4.* | 4.*)
20884def10e6Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
20894def10e6Smrg	;;
20904def10e6Smrg    esac
20914def10e6Smrgelse
20924def10e6Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
20934def10e6Smrg    if test "x$SUNCC" = "xyes"; then
20944def10e6Smrg	CWARNFLAGS="-v"
20954def10e6Smrg    fi
20964def10e6Smrgfi
20974def10e6SmrgAC_SUBST(CWARNFLAGS)
20984def10e6Smrg]) # XORG_CWARNFLAGS
2099a0d3b6eaSmrg
21004def10e6Smrg# XORG_STRICT_OPTION
21014def10e6Smrg# -----------------------
21024def10e6Smrg# Minimum version: 1.3.0
2103a0d3b6eaSmrg#
21044def10e6Smrg# Add configure option to enable strict compilation
21054def10e6SmrgAC_DEFUN([XORG_STRICT_OPTION], [
21064def10e6Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
21074def10e6SmrgAC_REQUIRE([AC_PROG_CC_C99])
21084def10e6SmrgAC_REQUIRE([XORG_CWARNFLAGS])
2109a0d3b6eaSmrg
21104def10e6SmrgAC_ARG_ENABLE(strict-compilation,
21114def10e6Smrg			  AS_HELP_STRING([--enable-strict-compilation],
21124def10e6Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
21134def10e6Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
21144def10e6Smrgif test "x$STRICT_COMPILE" = "xyes"; then
21154def10e6Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
21164def10e6Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
21174def10e6Smrg	if test "x$GCC" = xyes ; then
21184def10e6Smrg		STRICT_CFLAGS="-pedantic -Werror"
21194def10e6Smrg	elif test "x$SUNCC" = "xyes"; then
21204def10e6Smrg		STRICT_CFLAGS="-errwarn"
21214def10e6Smrg    elif test "x$INTELCC" = "xyes"; then
21224def10e6Smrg		STRICT_CFLAGS="-Werror"
21234def10e6Smrg	fi
21244def10e6Smrgfi
21254def10e6SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
21264def10e6SmrgAC_SUBST([CWARNFLAGS])
21274def10e6Smrg]) # XORG_STRICT_OPTION
2128a0d3b6eaSmrg
21294def10e6Smrg# XORG_DEFAULT_OPTIONS
21304def10e6Smrg# --------------------
21314def10e6Smrg# Minimum version: 1.3.0
21324def10e6Smrg#
21334def10e6Smrg# Defines default options for X.Org modules.
21344def10e6Smrg#
21354def10e6SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
21364def10e6SmrgAC_REQUIRE([AC_PROG_INSTALL])
21374def10e6SmrgXORG_CWARNFLAGS
21384def10e6SmrgXORG_STRICT_OPTION
21394def10e6SmrgXORG_RELEASE_VERSION
21404def10e6SmrgXORG_CHANGELOG
21414def10e6SmrgXORG_INSTALL
21424def10e6SmrgXORG_MANPAGE_SECTIONS
21434def10e6Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
21444def10e6Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
21454def10e6Smrg]) # XORG_DEFAULT_OPTIONS
2146f8a31ee4Smrg
21474def10e6Smrg# XORG_INSTALL()
21484def10e6Smrg# ----------------
21494def10e6Smrg# Minimum version: 1.4.0
21504def10e6Smrg#
21514def10e6Smrg# Defines the variable INSTALL_CMD as the command to copy
21524def10e6Smrg# INSTALL from $prefix/share/util-macros.
21534def10e6Smrg#
21544def10e6SmrgAC_DEFUN([XORG_INSTALL], [
21554def10e6SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
21564def10e6Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
21574def10e6SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
21584def10e6Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
21594def10e6Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
21604def10e6Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
21614def10e6SmrgAC_SUBST([INSTALL_CMD])
21624def10e6Smrg]) # XORG_INSTALL
21634def10e6Smrgdnl Copyright 2005 Red Hat, Inc
21644def10e6Smrgdnl
21654def10e6Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
21664def10e6Smrgdnl documentation for any purpose is hereby granted without fee, provided that
21674def10e6Smrgdnl the above copyright notice appear in all copies and that both that
21684def10e6Smrgdnl copyright notice and this permission notice appear in supporting
21694def10e6Smrgdnl documentation.
21704def10e6Smrgdnl
21714def10e6Smrgdnl The above copyright notice and this permission notice shall be included
21724def10e6Smrgdnl in all copies or substantial portions of the Software.
21734def10e6Smrgdnl
21744def10e6Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21754def10e6Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21764def10e6Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21774def10e6Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
21784def10e6Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21794def10e6Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21804def10e6Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
21814def10e6Smrgdnl
21824def10e6Smrgdnl Except as contained in this notice, the name of the copyright holders shall
21834def10e6Smrgdnl not be used in advertising or otherwise to promote the sale, use or
21844def10e6Smrgdnl other dealings in this Software without prior written authorization
21854def10e6Smrgdnl from the copyright holders.
21864def10e6Smrgdnl
2187a0d3b6eaSmrg
21884def10e6Smrg# XORG_RELEASE_VERSION
21894def10e6Smrg# --------------------
21904def10e6Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
21914def10e6Smrg 
21924def10e6SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
21934def10e6Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
21944def10e6Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
21954def10e6Smrg		[Major version of this package])
21964def10e6Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
21974def10e6Smrg	if test "x$PVM" = "x"; then
21984def10e6Smrg		PVM="0"
21994def10e6Smrg	fi
22004def10e6Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
22014def10e6Smrg		[$PVM],
22024def10e6Smrg		[Minor version of this package])
22034def10e6Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
22044def10e6Smrg	if test "x$PVP" = "x"; then
22054def10e6Smrg		PVP="0"
22064def10e6Smrg	fi
22074def10e6Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
22084def10e6Smrg		[$PVP],
22094def10e6Smrg		[Patch version of this package])
22104def10e6Smrg])
2211a0d3b6eaSmrg
22124def10e6Smrg# XORG_CHANGELOG()
22134def10e6Smrg# ----------------
22144def10e6Smrg# Minimum version: 1.2.0
22154def10e6Smrg#
22164def10e6Smrg# Defines the variable CHANGELOG_CMD as the command to generate
22174def10e6Smrg# ChangeLog from git.
22184def10e6Smrg#
22194def10e6Smrg#
22204def10e6SmrgAC_DEFUN([XORG_CHANGELOG], [
22214def10e6SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
22224def10e6Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
22234def10e6Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
22244def10e6Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
22254def10e6SmrgAC_SUBST([CHANGELOG_CMD])
22264def10e6Smrg]) # XORG_CHANGELOG
22274def10e6Smrg
22284def10e6Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
22294def10e6Smrg# 
22304def10e6Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
22314def10e6Smrg#
22324def10e6Smrg# This program is free software; you can redistribute it and/or modify
22334def10e6Smrg# it under the terms of the GNU General Public License as published by
22344def10e6Smrg# the Free Software Foundation; either version 2 of the License, or
22354def10e6Smrg# (at your option) any later version.
22364def10e6Smrg#
22374def10e6Smrg# This program is distributed in the hope that it will be useful, but
22384def10e6Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
22394def10e6Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22404def10e6Smrg# General Public License for more details.
22414def10e6Smrg#
22424def10e6Smrg# You should have received a copy of the GNU General Public License
22434def10e6Smrg# along with this program; if not, write to the Free Software
22444def10e6Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22454def10e6Smrg#
22464def10e6Smrg# As a special exception to the GNU General Public License, if you
22474def10e6Smrg# distribute this file as part of a program that contains a
22484def10e6Smrg# configuration script generated by Autoconf, you may include it under
22494def10e6Smrg# the same distribution terms that you use for the rest of that program.
22504def10e6Smrg
22514def10e6Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
22524def10e6Smrg# ----------------------------------
22534def10e6SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
22544def10e6Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
22554def10e6Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
22564def10e6SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
22574def10e6Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
22584def10e6Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2259a0d3b6eaSmrgfi
22604def10e6Smrgif test -n "$PKG_CONFIG"; then
22614def10e6Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
22624def10e6Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
22634def10e6Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
22644def10e6Smrg		AC_MSG_RESULT([yes])
22654def10e6Smrg	else
22664def10e6Smrg		AC_MSG_RESULT([no])
22674def10e6Smrg		PKG_CONFIG=""
22684def10e6Smrg	fi
22694def10e6Smrg		
22704def10e6Smrgfi[]dnl
22714def10e6Smrg])# PKG_PROG_PKG_CONFIG
2272a0d3b6eaSmrg
22734def10e6Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2274f8a31ee4Smrg#
22754def10e6Smrg# Check to see whether a particular set of modules exists.  Similar
22764def10e6Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
22774def10e6Smrg#
22784def10e6Smrg#
22794def10e6Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
22804def10e6Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
22814def10e6Smrg# PKG_CHECK_EXISTS manually
22824def10e6Smrg# --------------------------------------------------------------
22834def10e6SmrgAC_DEFUN([PKG_CHECK_EXISTS],
22844def10e6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
22854def10e6Smrgif test -n "$PKG_CONFIG" && \
22864def10e6Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
22874def10e6Smrg  m4_ifval([$2], [$2], [:])
22884def10e6Smrgm4_ifvaln([$3], [else
22894def10e6Smrg  $3])dnl
22904def10e6Smrgfi])
2291f8a31ee4Smrg
2292f8a31ee4Smrg
22934def10e6Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
22944def10e6Smrg# ---------------------------------------------
22954def10e6Smrgm4_define([_PKG_CONFIG],
22964def10e6Smrg[if test -n "$$1"; then
22974def10e6Smrg    pkg_cv_[]$1="$$1"
22984def10e6Smrg elif test -n "$PKG_CONFIG"; then
22994def10e6Smrg    PKG_CHECK_EXISTS([$3],
23004def10e6Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
23014def10e6Smrg		     [pkg_failed=yes])
23024def10e6Smrg else
23034def10e6Smrg    pkg_failed=untried
23044def10e6Smrgfi[]dnl
23054def10e6Smrg])# _PKG_CONFIG
2306f8a31ee4Smrg
23074def10e6Smrg# _PKG_SHORT_ERRORS_SUPPORTED
23084def10e6Smrg# -----------------------------
23094def10e6SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
23104def10e6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
23114def10e6Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
23124def10e6Smrg        _pkg_short_errors_supported=yes
23134def10e6Smrgelse
23144def10e6Smrg        _pkg_short_errors_supported=no
23154def10e6Smrgfi[]dnl
23164def10e6Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
2317a0d3b6eaSmrg
2318a0d3b6eaSmrg
23194def10e6Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
23204def10e6Smrg# [ACTION-IF-NOT-FOUND])
2321a0d3b6eaSmrg#
23224def10e6Smrg#
23234def10e6Smrg# Note that if there is a possibility the first call to
23244def10e6Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
23254def10e6Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
23264def10e6Smrg#
23274def10e6Smrg#
23284def10e6Smrg# --------------------------------------------------------------
23294def10e6SmrgAC_DEFUN([PKG_CHECK_MODULES],
23304def10e6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
23314def10e6SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
23324def10e6SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2333a0d3b6eaSmrg
23344def10e6Smrgpkg_failed=no
23354def10e6SmrgAC_MSG_CHECKING([for $1])
2336f8a31ee4Smrg
23374def10e6Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
23384def10e6Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2339a0d3b6eaSmrg
23404def10e6Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
23414def10e6Smrgand $1[]_LIBS to avoid the need to call pkg-config.
23424def10e6SmrgSee the pkg-config man page for more details.])
2343f8a31ee4Smrg
23444def10e6Smrgif test $pkg_failed = yes; then
23454def10e6Smrg        _PKG_SHORT_ERRORS_SUPPORTED
23464def10e6Smrg        if test $_pkg_short_errors_supported = yes; then
23474def10e6Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
23484def10e6Smrg        else 
23494def10e6Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
23504def10e6Smrg        fi
23514def10e6Smrg	# Put the nasty error message in config.log where it belongs
23524def10e6Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2353a0d3b6eaSmrg
23544def10e6Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
23554def10e6Smrg[Package requirements ($2) were not met:
2356a0d3b6eaSmrg
23574def10e6Smrg$$1_PKG_ERRORS
2358a0d3b6eaSmrg
23594def10e6SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
23604def10e6Smrginstalled software in a non-standard prefix.
2361a0d3b6eaSmrg
23624def10e6Smrg_PKG_TEXT
23634def10e6Smrg])],
23644def10e6Smrg		[AC_MSG_RESULT([no])
23654def10e6Smrg                $4])
23664def10e6Smrgelif test $pkg_failed = untried; then
23674def10e6Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
23684def10e6Smrg[The pkg-config script could not be found or is too old.  Make sure it
23694def10e6Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
23704def10e6Smrgpath to pkg-config.
2371a0d3b6eaSmrg
23724def10e6Smrg_PKG_TEXT
2373a0d3b6eaSmrg
23744def10e6SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
23754def10e6Smrg		[$4])
23764def10e6Smrgelse
23774def10e6Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
23784def10e6Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
23794def10e6Smrg        AC_MSG_RESULT([yes])
23804def10e6Smrg	ifelse([$3], , :, [$3])
23814def10e6Smrgfi[]dnl
23824def10e6Smrg])# PKG_CHECK_MODULES
2383a0d3b6eaSmrg
2384