aclocal.m4 revision 55074dd0
155074dd0Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2a1d141d5Smrg
32ddb6cf1Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
42ddb6cf1Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5a1d141d5Smrg# This file is free software; the Free Software Foundation
6a1d141d5Smrg# gives unlimited permission to copy and/or distribute it,
7a1d141d5Smrg# with or without modifications, as long as this notice is preserved.
8a1d141d5Smrg
9a1d141d5Smrg# This program is distributed in the hope that it will be useful,
10a1d141d5Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11a1d141d5Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12a1d141d5Smrg# PARTICULAR PURPOSE.
13a1d141d5Smrg
142ddb6cf1Smrgm4_ifndef([AC_AUTOCONF_VERSION],
152ddb6cf1Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1655074dd0Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
1755074dd0Smrg[m4_warning([this file was generated for autoconf 2.68.
182ddb6cf1SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
192ddb6cf1SmrgIf you have problems, you may need to regenerate the build system entirely.
202ddb6cf1SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21a1d141d5Smrg
2255074dd0Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
232ddb6cf1Smrg#
2455074dd0Smrg# This file is free software; the Free Software Foundation
2555074dd0Smrg# gives unlimited permission to copy and/or distribute it,
2655074dd0Smrg# with or without modifications, as long as this notice is preserved.
27a1d141d5Smrg
2855074dd0Smrg# AM_AUTOMAKE_VERSION(VERSION)
2955074dd0Smrg# ----------------------------
3055074dd0Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3155074dd0Smrg# generated from the m4 files accompanying Automake X.Y.
3255074dd0Smrg# (This private macro should not be called outside this file.)
3355074dd0SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3455074dd0Smrg[am__api_version='1.11'
3555074dd0Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3655074dd0Smrgdnl require some minimum version.  Point them to the right macro.
3755074dd0Smrgm4_if([$1], [1.11.1], [],
3855074dd0Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3955074dd0Smrg])
40a1d141d5Smrg
4155074dd0Smrg# _AM_AUTOCONF_VERSION(VERSION)
4255074dd0Smrg# -----------------------------
4355074dd0Smrg# aclocal traces this macro to find the Autoconf version.
4455074dd0Smrg# This is a private macro too.  Using m4_define simplifies
4555074dd0Smrg# the logic in aclocal, which can simply ignore this definition.
4655074dd0Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47a1d141d5Smrg
4855074dd0Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
4955074dd0Smrg# -------------------------------
5055074dd0Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5155074dd0Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5255074dd0SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5355074dd0Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
5455074dd0Smrgm4_ifndef([AC_AUTOCONF_VERSION],
5555074dd0Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5655074dd0Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57a1d141d5Smrg
5855074dd0Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59a1d141d5Smrg
6055074dd0Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6155074dd0Smrg#
6255074dd0Smrg# This file is free software; the Free Software Foundation
6355074dd0Smrg# gives unlimited permission to copy and/or distribute it,
6455074dd0Smrg# with or without modifications, as long as this notice is preserved.
65a1d141d5Smrg
6655074dd0Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6755074dd0Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6855074dd0Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6955074dd0Smrg#
7055074dd0Smrg# Of course, Automake must honor this variable whenever it calls a
7155074dd0Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7255074dd0Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7355074dd0Smrg# depending on how configure is run.  This is pretty annoying, since
7455074dd0Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7555074dd0Smrg# source directory, any form will work fine, but in subdirectories a
7655074dd0Smrg# relative path needs to be adjusted first.
772ddb6cf1Smrg#
7855074dd0Smrg# $ac_aux_dir/missing
7955074dd0Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8055074dd0Smrg# $top_srcdir/$ac_aux_dir/missing
8155074dd0Smrg#    fails if $ac_aux_dir is absolute,
8255074dd0Smrg#    fails when called from a subdirectory in a VPATH build with
8355074dd0Smrg#          a relative $ac_aux_dir
842ddb6cf1Smrg#
8555074dd0Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8655074dd0Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
8755074dd0Smrg# harmless because $srcdir is `.', but things will broke when you
8855074dd0Smrg# start a VPATH build or use an absolute $srcdir.
892ddb6cf1Smrg#
9055074dd0Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9155074dd0Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9255074dd0Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9355074dd0Smrg# and then we would define $MISSING as
9455074dd0Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9555074dd0Smrg# This will work as long as MISSING is not called from configure, because
9655074dd0Smrg# unfortunately $(top_srcdir) has no meaning in configure.
9755074dd0Smrg# However there are other variables, like CC, which are often used in
9855074dd0Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
992ddb6cf1Smrg#
10055074dd0Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
10155074dd0Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
10255074dd0Smrg# configured tree to be moved without reconfiguration.
103a1d141d5Smrg
10455074dd0SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10555074dd0Smrg[dnl Rely on autoconf to set up CDPATH properly.
10655074dd0SmrgAC_PREREQ([2.50])dnl
10755074dd0Smrg# expand $ac_aux_dir to an absolute path
10855074dd0Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
10955074dd0Smrg])
110a1d141d5Smrg
11155074dd0Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112a1d141d5Smrg
11355074dd0Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11455074dd0Smrg# Free Software Foundation, Inc.
11555074dd0Smrg#
11655074dd0Smrg# This file is free software; the Free Software Foundation
11755074dd0Smrg# gives unlimited permission to copy and/or distribute it,
11855074dd0Smrg# with or without modifications, as long as this notice is preserved.
119a1d141d5Smrg
12055074dd0Smrg# serial 9
121a1d141d5Smrg
12255074dd0Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12355074dd0Smrg# -------------------------------------
12455074dd0Smrg# Define a conditional.
12555074dd0SmrgAC_DEFUN([AM_CONDITIONAL],
12655074dd0Smrg[AC_PREREQ(2.52)dnl
12755074dd0Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12855074dd0Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12955074dd0SmrgAC_SUBST([$1_TRUE])dnl
13055074dd0SmrgAC_SUBST([$1_FALSE])dnl
13155074dd0Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
13255074dd0Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
13355074dd0Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13455074dd0Smrgif $2; then
13555074dd0Smrg  $1_TRUE=
13655074dd0Smrg  $1_FALSE='#'
13755074dd0Smrgelse
13855074dd0Smrg  $1_TRUE='#'
13955074dd0Smrg  $1_FALSE=
14055074dd0Smrgfi
14155074dd0SmrgAC_CONFIG_COMMANDS_PRE(
14255074dd0Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14355074dd0Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14455074dd0SmrgUsually this means the macro was only invoked conditionally.]])
14555074dd0Smrgfi])])
146a1d141d5Smrg
14755074dd0Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
14855074dd0Smrg# Free Software Foundation, Inc.
14955074dd0Smrg#
15055074dd0Smrg# This file is free software; the Free Software Foundation
15155074dd0Smrg# gives unlimited permission to copy and/or distribute it,
15255074dd0Smrg# with or without modifications, as long as this notice is preserved.
153a1d141d5Smrg
15455074dd0Smrg# serial 10
155a1d141d5Smrg
15655074dd0Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
15755074dd0Smrg# written in clear, in which case automake, when reading aclocal.m4,
15855074dd0Smrg# will think it sees a *use*, and therefore will trigger all it's
15955074dd0Smrg# C support machinery.  Also note that it means that autoscan, seeing
16055074dd0Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161a1d141d5Smrg
162a1d141d5Smrg
16355074dd0Smrg# _AM_DEPENDENCIES(NAME)
16455074dd0Smrg# ----------------------
16555074dd0Smrg# See how the compiler implements dependency checking.
16655074dd0Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
16755074dd0Smrg# We try a few techniques and use that to set a single cache variable.
168a1d141d5Smrg#
16955074dd0Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
17055074dd0Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
17155074dd0Smrg# dependency, and given that the user is not expected to run this macro,
17255074dd0Smrg# just rely on AC_PROG_CC.
17355074dd0SmrgAC_DEFUN([_AM_DEPENDENCIES],
17455074dd0Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
17555074dd0SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
17655074dd0SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
17755074dd0SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
17855074dd0Smrg
17955074dd0Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
18055074dd0Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
18155074dd0Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
18255074dd0Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
18355074dd0Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
18455074dd0Smrg                   [depcc="$$1"   am_compiler_list=])
18555074dd0Smrg
18655074dd0SmrgAC_CACHE_CHECK([dependency style of $depcc],
18755074dd0Smrg               [am_cv_$1_dependencies_compiler_type],
18855074dd0Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
18955074dd0Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
19055074dd0Smrg  # making bogus files that we don't know about and never remove.  For
19155074dd0Smrg  # instance it was reported that on HP-UX the gcc test will end up
19255074dd0Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
19355074dd0Smrg  # in D'.
19455074dd0Smrg  mkdir conftest.dir
19555074dd0Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19655074dd0Smrg  # using a relative directory.
19755074dd0Smrg  cp "$am_depcomp" conftest.dir
19855074dd0Smrg  cd conftest.dir
19955074dd0Smrg  # We will build objects and dependencies in a subdirectory because
20055074dd0Smrg  # it helps to detect inapplicable dependency modes.  For instance
20155074dd0Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
20255074dd0Smrg  # side effect of compilation, but ICC will put the dependencies in
20355074dd0Smrg  # the current directory while Tru64 will put them in the object
20455074dd0Smrg  # directory.
20555074dd0Smrg  mkdir sub
20655074dd0Smrg
20755074dd0Smrg  am_cv_$1_dependencies_compiler_type=none
20855074dd0Smrg  if test "$am_compiler_list" = ""; then
20955074dd0Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
21055074dd0Smrg  fi
21155074dd0Smrg  am__universal=false
21255074dd0Smrg  m4_case([$1], [CC],
21355074dd0Smrg    [case " $depcc " in #(
21455074dd0Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21555074dd0Smrg     esac],
21655074dd0Smrg    [CXX],
21755074dd0Smrg    [case " $depcc " in #(
21855074dd0Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21955074dd0Smrg     esac])
22055074dd0Smrg
22155074dd0Smrg  for depmode in $am_compiler_list; do
22255074dd0Smrg    # Setup a source with many dependencies, because some compilers
22355074dd0Smrg    # like to wrap large dependency lists on column 80 (with \), and
22455074dd0Smrg    # we should not choose a depcomp mode which is confused by this.
22555074dd0Smrg    #
22655074dd0Smrg    # We need to recreate these files for each test, as the compiler may
22755074dd0Smrg    # overwrite some of them when testing with obscure command lines.
22855074dd0Smrg    # This happens at least with the AIX C compiler.
22955074dd0Smrg    : > sub/conftest.c
23055074dd0Smrg    for i in 1 2 3 4 5 6; do
23155074dd0Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23255074dd0Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
23355074dd0Smrg      # Solaris 8's {/usr,}/bin/sh.
23455074dd0Smrg      touch sub/conftst$i.h
23555074dd0Smrg    done
23655074dd0Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
23755074dd0Smrg
23855074dd0Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
23955074dd0Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
24055074dd0Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
24155074dd0Smrg    # versions had trouble with output in subdirs
24255074dd0Smrg    am__obj=sub/conftest.${OBJEXT-o}
24355074dd0Smrg    am__minus_obj="-o $am__obj"
24455074dd0Smrg    case $depmode in
24555074dd0Smrg    gcc)
24655074dd0Smrg      # This depmode causes a compiler race in universal mode.
24755074dd0Smrg      test "$am__universal" = false || continue
24855074dd0Smrg      ;;
24955074dd0Smrg    nosideeffect)
25055074dd0Smrg      # after this tag, mechanisms are not by side-effect, so they'll
25155074dd0Smrg      # only be used when explicitly requested
25255074dd0Smrg      if test "x$enable_dependency_tracking" = xyes; then
25355074dd0Smrg	continue
25455074dd0Smrg      else
25555074dd0Smrg	break
25655074dd0Smrg      fi
25755074dd0Smrg      ;;
25855074dd0Smrg    msvisualcpp | msvcmsys)
25955074dd0Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
26055074dd0Smrg      # not run yet.  These depmodes are late enough in the game, and
26155074dd0Smrg      # so weak that their functioning should not be impacted.
26255074dd0Smrg      am__obj=conftest.${OBJEXT-o}
26355074dd0Smrg      am__minus_obj=
26455074dd0Smrg      ;;
26555074dd0Smrg    none) break ;;
26655074dd0Smrg    esac
26755074dd0Smrg    if depmode=$depmode \
26855074dd0Smrg       source=sub/conftest.c object=$am__obj \
26955074dd0Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
27055074dd0Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
27155074dd0Smrg         >/dev/null 2>conftest.err &&
27255074dd0Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
27355074dd0Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27455074dd0Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
27555074dd0Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
27655074dd0Smrg      # icc doesn't choke on unknown options, it will just issue warnings
27755074dd0Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
27855074dd0Smrg      # that says an option was ignored or not supported.
27955074dd0Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
28055074dd0Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
28155074dd0Smrg      # The diagnosis changed in icc 8.0:
28255074dd0Smrg      #   icc: Command line remark: option '-MP' not supported
28355074dd0Smrg      if (grep 'ignoring option' conftest.err ||
28455074dd0Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
28555074dd0Smrg        am_cv_$1_dependencies_compiler_type=$depmode
28655074dd0Smrg        break
28755074dd0Smrg      fi
28855074dd0Smrg    fi
28955074dd0Smrg  done
29055074dd0Smrg
29155074dd0Smrg  cd ..
29255074dd0Smrg  rm -rf conftest.dir
29355074dd0Smrgelse
29455074dd0Smrg  am_cv_$1_dependencies_compiler_type=none
29555074dd0Smrgfi
29655074dd0Smrg])
29755074dd0SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
29855074dd0SmrgAM_CONDITIONAL([am__fastdep$1], [
29955074dd0Smrg  test "x$enable_dependency_tracking" != xno \
30055074dd0Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
30155074dd0Smrg])
30255074dd0Smrg
30355074dd0Smrg
30455074dd0Smrg# AM_SET_DEPDIR
30555074dd0Smrg# -------------
30655074dd0Smrg# Choose a directory name for dependency files.
30755074dd0Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
30855074dd0SmrgAC_DEFUN([AM_SET_DEPDIR],
30955074dd0Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
31055074dd0SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
31155074dd0Smrg])
31255074dd0Smrg
31355074dd0Smrg
31455074dd0Smrg# AM_DEP_TRACK
31555074dd0Smrg# ------------
31655074dd0SmrgAC_DEFUN([AM_DEP_TRACK],
31755074dd0Smrg[AC_ARG_ENABLE(dependency-tracking,
31855074dd0Smrg[  --disable-dependency-tracking  speeds up one-time build
31955074dd0Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
32055074dd0Smrgif test "x$enable_dependency_tracking" != xno; then
32155074dd0Smrg  am_depcomp="$ac_aux_dir/depcomp"
32255074dd0Smrg  AMDEPBACKSLASH='\'
32355074dd0Smrgfi
32455074dd0SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
32555074dd0SmrgAC_SUBST([AMDEPBACKSLASH])dnl
32655074dd0Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
32755074dd0Smrg])
32855074dd0Smrg
32955074dd0Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
33055074dd0Smrg
33155074dd0Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33255074dd0Smrg# Free Software Foundation, Inc.
3332ddb6cf1Smrg#
33455074dd0Smrg# This file is free software; the Free Software Foundation
33555074dd0Smrg# gives unlimited permission to copy and/or distribute it,
33655074dd0Smrg# with or without modifications, as long as this notice is preserved.
33755074dd0Smrg
33855074dd0Smrg#serial 5
33955074dd0Smrg
34055074dd0Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
34155074dd0Smrg# ------------------------------
34255074dd0SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
34355074dd0Smrg[{
34455074dd0Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
34555074dd0Smrg  # are listed without --file.  Let's play safe and only enable the eval
34655074dd0Smrg  # if we detect the quoting.
34755074dd0Smrg  case $CONFIG_FILES in
34855074dd0Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
34955074dd0Smrg  *)   set x $CONFIG_FILES ;;
35055074dd0Smrg  esac
35155074dd0Smrg  shift
35255074dd0Smrg  for mf
35355074dd0Smrg  do
35455074dd0Smrg    # Strip MF so we end up with the name of the file.
35555074dd0Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
35655074dd0Smrg    # Check whether this is an Automake generated Makefile or not.
35755074dd0Smrg    # We used to match only the files named `Makefile.in', but
35855074dd0Smrg    # some people rename them; so instead we look at the file content.
35955074dd0Smrg    # Grep'ing the first line is not enough: some people post-process
36055074dd0Smrg    # each Makefile.in and add a new line on top of each file to say so.
36155074dd0Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
36255074dd0Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
36355074dd0Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36455074dd0Smrg      dirpart=`AS_DIRNAME("$mf")`
36555074dd0Smrg    else
36655074dd0Smrg      continue
36755074dd0Smrg    fi
36855074dd0Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
36955074dd0Smrg    # from the Makefile without running `make'.
37055074dd0Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
37155074dd0Smrg    test -z "$DEPDIR" && continue
37255074dd0Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
37355074dd0Smrg    test -z "am__include" && continue
37455074dd0Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37555074dd0Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
37655074dd0Smrg    U=`sed -n 's/^U = //p' < "$mf"`
37755074dd0Smrg    # Find all dependency output files, they are included files with
37855074dd0Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
37955074dd0Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
38055074dd0Smrg    # expansion.
38155074dd0Smrg    for file in `sed -n "
38255074dd0Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
38355074dd0Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
38455074dd0Smrg      # Make sure the directory exists.
38555074dd0Smrg      test -f "$dirpart/$file" && continue
38655074dd0Smrg      fdir=`AS_DIRNAME(["$file"])`
38755074dd0Smrg      AS_MKDIR_P([$dirpart/$fdir])
38855074dd0Smrg      # echo "creating $dirpart/$file"
38955074dd0Smrg      echo '# dummy' > "$dirpart/$file"
39055074dd0Smrg    done
39155074dd0Smrg  done
39255074dd0Smrg}
39355074dd0Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
39455074dd0Smrg
39555074dd0Smrg
39655074dd0Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
39755074dd0Smrg# -----------------------------
39855074dd0Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
3992ddb6cf1Smrg#
40055074dd0Smrg# This code is only required when automatic dependency tracking
40155074dd0Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
40255074dd0Smrg# need in order to bootstrap the dependency handling code.
40355074dd0SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
40455074dd0Smrg[AC_CONFIG_COMMANDS([depfiles],
40555074dd0Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
40655074dd0Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
40755074dd0Smrg])
408a1d141d5Smrg
40955074dd0Smrg# Do all the work for Automake.                             -*- Autoconf -*-
41055074dd0Smrg
41155074dd0Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
41255074dd0Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4132ddb6cf1Smrg#
41455074dd0Smrg# This file is free software; the Free Software Foundation
41555074dd0Smrg# gives unlimited permission to copy and/or distribute it,
41655074dd0Smrg# with or without modifications, as long as this notice is preserved.
417a1d141d5Smrg
41855074dd0Smrg# serial 16
41955074dd0Smrg
42055074dd0Smrg# This macro actually does too much.  Some checks are only needed if
42155074dd0Smrg# your package does certain things.  But this isn't really a big deal.
42255074dd0Smrg
42355074dd0Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
42455074dd0Smrg# AM_INIT_AUTOMAKE([OPTIONS])
42555074dd0Smrg# -----------------------------------------------
42655074dd0Smrg# The call with PACKAGE and VERSION arguments is the old style
42755074dd0Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
42855074dd0Smrg# and VERSION should now be passed to AC_INIT and removed from
42955074dd0Smrg# the call to AM_INIT_AUTOMAKE.
43055074dd0Smrg# We support both call styles for the transition.  After
43155074dd0Smrg# the next Automake release, Autoconf can make the AC_INIT
43255074dd0Smrg# arguments mandatory, and then we can depend on a new Autoconf
43355074dd0Smrg# release and drop the old call support.
43455074dd0SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
43555074dd0Smrg[AC_PREREQ([2.62])dnl
43655074dd0Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
43755074dd0Smrgdnl the ones we care about.
43855074dd0Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
43955074dd0SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
44055074dd0SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
44155074dd0Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
44255074dd0Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
44355074dd0Smrg  # is not polluted with repeated "-I."
44455074dd0Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
44555074dd0Smrg  # test to see if srcdir already configured
44655074dd0Smrg  if test -f $srcdir/config.status; then
44755074dd0Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
44855074dd0Smrg  fi
4492ddb6cf1Smrgfi
450a1d141d5Smrg
45155074dd0Smrg# test whether we have cygpath
45255074dd0Smrgif test -z "$CYGPATH_W"; then
45355074dd0Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
45455074dd0Smrg    CYGPATH_W='cygpath -w'
45555074dd0Smrg  else
45655074dd0Smrg    CYGPATH_W=echo
45755074dd0Smrg  fi
4582ddb6cf1Smrgfi
45955074dd0SmrgAC_SUBST([CYGPATH_W])
460a1d141d5Smrg
46155074dd0Smrg# Define the identity of the package.
46255074dd0Smrgdnl Distinguish between old-style and new-style calls.
46355074dd0Smrgm4_ifval([$2],
46455074dd0Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
46555074dd0Smrg AC_SUBST([PACKAGE], [$1])dnl
46655074dd0Smrg AC_SUBST([VERSION], [$2])],
46755074dd0Smrg[_AM_SET_OPTIONS([$1])dnl
46855074dd0Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
46955074dd0Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
47055074dd0Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
47155074dd0Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
47255074dd0Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473a1d141d5Smrg
47455074dd0Smrg_AM_IF_OPTION([no-define],,
47555074dd0Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
47655074dd0Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
47755074dd0Smrg
47855074dd0Smrg# Some tools Automake needs.
47955074dd0SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
48055074dd0SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
48155074dd0SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
48255074dd0SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
48355074dd0SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
48455074dd0SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
48555074dd0SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
48655074dd0SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
48755074dd0SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
48855074dd0SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
48955074dd0Smrg# We need awk for the "check" target.  The system "awk" is bad on
49055074dd0Smrg# some platforms.
49155074dd0SmrgAC_REQUIRE([AC_PROG_AWK])dnl
49255074dd0SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
49355074dd0SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
49455074dd0Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
49555074dd0Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
49655074dd0Smrg			     [_AM_PROG_TAR([v7])])])
49755074dd0Smrg_AM_IF_OPTION([no-dependencies],,
49855074dd0Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
49955074dd0Smrg		  [_AM_DEPENDENCIES(CC)],
50055074dd0Smrg		  [define([AC_PROG_CC],
50155074dd0Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
50255074dd0SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
50355074dd0Smrg		  [_AM_DEPENDENCIES(CXX)],
50455074dd0Smrg		  [define([AC_PROG_CXX],
50555074dd0Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
50655074dd0SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
50755074dd0Smrg		  [_AM_DEPENDENCIES(OBJC)],
50855074dd0Smrg		  [define([AC_PROG_OBJC],
50955074dd0Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
51055074dd0Smrg])
51155074dd0Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
51255074dd0Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
51355074dd0Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
51455074dd0Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
51555074dd0SmrgAC_CONFIG_COMMANDS_PRE(dnl
51655074dd0Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
51755074dd0Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
51855074dd0Smrg])
519a1d141d5Smrg
52055074dd0Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
52155074dd0Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
52255074dd0Smrgdnl mangled by Autoconf and run in a shell conditional statement.
52355074dd0Smrgm4_define([_AC_COMPILER_EXEEXT],
52455074dd0Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525a1d141d5Smrg
526a1d141d5Smrg
52755074dd0Smrg# When config.status generates a header, we must update the stamp-h file.
52855074dd0Smrg# This file resides in the same directory as the config header
52955074dd0Smrg# that is generated.  The stamp files are numbered to have different names.
530a1d141d5Smrg
53155074dd0Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
53255074dd0Smrg# loop where config.status creates the headers, so we can generate
53355074dd0Smrg# our stamp files there.
53455074dd0SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
53555074dd0Smrg[# Compute $1's index in $config_headers.
53655074dd0Smrg_am_arg=$1
53755074dd0Smrg_am_stamp_count=1
53855074dd0Smrgfor _am_header in $config_headers :; do
53955074dd0Smrg  case $_am_header in
54055074dd0Smrg    $_am_arg | $_am_arg:* )
54155074dd0Smrg      break ;;
54255074dd0Smrg    * )
54355074dd0Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
54455074dd0Smrg  esac
54555074dd0Smrgdone
54655074dd0Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547a1d141d5Smrg
54855074dd0Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
54955074dd0Smrg#
55055074dd0Smrg# This file is free software; the Free Software Foundation
55155074dd0Smrg# gives unlimited permission to copy and/or distribute it,
55255074dd0Smrg# with or without modifications, as long as this notice is preserved.
553a1d141d5Smrg
55455074dd0Smrg# AM_PROG_INSTALL_SH
55555074dd0Smrg# ------------------
55655074dd0Smrg# Define $install_sh.
55755074dd0SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
55855074dd0Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
55955074dd0Smrgif test x"${install_sh}" != xset; then
56055074dd0Smrg  case $am_aux_dir in
56155074dd0Smrg  *\ * | *\	*)
56255074dd0Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
56355074dd0Smrg  *)
56455074dd0Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
56555074dd0Smrg  esac
5662ddb6cf1Smrgfi
56755074dd0SmrgAC_SUBST(install_sh)])
568a1d141d5Smrg
56955074dd0Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5702ddb6cf1Smrg#
57155074dd0Smrg# This file is free software; the Free Software Foundation
57255074dd0Smrg# gives unlimited permission to copy and/or distribute it,
57355074dd0Smrg# with or without modifications, as long as this notice is preserved.
57455074dd0Smrg
57555074dd0Smrg# serial 2
576a1d141d5Smrg
57755074dd0Smrg# Check whether the underlying file-system supports filenames
57855074dd0Smrg# with a leading dot.  For instance MS-DOS doesn't.
57955074dd0SmrgAC_DEFUN([AM_SET_LEADING_DOT],
58055074dd0Smrg[rm -rf .tst 2>/dev/null
58155074dd0Smrgmkdir .tst 2>/dev/null
58255074dd0Smrgif test -d .tst; then
58355074dd0Smrg  am__leading_dot=.
584a1d141d5Smrgelse
58555074dd0Smrg  am__leading_dot=_
586a1d141d5Smrgfi
58755074dd0Smrgrmdir .tst 2>/dev/null
58855074dd0SmrgAC_SUBST([am__leading_dot])])
589a1d141d5Smrg
59055074dd0Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
59155074dd0Smrg# From Jim Meyering
592a1d141d5Smrg
59355074dd0Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
59455074dd0Smrg# Free Software Foundation, Inc.
59555074dd0Smrg#
59655074dd0Smrg# This file is free software; the Free Software Foundation
59755074dd0Smrg# gives unlimited permission to copy and/or distribute it,
59855074dd0Smrg# with or without modifications, as long as this notice is preserved.
599a1d141d5Smrg
60055074dd0Smrg# serial 5
601a1d141d5Smrg
60255074dd0Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
60355074dd0Smrg# ----------------------------------
60455074dd0Smrg# Control maintainer-specific portions of Makefiles.
60555074dd0Smrg# Default is to disable them, unless `enable' is passed literally.
60655074dd0Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
60755074dd0Smrg# can override the default with the --enable/--disable switch.
60855074dd0SmrgAC_DEFUN([AM_MAINTAINER_MODE],
60955074dd0Smrg[m4_case(m4_default([$1], [disable]),
61055074dd0Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
61155074dd0Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
61255074dd0Smrg       [m4_define([am_maintainer_other], [enable])
61355074dd0Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
61455074dd0SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
61555074dd0Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
61655074dd0Smrg  AC_ARG_ENABLE([maintainer-mode],
61755074dd0Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
61855074dd0Smrg			  (and sometimes confusing) to the casual installer],
61955074dd0Smrg      [USE_MAINTAINER_MODE=$enableval],
62055074dd0Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
62155074dd0Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
62255074dd0Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
62355074dd0Smrg  MAINT=$MAINTAINER_MODE_TRUE
62455074dd0Smrg  AC_SUBST([MAINT])dnl
62555074dd0Smrg]
62655074dd0Smrg)
627a1d141d5Smrg
62855074dd0SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
629a1d141d5Smrg
63055074dd0Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
631a1d141d5Smrg
63255074dd0Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
63355074dd0Smrg#
63455074dd0Smrg# This file is free software; the Free Software Foundation
63555074dd0Smrg# gives unlimited permission to copy and/or distribute it,
63655074dd0Smrg# with or without modifications, as long as this notice is preserved.
637a1d141d5Smrg
63855074dd0Smrg# serial 4
639a1d141d5Smrg
64055074dd0Smrg# AM_MAKE_INCLUDE()
64155074dd0Smrg# -----------------
64255074dd0Smrg# Check to see how make treats includes.
64355074dd0SmrgAC_DEFUN([AM_MAKE_INCLUDE],
64455074dd0Smrg[am_make=${MAKE-make}
64555074dd0Smrgcat > confinc << 'END'
64655074dd0Smrgam__doit:
64755074dd0Smrg	@echo this is the am__doit target
64855074dd0Smrg.PHONY: am__doit
64955074dd0SmrgEND
65055074dd0Smrg# If we don't find an include directive, just comment out the code.
65155074dd0SmrgAC_MSG_CHECKING([for style of include used by $am_make])
65255074dd0Smrgam__include="#"
65355074dd0Smrgam__quote=
65455074dd0Smrg_am_result=none
65555074dd0Smrg# First try GNU make style include.
65655074dd0Smrgecho "include confinc" > confmf
65755074dd0Smrg# Ignore all kinds of additional output from `make'.
65855074dd0Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
65955074dd0Smrg*the\ am__doit\ target*)
66055074dd0Smrg  am__include=include
66155074dd0Smrg  am__quote=
66255074dd0Smrg  _am_result=GNU
66355074dd0Smrg  ;;
66455074dd0Smrgesac
66555074dd0Smrg# Now try BSD make style include.
66655074dd0Smrgif test "$am__include" = "#"; then
66755074dd0Smrg   echo '.include "confinc"' > confmf
66855074dd0Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
66955074dd0Smrg   *the\ am__doit\ target*)
67055074dd0Smrg     am__include=.include
67155074dd0Smrg     am__quote="\""
67255074dd0Smrg     _am_result=BSD
67355074dd0Smrg     ;;
67455074dd0Smrg   esac
67555074dd0Smrgfi
67655074dd0SmrgAC_SUBST([am__include])
67755074dd0SmrgAC_SUBST([am__quote])
67855074dd0SmrgAC_MSG_RESULT([$_am_result])
67955074dd0Smrgrm -f confinc confmf
68055074dd0Smrg])
681a1d141d5Smrg
68255074dd0Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
683a1d141d5Smrg
68455074dd0Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
68555074dd0Smrg# Free Software Foundation, Inc.
6862ddb6cf1Smrg#
68755074dd0Smrg# This file is free software; the Free Software Foundation
68855074dd0Smrg# gives unlimited permission to copy and/or distribute it,
68955074dd0Smrg# with or without modifications, as long as this notice is preserved.
6902ddb6cf1Smrg
69155074dd0Smrg# serial 6
6922ddb6cf1Smrg
69355074dd0Smrg# AM_MISSING_PROG(NAME, PROGRAM)
69455074dd0Smrg# ------------------------------
69555074dd0SmrgAC_DEFUN([AM_MISSING_PROG],
69655074dd0Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
69755074dd0Smrg$1=${$1-"${am_missing_run}$2"}
69855074dd0SmrgAC_SUBST($1)])
6992ddb6cf1Smrg
700a1d141d5Smrg
70155074dd0Smrg# AM_MISSING_HAS_RUN
70255074dd0Smrg# ------------------
70355074dd0Smrg# Define MISSING if not defined so far and test if it supports --run.
70455074dd0Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
70555074dd0SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
70655074dd0Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
70755074dd0SmrgAC_REQUIRE_AUX_FILE([missing])dnl
70855074dd0Smrgif test x"${MISSING+set}" != xset; then
70955074dd0Smrg  case $am_aux_dir in
71055074dd0Smrg  *\ * | *\	*)
71155074dd0Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
71255074dd0Smrg  *)
71355074dd0Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
71455074dd0Smrg  esac
7152ddb6cf1Smrgfi
71655074dd0Smrg# Use eval to expand $SHELL
71755074dd0Smrgif eval "$MISSING --run true"; then
71855074dd0Smrg  am_missing_run="$MISSING --run "
71955074dd0Smrgelse
72055074dd0Smrg  am_missing_run=
72155074dd0Smrg  AC_MSG_WARN([`missing' script is too old or missing])
7222ddb6cf1Smrgfi
72355074dd0Smrg])
724a1d141d5Smrg
72555074dd0Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
72655074dd0Smrg#
72755074dd0Smrg# This file is free software; the Free Software Foundation
72855074dd0Smrg# gives unlimited permission to copy and/or distribute it,
72955074dd0Smrg# with or without modifications, as long as this notice is preserved.
730a1d141d5Smrg
73155074dd0Smrg# AM_PROG_MKDIR_P
73255074dd0Smrg# ---------------
73355074dd0Smrg# Check for `mkdir -p'.
73455074dd0SmrgAC_DEFUN([AM_PROG_MKDIR_P],
73555074dd0Smrg[AC_PREREQ([2.60])dnl
73655074dd0SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
73755074dd0Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
73855074dd0Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
73955074dd0Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
74055074dd0Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
74155074dd0Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
74255074dd0Smrgdnl adjustment using top_builddir (which is defined more often than
74355074dd0Smrgdnl MKDIR_P).
74455074dd0SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
74555074dd0Smrgcase $mkdir_p in
74655074dd0Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
74755074dd0Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
74855074dd0Smrgesac
74955074dd0Smrg])
750a1d141d5Smrg
75155074dd0Smrg# Helper functions for option handling.                     -*- Autoconf -*-
752a1d141d5Smrg
75355074dd0Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
7542ddb6cf1Smrg#
75555074dd0Smrg# This file is free software; the Free Software Foundation
75655074dd0Smrg# gives unlimited permission to copy and/or distribute it,
75755074dd0Smrg# with or without modifications, as long as this notice is preserved.
758a1d141d5Smrg
75955074dd0Smrg# serial 4
760a1d141d5Smrg
76155074dd0Smrg# _AM_MANGLE_OPTION(NAME)
76255074dd0Smrg# -----------------------
76355074dd0SmrgAC_DEFUN([_AM_MANGLE_OPTION],
76455074dd0Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765a1d141d5Smrg
76655074dd0Smrg# _AM_SET_OPTION(NAME)
76755074dd0Smrg# ------------------------------
76855074dd0Smrg# Set option NAME.  Presently that only means defining a flag for this option.
76955074dd0SmrgAC_DEFUN([_AM_SET_OPTION],
77055074dd0Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7712ddb6cf1Smrg
77255074dd0Smrg# _AM_SET_OPTIONS(OPTIONS)
77355074dd0Smrg# ----------------------------------
77455074dd0Smrg# OPTIONS is a space-separated list of Automake options.
77555074dd0SmrgAC_DEFUN([_AM_SET_OPTIONS],
77655074dd0Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
777a1d141d5Smrg
77855074dd0Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
77955074dd0Smrg# -------------------------------------------
78055074dd0Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
78155074dd0SmrgAC_DEFUN([_AM_IF_OPTION],
78255074dd0Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783a1d141d5Smrg
78455074dd0Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785a1d141d5Smrg
78655074dd0Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
78755074dd0Smrg# Free Software Foundation, Inc.
7882ddb6cf1Smrg#
78955074dd0Smrg# This file is free software; the Free Software Foundation
79055074dd0Smrg# gives unlimited permission to copy and/or distribute it,
79155074dd0Smrg# with or without modifications, as long as this notice is preserved.
792a1d141d5Smrg
79355074dd0Smrg# serial 5
7942ddb6cf1Smrg
79555074dd0Smrg# AM_SANITY_CHECK
7962ddb6cf1Smrg# ---------------
79755074dd0SmrgAC_DEFUN([AM_SANITY_CHECK],
79855074dd0Smrg[AC_MSG_CHECKING([whether build environment is sane])
79955074dd0Smrg# Just in case
80055074dd0Smrgsleep 1
80155074dd0Smrgecho timestamp > conftest.file
80255074dd0Smrg# Reject unsafe characters in $srcdir or the absolute working directory
80355074dd0Smrg# name.  Accept space and tab only in the latter.
80455074dd0Smrgam_lf='
80555074dd0Smrg'
80655074dd0Smrgcase `pwd` in
80755074dd0Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
80855074dd0Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
80955074dd0Smrgesac
81055074dd0Smrgcase $srcdir in
81155074dd0Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
81255074dd0Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
81355074dd0Smrgesac
814a1d141d5Smrg
81555074dd0Smrg# Do `set' in a subshell so we don't clobber the current shell's
81655074dd0Smrg# arguments.  Must try -L first in case configure is actually a
81755074dd0Smrg# symlink; some systems play weird games with the mod time of symlinks
81855074dd0Smrg# (eg FreeBSD returns the mod time of the symlink's containing
81955074dd0Smrg# directory).
82055074dd0Smrgif (
82155074dd0Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
82255074dd0Smrg   if test "$[*]" = "X"; then
82355074dd0Smrg      # -L didn't work.
82455074dd0Smrg      set X `ls -t "$srcdir/configure" conftest.file`
82555074dd0Smrg   fi
82655074dd0Smrg   rm -f conftest.file
82755074dd0Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
82855074dd0Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
82955074dd0Smrg
83055074dd0Smrg      # If neither matched, then we have a broken ls.  This can happen
83155074dd0Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
83255074dd0Smrg      # broken ls alias from the environment.  This has actually
83355074dd0Smrg      # happened.  Such a system could not be considered "sane".
83455074dd0Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
83555074dd0Smrgalias in your environment])
83655074dd0Smrg   fi
8372ddb6cf1Smrg
83855074dd0Smrg   test "$[2]" = conftest.file
83955074dd0Smrg   )
84055074dd0Smrgthen
84155074dd0Smrg   # Ok.
84255074dd0Smrg   :
84355074dd0Smrgelse
84455074dd0Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
84555074dd0SmrgCheck your system clock])
8462ddb6cf1Smrgfi
84755074dd0SmrgAC_MSG_RESULT(yes)])
848a1d141d5Smrg
84955074dd0Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
8502ddb6cf1Smrg#
85155074dd0Smrg# This file is free software; the Free Software Foundation
85255074dd0Smrg# gives unlimited permission to copy and/or distribute it,
85355074dd0Smrg# with or without modifications, as long as this notice is preserved.
8542ddb6cf1Smrg
85555074dd0Smrg# serial 1
856a1d141d5Smrg
85755074dd0Smrg# AM_SILENT_RULES([DEFAULT])
85855074dd0Smrg# --------------------------
85955074dd0Smrg# Enable less verbose build rules; with the default set to DEFAULT
86055074dd0Smrg# (`yes' being less verbose, `no' or empty being verbose).
86155074dd0SmrgAC_DEFUN([AM_SILENT_RULES],
86255074dd0Smrg[AC_ARG_ENABLE([silent-rules],
86355074dd0Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
86455074dd0Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
86555074dd0Smrgcase $enable_silent_rules in
86655074dd0Smrgyes) AM_DEFAULT_VERBOSITY=0;;
86755074dd0Smrgno)  AM_DEFAULT_VERBOSITY=1;;
86855074dd0Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
86955074dd0Smrgesac
87055074dd0SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
87155074dd0SmrgAM_BACKSLASH='\'
87255074dd0SmrgAC_SUBST([AM_BACKSLASH])dnl
87355074dd0Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8742ddb6cf1Smrg])
875a1d141d5Smrg
87655074dd0Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8772ddb6cf1Smrg#
87855074dd0Smrg# This file is free software; the Free Software Foundation
87955074dd0Smrg# gives unlimited permission to copy and/or distribute it,
88055074dd0Smrg# with or without modifications, as long as this notice is preserved.
88155074dd0Smrg
88255074dd0Smrg# AM_PROG_INSTALL_STRIP
88355074dd0Smrg# ---------------------
88455074dd0Smrg# One issue with vendor `install' (even GNU) is that you can't
88555074dd0Smrg# specify the program used to strip binaries.  This is especially
88655074dd0Smrg# annoying in cross-compiling environments, where the build's strip
88755074dd0Smrg# is unlikely to handle the host's binaries.
88855074dd0Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
88955074dd0Smrg# always use install-sh in `make install-strip', and initialize
89055074dd0Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
89155074dd0SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
89255074dd0Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
89355074dd0Smrg# Installed binaries are usually stripped using `strip' when the user
89455074dd0Smrg# run `make install-strip'.  However `strip' might not be the right
89555074dd0Smrg# tool to use in cross-compilation environments, therefore Automake
89655074dd0Smrg# will honor the `STRIP' environment variable to overrule this program.
89755074dd0Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
89855074dd0Smrgif test "$cross_compiling" != no; then
89955074dd0Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
90055074dd0Smrgfi
90155074dd0SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
90255074dd0SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
90355074dd0Smrg
90455074dd0Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9052ddb6cf1Smrg#
90655074dd0Smrg# This file is free software; the Free Software Foundation
90755074dd0Smrg# gives unlimited permission to copy and/or distribute it,
90855074dd0Smrg# with or without modifications, as long as this notice is preserved.
9092ddb6cf1Smrg
91055074dd0Smrg# serial 2
91155074dd0Smrg
91255074dd0Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
91355074dd0Smrg# ---------------------------
91455074dd0Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
91555074dd0Smrg# This macro is traced by Automake.
91655074dd0SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
91755074dd0Smrg
91855074dd0Smrg# AM_SUBST_NOTMAKE(VARIABLE)
91955074dd0Smrg# ---------------------------
92055074dd0Smrg# Public sister of _AM_SUBST_NOTMAKE.
92155074dd0SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
92255074dd0Smrg
92355074dd0Smrg# Check how to create a tarball.                            -*- Autoconf -*-
92455074dd0Smrg
92555074dd0Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9262ddb6cf1Smrg#
9272ddb6cf1Smrg# This file is free software; the Free Software Foundation
9282ddb6cf1Smrg# gives unlimited permission to copy and/or distribute it,
9292ddb6cf1Smrg# with or without modifications, as long as this notice is preserved.
930a1d141d5Smrg
93155074dd0Smrg# serial 2
93255074dd0Smrg
93355074dd0Smrg# _AM_PROG_TAR(FORMAT)
93455074dd0Smrg# --------------------
93555074dd0Smrg# Check how to create a tarball in format FORMAT.
93655074dd0Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
93755074dd0Smrg#
93855074dd0Smrg# Substitute a variable $(am__tar) that is a command
93955074dd0Smrg# writing to stdout a FORMAT-tarball containing the directory
94055074dd0Smrg# $tardir.
94155074dd0Smrg#     tardir=directory && $(am__tar) > result.tar
94255074dd0Smrg#
94355074dd0Smrg# Substitute a variable $(am__untar) that extract such
94455074dd0Smrg# a tarball read from stdin.
94555074dd0Smrg#     $(am__untar) < result.tar
94655074dd0SmrgAC_DEFUN([_AM_PROG_TAR],
94755074dd0Smrg[# Always define AMTAR for backward compatibility.
94855074dd0SmrgAM_MISSING_PROG([AMTAR], [tar])
94955074dd0Smrgm4_if([$1], [v7],
95055074dd0Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
95155074dd0Smrg     [m4_case([$1], [ustar],, [pax],,
95255074dd0Smrg              [m4_fatal([Unknown tar format])])
95355074dd0SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
95455074dd0Smrg# Loop over all known methods to create a tar archive until one works.
95555074dd0Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
95655074dd0Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
95755074dd0Smrg# Do not fold the above two line into one, because Tru64 sh and
95855074dd0Smrg# Solaris sh will not grok spaces in the rhs of `-'.
95955074dd0Smrgfor _am_tool in $_am_tools
96055074dd0Smrgdo
96155074dd0Smrg  case $_am_tool in
96255074dd0Smrg  gnutar)
96355074dd0Smrg    for _am_tar in tar gnutar gtar;
96455074dd0Smrg    do
96555074dd0Smrg      AM_RUN_LOG([$_am_tar --version]) && break
96655074dd0Smrg    done
96755074dd0Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
96855074dd0Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
96955074dd0Smrg    am__untar="$_am_tar -xf -"
97055074dd0Smrg    ;;
97155074dd0Smrg  plaintar)
97255074dd0Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
97355074dd0Smrg    # ustar tarball either.
97455074dd0Smrg    (tar --version) >/dev/null 2>&1 && continue
97555074dd0Smrg    am__tar='tar chf - "$$tardir"'
97655074dd0Smrg    am__tar_='tar chf - "$tardir"'
97755074dd0Smrg    am__untar='tar xf -'
97855074dd0Smrg    ;;
97955074dd0Smrg  pax)
98055074dd0Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
98155074dd0Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
98255074dd0Smrg    am__untar='pax -r'
98355074dd0Smrg    ;;
98455074dd0Smrg  cpio)
98555074dd0Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
98655074dd0Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
98755074dd0Smrg    am__untar='cpio -i -H $1 -d'
98855074dd0Smrg    ;;
98955074dd0Smrg  none)
99055074dd0Smrg    am__tar=false
99155074dd0Smrg    am__tar_=false
99255074dd0Smrg    am__untar=false
99355074dd0Smrg    ;;
99455074dd0Smrg  esac
995a1d141d5Smrg
99655074dd0Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
99755074dd0Smrg  # and am__untar set.
99855074dd0Smrg  test -n "${am_cv_prog_tar_$1}" && break
999a1d141d5Smrg
100055074dd0Smrg  # tar/untar a dummy directory, and stop if the command works
100155074dd0Smrg  rm -rf conftest.dir
100255074dd0Smrg  mkdir conftest.dir
100355074dd0Smrg  echo GrepMe > conftest.dir/file
100455074dd0Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
100555074dd0Smrg  rm -rf conftest.dir
100655074dd0Smrg  if test -s conftest.tar; then
100755074dd0Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
100855074dd0Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
100955074dd0Smrg  fi
101055074dd0Smrgdone
101155074dd0Smrgrm -rf conftest.dir
1012a1d141d5Smrg
101355074dd0SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
101455074dd0SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
101555074dd0SmrgAC_SUBST([am__tar])
101655074dd0SmrgAC_SUBST([am__untar])
101755074dd0Smrg]) # _AM_PROG_TAR
1018a1d141d5Smrg
101955074dd0Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
102055074dd0Smrgdnl
102155074dd0Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
102255074dd0Smrgdnl 
102355074dd0Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
102455074dd0Smrgdnl copy of this software and associated documentation files (the "Software"),
102555074dd0Smrgdnl to deal in the Software without restriction, including without limitation
102655074dd0Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
102755074dd0Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
102855074dd0Smrgdnl Software is furnished to do so, subject to the following conditions:
102955074dd0Smrgdnl
103055074dd0Smrgdnl The above copyright notice and this permission notice (including the next
103155074dd0Smrgdnl paragraph) shall be included in all copies or substantial portions of the
103255074dd0Smrgdnl Software.
103355074dd0Smrgdnl
103455074dd0Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
103555074dd0Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
103655074dd0Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
103755074dd0Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
103855074dd0Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
103955074dd0Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
104055074dd0Smrgdnl DEALINGS IN THE SOFTWARE.
1041a1d141d5Smrg
104255074dd0Smrg# XORG_MACROS_VERSION(required-version)
104355074dd0Smrg# -------------------------------------
104455074dd0Smrg# Minimum version: 1.1.0
10452ddb6cf1Smrg#
104655074dd0Smrg# If you're using a macro added in Version 1.1 or newer, include this in
104755074dd0Smrg# your configure.ac with the minimum required version, such as:
104855074dd0Smrg# XORG_MACROS_VERSION(1.1)
10492ddb6cf1Smrg#
105055074dd0Smrg# To ensure that this macro is defined, also add:
105155074dd0Smrg# m4_ifndef([XORG_MACROS_VERSION],
105255074dd0Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10532ddb6cf1Smrg#
10542ddb6cf1Smrg#
105555074dd0Smrg# See the "minimum version" comment for each macro you use to see what 
105655074dd0Smrg# version you require.
105755074dd0Smrgm4_defun([XORG_MACROS_VERSION],[
105855074dd0Smrgm4_define([vers_have], [1.11.0])
105955074dd0Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
106055074dd0Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
106155074dd0Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
106255074dd0Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
106355074dd0Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
106455074dd0Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
106555074dd0Smrgm4_undefine([vers_have])
106655074dd0Smrgm4_undefine([maj_have])
106755074dd0Smrgm4_undefine([maj_needed])
106855074dd0Smrg]) # XORG_MACROS_VERSION
10692ddb6cf1Smrg
107055074dd0Smrg# XORG_PROG_RAWCPP()
107155074dd0Smrg# ------------------
107255074dd0Smrg# Minimum version: 1.0.0
10732ddb6cf1Smrg#
107455074dd0Smrg# Find cpp program and necessary flags for use in pre-processing text files
107555074dd0Smrg# such as man pages and config files
107655074dd0SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
107755074dd0SmrgAC_REQUIRE([AC_PROG_CPP])
107855074dd0SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
107955074dd0Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
10802ddb6cf1Smrg
108155074dd0Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
108255074dd0Smrg# which is not the best choice for supporting other OS'es, but covers most
108355074dd0Smrg# of the ones we need for now.
108455074dd0SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
108555074dd0SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
108655074dd0Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
108755074dd0Smrg	AC_MSG_RESULT([no])
108855074dd0Smrgelse
108955074dd0Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
109055074dd0Smrg		RAWCPPFLAGS=-undef
109155074dd0Smrg		AC_MSG_RESULT([yes])
109255074dd0Smrg	# under Cygwin unix is still defined even with -undef
109355074dd0Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
109455074dd0Smrg		RAWCPPFLAGS="-undef -ansi"
109555074dd0Smrg		AC_MSG_RESULT([yes, with -ansi])
109655074dd0Smrg	else
109755074dd0Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
109855074dd0Smrg	fi
109955074dd0Smrgfi
110055074dd0Smrgrm -f conftest.$ac_ext
11012ddb6cf1Smrg
110255074dd0SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
110355074dd0SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
110455074dd0Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
110555074dd0Smrg	AC_MSG_RESULT([no])
11062ddb6cf1Smrgelse
110755074dd0Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
110855074dd0Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
110955074dd0Smrg		AC_MSG_RESULT([yes])
111055074dd0Smrg	else
111155074dd0Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
111255074dd0Smrg	fi
11132ddb6cf1Smrgfi
111455074dd0Smrgrm -f conftest.$ac_ext
111555074dd0SmrgAC_SUBST(RAWCPPFLAGS)
111655074dd0Smrg]) # XORG_PROG_RAWCPP
11172ddb6cf1Smrg
111855074dd0Smrg# XORG_MANPAGE_SECTIONS()
111955074dd0Smrg# -----------------------
112055074dd0Smrg# Minimum version: 1.0.0
11212ddb6cf1Smrg#
112255074dd0Smrg# Determine which sections man pages go in for the different man page types
112355074dd0Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
112455074dd0Smrg# Not sure if there's any better way than just hardcoding by OS name.
112555074dd0Smrg# Override default settings by setting environment variables
112655074dd0Smrg# Added MAN_SUBSTS in version 1.8
112755074dd0Smrg# Added AC_PROG_SED in version 1.8
11282ddb6cf1Smrg
112955074dd0SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
113055074dd0SmrgAC_REQUIRE([AC_CANONICAL_HOST])
113155074dd0SmrgAC_REQUIRE([AC_PROG_SED])
11322ddb6cf1Smrg
113355074dd0Smrgif test x$APP_MAN_SUFFIX = x    ; then
113455074dd0Smrg    APP_MAN_SUFFIX=1
113555074dd0Smrgfi
113655074dd0Smrgif test x$APP_MAN_DIR = x    ; then
113755074dd0Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
113855074dd0Smrgfi
11392ddb6cf1Smrg
114055074dd0Smrgif test x$LIB_MAN_SUFFIX = x    ; then
114155074dd0Smrg    LIB_MAN_SUFFIX=3
114255074dd0Smrgfi
114355074dd0Smrgif test x$LIB_MAN_DIR = x    ; then
114455074dd0Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
114555074dd0Smrgfi
1146a1d141d5Smrg
114755074dd0Smrgif test x$FILE_MAN_SUFFIX = x    ; then
114855074dd0Smrg    case $host_os in
114955074dd0Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
115055074dd0Smrg	*)		FILE_MAN_SUFFIX=5  ;;
115155074dd0Smrg    esac
115255074dd0Smrgfi
115355074dd0Smrgif test x$FILE_MAN_DIR = x    ; then
115455074dd0Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
115555074dd0Smrgfi
11562ddb6cf1Smrg
115755074dd0Smrgif test x$MISC_MAN_SUFFIX = x    ; then
115855074dd0Smrg    case $host_os in
115955074dd0Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
116055074dd0Smrg	*)		MISC_MAN_SUFFIX=7  ;;
116155074dd0Smrg    esac
116255074dd0Smrgfi
116355074dd0Smrgif test x$MISC_MAN_DIR = x    ; then
116455074dd0Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
116555074dd0Smrgfi
1166a1d141d5Smrg
116755074dd0Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
116855074dd0Smrg    case $host_os in
116955074dd0Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
117055074dd0Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1171a1d141d5Smrg    esac
117255074dd0Smrgfi
117355074dd0Smrgif test x$DRIVER_MAN_DIR = x    ; then
117455074dd0Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
117555074dd0Smrgfi
1176a1d141d5Smrg
117755074dd0Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
117855074dd0Smrg    case $host_os in
117955074dd0Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
118055074dd0Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
118155074dd0Smrg    esac
118255074dd0Smrgfi
118355074dd0Smrgif test x$ADMIN_MAN_DIR = x    ; then
118455074dd0Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1185a1d141d5Smrgfi
1186a1d141d5Smrg
1187a1d141d5Smrg
118855074dd0SmrgAC_SUBST([APP_MAN_SUFFIX])
118955074dd0SmrgAC_SUBST([LIB_MAN_SUFFIX])
119055074dd0SmrgAC_SUBST([FILE_MAN_SUFFIX])
119155074dd0SmrgAC_SUBST([MISC_MAN_SUFFIX])
119255074dd0SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
119355074dd0SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
119455074dd0SmrgAC_SUBST([APP_MAN_DIR])
119555074dd0SmrgAC_SUBST([LIB_MAN_DIR])
119655074dd0SmrgAC_SUBST([FILE_MAN_DIR])
119755074dd0SmrgAC_SUBST([MISC_MAN_DIR])
119855074dd0SmrgAC_SUBST([DRIVER_MAN_DIR])
119955074dd0SmrgAC_SUBST([ADMIN_MAN_DIR])
1200a1d141d5Smrg
120155074dd0SmrgXORG_MAN_PAGE="X Version 11"
120255074dd0SmrgAC_SUBST([XORG_MAN_PAGE])
120355074dd0SmrgMAN_SUBSTS="\
120455074dd0Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
120555074dd0Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
120655074dd0Smrg	-e 's|__xservername__|Xorg|g' \
120755074dd0Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
120855074dd0Smrg	-e 's|__projectroot__|\$(prefix)|g' \
120955074dd0Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
121055074dd0Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
121155074dd0Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
121255074dd0Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
121355074dd0Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
121455074dd0Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
121555074dd0Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
121655074dd0SmrgAC_SUBST([MAN_SUBSTS])
1217a1d141d5Smrg
121855074dd0Smrg]) # XORG_MANPAGE_SECTIONS
121955074dd0Smrg
122055074dd0Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
122155074dd0Smrg# ------------------------
122255074dd0Smrg# Minimum version: 1.7.0
122355074dd0Smrg#
122455074dd0Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
122555074dd0Smrg# provided by xorg-sgml-doctools, if installed.
122655074dd0SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
122755074dd0SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
122855074dd0SmrgXORG_SGML_PATH=
122955074dd0SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
123055074dd0Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
123155074dd0Smrg    [m4_ifval([$1],[:],
123255074dd0Smrg        [if test x"$cross_compiling" != x"yes" ; then
123355074dd0Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
123455074dd0Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
123555074dd0Smrg         fi])
123655074dd0Smrg    ])
123755074dd0Smrg
123855074dd0Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
123955074dd0Smrg# the path and the name of the doc stylesheet
124055074dd0Smrgif test "x$XORG_SGML_PATH" != "x" ; then
124155074dd0Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
124255074dd0Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
124355074dd0Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
124455074dd0Smrgelse
124555074dd0Smrg   AC_MSG_RESULT([no])
1246a1d141d5Smrgfi
1247a1d141d5Smrg
124855074dd0SmrgAC_SUBST(XORG_SGML_PATH)
124955074dd0SmrgAC_SUBST(STYLESHEET_SRCDIR)
125055074dd0SmrgAC_SUBST(XSL_STYLESHEET)
125155074dd0SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
125255074dd0Smrg]) # XORG_CHECK_SGML_DOCTOOLS
1253a1d141d5Smrg
125455074dd0Smrg# XORG_CHECK_LINUXDOC
125555074dd0Smrg# -------------------
125655074dd0Smrg# Minimum version: 1.0.0
12572ddb6cf1Smrg#
125855074dd0Smrg# Defines the variable MAKE_TEXT if the necessary tools and
125955074dd0Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
126055074dd0Smrg# Whether or not the necessary tools and files are found can be checked
126155074dd0Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
126255074dd0SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
126355074dd0SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
126455074dd0SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1265a1d141d5Smrg
126655074dd0SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1267a1d141d5Smrg
126855074dd0SmrgAC_MSG_CHECKING([whether to build documentation])
126955074dd0Smrg
127055074dd0Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
127155074dd0Smrg   BUILDDOC=yes
127255074dd0Smrgelse
127355074dd0Smrg   BUILDDOC=no
127455074dd0Smrgfi
1275a1d141d5Smrg
127655074dd0SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1277a1d141d5Smrg
127855074dd0SmrgAC_MSG_RESULT([$BUILDDOC])
1279a1d141d5Smrg
128055074dd0SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1281a1d141d5Smrg
128255074dd0Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
128355074dd0Smrg   BUILDPDFDOC=yes
128455074dd0Smrgelse
128555074dd0Smrg   BUILDPDFDOC=no
128655074dd0Smrgfi
1287a1d141d5Smrg
128855074dd0SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1289a1d141d5Smrg
129055074dd0SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1291a1d141d5Smrg
129255074dd0SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
129355074dd0SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
129455074dd0SmrgMAKE_PDF="$PS2PDF"
129555074dd0SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
129655074dd0Smrg
129755074dd0SmrgAC_SUBST(MAKE_TEXT)
129855074dd0SmrgAC_SUBST(MAKE_PS)
129955074dd0SmrgAC_SUBST(MAKE_PDF)
130055074dd0SmrgAC_SUBST(MAKE_HTML)
130155074dd0Smrg]) # XORG_CHECK_LINUXDOC
130255074dd0Smrg
130355074dd0Smrg# XORG_CHECK_DOCBOOK
130455074dd0Smrg# -------------------
130555074dd0Smrg# Minimum version: 1.0.0
13062ddb6cf1Smrg#
130755074dd0Smrg# Checks for the ability to build output formats from SGML DocBook source.
130855074dd0Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
130955074dd0Smrg# indicates whether the necessary tools and files are found and, if set,
131055074dd0Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
131155074dd0SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
131255074dd0SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
13132ddb6cf1Smrg
131455074dd0SmrgBUILDTXTDOC=no
131555074dd0SmrgBUILDPDFDOC=no
131655074dd0SmrgBUILDPSDOC=no
131755074dd0SmrgBUILDHTMLDOC=no
13182ddb6cf1Smrg
131955074dd0SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
132055074dd0SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
132155074dd0SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
132255074dd0SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
13232ddb6cf1Smrg
132455074dd0SmrgAC_MSG_CHECKING([whether to build text documentation])
132555074dd0Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
132655074dd0Smrg   test x$BUILD_TXTDOC != xno; then
132755074dd0Smrg	BUILDTXTDOC=yes
13282ddb6cf1Smrgfi
132955074dd0SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
133055074dd0SmrgAC_MSG_RESULT([$BUILDTXTDOC])
13312ddb6cf1Smrg
133255074dd0SmrgAC_MSG_CHECKING([whether to build PDF documentation])
133355074dd0Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
133455074dd0Smrg   test x$BUILD_PDFDOC != xno; then
133555074dd0Smrg	BUILDPDFDOC=yes
13362ddb6cf1Smrgfi
133755074dd0SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
133855074dd0SmrgAC_MSG_RESULT([$BUILDPDFDOC])
13392ddb6cf1Smrg
134055074dd0SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
134155074dd0Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
134255074dd0Smrg   test x$BUILD_PSDOC != xno; then
134355074dd0Smrg	BUILDPSDOC=yes
134455074dd0Smrgfi
134555074dd0SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
134655074dd0SmrgAC_MSG_RESULT([$BUILDPSDOC])
13472ddb6cf1Smrg
134855074dd0SmrgAC_MSG_CHECKING([whether to build HTML documentation])
134955074dd0Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
135055074dd0Smrg   test x$BUILD_HTMLDOC != xno; then
135155074dd0Smrg	BUILDHTMLDOC=yes
135255074dd0Smrgfi
135355074dd0SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
135455074dd0SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
13552ddb6cf1Smrg
135655074dd0SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
135755074dd0SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
135855074dd0SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
135955074dd0SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
13602ddb6cf1Smrg
136155074dd0SmrgAC_SUBST(MAKE_TEXT)
136255074dd0SmrgAC_SUBST(MAKE_PS)
136355074dd0SmrgAC_SUBST(MAKE_PDF)
136455074dd0SmrgAC_SUBST(MAKE_HTML)
136555074dd0Smrg]) # XORG_CHECK_DOCBOOK
13662ddb6cf1Smrg
136755074dd0Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
136855074dd0Smrg# ----------------
136955074dd0Smrg# Minimum version: 1.5.0
137055074dd0Smrg# Minimum version for optional DEFAULT argument: 1.11.0
137155074dd0Smrg#
137255074dd0Smrg# Documentation tools are not always available on all platforms and sometimes
137355074dd0Smrg# not at the appropriate level. This macro enables a module to test for the
137455074dd0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
137555074dd0Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
137655074dd0Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
137755074dd0Smrg# --with-xmlto assumes 'auto'.
137855074dd0Smrg#
137955074dd0Smrg# Interface to module:
138055074dd0Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
138155074dd0Smrg# XMLTO:	returns the path of the xmlto program found
138255074dd0Smrg#		returns the path set by the user in the environment
138355074dd0Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
138455074dd0Smrg#		'no' user instructs the module not to use xmlto
138555074dd0Smrg#
138655074dd0Smrg# Added in version 1.10.0
138755074dd0Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
138855074dd0Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
138955074dd0Smrg#
139055074dd0Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
139155074dd0Smrg#
139255074dd0SmrgAC_DEFUN([XORG_WITH_XMLTO],[
139355074dd0SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
139455074dd0Smrgm4_define([_defopt], m4_default([$2], [auto]))
139555074dd0SmrgAC_ARG_WITH(xmlto,
139655074dd0Smrg	AS_HELP_STRING([--with-xmlto],
139755074dd0Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
139855074dd0Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
139955074dd0Smrgm4_undefine([_defopt])
140055074dd0Smrg
140155074dd0Smrgif test "x$use_xmlto" = x"auto"; then
140255074dd0Smrg   AC_PATH_PROG([XMLTO], [xmlto])
140355074dd0Smrg   if test "x$XMLTO" = "x"; then
140455074dd0Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
140555074dd0Smrg	have_xmlto=no
140655074dd0Smrg   else
140755074dd0Smrg        have_xmlto=yes
140855074dd0Smrg   fi
140955074dd0Smrgelif test "x$use_xmlto" = x"yes" ; then
141055074dd0Smrg   AC_PATH_PROG([XMLTO], [xmlto])
141155074dd0Smrg   if test "x$XMLTO" = "x"; then
141255074dd0Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
141355074dd0Smrg   fi
141455074dd0Smrg   have_xmlto=yes
141555074dd0Smrgelif test "x$use_xmlto" = x"no" ; then
141655074dd0Smrg   if test "x$XMLTO" != "x"; then
141755074dd0Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
141855074dd0Smrg   fi
141955074dd0Smrg   have_xmlto=no
142055074dd0Smrgelse
142155074dd0Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
142255074dd0Smrgfi
14232ddb6cf1Smrg
142455074dd0Smrg# Test for a minimum version of xmlto, if provided.
142555074dd0Smrgm4_ifval([$1],
142655074dd0Smrg[if test "$have_xmlto" = yes; then
142755074dd0Smrg    # scrape the xmlto version
142855074dd0Smrg    AC_MSG_CHECKING([the xmlto version])
142955074dd0Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
143055074dd0Smrg    AC_MSG_RESULT([$xmlto_version])
143155074dd0Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
143255074dd0Smrg        [if test "x$use_xmlto" = xauto; then
143355074dd0Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
143455074dd0Smrg            have_xmlto=no
143555074dd0Smrg        else
143655074dd0Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
143755074dd0Smrg        fi])
143855074dd0Smrgfi])
14392ddb6cf1Smrg
144055074dd0Smrg# Test for the ability of xmlto to generate a text target
144155074dd0Smrghave_xmlto_text=no
144255074dd0Smrgcat > conftest.xml << "EOF"
144355074dd0SmrgEOF
144455074dd0SmrgAS_IF([test "$have_xmlto" = yes],
144555074dd0Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
144655074dd0Smrg             [have_xmlto_text=yes],
144755074dd0Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
144855074dd0Smrgrm -f conftest.xml
144955074dd0SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
145055074dd0SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
145155074dd0Smrg]) # XORG_WITH_XMLTO
145255074dd0Smrg
145355074dd0Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
145455074dd0Smrg# ----------------
145555074dd0Smrg# Minimum version: 1.5.0
145655074dd0Smrg# Minimum version for optional DEFAULT argument: 1.11.0
14572ddb6cf1Smrg#
145855074dd0Smrg# Documentation tools are not always available on all platforms and sometimes
145955074dd0Smrg# not at the appropriate level. This macro enables a module to test for the
146055074dd0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
146155074dd0Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
146255074dd0Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
146355074dd0Smrg# --with-asciidoc assumes 'auto'.
146455074dd0Smrg#
146555074dd0Smrg# Interface to module:
146655074dd0Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
146755074dd0Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
146855074dd0Smrg#		 returns the path set by the user in the environment
146955074dd0Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
147055074dd0Smrg#		  'no' user instructs the module not to use asciidoc
147155074dd0Smrg#
147255074dd0Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
147355074dd0Smrg#
147455074dd0SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
147555074dd0SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
147655074dd0Smrgm4_define([_defopt], m4_default([$2], [auto]))
147755074dd0SmrgAC_ARG_WITH(asciidoc,
147855074dd0Smrg	AS_HELP_STRING([--with-asciidoc],
147955074dd0Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
148055074dd0Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
148155074dd0Smrgm4_undefine([_defopt])
148255074dd0Smrg
148355074dd0Smrgif test "x$use_asciidoc" = x"auto"; then
148455074dd0Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
148555074dd0Smrg   if test "x$ASCIIDOC" = "x"; then
148655074dd0Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
148755074dd0Smrg	have_asciidoc=no
148855074dd0Smrg   else
148955074dd0Smrg        have_asciidoc=yes
149055074dd0Smrg   fi
149155074dd0Smrgelif test "x$use_asciidoc" = x"yes" ; then
149255074dd0Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
149355074dd0Smrg   if test "x$ASCIIDOC" = "x"; then
149455074dd0Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
149555074dd0Smrg   fi
149655074dd0Smrg   have_asciidoc=yes
149755074dd0Smrgelif test "x$use_asciidoc" = x"no" ; then
149855074dd0Smrg   if test "x$ASCIIDOC" != "x"; then
149955074dd0Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
150055074dd0Smrg   fi
150155074dd0Smrg   have_asciidoc=no
150255074dd0Smrgelse
150355074dd0Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
15042ddb6cf1Smrgfi
150555074dd0Smrgm4_ifval([$1],
150655074dd0Smrg[if test "$have_asciidoc" = yes; then
150755074dd0Smrg    # scrape the asciidoc version
150855074dd0Smrg    AC_MSG_CHECKING([the asciidoc version])
150955074dd0Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
151055074dd0Smrg    AC_MSG_RESULT([$asciidoc_version])
151155074dd0Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
151255074dd0Smrg        [if test "x$use_asciidoc" = xauto; then
151355074dd0Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
151455074dd0Smrg            have_asciidoc=no
151555074dd0Smrg        else
151655074dd0Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
151755074dd0Smrg        fi])
151855074dd0Smrgfi])
151955074dd0SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
152055074dd0Smrg]) # XORG_WITH_ASCIIDOC
15212ddb6cf1Smrg
152255074dd0Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
152355074dd0Smrg# --------------------------------
152455074dd0Smrg# Minimum version: 1.5.0
152555074dd0Smrg# Minimum version for optional DEFAULT argument: 1.11.0
15262ddb6cf1Smrg#
152755074dd0Smrg# Documentation tools are not always available on all platforms and sometimes
152855074dd0Smrg# not at the appropriate level. This macro enables a module to test for the
152955074dd0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
153055074dd0Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
153155074dd0Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
153255074dd0Smrg# --with-doxygen assumes 'auto'.
153355074dd0Smrg#
153455074dd0Smrg# Interface to module:
153555074dd0Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
153655074dd0Smrg# DOXYGEN:	 returns the path of the doxygen program found
153755074dd0Smrg#		 returns the path set by the user in the environment
153855074dd0Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
153955074dd0Smrg#		  'no' user instructs the module not to use doxygen
154055074dd0Smrg#
154155074dd0Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
154255074dd0Smrg#
154355074dd0SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
154455074dd0SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
154555074dd0Smrgm4_define([_defopt], m4_default([$2], [auto]))
154655074dd0SmrgAC_ARG_WITH(doxygen,
154755074dd0Smrg	AS_HELP_STRING([--with-doxygen],
154855074dd0Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
154955074dd0Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
155055074dd0Smrgm4_undefine([_defopt])
155155074dd0Smrg
155255074dd0Smrgif test "x$use_doxygen" = x"auto"; then
155355074dd0Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
155455074dd0Smrg   if test "x$DOXYGEN" = "x"; then
155555074dd0Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
155655074dd0Smrg	have_doxygen=no
155755074dd0Smrg   else
155855074dd0Smrg        have_doxygen=yes
155955074dd0Smrg   fi
156055074dd0Smrgelif test "x$use_doxygen" = x"yes" ; then
156155074dd0Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
156255074dd0Smrg   if test "x$DOXYGEN" = "x"; then
156355074dd0Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
156455074dd0Smrg   fi
156555074dd0Smrg   have_doxygen=yes
156655074dd0Smrgelif test "x$use_doxygen" = x"no" ; then
156755074dd0Smrg   if test "x$DOXYGEN" != "x"; then
156855074dd0Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
156955074dd0Smrg   fi
157055074dd0Smrg   have_doxygen=no
157155074dd0Smrgelse
157255074dd0Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
157355074dd0Smrgfi
157455074dd0Smrgm4_ifval([$1],
157555074dd0Smrg[if test "$have_doxygen" = yes; then
157655074dd0Smrg    # scrape the doxygen version
157755074dd0Smrg    AC_MSG_CHECKING([the doxygen version])
157855074dd0Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
157955074dd0Smrg    AC_MSG_RESULT([$doxygen_version])
158055074dd0Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
158155074dd0Smrg        [if test "x$use_doxygen" = xauto; then
158255074dd0Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
158355074dd0Smrg            have_doxygen=no
158455074dd0Smrg        else
158555074dd0Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
158655074dd0Smrg        fi])
158755074dd0Smrgfi])
158855074dd0SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
158955074dd0Smrg]) # XORG_WITH_DOXYGEN
1590a1d141d5Smrg
159155074dd0Smrg# XORG_WITH_GROFF([DEFAULT])
159255074dd0Smrg# ----------------
159355074dd0Smrg# Minimum version: 1.6.0
159455074dd0Smrg# Minimum version for optional DEFAULT argument: 1.11.0
159555074dd0Smrg#
159655074dd0Smrg# Documentation tools are not always available on all platforms and sometimes
159755074dd0Smrg# not at the appropriate level. This macro enables a module to test for the
159855074dd0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
159955074dd0Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
160055074dd0Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
160155074dd0Smrg# --with-groff assumes 'auto'.
160255074dd0Smrg#
160355074dd0Smrg# Interface to module:
160455074dd0Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
160555074dd0Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
160655074dd0Smrg# HAVE_GROFF_MS: the -ms macros package
160755074dd0Smrg# GROFF:	 returns the path of the groff program found
160855074dd0Smrg#		 returns the path set by the user in the environment
160955074dd0Smrg# --with-groff:	 'yes' user instructs the module to use groff
161055074dd0Smrg#		 'no' user instructs the module not to use groff
161155074dd0Smrg#
161255074dd0Smrg# Added in version 1.9.0:
161355074dd0Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
161455074dd0Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
161555074dd0Smrg#		   psselect from the psutils package.
161655074dd0Smrg#		   the ghostcript package. Refer to the grohtml man pages
161755074dd0Smrg#
161855074dd0Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
161955074dd0Smrg#
162055074dd0Smrg# OS and distros often splits groff in a basic and full package, the former
162155074dd0Smrg# having the groff program and the later having devices, fonts and macros
162255074dd0Smrg# Checking for the groff executable is not enough.
162355074dd0Smrg#
162455074dd0Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
162555074dd0Smrg# unset HAVE_GROFF or GROFF env variables.
162655074dd0Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
162755074dd0Smrg#
162855074dd0SmrgAC_DEFUN([XORG_WITH_GROFF],[
162955074dd0SmrgAC_ARG_VAR([GROFF], [Path to groff command])
163055074dd0Smrgm4_define([_defopt], m4_default([$1], [auto]))
163155074dd0SmrgAC_ARG_WITH(groff,
163255074dd0Smrg	AS_HELP_STRING([--with-groff],
163355074dd0Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
163455074dd0Smrg	   [use_groff=$withval], [use_groff=]_defopt)
163555074dd0Smrgm4_undefine([_defopt])
163655074dd0Smrg
163755074dd0Smrgif test "x$use_groff" = x"auto"; then
163855074dd0Smrg   AC_PATH_PROG([GROFF], [groff])
163955074dd0Smrg   if test "x$GROFF" = "x"; then
164055074dd0Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
164155074dd0Smrg	have_groff=no
164255074dd0Smrg   else
164355074dd0Smrg        have_groff=yes
164455074dd0Smrg   fi
164555074dd0Smrgelif test "x$use_groff" = x"yes" ; then
164655074dd0Smrg   AC_PATH_PROG([GROFF], [groff])
164755074dd0Smrg   if test "x$GROFF" = "x"; then
164855074dd0Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
164955074dd0Smrg   fi
165055074dd0Smrg   have_groff=yes
165155074dd0Smrgelif test "x$use_groff" = x"no" ; then
165255074dd0Smrg   if test "x$GROFF" != "x"; then
165355074dd0Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
165455074dd0Smrg   fi
165555074dd0Smrg   have_groff=no
16562ddb6cf1Smrgelse
165755074dd0Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
16582ddb6cf1Smrgfi
16592ddb6cf1Smrg
166055074dd0Smrg# We have groff, test for the presence of the macro packages
166155074dd0Smrgif test "x$have_groff" = x"yes"; then
166255074dd0Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
166355074dd0Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
166455074dd0Smrg        groff_ms_works=yes
166555074dd0Smrg    else
166655074dd0Smrg        groff_ms_works=no
166755074dd0Smrg    fi
166855074dd0Smrg    AC_MSG_RESULT([$groff_ms_works])
166955074dd0Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
167055074dd0Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
167155074dd0Smrg        groff_mm_works=yes
167255074dd0Smrg    else
167355074dd0Smrg        groff_mm_works=no
167455074dd0Smrg    fi
167555074dd0Smrg    AC_MSG_RESULT([$groff_mm_works])
167655074dd0Smrgfi
16772ddb6cf1Smrg
167855074dd0Smrg# We have groff, test for HTML dependencies, one command per package
167955074dd0Smrgif test "x$have_groff" = x"yes"; then
168055074dd0Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
168155074dd0Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
168255074dd0Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
168355074dd0Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
168455074dd0Smrg      have_groff_html=yes
168555074dd0Smrg   else
168655074dd0Smrg      have_groff_html=no
168755074dd0Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
168855074dd0Smrg   fi
168955074dd0Smrgfi
16902ddb6cf1Smrg
169155074dd0Smrg# Set Automake conditionals for Makefiles
169255074dd0SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
169355074dd0SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
169455074dd0SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
169555074dd0SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
169655074dd0Smrg]) # XORG_WITH_GROFF
16972ddb6cf1Smrg
169855074dd0Smrg# XORG_WITH_FOP([DEFAULT])
169955074dd0Smrg# ----------------
170055074dd0Smrg# Minimum version: 1.6.0
170155074dd0Smrg# Minimum version for optional DEFAULT argument: 1.11.0
170255074dd0Smrg#
170355074dd0Smrg# Documentation tools are not always available on all platforms and sometimes
170455074dd0Smrg# not at the appropriate level. This macro enables a module to test for the
170555074dd0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
170655074dd0Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
170755074dd0Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
170855074dd0Smrg# --with-fop assumes 'auto'.
170955074dd0Smrg#
171055074dd0Smrg# Interface to module:
171155074dd0Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
171255074dd0Smrg# FOP:	 	returns the path of the fop program found
171355074dd0Smrg#		returns the path set by the user in the environment
171455074dd0Smrg# --with-fop: 	'yes' user instructs the module to use fop
171555074dd0Smrg#		'no' user instructs the module not to use fop
171655074dd0Smrg#
171755074dd0Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
171855074dd0Smrg#
171955074dd0SmrgAC_DEFUN([XORG_WITH_FOP],[
172055074dd0SmrgAC_ARG_VAR([FOP], [Path to fop command])
172155074dd0Smrgm4_define([_defopt], m4_default([$1], [auto]))
172255074dd0SmrgAC_ARG_WITH(fop,
172355074dd0Smrg	AS_HELP_STRING([--with-fop],
172455074dd0Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
172555074dd0Smrg	   [use_fop=$withval], [use_fop=]_defopt)
172655074dd0Smrgm4_undefine([_defopt])
172755074dd0Smrg
172855074dd0Smrgif test "x$use_fop" = x"auto"; then
172955074dd0Smrg   AC_PATH_PROG([FOP], [fop])
173055074dd0Smrg   if test "x$FOP" = "x"; then
173155074dd0Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
173255074dd0Smrg	have_fop=no
173355074dd0Smrg   else
173455074dd0Smrg        have_fop=yes
173555074dd0Smrg   fi
173655074dd0Smrgelif test "x$use_fop" = x"yes" ; then
173755074dd0Smrg   AC_PATH_PROG([FOP], [fop])
173855074dd0Smrg   if test "x$FOP" = "x"; then
173955074dd0Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
174055074dd0Smrg   fi
174155074dd0Smrg   have_fop=yes
174255074dd0Smrgelif test "x$use_fop" = x"no" ; then
174355074dd0Smrg   if test "x$FOP" != "x"; then
174455074dd0Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
174555074dd0Smrg   fi
174655074dd0Smrg   have_fop=no
174755074dd0Smrgelse
174855074dd0Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
174955074dd0Smrgfi
175055074dd0SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
175155074dd0Smrg]) # XORG_WITH_FOP
17522ddb6cf1Smrg
175355074dd0Smrg# XORG_WITH_PS2PDF([DEFAULT])
175455074dd0Smrg# ----------------
175555074dd0Smrg# Minimum version: 1.6.0
175655074dd0Smrg# Minimum version for optional DEFAULT argument: 1.11.0
175755074dd0Smrg#
175855074dd0Smrg# Documentation tools are not always available on all platforms and sometimes
175955074dd0Smrg# not at the appropriate level. This macro enables a module to test for the
176055074dd0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
176155074dd0Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
176255074dd0Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
176355074dd0Smrg# --with-ps2pdf assumes 'auto'.
176455074dd0Smrg#
176555074dd0Smrg# Interface to module:
176655074dd0Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
176755074dd0Smrg# PS2PDF:	returns the path of the ps2pdf program found
176855074dd0Smrg#		returns the path set by the user in the environment
176955074dd0Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
177055074dd0Smrg#		 'no' user instructs the module not to use ps2pdf
177155074dd0Smrg#
177255074dd0Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
177355074dd0Smrg#
177455074dd0SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
177555074dd0SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
177655074dd0Smrgm4_define([_defopt], m4_default([$1], [auto]))
177755074dd0SmrgAC_ARG_WITH(ps2pdf,
177855074dd0Smrg	AS_HELP_STRING([--with-ps2pdf],
177955074dd0Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
178055074dd0Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
178155074dd0Smrgm4_undefine([_defopt])
178255074dd0Smrg
178355074dd0Smrgif test "x$use_ps2pdf" = x"auto"; then
178455074dd0Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
178555074dd0Smrg   if test "x$PS2PDF" = "x"; then
178655074dd0Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
178755074dd0Smrg	have_ps2pdf=no
178855074dd0Smrg   else
178955074dd0Smrg        have_ps2pdf=yes
179055074dd0Smrg   fi
179155074dd0Smrgelif test "x$use_ps2pdf" = x"yes" ; then
179255074dd0Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
179355074dd0Smrg   if test "x$PS2PDF" = "x"; then
179455074dd0Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
179555074dd0Smrg   fi
179655074dd0Smrg   have_ps2pdf=yes
179755074dd0Smrgelif test "x$use_ps2pdf" = x"no" ; then
179855074dd0Smrg   if test "x$PS2PDF" != "x"; then
179955074dd0Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
180055074dd0Smrg   fi
180155074dd0Smrg   have_ps2pdf=no
180255074dd0Smrgelse
180355074dd0Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
180455074dd0Smrgfi
180555074dd0SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
180655074dd0Smrg]) # XORG_WITH_PS2PDF
18072ddb6cf1Smrg
180855074dd0Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
180955074dd0Smrg# ----------------
181055074dd0Smrg# Minimum version: 1.6.0
181155074dd0Smrg#
181255074dd0Smrg# Documentation tools are not always available on all platforms and sometimes
181355074dd0Smrg# not at the appropriate level. This macro enables a builder to skip all
181455074dd0Smrg# documentation targets except traditional man pages.
181555074dd0Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
181655074dd0Smrg# maximum flexibilty in controlling documentation building.
181755074dd0Smrg# Refer to:
181855074dd0Smrg# XORG_WITH_XMLTO         --with-xmlto
181955074dd0Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
182055074dd0Smrg# XORG_WITH_DOXYGEN       --with-doxygen
182155074dd0Smrg# XORG_WITH_FOP           --with-fop
182255074dd0Smrg# XORG_WITH_GROFF         --with-groff
182355074dd0Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
182455074dd0Smrg#
182555074dd0Smrg# Interface to module:
182655074dd0Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
182755074dd0Smrg# --enable-docs: 'yes' user instructs the module to generate docs
182855074dd0Smrg#		 'no' user instructs the module not to generate docs
182955074dd0Smrg# parm1:	specify the default value, yes or no.
183055074dd0Smrg#
183155074dd0SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
183255074dd0Smrgm4_define([docs_default], m4_default([$1], [yes]))
183355074dd0SmrgAC_ARG_ENABLE(docs,
183455074dd0Smrg	AS_HELP_STRING([--enable-docs],
183555074dd0Smrg	   [Enable building the documentation (default: ]docs_default[)]),
183655074dd0Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
183755074dd0Smrgm4_undefine([docs_default])
183855074dd0SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
183955074dd0SmrgAC_MSG_CHECKING([whether to build documentation])
184055074dd0SmrgAC_MSG_RESULT([$build_docs])
184155074dd0Smrg]) # XORG_ENABLE_DOCS
184255074dd0Smrg
184355074dd0Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
184455074dd0Smrg# ----------------
184555074dd0Smrg# Minimum version: 1.6.0
184655074dd0Smrg#
184755074dd0Smrg# This macro enables a builder to skip all developer documentation.
184855074dd0Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
184955074dd0Smrg# maximum flexibilty in controlling documentation building.
185055074dd0Smrg# Refer to:
185155074dd0Smrg# XORG_WITH_XMLTO         --with-xmlto
185255074dd0Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
185355074dd0Smrg# XORG_WITH_DOXYGEN       --with-doxygen
185455074dd0Smrg# XORG_WITH_FOP           --with-fop
185555074dd0Smrg# XORG_WITH_GROFF         --with-groff
185655074dd0Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
185755074dd0Smrg#
185855074dd0Smrg# Interface to module:
185955074dd0Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
186055074dd0Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
186155074dd0Smrg#			'no' user instructs the module not to generate developer docs
186255074dd0Smrg# parm1:		specify the default value, yes or no.
186355074dd0Smrg#
186455074dd0SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
186555074dd0Smrgm4_define([devel_default], m4_default([$1], [yes]))
186655074dd0SmrgAC_ARG_ENABLE(devel-docs,
186755074dd0Smrg	AS_HELP_STRING([--enable-devel-docs],
186855074dd0Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
186955074dd0Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
187055074dd0Smrgm4_undefine([devel_default])
187155074dd0SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
187255074dd0SmrgAC_MSG_CHECKING([whether to build developer documentation])
187355074dd0SmrgAC_MSG_RESULT([$build_devel_docs])
187455074dd0Smrg]) # XORG_ENABLE_DEVEL_DOCS
187555074dd0Smrg
187655074dd0Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
187755074dd0Smrg# ----------------
187855074dd0Smrg# Minimum version: 1.6.0
187955074dd0Smrg#
188055074dd0Smrg# This macro enables a builder to skip all functional specification targets.
188155074dd0Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
188255074dd0Smrg# maximum flexibilty in controlling documentation building.
188355074dd0Smrg# Refer to:
188455074dd0Smrg# XORG_WITH_XMLTO         --with-xmlto
188555074dd0Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
188655074dd0Smrg# XORG_WITH_DOXYGEN       --with-doxygen
188755074dd0Smrg# XORG_WITH_FOP           --with-fop
188855074dd0Smrg# XORG_WITH_GROFF         --with-groff
188955074dd0Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
189055074dd0Smrg#
189155074dd0Smrg# Interface to module:
189255074dd0Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
189355074dd0Smrg# --enable-specs:	'yes' user instructs the module to generate specs
189455074dd0Smrg#			'no' user instructs the module not to generate specs
189555074dd0Smrg# parm1:		specify the default value, yes or no.
189655074dd0Smrg#
189755074dd0SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
189855074dd0Smrgm4_define([spec_default], m4_default([$1], [yes]))
189955074dd0SmrgAC_ARG_ENABLE(specs,
190055074dd0Smrg	AS_HELP_STRING([--enable-specs],
190155074dd0Smrg	   [Enable building the specs (default: ]spec_default[)]),
190255074dd0Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
190355074dd0Smrgm4_undefine([spec_default])
190455074dd0SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
190555074dd0SmrgAC_MSG_CHECKING([whether to build functional specifications])
190655074dd0SmrgAC_MSG_RESULT([$build_specs])
190755074dd0Smrg]) # XORG_ENABLE_SPECS
19082ddb6cf1Smrg
190955074dd0Smrg# XORG_CHECK_MALLOC_ZERO
191055074dd0Smrg# ----------------------
191155074dd0Smrg# Minimum version: 1.0.0
19122ddb6cf1Smrg#
191355074dd0Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
191455074dd0Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
191555074dd0Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
191655074dd0SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
191755074dd0SmrgAC_ARG_ENABLE(malloc0returnsnull,
191855074dd0Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
191955074dd0Smrg		       [malloc(0) returns NULL (default: auto)]),
192055074dd0Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
192155074dd0Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
19222ddb6cf1Smrg
192355074dd0SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
192455074dd0Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
192555074dd0Smrg	AC_RUN_IFELSE([
192655074dd0Smrgchar *malloc();
192755074dd0Smrgchar *realloc();
192855074dd0Smrgchar *calloc();
192955074dd0Smrgmain() {
193055074dd0Smrg    char *m0, *r0, *c0, *p;
193155074dd0Smrg    m0 = malloc(0);
193255074dd0Smrg    p = malloc(10);
193355074dd0Smrg    r0 = realloc(p,0);
193455074dd0Smrg    c0 = calloc(0);
193555074dd0Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
193655074dd0Smrg}],
193755074dd0Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
193855074dd0Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
193955074dd0Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
194055074dd0Smrgfi
194155074dd0SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
19422ddb6cf1Smrg
194355074dd0Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
194455074dd0Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
194555074dd0Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
194655074dd0Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
194755074dd0Smrgelse
194855074dd0Smrg	MALLOC_ZERO_CFLAGS=""
194955074dd0Smrg	XMALLOC_ZERO_CFLAGS=""
195055074dd0Smrg	XTMALLOC_ZERO_CFLAGS=""
1951a1d141d5Smrgfi
1952a1d141d5Smrg
195355074dd0SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
195455074dd0SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
195555074dd0SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
195655074dd0Smrg]) # XORG_CHECK_MALLOC_ZERO
1957a1d141d5Smrg
195855074dd0Smrg# XORG_WITH_LINT()
195955074dd0Smrg# ----------------
196055074dd0Smrg# Minimum version: 1.1.0
19612ddb6cf1Smrg#
196255074dd0Smrg# This macro enables the use of a tool that flags some suspicious and
196355074dd0Smrg# non-portable constructs (likely to be bugs) in C language source code.
196455074dd0Smrg# It will attempt to locate the tool and use appropriate options.
196555074dd0Smrg# There are various lint type tools on different platforms.
196655074dd0Smrg#
196755074dd0Smrg# Interface to module:
196855074dd0Smrg# LINT:		returns the path to the tool found on the platform
196955074dd0Smrg#		or the value set to LINT on the configure cmd line
197055074dd0Smrg#		also an Automake conditional
197155074dd0Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
197255074dd0Smrg#
197355074dd0Smrg# --with-lint:	'yes' user instructs the module to use lint
197455074dd0Smrg#		'no' user instructs the module not to use lint (default)
197555074dd0Smrg#
197655074dd0Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
197755074dd0Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
197855074dd0Smrg#
197955074dd0SmrgAC_DEFUN([XORG_WITH_LINT],[
1980a1d141d5Smrg
198155074dd0SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
198255074dd0SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
198355074dd0SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
198455074dd0Smrg		[Use a lint-style source code checker (default: disabled)])],
198555074dd0Smrg		[use_lint=$withval], [use_lint=no])
1986a1d141d5Smrg
198755074dd0Smrg# Obtain platform specific info like program name and options
198855074dd0Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
198955074dd0Smrgcase $host_os in
199055074dd0Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
199155074dd0Smrg	lint_name=splint
199255074dd0Smrg	lint_options="-badflag"
199355074dd0Smrg	;;
199455074dd0Smrg  *freebsd* | *netbsd*)
199555074dd0Smrg	lint_name=lint
199655074dd0Smrg	lint_options="-u -b"
199755074dd0Smrg	;;
199855074dd0Smrg  *solaris*)
199955074dd0Smrg	lint_name=lint
200055074dd0Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
200155074dd0Smrg	;;
200255074dd0Smrgesac
2003a1d141d5Smrg
200455074dd0Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
200555074dd0Smrgif test "x$use_lint" = x"yes" ; then
200655074dd0Smrg   AC_PATH_PROG([LINT], [$lint_name])
200755074dd0Smrg   if test "x$LINT" = "x"; then
200855074dd0Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
200955074dd0Smrg   fi
201055074dd0Smrgelif test "x$use_lint" = x"no" ; then
201155074dd0Smrg   if test "x$LINT" != "x"; then
201255074dd0Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
201355074dd0Smrg   fi
2014a1d141d5Smrgelse
201555074dd0Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2016a1d141d5Smrgfi
2017a1d141d5Smrg
201855074dd0Smrg# User supplied flags override default flags
201955074dd0Smrgif test "x$LINT_FLAGS" != "x"; then
202055074dd0Smrg   lint_options=$LINT_FLAGS
202155074dd0Smrgfi
2022a1d141d5Smrg
202355074dd0SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
202455074dd0SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2025a1d141d5Smrg
202655074dd0Smrg]) # XORG_WITH_LINT
2027a1d141d5Smrg
202855074dd0Smrg# XORG_LINT_LIBRARY(LIBNAME)
202955074dd0Smrg# --------------------------
203055074dd0Smrg# Minimum version: 1.1.0
20312ddb6cf1Smrg#
203255074dd0Smrg# Sets up flags for building lint libraries for checking programs that call
203355074dd0Smrg# functions in the library.
203455074dd0Smrg#
203555074dd0Smrg# Interface to module:
203655074dd0Smrg# LINTLIB		- Automake variable with the name of lint library file to make
203755074dd0Smrg# MAKE_LINT_LIB		- Automake conditional
203855074dd0Smrg#
203955074dd0Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
204055074dd0Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2041a1d141d5Smrg
204255074dd0SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
204355074dd0SmrgAC_REQUIRE([XORG_WITH_LINT])
204455074dd0SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
204555074dd0Smrg	[Create lint library (default: disabled)])],
204655074dd0Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2047a1d141d5Smrg
204855074dd0Smrgif test "x$make_lint_lib" = x"yes" ; then
204955074dd0Smrg   LINTLIB=llib-l$1.ln
205055074dd0Smrg   if test "x$LINT" = "x"; then
205155074dd0Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
205255074dd0Smrg   fi
205355074dd0Smrgelif test "x$make_lint_lib" != x"no" ; then
205455074dd0Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
205555074dd0Smrgfi
2056a1d141d5Smrg
205755074dd0SmrgAC_SUBST(LINTLIB)
205855074dd0SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2059a1d141d5Smrg
206055074dd0Smrg]) # XORG_LINT_LIBRARY
2061a1d141d5Smrg
206255074dd0Smrg# XORG_CWARNFLAGS
206355074dd0Smrg# ---------------
206455074dd0Smrg# Minimum version: 1.2.0
206555074dd0Smrg#
206655074dd0Smrg# Defines CWARNFLAGS to enable C compiler warnings.
206755074dd0Smrg#
206855074dd0SmrgAC_DEFUN([XORG_CWARNFLAGS], [
206955074dd0SmrgAC_REQUIRE([AC_PROG_CC_C99])
207055074dd0Smrgif  test "x$GCC" = xyes ; then
207155074dd0Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
207255074dd0Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
207355074dd0Smrg-Wbad-function-cast -Wformat=2"
207455074dd0Smrg    case `$CC -dumpversion` in
207555074dd0Smrg    3.4.* | 4.*)
207655074dd0Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
207755074dd0Smrg	;;
207855074dd0Smrg    esac
207955074dd0Smrgelse
208055074dd0Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
208155074dd0Smrg    if test "x$SUNCC" = "xyes"; then
208255074dd0Smrg	CWARNFLAGS="-v"
208355074dd0Smrg    fi
208455074dd0Smrgfi
208555074dd0SmrgAC_SUBST(CWARNFLAGS)
208655074dd0Smrg]) # XORG_CWARNFLAGS
2087a1d141d5Smrg
208855074dd0Smrg# XORG_STRICT_OPTION
208955074dd0Smrg# -----------------------
209055074dd0Smrg# Minimum version: 1.3.0
209155074dd0Smrg#
209255074dd0Smrg# Add configure option to enable strict compilation
209355074dd0SmrgAC_DEFUN([XORG_STRICT_OPTION], [
209455074dd0Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
209555074dd0SmrgAC_REQUIRE([AC_PROG_CC_C99])
209655074dd0SmrgAC_REQUIRE([XORG_CWARNFLAGS])
2097a1d141d5Smrg
209855074dd0SmrgAC_ARG_ENABLE(strict-compilation,
209955074dd0Smrg			  AS_HELP_STRING([--enable-strict-compilation],
210055074dd0Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
210155074dd0Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
210255074dd0Smrgif test "x$STRICT_COMPILE" = "xyes"; then
210355074dd0Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
210455074dd0Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
210555074dd0Smrg	if test "x$GCC" = xyes ; then
210655074dd0Smrg		STRICT_CFLAGS="-pedantic -Werror"
210755074dd0Smrg	elif test "x$SUNCC" = "xyes"; then
210855074dd0Smrg		STRICT_CFLAGS="-errwarn"
210955074dd0Smrg    elif test "x$INTELCC" = "xyes"; then
211055074dd0Smrg		STRICT_CFLAGS="-Werror"
211155074dd0Smrg	fi
211255074dd0Smrgfi
211355074dd0SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
211455074dd0SmrgAC_SUBST([CWARNFLAGS])
211555074dd0Smrg]) # XORG_STRICT_OPTION
211655074dd0Smrg
211755074dd0Smrg# XORG_DEFAULT_OPTIONS
211855074dd0Smrg# --------------------
211955074dd0Smrg# Minimum version: 1.3.0
21202ddb6cf1Smrg#
212155074dd0Smrg# Defines default options for X.Org modules.
212255074dd0Smrg#
212355074dd0SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
212455074dd0SmrgAC_REQUIRE([AC_PROG_INSTALL])
212555074dd0SmrgXORG_CWARNFLAGS
212655074dd0SmrgXORG_STRICT_OPTION
212755074dd0SmrgXORG_RELEASE_VERSION
212855074dd0SmrgXORG_CHANGELOG
212955074dd0SmrgXORG_INSTALL
213055074dd0SmrgXORG_MANPAGE_SECTIONS
213155074dd0Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
213255074dd0Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
213355074dd0Smrg]) # XORG_DEFAULT_OPTIONS
2134a1d141d5Smrg
213555074dd0Smrg# XORG_INSTALL()
213655074dd0Smrg# ----------------
213755074dd0Smrg# Minimum version: 1.4.0
213855074dd0Smrg#
213955074dd0Smrg# Defines the variable INSTALL_CMD as the command to copy
214055074dd0Smrg# INSTALL from $prefix/share/util-macros.
214155074dd0Smrg#
214255074dd0SmrgAC_DEFUN([XORG_INSTALL], [
214355074dd0SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
214455074dd0Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
214555074dd0SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
214655074dd0Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
214755074dd0Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
214855074dd0Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
214955074dd0SmrgAC_SUBST([INSTALL_CMD])
215055074dd0Smrg]) # XORG_INSTALL
215155074dd0Smrgdnl Copyright 2005 Red Hat, Inc
215255074dd0Smrgdnl
215355074dd0Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
215455074dd0Smrgdnl documentation for any purpose is hereby granted without fee, provided that
215555074dd0Smrgdnl the above copyright notice appear in all copies and that both that
215655074dd0Smrgdnl copyright notice and this permission notice appear in supporting
215755074dd0Smrgdnl documentation.
215855074dd0Smrgdnl
215955074dd0Smrgdnl The above copyright notice and this permission notice shall be included
216055074dd0Smrgdnl in all copies or substantial portions of the Software.
216155074dd0Smrgdnl
216255074dd0Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
216355074dd0Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
216455074dd0Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
216555074dd0Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
216655074dd0Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
216755074dd0Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
216855074dd0Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
216955074dd0Smrgdnl
217055074dd0Smrgdnl Except as contained in this notice, the name of the copyright holders shall
217155074dd0Smrgdnl not be used in advertising or otherwise to promote the sale, use or
217255074dd0Smrgdnl other dealings in this Software without prior written authorization
217355074dd0Smrgdnl from the copyright holders.
217455074dd0Smrgdnl
2175a1d141d5Smrg
217655074dd0Smrg# XORG_RELEASE_VERSION
217755074dd0Smrg# --------------------
217855074dd0Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
217955074dd0Smrg 
218055074dd0SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
218155074dd0Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
218255074dd0Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
218355074dd0Smrg		[Major version of this package])
218455074dd0Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
218555074dd0Smrg	if test "x$PVM" = "x"; then
218655074dd0Smrg		PVM="0"
218755074dd0Smrg	fi
218855074dd0Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
218955074dd0Smrg		[$PVM],
219055074dd0Smrg		[Minor version of this package])
219155074dd0Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
219255074dd0Smrg	if test "x$PVP" = "x"; then
219355074dd0Smrg		PVP="0"
219455074dd0Smrg	fi
219555074dd0Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
219655074dd0Smrg		[$PVP],
219755074dd0Smrg		[Patch version of this package])
219855074dd0Smrg])
2199a1d141d5Smrg
220055074dd0Smrg# XORG_CHANGELOG()
220155074dd0Smrg# ----------------
220255074dd0Smrg# Minimum version: 1.2.0
220355074dd0Smrg#
220455074dd0Smrg# Defines the variable CHANGELOG_CMD as the command to generate
220555074dd0Smrg# ChangeLog from git.
220655074dd0Smrg#
220755074dd0Smrg#
220855074dd0SmrgAC_DEFUN([XORG_CHANGELOG], [
220955074dd0SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
221055074dd0Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
221155074dd0Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
221255074dd0Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
221355074dd0SmrgAC_SUBST([CHANGELOG_CMD])
221455074dd0Smrg]) # XORG_CHANGELOG
2215a1d141d5Smrg
221655074dd0Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
221755074dd0Smrg# 
221855074dd0Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
221955074dd0Smrg#
222055074dd0Smrg# This program is free software; you can redistribute it and/or modify
222155074dd0Smrg# it under the terms of the GNU General Public License as published by
222255074dd0Smrg# the Free Software Foundation; either version 2 of the License, or
222355074dd0Smrg# (at your option) any later version.
222455074dd0Smrg#
222555074dd0Smrg# This program is distributed in the hope that it will be useful, but
222655074dd0Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
222755074dd0Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
222855074dd0Smrg# General Public License for more details.
222955074dd0Smrg#
223055074dd0Smrg# You should have received a copy of the GNU General Public License
223155074dd0Smrg# along with this program; if not, write to the Free Software
223255074dd0Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
223355074dd0Smrg#
223455074dd0Smrg# As a special exception to the GNU General Public License, if you
223555074dd0Smrg# distribute this file as part of a program that contains a
223655074dd0Smrg# configuration script generated by Autoconf, you may include it under
223755074dd0Smrg# the same distribution terms that you use for the rest of that program.
2238a1d141d5Smrg
223955074dd0Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
224055074dd0Smrg# ----------------------------------
224155074dd0SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
224255074dd0Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
224355074dd0Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
224455074dd0SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
224555074dd0Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
224655074dd0Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
22472ddb6cf1Smrgfi
224855074dd0Smrgif test -n "$PKG_CONFIG"; then
224955074dd0Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
225055074dd0Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
225155074dd0Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
225255074dd0Smrg		AC_MSG_RESULT([yes])
225355074dd0Smrg	else
225455074dd0Smrg		AC_MSG_RESULT([no])
225555074dd0Smrg		PKG_CONFIG=""
225655074dd0Smrg	fi
225755074dd0Smrg		
225855074dd0Smrgfi[]dnl
225955074dd0Smrg])# PKG_PROG_PKG_CONFIG
2260a1d141d5Smrg
226155074dd0Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2262a1d141d5Smrg#
226355074dd0Smrg# Check to see whether a particular set of modules exists.  Similar
226455074dd0Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
226555074dd0Smrg#
226655074dd0Smrg#
226755074dd0Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
226855074dd0Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
226955074dd0Smrg# PKG_CHECK_EXISTS manually
227055074dd0Smrg# --------------------------------------------------------------
227155074dd0SmrgAC_DEFUN([PKG_CHECK_EXISTS],
227255074dd0Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
227355074dd0Smrgif test -n "$PKG_CONFIG" && \
227455074dd0Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
227555074dd0Smrg  m4_ifval([$2], [$2], [:])
227655074dd0Smrgm4_ifvaln([$3], [else
227755074dd0Smrg  $3])dnl
227855074dd0Smrgfi])
22792ddb6cf1Smrg
22802ddb6cf1Smrg
228155074dd0Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
228255074dd0Smrg# ---------------------------------------------
228355074dd0Smrgm4_define([_PKG_CONFIG],
228455074dd0Smrg[if test -n "$$1"; then
228555074dd0Smrg    pkg_cv_[]$1="$$1"
228655074dd0Smrg elif test -n "$PKG_CONFIG"; then
228755074dd0Smrg    PKG_CHECK_EXISTS([$3],
228855074dd0Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
228955074dd0Smrg		     [pkg_failed=yes])
229055074dd0Smrg else
229155074dd0Smrg    pkg_failed=untried
229255074dd0Smrgfi[]dnl
229355074dd0Smrg])# _PKG_CONFIG
22942ddb6cf1Smrg
229555074dd0Smrg# _PKG_SHORT_ERRORS_SUPPORTED
229655074dd0Smrg# -----------------------------
229755074dd0SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
229855074dd0Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
229955074dd0Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
230055074dd0Smrg        _pkg_short_errors_supported=yes
230155074dd0Smrgelse
230255074dd0Smrg        _pkg_short_errors_supported=no
230355074dd0Smrgfi[]dnl
230455074dd0Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
2305a1d141d5Smrg
2306a1d141d5Smrg
230755074dd0Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
230855074dd0Smrg# [ACTION-IF-NOT-FOUND])
2309a1d141d5Smrg#
231055074dd0Smrg#
231155074dd0Smrg# Note that if there is a possibility the first call to
231255074dd0Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
231355074dd0Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
231455074dd0Smrg#
231555074dd0Smrg#
231655074dd0Smrg# --------------------------------------------------------------
231755074dd0SmrgAC_DEFUN([PKG_CHECK_MODULES],
231855074dd0Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
231955074dd0SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
232055074dd0SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2321a1d141d5Smrg
232255074dd0Smrgpkg_failed=no
232355074dd0SmrgAC_MSG_CHECKING([for $1])
2324a1d141d5Smrg
232555074dd0Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
232655074dd0Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2327a1d141d5Smrg
232855074dd0Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
232955074dd0Smrgand $1[]_LIBS to avoid the need to call pkg-config.
233055074dd0SmrgSee the pkg-config man page for more details.])
2331a1d141d5Smrg
233255074dd0Smrgif test $pkg_failed = yes; then
233355074dd0Smrg        _PKG_SHORT_ERRORS_SUPPORTED
233455074dd0Smrg        if test $_pkg_short_errors_supported = yes; then
233555074dd0Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
233655074dd0Smrg        else 
233755074dd0Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
233855074dd0Smrg        fi
233955074dd0Smrg	# Put the nasty error message in config.log where it belongs
234055074dd0Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2341a1d141d5Smrg
234255074dd0Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
234355074dd0Smrg[Package requirements ($2) were not met:
23442ddb6cf1Smrg
234555074dd0Smrg$$1_PKG_ERRORS
23462ddb6cf1Smrg
234755074dd0SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
234855074dd0Smrginstalled software in a non-standard prefix.
2349a1d141d5Smrg
235055074dd0Smrg_PKG_TEXT
235155074dd0Smrg])],
235255074dd0Smrg		[AC_MSG_RESULT([no])
235355074dd0Smrg                $4])
235455074dd0Smrgelif test $pkg_failed = untried; then
235555074dd0Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
235655074dd0Smrg[The pkg-config script could not be found or is too old.  Make sure it
235755074dd0Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
235855074dd0Smrgpath to pkg-config.
2359a1d141d5Smrg
236055074dd0Smrg_PKG_TEXT
2361a1d141d5Smrg
236255074dd0SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
236355074dd0Smrg		[$4])
236455074dd0Smrgelse
236555074dd0Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
236655074dd0Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
236755074dd0Smrg        AC_MSG_RESULT([yes])
236855074dd0Smrg	ifelse([$3], , :, [$3])
236955074dd0Smrgfi[]dnl
237055074dd0Smrg])# PKG_CHECK_MODULES
2371a1d141d5Smrg
2372