aclocal.m4 revision 2d861bc5
12d861bc5Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
244d7874bSmrg
344d7874bSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
42d861bc5Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
544d7874bSmrg# This file is free software; the Free Software Foundation
644d7874bSmrg# gives unlimited permission to copy and/or distribute it,
744d7874bSmrg# with or without modifications, as long as this notice is preserved.
844d7874bSmrg
944d7874bSmrg# This program is distributed in the hope that it will be useful,
1044d7874bSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1144d7874bSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1244d7874bSmrg# PARTICULAR PURPOSE.
1344d7874bSmrg
142d861bc5Smrgm4_ifndef([AC_AUTOCONF_VERSION],
152d861bc5Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
162d861bc5Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
172d861bc5Smrg[m4_warning([this file was generated for autoconf 2.68.
182d861bc5SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
192d861bc5SmrgIf you have problems, you may need to regenerate the build system entirely.
202d861bc5SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
2144d7874bSmrg
222d861bc5Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2344d7874bSmrg#
2444d7874bSmrg# This file is free software; the Free Software Foundation
2544d7874bSmrg# gives unlimited permission to copy and/or distribute it,
2644d7874bSmrg# with or without modifications, as long as this notice is preserved.
2744d7874bSmrg
2844d7874bSmrg# AM_AUTOMAKE_VERSION(VERSION)
2944d7874bSmrg# ----------------------------
3044d7874bSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3144d7874bSmrg# generated from the m4 files accompanying Automake X.Y.
322d861bc5Smrg# (This private macro should not be called outside this file.)
332d861bc5SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
342d861bc5Smrg[am__api_version='1.11'
352d861bc5Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
362d861bc5Smrgdnl require some minimum version.  Point them to the right macro.
372d861bc5Smrgm4_if([$1], [1.11.1], [],
382d861bc5Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
392d861bc5Smrg])
402d861bc5Smrg
412d861bc5Smrg# _AM_AUTOCONF_VERSION(VERSION)
422d861bc5Smrg# -----------------------------
432d861bc5Smrg# aclocal traces this macro to find the Autoconf version.
442d861bc5Smrg# This is a private macro too.  Using m4_define simplifies
452d861bc5Smrg# the logic in aclocal, which can simply ignore this definition.
462d861bc5Smrgm4_define([_AM_AUTOCONF_VERSION], [])
4744d7874bSmrg
4844d7874bSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
4944d7874bSmrg# -------------------------------
502d861bc5Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
512d861bc5Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5244d7874bSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
532d861bc5Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
542d861bc5Smrgm4_ifndef([AC_AUTOCONF_VERSION],
552d861bc5Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
562d861bc5Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5744d7874bSmrg
5844d7874bSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
5944d7874bSmrg
6044d7874bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6144d7874bSmrg#
6244d7874bSmrg# This file is free software; the Free Software Foundation
6344d7874bSmrg# gives unlimited permission to copy and/or distribute it,
6444d7874bSmrg# with or without modifications, as long as this notice is preserved.
6544d7874bSmrg
6644d7874bSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6744d7874bSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6844d7874bSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6944d7874bSmrg#
7044d7874bSmrg# Of course, Automake must honor this variable whenever it calls a
7144d7874bSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7244d7874bSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7344d7874bSmrg# depending on how configure is run.  This is pretty annoying, since
7444d7874bSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7544d7874bSmrg# source directory, any form will work fine, but in subdirectories a
7644d7874bSmrg# relative path needs to be adjusted first.
7744d7874bSmrg#
7844d7874bSmrg# $ac_aux_dir/missing
7944d7874bSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8044d7874bSmrg# $top_srcdir/$ac_aux_dir/missing
8144d7874bSmrg#    fails if $ac_aux_dir is absolute,
8244d7874bSmrg#    fails when called from a subdirectory in a VPATH build with
8344d7874bSmrg#          a relative $ac_aux_dir
8444d7874bSmrg#
8544d7874bSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8644d7874bSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
8744d7874bSmrg# harmless because $srcdir is `.', but things will broke when you
8844d7874bSmrg# start a VPATH build or use an absolute $srcdir.
8944d7874bSmrg#
9044d7874bSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9144d7874bSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9244d7874bSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9344d7874bSmrg# and then we would define $MISSING as
9444d7874bSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9544d7874bSmrg# This will work as long as MISSING is not called from configure, because
9644d7874bSmrg# unfortunately $(top_srcdir) has no meaning in configure.
9744d7874bSmrg# However there are other variables, like CC, which are often used in
9844d7874bSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9944d7874bSmrg#
10044d7874bSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
10144d7874bSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
10244d7874bSmrg# configured tree to be moved without reconfiguration.
10344d7874bSmrg
10444d7874bSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10544d7874bSmrg[dnl Rely on autoconf to set up CDPATH properly.
10644d7874bSmrgAC_PREREQ([2.50])dnl
10744d7874bSmrg# expand $ac_aux_dir to an absolute path
10844d7874bSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
10944d7874bSmrg])
11044d7874bSmrg
11144d7874bSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11244d7874bSmrg
1132d861bc5Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11444d7874bSmrg# Free Software Foundation, Inc.
11544d7874bSmrg#
11644d7874bSmrg# This file is free software; the Free Software Foundation
11744d7874bSmrg# gives unlimited permission to copy and/or distribute it,
11844d7874bSmrg# with or without modifications, as long as this notice is preserved.
11944d7874bSmrg
1202d861bc5Smrg# serial 9
12144d7874bSmrg
12244d7874bSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12344d7874bSmrg# -------------------------------------
12444d7874bSmrg# Define a conditional.
12544d7874bSmrgAC_DEFUN([AM_CONDITIONAL],
12644d7874bSmrg[AC_PREREQ(2.52)dnl
12744d7874bSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12844d7874bSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1292d861bc5SmrgAC_SUBST([$1_TRUE])dnl
1302d861bc5SmrgAC_SUBST([$1_FALSE])dnl
1312d861bc5Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1322d861bc5Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1332d861bc5Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13444d7874bSmrgif $2; then
13544d7874bSmrg  $1_TRUE=
13644d7874bSmrg  $1_FALSE='#'
13744d7874bSmrgelse
13844d7874bSmrg  $1_TRUE='#'
13944d7874bSmrg  $1_FALSE=
14044d7874bSmrgfi
14144d7874bSmrgAC_CONFIG_COMMANDS_PRE(
14244d7874bSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14344d7874bSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14444d7874bSmrgUsually this means the macro was only invoked conditionally.]])
14544d7874bSmrgfi])])
14644d7874bSmrg
1472d861bc5Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
14844d7874bSmrg# Free Software Foundation, Inc.
14944d7874bSmrg#
15044d7874bSmrg# This file is free software; the Free Software Foundation
15144d7874bSmrg# gives unlimited permission to copy and/or distribute it,
15244d7874bSmrg# with or without modifications, as long as this notice is preserved.
15344d7874bSmrg
1542d861bc5Smrg# serial 10
15544d7874bSmrg
15644d7874bSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
15744d7874bSmrg# written in clear, in which case automake, when reading aclocal.m4,
15844d7874bSmrg# will think it sees a *use*, and therefore will trigger all it's
15944d7874bSmrg# C support machinery.  Also note that it means that autoscan, seeing
16044d7874bSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
16144d7874bSmrg
16244d7874bSmrg
16344d7874bSmrg# _AM_DEPENDENCIES(NAME)
16444d7874bSmrg# ----------------------
16544d7874bSmrg# See how the compiler implements dependency checking.
16644d7874bSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
16744d7874bSmrg# We try a few techniques and use that to set a single cache variable.
16844d7874bSmrg#
16944d7874bSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
17044d7874bSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
17144d7874bSmrg# dependency, and given that the user is not expected to run this macro,
17244d7874bSmrg# just rely on AC_PROG_CC.
17344d7874bSmrgAC_DEFUN([_AM_DEPENDENCIES],
17444d7874bSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
17544d7874bSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
17644d7874bSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
17744d7874bSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
17844d7874bSmrg
17944d7874bSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
18044d7874bSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
18144d7874bSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1822d861bc5Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
18344d7874bSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
18444d7874bSmrg                   [depcc="$$1"   am_compiler_list=])
18544d7874bSmrg
18644d7874bSmrgAC_CACHE_CHECK([dependency style of $depcc],
18744d7874bSmrg               [am_cv_$1_dependencies_compiler_type],
18844d7874bSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
18944d7874bSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
19044d7874bSmrg  # making bogus files that we don't know about and never remove.  For
19144d7874bSmrg  # instance it was reported that on HP-UX the gcc test will end up
19244d7874bSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
19344d7874bSmrg  # in D'.
19444d7874bSmrg  mkdir conftest.dir
19544d7874bSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19644d7874bSmrg  # using a relative directory.
19744d7874bSmrg  cp "$am_depcomp" conftest.dir
19844d7874bSmrg  cd conftest.dir
19944d7874bSmrg  # We will build objects and dependencies in a subdirectory because
20044d7874bSmrg  # it helps to detect inapplicable dependency modes.  For instance
20144d7874bSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
20244d7874bSmrg  # side effect of compilation, but ICC will put the dependencies in
20344d7874bSmrg  # the current directory while Tru64 will put them in the object
20444d7874bSmrg  # directory.
20544d7874bSmrg  mkdir sub
20644d7874bSmrg
20744d7874bSmrg  am_cv_$1_dependencies_compiler_type=none
20844d7874bSmrg  if test "$am_compiler_list" = ""; then
20944d7874bSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
21044d7874bSmrg  fi
2112d861bc5Smrg  am__universal=false
2122d861bc5Smrg  m4_case([$1], [CC],
2132d861bc5Smrg    [case " $depcc " in #(
2142d861bc5Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2152d861bc5Smrg     esac],
2162d861bc5Smrg    [CXX],
2172d861bc5Smrg    [case " $depcc " in #(
2182d861bc5Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2192d861bc5Smrg     esac])
2202d861bc5Smrg
22144d7874bSmrg  for depmode in $am_compiler_list; do
22244d7874bSmrg    # Setup a source with many dependencies, because some compilers
22344d7874bSmrg    # like to wrap large dependency lists on column 80 (with \), and
22444d7874bSmrg    # we should not choose a depcomp mode which is confused by this.
22544d7874bSmrg    #
22644d7874bSmrg    # We need to recreate these files for each test, as the compiler may
22744d7874bSmrg    # overwrite some of them when testing with obscure command lines.
22844d7874bSmrg    # This happens at least with the AIX C compiler.
22944d7874bSmrg    : > sub/conftest.c
23044d7874bSmrg    for i in 1 2 3 4 5 6; do
23144d7874bSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23244d7874bSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
23344d7874bSmrg      # Solaris 8's {/usr,}/bin/sh.
23444d7874bSmrg      touch sub/conftst$i.h
23544d7874bSmrg    done
23644d7874bSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
23744d7874bSmrg
2382d861bc5Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2392d861bc5Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2402d861bc5Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
2412d861bc5Smrg    # versions had trouble with output in subdirs
2422d861bc5Smrg    am__obj=sub/conftest.${OBJEXT-o}
2432d861bc5Smrg    am__minus_obj="-o $am__obj"
24444d7874bSmrg    case $depmode in
2452d861bc5Smrg    gcc)
2462d861bc5Smrg      # This depmode causes a compiler race in universal mode.
2472d861bc5Smrg      test "$am__universal" = false || continue
2482d861bc5Smrg      ;;
24944d7874bSmrg    nosideeffect)
25044d7874bSmrg      # after this tag, mechanisms are not by side-effect, so they'll
25144d7874bSmrg      # only be used when explicitly requested
25244d7874bSmrg      if test "x$enable_dependency_tracking" = xyes; then
25344d7874bSmrg	continue
25444d7874bSmrg      else
25544d7874bSmrg	break
25644d7874bSmrg      fi
25744d7874bSmrg      ;;
2582d861bc5Smrg    msvisualcpp | msvcmsys)
2592d861bc5Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
2602d861bc5Smrg      # not run yet.  These depmodes are late enough in the game, and
2612d861bc5Smrg      # so weak that their functioning should not be impacted.
2622d861bc5Smrg      am__obj=conftest.${OBJEXT-o}
2632d861bc5Smrg      am__minus_obj=
2642d861bc5Smrg      ;;
26544d7874bSmrg    none) break ;;
26644d7874bSmrg    esac
26744d7874bSmrg    if depmode=$depmode \
2682d861bc5Smrg       source=sub/conftest.c object=$am__obj \
26944d7874bSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2702d861bc5Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
27144d7874bSmrg         >/dev/null 2>conftest.err &&
2722d861bc5Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
27344d7874bSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2742d861bc5Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
27544d7874bSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
27644d7874bSmrg      # icc doesn't choke on unknown options, it will just issue warnings
27744d7874bSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
27844d7874bSmrg      # that says an option was ignored or not supported.
27944d7874bSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
28044d7874bSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
28144d7874bSmrg      # The diagnosis changed in icc 8.0:
28244d7874bSmrg      #   icc: Command line remark: option '-MP' not supported
28344d7874bSmrg      if (grep 'ignoring option' conftest.err ||
28444d7874bSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
28544d7874bSmrg        am_cv_$1_dependencies_compiler_type=$depmode
28644d7874bSmrg        break
28744d7874bSmrg      fi
28844d7874bSmrg    fi
28944d7874bSmrg  done
29044d7874bSmrg
29144d7874bSmrg  cd ..
29244d7874bSmrg  rm -rf conftest.dir
29344d7874bSmrgelse
29444d7874bSmrg  am_cv_$1_dependencies_compiler_type=none
29544d7874bSmrgfi
29644d7874bSmrg])
29744d7874bSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
29844d7874bSmrgAM_CONDITIONAL([am__fastdep$1], [
29944d7874bSmrg  test "x$enable_dependency_tracking" != xno \
30044d7874bSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
30144d7874bSmrg])
30244d7874bSmrg
30344d7874bSmrg
30444d7874bSmrg# AM_SET_DEPDIR
30544d7874bSmrg# -------------
30644d7874bSmrg# Choose a directory name for dependency files.
30744d7874bSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
30844d7874bSmrgAC_DEFUN([AM_SET_DEPDIR],
30944d7874bSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
31044d7874bSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
31144d7874bSmrg])
31244d7874bSmrg
31344d7874bSmrg
31444d7874bSmrg# AM_DEP_TRACK
31544d7874bSmrg# ------------
31644d7874bSmrgAC_DEFUN([AM_DEP_TRACK],
31744d7874bSmrg[AC_ARG_ENABLE(dependency-tracking,
31844d7874bSmrg[  --disable-dependency-tracking  speeds up one-time build
31944d7874bSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
32044d7874bSmrgif test "x$enable_dependency_tracking" != xno; then
32144d7874bSmrg  am_depcomp="$ac_aux_dir/depcomp"
32244d7874bSmrg  AMDEPBACKSLASH='\'
32344d7874bSmrgfi
32444d7874bSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3252d861bc5SmrgAC_SUBST([AMDEPBACKSLASH])dnl
3262d861bc5Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
32744d7874bSmrg])
32844d7874bSmrg
32944d7874bSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
33044d7874bSmrg
3312d861bc5Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33244d7874bSmrg# Free Software Foundation, Inc.
33344d7874bSmrg#
33444d7874bSmrg# This file is free software; the Free Software Foundation
33544d7874bSmrg# gives unlimited permission to copy and/or distribute it,
33644d7874bSmrg# with or without modifications, as long as this notice is preserved.
33744d7874bSmrg
3382d861bc5Smrg#serial 5
33944d7874bSmrg
34044d7874bSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
34144d7874bSmrg# ------------------------------
34244d7874bSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3432d861bc5Smrg[{
3442d861bc5Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
3452d861bc5Smrg  # are listed without --file.  Let's play safe and only enable the eval
3462d861bc5Smrg  # if we detect the quoting.
3472d861bc5Smrg  case $CONFIG_FILES in
3482d861bc5Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
3492d861bc5Smrg  *)   set x $CONFIG_FILES ;;
3502d861bc5Smrg  esac
3512d861bc5Smrg  shift
3522d861bc5Smrg  for mf
3532d861bc5Smrg  do
3542d861bc5Smrg    # Strip MF so we end up with the name of the file.
3552d861bc5Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3562d861bc5Smrg    # Check whether this is an Automake generated Makefile or not.
3572d861bc5Smrg    # We used to match only the files named `Makefile.in', but
3582d861bc5Smrg    # some people rename them; so instead we look at the file content.
3592d861bc5Smrg    # Grep'ing the first line is not enough: some people post-process
3602d861bc5Smrg    # each Makefile.in and add a new line on top of each file to say so.
3612d861bc5Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
3622d861bc5Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
3632d861bc5Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3642d861bc5Smrg      dirpart=`AS_DIRNAME("$mf")`
3652d861bc5Smrg    else
3662d861bc5Smrg      continue
3672d861bc5Smrg    fi
3682d861bc5Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
3692d861bc5Smrg    # from the Makefile without running `make'.
3702d861bc5Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3712d861bc5Smrg    test -z "$DEPDIR" && continue
3722d861bc5Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3732d861bc5Smrg    test -z "am__include" && continue
3742d861bc5Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3752d861bc5Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
3762d861bc5Smrg    U=`sed -n 's/^U = //p' < "$mf"`
3772d861bc5Smrg    # Find all dependency output files, they are included files with
3782d861bc5Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3792d861bc5Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3802d861bc5Smrg    # expansion.
3812d861bc5Smrg    for file in `sed -n "
3822d861bc5Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3832d861bc5Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3842d861bc5Smrg      # Make sure the directory exists.
3852d861bc5Smrg      test -f "$dirpart/$file" && continue
3862d861bc5Smrg      fdir=`AS_DIRNAME(["$file"])`
3872d861bc5Smrg      AS_MKDIR_P([$dirpart/$fdir])
3882d861bc5Smrg      # echo "creating $dirpart/$file"
3892d861bc5Smrg      echo '# dummy' > "$dirpart/$file"
3902d861bc5Smrg    done
39144d7874bSmrg  done
3922d861bc5Smrg}
39344d7874bSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
39444d7874bSmrg
39544d7874bSmrg
39644d7874bSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
39744d7874bSmrg# -----------------------------
39844d7874bSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
39944d7874bSmrg#
40044d7874bSmrg# This code is only required when automatic dependency tracking
40144d7874bSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
40244d7874bSmrg# need in order to bootstrap the dependency handling code.
40344d7874bSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
40444d7874bSmrg[AC_CONFIG_COMMANDS([depfiles],
40544d7874bSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
40644d7874bSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
40744d7874bSmrg])
40844d7874bSmrg
40944d7874bSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
41044d7874bSmrg# Free Software Foundation, Inc.
41144d7874bSmrg#
41244d7874bSmrg# This file is free software; the Free Software Foundation
41344d7874bSmrg# gives unlimited permission to copy and/or distribute it,
41444d7874bSmrg# with or without modifications, as long as this notice is preserved.
41544d7874bSmrg
41644d7874bSmrg# serial 8
41744d7874bSmrg
41844d7874bSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
41944d7874bSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
42044d7874bSmrg
42144d7874bSmrg# Do all the work for Automake.                             -*- Autoconf -*-
42244d7874bSmrg
4232d861bc5Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4242d861bc5Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
42544d7874bSmrg#
42644d7874bSmrg# This file is free software; the Free Software Foundation
42744d7874bSmrg# gives unlimited permission to copy and/or distribute it,
42844d7874bSmrg# with or without modifications, as long as this notice is preserved.
42944d7874bSmrg
4302d861bc5Smrg# serial 16
43144d7874bSmrg
43244d7874bSmrg# This macro actually does too much.  Some checks are only needed if
43344d7874bSmrg# your package does certain things.  But this isn't really a big deal.
43444d7874bSmrg
43544d7874bSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
43644d7874bSmrg# AM_INIT_AUTOMAKE([OPTIONS])
43744d7874bSmrg# -----------------------------------------------
43844d7874bSmrg# The call with PACKAGE and VERSION arguments is the old style
43944d7874bSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
44044d7874bSmrg# and VERSION should now be passed to AC_INIT and removed from
44144d7874bSmrg# the call to AM_INIT_AUTOMAKE.
44244d7874bSmrg# We support both call styles for the transition.  After
44344d7874bSmrg# the next Automake release, Autoconf can make the AC_INIT
44444d7874bSmrg# arguments mandatory, and then we can depend on a new Autoconf
44544d7874bSmrg# release and drop the old call support.
44644d7874bSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4472d861bc5Smrg[AC_PREREQ([2.62])dnl
44844d7874bSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
44944d7874bSmrgdnl the ones we care about.
45044d7874bSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
45144d7874bSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
45244d7874bSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4532d861bc5Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4542d861bc5Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4552d861bc5Smrg  # is not polluted with repeated "-I."
4562d861bc5Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4572d861bc5Smrg  # test to see if srcdir already configured
4582d861bc5Smrg  if test -f $srcdir/config.status; then
4592d861bc5Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4602d861bc5Smrg  fi
46144d7874bSmrgfi
46244d7874bSmrg
46344d7874bSmrg# test whether we have cygpath
46444d7874bSmrgif test -z "$CYGPATH_W"; then
46544d7874bSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
46644d7874bSmrg    CYGPATH_W='cygpath -w'
46744d7874bSmrg  else
46844d7874bSmrg    CYGPATH_W=echo
46944d7874bSmrg  fi
47044d7874bSmrgfi
47144d7874bSmrgAC_SUBST([CYGPATH_W])
47244d7874bSmrg
47344d7874bSmrg# Define the identity of the package.
47444d7874bSmrgdnl Distinguish between old-style and new-style calls.
47544d7874bSmrgm4_ifval([$2],
47644d7874bSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
47744d7874bSmrg AC_SUBST([PACKAGE], [$1])dnl
47844d7874bSmrg AC_SUBST([VERSION], [$2])],
47944d7874bSmrg[_AM_SET_OPTIONS([$1])dnl
4802d861bc5Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4812d861bc5Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4822d861bc5Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
48344d7874bSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
48444d7874bSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
48544d7874bSmrg
48644d7874bSmrg_AM_IF_OPTION([no-define],,
48744d7874bSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
48844d7874bSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
48944d7874bSmrg
49044d7874bSmrg# Some tools Automake needs.
49144d7874bSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
49244d7874bSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
49344d7874bSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
49444d7874bSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
49544d7874bSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
49644d7874bSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
49744d7874bSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4982d861bc5SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4992d861bc5SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
50044d7874bSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
50144d7874bSmrg# We need awk for the "check" target.  The system "awk" is bad on
50244d7874bSmrg# some platforms.
50344d7874bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
50444d7874bSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
50544d7874bSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
50644d7874bSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
5072d861bc5Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
5082d861bc5Smrg			     [_AM_PROG_TAR([v7])])])
50944d7874bSmrg_AM_IF_OPTION([no-dependencies],,
51044d7874bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
5112d861bc5Smrg		  [_AM_DEPENDENCIES(CC)],
5122d861bc5Smrg		  [define([AC_PROG_CC],
5132d861bc5Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
51444d7874bSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5152d861bc5Smrg		  [_AM_DEPENDENCIES(CXX)],
5162d861bc5Smrg		  [define([AC_PROG_CXX],
5172d861bc5Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5182d861bc5SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5192d861bc5Smrg		  [_AM_DEPENDENCIES(OBJC)],
5202d861bc5Smrg		  [define([AC_PROG_OBJC],
5212d861bc5Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
52244d7874bSmrg])
5232d861bc5Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5242d861bc5Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5252d861bc5Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5262d861bc5Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5272d861bc5SmrgAC_CONFIG_COMMANDS_PRE(dnl
5282d861bc5Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5292d861bc5Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
53044d7874bSmrg])
53144d7874bSmrg
5322d861bc5Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5332d861bc5Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5342d861bc5Smrgdnl mangled by Autoconf and run in a shell conditional statement.
5352d861bc5Smrgm4_define([_AC_COMPILER_EXEEXT],
5362d861bc5Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5372d861bc5Smrg
53844d7874bSmrg
53944d7874bSmrg# When config.status generates a header, we must update the stamp-h file.
54044d7874bSmrg# This file resides in the same directory as the config header
54144d7874bSmrg# that is generated.  The stamp files are numbered to have different names.
54244d7874bSmrg
54344d7874bSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
54444d7874bSmrg# loop where config.status creates the headers, so we can generate
54544d7874bSmrg# our stamp files there.
54644d7874bSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
54744d7874bSmrg[# Compute $1's index in $config_headers.
5482d861bc5Smrg_am_arg=$1
54944d7874bSmrg_am_stamp_count=1
55044d7874bSmrgfor _am_header in $config_headers :; do
55144d7874bSmrg  case $_am_header in
5522d861bc5Smrg    $_am_arg | $_am_arg:* )
55344d7874bSmrg      break ;;
55444d7874bSmrg    * )
55544d7874bSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
55644d7874bSmrg  esac
55744d7874bSmrgdone
5582d861bc5Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
55944d7874bSmrg
5602d861bc5Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
56144d7874bSmrg#
56244d7874bSmrg# This file is free software; the Free Software Foundation
56344d7874bSmrg# gives unlimited permission to copy and/or distribute it,
56444d7874bSmrg# with or without modifications, as long as this notice is preserved.
56544d7874bSmrg
56644d7874bSmrg# AM_PROG_INSTALL_SH
56744d7874bSmrg# ------------------
56844d7874bSmrg# Define $install_sh.
56944d7874bSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
57044d7874bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5712d861bc5Smrgif test x"${install_sh}" != xset; then
5722d861bc5Smrg  case $am_aux_dir in
5732d861bc5Smrg  *\ * | *\	*)
5742d861bc5Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5752d861bc5Smrg  *)
5762d861bc5Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5772d861bc5Smrg  esac
5782d861bc5Smrgfi
57944d7874bSmrgAC_SUBST(install_sh)])
58044d7874bSmrg
58144d7874bSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
58244d7874bSmrg#
58344d7874bSmrg# This file is free software; the Free Software Foundation
58444d7874bSmrg# gives unlimited permission to copy and/or distribute it,
58544d7874bSmrg# with or without modifications, as long as this notice is preserved.
58644d7874bSmrg
58744d7874bSmrg# serial 2
58844d7874bSmrg
58944d7874bSmrg# Check whether the underlying file-system supports filenames
59044d7874bSmrg# with a leading dot.  For instance MS-DOS doesn't.
59144d7874bSmrgAC_DEFUN([AM_SET_LEADING_DOT],
59244d7874bSmrg[rm -rf .tst 2>/dev/null
59344d7874bSmrgmkdir .tst 2>/dev/null
59444d7874bSmrgif test -d .tst; then
59544d7874bSmrg  am__leading_dot=.
59644d7874bSmrgelse
59744d7874bSmrg  am__leading_dot=_
59844d7874bSmrgfi
59944d7874bSmrgrmdir .tst 2>/dev/null
60044d7874bSmrgAC_SUBST([am__leading_dot])])
60144d7874bSmrg
60244d7874bSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
60344d7874bSmrg# From Jim Meyering
60444d7874bSmrg
6052d861bc5Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
60644d7874bSmrg# Free Software Foundation, Inc.
60744d7874bSmrg#
60844d7874bSmrg# This file is free software; the Free Software Foundation
60944d7874bSmrg# gives unlimited permission to copy and/or distribute it,
61044d7874bSmrg# with or without modifications, as long as this notice is preserved.
61144d7874bSmrg
6122d861bc5Smrg# serial 5
61344d7874bSmrg
6142d861bc5Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6152d861bc5Smrg# ----------------------------------
6162d861bc5Smrg# Control maintainer-specific portions of Makefiles.
6172d861bc5Smrg# Default is to disable them, unless `enable' is passed literally.
6182d861bc5Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6192d861bc5Smrg# can override the default with the --enable/--disable switch.
62044d7874bSmrgAC_DEFUN([AM_MAINTAINER_MODE],
6212d861bc5Smrg[m4_case(m4_default([$1], [disable]),
6222d861bc5Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
6232d861bc5Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
6242d861bc5Smrg       [m4_define([am_maintainer_other], [enable])
6252d861bc5Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6262d861bc5SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6272d861bc5Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6282d861bc5Smrg  AC_ARG_ENABLE([maintainer-mode],
6292d861bc5Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
63044d7874bSmrg			  (and sometimes confusing) to the casual installer],
6312d861bc5Smrg      [USE_MAINTAINER_MODE=$enableval],
6322d861bc5Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
63344d7874bSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6342d861bc5Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
63544d7874bSmrg  MAINT=$MAINTAINER_MODE_TRUE
6362d861bc5Smrg  AC_SUBST([MAINT])dnl
63744d7874bSmrg]
63844d7874bSmrg)
63944d7874bSmrg
64044d7874bSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
64144d7874bSmrg
64244d7874bSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
64344d7874bSmrg
6442d861bc5Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
64544d7874bSmrg#
64644d7874bSmrg# This file is free software; the Free Software Foundation
64744d7874bSmrg# gives unlimited permission to copy and/or distribute it,
64844d7874bSmrg# with or without modifications, as long as this notice is preserved.
64944d7874bSmrg
6502d861bc5Smrg# serial 4
65144d7874bSmrg
65244d7874bSmrg# AM_MAKE_INCLUDE()
65344d7874bSmrg# -----------------
65444d7874bSmrg# Check to see how make treats includes.
65544d7874bSmrgAC_DEFUN([AM_MAKE_INCLUDE],
65644d7874bSmrg[am_make=${MAKE-make}
65744d7874bSmrgcat > confinc << 'END'
65844d7874bSmrgam__doit:
6592d861bc5Smrg	@echo this is the am__doit target
66044d7874bSmrg.PHONY: am__doit
66144d7874bSmrgEND
66244d7874bSmrg# If we don't find an include directive, just comment out the code.
66344d7874bSmrgAC_MSG_CHECKING([for style of include used by $am_make])
66444d7874bSmrgam__include="#"
66544d7874bSmrgam__quote=
66644d7874bSmrg_am_result=none
66744d7874bSmrg# First try GNU make style include.
66844d7874bSmrgecho "include confinc" > confmf
6692d861bc5Smrg# Ignore all kinds of additional output from `make'.
6702d861bc5Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6712d861bc5Smrg*the\ am__doit\ target*)
6722d861bc5Smrg  am__include=include
6732d861bc5Smrg  am__quote=
6742d861bc5Smrg  _am_result=GNU
6752d861bc5Smrg  ;;
6762d861bc5Smrgesac
67744d7874bSmrg# Now try BSD make style include.
67844d7874bSmrgif test "$am__include" = "#"; then
67944d7874bSmrg   echo '.include "confinc"' > confmf
6802d861bc5Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6812d861bc5Smrg   *the\ am__doit\ target*)
6822d861bc5Smrg     am__include=.include
6832d861bc5Smrg     am__quote="\""
6842d861bc5Smrg     _am_result=BSD
6852d861bc5Smrg     ;;
6862d861bc5Smrg   esac
68744d7874bSmrgfi
68844d7874bSmrgAC_SUBST([am__include])
68944d7874bSmrgAC_SUBST([am__quote])
69044d7874bSmrgAC_MSG_RESULT([$_am_result])
69144d7874bSmrgrm -f confinc confmf
69244d7874bSmrg])
69344d7874bSmrg
69444d7874bSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
69544d7874bSmrg
6962d861bc5Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
69744d7874bSmrg# Free Software Foundation, Inc.
69844d7874bSmrg#
69944d7874bSmrg# This file is free software; the Free Software Foundation
70044d7874bSmrg# gives unlimited permission to copy and/or distribute it,
70144d7874bSmrg# with or without modifications, as long as this notice is preserved.
70244d7874bSmrg
7032d861bc5Smrg# serial 6
70444d7874bSmrg
70544d7874bSmrg# AM_MISSING_PROG(NAME, PROGRAM)
70644d7874bSmrg# ------------------------------
70744d7874bSmrgAC_DEFUN([AM_MISSING_PROG],
70844d7874bSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
70944d7874bSmrg$1=${$1-"${am_missing_run}$2"}
71044d7874bSmrgAC_SUBST($1)])
71144d7874bSmrg
71244d7874bSmrg
71344d7874bSmrg# AM_MISSING_HAS_RUN
71444d7874bSmrg# ------------------
71544d7874bSmrg# Define MISSING if not defined so far and test if it supports --run.
71644d7874bSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
71744d7874bSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
71844d7874bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7192d861bc5SmrgAC_REQUIRE_AUX_FILE([missing])dnl
7202d861bc5Smrgif test x"${MISSING+set}" != xset; then
7212d861bc5Smrg  case $am_aux_dir in
7222d861bc5Smrg  *\ * | *\	*)
7232d861bc5Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7242d861bc5Smrg  *)
7252d861bc5Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7262d861bc5Smrg  esac
7272d861bc5Smrgfi
72844d7874bSmrg# Use eval to expand $SHELL
72944d7874bSmrgif eval "$MISSING --run true"; then
73044d7874bSmrg  am_missing_run="$MISSING --run "
73144d7874bSmrgelse
73244d7874bSmrg  am_missing_run=
73344d7874bSmrg  AC_MSG_WARN([`missing' script is too old or missing])
73444d7874bSmrgfi
73544d7874bSmrg])
73644d7874bSmrg
7372d861bc5Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
73844d7874bSmrg#
73944d7874bSmrg# This file is free software; the Free Software Foundation
74044d7874bSmrg# gives unlimited permission to copy and/or distribute it,
74144d7874bSmrg# with or without modifications, as long as this notice is preserved.
74244d7874bSmrg
74344d7874bSmrg# AM_PROG_MKDIR_P
74444d7874bSmrg# ---------------
7452d861bc5Smrg# Check for `mkdir -p'.
74644d7874bSmrgAC_DEFUN([AM_PROG_MKDIR_P],
7472d861bc5Smrg[AC_PREREQ([2.60])dnl
7482d861bc5SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7492d861bc5Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7502d861bc5Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
7512d861bc5Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7522d861bc5Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7532d861bc5Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7542d861bc5Smrgdnl adjustment using top_builddir (which is defined more often than
7552d861bc5Smrgdnl MKDIR_P).
7562d861bc5SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7572d861bc5Smrgcase $mkdir_p in
7582d861bc5Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7592d861bc5Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7602d861bc5Smrgesac
7612d861bc5Smrg])
76244d7874bSmrg
76344d7874bSmrg# Helper functions for option handling.                     -*- Autoconf -*-
76444d7874bSmrg
7652d861bc5Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
76644d7874bSmrg#
76744d7874bSmrg# This file is free software; the Free Software Foundation
76844d7874bSmrg# gives unlimited permission to copy and/or distribute it,
76944d7874bSmrg# with or without modifications, as long as this notice is preserved.
77044d7874bSmrg
7712d861bc5Smrg# serial 4
77244d7874bSmrg
77344d7874bSmrg# _AM_MANGLE_OPTION(NAME)
77444d7874bSmrg# -----------------------
77544d7874bSmrgAC_DEFUN([_AM_MANGLE_OPTION],
77644d7874bSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
77744d7874bSmrg
77844d7874bSmrg# _AM_SET_OPTION(NAME)
77944d7874bSmrg# ------------------------------
78044d7874bSmrg# Set option NAME.  Presently that only means defining a flag for this option.
78144d7874bSmrgAC_DEFUN([_AM_SET_OPTION],
78244d7874bSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
78344d7874bSmrg
78444d7874bSmrg# _AM_SET_OPTIONS(OPTIONS)
78544d7874bSmrg# ----------------------------------
78644d7874bSmrg# OPTIONS is a space-separated list of Automake options.
78744d7874bSmrgAC_DEFUN([_AM_SET_OPTIONS],
7882d861bc5Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
78944d7874bSmrg
79044d7874bSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
79144d7874bSmrg# -------------------------------------------
79244d7874bSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
79344d7874bSmrgAC_DEFUN([_AM_IF_OPTION],
79444d7874bSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
79544d7874bSmrg
79644d7874bSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
79744d7874bSmrg
7982d861bc5Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
79944d7874bSmrg# Free Software Foundation, Inc.
80044d7874bSmrg#
80144d7874bSmrg# This file is free software; the Free Software Foundation
80244d7874bSmrg# gives unlimited permission to copy and/or distribute it,
80344d7874bSmrg# with or without modifications, as long as this notice is preserved.
80444d7874bSmrg
8052d861bc5Smrg# serial 5
80644d7874bSmrg
80744d7874bSmrg# AM_SANITY_CHECK
80844d7874bSmrg# ---------------
80944d7874bSmrgAC_DEFUN([AM_SANITY_CHECK],
81044d7874bSmrg[AC_MSG_CHECKING([whether build environment is sane])
81144d7874bSmrg# Just in case
81244d7874bSmrgsleep 1
81344d7874bSmrgecho timestamp > conftest.file
8142d861bc5Smrg# Reject unsafe characters in $srcdir or the absolute working directory
8152d861bc5Smrg# name.  Accept space and tab only in the latter.
8162d861bc5Smrgam_lf='
8172d861bc5Smrg'
8182d861bc5Smrgcase `pwd` in
8192d861bc5Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8202d861bc5Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8212d861bc5Smrgesac
8222d861bc5Smrgcase $srcdir in
8232d861bc5Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8242d861bc5Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8252d861bc5Smrgesac
8262d861bc5Smrg
82744d7874bSmrg# Do `set' in a subshell so we don't clobber the current shell's
82844d7874bSmrg# arguments.  Must try -L first in case configure is actually a
82944d7874bSmrg# symlink; some systems play weird games with the mod time of symlinks
83044d7874bSmrg# (eg FreeBSD returns the mod time of the symlink's containing
83144d7874bSmrg# directory).
83244d7874bSmrgif (
8332d861bc5Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
83444d7874bSmrg   if test "$[*]" = "X"; then
83544d7874bSmrg      # -L didn't work.
8362d861bc5Smrg      set X `ls -t "$srcdir/configure" conftest.file`
83744d7874bSmrg   fi
83844d7874bSmrg   rm -f conftest.file
83944d7874bSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
84044d7874bSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
84144d7874bSmrg
84244d7874bSmrg      # If neither matched, then we have a broken ls.  This can happen
84344d7874bSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
84444d7874bSmrg      # broken ls alias from the environment.  This has actually
84544d7874bSmrg      # happened.  Such a system could not be considered "sane".
84644d7874bSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
84744d7874bSmrgalias in your environment])
84844d7874bSmrg   fi
84944d7874bSmrg
85044d7874bSmrg   test "$[2]" = conftest.file
85144d7874bSmrg   )
85244d7874bSmrgthen
85344d7874bSmrg   # Ok.
85444d7874bSmrg   :
85544d7874bSmrgelse
85644d7874bSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
85744d7874bSmrgCheck your system clock])
85844d7874bSmrgfi
85944d7874bSmrgAC_MSG_RESULT(yes)])
86044d7874bSmrg
8612d861bc5Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
8622d861bc5Smrg#
8632d861bc5Smrg# This file is free software; the Free Software Foundation
8642d861bc5Smrg# gives unlimited permission to copy and/or distribute it,
8652d861bc5Smrg# with or without modifications, as long as this notice is preserved.
8662d861bc5Smrg
8672d861bc5Smrg# serial 1
8682d861bc5Smrg
8692d861bc5Smrg# AM_SILENT_RULES([DEFAULT])
8702d861bc5Smrg# --------------------------
8712d861bc5Smrg# Enable less verbose build rules; with the default set to DEFAULT
8722d861bc5Smrg# (`yes' being less verbose, `no' or empty being verbose).
8732d861bc5SmrgAC_DEFUN([AM_SILENT_RULES],
8742d861bc5Smrg[AC_ARG_ENABLE([silent-rules],
8752d861bc5Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8762d861bc5Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8772d861bc5Smrgcase $enable_silent_rules in
8782d861bc5Smrgyes) AM_DEFAULT_VERBOSITY=0;;
8792d861bc5Smrgno)  AM_DEFAULT_VERBOSITY=1;;
8802d861bc5Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8812d861bc5Smrgesac
8822d861bc5SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8832d861bc5SmrgAM_BACKSLASH='\'
8842d861bc5SmrgAC_SUBST([AM_BACKSLASH])dnl
8852d861bc5Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8862d861bc5Smrg])
8872d861bc5Smrg
88844d7874bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
88944d7874bSmrg#
89044d7874bSmrg# This file is free software; the Free Software Foundation
89144d7874bSmrg# gives unlimited permission to copy and/or distribute it,
89244d7874bSmrg# with or without modifications, as long as this notice is preserved.
89344d7874bSmrg
89444d7874bSmrg# AM_PROG_INSTALL_STRIP
89544d7874bSmrg# ---------------------
89644d7874bSmrg# One issue with vendor `install' (even GNU) is that you can't
89744d7874bSmrg# specify the program used to strip binaries.  This is especially
89844d7874bSmrg# annoying in cross-compiling environments, where the build's strip
89944d7874bSmrg# is unlikely to handle the host's binaries.
90044d7874bSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
90144d7874bSmrg# always use install-sh in `make install-strip', and initialize
90244d7874bSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
90344d7874bSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
90444d7874bSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
90544d7874bSmrg# Installed binaries are usually stripped using `strip' when the user
90644d7874bSmrg# run `make install-strip'.  However `strip' might not be the right
90744d7874bSmrg# tool to use in cross-compilation environments, therefore Automake
90844d7874bSmrg# will honor the `STRIP' environment variable to overrule this program.
90944d7874bSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
91044d7874bSmrgif test "$cross_compiling" != no; then
91144d7874bSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
91244d7874bSmrgfi
9132d861bc5SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
91444d7874bSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
91544d7874bSmrg
9162d861bc5Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9172d861bc5Smrg#
9182d861bc5Smrg# This file is free software; the Free Software Foundation
9192d861bc5Smrg# gives unlimited permission to copy and/or distribute it,
9202d861bc5Smrg# with or without modifications, as long as this notice is preserved.
9212d861bc5Smrg
9222d861bc5Smrg# serial 2
9232d861bc5Smrg
9242d861bc5Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
9252d861bc5Smrg# ---------------------------
9262d861bc5Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9272d861bc5Smrg# This macro is traced by Automake.
9282d861bc5SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9292d861bc5Smrg
9302d861bc5Smrg# AM_SUBST_NOTMAKE(VARIABLE)
9312d861bc5Smrg# ---------------------------
9322d861bc5Smrg# Public sister of _AM_SUBST_NOTMAKE.
9332d861bc5SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9342d861bc5Smrg
93544d7874bSmrg# Check how to create a tarball.                            -*- Autoconf -*-
93644d7874bSmrg
93744d7874bSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
93844d7874bSmrg#
93944d7874bSmrg# This file is free software; the Free Software Foundation
94044d7874bSmrg# gives unlimited permission to copy and/or distribute it,
94144d7874bSmrg# with or without modifications, as long as this notice is preserved.
94244d7874bSmrg
94344d7874bSmrg# serial 2
94444d7874bSmrg
94544d7874bSmrg# _AM_PROG_TAR(FORMAT)
94644d7874bSmrg# --------------------
94744d7874bSmrg# Check how to create a tarball in format FORMAT.
94844d7874bSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
94944d7874bSmrg#
95044d7874bSmrg# Substitute a variable $(am__tar) that is a command
95144d7874bSmrg# writing to stdout a FORMAT-tarball containing the directory
95244d7874bSmrg# $tardir.
95344d7874bSmrg#     tardir=directory && $(am__tar) > result.tar
95444d7874bSmrg#
95544d7874bSmrg# Substitute a variable $(am__untar) that extract such
95644d7874bSmrg# a tarball read from stdin.
95744d7874bSmrg#     $(am__untar) < result.tar
95844d7874bSmrgAC_DEFUN([_AM_PROG_TAR],
95944d7874bSmrg[# Always define AMTAR for backward compatibility.
96044d7874bSmrgAM_MISSING_PROG([AMTAR], [tar])
96144d7874bSmrgm4_if([$1], [v7],
96244d7874bSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
96344d7874bSmrg     [m4_case([$1], [ustar],, [pax],,
96444d7874bSmrg              [m4_fatal([Unknown tar format])])
96544d7874bSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
96644d7874bSmrg# Loop over all known methods to create a tar archive until one works.
96744d7874bSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
96844d7874bSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
96944d7874bSmrg# Do not fold the above two line into one, because Tru64 sh and
97044d7874bSmrg# Solaris sh will not grok spaces in the rhs of `-'.
97144d7874bSmrgfor _am_tool in $_am_tools
97244d7874bSmrgdo
97344d7874bSmrg  case $_am_tool in
97444d7874bSmrg  gnutar)
97544d7874bSmrg    for _am_tar in tar gnutar gtar;
97644d7874bSmrg    do
97744d7874bSmrg      AM_RUN_LOG([$_am_tar --version]) && break
97844d7874bSmrg    done
97944d7874bSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
98044d7874bSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
98144d7874bSmrg    am__untar="$_am_tar -xf -"
98244d7874bSmrg    ;;
98344d7874bSmrg  plaintar)
98444d7874bSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
98544d7874bSmrg    # ustar tarball either.
98644d7874bSmrg    (tar --version) >/dev/null 2>&1 && continue
98744d7874bSmrg    am__tar='tar chf - "$$tardir"'
98844d7874bSmrg    am__tar_='tar chf - "$tardir"'
98944d7874bSmrg    am__untar='tar xf -'
99044d7874bSmrg    ;;
99144d7874bSmrg  pax)
99244d7874bSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
99344d7874bSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
99444d7874bSmrg    am__untar='pax -r'
99544d7874bSmrg    ;;
99644d7874bSmrg  cpio)
99744d7874bSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
99844d7874bSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
99944d7874bSmrg    am__untar='cpio -i -H $1 -d'
100044d7874bSmrg    ;;
100144d7874bSmrg  none)
100244d7874bSmrg    am__tar=false
100344d7874bSmrg    am__tar_=false
100444d7874bSmrg    am__untar=false
100544d7874bSmrg    ;;
100644d7874bSmrg  esac
100744d7874bSmrg
100844d7874bSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
100944d7874bSmrg  # and am__untar set.
101044d7874bSmrg  test -n "${am_cv_prog_tar_$1}" && break
101144d7874bSmrg
101244d7874bSmrg  # tar/untar a dummy directory, and stop if the command works
101344d7874bSmrg  rm -rf conftest.dir
101444d7874bSmrg  mkdir conftest.dir
101544d7874bSmrg  echo GrepMe > conftest.dir/file
101644d7874bSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
101744d7874bSmrg  rm -rf conftest.dir
101844d7874bSmrg  if test -s conftest.tar; then
101944d7874bSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
102044d7874bSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
102144d7874bSmrg  fi
102244d7874bSmrgdone
102344d7874bSmrgrm -rf conftest.dir
102444d7874bSmrg
102544d7874bSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
102644d7874bSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
102744d7874bSmrgAC_SUBST([am__tar])
102844d7874bSmrgAC_SUBST([am__untar])
102944d7874bSmrg]) # _AM_PROG_TAR
103044d7874bSmrg
10312d861bc5Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
103244d7874bSmrgdnl
10332d861bc5Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
103444d7874bSmrgdnl 
103544d7874bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10362d861bc5Smrgdnl copy of this software and associated documentation files (the "Software"),
10372d861bc5Smrgdnl to deal in the Software without restriction, including without limitation
10382d861bc5Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
10392d861bc5Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
10402d861bc5Smrgdnl Software is furnished to do so, subject to the following conditions:
104144d7874bSmrgdnl
10422d861bc5Smrgdnl The above copyright notice and this permission notice (including the next
10432d861bc5Smrgdnl paragraph) shall be included in all copies or substantial portions of the
10442d861bc5Smrgdnl Software.
104544d7874bSmrgdnl
10462d861bc5Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10472d861bc5Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10482d861bc5Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
10492d861bc5Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10502d861bc5Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
10512d861bc5Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
10522d861bc5Smrgdnl DEALINGS IN THE SOFTWARE.
105344d7874bSmrg
105444d7874bSmrg# XORG_MACROS_VERSION(required-version)
105544d7874bSmrg# -------------------------------------
105644d7874bSmrg# Minimum version: 1.1.0
105744d7874bSmrg#
105844d7874bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
105944d7874bSmrg# your configure.ac with the minimum required version, such as:
106044d7874bSmrg# XORG_MACROS_VERSION(1.1)
106144d7874bSmrg#
10622d861bc5Smrg# To ensure that this macro is defined, also add:
10632d861bc5Smrg# m4_ifndef([XORG_MACROS_VERSION],
10642d861bc5Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
106544d7874bSmrg#
106644d7874bSmrg#
106744d7874bSmrg# See the "minimum version" comment for each macro you use to see what 
106844d7874bSmrg# version you require.
10692d861bc5Smrgm4_defun([XORG_MACROS_VERSION],[
10702d861bc5Smrgm4_define([vers_have], [1.11.0])
10712d861bc5Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10722d861bc5Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10732d861bc5Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
10742d861bc5Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
10752d861bc5Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
10762d861bc5Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
10772d861bc5Smrgm4_undefine([vers_have])
10782d861bc5Smrgm4_undefine([maj_have])
10792d861bc5Smrgm4_undefine([maj_needed])
108044d7874bSmrg]) # XORG_MACROS_VERSION
108144d7874bSmrg
108244d7874bSmrg# XORG_PROG_RAWCPP()
108344d7874bSmrg# ------------------
108444d7874bSmrg# Minimum version: 1.0.0
108544d7874bSmrg#
108644d7874bSmrg# Find cpp program and necessary flags for use in pre-processing text files
108744d7874bSmrg# such as man pages and config files
108844d7874bSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
108944d7874bSmrgAC_REQUIRE([AC_PROG_CPP])
109044d7874bSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
109144d7874bSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
109244d7874bSmrg
109344d7874bSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
109444d7874bSmrg# which is not the best choice for supporting other OS'es, but covers most
109544d7874bSmrg# of the ones we need for now.
109644d7874bSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
109744d7874bSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
109844d7874bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
109944d7874bSmrg	AC_MSG_RESULT([no])
110044d7874bSmrgelse
110144d7874bSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
110244d7874bSmrg		RAWCPPFLAGS=-undef
110344d7874bSmrg		AC_MSG_RESULT([yes])
11042d861bc5Smrg	# under Cygwin unix is still defined even with -undef
11052d861bc5Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11062d861bc5Smrg		RAWCPPFLAGS="-undef -ansi"
11072d861bc5Smrg		AC_MSG_RESULT([yes, with -ansi])
110844d7874bSmrg	else
110944d7874bSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
111044d7874bSmrg	fi
111144d7874bSmrgfi
111244d7874bSmrgrm -f conftest.$ac_ext
111344d7874bSmrg
111444d7874bSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
111544d7874bSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
111644d7874bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
111744d7874bSmrg	AC_MSG_RESULT([no])
111844d7874bSmrgelse
111944d7874bSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
112044d7874bSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
112144d7874bSmrg		AC_MSG_RESULT([yes])
112244d7874bSmrg	else
112344d7874bSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
112444d7874bSmrg	fi
112544d7874bSmrgfi
112644d7874bSmrgrm -f conftest.$ac_ext
112744d7874bSmrgAC_SUBST(RAWCPPFLAGS)
112844d7874bSmrg]) # XORG_PROG_RAWCPP
112944d7874bSmrg
113044d7874bSmrg# XORG_MANPAGE_SECTIONS()
113144d7874bSmrg# -----------------------
113244d7874bSmrg# Minimum version: 1.0.0
113344d7874bSmrg#
113444d7874bSmrg# Determine which sections man pages go in for the different man page types
113544d7874bSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
113644d7874bSmrg# Not sure if there's any better way than just hardcoding by OS name.
113744d7874bSmrg# Override default settings by setting environment variables
11382d861bc5Smrg# Added MAN_SUBSTS in version 1.8
11392d861bc5Smrg# Added AC_PROG_SED in version 1.8
114044d7874bSmrg
114144d7874bSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
114244d7874bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
11432d861bc5SmrgAC_REQUIRE([AC_PROG_SED])
114444d7874bSmrg
114544d7874bSmrgif test x$APP_MAN_SUFFIX = x    ; then
114644d7874bSmrg    APP_MAN_SUFFIX=1
114744d7874bSmrgfi
114844d7874bSmrgif test x$APP_MAN_DIR = x    ; then
114944d7874bSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
115044d7874bSmrgfi
115144d7874bSmrg
115244d7874bSmrgif test x$LIB_MAN_SUFFIX = x    ; then
115344d7874bSmrg    LIB_MAN_SUFFIX=3
115444d7874bSmrgfi
115544d7874bSmrgif test x$LIB_MAN_DIR = x    ; then
115644d7874bSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
115744d7874bSmrgfi
115844d7874bSmrg
115944d7874bSmrgif test x$FILE_MAN_SUFFIX = x    ; then
116044d7874bSmrg    case $host_os in
116144d7874bSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
116244d7874bSmrg	*)		FILE_MAN_SUFFIX=5  ;;
116344d7874bSmrg    esac
116444d7874bSmrgfi
116544d7874bSmrgif test x$FILE_MAN_DIR = x    ; then
116644d7874bSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
116744d7874bSmrgfi
116844d7874bSmrg
116944d7874bSmrgif test x$MISC_MAN_SUFFIX = x    ; then
117044d7874bSmrg    case $host_os in
117144d7874bSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
117244d7874bSmrg	*)		MISC_MAN_SUFFIX=7  ;;
117344d7874bSmrg    esac
117444d7874bSmrgfi
117544d7874bSmrgif test x$MISC_MAN_DIR = x    ; then
117644d7874bSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
117744d7874bSmrgfi
117844d7874bSmrg
117944d7874bSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
118044d7874bSmrg    case $host_os in
118144d7874bSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
118244d7874bSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
118344d7874bSmrg    esac
118444d7874bSmrgfi
118544d7874bSmrgif test x$DRIVER_MAN_DIR = x    ; then
118644d7874bSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
118744d7874bSmrgfi
118844d7874bSmrg
118944d7874bSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
119044d7874bSmrg    case $host_os in
119144d7874bSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
119244d7874bSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
119344d7874bSmrg    esac
119444d7874bSmrgfi
119544d7874bSmrgif test x$ADMIN_MAN_DIR = x    ; then
119644d7874bSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
119744d7874bSmrgfi
119844d7874bSmrg
119944d7874bSmrg
120044d7874bSmrgAC_SUBST([APP_MAN_SUFFIX])
120144d7874bSmrgAC_SUBST([LIB_MAN_SUFFIX])
120244d7874bSmrgAC_SUBST([FILE_MAN_SUFFIX])
120344d7874bSmrgAC_SUBST([MISC_MAN_SUFFIX])
120444d7874bSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
120544d7874bSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
120644d7874bSmrgAC_SUBST([APP_MAN_DIR])
120744d7874bSmrgAC_SUBST([LIB_MAN_DIR])
120844d7874bSmrgAC_SUBST([FILE_MAN_DIR])
120944d7874bSmrgAC_SUBST([MISC_MAN_DIR])
121044d7874bSmrgAC_SUBST([DRIVER_MAN_DIR])
121144d7874bSmrgAC_SUBST([ADMIN_MAN_DIR])
12122d861bc5Smrg
12132d861bc5SmrgXORG_MAN_PAGE="X Version 11"
12142d861bc5SmrgAC_SUBST([XORG_MAN_PAGE])
12152d861bc5SmrgMAN_SUBSTS="\
12162d861bc5Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12172d861bc5Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12182d861bc5Smrg	-e 's|__xservername__|Xorg|g' \
12192d861bc5Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
12202d861bc5Smrg	-e 's|__projectroot__|\$(prefix)|g' \
12212d861bc5Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
12222d861bc5Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
12232d861bc5Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
12242d861bc5Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
12252d861bc5Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
12262d861bc5Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
12272d861bc5Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
12282d861bc5SmrgAC_SUBST([MAN_SUBSTS])
12292d861bc5Smrg
123044d7874bSmrg]) # XORG_MANPAGE_SECTIONS
123144d7874bSmrg
12322d861bc5Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
12332d861bc5Smrg# ------------------------
12342d861bc5Smrg# Minimum version: 1.7.0
12352d861bc5Smrg#
12362d861bc5Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
12372d861bc5Smrg# provided by xorg-sgml-doctools, if installed.
12382d861bc5SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
12392d861bc5SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
12402d861bc5SmrgXORG_SGML_PATH=
12412d861bc5SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
12422d861bc5Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
12432d861bc5Smrg    [m4_ifval([$1],[:],
12442d861bc5Smrg        [if test x"$cross_compiling" != x"yes" ; then
12452d861bc5Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
12462d861bc5Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
12472d861bc5Smrg         fi])
12482d861bc5Smrg    ])
12492d861bc5Smrg
12502d861bc5Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
12512d861bc5Smrg# the path and the name of the doc stylesheet
12522d861bc5Smrgif test "x$XORG_SGML_PATH" != "x" ; then
12532d861bc5Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
12542d861bc5Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
12552d861bc5Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
12562d861bc5Smrgelse
12572d861bc5Smrg   AC_MSG_RESULT([no])
12582d861bc5Smrgfi
12592d861bc5Smrg
12602d861bc5SmrgAC_SUBST(XORG_SGML_PATH)
12612d861bc5SmrgAC_SUBST(STYLESHEET_SRCDIR)
12622d861bc5SmrgAC_SUBST(XSL_STYLESHEET)
12632d861bc5SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
12642d861bc5Smrg]) # XORG_CHECK_SGML_DOCTOOLS
12652d861bc5Smrg
126644d7874bSmrg# XORG_CHECK_LINUXDOC
126744d7874bSmrg# -------------------
126844d7874bSmrg# Minimum version: 1.0.0
126944d7874bSmrg#
127044d7874bSmrg# Defines the variable MAKE_TEXT if the necessary tools and
127144d7874bSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
127244d7874bSmrg# Whether or not the necessary tools and files are found can be checked
127344d7874bSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
127444d7874bSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12752d861bc5SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
12762d861bc5SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
127744d7874bSmrg
127844d7874bSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
127944d7874bSmrg
12802d861bc5SmrgAC_MSG_CHECKING([whether to build documentation])
128144d7874bSmrg
12822d861bc5Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
128344d7874bSmrg   BUILDDOC=yes
128444d7874bSmrgelse
128544d7874bSmrg   BUILDDOC=no
128644d7874bSmrgfi
128744d7874bSmrg
128844d7874bSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
128944d7874bSmrg
129044d7874bSmrgAC_MSG_RESULT([$BUILDDOC])
129144d7874bSmrg
12922d861bc5SmrgAC_MSG_CHECKING([whether to build pdf documentation])
129344d7874bSmrg
12942d861bc5Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
129544d7874bSmrg   BUILDPDFDOC=yes
129644d7874bSmrgelse
129744d7874bSmrg   BUILDPDFDOC=no
129844d7874bSmrgfi
129944d7874bSmrg
130044d7874bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
130144d7874bSmrg
130244d7874bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
130344d7874bSmrg
13042d861bc5SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
130544d7874bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
130644d7874bSmrgMAKE_PDF="$PS2PDF"
130744d7874bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
130844d7874bSmrg
130944d7874bSmrgAC_SUBST(MAKE_TEXT)
131044d7874bSmrgAC_SUBST(MAKE_PS)
131144d7874bSmrgAC_SUBST(MAKE_PDF)
131244d7874bSmrgAC_SUBST(MAKE_HTML)
131344d7874bSmrg]) # XORG_CHECK_LINUXDOC
131444d7874bSmrg
131544d7874bSmrg# XORG_CHECK_DOCBOOK
131644d7874bSmrg# -------------------
131744d7874bSmrg# Minimum version: 1.0.0
131844d7874bSmrg#
131944d7874bSmrg# Checks for the ability to build output formats from SGML DocBook source.
132044d7874bSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
132144d7874bSmrg# indicates whether the necessary tools and files are found and, if set,
132244d7874bSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
132344d7874bSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
13242d861bc5SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
13252d861bc5Smrg
132644d7874bSmrgBUILDTXTDOC=no
132744d7874bSmrgBUILDPDFDOC=no
132844d7874bSmrgBUILDPSDOC=no
132944d7874bSmrgBUILDHTMLDOC=no
133044d7874bSmrg
133144d7874bSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
133244d7874bSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
133344d7874bSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
133444d7874bSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
133544d7874bSmrg
13362d861bc5SmrgAC_MSG_CHECKING([whether to build text documentation])
13372d861bc5Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
133844d7874bSmrg   test x$BUILD_TXTDOC != xno; then
133944d7874bSmrg	BUILDTXTDOC=yes
134044d7874bSmrgfi
134144d7874bSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
134244d7874bSmrgAC_MSG_RESULT([$BUILDTXTDOC])
134344d7874bSmrg
13442d861bc5SmrgAC_MSG_CHECKING([whether to build PDF documentation])
13452d861bc5Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
134644d7874bSmrg   test x$BUILD_PDFDOC != xno; then
134744d7874bSmrg	BUILDPDFDOC=yes
134844d7874bSmrgfi
134944d7874bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
135044d7874bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
135144d7874bSmrg
13522d861bc5SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
13532d861bc5Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
135444d7874bSmrg   test x$BUILD_PSDOC != xno; then
135544d7874bSmrg	BUILDPSDOC=yes
135644d7874bSmrgfi
135744d7874bSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
135844d7874bSmrgAC_MSG_RESULT([$BUILDPSDOC])
135944d7874bSmrg
13602d861bc5SmrgAC_MSG_CHECKING([whether to build HTML documentation])
13612d861bc5Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
136244d7874bSmrg   test x$BUILD_HTMLDOC != xno; then
136344d7874bSmrg	BUILDHTMLDOC=yes
136444d7874bSmrgfi
136544d7874bSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
136644d7874bSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
136744d7874bSmrg
136844d7874bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
136944d7874bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
137044d7874bSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
137144d7874bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
137244d7874bSmrg
137344d7874bSmrgAC_SUBST(MAKE_TEXT)
137444d7874bSmrgAC_SUBST(MAKE_PS)
137544d7874bSmrgAC_SUBST(MAKE_PDF)
137644d7874bSmrgAC_SUBST(MAKE_HTML)
137744d7874bSmrg]) # XORG_CHECK_DOCBOOK
137844d7874bSmrg
13792d861bc5Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
13802d861bc5Smrg# ----------------
13812d861bc5Smrg# Minimum version: 1.5.0
13822d861bc5Smrg# Minimum version for optional DEFAULT argument: 1.11.0
13832d861bc5Smrg#
13842d861bc5Smrg# Documentation tools are not always available on all platforms and sometimes
13852d861bc5Smrg# not at the appropriate level. This macro enables a module to test for the
13862d861bc5Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
13872d861bc5Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
13882d861bc5Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
13892d861bc5Smrg# --with-xmlto assumes 'auto'.
13902d861bc5Smrg#
13912d861bc5Smrg# Interface to module:
13922d861bc5Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
13932d861bc5Smrg# XMLTO:	returns the path of the xmlto program found
13942d861bc5Smrg#		returns the path set by the user in the environment
13952d861bc5Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
13962d861bc5Smrg#		'no' user instructs the module not to use xmlto
13972d861bc5Smrg#
13982d861bc5Smrg# Added in version 1.10.0
13992d861bc5Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
14002d861bc5Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
14012d861bc5Smrg#
14022d861bc5Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
14032d861bc5Smrg#
14042d861bc5SmrgAC_DEFUN([XORG_WITH_XMLTO],[
14052d861bc5SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
14062d861bc5Smrgm4_define([_defopt], m4_default([$2], [auto]))
14072d861bc5SmrgAC_ARG_WITH(xmlto,
14082d861bc5Smrg	AS_HELP_STRING([--with-xmlto],
14092d861bc5Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
14102d861bc5Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
14112d861bc5Smrgm4_undefine([_defopt])
14122d861bc5Smrg
14132d861bc5Smrgif test "x$use_xmlto" = x"auto"; then
14142d861bc5Smrg   AC_PATH_PROG([XMLTO], [xmlto])
14152d861bc5Smrg   if test "x$XMLTO" = "x"; then
14162d861bc5Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
14172d861bc5Smrg	have_xmlto=no
14182d861bc5Smrg   else
14192d861bc5Smrg        have_xmlto=yes
14202d861bc5Smrg   fi
14212d861bc5Smrgelif test "x$use_xmlto" = x"yes" ; then
14222d861bc5Smrg   AC_PATH_PROG([XMLTO], [xmlto])
14232d861bc5Smrg   if test "x$XMLTO" = "x"; then
14242d861bc5Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
14252d861bc5Smrg   fi
14262d861bc5Smrg   have_xmlto=yes
14272d861bc5Smrgelif test "x$use_xmlto" = x"no" ; then
14282d861bc5Smrg   if test "x$XMLTO" != "x"; then
14292d861bc5Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
14302d861bc5Smrg   fi
14312d861bc5Smrg   have_xmlto=no
14322d861bc5Smrgelse
14332d861bc5Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
14342d861bc5Smrgfi
14352d861bc5Smrg
14362d861bc5Smrg# Test for a minimum version of xmlto, if provided.
14372d861bc5Smrgm4_ifval([$1],
14382d861bc5Smrg[if test "$have_xmlto" = yes; then
14392d861bc5Smrg    # scrape the xmlto version
14402d861bc5Smrg    AC_MSG_CHECKING([the xmlto version])
14412d861bc5Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
14422d861bc5Smrg    AC_MSG_RESULT([$xmlto_version])
14432d861bc5Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
14442d861bc5Smrg        [if test "x$use_xmlto" = xauto; then
14452d861bc5Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
14462d861bc5Smrg            have_xmlto=no
14472d861bc5Smrg        else
14482d861bc5Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
14492d861bc5Smrg        fi])
14502d861bc5Smrgfi])
14512d861bc5Smrg
14522d861bc5Smrg# Test for the ability of xmlto to generate a text target
14532d861bc5Smrghave_xmlto_text=no
14542d861bc5Smrgcat > conftest.xml << "EOF"
14552d861bc5SmrgEOF
14562d861bc5SmrgAS_IF([test "$have_xmlto" = yes],
14572d861bc5Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
14582d861bc5Smrg             [have_xmlto_text=yes],
14592d861bc5Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
14602d861bc5Smrgrm -f conftest.xml
14612d861bc5SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
14622d861bc5SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
14632d861bc5Smrg]) # XORG_WITH_XMLTO
14642d861bc5Smrg
14652d861bc5Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
14662d861bc5Smrg# ----------------
14672d861bc5Smrg# Minimum version: 1.5.0
14682d861bc5Smrg# Minimum version for optional DEFAULT argument: 1.11.0
14692d861bc5Smrg#
14702d861bc5Smrg# Documentation tools are not always available on all platforms and sometimes
14712d861bc5Smrg# not at the appropriate level. This macro enables a module to test for the
14722d861bc5Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
14732d861bc5Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
14742d861bc5Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
14752d861bc5Smrg# --with-asciidoc assumes 'auto'.
14762d861bc5Smrg#
14772d861bc5Smrg# Interface to module:
14782d861bc5Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
14792d861bc5Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
14802d861bc5Smrg#		 returns the path set by the user in the environment
14812d861bc5Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
14822d861bc5Smrg#		  'no' user instructs the module not to use asciidoc
14832d861bc5Smrg#
14842d861bc5Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
14852d861bc5Smrg#
14862d861bc5SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
14872d861bc5SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
14882d861bc5Smrgm4_define([_defopt], m4_default([$2], [auto]))
14892d861bc5SmrgAC_ARG_WITH(asciidoc,
14902d861bc5Smrg	AS_HELP_STRING([--with-asciidoc],
14912d861bc5Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
14922d861bc5Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
14932d861bc5Smrgm4_undefine([_defopt])
14942d861bc5Smrg
14952d861bc5Smrgif test "x$use_asciidoc" = x"auto"; then
14962d861bc5Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
14972d861bc5Smrg   if test "x$ASCIIDOC" = "x"; then
14982d861bc5Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
14992d861bc5Smrg	have_asciidoc=no
15002d861bc5Smrg   else
15012d861bc5Smrg        have_asciidoc=yes
15022d861bc5Smrg   fi
15032d861bc5Smrgelif test "x$use_asciidoc" = x"yes" ; then
15042d861bc5Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
15052d861bc5Smrg   if test "x$ASCIIDOC" = "x"; then
15062d861bc5Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
15072d861bc5Smrg   fi
15082d861bc5Smrg   have_asciidoc=yes
15092d861bc5Smrgelif test "x$use_asciidoc" = x"no" ; then
15102d861bc5Smrg   if test "x$ASCIIDOC" != "x"; then
15112d861bc5Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
15122d861bc5Smrg   fi
15132d861bc5Smrg   have_asciidoc=no
15142d861bc5Smrgelse
15152d861bc5Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
15162d861bc5Smrgfi
15172d861bc5Smrgm4_ifval([$1],
15182d861bc5Smrg[if test "$have_asciidoc" = yes; then
15192d861bc5Smrg    # scrape the asciidoc version
15202d861bc5Smrg    AC_MSG_CHECKING([the asciidoc version])
15212d861bc5Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
15222d861bc5Smrg    AC_MSG_RESULT([$asciidoc_version])
15232d861bc5Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
15242d861bc5Smrg        [if test "x$use_asciidoc" = xauto; then
15252d861bc5Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
15262d861bc5Smrg            have_asciidoc=no
15272d861bc5Smrg        else
15282d861bc5Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
15292d861bc5Smrg        fi])
15302d861bc5Smrgfi])
15312d861bc5SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
15322d861bc5Smrg]) # XORG_WITH_ASCIIDOC
15332d861bc5Smrg
15342d861bc5Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
15352d861bc5Smrg# --------------------------------
15362d861bc5Smrg# Minimum version: 1.5.0
15372d861bc5Smrg# Minimum version for optional DEFAULT argument: 1.11.0
15382d861bc5Smrg#
15392d861bc5Smrg# Documentation tools are not always available on all platforms and sometimes
15402d861bc5Smrg# not at the appropriate level. This macro enables a module to test for the
15412d861bc5Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
15422d861bc5Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
15432d861bc5Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
15442d861bc5Smrg# --with-doxygen assumes 'auto'.
15452d861bc5Smrg#
15462d861bc5Smrg# Interface to module:
15472d861bc5Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
15482d861bc5Smrg# DOXYGEN:	 returns the path of the doxygen program found
15492d861bc5Smrg#		 returns the path set by the user in the environment
15502d861bc5Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
15512d861bc5Smrg#		  'no' user instructs the module not to use doxygen
15522d861bc5Smrg#
15532d861bc5Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
15542d861bc5Smrg#
15552d861bc5SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
15562d861bc5SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
15572d861bc5Smrgm4_define([_defopt], m4_default([$2], [auto]))
15582d861bc5SmrgAC_ARG_WITH(doxygen,
15592d861bc5Smrg	AS_HELP_STRING([--with-doxygen],
15602d861bc5Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
15612d861bc5Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
15622d861bc5Smrgm4_undefine([_defopt])
15632d861bc5Smrg
15642d861bc5Smrgif test "x$use_doxygen" = x"auto"; then
15652d861bc5Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15662d861bc5Smrg   if test "x$DOXYGEN" = "x"; then
15672d861bc5Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
15682d861bc5Smrg	have_doxygen=no
15692d861bc5Smrg   else
15702d861bc5Smrg        have_doxygen=yes
15712d861bc5Smrg   fi
15722d861bc5Smrgelif test "x$use_doxygen" = x"yes" ; then
15732d861bc5Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15742d861bc5Smrg   if test "x$DOXYGEN" = "x"; then
15752d861bc5Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
15762d861bc5Smrg   fi
15772d861bc5Smrg   have_doxygen=yes
15782d861bc5Smrgelif test "x$use_doxygen" = x"no" ; then
15792d861bc5Smrg   if test "x$DOXYGEN" != "x"; then
15802d861bc5Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
15812d861bc5Smrg   fi
15822d861bc5Smrg   have_doxygen=no
15832d861bc5Smrgelse
15842d861bc5Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
15852d861bc5Smrgfi
15862d861bc5Smrgm4_ifval([$1],
15872d861bc5Smrg[if test "$have_doxygen" = yes; then
15882d861bc5Smrg    # scrape the doxygen version
15892d861bc5Smrg    AC_MSG_CHECKING([the doxygen version])
15902d861bc5Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
15912d861bc5Smrg    AC_MSG_RESULT([$doxygen_version])
15922d861bc5Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
15932d861bc5Smrg        [if test "x$use_doxygen" = xauto; then
15942d861bc5Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
15952d861bc5Smrg            have_doxygen=no
15962d861bc5Smrg        else
15972d861bc5Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
15982d861bc5Smrg        fi])
15992d861bc5Smrgfi])
16002d861bc5SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
16012d861bc5Smrg]) # XORG_WITH_DOXYGEN
16022d861bc5Smrg
16032d861bc5Smrg# XORG_WITH_GROFF([DEFAULT])
16042d861bc5Smrg# ----------------
16052d861bc5Smrg# Minimum version: 1.6.0
16062d861bc5Smrg# Minimum version for optional DEFAULT argument: 1.11.0
16072d861bc5Smrg#
16082d861bc5Smrg# Documentation tools are not always available on all platforms and sometimes
16092d861bc5Smrg# not at the appropriate level. This macro enables a module to test for the
16102d861bc5Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
16112d861bc5Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
16122d861bc5Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
16132d861bc5Smrg# --with-groff assumes 'auto'.
16142d861bc5Smrg#
16152d861bc5Smrg# Interface to module:
16162d861bc5Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
16172d861bc5Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
16182d861bc5Smrg# HAVE_GROFF_MS: the -ms macros package
16192d861bc5Smrg# GROFF:	 returns the path of the groff program found
16202d861bc5Smrg#		 returns the path set by the user in the environment
16212d861bc5Smrg# --with-groff:	 'yes' user instructs the module to use groff
16222d861bc5Smrg#		 'no' user instructs the module not to use groff
16232d861bc5Smrg#
16242d861bc5Smrg# Added in version 1.9.0:
16252d861bc5Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
16262d861bc5Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
16272d861bc5Smrg#		   psselect from the psutils package.
16282d861bc5Smrg#		   the ghostcript package. Refer to the grohtml man pages
16292d861bc5Smrg#
16302d861bc5Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
16312d861bc5Smrg#
16322d861bc5Smrg# OS and distros often splits groff in a basic and full package, the former
16332d861bc5Smrg# having the groff program and the later having devices, fonts and macros
16342d861bc5Smrg# Checking for the groff executable is not enough.
16352d861bc5Smrg#
16362d861bc5Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
16372d861bc5Smrg# unset HAVE_GROFF or GROFF env variables.
16382d861bc5Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
16392d861bc5Smrg#
16402d861bc5SmrgAC_DEFUN([XORG_WITH_GROFF],[
16412d861bc5SmrgAC_ARG_VAR([GROFF], [Path to groff command])
16422d861bc5Smrgm4_define([_defopt], m4_default([$1], [auto]))
16432d861bc5SmrgAC_ARG_WITH(groff,
16442d861bc5Smrg	AS_HELP_STRING([--with-groff],
16452d861bc5Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
16462d861bc5Smrg	   [use_groff=$withval], [use_groff=]_defopt)
16472d861bc5Smrgm4_undefine([_defopt])
16482d861bc5Smrg
16492d861bc5Smrgif test "x$use_groff" = x"auto"; then
16502d861bc5Smrg   AC_PATH_PROG([GROFF], [groff])
16512d861bc5Smrg   if test "x$GROFF" = "x"; then
16522d861bc5Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
16532d861bc5Smrg	have_groff=no
16542d861bc5Smrg   else
16552d861bc5Smrg        have_groff=yes
16562d861bc5Smrg   fi
16572d861bc5Smrgelif test "x$use_groff" = x"yes" ; then
16582d861bc5Smrg   AC_PATH_PROG([GROFF], [groff])
16592d861bc5Smrg   if test "x$GROFF" = "x"; then
16602d861bc5Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
16612d861bc5Smrg   fi
16622d861bc5Smrg   have_groff=yes
16632d861bc5Smrgelif test "x$use_groff" = x"no" ; then
16642d861bc5Smrg   if test "x$GROFF" != "x"; then
16652d861bc5Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
16662d861bc5Smrg   fi
16672d861bc5Smrg   have_groff=no
16682d861bc5Smrgelse
16692d861bc5Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
16702d861bc5Smrgfi
16712d861bc5Smrg
16722d861bc5Smrg# We have groff, test for the presence of the macro packages
16732d861bc5Smrgif test "x$have_groff" = x"yes"; then
16742d861bc5Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
16752d861bc5Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
16762d861bc5Smrg        groff_ms_works=yes
16772d861bc5Smrg    else
16782d861bc5Smrg        groff_ms_works=no
16792d861bc5Smrg    fi
16802d861bc5Smrg    AC_MSG_RESULT([$groff_ms_works])
16812d861bc5Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
16822d861bc5Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
16832d861bc5Smrg        groff_mm_works=yes
16842d861bc5Smrg    else
16852d861bc5Smrg        groff_mm_works=no
16862d861bc5Smrg    fi
16872d861bc5Smrg    AC_MSG_RESULT([$groff_mm_works])
16882d861bc5Smrgfi
16892d861bc5Smrg
16902d861bc5Smrg# We have groff, test for HTML dependencies, one command per package
16912d861bc5Smrgif test "x$have_groff" = x"yes"; then
16922d861bc5Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
16932d861bc5Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
16942d861bc5Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
16952d861bc5Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
16962d861bc5Smrg      have_groff_html=yes
16972d861bc5Smrg   else
16982d861bc5Smrg      have_groff_html=no
16992d861bc5Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
17002d861bc5Smrg   fi
17012d861bc5Smrgfi
17022d861bc5Smrg
17032d861bc5Smrg# Set Automake conditionals for Makefiles
17042d861bc5SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
17052d861bc5SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
17062d861bc5SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
17072d861bc5SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
17082d861bc5Smrg]) # XORG_WITH_GROFF
17092d861bc5Smrg
17102d861bc5Smrg# XORG_WITH_FOP([DEFAULT])
17112d861bc5Smrg# ----------------
17122d861bc5Smrg# Minimum version: 1.6.0
17132d861bc5Smrg# Minimum version for optional DEFAULT argument: 1.11.0
17142d861bc5Smrg#
17152d861bc5Smrg# Documentation tools are not always available on all platforms and sometimes
17162d861bc5Smrg# not at the appropriate level. This macro enables a module to test for the
17172d861bc5Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
17182d861bc5Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
17192d861bc5Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
17202d861bc5Smrg# --with-fop assumes 'auto'.
17212d861bc5Smrg#
17222d861bc5Smrg# Interface to module:
17232d861bc5Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
17242d861bc5Smrg# FOP:	 	returns the path of the fop program found
17252d861bc5Smrg#		returns the path set by the user in the environment
17262d861bc5Smrg# --with-fop: 	'yes' user instructs the module to use fop
17272d861bc5Smrg#		'no' user instructs the module not to use fop
17282d861bc5Smrg#
17292d861bc5Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
17302d861bc5Smrg#
17312d861bc5SmrgAC_DEFUN([XORG_WITH_FOP],[
17322d861bc5SmrgAC_ARG_VAR([FOP], [Path to fop command])
17332d861bc5Smrgm4_define([_defopt], m4_default([$1], [auto]))
17342d861bc5SmrgAC_ARG_WITH(fop,
17352d861bc5Smrg	AS_HELP_STRING([--with-fop],
17362d861bc5Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
17372d861bc5Smrg	   [use_fop=$withval], [use_fop=]_defopt)
17382d861bc5Smrgm4_undefine([_defopt])
17392d861bc5Smrg
17402d861bc5Smrgif test "x$use_fop" = x"auto"; then
17412d861bc5Smrg   AC_PATH_PROG([FOP], [fop])
17422d861bc5Smrg   if test "x$FOP" = "x"; then
17432d861bc5Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
17442d861bc5Smrg	have_fop=no
17452d861bc5Smrg   else
17462d861bc5Smrg        have_fop=yes
17472d861bc5Smrg   fi
17482d861bc5Smrgelif test "x$use_fop" = x"yes" ; then
17492d861bc5Smrg   AC_PATH_PROG([FOP], [fop])
17502d861bc5Smrg   if test "x$FOP" = "x"; then
17512d861bc5Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
17522d861bc5Smrg   fi
17532d861bc5Smrg   have_fop=yes
17542d861bc5Smrgelif test "x$use_fop" = x"no" ; then
17552d861bc5Smrg   if test "x$FOP" != "x"; then
17562d861bc5Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
17572d861bc5Smrg   fi
17582d861bc5Smrg   have_fop=no
17592d861bc5Smrgelse
17602d861bc5Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
17612d861bc5Smrgfi
17622d861bc5SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
17632d861bc5Smrg]) # XORG_WITH_FOP
17642d861bc5Smrg
17652d861bc5Smrg# XORG_WITH_PS2PDF([DEFAULT])
17662d861bc5Smrg# ----------------
17672d861bc5Smrg# Minimum version: 1.6.0
17682d861bc5Smrg# Minimum version for optional DEFAULT argument: 1.11.0
17692d861bc5Smrg#
17702d861bc5Smrg# Documentation tools are not always available on all platforms and sometimes
17712d861bc5Smrg# not at the appropriate level. This macro enables a module to test for the
17722d861bc5Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
17732d861bc5Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
17742d861bc5Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
17752d861bc5Smrg# --with-ps2pdf assumes 'auto'.
17762d861bc5Smrg#
17772d861bc5Smrg# Interface to module:
17782d861bc5Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
17792d861bc5Smrg# PS2PDF:	returns the path of the ps2pdf program found
17802d861bc5Smrg#		returns the path set by the user in the environment
17812d861bc5Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
17822d861bc5Smrg#		 'no' user instructs the module not to use ps2pdf
17832d861bc5Smrg#
17842d861bc5Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
17852d861bc5Smrg#
17862d861bc5SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
17872d861bc5SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
17882d861bc5Smrgm4_define([_defopt], m4_default([$1], [auto]))
17892d861bc5SmrgAC_ARG_WITH(ps2pdf,
17902d861bc5Smrg	AS_HELP_STRING([--with-ps2pdf],
17912d861bc5Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
17922d861bc5Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
17932d861bc5Smrgm4_undefine([_defopt])
17942d861bc5Smrg
17952d861bc5Smrgif test "x$use_ps2pdf" = x"auto"; then
17962d861bc5Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
17972d861bc5Smrg   if test "x$PS2PDF" = "x"; then
17982d861bc5Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
17992d861bc5Smrg	have_ps2pdf=no
18002d861bc5Smrg   else
18012d861bc5Smrg        have_ps2pdf=yes
18022d861bc5Smrg   fi
18032d861bc5Smrgelif test "x$use_ps2pdf" = x"yes" ; then
18042d861bc5Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
18052d861bc5Smrg   if test "x$PS2PDF" = "x"; then
18062d861bc5Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
18072d861bc5Smrg   fi
18082d861bc5Smrg   have_ps2pdf=yes
18092d861bc5Smrgelif test "x$use_ps2pdf" = x"no" ; then
18102d861bc5Smrg   if test "x$PS2PDF" != "x"; then
18112d861bc5Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
18122d861bc5Smrg   fi
18132d861bc5Smrg   have_ps2pdf=no
18142d861bc5Smrgelse
18152d861bc5Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
18162d861bc5Smrgfi
18172d861bc5SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
18182d861bc5Smrg]) # XORG_WITH_PS2PDF
18192d861bc5Smrg
18202d861bc5Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
18212d861bc5Smrg# ----------------
18222d861bc5Smrg# Minimum version: 1.6.0
18232d861bc5Smrg#
18242d861bc5Smrg# Documentation tools are not always available on all platforms and sometimes
18252d861bc5Smrg# not at the appropriate level. This macro enables a builder to skip all
18262d861bc5Smrg# documentation targets except traditional man pages.
18272d861bc5Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18282d861bc5Smrg# maximum flexibilty in controlling documentation building.
18292d861bc5Smrg# Refer to:
18302d861bc5Smrg# XORG_WITH_XMLTO         --with-xmlto
18312d861bc5Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18322d861bc5Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18332d861bc5Smrg# XORG_WITH_FOP           --with-fop
18342d861bc5Smrg# XORG_WITH_GROFF         --with-groff
18352d861bc5Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18362d861bc5Smrg#
18372d861bc5Smrg# Interface to module:
18382d861bc5Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
18392d861bc5Smrg# --enable-docs: 'yes' user instructs the module to generate docs
18402d861bc5Smrg#		 'no' user instructs the module not to generate docs
18412d861bc5Smrg# parm1:	specify the default value, yes or no.
18422d861bc5Smrg#
18432d861bc5SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
18442d861bc5Smrgm4_define([default], m4_default([$1], [yes]))
18452d861bc5SmrgAC_ARG_ENABLE(docs,
18462d861bc5Smrg	AS_HELP_STRING([--enable-docs],
18472d861bc5Smrg	   [Enable building the documentation (default: ]default[)]),
18482d861bc5Smrg	   [build_docs=$enableval], [build_docs=]default)
18492d861bc5Smrgm4_undefine([default])
18502d861bc5SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
18512d861bc5SmrgAC_MSG_CHECKING([whether to build documentation])
18522d861bc5SmrgAC_MSG_RESULT([$build_docs])
18532d861bc5Smrg]) # XORG_ENABLE_DOCS
18542d861bc5Smrg
18552d861bc5Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
18562d861bc5Smrg# ----------------
18572d861bc5Smrg# Minimum version: 1.6.0
18582d861bc5Smrg#
18592d861bc5Smrg# This macro enables a builder to skip all developer documentation.
18602d861bc5Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18612d861bc5Smrg# maximum flexibilty in controlling documentation building.
18622d861bc5Smrg# Refer to:
18632d861bc5Smrg# XORG_WITH_XMLTO         --with-xmlto
18642d861bc5Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18652d861bc5Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18662d861bc5Smrg# XORG_WITH_FOP           --with-fop
18672d861bc5Smrg# XORG_WITH_GROFF         --with-groff
18682d861bc5Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18692d861bc5Smrg#
18702d861bc5Smrg# Interface to module:
18712d861bc5Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
18722d861bc5Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
18732d861bc5Smrg#			'no' user instructs the module not to generate developer docs
18742d861bc5Smrg# parm1:		specify the default value, yes or no.
18752d861bc5Smrg#
18762d861bc5SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
18772d861bc5Smrgm4_define([devel_default], m4_default([$1], [yes]))
18782d861bc5SmrgAC_ARG_ENABLE(devel-docs,
18792d861bc5Smrg	AS_HELP_STRING([--enable-devel-docs],
18802d861bc5Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
18812d861bc5Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
18822d861bc5Smrgm4_undefine([devel_default])
18832d861bc5SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
18842d861bc5SmrgAC_MSG_CHECKING([whether to build developer documentation])
18852d861bc5SmrgAC_MSG_RESULT([$build_devel_docs])
18862d861bc5Smrg]) # XORG_ENABLE_DEVEL_DOCS
18872d861bc5Smrg
18882d861bc5Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
18892d861bc5Smrg# ----------------
18902d861bc5Smrg# Minimum version: 1.6.0
18912d861bc5Smrg#
18922d861bc5Smrg# This macro enables a builder to skip all functional specification targets.
18932d861bc5Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18942d861bc5Smrg# maximum flexibilty in controlling documentation building.
18952d861bc5Smrg# Refer to:
18962d861bc5Smrg# XORG_WITH_XMLTO         --with-xmlto
18972d861bc5Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18982d861bc5Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18992d861bc5Smrg# XORG_WITH_FOP           --with-fop
19002d861bc5Smrg# XORG_WITH_GROFF         --with-groff
19012d861bc5Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
19022d861bc5Smrg#
19032d861bc5Smrg# Interface to module:
19042d861bc5Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
19052d861bc5Smrg# --enable-specs:	'yes' user instructs the module to generate specs
19062d861bc5Smrg#			'no' user instructs the module not to generate specs
19072d861bc5Smrg# parm1:		specify the default value, yes or no.
19082d861bc5Smrg#
19092d861bc5SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
19102d861bc5Smrgm4_define([spec_default], m4_default([$1], [yes]))
19112d861bc5SmrgAC_ARG_ENABLE(specs,
19122d861bc5Smrg	AS_HELP_STRING([--enable-specs],
19132d861bc5Smrg	   [Enable building the specs (default: ]spec_default[)]),
19142d861bc5Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
19152d861bc5Smrgm4_undefine([spec_default])
19162d861bc5SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
19172d861bc5SmrgAC_MSG_CHECKING([whether to build functional specifications])
19182d861bc5SmrgAC_MSG_RESULT([$build_specs])
19192d861bc5Smrg]) # XORG_ENABLE_SPECS
19202d861bc5Smrg
192144d7874bSmrg# XORG_CHECK_MALLOC_ZERO
192244d7874bSmrg# ----------------------
192344d7874bSmrg# Minimum version: 1.0.0
192444d7874bSmrg#
192544d7874bSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
192644d7874bSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
192744d7874bSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
192844d7874bSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
192944d7874bSmrgAC_ARG_ENABLE(malloc0returnsnull,
19302d861bc5Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
193144d7874bSmrg		       [malloc(0) returns NULL (default: auto)]),
193244d7874bSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
193344d7874bSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
193444d7874bSmrg
193544d7874bSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
193644d7874bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
193744d7874bSmrg	AC_RUN_IFELSE([
193844d7874bSmrgchar *malloc();
193944d7874bSmrgchar *realloc();
194044d7874bSmrgchar *calloc();
194144d7874bSmrgmain() {
194244d7874bSmrg    char *m0, *r0, *c0, *p;
194344d7874bSmrg    m0 = malloc(0);
194444d7874bSmrg    p = malloc(10);
194544d7874bSmrg    r0 = realloc(p,0);
194644d7874bSmrg    c0 = calloc(0);
194744d7874bSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
194844d7874bSmrg}],
194944d7874bSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
19502d861bc5Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
19512d861bc5Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
195244d7874bSmrgfi
195344d7874bSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
195444d7874bSmrg
195544d7874bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
195644d7874bSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
195744d7874bSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
195844d7874bSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
195944d7874bSmrgelse
196044d7874bSmrg	MALLOC_ZERO_CFLAGS=""
196144d7874bSmrg	XMALLOC_ZERO_CFLAGS=""
196244d7874bSmrg	XTMALLOC_ZERO_CFLAGS=""
196344d7874bSmrgfi
196444d7874bSmrg
196544d7874bSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
196644d7874bSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
196744d7874bSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
196844d7874bSmrg]) # XORG_CHECK_MALLOC_ZERO
196944d7874bSmrg
197044d7874bSmrg# XORG_WITH_LINT()
197144d7874bSmrg# ----------------
197244d7874bSmrg# Minimum version: 1.1.0
197344d7874bSmrg#
19742d861bc5Smrg# This macro enables the use of a tool that flags some suspicious and
19752d861bc5Smrg# non-portable constructs (likely to be bugs) in C language source code.
19762d861bc5Smrg# It will attempt to locate the tool and use appropriate options.
19772d861bc5Smrg# There are various lint type tools on different platforms.
19782d861bc5Smrg#
19792d861bc5Smrg# Interface to module:
19802d861bc5Smrg# LINT:		returns the path to the tool found on the platform
19812d861bc5Smrg#		or the value set to LINT on the configure cmd line
19822d861bc5Smrg#		also an Automake conditional
19832d861bc5Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
19842d861bc5Smrg#
19852d861bc5Smrg# --with-lint:	'yes' user instructs the module to use lint
19862d861bc5Smrg#		'no' user instructs the module not to use lint (default)
19872d861bc5Smrg#
19882d861bc5Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
19892d861bc5Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
199044d7874bSmrg#
199144d7874bSmrgAC_DEFUN([XORG_WITH_LINT],[
199244d7874bSmrg
19932d861bc5SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
19942d861bc5SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
19952d861bc5SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
199644d7874bSmrg		[Use a lint-style source code checker (default: disabled)])],
199744d7874bSmrg		[use_lint=$withval], [use_lint=no])
19982d861bc5Smrg
19992d861bc5Smrg# Obtain platform specific info like program name and options
20002d861bc5Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
20012d861bc5Smrgcase $host_os in
20022d861bc5Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
20032d861bc5Smrg	lint_name=splint
20042d861bc5Smrg	lint_options="-badflag"
20052d861bc5Smrg	;;
20062d861bc5Smrg  *freebsd* | *netbsd*)
20072d861bc5Smrg	lint_name=lint
20082d861bc5Smrg	lint_options="-u -b"
20092d861bc5Smrg	;;
20102d861bc5Smrg  *solaris*)
20112d861bc5Smrg	lint_name=lint
20122d861bc5Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
20132d861bc5Smrg	;;
20142d861bc5Smrgesac
20152d861bc5Smrg
20162d861bc5Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
20172d861bc5Smrgif test "x$use_lint" = x"yes" ; then
20182d861bc5Smrg   AC_PATH_PROG([LINT], [$lint_name])
20192d861bc5Smrg   if test "x$LINT" = "x"; then
20202d861bc5Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
20212d861bc5Smrg   fi
20222d861bc5Smrgelif test "x$use_lint" = x"no" ; then
20232d861bc5Smrg   if test "x$LINT" != "x"; then
20242d861bc5Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
20252d861bc5Smrg   fi
202644d7874bSmrgelse
20272d861bc5Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
202844d7874bSmrgfi
20292d861bc5Smrg
20302d861bc5Smrg# User supplied flags override default flags
20312d861bc5Smrgif test "x$LINT_FLAGS" != "x"; then
20322d861bc5Smrg   lint_options=$LINT_FLAGS
203344d7874bSmrgfi
203444d7874bSmrg
20352d861bc5SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
20362d861bc5SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
203744d7874bSmrg
203844d7874bSmrg]) # XORG_WITH_LINT
203944d7874bSmrg
204044d7874bSmrg# XORG_LINT_LIBRARY(LIBNAME)
204144d7874bSmrg# --------------------------
204244d7874bSmrg# Minimum version: 1.1.0
204344d7874bSmrg#
204444d7874bSmrg# Sets up flags for building lint libraries for checking programs that call
204544d7874bSmrg# functions in the library.
204644d7874bSmrg#
20472d861bc5Smrg# Interface to module:
20482d861bc5Smrg# LINTLIB		- Automake variable with the name of lint library file to make
20492d861bc5Smrg# MAKE_LINT_LIB		- Automake conditional
20502d861bc5Smrg#
20512d861bc5Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
20522d861bc5Smrg#			  - 'no' user instructs the module not to create a lint library (default)
205344d7874bSmrg
205444d7874bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
205544d7874bSmrgAC_REQUIRE([XORG_WITH_LINT])
20562d861bc5SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
205744d7874bSmrg	[Create lint library (default: disabled)])],
205844d7874bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
20592d861bc5Smrg
20602d861bc5Smrgif test "x$make_lint_lib" = x"yes" ; then
20612d861bc5Smrg   LINTLIB=llib-l$1.ln
20622d861bc5Smrg   if test "x$LINT" = "x"; then
20632d861bc5Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
20642d861bc5Smrg   fi
20652d861bc5Smrgelif test "x$make_lint_lib" != x"no" ; then
20662d861bc5Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
206744d7874bSmrgfi
20682d861bc5Smrg
206944d7874bSmrgAC_SUBST(LINTLIB)
207044d7874bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
207144d7874bSmrg
207244d7874bSmrg]) # XORG_LINT_LIBRARY
207344d7874bSmrg
20742d861bc5Smrg# XORG_CWARNFLAGS
20752d861bc5Smrg# ---------------
20762d861bc5Smrg# Minimum version: 1.2.0
20772d861bc5Smrg#
20782d861bc5Smrg# Defines CWARNFLAGS to enable C compiler warnings.
20792d861bc5Smrg#
20802d861bc5SmrgAC_DEFUN([XORG_CWARNFLAGS], [
20812d861bc5SmrgAC_REQUIRE([AC_PROG_CC_C99])
20822d861bc5Smrgif  test "x$GCC" = xyes ; then
20832d861bc5Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
20842d861bc5Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
20852d861bc5Smrg-Wbad-function-cast -Wformat=2"
20862d861bc5Smrg    case `$CC -dumpversion` in
20872d861bc5Smrg    3.4.* | 4.*)
20882d861bc5Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
20892d861bc5Smrg	;;
20902d861bc5Smrg    esac
20912d861bc5Smrgelse
20922d861bc5Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
20932d861bc5Smrg    if test "x$SUNCC" = "xyes"; then
20942d861bc5Smrg	CWARNFLAGS="-v"
20952d861bc5Smrg    fi
20962d861bc5Smrgfi
20972d861bc5SmrgAC_SUBST(CWARNFLAGS)
20982d861bc5Smrg]) # XORG_CWARNFLAGS
20992d861bc5Smrg
21002d861bc5Smrg# XORG_STRICT_OPTION
21012d861bc5Smrg# -----------------------
21022d861bc5Smrg# Minimum version: 1.3.0
21032d861bc5Smrg#
21042d861bc5Smrg# Add configure option to enable strict compilation
21052d861bc5SmrgAC_DEFUN([XORG_STRICT_OPTION], [
21062d861bc5Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
21072d861bc5SmrgAC_REQUIRE([AC_PROG_CC_C99])
21082d861bc5SmrgAC_REQUIRE([XORG_CWARNFLAGS])
21092d861bc5Smrg
21102d861bc5SmrgAC_ARG_ENABLE(strict-compilation,
21112d861bc5Smrg			  AS_HELP_STRING([--enable-strict-compilation],
21122d861bc5Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
21132d861bc5Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
21142d861bc5Smrgif test "x$STRICT_COMPILE" = "xyes"; then
21152d861bc5Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
21162d861bc5Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
21172d861bc5Smrg	if test "x$GCC" = xyes ; then
21182d861bc5Smrg		STRICT_CFLAGS="-pedantic -Werror"
21192d861bc5Smrg	elif test "x$SUNCC" = "xyes"; then
21202d861bc5Smrg		STRICT_CFLAGS="-errwarn"
21212d861bc5Smrg    elif test "x$INTELCC" = "xyes"; then
21222d861bc5Smrg		STRICT_CFLAGS="-Werror"
21232d861bc5Smrg	fi
21242d861bc5Smrgfi
21252d861bc5SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
21262d861bc5SmrgAC_SUBST([CWARNFLAGS])
21272d861bc5Smrg]) # XORG_STRICT_OPTION
21282d861bc5Smrg
21292d861bc5Smrg# XORG_DEFAULT_OPTIONS
21302d861bc5Smrg# --------------------
21312d861bc5Smrg# Minimum version: 1.3.0
21322d861bc5Smrg#
21332d861bc5Smrg# Defines default options for X.Org modules.
21342d861bc5Smrg#
21352d861bc5SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
21362d861bc5SmrgAC_REQUIRE([AC_PROG_INSTALL])
21372d861bc5SmrgXORG_CWARNFLAGS
21382d861bc5SmrgXORG_STRICT_OPTION
21392d861bc5SmrgXORG_RELEASE_VERSION
21402d861bc5SmrgXORG_CHANGELOG
21412d861bc5SmrgXORG_INSTALL
21422d861bc5SmrgXORG_MANPAGE_SECTIONS
21432d861bc5Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
21442d861bc5Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
21452d861bc5Smrg]) # XORG_DEFAULT_OPTIONS
21462d861bc5Smrg
21472d861bc5Smrg# XORG_INSTALL()
21482d861bc5Smrg# ----------------
21492d861bc5Smrg# Minimum version: 1.4.0
21502d861bc5Smrg#
21512d861bc5Smrg# Defines the variable INSTALL_CMD as the command to copy
21522d861bc5Smrg# INSTALL from $prefix/share/util-macros.
21532d861bc5Smrg#
21542d861bc5SmrgAC_DEFUN([XORG_INSTALL], [
21552d861bc5SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
21562d861bc5Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
21572d861bc5SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
21582d861bc5Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
21592d861bc5Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
21602d861bc5Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
21612d861bc5SmrgAC_SUBST([INSTALL_CMD])
21622d861bc5Smrg]) # XORG_INSTALL
216344d7874bSmrgdnl Copyright 2005 Red Hat, Inc
216444d7874bSmrgdnl
216544d7874bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
216644d7874bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
216744d7874bSmrgdnl the above copyright notice appear in all copies and that both that
216844d7874bSmrgdnl copyright notice and this permission notice appear in supporting
216944d7874bSmrgdnl documentation.
217044d7874bSmrgdnl
217144d7874bSmrgdnl The above copyright notice and this permission notice shall be included
217244d7874bSmrgdnl in all copies or substantial portions of the Software.
217344d7874bSmrgdnl
217444d7874bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
217544d7874bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
217644d7874bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
217744d7874bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
217844d7874bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
217944d7874bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
218044d7874bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
218144d7874bSmrgdnl
218244d7874bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
218344d7874bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
218444d7874bSmrgdnl other dealings in this Software without prior written authorization
218544d7874bSmrgdnl from the copyright holders.
218644d7874bSmrgdnl
218744d7874bSmrg
218844d7874bSmrg# XORG_RELEASE_VERSION
218944d7874bSmrg# --------------------
21902d861bc5Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
219144d7874bSmrg 
219244d7874bSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
219344d7874bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
219444d7874bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
219544d7874bSmrg		[Major version of this package])
21962d861bc5Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
219744d7874bSmrg	if test "x$PVM" = "x"; then
219844d7874bSmrg		PVM="0"
219944d7874bSmrg	fi
220044d7874bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
220144d7874bSmrg		[$PVM],
220244d7874bSmrg		[Minor version of this package])
22032d861bc5Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
220444d7874bSmrg	if test "x$PVP" = "x"; then
220544d7874bSmrg		PVP="0"
220644d7874bSmrg	fi
220744d7874bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
220844d7874bSmrg		[$PVP],
220944d7874bSmrg		[Patch version of this package])
221044d7874bSmrg])
221144d7874bSmrg
22122d861bc5Smrg# XORG_CHANGELOG()
22132d861bc5Smrg# ----------------
22142d861bc5Smrg# Minimum version: 1.2.0
22152d861bc5Smrg#
22162d861bc5Smrg# Defines the variable CHANGELOG_CMD as the command to generate
22172d861bc5Smrg# ChangeLog from git.
22182d861bc5Smrg#
22192d861bc5Smrg#
22202d861bc5SmrgAC_DEFUN([XORG_CHANGELOG], [
22212d861bc5SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
22222d861bc5Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
22232d861bc5Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
22242d861bc5Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
22252d861bc5SmrgAC_SUBST([CHANGELOG_CMD])
22262d861bc5Smrg]) # XORG_CHANGELOG
22272d861bc5Smrg
22282d861bc5Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
22292d861bc5Smrg# 
22302d861bc5Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
22312d861bc5Smrg#
22322d861bc5Smrg# This program is free software; you can redistribute it and/or modify
22332d861bc5Smrg# it under the terms of the GNU General Public License as published by
22342d861bc5Smrg# the Free Software Foundation; either version 2 of the License, or
22352d861bc5Smrg# (at your option) any later version.
22362d861bc5Smrg#
22372d861bc5Smrg# This program is distributed in the hope that it will be useful, but
22382d861bc5Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
22392d861bc5Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22402d861bc5Smrg# General Public License for more details.
22412d861bc5Smrg#
22422d861bc5Smrg# You should have received a copy of the GNU General Public License
22432d861bc5Smrg# along with this program; if not, write to the Free Software
22442d861bc5Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22452d861bc5Smrg#
22462d861bc5Smrg# As a special exception to the GNU General Public License, if you
22472d861bc5Smrg# distribute this file as part of a program that contains a
22482d861bc5Smrg# configuration script generated by Autoconf, you may include it under
22492d861bc5Smrg# the same distribution terms that you use for the rest of that program.
22502d861bc5Smrg
22512d861bc5Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
22522d861bc5Smrg# ----------------------------------
22532d861bc5SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
22542d861bc5Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
22552d861bc5Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
22562d861bc5SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
22572d861bc5Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
22582d861bc5Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
22592d861bc5Smrgfi
22602d861bc5Smrgif test -n "$PKG_CONFIG"; then
22612d861bc5Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
22622d861bc5Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
22632d861bc5Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
22642d861bc5Smrg		AC_MSG_RESULT([yes])
22652d861bc5Smrg	else
22662d861bc5Smrg		AC_MSG_RESULT([no])
22672d861bc5Smrg		PKG_CONFIG=""
22682d861bc5Smrg	fi
22692d861bc5Smrg		
22702d861bc5Smrgfi[]dnl
22712d861bc5Smrg])# PKG_PROG_PKG_CONFIG
22722d861bc5Smrg
22732d861bc5Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
22742d861bc5Smrg#
22752d861bc5Smrg# Check to see whether a particular set of modules exists.  Similar
22762d861bc5Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
22772d861bc5Smrg#
22782d861bc5Smrg#
22792d861bc5Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
22802d861bc5Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
22812d861bc5Smrg# PKG_CHECK_EXISTS manually
22822d861bc5Smrg# --------------------------------------------------------------
22832d861bc5SmrgAC_DEFUN([PKG_CHECK_EXISTS],
22842d861bc5Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
22852d861bc5Smrgif test -n "$PKG_CONFIG" && \
22862d861bc5Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
22872d861bc5Smrg  m4_ifval([$2], [$2], [:])
22882d861bc5Smrgm4_ifvaln([$3], [else
22892d861bc5Smrg  $3])dnl
22902d861bc5Smrgfi])
22912d861bc5Smrg
22922d861bc5Smrg
22932d861bc5Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
22942d861bc5Smrg# ---------------------------------------------
22952d861bc5Smrgm4_define([_PKG_CONFIG],
22962d861bc5Smrg[if test -n "$$1"; then
22972d861bc5Smrg    pkg_cv_[]$1="$$1"
22982d861bc5Smrg elif test -n "$PKG_CONFIG"; then
22992d861bc5Smrg    PKG_CHECK_EXISTS([$3],
23002d861bc5Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
23012d861bc5Smrg		     [pkg_failed=yes])
23022d861bc5Smrg else
23032d861bc5Smrg    pkg_failed=untried
23042d861bc5Smrgfi[]dnl
23052d861bc5Smrg])# _PKG_CONFIG
23062d861bc5Smrg
23072d861bc5Smrg# _PKG_SHORT_ERRORS_SUPPORTED
23082d861bc5Smrg# -----------------------------
23092d861bc5SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
23102d861bc5Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
23112d861bc5Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
23122d861bc5Smrg        _pkg_short_errors_supported=yes
23132d861bc5Smrgelse
23142d861bc5Smrg        _pkg_short_errors_supported=no
23152d861bc5Smrgfi[]dnl
23162d861bc5Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
23172d861bc5Smrg
23182d861bc5Smrg
23192d861bc5Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
23202d861bc5Smrg# [ACTION-IF-NOT-FOUND])
23212d861bc5Smrg#
23222d861bc5Smrg#
23232d861bc5Smrg# Note that if there is a possibility the first call to
23242d861bc5Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
23252d861bc5Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
23262d861bc5Smrg#
23272d861bc5Smrg#
23282d861bc5Smrg# --------------------------------------------------------------
23292d861bc5SmrgAC_DEFUN([PKG_CHECK_MODULES],
23302d861bc5Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
23312d861bc5SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
23322d861bc5SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
23332d861bc5Smrg
23342d861bc5Smrgpkg_failed=no
23352d861bc5SmrgAC_MSG_CHECKING([for $1])
23362d861bc5Smrg
23372d861bc5Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
23382d861bc5Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
23392d861bc5Smrg
23402d861bc5Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
23412d861bc5Smrgand $1[]_LIBS to avoid the need to call pkg-config.
23422d861bc5SmrgSee the pkg-config man page for more details.])
23432d861bc5Smrg
23442d861bc5Smrgif test $pkg_failed = yes; then
23452d861bc5Smrg        _PKG_SHORT_ERRORS_SUPPORTED
23462d861bc5Smrg        if test $_pkg_short_errors_supported = yes; then
23472d861bc5Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
23482d861bc5Smrg        else 
23492d861bc5Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
23502d861bc5Smrg        fi
23512d861bc5Smrg	# Put the nasty error message in config.log where it belongs
23522d861bc5Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
23532d861bc5Smrg
23542d861bc5Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
23552d861bc5Smrg[Package requirements ($2) were not met:
23562d861bc5Smrg
23572d861bc5Smrg$$1_PKG_ERRORS
23582d861bc5Smrg
23592d861bc5SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
23602d861bc5Smrginstalled software in a non-standard prefix.
23612d861bc5Smrg
23622d861bc5Smrg_PKG_TEXT
23632d861bc5Smrg])],
23642d861bc5Smrg		[AC_MSG_RESULT([no])
23652d861bc5Smrg                $4])
23662d861bc5Smrgelif test $pkg_failed = untried; then
23672d861bc5Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
23682d861bc5Smrg[The pkg-config script could not be found or is too old.  Make sure it
23692d861bc5Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
23702d861bc5Smrgpath to pkg-config.
23712d861bc5Smrg
23722d861bc5Smrg_PKG_TEXT
23732d861bc5Smrg
23742d861bc5SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
23752d861bc5Smrg		[$4])
23762d861bc5Smrgelse
23772d861bc5Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
23782d861bc5Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
23792d861bc5Smrg        AC_MSG_RESULT([yes])
23802d861bc5Smrg	ifelse([$3], , :, [$3])
23812d861bc5Smrgfi[]dnl
23822d861bc5Smrg])# PKG_CHECK_MODULES
23832d861bc5Smrg
2384