aclocal.m4 revision b62cc08c
1b62cc08cSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
29fe995a9Smrg
39fe995a9Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4b62cc08cSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
59fe995a9Smrg# This file is free software; the Free Software Foundation
69fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
79fe995a9Smrg# with or without modifications, as long as this notice is preserved.
89fe995a9Smrg
99fe995a9Smrg# This program is distributed in the hope that it will be useful,
109fe995a9Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
119fe995a9Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
129fe995a9Smrg# PARTICULAR PURPOSE.
139fe995a9Smrg
14b62cc08cSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15b62cc08cSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16b62cc08cSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17b62cc08cSmrg[m4_warning([this file was generated for autoconf 2.68.
18b62cc08cSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19b62cc08cSmrgIf you have problems, you may need to regenerate the build system entirely.
20b62cc08cSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
219fe995a9Smrg
22b62cc08cSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
239fe995a9Smrg#
249fe995a9Smrg# This file is free software; the Free Software Foundation
259fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
269fe995a9Smrg# with or without modifications, as long as this notice is preserved.
279fe995a9Smrg
289fe995a9Smrg# AM_AUTOMAKE_VERSION(VERSION)
299fe995a9Smrg# ----------------------------
309fe995a9Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
319fe995a9Smrg# generated from the m4 files accompanying Automake X.Y.
329fe995a9Smrg# (This private macro should not be called outside this file.)
339fe995a9SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34b62cc08cSmrg[am__api_version='1.11'
359fe995a9Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
369fe995a9Smrgdnl require some minimum version.  Point them to the right macro.
37b62cc08cSmrgm4_if([$1], [1.11.1], [],
389fe995a9Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
399fe995a9Smrg])
409fe995a9Smrg
419fe995a9Smrg# _AM_AUTOCONF_VERSION(VERSION)
429fe995a9Smrg# -----------------------------
439fe995a9Smrg# aclocal traces this macro to find the Autoconf version.
449fe995a9Smrg# This is a private macro too.  Using m4_define simplifies
459fe995a9Smrg# the logic in aclocal, which can simply ignore this definition.
469fe995a9Smrgm4_define([_AM_AUTOCONF_VERSION], [])
479fe995a9Smrg
489fe995a9Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
499fe995a9Smrg# -------------------------------
509fe995a9Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51b62cc08cSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
529fe995a9SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53b62cc08cSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
54b62cc08cSmrgm4_ifndef([AC_AUTOCONF_VERSION],
55b62cc08cSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56b62cc08cSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
579fe995a9Smrg
589fe995a9Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
599fe995a9Smrg
609fe995a9Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
619fe995a9Smrg#
629fe995a9Smrg# This file is free software; the Free Software Foundation
639fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
649fe995a9Smrg# with or without modifications, as long as this notice is preserved.
659fe995a9Smrg
669fe995a9Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
679fe995a9Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
689fe995a9Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
699fe995a9Smrg#
709fe995a9Smrg# Of course, Automake must honor this variable whenever it calls a
719fe995a9Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
729fe995a9Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
739fe995a9Smrg# depending on how configure is run.  This is pretty annoying, since
749fe995a9Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
759fe995a9Smrg# source directory, any form will work fine, but in subdirectories a
769fe995a9Smrg# relative path needs to be adjusted first.
779fe995a9Smrg#
789fe995a9Smrg# $ac_aux_dir/missing
799fe995a9Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
809fe995a9Smrg# $top_srcdir/$ac_aux_dir/missing
819fe995a9Smrg#    fails if $ac_aux_dir is absolute,
829fe995a9Smrg#    fails when called from a subdirectory in a VPATH build with
839fe995a9Smrg#          a relative $ac_aux_dir
849fe995a9Smrg#
859fe995a9Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
869fe995a9Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
879fe995a9Smrg# harmless because $srcdir is `.', but things will broke when you
889fe995a9Smrg# start a VPATH build or use an absolute $srcdir.
899fe995a9Smrg#
909fe995a9Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
919fe995a9Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
929fe995a9Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
939fe995a9Smrg# and then we would define $MISSING as
949fe995a9Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
959fe995a9Smrg# This will work as long as MISSING is not called from configure, because
969fe995a9Smrg# unfortunately $(top_srcdir) has no meaning in configure.
979fe995a9Smrg# However there are other variables, like CC, which are often used in
989fe995a9Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
999fe995a9Smrg#
1009fe995a9Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
1019fe995a9Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
1029fe995a9Smrg# configured tree to be moved without reconfiguration.
1039fe995a9Smrg
1049fe995a9SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1059fe995a9Smrg[dnl Rely on autoconf to set up CDPATH properly.
1069fe995a9SmrgAC_PREREQ([2.50])dnl
1079fe995a9Smrg# expand $ac_aux_dir to an absolute path
1089fe995a9Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
1099fe995a9Smrg])
1109fe995a9Smrg
1119fe995a9Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1129fe995a9Smrg
113b62cc08cSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1149fe995a9Smrg# Free Software Foundation, Inc.
1159fe995a9Smrg#
1169fe995a9Smrg# This file is free software; the Free Software Foundation
1179fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
1189fe995a9Smrg# with or without modifications, as long as this notice is preserved.
1199fe995a9Smrg
120b62cc08cSmrg# serial 9
1219fe995a9Smrg
1229fe995a9Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1239fe995a9Smrg# -------------------------------------
1249fe995a9Smrg# Define a conditional.
1259fe995a9SmrgAC_DEFUN([AM_CONDITIONAL],
1269fe995a9Smrg[AC_PREREQ(2.52)dnl
1279fe995a9Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1289fe995a9Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1299fe995a9SmrgAC_SUBST([$1_TRUE])dnl
1309fe995a9SmrgAC_SUBST([$1_FALSE])dnl
1319fe995a9Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1329fe995a9Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133b62cc08cSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1349fe995a9Smrgif $2; then
1359fe995a9Smrg  $1_TRUE=
1369fe995a9Smrg  $1_FALSE='#'
1379fe995a9Smrgelse
1389fe995a9Smrg  $1_TRUE='#'
1399fe995a9Smrg  $1_FALSE=
1409fe995a9Smrgfi
1419fe995a9SmrgAC_CONFIG_COMMANDS_PRE(
1429fe995a9Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1439fe995a9Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1449fe995a9SmrgUsually this means the macro was only invoked conditionally.]])
1459fe995a9Smrgfi])])
1469fe995a9Smrg
147b62cc08cSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1489fe995a9Smrg# Free Software Foundation, Inc.
1499fe995a9Smrg#
1509fe995a9Smrg# This file is free software; the Free Software Foundation
1519fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
1529fe995a9Smrg# with or without modifications, as long as this notice is preserved.
1539fe995a9Smrg
154b62cc08cSmrg# serial 10
1559fe995a9Smrg
1569fe995a9Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1579fe995a9Smrg# written in clear, in which case automake, when reading aclocal.m4,
1589fe995a9Smrg# will think it sees a *use*, and therefore will trigger all it's
1599fe995a9Smrg# C support machinery.  Also note that it means that autoscan, seeing
1609fe995a9Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1619fe995a9Smrg
1629fe995a9Smrg
1639fe995a9Smrg# _AM_DEPENDENCIES(NAME)
1649fe995a9Smrg# ----------------------
1659fe995a9Smrg# See how the compiler implements dependency checking.
1669fe995a9Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1679fe995a9Smrg# We try a few techniques and use that to set a single cache variable.
1689fe995a9Smrg#
1699fe995a9Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1709fe995a9Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1719fe995a9Smrg# dependency, and given that the user is not expected to run this macro,
1729fe995a9Smrg# just rely on AC_PROG_CC.
1739fe995a9SmrgAC_DEFUN([_AM_DEPENDENCIES],
1749fe995a9Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1759fe995a9SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1769fe995a9SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1779fe995a9SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1789fe995a9Smrg
1799fe995a9Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1809fe995a9Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1819fe995a9Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1829fe995a9Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1839fe995a9Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1849fe995a9Smrg                   [depcc="$$1"   am_compiler_list=])
1859fe995a9Smrg
1869fe995a9SmrgAC_CACHE_CHECK([dependency style of $depcc],
1879fe995a9Smrg               [am_cv_$1_dependencies_compiler_type],
1889fe995a9Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1899fe995a9Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1909fe995a9Smrg  # making bogus files that we don't know about and never remove.  For
1919fe995a9Smrg  # instance it was reported that on HP-UX the gcc test will end up
1929fe995a9Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
1939fe995a9Smrg  # in D'.
1949fe995a9Smrg  mkdir conftest.dir
1959fe995a9Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1969fe995a9Smrg  # using a relative directory.
1979fe995a9Smrg  cp "$am_depcomp" conftest.dir
1989fe995a9Smrg  cd conftest.dir
1999fe995a9Smrg  # We will build objects and dependencies in a subdirectory because
2009fe995a9Smrg  # it helps to detect inapplicable dependency modes.  For instance
2019fe995a9Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2029fe995a9Smrg  # side effect of compilation, but ICC will put the dependencies in
2039fe995a9Smrg  # the current directory while Tru64 will put them in the object
2049fe995a9Smrg  # directory.
2059fe995a9Smrg  mkdir sub
2069fe995a9Smrg
2079fe995a9Smrg  am_cv_$1_dependencies_compiler_type=none
2089fe995a9Smrg  if test "$am_compiler_list" = ""; then
2099fe995a9Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2109fe995a9Smrg  fi
211b62cc08cSmrg  am__universal=false
212b62cc08cSmrg  m4_case([$1], [CC],
213b62cc08cSmrg    [case " $depcc " in #(
214b62cc08cSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215b62cc08cSmrg     esac],
216b62cc08cSmrg    [CXX],
217b62cc08cSmrg    [case " $depcc " in #(
218b62cc08cSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219b62cc08cSmrg     esac])
220b62cc08cSmrg
2219fe995a9Smrg  for depmode in $am_compiler_list; do
2229fe995a9Smrg    # Setup a source with many dependencies, because some compilers
2239fe995a9Smrg    # like to wrap large dependency lists on column 80 (with \), and
2249fe995a9Smrg    # we should not choose a depcomp mode which is confused by this.
2259fe995a9Smrg    #
2269fe995a9Smrg    # We need to recreate these files for each test, as the compiler may
2279fe995a9Smrg    # overwrite some of them when testing with obscure command lines.
2289fe995a9Smrg    # This happens at least with the AIX C compiler.
2299fe995a9Smrg    : > sub/conftest.c
2309fe995a9Smrg    for i in 1 2 3 4 5 6; do
2319fe995a9Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2329fe995a9Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2339fe995a9Smrg      # Solaris 8's {/usr,}/bin/sh.
2349fe995a9Smrg      touch sub/conftst$i.h
2359fe995a9Smrg    done
2369fe995a9Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2379fe995a9Smrg
238b62cc08cSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239b62cc08cSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240b62cc08cSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241b62cc08cSmrg    # versions had trouble with output in subdirs
242b62cc08cSmrg    am__obj=sub/conftest.${OBJEXT-o}
243b62cc08cSmrg    am__minus_obj="-o $am__obj"
2449fe995a9Smrg    case $depmode in
245b62cc08cSmrg    gcc)
246b62cc08cSmrg      # This depmode causes a compiler race in universal mode.
247b62cc08cSmrg      test "$am__universal" = false || continue
248b62cc08cSmrg      ;;
2499fe995a9Smrg    nosideeffect)
2509fe995a9Smrg      # after this tag, mechanisms are not by side-effect, so they'll
2519fe995a9Smrg      # only be used when explicitly requested
2529fe995a9Smrg      if test "x$enable_dependency_tracking" = xyes; then
2539fe995a9Smrg	continue
2549fe995a9Smrg      else
2559fe995a9Smrg	break
2569fe995a9Smrg      fi
2579fe995a9Smrg      ;;
258b62cc08cSmrg    msvisualcpp | msvcmsys)
259b62cc08cSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
260b62cc08cSmrg      # not run yet.  These depmodes are late enough in the game, and
261b62cc08cSmrg      # so weak that their functioning should not be impacted.
262b62cc08cSmrg      am__obj=conftest.${OBJEXT-o}
263b62cc08cSmrg      am__minus_obj=
264b62cc08cSmrg      ;;
2659fe995a9Smrg    none) break ;;
2669fe995a9Smrg    esac
2679fe995a9Smrg    if depmode=$depmode \
268b62cc08cSmrg       source=sub/conftest.c object=$am__obj \
2699fe995a9Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270b62cc08cSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2719fe995a9Smrg         >/dev/null 2>conftest.err &&
2729fe995a9Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2739fe995a9Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274b62cc08cSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2759fe995a9Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2769fe995a9Smrg      # icc doesn't choke on unknown options, it will just issue warnings
2779fe995a9Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
2789fe995a9Smrg      # that says an option was ignored or not supported.
2799fe995a9Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2809fe995a9Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2819fe995a9Smrg      # The diagnosis changed in icc 8.0:
2829fe995a9Smrg      #   icc: Command line remark: option '-MP' not supported
2839fe995a9Smrg      if (grep 'ignoring option' conftest.err ||
2849fe995a9Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2859fe995a9Smrg        am_cv_$1_dependencies_compiler_type=$depmode
2869fe995a9Smrg        break
2879fe995a9Smrg      fi
2889fe995a9Smrg    fi
2899fe995a9Smrg  done
2909fe995a9Smrg
2919fe995a9Smrg  cd ..
2929fe995a9Smrg  rm -rf conftest.dir
2939fe995a9Smrgelse
2949fe995a9Smrg  am_cv_$1_dependencies_compiler_type=none
2959fe995a9Smrgfi
2969fe995a9Smrg])
2979fe995a9SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2989fe995a9SmrgAM_CONDITIONAL([am__fastdep$1], [
2999fe995a9Smrg  test "x$enable_dependency_tracking" != xno \
3009fe995a9Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3019fe995a9Smrg])
3029fe995a9Smrg
3039fe995a9Smrg
3049fe995a9Smrg# AM_SET_DEPDIR
3059fe995a9Smrg# -------------
3069fe995a9Smrg# Choose a directory name for dependency files.
3079fe995a9Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3089fe995a9SmrgAC_DEFUN([AM_SET_DEPDIR],
3099fe995a9Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3109fe995a9SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3119fe995a9Smrg])
3129fe995a9Smrg
3139fe995a9Smrg
3149fe995a9Smrg# AM_DEP_TRACK
3159fe995a9Smrg# ------------
3169fe995a9SmrgAC_DEFUN([AM_DEP_TRACK],
3179fe995a9Smrg[AC_ARG_ENABLE(dependency-tracking,
3189fe995a9Smrg[  --disable-dependency-tracking  speeds up one-time build
3199fe995a9Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3209fe995a9Smrgif test "x$enable_dependency_tracking" != xno; then
3219fe995a9Smrg  am_depcomp="$ac_aux_dir/depcomp"
3229fe995a9Smrg  AMDEPBACKSLASH='\'
3239fe995a9Smrgfi
3249fe995a9SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3259fe995a9SmrgAC_SUBST([AMDEPBACKSLASH])dnl
3269fe995a9Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3279fe995a9Smrg])
3289fe995a9Smrg
3299fe995a9Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3309fe995a9Smrg
331b62cc08cSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
3329fe995a9Smrg# Free Software Foundation, Inc.
3339fe995a9Smrg#
3349fe995a9Smrg# This file is free software; the Free Software Foundation
3359fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
3369fe995a9Smrg# with or without modifications, as long as this notice is preserved.
3379fe995a9Smrg
338b62cc08cSmrg#serial 5
3399fe995a9Smrg
3409fe995a9Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3419fe995a9Smrg# ------------------------------
3429fe995a9SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343b62cc08cSmrg[{
344b62cc08cSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345b62cc08cSmrg  # are listed without --file.  Let's play safe and only enable the eval
346b62cc08cSmrg  # if we detect the quoting.
347b62cc08cSmrg  case $CONFIG_FILES in
348b62cc08cSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
349b62cc08cSmrg  *)   set x $CONFIG_FILES ;;
350b62cc08cSmrg  esac
351b62cc08cSmrg  shift
352b62cc08cSmrg  for mf
353b62cc08cSmrg  do
354b62cc08cSmrg    # Strip MF so we end up with the name of the file.
355b62cc08cSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356b62cc08cSmrg    # Check whether this is an Automake generated Makefile or not.
357b62cc08cSmrg    # We used to match only the files named `Makefile.in', but
358b62cc08cSmrg    # some people rename them; so instead we look at the file content.
359b62cc08cSmrg    # Grep'ing the first line is not enough: some people post-process
360b62cc08cSmrg    # each Makefile.in and add a new line on top of each file to say so.
361b62cc08cSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
362b62cc08cSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
363b62cc08cSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364b62cc08cSmrg      dirpart=`AS_DIRNAME("$mf")`
365b62cc08cSmrg    else
366b62cc08cSmrg      continue
367b62cc08cSmrg    fi
368b62cc08cSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
369b62cc08cSmrg    # from the Makefile without running `make'.
370b62cc08cSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371b62cc08cSmrg    test -z "$DEPDIR" && continue
372b62cc08cSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373b62cc08cSmrg    test -z "am__include" && continue
374b62cc08cSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375b62cc08cSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
376b62cc08cSmrg    U=`sed -n 's/^U = //p' < "$mf"`
377b62cc08cSmrg    # Find all dependency output files, they are included files with
378b62cc08cSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379b62cc08cSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380b62cc08cSmrg    # expansion.
381b62cc08cSmrg    for file in `sed -n "
382b62cc08cSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383b62cc08cSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384b62cc08cSmrg      # Make sure the directory exists.
385b62cc08cSmrg      test -f "$dirpart/$file" && continue
386b62cc08cSmrg      fdir=`AS_DIRNAME(["$file"])`
387b62cc08cSmrg      AS_MKDIR_P([$dirpart/$fdir])
388b62cc08cSmrg      # echo "creating $dirpart/$file"
389b62cc08cSmrg      echo '# dummy' > "$dirpart/$file"
390b62cc08cSmrg    done
3919fe995a9Smrg  done
392b62cc08cSmrg}
3939fe995a9Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3949fe995a9Smrg
3959fe995a9Smrg
3969fe995a9Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3979fe995a9Smrg# -----------------------------
3989fe995a9Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
3999fe995a9Smrg#
4009fe995a9Smrg# This code is only required when automatic dependency tracking
4019fe995a9Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
4029fe995a9Smrg# need in order to bootstrap the dependency handling code.
4039fe995a9SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4049fe995a9Smrg[AC_CONFIG_COMMANDS([depfiles],
4059fe995a9Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4069fe995a9Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4079fe995a9Smrg])
4089fe995a9Smrg
4099fe995a9Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
4109fe995a9Smrg# Free Software Foundation, Inc.
4119fe995a9Smrg#
4129fe995a9Smrg# This file is free software; the Free Software Foundation
4139fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
4149fe995a9Smrg# with or without modifications, as long as this notice is preserved.
4159fe995a9Smrg
4169fe995a9Smrg# serial 8
4179fe995a9Smrg
4189fe995a9Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
4199fe995a9SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
4209fe995a9Smrg
4219fe995a9Smrg# Do all the work for Automake.                             -*- Autoconf -*-
4229fe995a9Smrg
4239fe995a9Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
424b62cc08cSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4259fe995a9Smrg#
4269fe995a9Smrg# This file is free software; the Free Software Foundation
4279fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
4289fe995a9Smrg# with or without modifications, as long as this notice is preserved.
4299fe995a9Smrg
430b62cc08cSmrg# serial 16
4319fe995a9Smrg
4329fe995a9Smrg# This macro actually does too much.  Some checks are only needed if
4339fe995a9Smrg# your package does certain things.  But this isn't really a big deal.
4349fe995a9Smrg
4359fe995a9Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4369fe995a9Smrg# AM_INIT_AUTOMAKE([OPTIONS])
4379fe995a9Smrg# -----------------------------------------------
4389fe995a9Smrg# The call with PACKAGE and VERSION arguments is the old style
4399fe995a9Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
4409fe995a9Smrg# and VERSION should now be passed to AC_INIT and removed from
4419fe995a9Smrg# the call to AM_INIT_AUTOMAKE.
4429fe995a9Smrg# We support both call styles for the transition.  After
4439fe995a9Smrg# the next Automake release, Autoconf can make the AC_INIT
4449fe995a9Smrg# arguments mandatory, and then we can depend on a new Autoconf
4459fe995a9Smrg# release and drop the old call support.
4469fe995a9SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
447b62cc08cSmrg[AC_PREREQ([2.62])dnl
4489fe995a9Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4499fe995a9Smrgdnl the ones we care about.
4509fe995a9Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4519fe995a9SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4529fe995a9SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4539fe995a9Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4549fe995a9Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4559fe995a9Smrg  # is not polluted with repeated "-I."
4569fe995a9Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4579fe995a9Smrg  # test to see if srcdir already configured
4589fe995a9Smrg  if test -f $srcdir/config.status; then
4599fe995a9Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4609fe995a9Smrg  fi
4619fe995a9Smrgfi
4629fe995a9Smrg
4639fe995a9Smrg# test whether we have cygpath
4649fe995a9Smrgif test -z "$CYGPATH_W"; then
4659fe995a9Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4669fe995a9Smrg    CYGPATH_W='cygpath -w'
4679fe995a9Smrg  else
4689fe995a9Smrg    CYGPATH_W=echo
4699fe995a9Smrg  fi
4709fe995a9Smrgfi
4719fe995a9SmrgAC_SUBST([CYGPATH_W])
4729fe995a9Smrg
4739fe995a9Smrg# Define the identity of the package.
4749fe995a9Smrgdnl Distinguish between old-style and new-style calls.
4759fe995a9Smrgm4_ifval([$2],
4769fe995a9Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4779fe995a9Smrg AC_SUBST([PACKAGE], [$1])dnl
4789fe995a9Smrg AC_SUBST([VERSION], [$2])],
4799fe995a9Smrg[_AM_SET_OPTIONS([$1])dnl
4809fe995a9Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4819fe995a9Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4829fe995a9Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4839fe995a9Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4849fe995a9Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4859fe995a9Smrg
4869fe995a9Smrg_AM_IF_OPTION([no-define],,
4879fe995a9Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4889fe995a9Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4899fe995a9Smrg
4909fe995a9Smrg# Some tools Automake needs.
4919fe995a9SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4929fe995a9SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4939fe995a9SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4949fe995a9SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4959fe995a9SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4969fe995a9SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4979fe995a9SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
498b62cc08cSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
499b62cc08cSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
5009fe995a9SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
5019fe995a9Smrg# We need awk for the "check" target.  The system "awk" is bad on
5029fe995a9Smrg# some platforms.
5039fe995a9SmrgAC_REQUIRE([AC_PROG_AWK])dnl
5049fe995a9SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
5059fe995a9SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
5069fe995a9Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
507b62cc08cSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
508b62cc08cSmrg			     [_AM_PROG_TAR([v7])])])
5099fe995a9Smrg_AM_IF_OPTION([no-dependencies],,
5109fe995a9Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
511b62cc08cSmrg		  [_AM_DEPENDENCIES(CC)],
512b62cc08cSmrg		  [define([AC_PROG_CC],
513b62cc08cSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
5149fe995a9SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
515b62cc08cSmrg		  [_AM_DEPENDENCIES(CXX)],
516b62cc08cSmrg		  [define([AC_PROG_CXX],
517b62cc08cSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5189fe995a9SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
519b62cc08cSmrg		  [_AM_DEPENDENCIES(OBJC)],
520b62cc08cSmrg		  [define([AC_PROG_OBJC],
521b62cc08cSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
5229fe995a9Smrg])
523b62cc08cSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
524b62cc08cSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
525b62cc08cSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
526b62cc08cSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
527b62cc08cSmrgAC_CONFIG_COMMANDS_PRE(dnl
528b62cc08cSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
529b62cc08cSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5309fe995a9Smrg])
5319fe995a9Smrg
532b62cc08cSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
533b62cc08cSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
534b62cc08cSmrgdnl mangled by Autoconf and run in a shell conditional statement.
535b62cc08cSmrgm4_define([_AC_COMPILER_EXEEXT],
536b62cc08cSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537b62cc08cSmrg
5389fe995a9Smrg
5399fe995a9Smrg# When config.status generates a header, we must update the stamp-h file.
5409fe995a9Smrg# This file resides in the same directory as the config header
5419fe995a9Smrg# that is generated.  The stamp files are numbered to have different names.
5429fe995a9Smrg
5439fe995a9Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
5449fe995a9Smrg# loop where config.status creates the headers, so we can generate
5459fe995a9Smrg# our stamp files there.
5469fe995a9SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
5479fe995a9Smrg[# Compute $1's index in $config_headers.
548b62cc08cSmrg_am_arg=$1
5499fe995a9Smrg_am_stamp_count=1
5509fe995a9Smrgfor _am_header in $config_headers :; do
5519fe995a9Smrg  case $_am_header in
552b62cc08cSmrg    $_am_arg | $_am_arg:* )
5539fe995a9Smrg      break ;;
5549fe995a9Smrg    * )
5559fe995a9Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5569fe995a9Smrg  esac
5579fe995a9Smrgdone
558b62cc08cSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
5599fe995a9Smrg
560b62cc08cSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
5619fe995a9Smrg#
5629fe995a9Smrg# This file is free software; the Free Software Foundation
5639fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
5649fe995a9Smrg# with or without modifications, as long as this notice is preserved.
5659fe995a9Smrg
5669fe995a9Smrg# AM_PROG_INSTALL_SH
5679fe995a9Smrg# ------------------
5689fe995a9Smrg# Define $install_sh.
5699fe995a9SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5709fe995a9Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
571b62cc08cSmrgif test x"${install_sh}" != xset; then
572b62cc08cSmrg  case $am_aux_dir in
573b62cc08cSmrg  *\ * | *\	*)
574b62cc08cSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
575b62cc08cSmrg  *)
576b62cc08cSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
577b62cc08cSmrg  esac
578b62cc08cSmrgfi
5799fe995a9SmrgAC_SUBST(install_sh)])
5809fe995a9Smrg
5819fe995a9Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5829fe995a9Smrg#
5839fe995a9Smrg# This file is free software; the Free Software Foundation
5849fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
5859fe995a9Smrg# with or without modifications, as long as this notice is preserved.
5869fe995a9Smrg
5879fe995a9Smrg# serial 2
5889fe995a9Smrg
5899fe995a9Smrg# Check whether the underlying file-system supports filenames
5909fe995a9Smrg# with a leading dot.  For instance MS-DOS doesn't.
5919fe995a9SmrgAC_DEFUN([AM_SET_LEADING_DOT],
5929fe995a9Smrg[rm -rf .tst 2>/dev/null
5939fe995a9Smrgmkdir .tst 2>/dev/null
5949fe995a9Smrgif test -d .tst; then
5959fe995a9Smrg  am__leading_dot=.
5969fe995a9Smrgelse
5979fe995a9Smrg  am__leading_dot=_
5989fe995a9Smrgfi
5999fe995a9Smrgrmdir .tst 2>/dev/null
6009fe995a9SmrgAC_SUBST([am__leading_dot])])
6019fe995a9Smrg
6029fe995a9Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
6039fe995a9Smrg# From Jim Meyering
6049fe995a9Smrg
605b62cc08cSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
6069fe995a9Smrg# Free Software Foundation, Inc.
6079fe995a9Smrg#
6089fe995a9Smrg# This file is free software; the Free Software Foundation
6099fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
6109fe995a9Smrg# with or without modifications, as long as this notice is preserved.
6119fe995a9Smrg
612b62cc08cSmrg# serial 5
6139fe995a9Smrg
614b62cc08cSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
615b62cc08cSmrg# ----------------------------------
616b62cc08cSmrg# Control maintainer-specific portions of Makefiles.
617b62cc08cSmrg# Default is to disable them, unless `enable' is passed literally.
618b62cc08cSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
619b62cc08cSmrg# can override the default with the --enable/--disable switch.
6209fe995a9SmrgAC_DEFUN([AM_MAINTAINER_MODE],
621b62cc08cSmrg[m4_case(m4_default([$1], [disable]),
622b62cc08cSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
623b62cc08cSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
624b62cc08cSmrg       [m4_define([am_maintainer_other], [enable])
625b62cc08cSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
626b62cc08cSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
627b62cc08cSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
628b62cc08cSmrg  AC_ARG_ENABLE([maintainer-mode],
629b62cc08cSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
6309fe995a9Smrg			  (and sometimes confusing) to the casual installer],
631b62cc08cSmrg      [USE_MAINTAINER_MODE=$enableval],
632b62cc08cSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
6339fe995a9Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
634b62cc08cSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
6359fe995a9Smrg  MAINT=$MAINTAINER_MODE_TRUE
636b62cc08cSmrg  AC_SUBST([MAINT])dnl
6379fe995a9Smrg]
6389fe995a9Smrg)
6399fe995a9Smrg
6409fe995a9SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
6419fe995a9Smrg
6429fe995a9Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6439fe995a9Smrg
644b62cc08cSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
6459fe995a9Smrg#
6469fe995a9Smrg# This file is free software; the Free Software Foundation
6479fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
6489fe995a9Smrg# with or without modifications, as long as this notice is preserved.
6499fe995a9Smrg
650b62cc08cSmrg# serial 4
6519fe995a9Smrg
6529fe995a9Smrg# AM_MAKE_INCLUDE()
6539fe995a9Smrg# -----------------
6549fe995a9Smrg# Check to see how make treats includes.
6559fe995a9SmrgAC_DEFUN([AM_MAKE_INCLUDE],
6569fe995a9Smrg[am_make=${MAKE-make}
6579fe995a9Smrgcat > confinc << 'END'
6589fe995a9Smrgam__doit:
659b62cc08cSmrg	@echo this is the am__doit target
6609fe995a9Smrg.PHONY: am__doit
6619fe995a9SmrgEND
6629fe995a9Smrg# If we don't find an include directive, just comment out the code.
6639fe995a9SmrgAC_MSG_CHECKING([for style of include used by $am_make])
6649fe995a9Smrgam__include="#"
6659fe995a9Smrgam__quote=
6669fe995a9Smrg_am_result=none
6679fe995a9Smrg# First try GNU make style include.
6689fe995a9Smrgecho "include confinc" > confmf
669b62cc08cSmrg# Ignore all kinds of additional output from `make'.
670b62cc08cSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
671b62cc08cSmrg*the\ am__doit\ target*)
672b62cc08cSmrg  am__include=include
673b62cc08cSmrg  am__quote=
674b62cc08cSmrg  _am_result=GNU
675b62cc08cSmrg  ;;
676b62cc08cSmrgesac
6779fe995a9Smrg# Now try BSD make style include.
6789fe995a9Smrgif test "$am__include" = "#"; then
6799fe995a9Smrg   echo '.include "confinc"' > confmf
680b62cc08cSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
681b62cc08cSmrg   *the\ am__doit\ target*)
682b62cc08cSmrg     am__include=.include
683b62cc08cSmrg     am__quote="\""
684b62cc08cSmrg     _am_result=BSD
685b62cc08cSmrg     ;;
686b62cc08cSmrg   esac
6879fe995a9Smrgfi
6889fe995a9SmrgAC_SUBST([am__include])
6899fe995a9SmrgAC_SUBST([am__quote])
6909fe995a9SmrgAC_MSG_RESULT([$_am_result])
6919fe995a9Smrgrm -f confinc confmf
6929fe995a9Smrg])
6939fe995a9Smrg
6949fe995a9Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6959fe995a9Smrg
696b62cc08cSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
6979fe995a9Smrg# Free Software Foundation, Inc.
6989fe995a9Smrg#
6999fe995a9Smrg# This file is free software; the Free Software Foundation
7009fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
7019fe995a9Smrg# with or without modifications, as long as this notice is preserved.
7029fe995a9Smrg
703b62cc08cSmrg# serial 6
7049fe995a9Smrg
7059fe995a9Smrg# AM_MISSING_PROG(NAME, PROGRAM)
7069fe995a9Smrg# ------------------------------
7079fe995a9SmrgAC_DEFUN([AM_MISSING_PROG],
7089fe995a9Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
7099fe995a9Smrg$1=${$1-"${am_missing_run}$2"}
7109fe995a9SmrgAC_SUBST($1)])
7119fe995a9Smrg
7129fe995a9Smrg
7139fe995a9Smrg# AM_MISSING_HAS_RUN
7149fe995a9Smrg# ------------------
7159fe995a9Smrg# Define MISSING if not defined so far and test if it supports --run.
7169fe995a9Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
7179fe995a9SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7189fe995a9Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7199fe995a9SmrgAC_REQUIRE_AUX_FILE([missing])dnl
720b62cc08cSmrgif test x"${MISSING+set}" != xset; then
721b62cc08cSmrg  case $am_aux_dir in
722b62cc08cSmrg  *\ * | *\	*)
723b62cc08cSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
724b62cc08cSmrg  *)
725b62cc08cSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
726b62cc08cSmrg  esac
727b62cc08cSmrgfi
7289fe995a9Smrg# Use eval to expand $SHELL
7299fe995a9Smrgif eval "$MISSING --run true"; then
7309fe995a9Smrg  am_missing_run="$MISSING --run "
7319fe995a9Smrgelse
7329fe995a9Smrg  am_missing_run=
7339fe995a9Smrg  AC_MSG_WARN([`missing' script is too old or missing])
7349fe995a9Smrgfi
7359fe995a9Smrg])
7369fe995a9Smrg
7379fe995a9Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
7389fe995a9Smrg#
7399fe995a9Smrg# This file is free software; the Free Software Foundation
7409fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
7419fe995a9Smrg# with or without modifications, as long as this notice is preserved.
7429fe995a9Smrg
7439fe995a9Smrg# AM_PROG_MKDIR_P
7449fe995a9Smrg# ---------------
7459fe995a9Smrg# Check for `mkdir -p'.
7469fe995a9SmrgAC_DEFUN([AM_PROG_MKDIR_P],
7479fe995a9Smrg[AC_PREREQ([2.60])dnl
7489fe995a9SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7499fe995a9Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7509fe995a9Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
7519fe995a9Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7529fe995a9Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7539fe995a9Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7549fe995a9Smrgdnl adjustment using top_builddir (which is defined more often than
7559fe995a9Smrgdnl MKDIR_P).
7569fe995a9SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7579fe995a9Smrgcase $mkdir_p in
7589fe995a9Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7599fe995a9Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7609fe995a9Smrgesac
7619fe995a9Smrg])
7629fe995a9Smrg
7639fe995a9Smrg# Helper functions for option handling.                     -*- Autoconf -*-
7649fe995a9Smrg
765b62cc08cSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
7669fe995a9Smrg#
7679fe995a9Smrg# This file is free software; the Free Software Foundation
7689fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
7699fe995a9Smrg# with or without modifications, as long as this notice is preserved.
7709fe995a9Smrg
771b62cc08cSmrg# serial 4
7729fe995a9Smrg
7739fe995a9Smrg# _AM_MANGLE_OPTION(NAME)
7749fe995a9Smrg# -----------------------
7759fe995a9SmrgAC_DEFUN([_AM_MANGLE_OPTION],
7769fe995a9Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7779fe995a9Smrg
7789fe995a9Smrg# _AM_SET_OPTION(NAME)
7799fe995a9Smrg# ------------------------------
7809fe995a9Smrg# Set option NAME.  Presently that only means defining a flag for this option.
7819fe995a9SmrgAC_DEFUN([_AM_SET_OPTION],
7829fe995a9Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7839fe995a9Smrg
7849fe995a9Smrg# _AM_SET_OPTIONS(OPTIONS)
7859fe995a9Smrg# ----------------------------------
7869fe995a9Smrg# OPTIONS is a space-separated list of Automake options.
7879fe995a9SmrgAC_DEFUN([_AM_SET_OPTIONS],
788b62cc08cSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7899fe995a9Smrg
7909fe995a9Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7919fe995a9Smrg# -------------------------------------------
7929fe995a9Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7939fe995a9SmrgAC_DEFUN([_AM_IF_OPTION],
7949fe995a9Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7959fe995a9Smrg
7969fe995a9Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7979fe995a9Smrg
798b62cc08cSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
7999fe995a9Smrg# Free Software Foundation, Inc.
8009fe995a9Smrg#
8019fe995a9Smrg# This file is free software; the Free Software Foundation
8029fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
8039fe995a9Smrg# with or without modifications, as long as this notice is preserved.
8049fe995a9Smrg
805b62cc08cSmrg# serial 5
8069fe995a9Smrg
8079fe995a9Smrg# AM_SANITY_CHECK
8089fe995a9Smrg# ---------------
8099fe995a9SmrgAC_DEFUN([AM_SANITY_CHECK],
8109fe995a9Smrg[AC_MSG_CHECKING([whether build environment is sane])
8119fe995a9Smrg# Just in case
8129fe995a9Smrgsleep 1
8139fe995a9Smrgecho timestamp > conftest.file
814b62cc08cSmrg# Reject unsafe characters in $srcdir or the absolute working directory
815b62cc08cSmrg# name.  Accept space and tab only in the latter.
816b62cc08cSmrgam_lf='
817b62cc08cSmrg'
818b62cc08cSmrgcase `pwd` in
819b62cc08cSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
820b62cc08cSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
821b62cc08cSmrgesac
822b62cc08cSmrgcase $srcdir in
823b62cc08cSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
824b62cc08cSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
825b62cc08cSmrgesac
826b62cc08cSmrg
8279fe995a9Smrg# Do `set' in a subshell so we don't clobber the current shell's
8289fe995a9Smrg# arguments.  Must try -L first in case configure is actually a
8299fe995a9Smrg# symlink; some systems play weird games with the mod time of symlinks
8309fe995a9Smrg# (eg FreeBSD returns the mod time of the symlink's containing
8319fe995a9Smrg# directory).
8329fe995a9Smrgif (
833b62cc08cSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8349fe995a9Smrg   if test "$[*]" = "X"; then
8359fe995a9Smrg      # -L didn't work.
836b62cc08cSmrg      set X `ls -t "$srcdir/configure" conftest.file`
8379fe995a9Smrg   fi
8389fe995a9Smrg   rm -f conftest.file
8399fe995a9Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
8409fe995a9Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8419fe995a9Smrg
8429fe995a9Smrg      # If neither matched, then we have a broken ls.  This can happen
8439fe995a9Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
8449fe995a9Smrg      # broken ls alias from the environment.  This has actually
8459fe995a9Smrg      # happened.  Such a system could not be considered "sane".
8469fe995a9Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8479fe995a9Smrgalias in your environment])
8489fe995a9Smrg   fi
8499fe995a9Smrg
8509fe995a9Smrg   test "$[2]" = conftest.file
8519fe995a9Smrg   )
8529fe995a9Smrgthen
8539fe995a9Smrg   # Ok.
8549fe995a9Smrg   :
8559fe995a9Smrgelse
8569fe995a9Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
8579fe995a9SmrgCheck your system clock])
8589fe995a9Smrgfi
8599fe995a9SmrgAC_MSG_RESULT(yes)])
8609fe995a9Smrg
861b62cc08cSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
862b62cc08cSmrg#
863b62cc08cSmrg# This file is free software; the Free Software Foundation
864b62cc08cSmrg# gives unlimited permission to copy and/or distribute it,
865b62cc08cSmrg# with or without modifications, as long as this notice is preserved.
866b62cc08cSmrg
867b62cc08cSmrg# serial 1
868b62cc08cSmrg
869b62cc08cSmrg# AM_SILENT_RULES([DEFAULT])
870b62cc08cSmrg# --------------------------
871b62cc08cSmrg# Enable less verbose build rules; with the default set to DEFAULT
872b62cc08cSmrg# (`yes' being less verbose, `no' or empty being verbose).
873b62cc08cSmrgAC_DEFUN([AM_SILENT_RULES],
874b62cc08cSmrg[AC_ARG_ENABLE([silent-rules],
875b62cc08cSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
876b62cc08cSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
877b62cc08cSmrgcase $enable_silent_rules in
878b62cc08cSmrgyes) AM_DEFAULT_VERBOSITY=0;;
879b62cc08cSmrgno)  AM_DEFAULT_VERBOSITY=1;;
880b62cc08cSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
881b62cc08cSmrgesac
882b62cc08cSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
883b62cc08cSmrgAM_BACKSLASH='\'
884b62cc08cSmrgAC_SUBST([AM_BACKSLASH])dnl
885b62cc08cSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
886b62cc08cSmrg])
887b62cc08cSmrg
8889fe995a9Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8899fe995a9Smrg#
8909fe995a9Smrg# This file is free software; the Free Software Foundation
8919fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
8929fe995a9Smrg# with or without modifications, as long as this notice is preserved.
8939fe995a9Smrg
8949fe995a9Smrg# AM_PROG_INSTALL_STRIP
8959fe995a9Smrg# ---------------------
8969fe995a9Smrg# One issue with vendor `install' (even GNU) is that you can't
8979fe995a9Smrg# specify the program used to strip binaries.  This is especially
8989fe995a9Smrg# annoying in cross-compiling environments, where the build's strip
8999fe995a9Smrg# is unlikely to handle the host's binaries.
9009fe995a9Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9019fe995a9Smrg# always use install-sh in `make install-strip', and initialize
9029fe995a9Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
9039fe995a9SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
9049fe995a9Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9059fe995a9Smrg# Installed binaries are usually stripped using `strip' when the user
9069fe995a9Smrg# run `make install-strip'.  However `strip' might not be the right
9079fe995a9Smrg# tool to use in cross-compilation environments, therefore Automake
9089fe995a9Smrg# will honor the `STRIP' environment variable to overrule this program.
9099fe995a9Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
9109fe995a9Smrgif test "$cross_compiling" != no; then
9119fe995a9Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
9129fe995a9Smrgfi
9139fe995a9SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9149fe995a9SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9159fe995a9Smrg
916b62cc08cSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9179fe995a9Smrg#
9189fe995a9Smrg# This file is free software; the Free Software Foundation
9199fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
9209fe995a9Smrg# with or without modifications, as long as this notice is preserved.
9219fe995a9Smrg
922b62cc08cSmrg# serial 2
923b62cc08cSmrg
9249fe995a9Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
9259fe995a9Smrg# ---------------------------
926b62cc08cSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9279fe995a9Smrg# This macro is traced by Automake.
9289fe995a9SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9299fe995a9Smrg
930b62cc08cSmrg# AM_SUBST_NOTMAKE(VARIABLE)
931b62cc08cSmrg# ---------------------------
932b62cc08cSmrg# Public sister of _AM_SUBST_NOTMAKE.
933b62cc08cSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
934b62cc08cSmrg
9359fe995a9Smrg# Check how to create a tarball.                            -*- Autoconf -*-
9369fe995a9Smrg
9379fe995a9Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9389fe995a9Smrg#
9399fe995a9Smrg# This file is free software; the Free Software Foundation
9409fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
9419fe995a9Smrg# with or without modifications, as long as this notice is preserved.
9429fe995a9Smrg
9439fe995a9Smrg# serial 2
9449fe995a9Smrg
9459fe995a9Smrg# _AM_PROG_TAR(FORMAT)
9469fe995a9Smrg# --------------------
9479fe995a9Smrg# Check how to create a tarball in format FORMAT.
9489fe995a9Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
9499fe995a9Smrg#
9509fe995a9Smrg# Substitute a variable $(am__tar) that is a command
9519fe995a9Smrg# writing to stdout a FORMAT-tarball containing the directory
9529fe995a9Smrg# $tardir.
9539fe995a9Smrg#     tardir=directory && $(am__tar) > result.tar
9549fe995a9Smrg#
9559fe995a9Smrg# Substitute a variable $(am__untar) that extract such
9569fe995a9Smrg# a tarball read from stdin.
9579fe995a9Smrg#     $(am__untar) < result.tar
9589fe995a9SmrgAC_DEFUN([_AM_PROG_TAR],
9599fe995a9Smrg[# Always define AMTAR for backward compatibility.
9609fe995a9SmrgAM_MISSING_PROG([AMTAR], [tar])
9619fe995a9Smrgm4_if([$1], [v7],
9629fe995a9Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
9639fe995a9Smrg     [m4_case([$1], [ustar],, [pax],,
9649fe995a9Smrg              [m4_fatal([Unknown tar format])])
9659fe995a9SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
9669fe995a9Smrg# Loop over all known methods to create a tar archive until one works.
9679fe995a9Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9689fe995a9Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
9699fe995a9Smrg# Do not fold the above two line into one, because Tru64 sh and
9709fe995a9Smrg# Solaris sh will not grok spaces in the rhs of `-'.
9719fe995a9Smrgfor _am_tool in $_am_tools
9729fe995a9Smrgdo
9739fe995a9Smrg  case $_am_tool in
9749fe995a9Smrg  gnutar)
9759fe995a9Smrg    for _am_tar in tar gnutar gtar;
9769fe995a9Smrg    do
9779fe995a9Smrg      AM_RUN_LOG([$_am_tar --version]) && break
9789fe995a9Smrg    done
9799fe995a9Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9809fe995a9Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9819fe995a9Smrg    am__untar="$_am_tar -xf -"
9829fe995a9Smrg    ;;
9839fe995a9Smrg  plaintar)
9849fe995a9Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
9859fe995a9Smrg    # ustar tarball either.
9869fe995a9Smrg    (tar --version) >/dev/null 2>&1 && continue
9879fe995a9Smrg    am__tar='tar chf - "$$tardir"'
9889fe995a9Smrg    am__tar_='tar chf - "$tardir"'
9899fe995a9Smrg    am__untar='tar xf -'
9909fe995a9Smrg    ;;
9919fe995a9Smrg  pax)
9929fe995a9Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
9939fe995a9Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
9949fe995a9Smrg    am__untar='pax -r'
9959fe995a9Smrg    ;;
9969fe995a9Smrg  cpio)
9979fe995a9Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9989fe995a9Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9999fe995a9Smrg    am__untar='cpio -i -H $1 -d'
10009fe995a9Smrg    ;;
10019fe995a9Smrg  none)
10029fe995a9Smrg    am__tar=false
10039fe995a9Smrg    am__tar_=false
10049fe995a9Smrg    am__untar=false
10059fe995a9Smrg    ;;
10069fe995a9Smrg  esac
10079fe995a9Smrg
10089fe995a9Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
10099fe995a9Smrg  # and am__untar set.
10109fe995a9Smrg  test -n "${am_cv_prog_tar_$1}" && break
10119fe995a9Smrg
10129fe995a9Smrg  # tar/untar a dummy directory, and stop if the command works
10139fe995a9Smrg  rm -rf conftest.dir
10149fe995a9Smrg  mkdir conftest.dir
10159fe995a9Smrg  echo GrepMe > conftest.dir/file
10169fe995a9Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10179fe995a9Smrg  rm -rf conftest.dir
10189fe995a9Smrg  if test -s conftest.tar; then
10199fe995a9Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
10209fe995a9Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
10219fe995a9Smrg  fi
10229fe995a9Smrgdone
10239fe995a9Smrgrm -rf conftest.dir
10249fe995a9Smrg
10259fe995a9SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10269fe995a9SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
10279fe995a9SmrgAC_SUBST([am__tar])
10289fe995a9SmrgAC_SUBST([am__untar])
10299fe995a9Smrg]) # _AM_PROG_TAR
10309fe995a9Smrg
1031b62cc08cSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10329fe995a9Smrgdnl
1033b62cc08cSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
10349fe995a9Smrgdnl 
10359fe995a9Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1036b62cc08cSmrgdnl copy of this software and associated documentation files (the "Software"),
1037b62cc08cSmrgdnl to deal in the Software without restriction, including without limitation
1038b62cc08cSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1039b62cc08cSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
1040b62cc08cSmrgdnl Software is furnished to do so, subject to the following conditions:
10419fe995a9Smrgdnl
1042b62cc08cSmrgdnl The above copyright notice and this permission notice (including the next
1043b62cc08cSmrgdnl paragraph) shall be included in all copies or substantial portions of the
1044b62cc08cSmrgdnl Software.
10459fe995a9Smrgdnl
1046b62cc08cSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1047b62cc08cSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1048b62cc08cSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1049b62cc08cSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1050b62cc08cSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1051b62cc08cSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1052b62cc08cSmrgdnl DEALINGS IN THE SOFTWARE.
10539fe995a9Smrg
10549fe995a9Smrg# XORG_MACROS_VERSION(required-version)
10559fe995a9Smrg# -------------------------------------
10569fe995a9Smrg# Minimum version: 1.1.0
10579fe995a9Smrg#
10589fe995a9Smrg# If you're using a macro added in Version 1.1 or newer, include this in
10599fe995a9Smrg# your configure.ac with the minimum required version, such as:
10609fe995a9Smrg# XORG_MACROS_VERSION(1.1)
10619fe995a9Smrg#
1062b62cc08cSmrg# To ensure that this macro is defined, also add:
1063b62cc08cSmrg# m4_ifndef([XORG_MACROS_VERSION],
1064b62cc08cSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10659fe995a9Smrg#
10669fe995a9Smrg#
10679fe995a9Smrg# See the "minimum version" comment for each macro you use to see what 
10689fe995a9Smrg# version you require.
1069b62cc08cSmrgm4_defun([XORG_MACROS_VERSION],[
1070b62cc08cSmrgm4_define([vers_have], [1.11.0])
1071b62cc08cSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1072b62cc08cSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1073b62cc08cSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1074b62cc08cSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1075b62cc08cSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1076b62cc08cSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1077b62cc08cSmrgm4_undefine([vers_have])
1078b62cc08cSmrgm4_undefine([maj_have])
1079b62cc08cSmrgm4_undefine([maj_needed])
10809fe995a9Smrg]) # XORG_MACROS_VERSION
10819fe995a9Smrg
10829fe995a9Smrg# XORG_PROG_RAWCPP()
10839fe995a9Smrg# ------------------
10849fe995a9Smrg# Minimum version: 1.0.0
10859fe995a9Smrg#
10869fe995a9Smrg# Find cpp program and necessary flags for use in pre-processing text files
10879fe995a9Smrg# such as man pages and config files
10889fe995a9SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
10899fe995a9SmrgAC_REQUIRE([AC_PROG_CPP])
10909fe995a9SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
10919fe995a9Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
10929fe995a9Smrg
10939fe995a9Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
10949fe995a9Smrg# which is not the best choice for supporting other OS'es, but covers most
10959fe995a9Smrg# of the ones we need for now.
10969fe995a9SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
10979fe995a9SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
10989fe995a9Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10999fe995a9Smrg	AC_MSG_RESULT([no])
11009fe995a9Smrgelse
11019fe995a9Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11029fe995a9Smrg		RAWCPPFLAGS=-undef
11039fe995a9Smrg		AC_MSG_RESULT([yes])
1104b62cc08cSmrg	# under Cygwin unix is still defined even with -undef
1105b62cc08cSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1106b62cc08cSmrg		RAWCPPFLAGS="-undef -ansi"
1107b62cc08cSmrg		AC_MSG_RESULT([yes, with -ansi])
11089fe995a9Smrg	else
11099fe995a9Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
11109fe995a9Smrg	fi
11119fe995a9Smrgfi
11129fe995a9Smrgrm -f conftest.$ac_ext
11139fe995a9Smrg
11149fe995a9SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
11159fe995a9SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
11169fe995a9Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11179fe995a9Smrg	AC_MSG_RESULT([no])
11189fe995a9Smrgelse
11199fe995a9Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11209fe995a9Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
11219fe995a9Smrg		AC_MSG_RESULT([yes])
11229fe995a9Smrg	else
11239fe995a9Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
11249fe995a9Smrg	fi
11259fe995a9Smrgfi
11269fe995a9Smrgrm -f conftest.$ac_ext
11279fe995a9SmrgAC_SUBST(RAWCPPFLAGS)
11289fe995a9Smrg]) # XORG_PROG_RAWCPP
11299fe995a9Smrg
11309fe995a9Smrg# XORG_MANPAGE_SECTIONS()
11319fe995a9Smrg# -----------------------
11329fe995a9Smrg# Minimum version: 1.0.0
11339fe995a9Smrg#
11349fe995a9Smrg# Determine which sections man pages go in for the different man page types
11359fe995a9Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
11369fe995a9Smrg# Not sure if there's any better way than just hardcoding by OS name.
11379fe995a9Smrg# Override default settings by setting environment variables
1138b62cc08cSmrg# Added MAN_SUBSTS in version 1.8
1139b62cc08cSmrg# Added AC_PROG_SED in version 1.8
11409fe995a9Smrg
11419fe995a9SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
11429fe995a9SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1143b62cc08cSmrgAC_REQUIRE([AC_PROG_SED])
11449fe995a9Smrg
11459fe995a9Smrgif test x$APP_MAN_SUFFIX = x    ; then
11469fe995a9Smrg    APP_MAN_SUFFIX=1
11479fe995a9Smrgfi
11489fe995a9Smrgif test x$APP_MAN_DIR = x    ; then
11499fe995a9Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
11509fe995a9Smrgfi
11519fe995a9Smrg
11529fe995a9Smrgif test x$LIB_MAN_SUFFIX = x    ; then
11539fe995a9Smrg    LIB_MAN_SUFFIX=3
11549fe995a9Smrgfi
11559fe995a9Smrgif test x$LIB_MAN_DIR = x    ; then
11569fe995a9Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
11579fe995a9Smrgfi
11589fe995a9Smrg
11599fe995a9Smrgif test x$FILE_MAN_SUFFIX = x    ; then
11609fe995a9Smrg    case $host_os in
11619fe995a9Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
11629fe995a9Smrg	*)		FILE_MAN_SUFFIX=5  ;;
11639fe995a9Smrg    esac
11649fe995a9Smrgfi
11659fe995a9Smrgif test x$FILE_MAN_DIR = x    ; then
11669fe995a9Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
11679fe995a9Smrgfi
11689fe995a9Smrg
11699fe995a9Smrgif test x$MISC_MAN_SUFFIX = x    ; then
11709fe995a9Smrg    case $host_os in
11719fe995a9Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
11729fe995a9Smrg	*)		MISC_MAN_SUFFIX=7  ;;
11739fe995a9Smrg    esac
11749fe995a9Smrgfi
11759fe995a9Smrgif test x$MISC_MAN_DIR = x    ; then
11769fe995a9Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
11779fe995a9Smrgfi
11789fe995a9Smrg
11799fe995a9Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
11809fe995a9Smrg    case $host_os in
11819fe995a9Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
11829fe995a9Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
11839fe995a9Smrg    esac
11849fe995a9Smrgfi
11859fe995a9Smrgif test x$DRIVER_MAN_DIR = x    ; then
11869fe995a9Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
11879fe995a9Smrgfi
11889fe995a9Smrg
11899fe995a9Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
11909fe995a9Smrg    case $host_os in
11919fe995a9Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
11929fe995a9Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
11939fe995a9Smrg    esac
11949fe995a9Smrgfi
11959fe995a9Smrgif test x$ADMIN_MAN_DIR = x    ; then
11969fe995a9Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
11979fe995a9Smrgfi
11989fe995a9Smrg
11999fe995a9Smrg
12009fe995a9SmrgAC_SUBST([APP_MAN_SUFFIX])
12019fe995a9SmrgAC_SUBST([LIB_MAN_SUFFIX])
12029fe995a9SmrgAC_SUBST([FILE_MAN_SUFFIX])
12039fe995a9SmrgAC_SUBST([MISC_MAN_SUFFIX])
12049fe995a9SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
12059fe995a9SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
12069fe995a9SmrgAC_SUBST([APP_MAN_DIR])
12079fe995a9SmrgAC_SUBST([LIB_MAN_DIR])
12089fe995a9SmrgAC_SUBST([FILE_MAN_DIR])
12099fe995a9SmrgAC_SUBST([MISC_MAN_DIR])
12109fe995a9SmrgAC_SUBST([DRIVER_MAN_DIR])
12119fe995a9SmrgAC_SUBST([ADMIN_MAN_DIR])
1212b62cc08cSmrg
1213b62cc08cSmrgXORG_MAN_PAGE="X Version 11"
1214b62cc08cSmrgAC_SUBST([XORG_MAN_PAGE])
1215b62cc08cSmrgMAN_SUBSTS="\
1216b62cc08cSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1217b62cc08cSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1218b62cc08cSmrg	-e 's|__xservername__|Xorg|g' \
1219b62cc08cSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
1220b62cc08cSmrg	-e 's|__projectroot__|\$(prefix)|g' \
1221b62cc08cSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1222b62cc08cSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1223b62cc08cSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1224b62cc08cSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1225b62cc08cSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1226b62cc08cSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1227b62cc08cSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1228b62cc08cSmrgAC_SUBST([MAN_SUBSTS])
1229b62cc08cSmrg
12309fe995a9Smrg]) # XORG_MANPAGE_SECTIONS
12319fe995a9Smrg
1232b62cc08cSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1233b62cc08cSmrg# ------------------------
1234b62cc08cSmrg# Minimum version: 1.7.0
1235b62cc08cSmrg#
1236b62cc08cSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1237b62cc08cSmrg# provided by xorg-sgml-doctools, if installed.
1238b62cc08cSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1239b62cc08cSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1240b62cc08cSmrgXORG_SGML_PATH=
1241b62cc08cSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1242b62cc08cSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1243b62cc08cSmrg    [m4_ifval([$1],[:],
1244b62cc08cSmrg        [if test x"$cross_compiling" != x"yes" ; then
1245b62cc08cSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1246b62cc08cSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1247b62cc08cSmrg         fi])
1248b62cc08cSmrg    ])
1249b62cc08cSmrg
1250b62cc08cSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1251b62cc08cSmrg# the path and the name of the doc stylesheet
1252b62cc08cSmrgif test "x$XORG_SGML_PATH" != "x" ; then
1253b62cc08cSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1254b62cc08cSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1255b62cc08cSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1256b62cc08cSmrgelse
1257b62cc08cSmrg   AC_MSG_RESULT([no])
1258b62cc08cSmrgfi
1259b62cc08cSmrg
1260b62cc08cSmrgAC_SUBST(XORG_SGML_PATH)
1261b62cc08cSmrgAC_SUBST(STYLESHEET_SRCDIR)
1262b62cc08cSmrgAC_SUBST(XSL_STYLESHEET)
1263b62cc08cSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1264b62cc08cSmrg]) # XORG_CHECK_SGML_DOCTOOLS
1265b62cc08cSmrg
12669fe995a9Smrg# XORG_CHECK_LINUXDOC
12679fe995a9Smrg# -------------------
12689fe995a9Smrg# Minimum version: 1.0.0
12699fe995a9Smrg#
12709fe995a9Smrg# Defines the variable MAKE_TEXT if the necessary tools and
12719fe995a9Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
12729fe995a9Smrg# Whether or not the necessary tools and files are found can be checked
12739fe995a9Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
12749fe995a9SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1275b62cc08cSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1276b62cc08cSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
12779fe995a9Smrg
12789fe995a9SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
12799fe995a9Smrg
1280b62cc08cSmrgAC_MSG_CHECKING([whether to build documentation])
12819fe995a9Smrg
1282b62cc08cSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
12839fe995a9Smrg   BUILDDOC=yes
12849fe995a9Smrgelse
12859fe995a9Smrg   BUILDDOC=no
12869fe995a9Smrgfi
12879fe995a9Smrg
12889fe995a9SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
12899fe995a9Smrg
12909fe995a9SmrgAC_MSG_RESULT([$BUILDDOC])
12919fe995a9Smrg
1292b62cc08cSmrgAC_MSG_CHECKING([whether to build pdf documentation])
12939fe995a9Smrg
1294b62cc08cSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
12959fe995a9Smrg   BUILDPDFDOC=yes
12969fe995a9Smrgelse
12979fe995a9Smrg   BUILDPDFDOC=no
12989fe995a9Smrgfi
12999fe995a9Smrg
13009fe995a9SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13019fe995a9Smrg
13029fe995a9SmrgAC_MSG_RESULT([$BUILDPDFDOC])
13039fe995a9Smrg
1304b62cc08cSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
13059fe995a9SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
13069fe995a9SmrgMAKE_PDF="$PS2PDF"
13079fe995a9SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
13089fe995a9Smrg
13099fe995a9SmrgAC_SUBST(MAKE_TEXT)
13109fe995a9SmrgAC_SUBST(MAKE_PS)
13119fe995a9SmrgAC_SUBST(MAKE_PDF)
13129fe995a9SmrgAC_SUBST(MAKE_HTML)
13139fe995a9Smrg]) # XORG_CHECK_LINUXDOC
13149fe995a9Smrg
13159fe995a9Smrg# XORG_CHECK_DOCBOOK
13169fe995a9Smrg# -------------------
13179fe995a9Smrg# Minimum version: 1.0.0
13189fe995a9Smrg#
13199fe995a9Smrg# Checks for the ability to build output formats from SGML DocBook source.
13209fe995a9Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
13219fe995a9Smrg# indicates whether the necessary tools and files are found and, if set,
13229fe995a9Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
13239fe995a9SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1324b62cc08cSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1325b62cc08cSmrg
13269fe995a9SmrgBUILDTXTDOC=no
13279fe995a9SmrgBUILDPDFDOC=no
13289fe995a9SmrgBUILDPSDOC=no
13299fe995a9SmrgBUILDHTMLDOC=no
13309fe995a9Smrg
13319fe995a9SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
13329fe995a9SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
13339fe995a9SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
13349fe995a9SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
13359fe995a9Smrg
1336b62cc08cSmrgAC_MSG_CHECKING([whether to build text documentation])
1337b62cc08cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
13389fe995a9Smrg   test x$BUILD_TXTDOC != xno; then
13399fe995a9Smrg	BUILDTXTDOC=yes
13409fe995a9Smrgfi
13419fe995a9SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
13429fe995a9SmrgAC_MSG_RESULT([$BUILDTXTDOC])
13439fe995a9Smrg
1344b62cc08cSmrgAC_MSG_CHECKING([whether to build PDF documentation])
1345b62cc08cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
13469fe995a9Smrg   test x$BUILD_PDFDOC != xno; then
13479fe995a9Smrg	BUILDPDFDOC=yes
13489fe995a9Smrgfi
13499fe995a9SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13509fe995a9SmrgAC_MSG_RESULT([$BUILDPDFDOC])
13519fe995a9Smrg
1352b62cc08cSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1353b62cc08cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
13549fe995a9Smrg   test x$BUILD_PSDOC != xno; then
13559fe995a9Smrg	BUILDPSDOC=yes
13569fe995a9Smrgfi
13579fe995a9SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
13589fe995a9SmrgAC_MSG_RESULT([$BUILDPSDOC])
13599fe995a9Smrg
1360b62cc08cSmrgAC_MSG_CHECKING([whether to build HTML documentation])
1361b62cc08cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
13629fe995a9Smrg   test x$BUILD_HTMLDOC != xno; then
13639fe995a9Smrg	BUILDHTMLDOC=yes
13649fe995a9Smrgfi
13659fe995a9SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
13669fe995a9SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
13679fe995a9Smrg
13689fe995a9SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
13699fe995a9SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
13709fe995a9SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
13719fe995a9SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
13729fe995a9Smrg
13739fe995a9SmrgAC_SUBST(MAKE_TEXT)
13749fe995a9SmrgAC_SUBST(MAKE_PS)
13759fe995a9SmrgAC_SUBST(MAKE_PDF)
13769fe995a9SmrgAC_SUBST(MAKE_HTML)
13779fe995a9Smrg]) # XORG_CHECK_DOCBOOK
13789fe995a9Smrg
1379b62cc08cSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1380b62cc08cSmrg# ----------------
1381b62cc08cSmrg# Minimum version: 1.5.0
1382b62cc08cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1383b62cc08cSmrg#
1384b62cc08cSmrg# Documentation tools are not always available on all platforms and sometimes
1385b62cc08cSmrg# not at the appropriate level. This macro enables a module to test for the
1386b62cc08cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1387b62cc08cSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1388b62cc08cSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1389b62cc08cSmrg# --with-xmlto assumes 'auto'.
1390b62cc08cSmrg#
1391b62cc08cSmrg# Interface to module:
1392b62cc08cSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1393b62cc08cSmrg# XMLTO:	returns the path of the xmlto program found
1394b62cc08cSmrg#		returns the path set by the user in the environment
1395b62cc08cSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1396b62cc08cSmrg#		'no' user instructs the module not to use xmlto
1397b62cc08cSmrg#
1398b62cc08cSmrg# Added in version 1.10.0
1399b62cc08cSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1400b62cc08cSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1401b62cc08cSmrg#
1402b62cc08cSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1403b62cc08cSmrg#
1404b62cc08cSmrgAC_DEFUN([XORG_WITH_XMLTO],[
1405b62cc08cSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1406b62cc08cSmrgm4_define([_defopt], m4_default([$2], [auto]))
1407b62cc08cSmrgAC_ARG_WITH(xmlto,
1408b62cc08cSmrg	AS_HELP_STRING([--with-xmlto],
1409b62cc08cSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1410b62cc08cSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1411b62cc08cSmrgm4_undefine([_defopt])
1412b62cc08cSmrg
1413b62cc08cSmrgif test "x$use_xmlto" = x"auto"; then
1414b62cc08cSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1415b62cc08cSmrg   if test "x$XMLTO" = "x"; then
1416b62cc08cSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1417b62cc08cSmrg	have_xmlto=no
1418b62cc08cSmrg   else
1419b62cc08cSmrg        have_xmlto=yes
1420b62cc08cSmrg   fi
1421b62cc08cSmrgelif test "x$use_xmlto" = x"yes" ; then
1422b62cc08cSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1423b62cc08cSmrg   if test "x$XMLTO" = "x"; then
1424b62cc08cSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1425b62cc08cSmrg   fi
1426b62cc08cSmrg   have_xmlto=yes
1427b62cc08cSmrgelif test "x$use_xmlto" = x"no" ; then
1428b62cc08cSmrg   if test "x$XMLTO" != "x"; then
1429b62cc08cSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1430b62cc08cSmrg   fi
1431b62cc08cSmrg   have_xmlto=no
1432b62cc08cSmrgelse
1433b62cc08cSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1434b62cc08cSmrgfi
1435b62cc08cSmrg
1436b62cc08cSmrg# Test for a minimum version of xmlto, if provided.
1437b62cc08cSmrgm4_ifval([$1],
1438b62cc08cSmrg[if test "$have_xmlto" = yes; then
1439b62cc08cSmrg    # scrape the xmlto version
1440b62cc08cSmrg    AC_MSG_CHECKING([the xmlto version])
1441b62cc08cSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1442b62cc08cSmrg    AC_MSG_RESULT([$xmlto_version])
1443b62cc08cSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1444b62cc08cSmrg        [if test "x$use_xmlto" = xauto; then
1445b62cc08cSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1446b62cc08cSmrg            have_xmlto=no
1447b62cc08cSmrg        else
1448b62cc08cSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1449b62cc08cSmrg        fi])
1450b62cc08cSmrgfi])
1451b62cc08cSmrg
1452b62cc08cSmrg# Test for the ability of xmlto to generate a text target
1453b62cc08cSmrghave_xmlto_text=no
1454b62cc08cSmrgcat > conftest.xml << "EOF"
1455b62cc08cSmrgEOF
1456b62cc08cSmrgAS_IF([test "$have_xmlto" = yes],
1457b62cc08cSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1458b62cc08cSmrg             [have_xmlto_text=yes],
1459b62cc08cSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1460b62cc08cSmrgrm -f conftest.xml
1461b62cc08cSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1462b62cc08cSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1463b62cc08cSmrg]) # XORG_WITH_XMLTO
1464b62cc08cSmrg
1465b62cc08cSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1466b62cc08cSmrg# ----------------
1467b62cc08cSmrg# Minimum version: 1.5.0
1468b62cc08cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1469b62cc08cSmrg#
1470b62cc08cSmrg# Documentation tools are not always available on all platforms and sometimes
1471b62cc08cSmrg# not at the appropriate level. This macro enables a module to test for the
1472b62cc08cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1473b62cc08cSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1474b62cc08cSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1475b62cc08cSmrg# --with-asciidoc assumes 'auto'.
1476b62cc08cSmrg#
1477b62cc08cSmrg# Interface to module:
1478b62cc08cSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1479b62cc08cSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
1480b62cc08cSmrg#		 returns the path set by the user in the environment
1481b62cc08cSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1482b62cc08cSmrg#		  'no' user instructs the module not to use asciidoc
1483b62cc08cSmrg#
1484b62cc08cSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1485b62cc08cSmrg#
1486b62cc08cSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1487b62cc08cSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1488b62cc08cSmrgm4_define([_defopt], m4_default([$2], [auto]))
1489b62cc08cSmrgAC_ARG_WITH(asciidoc,
1490b62cc08cSmrg	AS_HELP_STRING([--with-asciidoc],
1491b62cc08cSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1492b62cc08cSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1493b62cc08cSmrgm4_undefine([_defopt])
1494b62cc08cSmrg
1495b62cc08cSmrgif test "x$use_asciidoc" = x"auto"; then
1496b62cc08cSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1497b62cc08cSmrg   if test "x$ASCIIDOC" = "x"; then
1498b62cc08cSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1499b62cc08cSmrg	have_asciidoc=no
1500b62cc08cSmrg   else
1501b62cc08cSmrg        have_asciidoc=yes
1502b62cc08cSmrg   fi
1503b62cc08cSmrgelif test "x$use_asciidoc" = x"yes" ; then
1504b62cc08cSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1505b62cc08cSmrg   if test "x$ASCIIDOC" = "x"; then
1506b62cc08cSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1507b62cc08cSmrg   fi
1508b62cc08cSmrg   have_asciidoc=yes
1509b62cc08cSmrgelif test "x$use_asciidoc" = x"no" ; then
1510b62cc08cSmrg   if test "x$ASCIIDOC" != "x"; then
1511b62cc08cSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1512b62cc08cSmrg   fi
1513b62cc08cSmrg   have_asciidoc=no
1514b62cc08cSmrgelse
1515b62cc08cSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1516b62cc08cSmrgfi
1517b62cc08cSmrgm4_ifval([$1],
1518b62cc08cSmrg[if test "$have_asciidoc" = yes; then
1519b62cc08cSmrg    # scrape the asciidoc version
1520b62cc08cSmrg    AC_MSG_CHECKING([the asciidoc version])
1521b62cc08cSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1522b62cc08cSmrg    AC_MSG_RESULT([$asciidoc_version])
1523b62cc08cSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1524b62cc08cSmrg        [if test "x$use_asciidoc" = xauto; then
1525b62cc08cSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1526b62cc08cSmrg            have_asciidoc=no
1527b62cc08cSmrg        else
1528b62cc08cSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1529b62cc08cSmrg        fi])
1530b62cc08cSmrgfi])
1531b62cc08cSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1532b62cc08cSmrg]) # XORG_WITH_ASCIIDOC
1533b62cc08cSmrg
1534b62cc08cSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1535b62cc08cSmrg# --------------------------------
1536b62cc08cSmrg# Minimum version: 1.5.0
1537b62cc08cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1538b62cc08cSmrg#
1539b62cc08cSmrg# Documentation tools are not always available on all platforms and sometimes
1540b62cc08cSmrg# not at the appropriate level. This macro enables a module to test for the
1541b62cc08cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1542b62cc08cSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1543b62cc08cSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1544b62cc08cSmrg# --with-doxygen assumes 'auto'.
1545b62cc08cSmrg#
1546b62cc08cSmrg# Interface to module:
1547b62cc08cSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1548b62cc08cSmrg# DOXYGEN:	 returns the path of the doxygen program found
1549b62cc08cSmrg#		 returns the path set by the user in the environment
1550b62cc08cSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1551b62cc08cSmrg#		  'no' user instructs the module not to use doxygen
1552b62cc08cSmrg#
1553b62cc08cSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1554b62cc08cSmrg#
1555b62cc08cSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1556b62cc08cSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1557b62cc08cSmrgm4_define([_defopt], m4_default([$2], [auto]))
1558b62cc08cSmrgAC_ARG_WITH(doxygen,
1559b62cc08cSmrg	AS_HELP_STRING([--with-doxygen],
1560b62cc08cSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1561b62cc08cSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1562b62cc08cSmrgm4_undefine([_defopt])
1563b62cc08cSmrg
1564b62cc08cSmrgif test "x$use_doxygen" = x"auto"; then
1565b62cc08cSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1566b62cc08cSmrg   if test "x$DOXYGEN" = "x"; then
1567b62cc08cSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1568b62cc08cSmrg	have_doxygen=no
1569b62cc08cSmrg   else
1570b62cc08cSmrg        have_doxygen=yes
1571b62cc08cSmrg   fi
1572b62cc08cSmrgelif test "x$use_doxygen" = x"yes" ; then
1573b62cc08cSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1574b62cc08cSmrg   if test "x$DOXYGEN" = "x"; then
1575b62cc08cSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1576b62cc08cSmrg   fi
1577b62cc08cSmrg   have_doxygen=yes
1578b62cc08cSmrgelif test "x$use_doxygen" = x"no" ; then
1579b62cc08cSmrg   if test "x$DOXYGEN" != "x"; then
1580b62cc08cSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1581b62cc08cSmrg   fi
1582b62cc08cSmrg   have_doxygen=no
1583b62cc08cSmrgelse
1584b62cc08cSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1585b62cc08cSmrgfi
1586b62cc08cSmrgm4_ifval([$1],
1587b62cc08cSmrg[if test "$have_doxygen" = yes; then
1588b62cc08cSmrg    # scrape the doxygen version
1589b62cc08cSmrg    AC_MSG_CHECKING([the doxygen version])
1590b62cc08cSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1591b62cc08cSmrg    AC_MSG_RESULT([$doxygen_version])
1592b62cc08cSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1593b62cc08cSmrg        [if test "x$use_doxygen" = xauto; then
1594b62cc08cSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1595b62cc08cSmrg            have_doxygen=no
1596b62cc08cSmrg        else
1597b62cc08cSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1598b62cc08cSmrg        fi])
1599b62cc08cSmrgfi])
1600b62cc08cSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1601b62cc08cSmrg]) # XORG_WITH_DOXYGEN
1602b62cc08cSmrg
1603b62cc08cSmrg# XORG_WITH_GROFF([DEFAULT])
1604b62cc08cSmrg# ----------------
1605b62cc08cSmrg# Minimum version: 1.6.0
1606b62cc08cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1607b62cc08cSmrg#
1608b62cc08cSmrg# Documentation tools are not always available on all platforms and sometimes
1609b62cc08cSmrg# not at the appropriate level. This macro enables a module to test for the
1610b62cc08cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1611b62cc08cSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
1612b62cc08cSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
1613b62cc08cSmrg# --with-groff assumes 'auto'.
1614b62cc08cSmrg#
1615b62cc08cSmrg# Interface to module:
1616b62cc08cSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1617b62cc08cSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1618b62cc08cSmrg# HAVE_GROFF_MS: the -ms macros package
1619b62cc08cSmrg# GROFF:	 returns the path of the groff program found
1620b62cc08cSmrg#		 returns the path set by the user in the environment
1621b62cc08cSmrg# --with-groff:	 'yes' user instructs the module to use groff
1622b62cc08cSmrg#		 'no' user instructs the module not to use groff
1623b62cc08cSmrg#
1624b62cc08cSmrg# Added in version 1.9.0:
1625b62cc08cSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1626b62cc08cSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1627b62cc08cSmrg#		   psselect from the psutils package.
1628b62cc08cSmrg#		   the ghostcript package. Refer to the grohtml man pages
1629b62cc08cSmrg#
1630b62cc08cSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1631b62cc08cSmrg#
1632b62cc08cSmrg# OS and distros often splits groff in a basic and full package, the former
1633b62cc08cSmrg# having the groff program and the later having devices, fonts and macros
1634b62cc08cSmrg# Checking for the groff executable is not enough.
1635b62cc08cSmrg#
1636b62cc08cSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
1637b62cc08cSmrg# unset HAVE_GROFF or GROFF env variables.
1638b62cc08cSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1639b62cc08cSmrg#
1640b62cc08cSmrgAC_DEFUN([XORG_WITH_GROFF],[
1641b62cc08cSmrgAC_ARG_VAR([GROFF], [Path to groff command])
1642b62cc08cSmrgm4_define([_defopt], m4_default([$1], [auto]))
1643b62cc08cSmrgAC_ARG_WITH(groff,
1644b62cc08cSmrg	AS_HELP_STRING([--with-groff],
1645b62cc08cSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1646b62cc08cSmrg	   [use_groff=$withval], [use_groff=]_defopt)
1647b62cc08cSmrgm4_undefine([_defopt])
1648b62cc08cSmrg
1649b62cc08cSmrgif test "x$use_groff" = x"auto"; then
1650b62cc08cSmrg   AC_PATH_PROG([GROFF], [groff])
1651b62cc08cSmrg   if test "x$GROFF" = "x"; then
1652b62cc08cSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1653b62cc08cSmrg	have_groff=no
1654b62cc08cSmrg   else
1655b62cc08cSmrg        have_groff=yes
1656b62cc08cSmrg   fi
1657b62cc08cSmrgelif test "x$use_groff" = x"yes" ; then
1658b62cc08cSmrg   AC_PATH_PROG([GROFF], [groff])
1659b62cc08cSmrg   if test "x$GROFF" = "x"; then
1660b62cc08cSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1661b62cc08cSmrg   fi
1662b62cc08cSmrg   have_groff=yes
1663b62cc08cSmrgelif test "x$use_groff" = x"no" ; then
1664b62cc08cSmrg   if test "x$GROFF" != "x"; then
1665b62cc08cSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1666b62cc08cSmrg   fi
1667b62cc08cSmrg   have_groff=no
1668b62cc08cSmrgelse
1669b62cc08cSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1670b62cc08cSmrgfi
1671b62cc08cSmrg
1672b62cc08cSmrg# We have groff, test for the presence of the macro packages
1673b62cc08cSmrgif test "x$have_groff" = x"yes"; then
1674b62cc08cSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1675b62cc08cSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1676b62cc08cSmrg        groff_ms_works=yes
1677b62cc08cSmrg    else
1678b62cc08cSmrg        groff_ms_works=no
1679b62cc08cSmrg    fi
1680b62cc08cSmrg    AC_MSG_RESULT([$groff_ms_works])
1681b62cc08cSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1682b62cc08cSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1683b62cc08cSmrg        groff_mm_works=yes
1684b62cc08cSmrg    else
1685b62cc08cSmrg        groff_mm_works=no
1686b62cc08cSmrg    fi
1687b62cc08cSmrg    AC_MSG_RESULT([$groff_mm_works])
1688b62cc08cSmrgfi
1689b62cc08cSmrg
1690b62cc08cSmrg# We have groff, test for HTML dependencies, one command per package
1691b62cc08cSmrgif test "x$have_groff" = x"yes"; then
1692b62cc08cSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1693b62cc08cSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1694b62cc08cSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1695b62cc08cSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1696b62cc08cSmrg      have_groff_html=yes
1697b62cc08cSmrg   else
1698b62cc08cSmrg      have_groff_html=no
1699b62cc08cSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1700b62cc08cSmrg   fi
1701b62cc08cSmrgfi
1702b62cc08cSmrg
1703b62cc08cSmrg# Set Automake conditionals for Makefiles
1704b62cc08cSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1705b62cc08cSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1706b62cc08cSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1707b62cc08cSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1708b62cc08cSmrg]) # XORG_WITH_GROFF
1709b62cc08cSmrg
1710b62cc08cSmrg# XORG_WITH_FOP([DEFAULT])
1711b62cc08cSmrg# ----------------
1712b62cc08cSmrg# Minimum version: 1.6.0
1713b62cc08cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1714b62cc08cSmrg#
1715b62cc08cSmrg# Documentation tools are not always available on all platforms and sometimes
1716b62cc08cSmrg# not at the appropriate level. This macro enables a module to test for the
1717b62cc08cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1718b62cc08cSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
1719b62cc08cSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
1720b62cc08cSmrg# --with-fop assumes 'auto'.
1721b62cc08cSmrg#
1722b62cc08cSmrg# Interface to module:
1723b62cc08cSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1724b62cc08cSmrg# FOP:	 	returns the path of the fop program found
1725b62cc08cSmrg#		returns the path set by the user in the environment
1726b62cc08cSmrg# --with-fop: 	'yes' user instructs the module to use fop
1727b62cc08cSmrg#		'no' user instructs the module not to use fop
1728b62cc08cSmrg#
1729b62cc08cSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1730b62cc08cSmrg#
1731b62cc08cSmrgAC_DEFUN([XORG_WITH_FOP],[
1732b62cc08cSmrgAC_ARG_VAR([FOP], [Path to fop command])
1733b62cc08cSmrgm4_define([_defopt], m4_default([$1], [auto]))
1734b62cc08cSmrgAC_ARG_WITH(fop,
1735b62cc08cSmrg	AS_HELP_STRING([--with-fop],
1736b62cc08cSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1737b62cc08cSmrg	   [use_fop=$withval], [use_fop=]_defopt)
1738b62cc08cSmrgm4_undefine([_defopt])
1739b62cc08cSmrg
1740b62cc08cSmrgif test "x$use_fop" = x"auto"; then
1741b62cc08cSmrg   AC_PATH_PROG([FOP], [fop])
1742b62cc08cSmrg   if test "x$FOP" = "x"; then
1743b62cc08cSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1744b62cc08cSmrg	have_fop=no
1745b62cc08cSmrg   else
1746b62cc08cSmrg        have_fop=yes
1747b62cc08cSmrg   fi
1748b62cc08cSmrgelif test "x$use_fop" = x"yes" ; then
1749b62cc08cSmrg   AC_PATH_PROG([FOP], [fop])
1750b62cc08cSmrg   if test "x$FOP" = "x"; then
1751b62cc08cSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1752b62cc08cSmrg   fi
1753b62cc08cSmrg   have_fop=yes
1754b62cc08cSmrgelif test "x$use_fop" = x"no" ; then
1755b62cc08cSmrg   if test "x$FOP" != "x"; then
1756b62cc08cSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1757b62cc08cSmrg   fi
1758b62cc08cSmrg   have_fop=no
1759b62cc08cSmrgelse
1760b62cc08cSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1761b62cc08cSmrgfi
1762b62cc08cSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1763b62cc08cSmrg]) # XORG_WITH_FOP
1764b62cc08cSmrg
1765b62cc08cSmrg# XORG_WITH_PS2PDF([DEFAULT])
1766b62cc08cSmrg# ----------------
1767b62cc08cSmrg# Minimum version: 1.6.0
1768b62cc08cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1769b62cc08cSmrg#
1770b62cc08cSmrg# Documentation tools are not always available on all platforms and sometimes
1771b62cc08cSmrg# not at the appropriate level. This macro enables a module to test for the
1772b62cc08cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1773b62cc08cSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1774b62cc08cSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1775b62cc08cSmrg# --with-ps2pdf assumes 'auto'.
1776b62cc08cSmrg#
1777b62cc08cSmrg# Interface to module:
1778b62cc08cSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1779b62cc08cSmrg# PS2PDF:	returns the path of the ps2pdf program found
1780b62cc08cSmrg#		returns the path set by the user in the environment
1781b62cc08cSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1782b62cc08cSmrg#		 'no' user instructs the module not to use ps2pdf
1783b62cc08cSmrg#
1784b62cc08cSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1785b62cc08cSmrg#
1786b62cc08cSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1787b62cc08cSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1788b62cc08cSmrgm4_define([_defopt], m4_default([$1], [auto]))
1789b62cc08cSmrgAC_ARG_WITH(ps2pdf,
1790b62cc08cSmrg	AS_HELP_STRING([--with-ps2pdf],
1791b62cc08cSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1792b62cc08cSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1793b62cc08cSmrgm4_undefine([_defopt])
1794b62cc08cSmrg
1795b62cc08cSmrgif test "x$use_ps2pdf" = x"auto"; then
1796b62cc08cSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1797b62cc08cSmrg   if test "x$PS2PDF" = "x"; then
1798b62cc08cSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1799b62cc08cSmrg	have_ps2pdf=no
1800b62cc08cSmrg   else
1801b62cc08cSmrg        have_ps2pdf=yes
1802b62cc08cSmrg   fi
1803b62cc08cSmrgelif test "x$use_ps2pdf" = x"yes" ; then
1804b62cc08cSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1805b62cc08cSmrg   if test "x$PS2PDF" = "x"; then
1806b62cc08cSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1807b62cc08cSmrg   fi
1808b62cc08cSmrg   have_ps2pdf=yes
1809b62cc08cSmrgelif test "x$use_ps2pdf" = x"no" ; then
1810b62cc08cSmrg   if test "x$PS2PDF" != "x"; then
1811b62cc08cSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1812b62cc08cSmrg   fi
1813b62cc08cSmrg   have_ps2pdf=no
1814b62cc08cSmrgelse
1815b62cc08cSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1816b62cc08cSmrgfi
1817b62cc08cSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1818b62cc08cSmrg]) # XORG_WITH_PS2PDF
1819b62cc08cSmrg
1820b62cc08cSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
1821b62cc08cSmrg# ----------------
1822b62cc08cSmrg# Minimum version: 1.6.0
1823b62cc08cSmrg#
1824b62cc08cSmrg# Documentation tools are not always available on all platforms and sometimes
1825b62cc08cSmrg# not at the appropriate level. This macro enables a builder to skip all
1826b62cc08cSmrg# documentation targets except traditional man pages.
1827b62cc08cSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1828b62cc08cSmrg# maximum flexibilty in controlling documentation building.
1829b62cc08cSmrg# Refer to:
1830b62cc08cSmrg# XORG_WITH_XMLTO         --with-xmlto
1831b62cc08cSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1832b62cc08cSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1833b62cc08cSmrg# XORG_WITH_FOP           --with-fop
1834b62cc08cSmrg# XORG_WITH_GROFF         --with-groff
1835b62cc08cSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1836b62cc08cSmrg#
1837b62cc08cSmrg# Interface to module:
1838b62cc08cSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1839b62cc08cSmrg# --enable-docs: 'yes' user instructs the module to generate docs
1840b62cc08cSmrg#		 'no' user instructs the module not to generate docs
1841b62cc08cSmrg# parm1:	specify the default value, yes or no.
1842b62cc08cSmrg#
1843b62cc08cSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1844b62cc08cSmrgm4_define([default], m4_default([$1], [yes]))
1845b62cc08cSmrgAC_ARG_ENABLE(docs,
1846b62cc08cSmrg	AS_HELP_STRING([--enable-docs],
1847b62cc08cSmrg	   [Enable building the documentation (default: ]default[)]),
1848b62cc08cSmrg	   [build_docs=$enableval], [build_docs=]default)
1849b62cc08cSmrgm4_undefine([default])
1850b62cc08cSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1851b62cc08cSmrgAC_MSG_CHECKING([whether to build documentation])
1852b62cc08cSmrgAC_MSG_RESULT([$build_docs])
1853b62cc08cSmrg]) # XORG_ENABLE_DOCS
1854b62cc08cSmrg
1855b62cc08cSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1856b62cc08cSmrg# ----------------
1857b62cc08cSmrg# Minimum version: 1.6.0
1858b62cc08cSmrg#
1859b62cc08cSmrg# This macro enables a builder to skip all developer documentation.
1860b62cc08cSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1861b62cc08cSmrg# maximum flexibilty in controlling documentation building.
1862b62cc08cSmrg# Refer to:
1863b62cc08cSmrg# XORG_WITH_XMLTO         --with-xmlto
1864b62cc08cSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1865b62cc08cSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1866b62cc08cSmrg# XORG_WITH_FOP           --with-fop
1867b62cc08cSmrg# XORG_WITH_GROFF         --with-groff
1868b62cc08cSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1869b62cc08cSmrg#
1870b62cc08cSmrg# Interface to module:
1871b62cc08cSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1872b62cc08cSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1873b62cc08cSmrg#			'no' user instructs the module not to generate developer docs
1874b62cc08cSmrg# parm1:		specify the default value, yes or no.
1875b62cc08cSmrg#
1876b62cc08cSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1877b62cc08cSmrgm4_define([devel_default], m4_default([$1], [yes]))
1878b62cc08cSmrgAC_ARG_ENABLE(devel-docs,
1879b62cc08cSmrg	AS_HELP_STRING([--enable-devel-docs],
1880b62cc08cSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1881b62cc08cSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1882b62cc08cSmrgm4_undefine([devel_default])
1883b62cc08cSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1884b62cc08cSmrgAC_MSG_CHECKING([whether to build developer documentation])
1885b62cc08cSmrgAC_MSG_RESULT([$build_devel_docs])
1886b62cc08cSmrg]) # XORG_ENABLE_DEVEL_DOCS
1887b62cc08cSmrg
1888b62cc08cSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
1889b62cc08cSmrg# ----------------
1890b62cc08cSmrg# Minimum version: 1.6.0
1891b62cc08cSmrg#
1892b62cc08cSmrg# This macro enables a builder to skip all functional specification targets.
1893b62cc08cSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1894b62cc08cSmrg# maximum flexibilty in controlling documentation building.
1895b62cc08cSmrg# Refer to:
1896b62cc08cSmrg# XORG_WITH_XMLTO         --with-xmlto
1897b62cc08cSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1898b62cc08cSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1899b62cc08cSmrg# XORG_WITH_FOP           --with-fop
1900b62cc08cSmrg# XORG_WITH_GROFF         --with-groff
1901b62cc08cSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1902b62cc08cSmrg#
1903b62cc08cSmrg# Interface to module:
1904b62cc08cSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1905b62cc08cSmrg# --enable-specs:	'yes' user instructs the module to generate specs
1906b62cc08cSmrg#			'no' user instructs the module not to generate specs
1907b62cc08cSmrg# parm1:		specify the default value, yes or no.
1908b62cc08cSmrg#
1909b62cc08cSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1910b62cc08cSmrgm4_define([spec_default], m4_default([$1], [yes]))
1911b62cc08cSmrgAC_ARG_ENABLE(specs,
1912b62cc08cSmrg	AS_HELP_STRING([--enable-specs],
1913b62cc08cSmrg	   [Enable building the specs (default: ]spec_default[)]),
1914b62cc08cSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
1915b62cc08cSmrgm4_undefine([spec_default])
1916b62cc08cSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1917b62cc08cSmrgAC_MSG_CHECKING([whether to build functional specifications])
1918b62cc08cSmrgAC_MSG_RESULT([$build_specs])
1919b62cc08cSmrg]) # XORG_ENABLE_SPECS
1920b62cc08cSmrg
19219fe995a9Smrg# XORG_CHECK_MALLOC_ZERO
19229fe995a9Smrg# ----------------------
19239fe995a9Smrg# Minimum version: 1.0.0
19249fe995a9Smrg#
19259fe995a9Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
19269fe995a9Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
19279fe995a9Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
19289fe995a9SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
19299fe995a9SmrgAC_ARG_ENABLE(malloc0returnsnull,
1930b62cc08cSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
19319fe995a9Smrg		       [malloc(0) returns NULL (default: auto)]),
19329fe995a9Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
19339fe995a9Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
19349fe995a9Smrg
19359fe995a9SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
19369fe995a9Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
19379fe995a9Smrg	AC_RUN_IFELSE([
19389fe995a9Smrgchar *malloc();
19399fe995a9Smrgchar *realloc();
19409fe995a9Smrgchar *calloc();
19419fe995a9Smrgmain() {
19429fe995a9Smrg    char *m0, *r0, *c0, *p;
19439fe995a9Smrg    m0 = malloc(0);
19449fe995a9Smrg    p = malloc(10);
19459fe995a9Smrg    r0 = realloc(p,0);
19469fe995a9Smrg    c0 = calloc(0);
19479fe995a9Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
19489fe995a9Smrg}],
19499fe995a9Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1950b62cc08cSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
1951b62cc08cSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
19529fe995a9Smrgfi
19539fe995a9SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
19549fe995a9Smrg
19559fe995a9Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
19569fe995a9Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
19579fe995a9Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
19589fe995a9Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
19599fe995a9Smrgelse
19609fe995a9Smrg	MALLOC_ZERO_CFLAGS=""
19619fe995a9Smrg	XMALLOC_ZERO_CFLAGS=""
19629fe995a9Smrg	XTMALLOC_ZERO_CFLAGS=""
19639fe995a9Smrgfi
19649fe995a9Smrg
19659fe995a9SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
19669fe995a9SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
19679fe995a9SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
19689fe995a9Smrg]) # XORG_CHECK_MALLOC_ZERO
19699fe995a9Smrg
19709fe995a9Smrg# XORG_WITH_LINT()
19719fe995a9Smrg# ----------------
19729fe995a9Smrg# Minimum version: 1.1.0
19739fe995a9Smrg#
1974b62cc08cSmrg# This macro enables the use of a tool that flags some suspicious and
1975b62cc08cSmrg# non-portable constructs (likely to be bugs) in C language source code.
1976b62cc08cSmrg# It will attempt to locate the tool and use appropriate options.
1977b62cc08cSmrg# There are various lint type tools on different platforms.
1978b62cc08cSmrg#
1979b62cc08cSmrg# Interface to module:
1980b62cc08cSmrg# LINT:		returns the path to the tool found on the platform
1981b62cc08cSmrg#		or the value set to LINT on the configure cmd line
1982b62cc08cSmrg#		also an Automake conditional
1983b62cc08cSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
1984b62cc08cSmrg#
1985b62cc08cSmrg# --with-lint:	'yes' user instructs the module to use lint
1986b62cc08cSmrg#		'no' user instructs the module not to use lint (default)
1987b62cc08cSmrg#
1988b62cc08cSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1989b62cc08cSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
19909fe995a9Smrg#
19919fe995a9SmrgAC_DEFUN([XORG_WITH_LINT],[
19929fe995a9Smrg
1993b62cc08cSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1994b62cc08cSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1995b62cc08cSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
19969fe995a9Smrg		[Use a lint-style source code checker (default: disabled)])],
19979fe995a9Smrg		[use_lint=$withval], [use_lint=no])
1998b62cc08cSmrg
1999b62cc08cSmrg# Obtain platform specific info like program name and options
2000b62cc08cSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
2001b62cc08cSmrgcase $host_os in
2002b62cc08cSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2003b62cc08cSmrg	lint_name=splint
2004b62cc08cSmrg	lint_options="-badflag"
2005b62cc08cSmrg	;;
2006b62cc08cSmrg  *freebsd* | *netbsd*)
2007b62cc08cSmrg	lint_name=lint
2008b62cc08cSmrg	lint_options="-u -b"
2009b62cc08cSmrg	;;
2010b62cc08cSmrg  *solaris*)
2011b62cc08cSmrg	lint_name=lint
2012b62cc08cSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2013b62cc08cSmrg	;;
2014b62cc08cSmrgesac
2015b62cc08cSmrg
2016b62cc08cSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
2017b62cc08cSmrgif test "x$use_lint" = x"yes" ; then
2018b62cc08cSmrg   AC_PATH_PROG([LINT], [$lint_name])
2019b62cc08cSmrg   if test "x$LINT" = "x"; then
2020b62cc08cSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2021b62cc08cSmrg   fi
2022b62cc08cSmrgelif test "x$use_lint" = x"no" ; then
2023b62cc08cSmrg   if test "x$LINT" != "x"; then
2024b62cc08cSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2025b62cc08cSmrg   fi
20269fe995a9Smrgelse
2027b62cc08cSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
20289fe995a9Smrgfi
2029b62cc08cSmrg
2030b62cc08cSmrg# User supplied flags override default flags
2031b62cc08cSmrgif test "x$LINT_FLAGS" != "x"; then
2032b62cc08cSmrg   lint_options=$LINT_FLAGS
20339fe995a9Smrgfi
20349fe995a9Smrg
2035b62cc08cSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2036b62cc08cSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
20379fe995a9Smrg
20389fe995a9Smrg]) # XORG_WITH_LINT
20399fe995a9Smrg
20409fe995a9Smrg# XORG_LINT_LIBRARY(LIBNAME)
20419fe995a9Smrg# --------------------------
20429fe995a9Smrg# Minimum version: 1.1.0
20439fe995a9Smrg#
20449fe995a9Smrg# Sets up flags for building lint libraries for checking programs that call
20459fe995a9Smrg# functions in the library.
20469fe995a9Smrg#
2047b62cc08cSmrg# Interface to module:
2048b62cc08cSmrg# LINTLIB		- Automake variable with the name of lint library file to make
2049b62cc08cSmrg# MAKE_LINT_LIB		- Automake conditional
2050b62cc08cSmrg#
2051b62cc08cSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2052b62cc08cSmrg#			  - 'no' user instructs the module not to create a lint library (default)
20539fe995a9Smrg
20549fe995a9SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
20559fe995a9SmrgAC_REQUIRE([XORG_WITH_LINT])
2056b62cc08cSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
20579fe995a9Smrg	[Create lint library (default: disabled)])],
20589fe995a9Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2059b62cc08cSmrg
2060b62cc08cSmrgif test "x$make_lint_lib" = x"yes" ; then
2061b62cc08cSmrg   LINTLIB=llib-l$1.ln
2062b62cc08cSmrg   if test "x$LINT" = "x"; then
2063b62cc08cSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2064b62cc08cSmrg   fi
2065b62cc08cSmrgelif test "x$make_lint_lib" != x"no" ; then
2066b62cc08cSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
20679fe995a9Smrgfi
2068b62cc08cSmrg
20699fe995a9SmrgAC_SUBST(LINTLIB)
20709fe995a9SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
20719fe995a9Smrg
20729fe995a9Smrg]) # XORG_LINT_LIBRARY
20739fe995a9Smrg
2074b62cc08cSmrg# XORG_CWARNFLAGS
2075b62cc08cSmrg# ---------------
2076b62cc08cSmrg# Minimum version: 1.2.0
2077b62cc08cSmrg#
2078b62cc08cSmrg# Defines CWARNFLAGS to enable C compiler warnings.
2079b62cc08cSmrg#
2080b62cc08cSmrgAC_DEFUN([XORG_CWARNFLAGS], [
2081b62cc08cSmrgAC_REQUIRE([AC_PROG_CC_C99])
2082b62cc08cSmrgif  test "x$GCC" = xyes ; then
2083b62cc08cSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
2084b62cc08cSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
2085b62cc08cSmrg-Wbad-function-cast -Wformat=2"
2086b62cc08cSmrg    case `$CC -dumpversion` in
2087b62cc08cSmrg    3.4.* | 4.*)
2088b62cc08cSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
2089b62cc08cSmrg	;;
2090b62cc08cSmrg    esac
2091b62cc08cSmrgelse
2092b62cc08cSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2093b62cc08cSmrg    if test "x$SUNCC" = "xyes"; then
2094b62cc08cSmrg	CWARNFLAGS="-v"
2095b62cc08cSmrg    fi
2096b62cc08cSmrgfi
2097b62cc08cSmrgAC_SUBST(CWARNFLAGS)
2098b62cc08cSmrg]) # XORG_CWARNFLAGS
2099b62cc08cSmrg
2100b62cc08cSmrg# XORG_STRICT_OPTION
2101b62cc08cSmrg# -----------------------
2102b62cc08cSmrg# Minimum version: 1.3.0
2103b62cc08cSmrg#
2104b62cc08cSmrg# Add configure option to enable strict compilation
2105b62cc08cSmrgAC_DEFUN([XORG_STRICT_OPTION], [
2106b62cc08cSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
2107b62cc08cSmrgAC_REQUIRE([AC_PROG_CC_C99])
2108b62cc08cSmrgAC_REQUIRE([XORG_CWARNFLAGS])
2109b62cc08cSmrg
2110b62cc08cSmrgAC_ARG_ENABLE(strict-compilation,
2111b62cc08cSmrg			  AS_HELP_STRING([--enable-strict-compilation],
2112b62cc08cSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
2113b62cc08cSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2114b62cc08cSmrgif test "x$STRICT_COMPILE" = "xyes"; then
2115b62cc08cSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2116b62cc08cSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2117b62cc08cSmrg	if test "x$GCC" = xyes ; then
2118b62cc08cSmrg		STRICT_CFLAGS="-pedantic -Werror"
2119b62cc08cSmrg	elif test "x$SUNCC" = "xyes"; then
2120b62cc08cSmrg		STRICT_CFLAGS="-errwarn"
2121b62cc08cSmrg    elif test "x$INTELCC" = "xyes"; then
2122b62cc08cSmrg		STRICT_CFLAGS="-Werror"
2123b62cc08cSmrg	fi
2124b62cc08cSmrgfi
2125b62cc08cSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
2126b62cc08cSmrgAC_SUBST([CWARNFLAGS])
2127b62cc08cSmrg]) # XORG_STRICT_OPTION
2128b62cc08cSmrg
2129b62cc08cSmrg# XORG_DEFAULT_OPTIONS
2130b62cc08cSmrg# --------------------
2131b62cc08cSmrg# Minimum version: 1.3.0
2132b62cc08cSmrg#
2133b62cc08cSmrg# Defines default options for X.Org modules.
2134b62cc08cSmrg#
2135b62cc08cSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
2136b62cc08cSmrgAC_REQUIRE([AC_PROG_INSTALL])
2137b62cc08cSmrgXORG_CWARNFLAGS
2138b62cc08cSmrgXORG_STRICT_OPTION
2139b62cc08cSmrgXORG_RELEASE_VERSION
2140b62cc08cSmrgXORG_CHANGELOG
2141b62cc08cSmrgXORG_INSTALL
2142b62cc08cSmrgXORG_MANPAGE_SECTIONS
2143b62cc08cSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2144b62cc08cSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2145b62cc08cSmrg]) # XORG_DEFAULT_OPTIONS
2146b62cc08cSmrg
2147b62cc08cSmrg# XORG_INSTALL()
2148b62cc08cSmrg# ----------------
2149b62cc08cSmrg# Minimum version: 1.4.0
2150b62cc08cSmrg#
2151b62cc08cSmrg# Defines the variable INSTALL_CMD as the command to copy
2152b62cc08cSmrg# INSTALL from $prefix/share/util-macros.
2153b62cc08cSmrg#
2154b62cc08cSmrgAC_DEFUN([XORG_INSTALL], [
2155b62cc08cSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2156b62cc08cSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2157b62cc08cSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2158b62cc08cSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2159b62cc08cSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
2160b62cc08cSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
2161b62cc08cSmrgAC_SUBST([INSTALL_CMD])
2162b62cc08cSmrg]) # XORG_INSTALL
21639fe995a9Smrgdnl Copyright 2005 Red Hat, Inc
21649fe995a9Smrgdnl
21659fe995a9Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
21669fe995a9Smrgdnl documentation for any purpose is hereby granted without fee, provided that
21679fe995a9Smrgdnl the above copyright notice appear in all copies and that both that
21689fe995a9Smrgdnl copyright notice and this permission notice appear in supporting
21699fe995a9Smrgdnl documentation.
21709fe995a9Smrgdnl
21719fe995a9Smrgdnl The above copyright notice and this permission notice shall be included
21729fe995a9Smrgdnl in all copies or substantial portions of the Software.
21739fe995a9Smrgdnl
21749fe995a9Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21759fe995a9Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21769fe995a9Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21779fe995a9Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
21789fe995a9Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21799fe995a9Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21809fe995a9Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
21819fe995a9Smrgdnl
21829fe995a9Smrgdnl Except as contained in this notice, the name of the copyright holders shall
21839fe995a9Smrgdnl not be used in advertising or otherwise to promote the sale, use or
21849fe995a9Smrgdnl other dealings in this Software without prior written authorization
21859fe995a9Smrgdnl from the copyright holders.
21869fe995a9Smrgdnl
21879fe995a9Smrg
21889fe995a9Smrg# XORG_RELEASE_VERSION
21899fe995a9Smrg# --------------------
2190b62cc08cSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
21919fe995a9Smrg 
21929fe995a9SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
21939fe995a9Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
21949fe995a9Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
21959fe995a9Smrg		[Major version of this package])
2196b62cc08cSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
21979fe995a9Smrg	if test "x$PVM" = "x"; then
21989fe995a9Smrg		PVM="0"
21999fe995a9Smrg	fi
22009fe995a9Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
22019fe995a9Smrg		[$PVM],
22029fe995a9Smrg		[Minor version of this package])
2203b62cc08cSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
22049fe995a9Smrg	if test "x$PVP" = "x"; then
22059fe995a9Smrg		PVP="0"
22069fe995a9Smrg	fi
22079fe995a9Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
22089fe995a9Smrg		[$PVP],
22099fe995a9Smrg		[Patch version of this package])
22109fe995a9Smrg])
22119fe995a9Smrg
2212b62cc08cSmrg# XORG_CHANGELOG()
2213b62cc08cSmrg# ----------------
2214b62cc08cSmrg# Minimum version: 1.2.0
2215b62cc08cSmrg#
2216b62cc08cSmrg# Defines the variable CHANGELOG_CMD as the command to generate
2217b62cc08cSmrg# ChangeLog from git.
2218b62cc08cSmrg#
2219b62cc08cSmrg#
2220b62cc08cSmrgAC_DEFUN([XORG_CHANGELOG], [
2221b62cc08cSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
2222b62cc08cSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2223b62cc08cSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2224b62cc08cSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
2225b62cc08cSmrgAC_SUBST([CHANGELOG_CMD])
2226b62cc08cSmrg]) # XORG_CHANGELOG
2227b62cc08cSmrg
22289fe995a9Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
22299fe995a9Smrg# 
22309fe995a9Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
22319fe995a9Smrg#
22329fe995a9Smrg# This program is free software; you can redistribute it and/or modify
22339fe995a9Smrg# it under the terms of the GNU General Public License as published by
22349fe995a9Smrg# the Free Software Foundation; either version 2 of the License, or
22359fe995a9Smrg# (at your option) any later version.
22369fe995a9Smrg#
22379fe995a9Smrg# This program is distributed in the hope that it will be useful, but
22389fe995a9Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
22399fe995a9Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22409fe995a9Smrg# General Public License for more details.
22419fe995a9Smrg#
22429fe995a9Smrg# You should have received a copy of the GNU General Public License
22439fe995a9Smrg# along with this program; if not, write to the Free Software
22449fe995a9Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22459fe995a9Smrg#
22469fe995a9Smrg# As a special exception to the GNU General Public License, if you
22479fe995a9Smrg# distribute this file as part of a program that contains a
22489fe995a9Smrg# configuration script generated by Autoconf, you may include it under
22499fe995a9Smrg# the same distribution terms that you use for the rest of that program.
22509fe995a9Smrg
22519fe995a9Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
22529fe995a9Smrg# ----------------------------------
22539fe995a9SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
22549fe995a9Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
22559fe995a9Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
22569fe995a9SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
22579fe995a9Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
22589fe995a9Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
22599fe995a9Smrgfi
22609fe995a9Smrgif test -n "$PKG_CONFIG"; then
2261b62cc08cSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
22629fe995a9Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
22639fe995a9Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
22649fe995a9Smrg		AC_MSG_RESULT([yes])
22659fe995a9Smrg	else
22669fe995a9Smrg		AC_MSG_RESULT([no])
22679fe995a9Smrg		PKG_CONFIG=""
22689fe995a9Smrg	fi
22699fe995a9Smrg		
22709fe995a9Smrgfi[]dnl
22719fe995a9Smrg])# PKG_PROG_PKG_CONFIG
22729fe995a9Smrg
22739fe995a9Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
22749fe995a9Smrg#
22759fe995a9Smrg# Check to see whether a particular set of modules exists.  Similar
22769fe995a9Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
22779fe995a9Smrg#
22789fe995a9Smrg#
22799fe995a9Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
22809fe995a9Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
22819fe995a9Smrg# PKG_CHECK_EXISTS manually
22829fe995a9Smrg# --------------------------------------------------------------
22839fe995a9SmrgAC_DEFUN([PKG_CHECK_EXISTS],
22849fe995a9Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
22859fe995a9Smrgif test -n "$PKG_CONFIG" && \
22869fe995a9Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
22879fe995a9Smrg  m4_ifval([$2], [$2], [:])
22889fe995a9Smrgm4_ifvaln([$3], [else
22899fe995a9Smrg  $3])dnl
22909fe995a9Smrgfi])
22919fe995a9Smrg
22929fe995a9Smrg
22939fe995a9Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
22949fe995a9Smrg# ---------------------------------------------
22959fe995a9Smrgm4_define([_PKG_CONFIG],
2296b62cc08cSmrg[if test -n "$$1"; then
2297b62cc08cSmrg    pkg_cv_[]$1="$$1"
2298b62cc08cSmrg elif test -n "$PKG_CONFIG"; then
2299b62cc08cSmrg    PKG_CHECK_EXISTS([$3],
2300b62cc08cSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
2301b62cc08cSmrg		     [pkg_failed=yes])
2302b62cc08cSmrg else
2303b62cc08cSmrg    pkg_failed=untried
23049fe995a9Smrgfi[]dnl
23059fe995a9Smrg])# _PKG_CONFIG
23069fe995a9Smrg
2307b62cc08cSmrg# _PKG_SHORT_ERRORS_SUPPORTED
2308b62cc08cSmrg# -----------------------------
2309b62cc08cSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2310b62cc08cSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2311b62cc08cSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2312b62cc08cSmrg        _pkg_short_errors_supported=yes
2313b62cc08cSmrgelse
2314b62cc08cSmrg        _pkg_short_errors_supported=no
2315b62cc08cSmrgfi[]dnl
2316b62cc08cSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
2317b62cc08cSmrg
2318b62cc08cSmrg
23199fe995a9Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
23209fe995a9Smrg# [ACTION-IF-NOT-FOUND])
23219fe995a9Smrg#
23229fe995a9Smrg#
23239fe995a9Smrg# Note that if there is a possibility the first call to
23249fe995a9Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
23259fe995a9Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
23269fe995a9Smrg#
23279fe995a9Smrg#
23289fe995a9Smrg# --------------------------------------------------------------
23299fe995a9SmrgAC_DEFUN([PKG_CHECK_MODULES],
23309fe995a9Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
23319fe995a9SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
23329fe995a9SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
23339fe995a9Smrg
23349fe995a9Smrgpkg_failed=no
23359fe995a9SmrgAC_MSG_CHECKING([for $1])
23369fe995a9Smrg
23379fe995a9Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
23389fe995a9Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
23399fe995a9Smrg
2340b62cc08cSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2341b62cc08cSmrgand $1[]_LIBS to avoid the need to call pkg-config.
2342b62cc08cSmrgSee the pkg-config man page for more details.])
2343b62cc08cSmrg
23449fe995a9Smrgif test $pkg_failed = yes; then
2345b62cc08cSmrg        _PKG_SHORT_ERRORS_SUPPORTED
2346b62cc08cSmrg        if test $_pkg_short_errors_supported = yes; then
2347b62cc08cSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
2348b62cc08cSmrg        else 
2349b62cc08cSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
2350b62cc08cSmrg        fi
23519fe995a9Smrg	# Put the nasty error message in config.log where it belongs
2352b62cc08cSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
23539fe995a9Smrg
23549fe995a9Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
2355b62cc08cSmrg[Package requirements ($2) were not met:
2356b62cc08cSmrg
2357b62cc08cSmrg$$1_PKG_ERRORS
2358b62cc08cSmrg
23599fe995a9SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
23609fe995a9Smrginstalled software in a non-standard prefix.
23619fe995a9Smrg
2362b62cc08cSmrg_PKG_TEXT
2363b62cc08cSmrg])],
2364b62cc08cSmrg		[AC_MSG_RESULT([no])
2365b62cc08cSmrg                $4])
23669fe995a9Smrgelif test $pkg_failed = untried; then
23679fe995a9Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
23689fe995a9Smrg[The pkg-config script could not be found or is too old.  Make sure it
23699fe995a9Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
23709fe995a9Smrgpath to pkg-config.
23719fe995a9Smrg
2372b62cc08cSmrg_PKG_TEXT
23739fe995a9Smrg
2374b62cc08cSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
23759fe995a9Smrg		[$4])
23769fe995a9Smrgelse
23779fe995a9Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
23789fe995a9Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
23799fe995a9Smrg        AC_MSG_RESULT([yes])
23809fe995a9Smrg	ifelse([$3], , :, [$3])
23819fe995a9Smrgfi[]dnl
23829fe995a9Smrg])# PKG_CHECK_MODULES
23839fe995a9Smrg
2384