aclocal.m4 revision 604a4f4c
1604a4f4cSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
21e00de39Smrg
31e00de39Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
421ecb1efSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
51e00de39Smrg# This file is free software; the Free Software Foundation
61e00de39Smrg# gives unlimited permission to copy and/or distribute it,
71e00de39Smrg# with or without modifications, as long as this notice is preserved.
81e00de39Smrg
91e00de39Smrg# This program is distributed in the hope that it will be useful,
101e00de39Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
111e00de39Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
121e00de39Smrg# PARTICULAR PURPOSE.
131e00de39Smrg
141e00de39Smrgm4_ifndef([AC_AUTOCONF_VERSION],
151e00de39Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16604a4f4cSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17604a4f4cSmrg[m4_warning([this file was generated for autoconf 2.68.
181e00de39SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
191e00de39SmrgIf you have problems, you may need to regenerate the build system entirely.
201e00de39SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
211e00de39Smrg
2221ecb1efSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
231e00de39Smrg#
2421ecb1efSmrg# This file is free software; the Free Software Foundation
2521ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
2621ecb1efSmrg# with or without modifications, as long as this notice is preserved.
271e00de39Smrg
2821ecb1efSmrg# AM_AUTOMAKE_VERSION(VERSION)
2921ecb1efSmrg# ----------------------------
3021ecb1efSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3121ecb1efSmrg# generated from the m4 files accompanying Automake X.Y.
3221ecb1efSmrg# (This private macro should not be called outside this file.)
3321ecb1efSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3421ecb1efSmrg[am__api_version='1.11'
3521ecb1efSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3621ecb1efSmrgdnl require some minimum version.  Point them to the right macro.
37604a4f4cSmrgm4_if([$1], [1.11.1], [],
3821ecb1efSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3921ecb1efSmrg])
401e00de39Smrg
4121ecb1efSmrg# _AM_AUTOCONF_VERSION(VERSION)
4221ecb1efSmrg# -----------------------------
4321ecb1efSmrg# aclocal traces this macro to find the Autoconf version.
4421ecb1efSmrg# This is a private macro too.  Using m4_define simplifies
4521ecb1efSmrg# the logic in aclocal, which can simply ignore this definition.
4621ecb1efSmrgm4_define([_AM_AUTOCONF_VERSION], [])
471e00de39Smrg
4821ecb1efSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
4921ecb1efSmrg# -------------------------------
5021ecb1efSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5121ecb1efSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5221ecb1efSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53604a4f4cSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
5421ecb1efSmrgm4_ifndef([AC_AUTOCONF_VERSION],
5521ecb1efSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5621ecb1efSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
571e00de39Smrg
5821ecb1efSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
591e00de39Smrg
6021ecb1efSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6121ecb1efSmrg#
6221ecb1efSmrg# This file is free software; the Free Software Foundation
6321ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
6421ecb1efSmrg# with or without modifications, as long as this notice is preserved.
651e00de39Smrg
6621ecb1efSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6721ecb1efSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6821ecb1efSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
691e00de39Smrg#
7021ecb1efSmrg# Of course, Automake must honor this variable whenever it calls a
7121ecb1efSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7221ecb1efSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7321ecb1efSmrg# depending on how configure is run.  This is pretty annoying, since
7421ecb1efSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7521ecb1efSmrg# source directory, any form will work fine, but in subdirectories a
7621ecb1efSmrg# relative path needs to be adjusted first.
771e00de39Smrg#
7821ecb1efSmrg# $ac_aux_dir/missing
7921ecb1efSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8021ecb1efSmrg# $top_srcdir/$ac_aux_dir/missing
8121ecb1efSmrg#    fails if $ac_aux_dir is absolute,
8221ecb1efSmrg#    fails when called from a subdirectory in a VPATH build with
8321ecb1efSmrg#          a relative $ac_aux_dir
841e00de39Smrg#
8521ecb1efSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8621ecb1efSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
8721ecb1efSmrg# harmless because $srcdir is `.', but things will broke when you
8821ecb1efSmrg# start a VPATH build or use an absolute $srcdir.
891e00de39Smrg#
9021ecb1efSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9121ecb1efSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9221ecb1efSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9321ecb1efSmrg# and then we would define $MISSING as
9421ecb1efSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9521ecb1efSmrg# This will work as long as MISSING is not called from configure, because
9621ecb1efSmrg# unfortunately $(top_srcdir) has no meaning in configure.
9721ecb1efSmrg# However there are other variables, like CC, which are often used in
9821ecb1efSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9921ecb1efSmrg#
10021ecb1efSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
10121ecb1efSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
10221ecb1efSmrg# configured tree to be moved without reconfiguration.
1031e00de39Smrg
10421ecb1efSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10521ecb1efSmrg[dnl Rely on autoconf to set up CDPATH properly.
10621ecb1efSmrgAC_PREREQ([2.50])dnl
10721ecb1efSmrg# expand $ac_aux_dir to an absolute path
10821ecb1efSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
10921ecb1efSmrg])
1101e00de39Smrg
11121ecb1efSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1121e00de39Smrg
11321ecb1efSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11421ecb1efSmrg# Free Software Foundation, Inc.
11521ecb1efSmrg#
11621ecb1efSmrg# This file is free software; the Free Software Foundation
11721ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
11821ecb1efSmrg# with or without modifications, as long as this notice is preserved.
1191e00de39Smrg
12021ecb1efSmrg# serial 9
1211e00de39Smrg
12221ecb1efSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12321ecb1efSmrg# -------------------------------------
12421ecb1efSmrg# Define a conditional.
12521ecb1efSmrgAC_DEFUN([AM_CONDITIONAL],
12621ecb1efSmrg[AC_PREREQ(2.52)dnl
12721ecb1efSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12821ecb1efSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12921ecb1efSmrgAC_SUBST([$1_TRUE])dnl
13021ecb1efSmrgAC_SUBST([$1_FALSE])dnl
13121ecb1efSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
13221ecb1efSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
13321ecb1efSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13421ecb1efSmrgif $2; then
13521ecb1efSmrg  $1_TRUE=
13621ecb1efSmrg  $1_FALSE='#'
13721ecb1efSmrgelse
13821ecb1efSmrg  $1_TRUE='#'
13921ecb1efSmrg  $1_FALSE=
14021ecb1efSmrgfi
14121ecb1efSmrgAC_CONFIG_COMMANDS_PRE(
14221ecb1efSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14321ecb1efSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14421ecb1efSmrgUsually this means the macro was only invoked conditionally.]])
14521ecb1efSmrgfi])])
1461e00de39Smrg
14721ecb1efSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
14821ecb1efSmrg# Free Software Foundation, Inc.
14921ecb1efSmrg#
15021ecb1efSmrg# This file is free software; the Free Software Foundation
15121ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
15221ecb1efSmrg# with or without modifications, as long as this notice is preserved.
1531e00de39Smrg
15421ecb1efSmrg# serial 10
1551e00de39Smrg
15621ecb1efSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
15721ecb1efSmrg# written in clear, in which case automake, when reading aclocal.m4,
15821ecb1efSmrg# will think it sees a *use*, and therefore will trigger all it's
15921ecb1efSmrg# C support machinery.  Also note that it means that autoscan, seeing
16021ecb1efSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1611e00de39Smrg
1621e00de39Smrg
16321ecb1efSmrg# _AM_DEPENDENCIES(NAME)
16421ecb1efSmrg# ----------------------
16521ecb1efSmrg# See how the compiler implements dependency checking.
16621ecb1efSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
16721ecb1efSmrg# We try a few techniques and use that to set a single cache variable.
1681e00de39Smrg#
16921ecb1efSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
17021ecb1efSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
17121ecb1efSmrg# dependency, and given that the user is not expected to run this macro,
17221ecb1efSmrg# just rely on AC_PROG_CC.
17321ecb1efSmrgAC_DEFUN([_AM_DEPENDENCIES],
17421ecb1efSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
17521ecb1efSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
17621ecb1efSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
17721ecb1efSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1781e00de39Smrg
17921ecb1efSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
18021ecb1efSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
18121ecb1efSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
18221ecb1efSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
18321ecb1efSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
18421ecb1efSmrg                   [depcc="$$1"   am_compiler_list=])
1851e00de39Smrg
18621ecb1efSmrgAC_CACHE_CHECK([dependency style of $depcc],
18721ecb1efSmrg               [am_cv_$1_dependencies_compiler_type],
18821ecb1efSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
18921ecb1efSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
19021ecb1efSmrg  # making bogus files that we don't know about and never remove.  For
19121ecb1efSmrg  # instance it was reported that on HP-UX the gcc test will end up
19221ecb1efSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
19321ecb1efSmrg  # in D'.
19421ecb1efSmrg  mkdir conftest.dir
19521ecb1efSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19621ecb1efSmrg  # using a relative directory.
19721ecb1efSmrg  cp "$am_depcomp" conftest.dir
19821ecb1efSmrg  cd conftest.dir
19921ecb1efSmrg  # We will build objects and dependencies in a subdirectory because
20021ecb1efSmrg  # it helps to detect inapplicable dependency modes.  For instance
20121ecb1efSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
20221ecb1efSmrg  # side effect of compilation, but ICC will put the dependencies in
20321ecb1efSmrg  # the current directory while Tru64 will put them in the object
20421ecb1efSmrg  # directory.
20521ecb1efSmrg  mkdir sub
20621ecb1efSmrg
20721ecb1efSmrg  am_cv_$1_dependencies_compiler_type=none
20821ecb1efSmrg  if test "$am_compiler_list" = ""; then
20921ecb1efSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
21021ecb1efSmrg  fi
21121ecb1efSmrg  am__universal=false
21221ecb1efSmrg  m4_case([$1], [CC],
21321ecb1efSmrg    [case " $depcc " in #(
21421ecb1efSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21521ecb1efSmrg     esac],
21621ecb1efSmrg    [CXX],
21721ecb1efSmrg    [case " $depcc " in #(
21821ecb1efSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21921ecb1efSmrg     esac])
22021ecb1efSmrg
22121ecb1efSmrg  for depmode in $am_compiler_list; do
22221ecb1efSmrg    # Setup a source with many dependencies, because some compilers
22321ecb1efSmrg    # like to wrap large dependency lists on column 80 (with \), and
22421ecb1efSmrg    # we should not choose a depcomp mode which is confused by this.
22521ecb1efSmrg    #
22621ecb1efSmrg    # We need to recreate these files for each test, as the compiler may
22721ecb1efSmrg    # overwrite some of them when testing with obscure command lines.
22821ecb1efSmrg    # This happens at least with the AIX C compiler.
22921ecb1efSmrg    : > sub/conftest.c
23021ecb1efSmrg    for i in 1 2 3 4 5 6; do
23121ecb1efSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23221ecb1efSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
23321ecb1efSmrg      # Solaris 8's {/usr,}/bin/sh.
23421ecb1efSmrg      touch sub/conftst$i.h
23521ecb1efSmrg    done
23621ecb1efSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
23721ecb1efSmrg
23821ecb1efSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
23921ecb1efSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
24021ecb1efSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
24121ecb1efSmrg    # versions had trouble with output in subdirs
24221ecb1efSmrg    am__obj=sub/conftest.${OBJEXT-o}
24321ecb1efSmrg    am__minus_obj="-o $am__obj"
24421ecb1efSmrg    case $depmode in
24521ecb1efSmrg    gcc)
24621ecb1efSmrg      # This depmode causes a compiler race in universal mode.
24721ecb1efSmrg      test "$am__universal" = false || continue
24821ecb1efSmrg      ;;
24921ecb1efSmrg    nosideeffect)
25021ecb1efSmrg      # after this tag, mechanisms are not by side-effect, so they'll
25121ecb1efSmrg      # only be used when explicitly requested
25221ecb1efSmrg      if test "x$enable_dependency_tracking" = xyes; then
25321ecb1efSmrg	continue
25421ecb1efSmrg      else
25521ecb1efSmrg	break
25621ecb1efSmrg      fi
25721ecb1efSmrg      ;;
25821ecb1efSmrg    msvisualcpp | msvcmsys)
25921ecb1efSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
26021ecb1efSmrg      # not run yet.  These depmodes are late enough in the game, and
26121ecb1efSmrg      # so weak that their functioning should not be impacted.
26221ecb1efSmrg      am__obj=conftest.${OBJEXT-o}
26321ecb1efSmrg      am__minus_obj=
26421ecb1efSmrg      ;;
26521ecb1efSmrg    none) break ;;
26621ecb1efSmrg    esac
26721ecb1efSmrg    if depmode=$depmode \
26821ecb1efSmrg       source=sub/conftest.c object=$am__obj \
26921ecb1efSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
27021ecb1efSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
27121ecb1efSmrg         >/dev/null 2>conftest.err &&
27221ecb1efSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
27321ecb1efSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27421ecb1efSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
27521ecb1efSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
27621ecb1efSmrg      # icc doesn't choke on unknown options, it will just issue warnings
27721ecb1efSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
27821ecb1efSmrg      # that says an option was ignored or not supported.
27921ecb1efSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
28021ecb1efSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
28121ecb1efSmrg      # The diagnosis changed in icc 8.0:
28221ecb1efSmrg      #   icc: Command line remark: option '-MP' not supported
28321ecb1efSmrg      if (grep 'ignoring option' conftest.err ||
28421ecb1efSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
28521ecb1efSmrg        am_cv_$1_dependencies_compiler_type=$depmode
28621ecb1efSmrg        break
28721ecb1efSmrg      fi
28821ecb1efSmrg    fi
28921ecb1efSmrg  done
29021ecb1efSmrg
29121ecb1efSmrg  cd ..
29221ecb1efSmrg  rm -rf conftest.dir
2931e00de39Smrgelse
29421ecb1efSmrg  am_cv_$1_dependencies_compiler_type=none
2951e00de39Smrgfi
29621ecb1efSmrg])
29721ecb1efSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
29821ecb1efSmrgAM_CONDITIONAL([am__fastdep$1], [
29921ecb1efSmrg  test "x$enable_dependency_tracking" != xno \
30021ecb1efSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
30121ecb1efSmrg])
3021e00de39Smrg
30321ecb1efSmrg
30421ecb1efSmrg# AM_SET_DEPDIR
30521ecb1efSmrg# -------------
30621ecb1efSmrg# Choose a directory name for dependency files.
30721ecb1efSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
30821ecb1efSmrgAC_DEFUN([AM_SET_DEPDIR],
30921ecb1efSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
31021ecb1efSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
31121ecb1efSmrg])
31221ecb1efSmrg
31321ecb1efSmrg
31421ecb1efSmrg# AM_DEP_TRACK
31521ecb1efSmrg# ------------
31621ecb1efSmrgAC_DEFUN([AM_DEP_TRACK],
31721ecb1efSmrg[AC_ARG_ENABLE(dependency-tracking,
31821ecb1efSmrg[  --disable-dependency-tracking  speeds up one-time build
31921ecb1efSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
32021ecb1efSmrgif test "x$enable_dependency_tracking" != xno; then
32121ecb1efSmrg  am_depcomp="$ac_aux_dir/depcomp"
32221ecb1efSmrg  AMDEPBACKSLASH='\'
3231e00de39Smrgfi
32421ecb1efSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
32521ecb1efSmrgAC_SUBST([AMDEPBACKSLASH])dnl
32621ecb1efSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
32721ecb1efSmrg])
3281e00de39Smrg
32921ecb1efSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
33021ecb1efSmrg
33121ecb1efSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33221ecb1efSmrg# Free Software Foundation, Inc.
3331e00de39Smrg#
33421ecb1efSmrg# This file is free software; the Free Software Foundation
33521ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
33621ecb1efSmrg# with or without modifications, as long as this notice is preserved.
3371e00de39Smrg
33821ecb1efSmrg#serial 5
3391e00de39Smrg
34021ecb1efSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
34121ecb1efSmrg# ------------------------------
34221ecb1efSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
34321ecb1efSmrg[{
34421ecb1efSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
34521ecb1efSmrg  # are listed without --file.  Let's play safe and only enable the eval
34621ecb1efSmrg  # if we detect the quoting.
34721ecb1efSmrg  case $CONFIG_FILES in
34821ecb1efSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
34921ecb1efSmrg  *)   set x $CONFIG_FILES ;;
35021ecb1efSmrg  esac
35121ecb1efSmrg  shift
35221ecb1efSmrg  for mf
35321ecb1efSmrg  do
35421ecb1efSmrg    # Strip MF so we end up with the name of the file.
35521ecb1efSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
35621ecb1efSmrg    # Check whether this is an Automake generated Makefile or not.
35721ecb1efSmrg    # We used to match only the files named `Makefile.in', but
35821ecb1efSmrg    # some people rename them; so instead we look at the file content.
35921ecb1efSmrg    # Grep'ing the first line is not enough: some people post-process
36021ecb1efSmrg    # each Makefile.in and add a new line on top of each file to say so.
36121ecb1efSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
36221ecb1efSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
36321ecb1efSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36421ecb1efSmrg      dirpart=`AS_DIRNAME("$mf")`
36521ecb1efSmrg    else
36621ecb1efSmrg      continue
36721ecb1efSmrg    fi
36821ecb1efSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
36921ecb1efSmrg    # from the Makefile without running `make'.
37021ecb1efSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
37121ecb1efSmrg    test -z "$DEPDIR" && continue
37221ecb1efSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
37321ecb1efSmrg    test -z "am__include" && continue
37421ecb1efSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37521ecb1efSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
37621ecb1efSmrg    U=`sed -n 's/^U = //p' < "$mf"`
37721ecb1efSmrg    # Find all dependency output files, they are included files with
37821ecb1efSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
37921ecb1efSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
38021ecb1efSmrg    # expansion.
38121ecb1efSmrg    for file in `sed -n "
38221ecb1efSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
38321ecb1efSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
38421ecb1efSmrg      # Make sure the directory exists.
38521ecb1efSmrg      test -f "$dirpart/$file" && continue
38621ecb1efSmrg      fdir=`AS_DIRNAME(["$file"])`
38721ecb1efSmrg      AS_MKDIR_P([$dirpart/$fdir])
38821ecb1efSmrg      # echo "creating $dirpart/$file"
38921ecb1efSmrg      echo '# dummy' > "$dirpart/$file"
39021ecb1efSmrg    done
39121ecb1efSmrg  done
39221ecb1efSmrg}
39321ecb1efSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3941e00de39Smrg
3951e00de39Smrg
39621ecb1efSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
39721ecb1efSmrg# -----------------------------
39821ecb1efSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
39921ecb1efSmrg#
40021ecb1efSmrg# This code is only required when automatic dependency tracking
40121ecb1efSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
40221ecb1efSmrg# need in order to bootstrap the dependency handling code.
40321ecb1efSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
40421ecb1efSmrg[AC_CONFIG_COMMANDS([depfiles],
40521ecb1efSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
40621ecb1efSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
40721ecb1efSmrg])
4081e00de39Smrg
40921ecb1efSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
41021ecb1efSmrg# Free Software Foundation, Inc.
41121ecb1efSmrg#
41221ecb1efSmrg# This file is free software; the Free Software Foundation
41321ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
41421ecb1efSmrg# with or without modifications, as long as this notice is preserved.
4151e00de39Smrg
41621ecb1efSmrg# serial 8
4171e00de39Smrg
41821ecb1efSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
41921ecb1efSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
42021ecb1efSmrg
42121ecb1efSmrg# Do all the work for Automake.                             -*- Autoconf -*-
42221ecb1efSmrg
42321ecb1efSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
42421ecb1efSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
42521ecb1efSmrg#
42621ecb1efSmrg# This file is free software; the Free Software Foundation
42721ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
42821ecb1efSmrg# with or without modifications, as long as this notice is preserved.
42921ecb1efSmrg
43021ecb1efSmrg# serial 16
43121ecb1efSmrg
43221ecb1efSmrg# This macro actually does too much.  Some checks are only needed if
43321ecb1efSmrg# your package does certain things.  But this isn't really a big deal.
43421ecb1efSmrg
43521ecb1efSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
43621ecb1efSmrg# AM_INIT_AUTOMAKE([OPTIONS])
43721ecb1efSmrg# -----------------------------------------------
43821ecb1efSmrg# The call with PACKAGE and VERSION arguments is the old style
43921ecb1efSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
44021ecb1efSmrg# and VERSION should now be passed to AC_INIT and removed from
44121ecb1efSmrg# the call to AM_INIT_AUTOMAKE.
44221ecb1efSmrg# We support both call styles for the transition.  After
44321ecb1efSmrg# the next Automake release, Autoconf can make the AC_INIT
44421ecb1efSmrg# arguments mandatory, and then we can depend on a new Autoconf
44521ecb1efSmrg# release and drop the old call support.
44621ecb1efSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
44721ecb1efSmrg[AC_PREREQ([2.62])dnl
44821ecb1efSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
44921ecb1efSmrgdnl the ones we care about.
45021ecb1efSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
45121ecb1efSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
45221ecb1efSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
45321ecb1efSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
45421ecb1efSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
45521ecb1efSmrg  # is not polluted with repeated "-I."
45621ecb1efSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
45721ecb1efSmrg  # test to see if srcdir already configured
45821ecb1efSmrg  if test -f $srcdir/config.status; then
45921ecb1efSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
46021ecb1efSmrg  fi
4611e00de39Smrgfi
46221ecb1efSmrg
46321ecb1efSmrg# test whether we have cygpath
46421ecb1efSmrgif test -z "$CYGPATH_W"; then
46521ecb1efSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
46621ecb1efSmrg    CYGPATH_W='cygpath -w'
46721ecb1efSmrg  else
46821ecb1efSmrg    CYGPATH_W=echo
46921ecb1efSmrg  fi
4701e00de39Smrgfi
47121ecb1efSmrgAC_SUBST([CYGPATH_W])
4721e00de39Smrg
47321ecb1efSmrg# Define the identity of the package.
47421ecb1efSmrgdnl Distinguish between old-style and new-style calls.
47521ecb1efSmrgm4_ifval([$2],
47621ecb1efSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
47721ecb1efSmrg AC_SUBST([PACKAGE], [$1])dnl
47821ecb1efSmrg AC_SUBST([VERSION], [$2])],
47921ecb1efSmrg[_AM_SET_OPTIONS([$1])dnl
48021ecb1efSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
48121ecb1efSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
48221ecb1efSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
48321ecb1efSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
48421ecb1efSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4851e00de39Smrg
48621ecb1efSmrg_AM_IF_OPTION([no-define],,
48721ecb1efSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
48821ecb1efSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4891e00de39Smrg
49021ecb1efSmrg# Some tools Automake needs.
49121ecb1efSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
49221ecb1efSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
49321ecb1efSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
49421ecb1efSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
49521ecb1efSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
49621ecb1efSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
49721ecb1efSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
49821ecb1efSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
49921ecb1efSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
50021ecb1efSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
50121ecb1efSmrg# We need awk for the "check" target.  The system "awk" is bad on
50221ecb1efSmrg# some platforms.
50321ecb1efSmrgAC_REQUIRE([AC_PROG_AWK])dnl
50421ecb1efSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
50521ecb1efSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
50621ecb1efSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
50721ecb1efSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
50821ecb1efSmrg			     [_AM_PROG_TAR([v7])])])
50921ecb1efSmrg_AM_IF_OPTION([no-dependencies],,
51021ecb1efSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
51121ecb1efSmrg		  [_AM_DEPENDENCIES(CC)],
51221ecb1efSmrg		  [define([AC_PROG_CC],
51321ecb1efSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
51421ecb1efSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
51521ecb1efSmrg		  [_AM_DEPENDENCIES(CXX)],
51621ecb1efSmrg		  [define([AC_PROG_CXX],
51721ecb1efSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
51821ecb1efSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
51921ecb1efSmrg		  [_AM_DEPENDENCIES(OBJC)],
52021ecb1efSmrg		  [define([AC_PROG_OBJC],
52121ecb1efSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
52221ecb1efSmrg])
52321ecb1efSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
52421ecb1efSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
52521ecb1efSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
52621ecb1efSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
52721ecb1efSmrgAC_CONFIG_COMMANDS_PRE(dnl
52821ecb1efSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
52921ecb1efSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
53021ecb1efSmrg])
5311e00de39Smrg
53221ecb1efSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
53321ecb1efSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
53421ecb1efSmrgdnl mangled by Autoconf and run in a shell conditional statement.
53521ecb1efSmrgm4_define([_AC_COMPILER_EXEEXT],
53621ecb1efSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5371e00de39Smrg
5381e00de39Smrg
53921ecb1efSmrg# When config.status generates a header, we must update the stamp-h file.
54021ecb1efSmrg# This file resides in the same directory as the config header
54121ecb1efSmrg# that is generated.  The stamp files are numbered to have different names.
54221ecb1efSmrg
54321ecb1efSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
54421ecb1efSmrg# loop where config.status creates the headers, so we can generate
54521ecb1efSmrg# our stamp files there.
54621ecb1efSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
54721ecb1efSmrg[# Compute $1's index in $config_headers.
54821ecb1efSmrg_am_arg=$1
54921ecb1efSmrg_am_stamp_count=1
55021ecb1efSmrgfor _am_header in $config_headers :; do
55121ecb1efSmrg  case $_am_header in
55221ecb1efSmrg    $_am_arg | $_am_arg:* )
55321ecb1efSmrg      break ;;
55421ecb1efSmrg    * )
55521ecb1efSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
55621ecb1efSmrg  esac
55721ecb1efSmrgdone
55821ecb1efSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
55921ecb1efSmrg
56021ecb1efSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
56121ecb1efSmrg#
56221ecb1efSmrg# This file is free software; the Free Software Foundation
56321ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
56421ecb1efSmrg# with or without modifications, as long as this notice is preserved.
5651e00de39Smrg
56621ecb1efSmrg# AM_PROG_INSTALL_SH
56721ecb1efSmrg# ------------------
56821ecb1efSmrg# Define $install_sh.
56921ecb1efSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
57021ecb1efSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
57121ecb1efSmrgif test x"${install_sh}" != xset; then
57221ecb1efSmrg  case $am_aux_dir in
57321ecb1efSmrg  *\ * | *\	*)
57421ecb1efSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
57521ecb1efSmrg  *)
57621ecb1efSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
57721ecb1efSmrg  esac
5781e00de39Smrgfi
57921ecb1efSmrgAC_SUBST(install_sh)])
5801e00de39Smrg
58121ecb1efSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
58221ecb1efSmrg#
58321ecb1efSmrg# This file is free software; the Free Software Foundation
58421ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
58521ecb1efSmrg# with or without modifications, as long as this notice is preserved.
5861e00de39Smrg
58721ecb1efSmrg# serial 2
5881e00de39Smrg
58921ecb1efSmrg# Check whether the underlying file-system supports filenames
59021ecb1efSmrg# with a leading dot.  For instance MS-DOS doesn't.
59121ecb1efSmrgAC_DEFUN([AM_SET_LEADING_DOT],
59221ecb1efSmrg[rm -rf .tst 2>/dev/null
59321ecb1efSmrgmkdir .tst 2>/dev/null
59421ecb1efSmrgif test -d .tst; then
59521ecb1efSmrg  am__leading_dot=.
5961e00de39Smrgelse
59721ecb1efSmrg  am__leading_dot=_
5981e00de39Smrgfi
59921ecb1efSmrgrmdir .tst 2>/dev/null
60021ecb1efSmrgAC_SUBST([am__leading_dot])])
6011e00de39Smrg
60221ecb1efSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
60321ecb1efSmrg# From Jim Meyering
6041e00de39Smrg
60521ecb1efSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
60621ecb1efSmrg# Free Software Foundation, Inc.
60721ecb1efSmrg#
60821ecb1efSmrg# This file is free software; the Free Software Foundation
60921ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
61021ecb1efSmrg# with or without modifications, as long as this notice is preserved.
6111e00de39Smrg
61221ecb1efSmrg# serial 5
6131e00de39Smrg
61421ecb1efSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
61521ecb1efSmrg# ----------------------------------
61621ecb1efSmrg# Control maintainer-specific portions of Makefiles.
61721ecb1efSmrg# Default is to disable them, unless `enable' is passed literally.
61821ecb1efSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
61921ecb1efSmrg# can override the default with the --enable/--disable switch.
62021ecb1efSmrgAC_DEFUN([AM_MAINTAINER_MODE],
62121ecb1efSmrg[m4_case(m4_default([$1], [disable]),
62221ecb1efSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
62321ecb1efSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
62421ecb1efSmrg       [m4_define([am_maintainer_other], [enable])
62521ecb1efSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
62621ecb1efSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
62721ecb1efSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
62821ecb1efSmrg  AC_ARG_ENABLE([maintainer-mode],
62921ecb1efSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
63021ecb1efSmrg			  (and sometimes confusing) to the casual installer],
63121ecb1efSmrg      [USE_MAINTAINER_MODE=$enableval],
63221ecb1efSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
63321ecb1efSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
63421ecb1efSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
63521ecb1efSmrg  MAINT=$MAINTAINER_MODE_TRUE
63621ecb1efSmrg  AC_SUBST([MAINT])dnl
63721ecb1efSmrg]
63821ecb1efSmrg)
6391e00de39Smrg
64021ecb1efSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
6411e00de39Smrg
64221ecb1efSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6431e00de39Smrg
64421ecb1efSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
64521ecb1efSmrg#
64621ecb1efSmrg# This file is free software; the Free Software Foundation
64721ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
64821ecb1efSmrg# with or without modifications, as long as this notice is preserved.
6491e00de39Smrg
65021ecb1efSmrg# serial 4
6511e00de39Smrg
65221ecb1efSmrg# AM_MAKE_INCLUDE()
65321ecb1efSmrg# -----------------
65421ecb1efSmrg# Check to see how make treats includes.
65521ecb1efSmrgAC_DEFUN([AM_MAKE_INCLUDE],
65621ecb1efSmrg[am_make=${MAKE-make}
65721ecb1efSmrgcat > confinc << 'END'
65821ecb1efSmrgam__doit:
65921ecb1efSmrg	@echo this is the am__doit target
66021ecb1efSmrg.PHONY: am__doit
66121ecb1efSmrgEND
66221ecb1efSmrg# If we don't find an include directive, just comment out the code.
66321ecb1efSmrgAC_MSG_CHECKING([for style of include used by $am_make])
66421ecb1efSmrgam__include="#"
66521ecb1efSmrgam__quote=
66621ecb1efSmrg_am_result=none
66721ecb1efSmrg# First try GNU make style include.
66821ecb1efSmrgecho "include confinc" > confmf
66921ecb1efSmrg# Ignore all kinds of additional output from `make'.
67021ecb1efSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
67121ecb1efSmrg*the\ am__doit\ target*)
67221ecb1efSmrg  am__include=include
67321ecb1efSmrg  am__quote=
67421ecb1efSmrg  _am_result=GNU
67521ecb1efSmrg  ;;
67621ecb1efSmrgesac
67721ecb1efSmrg# Now try BSD make style include.
67821ecb1efSmrgif test "$am__include" = "#"; then
67921ecb1efSmrg   echo '.include "confinc"' > confmf
68021ecb1efSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
68121ecb1efSmrg   *the\ am__doit\ target*)
68221ecb1efSmrg     am__include=.include
68321ecb1efSmrg     am__quote="\""
68421ecb1efSmrg     _am_result=BSD
68521ecb1efSmrg     ;;
68621ecb1efSmrg   esac
6871e00de39Smrgfi
68821ecb1efSmrgAC_SUBST([am__include])
68921ecb1efSmrgAC_SUBST([am__quote])
69021ecb1efSmrgAC_MSG_RESULT([$_am_result])
69121ecb1efSmrgrm -f confinc confmf
69221ecb1efSmrg])
6931e00de39Smrg
69421ecb1efSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6951e00de39Smrg
69621ecb1efSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
69721ecb1efSmrg# Free Software Foundation, Inc.
69821ecb1efSmrg#
69921ecb1efSmrg# This file is free software; the Free Software Foundation
70021ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
70121ecb1efSmrg# with or without modifications, as long as this notice is preserved.
7021e00de39Smrg
70321ecb1efSmrg# serial 6
7041e00de39Smrg
70521ecb1efSmrg# AM_MISSING_PROG(NAME, PROGRAM)
70621ecb1efSmrg# ------------------------------
70721ecb1efSmrgAC_DEFUN([AM_MISSING_PROG],
70821ecb1efSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
70921ecb1efSmrg$1=${$1-"${am_missing_run}$2"}
71021ecb1efSmrgAC_SUBST($1)])
7111e00de39Smrg
7121e00de39Smrg
71321ecb1efSmrg# AM_MISSING_HAS_RUN
71421ecb1efSmrg# ------------------
71521ecb1efSmrg# Define MISSING if not defined so far and test if it supports --run.
71621ecb1efSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
71721ecb1efSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
71821ecb1efSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
71921ecb1efSmrgAC_REQUIRE_AUX_FILE([missing])dnl
72021ecb1efSmrgif test x"${MISSING+set}" != xset; then
72121ecb1efSmrg  case $am_aux_dir in
72221ecb1efSmrg  *\ * | *\	*)
72321ecb1efSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
72421ecb1efSmrg  *)
72521ecb1efSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
72621ecb1efSmrg  esac
7271e00de39Smrgfi
72821ecb1efSmrg# Use eval to expand $SHELL
72921ecb1efSmrgif eval "$MISSING --run true"; then
73021ecb1efSmrg  am_missing_run="$MISSING --run "
7311e00de39Smrgelse
73221ecb1efSmrg  am_missing_run=
73321ecb1efSmrg  AC_MSG_WARN([`missing' script is too old or missing])
7341e00de39Smrgfi
73521ecb1efSmrg])
7361e00de39Smrg
73721ecb1efSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
7381e00de39Smrg#
73921ecb1efSmrg# This file is free software; the Free Software Foundation
74021ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
74121ecb1efSmrg# with or without modifications, as long as this notice is preserved.
7421e00de39Smrg
74321ecb1efSmrg# AM_PROG_MKDIR_P
74421ecb1efSmrg# ---------------
74521ecb1efSmrg# Check for `mkdir -p'.
74621ecb1efSmrgAC_DEFUN([AM_PROG_MKDIR_P],
74721ecb1efSmrg[AC_PREREQ([2.60])dnl
74821ecb1efSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
74921ecb1efSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
75021ecb1efSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
75121ecb1efSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
75221ecb1efSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
75321ecb1efSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
75421ecb1efSmrgdnl adjustment using top_builddir (which is defined more often than
75521ecb1efSmrgdnl MKDIR_P).
75621ecb1efSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
75721ecb1efSmrgcase $mkdir_p in
75821ecb1efSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
75921ecb1efSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
76021ecb1efSmrgesac
76121ecb1efSmrg])
7621e00de39Smrg
76321ecb1efSmrg# Helper functions for option handling.                     -*- Autoconf -*-
7641e00de39Smrg
76521ecb1efSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
7661e00de39Smrg#
76721ecb1efSmrg# This file is free software; the Free Software Foundation
76821ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
76921ecb1efSmrg# with or without modifications, as long as this notice is preserved.
7701e00de39Smrg
77121ecb1efSmrg# serial 4
7721e00de39Smrg
77321ecb1efSmrg# _AM_MANGLE_OPTION(NAME)
77421ecb1efSmrg# -----------------------
77521ecb1efSmrgAC_DEFUN([_AM_MANGLE_OPTION],
77621ecb1efSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7771e00de39Smrg
77821ecb1efSmrg# _AM_SET_OPTION(NAME)
77921ecb1efSmrg# ------------------------------
78021ecb1efSmrg# Set option NAME.  Presently that only means defining a flag for this option.
78121ecb1efSmrgAC_DEFUN([_AM_SET_OPTION],
78221ecb1efSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7831e00de39Smrg
78421ecb1efSmrg# _AM_SET_OPTIONS(OPTIONS)
78521ecb1efSmrg# ----------------------------------
78621ecb1efSmrg# OPTIONS is a space-separated list of Automake options.
78721ecb1efSmrgAC_DEFUN([_AM_SET_OPTIONS],
78821ecb1efSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
78921ecb1efSmrg
79021ecb1efSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
79121ecb1efSmrg# -------------------------------------------
79221ecb1efSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
79321ecb1efSmrgAC_DEFUN([_AM_IF_OPTION],
79421ecb1efSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
79521ecb1efSmrg
79621ecb1efSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7971e00de39Smrg
79821ecb1efSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
79921ecb1efSmrg# Free Software Foundation, Inc.
8001e00de39Smrg#
8011e00de39Smrg# This file is free software; the Free Software Foundation
8021e00de39Smrg# gives unlimited permission to copy and/or distribute it,
8031e00de39Smrg# with or without modifications, as long as this notice is preserved.
8041e00de39Smrg
80521ecb1efSmrg# serial 5
8061e00de39Smrg
80721ecb1efSmrg# AM_SANITY_CHECK
80821ecb1efSmrg# ---------------
80921ecb1efSmrgAC_DEFUN([AM_SANITY_CHECK],
81021ecb1efSmrg[AC_MSG_CHECKING([whether build environment is sane])
81121ecb1efSmrg# Just in case
81221ecb1efSmrgsleep 1
81321ecb1efSmrgecho timestamp > conftest.file
81421ecb1efSmrg# Reject unsafe characters in $srcdir or the absolute working directory
81521ecb1efSmrg# name.  Accept space and tab only in the latter.
81621ecb1efSmrgam_lf='
81721ecb1efSmrg'
81821ecb1efSmrgcase `pwd` in
81921ecb1efSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
82021ecb1efSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
82121ecb1efSmrgesac
82221ecb1efSmrgcase $srcdir in
82321ecb1efSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
82421ecb1efSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
82521ecb1efSmrgesac
8261e00de39Smrg
82721ecb1efSmrg# Do `set' in a subshell so we don't clobber the current shell's
82821ecb1efSmrg# arguments.  Must try -L first in case configure is actually a
82921ecb1efSmrg# symlink; some systems play weird games with the mod time of symlinks
83021ecb1efSmrg# (eg FreeBSD returns the mod time of the symlink's containing
83121ecb1efSmrg# directory).
83221ecb1efSmrgif (
83321ecb1efSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
83421ecb1efSmrg   if test "$[*]" = "X"; then
83521ecb1efSmrg      # -L didn't work.
83621ecb1efSmrg      set X `ls -t "$srcdir/configure" conftest.file`
83721ecb1efSmrg   fi
83821ecb1efSmrg   rm -f conftest.file
83921ecb1efSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
84021ecb1efSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8411e00de39Smrg
84221ecb1efSmrg      # If neither matched, then we have a broken ls.  This can happen
84321ecb1efSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
84421ecb1efSmrg      # broken ls alias from the environment.  This has actually
84521ecb1efSmrg      # happened.  Such a system could not be considered "sane".
84621ecb1efSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
84721ecb1efSmrgalias in your environment])
84821ecb1efSmrg   fi
8491e00de39Smrg
85021ecb1efSmrg   test "$[2]" = conftest.file
85121ecb1efSmrg   )
85221ecb1efSmrgthen
85321ecb1efSmrg   # Ok.
85421ecb1efSmrg   :
85521ecb1efSmrgelse
85621ecb1efSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
85721ecb1efSmrgCheck your system clock])
85821ecb1efSmrgfi
85921ecb1efSmrgAC_MSG_RESULT(yes)])
86021ecb1efSmrg
86121ecb1efSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
8621e00de39Smrg#
8631e00de39Smrg# This file is free software; the Free Software Foundation
8641e00de39Smrg# gives unlimited permission to copy and/or distribute it,
8651e00de39Smrg# with or without modifications, as long as this notice is preserved.
8661e00de39Smrg
86721ecb1efSmrg# serial 1
8681e00de39Smrg
86921ecb1efSmrg# AM_SILENT_RULES([DEFAULT])
87021ecb1efSmrg# --------------------------
87121ecb1efSmrg# Enable less verbose build rules; with the default set to DEFAULT
87221ecb1efSmrg# (`yes' being less verbose, `no' or empty being verbose).
87321ecb1efSmrgAC_DEFUN([AM_SILENT_RULES],
87421ecb1efSmrg[AC_ARG_ENABLE([silent-rules],
87521ecb1efSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
87621ecb1efSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
87721ecb1efSmrgcase $enable_silent_rules in
87821ecb1efSmrgyes) AM_DEFAULT_VERBOSITY=0;;
87921ecb1efSmrgno)  AM_DEFAULT_VERBOSITY=1;;
88021ecb1efSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
88121ecb1efSmrgesac
88221ecb1efSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
88321ecb1efSmrgAM_BACKSLASH='\'
88421ecb1efSmrgAC_SUBST([AM_BACKSLASH])dnl
88521ecb1efSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8861e00de39Smrg])
8871e00de39Smrg
88821ecb1efSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
88921ecb1efSmrg#
89021ecb1efSmrg# This file is free software; the Free Software Foundation
89121ecb1efSmrg# gives unlimited permission to copy and/or distribute it,
89221ecb1efSmrg# with or without modifications, as long as this notice is preserved.
89321ecb1efSmrg
89421ecb1efSmrg# AM_PROG_INSTALL_STRIP
89521ecb1efSmrg# ---------------------
89621ecb1efSmrg# One issue with vendor `install' (even GNU) is that you can't
89721ecb1efSmrg# specify the program used to strip binaries.  This is especially
89821ecb1efSmrg# annoying in cross-compiling environments, where the build's strip
89921ecb1efSmrg# is unlikely to handle the host's binaries.
90021ecb1efSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
90121ecb1efSmrg# always use install-sh in `make install-strip', and initialize
90221ecb1efSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
90321ecb1efSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
90421ecb1efSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
90521ecb1efSmrg# Installed binaries are usually stripped using `strip' when the user
90621ecb1efSmrg# run `make install-strip'.  However `strip' might not be the right
90721ecb1efSmrg# tool to use in cross-compilation environments, therefore Automake
90821ecb1efSmrg# will honor the `STRIP' environment variable to overrule this program.
90921ecb1efSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
91021ecb1efSmrgif test "$cross_compiling" != no; then
91121ecb1efSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
91221ecb1efSmrgfi
91321ecb1efSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
91421ecb1efSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9151e00de39Smrg
91621ecb1efSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9171e00de39Smrg#
9181e00de39Smrg# This file is free software; the Free Software Foundation
9191e00de39Smrg# gives unlimited permission to copy and/or distribute it,
9201e00de39Smrg# with or without modifications, as long as this notice is preserved.
9211e00de39Smrg
92221ecb1efSmrg# serial 2
9231e00de39Smrg
92421ecb1efSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
92521ecb1efSmrg# ---------------------------
92621ecb1efSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
92721ecb1efSmrg# This macro is traced by Automake.
92821ecb1efSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9291e00de39Smrg
93021ecb1efSmrg# AM_SUBST_NOTMAKE(VARIABLE)
93121ecb1efSmrg# ---------------------------
93221ecb1efSmrg# Public sister of _AM_SUBST_NOTMAKE.
93321ecb1efSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
93421ecb1efSmrg
93521ecb1efSmrg# Check how to create a tarball.                            -*- Autoconf -*-
93621ecb1efSmrg
93721ecb1efSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9381e00de39Smrg#
9391e00de39Smrg# This file is free software; the Free Software Foundation
9401e00de39Smrg# gives unlimited permission to copy and/or distribute it,
9411e00de39Smrg# with or without modifications, as long as this notice is preserved.
9421e00de39Smrg
94321ecb1efSmrg# serial 2
9441e00de39Smrg
94521ecb1efSmrg# _AM_PROG_TAR(FORMAT)
94621ecb1efSmrg# --------------------
94721ecb1efSmrg# Check how to create a tarball in format FORMAT.
94821ecb1efSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
9491e00de39Smrg#
95021ecb1efSmrg# Substitute a variable $(am__tar) that is a command
95121ecb1efSmrg# writing to stdout a FORMAT-tarball containing the directory
95221ecb1efSmrg# $tardir.
95321ecb1efSmrg#     tardir=directory && $(am__tar) > result.tar
95421ecb1efSmrg#
95521ecb1efSmrg# Substitute a variable $(am__untar) that extract such
95621ecb1efSmrg# a tarball read from stdin.
95721ecb1efSmrg#     $(am__untar) < result.tar
95821ecb1efSmrgAC_DEFUN([_AM_PROG_TAR],
95921ecb1efSmrg[# Always define AMTAR for backward compatibility.
96021ecb1efSmrgAM_MISSING_PROG([AMTAR], [tar])
96121ecb1efSmrgm4_if([$1], [v7],
96221ecb1efSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
96321ecb1efSmrg     [m4_case([$1], [ustar],, [pax],,
96421ecb1efSmrg              [m4_fatal([Unknown tar format])])
96521ecb1efSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
96621ecb1efSmrg# Loop over all known methods to create a tar archive until one works.
96721ecb1efSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
96821ecb1efSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
96921ecb1efSmrg# Do not fold the above two line into one, because Tru64 sh and
97021ecb1efSmrg# Solaris sh will not grok spaces in the rhs of `-'.
97121ecb1efSmrgfor _am_tool in $_am_tools
97221ecb1efSmrgdo
97321ecb1efSmrg  case $_am_tool in
97421ecb1efSmrg  gnutar)
97521ecb1efSmrg    for _am_tar in tar gnutar gtar;
97621ecb1efSmrg    do
97721ecb1efSmrg      AM_RUN_LOG([$_am_tar --version]) && break
97821ecb1efSmrg    done
97921ecb1efSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
98021ecb1efSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
98121ecb1efSmrg    am__untar="$_am_tar -xf -"
98221ecb1efSmrg    ;;
98321ecb1efSmrg  plaintar)
98421ecb1efSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
98521ecb1efSmrg    # ustar tarball either.
98621ecb1efSmrg    (tar --version) >/dev/null 2>&1 && continue
98721ecb1efSmrg    am__tar='tar chf - "$$tardir"'
98821ecb1efSmrg    am__tar_='tar chf - "$tardir"'
98921ecb1efSmrg    am__untar='tar xf -'
99021ecb1efSmrg    ;;
99121ecb1efSmrg  pax)
99221ecb1efSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
99321ecb1efSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
99421ecb1efSmrg    am__untar='pax -r'
99521ecb1efSmrg    ;;
99621ecb1efSmrg  cpio)
99721ecb1efSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
99821ecb1efSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
99921ecb1efSmrg    am__untar='cpio -i -H $1 -d'
100021ecb1efSmrg    ;;
100121ecb1efSmrg  none)
100221ecb1efSmrg    am__tar=false
100321ecb1efSmrg    am__tar_=false
100421ecb1efSmrg    am__untar=false
100521ecb1efSmrg    ;;
100621ecb1efSmrg  esac
10071e00de39Smrg
100821ecb1efSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
100921ecb1efSmrg  # and am__untar set.
101021ecb1efSmrg  test -n "${am_cv_prog_tar_$1}" && break
10111e00de39Smrg
101221ecb1efSmrg  # tar/untar a dummy directory, and stop if the command works
101321ecb1efSmrg  rm -rf conftest.dir
10141e00de39Smrg  mkdir conftest.dir
101521ecb1efSmrg  echo GrepMe > conftest.dir/file
101621ecb1efSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
101721ecb1efSmrg  rm -rf conftest.dir
101821ecb1efSmrg  if test -s conftest.tar; then
101921ecb1efSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
102021ecb1efSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
10211e00de39Smrg  fi
102221ecb1efSmrgdone
102321ecb1efSmrgrm -rf conftest.dir
102421ecb1efSmrg
102521ecb1efSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
102621ecb1efSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
102721ecb1efSmrgAC_SUBST([am__tar])
102821ecb1efSmrgAC_SUBST([am__untar])
102921ecb1efSmrg]) # _AM_PROG_TAR
103021ecb1efSmrg
103121ecb1efSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
103221ecb1efSmrgdnl
1033604a4f4cSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
103421ecb1efSmrgdnl 
103521ecb1efSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1036604a4f4cSmrgdnl copy of this software and associated documentation files (the "Software"),
1037604a4f4cSmrgdnl to deal in the Software without restriction, including without limitation
1038604a4f4cSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1039604a4f4cSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
1040604a4f4cSmrgdnl Software is furnished to do so, subject to the following conditions:
104121ecb1efSmrgdnl
1042604a4f4cSmrgdnl The above copyright notice and this permission notice (including the next
1043604a4f4cSmrgdnl paragraph) shall be included in all copies or substantial portions of the
1044604a4f4cSmrgdnl Software.
104521ecb1efSmrgdnl
1046604a4f4cSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1047604a4f4cSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1048604a4f4cSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1049604a4f4cSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1050604a4f4cSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1051604a4f4cSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1052604a4f4cSmrgdnl DEALINGS IN THE SOFTWARE.
105321ecb1efSmrg
105421ecb1efSmrg# XORG_MACROS_VERSION(required-version)
105521ecb1efSmrg# -------------------------------------
105621ecb1efSmrg# Minimum version: 1.1.0
105721ecb1efSmrg#
105821ecb1efSmrg# If you're using a macro added in Version 1.1 or newer, include this in
105921ecb1efSmrg# your configure.ac with the minimum required version, such as:
106021ecb1efSmrg# XORG_MACROS_VERSION(1.1)
106121ecb1efSmrg#
106221ecb1efSmrg# To ensure that this macro is defined, also add:
106321ecb1efSmrg# m4_ifndef([XORG_MACROS_VERSION],
106421ecb1efSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
106521ecb1efSmrg#
106621ecb1efSmrg#
106721ecb1efSmrg# See the "minimum version" comment for each macro you use to see what 
106821ecb1efSmrg# version you require.
106921ecb1efSmrgm4_defun([XORG_MACROS_VERSION],[
1070604a4f4cSmrgm4_define([vers_have], [1.10.1])
107121ecb1efSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
107221ecb1efSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
107321ecb1efSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
107421ecb1efSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
107521ecb1efSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
107621ecb1efSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
107721ecb1efSmrgm4_undefine([vers_have])
107821ecb1efSmrgm4_undefine([maj_have])
107921ecb1efSmrgm4_undefine([maj_needed])
108021ecb1efSmrg]) # XORG_MACROS_VERSION
108121ecb1efSmrg
108221ecb1efSmrg# XORG_PROG_RAWCPP()
108321ecb1efSmrg# ------------------
108421ecb1efSmrg# Minimum version: 1.0.0
108521ecb1efSmrg#
108621ecb1efSmrg# Find cpp program and necessary flags for use in pre-processing text files
108721ecb1efSmrg# such as man pages and config files
108821ecb1efSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
108921ecb1efSmrgAC_REQUIRE([AC_PROG_CPP])
109021ecb1efSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
109121ecb1efSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
10921e00de39Smrg
109321ecb1efSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
109421ecb1efSmrg# which is not the best choice for supporting other OS'es, but covers most
109521ecb1efSmrg# of the ones we need for now.
109621ecb1efSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
109721ecb1efSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
109821ecb1efSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
109921ecb1efSmrg	AC_MSG_RESULT([no])
110021ecb1efSmrgelse
110121ecb1efSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
110221ecb1efSmrg		RAWCPPFLAGS=-undef
110321ecb1efSmrg		AC_MSG_RESULT([yes])
110421ecb1efSmrg	# under Cygwin unix is still defined even with -undef
110521ecb1efSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
110621ecb1efSmrg		RAWCPPFLAGS="-undef -ansi"
110721ecb1efSmrg		AC_MSG_RESULT([yes, with -ansi])
110821ecb1efSmrg	else
110921ecb1efSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
111021ecb1efSmrg	fi
111121ecb1efSmrgfi
111221ecb1efSmrgrm -f conftest.$ac_ext
11131e00de39Smrg
111421ecb1efSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
111521ecb1efSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
111621ecb1efSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
111721ecb1efSmrg	AC_MSG_RESULT([no])
11181e00de39Smrgelse
111921ecb1efSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
112021ecb1efSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
112121ecb1efSmrg		AC_MSG_RESULT([yes])
112221ecb1efSmrg	else
112321ecb1efSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
112421ecb1efSmrg	fi
11251e00de39Smrgfi
112621ecb1efSmrgrm -f conftest.$ac_ext
112721ecb1efSmrgAC_SUBST(RAWCPPFLAGS)
112821ecb1efSmrg]) # XORG_PROG_RAWCPP
11291e00de39Smrg
113021ecb1efSmrg# XORG_MANPAGE_SECTIONS()
113121ecb1efSmrg# -----------------------
113221ecb1efSmrg# Minimum version: 1.0.0
113321ecb1efSmrg#
113421ecb1efSmrg# Determine which sections man pages go in for the different man page types
113521ecb1efSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
113621ecb1efSmrg# Not sure if there's any better way than just hardcoding by OS name.
113721ecb1efSmrg# Override default settings by setting environment variables
1138604a4f4cSmrg# Added MAN_SUBSTS in version 1.8
1139604a4f4cSmrg# Added AC_PROG_SED in version 1.8
11401e00de39Smrg
114121ecb1efSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
114221ecb1efSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1143604a4f4cSmrgAC_REQUIRE([AC_PROG_SED])
11441e00de39Smrg
114521ecb1efSmrgif test x$APP_MAN_SUFFIX = x    ; then
114621ecb1efSmrg    APP_MAN_SUFFIX=1
114721ecb1efSmrgfi
114821ecb1efSmrgif test x$APP_MAN_DIR = x    ; then
114921ecb1efSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
115021ecb1efSmrgfi
11511e00de39Smrg
115221ecb1efSmrgif test x$LIB_MAN_SUFFIX = x    ; then
115321ecb1efSmrg    LIB_MAN_SUFFIX=3
115421ecb1efSmrgfi
115521ecb1efSmrgif test x$LIB_MAN_DIR = x    ; then
115621ecb1efSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
11571e00de39Smrgfi
11581e00de39Smrg
115921ecb1efSmrgif test x$FILE_MAN_SUFFIX = x    ; then
116021ecb1efSmrg    case $host_os in
116121ecb1efSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
116221ecb1efSmrg	*)		FILE_MAN_SUFFIX=5  ;;
116321ecb1efSmrg    esac
116421ecb1efSmrgfi
116521ecb1efSmrgif test x$FILE_MAN_DIR = x    ; then
116621ecb1efSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
116721ecb1efSmrgfi
11681e00de39Smrg
116921ecb1efSmrgif test x$MISC_MAN_SUFFIX = x    ; then
117021ecb1efSmrg    case $host_os in
117121ecb1efSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
117221ecb1efSmrg	*)		MISC_MAN_SUFFIX=7  ;;
117321ecb1efSmrg    esac
117421ecb1efSmrgfi
117521ecb1efSmrgif test x$MISC_MAN_DIR = x    ; then
117621ecb1efSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
117721ecb1efSmrgfi
11781e00de39Smrg
117921ecb1efSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
118021ecb1efSmrg    case $host_os in
118121ecb1efSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
118221ecb1efSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
118321ecb1efSmrg    esac
118421ecb1efSmrgfi
118521ecb1efSmrgif test x$DRIVER_MAN_DIR = x    ; then
118621ecb1efSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
118721ecb1efSmrgfi
11881e00de39Smrg
118921ecb1efSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
119021ecb1efSmrg    case $host_os in
119121ecb1efSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
119221ecb1efSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
119321ecb1efSmrg    esac
119421ecb1efSmrgfi
119521ecb1efSmrgif test x$ADMIN_MAN_DIR = x    ; then
119621ecb1efSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
119721ecb1efSmrgfi
11981e00de39Smrg
11991e00de39Smrg
120021ecb1efSmrgAC_SUBST([APP_MAN_SUFFIX])
120121ecb1efSmrgAC_SUBST([LIB_MAN_SUFFIX])
120221ecb1efSmrgAC_SUBST([FILE_MAN_SUFFIX])
120321ecb1efSmrgAC_SUBST([MISC_MAN_SUFFIX])
120421ecb1efSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
120521ecb1efSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
120621ecb1efSmrgAC_SUBST([APP_MAN_DIR])
120721ecb1efSmrgAC_SUBST([LIB_MAN_DIR])
120821ecb1efSmrgAC_SUBST([FILE_MAN_DIR])
120921ecb1efSmrgAC_SUBST([MISC_MAN_DIR])
121021ecb1efSmrgAC_SUBST([DRIVER_MAN_DIR])
121121ecb1efSmrgAC_SUBST([ADMIN_MAN_DIR])
1212604a4f4cSmrg
1213604a4f4cSmrgXORG_MAN_PAGE="X Version 11"
1214604a4f4cSmrgAC_SUBST([XORG_MAN_PAGE])
1215604a4f4cSmrgMAN_SUBSTS="\
1216604a4f4cSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1217604a4f4cSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1218604a4f4cSmrg	-e 's|__xservername__|Xorg|g' \
1219604a4f4cSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
1220604a4f4cSmrg	-e 's|__projectroot__|\$(prefix)|g' \
1221604a4f4cSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1222604a4f4cSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1223604a4f4cSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1224604a4f4cSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1225604a4f4cSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1226604a4f4cSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1227604a4f4cSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1228604a4f4cSmrgAC_SUBST([MAN_SUBSTS])
1229604a4f4cSmrg
123021ecb1efSmrg]) # XORG_MANPAGE_SECTIONS
12311e00de39Smrg
1232604a4f4cSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1233604a4f4cSmrg# ------------------------
1234604a4f4cSmrg# Minimum version: 1.7.0
1235604a4f4cSmrg#
1236604a4f4cSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1237604a4f4cSmrg# provided by xorg-sgml-doctools, if installed.
1238604a4f4cSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1239604a4f4cSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1240604a4f4cSmrgXORG_SGML_PATH=
1241604a4f4cSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1242604a4f4cSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1243604a4f4cSmrg    [m4_ifval([$1],[:],
1244604a4f4cSmrg        [if test x"$cross_compiling" != x"yes" ; then
1245604a4f4cSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1246604a4f4cSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1247604a4f4cSmrg         fi])
1248604a4f4cSmrg    ])
1249604a4f4cSmrg
1250604a4f4cSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1251604a4f4cSmrg# the path and the name of the doc stylesheet
1252604a4f4cSmrgif test "x$XORG_SGML_PATH" != "x" ; then
1253604a4f4cSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1254604a4f4cSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1255604a4f4cSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1256604a4f4cSmrgelse
1257604a4f4cSmrg   AC_MSG_RESULT([no])
1258604a4f4cSmrgfi
1259604a4f4cSmrg
1260604a4f4cSmrgAC_SUBST(XORG_SGML_PATH)
1261604a4f4cSmrgAC_SUBST(STYLESHEET_SRCDIR)
1262604a4f4cSmrgAC_SUBST(XSL_STYLESHEET)
1263604a4f4cSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1264604a4f4cSmrg]) # XORG_CHECK_SGML_DOCTOOLS
1265604a4f4cSmrg
126621ecb1efSmrg# XORG_CHECK_LINUXDOC
126721ecb1efSmrg# -------------------
126821ecb1efSmrg# Minimum version: 1.0.0
12691e00de39Smrg#
127021ecb1efSmrg# Defines the variable MAKE_TEXT if the necessary tools and
127121ecb1efSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
127221ecb1efSmrg# Whether or not the necessary tools and files are found can be checked
127321ecb1efSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
127421ecb1efSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1275604a4f4cSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1276604a4f4cSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
12771e00de39Smrg
127821ecb1efSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
12791e00de39Smrg
1280604a4f4cSmrgAC_MSG_CHECKING([whether to build documentation])
12811e00de39Smrg
1282604a4f4cSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
128321ecb1efSmrg   BUILDDOC=yes
128421ecb1efSmrgelse
128521ecb1efSmrg   BUILDDOC=no
12861e00de39Smrgfi
12871e00de39Smrg
128821ecb1efSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
12891e00de39Smrg
129021ecb1efSmrgAC_MSG_RESULT([$BUILDDOC])
12911e00de39Smrg
1292604a4f4cSmrgAC_MSG_CHECKING([whether to build pdf documentation])
12931e00de39Smrg
1294604a4f4cSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
129521ecb1efSmrg   BUILDPDFDOC=yes
129621ecb1efSmrgelse
129721ecb1efSmrg   BUILDPDFDOC=no
129821ecb1efSmrgfi
12991e00de39Smrg
130021ecb1efSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13011e00de39Smrg
130221ecb1efSmrgAC_MSG_RESULT([$BUILDPDFDOC])
13031e00de39Smrg
1304604a4f4cSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
130521ecb1efSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
130621ecb1efSmrgMAKE_PDF="$PS2PDF"
130721ecb1efSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
13081e00de39Smrg
130921ecb1efSmrgAC_SUBST(MAKE_TEXT)
131021ecb1efSmrgAC_SUBST(MAKE_PS)
131121ecb1efSmrgAC_SUBST(MAKE_PDF)
131221ecb1efSmrgAC_SUBST(MAKE_HTML)
131321ecb1efSmrg]) # XORG_CHECK_LINUXDOC
131421ecb1efSmrg
131521ecb1efSmrg# XORG_CHECK_DOCBOOK
131621ecb1efSmrg# -------------------
131721ecb1efSmrg# Minimum version: 1.0.0
13181e00de39Smrg#
131921ecb1efSmrg# Checks for the ability to build output formats from SGML DocBook source.
132021ecb1efSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
132121ecb1efSmrg# indicates whether the necessary tools and files are found and, if set,
132221ecb1efSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
132321ecb1efSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1324604a4f4cSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1325604a4f4cSmrg
132621ecb1efSmrgBUILDTXTDOC=no
132721ecb1efSmrgBUILDPDFDOC=no
132821ecb1efSmrgBUILDPSDOC=no
132921ecb1efSmrgBUILDHTMLDOC=no
13301e00de39Smrg
133121ecb1efSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
133221ecb1efSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
133321ecb1efSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
133421ecb1efSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
13351e00de39Smrg
1336604a4f4cSmrgAC_MSG_CHECKING([whether to build text documentation])
1337604a4f4cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
133821ecb1efSmrg   test x$BUILD_TXTDOC != xno; then
133921ecb1efSmrg	BUILDTXTDOC=yes
134021ecb1efSmrgfi
134121ecb1efSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
134221ecb1efSmrgAC_MSG_RESULT([$BUILDTXTDOC])
13431e00de39Smrg
1344604a4f4cSmrgAC_MSG_CHECKING([whether to build PDF documentation])
1345604a4f4cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
134621ecb1efSmrg   test x$BUILD_PDFDOC != xno; then
134721ecb1efSmrg	BUILDPDFDOC=yes
13481e00de39Smrgfi
134921ecb1efSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
135021ecb1efSmrgAC_MSG_RESULT([$BUILDPDFDOC])
13511e00de39Smrg
1352604a4f4cSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1353604a4f4cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
135421ecb1efSmrg   test x$BUILD_PSDOC != xno; then
135521ecb1efSmrg	BUILDPSDOC=yes
135621ecb1efSmrgfi
135721ecb1efSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
135821ecb1efSmrgAC_MSG_RESULT([$BUILDPSDOC])
13591e00de39Smrg
1360604a4f4cSmrgAC_MSG_CHECKING([whether to build HTML documentation])
1361604a4f4cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
136221ecb1efSmrg   test x$BUILD_HTMLDOC != xno; then
136321ecb1efSmrg	BUILDHTMLDOC=yes
136421ecb1efSmrgfi
136521ecb1efSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
136621ecb1efSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
13671e00de39Smrg
136821ecb1efSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
136921ecb1efSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
137021ecb1efSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
137121ecb1efSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
13721e00de39Smrg
137321ecb1efSmrgAC_SUBST(MAKE_TEXT)
137421ecb1efSmrgAC_SUBST(MAKE_PS)
137521ecb1efSmrgAC_SUBST(MAKE_PDF)
137621ecb1efSmrgAC_SUBST(MAKE_HTML)
137721ecb1efSmrg]) # XORG_CHECK_DOCBOOK
13781e00de39Smrg
1379604a4f4cSmrg# XORG_WITH_XMLTO([MIN-VERSION])
1380604a4f4cSmrg# ----------------
1381604a4f4cSmrg# Minimum version: 1.5.0
1382604a4f4cSmrg#
1383604a4f4cSmrg# Documentation tools are not always available on all platforms and sometimes
1384604a4f4cSmrg# not at the appropriate level. This macro enables a module to test for the
1385604a4f4cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1386604a4f4cSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1387604a4f4cSmrg# as whether or not to use the xmlto package.
1388604a4f4cSmrg#
1389604a4f4cSmrg# Interface to module:
1390604a4f4cSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1391604a4f4cSmrg# XMLTO:	returns the path of the xmlto program found
1392604a4f4cSmrg#		returns the path set by the user in the environment
1393604a4f4cSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1394604a4f4cSmrg#		'no' user instructs the module not to use xmlto
1395604a4f4cSmrg#
1396604a4f4cSmrg# Added in version 1.10.0
1397604a4f4cSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1398604a4f4cSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1399604a4f4cSmrg#
1400604a4f4cSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1401604a4f4cSmrg#
1402604a4f4cSmrgAC_DEFUN([XORG_WITH_XMLTO],[
1403604a4f4cSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1404604a4f4cSmrgAC_ARG_WITH(xmlto,
1405604a4f4cSmrg	AS_HELP_STRING([--with-xmlto],
1406604a4f4cSmrg	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
1407604a4f4cSmrg	   [use_xmlto=$withval], [use_xmlto=auto])
1408604a4f4cSmrg
1409604a4f4cSmrgif test "x$use_xmlto" = x"auto"; then
1410604a4f4cSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1411604a4f4cSmrg   if test "x$XMLTO" = "x"; then
1412604a4f4cSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1413604a4f4cSmrg	have_xmlto=no
1414604a4f4cSmrg   else
1415604a4f4cSmrg        have_xmlto=yes
1416604a4f4cSmrg   fi
1417604a4f4cSmrgelif test "x$use_xmlto" = x"yes" ; then
1418604a4f4cSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1419604a4f4cSmrg   if test "x$XMLTO" = "x"; then
1420604a4f4cSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1421604a4f4cSmrg   fi
1422604a4f4cSmrg   have_xmlto=yes
1423604a4f4cSmrgelif test "x$use_xmlto" = x"no" ; then
1424604a4f4cSmrg   if test "x$XMLTO" != "x"; then
1425604a4f4cSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1426604a4f4cSmrg   fi
1427604a4f4cSmrg   have_xmlto=no
1428604a4f4cSmrgelse
1429604a4f4cSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1430604a4f4cSmrgfi
1431604a4f4cSmrg
1432604a4f4cSmrg# Test for a minimum version of xmlto, if provided.
1433604a4f4cSmrgm4_ifval([$1],
1434604a4f4cSmrg[if test "$have_xmlto" = yes; then
1435604a4f4cSmrg    # scrape the xmlto version
1436604a4f4cSmrg    AC_MSG_CHECKING([the xmlto version])
1437604a4f4cSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1438604a4f4cSmrg    AC_MSG_RESULT([$xmlto_version])
1439604a4f4cSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1440604a4f4cSmrg        [if test "x$use_xmlto" = xauto; then
1441604a4f4cSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1442604a4f4cSmrg            have_xmlto=no
1443604a4f4cSmrg        else
1444604a4f4cSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1445604a4f4cSmrg        fi])
1446604a4f4cSmrgfi])
1447604a4f4cSmrg
1448604a4f4cSmrg# Test for the ability of xmlto to generate a text target
1449604a4f4cSmrghave_xmlto_text=no
1450604a4f4cSmrgcat > conftest.xml << "EOF"
1451604a4f4cSmrgEOF
1452604a4f4cSmrgAS_IF([test "$have_xmlto" = yes],
1453604a4f4cSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1454604a4f4cSmrg             [have_xmlto_text=yes],
1455604a4f4cSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1456604a4f4cSmrgrm -f conftest.xml
1457604a4f4cSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1458604a4f4cSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1459604a4f4cSmrg]) # XORG_WITH_XMLTO
1460604a4f4cSmrg
1461604a4f4cSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION])
1462604a4f4cSmrg# ----------------
1463604a4f4cSmrg# Minimum version: 1.5.0
1464604a4f4cSmrg#
1465604a4f4cSmrg# Documentation tools are not always available on all platforms and sometimes
1466604a4f4cSmrg# not at the appropriate level. This macro enables a module to test for the
1467604a4f4cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1468604a4f4cSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1469604a4f4cSmrg# as whether or not to use the asciidoc package.
1470604a4f4cSmrg#
1471604a4f4cSmrg# Interface to module:
1472604a4f4cSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1473604a4f4cSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
1474604a4f4cSmrg#		 returns the path set by the user in the environment
1475604a4f4cSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1476604a4f4cSmrg#		  'no' user instructs the module not to use asciidoc
1477604a4f4cSmrg#
1478604a4f4cSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1479604a4f4cSmrg#
1480604a4f4cSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1481604a4f4cSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1482604a4f4cSmrgAC_ARG_WITH(asciidoc,
1483604a4f4cSmrg	AS_HELP_STRING([--with-asciidoc],
1484604a4f4cSmrg	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
1485604a4f4cSmrg	   [use_asciidoc=$withval], [use_asciidoc=auto])
1486604a4f4cSmrg
1487604a4f4cSmrgif test "x$use_asciidoc" = x"auto"; then
1488604a4f4cSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1489604a4f4cSmrg   if test "x$ASCIIDOC" = "x"; then
1490604a4f4cSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1491604a4f4cSmrg	have_asciidoc=no
1492604a4f4cSmrg   else
1493604a4f4cSmrg        have_asciidoc=yes
1494604a4f4cSmrg   fi
1495604a4f4cSmrgelif test "x$use_asciidoc" = x"yes" ; then
1496604a4f4cSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1497604a4f4cSmrg   if test "x$ASCIIDOC" = "x"; then
1498604a4f4cSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1499604a4f4cSmrg   fi
1500604a4f4cSmrg   have_asciidoc=yes
1501604a4f4cSmrgelif test "x$use_asciidoc" = x"no" ; then
1502604a4f4cSmrg   if test "x$ASCIIDOC" != "x"; then
1503604a4f4cSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1504604a4f4cSmrg   fi
1505604a4f4cSmrg   have_asciidoc=no
1506604a4f4cSmrgelse
1507604a4f4cSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1508604a4f4cSmrgfi
1509604a4f4cSmrgm4_ifval([$1],
1510604a4f4cSmrg[if test "$have_asciidoc" = yes; then
1511604a4f4cSmrg    # scrape the asciidoc version
1512604a4f4cSmrg    AC_MSG_CHECKING([the asciidoc version])
1513604a4f4cSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1514604a4f4cSmrg    AC_MSG_RESULT([$asciidoc_version])
1515604a4f4cSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1516604a4f4cSmrg        [if test "x$use_asciidoc" = xauto; then
1517604a4f4cSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1518604a4f4cSmrg            have_asciidoc=no
1519604a4f4cSmrg        else
1520604a4f4cSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1521604a4f4cSmrg        fi])
1522604a4f4cSmrgfi])
1523604a4f4cSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1524604a4f4cSmrg]) # XORG_WITH_ASCIIDOC
1525604a4f4cSmrg
1526604a4f4cSmrg# XORG_WITH_DOXYGEN([MIN-VERSION])
1527604a4f4cSmrg# --------------------------------
1528604a4f4cSmrg# Minimum version: 1.5.0
1529604a4f4cSmrg#
1530604a4f4cSmrg# Documentation tools are not always available on all platforms and sometimes
1531604a4f4cSmrg# not at the appropriate level. This macro enables a module to test for the
1532604a4f4cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1533604a4f4cSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1534604a4f4cSmrg# as whether or not to use the doxygen package.
1535604a4f4cSmrg#
1536604a4f4cSmrg# Interface to module:
1537604a4f4cSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1538604a4f4cSmrg# DOXYGEN:	 returns the path of the doxygen program found
1539604a4f4cSmrg#		 returns the path set by the user in the environment
1540604a4f4cSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1541604a4f4cSmrg#		  'no' user instructs the module not to use doxygen
1542604a4f4cSmrg#
1543604a4f4cSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1544604a4f4cSmrg#
1545604a4f4cSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1546604a4f4cSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1547604a4f4cSmrgAC_ARG_WITH(doxygen,
1548604a4f4cSmrg	AS_HELP_STRING([--with-doxygen],
1549604a4f4cSmrg	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
1550604a4f4cSmrg	   [use_doxygen=$withval], [use_doxygen=auto])
1551604a4f4cSmrg
1552604a4f4cSmrgif test "x$use_doxygen" = x"auto"; then
1553604a4f4cSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1554604a4f4cSmrg   if test "x$DOXYGEN" = "x"; then
1555604a4f4cSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1556604a4f4cSmrg	have_doxygen=no
1557604a4f4cSmrg   else
1558604a4f4cSmrg        have_doxygen=yes
1559604a4f4cSmrg   fi
1560604a4f4cSmrgelif test "x$use_doxygen" = x"yes" ; then
1561604a4f4cSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1562604a4f4cSmrg   if test "x$DOXYGEN" = "x"; then
1563604a4f4cSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1564604a4f4cSmrg   fi
1565604a4f4cSmrg   have_doxygen=yes
1566604a4f4cSmrgelif test "x$use_doxygen" = x"no" ; then
1567604a4f4cSmrg   if test "x$DOXYGEN" != "x"; then
1568604a4f4cSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1569604a4f4cSmrg   fi
1570604a4f4cSmrg   have_doxygen=no
1571604a4f4cSmrgelse
1572604a4f4cSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1573604a4f4cSmrgfi
1574604a4f4cSmrgm4_ifval([$1],
1575604a4f4cSmrg[if test "$have_doxygen" = yes; then
1576604a4f4cSmrg    # scrape the doxygen version
1577604a4f4cSmrg    AC_MSG_CHECKING([the doxygen version])
1578604a4f4cSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1579604a4f4cSmrg    AC_MSG_RESULT([$doxygen_version])
1580604a4f4cSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1581604a4f4cSmrg        [if test "x$use_doxygen" = xauto; then
1582604a4f4cSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1583604a4f4cSmrg            have_doxygen=no
1584604a4f4cSmrg        else
1585604a4f4cSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1586604a4f4cSmrg        fi])
1587604a4f4cSmrgfi])
1588604a4f4cSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1589604a4f4cSmrg]) # XORG_WITH_DOXYGEN
1590604a4f4cSmrg
1591604a4f4cSmrg# XORG_WITH_GROFF
1592604a4f4cSmrg# ----------------
1593604a4f4cSmrg# Minimum version: 1.6.0
1594604a4f4cSmrg#
1595604a4f4cSmrg# Documentation tools are not always available on all platforms and sometimes
1596604a4f4cSmrg# not at the appropriate level. This macro enables a module to test for the
1597604a4f4cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1598604a4f4cSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
1599604a4f4cSmrg# as whether or not to use the groff package.
1600604a4f4cSmrg#
1601604a4f4cSmrg# Interface to module:
1602604a4f4cSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1603604a4f4cSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1604604a4f4cSmrg# HAVE_GROFF_MS: the -ms macros package
1605604a4f4cSmrg# GROFF:	 returns the path of the groff program found
1606604a4f4cSmrg#		 returns the path set by the user in the environment
1607604a4f4cSmrg# --with-groff:	 'yes' user instructs the module to use groff
1608604a4f4cSmrg#		 'no' user instructs the module not to use groff
1609604a4f4cSmrg#
1610604a4f4cSmrg# Added in version 1.9.0:
1611604a4f4cSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1612604a4f4cSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1613604a4f4cSmrg#		   psselect from the psutils package.
1614604a4f4cSmrg#		   the ghostcript package. Refer to the grohtml man pages
1615604a4f4cSmrg#
1616604a4f4cSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1617604a4f4cSmrg#
1618604a4f4cSmrg# OS and distros often splits groff in a basic and full package, the former
1619604a4f4cSmrg# having the groff program and the later having devices, fonts and macros
1620604a4f4cSmrg# Checking for the groff executable is not enough.
1621604a4f4cSmrg#
1622604a4f4cSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
1623604a4f4cSmrg# unset HAVE_GROFF or GROFF env variables.
1624604a4f4cSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1625604a4f4cSmrg#
1626604a4f4cSmrgAC_DEFUN([XORG_WITH_GROFF],[
1627604a4f4cSmrgAC_ARG_VAR([GROFF], [Path to groff command])
1628604a4f4cSmrgAC_ARG_WITH(groff,
1629604a4f4cSmrg	AS_HELP_STRING([--with-groff],
1630604a4f4cSmrg	   [Use groff to regenerate documentation (default: yes, if installed)]),
1631604a4f4cSmrg	   [use_groff=$withval], [use_groff=auto])
1632604a4f4cSmrg
1633604a4f4cSmrgif test "x$use_groff" = x"auto"; then
1634604a4f4cSmrg   AC_PATH_PROG([GROFF], [groff])
1635604a4f4cSmrg   if test "x$GROFF" = "x"; then
1636604a4f4cSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1637604a4f4cSmrg	have_groff=no
1638604a4f4cSmrg   else
1639604a4f4cSmrg        have_groff=yes
1640604a4f4cSmrg   fi
1641604a4f4cSmrgelif test "x$use_groff" = x"yes" ; then
1642604a4f4cSmrg   AC_PATH_PROG([GROFF], [groff])
1643604a4f4cSmrg   if test "x$GROFF" = "x"; then
1644604a4f4cSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1645604a4f4cSmrg   fi
1646604a4f4cSmrg   have_groff=yes
1647604a4f4cSmrgelif test "x$use_groff" = x"no" ; then
1648604a4f4cSmrg   if test "x$GROFF" != "x"; then
1649604a4f4cSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1650604a4f4cSmrg   fi
1651604a4f4cSmrg   have_groff=no
1652604a4f4cSmrgelse
1653604a4f4cSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1654604a4f4cSmrgfi
1655604a4f4cSmrg
1656604a4f4cSmrg# We have groff, test for the presence of the macro packages
1657604a4f4cSmrgif test "x$have_groff" = x"yes"; then
1658604a4f4cSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1659604a4f4cSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1660604a4f4cSmrg        groff_ms_works=yes
1661604a4f4cSmrg    else
1662604a4f4cSmrg        groff_ms_works=no
1663604a4f4cSmrg    fi
1664604a4f4cSmrg    AC_MSG_RESULT([$groff_ms_works])
1665604a4f4cSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1666604a4f4cSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1667604a4f4cSmrg        groff_mm_works=yes
1668604a4f4cSmrg    else
1669604a4f4cSmrg        groff_mm_works=no
1670604a4f4cSmrg    fi
1671604a4f4cSmrg    AC_MSG_RESULT([$groff_mm_works])
1672604a4f4cSmrgfi
1673604a4f4cSmrg
1674604a4f4cSmrg# We have groff, test for HTML dependencies, one command per package
1675604a4f4cSmrgif test "x$have_groff" = x"yes"; then
1676604a4f4cSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1677604a4f4cSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1678604a4f4cSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1679604a4f4cSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1680604a4f4cSmrg      have_groff_html=yes
1681604a4f4cSmrg   else
1682604a4f4cSmrg      have_groff_html=no
1683604a4f4cSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1684604a4f4cSmrg   fi
1685604a4f4cSmrgfi
1686604a4f4cSmrg
1687604a4f4cSmrg# Set Automake conditionals for Makefiles
1688604a4f4cSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1689604a4f4cSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1690604a4f4cSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1691604a4f4cSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1692604a4f4cSmrg]) # XORG_WITH_GROFF
1693604a4f4cSmrg
1694604a4f4cSmrg# XORG_WITH_FOP
1695604a4f4cSmrg# ----------------
1696604a4f4cSmrg# Minimum version: 1.6.0
1697604a4f4cSmrg#
1698604a4f4cSmrg# Documentation tools are not always available on all platforms and sometimes
1699604a4f4cSmrg# not at the appropriate level. This macro enables a module to test for the
1700604a4f4cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1701604a4f4cSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
1702604a4f4cSmrg# as whether or not to use the fop package.
1703604a4f4cSmrg#
1704604a4f4cSmrg# Interface to module:
1705604a4f4cSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1706604a4f4cSmrg# FOP:	 	returns the path of the fop program found
1707604a4f4cSmrg#		returns the path set by the user in the environment
1708604a4f4cSmrg# --with-fop: 	'yes' user instructs the module to use fop
1709604a4f4cSmrg#		'no' user instructs the module not to use fop
1710604a4f4cSmrg#
1711604a4f4cSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1712604a4f4cSmrg#
1713604a4f4cSmrgAC_DEFUN([XORG_WITH_FOP],[
1714604a4f4cSmrgAC_ARG_VAR([FOP], [Path to fop command])
1715604a4f4cSmrgAC_ARG_WITH(fop,
1716604a4f4cSmrg	AS_HELP_STRING([--with-fop],
1717604a4f4cSmrg	   [Use fop to regenerate documentation (default: yes, if installed)]),
1718604a4f4cSmrg	   [use_fop=$withval], [use_fop=auto])
1719604a4f4cSmrg
1720604a4f4cSmrgif test "x$use_fop" = x"auto"; then
1721604a4f4cSmrg   AC_PATH_PROG([FOP], [fop])
1722604a4f4cSmrg   if test "x$FOP" = "x"; then
1723604a4f4cSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1724604a4f4cSmrg	have_fop=no
1725604a4f4cSmrg   else
1726604a4f4cSmrg        have_fop=yes
1727604a4f4cSmrg   fi
1728604a4f4cSmrgelif test "x$use_fop" = x"yes" ; then
1729604a4f4cSmrg   AC_PATH_PROG([FOP], [fop])
1730604a4f4cSmrg   if test "x$FOP" = "x"; then
1731604a4f4cSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1732604a4f4cSmrg   fi
1733604a4f4cSmrg   have_fop=yes
1734604a4f4cSmrgelif test "x$use_fop" = x"no" ; then
1735604a4f4cSmrg   if test "x$FOP" != "x"; then
1736604a4f4cSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1737604a4f4cSmrg   fi
1738604a4f4cSmrg   have_fop=no
1739604a4f4cSmrgelse
1740604a4f4cSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1741604a4f4cSmrgfi
1742604a4f4cSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1743604a4f4cSmrg]) # XORG_WITH_FOP
1744604a4f4cSmrg
1745604a4f4cSmrg# XORG_WITH_PS2PDF
1746604a4f4cSmrg# ----------------
1747604a4f4cSmrg# Minimum version: 1.6.0
1748604a4f4cSmrg#
1749604a4f4cSmrg# Documentation tools are not always available on all platforms and sometimes
1750604a4f4cSmrg# not at the appropriate level. This macro enables a module to test for the
1751604a4f4cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1752604a4f4cSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1753604a4f4cSmrg# as whether or not to use the ps2pdf package.
1754604a4f4cSmrg#
1755604a4f4cSmrg# Interface to module:
1756604a4f4cSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1757604a4f4cSmrg# PS2PDF:	returns the path of the ps2pdf program found
1758604a4f4cSmrg#		returns the path set by the user in the environment
1759604a4f4cSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1760604a4f4cSmrg#		 'no' user instructs the module not to use ps2pdf
1761604a4f4cSmrg#
1762604a4f4cSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1763604a4f4cSmrg#
1764604a4f4cSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1765604a4f4cSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1766604a4f4cSmrgAC_ARG_WITH(ps2pdf,
1767604a4f4cSmrg	AS_HELP_STRING([--with-ps2pdf],
1768604a4f4cSmrg	   [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
1769604a4f4cSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=auto])
1770604a4f4cSmrg
1771604a4f4cSmrgif test "x$use_ps2pdf" = x"auto"; then
1772604a4f4cSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1773604a4f4cSmrg   if test "x$PS2PDF" = "x"; then
1774604a4f4cSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1775604a4f4cSmrg	have_ps2pdf=no
1776604a4f4cSmrg   else
1777604a4f4cSmrg        have_ps2pdf=yes
1778604a4f4cSmrg   fi
1779604a4f4cSmrgelif test "x$use_ps2pdf" = x"yes" ; then
1780604a4f4cSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1781604a4f4cSmrg   if test "x$PS2PDF" = "x"; then
1782604a4f4cSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1783604a4f4cSmrg   fi
1784604a4f4cSmrg   have_ps2pdf=yes
1785604a4f4cSmrgelif test "x$use_ps2pdf" = x"no" ; then
1786604a4f4cSmrg   if test "x$PS2PDF" != "x"; then
1787604a4f4cSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1788604a4f4cSmrg   fi
1789604a4f4cSmrg   have_ps2pdf=no
1790604a4f4cSmrgelse
1791604a4f4cSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1792604a4f4cSmrgfi
1793604a4f4cSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1794604a4f4cSmrg]) # XORG_WITH_PS2PDF
1795604a4f4cSmrg
1796604a4f4cSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
1797604a4f4cSmrg# ----------------
1798604a4f4cSmrg# Minimum version: 1.6.0
1799604a4f4cSmrg#
1800604a4f4cSmrg# Documentation tools are not always available on all platforms and sometimes
1801604a4f4cSmrg# not at the appropriate level. This macro enables a builder to skip all
1802604a4f4cSmrg# documentation targets except traditional man pages.
1803604a4f4cSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1804604a4f4cSmrg# maximum flexibilty in controlling documentation building.
1805604a4f4cSmrg# Refer to:
1806604a4f4cSmrg# XORG_WITH_XMLTO         --with-xmlto
1807604a4f4cSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1808604a4f4cSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1809604a4f4cSmrg# XORG_WITH_FOP           --with-fop
1810604a4f4cSmrg# XORG_WITH_GROFF         --with-groff
1811604a4f4cSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1812604a4f4cSmrg#
1813604a4f4cSmrg# Interface to module:
1814604a4f4cSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1815604a4f4cSmrg# --enable-docs: 'yes' user instructs the module to generate docs
1816604a4f4cSmrg#		 'no' user instructs the module not to generate docs
1817604a4f4cSmrg# parm1:	specify the default value, yes or no.
1818604a4f4cSmrg#
1819604a4f4cSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1820604a4f4cSmrgdefault=$1
1821604a4f4cSmrgif test "x$default" = x ; then
1822604a4f4cSmrg  default="yes"
1823604a4f4cSmrgfi
1824604a4f4cSmrgAC_ARG_ENABLE(docs,
1825604a4f4cSmrg	AS_HELP_STRING([--enable-docs],
1826604a4f4cSmrg	   [Enable building the documentation (default: yes)]),
1827604a4f4cSmrg	   [build_docs=$enableval], [build_docs=$default])
1828604a4f4cSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1829604a4f4cSmrgAC_MSG_CHECKING([whether to build documentation])
1830604a4f4cSmrgAC_MSG_RESULT([$build_docs])
1831604a4f4cSmrg]) # XORG_ENABLE_DOCS
1832604a4f4cSmrg
1833604a4f4cSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1834604a4f4cSmrg# ----------------
1835604a4f4cSmrg# Minimum version: 1.6.0
1836604a4f4cSmrg#
1837604a4f4cSmrg# This macro enables a builder to skip all developer documentation.
1838604a4f4cSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1839604a4f4cSmrg# maximum flexibilty in controlling documentation building.
1840604a4f4cSmrg# Refer to:
1841604a4f4cSmrg# XORG_WITH_XMLTO         --with-xmlto
1842604a4f4cSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1843604a4f4cSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1844604a4f4cSmrg# XORG_WITH_FOP           --with-fop
1845604a4f4cSmrg# XORG_WITH_GROFF         --with-groff
1846604a4f4cSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1847604a4f4cSmrg#
1848604a4f4cSmrg# Interface to module:
1849604a4f4cSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1850604a4f4cSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1851604a4f4cSmrg#			'no' user instructs the module not to generate developer docs
1852604a4f4cSmrg# parm1:		specify the default value, yes or no.
1853604a4f4cSmrg#
1854604a4f4cSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1855604a4f4cSmrgdevel_default=$1
1856604a4f4cSmrgif test "x$devel_default" = x ; then
1857604a4f4cSmrg  devel_default="yes"
1858604a4f4cSmrgfi
1859604a4f4cSmrgAC_ARG_ENABLE(devel-docs,
1860604a4f4cSmrg	AS_HELP_STRING([--enable-devel-docs],
1861604a4f4cSmrg	   [Enable building the developer documentation (default: yes)]),
1862604a4f4cSmrg	   [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
1863604a4f4cSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1864604a4f4cSmrgAC_MSG_CHECKING([whether to build developer documentation])
1865604a4f4cSmrgAC_MSG_RESULT([$build_devel_docs])
1866604a4f4cSmrg]) # XORG_ENABLE_DEVEL_DOCS
1867604a4f4cSmrg
1868604a4f4cSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
1869604a4f4cSmrg# ----------------
1870604a4f4cSmrg# Minimum version: 1.6.0
1871604a4f4cSmrg#
1872604a4f4cSmrg# This macro enables a builder to skip all functional specification targets.
1873604a4f4cSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1874604a4f4cSmrg# maximum flexibilty in controlling documentation building.
1875604a4f4cSmrg# Refer to:
1876604a4f4cSmrg# XORG_WITH_XMLTO         --with-xmlto
1877604a4f4cSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1878604a4f4cSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1879604a4f4cSmrg# XORG_WITH_FOP           --with-fop
1880604a4f4cSmrg# XORG_WITH_GROFF         --with-groff
1881604a4f4cSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1882604a4f4cSmrg#
1883604a4f4cSmrg# Interface to module:
1884604a4f4cSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1885604a4f4cSmrg# --enable-specs:	'yes' user instructs the module to generate specs
1886604a4f4cSmrg#			'no' user instructs the module not to generate specs
1887604a4f4cSmrg# parm1:		specify the default value, yes or no.
1888604a4f4cSmrg#
1889604a4f4cSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1890604a4f4cSmrgspec_default=$1
1891604a4f4cSmrgif test "x$spec_default" = x ; then
1892604a4f4cSmrg  spec_default="yes"
1893604a4f4cSmrgfi
1894604a4f4cSmrgAC_ARG_ENABLE(specs,
1895604a4f4cSmrg	AS_HELP_STRING([--enable-specs],
1896604a4f4cSmrg	   [Enable building the specs (default: yes)]),
1897604a4f4cSmrg	   [build_specs=$enableval], [build_specs=$spec_default])
1898604a4f4cSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1899604a4f4cSmrgAC_MSG_CHECKING([whether to build functional specifications])
1900604a4f4cSmrgAC_MSG_RESULT([$build_specs])
1901604a4f4cSmrg]) # XORG_ENABLE_SPECS
1902604a4f4cSmrg
190321ecb1efSmrg# XORG_CHECK_MALLOC_ZERO
190421ecb1efSmrg# ----------------------
190521ecb1efSmrg# Minimum version: 1.0.0
190621ecb1efSmrg#
190721ecb1efSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
190821ecb1efSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
190921ecb1efSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
191021ecb1efSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
191121ecb1efSmrgAC_ARG_ENABLE(malloc0returnsnull,
191221ecb1efSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
191321ecb1efSmrg		       [malloc(0) returns NULL (default: auto)]),
191421ecb1efSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
191521ecb1efSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
19161e00de39Smrg
191721ecb1efSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
191821ecb1efSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
191921ecb1efSmrg	AC_RUN_IFELSE([
192021ecb1efSmrgchar *malloc();
192121ecb1efSmrgchar *realloc();
192221ecb1efSmrgchar *calloc();
192321ecb1efSmrgmain() {
192421ecb1efSmrg    char *m0, *r0, *c0, *p;
192521ecb1efSmrg    m0 = malloc(0);
192621ecb1efSmrg    p = malloc(10);
192721ecb1efSmrg    r0 = realloc(p,0);
192821ecb1efSmrg    c0 = calloc(0);
192921ecb1efSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
193021ecb1efSmrg}],
193121ecb1efSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1932604a4f4cSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
1933604a4f4cSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
193421ecb1efSmrgfi
193521ecb1efSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
19361e00de39Smrg
193721ecb1efSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
193821ecb1efSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
193921ecb1efSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
194021ecb1efSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
194121ecb1efSmrgelse
194221ecb1efSmrg	MALLOC_ZERO_CFLAGS=""
194321ecb1efSmrg	XMALLOC_ZERO_CFLAGS=""
194421ecb1efSmrg	XTMALLOC_ZERO_CFLAGS=""
194521ecb1efSmrgfi
19461e00de39Smrg
194721ecb1efSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
194821ecb1efSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
194921ecb1efSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
195021ecb1efSmrg]) # XORG_CHECK_MALLOC_ZERO
19511e00de39Smrg
195221ecb1efSmrg# XORG_WITH_LINT()
195321ecb1efSmrg# ----------------
195421ecb1efSmrg# Minimum version: 1.1.0
195521ecb1efSmrg#
1956604a4f4cSmrg# This macro enables the use of a tool that flags some suspicious and
1957604a4f4cSmrg# non-portable constructs (likely to be bugs) in C language source code.
1958604a4f4cSmrg# It will attempt to locate the tool and use appropriate options.
1959604a4f4cSmrg# There are various lint type tools on different platforms.
1960604a4f4cSmrg#
1961604a4f4cSmrg# Interface to module:
1962604a4f4cSmrg# LINT:		returns the path to the tool found on the platform
1963604a4f4cSmrg#		or the value set to LINT on the configure cmd line
1964604a4f4cSmrg#		also an Automake conditional
1965604a4f4cSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
1966604a4f4cSmrg#
1967604a4f4cSmrg# --with-lint:	'yes' user instructs the module to use lint
1968604a4f4cSmrg#		'no' user instructs the module not to use lint (default)
1969604a4f4cSmrg#
1970604a4f4cSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1971604a4f4cSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
197221ecb1efSmrg#
197321ecb1efSmrgAC_DEFUN([XORG_WITH_LINT],[
197421ecb1efSmrg
1975604a4f4cSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1976604a4f4cSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
197721ecb1efSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
197821ecb1efSmrg		[Use a lint-style source code checker (default: disabled)])],
197921ecb1efSmrg		[use_lint=$withval], [use_lint=no])
1980604a4f4cSmrg
1981604a4f4cSmrg# Obtain platform specific info like program name and options
1982604a4f4cSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1983604a4f4cSmrgcase $host_os in
1984604a4f4cSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1985604a4f4cSmrg	lint_name=splint
1986604a4f4cSmrg	lint_options="-badflag"
1987604a4f4cSmrg	;;
1988604a4f4cSmrg  *freebsd* | *netbsd*)
1989604a4f4cSmrg	lint_name=lint
1990604a4f4cSmrg	lint_options="-u -b"
1991604a4f4cSmrg	;;
1992604a4f4cSmrg  *solaris*)
1993604a4f4cSmrg	lint_name=lint
1994604a4f4cSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1995604a4f4cSmrg	;;
1996604a4f4cSmrgesac
1997604a4f4cSmrg
1998604a4f4cSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1999604a4f4cSmrgif test "x$use_lint" = x"yes" ; then
2000604a4f4cSmrg   AC_PATH_PROG([LINT], [$lint_name])
2001604a4f4cSmrg   if test "x$LINT" = "x"; then
2002604a4f4cSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2003604a4f4cSmrg   fi
2004604a4f4cSmrgelif test "x$use_lint" = x"no" ; then
2005604a4f4cSmrg   if test "x$LINT" != "x"; then
2006604a4f4cSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2007604a4f4cSmrg   fi
200821ecb1efSmrgelse
2009604a4f4cSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
20101e00de39Smrgfi
2011604a4f4cSmrg
2012604a4f4cSmrg# User supplied flags override default flags
2013604a4f4cSmrgif test "x$LINT_FLAGS" != "x"; then
2014604a4f4cSmrg   lint_options=$LINT_FLAGS
20151e00de39Smrgfi
20161e00de39Smrg
2017604a4f4cSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2018604a4f4cSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
20191e00de39Smrg
202021ecb1efSmrg]) # XORG_WITH_LINT
20211e00de39Smrg
202221ecb1efSmrg# XORG_LINT_LIBRARY(LIBNAME)
202321ecb1efSmrg# --------------------------
202421ecb1efSmrg# Minimum version: 1.1.0
202521ecb1efSmrg#
202621ecb1efSmrg# Sets up flags for building lint libraries for checking programs that call
202721ecb1efSmrg# functions in the library.
202821ecb1efSmrg#
2029604a4f4cSmrg# Interface to module:
2030604a4f4cSmrg# LINTLIB		- Automake variable with the name of lint library file to make
2031604a4f4cSmrg# MAKE_LINT_LIB		- Automake conditional
2032604a4f4cSmrg#
2033604a4f4cSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2034604a4f4cSmrg#			  - 'no' user instructs the module not to create a lint library (default)
20351e00de39Smrg
203621ecb1efSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
203721ecb1efSmrgAC_REQUIRE([XORG_WITH_LINT])
203821ecb1efSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
203921ecb1efSmrg	[Create lint library (default: disabled)])],
204021ecb1efSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2041604a4f4cSmrg
2042604a4f4cSmrgif test "x$make_lint_lib" = x"yes" ; then
2043604a4f4cSmrg   LINTLIB=llib-l$1.ln
2044604a4f4cSmrg   if test "x$LINT" = "x"; then
2045604a4f4cSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2046604a4f4cSmrg   fi
2047604a4f4cSmrgelif test "x$make_lint_lib" != x"no" ; then
2048604a4f4cSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
204921ecb1efSmrgfi
2050604a4f4cSmrg
205121ecb1efSmrgAC_SUBST(LINTLIB)
205221ecb1efSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
20531e00de39Smrg
205421ecb1efSmrg]) # XORG_LINT_LIBRARY
20551e00de39Smrg
205621ecb1efSmrg# XORG_CWARNFLAGS
205721ecb1efSmrg# ---------------
205821ecb1efSmrg# Minimum version: 1.2.0
205921ecb1efSmrg#
206021ecb1efSmrg# Defines CWARNFLAGS to enable C compiler warnings.
206121ecb1efSmrg#
206221ecb1efSmrgAC_DEFUN([XORG_CWARNFLAGS], [
2063604a4f4cSmrgAC_REQUIRE([AC_PROG_CC_C99])
206421ecb1efSmrgif  test "x$GCC" = xyes ; then
206521ecb1efSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
206621ecb1efSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
2067604a4f4cSmrg-Wbad-function-cast -Wformat=2"
206821ecb1efSmrg    case `$CC -dumpversion` in
206921ecb1efSmrg    3.4.* | 4.*)
207021ecb1efSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
207121ecb1efSmrg	;;
207221ecb1efSmrg    esac
20731e00de39Smrgelse
207421ecb1efSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
207521ecb1efSmrg    if test "x$SUNCC" = "xyes"; then
207621ecb1efSmrg	CWARNFLAGS="-v"
207721ecb1efSmrg    fi
20781e00de39Smrgfi
207921ecb1efSmrgAC_SUBST(CWARNFLAGS)
208021ecb1efSmrg]) # XORG_CWARNFLAGS
20811e00de39Smrg
208221ecb1efSmrg# XORG_STRICT_OPTION
208321ecb1efSmrg# -----------------------
208421ecb1efSmrg# Minimum version: 1.3.0
20851e00de39Smrg#
208621ecb1efSmrg# Add configure option to enable strict compilation
208721ecb1efSmrgAC_DEFUN([XORG_STRICT_OPTION], [
2088604a4f4cSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
208921ecb1efSmrgAC_REQUIRE([AC_PROG_CC_C99])
209021ecb1efSmrgAC_REQUIRE([XORG_CWARNFLAGS])
209121ecb1efSmrg
209221ecb1efSmrgAC_ARG_ENABLE(strict-compilation,
209321ecb1efSmrg			  AS_HELP_STRING([--enable-strict-compilation],
209421ecb1efSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
209521ecb1efSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
209621ecb1efSmrgif test "x$STRICT_COMPILE" = "xyes"; then
209721ecb1efSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
209821ecb1efSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
209921ecb1efSmrg	if test "x$GCC" = xyes ; then
210021ecb1efSmrg		STRICT_CFLAGS="-pedantic -Werror"
210121ecb1efSmrg	elif test "x$SUNCC" = "xyes"; then
210221ecb1efSmrg		STRICT_CFLAGS="-errwarn"
210321ecb1efSmrg    elif test "x$INTELCC" = "xyes"; then
210421ecb1efSmrg		STRICT_CFLAGS="-Werror"
210521ecb1efSmrg	fi
210621ecb1efSmrgfi
210721ecb1efSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
210821ecb1efSmrgAC_SUBST([CWARNFLAGS])
210921ecb1efSmrg]) # XORG_STRICT_OPTION
21101e00de39Smrg
211121ecb1efSmrg# XORG_DEFAULT_OPTIONS
211221ecb1efSmrg# --------------------
211321ecb1efSmrg# Minimum version: 1.3.0
21141e00de39Smrg#
211521ecb1efSmrg# Defines default options for X.Org modules.
211621ecb1efSmrg#
211721ecb1efSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
2118604a4f4cSmrgAC_REQUIRE([AC_PROG_INSTALL])
211921ecb1efSmrgXORG_CWARNFLAGS
212021ecb1efSmrgXORG_STRICT_OPTION
212121ecb1efSmrgXORG_RELEASE_VERSION
212221ecb1efSmrgXORG_CHANGELOG
2123604a4f4cSmrgXORG_INSTALL
212421ecb1efSmrgXORG_MANPAGE_SECTIONS
2125604a4f4cSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2126604a4f4cSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
212721ecb1efSmrg]) # XORG_DEFAULT_OPTIONS
2128604a4f4cSmrg
2129604a4f4cSmrg# XORG_INSTALL()
2130604a4f4cSmrg# ----------------
2131604a4f4cSmrg# Minimum version: 1.4.0
2132604a4f4cSmrg#
2133604a4f4cSmrg# Defines the variable INSTALL_CMD as the command to copy
2134604a4f4cSmrg# INSTALL from $prefix/share/util-macros.
2135604a4f4cSmrg#
2136604a4f4cSmrgAC_DEFUN([XORG_INSTALL], [
2137604a4f4cSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2138604a4f4cSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2139604a4f4cSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2140604a4f4cSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2141604a4f4cSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
2142604a4f4cSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
2143604a4f4cSmrgAC_SUBST([INSTALL_CMD])
2144604a4f4cSmrg]) # XORG_INSTALL
214521ecb1efSmrgdnl Copyright 2005 Red Hat, Inc
214621ecb1efSmrgdnl
214721ecb1efSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
214821ecb1efSmrgdnl documentation for any purpose is hereby granted without fee, provided that
214921ecb1efSmrgdnl the above copyright notice appear in all copies and that both that
215021ecb1efSmrgdnl copyright notice and this permission notice appear in supporting
215121ecb1efSmrgdnl documentation.
215221ecb1efSmrgdnl
215321ecb1efSmrgdnl The above copyright notice and this permission notice shall be included
215421ecb1efSmrgdnl in all copies or substantial portions of the Software.
215521ecb1efSmrgdnl
215621ecb1efSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
215721ecb1efSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
215821ecb1efSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
215921ecb1efSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
216021ecb1efSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
216121ecb1efSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
216221ecb1efSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
216321ecb1efSmrgdnl
216421ecb1efSmrgdnl Except as contained in this notice, the name of the copyright holders shall
216521ecb1efSmrgdnl not be used in advertising or otherwise to promote the sale, use or
216621ecb1efSmrgdnl other dealings in this Software without prior written authorization
216721ecb1efSmrgdnl from the copyright holders.
216821ecb1efSmrgdnl
21691e00de39Smrg
217021ecb1efSmrg# XORG_RELEASE_VERSION
217121ecb1efSmrg# --------------------
2172604a4f4cSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
217321ecb1efSmrg 
217421ecb1efSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
217521ecb1efSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
217621ecb1efSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
217721ecb1efSmrg		[Major version of this package])
217821ecb1efSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
217921ecb1efSmrg	if test "x$PVM" = "x"; then
218021ecb1efSmrg		PVM="0"
218121ecb1efSmrg	fi
218221ecb1efSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
218321ecb1efSmrg		[$PVM],
218421ecb1efSmrg		[Minor version of this package])
218521ecb1efSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
218621ecb1efSmrg	if test "x$PVP" = "x"; then
218721ecb1efSmrg		PVP="0"
218821ecb1efSmrg	fi
218921ecb1efSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
219021ecb1efSmrg		[$PVP],
219121ecb1efSmrg		[Patch version of this package])
219221ecb1efSmrg])
21931e00de39Smrg
219421ecb1efSmrg# XORG_CHANGELOG()
219521ecb1efSmrg# ----------------
219621ecb1efSmrg# Minimum version: 1.2.0
219721ecb1efSmrg#
219821ecb1efSmrg# Defines the variable CHANGELOG_CMD as the command to generate
219921ecb1efSmrg# ChangeLog from git.
220021ecb1efSmrg#
220121ecb1efSmrg#
220221ecb1efSmrgAC_DEFUN([XORG_CHANGELOG], [
2203604a4f4cSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
2204604a4f4cSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2205604a4f4cSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
220621ecb1efSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
220721ecb1efSmrgAC_SUBST([CHANGELOG_CMD])
220821ecb1efSmrg]) # XORG_CHANGELOG
22091e00de39Smrg
221021ecb1efSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
221121ecb1efSmrg# 
221221ecb1efSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
221321ecb1efSmrg#
221421ecb1efSmrg# This program is free software; you can redistribute it and/or modify
221521ecb1efSmrg# it under the terms of the GNU General Public License as published by
221621ecb1efSmrg# the Free Software Foundation; either version 2 of the License, or
221721ecb1efSmrg# (at your option) any later version.
221821ecb1efSmrg#
221921ecb1efSmrg# This program is distributed in the hope that it will be useful, but
222021ecb1efSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
222121ecb1efSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
222221ecb1efSmrg# General Public License for more details.
222321ecb1efSmrg#
222421ecb1efSmrg# You should have received a copy of the GNU General Public License
222521ecb1efSmrg# along with this program; if not, write to the Free Software
222621ecb1efSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
222721ecb1efSmrg#
222821ecb1efSmrg# As a special exception to the GNU General Public License, if you
222921ecb1efSmrg# distribute this file as part of a program that contains a
223021ecb1efSmrg# configuration script generated by Autoconf, you may include it under
223121ecb1efSmrg# the same distribution terms that you use for the rest of that program.
22321e00de39Smrg
223321ecb1efSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
22341e00de39Smrg# ----------------------------------
223521ecb1efSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
223621ecb1efSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
223721ecb1efSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
223821ecb1efSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
223921ecb1efSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
224021ecb1efSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
224121ecb1efSmrgfi
224221ecb1efSmrgif test -n "$PKG_CONFIG"; then
224321ecb1efSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
224421ecb1efSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
224521ecb1efSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
224621ecb1efSmrg		AC_MSG_RESULT([yes])
224721ecb1efSmrg	else
224821ecb1efSmrg		AC_MSG_RESULT([no])
224921ecb1efSmrg		PKG_CONFIG=""
225021ecb1efSmrg	fi
225121ecb1efSmrg		
225221ecb1efSmrgfi[]dnl
225321ecb1efSmrg])# PKG_PROG_PKG_CONFIG
22541e00de39Smrg
225521ecb1efSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
225621ecb1efSmrg#
225721ecb1efSmrg# Check to see whether a particular set of modules exists.  Similar
225821ecb1efSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
225921ecb1efSmrg#
226021ecb1efSmrg#
226121ecb1efSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
226221ecb1efSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
226321ecb1efSmrg# PKG_CHECK_EXISTS manually
226421ecb1efSmrg# --------------------------------------------------------------
226521ecb1efSmrgAC_DEFUN([PKG_CHECK_EXISTS],
226621ecb1efSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
226721ecb1efSmrgif test -n "$PKG_CONFIG" && \
226821ecb1efSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
226921ecb1efSmrg  m4_ifval([$2], [$2], [:])
227021ecb1efSmrgm4_ifvaln([$3], [else
227121ecb1efSmrg  $3])dnl
227221ecb1efSmrgfi])
22731e00de39Smrg
22741e00de39Smrg
227521ecb1efSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
227621ecb1efSmrg# ---------------------------------------------
227721ecb1efSmrgm4_define([_PKG_CONFIG],
227821ecb1efSmrg[if test -n "$$1"; then
227921ecb1efSmrg    pkg_cv_[]$1="$$1"
228021ecb1efSmrg elif test -n "$PKG_CONFIG"; then
228121ecb1efSmrg    PKG_CHECK_EXISTS([$3],
228221ecb1efSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
228321ecb1efSmrg		     [pkg_failed=yes])
228421ecb1efSmrg else
228521ecb1efSmrg    pkg_failed=untried
228621ecb1efSmrgfi[]dnl
228721ecb1efSmrg])# _PKG_CONFIG
22881e00de39Smrg
228921ecb1efSmrg# _PKG_SHORT_ERRORS_SUPPORTED
229021ecb1efSmrg# -----------------------------
229121ecb1efSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
229221ecb1efSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
229321ecb1efSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
229421ecb1efSmrg        _pkg_short_errors_supported=yes
22951e00de39Smrgelse
229621ecb1efSmrg        _pkg_short_errors_supported=no
229721ecb1efSmrgfi[]dnl
229821ecb1efSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
22991e00de39Smrg
230021ecb1efSmrg
230121ecb1efSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
230221ecb1efSmrg# [ACTION-IF-NOT-FOUND])
23031e00de39Smrg#
230421ecb1efSmrg#
230521ecb1efSmrg# Note that if there is a possibility the first call to
230621ecb1efSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
230721ecb1efSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
230821ecb1efSmrg#
230921ecb1efSmrg#
231021ecb1efSmrg# --------------------------------------------------------------
231121ecb1efSmrgAC_DEFUN([PKG_CHECK_MODULES],
231221ecb1efSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
231321ecb1efSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
231421ecb1efSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
23151e00de39Smrg
231621ecb1efSmrgpkg_failed=no
231721ecb1efSmrgAC_MSG_CHECKING([for $1])
23181e00de39Smrg
231921ecb1efSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
232021ecb1efSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
23211e00de39Smrg
232221ecb1efSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
232321ecb1efSmrgand $1[]_LIBS to avoid the need to call pkg-config.
232421ecb1efSmrgSee the pkg-config man page for more details.])
23251e00de39Smrg
232621ecb1efSmrgif test $pkg_failed = yes; then
232721ecb1efSmrg        _PKG_SHORT_ERRORS_SUPPORTED
232821ecb1efSmrg        if test $_pkg_short_errors_supported = yes; then
232921ecb1efSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
233021ecb1efSmrg        else 
233121ecb1efSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
233221ecb1efSmrg        fi
233321ecb1efSmrg	# Put the nasty error message in config.log where it belongs
233421ecb1efSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
23351e00de39Smrg
233621ecb1efSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
233721ecb1efSmrg[Package requirements ($2) were not met:
23381e00de39Smrg
233921ecb1efSmrg$$1_PKG_ERRORS
23401e00de39Smrg
234121ecb1efSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
234221ecb1efSmrginstalled software in a non-standard prefix.
23431e00de39Smrg
234421ecb1efSmrg_PKG_TEXT
234521ecb1efSmrg])],
234621ecb1efSmrg		[AC_MSG_RESULT([no])
234721ecb1efSmrg                $4])
234821ecb1efSmrgelif test $pkg_failed = untried; then
234921ecb1efSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
235021ecb1efSmrg[The pkg-config script could not be found or is too old.  Make sure it
235121ecb1efSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
235221ecb1efSmrgpath to pkg-config.
23531e00de39Smrg
235421ecb1efSmrg_PKG_TEXT
23551e00de39Smrg
235621ecb1efSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
235721ecb1efSmrg		[$4])
235821ecb1efSmrgelse
235921ecb1efSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
236021ecb1efSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
236121ecb1efSmrg        AC_MSG_RESULT([yes])
236221ecb1efSmrg	ifelse([$3], , :, [$3])
236321ecb1efSmrgfi[]dnl
236421ecb1efSmrg])# PKG_CHECK_MODULES
23651e00de39Smrg
2366