aclocal.m4 revision af928962
1af928962Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
273143b9aSmrg
373143b9aSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4b53e5eeaSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
573143b9aSmrg# This file is free software; the Free Software Foundation
673143b9aSmrg# gives unlimited permission to copy and/or distribute it,
773143b9aSmrg# with or without modifications, as long as this notice is preserved.
873143b9aSmrg
973143b9aSmrg# This program is distributed in the hope that it will be useful,
1073143b9aSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1173143b9aSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1273143b9aSmrg# PARTICULAR PURPOSE.
1373143b9aSmrg
14b53e5eeaSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15b53e5eeaSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16af928962Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17af928962Smrg[m4_warning([this file was generated for autoconf 2.68.
18b53e5eeaSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19b53e5eeaSmrgIf you have problems, you may need to regenerate the build system entirely.
20b53e5eeaSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
2173143b9aSmrg
22b53e5eeaSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2373143b9aSmrg#
2473143b9aSmrg# This file is free software; the Free Software Foundation
2573143b9aSmrg# gives unlimited permission to copy and/or distribute it,
2673143b9aSmrg# with or without modifications, as long as this notice is preserved.
2773143b9aSmrg
2873143b9aSmrg# AM_AUTOMAKE_VERSION(VERSION)
2973143b9aSmrg# ----------------------------
3073143b9aSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3173143b9aSmrg# generated from the m4 files accompanying Automake X.Y.
3273143b9aSmrg# (This private macro should not be called outside this file.)
3373143b9aSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34b53e5eeaSmrg[am__api_version='1.11'
3573143b9aSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3673143b9aSmrgdnl require some minimum version.  Point them to the right macro.
37af928962Smrgm4_if([$1], [1.11.1], [],
3873143b9aSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3973143b9aSmrg])
4073143b9aSmrg
4173143b9aSmrg# _AM_AUTOCONF_VERSION(VERSION)
4273143b9aSmrg# -----------------------------
4373143b9aSmrg# aclocal traces this macro to find the Autoconf version.
4473143b9aSmrg# This is a private macro too.  Using m4_define simplifies
4573143b9aSmrg# the logic in aclocal, which can simply ignore this definition.
4673143b9aSmrgm4_define([_AM_AUTOCONF_VERSION], [])
4773143b9aSmrg
4873143b9aSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
4973143b9aSmrg# -------------------------------
5073143b9aSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51b53e5eeaSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5273143b9aSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53af928962Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
54b53e5eeaSmrgm4_ifndef([AC_AUTOCONF_VERSION],
55b53e5eeaSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56b53e5eeaSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5773143b9aSmrg
5873143b9aSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
5973143b9aSmrg
6073143b9aSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6173143b9aSmrg#
6273143b9aSmrg# This file is free software; the Free Software Foundation
6373143b9aSmrg# gives unlimited permission to copy and/or distribute it,
6473143b9aSmrg# with or without modifications, as long as this notice is preserved.
6573143b9aSmrg
6673143b9aSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6773143b9aSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6873143b9aSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6973143b9aSmrg#
7073143b9aSmrg# Of course, Automake must honor this variable whenever it calls a
7173143b9aSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7273143b9aSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7373143b9aSmrg# depending on how configure is run.  This is pretty annoying, since
7473143b9aSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7573143b9aSmrg# source directory, any form will work fine, but in subdirectories a
7673143b9aSmrg# relative path needs to be adjusted first.
7773143b9aSmrg#
7873143b9aSmrg# $ac_aux_dir/missing
7973143b9aSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8073143b9aSmrg# $top_srcdir/$ac_aux_dir/missing
8173143b9aSmrg#    fails if $ac_aux_dir is absolute,
8273143b9aSmrg#    fails when called from a subdirectory in a VPATH build with
8373143b9aSmrg#          a relative $ac_aux_dir
8473143b9aSmrg#
8573143b9aSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8673143b9aSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
8773143b9aSmrg# harmless because $srcdir is `.', but things will broke when you
8873143b9aSmrg# start a VPATH build or use an absolute $srcdir.
8973143b9aSmrg#
9073143b9aSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9173143b9aSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9273143b9aSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9373143b9aSmrg# and then we would define $MISSING as
9473143b9aSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9573143b9aSmrg# This will work as long as MISSING is not called from configure, because
9673143b9aSmrg# unfortunately $(top_srcdir) has no meaning in configure.
9773143b9aSmrg# However there are other variables, like CC, which are often used in
9873143b9aSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9973143b9aSmrg#
10073143b9aSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
10173143b9aSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
10273143b9aSmrg# configured tree to be moved without reconfiguration.
10373143b9aSmrg
10473143b9aSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10573143b9aSmrg[dnl Rely on autoconf to set up CDPATH properly.
10673143b9aSmrgAC_PREREQ([2.50])dnl
10773143b9aSmrg# expand $ac_aux_dir to an absolute path
10873143b9aSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
10973143b9aSmrg])
11073143b9aSmrg
11173143b9aSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11273143b9aSmrg
113b53e5eeaSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11473143b9aSmrg# Free Software Foundation, Inc.
11573143b9aSmrg#
11673143b9aSmrg# This file is free software; the Free Software Foundation
11773143b9aSmrg# gives unlimited permission to copy and/or distribute it,
11873143b9aSmrg# with or without modifications, as long as this notice is preserved.
11973143b9aSmrg
120b53e5eeaSmrg# serial 9
12173143b9aSmrg
12273143b9aSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12373143b9aSmrg# -------------------------------------
12473143b9aSmrg# Define a conditional.
12573143b9aSmrgAC_DEFUN([AM_CONDITIONAL],
12673143b9aSmrg[AC_PREREQ(2.52)dnl
12773143b9aSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12873143b9aSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12973143b9aSmrgAC_SUBST([$1_TRUE])dnl
13073143b9aSmrgAC_SUBST([$1_FALSE])dnl
13173143b9aSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
13273143b9aSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133b53e5eeaSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13473143b9aSmrgif $2; then
13573143b9aSmrg  $1_TRUE=
13673143b9aSmrg  $1_FALSE='#'
13773143b9aSmrgelse
13873143b9aSmrg  $1_TRUE='#'
13973143b9aSmrg  $1_FALSE=
14073143b9aSmrgfi
14173143b9aSmrgAC_CONFIG_COMMANDS_PRE(
14273143b9aSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14373143b9aSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14473143b9aSmrgUsually this means the macro was only invoked conditionally.]])
14573143b9aSmrgfi])])
14673143b9aSmrg
147b53e5eeaSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
14873143b9aSmrg# Free Software Foundation, Inc.
14973143b9aSmrg#
15073143b9aSmrg# This file is free software; the Free Software Foundation
15173143b9aSmrg# gives unlimited permission to copy and/or distribute it,
15273143b9aSmrg# with or without modifications, as long as this notice is preserved.
15373143b9aSmrg
154b53e5eeaSmrg# serial 10
15573143b9aSmrg
15673143b9aSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
15773143b9aSmrg# written in clear, in which case automake, when reading aclocal.m4,
15873143b9aSmrg# will think it sees a *use*, and therefore will trigger all it's
15973143b9aSmrg# C support machinery.  Also note that it means that autoscan, seeing
16073143b9aSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
16173143b9aSmrg
16273143b9aSmrg
16373143b9aSmrg# _AM_DEPENDENCIES(NAME)
16473143b9aSmrg# ----------------------
16573143b9aSmrg# See how the compiler implements dependency checking.
16673143b9aSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
16773143b9aSmrg# We try a few techniques and use that to set a single cache variable.
16873143b9aSmrg#
16973143b9aSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
17073143b9aSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
17173143b9aSmrg# dependency, and given that the user is not expected to run this macro,
17273143b9aSmrg# just rely on AC_PROG_CC.
17373143b9aSmrgAC_DEFUN([_AM_DEPENDENCIES],
17473143b9aSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
17573143b9aSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
17673143b9aSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
17773143b9aSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
17873143b9aSmrg
17973143b9aSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
18073143b9aSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
18173143b9aSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
18273143b9aSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
18373143b9aSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
18473143b9aSmrg                   [depcc="$$1"   am_compiler_list=])
18573143b9aSmrg
18673143b9aSmrgAC_CACHE_CHECK([dependency style of $depcc],
18773143b9aSmrg               [am_cv_$1_dependencies_compiler_type],
18873143b9aSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
18973143b9aSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
19073143b9aSmrg  # making bogus files that we don't know about and never remove.  For
19173143b9aSmrg  # instance it was reported that on HP-UX the gcc test will end up
19273143b9aSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
19373143b9aSmrg  # in D'.
19473143b9aSmrg  mkdir conftest.dir
19573143b9aSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19673143b9aSmrg  # using a relative directory.
19773143b9aSmrg  cp "$am_depcomp" conftest.dir
19873143b9aSmrg  cd conftest.dir
19973143b9aSmrg  # We will build objects and dependencies in a subdirectory because
20073143b9aSmrg  # it helps to detect inapplicable dependency modes.  For instance
20173143b9aSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
20273143b9aSmrg  # side effect of compilation, but ICC will put the dependencies in
20373143b9aSmrg  # the current directory while Tru64 will put them in the object
20473143b9aSmrg  # directory.
20573143b9aSmrg  mkdir sub
20673143b9aSmrg
20773143b9aSmrg  am_cv_$1_dependencies_compiler_type=none
20873143b9aSmrg  if test "$am_compiler_list" = ""; then
20973143b9aSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
21073143b9aSmrg  fi
211b53e5eeaSmrg  am__universal=false
212b53e5eeaSmrg  m4_case([$1], [CC],
213b53e5eeaSmrg    [case " $depcc " in #(
214b53e5eeaSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215b53e5eeaSmrg     esac],
216b53e5eeaSmrg    [CXX],
217b53e5eeaSmrg    [case " $depcc " in #(
218b53e5eeaSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219b53e5eeaSmrg     esac])
220b53e5eeaSmrg
22173143b9aSmrg  for depmode in $am_compiler_list; do
22273143b9aSmrg    # Setup a source with many dependencies, because some compilers
22373143b9aSmrg    # like to wrap large dependency lists on column 80 (with \), and
22473143b9aSmrg    # we should not choose a depcomp mode which is confused by this.
22573143b9aSmrg    #
22673143b9aSmrg    # We need to recreate these files for each test, as the compiler may
22773143b9aSmrg    # overwrite some of them when testing with obscure command lines.
22873143b9aSmrg    # This happens at least with the AIX C compiler.
22973143b9aSmrg    : > sub/conftest.c
23073143b9aSmrg    for i in 1 2 3 4 5 6; do
23173143b9aSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23273143b9aSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
23373143b9aSmrg      # Solaris 8's {/usr,}/bin/sh.
23473143b9aSmrg      touch sub/conftst$i.h
23573143b9aSmrg    done
23673143b9aSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
23773143b9aSmrg
238b53e5eeaSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239b53e5eeaSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240b53e5eeaSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241b53e5eeaSmrg    # versions had trouble with output in subdirs
242b53e5eeaSmrg    am__obj=sub/conftest.${OBJEXT-o}
243b53e5eeaSmrg    am__minus_obj="-o $am__obj"
24473143b9aSmrg    case $depmode in
245b53e5eeaSmrg    gcc)
246b53e5eeaSmrg      # This depmode causes a compiler race in universal mode.
247b53e5eeaSmrg      test "$am__universal" = false || continue
248b53e5eeaSmrg      ;;
24973143b9aSmrg    nosideeffect)
25073143b9aSmrg      # after this tag, mechanisms are not by side-effect, so they'll
25173143b9aSmrg      # only be used when explicitly requested
25273143b9aSmrg      if test "x$enable_dependency_tracking" = xyes; then
25373143b9aSmrg	continue
25473143b9aSmrg      else
25573143b9aSmrg	break
25673143b9aSmrg      fi
25773143b9aSmrg      ;;
258b53e5eeaSmrg    msvisualcpp | msvcmsys)
259b53e5eeaSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
260b53e5eeaSmrg      # not run yet.  These depmodes are late enough in the game, and
261b53e5eeaSmrg      # so weak that their functioning should not be impacted.
262b53e5eeaSmrg      am__obj=conftest.${OBJEXT-o}
263b53e5eeaSmrg      am__minus_obj=
264b53e5eeaSmrg      ;;
26573143b9aSmrg    none) break ;;
26673143b9aSmrg    esac
26773143b9aSmrg    if depmode=$depmode \
268b53e5eeaSmrg       source=sub/conftest.c object=$am__obj \
26973143b9aSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270b53e5eeaSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
27173143b9aSmrg         >/dev/null 2>conftest.err &&
27273143b9aSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
27373143b9aSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274b53e5eeaSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
27573143b9aSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
27673143b9aSmrg      # icc doesn't choke on unknown options, it will just issue warnings
27773143b9aSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
27873143b9aSmrg      # that says an option was ignored or not supported.
27973143b9aSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
28073143b9aSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
28173143b9aSmrg      # The diagnosis changed in icc 8.0:
28273143b9aSmrg      #   icc: Command line remark: option '-MP' not supported
28373143b9aSmrg      if (grep 'ignoring option' conftest.err ||
28473143b9aSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
28573143b9aSmrg        am_cv_$1_dependencies_compiler_type=$depmode
28673143b9aSmrg        break
28773143b9aSmrg      fi
28873143b9aSmrg    fi
28973143b9aSmrg  done
29073143b9aSmrg
29173143b9aSmrg  cd ..
29273143b9aSmrg  rm -rf conftest.dir
29373143b9aSmrgelse
29473143b9aSmrg  am_cv_$1_dependencies_compiler_type=none
29573143b9aSmrgfi
29673143b9aSmrg])
29773143b9aSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
29873143b9aSmrgAM_CONDITIONAL([am__fastdep$1], [
29973143b9aSmrg  test "x$enable_dependency_tracking" != xno \
30073143b9aSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
30173143b9aSmrg])
30273143b9aSmrg
30373143b9aSmrg
30473143b9aSmrg# AM_SET_DEPDIR
30573143b9aSmrg# -------------
30673143b9aSmrg# Choose a directory name for dependency files.
30773143b9aSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
30873143b9aSmrgAC_DEFUN([AM_SET_DEPDIR],
30973143b9aSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
31073143b9aSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
31173143b9aSmrg])
31273143b9aSmrg
31373143b9aSmrg
31473143b9aSmrg# AM_DEP_TRACK
31573143b9aSmrg# ------------
31673143b9aSmrgAC_DEFUN([AM_DEP_TRACK],
31773143b9aSmrg[AC_ARG_ENABLE(dependency-tracking,
31873143b9aSmrg[  --disable-dependency-tracking  speeds up one-time build
31973143b9aSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
32073143b9aSmrgif test "x$enable_dependency_tracking" != xno; then
32173143b9aSmrg  am_depcomp="$ac_aux_dir/depcomp"
32273143b9aSmrg  AMDEPBACKSLASH='\'
32373143b9aSmrgfi
32473143b9aSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
32573143b9aSmrgAC_SUBST([AMDEPBACKSLASH])dnl
32673143b9aSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
32773143b9aSmrg])
32873143b9aSmrg
32973143b9aSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
33073143b9aSmrg
331b53e5eeaSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33273143b9aSmrg# Free Software Foundation, Inc.
33373143b9aSmrg#
33473143b9aSmrg# This file is free software; the Free Software Foundation
33573143b9aSmrg# gives unlimited permission to copy and/or distribute it,
33673143b9aSmrg# with or without modifications, as long as this notice is preserved.
33773143b9aSmrg
338b53e5eeaSmrg#serial 5
33973143b9aSmrg
34073143b9aSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
34173143b9aSmrg# ------------------------------
34273143b9aSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343b53e5eeaSmrg[{
344b53e5eeaSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345b53e5eeaSmrg  # are listed without --file.  Let's play safe and only enable the eval
346b53e5eeaSmrg  # if we detect the quoting.
347b53e5eeaSmrg  case $CONFIG_FILES in
348b53e5eeaSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
349b53e5eeaSmrg  *)   set x $CONFIG_FILES ;;
350b53e5eeaSmrg  esac
351b53e5eeaSmrg  shift
352b53e5eeaSmrg  for mf
353b53e5eeaSmrg  do
354b53e5eeaSmrg    # Strip MF so we end up with the name of the file.
355b53e5eeaSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356b53e5eeaSmrg    # Check whether this is an Automake generated Makefile or not.
357b53e5eeaSmrg    # We used to match only the files named `Makefile.in', but
358b53e5eeaSmrg    # some people rename them; so instead we look at the file content.
359b53e5eeaSmrg    # Grep'ing the first line is not enough: some people post-process
360b53e5eeaSmrg    # each Makefile.in and add a new line on top of each file to say so.
361b53e5eeaSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
362b53e5eeaSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
363b53e5eeaSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364b53e5eeaSmrg      dirpart=`AS_DIRNAME("$mf")`
365b53e5eeaSmrg    else
366b53e5eeaSmrg      continue
367b53e5eeaSmrg    fi
368b53e5eeaSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
369b53e5eeaSmrg    # from the Makefile without running `make'.
370b53e5eeaSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371b53e5eeaSmrg    test -z "$DEPDIR" && continue
372b53e5eeaSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373b53e5eeaSmrg    test -z "am__include" && continue
374b53e5eeaSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375b53e5eeaSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
376b53e5eeaSmrg    U=`sed -n 's/^U = //p' < "$mf"`
377b53e5eeaSmrg    # Find all dependency output files, they are included files with
378b53e5eeaSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379b53e5eeaSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380b53e5eeaSmrg    # expansion.
381b53e5eeaSmrg    for file in `sed -n "
382b53e5eeaSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383b53e5eeaSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384b53e5eeaSmrg      # Make sure the directory exists.
385b53e5eeaSmrg      test -f "$dirpart/$file" && continue
386b53e5eeaSmrg      fdir=`AS_DIRNAME(["$file"])`
387b53e5eeaSmrg      AS_MKDIR_P([$dirpart/$fdir])
388b53e5eeaSmrg      # echo "creating $dirpart/$file"
389b53e5eeaSmrg      echo '# dummy' > "$dirpart/$file"
390b53e5eeaSmrg    done
39173143b9aSmrg  done
392b53e5eeaSmrg}
39373143b9aSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
39473143b9aSmrg
39573143b9aSmrg
39673143b9aSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
39773143b9aSmrg# -----------------------------
39873143b9aSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
39973143b9aSmrg#
40073143b9aSmrg# This code is only required when automatic dependency tracking
40173143b9aSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
40273143b9aSmrg# need in order to bootstrap the dependency handling code.
40373143b9aSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
40473143b9aSmrg[AC_CONFIG_COMMANDS([depfiles],
40573143b9aSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
40673143b9aSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
40773143b9aSmrg])
40873143b9aSmrg
40973143b9aSmrg# Do all the work for Automake.                             -*- Autoconf -*-
41073143b9aSmrg
41173143b9aSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
412b53e5eeaSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
41373143b9aSmrg#
41473143b9aSmrg# This file is free software; the Free Software Foundation
41573143b9aSmrg# gives unlimited permission to copy and/or distribute it,
41673143b9aSmrg# with or without modifications, as long as this notice is preserved.
41773143b9aSmrg
418b53e5eeaSmrg# serial 16
41973143b9aSmrg
42073143b9aSmrg# This macro actually does too much.  Some checks are only needed if
42173143b9aSmrg# your package does certain things.  But this isn't really a big deal.
42273143b9aSmrg
42373143b9aSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
42473143b9aSmrg# AM_INIT_AUTOMAKE([OPTIONS])
42573143b9aSmrg# -----------------------------------------------
42673143b9aSmrg# The call with PACKAGE and VERSION arguments is the old style
42773143b9aSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
42873143b9aSmrg# and VERSION should now be passed to AC_INIT and removed from
42973143b9aSmrg# the call to AM_INIT_AUTOMAKE.
43073143b9aSmrg# We support both call styles for the transition.  After
43173143b9aSmrg# the next Automake release, Autoconf can make the AC_INIT
43273143b9aSmrg# arguments mandatory, and then we can depend on a new Autoconf
43373143b9aSmrg# release and drop the old call support.
43473143b9aSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
435b53e5eeaSmrg[AC_PREREQ([2.62])dnl
43673143b9aSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
43773143b9aSmrgdnl the ones we care about.
43873143b9aSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
43973143b9aSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
44073143b9aSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
44173143b9aSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
44273143b9aSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
44373143b9aSmrg  # is not polluted with repeated "-I."
44473143b9aSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
44573143b9aSmrg  # test to see if srcdir already configured
44673143b9aSmrg  if test -f $srcdir/config.status; then
44773143b9aSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
44873143b9aSmrg  fi
44973143b9aSmrgfi
45073143b9aSmrg
45173143b9aSmrg# test whether we have cygpath
45273143b9aSmrgif test -z "$CYGPATH_W"; then
45373143b9aSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
45473143b9aSmrg    CYGPATH_W='cygpath -w'
45573143b9aSmrg  else
45673143b9aSmrg    CYGPATH_W=echo
45773143b9aSmrg  fi
45873143b9aSmrgfi
45973143b9aSmrgAC_SUBST([CYGPATH_W])
46073143b9aSmrg
46173143b9aSmrg# Define the identity of the package.
46273143b9aSmrgdnl Distinguish between old-style and new-style calls.
46373143b9aSmrgm4_ifval([$2],
46473143b9aSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
46573143b9aSmrg AC_SUBST([PACKAGE], [$1])dnl
46673143b9aSmrg AC_SUBST([VERSION], [$2])],
46773143b9aSmrg[_AM_SET_OPTIONS([$1])dnl
46873143b9aSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
46973143b9aSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
47073143b9aSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
47173143b9aSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
47273143b9aSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
47373143b9aSmrg
47473143b9aSmrg_AM_IF_OPTION([no-define],,
47573143b9aSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
47673143b9aSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
47773143b9aSmrg
47873143b9aSmrg# Some tools Automake needs.
47973143b9aSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
48073143b9aSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
48173143b9aSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
48273143b9aSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
48373143b9aSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
48473143b9aSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
48573143b9aSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
486b53e5eeaSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487b53e5eeaSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
48873143b9aSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
48973143b9aSmrg# We need awk for the "check" target.  The system "awk" is bad on
49073143b9aSmrg# some platforms.
49173143b9aSmrgAC_REQUIRE([AC_PROG_AWK])dnl
49273143b9aSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
49373143b9aSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
49473143b9aSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
495b53e5eeaSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
496b53e5eeaSmrg			     [_AM_PROG_TAR([v7])])])
49773143b9aSmrg_AM_IF_OPTION([no-dependencies],,
49873143b9aSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
499b53e5eeaSmrg		  [_AM_DEPENDENCIES(CC)],
500b53e5eeaSmrg		  [define([AC_PROG_CC],
501b53e5eeaSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
50273143b9aSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
503b53e5eeaSmrg		  [_AM_DEPENDENCIES(CXX)],
504b53e5eeaSmrg		  [define([AC_PROG_CXX],
505b53e5eeaSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
50673143b9aSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
507b53e5eeaSmrg		  [_AM_DEPENDENCIES(OBJC)],
508b53e5eeaSmrg		  [define([AC_PROG_OBJC],
509b53e5eeaSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
51073143b9aSmrg])
511b53e5eeaSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
512b53e5eeaSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
513b53e5eeaSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
514b53e5eeaSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
515b53e5eeaSmrgAC_CONFIG_COMMANDS_PRE(dnl
516b53e5eeaSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
517b53e5eeaSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
51873143b9aSmrg])
51973143b9aSmrg
520b53e5eeaSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
521b53e5eeaSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522b53e5eeaSmrgdnl mangled by Autoconf and run in a shell conditional statement.
523b53e5eeaSmrgm4_define([_AC_COMPILER_EXEEXT],
524b53e5eeaSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525b53e5eeaSmrg
52673143b9aSmrg
52773143b9aSmrg# When config.status generates a header, we must update the stamp-h file.
52873143b9aSmrg# This file resides in the same directory as the config header
52973143b9aSmrg# that is generated.  The stamp files are numbered to have different names.
53073143b9aSmrg
53173143b9aSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
53273143b9aSmrg# loop where config.status creates the headers, so we can generate
53373143b9aSmrg# our stamp files there.
53473143b9aSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
53573143b9aSmrg[# Compute $1's index in $config_headers.
536b53e5eeaSmrg_am_arg=$1
53773143b9aSmrg_am_stamp_count=1
53873143b9aSmrgfor _am_header in $config_headers :; do
53973143b9aSmrg  case $_am_header in
540b53e5eeaSmrg    $_am_arg | $_am_arg:* )
54173143b9aSmrg      break ;;
54273143b9aSmrg    * )
54373143b9aSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
54473143b9aSmrg  esac
54573143b9aSmrgdone
546b53e5eeaSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
54773143b9aSmrg
548b53e5eeaSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
54973143b9aSmrg#
55073143b9aSmrg# This file is free software; the Free Software Foundation
55173143b9aSmrg# gives unlimited permission to copy and/or distribute it,
55273143b9aSmrg# with or without modifications, as long as this notice is preserved.
55373143b9aSmrg
55473143b9aSmrg# AM_PROG_INSTALL_SH
55573143b9aSmrg# ------------------
55673143b9aSmrg# Define $install_sh.
55773143b9aSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
55873143b9aSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
559b53e5eeaSmrgif test x"${install_sh}" != xset; then
560b53e5eeaSmrg  case $am_aux_dir in
561b53e5eeaSmrg  *\ * | *\	*)
562b53e5eeaSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
563b53e5eeaSmrg  *)
564b53e5eeaSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
565b53e5eeaSmrg  esac
566b53e5eeaSmrgfi
56773143b9aSmrgAC_SUBST(install_sh)])
56873143b9aSmrg
56973143b9aSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
57073143b9aSmrg#
57173143b9aSmrg# This file is free software; the Free Software Foundation
57273143b9aSmrg# gives unlimited permission to copy and/or distribute it,
57373143b9aSmrg# with or without modifications, as long as this notice is preserved.
57473143b9aSmrg
57573143b9aSmrg# serial 2
57673143b9aSmrg
57773143b9aSmrg# Check whether the underlying file-system supports filenames
57873143b9aSmrg# with a leading dot.  For instance MS-DOS doesn't.
57973143b9aSmrgAC_DEFUN([AM_SET_LEADING_DOT],
58073143b9aSmrg[rm -rf .tst 2>/dev/null
58173143b9aSmrgmkdir .tst 2>/dev/null
58273143b9aSmrgif test -d .tst; then
58373143b9aSmrg  am__leading_dot=.
58473143b9aSmrgelse
58573143b9aSmrg  am__leading_dot=_
58673143b9aSmrgfi
58773143b9aSmrgrmdir .tst 2>/dev/null
58873143b9aSmrgAC_SUBST([am__leading_dot])])
58973143b9aSmrg
59073143b9aSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
59173143b9aSmrg# From Jim Meyering
59273143b9aSmrg
593b53e5eeaSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
59473143b9aSmrg# Free Software Foundation, Inc.
59573143b9aSmrg#
59673143b9aSmrg# This file is free software; the Free Software Foundation
59773143b9aSmrg# gives unlimited permission to copy and/or distribute it,
59873143b9aSmrg# with or without modifications, as long as this notice is preserved.
59973143b9aSmrg
600b53e5eeaSmrg# serial 5
60173143b9aSmrg
602b53e5eeaSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
603b53e5eeaSmrg# ----------------------------------
604b53e5eeaSmrg# Control maintainer-specific portions of Makefiles.
605b53e5eeaSmrg# Default is to disable them, unless `enable' is passed literally.
606b53e5eeaSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
607b53e5eeaSmrg# can override the default with the --enable/--disable switch.
60873143b9aSmrgAC_DEFUN([AM_MAINTAINER_MODE],
609b53e5eeaSmrg[m4_case(m4_default([$1], [disable]),
610b53e5eeaSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
611b53e5eeaSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
612b53e5eeaSmrg       [m4_define([am_maintainer_other], [enable])
613b53e5eeaSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
614b53e5eeaSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
615b53e5eeaSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
616b53e5eeaSmrg  AC_ARG_ENABLE([maintainer-mode],
617b53e5eeaSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
61873143b9aSmrg			  (and sometimes confusing) to the casual installer],
619b53e5eeaSmrg      [USE_MAINTAINER_MODE=$enableval],
620b53e5eeaSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
62173143b9aSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
622b53e5eeaSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
62373143b9aSmrg  MAINT=$MAINTAINER_MODE_TRUE
624b53e5eeaSmrg  AC_SUBST([MAINT])dnl
62573143b9aSmrg]
62673143b9aSmrg)
62773143b9aSmrg
62873143b9aSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
62973143b9aSmrg
63073143b9aSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
63173143b9aSmrg
632b53e5eeaSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
63373143b9aSmrg#
63473143b9aSmrg# This file is free software; the Free Software Foundation
63573143b9aSmrg# gives unlimited permission to copy and/or distribute it,
63673143b9aSmrg# with or without modifications, as long as this notice is preserved.
63773143b9aSmrg
638b53e5eeaSmrg# serial 4
63973143b9aSmrg
64073143b9aSmrg# AM_MAKE_INCLUDE()
64173143b9aSmrg# -----------------
64273143b9aSmrg# Check to see how make treats includes.
64373143b9aSmrgAC_DEFUN([AM_MAKE_INCLUDE],
64473143b9aSmrg[am_make=${MAKE-make}
64573143b9aSmrgcat > confinc << 'END'
64673143b9aSmrgam__doit:
647b53e5eeaSmrg	@echo this is the am__doit target
64873143b9aSmrg.PHONY: am__doit
64973143b9aSmrgEND
65073143b9aSmrg# If we don't find an include directive, just comment out the code.
65173143b9aSmrgAC_MSG_CHECKING([for style of include used by $am_make])
65273143b9aSmrgam__include="#"
65373143b9aSmrgam__quote=
65473143b9aSmrg_am_result=none
65573143b9aSmrg# First try GNU make style include.
65673143b9aSmrgecho "include confinc" > confmf
657b53e5eeaSmrg# Ignore all kinds of additional output from `make'.
658b53e5eeaSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
659b53e5eeaSmrg*the\ am__doit\ target*)
660b53e5eeaSmrg  am__include=include
661b53e5eeaSmrg  am__quote=
662b53e5eeaSmrg  _am_result=GNU
663b53e5eeaSmrg  ;;
664b53e5eeaSmrgesac
66573143b9aSmrg# Now try BSD make style include.
66673143b9aSmrgif test "$am__include" = "#"; then
66773143b9aSmrg   echo '.include "confinc"' > confmf
668b53e5eeaSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
669b53e5eeaSmrg   *the\ am__doit\ target*)
670b53e5eeaSmrg     am__include=.include
671b53e5eeaSmrg     am__quote="\""
672b53e5eeaSmrg     _am_result=BSD
673b53e5eeaSmrg     ;;
674b53e5eeaSmrg   esac
67573143b9aSmrgfi
67673143b9aSmrgAC_SUBST([am__include])
67773143b9aSmrgAC_SUBST([am__quote])
67873143b9aSmrgAC_MSG_RESULT([$_am_result])
67973143b9aSmrgrm -f confinc confmf
68073143b9aSmrg])
68173143b9aSmrg
68273143b9aSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
68373143b9aSmrg
684b53e5eeaSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
68573143b9aSmrg# Free Software Foundation, Inc.
68673143b9aSmrg#
68773143b9aSmrg# This file is free software; the Free Software Foundation
68873143b9aSmrg# gives unlimited permission to copy and/or distribute it,
68973143b9aSmrg# with or without modifications, as long as this notice is preserved.
69073143b9aSmrg
691b53e5eeaSmrg# serial 6
69273143b9aSmrg
69373143b9aSmrg# AM_MISSING_PROG(NAME, PROGRAM)
69473143b9aSmrg# ------------------------------
69573143b9aSmrgAC_DEFUN([AM_MISSING_PROG],
69673143b9aSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
69773143b9aSmrg$1=${$1-"${am_missing_run}$2"}
69873143b9aSmrgAC_SUBST($1)])
69973143b9aSmrg
70073143b9aSmrg
70173143b9aSmrg# AM_MISSING_HAS_RUN
70273143b9aSmrg# ------------------
70373143b9aSmrg# Define MISSING if not defined so far and test if it supports --run.
70473143b9aSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
70573143b9aSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
70673143b9aSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
70773143b9aSmrgAC_REQUIRE_AUX_FILE([missing])dnl
708b53e5eeaSmrgif test x"${MISSING+set}" != xset; then
709b53e5eeaSmrg  case $am_aux_dir in
710b53e5eeaSmrg  *\ * | *\	*)
711b53e5eeaSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
712b53e5eeaSmrg  *)
713b53e5eeaSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
714b53e5eeaSmrg  esac
715b53e5eeaSmrgfi
71673143b9aSmrg# Use eval to expand $SHELL
71773143b9aSmrgif eval "$MISSING --run true"; then
71873143b9aSmrg  am_missing_run="$MISSING --run "
71973143b9aSmrgelse
72073143b9aSmrg  am_missing_run=
72173143b9aSmrg  AC_MSG_WARN([`missing' script is too old or missing])
72273143b9aSmrgfi
72373143b9aSmrg])
72473143b9aSmrg
72573143b9aSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
72673143b9aSmrg#
72773143b9aSmrg# This file is free software; the Free Software Foundation
72873143b9aSmrg# gives unlimited permission to copy and/or distribute it,
72973143b9aSmrg# with or without modifications, as long as this notice is preserved.
73073143b9aSmrg
73173143b9aSmrg# AM_PROG_MKDIR_P
73273143b9aSmrg# ---------------
73373143b9aSmrg# Check for `mkdir -p'.
73473143b9aSmrgAC_DEFUN([AM_PROG_MKDIR_P],
73573143b9aSmrg[AC_PREREQ([2.60])dnl
73673143b9aSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
73773143b9aSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
73873143b9aSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
73973143b9aSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
74073143b9aSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
74173143b9aSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
74273143b9aSmrgdnl adjustment using top_builddir (which is defined more often than
74373143b9aSmrgdnl MKDIR_P).
74473143b9aSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
74573143b9aSmrgcase $mkdir_p in
74673143b9aSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
74773143b9aSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
74873143b9aSmrgesac
74973143b9aSmrg])
75073143b9aSmrg
75173143b9aSmrg# Helper functions for option handling.                     -*- Autoconf -*-
75273143b9aSmrg
753b53e5eeaSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
75473143b9aSmrg#
75573143b9aSmrg# This file is free software; the Free Software Foundation
75673143b9aSmrg# gives unlimited permission to copy and/or distribute it,
75773143b9aSmrg# with or without modifications, as long as this notice is preserved.
75873143b9aSmrg
759b53e5eeaSmrg# serial 4
76073143b9aSmrg
76173143b9aSmrg# _AM_MANGLE_OPTION(NAME)
76273143b9aSmrg# -----------------------
76373143b9aSmrgAC_DEFUN([_AM_MANGLE_OPTION],
76473143b9aSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
76573143b9aSmrg
76673143b9aSmrg# _AM_SET_OPTION(NAME)
76773143b9aSmrg# ------------------------------
76873143b9aSmrg# Set option NAME.  Presently that only means defining a flag for this option.
76973143b9aSmrgAC_DEFUN([_AM_SET_OPTION],
77073143b9aSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
77173143b9aSmrg
77273143b9aSmrg# _AM_SET_OPTIONS(OPTIONS)
77373143b9aSmrg# ----------------------------------
77473143b9aSmrg# OPTIONS is a space-separated list of Automake options.
77573143b9aSmrgAC_DEFUN([_AM_SET_OPTIONS],
776b53e5eeaSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
77773143b9aSmrg
77873143b9aSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
77973143b9aSmrg# -------------------------------------------
78073143b9aSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
78173143b9aSmrgAC_DEFUN([_AM_IF_OPTION],
78273143b9aSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
78373143b9aSmrg
78473143b9aSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
78573143b9aSmrg
786b53e5eeaSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
78773143b9aSmrg# Free Software Foundation, Inc.
78873143b9aSmrg#
78973143b9aSmrg# This file is free software; the Free Software Foundation
79073143b9aSmrg# gives unlimited permission to copy and/or distribute it,
79173143b9aSmrg# with or without modifications, as long as this notice is preserved.
79273143b9aSmrg
793b53e5eeaSmrg# serial 5
79473143b9aSmrg
79573143b9aSmrg# AM_SANITY_CHECK
79673143b9aSmrg# ---------------
79773143b9aSmrgAC_DEFUN([AM_SANITY_CHECK],
79873143b9aSmrg[AC_MSG_CHECKING([whether build environment is sane])
79973143b9aSmrg# Just in case
80073143b9aSmrgsleep 1
80173143b9aSmrgecho timestamp > conftest.file
802b53e5eeaSmrg# Reject unsafe characters in $srcdir or the absolute working directory
803b53e5eeaSmrg# name.  Accept space and tab only in the latter.
804b53e5eeaSmrgam_lf='
805b53e5eeaSmrg'
806b53e5eeaSmrgcase `pwd` in
807b53e5eeaSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
808b53e5eeaSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
809b53e5eeaSmrgesac
810b53e5eeaSmrgcase $srcdir in
811b53e5eeaSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
812b53e5eeaSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
813b53e5eeaSmrgesac
814b53e5eeaSmrg
81573143b9aSmrg# Do `set' in a subshell so we don't clobber the current shell's
81673143b9aSmrg# arguments.  Must try -L first in case configure is actually a
81773143b9aSmrg# symlink; some systems play weird games with the mod time of symlinks
81873143b9aSmrg# (eg FreeBSD returns the mod time of the symlink's containing
81973143b9aSmrg# directory).
82073143b9aSmrgif (
821b53e5eeaSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
82273143b9aSmrg   if test "$[*]" = "X"; then
82373143b9aSmrg      # -L didn't work.
824b53e5eeaSmrg      set X `ls -t "$srcdir/configure" conftest.file`
82573143b9aSmrg   fi
82673143b9aSmrg   rm -f conftest.file
82773143b9aSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
82873143b9aSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
82973143b9aSmrg
83073143b9aSmrg      # If neither matched, then we have a broken ls.  This can happen
83173143b9aSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
83273143b9aSmrg      # broken ls alias from the environment.  This has actually
83373143b9aSmrg      # happened.  Such a system could not be considered "sane".
83473143b9aSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
83573143b9aSmrgalias in your environment])
83673143b9aSmrg   fi
83773143b9aSmrg
83873143b9aSmrg   test "$[2]" = conftest.file
83973143b9aSmrg   )
84073143b9aSmrgthen
84173143b9aSmrg   # Ok.
84273143b9aSmrg   :
84373143b9aSmrgelse
84473143b9aSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
84573143b9aSmrgCheck your system clock])
84673143b9aSmrgfi
84773143b9aSmrgAC_MSG_RESULT(yes)])
84873143b9aSmrg
849b53e5eeaSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
850b53e5eeaSmrg#
851b53e5eeaSmrg# This file is free software; the Free Software Foundation
852b53e5eeaSmrg# gives unlimited permission to copy and/or distribute it,
853b53e5eeaSmrg# with or without modifications, as long as this notice is preserved.
854b53e5eeaSmrg
855b53e5eeaSmrg# serial 1
856b53e5eeaSmrg
857b53e5eeaSmrg# AM_SILENT_RULES([DEFAULT])
858b53e5eeaSmrg# --------------------------
859b53e5eeaSmrg# Enable less verbose build rules; with the default set to DEFAULT
860b53e5eeaSmrg# (`yes' being less verbose, `no' or empty being verbose).
861b53e5eeaSmrgAC_DEFUN([AM_SILENT_RULES],
862b53e5eeaSmrg[AC_ARG_ENABLE([silent-rules],
863b53e5eeaSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
864b53e5eeaSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
865b53e5eeaSmrgcase $enable_silent_rules in
866b53e5eeaSmrgyes) AM_DEFAULT_VERBOSITY=0;;
867b53e5eeaSmrgno)  AM_DEFAULT_VERBOSITY=1;;
868b53e5eeaSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
869b53e5eeaSmrgesac
870b53e5eeaSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
871b53e5eeaSmrgAM_BACKSLASH='\'
872b53e5eeaSmrgAC_SUBST([AM_BACKSLASH])dnl
873b53e5eeaSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
874b53e5eeaSmrg])
875b53e5eeaSmrg
87673143b9aSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
87773143b9aSmrg#
87873143b9aSmrg# This file is free software; the Free Software Foundation
87973143b9aSmrg# gives unlimited permission to copy and/or distribute it,
88073143b9aSmrg# with or without modifications, as long as this notice is preserved.
88173143b9aSmrg
88273143b9aSmrg# AM_PROG_INSTALL_STRIP
88373143b9aSmrg# ---------------------
88473143b9aSmrg# One issue with vendor `install' (even GNU) is that you can't
88573143b9aSmrg# specify the program used to strip binaries.  This is especially
88673143b9aSmrg# annoying in cross-compiling environments, where the build's strip
88773143b9aSmrg# is unlikely to handle the host's binaries.
88873143b9aSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
88973143b9aSmrg# always use install-sh in `make install-strip', and initialize
89073143b9aSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
89173143b9aSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
89273143b9aSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
89373143b9aSmrg# Installed binaries are usually stripped using `strip' when the user
89473143b9aSmrg# run `make install-strip'.  However `strip' might not be the right
89573143b9aSmrg# tool to use in cross-compilation environments, therefore Automake
89673143b9aSmrg# will honor the `STRIP' environment variable to overrule this program.
89773143b9aSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
89873143b9aSmrgif test "$cross_compiling" != no; then
89973143b9aSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
90073143b9aSmrgfi
90173143b9aSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
90273143b9aSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
90373143b9aSmrg
904b53e5eeaSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
90573143b9aSmrg#
90673143b9aSmrg# This file is free software; the Free Software Foundation
90773143b9aSmrg# gives unlimited permission to copy and/or distribute it,
90873143b9aSmrg# with or without modifications, as long as this notice is preserved.
90973143b9aSmrg
910b53e5eeaSmrg# serial 2
911b53e5eeaSmrg
91273143b9aSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
91373143b9aSmrg# ---------------------------
914b53e5eeaSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
91573143b9aSmrg# This macro is traced by Automake.
91673143b9aSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
91773143b9aSmrg
918b53e5eeaSmrg# AM_SUBST_NOTMAKE(VARIABLE)
919b53e5eeaSmrg# ---------------------------
920b53e5eeaSmrg# Public sister of _AM_SUBST_NOTMAKE.
921b53e5eeaSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
922b53e5eeaSmrg
92373143b9aSmrg# Check how to create a tarball.                            -*- Autoconf -*-
92473143b9aSmrg
92573143b9aSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
92673143b9aSmrg#
92773143b9aSmrg# This file is free software; the Free Software Foundation
92873143b9aSmrg# gives unlimited permission to copy and/or distribute it,
92973143b9aSmrg# with or without modifications, as long as this notice is preserved.
93073143b9aSmrg
93173143b9aSmrg# serial 2
93273143b9aSmrg
93373143b9aSmrg# _AM_PROG_TAR(FORMAT)
93473143b9aSmrg# --------------------
93573143b9aSmrg# Check how to create a tarball in format FORMAT.
93673143b9aSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
93773143b9aSmrg#
93873143b9aSmrg# Substitute a variable $(am__tar) that is a command
93973143b9aSmrg# writing to stdout a FORMAT-tarball containing the directory
94073143b9aSmrg# $tardir.
94173143b9aSmrg#     tardir=directory && $(am__tar) > result.tar
94273143b9aSmrg#
94373143b9aSmrg# Substitute a variable $(am__untar) that extract such
94473143b9aSmrg# a tarball read from stdin.
94573143b9aSmrg#     $(am__untar) < result.tar
94673143b9aSmrgAC_DEFUN([_AM_PROG_TAR],
94773143b9aSmrg[# Always define AMTAR for backward compatibility.
94873143b9aSmrgAM_MISSING_PROG([AMTAR], [tar])
94973143b9aSmrgm4_if([$1], [v7],
95073143b9aSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
95173143b9aSmrg     [m4_case([$1], [ustar],, [pax],,
95273143b9aSmrg              [m4_fatal([Unknown tar format])])
95373143b9aSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
95473143b9aSmrg# Loop over all known methods to create a tar archive until one works.
95573143b9aSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
95673143b9aSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
95773143b9aSmrg# Do not fold the above two line into one, because Tru64 sh and
95873143b9aSmrg# Solaris sh will not grok spaces in the rhs of `-'.
95973143b9aSmrgfor _am_tool in $_am_tools
96073143b9aSmrgdo
96173143b9aSmrg  case $_am_tool in
96273143b9aSmrg  gnutar)
96373143b9aSmrg    for _am_tar in tar gnutar gtar;
96473143b9aSmrg    do
96573143b9aSmrg      AM_RUN_LOG([$_am_tar --version]) && break
96673143b9aSmrg    done
96773143b9aSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
96873143b9aSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
96973143b9aSmrg    am__untar="$_am_tar -xf -"
97073143b9aSmrg    ;;
97173143b9aSmrg  plaintar)
97273143b9aSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
97373143b9aSmrg    # ustar tarball either.
97473143b9aSmrg    (tar --version) >/dev/null 2>&1 && continue
97573143b9aSmrg    am__tar='tar chf - "$$tardir"'
97673143b9aSmrg    am__tar_='tar chf - "$tardir"'
97773143b9aSmrg    am__untar='tar xf -'
97873143b9aSmrg    ;;
97973143b9aSmrg  pax)
98073143b9aSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
98173143b9aSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
98273143b9aSmrg    am__untar='pax -r'
98373143b9aSmrg    ;;
98473143b9aSmrg  cpio)
98573143b9aSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
98673143b9aSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
98773143b9aSmrg    am__untar='cpio -i -H $1 -d'
98873143b9aSmrg    ;;
98973143b9aSmrg  none)
99073143b9aSmrg    am__tar=false
99173143b9aSmrg    am__tar_=false
99273143b9aSmrg    am__untar=false
99373143b9aSmrg    ;;
99473143b9aSmrg  esac
99573143b9aSmrg
99673143b9aSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
99773143b9aSmrg  # and am__untar set.
99873143b9aSmrg  test -n "${am_cv_prog_tar_$1}" && break
99973143b9aSmrg
100073143b9aSmrg  # tar/untar a dummy directory, and stop if the command works
100173143b9aSmrg  rm -rf conftest.dir
100273143b9aSmrg  mkdir conftest.dir
100373143b9aSmrg  echo GrepMe > conftest.dir/file
100473143b9aSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
100573143b9aSmrg  rm -rf conftest.dir
100673143b9aSmrg  if test -s conftest.tar; then
100773143b9aSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
100873143b9aSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
100973143b9aSmrg  fi
101073143b9aSmrgdone
101173143b9aSmrgrm -rf conftest.dir
101273143b9aSmrg
101373143b9aSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
101473143b9aSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
101573143b9aSmrgAC_SUBST([am__tar])
101673143b9aSmrgAC_SUBST([am__untar])
101773143b9aSmrg]) # _AM_PROG_TAR
101873143b9aSmrg
10198d4c0f7bSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10208d4c0f7bSmrgdnl
1021af928962Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
10228d4c0f7bSmrgdnl 
10238d4c0f7bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1024af928962Smrgdnl copy of this software and associated documentation files (the "Software"),
1025af928962Smrgdnl to deal in the Software without restriction, including without limitation
1026af928962Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1027af928962Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
1028af928962Smrgdnl Software is furnished to do so, subject to the following conditions:
10298d4c0f7bSmrgdnl
1030af928962Smrgdnl The above copyright notice and this permission notice (including the next
1031af928962Smrgdnl paragraph) shall be included in all copies or substantial portions of the
1032af928962Smrgdnl Software.
10338d4c0f7bSmrgdnl
1034af928962Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1035af928962Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1036af928962Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1037af928962Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1038af928962Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1039af928962Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1040af928962Smrgdnl DEALINGS IN THE SOFTWARE.
10418d4c0f7bSmrg
10428d4c0f7bSmrg# XORG_MACROS_VERSION(required-version)
10438d4c0f7bSmrg# -------------------------------------
10448d4c0f7bSmrg# Minimum version: 1.1.0
10458d4c0f7bSmrg#
10468d4c0f7bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
10478d4c0f7bSmrg# your configure.ac with the minimum required version, such as:
10488d4c0f7bSmrg# XORG_MACROS_VERSION(1.1)
10498d4c0f7bSmrg#
1050e8a71cdfSmrg# To ensure that this macro is defined, also add:
1051e8a71cdfSmrg# m4_ifndef([XORG_MACROS_VERSION],
1052e8a71cdfSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10538d4c0f7bSmrg#
10548d4c0f7bSmrg#
10558d4c0f7bSmrg# See the "minimum version" comment for each macro you use to see what 
10568d4c0f7bSmrg# version you require.
1057e8a71cdfSmrgm4_defun([XORG_MACROS_VERSION],[
1058af928962Smrgm4_define([vers_have], [1.11.0])
1059e8a71cdfSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1060e8a71cdfSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1061e8a71cdfSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1062e8a71cdfSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1063e8a71cdfSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1064e8a71cdfSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1065e8a71cdfSmrgm4_undefine([vers_have])
1066e8a71cdfSmrgm4_undefine([maj_have])
1067e8a71cdfSmrgm4_undefine([maj_needed])
10688d4c0f7bSmrg]) # XORG_MACROS_VERSION
10698d4c0f7bSmrg
10708d4c0f7bSmrg# XORG_PROG_RAWCPP()
10718d4c0f7bSmrg# ------------------
10728d4c0f7bSmrg# Minimum version: 1.0.0
10738d4c0f7bSmrg#
10748d4c0f7bSmrg# Find cpp program and necessary flags for use in pre-processing text files
10758d4c0f7bSmrg# such as man pages and config files
10768d4c0f7bSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
10778d4c0f7bSmrgAC_REQUIRE([AC_PROG_CPP])
10788d4c0f7bSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
10798d4c0f7bSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
10808d4c0f7bSmrg
10818d4c0f7bSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
10828d4c0f7bSmrg# which is not the best choice for supporting other OS'es, but covers most
10838d4c0f7bSmrg# of the ones we need for now.
10848d4c0f7bSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
10858d4c0f7bSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
10868d4c0f7bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10878d4c0f7bSmrg	AC_MSG_RESULT([no])
10888d4c0f7bSmrgelse
10898d4c0f7bSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10908d4c0f7bSmrg		RAWCPPFLAGS=-undef
10918d4c0f7bSmrg		AC_MSG_RESULT([yes])
10928d4c0f7bSmrg	# under Cygwin unix is still defined even with -undef
10938d4c0f7bSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10948d4c0f7bSmrg		RAWCPPFLAGS="-undef -ansi"
10958d4c0f7bSmrg		AC_MSG_RESULT([yes, with -ansi])
10968d4c0f7bSmrg	else
10978d4c0f7bSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
10988d4c0f7bSmrg	fi
10998d4c0f7bSmrgfi
11008d4c0f7bSmrgrm -f conftest.$ac_ext
11018d4c0f7bSmrg
11028d4c0f7bSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
11038d4c0f7bSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
11048d4c0f7bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11058d4c0f7bSmrg	AC_MSG_RESULT([no])
11068d4c0f7bSmrgelse
11078d4c0f7bSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11088d4c0f7bSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
11098d4c0f7bSmrg		AC_MSG_RESULT([yes])
11108d4c0f7bSmrg	else
11118d4c0f7bSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
11128d4c0f7bSmrg	fi
11138d4c0f7bSmrgfi
11148d4c0f7bSmrgrm -f conftest.$ac_ext
11158d4c0f7bSmrgAC_SUBST(RAWCPPFLAGS)
11168d4c0f7bSmrg]) # XORG_PROG_RAWCPP
11178d4c0f7bSmrg
11188d4c0f7bSmrg# XORG_MANPAGE_SECTIONS()
11198d4c0f7bSmrg# -----------------------
11208d4c0f7bSmrg# Minimum version: 1.0.0
11218d4c0f7bSmrg#
11228d4c0f7bSmrg# Determine which sections man pages go in for the different man page types
11238d4c0f7bSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
11248d4c0f7bSmrg# Not sure if there's any better way than just hardcoding by OS name.
11258d4c0f7bSmrg# Override default settings by setting environment variables
1126af928962Smrg# Added MAN_SUBSTS in version 1.8
1127af928962Smrg# Added AC_PROG_SED in version 1.8
11288d4c0f7bSmrg
11298d4c0f7bSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
11308d4c0f7bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1131af928962SmrgAC_REQUIRE([AC_PROG_SED])
11328d4c0f7bSmrg
11338d4c0f7bSmrgif test x$APP_MAN_SUFFIX = x    ; then
11348d4c0f7bSmrg    APP_MAN_SUFFIX=1
11358d4c0f7bSmrgfi
11368d4c0f7bSmrgif test x$APP_MAN_DIR = x    ; then
11378d4c0f7bSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
11388d4c0f7bSmrgfi
11398d4c0f7bSmrg
11408d4c0f7bSmrgif test x$LIB_MAN_SUFFIX = x    ; then
11418d4c0f7bSmrg    LIB_MAN_SUFFIX=3
11428d4c0f7bSmrgfi
11438d4c0f7bSmrgif test x$LIB_MAN_DIR = x    ; then
11448d4c0f7bSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
11458d4c0f7bSmrgfi
11468d4c0f7bSmrg
11478d4c0f7bSmrgif test x$FILE_MAN_SUFFIX = x    ; then
11488d4c0f7bSmrg    case $host_os in
11498d4c0f7bSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
11508d4c0f7bSmrg	*)		FILE_MAN_SUFFIX=5  ;;
11518d4c0f7bSmrg    esac
11528d4c0f7bSmrgfi
11538d4c0f7bSmrgif test x$FILE_MAN_DIR = x    ; then
11548d4c0f7bSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
11558d4c0f7bSmrgfi
11568d4c0f7bSmrg
11578d4c0f7bSmrgif test x$MISC_MAN_SUFFIX = x    ; then
11588d4c0f7bSmrg    case $host_os in
11598d4c0f7bSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
11608d4c0f7bSmrg	*)		MISC_MAN_SUFFIX=7  ;;
11618d4c0f7bSmrg    esac
11628d4c0f7bSmrgfi
11638d4c0f7bSmrgif test x$MISC_MAN_DIR = x    ; then
11648d4c0f7bSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
11658d4c0f7bSmrgfi
11668d4c0f7bSmrg
11678d4c0f7bSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
11688d4c0f7bSmrg    case $host_os in
11698d4c0f7bSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
11708d4c0f7bSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
11718d4c0f7bSmrg    esac
11728d4c0f7bSmrgfi
11738d4c0f7bSmrgif test x$DRIVER_MAN_DIR = x    ; then
11748d4c0f7bSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
11758d4c0f7bSmrgfi
11768d4c0f7bSmrg
11778d4c0f7bSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
11788d4c0f7bSmrg    case $host_os in
11798d4c0f7bSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
11808d4c0f7bSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
11818d4c0f7bSmrg    esac
11828d4c0f7bSmrgfi
11838d4c0f7bSmrgif test x$ADMIN_MAN_DIR = x    ; then
11848d4c0f7bSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
11858d4c0f7bSmrgfi
11868d4c0f7bSmrg
11878d4c0f7bSmrg
11888d4c0f7bSmrgAC_SUBST([APP_MAN_SUFFIX])
11898d4c0f7bSmrgAC_SUBST([LIB_MAN_SUFFIX])
11908d4c0f7bSmrgAC_SUBST([FILE_MAN_SUFFIX])
11918d4c0f7bSmrgAC_SUBST([MISC_MAN_SUFFIX])
11928d4c0f7bSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
11938d4c0f7bSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
11948d4c0f7bSmrgAC_SUBST([APP_MAN_DIR])
11958d4c0f7bSmrgAC_SUBST([LIB_MAN_DIR])
11968d4c0f7bSmrgAC_SUBST([FILE_MAN_DIR])
11978d4c0f7bSmrgAC_SUBST([MISC_MAN_DIR])
11988d4c0f7bSmrgAC_SUBST([DRIVER_MAN_DIR])
11998d4c0f7bSmrgAC_SUBST([ADMIN_MAN_DIR])
1200af928962Smrg
1201af928962SmrgXORG_MAN_PAGE="X Version 11"
1202af928962SmrgAC_SUBST([XORG_MAN_PAGE])
1203af928962SmrgMAN_SUBSTS="\
1204af928962Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1205af928962Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1206af928962Smrg	-e 's|__xservername__|Xorg|g' \
1207af928962Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
1208af928962Smrg	-e 's|__projectroot__|\$(prefix)|g' \
1209af928962Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1210af928962Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1211af928962Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1212af928962Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1213af928962Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1214af928962Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1215af928962Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1216af928962SmrgAC_SUBST([MAN_SUBSTS])
1217af928962Smrg
12188d4c0f7bSmrg]) # XORG_MANPAGE_SECTIONS
12198d4c0f7bSmrg
1220af928962Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1221af928962Smrg# ------------------------
1222af928962Smrg# Minimum version: 1.7.0
1223af928962Smrg#
1224af928962Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1225af928962Smrg# provided by xorg-sgml-doctools, if installed.
1226af928962SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1227af928962SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1228af928962SmrgXORG_SGML_PATH=
1229af928962SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1230af928962Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1231af928962Smrg    [m4_ifval([$1],[:],
1232af928962Smrg        [if test x"$cross_compiling" != x"yes" ; then
1233af928962Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1234af928962Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1235af928962Smrg         fi])
1236af928962Smrg    ])
1237af928962Smrg
1238af928962Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1239af928962Smrg# the path and the name of the doc stylesheet
1240af928962Smrgif test "x$XORG_SGML_PATH" != "x" ; then
1241af928962Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1242af928962Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1243af928962Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1244af928962Smrgelse
1245af928962Smrg   AC_MSG_RESULT([no])
1246af928962Smrgfi
1247af928962Smrg
1248af928962SmrgAC_SUBST(XORG_SGML_PATH)
1249af928962SmrgAC_SUBST(STYLESHEET_SRCDIR)
1250af928962SmrgAC_SUBST(XSL_STYLESHEET)
1251af928962SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1252af928962Smrg]) # XORG_CHECK_SGML_DOCTOOLS
1253af928962Smrg
12548d4c0f7bSmrg# XORG_CHECK_LINUXDOC
12558d4c0f7bSmrg# -------------------
12568d4c0f7bSmrg# Minimum version: 1.0.0
12578d4c0f7bSmrg#
12588d4c0f7bSmrg# Defines the variable MAKE_TEXT if the necessary tools and
12598d4c0f7bSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
12608d4c0f7bSmrg# Whether or not the necessary tools and files are found can be checked
12618d4c0f7bSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
12628d4c0f7bSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1263af928962SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1264af928962SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
12658d4c0f7bSmrg
12668d4c0f7bSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
12678d4c0f7bSmrg
1268af928962SmrgAC_MSG_CHECKING([whether to build documentation])
12698d4c0f7bSmrg
1270af928962Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
12718d4c0f7bSmrg   BUILDDOC=yes
12728d4c0f7bSmrgelse
12738d4c0f7bSmrg   BUILDDOC=no
12748d4c0f7bSmrgfi
12758d4c0f7bSmrg
12768d4c0f7bSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
12778d4c0f7bSmrg
12788d4c0f7bSmrgAC_MSG_RESULT([$BUILDDOC])
12798d4c0f7bSmrg
1280af928962SmrgAC_MSG_CHECKING([whether to build pdf documentation])
12818d4c0f7bSmrg
1282af928962Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
12838d4c0f7bSmrg   BUILDPDFDOC=yes
12848d4c0f7bSmrgelse
12858d4c0f7bSmrg   BUILDPDFDOC=no
12868d4c0f7bSmrgfi
12878d4c0f7bSmrg
12888d4c0f7bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
12898d4c0f7bSmrg
12908d4c0f7bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
12918d4c0f7bSmrg
1292af928962SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
12938d4c0f7bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
12948d4c0f7bSmrgMAKE_PDF="$PS2PDF"
12958d4c0f7bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
12968d4c0f7bSmrg
12978d4c0f7bSmrgAC_SUBST(MAKE_TEXT)
12988d4c0f7bSmrgAC_SUBST(MAKE_PS)
12998d4c0f7bSmrgAC_SUBST(MAKE_PDF)
13008d4c0f7bSmrgAC_SUBST(MAKE_HTML)
13018d4c0f7bSmrg]) # XORG_CHECK_LINUXDOC
13028d4c0f7bSmrg
13038d4c0f7bSmrg# XORG_CHECK_DOCBOOK
13048d4c0f7bSmrg# -------------------
13058d4c0f7bSmrg# Minimum version: 1.0.0
13068d4c0f7bSmrg#
13078d4c0f7bSmrg# Checks for the ability to build output formats from SGML DocBook source.
13088d4c0f7bSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
13098d4c0f7bSmrg# indicates whether the necessary tools and files are found and, if set,
13108d4c0f7bSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
13118d4c0f7bSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1312af928962SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1313af928962Smrg
13148d4c0f7bSmrgBUILDTXTDOC=no
13158d4c0f7bSmrgBUILDPDFDOC=no
13168d4c0f7bSmrgBUILDPSDOC=no
13178d4c0f7bSmrgBUILDHTMLDOC=no
13188d4c0f7bSmrg
13198d4c0f7bSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
13208d4c0f7bSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
13218d4c0f7bSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
13228d4c0f7bSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
13238d4c0f7bSmrg
1324af928962SmrgAC_MSG_CHECKING([whether to build text documentation])
1325af928962Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
13268d4c0f7bSmrg   test x$BUILD_TXTDOC != xno; then
13278d4c0f7bSmrg	BUILDTXTDOC=yes
13288d4c0f7bSmrgfi
13298d4c0f7bSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
13308d4c0f7bSmrgAC_MSG_RESULT([$BUILDTXTDOC])
13318d4c0f7bSmrg
1332af928962SmrgAC_MSG_CHECKING([whether to build PDF documentation])
1333af928962Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
13348d4c0f7bSmrg   test x$BUILD_PDFDOC != xno; then
13358d4c0f7bSmrg	BUILDPDFDOC=yes
13368d4c0f7bSmrgfi
13378d4c0f7bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13388d4c0f7bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
13398d4c0f7bSmrg
1340af928962SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1341af928962Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
13428d4c0f7bSmrg   test x$BUILD_PSDOC != xno; then
13438d4c0f7bSmrg	BUILDPSDOC=yes
13448d4c0f7bSmrgfi
13458d4c0f7bSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
13468d4c0f7bSmrgAC_MSG_RESULT([$BUILDPSDOC])
13478d4c0f7bSmrg
1348af928962SmrgAC_MSG_CHECKING([whether to build HTML documentation])
1349af928962Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
13508d4c0f7bSmrg   test x$BUILD_HTMLDOC != xno; then
13518d4c0f7bSmrg	BUILDHTMLDOC=yes
13528d4c0f7bSmrgfi
13538d4c0f7bSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
13548d4c0f7bSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
13558d4c0f7bSmrg
13568d4c0f7bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
13578d4c0f7bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
13588d4c0f7bSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
13598d4c0f7bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
13608d4c0f7bSmrg
13618d4c0f7bSmrgAC_SUBST(MAKE_TEXT)
13628d4c0f7bSmrgAC_SUBST(MAKE_PS)
13638d4c0f7bSmrgAC_SUBST(MAKE_PDF)
13648d4c0f7bSmrgAC_SUBST(MAKE_HTML)
13658d4c0f7bSmrg]) # XORG_CHECK_DOCBOOK
13668d4c0f7bSmrg
1367af928962Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1368af928962Smrg# ----------------
1369af928962Smrg# Minimum version: 1.5.0
1370af928962Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1371af928962Smrg#
1372af928962Smrg# Documentation tools are not always available on all platforms and sometimes
1373af928962Smrg# not at the appropriate level. This macro enables a module to test for the
1374af928962Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1375af928962Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1376af928962Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1377af928962Smrg# --with-xmlto assumes 'auto'.
1378af928962Smrg#
1379af928962Smrg# Interface to module:
1380af928962Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1381af928962Smrg# XMLTO:	returns the path of the xmlto program found
1382af928962Smrg#		returns the path set by the user in the environment
1383af928962Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1384af928962Smrg#		'no' user instructs the module not to use xmlto
1385af928962Smrg#
1386af928962Smrg# Added in version 1.10.0
1387af928962Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1388af928962Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1389af928962Smrg#
1390af928962Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1391af928962Smrg#
1392af928962SmrgAC_DEFUN([XORG_WITH_XMLTO],[
1393af928962SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1394af928962Smrgm4_define([_defopt], m4_default([$2], [auto]))
1395af928962SmrgAC_ARG_WITH(xmlto,
1396af928962Smrg	AS_HELP_STRING([--with-xmlto],
1397af928962Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1398af928962Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1399af928962Smrgm4_undefine([_defopt])
1400af928962Smrg
1401af928962Smrgif test "x$use_xmlto" = x"auto"; then
1402af928962Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1403af928962Smrg   if test "x$XMLTO" = "x"; then
1404af928962Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1405af928962Smrg	have_xmlto=no
1406af928962Smrg   else
1407af928962Smrg        have_xmlto=yes
1408af928962Smrg   fi
1409af928962Smrgelif test "x$use_xmlto" = x"yes" ; then
1410af928962Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1411af928962Smrg   if test "x$XMLTO" = "x"; then
1412af928962Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1413af928962Smrg   fi
1414af928962Smrg   have_xmlto=yes
1415af928962Smrgelif test "x$use_xmlto" = x"no" ; then
1416af928962Smrg   if test "x$XMLTO" != "x"; then
1417af928962Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1418af928962Smrg   fi
1419af928962Smrg   have_xmlto=no
1420af928962Smrgelse
1421af928962Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1422af928962Smrgfi
1423af928962Smrg
1424af928962Smrg# Test for a minimum version of xmlto, if provided.
1425af928962Smrgm4_ifval([$1],
1426af928962Smrg[if test "$have_xmlto" = yes; then
1427af928962Smrg    # scrape the xmlto version
1428af928962Smrg    AC_MSG_CHECKING([the xmlto version])
1429af928962Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1430af928962Smrg    AC_MSG_RESULT([$xmlto_version])
1431af928962Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1432af928962Smrg        [if test "x$use_xmlto" = xauto; then
1433af928962Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1434af928962Smrg            have_xmlto=no
1435af928962Smrg        else
1436af928962Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1437af928962Smrg        fi])
1438af928962Smrgfi])
1439af928962Smrg
1440af928962Smrg# Test for the ability of xmlto to generate a text target
1441af928962Smrghave_xmlto_text=no
1442af928962Smrgcat > conftest.xml << "EOF"
1443af928962SmrgEOF
1444af928962SmrgAS_IF([test "$have_xmlto" = yes],
1445af928962Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1446af928962Smrg             [have_xmlto_text=yes],
1447af928962Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1448af928962Smrgrm -f conftest.xml
1449af928962SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1450af928962SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1451af928962Smrg]) # XORG_WITH_XMLTO
1452af928962Smrg
1453af928962Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1454af928962Smrg# ----------------
1455af928962Smrg# Minimum version: 1.5.0
1456af928962Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1457af928962Smrg#
1458af928962Smrg# Documentation tools are not always available on all platforms and sometimes
1459af928962Smrg# not at the appropriate level. This macro enables a module to test for the
1460af928962Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1461af928962Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1462af928962Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1463af928962Smrg# --with-asciidoc assumes 'auto'.
1464af928962Smrg#
1465af928962Smrg# Interface to module:
1466af928962Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1467af928962Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
1468af928962Smrg#		 returns the path set by the user in the environment
1469af928962Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1470af928962Smrg#		  'no' user instructs the module not to use asciidoc
1471af928962Smrg#
1472af928962Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1473af928962Smrg#
1474af928962SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1475af928962SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1476af928962Smrgm4_define([_defopt], m4_default([$2], [auto]))
1477af928962SmrgAC_ARG_WITH(asciidoc,
1478af928962Smrg	AS_HELP_STRING([--with-asciidoc],
1479af928962Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1480af928962Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1481af928962Smrgm4_undefine([_defopt])
1482af928962Smrg
1483af928962Smrgif test "x$use_asciidoc" = x"auto"; then
1484af928962Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1485af928962Smrg   if test "x$ASCIIDOC" = "x"; then
1486af928962Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1487af928962Smrg	have_asciidoc=no
1488af928962Smrg   else
1489af928962Smrg        have_asciidoc=yes
1490af928962Smrg   fi
1491af928962Smrgelif test "x$use_asciidoc" = x"yes" ; then
1492af928962Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1493af928962Smrg   if test "x$ASCIIDOC" = "x"; then
1494af928962Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1495af928962Smrg   fi
1496af928962Smrg   have_asciidoc=yes
1497af928962Smrgelif test "x$use_asciidoc" = x"no" ; then
1498af928962Smrg   if test "x$ASCIIDOC" != "x"; then
1499af928962Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1500af928962Smrg   fi
1501af928962Smrg   have_asciidoc=no
1502af928962Smrgelse
1503af928962Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1504af928962Smrgfi
1505af928962Smrgm4_ifval([$1],
1506af928962Smrg[if test "$have_asciidoc" = yes; then
1507af928962Smrg    # scrape the asciidoc version
1508af928962Smrg    AC_MSG_CHECKING([the asciidoc version])
1509af928962Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1510af928962Smrg    AC_MSG_RESULT([$asciidoc_version])
1511af928962Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1512af928962Smrg        [if test "x$use_asciidoc" = xauto; then
1513af928962Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1514af928962Smrg            have_asciidoc=no
1515af928962Smrg        else
1516af928962Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1517af928962Smrg        fi])
1518af928962Smrgfi])
1519af928962SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1520af928962Smrg]) # XORG_WITH_ASCIIDOC
1521af928962Smrg
1522af928962Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1523af928962Smrg# --------------------------------
1524af928962Smrg# Minimum version: 1.5.0
1525af928962Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1526af928962Smrg#
1527af928962Smrg# Documentation tools are not always available on all platforms and sometimes
1528af928962Smrg# not at the appropriate level. This macro enables a module to test for the
1529af928962Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1530af928962Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1531af928962Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1532af928962Smrg# --with-doxygen assumes 'auto'.
1533af928962Smrg#
1534af928962Smrg# Interface to module:
1535af928962Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1536af928962Smrg# DOXYGEN:	 returns the path of the doxygen program found
1537af928962Smrg#		 returns the path set by the user in the environment
1538af928962Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1539af928962Smrg#		  'no' user instructs the module not to use doxygen
1540af928962Smrg#
1541af928962Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1542af928962Smrg#
1543af928962SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1544af928962SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1545af928962Smrgm4_define([_defopt], m4_default([$2], [auto]))
1546af928962SmrgAC_ARG_WITH(doxygen,
1547af928962Smrg	AS_HELP_STRING([--with-doxygen],
1548af928962Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1549af928962Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1550af928962Smrgm4_undefine([_defopt])
1551af928962Smrg
1552af928962Smrgif test "x$use_doxygen" = x"auto"; then
1553af928962Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1554af928962Smrg   if test "x$DOXYGEN" = "x"; then
1555af928962Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1556af928962Smrg	have_doxygen=no
1557af928962Smrg   else
1558af928962Smrg        have_doxygen=yes
1559af928962Smrg   fi
1560af928962Smrgelif test "x$use_doxygen" = x"yes" ; then
1561af928962Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1562af928962Smrg   if test "x$DOXYGEN" = "x"; then
1563af928962Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1564af928962Smrg   fi
1565af928962Smrg   have_doxygen=yes
1566af928962Smrgelif test "x$use_doxygen" = x"no" ; then
1567af928962Smrg   if test "x$DOXYGEN" != "x"; then
1568af928962Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1569af928962Smrg   fi
1570af928962Smrg   have_doxygen=no
1571af928962Smrgelse
1572af928962Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1573af928962Smrgfi
1574af928962Smrgm4_ifval([$1],
1575af928962Smrg[if test "$have_doxygen" = yes; then
1576af928962Smrg    # scrape the doxygen version
1577af928962Smrg    AC_MSG_CHECKING([the doxygen version])
1578af928962Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1579af928962Smrg    AC_MSG_RESULT([$doxygen_version])
1580af928962Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1581af928962Smrg        [if test "x$use_doxygen" = xauto; then
1582af928962Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1583af928962Smrg            have_doxygen=no
1584af928962Smrg        else
1585af928962Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1586af928962Smrg        fi])
1587af928962Smrgfi])
1588af928962SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1589af928962Smrg]) # XORG_WITH_DOXYGEN
1590af928962Smrg
1591af928962Smrg# XORG_WITH_GROFF([DEFAULT])
1592af928962Smrg# ----------------
1593af928962Smrg# Minimum version: 1.6.0
1594af928962Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1595af928962Smrg#
1596af928962Smrg# Documentation tools are not always available on all platforms and sometimes
1597af928962Smrg# not at the appropriate level. This macro enables a module to test for the
1598af928962Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1599af928962Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
1600af928962Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
1601af928962Smrg# --with-groff assumes 'auto'.
1602af928962Smrg#
1603af928962Smrg# Interface to module:
1604af928962Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1605af928962Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1606af928962Smrg# HAVE_GROFF_MS: the -ms macros package
1607af928962Smrg# GROFF:	 returns the path of the groff program found
1608af928962Smrg#		 returns the path set by the user in the environment
1609af928962Smrg# --with-groff:	 'yes' user instructs the module to use groff
1610af928962Smrg#		 'no' user instructs the module not to use groff
1611af928962Smrg#
1612af928962Smrg# Added in version 1.9.0:
1613af928962Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1614af928962Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1615af928962Smrg#		   psselect from the psutils package.
1616af928962Smrg#		   the ghostcript package. Refer to the grohtml man pages
1617af928962Smrg#
1618af928962Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1619af928962Smrg#
1620af928962Smrg# OS and distros often splits groff in a basic and full package, the former
1621af928962Smrg# having the groff program and the later having devices, fonts and macros
1622af928962Smrg# Checking for the groff executable is not enough.
1623af928962Smrg#
1624af928962Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
1625af928962Smrg# unset HAVE_GROFF or GROFF env variables.
1626af928962Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1627af928962Smrg#
1628af928962SmrgAC_DEFUN([XORG_WITH_GROFF],[
1629af928962SmrgAC_ARG_VAR([GROFF], [Path to groff command])
1630af928962Smrgm4_define([_defopt], m4_default([$1], [auto]))
1631af928962SmrgAC_ARG_WITH(groff,
1632af928962Smrg	AS_HELP_STRING([--with-groff],
1633af928962Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1634af928962Smrg	   [use_groff=$withval], [use_groff=]_defopt)
1635af928962Smrgm4_undefine([_defopt])
1636af928962Smrg
1637af928962Smrgif test "x$use_groff" = x"auto"; then
1638af928962Smrg   AC_PATH_PROG([GROFF], [groff])
1639af928962Smrg   if test "x$GROFF" = "x"; then
1640af928962Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1641af928962Smrg	have_groff=no
1642af928962Smrg   else
1643af928962Smrg        have_groff=yes
1644af928962Smrg   fi
1645af928962Smrgelif test "x$use_groff" = x"yes" ; then
1646af928962Smrg   AC_PATH_PROG([GROFF], [groff])
1647af928962Smrg   if test "x$GROFF" = "x"; then
1648af928962Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1649af928962Smrg   fi
1650af928962Smrg   have_groff=yes
1651af928962Smrgelif test "x$use_groff" = x"no" ; then
1652af928962Smrg   if test "x$GROFF" != "x"; then
1653af928962Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1654af928962Smrg   fi
1655af928962Smrg   have_groff=no
1656af928962Smrgelse
1657af928962Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1658af928962Smrgfi
1659af928962Smrg
1660af928962Smrg# We have groff, test for the presence of the macro packages
1661af928962Smrgif test "x$have_groff" = x"yes"; then
1662af928962Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1663af928962Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1664af928962Smrg        groff_ms_works=yes
1665af928962Smrg    else
1666af928962Smrg        groff_ms_works=no
1667af928962Smrg    fi
1668af928962Smrg    AC_MSG_RESULT([$groff_ms_works])
1669af928962Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1670af928962Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1671af928962Smrg        groff_mm_works=yes
1672af928962Smrg    else
1673af928962Smrg        groff_mm_works=no
1674af928962Smrg    fi
1675af928962Smrg    AC_MSG_RESULT([$groff_mm_works])
1676af928962Smrgfi
1677af928962Smrg
1678af928962Smrg# We have groff, test for HTML dependencies, one command per package
1679af928962Smrgif test "x$have_groff" = x"yes"; then
1680af928962Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1681af928962Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1682af928962Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1683af928962Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1684af928962Smrg      have_groff_html=yes
1685af928962Smrg   else
1686af928962Smrg      have_groff_html=no
1687af928962Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1688af928962Smrg   fi
1689af928962Smrgfi
1690af928962Smrg
1691af928962Smrg# Set Automake conditionals for Makefiles
1692af928962SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1693af928962SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1694af928962SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1695af928962SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1696af928962Smrg]) # XORG_WITH_GROFF
1697af928962Smrg
1698af928962Smrg# XORG_WITH_FOP([DEFAULT])
1699af928962Smrg# ----------------
1700af928962Smrg# Minimum version: 1.6.0
1701af928962Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1702af928962Smrg#
1703af928962Smrg# Documentation tools are not always available on all platforms and sometimes
1704af928962Smrg# not at the appropriate level. This macro enables a module to test for the
1705af928962Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1706af928962Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
1707af928962Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
1708af928962Smrg# --with-fop assumes 'auto'.
1709af928962Smrg#
1710af928962Smrg# Interface to module:
1711af928962Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1712af928962Smrg# FOP:	 	returns the path of the fop program found
1713af928962Smrg#		returns the path set by the user in the environment
1714af928962Smrg# --with-fop: 	'yes' user instructs the module to use fop
1715af928962Smrg#		'no' user instructs the module not to use fop
1716af928962Smrg#
1717af928962Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1718af928962Smrg#
1719af928962SmrgAC_DEFUN([XORG_WITH_FOP],[
1720af928962SmrgAC_ARG_VAR([FOP], [Path to fop command])
1721af928962Smrgm4_define([_defopt], m4_default([$1], [auto]))
1722af928962SmrgAC_ARG_WITH(fop,
1723af928962Smrg	AS_HELP_STRING([--with-fop],
1724af928962Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1725af928962Smrg	   [use_fop=$withval], [use_fop=]_defopt)
1726af928962Smrgm4_undefine([_defopt])
1727af928962Smrg
1728af928962Smrgif test "x$use_fop" = x"auto"; then
1729af928962Smrg   AC_PATH_PROG([FOP], [fop])
1730af928962Smrg   if test "x$FOP" = "x"; then
1731af928962Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1732af928962Smrg	have_fop=no
1733af928962Smrg   else
1734af928962Smrg        have_fop=yes
1735af928962Smrg   fi
1736af928962Smrgelif test "x$use_fop" = x"yes" ; then
1737af928962Smrg   AC_PATH_PROG([FOP], [fop])
1738af928962Smrg   if test "x$FOP" = "x"; then
1739af928962Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1740af928962Smrg   fi
1741af928962Smrg   have_fop=yes
1742af928962Smrgelif test "x$use_fop" = x"no" ; then
1743af928962Smrg   if test "x$FOP" != "x"; then
1744af928962Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1745af928962Smrg   fi
1746af928962Smrg   have_fop=no
1747af928962Smrgelse
1748af928962Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1749af928962Smrgfi
1750af928962SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1751af928962Smrg]) # XORG_WITH_FOP
1752af928962Smrg
1753af928962Smrg# XORG_WITH_PS2PDF([DEFAULT])
1754af928962Smrg# ----------------
1755af928962Smrg# Minimum version: 1.6.0
1756af928962Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1757af928962Smrg#
1758af928962Smrg# Documentation tools are not always available on all platforms and sometimes
1759af928962Smrg# not at the appropriate level. This macro enables a module to test for the
1760af928962Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1761af928962Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1762af928962Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1763af928962Smrg# --with-ps2pdf assumes 'auto'.
1764af928962Smrg#
1765af928962Smrg# Interface to module:
1766af928962Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1767af928962Smrg# PS2PDF:	returns the path of the ps2pdf program found
1768af928962Smrg#		returns the path set by the user in the environment
1769af928962Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1770af928962Smrg#		 'no' user instructs the module not to use ps2pdf
1771af928962Smrg#
1772af928962Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1773af928962Smrg#
1774af928962SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1775af928962SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1776af928962Smrgm4_define([_defopt], m4_default([$1], [auto]))
1777af928962SmrgAC_ARG_WITH(ps2pdf,
1778af928962Smrg	AS_HELP_STRING([--with-ps2pdf],
1779af928962Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1780af928962Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1781af928962Smrgm4_undefine([_defopt])
1782af928962Smrg
1783af928962Smrgif test "x$use_ps2pdf" = x"auto"; then
1784af928962Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1785af928962Smrg   if test "x$PS2PDF" = "x"; then
1786af928962Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1787af928962Smrg	have_ps2pdf=no
1788af928962Smrg   else
1789af928962Smrg        have_ps2pdf=yes
1790af928962Smrg   fi
1791af928962Smrgelif test "x$use_ps2pdf" = x"yes" ; then
1792af928962Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1793af928962Smrg   if test "x$PS2PDF" = "x"; then
1794af928962Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1795af928962Smrg   fi
1796af928962Smrg   have_ps2pdf=yes
1797af928962Smrgelif test "x$use_ps2pdf" = x"no" ; then
1798af928962Smrg   if test "x$PS2PDF" != "x"; then
1799af928962Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1800af928962Smrg   fi
1801af928962Smrg   have_ps2pdf=no
1802af928962Smrgelse
1803af928962Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1804af928962Smrgfi
1805af928962SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1806af928962Smrg]) # XORG_WITH_PS2PDF
1807af928962Smrg
1808af928962Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
1809af928962Smrg# ----------------
1810af928962Smrg# Minimum version: 1.6.0
1811af928962Smrg#
1812af928962Smrg# Documentation tools are not always available on all platforms and sometimes
1813af928962Smrg# not at the appropriate level. This macro enables a builder to skip all
1814af928962Smrg# documentation targets except traditional man pages.
1815af928962Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1816af928962Smrg# maximum flexibilty in controlling documentation building.
1817af928962Smrg# Refer to:
1818af928962Smrg# XORG_WITH_XMLTO         --with-xmlto
1819af928962Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1820af928962Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1821af928962Smrg# XORG_WITH_FOP           --with-fop
1822af928962Smrg# XORG_WITH_GROFF         --with-groff
1823af928962Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1824af928962Smrg#
1825af928962Smrg# Interface to module:
1826af928962Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1827af928962Smrg# --enable-docs: 'yes' user instructs the module to generate docs
1828af928962Smrg#		 'no' user instructs the module not to generate docs
1829af928962Smrg# parm1:	specify the default value, yes or no.
1830af928962Smrg#
1831af928962SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1832af928962Smrgm4_define([default], m4_default([$1], [yes]))
1833af928962SmrgAC_ARG_ENABLE(docs,
1834af928962Smrg	AS_HELP_STRING([--enable-docs],
1835af928962Smrg	   [Enable building the documentation (default: ]default[)]),
1836af928962Smrg	   [build_docs=$enableval], [build_docs=]default)
1837af928962Smrgm4_undefine([default])
1838af928962SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1839af928962SmrgAC_MSG_CHECKING([whether to build documentation])
1840af928962SmrgAC_MSG_RESULT([$build_docs])
1841af928962Smrg]) # XORG_ENABLE_DOCS
1842af928962Smrg
1843af928962Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1844af928962Smrg# ----------------
1845af928962Smrg# Minimum version: 1.6.0
1846af928962Smrg#
1847af928962Smrg# This macro enables a builder to skip all developer documentation.
1848af928962Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1849af928962Smrg# maximum flexibilty in controlling documentation building.
1850af928962Smrg# Refer to:
1851af928962Smrg# XORG_WITH_XMLTO         --with-xmlto
1852af928962Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1853af928962Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1854af928962Smrg# XORG_WITH_FOP           --with-fop
1855af928962Smrg# XORG_WITH_GROFF         --with-groff
1856af928962Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1857af928962Smrg#
1858af928962Smrg# Interface to module:
1859af928962Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1860af928962Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1861af928962Smrg#			'no' user instructs the module not to generate developer docs
1862af928962Smrg# parm1:		specify the default value, yes or no.
1863af928962Smrg#
1864af928962SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1865af928962Smrgm4_define([devel_default], m4_default([$1], [yes]))
1866af928962SmrgAC_ARG_ENABLE(devel-docs,
1867af928962Smrg	AS_HELP_STRING([--enable-devel-docs],
1868af928962Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1869af928962Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1870af928962Smrgm4_undefine([devel_default])
1871af928962SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1872af928962SmrgAC_MSG_CHECKING([whether to build developer documentation])
1873af928962SmrgAC_MSG_RESULT([$build_devel_docs])
1874af928962Smrg]) # XORG_ENABLE_DEVEL_DOCS
1875af928962Smrg
1876af928962Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
1877af928962Smrg# ----------------
1878af928962Smrg# Minimum version: 1.6.0
1879af928962Smrg#
1880af928962Smrg# This macro enables a builder to skip all functional specification targets.
1881af928962Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1882af928962Smrg# maximum flexibilty in controlling documentation building.
1883af928962Smrg# Refer to:
1884af928962Smrg# XORG_WITH_XMLTO         --with-xmlto
1885af928962Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1886af928962Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1887af928962Smrg# XORG_WITH_FOP           --with-fop
1888af928962Smrg# XORG_WITH_GROFF         --with-groff
1889af928962Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1890af928962Smrg#
1891af928962Smrg# Interface to module:
1892af928962Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1893af928962Smrg# --enable-specs:	'yes' user instructs the module to generate specs
1894af928962Smrg#			'no' user instructs the module not to generate specs
1895af928962Smrg# parm1:		specify the default value, yes or no.
1896af928962Smrg#
1897af928962SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1898af928962Smrgm4_define([spec_default], m4_default([$1], [yes]))
1899af928962SmrgAC_ARG_ENABLE(specs,
1900af928962Smrg	AS_HELP_STRING([--enable-specs],
1901af928962Smrg	   [Enable building the specs (default: ]spec_default[)]),
1902af928962Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
1903af928962Smrgm4_undefine([spec_default])
1904af928962SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1905af928962SmrgAC_MSG_CHECKING([whether to build functional specifications])
1906af928962SmrgAC_MSG_RESULT([$build_specs])
1907af928962Smrg]) # XORG_ENABLE_SPECS
1908af928962Smrg
19098d4c0f7bSmrg# XORG_CHECK_MALLOC_ZERO
19108d4c0f7bSmrg# ----------------------
19118d4c0f7bSmrg# Minimum version: 1.0.0
19128d4c0f7bSmrg#
19138d4c0f7bSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
19148d4c0f7bSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
19158d4c0f7bSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
19168d4c0f7bSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
19178d4c0f7bSmrgAC_ARG_ENABLE(malloc0returnsnull,
1918b53e5eeaSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
19198d4c0f7bSmrg		       [malloc(0) returns NULL (default: auto)]),
19208d4c0f7bSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
19218d4c0f7bSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
19228d4c0f7bSmrg
19238d4c0f7bSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
19248d4c0f7bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
19258d4c0f7bSmrg	AC_RUN_IFELSE([
19268d4c0f7bSmrgchar *malloc();
19278d4c0f7bSmrgchar *realloc();
19288d4c0f7bSmrgchar *calloc();
19298d4c0f7bSmrgmain() {
19308d4c0f7bSmrg    char *m0, *r0, *c0, *p;
19318d4c0f7bSmrg    m0 = malloc(0);
19328d4c0f7bSmrg    p = malloc(10);
19338d4c0f7bSmrg    r0 = realloc(p,0);
19348d4c0f7bSmrg    c0 = calloc(0);
19358d4c0f7bSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
19368d4c0f7bSmrg}],
19378d4c0f7bSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1938af928962Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
1939af928962Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
19408d4c0f7bSmrgfi
19418d4c0f7bSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
19428d4c0f7bSmrg
19438d4c0f7bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
19448d4c0f7bSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
19458d4c0f7bSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
19468d4c0f7bSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
19478d4c0f7bSmrgelse
19488d4c0f7bSmrg	MALLOC_ZERO_CFLAGS=""
19498d4c0f7bSmrg	XMALLOC_ZERO_CFLAGS=""
19508d4c0f7bSmrg	XTMALLOC_ZERO_CFLAGS=""
19518d4c0f7bSmrgfi
19528d4c0f7bSmrg
19538d4c0f7bSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
19548d4c0f7bSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
19558d4c0f7bSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
19568d4c0f7bSmrg]) # XORG_CHECK_MALLOC_ZERO
19578d4c0f7bSmrg
19588d4c0f7bSmrg# XORG_WITH_LINT()
19598d4c0f7bSmrg# ----------------
19608d4c0f7bSmrg# Minimum version: 1.1.0
19618d4c0f7bSmrg#
1962af928962Smrg# This macro enables the use of a tool that flags some suspicious and
1963af928962Smrg# non-portable constructs (likely to be bugs) in C language source code.
1964af928962Smrg# It will attempt to locate the tool and use appropriate options.
1965af928962Smrg# There are various lint type tools on different platforms.
1966af928962Smrg#
1967af928962Smrg# Interface to module:
1968af928962Smrg# LINT:		returns the path to the tool found on the platform
1969af928962Smrg#		or the value set to LINT on the configure cmd line
1970af928962Smrg#		also an Automake conditional
1971af928962Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
1972af928962Smrg#
1973af928962Smrg# --with-lint:	'yes' user instructs the module to use lint
1974af928962Smrg#		'no' user instructs the module not to use lint (default)
1975af928962Smrg#
1976af928962Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1977af928962Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
19788d4c0f7bSmrg#
19798d4c0f7bSmrgAC_DEFUN([XORG_WITH_LINT],[
19808d4c0f7bSmrg
1981af928962SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1982af928962SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1983b53e5eeaSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
19848d4c0f7bSmrg		[Use a lint-style source code checker (default: disabled)])],
19858d4c0f7bSmrg		[use_lint=$withval], [use_lint=no])
1986af928962Smrg
1987af928962Smrg# Obtain platform specific info like program name and options
1988af928962Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1989af928962Smrgcase $host_os in
1990af928962Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1991af928962Smrg	lint_name=splint
1992af928962Smrg	lint_options="-badflag"
1993af928962Smrg	;;
1994af928962Smrg  *freebsd* | *netbsd*)
1995af928962Smrg	lint_name=lint
1996af928962Smrg	lint_options="-u -b"
1997af928962Smrg	;;
1998af928962Smrg  *solaris*)
1999af928962Smrg	lint_name=lint
2000af928962Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2001af928962Smrg	;;
2002af928962Smrgesac
2003af928962Smrg
2004af928962Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
2005af928962Smrgif test "x$use_lint" = x"yes" ; then
2006af928962Smrg   AC_PATH_PROG([LINT], [$lint_name])
2007af928962Smrg   if test "x$LINT" = "x"; then
2008af928962Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2009af928962Smrg   fi
2010af928962Smrgelif test "x$use_lint" = x"no" ; then
2011af928962Smrg   if test "x$LINT" != "x"; then
2012af928962Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2013af928962Smrg   fi
20148d4c0f7bSmrgelse
2015af928962Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
20168d4c0f7bSmrgfi
2017af928962Smrg
2018af928962Smrg# User supplied flags override default flags
2019af928962Smrgif test "x$LINT_FLAGS" != "x"; then
2020af928962Smrg   lint_options=$LINT_FLAGS
20218d4c0f7bSmrgfi
20228d4c0f7bSmrg
2023af928962SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2024af928962SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
20258d4c0f7bSmrg
20268d4c0f7bSmrg]) # XORG_WITH_LINT
20278d4c0f7bSmrg
20288d4c0f7bSmrg# XORG_LINT_LIBRARY(LIBNAME)
20298d4c0f7bSmrg# --------------------------
20308d4c0f7bSmrg# Minimum version: 1.1.0
20318d4c0f7bSmrg#
20328d4c0f7bSmrg# Sets up flags for building lint libraries for checking programs that call
20338d4c0f7bSmrg# functions in the library.
20348d4c0f7bSmrg#
2035af928962Smrg# Interface to module:
2036af928962Smrg# LINTLIB		- Automake variable with the name of lint library file to make
2037af928962Smrg# MAKE_LINT_LIB		- Automake conditional
2038af928962Smrg#
2039af928962Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2040af928962Smrg#			  - 'no' user instructs the module not to create a lint library (default)
20418d4c0f7bSmrg
20428d4c0f7bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
20438d4c0f7bSmrgAC_REQUIRE([XORG_WITH_LINT])
2044b53e5eeaSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
20458d4c0f7bSmrg	[Create lint library (default: disabled)])],
20468d4c0f7bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2047af928962Smrg
2048af928962Smrgif test "x$make_lint_lib" = x"yes" ; then
2049af928962Smrg   LINTLIB=llib-l$1.ln
2050af928962Smrg   if test "x$LINT" = "x"; then
2051af928962Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2052af928962Smrg   fi
2053af928962Smrgelif test "x$make_lint_lib" != x"no" ; then
2054af928962Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
20558d4c0f7bSmrgfi
2056af928962Smrg
20578d4c0f7bSmrgAC_SUBST(LINTLIB)
20588d4c0f7bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
20598d4c0f7bSmrg
20608d4c0f7bSmrg]) # XORG_LINT_LIBRARY
20618d4c0f7bSmrg
20628d4c0f7bSmrg# XORG_CWARNFLAGS
20638d4c0f7bSmrg# ---------------
20648d4c0f7bSmrg# Minimum version: 1.2.0
20658d4c0f7bSmrg#
20668d4c0f7bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
20678d4c0f7bSmrg#
20688d4c0f7bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
2069af928962SmrgAC_REQUIRE([AC_PROG_CC_C99])
20708d4c0f7bSmrgif  test "x$GCC" = xyes ; then
20718d4c0f7bSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
20728d4c0f7bSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
2073af928962Smrg-Wbad-function-cast -Wformat=2"
2074e8a71cdfSmrg    case `$CC -dumpversion` in
20758d4c0f7bSmrg    3.4.* | 4.*)
2076e8a71cdfSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
20778d4c0f7bSmrg	;;
20788d4c0f7bSmrg    esac
20798d4c0f7bSmrgelse
20808d4c0f7bSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
20818d4c0f7bSmrg    if test "x$SUNCC" = "xyes"; then
20828d4c0f7bSmrg	CWARNFLAGS="-v"
20838d4c0f7bSmrg    fi
20848d4c0f7bSmrgfi
20858d4c0f7bSmrgAC_SUBST(CWARNFLAGS)
20868d4c0f7bSmrg]) # XORG_CWARNFLAGS
2087b53e5eeaSmrg
2088b53e5eeaSmrg# XORG_STRICT_OPTION
2089b53e5eeaSmrg# -----------------------
2090b53e5eeaSmrg# Minimum version: 1.3.0
2091b53e5eeaSmrg#
2092b53e5eeaSmrg# Add configure option to enable strict compilation
2093b53e5eeaSmrgAC_DEFUN([XORG_STRICT_OPTION], [
2094af928962Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
2095b53e5eeaSmrgAC_REQUIRE([AC_PROG_CC_C99])
2096b53e5eeaSmrgAC_REQUIRE([XORG_CWARNFLAGS])
2097b53e5eeaSmrg
2098b53e5eeaSmrgAC_ARG_ENABLE(strict-compilation,
2099b53e5eeaSmrg			  AS_HELP_STRING([--enable-strict-compilation],
2100b53e5eeaSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
2101b53e5eeaSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2102b53e5eeaSmrgif test "x$STRICT_COMPILE" = "xyes"; then
2103b53e5eeaSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2104b53e5eeaSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2105b53e5eeaSmrg	if test "x$GCC" = xyes ; then
2106b53e5eeaSmrg		STRICT_CFLAGS="-pedantic -Werror"
2107b53e5eeaSmrg	elif test "x$SUNCC" = "xyes"; then
2108b53e5eeaSmrg		STRICT_CFLAGS="-errwarn"
2109b53e5eeaSmrg    elif test "x$INTELCC" = "xyes"; then
2110b53e5eeaSmrg		STRICT_CFLAGS="-Werror"
2111b53e5eeaSmrg	fi
2112b53e5eeaSmrgfi
2113b53e5eeaSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
2114b53e5eeaSmrgAC_SUBST([CWARNFLAGS])
2115b53e5eeaSmrg]) # XORG_STRICT_OPTION
2116b53e5eeaSmrg
2117b53e5eeaSmrg# XORG_DEFAULT_OPTIONS
2118b53e5eeaSmrg# --------------------
2119b53e5eeaSmrg# Minimum version: 1.3.0
2120b53e5eeaSmrg#
2121b53e5eeaSmrg# Defines default options for X.Org modules.
2122b53e5eeaSmrg#
2123b53e5eeaSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
2124af928962SmrgAC_REQUIRE([AC_PROG_INSTALL])
2125b53e5eeaSmrgXORG_CWARNFLAGS
2126b53e5eeaSmrgXORG_STRICT_OPTION
2127b53e5eeaSmrgXORG_RELEASE_VERSION
2128b53e5eeaSmrgXORG_CHANGELOG
2129af928962SmrgXORG_INSTALL
2130b53e5eeaSmrgXORG_MANPAGE_SECTIONS
2131af928962Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2132af928962Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2133b53e5eeaSmrg]) # XORG_DEFAULT_OPTIONS
2134af928962Smrg
2135af928962Smrg# XORG_INSTALL()
2136af928962Smrg# ----------------
2137af928962Smrg# Minimum version: 1.4.0
2138af928962Smrg#
2139af928962Smrg# Defines the variable INSTALL_CMD as the command to copy
2140af928962Smrg# INSTALL from $prefix/share/util-macros.
2141af928962Smrg#
2142af928962SmrgAC_DEFUN([XORG_INSTALL], [
2143af928962SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2144af928962Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2145af928962SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2146af928962Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2147af928962Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
2148af928962Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
2149af928962SmrgAC_SUBST([INSTALL_CMD])
2150af928962Smrg]) # XORG_INSTALL
21518d4c0f7bSmrgdnl Copyright 2005 Red Hat, Inc
21528d4c0f7bSmrgdnl
21538d4c0f7bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
21548d4c0f7bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
21558d4c0f7bSmrgdnl the above copyright notice appear in all copies and that both that
21568d4c0f7bSmrgdnl copyright notice and this permission notice appear in supporting
21578d4c0f7bSmrgdnl documentation.
21588d4c0f7bSmrgdnl
21598d4c0f7bSmrgdnl The above copyright notice and this permission notice shall be included
21608d4c0f7bSmrgdnl in all copies or substantial portions of the Software.
21618d4c0f7bSmrgdnl
21628d4c0f7bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21638d4c0f7bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21648d4c0f7bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21658d4c0f7bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
21668d4c0f7bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21678d4c0f7bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21688d4c0f7bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
21698d4c0f7bSmrgdnl
21708d4c0f7bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
21718d4c0f7bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
21728d4c0f7bSmrgdnl other dealings in this Software without prior written authorization
21738d4c0f7bSmrgdnl from the copyright holders.
21748d4c0f7bSmrgdnl
21758d4c0f7bSmrg
21768d4c0f7bSmrg# XORG_RELEASE_VERSION
21778d4c0f7bSmrg# --------------------
2178af928962Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
21798d4c0f7bSmrg 
21808d4c0f7bSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
21818d4c0f7bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
21828d4c0f7bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
21838d4c0f7bSmrg		[Major version of this package])
21848d4c0f7bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
21858d4c0f7bSmrg	if test "x$PVM" = "x"; then
21868d4c0f7bSmrg		PVM="0"
21878d4c0f7bSmrg	fi
21888d4c0f7bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
21898d4c0f7bSmrg		[$PVM],
21908d4c0f7bSmrg		[Minor version of this package])
21918d4c0f7bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
21928d4c0f7bSmrg	if test "x$PVP" = "x"; then
21938d4c0f7bSmrg		PVP="0"
21948d4c0f7bSmrg	fi
21958d4c0f7bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
21968d4c0f7bSmrg		[$PVP],
21978d4c0f7bSmrg		[Patch version of this package])
21988d4c0f7bSmrg])
21998d4c0f7bSmrg
22008d4c0f7bSmrg# XORG_CHANGELOG()
22018d4c0f7bSmrg# ----------------
22028d4c0f7bSmrg# Minimum version: 1.2.0
22038d4c0f7bSmrg#
22048d4c0f7bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
22058d4c0f7bSmrg# ChangeLog from git.
22068d4c0f7bSmrg#
22078d4c0f7bSmrg#
22088d4c0f7bSmrgAC_DEFUN([XORG_CHANGELOG], [
2209af928962SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
2210af928962Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2211af928962Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
22128d4c0f7bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
22138d4c0f7bSmrgAC_SUBST([CHANGELOG_CMD])
22148d4c0f7bSmrg]) # XORG_CHANGELOG
22158d4c0f7bSmrg
2216af928962Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2217af928962Smrg# 
2218af928962Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2219af928962Smrg#
2220af928962Smrg# This program is free software; you can redistribute it and/or modify
2221af928962Smrg# it under the terms of the GNU General Public License as published by
2222af928962Smrg# the Free Software Foundation; either version 2 of the License, or
2223af928962Smrg# (at your option) any later version.
2224af928962Smrg#
2225af928962Smrg# This program is distributed in the hope that it will be useful, but
2226af928962Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2227af928962Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2228af928962Smrg# General Public License for more details.
2229af928962Smrg#
2230af928962Smrg# You should have received a copy of the GNU General Public License
2231af928962Smrg# along with this program; if not, write to the Free Software
2232af928962Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2233af928962Smrg#
2234af928962Smrg# As a special exception to the GNU General Public License, if you
2235af928962Smrg# distribute this file as part of a program that contains a
2236af928962Smrg# configuration script generated by Autoconf, you may include it under
2237af928962Smrg# the same distribution terms that you use for the rest of that program.
2238af928962Smrg
2239af928962Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2240af928962Smrg# ----------------------------------
2241af928962SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
2242af928962Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2243af928962Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2244af928962SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2245af928962Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2246af928962Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2247af928962Smrgfi
2248af928962Smrgif test -n "$PKG_CONFIG"; then
2249af928962Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
2250af928962Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2251af928962Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2252af928962Smrg		AC_MSG_RESULT([yes])
2253af928962Smrg	else
2254af928962Smrg		AC_MSG_RESULT([no])
2255af928962Smrg		PKG_CONFIG=""
2256af928962Smrg	fi
2257af928962Smrg		
2258af928962Smrgfi[]dnl
2259af928962Smrg])# PKG_PROG_PKG_CONFIG
2260af928962Smrg
2261af928962Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2262af928962Smrg#
2263af928962Smrg# Check to see whether a particular set of modules exists.  Similar
2264af928962Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2265af928962Smrg#
2266af928962Smrg#
2267af928962Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
2268af928962Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
2269af928962Smrg# PKG_CHECK_EXISTS manually
2270af928962Smrg# --------------------------------------------------------------
2271af928962SmrgAC_DEFUN([PKG_CHECK_EXISTS],
2272af928962Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2273af928962Smrgif test -n "$PKG_CONFIG" && \
2274af928962Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2275af928962Smrg  m4_ifval([$2], [$2], [:])
2276af928962Smrgm4_ifvaln([$3], [else
2277af928962Smrg  $3])dnl
2278af928962Smrgfi])
2279af928962Smrg
2280af928962Smrg
2281af928962Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2282af928962Smrg# ---------------------------------------------
2283af928962Smrgm4_define([_PKG_CONFIG],
2284af928962Smrg[if test -n "$$1"; then
2285af928962Smrg    pkg_cv_[]$1="$$1"
2286af928962Smrg elif test -n "$PKG_CONFIG"; then
2287af928962Smrg    PKG_CHECK_EXISTS([$3],
2288af928962Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
2289af928962Smrg		     [pkg_failed=yes])
2290af928962Smrg else
2291af928962Smrg    pkg_failed=untried
2292af928962Smrgfi[]dnl
2293af928962Smrg])# _PKG_CONFIG
2294af928962Smrg
2295af928962Smrg# _PKG_SHORT_ERRORS_SUPPORTED
2296af928962Smrg# -----------------------------
2297af928962SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2298af928962Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2299af928962Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2300af928962Smrg        _pkg_short_errors_supported=yes
2301af928962Smrgelse
2302af928962Smrg        _pkg_short_errors_supported=no
2303af928962Smrgfi[]dnl
2304af928962Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
2305af928962Smrg
2306af928962Smrg
2307af928962Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2308af928962Smrg# [ACTION-IF-NOT-FOUND])
2309af928962Smrg#
2310af928962Smrg#
2311af928962Smrg# Note that if there is a possibility the first call to
2312af928962Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
2313af928962Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2314af928962Smrg#
2315af928962Smrg#
2316af928962Smrg# --------------------------------------------------------------
2317af928962SmrgAC_DEFUN([PKG_CHECK_MODULES],
2318af928962Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2319af928962SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2320af928962SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2321af928962Smrg
2322af928962Smrgpkg_failed=no
2323af928962SmrgAC_MSG_CHECKING([for $1])
2324af928962Smrg
2325af928962Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2326af928962Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2327af928962Smrg
2328af928962Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2329af928962Smrgand $1[]_LIBS to avoid the need to call pkg-config.
2330af928962SmrgSee the pkg-config man page for more details.])
2331af928962Smrg
2332af928962Smrgif test $pkg_failed = yes; then
2333af928962Smrg        _PKG_SHORT_ERRORS_SUPPORTED
2334af928962Smrg        if test $_pkg_short_errors_supported = yes; then
2335af928962Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
2336af928962Smrg        else 
2337af928962Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
2338af928962Smrg        fi
2339af928962Smrg	# Put the nasty error message in config.log where it belongs
2340af928962Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2341af928962Smrg
2342af928962Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
2343af928962Smrg[Package requirements ($2) were not met:
2344af928962Smrg
2345af928962Smrg$$1_PKG_ERRORS
2346af928962Smrg
2347af928962SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
2348af928962Smrginstalled software in a non-standard prefix.
2349af928962Smrg
2350af928962Smrg_PKG_TEXT
2351af928962Smrg])],
2352af928962Smrg		[AC_MSG_RESULT([no])
2353af928962Smrg                $4])
2354af928962Smrgelif test $pkg_failed = untried; then
2355af928962Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
2356af928962Smrg[The pkg-config script could not be found or is too old.  Make sure it
2357af928962Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
2358af928962Smrgpath to pkg-config.
2359af928962Smrg
2360af928962Smrg_PKG_TEXT
2361af928962Smrg
2362af928962SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
2363af928962Smrg		[$4])
2364af928962Smrgelse
2365af928962Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2366af928962Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2367af928962Smrg        AC_MSG_RESULT([yes])
2368af928962Smrg	ifelse([$3], , :, [$3])
2369af928962Smrgfi[]dnl
2370af928962Smrg])# PKG_CHECK_MODULES
2371af928962Smrg
2372