aclocal.m4 revision 781f9a67
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# Do all the work for Automake.                             -*- Autoconf -*-
410a0d3b6eaSmrg
4114def10e6Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4124def10e6Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4134def10e6Smrg#
4144def10e6Smrg# This file is free software; the Free Software Foundation
4154def10e6Smrg# gives unlimited permission to copy and/or distribute it,
4164def10e6Smrg# with or without modifications, as long as this notice is preserved.
417a0d3b6eaSmrg
4184def10e6Smrg# serial 16
419a0d3b6eaSmrg
4204def10e6Smrg# This macro actually does too much.  Some checks are only needed if
4214def10e6Smrg# your package does certain things.  But this isn't really a big deal.
422a0d3b6eaSmrg
4234def10e6Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4244def10e6Smrg# AM_INIT_AUTOMAKE([OPTIONS])
4254def10e6Smrg# -----------------------------------------------
4264def10e6Smrg# The call with PACKAGE and VERSION arguments is the old style
4274def10e6Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
4284def10e6Smrg# and VERSION should now be passed to AC_INIT and removed from
4294def10e6Smrg# the call to AM_INIT_AUTOMAKE.
4304def10e6Smrg# We support both call styles for the transition.  After
4314def10e6Smrg# the next Automake release, Autoconf can make the AC_INIT
4324def10e6Smrg# arguments mandatory, and then we can depend on a new Autoconf
4334def10e6Smrg# release and drop the old call support.
4344def10e6SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4354def10e6Smrg[AC_PREREQ([2.62])dnl
4364def10e6Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4374def10e6Smrgdnl the ones we care about.
4384def10e6Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4394def10e6SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4404def10e6SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4414def10e6Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4424def10e6Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4434def10e6Smrg  # is not polluted with repeated "-I."
4444def10e6Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4454def10e6Smrg  # test to see if srcdir already configured
4464def10e6Smrg  if test -f $srcdir/config.status; then
4474def10e6Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4484def10e6Smrg  fi
449a0d3b6eaSmrgfi
450a0d3b6eaSmrg
4514def10e6Smrg# test whether we have cygpath
4524def10e6Smrgif test -z "$CYGPATH_W"; then
4534def10e6Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4544def10e6Smrg    CYGPATH_W='cygpath -w'
4554def10e6Smrg  else
4564def10e6Smrg    CYGPATH_W=echo
4574def10e6Smrg  fi
4584def10e6Smrgfi
4594def10e6SmrgAC_SUBST([CYGPATH_W])
460a0d3b6eaSmrg
4614def10e6Smrg# Define the identity of the package.
4624def10e6Smrgdnl Distinguish between old-style and new-style calls.
4634def10e6Smrgm4_ifval([$2],
4644def10e6Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4654def10e6Smrg AC_SUBST([PACKAGE], [$1])dnl
4664def10e6Smrg AC_SUBST([VERSION], [$2])],
4674def10e6Smrg[_AM_SET_OPTIONS([$1])dnl
4684def10e6Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4694def10e6Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4704def10e6Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4714def10e6Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4724def10e6Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473a0d3b6eaSmrg
4744def10e6Smrg_AM_IF_OPTION([no-define],,
4754def10e6Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4764def10e6Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
477a0d3b6eaSmrg
4784def10e6Smrg# Some tools Automake needs.
4794def10e6SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4804def10e6SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4814def10e6SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4824def10e6SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4834def10e6SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4844def10e6SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4854def10e6SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4864def10e6SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4874def10e6SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
4884def10e6SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
4894def10e6Smrg# We need awk for the "check" target.  The system "awk" is bad on
4904def10e6Smrg# some platforms.
4914def10e6SmrgAC_REQUIRE([AC_PROG_AWK])dnl
4924def10e6SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
4934def10e6SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
4944def10e6Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4954def10e6Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4964def10e6Smrg			     [_AM_PROG_TAR([v7])])])
4974def10e6Smrg_AM_IF_OPTION([no-dependencies],,
4984def10e6Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
4994def10e6Smrg		  [_AM_DEPENDENCIES(CC)],
5004def10e6Smrg		  [define([AC_PROG_CC],
5014def10e6Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
5024def10e6SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5034def10e6Smrg		  [_AM_DEPENDENCIES(CXX)],
5044def10e6Smrg		  [define([AC_PROG_CXX],
5054def10e6Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5064def10e6SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5074def10e6Smrg		  [_AM_DEPENDENCIES(OBJC)],
5084def10e6Smrg		  [define([AC_PROG_OBJC],
5094def10e6Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
5104def10e6Smrg])
5114def10e6Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5124def10e6Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5134def10e6Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5144def10e6Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5154def10e6SmrgAC_CONFIG_COMMANDS_PRE(dnl
5164def10e6Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5174def10e6Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5184def10e6Smrg])
519f8a31ee4Smrg
5204def10e6Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5214def10e6Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5224def10e6Smrgdnl mangled by Autoconf and run in a shell conditional statement.
5234def10e6Smrgm4_define([_AC_COMPILER_EXEEXT],
5244def10e6Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525a0d3b6eaSmrg
526a0d3b6eaSmrg
5274def10e6Smrg# When config.status generates a header, we must update the stamp-h file.
5284def10e6Smrg# This file resides in the same directory as the config header
5294def10e6Smrg# that is generated.  The stamp files are numbered to have different names.
530a0d3b6eaSmrg
5314def10e6Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
5324def10e6Smrg# loop where config.status creates the headers, so we can generate
5334def10e6Smrg# our stamp files there.
5344def10e6SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
5354def10e6Smrg[# Compute $1's index in $config_headers.
5364def10e6Smrg_am_arg=$1
5374def10e6Smrg_am_stamp_count=1
5384def10e6Smrgfor _am_header in $config_headers :; do
5394def10e6Smrg  case $_am_header in
5404def10e6Smrg    $_am_arg | $_am_arg:* )
5414def10e6Smrg      break ;;
5424def10e6Smrg    * )
5434def10e6Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5444def10e6Smrg  esac
5454def10e6Smrgdone
5464def10e6Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547a0d3b6eaSmrg
5484def10e6Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
5494def10e6Smrg#
5504def10e6Smrg# This file is free software; the Free Software Foundation
5514def10e6Smrg# gives unlimited permission to copy and/or distribute it,
5524def10e6Smrg# with or without modifications, as long as this notice is preserved.
553a0d3b6eaSmrg
5544def10e6Smrg# AM_PROG_INSTALL_SH
5554def10e6Smrg# ------------------
5564def10e6Smrg# Define $install_sh.
5574def10e6SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5584def10e6Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5594def10e6Smrgif test x"${install_sh}" != xset; then
5604def10e6Smrg  case $am_aux_dir in
5614def10e6Smrg  *\ * | *\	*)
5624def10e6Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5634def10e6Smrg  *)
5644def10e6Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5654def10e6Smrg  esac
566a0d3b6eaSmrgfi
5674def10e6SmrgAC_SUBST(install_sh)])
568a0d3b6eaSmrg
5694def10e6Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
570f8a31ee4Smrg#
5714def10e6Smrg# This file is free software; the Free Software Foundation
5724def10e6Smrg# gives unlimited permission to copy and/or distribute it,
5734def10e6Smrg# with or without modifications, as long as this notice is preserved.
574f8a31ee4Smrg
5754def10e6Smrg# serial 2
5764def10e6Smrg
5774def10e6Smrg# Check whether the underlying file-system supports filenames
5784def10e6Smrg# with a leading dot.  For instance MS-DOS doesn't.
5794def10e6SmrgAC_DEFUN([AM_SET_LEADING_DOT],
5804def10e6Smrg[rm -rf .tst 2>/dev/null
5814def10e6Smrgmkdir .tst 2>/dev/null
5824def10e6Smrgif test -d .tst; then
5834def10e6Smrg  am__leading_dot=.
584f8a31ee4Smrgelse
5854def10e6Smrg  am__leading_dot=_
586f8a31ee4Smrgfi
5874def10e6Smrgrmdir .tst 2>/dev/null
5884def10e6SmrgAC_SUBST([am__leading_dot])])
589f8a31ee4Smrg
5904def10e6Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
5914def10e6Smrg# From Jim Meyering
592f8a31ee4Smrg
5934def10e6Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
5944def10e6Smrg# Free Software Foundation, Inc.
595f8a31ee4Smrg#
5964def10e6Smrg# This file is free software; the Free Software Foundation
5974def10e6Smrg# gives unlimited permission to copy and/or distribute it,
5984def10e6Smrg# with or without modifications, as long as this notice is preserved.
5994def10e6Smrg
6004def10e6Smrg# serial 5
6014def10e6Smrg
6024def10e6Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6034def10e6Smrg# ----------------------------------
6044def10e6Smrg# Control maintainer-specific portions of Makefiles.
6054def10e6Smrg# Default is to disable them, unless `enable' is passed literally.
6064def10e6Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6074def10e6Smrg# can override the default with the --enable/--disable switch.
6084def10e6SmrgAC_DEFUN([AM_MAINTAINER_MODE],
6094def10e6Smrg[m4_case(m4_default([$1], [disable]),
6104def10e6Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
6114def10e6Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
6124def10e6Smrg       [m4_define([am_maintainer_other], [enable])
6134def10e6Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6144def10e6SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6154def10e6Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6164def10e6Smrg  AC_ARG_ENABLE([maintainer-mode],
6174def10e6Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
6184def10e6Smrg			  (and sometimes confusing) to the casual installer],
6194def10e6Smrg      [USE_MAINTAINER_MODE=$enableval],
6204def10e6Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
6214def10e6Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6224def10e6Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
6234def10e6Smrg  MAINT=$MAINTAINER_MODE_TRUE
6244def10e6Smrg  AC_SUBST([MAINT])dnl
6254def10e6Smrg]
6264def10e6Smrg)
6274def10e6Smrg
6284def10e6SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
6294def10e6Smrg
6304def10e6Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6314def10e6Smrg
6324def10e6Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
633f8a31ee4Smrg#
6344def10e6Smrg# This file is free software; the Free Software Foundation
6354def10e6Smrg# gives unlimited permission to copy and/or distribute it,
6364def10e6Smrg# with or without modifications, as long as this notice is preserved.
637f8a31ee4Smrg
6384def10e6Smrg# serial 4
6394def10e6Smrg
6404def10e6Smrg# AM_MAKE_INCLUDE()
6414def10e6Smrg# -----------------
6424def10e6Smrg# Check to see how make treats includes.
6434def10e6SmrgAC_DEFUN([AM_MAKE_INCLUDE],
6444def10e6Smrg[am_make=${MAKE-make}
6454def10e6Smrgcat > confinc << 'END'
6464def10e6Smrgam__doit:
6474def10e6Smrg	@echo this is the am__doit target
6484def10e6Smrg.PHONY: am__doit
6494def10e6SmrgEND
6504def10e6Smrg# If we don't find an include directive, just comment out the code.
6514def10e6SmrgAC_MSG_CHECKING([for style of include used by $am_make])
6524def10e6Smrgam__include="#"
6534def10e6Smrgam__quote=
6544def10e6Smrg_am_result=none
6554def10e6Smrg# First try GNU make style include.
6564def10e6Smrgecho "include confinc" > confmf
6574def10e6Smrg# Ignore all kinds of additional output from `make'.
6584def10e6Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6594def10e6Smrg*the\ am__doit\ target*)
6604def10e6Smrg  am__include=include
6614def10e6Smrg  am__quote=
6624def10e6Smrg  _am_result=GNU
6634def10e6Smrg  ;;
6644def10e6Smrgesac
6654def10e6Smrg# Now try BSD make style include.
6664def10e6Smrgif test "$am__include" = "#"; then
6674def10e6Smrg   echo '.include "confinc"' > confmf
6684def10e6Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6694def10e6Smrg   *the\ am__doit\ target*)
6704def10e6Smrg     am__include=.include
6714def10e6Smrg     am__quote="\""
6724def10e6Smrg     _am_result=BSD
6734def10e6Smrg     ;;
6744def10e6Smrg   esac
675f8a31ee4Smrgfi
6764def10e6SmrgAC_SUBST([am__include])
6774def10e6SmrgAC_SUBST([am__quote])
6784def10e6SmrgAC_MSG_RESULT([$_am_result])
6794def10e6Smrgrm -f confinc confmf
6804def10e6Smrg])
681f8a31ee4Smrg
6824def10e6Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6834def10e6Smrg
6844def10e6Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
6854def10e6Smrg# Free Software Foundation, Inc.
686f8a31ee4Smrg#
6874def10e6Smrg# This file is free software; the Free Software Foundation
6884def10e6Smrg# gives unlimited permission to copy and/or distribute it,
6894def10e6Smrg# with or without modifications, as long as this notice is preserved.
690f8a31ee4Smrg
6914def10e6Smrg# serial 6
6924def10e6Smrg
6934def10e6Smrg# AM_MISSING_PROG(NAME, PROGRAM)
6944def10e6Smrg# ------------------------------
6954def10e6SmrgAC_DEFUN([AM_MISSING_PROG],
6964def10e6Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
6974def10e6Smrg$1=${$1-"${am_missing_run}$2"}
6984def10e6SmrgAC_SUBST($1)])
6994def10e6Smrg
7004def10e6Smrg
7014def10e6Smrg# AM_MISSING_HAS_RUN
7024def10e6Smrg# ------------------
7034def10e6Smrg# Define MISSING if not defined so far and test if it supports --run.
7044def10e6Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
7054def10e6SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7064def10e6Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7074def10e6SmrgAC_REQUIRE_AUX_FILE([missing])dnl
7084def10e6Smrgif test x"${MISSING+set}" != xset; then
7094def10e6Smrg  case $am_aux_dir in
7104def10e6Smrg  *\ * | *\	*)
7114def10e6Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7124def10e6Smrg  *)
7134def10e6Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7144def10e6Smrg  esac
7154def10e6Smrgfi
7164def10e6Smrg# Use eval to expand $SHELL
7174def10e6Smrgif eval "$MISSING --run true"; then
7184def10e6Smrg  am_missing_run="$MISSING --run "
719f8a31ee4Smrgelse
7204def10e6Smrg  am_missing_run=
7214def10e6Smrg  AC_MSG_WARN([`missing' script is too old or missing])
722f8a31ee4Smrgfi
7234def10e6Smrg])
724f8a31ee4Smrg
7254def10e6Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726f8a31ee4Smrg#
7274def10e6Smrg# This file is free software; the Free Software Foundation
7284def10e6Smrg# gives unlimited permission to copy and/or distribute it,
7294def10e6Smrg# with or without modifications, as long as this notice is preserved.
7304def10e6Smrg
7314def10e6Smrg# AM_PROG_MKDIR_P
7324def10e6Smrg# ---------------
7334def10e6Smrg# Check for `mkdir -p'.
7344def10e6SmrgAC_DEFUN([AM_PROG_MKDIR_P],
7354def10e6Smrg[AC_PREREQ([2.60])dnl
7364def10e6SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7374def10e6Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7384def10e6Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
7394def10e6Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7404def10e6Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7414def10e6Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7424def10e6Smrgdnl adjustment using top_builddir (which is defined more often than
7434def10e6Smrgdnl MKDIR_P).
7444def10e6SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7454def10e6Smrgcase $mkdir_p in
7464def10e6Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7474def10e6Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7484def10e6Smrgesac
7494def10e6Smrg])
7504def10e6Smrg
7514def10e6Smrg# Helper functions for option handling.                     -*- Autoconf -*-
7524def10e6Smrg
7534def10e6Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
754f8a31ee4Smrg#
7554def10e6Smrg# This file is free software; the Free Software Foundation
7564def10e6Smrg# gives unlimited permission to copy and/or distribute it,
7574def10e6Smrg# with or without modifications, as long as this notice is preserved.
758f8a31ee4Smrg
7594def10e6Smrg# serial 4
760f8a31ee4Smrg
7614def10e6Smrg# _AM_MANGLE_OPTION(NAME)
7624def10e6Smrg# -----------------------
7634def10e6SmrgAC_DEFUN([_AM_MANGLE_OPTION],
7644def10e6Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765f8a31ee4Smrg
7664def10e6Smrg# _AM_SET_OPTION(NAME)
7674def10e6Smrg# ------------------------------
7684def10e6Smrg# Set option NAME.  Presently that only means defining a flag for this option.
7694def10e6SmrgAC_DEFUN([_AM_SET_OPTION],
7704def10e6Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
771f8a31ee4Smrg
7724def10e6Smrg# _AM_SET_OPTIONS(OPTIONS)
7734def10e6Smrg# ----------------------------------
7744def10e6Smrg# OPTIONS is a space-separated list of Automake options.
7754def10e6SmrgAC_DEFUN([_AM_SET_OPTIONS],
7764def10e6Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
777f8a31ee4Smrg
7784def10e6Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7794def10e6Smrg# -------------------------------------------
7804def10e6Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7814def10e6SmrgAC_DEFUN([_AM_IF_OPTION],
7824def10e6Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783f8a31ee4Smrg
7844def10e6Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785f8a31ee4Smrg
7864def10e6Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
7874def10e6Smrg# Free Software Foundation, Inc.
788f8a31ee4Smrg#
7894def10e6Smrg# This file is free software; the Free Software Foundation
7904def10e6Smrg# gives unlimited permission to copy and/or distribute it,
7914def10e6Smrg# with or without modifications, as long as this notice is preserved.
792f8a31ee4Smrg
7934def10e6Smrg# serial 5
7944def10e6Smrg
7954def10e6Smrg# AM_SANITY_CHECK
7964def10e6Smrg# ---------------
7974def10e6SmrgAC_DEFUN([AM_SANITY_CHECK],
7984def10e6Smrg[AC_MSG_CHECKING([whether build environment is sane])
7994def10e6Smrg# Just in case
8004def10e6Smrgsleep 1
8014def10e6Smrgecho timestamp > conftest.file
8024def10e6Smrg# Reject unsafe characters in $srcdir or the absolute working directory
8034def10e6Smrg# name.  Accept space and tab only in the latter.
8044def10e6Smrgam_lf='
8054def10e6Smrg'
8064def10e6Smrgcase `pwd` in
8074def10e6Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8084def10e6Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8094def10e6Smrgesac
8104def10e6Smrgcase $srcdir in
8114def10e6Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8124def10e6Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8134def10e6Smrgesac
8144def10e6Smrg
8154def10e6Smrg# Do `set' in a subshell so we don't clobber the current shell's
8164def10e6Smrg# arguments.  Must try -L first in case configure is actually a
8174def10e6Smrg# symlink; some systems play weird games with the mod time of symlinks
8184def10e6Smrg# (eg FreeBSD returns the mod time of the symlink's containing
8194def10e6Smrg# directory).
8204def10e6Smrgif (
8214def10e6Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8224def10e6Smrg   if test "$[*]" = "X"; then
8234def10e6Smrg      # -L didn't work.
8244def10e6Smrg      set X `ls -t "$srcdir/configure" conftest.file`
825f8a31ee4Smrg   fi
8264def10e6Smrg   rm -f conftest.file
8274def10e6Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
8284def10e6Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8294def10e6Smrg
8304def10e6Smrg      # If neither matched, then we have a broken ls.  This can happen
8314def10e6Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
8324def10e6Smrg      # broken ls alias from the environment.  This has actually
8334def10e6Smrg      # happened.  Such a system could not be considered "sane".
8344def10e6Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8354def10e6Smrgalias in your environment])
836f8a31ee4Smrg   fi
8374def10e6Smrg
8384def10e6Smrg   test "$[2]" = conftest.file
8394def10e6Smrg   )
8404def10e6Smrgthen
8414def10e6Smrg   # Ok.
8424def10e6Smrg   :
843f8a31ee4Smrgelse
8444def10e6Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
8454def10e6SmrgCheck your system clock])
846f8a31ee4Smrgfi
8474def10e6SmrgAC_MSG_RESULT(yes)])
848f8a31ee4Smrg
8494def10e6Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
850f8a31ee4Smrg#
8514def10e6Smrg# This file is free software; the Free Software Foundation
8524def10e6Smrg# gives unlimited permission to copy and/or distribute it,
8534def10e6Smrg# with or without modifications, as long as this notice is preserved.
854f8a31ee4Smrg
8554def10e6Smrg# serial 1
856f8a31ee4Smrg
8574def10e6Smrg# AM_SILENT_RULES([DEFAULT])
8584def10e6Smrg# --------------------------
8594def10e6Smrg# Enable less verbose build rules; with the default set to DEFAULT
8604def10e6Smrg# (`yes' being less verbose, `no' or empty being verbose).
8614def10e6SmrgAC_DEFUN([AM_SILENT_RULES],
8624def10e6Smrg[AC_ARG_ENABLE([silent-rules],
8634def10e6Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8644def10e6Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8654def10e6Smrgcase $enable_silent_rules in
8664def10e6Smrgyes) AM_DEFAULT_VERBOSITY=0;;
8674def10e6Smrgno)  AM_DEFAULT_VERBOSITY=1;;
8684def10e6Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8694def10e6Smrgesac
8704def10e6SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8714def10e6SmrgAM_BACKSLASH='\'
8724def10e6SmrgAC_SUBST([AM_BACKSLASH])dnl
8734def10e6Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8744def10e6Smrg])
875f8a31ee4Smrg
8764def10e6Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
877a0d3b6eaSmrg#
8784def10e6Smrg# This file is free software; the Free Software Foundation
8794def10e6Smrg# gives unlimited permission to copy and/or distribute it,
8804def10e6Smrg# with or without modifications, as long as this notice is preserved.
881a0d3b6eaSmrg
8824def10e6Smrg# AM_PROG_INSTALL_STRIP
8834def10e6Smrg# ---------------------
8844def10e6Smrg# One issue with vendor `install' (even GNU) is that you can't
8854def10e6Smrg# specify the program used to strip binaries.  This is especially
8864def10e6Smrg# annoying in cross-compiling environments, where the build's strip
8874def10e6Smrg# is unlikely to handle the host's binaries.
8884def10e6Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
8894def10e6Smrg# always use install-sh in `make install-strip', and initialize
8904def10e6Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
8914def10e6SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
8924def10e6Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
8934def10e6Smrg# Installed binaries are usually stripped using `strip' when the user
8944def10e6Smrg# run `make install-strip'.  However `strip' might not be the right
8954def10e6Smrg# tool to use in cross-compilation environments, therefore Automake
8964def10e6Smrg# will honor the `STRIP' environment variable to overrule this program.
8974def10e6Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
8984def10e6Smrgif test "$cross_compiling" != no; then
8994def10e6Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
900a0d3b6eaSmrgfi
9014def10e6SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9024def10e6SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
903a0d3b6eaSmrg
9044def10e6Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
905a0d3b6eaSmrg#
9064def10e6Smrg# This file is free software; the Free Software Foundation
9074def10e6Smrg# gives unlimited permission to copy and/or distribute it,
9084def10e6Smrg# with or without modifications, as long as this notice is preserved.
909a0d3b6eaSmrg
9104def10e6Smrg# serial 2
911f8a31ee4Smrg
9124def10e6Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
9134def10e6Smrg# ---------------------------
9144def10e6Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9154def10e6Smrg# This macro is traced by Automake.
9164def10e6SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
917f8a31ee4Smrg
9184def10e6Smrg# AM_SUBST_NOTMAKE(VARIABLE)
9194def10e6Smrg# ---------------------------
9204def10e6Smrg# Public sister of _AM_SUBST_NOTMAKE.
9214def10e6SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
922f8a31ee4Smrg
9234def10e6Smrg# Check how to create a tarball.                            -*- Autoconf -*-
924a0d3b6eaSmrg
9254def10e6Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9264def10e6Smrg#
9274def10e6Smrg# This file is free software; the Free Software Foundation
9284def10e6Smrg# gives unlimited permission to copy and/or distribute it,
9294def10e6Smrg# with or without modifications, as long as this notice is preserved.
930a0d3b6eaSmrg
9314def10e6Smrg# serial 2
932a0d3b6eaSmrg
9334def10e6Smrg# _AM_PROG_TAR(FORMAT)
9344def10e6Smrg# --------------------
9354def10e6Smrg# Check how to create a tarball in format FORMAT.
9364def10e6Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
937a0d3b6eaSmrg#
9384def10e6Smrg# Substitute a variable $(am__tar) that is a command
9394def10e6Smrg# writing to stdout a FORMAT-tarball containing the directory
9404def10e6Smrg# $tardir.
9414def10e6Smrg#     tardir=directory && $(am__tar) > result.tar
942f8a31ee4Smrg#
9434def10e6Smrg# Substitute a variable $(am__untar) that extract such
9444def10e6Smrg# a tarball read from stdin.
9454def10e6Smrg#     $(am__untar) < result.tar
9464def10e6SmrgAC_DEFUN([_AM_PROG_TAR],
9474def10e6Smrg[# Always define AMTAR for backward compatibility.
9484def10e6SmrgAM_MISSING_PROG([AMTAR], [tar])
9494def10e6Smrgm4_if([$1], [v7],
9504def10e6Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
9514def10e6Smrg     [m4_case([$1], [ustar],, [pax],,
9524def10e6Smrg              [m4_fatal([Unknown tar format])])
9534def10e6SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
9544def10e6Smrg# Loop over all known methods to create a tar archive until one works.
9554def10e6Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9564def10e6Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
9574def10e6Smrg# Do not fold the above two line into one, because Tru64 sh and
9584def10e6Smrg# Solaris sh will not grok spaces in the rhs of `-'.
9594def10e6Smrgfor _am_tool in $_am_tools
9604def10e6Smrgdo
9614def10e6Smrg  case $_am_tool in
9624def10e6Smrg  gnutar)
9634def10e6Smrg    for _am_tar in tar gnutar gtar;
9644def10e6Smrg    do
9654def10e6Smrg      AM_RUN_LOG([$_am_tar --version]) && break
9664def10e6Smrg    done
9674def10e6Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9684def10e6Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9694def10e6Smrg    am__untar="$_am_tar -xf -"
9704def10e6Smrg    ;;
9714def10e6Smrg  plaintar)
9724def10e6Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
9734def10e6Smrg    # ustar tarball either.
9744def10e6Smrg    (tar --version) >/dev/null 2>&1 && continue
9754def10e6Smrg    am__tar='tar chf - "$$tardir"'
9764def10e6Smrg    am__tar_='tar chf - "$tardir"'
9774def10e6Smrg    am__untar='tar xf -'
9784def10e6Smrg    ;;
9794def10e6Smrg  pax)
9804def10e6Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
9814def10e6Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
9824def10e6Smrg    am__untar='pax -r'
9834def10e6Smrg    ;;
9844def10e6Smrg  cpio)
9854def10e6Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9864def10e6Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9874def10e6Smrg    am__untar='cpio -i -H $1 -d'
9884def10e6Smrg    ;;
9894def10e6Smrg  none)
9904def10e6Smrg    am__tar=false
9914def10e6Smrg    am__tar_=false
9924def10e6Smrg    am__untar=false
9934def10e6Smrg    ;;
9944def10e6Smrg  esac
995a0d3b6eaSmrg
9964def10e6Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
9974def10e6Smrg  # and am__untar set.
9984def10e6Smrg  test -n "${am_cv_prog_tar_$1}" && break
999f8a31ee4Smrg
10004def10e6Smrg  # tar/untar a dummy directory, and stop if the command works
10014def10e6Smrg  rm -rf conftest.dir
10024def10e6Smrg  mkdir conftest.dir
10034def10e6Smrg  echo GrepMe > conftest.dir/file
10044def10e6Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10054def10e6Smrg  rm -rf conftest.dir
10064def10e6Smrg  if test -s conftest.tar; then
10074def10e6Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
10084def10e6Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
10094def10e6Smrg  fi
10104def10e6Smrgdone
10114def10e6Smrgrm -rf conftest.dir
1012f8a31ee4Smrg
10134def10e6SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10144def10e6SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
10154def10e6SmrgAC_SUBST([am__tar])
10164def10e6SmrgAC_SUBST([am__untar])
10174def10e6Smrg]) # _AM_PROG_TAR
1018a0d3b6eaSmrg
10194def10e6Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10204def10e6Smrgdnl
10214def10e6Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
10224def10e6Smrgdnl 
10234def10e6Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10244def10e6Smrgdnl copy of this software and associated documentation files (the "Software"),
10254def10e6Smrgdnl to deal in the Software without restriction, including without limitation
10264def10e6Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
10274def10e6Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
10284def10e6Smrgdnl Software is furnished to do so, subject to the following conditions:
10294def10e6Smrgdnl
10304def10e6Smrgdnl The above copyright notice and this permission notice (including the next
10314def10e6Smrgdnl paragraph) shall be included in all copies or substantial portions of the
10324def10e6Smrgdnl Software.
10334def10e6Smrgdnl
10344def10e6Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10354def10e6Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10364def10e6Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
10374def10e6Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10384def10e6Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
10394def10e6Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
10404def10e6Smrgdnl DEALINGS IN THE SOFTWARE.
1041a0d3b6eaSmrg
10424def10e6Smrg# XORG_MACROS_VERSION(required-version)
10434def10e6Smrg# -------------------------------------
10444def10e6Smrg# Minimum version: 1.1.0
1045f8a31ee4Smrg#
10464def10e6Smrg# If you're using a macro added in Version 1.1 or newer, include this in
10474def10e6Smrg# your configure.ac with the minimum required version, such as:
10484def10e6Smrg# XORG_MACROS_VERSION(1.1)
1049f8a31ee4Smrg#
10504def10e6Smrg# To ensure that this macro is defined, also add:
10514def10e6Smrg# m4_ifndef([XORG_MACROS_VERSION],
10524def10e6Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10534def10e6Smrg#
10544def10e6Smrg#
10554def10e6Smrg# See the "minimum version" comment for each macro you use to see what 
10564def10e6Smrg# version you require.
10574def10e6Smrgm4_defun([XORG_MACROS_VERSION],[
1058781f9a67Smrgm4_define([vers_have], [1.15.0])
10594def10e6Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10604def10e6Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10614def10e6Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
10624def10e6Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
10634def10e6Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
10644def10e6Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
10654def10e6Smrgm4_undefine([vers_have])
10664def10e6Smrgm4_undefine([maj_have])
10674def10e6Smrgm4_undefine([maj_needed])
10684def10e6Smrg]) # XORG_MACROS_VERSION
1069f8a31ee4Smrg
10704def10e6Smrg# XORG_PROG_RAWCPP()
10714def10e6Smrg# ------------------
10724def10e6Smrg# Minimum version: 1.0.0
1073f8a31ee4Smrg#
10744def10e6Smrg# Find cpp program and necessary flags for use in pre-processing text files
10754def10e6Smrg# such as man pages and config files
10764def10e6SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
10774def10e6SmrgAC_REQUIRE([AC_PROG_CPP])
10784def10e6SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
10794def10e6Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1080f8a31ee4Smrg
10814def10e6Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
10824def10e6Smrg# which is not the best choice for supporting other OS'es, but covers most
10834def10e6Smrg# of the ones we need for now.
10844def10e6SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1085781f9a67SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
10864def10e6Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10874def10e6Smrg	AC_MSG_RESULT([no])
10884def10e6Smrgelse
10894def10e6Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10904def10e6Smrg		RAWCPPFLAGS=-undef
10914def10e6Smrg		AC_MSG_RESULT([yes])
10924def10e6Smrg	# under Cygwin unix is still defined even with -undef
10934def10e6Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10944def10e6Smrg		RAWCPPFLAGS="-undef -ansi"
10954def10e6Smrg		AC_MSG_RESULT([yes, with -ansi])
10964def10e6Smrg	else
10974def10e6Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1098f8a31ee4Smrg	fi
1099f8a31ee4Smrgfi
11004def10e6Smrgrm -f conftest.$ac_ext
1101f8a31ee4Smrg
11024def10e6SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1103781f9a67SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
11044def10e6Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11054def10e6Smrg	AC_MSG_RESULT([no])
11064def10e6Smrgelse
11074def10e6Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11084def10e6Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
11094def10e6Smrg		AC_MSG_RESULT([yes])
11104def10e6Smrg	else
11114def10e6Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
11124def10e6Smrg	fi
11134def10e6Smrgfi
11144def10e6Smrgrm -f conftest.$ac_ext
11154def10e6SmrgAC_SUBST(RAWCPPFLAGS)
11164def10e6Smrg]) # XORG_PROG_RAWCPP
11174def10e6Smrg
11184def10e6Smrg# XORG_MANPAGE_SECTIONS()
11194def10e6Smrg# -----------------------
11204def10e6Smrg# Minimum version: 1.0.0
1121f8a31ee4Smrg#
11224def10e6Smrg# Determine which sections man pages go in for the different man page types
11234def10e6Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
11244def10e6Smrg# Not sure if there's any better way than just hardcoding by OS name.
11254def10e6Smrg# Override default settings by setting environment variables
11264def10e6Smrg# Added MAN_SUBSTS in version 1.8
11274def10e6Smrg# Added AC_PROG_SED in version 1.8
1128f8a31ee4Smrg
11294def10e6SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
11304def10e6SmrgAC_REQUIRE([AC_CANONICAL_HOST])
11314def10e6SmrgAC_REQUIRE([AC_PROG_SED])
1132f8a31ee4Smrg
11334def10e6Smrgif test x$APP_MAN_SUFFIX = x    ; then
11344def10e6Smrg    APP_MAN_SUFFIX=1
11354def10e6Smrgfi
11364def10e6Smrgif test x$APP_MAN_DIR = x    ; then
11374def10e6Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
11384def10e6Smrgfi
1139f8a31ee4Smrg
11404def10e6Smrgif test x$LIB_MAN_SUFFIX = x    ; then
11414def10e6Smrg    LIB_MAN_SUFFIX=3
11424def10e6Smrgfi
11434def10e6Smrgif test x$LIB_MAN_DIR = x    ; then
11444def10e6Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
11454def10e6Smrgfi
1146a0d3b6eaSmrg
11474def10e6Smrgif test x$FILE_MAN_SUFFIX = x    ; then
11484def10e6Smrg    case $host_os in
11494def10e6Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
11504def10e6Smrg	*)		FILE_MAN_SUFFIX=5  ;;
11514def10e6Smrg    esac
11524def10e6Smrgfi
11534def10e6Smrgif test x$FILE_MAN_DIR = x    ; then
11544def10e6Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
11554def10e6Smrgfi
1156a0d3b6eaSmrg
11574def10e6Smrgif test x$MISC_MAN_SUFFIX = x    ; then
11584def10e6Smrg    case $host_os in
11594def10e6Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
11604def10e6Smrg	*)		MISC_MAN_SUFFIX=7  ;;
11614def10e6Smrg    esac
11624def10e6Smrgfi
11634def10e6Smrgif test x$MISC_MAN_DIR = x    ; then
11644def10e6Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
11654def10e6Smrgfi
1166a0d3b6eaSmrg
11674def10e6Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
11684def10e6Smrg    case $host_os in
11694def10e6Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
11704def10e6Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
11714def10e6Smrg    esac
11724def10e6Smrgfi
11734def10e6Smrgif test x$DRIVER_MAN_DIR = x    ; then
11744def10e6Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
11754def10e6Smrgfi
1176a0d3b6eaSmrg
11774def10e6Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
11784def10e6Smrg    case $host_os in
11794def10e6Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
11804def10e6Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
11814def10e6Smrg    esac
11824def10e6Smrgfi
11834def10e6Smrgif test x$ADMIN_MAN_DIR = x    ; then
11844def10e6Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
11854def10e6Smrgfi
1186a0d3b6eaSmrg
1187a0d3b6eaSmrg
11884def10e6SmrgAC_SUBST([APP_MAN_SUFFIX])
11894def10e6SmrgAC_SUBST([LIB_MAN_SUFFIX])
11904def10e6SmrgAC_SUBST([FILE_MAN_SUFFIX])
11914def10e6SmrgAC_SUBST([MISC_MAN_SUFFIX])
11924def10e6SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
11934def10e6SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
11944def10e6SmrgAC_SUBST([APP_MAN_DIR])
11954def10e6SmrgAC_SUBST([LIB_MAN_DIR])
11964def10e6SmrgAC_SUBST([FILE_MAN_DIR])
11974def10e6SmrgAC_SUBST([MISC_MAN_DIR])
11984def10e6SmrgAC_SUBST([DRIVER_MAN_DIR])
11994def10e6SmrgAC_SUBST([ADMIN_MAN_DIR])
1200a0d3b6eaSmrg
12014def10e6SmrgXORG_MAN_PAGE="X Version 11"
12024def10e6SmrgAC_SUBST([XORG_MAN_PAGE])
12034def10e6SmrgMAN_SUBSTS="\
12044def10e6Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12054def10e6Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12064def10e6Smrg	-e 's|__xservername__|Xorg|g' \
12074def10e6Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
12084def10e6Smrg	-e 's|__projectroot__|\$(prefix)|g' \
12094def10e6Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
12104def10e6Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
12114def10e6Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
12124def10e6Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
12134def10e6Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
12144def10e6Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
12154def10e6Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
12164def10e6SmrgAC_SUBST([MAN_SUBSTS])
1217a0d3b6eaSmrg
12184def10e6Smrg]) # XORG_MANPAGE_SECTIONS
1219a0d3b6eaSmrg
12204def10e6Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
12214def10e6Smrg# ------------------------
12224def10e6Smrg# Minimum version: 1.7.0
1223a0d3b6eaSmrg#
12244def10e6Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
12254def10e6Smrg# provided by xorg-sgml-doctools, if installed.
12264def10e6SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
12274def10e6SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
12284def10e6SmrgXORG_SGML_PATH=
12294def10e6SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
12304def10e6Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
12314def10e6Smrg    [m4_ifval([$1],[:],
12324def10e6Smrg        [if test x"$cross_compiling" != x"yes" ; then
12334def10e6Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
12344def10e6Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
12354def10e6Smrg         fi])
12364def10e6Smrg    ])
1237a0d3b6eaSmrg
12384def10e6Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
12394def10e6Smrg# the path and the name of the doc stylesheet
12404def10e6Smrgif test "x$XORG_SGML_PATH" != "x" ; then
12414def10e6Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
12424def10e6Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
12434def10e6Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1244a0d3b6eaSmrgelse
12454def10e6Smrg   AC_MSG_RESULT([no])
1246a0d3b6eaSmrgfi
1247a0d3b6eaSmrg
12484def10e6SmrgAC_SUBST(XORG_SGML_PATH)
12494def10e6SmrgAC_SUBST(STYLESHEET_SRCDIR)
12504def10e6SmrgAC_SUBST(XSL_STYLESHEET)
12514def10e6SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
12524def10e6Smrg]) # XORG_CHECK_SGML_DOCTOOLS
1253a0d3b6eaSmrg
12544def10e6Smrg# XORG_CHECK_LINUXDOC
12554def10e6Smrg# -------------------
12564def10e6Smrg# Minimum version: 1.0.0
1257a0d3b6eaSmrg#
12584def10e6Smrg# Defines the variable MAKE_TEXT if the necessary tools and
12594def10e6Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
12604def10e6Smrg# Whether or not the necessary tools and files are found can be checked
12614def10e6Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
12624def10e6SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12634def10e6SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
12644def10e6SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1265f8a31ee4Smrg
12664def10e6SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1267a0d3b6eaSmrg
12684def10e6SmrgAC_MSG_CHECKING([whether to build documentation])
1269a0d3b6eaSmrg
12704def10e6Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
12714def10e6Smrg   BUILDDOC=yes
1272a0d3b6eaSmrgelse
12734def10e6Smrg   BUILDDOC=no
1274a0d3b6eaSmrgfi
1275a0d3b6eaSmrg
12764def10e6SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1277a0d3b6eaSmrg
12784def10e6SmrgAC_MSG_RESULT([$BUILDDOC])
1279a0d3b6eaSmrg
12804def10e6SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1281a0d3b6eaSmrg
12824def10e6Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
12834def10e6Smrg   BUILDPDFDOC=yes
12844def10e6Smrgelse
12854def10e6Smrg   BUILDPDFDOC=no
1286a0d3b6eaSmrgfi
1287a0d3b6eaSmrg
12884def10e6SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1289a0d3b6eaSmrg
12904def10e6SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1291a0d3b6eaSmrg
12924def10e6SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
12934def10e6SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
12944def10e6SmrgMAKE_PDF="$PS2PDF"
12954def10e6SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1296a0d3b6eaSmrg
12974def10e6SmrgAC_SUBST(MAKE_TEXT)
12984def10e6SmrgAC_SUBST(MAKE_PS)
12994def10e6SmrgAC_SUBST(MAKE_PDF)
13004def10e6SmrgAC_SUBST(MAKE_HTML)
13014def10e6Smrg]) # XORG_CHECK_LINUXDOC
1302a0d3b6eaSmrg
13034def10e6Smrg# XORG_CHECK_DOCBOOK
13044def10e6Smrg# -------------------
13054def10e6Smrg# Minimum version: 1.0.0
1306a0d3b6eaSmrg#
13074def10e6Smrg# Checks for the ability to build output formats from SGML DocBook source.
13084def10e6Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
13094def10e6Smrg# indicates whether the necessary tools and files are found and, if set,
13104def10e6Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
13114def10e6SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
13124def10e6SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1313a0d3b6eaSmrg
13144def10e6SmrgBUILDTXTDOC=no
13154def10e6SmrgBUILDPDFDOC=no
13164def10e6SmrgBUILDPSDOC=no
13174def10e6SmrgBUILDHTMLDOC=no
1318a0d3b6eaSmrg
13194def10e6SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
13204def10e6SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
13214def10e6SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
13224def10e6SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1323a0d3b6eaSmrg
13244def10e6SmrgAC_MSG_CHECKING([whether to build text documentation])
13254def10e6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
13264def10e6Smrg   test x$BUILD_TXTDOC != xno; then
13274def10e6Smrg	BUILDTXTDOC=yes
13284def10e6Smrgfi
13294def10e6SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
13304def10e6SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1331a0d3b6eaSmrg
13324def10e6SmrgAC_MSG_CHECKING([whether to build PDF documentation])
13334def10e6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
13344def10e6Smrg   test x$BUILD_PDFDOC != xno; then
13354def10e6Smrg	BUILDPDFDOC=yes
13364def10e6Smrgfi
13374def10e6SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13384def10e6SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1339a0d3b6eaSmrg
13404def10e6SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
13414def10e6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
13424def10e6Smrg   test x$BUILD_PSDOC != xno; then
13434def10e6Smrg	BUILDPSDOC=yes
13444def10e6Smrgfi
13454def10e6SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
13464def10e6SmrgAC_MSG_RESULT([$BUILDPSDOC])
1347a0d3b6eaSmrg
13484def10e6SmrgAC_MSG_CHECKING([whether to build HTML documentation])
13494def10e6Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
13504def10e6Smrg   test x$BUILD_HTMLDOC != xno; then
13514def10e6Smrg	BUILDHTMLDOC=yes
13524def10e6Smrgfi
13534def10e6SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
13544def10e6SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1355a0d3b6eaSmrg
13564def10e6SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
13574def10e6SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
13584def10e6SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
13594def10e6SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1360a0d3b6eaSmrg
13614def10e6SmrgAC_SUBST(MAKE_TEXT)
13624def10e6SmrgAC_SUBST(MAKE_PS)
13634def10e6SmrgAC_SUBST(MAKE_PDF)
13644def10e6SmrgAC_SUBST(MAKE_HTML)
13654def10e6Smrg]) # XORG_CHECK_DOCBOOK
13664def10e6Smrg
13674def10e6Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
13684def10e6Smrg# ----------------
13694def10e6Smrg# Minimum version: 1.5.0
13704def10e6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
13714def10e6Smrg#
13724def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
13734def10e6Smrg# not at the appropriate level. This macro enables a module to test for the
13744def10e6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
13754def10e6Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
13764def10e6Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
13774def10e6Smrg# --with-xmlto assumes 'auto'.
13784def10e6Smrg#
13794def10e6Smrg# Interface to module:
13804def10e6Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
13814def10e6Smrg# XMLTO:	returns the path of the xmlto program found
13824def10e6Smrg#		returns the path set by the user in the environment
13834def10e6Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
13844def10e6Smrg#		'no' user instructs the module not to use xmlto
13854def10e6Smrg#
13864def10e6Smrg# Added in version 1.10.0
13874def10e6Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
13884def10e6Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
13894def10e6Smrg#
13904def10e6Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
13914def10e6Smrg#
13924def10e6SmrgAC_DEFUN([XORG_WITH_XMLTO],[
13934def10e6SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
13944def10e6Smrgm4_define([_defopt], m4_default([$2], [auto]))
13954def10e6SmrgAC_ARG_WITH(xmlto,
13964def10e6Smrg	AS_HELP_STRING([--with-xmlto],
13974def10e6Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
13984def10e6Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
13994def10e6Smrgm4_undefine([_defopt])
14004def10e6Smrg
14014def10e6Smrgif test "x$use_xmlto" = x"auto"; then
14024def10e6Smrg   AC_PATH_PROG([XMLTO], [xmlto])
14034def10e6Smrg   if test "x$XMLTO" = "x"; then
14044def10e6Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
14054def10e6Smrg	have_xmlto=no
14064def10e6Smrg   else
14074def10e6Smrg        have_xmlto=yes
14084def10e6Smrg   fi
14094def10e6Smrgelif test "x$use_xmlto" = x"yes" ; then
14104def10e6Smrg   AC_PATH_PROG([XMLTO], [xmlto])
14114def10e6Smrg   if test "x$XMLTO" = "x"; then
14124def10e6Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
14134def10e6Smrg   fi
14144def10e6Smrg   have_xmlto=yes
14154def10e6Smrgelif test "x$use_xmlto" = x"no" ; then
14164def10e6Smrg   if test "x$XMLTO" != "x"; then
14174def10e6Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
14184def10e6Smrg   fi
14194def10e6Smrg   have_xmlto=no
14204def10e6Smrgelse
14214def10e6Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1422a0d3b6eaSmrgfi
1423a0d3b6eaSmrg
14244def10e6Smrg# Test for a minimum version of xmlto, if provided.
14254def10e6Smrgm4_ifval([$1],
14264def10e6Smrg[if test "$have_xmlto" = yes; then
14274def10e6Smrg    # scrape the xmlto version
14284def10e6Smrg    AC_MSG_CHECKING([the xmlto version])
14294def10e6Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
14304def10e6Smrg    AC_MSG_RESULT([$xmlto_version])
14314def10e6Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
14324def10e6Smrg        [if test "x$use_xmlto" = xauto; then
14334def10e6Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
14344def10e6Smrg            have_xmlto=no
14354def10e6Smrg        else
14364def10e6Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
14374def10e6Smrg        fi])
14384def10e6Smrgfi])
14394def10e6Smrg
14404def10e6Smrg# Test for the ability of xmlto to generate a text target
14414def10e6Smrghave_xmlto_text=no
14424def10e6Smrgcat > conftest.xml << "EOF"
14434def10e6SmrgEOF
14444def10e6SmrgAS_IF([test "$have_xmlto" = yes],
14454def10e6Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
14464def10e6Smrg             [have_xmlto_text=yes],
14474def10e6Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
14484def10e6Smrgrm -f conftest.xml
14494def10e6SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
14504def10e6SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
14514def10e6Smrg]) # XORG_WITH_XMLTO
14524def10e6Smrg
1453781f9a67Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1454781f9a67Smrg# --------------------------------------------
1455781f9a67Smrg# Minimum version: 1.12.0
1456781f9a67Smrg# Minimum version for optional DEFAULT argument: 1.12.0
1457781f9a67Smrg#
1458781f9a67Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1459781f9a67Smrg# XML-based language used for the transformation of XML documents.
1460781f9a67Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1461781f9a67Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
1462781f9a67Smrg# The XSLT processor is often used as a standalone tool for transformations.
1463781f9a67Smrg# It should not be assumed that this tool is used only to work with documnetation.
1464781f9a67Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
1465781f9a67Smrg#
1466781f9a67Smrg# Interface to module:
1467781f9a67Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1468781f9a67Smrg# XSLTPROC:	 returns the path of the xsltproc program found
1469781f9a67Smrg#		 returns the path set by the user in the environment
1470781f9a67Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1471781f9a67Smrg#		  'no' user instructs the module not to use xsltproc
1472781f9a67Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
1473781f9a67Smrg#
1474781f9a67Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
1475781f9a67Smrg#
1476781f9a67SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
1477781f9a67SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1478781f9a67Smrg# Preserves the interface, should it be implemented later
1479781f9a67Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1480781f9a67Smrgm4_define([_defopt], m4_default([$2], [auto]))
1481781f9a67SmrgAC_ARG_WITH(xsltproc,
1482781f9a67Smrg	AS_HELP_STRING([--with-xsltproc],
1483781f9a67Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1484781f9a67Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1485781f9a67Smrgm4_undefine([_defopt])
1486781f9a67Smrg
1487781f9a67Smrgif test "x$use_xsltproc" = x"auto"; then
1488781f9a67Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1489781f9a67Smrg   if test "x$XSLTPROC" = "x"; then
1490781f9a67Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1491781f9a67Smrg	have_xsltproc=no
1492781f9a67Smrg   else
1493781f9a67Smrg        have_xsltproc=yes
1494781f9a67Smrg   fi
1495781f9a67Smrgelif test "x$use_xsltproc" = x"yes" ; then
1496781f9a67Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1497781f9a67Smrg   if test "x$XSLTPROC" = "x"; then
1498781f9a67Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1499781f9a67Smrg   fi
1500781f9a67Smrg   have_xsltproc=yes
1501781f9a67Smrgelif test "x$use_xsltproc" = x"no" ; then
1502781f9a67Smrg   if test "x$XSLTPROC" != "x"; then
1503781f9a67Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1504781f9a67Smrg   fi
1505781f9a67Smrg   have_xsltproc=no
1506781f9a67Smrgelse
1507781f9a67Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1508781f9a67Smrgfi
1509781f9a67Smrg
1510781f9a67SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1511781f9a67Smrg]) # XORG_WITH_XSLTPROC
1512781f9a67Smrg
1513781f9a67Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1514781f9a67Smrg# ----------------------------------------
1515781f9a67Smrg# Minimum version: 1.15.0
1516781f9a67Smrg#
1517781f9a67Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
1518781f9a67Smrg# scanning arbitrary text files, extracting information from those text files,
1519781f9a67Smrg# and printing reports based on that information.
1520781f9a67Smrg#
1521781f9a67Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
1522781f9a67Smrg#
1523781f9a67Smrg# Interface to module:
1524781f9a67Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
1525781f9a67Smrg# PERL:	     returns the path of the perl program found
1526781f9a67Smrg#	     returns the path set by the user in the environment
1527781f9a67Smrg# --with-perl: 'yes' user instructs the module to use perl
1528781f9a67Smrg#	       'no' user instructs the module not to use perl
1529781f9a67Smrg# have_perl: returns yes if perl found in PATH or no
1530781f9a67Smrg#
1531781f9a67Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1532781f9a67Smrg#
1533781f9a67SmrgAC_DEFUN([XORG_WITH_PERL],[
1534781f9a67SmrgAC_ARG_VAR([PERL], [Path to perl command])
1535781f9a67Smrg# Preserves the interface, should it be implemented later
1536781f9a67Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1537781f9a67Smrgm4_define([_defopt], m4_default([$2], [auto]))
1538781f9a67SmrgAC_ARG_WITH(perl,
1539781f9a67Smrg	AS_HELP_STRING([--with-perl],
1540781f9a67Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
1541781f9a67Smrg	   [use_perl=$withval], [use_perl=]_defopt)
1542781f9a67Smrgm4_undefine([_defopt])
1543781f9a67Smrg
1544781f9a67Smrgif test "x$use_perl" = x"auto"; then
1545781f9a67Smrg   AC_PATH_PROG([PERL], [perl])
1546781f9a67Smrg   if test "x$PERL" = "x"; then
1547781f9a67Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
1548781f9a67Smrg	have_perl=no
1549781f9a67Smrg   else
1550781f9a67Smrg        have_perl=yes
1551781f9a67Smrg   fi
1552781f9a67Smrgelif test "x$use_perl" = x"yes" ; then
1553781f9a67Smrg   AC_PATH_PROG([PERL], [perl])
1554781f9a67Smrg   if test "x$PERL" = "x"; then
1555781f9a67Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1556781f9a67Smrg   fi
1557781f9a67Smrg   have_perl=yes
1558781f9a67Smrgelif test "x$use_perl" = x"no" ; then
1559781f9a67Smrg   if test "x$PERL" != "x"; then
1560781f9a67Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1561781f9a67Smrg   fi
1562781f9a67Smrg   have_perl=no
1563781f9a67Smrgelse
1564781f9a67Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1565781f9a67Smrgfi
1566781f9a67Smrg
1567781f9a67SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
1568781f9a67Smrg]) # XORG_WITH_PERL
1569781f9a67Smrg
15704def10e6Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
15714def10e6Smrg# ----------------
15724def10e6Smrg# Minimum version: 1.5.0
15734def10e6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
15744def10e6Smrg#
15754def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
15764def10e6Smrg# not at the appropriate level. This macro enables a module to test for the
15774def10e6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
15784def10e6Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
15794def10e6Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
15804def10e6Smrg# --with-asciidoc assumes 'auto'.
15814def10e6Smrg#
15824def10e6Smrg# Interface to module:
15834def10e6Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
15844def10e6Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
15854def10e6Smrg#		 returns the path set by the user in the environment
15864def10e6Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
15874def10e6Smrg#		  'no' user instructs the module not to use asciidoc
15884def10e6Smrg#
15894def10e6Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
15904def10e6Smrg#
15914def10e6SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
15924def10e6SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
15934def10e6Smrgm4_define([_defopt], m4_default([$2], [auto]))
15944def10e6SmrgAC_ARG_WITH(asciidoc,
15954def10e6Smrg	AS_HELP_STRING([--with-asciidoc],
15964def10e6Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
15974def10e6Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
15984def10e6Smrgm4_undefine([_defopt])
15994def10e6Smrg
16004def10e6Smrgif test "x$use_asciidoc" = x"auto"; then
16014def10e6Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
16024def10e6Smrg   if test "x$ASCIIDOC" = "x"; then
16034def10e6Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
16044def10e6Smrg	have_asciidoc=no
16054def10e6Smrg   else
16064def10e6Smrg        have_asciidoc=yes
16074def10e6Smrg   fi
16084def10e6Smrgelif test "x$use_asciidoc" = x"yes" ; then
16094def10e6Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
16104def10e6Smrg   if test "x$ASCIIDOC" = "x"; then
16114def10e6Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
16124def10e6Smrg   fi
16134def10e6Smrg   have_asciidoc=yes
16144def10e6Smrgelif test "x$use_asciidoc" = x"no" ; then
16154def10e6Smrg   if test "x$ASCIIDOC" != "x"; then
16164def10e6Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
16174def10e6Smrg   fi
16184def10e6Smrg   have_asciidoc=no
16194def10e6Smrgelse
16204def10e6Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1621a0d3b6eaSmrgfi
16224def10e6Smrgm4_ifval([$1],
16234def10e6Smrg[if test "$have_asciidoc" = yes; then
16244def10e6Smrg    # scrape the asciidoc version
16254def10e6Smrg    AC_MSG_CHECKING([the asciidoc version])
16264def10e6Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
16274def10e6Smrg    AC_MSG_RESULT([$asciidoc_version])
16284def10e6Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
16294def10e6Smrg        [if test "x$use_asciidoc" = xauto; then
16304def10e6Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
16314def10e6Smrg            have_asciidoc=no
16324def10e6Smrg        else
16334def10e6Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
16344def10e6Smrg        fi])
16354def10e6Smrgfi])
16364def10e6SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
16374def10e6Smrg]) # XORG_WITH_ASCIIDOC
1638a0d3b6eaSmrg
16394def10e6Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
16404def10e6Smrg# --------------------------------
16414def10e6Smrg# Minimum version: 1.5.0
16424def10e6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
16434def10e6Smrg#
16444def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
16454def10e6Smrg# not at the appropriate level. This macro enables a module to test for the
16464def10e6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
16474def10e6Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
16484def10e6Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
16494def10e6Smrg# --with-doxygen assumes 'auto'.
16504def10e6Smrg#
16514def10e6Smrg# Interface to module:
16524def10e6Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
16534def10e6Smrg# DOXYGEN:	 returns the path of the doxygen program found
16544def10e6Smrg#		 returns the path set by the user in the environment
16554def10e6Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
16564def10e6Smrg#		  'no' user instructs the module not to use doxygen
16574def10e6Smrg#
16584def10e6Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
16594def10e6Smrg#
16604def10e6SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
16614def10e6SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
16624def10e6Smrgm4_define([_defopt], m4_default([$2], [auto]))
16634def10e6SmrgAC_ARG_WITH(doxygen,
16644def10e6Smrg	AS_HELP_STRING([--with-doxygen],
16654def10e6Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
16664def10e6Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
16674def10e6Smrgm4_undefine([_defopt])
1668a0d3b6eaSmrg
16694def10e6Smrgif test "x$use_doxygen" = x"auto"; then
16704def10e6Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
16714def10e6Smrg   if test "x$DOXYGEN" = "x"; then
16724def10e6Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
16734def10e6Smrg	have_doxygen=no
16744def10e6Smrg   else
16754def10e6Smrg        have_doxygen=yes
16764def10e6Smrg   fi
16774def10e6Smrgelif test "x$use_doxygen" = x"yes" ; then
16784def10e6Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
16794def10e6Smrg   if test "x$DOXYGEN" = "x"; then
16804def10e6Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
16814def10e6Smrg   fi
16824def10e6Smrg   have_doxygen=yes
16834def10e6Smrgelif test "x$use_doxygen" = x"no" ; then
16844def10e6Smrg   if test "x$DOXYGEN" != "x"; then
16854def10e6Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
16864def10e6Smrg   fi
16874def10e6Smrg   have_doxygen=no
16884def10e6Smrgelse
16894def10e6Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
16904def10e6Smrgfi
16914def10e6Smrgm4_ifval([$1],
16924def10e6Smrg[if test "$have_doxygen" = yes; then
16934def10e6Smrg    # scrape the doxygen version
16944def10e6Smrg    AC_MSG_CHECKING([the doxygen version])
16954def10e6Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
16964def10e6Smrg    AC_MSG_RESULT([$doxygen_version])
16974def10e6Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
16984def10e6Smrg        [if test "x$use_doxygen" = xauto; then
16994def10e6Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
17004def10e6Smrg            have_doxygen=no
17014def10e6Smrg        else
17024def10e6Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
17034def10e6Smrg        fi])
17044def10e6Smrgfi])
17054def10e6SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
17064def10e6Smrg]) # XORG_WITH_DOXYGEN
1707a0d3b6eaSmrg
17084def10e6Smrg# XORG_WITH_GROFF([DEFAULT])
17094def10e6Smrg# ----------------
17104def10e6Smrg# Minimum version: 1.6.0
17114def10e6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
17124def10e6Smrg#
17134def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
17144def10e6Smrg# not at the appropriate level. This macro enables a module to test for the
17154def10e6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
17164def10e6Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
17174def10e6Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
17184def10e6Smrg# --with-groff assumes 'auto'.
17194def10e6Smrg#
17204def10e6Smrg# Interface to module:
17214def10e6Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
17224def10e6Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
17234def10e6Smrg# HAVE_GROFF_MS: the -ms macros package
17244def10e6Smrg# GROFF:	 returns the path of the groff program found
17254def10e6Smrg#		 returns the path set by the user in the environment
17264def10e6Smrg# --with-groff:	 'yes' user instructs the module to use groff
17274def10e6Smrg#		 'no' user instructs the module not to use groff
17284def10e6Smrg#
17294def10e6Smrg# Added in version 1.9.0:
17304def10e6Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
17314def10e6Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
17324def10e6Smrg#		   psselect from the psutils package.
17334def10e6Smrg#		   the ghostcript package. Refer to the grohtml man pages
17344def10e6Smrg#
17354def10e6Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
17364def10e6Smrg#
17374def10e6Smrg# OS and distros often splits groff in a basic and full package, the former
17384def10e6Smrg# having the groff program and the later having devices, fonts and macros
17394def10e6Smrg# Checking for the groff executable is not enough.
17404def10e6Smrg#
17414def10e6Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
17424def10e6Smrg# unset HAVE_GROFF or GROFF env variables.
17434def10e6Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
17444def10e6Smrg#
17454def10e6SmrgAC_DEFUN([XORG_WITH_GROFF],[
17464def10e6SmrgAC_ARG_VAR([GROFF], [Path to groff command])
17474def10e6Smrgm4_define([_defopt], m4_default([$1], [auto]))
17484def10e6SmrgAC_ARG_WITH(groff,
17494def10e6Smrg	AS_HELP_STRING([--with-groff],
17504def10e6Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
17514def10e6Smrg	   [use_groff=$withval], [use_groff=]_defopt)
17524def10e6Smrgm4_undefine([_defopt])
1753a0d3b6eaSmrg
17544def10e6Smrgif test "x$use_groff" = x"auto"; then
17554def10e6Smrg   AC_PATH_PROG([GROFF], [groff])
17564def10e6Smrg   if test "x$GROFF" = "x"; then
17574def10e6Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
17584def10e6Smrg	have_groff=no
17594def10e6Smrg   else
17604def10e6Smrg        have_groff=yes
17614def10e6Smrg   fi
17624def10e6Smrgelif test "x$use_groff" = x"yes" ; then
17634def10e6Smrg   AC_PATH_PROG([GROFF], [groff])
17644def10e6Smrg   if test "x$GROFF" = "x"; then
17654def10e6Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
17664def10e6Smrg   fi
17674def10e6Smrg   have_groff=yes
17684def10e6Smrgelif test "x$use_groff" = x"no" ; then
17694def10e6Smrg   if test "x$GROFF" != "x"; then
17704def10e6Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
17714def10e6Smrg   fi
17724def10e6Smrg   have_groff=no
17734def10e6Smrgelse
17744def10e6Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
17754def10e6Smrgfi
1776f8a31ee4Smrg
17774def10e6Smrg# We have groff, test for the presence of the macro packages
17784def10e6Smrgif test "x$have_groff" = x"yes"; then
17794def10e6Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
17804def10e6Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
17814def10e6Smrg        groff_ms_works=yes
17824def10e6Smrg    else
17834def10e6Smrg        groff_ms_works=no
17844def10e6Smrg    fi
17854def10e6Smrg    AC_MSG_RESULT([$groff_ms_works])
17864def10e6Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
17874def10e6Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
17884def10e6Smrg        groff_mm_works=yes
17894def10e6Smrg    else
17904def10e6Smrg        groff_mm_works=no
17914def10e6Smrg    fi
17924def10e6Smrg    AC_MSG_RESULT([$groff_mm_works])
17934def10e6Smrgfi
1794a0d3b6eaSmrg
17954def10e6Smrg# We have groff, test for HTML dependencies, one command per package
17964def10e6Smrgif test "x$have_groff" = x"yes"; then
17974def10e6Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
17984def10e6Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
17994def10e6Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
18004def10e6Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
18014def10e6Smrg      have_groff_html=yes
18024def10e6Smrg   else
18034def10e6Smrg      have_groff_html=no
18044def10e6Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
18054def10e6Smrg   fi
18064def10e6Smrgfi
1807a0d3b6eaSmrg
18084def10e6Smrg# Set Automake conditionals for Makefiles
18094def10e6SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
18104def10e6SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
18114def10e6SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
18124def10e6SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
18134def10e6Smrg]) # XORG_WITH_GROFF
1814a0d3b6eaSmrg
1815781f9a67Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1816781f9a67Smrg# ---------------------------------------
18174def10e6Smrg# Minimum version: 1.6.0
18184def10e6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1819781f9a67Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
1820a0d3b6eaSmrg#
18214def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
18224def10e6Smrg# not at the appropriate level. This macro enables a module to test for the
18234def10e6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
18244def10e6Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
18254def10e6Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
18264def10e6Smrg# --with-fop assumes 'auto'.
18274def10e6Smrg#
18284def10e6Smrg# Interface to module:
18294def10e6Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
18304def10e6Smrg# FOP:	 	returns the path of the fop program found
18314def10e6Smrg#		returns the path set by the user in the environment
18324def10e6Smrg# --with-fop: 	'yes' user instructs the module to use fop
18334def10e6Smrg#		'no' user instructs the module not to use fop
18344def10e6Smrg#
18354def10e6Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
18364def10e6Smrg#
18374def10e6SmrgAC_DEFUN([XORG_WITH_FOP],[
18384def10e6SmrgAC_ARG_VAR([FOP], [Path to fop command])
1839781f9a67Smrgm4_define([_defopt], m4_default([$2], [auto]))
18404def10e6SmrgAC_ARG_WITH(fop,
18414def10e6Smrg	AS_HELP_STRING([--with-fop],
18424def10e6Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
18434def10e6Smrg	   [use_fop=$withval], [use_fop=]_defopt)
18444def10e6Smrgm4_undefine([_defopt])
1845a0d3b6eaSmrg
18464def10e6Smrgif test "x$use_fop" = x"auto"; then
18474def10e6Smrg   AC_PATH_PROG([FOP], [fop])
18484def10e6Smrg   if test "x$FOP" = "x"; then
18494def10e6Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
18504def10e6Smrg	have_fop=no
18514def10e6Smrg   else
18524def10e6Smrg        have_fop=yes
18534def10e6Smrg   fi
18544def10e6Smrgelif test "x$use_fop" = x"yes" ; then
18554def10e6Smrg   AC_PATH_PROG([FOP], [fop])
18564def10e6Smrg   if test "x$FOP" = "x"; then
18574def10e6Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
18584def10e6Smrg   fi
18594def10e6Smrg   have_fop=yes
18604def10e6Smrgelif test "x$use_fop" = x"no" ; then
18614def10e6Smrg   if test "x$FOP" != "x"; then
18624def10e6Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
18634def10e6Smrg   fi
18644def10e6Smrg   have_fop=no
18654def10e6Smrgelse
18664def10e6Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1867f8a31ee4Smrgfi
1868781f9a67Smrg
1869781f9a67Smrg# Test for a minimum version of fop, if provided.
1870781f9a67Smrgm4_ifval([$1],
1871781f9a67Smrg[if test "$have_fop" = yes; then
1872781f9a67Smrg    # scrape the fop version
1873781f9a67Smrg    AC_MSG_CHECKING([for fop minimum version])
1874781f9a67Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1875781f9a67Smrg    AC_MSG_RESULT([$fop_version])
1876781f9a67Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
1877781f9a67Smrg        [if test "x$use_fop" = xauto; then
1878781f9a67Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1879781f9a67Smrg            have_fop=no
1880781f9a67Smrg        else
1881781f9a67Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1882781f9a67Smrg        fi])
1883781f9a67Smrgfi])
18844def10e6SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
18854def10e6Smrg]) # XORG_WITH_FOP
1886a0d3b6eaSmrg
18874def10e6Smrg# XORG_WITH_PS2PDF([DEFAULT])
18884def10e6Smrg# ----------------
18894def10e6Smrg# Minimum version: 1.6.0
18904def10e6Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1891a0d3b6eaSmrg#
18924def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
18934def10e6Smrg# not at the appropriate level. This macro enables a module to test for the
18944def10e6Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
18954def10e6Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
18964def10e6Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
18974def10e6Smrg# --with-ps2pdf assumes 'auto'.
18984def10e6Smrg#
18994def10e6Smrg# Interface to module:
19004def10e6Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
19014def10e6Smrg# PS2PDF:	returns the path of the ps2pdf program found
19024def10e6Smrg#		returns the path set by the user in the environment
19034def10e6Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
19044def10e6Smrg#		 'no' user instructs the module not to use ps2pdf
19054def10e6Smrg#
19064def10e6Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
19074def10e6Smrg#
19084def10e6SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
19094def10e6SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
19104def10e6Smrgm4_define([_defopt], m4_default([$1], [auto]))
19114def10e6SmrgAC_ARG_WITH(ps2pdf,
19124def10e6Smrg	AS_HELP_STRING([--with-ps2pdf],
19134def10e6Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
19144def10e6Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
19154def10e6Smrgm4_undefine([_defopt])
1916a0d3b6eaSmrg
19174def10e6Smrgif test "x$use_ps2pdf" = x"auto"; then
19184def10e6Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
19194def10e6Smrg   if test "x$PS2PDF" = "x"; then
19204def10e6Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
19214def10e6Smrg	have_ps2pdf=no
19224def10e6Smrg   else
19234def10e6Smrg        have_ps2pdf=yes
19244def10e6Smrg   fi
19254def10e6Smrgelif test "x$use_ps2pdf" = x"yes" ; then
19264def10e6Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
19274def10e6Smrg   if test "x$PS2PDF" = "x"; then
19284def10e6Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
19294def10e6Smrg   fi
19304def10e6Smrg   have_ps2pdf=yes
19314def10e6Smrgelif test "x$use_ps2pdf" = x"no" ; then
19324def10e6Smrg   if test "x$PS2PDF" != "x"; then
19334def10e6Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
19344def10e6Smrg   fi
19354def10e6Smrg   have_ps2pdf=no
1936a0d3b6eaSmrgelse
19374def10e6Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1938a0d3b6eaSmrgfi
19394def10e6SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
19404def10e6Smrg]) # XORG_WITH_PS2PDF
1941a0d3b6eaSmrg
19424def10e6Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
19434def10e6Smrg# ----------------
19444def10e6Smrg# Minimum version: 1.6.0
1945a0d3b6eaSmrg#
19464def10e6Smrg# Documentation tools are not always available on all platforms and sometimes
19474def10e6Smrg# not at the appropriate level. This macro enables a builder to skip all
19484def10e6Smrg# documentation targets except traditional man pages.
19494def10e6Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
19504def10e6Smrg# maximum flexibilty in controlling documentation building.
19514def10e6Smrg# Refer to:
19524def10e6Smrg# XORG_WITH_XMLTO         --with-xmlto
19534def10e6Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
19544def10e6Smrg# XORG_WITH_DOXYGEN       --with-doxygen
19554def10e6Smrg# XORG_WITH_FOP           --with-fop
19564def10e6Smrg# XORG_WITH_GROFF         --with-groff
19574def10e6Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
19584def10e6Smrg#
19594def10e6Smrg# Interface to module:
19604def10e6Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
19614def10e6Smrg# --enable-docs: 'yes' user instructs the module to generate docs
19624def10e6Smrg#		 'no' user instructs the module not to generate docs
19634def10e6Smrg# parm1:	specify the default value, yes or no.
19644def10e6Smrg#
19654def10e6SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1966781f9a67Smrgm4_define([docs_default], m4_default([$1], [yes]))
19674def10e6SmrgAC_ARG_ENABLE(docs,
19684def10e6Smrg	AS_HELP_STRING([--enable-docs],
1969781f9a67Smrg	   [Enable building the documentation (default: ]docs_default[)]),
1970781f9a67Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
1971781f9a67Smrgm4_undefine([docs_default])
19724def10e6SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
19734def10e6SmrgAC_MSG_CHECKING([whether to build documentation])
19744def10e6SmrgAC_MSG_RESULT([$build_docs])
19754def10e6Smrg]) # XORG_ENABLE_DOCS
1976a0d3b6eaSmrg
19774def10e6Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
19784def10e6Smrg# ----------------
19794def10e6Smrg# Minimum version: 1.6.0
19804def10e6Smrg#
19814def10e6Smrg# This macro enables a builder to skip all developer documentation.
19824def10e6Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
19834def10e6Smrg# maximum flexibilty in controlling documentation building.
19844def10e6Smrg# Refer to:
19854def10e6Smrg# XORG_WITH_XMLTO         --with-xmlto
19864def10e6Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
19874def10e6Smrg# XORG_WITH_DOXYGEN       --with-doxygen
19884def10e6Smrg# XORG_WITH_FOP           --with-fop
19894def10e6Smrg# XORG_WITH_GROFF         --with-groff
19904def10e6Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
19914def10e6Smrg#
19924def10e6Smrg# Interface to module:
19934def10e6Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
19944def10e6Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
19954def10e6Smrg#			'no' user instructs the module not to generate developer docs
19964def10e6Smrg# parm1:		specify the default value, yes or no.
19974def10e6Smrg#
19984def10e6SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
19994def10e6Smrgm4_define([devel_default], m4_default([$1], [yes]))
20004def10e6SmrgAC_ARG_ENABLE(devel-docs,
20014def10e6Smrg	AS_HELP_STRING([--enable-devel-docs],
20024def10e6Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
20034def10e6Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
20044def10e6Smrgm4_undefine([devel_default])
20054def10e6SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
20064def10e6SmrgAC_MSG_CHECKING([whether to build developer documentation])
20074def10e6SmrgAC_MSG_RESULT([$build_devel_docs])
20084def10e6Smrg]) # XORG_ENABLE_DEVEL_DOCS
2009a0d3b6eaSmrg
20104def10e6Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
20114def10e6Smrg# ----------------
20124def10e6Smrg# Minimum version: 1.6.0
20134def10e6Smrg#
20144def10e6Smrg# This macro enables a builder to skip all functional specification targets.
20154def10e6Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
20164def10e6Smrg# maximum flexibilty in controlling documentation building.
20174def10e6Smrg# Refer to:
20184def10e6Smrg# XORG_WITH_XMLTO         --with-xmlto
20194def10e6Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
20204def10e6Smrg# XORG_WITH_DOXYGEN       --with-doxygen
20214def10e6Smrg# XORG_WITH_FOP           --with-fop
20224def10e6Smrg# XORG_WITH_GROFF         --with-groff
20234def10e6Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
20244def10e6Smrg#
20254def10e6Smrg# Interface to module:
20264def10e6Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
20274def10e6Smrg# --enable-specs:	'yes' user instructs the module to generate specs
20284def10e6Smrg#			'no' user instructs the module not to generate specs
20294def10e6Smrg# parm1:		specify the default value, yes or no.
20304def10e6Smrg#
20314def10e6SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
20324def10e6Smrgm4_define([spec_default], m4_default([$1], [yes]))
20334def10e6SmrgAC_ARG_ENABLE(specs,
20344def10e6Smrg	AS_HELP_STRING([--enable-specs],
20354def10e6Smrg	   [Enable building the specs (default: ]spec_default[)]),
20364def10e6Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
20374def10e6Smrgm4_undefine([spec_default])
20384def10e6SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
20394def10e6SmrgAC_MSG_CHECKING([whether to build functional specifications])
20404def10e6SmrgAC_MSG_RESULT([$build_specs])
20414def10e6Smrg]) # XORG_ENABLE_SPECS
2042a0d3b6eaSmrg
2043781f9a67Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
2044781f9a67Smrg# ----------------------------------------------
2045781f9a67Smrg# Minimum version: 1.13.0
2046781f9a67Smrg#
2047781f9a67Smrg# This macro enables a builder to enable/disable unit testing
2048781f9a67Smrg# It makes no assumption about the test cases implementation
2049781f9a67Smrg# Test cases may or may not use Automake "Support for test suites"
2050781f9a67Smrg# They may or may not use the software utility library GLib
2051781f9a67Smrg#
2052781f9a67Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
2053781f9a67Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
2054781f9a67Smrg# The variable enable_unit_tests is used by other macros in this file.
2055781f9a67Smrg#
2056781f9a67Smrg# Interface to module:
2057781f9a67Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
2058781f9a67Smrg# enable_unit_tests:    used in configure.ac for additional configuration
2059781f9a67Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
2060781f9a67Smrg#			'no' user instructs the module not to build tests
2061781f9a67Smrg# parm1:		specify the default value, yes or no.
2062781f9a67Smrg#
2063781f9a67SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2064781f9a67SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
2065781f9a67SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
2066781f9a67Smrgm4_define([_defopt], m4_default([$1], [auto]))
2067781f9a67SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2068781f9a67Smrg	[Enable building unit test cases (default: ]_defopt[)]),
2069781f9a67Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
2070781f9a67Smrgm4_undefine([_defopt])
2071781f9a67SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
2072781f9a67SmrgAC_MSG_CHECKING([whether to build unit test cases])
2073781f9a67SmrgAC_MSG_RESULT([$enable_unit_tests])
2074781f9a67Smrg]) # XORG_ENABLE_UNIT_TESTS
2075781f9a67Smrg
2076781f9a67Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2077781f9a67Smrg# ----------------------------------------
2078781f9a67Smrg# Minimum version: 1.13.0
2079781f9a67Smrg#
2080781f9a67Smrg# GLib is a library which provides advanced data structures and functions.
2081781f9a67Smrg# This macro enables a module to test for the presence of Glib.
2082781f9a67Smrg#
2083781f9a67Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2084781f9a67Smrg# Otherwise the value of $enable_unit_tests is blank.
2085781f9a67Smrg#
2086781f9a67Smrg# Interface to module:
2087781f9a67Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
2088781f9a67Smrg# with_glib: used in configure.ac to know if GLib has been found
2089781f9a67Smrg# --with-glib:	'yes' user instructs the module to use glib
2090781f9a67Smrg#		'no' user instructs the module not to use glib
2091781f9a67Smrg#
2092781f9a67SmrgAC_DEFUN([XORG_WITH_GLIB],[
2093781f9a67SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2094781f9a67Smrgm4_define([_defopt], m4_default([$2], [auto]))
2095781f9a67SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
2096781f9a67Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
2097781f9a67Smrg	[with_glib=$withval], [with_glib=]_defopt)
2098781f9a67Smrgm4_undefine([_defopt])
2099781f9a67Smrg
2100781f9a67Smrghave_glib=no
2101781f9a67Smrg# Do not probe GLib if user explicitly disabled unit testing
2102781f9a67Smrgif test "x$enable_unit_tests" != x"no"; then
2103781f9a67Smrg  # Do not probe GLib if user explicitly disabled it
2104781f9a67Smrg  if test "x$with_glib" != x"no"; then
2105781f9a67Smrg    m4_ifval(
2106781f9a67Smrg      [$1],
2107781f9a67Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
2108781f9a67Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
2109781f9a67Smrg    )
2110781f9a67Smrg  fi
2111781f9a67Smrgfi
2112781f9a67Smrg
2113781f9a67Smrg# Not having GLib when unit testing has been explicitly requested is an error
2114781f9a67Smrgif test "x$enable_unit_tests" = x"yes"; then
2115781f9a67Smrg  if test "x$have_glib" = x"no"; then
2116781f9a67Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2117781f9a67Smrg  fi
2118781f9a67Smrgfi
2119781f9a67Smrg
2120781f9a67Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
2121781f9a67Smrgif test "x$enable_unit_tests" = x"no"; then
2122781f9a67Smrg  if test "x$with_glib" = x"yes"; then
2123781f9a67Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2124781f9a67Smrg  fi
2125781f9a67Smrgfi
2126781f9a67Smrg
2127781f9a67Smrg# Not having GLib when it has been explicitly requested is an error
2128781f9a67Smrgif test "x$with_glib" = x"yes"; then
2129781f9a67Smrg  if test "x$have_glib" = x"no"; then
2130781f9a67Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
2131781f9a67Smrg  fi
2132781f9a67Smrgfi
2133781f9a67Smrg
2134781f9a67SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2135781f9a67Smrg]) # XORG_WITH_GLIB
2136781f9a67Smrg
2137781f9a67Smrg# XORG_LD_WRAP
2138781f9a67Smrg# ------------
2139781f9a67Smrg# Minimum version: 1.13.0
2140781f9a67Smrg#
2141781f9a67Smrg# Check if linker supports -wrap, passed via compiler flags
2142781f9a67Smrg#
2143781f9a67Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2144781f9a67Smrg# Otherwise the value of $enable_unit_tests is blank.
2145781f9a67Smrg#
2146781f9a67SmrgAC_DEFUN([XORG_LD_WRAP],[
2147781f9a67SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no])
2148781f9a67Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
2149781f9a67Smrgif test "x$enable_unit_tests" = x"yes"; then
2150781f9a67Smrg  if test "x$have_ld_wrap" = x"no"; then
2151781f9a67Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2152781f9a67Smrg  fi
2153781f9a67Smrgfi
2154781f9a67SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
2155781f9a67Smrg#
2156781f9a67Smrg]) # XORG_LD_WRAP
2157781f9a67Smrg
2158781f9a67Smrg# XORG_CHECK_LINKER_FLAGS
2159781f9a67Smrg# -----------------------
2160781f9a67Smrg# SYNOPSIS
2161781f9a67Smrg#
2162781f9a67Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
2163781f9a67Smrg#
2164781f9a67Smrg# DESCRIPTION
2165781f9a67Smrg#
2166781f9a67Smrg#   Check whether the given linker FLAGS work with the current language's
2167781f9a67Smrg#   linker, or whether they give an error.
2168781f9a67Smrg#
2169781f9a67Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2170781f9a67Smrg#   success/failure.
2171781f9a67Smrg#
2172781f9a67Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2173781f9a67Smrg#
2174781f9a67Smrg# LICENSE
2175781f9a67Smrg#
2176781f9a67Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
2177781f9a67Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
2178781f9a67Smrg#   Copyright (c) 2009 Matteo Frigo
2179781f9a67Smrg#
2180781f9a67Smrg#   This program is free software: you can redistribute it and/or modify it
2181781f9a67Smrg#   under the terms of the GNU General Public License as published by the
2182781f9a67Smrg#   Free Software Foundation, either version 3 of the License, or (at your
2183781f9a67Smrg#   option) any later version.
2184781f9a67Smrg#
2185781f9a67Smrg#   This program is distributed in the hope that it will be useful, but
2186781f9a67Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
2187781f9a67Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
2188781f9a67Smrg#   Public License for more details.
2189781f9a67Smrg#
2190781f9a67Smrg#   You should have received a copy of the GNU General Public License along
2191781f9a67Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
2192781f9a67Smrg#
2193781f9a67Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
2194781f9a67Smrg#   gives unlimited permission to copy, distribute and modify the configure
2195781f9a67Smrg#   scripts that are the output of Autoconf when processing the Macro. You
2196781f9a67Smrg#   need not follow the terms of the GNU General Public License when using
2197781f9a67Smrg#   or distributing such scripts, even though portions of the text of the
2198781f9a67Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
2199781f9a67Smrg#   all other use of the material that constitutes the Autoconf Macro.
2200781f9a67Smrg#
2201781f9a67Smrg#   This special exception to the GPL applies to versions of the Autoconf
2202781f9a67Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
2203781f9a67Smrg#   modified version of the Autoconf Macro, you may extend this special
2204781f9a67Smrg#   exception to the GPL to apply to your modified version as well.#
2205781f9a67SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
2206781f9a67Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
2207781f9a67Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
2208781f9a67SmrgAS_LITERAL_IF([$1],
2209781f9a67Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2210781f9a67Smrg      ax_save_FLAGS=$LDFLAGS
2211781f9a67Smrg      LDFLAGS="$1"
2212781f9a67Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2213781f9a67Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2214781f9a67Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2215781f9a67Smrg      LDFLAGS=$ax_save_FLAGS])],
2216781f9a67Smrg  [ax_save_FLAGS=$LDFLAGS
2217781f9a67Smrg   LDFLAGS="$1"
2218781f9a67Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2219781f9a67Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2220781f9a67Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2221781f9a67Smrg   LDFLAGS=$ax_save_FLAGS])
2222781f9a67Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
2223781f9a67SmrgAC_MSG_RESULT($xorg_check_linker_flags)
2224781f9a67Smrgif test "x$xorg_check_linker_flags" = xyes; then
2225781f9a67Smrg	m4_default([$2], :)
2226781f9a67Smrgelse
2227781f9a67Smrg	m4_default([$3], :)
2228781f9a67Smrgfi
2229781f9a67Smrg]) # XORG_CHECK_LINKER_FLAGS
2230781f9a67Smrg
22314def10e6Smrg# XORG_CHECK_MALLOC_ZERO
22324def10e6Smrg# ----------------------
22334def10e6Smrg# Minimum version: 1.0.0
2234a0d3b6eaSmrg#
22354def10e6Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
22364def10e6Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
22374def10e6Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
22384def10e6SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
22394def10e6SmrgAC_ARG_ENABLE(malloc0returnsnull,
22404def10e6Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
22414def10e6Smrg		       [malloc(0) returns NULL (default: auto)]),
22424def10e6Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
22434def10e6Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
2244a0d3b6eaSmrg
22454def10e6SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
22464def10e6Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2247781f9a67Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
2248781f9a67Smrg#include <stdlib.h>
2249781f9a67Smrg],[
22504def10e6Smrg    char *m0, *r0, *c0, *p;
22514def10e6Smrg    m0 = malloc(0);
22524def10e6Smrg    p = malloc(10);
22534def10e6Smrg    r0 = realloc(p,0);
2254781f9a67Smrg    c0 = calloc(0,10);
2255781f9a67Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2256781f9a67Smrg])],
22574def10e6Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
22584def10e6Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
22594def10e6Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
22604def10e6Smrgfi
22614def10e6SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2262a0d3b6eaSmrg
22634def10e6Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
22644def10e6Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
22654def10e6Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
22664def10e6Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
22674def10e6Smrgelse
22684def10e6Smrg	MALLOC_ZERO_CFLAGS=""
22694def10e6Smrg	XMALLOC_ZERO_CFLAGS=""
22704def10e6Smrg	XTMALLOC_ZERO_CFLAGS=""
2271a0d3b6eaSmrgfi
2272a0d3b6eaSmrg
22734def10e6SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
22744def10e6SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
22754def10e6SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
22764def10e6Smrg]) # XORG_CHECK_MALLOC_ZERO
2277a0d3b6eaSmrg
22784def10e6Smrg# XORG_WITH_LINT()
22794def10e6Smrg# ----------------
22804def10e6Smrg# Minimum version: 1.1.0
2281a0d3b6eaSmrg#
22824def10e6Smrg# This macro enables the use of a tool that flags some suspicious and
22834def10e6Smrg# non-portable constructs (likely to be bugs) in C language source code.
22844def10e6Smrg# It will attempt to locate the tool and use appropriate options.
22854def10e6Smrg# There are various lint type tools on different platforms.
22864def10e6Smrg#
22874def10e6Smrg# Interface to module:
22884def10e6Smrg# LINT:		returns the path to the tool found on the platform
22894def10e6Smrg#		or the value set to LINT on the configure cmd line
22904def10e6Smrg#		also an Automake conditional
22914def10e6Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
22924def10e6Smrg#
22934def10e6Smrg# --with-lint:	'yes' user instructs the module to use lint
22944def10e6Smrg#		'no' user instructs the module not to use lint (default)
22954def10e6Smrg#
22964def10e6Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
22974def10e6Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
22984def10e6Smrg#
22994def10e6SmrgAC_DEFUN([XORG_WITH_LINT],[
2300a0d3b6eaSmrg
23014def10e6SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
23024def10e6SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
23034def10e6SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
23044def10e6Smrg		[Use a lint-style source code checker (default: disabled)])],
23054def10e6Smrg		[use_lint=$withval], [use_lint=no])
2306a0d3b6eaSmrg
23074def10e6Smrg# Obtain platform specific info like program name and options
23084def10e6Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
23094def10e6Smrgcase $host_os in
23104def10e6Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
23114def10e6Smrg	lint_name=splint
23124def10e6Smrg	lint_options="-badflag"
23134def10e6Smrg	;;
23144def10e6Smrg  *freebsd* | *netbsd*)
23154def10e6Smrg	lint_name=lint
23164def10e6Smrg	lint_options="-u -b"
23174def10e6Smrg	;;
23184def10e6Smrg  *solaris*)
23194def10e6Smrg	lint_name=lint
23204def10e6Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
23214def10e6Smrg	;;
23224def10e6Smrgesac
2323a0d3b6eaSmrg
23244def10e6Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
23254def10e6Smrgif test "x$use_lint" = x"yes" ; then
23264def10e6Smrg   AC_PATH_PROG([LINT], [$lint_name])
23274def10e6Smrg   if test "x$LINT" = "x"; then
23284def10e6Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
23294def10e6Smrg   fi
23304def10e6Smrgelif test "x$use_lint" = x"no" ; then
23314def10e6Smrg   if test "x$LINT" != "x"; then
23324def10e6Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
23334def10e6Smrg   fi
2334a0d3b6eaSmrgelse
23354def10e6Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2336a0d3b6eaSmrgfi
2337a0d3b6eaSmrg
23384def10e6Smrg# User supplied flags override default flags
23394def10e6Smrgif test "x$LINT_FLAGS" != "x"; then
23404def10e6Smrg   lint_options=$LINT_FLAGS
23414def10e6Smrgfi
2342a0d3b6eaSmrg
23434def10e6SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
23444def10e6SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2345a0d3b6eaSmrg
23464def10e6Smrg]) # XORG_WITH_LINT
2347a0d3b6eaSmrg
23484def10e6Smrg# XORG_LINT_LIBRARY(LIBNAME)
23494def10e6Smrg# --------------------------
23504def10e6Smrg# Minimum version: 1.1.0
2351a0d3b6eaSmrg#
23524def10e6Smrg# Sets up flags for building lint libraries for checking programs that call
23534def10e6Smrg# functions in the library.
23544def10e6Smrg#
23554def10e6Smrg# Interface to module:
23564def10e6Smrg# LINTLIB		- Automake variable with the name of lint library file to make
23574def10e6Smrg# MAKE_LINT_LIB		- Automake conditional
23584def10e6Smrg#
23594def10e6Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
23604def10e6Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2361a0d3b6eaSmrg
23624def10e6SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
23634def10e6SmrgAC_REQUIRE([XORG_WITH_LINT])
23644def10e6SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
23654def10e6Smrg	[Create lint library (default: disabled)])],
23664def10e6Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2367a0d3b6eaSmrg
23684def10e6Smrgif test "x$make_lint_lib" = x"yes" ; then
23694def10e6Smrg   LINTLIB=llib-l$1.ln
23704def10e6Smrg   if test "x$LINT" = "x"; then
23714def10e6Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
23724def10e6Smrg   fi
23734def10e6Smrgelif test "x$make_lint_lib" != x"no" ; then
23744def10e6Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
23754def10e6Smrgfi
2376a0d3b6eaSmrg
23774def10e6SmrgAC_SUBST(LINTLIB)
23784def10e6SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2379a0d3b6eaSmrg
23804def10e6Smrg]) # XORG_LINT_LIBRARY
2381a0d3b6eaSmrg
2382781f9a67Smrg# XORG_COMPILER_BRAND
2383781f9a67Smrg# -------------------
2384781f9a67Smrg# Minimum version: 1.14.0
2385781f9a67Smrg#
2386781f9a67Smrg# Checks for various brands of compilers and sets flags as appropriate:
2387781f9a67Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
2388781f9a67Smrg#   clang compiler - sets CLANGCC to "yes"
2389781f9a67Smrg#   Intel compiler - sets INTELCC to "yes"
2390781f9a67Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
2391781f9a67Smrg#
2392781f9a67SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
2393781f9a67SmrgAC_REQUIRE([AC_PROG_CC_C99])
2394781f9a67SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
2395781f9a67SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2396781f9a67SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2397781f9a67Smrg]) # XORG_COMPILER_BRAND
2398781f9a67Smrg
23994def10e6Smrg# XORG_CWARNFLAGS
24004def10e6Smrg# ---------------
24014def10e6Smrg# Minimum version: 1.2.0
24024def10e6Smrg#
24034def10e6Smrg# Defines CWARNFLAGS to enable C compiler warnings.
24044def10e6Smrg#
24054def10e6SmrgAC_DEFUN([XORG_CWARNFLAGS], [
24064def10e6SmrgAC_REQUIRE([AC_PROG_CC_C99])
2407781f9a67SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
24084def10e6Smrgif  test "x$GCC" = xyes ; then
24094def10e6Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
24104def10e6Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
24114def10e6Smrg-Wbad-function-cast -Wformat=2"
24124def10e6Smrg    case `$CC -dumpversion` in
24134def10e6Smrg    3.4.* | 4.*)
24144def10e6Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
24154def10e6Smrg	;;
24164def10e6Smrg    esac
24174def10e6Smrgelse
24184def10e6Smrg    if test "x$SUNCC" = "xyes"; then
24194def10e6Smrg	CWARNFLAGS="-v"
24204def10e6Smrg    fi
24214def10e6Smrgfi
24224def10e6SmrgAC_SUBST(CWARNFLAGS)
24234def10e6Smrg]) # XORG_CWARNFLAGS
2424a0d3b6eaSmrg
24254def10e6Smrg# XORG_STRICT_OPTION
24264def10e6Smrg# -----------------------
24274def10e6Smrg# Minimum version: 1.3.0
2428a0d3b6eaSmrg#
2429781f9a67Smrg# Add configure option to enable strict compilation flags, such as treating
2430781f9a67Smrg# warnings as fatal errors.
2431781f9a67Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
2432781f9a67Smrg# $CWARNFLAGS.
2433781f9a67Smrg#
2434781f9a67Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
2435781f9a67Smrg# when strict compilation is unconditionally desired.
24364def10e6SmrgAC_DEFUN([XORG_STRICT_OPTION], [
24374def10e6Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
24384def10e6SmrgAC_REQUIRE([AC_PROG_CC_C99])
2439781f9a67SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
24404def10e6SmrgAC_REQUIRE([XORG_CWARNFLAGS])
2441a0d3b6eaSmrg
24424def10e6SmrgAC_ARG_ENABLE(strict-compilation,
24434def10e6Smrg			  AS_HELP_STRING([--enable-strict-compilation],
24444def10e6Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
24454def10e6Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2446781f9a67Smrgif test "x$GCC" = xyes ; then
2447781f9a67Smrg    STRICT_CFLAGS="-pedantic -Werror"
2448781f9a67Smrg    # Add -Werror=attributes if supported (gcc 4.2 & later)
2449781f9a67Smrg    AC_MSG_CHECKING([if $CC supports -Werror=attributes])
2450781f9a67Smrg    save_CFLAGS="$CFLAGS"
2451781f9a67Smrg    CFLAGS="$CFLAGS $STRICT_CFLAGS -Werror=attributes"
2452781f9a67Smrg    AC_COMPILE_IFELSE([AC_LANG_SOURCE([return 0;])],
2453781f9a67Smrg		      [STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
2454781f9a67Smrg		       AC_MSG_RESULT([yes])],
2455781f9a67Smrg		      [AC_MSG_RESULT([no])])
2456781f9a67Smrg    CFLAGS="$save_CFLAGS"
2457781f9a67Smrgelif test "x$SUNCC" = "xyes"; then
2458781f9a67Smrg    STRICT_CFLAGS="-errwarn"
2459781f9a67Smrgelif test "x$INTELCC" = "xyes"; then
2460781f9a67Smrg    STRICT_CFLAGS="-Werror"
2461781f9a67Smrgfi
24624def10e6Smrgif test "x$STRICT_COMPILE" = "xyes"; then
2463781f9a67Smrg    CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
24644def10e6Smrgfi
2465781f9a67SmrgAC_SUBST([STRICT_CFLAGS])
24664def10e6SmrgAC_SUBST([CWARNFLAGS])
24674def10e6Smrg]) # XORG_STRICT_OPTION
2468a0d3b6eaSmrg
24694def10e6Smrg# XORG_DEFAULT_OPTIONS
24704def10e6Smrg# --------------------
24714def10e6Smrg# Minimum version: 1.3.0
24724def10e6Smrg#
24734def10e6Smrg# Defines default options for X.Org modules.
24744def10e6Smrg#
24754def10e6SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
24764def10e6SmrgAC_REQUIRE([AC_PROG_INSTALL])
24774def10e6SmrgXORG_CWARNFLAGS
24784def10e6SmrgXORG_STRICT_OPTION
24794def10e6SmrgXORG_RELEASE_VERSION
24804def10e6SmrgXORG_CHANGELOG
24814def10e6SmrgXORG_INSTALL
24824def10e6SmrgXORG_MANPAGE_SECTIONS
24834def10e6Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
24844def10e6Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
24854def10e6Smrg]) # XORG_DEFAULT_OPTIONS
2486f8a31ee4Smrg
24874def10e6Smrg# XORG_INSTALL()
24884def10e6Smrg# ----------------
24894def10e6Smrg# Minimum version: 1.4.0
24904def10e6Smrg#
24914def10e6Smrg# Defines the variable INSTALL_CMD as the command to copy
24924def10e6Smrg# INSTALL from $prefix/share/util-macros.
24934def10e6Smrg#
24944def10e6SmrgAC_DEFUN([XORG_INSTALL], [
24954def10e6SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
24964def10e6Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
24974def10e6SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
24984def10e6Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
24994def10e6Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
25004def10e6Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
25014def10e6SmrgAC_SUBST([INSTALL_CMD])
25024def10e6Smrg]) # XORG_INSTALL
25034def10e6Smrgdnl Copyright 2005 Red Hat, Inc
25044def10e6Smrgdnl
25054def10e6Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
25064def10e6Smrgdnl documentation for any purpose is hereby granted without fee, provided that
25074def10e6Smrgdnl the above copyright notice appear in all copies and that both that
25084def10e6Smrgdnl copyright notice and this permission notice appear in supporting
25094def10e6Smrgdnl documentation.
25104def10e6Smrgdnl
25114def10e6Smrgdnl The above copyright notice and this permission notice shall be included
25124def10e6Smrgdnl in all copies or substantial portions of the Software.
25134def10e6Smrgdnl
25144def10e6Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25154def10e6Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25164def10e6Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25174def10e6Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
25184def10e6Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25194def10e6Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25204def10e6Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
25214def10e6Smrgdnl
25224def10e6Smrgdnl Except as contained in this notice, the name of the copyright holders shall
25234def10e6Smrgdnl not be used in advertising or otherwise to promote the sale, use or
25244def10e6Smrgdnl other dealings in this Software without prior written authorization
25254def10e6Smrgdnl from the copyright holders.
25264def10e6Smrgdnl
2527a0d3b6eaSmrg
25284def10e6Smrg# XORG_RELEASE_VERSION
25294def10e6Smrg# --------------------
25304def10e6Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
25314def10e6Smrg 
25324def10e6SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
25334def10e6Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
25344def10e6Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
25354def10e6Smrg		[Major version of this package])
25364def10e6Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
25374def10e6Smrg	if test "x$PVM" = "x"; then
25384def10e6Smrg		PVM="0"
25394def10e6Smrg	fi
25404def10e6Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
25414def10e6Smrg		[$PVM],
25424def10e6Smrg		[Minor version of this package])
25434def10e6Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
25444def10e6Smrg	if test "x$PVP" = "x"; then
25454def10e6Smrg		PVP="0"
25464def10e6Smrg	fi
25474def10e6Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
25484def10e6Smrg		[$PVP],
25494def10e6Smrg		[Patch version of this package])
25504def10e6Smrg])
2551a0d3b6eaSmrg
25524def10e6Smrg# XORG_CHANGELOG()
25534def10e6Smrg# ----------------
25544def10e6Smrg# Minimum version: 1.2.0
25554def10e6Smrg#
25564def10e6Smrg# Defines the variable CHANGELOG_CMD as the command to generate
25574def10e6Smrg# ChangeLog from git.
25584def10e6Smrg#
25594def10e6Smrg#
25604def10e6SmrgAC_DEFUN([XORG_CHANGELOG], [
25614def10e6SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
25624def10e6Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
25634def10e6Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
25644def10e6Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
25654def10e6SmrgAC_SUBST([CHANGELOG_CMD])
25664def10e6Smrg]) # XORG_CHANGELOG
25674def10e6Smrg
25684def10e6Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
25694def10e6Smrg# 
25704def10e6Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
25714def10e6Smrg#
25724def10e6Smrg# This program is free software; you can redistribute it and/or modify
25734def10e6Smrg# it under the terms of the GNU General Public License as published by
25744def10e6Smrg# the Free Software Foundation; either version 2 of the License, or
25754def10e6Smrg# (at your option) any later version.
25764def10e6Smrg#
25774def10e6Smrg# This program is distributed in the hope that it will be useful, but
25784def10e6Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
25794def10e6Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25804def10e6Smrg# General Public License for more details.
25814def10e6Smrg#
25824def10e6Smrg# You should have received a copy of the GNU General Public License
25834def10e6Smrg# along with this program; if not, write to the Free Software
25844def10e6Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25854def10e6Smrg#
25864def10e6Smrg# As a special exception to the GNU General Public License, if you
25874def10e6Smrg# distribute this file as part of a program that contains a
25884def10e6Smrg# configuration script generated by Autoconf, you may include it under
25894def10e6Smrg# the same distribution terms that you use for the rest of that program.
25904def10e6Smrg
25914def10e6Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
25924def10e6Smrg# ----------------------------------
25934def10e6SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
25944def10e6Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
25954def10e6Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
25964def10e6SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
25974def10e6Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
25984def10e6Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2599a0d3b6eaSmrgfi
26004def10e6Smrgif test -n "$PKG_CONFIG"; then
26014def10e6Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
26024def10e6Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
26034def10e6Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
26044def10e6Smrg		AC_MSG_RESULT([yes])
26054def10e6Smrg	else
26064def10e6Smrg		AC_MSG_RESULT([no])
26074def10e6Smrg		PKG_CONFIG=""
26084def10e6Smrg	fi
26094def10e6Smrg		
26104def10e6Smrgfi[]dnl
26114def10e6Smrg])# PKG_PROG_PKG_CONFIG
2612a0d3b6eaSmrg
26134def10e6Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2614f8a31ee4Smrg#
26154def10e6Smrg# Check to see whether a particular set of modules exists.  Similar
26164def10e6Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
26174def10e6Smrg#
26184def10e6Smrg#
26194def10e6Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
26204def10e6Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
26214def10e6Smrg# PKG_CHECK_EXISTS manually
26224def10e6Smrg# --------------------------------------------------------------
26234def10e6SmrgAC_DEFUN([PKG_CHECK_EXISTS],
26244def10e6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
26254def10e6Smrgif test -n "$PKG_CONFIG" && \
26264def10e6Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
26274def10e6Smrg  m4_ifval([$2], [$2], [:])
26284def10e6Smrgm4_ifvaln([$3], [else
26294def10e6Smrg  $3])dnl
26304def10e6Smrgfi])
2631f8a31ee4Smrg
2632f8a31ee4Smrg
26334def10e6Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
26344def10e6Smrg# ---------------------------------------------
26354def10e6Smrgm4_define([_PKG_CONFIG],
26364def10e6Smrg[if test -n "$$1"; then
26374def10e6Smrg    pkg_cv_[]$1="$$1"
26384def10e6Smrg elif test -n "$PKG_CONFIG"; then
26394def10e6Smrg    PKG_CHECK_EXISTS([$3],
26404def10e6Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
26414def10e6Smrg		     [pkg_failed=yes])
26424def10e6Smrg else
26434def10e6Smrg    pkg_failed=untried
26444def10e6Smrgfi[]dnl
26454def10e6Smrg])# _PKG_CONFIG
2646f8a31ee4Smrg
26474def10e6Smrg# _PKG_SHORT_ERRORS_SUPPORTED
26484def10e6Smrg# -----------------------------
26494def10e6SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
26504def10e6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
26514def10e6Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
26524def10e6Smrg        _pkg_short_errors_supported=yes
26534def10e6Smrgelse
26544def10e6Smrg        _pkg_short_errors_supported=no
26554def10e6Smrgfi[]dnl
26564def10e6Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
2657a0d3b6eaSmrg
2658a0d3b6eaSmrg
26594def10e6Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
26604def10e6Smrg# [ACTION-IF-NOT-FOUND])
2661a0d3b6eaSmrg#
26624def10e6Smrg#
26634def10e6Smrg# Note that if there is a possibility the first call to
26644def10e6Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
26654def10e6Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
26664def10e6Smrg#
26674def10e6Smrg#
26684def10e6Smrg# --------------------------------------------------------------
26694def10e6SmrgAC_DEFUN([PKG_CHECK_MODULES],
26704def10e6Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
26714def10e6SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
26724def10e6SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2673a0d3b6eaSmrg
26744def10e6Smrgpkg_failed=no
26754def10e6SmrgAC_MSG_CHECKING([for $1])
2676f8a31ee4Smrg
26774def10e6Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
26784def10e6Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2679a0d3b6eaSmrg
26804def10e6Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
26814def10e6Smrgand $1[]_LIBS to avoid the need to call pkg-config.
26824def10e6SmrgSee the pkg-config man page for more details.])
2683f8a31ee4Smrg
26844def10e6Smrgif test $pkg_failed = yes; then
26854def10e6Smrg        _PKG_SHORT_ERRORS_SUPPORTED
26864def10e6Smrg        if test $_pkg_short_errors_supported = yes; then
26874def10e6Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
26884def10e6Smrg        else 
26894def10e6Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
26904def10e6Smrg        fi
26914def10e6Smrg	# Put the nasty error message in config.log where it belongs
26924def10e6Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2693a0d3b6eaSmrg
26944def10e6Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
26954def10e6Smrg[Package requirements ($2) were not met:
2696a0d3b6eaSmrg
26974def10e6Smrg$$1_PKG_ERRORS
2698a0d3b6eaSmrg
26994def10e6SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
27004def10e6Smrginstalled software in a non-standard prefix.
2701a0d3b6eaSmrg
27024def10e6Smrg_PKG_TEXT
27034def10e6Smrg])],
27044def10e6Smrg		[AC_MSG_RESULT([no])
27054def10e6Smrg                $4])
27064def10e6Smrgelif test $pkg_failed = untried; then
27074def10e6Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
27084def10e6Smrg[The pkg-config script could not be found or is too old.  Make sure it
27094def10e6Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
27104def10e6Smrgpath to pkg-config.
2711a0d3b6eaSmrg
27124def10e6Smrg_PKG_TEXT
2713a0d3b6eaSmrg
27144def10e6SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
27154def10e6Smrg		[$4])
27164def10e6Smrgelse
27174def10e6Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
27184def10e6Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
27194def10e6Smrg        AC_MSG_RESULT([yes])
27204def10e6Smrg	ifelse([$3], , :, [$3])
27214def10e6Smrgfi[]dnl
27224def10e6Smrg])# PKG_CHECK_MODULES
2723a0d3b6eaSmrg
2724