aclocal.m4 revision 2ab73d9f
16f5dd5c2Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2a0195d5fSmrg
3a0195d5fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
46600fe5bSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5a0195d5fSmrg# This file is free software; the Free Software Foundation
6a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
7a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
8a0195d5fSmrg
9a0195d5fSmrg# This program is distributed in the hope that it will be useful,
10a0195d5fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11a0195d5fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12a0195d5fSmrg# PARTICULAR PURPOSE.
13a0195d5fSmrg
14a0195d5fSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15a0195d5fSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
162ab73d9fSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
172ab73d9fSmrg[m4_warning([this file was generated for autoconf 2.68.
18a0195d5fSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19a0195d5fSmrgIf you have problems, you may need to regenerate the build system entirely.
20a0195d5fSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21a0195d5fSmrg
226600fe5bSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23a0195d5fSmrg#
246600fe5bSmrg# This file is free software; the Free Software Foundation
256600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
266600fe5bSmrg# with or without modifications, as long as this notice is preserved.
27a0195d5fSmrg
286600fe5bSmrg# AM_AUTOMAKE_VERSION(VERSION)
296600fe5bSmrg# ----------------------------
306600fe5bSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
316600fe5bSmrg# generated from the m4 files accompanying Automake X.Y.
326600fe5bSmrg# (This private macro should not be called outside this file.)
336600fe5bSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
346600fe5bSmrg[am__api_version='1.11'
356600fe5bSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
366600fe5bSmrgdnl require some minimum version.  Point them to the right macro.
376f5dd5c2Smrgm4_if([$1], [1.11.1], [],
386600fe5bSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
396600fe5bSmrg])
40a0195d5fSmrg
416600fe5bSmrg# _AM_AUTOCONF_VERSION(VERSION)
426600fe5bSmrg# -----------------------------
436600fe5bSmrg# aclocal traces this macro to find the Autoconf version.
446600fe5bSmrg# This is a private macro too.  Using m4_define simplifies
456600fe5bSmrg# the logic in aclocal, which can simply ignore this definition.
466600fe5bSmrgm4_define([_AM_AUTOCONF_VERSION], [])
47a0195d5fSmrg
486600fe5bSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
496600fe5bSmrg# -------------------------------
506600fe5bSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
516600fe5bSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
526600fe5bSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
536f5dd5c2Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
546600fe5bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
556600fe5bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
566600fe5bSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57a0195d5fSmrg
586600fe5bSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59a0195d5fSmrg
606600fe5bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
616600fe5bSmrg#
626600fe5bSmrg# This file is free software; the Free Software Foundation
636600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
646600fe5bSmrg# with or without modifications, as long as this notice is preserved.
65a0195d5fSmrg
666600fe5bSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
676600fe5bSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
686600fe5bSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69a0195d5fSmrg#
706600fe5bSmrg# Of course, Automake must honor this variable whenever it calls a
716600fe5bSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
726600fe5bSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
736600fe5bSmrg# depending on how configure is run.  This is pretty annoying, since
746600fe5bSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
756600fe5bSmrg# source directory, any form will work fine, but in subdirectories a
766600fe5bSmrg# relative path needs to be adjusted first.
77a0195d5fSmrg#
786600fe5bSmrg# $ac_aux_dir/missing
796600fe5bSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
806600fe5bSmrg# $top_srcdir/$ac_aux_dir/missing
816600fe5bSmrg#    fails if $ac_aux_dir is absolute,
826600fe5bSmrg#    fails when called from a subdirectory in a VPATH build with
836600fe5bSmrg#          a relative $ac_aux_dir
84a0195d5fSmrg#
856600fe5bSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
866600fe5bSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
876600fe5bSmrg# harmless because $srcdir is `.', but things will broke when you
886600fe5bSmrg# start a VPATH build or use an absolute $srcdir.
89a0195d5fSmrg#
906600fe5bSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
916600fe5bSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
926600fe5bSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
936600fe5bSmrg# and then we would define $MISSING as
946600fe5bSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
956600fe5bSmrg# This will work as long as MISSING is not called from configure, because
966600fe5bSmrg# unfortunately $(top_srcdir) has no meaning in configure.
976600fe5bSmrg# However there are other variables, like CC, which are often used in
986600fe5bSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
996600fe5bSmrg#
1006600fe5bSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
1016600fe5bSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
1026600fe5bSmrg# configured tree to be moved without reconfiguration.
103a0195d5fSmrg
1046600fe5bSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1056600fe5bSmrg[dnl Rely on autoconf to set up CDPATH properly.
1066600fe5bSmrgAC_PREREQ([2.50])dnl
1076600fe5bSmrg# expand $ac_aux_dir to an absolute path
1086600fe5bSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
1096600fe5bSmrg])
110a0195d5fSmrg
1116600fe5bSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112a0195d5fSmrg
1136600fe5bSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1146600fe5bSmrg# Free Software Foundation, Inc.
1156600fe5bSmrg#
1166600fe5bSmrg# This file is free software; the Free Software Foundation
1176600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
1186600fe5bSmrg# with or without modifications, as long as this notice is preserved.
119a0195d5fSmrg
1206600fe5bSmrg# serial 9
121a0195d5fSmrg
1226600fe5bSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1236600fe5bSmrg# -------------------------------------
1246600fe5bSmrg# Define a conditional.
1256600fe5bSmrgAC_DEFUN([AM_CONDITIONAL],
1266600fe5bSmrg[AC_PREREQ(2.52)dnl
1276600fe5bSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1286600fe5bSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1296600fe5bSmrgAC_SUBST([$1_TRUE])dnl
1306600fe5bSmrgAC_SUBST([$1_FALSE])dnl
1316600fe5bSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1326600fe5bSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1336600fe5bSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1346600fe5bSmrgif $2; then
1356600fe5bSmrg  $1_TRUE=
1366600fe5bSmrg  $1_FALSE='#'
1376600fe5bSmrgelse
1386600fe5bSmrg  $1_TRUE='#'
1396600fe5bSmrg  $1_FALSE=
1406600fe5bSmrgfi
1416600fe5bSmrgAC_CONFIG_COMMANDS_PRE(
1426600fe5bSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1436600fe5bSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1446600fe5bSmrgUsually this means the macro was only invoked conditionally.]])
1456600fe5bSmrgfi])])
146a0195d5fSmrg
1476600fe5bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1486600fe5bSmrg# Free Software Foundation, Inc.
1496600fe5bSmrg#
1506600fe5bSmrg# This file is free software; the Free Software Foundation
1516600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
1526600fe5bSmrg# with or without modifications, as long as this notice is preserved.
153a0195d5fSmrg
1546600fe5bSmrg# serial 10
155a0195d5fSmrg
1566600fe5bSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1576600fe5bSmrg# written in clear, in which case automake, when reading aclocal.m4,
1586600fe5bSmrg# will think it sees a *use*, and therefore will trigger all it's
1596600fe5bSmrg# C support machinery.  Also note that it means that autoscan, seeing
1606600fe5bSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161a0195d5fSmrg
162a0195d5fSmrg
1636600fe5bSmrg# _AM_DEPENDENCIES(NAME)
1646600fe5bSmrg# ----------------------
1656600fe5bSmrg# See how the compiler implements dependency checking.
1666600fe5bSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1676600fe5bSmrg# We try a few techniques and use that to set a single cache variable.
168a0195d5fSmrg#
1696600fe5bSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1706600fe5bSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1716600fe5bSmrg# dependency, and given that the user is not expected to run this macro,
1726600fe5bSmrg# just rely on AC_PROG_CC.
1736600fe5bSmrgAC_DEFUN([_AM_DEPENDENCIES],
1746600fe5bSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1756600fe5bSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1766600fe5bSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1776600fe5bSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178a0195d5fSmrg
1796600fe5bSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1806600fe5bSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1816600fe5bSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1826600fe5bSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1836600fe5bSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1846600fe5bSmrg                   [depcc="$$1"   am_compiler_list=])
185a0195d5fSmrg
1866600fe5bSmrgAC_CACHE_CHECK([dependency style of $depcc],
1876600fe5bSmrg               [am_cv_$1_dependencies_compiler_type],
1886600fe5bSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1896600fe5bSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1906600fe5bSmrg  # making bogus files that we don't know about and never remove.  For
1916600fe5bSmrg  # instance it was reported that on HP-UX the gcc test will end up
1926600fe5bSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1936600fe5bSmrg  # in D'.
1946600fe5bSmrg  mkdir conftest.dir
1956600fe5bSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1966600fe5bSmrg  # using a relative directory.
1976600fe5bSmrg  cp "$am_depcomp" conftest.dir
1986600fe5bSmrg  cd conftest.dir
1996600fe5bSmrg  # We will build objects and dependencies in a subdirectory because
2006600fe5bSmrg  # it helps to detect inapplicable dependency modes.  For instance
2016600fe5bSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2026600fe5bSmrg  # side effect of compilation, but ICC will put the dependencies in
2036600fe5bSmrg  # the current directory while Tru64 will put them in the object
2046600fe5bSmrg  # directory.
2056600fe5bSmrg  mkdir sub
2066600fe5bSmrg
2076600fe5bSmrg  am_cv_$1_dependencies_compiler_type=none
2086600fe5bSmrg  if test "$am_compiler_list" = ""; then
2096600fe5bSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2106600fe5bSmrg  fi
2116600fe5bSmrg  am__universal=false
2126600fe5bSmrg  m4_case([$1], [CC],
2136600fe5bSmrg    [case " $depcc " in #(
2146600fe5bSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2156600fe5bSmrg     esac],
2166600fe5bSmrg    [CXX],
2176600fe5bSmrg    [case " $depcc " in #(
2186600fe5bSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2196600fe5bSmrg     esac])
2206600fe5bSmrg
2216600fe5bSmrg  for depmode in $am_compiler_list; do
2226600fe5bSmrg    # Setup a source with many dependencies, because some compilers
2236600fe5bSmrg    # like to wrap large dependency lists on column 80 (with \), and
2246600fe5bSmrg    # we should not choose a depcomp mode which is confused by this.
2256600fe5bSmrg    #
2266600fe5bSmrg    # We need to recreate these files for each test, as the compiler may
2276600fe5bSmrg    # overwrite some of them when testing with obscure command lines.
2286600fe5bSmrg    # This happens at least with the AIX C compiler.
2296600fe5bSmrg    : > sub/conftest.c
2306600fe5bSmrg    for i in 1 2 3 4 5 6; do
2316600fe5bSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2326600fe5bSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2336600fe5bSmrg      # Solaris 8's {/usr,}/bin/sh.
2346600fe5bSmrg      touch sub/conftst$i.h
2356600fe5bSmrg    done
2366600fe5bSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2376600fe5bSmrg
2386600fe5bSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2396600fe5bSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2406600fe5bSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
2416600fe5bSmrg    # versions had trouble with output in subdirs
2426600fe5bSmrg    am__obj=sub/conftest.${OBJEXT-o}
2436600fe5bSmrg    am__minus_obj="-o $am__obj"
2446600fe5bSmrg    case $depmode in
2456600fe5bSmrg    gcc)
2466600fe5bSmrg      # This depmode causes a compiler race in universal mode.
2476600fe5bSmrg      test "$am__universal" = false || continue
2486600fe5bSmrg      ;;
2496600fe5bSmrg    nosideeffect)
2506600fe5bSmrg      # after this tag, mechanisms are not by side-effect, so they'll
2516600fe5bSmrg      # only be used when explicitly requested
2526600fe5bSmrg      if test "x$enable_dependency_tracking" = xyes; then
2536600fe5bSmrg	continue
2546600fe5bSmrg      else
2556600fe5bSmrg	break
2566600fe5bSmrg      fi
2576600fe5bSmrg      ;;
2586600fe5bSmrg    msvisualcpp | msvcmsys)
2596600fe5bSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
2606600fe5bSmrg      # not run yet.  These depmodes are late enough in the game, and
2616600fe5bSmrg      # so weak that their functioning should not be impacted.
2626600fe5bSmrg      am__obj=conftest.${OBJEXT-o}
2636600fe5bSmrg      am__minus_obj=
2646600fe5bSmrg      ;;
2656600fe5bSmrg    none) break ;;
2666600fe5bSmrg    esac
2676600fe5bSmrg    if depmode=$depmode \
2686600fe5bSmrg       source=sub/conftest.c object=$am__obj \
2696600fe5bSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2706600fe5bSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2716600fe5bSmrg         >/dev/null 2>conftest.err &&
2726600fe5bSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2736600fe5bSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2746600fe5bSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2756600fe5bSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2766600fe5bSmrg      # icc doesn't choke on unknown options, it will just issue warnings
2776600fe5bSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
2786600fe5bSmrg      # that says an option was ignored or not supported.
2796600fe5bSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2806600fe5bSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2816600fe5bSmrg      # The diagnosis changed in icc 8.0:
2826600fe5bSmrg      #   icc: Command line remark: option '-MP' not supported
2836600fe5bSmrg      if (grep 'ignoring option' conftest.err ||
2846600fe5bSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2856600fe5bSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2866600fe5bSmrg        break
2876600fe5bSmrg      fi
2886600fe5bSmrg    fi
2896600fe5bSmrg  done
2906600fe5bSmrg
2916600fe5bSmrg  cd ..
2926600fe5bSmrg  rm -rf conftest.dir
293a0195d5fSmrgelse
2946600fe5bSmrg  am_cv_$1_dependencies_compiler_type=none
295a0195d5fSmrgfi
2966600fe5bSmrg])
2976600fe5bSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2986600fe5bSmrgAM_CONDITIONAL([am__fastdep$1], [
2996600fe5bSmrg  test "x$enable_dependency_tracking" != xno \
3006600fe5bSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3016600fe5bSmrg])
302a0195d5fSmrg
3036600fe5bSmrg
3046600fe5bSmrg# AM_SET_DEPDIR
3056600fe5bSmrg# -------------
3066600fe5bSmrg# Choose a directory name for dependency files.
3076600fe5bSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3086600fe5bSmrgAC_DEFUN([AM_SET_DEPDIR],
3096600fe5bSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3106600fe5bSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3116600fe5bSmrg])
3126600fe5bSmrg
3136600fe5bSmrg
3146600fe5bSmrg# AM_DEP_TRACK
3156600fe5bSmrg# ------------
3166600fe5bSmrgAC_DEFUN([AM_DEP_TRACK],
3176600fe5bSmrg[AC_ARG_ENABLE(dependency-tracking,
3186600fe5bSmrg[  --disable-dependency-tracking  speeds up one-time build
3196600fe5bSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3206600fe5bSmrgif test "x$enable_dependency_tracking" != xno; then
3216600fe5bSmrg  am_depcomp="$ac_aux_dir/depcomp"
3226600fe5bSmrg  AMDEPBACKSLASH='\'
323a0195d5fSmrgfi
3246600fe5bSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3256600fe5bSmrgAC_SUBST([AMDEPBACKSLASH])dnl
3266600fe5bSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3276600fe5bSmrg])
328a0195d5fSmrg
3296600fe5bSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3306600fe5bSmrg
3316600fe5bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
3326600fe5bSmrg# Free Software Foundation, Inc.
333a0195d5fSmrg#
3346600fe5bSmrg# This file is free software; the Free Software Foundation
3356600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
3366600fe5bSmrg# with or without modifications, as long as this notice is preserved.
337a0195d5fSmrg
3386600fe5bSmrg#serial 5
339a0195d5fSmrg
3406600fe5bSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3416600fe5bSmrg# ------------------------------
3426600fe5bSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3436600fe5bSmrg[{
3446600fe5bSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
3456600fe5bSmrg  # are listed without --file.  Let's play safe and only enable the eval
3466600fe5bSmrg  # if we detect the quoting.
3476600fe5bSmrg  case $CONFIG_FILES in
3486600fe5bSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
3496600fe5bSmrg  *)   set x $CONFIG_FILES ;;
3506600fe5bSmrg  esac
3516600fe5bSmrg  shift
3526600fe5bSmrg  for mf
3536600fe5bSmrg  do
3546600fe5bSmrg    # Strip MF so we end up with the name of the file.
3556600fe5bSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3566600fe5bSmrg    # Check whether this is an Automake generated Makefile or not.
3576600fe5bSmrg    # We used to match only the files named `Makefile.in', but
3586600fe5bSmrg    # some people rename them; so instead we look at the file content.
3596600fe5bSmrg    # Grep'ing the first line is not enough: some people post-process
3606600fe5bSmrg    # each Makefile.in and add a new line on top of each file to say so.
3616600fe5bSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
3626600fe5bSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
3636600fe5bSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3646600fe5bSmrg      dirpart=`AS_DIRNAME("$mf")`
3656600fe5bSmrg    else
3666600fe5bSmrg      continue
3676600fe5bSmrg    fi
3686600fe5bSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
3696600fe5bSmrg    # from the Makefile without running `make'.
3706600fe5bSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3716600fe5bSmrg    test -z "$DEPDIR" && continue
3726600fe5bSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3736600fe5bSmrg    test -z "am__include" && continue
3746600fe5bSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3756600fe5bSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
3766600fe5bSmrg    U=`sed -n 's/^U = //p' < "$mf"`
3776600fe5bSmrg    # Find all dependency output files, they are included files with
3786600fe5bSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3796600fe5bSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3806600fe5bSmrg    # expansion.
3816600fe5bSmrg    for file in `sed -n "
3826600fe5bSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3836600fe5bSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3846600fe5bSmrg      # Make sure the directory exists.
3856600fe5bSmrg      test -f "$dirpart/$file" && continue
3866600fe5bSmrg      fdir=`AS_DIRNAME(["$file"])`
3876600fe5bSmrg      AS_MKDIR_P([$dirpart/$fdir])
3886600fe5bSmrg      # echo "creating $dirpart/$file"
3896600fe5bSmrg      echo '# dummy' > "$dirpart/$file"
3906600fe5bSmrg    done
3916600fe5bSmrg  done
3926600fe5bSmrg}
3936600fe5bSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394a0195d5fSmrg
395a0195d5fSmrg
3966600fe5bSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3976600fe5bSmrg# -----------------------------
3986600fe5bSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
3996600fe5bSmrg#
4006600fe5bSmrg# This code is only required when automatic dependency tracking
4016600fe5bSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
4026600fe5bSmrg# need in order to bootstrap the dependency handling code.
4036600fe5bSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4046600fe5bSmrg[AC_CONFIG_COMMANDS([depfiles],
4056600fe5bSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4066600fe5bSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4076600fe5bSmrg])
408a0195d5fSmrg
4096600fe5bSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4106600fe5bSmrg
4116600fe5bSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4126600fe5bSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4136600fe5bSmrg#
4146600fe5bSmrg# This file is free software; the Free Software Foundation
4156600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
4166600fe5bSmrg# with or without modifications, as long as this notice is preserved.
4176600fe5bSmrg
4186600fe5bSmrg# serial 16
4196600fe5bSmrg
4206600fe5bSmrg# This macro actually does too much.  Some checks are only needed if
4216600fe5bSmrg# your package does certain things.  But this isn't really a big deal.
4226600fe5bSmrg
4236600fe5bSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4246600fe5bSmrg# AM_INIT_AUTOMAKE([OPTIONS])
4256600fe5bSmrg# -----------------------------------------------
4266600fe5bSmrg# The call with PACKAGE and VERSION arguments is the old style
4276600fe5bSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
4286600fe5bSmrg# and VERSION should now be passed to AC_INIT and removed from
4296600fe5bSmrg# the call to AM_INIT_AUTOMAKE.
4306600fe5bSmrg# We support both call styles for the transition.  After
4316600fe5bSmrg# the next Automake release, Autoconf can make the AC_INIT
4326600fe5bSmrg# arguments mandatory, and then we can depend on a new Autoconf
4336600fe5bSmrg# release and drop the old call support.
4346600fe5bSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4356600fe5bSmrg[AC_PREREQ([2.62])dnl
4366600fe5bSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4376600fe5bSmrgdnl the ones we care about.
4386600fe5bSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4396600fe5bSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4406600fe5bSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4416600fe5bSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4426600fe5bSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4436600fe5bSmrg  # is not polluted with repeated "-I."
4446600fe5bSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4456600fe5bSmrg  # test to see if srcdir already configured
4466600fe5bSmrg  if test -f $srcdir/config.status; then
4476600fe5bSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4486600fe5bSmrg  fi
449a0195d5fSmrgfi
4506600fe5bSmrg
4516600fe5bSmrg# test whether we have cygpath
4526600fe5bSmrgif test -z "$CYGPATH_W"; then
4536600fe5bSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4546600fe5bSmrg    CYGPATH_W='cygpath -w'
4556600fe5bSmrg  else
4566600fe5bSmrg    CYGPATH_W=echo
4576600fe5bSmrg  fi
458a0195d5fSmrgfi
4596600fe5bSmrgAC_SUBST([CYGPATH_W])
460a0195d5fSmrg
4616600fe5bSmrg# Define the identity of the package.
4626600fe5bSmrgdnl Distinguish between old-style and new-style calls.
4636600fe5bSmrgm4_ifval([$2],
4646600fe5bSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4656600fe5bSmrg AC_SUBST([PACKAGE], [$1])dnl
4666600fe5bSmrg AC_SUBST([VERSION], [$2])],
4676600fe5bSmrg[_AM_SET_OPTIONS([$1])dnl
4686600fe5bSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4696600fe5bSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4706600fe5bSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4716600fe5bSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4726600fe5bSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473a0195d5fSmrg
4746600fe5bSmrg_AM_IF_OPTION([no-define],,
4756600fe5bSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4766600fe5bSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
477a0195d5fSmrg
4786600fe5bSmrg# Some tools Automake needs.
4796600fe5bSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4806600fe5bSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4816600fe5bSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4826600fe5bSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4836600fe5bSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4846600fe5bSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4856600fe5bSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4866600fe5bSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4876600fe5bSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
4886600fe5bSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
4896600fe5bSmrg# We need awk for the "check" target.  The system "awk" is bad on
4906600fe5bSmrg# some platforms.
4916600fe5bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
4926600fe5bSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
4936600fe5bSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
4946600fe5bSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4956600fe5bSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4966600fe5bSmrg			     [_AM_PROG_TAR([v7])])])
4976600fe5bSmrg_AM_IF_OPTION([no-dependencies],,
4986600fe5bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
4996600fe5bSmrg		  [_AM_DEPENDENCIES(CC)],
5006600fe5bSmrg		  [define([AC_PROG_CC],
5016600fe5bSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
5026600fe5bSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5036600fe5bSmrg		  [_AM_DEPENDENCIES(CXX)],
5046600fe5bSmrg		  [define([AC_PROG_CXX],
5056600fe5bSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5066600fe5bSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5076600fe5bSmrg		  [_AM_DEPENDENCIES(OBJC)],
5086600fe5bSmrg		  [define([AC_PROG_OBJC],
5096600fe5bSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
5106600fe5bSmrg])
5116600fe5bSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5126600fe5bSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5136600fe5bSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5146600fe5bSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5156600fe5bSmrgAC_CONFIG_COMMANDS_PRE(dnl
5166600fe5bSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5176600fe5bSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5186600fe5bSmrg])
519a0195d5fSmrg
5206600fe5bSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5216600fe5bSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5226600fe5bSmrgdnl mangled by Autoconf and run in a shell conditional statement.
5236600fe5bSmrgm4_define([_AC_COMPILER_EXEEXT],
5246600fe5bSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525a0195d5fSmrg
526a0195d5fSmrg
5276600fe5bSmrg# When config.status generates a header, we must update the stamp-h file.
5286600fe5bSmrg# This file resides in the same directory as the config header
5296600fe5bSmrg# that is generated.  The stamp files are numbered to have different names.
5306600fe5bSmrg
5316600fe5bSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
5326600fe5bSmrg# loop where config.status creates the headers, so we can generate
5336600fe5bSmrg# our stamp files there.
5346600fe5bSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
5356600fe5bSmrg[# Compute $1's index in $config_headers.
5366600fe5bSmrg_am_arg=$1
5376600fe5bSmrg_am_stamp_count=1
5386600fe5bSmrgfor _am_header in $config_headers :; do
5396600fe5bSmrg  case $_am_header in
5406600fe5bSmrg    $_am_arg | $_am_arg:* )
5416600fe5bSmrg      break ;;
5426600fe5bSmrg    * )
5436600fe5bSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5446600fe5bSmrg  esac
5456600fe5bSmrgdone
5466600fe5bSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
5476600fe5bSmrg
5486600fe5bSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
5496600fe5bSmrg#
5506600fe5bSmrg# This file is free software; the Free Software Foundation
5516600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
5526600fe5bSmrg# with or without modifications, as long as this notice is preserved.
553a0195d5fSmrg
5546600fe5bSmrg# AM_PROG_INSTALL_SH
5556600fe5bSmrg# ------------------
5566600fe5bSmrg# Define $install_sh.
5576600fe5bSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5586600fe5bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5596600fe5bSmrgif test x"${install_sh}" != xset; then
5606600fe5bSmrg  case $am_aux_dir in
5616600fe5bSmrg  *\ * | *\	*)
5626600fe5bSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5636600fe5bSmrg  *)
5646600fe5bSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5656600fe5bSmrg  esac
566a0195d5fSmrgfi
5676600fe5bSmrgAC_SUBST(install_sh)])
568a0195d5fSmrg
5696600fe5bSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5706600fe5bSmrg#
5716600fe5bSmrg# This file is free software; the Free Software Foundation
5726600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
5736600fe5bSmrg# with or without modifications, as long as this notice is preserved.
574a0195d5fSmrg
5756600fe5bSmrg# serial 2
576a0195d5fSmrg
5776600fe5bSmrg# Check whether the underlying file-system supports filenames
5786600fe5bSmrg# with a leading dot.  For instance MS-DOS doesn't.
5796600fe5bSmrgAC_DEFUN([AM_SET_LEADING_DOT],
5806600fe5bSmrg[rm -rf .tst 2>/dev/null
5816600fe5bSmrgmkdir .tst 2>/dev/null
5826600fe5bSmrgif test -d .tst; then
5836600fe5bSmrg  am__leading_dot=.
584a0195d5fSmrgelse
5856600fe5bSmrg  am__leading_dot=_
586a0195d5fSmrgfi
5876600fe5bSmrgrmdir .tst 2>/dev/null
5886600fe5bSmrgAC_SUBST([am__leading_dot])])
589a0195d5fSmrg
5906600fe5bSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
5916600fe5bSmrg# From Jim Meyering
592a0195d5fSmrg
5936600fe5bSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
5946600fe5bSmrg# Free Software Foundation, Inc.
5956600fe5bSmrg#
5966600fe5bSmrg# This file is free software; the Free Software Foundation
5976600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
5986600fe5bSmrg# with or without modifications, as long as this notice is preserved.
599a0195d5fSmrg
6006600fe5bSmrg# serial 5
601a0195d5fSmrg
6026600fe5bSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6036600fe5bSmrg# ----------------------------------
6046600fe5bSmrg# Control maintainer-specific portions of Makefiles.
6056600fe5bSmrg# Default is to disable them, unless `enable' is passed literally.
6066600fe5bSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6076600fe5bSmrg# can override the default with the --enable/--disable switch.
6086600fe5bSmrgAC_DEFUN([AM_MAINTAINER_MODE],
6096600fe5bSmrg[m4_case(m4_default([$1], [disable]),
6106600fe5bSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
6116600fe5bSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
6126600fe5bSmrg       [m4_define([am_maintainer_other], [enable])
6136600fe5bSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6146600fe5bSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6156600fe5bSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6166600fe5bSmrg  AC_ARG_ENABLE([maintainer-mode],
6176600fe5bSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
6186600fe5bSmrg			  (and sometimes confusing) to the casual installer],
6196600fe5bSmrg      [USE_MAINTAINER_MODE=$enableval],
6206600fe5bSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
6216600fe5bSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6226600fe5bSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
6236600fe5bSmrg  MAINT=$MAINTAINER_MODE_TRUE
6246600fe5bSmrg  AC_SUBST([MAINT])dnl
6256600fe5bSmrg]
6266600fe5bSmrg)
627a0195d5fSmrg
6286600fe5bSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
629a0195d5fSmrg
6306600fe5bSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
631a0195d5fSmrg
6326600fe5bSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
6336600fe5bSmrg#
6346600fe5bSmrg# This file is free software; the Free Software Foundation
6356600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
6366600fe5bSmrg# with or without modifications, as long as this notice is preserved.
637a0195d5fSmrg
6386600fe5bSmrg# serial 4
639a0195d5fSmrg
6406600fe5bSmrg# AM_MAKE_INCLUDE()
6416600fe5bSmrg# -----------------
6426600fe5bSmrg# Check to see how make treats includes.
6436600fe5bSmrgAC_DEFUN([AM_MAKE_INCLUDE],
6446600fe5bSmrg[am_make=${MAKE-make}
6456600fe5bSmrgcat > confinc << 'END'
6466600fe5bSmrgam__doit:
6476600fe5bSmrg	@echo this is the am__doit target
6486600fe5bSmrg.PHONY: am__doit
6496600fe5bSmrgEND
6506600fe5bSmrg# If we don't find an include directive, just comment out the code.
6516600fe5bSmrgAC_MSG_CHECKING([for style of include used by $am_make])
6526600fe5bSmrgam__include="#"
6536600fe5bSmrgam__quote=
6546600fe5bSmrg_am_result=none
6556600fe5bSmrg# First try GNU make style include.
6566600fe5bSmrgecho "include confinc" > confmf
6576600fe5bSmrg# Ignore all kinds of additional output from `make'.
6586600fe5bSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6596600fe5bSmrg*the\ am__doit\ target*)
6606600fe5bSmrg  am__include=include
6616600fe5bSmrg  am__quote=
6626600fe5bSmrg  _am_result=GNU
6636600fe5bSmrg  ;;
6646600fe5bSmrgesac
6656600fe5bSmrg# Now try BSD make style include.
6666600fe5bSmrgif test "$am__include" = "#"; then
6676600fe5bSmrg   echo '.include "confinc"' > confmf
6686600fe5bSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6696600fe5bSmrg   *the\ am__doit\ target*)
6706600fe5bSmrg     am__include=.include
6716600fe5bSmrg     am__quote="\""
6726600fe5bSmrg     _am_result=BSD
6736600fe5bSmrg     ;;
6746600fe5bSmrg   esac
675a0195d5fSmrgfi
6766600fe5bSmrgAC_SUBST([am__include])
6776600fe5bSmrgAC_SUBST([am__quote])
6786600fe5bSmrgAC_MSG_RESULT([$_am_result])
6796600fe5bSmrgrm -f confinc confmf
6806600fe5bSmrg])
681a0195d5fSmrg
6826600fe5bSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
683a0195d5fSmrg
6846600fe5bSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
6856600fe5bSmrg# Free Software Foundation, Inc.
6866600fe5bSmrg#
6876600fe5bSmrg# This file is free software; the Free Software Foundation
6886600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
6896600fe5bSmrg# with or without modifications, as long as this notice is preserved.
690a0195d5fSmrg
6916600fe5bSmrg# serial 6
692a0195d5fSmrg
6936600fe5bSmrg# AM_MISSING_PROG(NAME, PROGRAM)
6946600fe5bSmrg# ------------------------------
6956600fe5bSmrgAC_DEFUN([AM_MISSING_PROG],
6966600fe5bSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
6976600fe5bSmrg$1=${$1-"${am_missing_run}$2"}
6986600fe5bSmrgAC_SUBST($1)])
699a0195d5fSmrg
700a0195d5fSmrg
7016600fe5bSmrg# AM_MISSING_HAS_RUN
7026600fe5bSmrg# ------------------
7036600fe5bSmrg# Define MISSING if not defined so far and test if it supports --run.
7046600fe5bSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
7056600fe5bSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7066600fe5bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7076600fe5bSmrgAC_REQUIRE_AUX_FILE([missing])dnl
7086600fe5bSmrgif test x"${MISSING+set}" != xset; then
7096600fe5bSmrg  case $am_aux_dir in
7106600fe5bSmrg  *\ * | *\	*)
7116600fe5bSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7126600fe5bSmrg  *)
7136600fe5bSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7146600fe5bSmrg  esac
715a0195d5fSmrgfi
7166600fe5bSmrg# Use eval to expand $SHELL
7176600fe5bSmrgif eval "$MISSING --run true"; then
7186600fe5bSmrg  am_missing_run="$MISSING --run "
719a0195d5fSmrgelse
7206600fe5bSmrg  am_missing_run=
7216600fe5bSmrg  AC_MSG_WARN([`missing' script is too old or missing])
722a0195d5fSmrgfi
7236600fe5bSmrg])
724a0195d5fSmrg
7256600fe5bSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726a0195d5fSmrg#
7276600fe5bSmrg# This file is free software; the Free Software Foundation
7286600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
7296600fe5bSmrg# with or without modifications, as long as this notice is preserved.
730a0195d5fSmrg
7316600fe5bSmrg# AM_PROG_MKDIR_P
7326600fe5bSmrg# ---------------
7336600fe5bSmrg# Check for `mkdir -p'.
7346600fe5bSmrgAC_DEFUN([AM_PROG_MKDIR_P],
7356600fe5bSmrg[AC_PREREQ([2.60])dnl
7366600fe5bSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7376600fe5bSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7386600fe5bSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
7396600fe5bSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7406600fe5bSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7416600fe5bSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7426600fe5bSmrgdnl adjustment using top_builddir (which is defined more often than
7436600fe5bSmrgdnl MKDIR_P).
7446600fe5bSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7456600fe5bSmrgcase $mkdir_p in
7466600fe5bSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7476600fe5bSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7486600fe5bSmrgesac
7496600fe5bSmrg])
750a0195d5fSmrg
7516600fe5bSmrg# Helper functions for option handling.                     -*- Autoconf -*-
752a0195d5fSmrg
7536600fe5bSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
754a0195d5fSmrg#
7556600fe5bSmrg# This file is free software; the Free Software Foundation
7566600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
7576600fe5bSmrg# with or without modifications, as long as this notice is preserved.
758a0195d5fSmrg
7596600fe5bSmrg# serial 4
760a0195d5fSmrg
7616600fe5bSmrg# _AM_MANGLE_OPTION(NAME)
7626600fe5bSmrg# -----------------------
7636600fe5bSmrgAC_DEFUN([_AM_MANGLE_OPTION],
7646600fe5bSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765a0195d5fSmrg
7666600fe5bSmrg# _AM_SET_OPTION(NAME)
7676600fe5bSmrg# ------------------------------
7686600fe5bSmrg# Set option NAME.  Presently that only means defining a flag for this option.
7696600fe5bSmrgAC_DEFUN([_AM_SET_OPTION],
7706600fe5bSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
771a0195d5fSmrg
7726600fe5bSmrg# _AM_SET_OPTIONS(OPTIONS)
7736600fe5bSmrg# ----------------------------------
7746600fe5bSmrg# OPTIONS is a space-separated list of Automake options.
7756600fe5bSmrgAC_DEFUN([_AM_SET_OPTIONS],
7766600fe5bSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7776600fe5bSmrg
7786600fe5bSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7796600fe5bSmrg# -------------------------------------------
7806600fe5bSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7816600fe5bSmrgAC_DEFUN([_AM_IF_OPTION],
7826600fe5bSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7836600fe5bSmrg
7846600fe5bSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785a0195d5fSmrg
7866600fe5bSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
7876600fe5bSmrg# Free Software Foundation, Inc.
788a0195d5fSmrg#
789a0195d5fSmrg# This file is free software; the Free Software Foundation
790a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
791a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
792a0195d5fSmrg
7936600fe5bSmrg# serial 5
794a0195d5fSmrg
7956600fe5bSmrg# AM_SANITY_CHECK
7966600fe5bSmrg# ---------------
7976600fe5bSmrgAC_DEFUN([AM_SANITY_CHECK],
7986600fe5bSmrg[AC_MSG_CHECKING([whether build environment is sane])
7996600fe5bSmrg# Just in case
8006600fe5bSmrgsleep 1
8016600fe5bSmrgecho timestamp > conftest.file
8026600fe5bSmrg# Reject unsafe characters in $srcdir or the absolute working directory
8036600fe5bSmrg# name.  Accept space and tab only in the latter.
8046600fe5bSmrgam_lf='
8056600fe5bSmrg'
8066600fe5bSmrgcase `pwd` in
8076600fe5bSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8086600fe5bSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8096600fe5bSmrgesac
8106600fe5bSmrgcase $srcdir in
8116600fe5bSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8126600fe5bSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8136600fe5bSmrgesac
814a0195d5fSmrg
8156600fe5bSmrg# Do `set' in a subshell so we don't clobber the current shell's
8166600fe5bSmrg# arguments.  Must try -L first in case configure is actually a
8176600fe5bSmrg# symlink; some systems play weird games with the mod time of symlinks
8186600fe5bSmrg# (eg FreeBSD returns the mod time of the symlink's containing
8196600fe5bSmrg# directory).
8206600fe5bSmrgif (
8216600fe5bSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8226600fe5bSmrg   if test "$[*]" = "X"; then
8236600fe5bSmrg      # -L didn't work.
8246600fe5bSmrg      set X `ls -t "$srcdir/configure" conftest.file`
8256600fe5bSmrg   fi
8266600fe5bSmrg   rm -f conftest.file
8276600fe5bSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
8286600fe5bSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
829a0195d5fSmrg
8306600fe5bSmrg      # If neither matched, then we have a broken ls.  This can happen
8316600fe5bSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
8326600fe5bSmrg      # broken ls alias from the environment.  This has actually
8336600fe5bSmrg      # happened.  Such a system could not be considered "sane".
8346600fe5bSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8356600fe5bSmrgalias in your environment])
8366600fe5bSmrg   fi
837a0195d5fSmrg
8386600fe5bSmrg   test "$[2]" = conftest.file
8396600fe5bSmrg   )
8406600fe5bSmrgthen
8416600fe5bSmrg   # Ok.
8426600fe5bSmrg   :
8436600fe5bSmrgelse
8446600fe5bSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
8456600fe5bSmrgCheck your system clock])
8466600fe5bSmrgfi
8476600fe5bSmrgAC_MSG_RESULT(yes)])
8486600fe5bSmrg
8496600fe5bSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
850a0195d5fSmrg#
851a0195d5fSmrg# This file is free software; the Free Software Foundation
852a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
853a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
854a0195d5fSmrg
8556600fe5bSmrg# serial 1
856a0195d5fSmrg
8576600fe5bSmrg# AM_SILENT_RULES([DEFAULT])
8586600fe5bSmrg# --------------------------
8596600fe5bSmrg# Enable less verbose build rules; with the default set to DEFAULT
8606600fe5bSmrg# (`yes' being less verbose, `no' or empty being verbose).
8616600fe5bSmrgAC_DEFUN([AM_SILENT_RULES],
8626600fe5bSmrg[AC_ARG_ENABLE([silent-rules],
8636600fe5bSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8646600fe5bSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8656600fe5bSmrgcase $enable_silent_rules in
8666600fe5bSmrgyes) AM_DEFAULT_VERBOSITY=0;;
8676600fe5bSmrgno)  AM_DEFAULT_VERBOSITY=1;;
8686600fe5bSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8696600fe5bSmrgesac
8706600fe5bSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8716600fe5bSmrgAM_BACKSLASH='\'
8726600fe5bSmrgAC_SUBST([AM_BACKSLASH])dnl
8736600fe5bSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
874a0195d5fSmrg])
875a0195d5fSmrg
8766600fe5bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8776600fe5bSmrg#
8786600fe5bSmrg# This file is free software; the Free Software Foundation
8796600fe5bSmrg# gives unlimited permission to copy and/or distribute it,
8806600fe5bSmrg# with or without modifications, as long as this notice is preserved.
8816600fe5bSmrg
8826600fe5bSmrg# AM_PROG_INSTALL_STRIP
8836600fe5bSmrg# ---------------------
8846600fe5bSmrg# One issue with vendor `install' (even GNU) is that you can't
8856600fe5bSmrg# specify the program used to strip binaries.  This is especially
8866600fe5bSmrg# annoying in cross-compiling environments, where the build's strip
8876600fe5bSmrg# is unlikely to handle the host's binaries.
8886600fe5bSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
8896600fe5bSmrg# always use install-sh in `make install-strip', and initialize
8906600fe5bSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
8916600fe5bSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
8926600fe5bSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
8936600fe5bSmrg# Installed binaries are usually stripped using `strip' when the user
8946600fe5bSmrg# run `make install-strip'.  However `strip' might not be the right
8956600fe5bSmrg# tool to use in cross-compilation environments, therefore Automake
8966600fe5bSmrg# will honor the `STRIP' environment variable to overrule this program.
8976600fe5bSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
8986600fe5bSmrgif test "$cross_compiling" != no; then
8996600fe5bSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
9006600fe5bSmrgfi
9016600fe5bSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9026600fe5bSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
903a0195d5fSmrg
9046600fe5bSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
905a0195d5fSmrg#
906a0195d5fSmrg# This file is free software; the Free Software Foundation
907a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
908a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
909a0195d5fSmrg
9106600fe5bSmrg# serial 2
911a0195d5fSmrg
9126600fe5bSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
9136600fe5bSmrg# ---------------------------
9146600fe5bSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9156600fe5bSmrg# This macro is traced by Automake.
9166600fe5bSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
917a0195d5fSmrg
9186600fe5bSmrg# AM_SUBST_NOTMAKE(VARIABLE)
9196600fe5bSmrg# ---------------------------
9206600fe5bSmrg# Public sister of _AM_SUBST_NOTMAKE.
9216600fe5bSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9226600fe5bSmrg
9236600fe5bSmrg# Check how to create a tarball.                            -*- Autoconf -*-
9246600fe5bSmrg
9256600fe5bSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
926a0195d5fSmrg#
927a0195d5fSmrg# This file is free software; the Free Software Foundation
928a0195d5fSmrg# gives unlimited permission to copy and/or distribute it,
929a0195d5fSmrg# with or without modifications, as long as this notice is preserved.
930a0195d5fSmrg
9316600fe5bSmrg# serial 2
932a0195d5fSmrg
9336600fe5bSmrg# _AM_PROG_TAR(FORMAT)
9346600fe5bSmrg# --------------------
9356600fe5bSmrg# Check how to create a tarball in format FORMAT.
9366600fe5bSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
937a0195d5fSmrg#
9386600fe5bSmrg# Substitute a variable $(am__tar) that is a command
9396600fe5bSmrg# writing to stdout a FORMAT-tarball containing the directory
9406600fe5bSmrg# $tardir.
9416600fe5bSmrg#     tardir=directory && $(am__tar) > result.tar
9426600fe5bSmrg#
9436600fe5bSmrg# Substitute a variable $(am__untar) that extract such
9446600fe5bSmrg# a tarball read from stdin.
9456600fe5bSmrg#     $(am__untar) < result.tar
9466600fe5bSmrgAC_DEFUN([_AM_PROG_TAR],
9476600fe5bSmrg[# Always define AMTAR for backward compatibility.
9486600fe5bSmrgAM_MISSING_PROG([AMTAR], [tar])
9496600fe5bSmrgm4_if([$1], [v7],
9506600fe5bSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
9516600fe5bSmrg     [m4_case([$1], [ustar],, [pax],,
9526600fe5bSmrg              [m4_fatal([Unknown tar format])])
9536600fe5bSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
9546600fe5bSmrg# Loop over all known methods to create a tar archive until one works.
9556600fe5bSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9566600fe5bSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
9576600fe5bSmrg# Do not fold the above two line into one, because Tru64 sh and
9586600fe5bSmrg# Solaris sh will not grok spaces in the rhs of `-'.
9596600fe5bSmrgfor _am_tool in $_am_tools
9606600fe5bSmrgdo
9616600fe5bSmrg  case $_am_tool in
9626600fe5bSmrg  gnutar)
9636600fe5bSmrg    for _am_tar in tar gnutar gtar;
9646600fe5bSmrg    do
9656600fe5bSmrg      AM_RUN_LOG([$_am_tar --version]) && break
9666600fe5bSmrg    done
9676600fe5bSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9686600fe5bSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9696600fe5bSmrg    am__untar="$_am_tar -xf -"
9706600fe5bSmrg    ;;
9716600fe5bSmrg  plaintar)
9726600fe5bSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
9736600fe5bSmrg    # ustar tarball either.
9746600fe5bSmrg    (tar --version) >/dev/null 2>&1 && continue
9756600fe5bSmrg    am__tar='tar chf - "$$tardir"'
9766600fe5bSmrg    am__tar_='tar chf - "$tardir"'
9776600fe5bSmrg    am__untar='tar xf -'
9786600fe5bSmrg    ;;
9796600fe5bSmrg  pax)
9806600fe5bSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
9816600fe5bSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
9826600fe5bSmrg    am__untar='pax -r'
9836600fe5bSmrg    ;;
9846600fe5bSmrg  cpio)
9856600fe5bSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9866600fe5bSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9876600fe5bSmrg    am__untar='cpio -i -H $1 -d'
9886600fe5bSmrg    ;;
9896600fe5bSmrg  none)
9906600fe5bSmrg    am__tar=false
9916600fe5bSmrg    am__tar_=false
9926600fe5bSmrg    am__untar=false
9936600fe5bSmrg    ;;
9946600fe5bSmrg  esac
995a0195d5fSmrg
9966600fe5bSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
9976600fe5bSmrg  # and am__untar set.
9986600fe5bSmrg  test -n "${am_cv_prog_tar_$1}" && break
999a0195d5fSmrg
10006600fe5bSmrg  # tar/untar a dummy directory, and stop if the command works
10016600fe5bSmrg  rm -rf conftest.dir
1002a0195d5fSmrg  mkdir conftest.dir
10036600fe5bSmrg  echo GrepMe > conftest.dir/file
10046600fe5bSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10056600fe5bSmrg  rm -rf conftest.dir
10066600fe5bSmrg  if test -s conftest.tar; then
10076600fe5bSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
10086600fe5bSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1009a0195d5fSmrg  fi
10106600fe5bSmrgdone
10116600fe5bSmrgrm -rf conftest.dir
10126600fe5bSmrg
10136600fe5bSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10146600fe5bSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
10156600fe5bSmrgAC_SUBST([am__tar])
10166600fe5bSmrgAC_SUBST([am__untar])
10176600fe5bSmrg]) # _AM_PROG_TAR
10186600fe5bSmrg
10196600fe5bSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10206600fe5bSmrgdnl
10212ab73d9fSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
10226600fe5bSmrgdnl 
10236600fe5bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10246f5dd5c2Smrgdnl copy of this software and associated documentation files (the "Software"),
10256f5dd5c2Smrgdnl to deal in the Software without restriction, including without limitation
10266f5dd5c2Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
10276f5dd5c2Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
10286f5dd5c2Smrgdnl Software is furnished to do so, subject to the following conditions:
10296600fe5bSmrgdnl
10306f5dd5c2Smrgdnl The above copyright notice and this permission notice (including the next
10316f5dd5c2Smrgdnl paragraph) shall be included in all copies or substantial portions of the
10326f5dd5c2Smrgdnl Software.
10336600fe5bSmrgdnl
10346f5dd5c2Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10356f5dd5c2Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10366f5dd5c2Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
10376f5dd5c2Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10386f5dd5c2Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
10396f5dd5c2Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
10406f5dd5c2Smrgdnl DEALINGS IN THE SOFTWARE.
10416600fe5bSmrg
10426600fe5bSmrg# XORG_MACROS_VERSION(required-version)
10436600fe5bSmrg# -------------------------------------
10446600fe5bSmrg# Minimum version: 1.1.0
10456600fe5bSmrg#
10466600fe5bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
10476600fe5bSmrg# your configure.ac with the minimum required version, such as:
10486600fe5bSmrg# XORG_MACROS_VERSION(1.1)
10496600fe5bSmrg#
10506600fe5bSmrg# To ensure that this macro is defined, also add:
10516600fe5bSmrg# m4_ifndef([XORG_MACROS_VERSION],
10526600fe5bSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10536600fe5bSmrg#
10546600fe5bSmrg#
10556600fe5bSmrg# See the "minimum version" comment for each macro you use to see what 
10566600fe5bSmrg# version you require.
10576600fe5bSmrgm4_defun([XORG_MACROS_VERSION],[
10582ab73d9fSmrgm4_define([vers_have], [1.11.0])
10596600fe5bSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10606600fe5bSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10616600fe5bSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
10626600fe5bSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
10636600fe5bSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
10646600fe5bSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
10656600fe5bSmrgm4_undefine([vers_have])
10666600fe5bSmrgm4_undefine([maj_have])
10676600fe5bSmrgm4_undefine([maj_needed])
10686600fe5bSmrg]) # XORG_MACROS_VERSION
10696600fe5bSmrg
10706600fe5bSmrg# XORG_PROG_RAWCPP()
10716600fe5bSmrg# ------------------
10726600fe5bSmrg# Minimum version: 1.0.0
10736600fe5bSmrg#
10746600fe5bSmrg# Find cpp program and necessary flags for use in pre-processing text files
10756600fe5bSmrg# such as man pages and config files
10766600fe5bSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
10776600fe5bSmrgAC_REQUIRE([AC_PROG_CPP])
10786600fe5bSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
10796600fe5bSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1080a0195d5fSmrg
10816600fe5bSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
10826600fe5bSmrg# which is not the best choice for supporting other OS'es, but covers most
10836600fe5bSmrg# of the ones we need for now.
10846600fe5bSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
10856600fe5bSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
10866600fe5bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10876600fe5bSmrg	AC_MSG_RESULT([no])
10886600fe5bSmrgelse
10896600fe5bSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10906600fe5bSmrg		RAWCPPFLAGS=-undef
10916600fe5bSmrg		AC_MSG_RESULT([yes])
10926600fe5bSmrg	# under Cygwin unix is still defined even with -undef
10936600fe5bSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10946600fe5bSmrg		RAWCPPFLAGS="-undef -ansi"
10956600fe5bSmrg		AC_MSG_RESULT([yes, with -ansi])
10966600fe5bSmrg	else
10976600fe5bSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
10986600fe5bSmrg	fi
10996600fe5bSmrgfi
11006600fe5bSmrgrm -f conftest.$ac_ext
1101a0195d5fSmrg
11026600fe5bSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
11036600fe5bSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
11046600fe5bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11056600fe5bSmrg	AC_MSG_RESULT([no])
1106a0195d5fSmrgelse
11076600fe5bSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11086600fe5bSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
11096600fe5bSmrg		AC_MSG_RESULT([yes])
11106600fe5bSmrg	else
11116600fe5bSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
11126600fe5bSmrg	fi
1113a0195d5fSmrgfi
11146600fe5bSmrgrm -f conftest.$ac_ext
11156600fe5bSmrgAC_SUBST(RAWCPPFLAGS)
11166600fe5bSmrg]) # XORG_PROG_RAWCPP
1117a0195d5fSmrg
11186600fe5bSmrg# XORG_MANPAGE_SECTIONS()
11196600fe5bSmrg# -----------------------
11206600fe5bSmrg# Minimum version: 1.0.0
11216600fe5bSmrg#
11226600fe5bSmrg# Determine which sections man pages go in for the different man page types
11236600fe5bSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
11246600fe5bSmrg# Not sure if there's any better way than just hardcoding by OS name.
11256600fe5bSmrg# Override default settings by setting environment variables
11266f5dd5c2Smrg# Added MAN_SUBSTS in version 1.8
11276f5dd5c2Smrg# Added AC_PROG_SED in version 1.8
1128a0195d5fSmrg
11296600fe5bSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
11306600fe5bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
11316f5dd5c2SmrgAC_REQUIRE([AC_PROG_SED])
1132a0195d5fSmrg
11336600fe5bSmrgif test x$APP_MAN_SUFFIX = x    ; then
11346600fe5bSmrg    APP_MAN_SUFFIX=1
11356600fe5bSmrgfi
11366600fe5bSmrgif test x$APP_MAN_DIR = x    ; then
11376600fe5bSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
11386600fe5bSmrgfi
1139a0195d5fSmrg
11406600fe5bSmrgif test x$LIB_MAN_SUFFIX = x    ; then
11416600fe5bSmrg    LIB_MAN_SUFFIX=3
11426600fe5bSmrgfi
11436600fe5bSmrgif test x$LIB_MAN_DIR = x    ; then
11446600fe5bSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1145a0195d5fSmrgfi
1146a0195d5fSmrg
11476600fe5bSmrgif test x$FILE_MAN_SUFFIX = x    ; then
11486600fe5bSmrg    case $host_os in
11496600fe5bSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
11506600fe5bSmrg	*)		FILE_MAN_SUFFIX=5  ;;
11516600fe5bSmrg    esac
11526600fe5bSmrgfi
11536600fe5bSmrgif test x$FILE_MAN_DIR = x    ; then
11546600fe5bSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
11556600fe5bSmrgfi
1156a0195d5fSmrg
11576600fe5bSmrgif test x$MISC_MAN_SUFFIX = x    ; then
11586600fe5bSmrg    case $host_os in
11596600fe5bSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
11606600fe5bSmrg	*)		MISC_MAN_SUFFIX=7  ;;
11616600fe5bSmrg    esac
11626600fe5bSmrgfi
11636600fe5bSmrgif test x$MISC_MAN_DIR = x    ; then
11646600fe5bSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
11656600fe5bSmrgfi
1166a0195d5fSmrg
11676600fe5bSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
11686600fe5bSmrg    case $host_os in
11696600fe5bSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
11706600fe5bSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
11716600fe5bSmrg    esac
11726600fe5bSmrgfi
11736600fe5bSmrgif test x$DRIVER_MAN_DIR = x    ; then
11746600fe5bSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
11756600fe5bSmrgfi
1176a0195d5fSmrg
11776600fe5bSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
11786600fe5bSmrg    case $host_os in
11796600fe5bSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
11806600fe5bSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
11816600fe5bSmrg    esac
11826600fe5bSmrgfi
11836600fe5bSmrgif test x$ADMIN_MAN_DIR = x    ; then
11846600fe5bSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
11856600fe5bSmrgfi
1186a0195d5fSmrg
1187a0195d5fSmrg
11886600fe5bSmrgAC_SUBST([APP_MAN_SUFFIX])
11896600fe5bSmrgAC_SUBST([LIB_MAN_SUFFIX])
11906600fe5bSmrgAC_SUBST([FILE_MAN_SUFFIX])
11916600fe5bSmrgAC_SUBST([MISC_MAN_SUFFIX])
11926600fe5bSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
11936600fe5bSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
11946600fe5bSmrgAC_SUBST([APP_MAN_DIR])
11956600fe5bSmrgAC_SUBST([LIB_MAN_DIR])
11966600fe5bSmrgAC_SUBST([FILE_MAN_DIR])
11976600fe5bSmrgAC_SUBST([MISC_MAN_DIR])
11986600fe5bSmrgAC_SUBST([DRIVER_MAN_DIR])
11996600fe5bSmrgAC_SUBST([ADMIN_MAN_DIR])
12006f5dd5c2Smrg
12016f5dd5c2SmrgXORG_MAN_PAGE="X Version 11"
12026f5dd5c2SmrgAC_SUBST([XORG_MAN_PAGE])
12036f5dd5c2SmrgMAN_SUBSTS="\
12046f5dd5c2Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12056f5dd5c2Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12066f5dd5c2Smrg	-e 's|__xservername__|Xorg|g' \
12076f5dd5c2Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
12086f5dd5c2Smrg	-e 's|__projectroot__|\$(prefix)|g' \
12092ab73d9fSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
12106f5dd5c2Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
12116f5dd5c2Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
12126f5dd5c2Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
12136f5dd5c2Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
12146f5dd5c2Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
12156f5dd5c2Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
12166f5dd5c2SmrgAC_SUBST([MAN_SUBSTS])
12176f5dd5c2Smrg
12186600fe5bSmrg]) # XORG_MANPAGE_SECTIONS
1219a0195d5fSmrg
12206f5dd5c2Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
12216f5dd5c2Smrg# ------------------------
12226f5dd5c2Smrg# Minimum version: 1.7.0
12236f5dd5c2Smrg#
12246f5dd5c2Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
12256f5dd5c2Smrg# provided by xorg-sgml-doctools, if installed.
12266f5dd5c2SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
12276f5dd5c2SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
12286f5dd5c2SmrgXORG_SGML_PATH=
12296f5dd5c2SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
12306f5dd5c2Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
12316f5dd5c2Smrg    [m4_ifval([$1],[:],
12326f5dd5c2Smrg        [if test x"$cross_compiling" != x"yes" ; then
12336f5dd5c2Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
12346f5dd5c2Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
12356f5dd5c2Smrg         fi])
12366f5dd5c2Smrg    ])
12376f5dd5c2Smrg
12386f5dd5c2Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
12396f5dd5c2Smrg# the path and the name of the doc stylesheet
12406f5dd5c2Smrgif test "x$XORG_SGML_PATH" != "x" ; then
12416f5dd5c2Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
12426f5dd5c2Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
12436f5dd5c2Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
12446f5dd5c2Smrgelse
12456f5dd5c2Smrg   AC_MSG_RESULT([no])
12466f5dd5c2Smrgfi
12476f5dd5c2Smrg
12486f5dd5c2SmrgAC_SUBST(XORG_SGML_PATH)
12496f5dd5c2SmrgAC_SUBST(STYLESHEET_SRCDIR)
12506f5dd5c2SmrgAC_SUBST(XSL_STYLESHEET)
12516f5dd5c2SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
12526f5dd5c2Smrg]) # XORG_CHECK_SGML_DOCTOOLS
12536f5dd5c2Smrg
12546600fe5bSmrg# XORG_CHECK_LINUXDOC
12556600fe5bSmrg# -------------------
12566600fe5bSmrg# Minimum version: 1.0.0
1257a0195d5fSmrg#
12586600fe5bSmrg# Defines the variable MAKE_TEXT if the necessary tools and
12596600fe5bSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
12606600fe5bSmrg# Whether or not the necessary tools and files are found can be checked
12616600fe5bSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
12626600fe5bSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12636f5dd5c2SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
12646f5dd5c2SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1265a0195d5fSmrg
12666600fe5bSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1267a0195d5fSmrg
12686f5dd5c2SmrgAC_MSG_CHECKING([whether to build documentation])
1269a0195d5fSmrg
12706f5dd5c2Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
12716600fe5bSmrg   BUILDDOC=yes
12726600fe5bSmrgelse
12736600fe5bSmrg   BUILDDOC=no
1274a0195d5fSmrgfi
1275a0195d5fSmrg
12766600fe5bSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1277a0195d5fSmrg
12786600fe5bSmrgAC_MSG_RESULT([$BUILDDOC])
1279a0195d5fSmrg
12806f5dd5c2SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1281a0195d5fSmrg
12826f5dd5c2Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
12836600fe5bSmrg   BUILDPDFDOC=yes
12846600fe5bSmrgelse
12856600fe5bSmrg   BUILDPDFDOC=no
12866600fe5bSmrgfi
1287a0195d5fSmrg
12886600fe5bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1289a0195d5fSmrg
12906600fe5bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1291a0195d5fSmrg
12926f5dd5c2SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
12936600fe5bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
12946600fe5bSmrgMAKE_PDF="$PS2PDF"
12956600fe5bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1296a0195d5fSmrg
12976600fe5bSmrgAC_SUBST(MAKE_TEXT)
12986600fe5bSmrgAC_SUBST(MAKE_PS)
12996600fe5bSmrgAC_SUBST(MAKE_PDF)
13006600fe5bSmrgAC_SUBST(MAKE_HTML)
13016600fe5bSmrg]) # XORG_CHECK_LINUXDOC
13026600fe5bSmrg
13036600fe5bSmrg# XORG_CHECK_DOCBOOK
13046600fe5bSmrg# -------------------
13056600fe5bSmrg# Minimum version: 1.0.0
1306a0195d5fSmrg#
13076600fe5bSmrg# Checks for the ability to build output formats from SGML DocBook source.
13086600fe5bSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
13096600fe5bSmrg# indicates whether the necessary tools and files are found and, if set,
13106600fe5bSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
13116600fe5bSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
13126f5dd5c2SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
13136f5dd5c2Smrg
13146600fe5bSmrgBUILDTXTDOC=no
13156600fe5bSmrgBUILDPDFDOC=no
13166600fe5bSmrgBUILDPSDOC=no
13176600fe5bSmrgBUILDHTMLDOC=no
1318a0195d5fSmrg
13196600fe5bSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
13206600fe5bSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
13216600fe5bSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
13226600fe5bSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1323a0195d5fSmrg
13246f5dd5c2SmrgAC_MSG_CHECKING([whether to build text documentation])
13256f5dd5c2Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
13266600fe5bSmrg   test x$BUILD_TXTDOC != xno; then
13276600fe5bSmrg	BUILDTXTDOC=yes
13286600fe5bSmrgfi
13296600fe5bSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
13306600fe5bSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1331a0195d5fSmrg
13326f5dd5c2SmrgAC_MSG_CHECKING([whether to build PDF documentation])
13336f5dd5c2Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
13346600fe5bSmrg   test x$BUILD_PDFDOC != xno; then
13356600fe5bSmrg	BUILDPDFDOC=yes
1336a0195d5fSmrgfi
13376600fe5bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13386600fe5bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1339a0195d5fSmrg
13406f5dd5c2SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
13416f5dd5c2Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
13426600fe5bSmrg   test x$BUILD_PSDOC != xno; then
13436600fe5bSmrg	BUILDPSDOC=yes
13446600fe5bSmrgfi
13456600fe5bSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
13466600fe5bSmrgAC_MSG_RESULT([$BUILDPSDOC])
1347a0195d5fSmrg
13486f5dd5c2SmrgAC_MSG_CHECKING([whether to build HTML documentation])
13496f5dd5c2Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
13506600fe5bSmrg   test x$BUILD_HTMLDOC != xno; then
13516600fe5bSmrg	BUILDHTMLDOC=yes
13526600fe5bSmrgfi
13536600fe5bSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
13546600fe5bSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1355a0195d5fSmrg
13566600fe5bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
13576600fe5bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
13586600fe5bSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
13596600fe5bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1360a0195d5fSmrg
13616600fe5bSmrgAC_SUBST(MAKE_TEXT)
13626600fe5bSmrgAC_SUBST(MAKE_PS)
13636600fe5bSmrgAC_SUBST(MAKE_PDF)
13646600fe5bSmrgAC_SUBST(MAKE_HTML)
13656600fe5bSmrg]) # XORG_CHECK_DOCBOOK
1366a0195d5fSmrg
13672ab73d9fSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
13686f5dd5c2Smrg# ----------------
13696f5dd5c2Smrg# Minimum version: 1.5.0
13702ab73d9fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
13716f5dd5c2Smrg#
13726f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
13736f5dd5c2Smrg# not at the appropriate level. This macro enables a module to test for the
13746f5dd5c2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
13756f5dd5c2Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
13762ab73d9fSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
13772ab73d9fSmrg# --with-xmlto assumes 'auto'.
13786f5dd5c2Smrg#
13796f5dd5c2Smrg# Interface to module:
13806f5dd5c2Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
13816f5dd5c2Smrg# XMLTO:	returns the path of the xmlto program found
13826f5dd5c2Smrg#		returns the path set by the user in the environment
13836f5dd5c2Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
13846f5dd5c2Smrg#		'no' user instructs the module not to use xmlto
13856f5dd5c2Smrg#
13866f5dd5c2Smrg# Added in version 1.10.0
13876f5dd5c2Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
13886f5dd5c2Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
13896f5dd5c2Smrg#
13906f5dd5c2Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
13916f5dd5c2Smrg#
13926f5dd5c2SmrgAC_DEFUN([XORG_WITH_XMLTO],[
13936f5dd5c2SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
13942ab73d9fSmrgm4_define([_defopt], m4_default([$2], [auto]))
13956f5dd5c2SmrgAC_ARG_WITH(xmlto,
13966f5dd5c2Smrg	AS_HELP_STRING([--with-xmlto],
13972ab73d9fSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
13982ab73d9fSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
13992ab73d9fSmrgm4_undefine([_defopt])
14006f5dd5c2Smrg
14016f5dd5c2Smrgif test "x$use_xmlto" = x"auto"; then
14026f5dd5c2Smrg   AC_PATH_PROG([XMLTO], [xmlto])
14036f5dd5c2Smrg   if test "x$XMLTO" = "x"; then
14046f5dd5c2Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
14056f5dd5c2Smrg	have_xmlto=no
14066f5dd5c2Smrg   else
14076f5dd5c2Smrg        have_xmlto=yes
14086f5dd5c2Smrg   fi
14096f5dd5c2Smrgelif test "x$use_xmlto" = x"yes" ; then
14106f5dd5c2Smrg   AC_PATH_PROG([XMLTO], [xmlto])
14116f5dd5c2Smrg   if test "x$XMLTO" = "x"; then
14126f5dd5c2Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
14136f5dd5c2Smrg   fi
14146f5dd5c2Smrg   have_xmlto=yes
14156f5dd5c2Smrgelif test "x$use_xmlto" = x"no" ; then
14166f5dd5c2Smrg   if test "x$XMLTO" != "x"; then
14176f5dd5c2Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
14186f5dd5c2Smrg   fi
14196f5dd5c2Smrg   have_xmlto=no
14206f5dd5c2Smrgelse
14216f5dd5c2Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
14226f5dd5c2Smrgfi
14236f5dd5c2Smrg
14246f5dd5c2Smrg# Test for a minimum version of xmlto, if provided.
14256f5dd5c2Smrgm4_ifval([$1],
14266f5dd5c2Smrg[if test "$have_xmlto" = yes; then
14276f5dd5c2Smrg    # scrape the xmlto version
14286f5dd5c2Smrg    AC_MSG_CHECKING([the xmlto version])
14296f5dd5c2Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
14306f5dd5c2Smrg    AC_MSG_RESULT([$xmlto_version])
14316f5dd5c2Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
14326f5dd5c2Smrg        [if test "x$use_xmlto" = xauto; then
14336f5dd5c2Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
14346f5dd5c2Smrg            have_xmlto=no
14356f5dd5c2Smrg        else
14366f5dd5c2Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
14376f5dd5c2Smrg        fi])
14386f5dd5c2Smrgfi])
14396f5dd5c2Smrg
14406f5dd5c2Smrg# Test for the ability of xmlto to generate a text target
14416f5dd5c2Smrghave_xmlto_text=no
14426f5dd5c2Smrgcat > conftest.xml << "EOF"
14436f5dd5c2SmrgEOF
14446f5dd5c2SmrgAS_IF([test "$have_xmlto" = yes],
14456f5dd5c2Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
14466f5dd5c2Smrg             [have_xmlto_text=yes],
14476f5dd5c2Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
14486f5dd5c2Smrgrm -f conftest.xml
14496f5dd5c2SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
14506f5dd5c2SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
14516f5dd5c2Smrg]) # XORG_WITH_XMLTO
14526f5dd5c2Smrg
14532ab73d9fSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
14546f5dd5c2Smrg# ----------------
14556f5dd5c2Smrg# Minimum version: 1.5.0
14562ab73d9fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
14576f5dd5c2Smrg#
14586f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
14596f5dd5c2Smrg# not at the appropriate level. This macro enables a module to test for the
14606f5dd5c2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
14616f5dd5c2Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
14622ab73d9fSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
14632ab73d9fSmrg# --with-asciidoc assumes 'auto'.
14646f5dd5c2Smrg#
14656f5dd5c2Smrg# Interface to module:
14666f5dd5c2Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
14676f5dd5c2Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
14686f5dd5c2Smrg#		 returns the path set by the user in the environment
14696f5dd5c2Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
14706f5dd5c2Smrg#		  'no' user instructs the module not to use asciidoc
14716f5dd5c2Smrg#
14726f5dd5c2Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
14736f5dd5c2Smrg#
14746f5dd5c2SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
14756f5dd5c2SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
14762ab73d9fSmrgm4_define([_defopt], m4_default([$2], [auto]))
14776f5dd5c2SmrgAC_ARG_WITH(asciidoc,
14786f5dd5c2Smrg	AS_HELP_STRING([--with-asciidoc],
14792ab73d9fSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
14802ab73d9fSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
14812ab73d9fSmrgm4_undefine([_defopt])
14826f5dd5c2Smrg
14836f5dd5c2Smrgif test "x$use_asciidoc" = x"auto"; then
14846f5dd5c2Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
14856f5dd5c2Smrg   if test "x$ASCIIDOC" = "x"; then
14866f5dd5c2Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
14876f5dd5c2Smrg	have_asciidoc=no
14886f5dd5c2Smrg   else
14896f5dd5c2Smrg        have_asciidoc=yes
14906f5dd5c2Smrg   fi
14916f5dd5c2Smrgelif test "x$use_asciidoc" = x"yes" ; then
14926f5dd5c2Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
14936f5dd5c2Smrg   if test "x$ASCIIDOC" = "x"; then
14946f5dd5c2Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
14956f5dd5c2Smrg   fi
14966f5dd5c2Smrg   have_asciidoc=yes
14976f5dd5c2Smrgelif test "x$use_asciidoc" = x"no" ; then
14986f5dd5c2Smrg   if test "x$ASCIIDOC" != "x"; then
14996f5dd5c2Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
15006f5dd5c2Smrg   fi
15016f5dd5c2Smrg   have_asciidoc=no
15026f5dd5c2Smrgelse
15036f5dd5c2Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
15046f5dd5c2Smrgfi
15056f5dd5c2Smrgm4_ifval([$1],
15066f5dd5c2Smrg[if test "$have_asciidoc" = yes; then
15076f5dd5c2Smrg    # scrape the asciidoc version
15086f5dd5c2Smrg    AC_MSG_CHECKING([the asciidoc version])
15096f5dd5c2Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
15106f5dd5c2Smrg    AC_MSG_RESULT([$asciidoc_version])
15116f5dd5c2Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
15126f5dd5c2Smrg        [if test "x$use_asciidoc" = xauto; then
15136f5dd5c2Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
15146f5dd5c2Smrg            have_asciidoc=no
15156f5dd5c2Smrg        else
15166f5dd5c2Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
15176f5dd5c2Smrg        fi])
15186f5dd5c2Smrgfi])
15196f5dd5c2SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
15206f5dd5c2Smrg]) # XORG_WITH_ASCIIDOC
15216f5dd5c2Smrg
15222ab73d9fSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
15236f5dd5c2Smrg# --------------------------------
15246f5dd5c2Smrg# Minimum version: 1.5.0
15252ab73d9fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
15266f5dd5c2Smrg#
15276f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
15286f5dd5c2Smrg# not at the appropriate level. This macro enables a module to test for the
15296f5dd5c2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
15306f5dd5c2Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
15312ab73d9fSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
15322ab73d9fSmrg# --with-doxygen assumes 'auto'.
15336f5dd5c2Smrg#
15346f5dd5c2Smrg# Interface to module:
15356f5dd5c2Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
15366f5dd5c2Smrg# DOXYGEN:	 returns the path of the doxygen program found
15376f5dd5c2Smrg#		 returns the path set by the user in the environment
15386f5dd5c2Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
15396f5dd5c2Smrg#		  'no' user instructs the module not to use doxygen
15406f5dd5c2Smrg#
15416f5dd5c2Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
15426f5dd5c2Smrg#
15436f5dd5c2SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
15446f5dd5c2SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
15452ab73d9fSmrgm4_define([_defopt], m4_default([$2], [auto]))
15466f5dd5c2SmrgAC_ARG_WITH(doxygen,
15476f5dd5c2Smrg	AS_HELP_STRING([--with-doxygen],
15482ab73d9fSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
15492ab73d9fSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
15502ab73d9fSmrgm4_undefine([_defopt])
15516f5dd5c2Smrg
15526f5dd5c2Smrgif test "x$use_doxygen" = x"auto"; then
15536f5dd5c2Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15546f5dd5c2Smrg   if test "x$DOXYGEN" = "x"; then
15556f5dd5c2Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
15566f5dd5c2Smrg	have_doxygen=no
15576f5dd5c2Smrg   else
15586f5dd5c2Smrg        have_doxygen=yes
15596f5dd5c2Smrg   fi
15606f5dd5c2Smrgelif test "x$use_doxygen" = x"yes" ; then
15616f5dd5c2Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15626f5dd5c2Smrg   if test "x$DOXYGEN" = "x"; then
15636f5dd5c2Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
15646f5dd5c2Smrg   fi
15656f5dd5c2Smrg   have_doxygen=yes
15666f5dd5c2Smrgelif test "x$use_doxygen" = x"no" ; then
15676f5dd5c2Smrg   if test "x$DOXYGEN" != "x"; then
15686f5dd5c2Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
15696f5dd5c2Smrg   fi
15706f5dd5c2Smrg   have_doxygen=no
15716f5dd5c2Smrgelse
15726f5dd5c2Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
15736f5dd5c2Smrgfi
15746f5dd5c2Smrgm4_ifval([$1],
15756f5dd5c2Smrg[if test "$have_doxygen" = yes; then
15766f5dd5c2Smrg    # scrape the doxygen version
15776f5dd5c2Smrg    AC_MSG_CHECKING([the doxygen version])
15786f5dd5c2Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
15796f5dd5c2Smrg    AC_MSG_RESULT([$doxygen_version])
15806f5dd5c2Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
15816f5dd5c2Smrg        [if test "x$use_doxygen" = xauto; then
15826f5dd5c2Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
15836f5dd5c2Smrg            have_doxygen=no
15846f5dd5c2Smrg        else
15856f5dd5c2Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
15866f5dd5c2Smrg        fi])
15876f5dd5c2Smrgfi])
15886f5dd5c2SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
15896f5dd5c2Smrg]) # XORG_WITH_DOXYGEN
15906f5dd5c2Smrg
15912ab73d9fSmrg# XORG_WITH_GROFF([DEFAULT])
15926f5dd5c2Smrg# ----------------
15936f5dd5c2Smrg# Minimum version: 1.6.0
15942ab73d9fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
15956f5dd5c2Smrg#
15966f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
15976f5dd5c2Smrg# not at the appropriate level. This macro enables a module to test for the
15986f5dd5c2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
15996f5dd5c2Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
16002ab73d9fSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
16012ab73d9fSmrg# --with-groff assumes 'auto'.
16026f5dd5c2Smrg#
16036f5dd5c2Smrg# Interface to module:
16046f5dd5c2Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
16056f5dd5c2Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
16066f5dd5c2Smrg# HAVE_GROFF_MS: the -ms macros package
16076f5dd5c2Smrg# GROFF:	 returns the path of the groff program found
16086f5dd5c2Smrg#		 returns the path set by the user in the environment
16096f5dd5c2Smrg# --with-groff:	 'yes' user instructs the module to use groff
16106f5dd5c2Smrg#		 'no' user instructs the module not to use groff
16116f5dd5c2Smrg#
16126f5dd5c2Smrg# Added in version 1.9.0:
16136f5dd5c2Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
16146f5dd5c2Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
16156f5dd5c2Smrg#		   psselect from the psutils package.
16166f5dd5c2Smrg#		   the ghostcript package. Refer to the grohtml man pages
16176f5dd5c2Smrg#
16186f5dd5c2Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
16196f5dd5c2Smrg#
16206f5dd5c2Smrg# OS and distros often splits groff in a basic and full package, the former
16216f5dd5c2Smrg# having the groff program and the later having devices, fonts and macros
16226f5dd5c2Smrg# Checking for the groff executable is not enough.
16236f5dd5c2Smrg#
16246f5dd5c2Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
16256f5dd5c2Smrg# unset HAVE_GROFF or GROFF env variables.
16266f5dd5c2Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
16276f5dd5c2Smrg#
16286f5dd5c2SmrgAC_DEFUN([XORG_WITH_GROFF],[
16296f5dd5c2SmrgAC_ARG_VAR([GROFF], [Path to groff command])
16302ab73d9fSmrgm4_define([_defopt], m4_default([$1], [auto]))
16316f5dd5c2SmrgAC_ARG_WITH(groff,
16326f5dd5c2Smrg	AS_HELP_STRING([--with-groff],
16332ab73d9fSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
16342ab73d9fSmrg	   [use_groff=$withval], [use_groff=]_defopt)
16352ab73d9fSmrgm4_undefine([_defopt])
16366f5dd5c2Smrg
16376f5dd5c2Smrgif test "x$use_groff" = x"auto"; then
16386f5dd5c2Smrg   AC_PATH_PROG([GROFF], [groff])
16396f5dd5c2Smrg   if test "x$GROFF" = "x"; then
16406f5dd5c2Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
16416f5dd5c2Smrg	have_groff=no
16426f5dd5c2Smrg   else
16436f5dd5c2Smrg        have_groff=yes
16446f5dd5c2Smrg   fi
16456f5dd5c2Smrgelif test "x$use_groff" = x"yes" ; then
16466f5dd5c2Smrg   AC_PATH_PROG([GROFF], [groff])
16476f5dd5c2Smrg   if test "x$GROFF" = "x"; then
16486f5dd5c2Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
16496f5dd5c2Smrg   fi
16506f5dd5c2Smrg   have_groff=yes
16516f5dd5c2Smrgelif test "x$use_groff" = x"no" ; then
16526f5dd5c2Smrg   if test "x$GROFF" != "x"; then
16536f5dd5c2Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
16546f5dd5c2Smrg   fi
16556f5dd5c2Smrg   have_groff=no
16566f5dd5c2Smrgelse
16576f5dd5c2Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
16586f5dd5c2Smrgfi
16596f5dd5c2Smrg
16606f5dd5c2Smrg# We have groff, test for the presence of the macro packages
16616f5dd5c2Smrgif test "x$have_groff" = x"yes"; then
16626f5dd5c2Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
16636f5dd5c2Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
16646f5dd5c2Smrg        groff_ms_works=yes
16656f5dd5c2Smrg    else
16666f5dd5c2Smrg        groff_ms_works=no
16676f5dd5c2Smrg    fi
16686f5dd5c2Smrg    AC_MSG_RESULT([$groff_ms_works])
16696f5dd5c2Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
16706f5dd5c2Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
16716f5dd5c2Smrg        groff_mm_works=yes
16726f5dd5c2Smrg    else
16736f5dd5c2Smrg        groff_mm_works=no
16746f5dd5c2Smrg    fi
16756f5dd5c2Smrg    AC_MSG_RESULT([$groff_mm_works])
16766f5dd5c2Smrgfi
16776f5dd5c2Smrg
16786f5dd5c2Smrg# We have groff, test for HTML dependencies, one command per package
16796f5dd5c2Smrgif test "x$have_groff" = x"yes"; then
16806f5dd5c2Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
16816f5dd5c2Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
16826f5dd5c2Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
16836f5dd5c2Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
16846f5dd5c2Smrg      have_groff_html=yes
16856f5dd5c2Smrg   else
16866f5dd5c2Smrg      have_groff_html=no
16876f5dd5c2Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
16886f5dd5c2Smrg   fi
16896f5dd5c2Smrgfi
16906f5dd5c2Smrg
16916f5dd5c2Smrg# Set Automake conditionals for Makefiles
16926f5dd5c2SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
16936f5dd5c2SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
16946f5dd5c2SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
16956f5dd5c2SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
16966f5dd5c2Smrg]) # XORG_WITH_GROFF
16976f5dd5c2Smrg
16982ab73d9fSmrg# XORG_WITH_FOP([DEFAULT])
16996f5dd5c2Smrg# ----------------
17006f5dd5c2Smrg# Minimum version: 1.6.0
17012ab73d9fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
17026f5dd5c2Smrg#
17036f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
17046f5dd5c2Smrg# not at the appropriate level. This macro enables a module to test for the
17056f5dd5c2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
17066f5dd5c2Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
17072ab73d9fSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
17082ab73d9fSmrg# --with-fop assumes 'auto'.
17096f5dd5c2Smrg#
17106f5dd5c2Smrg# Interface to module:
17116f5dd5c2Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
17126f5dd5c2Smrg# FOP:	 	returns the path of the fop program found
17136f5dd5c2Smrg#		returns the path set by the user in the environment
17146f5dd5c2Smrg# --with-fop: 	'yes' user instructs the module to use fop
17156f5dd5c2Smrg#		'no' user instructs the module not to use fop
17166f5dd5c2Smrg#
17176f5dd5c2Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
17186f5dd5c2Smrg#
17196f5dd5c2SmrgAC_DEFUN([XORG_WITH_FOP],[
17206f5dd5c2SmrgAC_ARG_VAR([FOP], [Path to fop command])
17212ab73d9fSmrgm4_define([_defopt], m4_default([$1], [auto]))
17226f5dd5c2SmrgAC_ARG_WITH(fop,
17236f5dd5c2Smrg	AS_HELP_STRING([--with-fop],
17242ab73d9fSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
17252ab73d9fSmrg	   [use_fop=$withval], [use_fop=]_defopt)
17262ab73d9fSmrgm4_undefine([_defopt])
17276f5dd5c2Smrg
17286f5dd5c2Smrgif test "x$use_fop" = x"auto"; then
17296f5dd5c2Smrg   AC_PATH_PROG([FOP], [fop])
17306f5dd5c2Smrg   if test "x$FOP" = "x"; then
17316f5dd5c2Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
17326f5dd5c2Smrg	have_fop=no
17336f5dd5c2Smrg   else
17346f5dd5c2Smrg        have_fop=yes
17356f5dd5c2Smrg   fi
17366f5dd5c2Smrgelif test "x$use_fop" = x"yes" ; then
17376f5dd5c2Smrg   AC_PATH_PROG([FOP], [fop])
17386f5dd5c2Smrg   if test "x$FOP" = "x"; then
17396f5dd5c2Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
17406f5dd5c2Smrg   fi
17416f5dd5c2Smrg   have_fop=yes
17426f5dd5c2Smrgelif test "x$use_fop" = x"no" ; then
17436f5dd5c2Smrg   if test "x$FOP" != "x"; then
17446f5dd5c2Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
17456f5dd5c2Smrg   fi
17466f5dd5c2Smrg   have_fop=no
17476f5dd5c2Smrgelse
17486f5dd5c2Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
17496f5dd5c2Smrgfi
17506f5dd5c2SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
17516f5dd5c2Smrg]) # XORG_WITH_FOP
17526f5dd5c2Smrg
17532ab73d9fSmrg# XORG_WITH_PS2PDF([DEFAULT])
17546f5dd5c2Smrg# ----------------
17556f5dd5c2Smrg# Minimum version: 1.6.0
17562ab73d9fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
17576f5dd5c2Smrg#
17586f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
17596f5dd5c2Smrg# not at the appropriate level. This macro enables a module to test for the
17606f5dd5c2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
17616f5dd5c2Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
17622ab73d9fSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
17632ab73d9fSmrg# --with-ps2pdf assumes 'auto'.
17646f5dd5c2Smrg#
17656f5dd5c2Smrg# Interface to module:
17666f5dd5c2Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
17676f5dd5c2Smrg# PS2PDF:	returns the path of the ps2pdf program found
17686f5dd5c2Smrg#		returns the path set by the user in the environment
17696f5dd5c2Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
17706f5dd5c2Smrg#		 'no' user instructs the module not to use ps2pdf
17716f5dd5c2Smrg#
17726f5dd5c2Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
17736f5dd5c2Smrg#
17746f5dd5c2SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
17756f5dd5c2SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
17762ab73d9fSmrgm4_define([_defopt], m4_default([$1], [auto]))
17776f5dd5c2SmrgAC_ARG_WITH(ps2pdf,
17786f5dd5c2Smrg	AS_HELP_STRING([--with-ps2pdf],
17792ab73d9fSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
17802ab73d9fSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
17812ab73d9fSmrgm4_undefine([_defopt])
17826f5dd5c2Smrg
17836f5dd5c2Smrgif test "x$use_ps2pdf" = x"auto"; then
17846f5dd5c2Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
17856f5dd5c2Smrg   if test "x$PS2PDF" = "x"; then
17866f5dd5c2Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
17876f5dd5c2Smrg	have_ps2pdf=no
17886f5dd5c2Smrg   else
17896f5dd5c2Smrg        have_ps2pdf=yes
17906f5dd5c2Smrg   fi
17916f5dd5c2Smrgelif test "x$use_ps2pdf" = x"yes" ; then
17926f5dd5c2Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
17936f5dd5c2Smrg   if test "x$PS2PDF" = "x"; then
17946f5dd5c2Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
17956f5dd5c2Smrg   fi
17966f5dd5c2Smrg   have_ps2pdf=yes
17976f5dd5c2Smrgelif test "x$use_ps2pdf" = x"no" ; then
17986f5dd5c2Smrg   if test "x$PS2PDF" != "x"; then
17996f5dd5c2Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
18006f5dd5c2Smrg   fi
18016f5dd5c2Smrg   have_ps2pdf=no
18026f5dd5c2Smrgelse
18036f5dd5c2Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
18046f5dd5c2Smrgfi
18056f5dd5c2SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
18066f5dd5c2Smrg]) # XORG_WITH_PS2PDF
18076f5dd5c2Smrg
18086f5dd5c2Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
18096f5dd5c2Smrg# ----------------
18106f5dd5c2Smrg# Minimum version: 1.6.0
18116f5dd5c2Smrg#
18126f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
18136f5dd5c2Smrg# not at the appropriate level. This macro enables a builder to skip all
18146f5dd5c2Smrg# documentation targets except traditional man pages.
18156f5dd5c2Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18166f5dd5c2Smrg# maximum flexibilty in controlling documentation building.
18176f5dd5c2Smrg# Refer to:
18186f5dd5c2Smrg# XORG_WITH_XMLTO         --with-xmlto
18196f5dd5c2Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18206f5dd5c2Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18216f5dd5c2Smrg# XORG_WITH_FOP           --with-fop
18226f5dd5c2Smrg# XORG_WITH_GROFF         --with-groff
18236f5dd5c2Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18246f5dd5c2Smrg#
18256f5dd5c2Smrg# Interface to module:
18266f5dd5c2Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
18276f5dd5c2Smrg# --enable-docs: 'yes' user instructs the module to generate docs
18286f5dd5c2Smrg#		 'no' user instructs the module not to generate docs
18296f5dd5c2Smrg# parm1:	specify the default value, yes or no.
18306f5dd5c2Smrg#
18316f5dd5c2SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
18322ab73d9fSmrgm4_define([default], m4_default([$1], [yes]))
18336f5dd5c2SmrgAC_ARG_ENABLE(docs,
18346f5dd5c2Smrg	AS_HELP_STRING([--enable-docs],
18352ab73d9fSmrg	   [Enable building the documentation (default: ]default[)]),
18362ab73d9fSmrg	   [build_docs=$enableval], [build_docs=]default)
18372ab73d9fSmrgm4_undefine([default])
18386f5dd5c2SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
18396f5dd5c2SmrgAC_MSG_CHECKING([whether to build documentation])
18406f5dd5c2SmrgAC_MSG_RESULT([$build_docs])
18416f5dd5c2Smrg]) # XORG_ENABLE_DOCS
18426f5dd5c2Smrg
18436f5dd5c2Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
18446f5dd5c2Smrg# ----------------
18456f5dd5c2Smrg# Minimum version: 1.6.0
18466f5dd5c2Smrg#
18476f5dd5c2Smrg# This macro enables a builder to skip all developer documentation.
18486f5dd5c2Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18496f5dd5c2Smrg# maximum flexibilty in controlling documentation building.
18506f5dd5c2Smrg# Refer to:
18516f5dd5c2Smrg# XORG_WITH_XMLTO         --with-xmlto
18526f5dd5c2Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18536f5dd5c2Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18546f5dd5c2Smrg# XORG_WITH_FOP           --with-fop
18556f5dd5c2Smrg# XORG_WITH_GROFF         --with-groff
18566f5dd5c2Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18576f5dd5c2Smrg#
18586f5dd5c2Smrg# Interface to module:
18596f5dd5c2Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
18606f5dd5c2Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
18616f5dd5c2Smrg#			'no' user instructs the module not to generate developer docs
18626f5dd5c2Smrg# parm1:		specify the default value, yes or no.
18636f5dd5c2Smrg#
18646f5dd5c2SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
18652ab73d9fSmrgm4_define([devel_default], m4_default([$1], [yes]))
18666f5dd5c2SmrgAC_ARG_ENABLE(devel-docs,
18676f5dd5c2Smrg	AS_HELP_STRING([--enable-devel-docs],
18682ab73d9fSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
18692ab73d9fSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
18702ab73d9fSmrgm4_undefine([devel_default])
18716f5dd5c2SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
18726f5dd5c2SmrgAC_MSG_CHECKING([whether to build developer documentation])
18736f5dd5c2SmrgAC_MSG_RESULT([$build_devel_docs])
18746f5dd5c2Smrg]) # XORG_ENABLE_DEVEL_DOCS
18756f5dd5c2Smrg
18766f5dd5c2Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
18776f5dd5c2Smrg# ----------------
18786f5dd5c2Smrg# Minimum version: 1.6.0
18796f5dd5c2Smrg#
18806f5dd5c2Smrg# This macro enables a builder to skip all functional specification targets.
18816f5dd5c2Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18826f5dd5c2Smrg# maximum flexibilty in controlling documentation building.
18836f5dd5c2Smrg# Refer to:
18846f5dd5c2Smrg# XORG_WITH_XMLTO         --with-xmlto
18856f5dd5c2Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18866f5dd5c2Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18876f5dd5c2Smrg# XORG_WITH_FOP           --with-fop
18886f5dd5c2Smrg# XORG_WITH_GROFF         --with-groff
18896f5dd5c2Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18906f5dd5c2Smrg#
18916f5dd5c2Smrg# Interface to module:
18926f5dd5c2Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
18936f5dd5c2Smrg# --enable-specs:	'yes' user instructs the module to generate specs
18946f5dd5c2Smrg#			'no' user instructs the module not to generate specs
18956f5dd5c2Smrg# parm1:		specify the default value, yes or no.
18966f5dd5c2Smrg#
18976f5dd5c2SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
18982ab73d9fSmrgm4_define([spec_default], m4_default([$1], [yes]))
18996f5dd5c2SmrgAC_ARG_ENABLE(specs,
19006f5dd5c2Smrg	AS_HELP_STRING([--enable-specs],
19012ab73d9fSmrg	   [Enable building the specs (default: ]spec_default[)]),
19022ab73d9fSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
19032ab73d9fSmrgm4_undefine([spec_default])
19046f5dd5c2SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
19056f5dd5c2SmrgAC_MSG_CHECKING([whether to build functional specifications])
19066f5dd5c2SmrgAC_MSG_RESULT([$build_specs])
19076f5dd5c2Smrg]) # XORG_ENABLE_SPECS
19086f5dd5c2Smrg
19096600fe5bSmrg# XORG_CHECK_MALLOC_ZERO
19106600fe5bSmrg# ----------------------
19116600fe5bSmrg# Minimum version: 1.0.0
19126600fe5bSmrg#
19136600fe5bSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
19146600fe5bSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
19156600fe5bSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
19166600fe5bSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
19176600fe5bSmrgAC_ARG_ENABLE(malloc0returnsnull,
19186600fe5bSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
19196600fe5bSmrg		       [malloc(0) returns NULL (default: auto)]),
19206600fe5bSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
19216600fe5bSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1922a0195d5fSmrg
19236600fe5bSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
19246600fe5bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
19256600fe5bSmrg	AC_RUN_IFELSE([
19266600fe5bSmrgchar *malloc();
19276600fe5bSmrgchar *realloc();
19286600fe5bSmrgchar *calloc();
19296600fe5bSmrgmain() {
19306600fe5bSmrg    char *m0, *r0, *c0, *p;
19316600fe5bSmrg    m0 = malloc(0);
19326600fe5bSmrg    p = malloc(10);
19336600fe5bSmrg    r0 = realloc(p,0);
19346600fe5bSmrg    c0 = calloc(0);
19356600fe5bSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
19366600fe5bSmrg}],
19376600fe5bSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
19386f5dd5c2Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
19396f5dd5c2Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
19406600fe5bSmrgfi
19416600fe5bSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1942a0195d5fSmrg
19436600fe5bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
19446600fe5bSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
19456600fe5bSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
19466600fe5bSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
19476600fe5bSmrgelse
19486600fe5bSmrg	MALLOC_ZERO_CFLAGS=""
19496600fe5bSmrg	XMALLOC_ZERO_CFLAGS=""
19506600fe5bSmrg	XTMALLOC_ZERO_CFLAGS=""
19516600fe5bSmrgfi
1952a0195d5fSmrg
19536600fe5bSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
19546600fe5bSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
19556600fe5bSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
19566600fe5bSmrg]) # XORG_CHECK_MALLOC_ZERO
1957a0195d5fSmrg
19586600fe5bSmrg# XORG_WITH_LINT()
19596600fe5bSmrg# ----------------
19606600fe5bSmrg# Minimum version: 1.1.0
19616600fe5bSmrg#
19626f5dd5c2Smrg# This macro enables the use of a tool that flags some suspicious and
19636f5dd5c2Smrg# non-portable constructs (likely to be bugs) in C language source code.
19646f5dd5c2Smrg# It will attempt to locate the tool and use appropriate options.
19656f5dd5c2Smrg# There are various lint type tools on different platforms.
19666f5dd5c2Smrg#
19676f5dd5c2Smrg# Interface to module:
19686f5dd5c2Smrg# LINT:		returns the path to the tool found on the platform
19696f5dd5c2Smrg#		or the value set to LINT on the configure cmd line
19706f5dd5c2Smrg#		also an Automake conditional
19716f5dd5c2Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
19726f5dd5c2Smrg#
19736f5dd5c2Smrg# --with-lint:	'yes' user instructs the module to use lint
19746f5dd5c2Smrg#		'no' user instructs the module not to use lint (default)
19756f5dd5c2Smrg#
19766f5dd5c2Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
19776f5dd5c2Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
19786600fe5bSmrg#
19796600fe5bSmrgAC_DEFUN([XORG_WITH_LINT],[
19806600fe5bSmrg
19816f5dd5c2SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
19826f5dd5c2SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
19836600fe5bSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
19846600fe5bSmrg		[Use a lint-style source code checker (default: disabled)])],
19856600fe5bSmrg		[use_lint=$withval], [use_lint=no])
19866f5dd5c2Smrg
19876f5dd5c2Smrg# Obtain platform specific info like program name and options
19886f5dd5c2Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
19896f5dd5c2Smrgcase $host_os in
19906f5dd5c2Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
19916f5dd5c2Smrg	lint_name=splint
19926f5dd5c2Smrg	lint_options="-badflag"
19936f5dd5c2Smrg	;;
19946f5dd5c2Smrg  *freebsd* | *netbsd*)
19956f5dd5c2Smrg	lint_name=lint
19966f5dd5c2Smrg	lint_options="-u -b"
19976f5dd5c2Smrg	;;
19986f5dd5c2Smrg  *solaris*)
19996f5dd5c2Smrg	lint_name=lint
20006f5dd5c2Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
20016f5dd5c2Smrg	;;
20026f5dd5c2Smrgesac
20036f5dd5c2Smrg
20046f5dd5c2Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
20056f5dd5c2Smrgif test "x$use_lint" = x"yes" ; then
20066f5dd5c2Smrg   AC_PATH_PROG([LINT], [$lint_name])
20076f5dd5c2Smrg   if test "x$LINT" = "x"; then
20086f5dd5c2Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
20096f5dd5c2Smrg   fi
20106f5dd5c2Smrgelif test "x$use_lint" = x"no" ; then
20116f5dd5c2Smrg   if test "x$LINT" != "x"; then
20126f5dd5c2Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
20136f5dd5c2Smrg   fi
20146600fe5bSmrgelse
20156f5dd5c2Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2016a0195d5fSmrgfi
20176f5dd5c2Smrg
20186f5dd5c2Smrg# User supplied flags override default flags
20196f5dd5c2Smrgif test "x$LINT_FLAGS" != "x"; then
20206f5dd5c2Smrg   lint_options=$LINT_FLAGS
2021a0195d5fSmrgfi
2022a0195d5fSmrg
20236f5dd5c2SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
20246f5dd5c2SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2025a0195d5fSmrg
20266600fe5bSmrg]) # XORG_WITH_LINT
2027a0195d5fSmrg
20286600fe5bSmrg# XORG_LINT_LIBRARY(LIBNAME)
20296600fe5bSmrg# --------------------------
20306600fe5bSmrg# Minimum version: 1.1.0
20316600fe5bSmrg#
20326600fe5bSmrg# Sets up flags for building lint libraries for checking programs that call
20336600fe5bSmrg# functions in the library.
20346600fe5bSmrg#
20356f5dd5c2Smrg# Interface to module:
20366f5dd5c2Smrg# LINTLIB		- Automake variable with the name of lint library file to make
20376f5dd5c2Smrg# MAKE_LINT_LIB		- Automake conditional
20386f5dd5c2Smrg#
20396f5dd5c2Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
20406f5dd5c2Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2041a0195d5fSmrg
20426600fe5bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
20436600fe5bSmrgAC_REQUIRE([XORG_WITH_LINT])
20446600fe5bSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
20456600fe5bSmrg	[Create lint library (default: disabled)])],
20466600fe5bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
20476f5dd5c2Smrg
20486f5dd5c2Smrgif test "x$make_lint_lib" = x"yes" ; then
20496f5dd5c2Smrg   LINTLIB=llib-l$1.ln
20506f5dd5c2Smrg   if test "x$LINT" = "x"; then
20516f5dd5c2Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
20526f5dd5c2Smrg   fi
20536f5dd5c2Smrgelif test "x$make_lint_lib" != x"no" ; then
20546f5dd5c2Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
20556600fe5bSmrgfi
20566f5dd5c2Smrg
20576600fe5bSmrgAC_SUBST(LINTLIB)
20586600fe5bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2059a0195d5fSmrg
20606600fe5bSmrg]) # XORG_LINT_LIBRARY
2061a0195d5fSmrg
20626600fe5bSmrg# XORG_CWARNFLAGS
20636600fe5bSmrg# ---------------
20646600fe5bSmrg# Minimum version: 1.2.0
20656600fe5bSmrg#
20666600fe5bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
20676600fe5bSmrg#
20686600fe5bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
20696f5dd5c2SmrgAC_REQUIRE([AC_PROG_CC_C99])
20706600fe5bSmrgif  test "x$GCC" = xyes ; then
20716600fe5bSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
20726600fe5bSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
20736f5dd5c2Smrg-Wbad-function-cast -Wformat=2"
20746600fe5bSmrg    case `$CC -dumpversion` in
20756600fe5bSmrg    3.4.* | 4.*)
20766600fe5bSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
20776600fe5bSmrg	;;
20786600fe5bSmrg    esac
2079a0195d5fSmrgelse
20806600fe5bSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
20816600fe5bSmrg    if test "x$SUNCC" = "xyes"; then
20826600fe5bSmrg	CWARNFLAGS="-v"
20836600fe5bSmrg    fi
2084a0195d5fSmrgfi
20856600fe5bSmrgAC_SUBST(CWARNFLAGS)
20866600fe5bSmrg]) # XORG_CWARNFLAGS
2087a0195d5fSmrg
20886600fe5bSmrg# XORG_STRICT_OPTION
20896600fe5bSmrg# -----------------------
20906600fe5bSmrg# Minimum version: 1.3.0
2091a0195d5fSmrg#
20926600fe5bSmrg# Add configure option to enable strict compilation
20936600fe5bSmrgAC_DEFUN([XORG_STRICT_OPTION], [
20946f5dd5c2Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
20956600fe5bSmrgAC_REQUIRE([AC_PROG_CC_C99])
20966600fe5bSmrgAC_REQUIRE([XORG_CWARNFLAGS])
20976600fe5bSmrg
20986600fe5bSmrgAC_ARG_ENABLE(strict-compilation,
20996600fe5bSmrg			  AS_HELP_STRING([--enable-strict-compilation],
21006600fe5bSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
21016600fe5bSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
21026600fe5bSmrgif test "x$STRICT_COMPILE" = "xyes"; then
21036600fe5bSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
21046600fe5bSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
21056600fe5bSmrg	if test "x$GCC" = xyes ; then
21066600fe5bSmrg		STRICT_CFLAGS="-pedantic -Werror"
21076600fe5bSmrg	elif test "x$SUNCC" = "xyes"; then
21086600fe5bSmrg		STRICT_CFLAGS="-errwarn"
21096600fe5bSmrg    elif test "x$INTELCC" = "xyes"; then
21106600fe5bSmrg		STRICT_CFLAGS="-Werror"
21116600fe5bSmrg	fi
21126600fe5bSmrgfi
21136600fe5bSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
21146600fe5bSmrgAC_SUBST([CWARNFLAGS])
21156600fe5bSmrg]) # XORG_STRICT_OPTION
2116a0195d5fSmrg
21176600fe5bSmrg# XORG_DEFAULT_OPTIONS
21186600fe5bSmrg# --------------------
21196600fe5bSmrg# Minimum version: 1.3.0
2120a0195d5fSmrg#
21216600fe5bSmrg# Defines default options for X.Org modules.
21226600fe5bSmrg#
21236600fe5bSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
21246f5dd5c2SmrgAC_REQUIRE([AC_PROG_INSTALL])
21256600fe5bSmrgXORG_CWARNFLAGS
21266600fe5bSmrgXORG_STRICT_OPTION
21276600fe5bSmrgXORG_RELEASE_VERSION
21286600fe5bSmrgXORG_CHANGELOG
21296f5dd5c2SmrgXORG_INSTALL
21306600fe5bSmrgXORG_MANPAGE_SECTIONS
21316f5dd5c2Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
21326f5dd5c2Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
21336600fe5bSmrg]) # XORG_DEFAULT_OPTIONS
21346f5dd5c2Smrg
21356f5dd5c2Smrg# XORG_INSTALL()
21366f5dd5c2Smrg# ----------------
21376f5dd5c2Smrg# Minimum version: 1.4.0
21386f5dd5c2Smrg#
21396f5dd5c2Smrg# Defines the variable INSTALL_CMD as the command to copy
21406f5dd5c2Smrg# INSTALL from $prefix/share/util-macros.
21416f5dd5c2Smrg#
21426f5dd5c2SmrgAC_DEFUN([XORG_INSTALL], [
21436f5dd5c2SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
21446f5dd5c2Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
21456f5dd5c2SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
21466f5dd5c2Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
21476f5dd5c2Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
21486f5dd5c2Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
21496f5dd5c2SmrgAC_SUBST([INSTALL_CMD])
21506f5dd5c2Smrg]) # XORG_INSTALL
21516600fe5bSmrgdnl Copyright 2005 Red Hat, Inc
21526600fe5bSmrgdnl
21536600fe5bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
21546600fe5bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
21556600fe5bSmrgdnl the above copyright notice appear in all copies and that both that
21566600fe5bSmrgdnl copyright notice and this permission notice appear in supporting
21576600fe5bSmrgdnl documentation.
21586600fe5bSmrgdnl
21596600fe5bSmrgdnl The above copyright notice and this permission notice shall be included
21606600fe5bSmrgdnl in all copies or substantial portions of the Software.
21616600fe5bSmrgdnl
21626600fe5bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21636600fe5bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21646600fe5bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21656600fe5bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
21666600fe5bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21676600fe5bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21686600fe5bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
21696600fe5bSmrgdnl
21706600fe5bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
21716600fe5bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
21726600fe5bSmrgdnl other dealings in this Software without prior written authorization
21736600fe5bSmrgdnl from the copyright holders.
21746600fe5bSmrgdnl
2175a0195d5fSmrg
21766600fe5bSmrg# XORG_RELEASE_VERSION
21776600fe5bSmrg# --------------------
21786f5dd5c2Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
21796600fe5bSmrg 
21806600fe5bSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
21816600fe5bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
21826600fe5bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
21836600fe5bSmrg		[Major version of this package])
21846600fe5bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
21856600fe5bSmrg	if test "x$PVM" = "x"; then
21866600fe5bSmrg		PVM="0"
21876600fe5bSmrg	fi
21886600fe5bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
21896600fe5bSmrg		[$PVM],
21906600fe5bSmrg		[Minor version of this package])
21916600fe5bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
21926600fe5bSmrg	if test "x$PVP" = "x"; then
21936600fe5bSmrg		PVP="0"
21946600fe5bSmrg	fi
21956600fe5bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
21966600fe5bSmrg		[$PVP],
21976600fe5bSmrg		[Patch version of this package])
21986600fe5bSmrg])
2199a0195d5fSmrg
22006600fe5bSmrg# XORG_CHANGELOG()
22016600fe5bSmrg# ----------------
22026600fe5bSmrg# Minimum version: 1.2.0
22036600fe5bSmrg#
22046600fe5bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
22056600fe5bSmrg# ChangeLog from git.
22066600fe5bSmrg#
22076600fe5bSmrg#
22086600fe5bSmrgAC_DEFUN([XORG_CHANGELOG], [
22096f5dd5c2SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
22106f5dd5c2Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
22116f5dd5c2Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
22126600fe5bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
22136600fe5bSmrgAC_SUBST([CHANGELOG_CMD])
22146600fe5bSmrg]) # XORG_CHANGELOG
2215a0195d5fSmrg
22162ab73d9fSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
22172ab73d9fSmrg# 
22182ab73d9fSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
22192ab73d9fSmrg#
22202ab73d9fSmrg# This program is free software; you can redistribute it and/or modify
22212ab73d9fSmrg# it under the terms of the GNU General Public License as published by
22222ab73d9fSmrg# the Free Software Foundation; either version 2 of the License, or
22232ab73d9fSmrg# (at your option) any later version.
22242ab73d9fSmrg#
22252ab73d9fSmrg# This program is distributed in the hope that it will be useful, but
22262ab73d9fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
22272ab73d9fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22282ab73d9fSmrg# General Public License for more details.
22292ab73d9fSmrg#
22302ab73d9fSmrg# You should have received a copy of the GNU General Public License
22312ab73d9fSmrg# along with this program; if not, write to the Free Software
22322ab73d9fSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22332ab73d9fSmrg#
22342ab73d9fSmrg# As a special exception to the GNU General Public License, if you
22352ab73d9fSmrg# distribute this file as part of a program that contains a
22362ab73d9fSmrg# configuration script generated by Autoconf, you may include it under
22372ab73d9fSmrg# the same distribution terms that you use for the rest of that program.
22382ab73d9fSmrg
22392ab73d9fSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
22402ab73d9fSmrg# ----------------------------------
22412ab73d9fSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
22422ab73d9fSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
22432ab73d9fSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
22442ab73d9fSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
22452ab73d9fSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
22462ab73d9fSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
22472ab73d9fSmrgfi
22482ab73d9fSmrgif test -n "$PKG_CONFIG"; then
22492ab73d9fSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
22502ab73d9fSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
22512ab73d9fSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
22522ab73d9fSmrg		AC_MSG_RESULT([yes])
22532ab73d9fSmrg	else
22542ab73d9fSmrg		AC_MSG_RESULT([no])
22552ab73d9fSmrg		PKG_CONFIG=""
22562ab73d9fSmrg	fi
22572ab73d9fSmrg		
22582ab73d9fSmrgfi[]dnl
22592ab73d9fSmrg])# PKG_PROG_PKG_CONFIG
22602ab73d9fSmrg
22612ab73d9fSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
22622ab73d9fSmrg#
22632ab73d9fSmrg# Check to see whether a particular set of modules exists.  Similar
22642ab73d9fSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
22652ab73d9fSmrg#
22662ab73d9fSmrg#
22672ab73d9fSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
22682ab73d9fSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
22692ab73d9fSmrg# PKG_CHECK_EXISTS manually
22702ab73d9fSmrg# --------------------------------------------------------------
22712ab73d9fSmrgAC_DEFUN([PKG_CHECK_EXISTS],
22722ab73d9fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
22732ab73d9fSmrgif test -n "$PKG_CONFIG" && \
22742ab73d9fSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
22752ab73d9fSmrg  m4_ifval([$2], [$2], [:])
22762ab73d9fSmrgm4_ifvaln([$3], [else
22772ab73d9fSmrg  $3])dnl
22782ab73d9fSmrgfi])
22792ab73d9fSmrg
22802ab73d9fSmrg
22812ab73d9fSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
22822ab73d9fSmrg# ---------------------------------------------
22832ab73d9fSmrgm4_define([_PKG_CONFIG],
22842ab73d9fSmrg[if test -n "$$1"; then
22852ab73d9fSmrg    pkg_cv_[]$1="$$1"
22862ab73d9fSmrg elif test -n "$PKG_CONFIG"; then
22872ab73d9fSmrg    PKG_CHECK_EXISTS([$3],
22882ab73d9fSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
22892ab73d9fSmrg		     [pkg_failed=yes])
22902ab73d9fSmrg else
22912ab73d9fSmrg    pkg_failed=untried
22922ab73d9fSmrgfi[]dnl
22932ab73d9fSmrg])# _PKG_CONFIG
22942ab73d9fSmrg
22952ab73d9fSmrg# _PKG_SHORT_ERRORS_SUPPORTED
22962ab73d9fSmrg# -----------------------------
22972ab73d9fSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
22982ab73d9fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
22992ab73d9fSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
23002ab73d9fSmrg        _pkg_short_errors_supported=yes
23012ab73d9fSmrgelse
23022ab73d9fSmrg        _pkg_short_errors_supported=no
23032ab73d9fSmrgfi[]dnl
23042ab73d9fSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
23052ab73d9fSmrg
23062ab73d9fSmrg
23072ab73d9fSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
23082ab73d9fSmrg# [ACTION-IF-NOT-FOUND])
23092ab73d9fSmrg#
23102ab73d9fSmrg#
23112ab73d9fSmrg# Note that if there is a possibility the first call to
23122ab73d9fSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
23132ab73d9fSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
23142ab73d9fSmrg#
23152ab73d9fSmrg#
23162ab73d9fSmrg# --------------------------------------------------------------
23172ab73d9fSmrgAC_DEFUN([PKG_CHECK_MODULES],
23182ab73d9fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
23192ab73d9fSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
23202ab73d9fSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
23212ab73d9fSmrg
23222ab73d9fSmrgpkg_failed=no
23232ab73d9fSmrgAC_MSG_CHECKING([for $1])
23242ab73d9fSmrg
23252ab73d9fSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
23262ab73d9fSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
23272ab73d9fSmrg
23282ab73d9fSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
23292ab73d9fSmrgand $1[]_LIBS to avoid the need to call pkg-config.
23302ab73d9fSmrgSee the pkg-config man page for more details.])
23312ab73d9fSmrg
23322ab73d9fSmrgif test $pkg_failed = yes; then
23332ab73d9fSmrg        _PKG_SHORT_ERRORS_SUPPORTED
23342ab73d9fSmrg        if test $_pkg_short_errors_supported = yes; then
23352ab73d9fSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
23362ab73d9fSmrg        else 
23372ab73d9fSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
23382ab73d9fSmrg        fi
23392ab73d9fSmrg	# Put the nasty error message in config.log where it belongs
23402ab73d9fSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
23412ab73d9fSmrg
23422ab73d9fSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
23432ab73d9fSmrg[Package requirements ($2) were not met:
23442ab73d9fSmrg
23452ab73d9fSmrg$$1_PKG_ERRORS
23462ab73d9fSmrg
23472ab73d9fSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
23482ab73d9fSmrginstalled software in a non-standard prefix.
23492ab73d9fSmrg
23502ab73d9fSmrg_PKG_TEXT
23512ab73d9fSmrg])],
23522ab73d9fSmrg		[AC_MSG_RESULT([no])
23532ab73d9fSmrg                $4])
23542ab73d9fSmrgelif test $pkg_failed = untried; then
23552ab73d9fSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
23562ab73d9fSmrg[The pkg-config script could not be found or is too old.  Make sure it
23572ab73d9fSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
23582ab73d9fSmrgpath to pkg-config.
23592ab73d9fSmrg
23602ab73d9fSmrg_PKG_TEXT
23612ab73d9fSmrg
23622ab73d9fSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
23632ab73d9fSmrg		[$4])
23642ab73d9fSmrgelse
23652ab73d9fSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
23662ab73d9fSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
23672ab73d9fSmrg        AC_MSG_RESULT([yes])
23682ab73d9fSmrg	ifelse([$3], , :, [$3])
23692ab73d9fSmrgfi[]dnl
23702ab73d9fSmrg])# PKG_CHECK_MODULES
23712ab73d9fSmrg
2372