aclocal.m4 revision 65912f00
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],[
1058ff6cf368Smrgm4_define([vers_have], [1.15.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])
1085ff6cf368SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[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])
1103ff6cf368SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[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
1453ff6cf368Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1454ff6cf368Smrg# --------------------------------------------
1455ff6cf368Smrg# Minimum version: 1.12.0
1456ff6cf368Smrg# Minimum version for optional DEFAULT argument: 1.12.0
1457ff6cf368Smrg#
1458ff6cf368Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1459ff6cf368Smrg# XML-based language used for the transformation of XML documents.
1460ff6cf368Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1461ff6cf368Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
1462ff6cf368Smrg# The XSLT processor is often used as a standalone tool for transformations.
1463ff6cf368Smrg# It should not be assumed that this tool is used only to work with documnetation.
1464ff6cf368Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
1465ff6cf368Smrg#
1466ff6cf368Smrg# Interface to module:
1467ff6cf368Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1468ff6cf368Smrg# XSLTPROC:	 returns the path of the xsltproc program found
1469ff6cf368Smrg#		 returns the path set by the user in the environment
1470ff6cf368Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1471ff6cf368Smrg#		  'no' user instructs the module not to use xsltproc
1472ff6cf368Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
1473ff6cf368Smrg#
1474ff6cf368Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
1475ff6cf368Smrg#
1476ff6cf368SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
1477ff6cf368SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1478ff6cf368Smrg# Preserves the interface, should it be implemented later
1479ff6cf368Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1480ff6cf368Smrgm4_define([_defopt], m4_default([$2], [auto]))
1481ff6cf368SmrgAC_ARG_WITH(xsltproc,
1482ff6cf368Smrg	AS_HELP_STRING([--with-xsltproc],
1483ff6cf368Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1484ff6cf368Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1485ff6cf368Smrgm4_undefine([_defopt])
1486ff6cf368Smrg
1487ff6cf368Smrgif test "x$use_xsltproc" = x"auto"; then
1488ff6cf368Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1489ff6cf368Smrg   if test "x$XSLTPROC" = "x"; then
1490ff6cf368Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1491ff6cf368Smrg	have_xsltproc=no
1492ff6cf368Smrg   else
1493ff6cf368Smrg        have_xsltproc=yes
1494ff6cf368Smrg   fi
1495ff6cf368Smrgelif test "x$use_xsltproc" = x"yes" ; then
1496ff6cf368Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1497ff6cf368Smrg   if test "x$XSLTPROC" = "x"; then
1498ff6cf368Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1499ff6cf368Smrg   fi
1500ff6cf368Smrg   have_xsltproc=yes
1501ff6cf368Smrgelif test "x$use_xsltproc" = x"no" ; then
1502ff6cf368Smrg   if test "x$XSLTPROC" != "x"; then
1503ff6cf368Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1504ff6cf368Smrg   fi
1505ff6cf368Smrg   have_xsltproc=no
1506ff6cf368Smrgelse
1507ff6cf368Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1508ff6cf368Smrgfi
1509ff6cf368Smrg
1510ff6cf368SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1511ff6cf368Smrg]) # XORG_WITH_XSLTPROC
1512ff6cf368Smrg
1513ff6cf368Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1514ff6cf368Smrg# ----------------------------------------
1515ff6cf368Smrg# Minimum version: 1.15.0
1516ff6cf368Smrg#
1517ff6cf368Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
1518ff6cf368Smrg# scanning arbitrary text files, extracting information from those text files,
1519ff6cf368Smrg# and printing reports based on that information.
1520ff6cf368Smrg#
1521ff6cf368Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
1522ff6cf368Smrg#
1523ff6cf368Smrg# Interface to module:
1524ff6cf368Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
1525ff6cf368Smrg# PERL:	     returns the path of the perl program found
1526ff6cf368Smrg#	     returns the path set by the user in the environment
1527ff6cf368Smrg# --with-perl: 'yes' user instructs the module to use perl
1528ff6cf368Smrg#	       'no' user instructs the module not to use perl
1529ff6cf368Smrg# have_perl: returns yes if perl found in PATH or no
1530ff6cf368Smrg#
1531ff6cf368Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1532ff6cf368Smrg#
1533ff6cf368SmrgAC_DEFUN([XORG_WITH_PERL],[
1534ff6cf368SmrgAC_ARG_VAR([PERL], [Path to perl command])
1535ff6cf368Smrg# Preserves the interface, should it be implemented later
1536ff6cf368Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1537ff6cf368Smrgm4_define([_defopt], m4_default([$2], [auto]))
1538ff6cf368SmrgAC_ARG_WITH(perl,
1539ff6cf368Smrg	AS_HELP_STRING([--with-perl],
1540ff6cf368Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
1541ff6cf368Smrg	   [use_perl=$withval], [use_perl=]_defopt)
1542ff6cf368Smrgm4_undefine([_defopt])
1543ff6cf368Smrg
1544ff6cf368Smrgif test "x$use_perl" = x"auto"; then
1545ff6cf368Smrg   AC_PATH_PROG([PERL], [perl])
1546ff6cf368Smrg   if test "x$PERL" = "x"; then
1547ff6cf368Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
1548ff6cf368Smrg	have_perl=no
1549ff6cf368Smrg   else
1550ff6cf368Smrg        have_perl=yes
1551ff6cf368Smrg   fi
1552ff6cf368Smrgelif test "x$use_perl" = x"yes" ; then
1553ff6cf368Smrg   AC_PATH_PROG([PERL], [perl])
1554ff6cf368Smrg   if test "x$PERL" = "x"; then
1555ff6cf368Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1556ff6cf368Smrg   fi
1557ff6cf368Smrg   have_perl=yes
1558ff6cf368Smrgelif test "x$use_perl" = x"no" ; then
1559ff6cf368Smrg   if test "x$PERL" != "x"; then
1560ff6cf368Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1561ff6cf368Smrg   fi
1562ff6cf368Smrg   have_perl=no
1563ff6cf368Smrgelse
1564ff6cf368Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1565ff6cf368Smrgfi
1566ff6cf368Smrg
1567ff6cf368SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
1568ff6cf368Smrg]) # XORG_WITH_PERL
1569ff6cf368Smrg
15702ab73d9fSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
15716f5dd5c2Smrg# ----------------
15726f5dd5c2Smrg# Minimum version: 1.5.0
15732ab73d9fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
15746f5dd5c2Smrg#
15756f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
15766f5dd5c2Smrg# not at the appropriate level. This macro enables a module to test for the
15776f5dd5c2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
15786f5dd5c2Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
15792ab73d9fSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
15802ab73d9fSmrg# --with-asciidoc assumes 'auto'.
15816f5dd5c2Smrg#
15826f5dd5c2Smrg# Interface to module:
15836f5dd5c2Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
15846f5dd5c2Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
15856f5dd5c2Smrg#		 returns the path set by the user in the environment
15866f5dd5c2Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
15876f5dd5c2Smrg#		  'no' user instructs the module not to use asciidoc
15886f5dd5c2Smrg#
15896f5dd5c2Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
15906f5dd5c2Smrg#
15916f5dd5c2SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
15926f5dd5c2SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
15932ab73d9fSmrgm4_define([_defopt], m4_default([$2], [auto]))
15946f5dd5c2SmrgAC_ARG_WITH(asciidoc,
15956f5dd5c2Smrg	AS_HELP_STRING([--with-asciidoc],
15962ab73d9fSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
15972ab73d9fSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
15982ab73d9fSmrgm4_undefine([_defopt])
15996f5dd5c2Smrg
16006f5dd5c2Smrgif test "x$use_asciidoc" = x"auto"; then
16016f5dd5c2Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
16026f5dd5c2Smrg   if test "x$ASCIIDOC" = "x"; then
16036f5dd5c2Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
16046f5dd5c2Smrg	have_asciidoc=no
16056f5dd5c2Smrg   else
16066f5dd5c2Smrg        have_asciidoc=yes
16076f5dd5c2Smrg   fi
16086f5dd5c2Smrgelif test "x$use_asciidoc" = x"yes" ; then
16096f5dd5c2Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
16106f5dd5c2Smrg   if test "x$ASCIIDOC" = "x"; then
16116f5dd5c2Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
16126f5dd5c2Smrg   fi
16136f5dd5c2Smrg   have_asciidoc=yes
16146f5dd5c2Smrgelif test "x$use_asciidoc" = x"no" ; then
16156f5dd5c2Smrg   if test "x$ASCIIDOC" != "x"; then
16166f5dd5c2Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
16176f5dd5c2Smrg   fi
16186f5dd5c2Smrg   have_asciidoc=no
16196f5dd5c2Smrgelse
16206f5dd5c2Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
16216f5dd5c2Smrgfi
16226f5dd5c2Smrgm4_ifval([$1],
16236f5dd5c2Smrg[if test "$have_asciidoc" = yes; then
16246f5dd5c2Smrg    # scrape the asciidoc version
16256f5dd5c2Smrg    AC_MSG_CHECKING([the asciidoc version])
16266f5dd5c2Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
16276f5dd5c2Smrg    AC_MSG_RESULT([$asciidoc_version])
16286f5dd5c2Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
16296f5dd5c2Smrg        [if test "x$use_asciidoc" = xauto; then
16306f5dd5c2Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
16316f5dd5c2Smrg            have_asciidoc=no
16326f5dd5c2Smrg        else
16336f5dd5c2Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
16346f5dd5c2Smrg        fi])
16356f5dd5c2Smrgfi])
16366f5dd5c2SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
16376f5dd5c2Smrg]) # XORG_WITH_ASCIIDOC
16386f5dd5c2Smrg
16392ab73d9fSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
16406f5dd5c2Smrg# --------------------------------
16416f5dd5c2Smrg# Minimum version: 1.5.0
16422ab73d9fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
16436f5dd5c2Smrg#
16446f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
16456f5dd5c2Smrg# not at the appropriate level. This macro enables a module to test for the
16466f5dd5c2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
16476f5dd5c2Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
16482ab73d9fSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
16492ab73d9fSmrg# --with-doxygen assumes 'auto'.
16506f5dd5c2Smrg#
16516f5dd5c2Smrg# Interface to module:
16526f5dd5c2Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
16536f5dd5c2Smrg# DOXYGEN:	 returns the path of the doxygen program found
16546f5dd5c2Smrg#		 returns the path set by the user in the environment
16556f5dd5c2Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
16566f5dd5c2Smrg#		  'no' user instructs the module not to use doxygen
16576f5dd5c2Smrg#
16586f5dd5c2Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
16596f5dd5c2Smrg#
16606f5dd5c2SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
16616f5dd5c2SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
16622ab73d9fSmrgm4_define([_defopt], m4_default([$2], [auto]))
16636f5dd5c2SmrgAC_ARG_WITH(doxygen,
16646f5dd5c2Smrg	AS_HELP_STRING([--with-doxygen],
16652ab73d9fSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
16662ab73d9fSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
16672ab73d9fSmrgm4_undefine([_defopt])
16686f5dd5c2Smrg
16696f5dd5c2Smrgif test "x$use_doxygen" = x"auto"; then
16706f5dd5c2Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
16716f5dd5c2Smrg   if test "x$DOXYGEN" = "x"; then
16726f5dd5c2Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
16736f5dd5c2Smrg	have_doxygen=no
16746f5dd5c2Smrg   else
16756f5dd5c2Smrg        have_doxygen=yes
16766f5dd5c2Smrg   fi
16776f5dd5c2Smrgelif test "x$use_doxygen" = x"yes" ; then
16786f5dd5c2Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
16796f5dd5c2Smrg   if test "x$DOXYGEN" = "x"; then
16806f5dd5c2Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
16816f5dd5c2Smrg   fi
16826f5dd5c2Smrg   have_doxygen=yes
16836f5dd5c2Smrgelif test "x$use_doxygen" = x"no" ; then
16846f5dd5c2Smrg   if test "x$DOXYGEN" != "x"; then
16856f5dd5c2Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
16866f5dd5c2Smrg   fi
16876f5dd5c2Smrg   have_doxygen=no
16886f5dd5c2Smrgelse
16896f5dd5c2Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
16906f5dd5c2Smrgfi
16916f5dd5c2Smrgm4_ifval([$1],
16926f5dd5c2Smrg[if test "$have_doxygen" = yes; then
16936f5dd5c2Smrg    # scrape the doxygen version
16946f5dd5c2Smrg    AC_MSG_CHECKING([the doxygen version])
16956f5dd5c2Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
16966f5dd5c2Smrg    AC_MSG_RESULT([$doxygen_version])
16976f5dd5c2Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
16986f5dd5c2Smrg        [if test "x$use_doxygen" = xauto; then
16996f5dd5c2Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
17006f5dd5c2Smrg            have_doxygen=no
17016f5dd5c2Smrg        else
17026f5dd5c2Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
17036f5dd5c2Smrg        fi])
17046f5dd5c2Smrgfi])
17056f5dd5c2SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
17066f5dd5c2Smrg]) # XORG_WITH_DOXYGEN
17076f5dd5c2Smrg
17082ab73d9fSmrg# XORG_WITH_GROFF([DEFAULT])
17096f5dd5c2Smrg# ----------------
17106f5dd5c2Smrg# Minimum version: 1.6.0
17112ab73d9fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
17126f5dd5c2Smrg#
17136f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
17146f5dd5c2Smrg# not at the appropriate level. This macro enables a module to test for the
17156f5dd5c2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
17166f5dd5c2Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
17172ab73d9fSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
17182ab73d9fSmrg# --with-groff assumes 'auto'.
17196f5dd5c2Smrg#
17206f5dd5c2Smrg# Interface to module:
17216f5dd5c2Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
17226f5dd5c2Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
17236f5dd5c2Smrg# HAVE_GROFF_MS: the -ms macros package
17246f5dd5c2Smrg# GROFF:	 returns the path of the groff program found
17256f5dd5c2Smrg#		 returns the path set by the user in the environment
17266f5dd5c2Smrg# --with-groff:	 'yes' user instructs the module to use groff
17276f5dd5c2Smrg#		 'no' user instructs the module not to use groff
17286f5dd5c2Smrg#
17296f5dd5c2Smrg# Added in version 1.9.0:
17306f5dd5c2Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
17316f5dd5c2Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
17326f5dd5c2Smrg#		   psselect from the psutils package.
17336f5dd5c2Smrg#		   the ghostcript package. Refer to the grohtml man pages
17346f5dd5c2Smrg#
17356f5dd5c2Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
17366f5dd5c2Smrg#
17376f5dd5c2Smrg# OS and distros often splits groff in a basic and full package, the former
17386f5dd5c2Smrg# having the groff program and the later having devices, fonts and macros
17396f5dd5c2Smrg# Checking for the groff executable is not enough.
17406f5dd5c2Smrg#
17416f5dd5c2Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
17426f5dd5c2Smrg# unset HAVE_GROFF or GROFF env variables.
17436f5dd5c2Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
17446f5dd5c2Smrg#
17456f5dd5c2SmrgAC_DEFUN([XORG_WITH_GROFF],[
17466f5dd5c2SmrgAC_ARG_VAR([GROFF], [Path to groff command])
17472ab73d9fSmrgm4_define([_defopt], m4_default([$1], [auto]))
17486f5dd5c2SmrgAC_ARG_WITH(groff,
17496f5dd5c2Smrg	AS_HELP_STRING([--with-groff],
17502ab73d9fSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
17512ab73d9fSmrg	   [use_groff=$withval], [use_groff=]_defopt)
17522ab73d9fSmrgm4_undefine([_defopt])
17536f5dd5c2Smrg
17546f5dd5c2Smrgif test "x$use_groff" = x"auto"; then
17556f5dd5c2Smrg   AC_PATH_PROG([GROFF], [groff])
17566f5dd5c2Smrg   if test "x$GROFF" = "x"; then
17576f5dd5c2Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
17586f5dd5c2Smrg	have_groff=no
17596f5dd5c2Smrg   else
17606f5dd5c2Smrg        have_groff=yes
17616f5dd5c2Smrg   fi
17626f5dd5c2Smrgelif test "x$use_groff" = x"yes" ; then
17636f5dd5c2Smrg   AC_PATH_PROG([GROFF], [groff])
17646f5dd5c2Smrg   if test "x$GROFF" = "x"; then
17656f5dd5c2Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
17666f5dd5c2Smrg   fi
17676f5dd5c2Smrg   have_groff=yes
17686f5dd5c2Smrgelif test "x$use_groff" = x"no" ; then
17696f5dd5c2Smrg   if test "x$GROFF" != "x"; then
17706f5dd5c2Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
17716f5dd5c2Smrg   fi
17726f5dd5c2Smrg   have_groff=no
17736f5dd5c2Smrgelse
17746f5dd5c2Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
17756f5dd5c2Smrgfi
17766f5dd5c2Smrg
17776f5dd5c2Smrg# We have groff, test for the presence of the macro packages
17786f5dd5c2Smrgif test "x$have_groff" = x"yes"; then
17796f5dd5c2Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
17806f5dd5c2Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
17816f5dd5c2Smrg        groff_ms_works=yes
17826f5dd5c2Smrg    else
17836f5dd5c2Smrg        groff_ms_works=no
17846f5dd5c2Smrg    fi
17856f5dd5c2Smrg    AC_MSG_RESULT([$groff_ms_works])
17866f5dd5c2Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
17876f5dd5c2Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
17886f5dd5c2Smrg        groff_mm_works=yes
17896f5dd5c2Smrg    else
17906f5dd5c2Smrg        groff_mm_works=no
17916f5dd5c2Smrg    fi
17926f5dd5c2Smrg    AC_MSG_RESULT([$groff_mm_works])
17936f5dd5c2Smrgfi
17946f5dd5c2Smrg
17956f5dd5c2Smrg# We have groff, test for HTML dependencies, one command per package
17966f5dd5c2Smrgif test "x$have_groff" = x"yes"; then
17976f5dd5c2Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
17986f5dd5c2Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
17996f5dd5c2Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
18006f5dd5c2Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
18016f5dd5c2Smrg      have_groff_html=yes
18026f5dd5c2Smrg   else
18036f5dd5c2Smrg      have_groff_html=no
18046f5dd5c2Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
18056f5dd5c2Smrg   fi
18066f5dd5c2Smrgfi
18076f5dd5c2Smrg
18086f5dd5c2Smrg# Set Automake conditionals for Makefiles
18096f5dd5c2SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
18106f5dd5c2SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
18116f5dd5c2SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
18126f5dd5c2SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
18136f5dd5c2Smrg]) # XORG_WITH_GROFF
18146f5dd5c2Smrg
1815ff6cf368Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1816ff6cf368Smrg# ---------------------------------------
18176f5dd5c2Smrg# Minimum version: 1.6.0
18182ab73d9fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1819ff6cf368Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
18206f5dd5c2Smrg#
18216f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
18226f5dd5c2Smrg# not at the appropriate level. This macro enables a module to test for the
18236f5dd5c2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
18246f5dd5c2Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
18252ab73d9fSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
18262ab73d9fSmrg# --with-fop assumes 'auto'.
18276f5dd5c2Smrg#
18286f5dd5c2Smrg# Interface to module:
18296f5dd5c2Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
18306f5dd5c2Smrg# FOP:	 	returns the path of the fop program found
18316f5dd5c2Smrg#		returns the path set by the user in the environment
18326f5dd5c2Smrg# --with-fop: 	'yes' user instructs the module to use fop
18336f5dd5c2Smrg#		'no' user instructs the module not to use fop
18346f5dd5c2Smrg#
18356f5dd5c2Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
18366f5dd5c2Smrg#
18376f5dd5c2SmrgAC_DEFUN([XORG_WITH_FOP],[
18386f5dd5c2SmrgAC_ARG_VAR([FOP], [Path to fop command])
1839ff6cf368Smrgm4_define([_defopt], m4_default([$2], [auto]))
18406f5dd5c2SmrgAC_ARG_WITH(fop,
18416f5dd5c2Smrg	AS_HELP_STRING([--with-fop],
18422ab73d9fSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
18432ab73d9fSmrg	   [use_fop=$withval], [use_fop=]_defopt)
18442ab73d9fSmrgm4_undefine([_defopt])
18456f5dd5c2Smrg
18466f5dd5c2Smrgif test "x$use_fop" = x"auto"; then
18476f5dd5c2Smrg   AC_PATH_PROG([FOP], [fop])
18486f5dd5c2Smrg   if test "x$FOP" = "x"; then
18496f5dd5c2Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
18506f5dd5c2Smrg	have_fop=no
18516f5dd5c2Smrg   else
18526f5dd5c2Smrg        have_fop=yes
18536f5dd5c2Smrg   fi
18546f5dd5c2Smrgelif test "x$use_fop" = x"yes" ; then
18556f5dd5c2Smrg   AC_PATH_PROG([FOP], [fop])
18566f5dd5c2Smrg   if test "x$FOP" = "x"; then
18576f5dd5c2Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
18586f5dd5c2Smrg   fi
18596f5dd5c2Smrg   have_fop=yes
18606f5dd5c2Smrgelif test "x$use_fop" = x"no" ; then
18616f5dd5c2Smrg   if test "x$FOP" != "x"; then
18626f5dd5c2Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
18636f5dd5c2Smrg   fi
18646f5dd5c2Smrg   have_fop=no
18656f5dd5c2Smrgelse
18666f5dd5c2Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
18676f5dd5c2Smrgfi
1868ff6cf368Smrg
1869ff6cf368Smrg# Test for a minimum version of fop, if provided.
1870ff6cf368Smrgm4_ifval([$1],
1871ff6cf368Smrg[if test "$have_fop" = yes; then
1872ff6cf368Smrg    # scrape the fop version
1873ff6cf368Smrg    AC_MSG_CHECKING([for fop minimum version])
1874ff6cf368Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1875ff6cf368Smrg    AC_MSG_RESULT([$fop_version])
1876ff6cf368Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
1877ff6cf368Smrg        [if test "x$use_fop" = xauto; then
1878ff6cf368Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1879ff6cf368Smrg            have_fop=no
1880ff6cf368Smrg        else
1881ff6cf368Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1882ff6cf368Smrg        fi])
1883ff6cf368Smrgfi])
18846f5dd5c2SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
18856f5dd5c2Smrg]) # XORG_WITH_FOP
18866f5dd5c2Smrg
18872ab73d9fSmrg# XORG_WITH_PS2PDF([DEFAULT])
18886f5dd5c2Smrg# ----------------
18896f5dd5c2Smrg# Minimum version: 1.6.0
18902ab73d9fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
18916f5dd5c2Smrg#
18926f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
18936f5dd5c2Smrg# not at the appropriate level. This macro enables a module to test for the
18946f5dd5c2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
18956f5dd5c2Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
18962ab73d9fSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
18972ab73d9fSmrg# --with-ps2pdf assumes 'auto'.
18986f5dd5c2Smrg#
18996f5dd5c2Smrg# Interface to module:
19006f5dd5c2Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
19016f5dd5c2Smrg# PS2PDF:	returns the path of the ps2pdf program found
19026f5dd5c2Smrg#		returns the path set by the user in the environment
19036f5dd5c2Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
19046f5dd5c2Smrg#		 'no' user instructs the module not to use ps2pdf
19056f5dd5c2Smrg#
19066f5dd5c2Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
19076f5dd5c2Smrg#
19086f5dd5c2SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
19096f5dd5c2SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
19102ab73d9fSmrgm4_define([_defopt], m4_default([$1], [auto]))
19116f5dd5c2SmrgAC_ARG_WITH(ps2pdf,
19126f5dd5c2Smrg	AS_HELP_STRING([--with-ps2pdf],
19132ab73d9fSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
19142ab73d9fSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
19152ab73d9fSmrgm4_undefine([_defopt])
19166f5dd5c2Smrg
19176f5dd5c2Smrgif test "x$use_ps2pdf" = x"auto"; then
19186f5dd5c2Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
19196f5dd5c2Smrg   if test "x$PS2PDF" = "x"; then
19206f5dd5c2Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
19216f5dd5c2Smrg	have_ps2pdf=no
19226f5dd5c2Smrg   else
19236f5dd5c2Smrg        have_ps2pdf=yes
19246f5dd5c2Smrg   fi
19256f5dd5c2Smrgelif test "x$use_ps2pdf" = x"yes" ; then
19266f5dd5c2Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
19276f5dd5c2Smrg   if test "x$PS2PDF" = "x"; then
19286f5dd5c2Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
19296f5dd5c2Smrg   fi
19306f5dd5c2Smrg   have_ps2pdf=yes
19316f5dd5c2Smrgelif test "x$use_ps2pdf" = x"no" ; then
19326f5dd5c2Smrg   if test "x$PS2PDF" != "x"; then
19336f5dd5c2Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
19346f5dd5c2Smrg   fi
19356f5dd5c2Smrg   have_ps2pdf=no
19366f5dd5c2Smrgelse
19376f5dd5c2Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
19386f5dd5c2Smrgfi
19396f5dd5c2SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
19406f5dd5c2Smrg]) # XORG_WITH_PS2PDF
19416f5dd5c2Smrg
19426f5dd5c2Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
19436f5dd5c2Smrg# ----------------
19446f5dd5c2Smrg# Minimum version: 1.6.0
19456f5dd5c2Smrg#
19466f5dd5c2Smrg# Documentation tools are not always available on all platforms and sometimes
19476f5dd5c2Smrg# not at the appropriate level. This macro enables a builder to skip all
19486f5dd5c2Smrg# documentation targets except traditional man pages.
19496f5dd5c2Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
19506f5dd5c2Smrg# maximum flexibilty in controlling documentation building.
19516f5dd5c2Smrg# Refer to:
19526f5dd5c2Smrg# XORG_WITH_XMLTO         --with-xmlto
19536f5dd5c2Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
19546f5dd5c2Smrg# XORG_WITH_DOXYGEN       --with-doxygen
19556f5dd5c2Smrg# XORG_WITH_FOP           --with-fop
19566f5dd5c2Smrg# XORG_WITH_GROFF         --with-groff
19576f5dd5c2Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
19586f5dd5c2Smrg#
19596f5dd5c2Smrg# Interface to module:
19606f5dd5c2Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
19616f5dd5c2Smrg# --enable-docs: 'yes' user instructs the module to generate docs
19626f5dd5c2Smrg#		 'no' user instructs the module not to generate docs
19636f5dd5c2Smrg# parm1:	specify the default value, yes or no.
19646f5dd5c2Smrg#
19656f5dd5c2SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1966ff6cf368Smrgm4_define([docs_default], m4_default([$1], [yes]))
19676f5dd5c2SmrgAC_ARG_ENABLE(docs,
19686f5dd5c2Smrg	AS_HELP_STRING([--enable-docs],
1969ff6cf368Smrg	   [Enable building the documentation (default: ]docs_default[)]),
1970ff6cf368Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
1971ff6cf368Smrgm4_undefine([docs_default])
19726f5dd5c2SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
19736f5dd5c2SmrgAC_MSG_CHECKING([whether to build documentation])
19746f5dd5c2SmrgAC_MSG_RESULT([$build_docs])
19756f5dd5c2Smrg]) # XORG_ENABLE_DOCS
19766f5dd5c2Smrg
19776f5dd5c2Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
19786f5dd5c2Smrg# ----------------
19796f5dd5c2Smrg# Minimum version: 1.6.0
19806f5dd5c2Smrg#
19816f5dd5c2Smrg# This macro enables a builder to skip all developer documentation.
19826f5dd5c2Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
19836f5dd5c2Smrg# maximum flexibilty in controlling documentation building.
19846f5dd5c2Smrg# Refer to:
19856f5dd5c2Smrg# XORG_WITH_XMLTO         --with-xmlto
19866f5dd5c2Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
19876f5dd5c2Smrg# XORG_WITH_DOXYGEN       --with-doxygen
19886f5dd5c2Smrg# XORG_WITH_FOP           --with-fop
19896f5dd5c2Smrg# XORG_WITH_GROFF         --with-groff
19906f5dd5c2Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
19916f5dd5c2Smrg#
19926f5dd5c2Smrg# Interface to module:
19936f5dd5c2Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
19946f5dd5c2Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
19956f5dd5c2Smrg#			'no' user instructs the module not to generate developer docs
19966f5dd5c2Smrg# parm1:		specify the default value, yes or no.
19976f5dd5c2Smrg#
19986f5dd5c2SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
19992ab73d9fSmrgm4_define([devel_default], m4_default([$1], [yes]))
20006f5dd5c2SmrgAC_ARG_ENABLE(devel-docs,
20016f5dd5c2Smrg	AS_HELP_STRING([--enable-devel-docs],
20022ab73d9fSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
20032ab73d9fSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
20042ab73d9fSmrgm4_undefine([devel_default])
20056f5dd5c2SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
20066f5dd5c2SmrgAC_MSG_CHECKING([whether to build developer documentation])
20076f5dd5c2SmrgAC_MSG_RESULT([$build_devel_docs])
20086f5dd5c2Smrg]) # XORG_ENABLE_DEVEL_DOCS
20096f5dd5c2Smrg
20106f5dd5c2Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
20116f5dd5c2Smrg# ----------------
20126f5dd5c2Smrg# Minimum version: 1.6.0
20136f5dd5c2Smrg#
20146f5dd5c2Smrg# This macro enables a builder to skip all functional specification targets.
20156f5dd5c2Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
20166f5dd5c2Smrg# maximum flexibilty in controlling documentation building.
20176f5dd5c2Smrg# Refer to:
20186f5dd5c2Smrg# XORG_WITH_XMLTO         --with-xmlto
20196f5dd5c2Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
20206f5dd5c2Smrg# XORG_WITH_DOXYGEN       --with-doxygen
20216f5dd5c2Smrg# XORG_WITH_FOP           --with-fop
20226f5dd5c2Smrg# XORG_WITH_GROFF         --with-groff
20236f5dd5c2Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
20246f5dd5c2Smrg#
20256f5dd5c2Smrg# Interface to module:
20266f5dd5c2Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
20276f5dd5c2Smrg# --enable-specs:	'yes' user instructs the module to generate specs
20286f5dd5c2Smrg#			'no' user instructs the module not to generate specs
20296f5dd5c2Smrg# parm1:		specify the default value, yes or no.
20306f5dd5c2Smrg#
20316f5dd5c2SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
20322ab73d9fSmrgm4_define([spec_default], m4_default([$1], [yes]))
20336f5dd5c2SmrgAC_ARG_ENABLE(specs,
20346f5dd5c2Smrg	AS_HELP_STRING([--enable-specs],
20352ab73d9fSmrg	   [Enable building the specs (default: ]spec_default[)]),
20362ab73d9fSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
20372ab73d9fSmrgm4_undefine([spec_default])
20386f5dd5c2SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
20396f5dd5c2SmrgAC_MSG_CHECKING([whether to build functional specifications])
20406f5dd5c2SmrgAC_MSG_RESULT([$build_specs])
20416f5dd5c2Smrg]) # XORG_ENABLE_SPECS
20426f5dd5c2Smrg
2043ff6cf368Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
2044ff6cf368Smrg# ----------------------------------------------
2045ff6cf368Smrg# Minimum version: 1.13.0
2046ff6cf368Smrg#
2047ff6cf368Smrg# This macro enables a builder to enable/disable unit testing
2048ff6cf368Smrg# It makes no assumption about the test cases implementation
2049ff6cf368Smrg# Test cases may or may not use Automake "Support for test suites"
2050ff6cf368Smrg# They may or may not use the software utility library GLib
2051ff6cf368Smrg#
2052ff6cf368Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
2053ff6cf368Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
2054ff6cf368Smrg# The variable enable_unit_tests is used by other macros in this file.
2055ff6cf368Smrg#
2056ff6cf368Smrg# Interface to module:
2057ff6cf368Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
2058ff6cf368Smrg# enable_unit_tests:    used in configure.ac for additional configuration
2059ff6cf368Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
2060ff6cf368Smrg#			'no' user instructs the module not to build tests
2061ff6cf368Smrg# parm1:		specify the default value, yes or no.
2062ff6cf368Smrg#
2063ff6cf368SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
2064ff6cf368SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
2065ff6cf368SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
2066ff6cf368Smrgm4_define([_defopt], m4_default([$1], [auto]))
2067ff6cf368SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
2068ff6cf368Smrg	[Enable building unit test cases (default: ]_defopt[)]),
2069ff6cf368Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
2070ff6cf368Smrgm4_undefine([_defopt])
2071ff6cf368SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
2072ff6cf368SmrgAC_MSG_CHECKING([whether to build unit test cases])
2073ff6cf368SmrgAC_MSG_RESULT([$enable_unit_tests])
2074ff6cf368Smrg]) # XORG_ENABLE_UNIT_TESTS
2075ff6cf368Smrg
2076ff6cf368Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
2077ff6cf368Smrg# ----------------------------------------
2078ff6cf368Smrg# Minimum version: 1.13.0
2079ff6cf368Smrg#
2080ff6cf368Smrg# GLib is a library which provides advanced data structures and functions.
2081ff6cf368Smrg# This macro enables a module to test for the presence of Glib.
2082ff6cf368Smrg#
2083ff6cf368Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
2084ff6cf368Smrg# Otherwise the value of $enable_unit_tests is blank.
2085ff6cf368Smrg#
2086ff6cf368Smrg# Interface to module:
2087ff6cf368Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
2088ff6cf368Smrg# with_glib: used in configure.ac to know if GLib has been found
2089ff6cf368Smrg# --with-glib:	'yes' user instructs the module to use glib
2090ff6cf368Smrg#		'no' user instructs the module not to use glib
2091ff6cf368Smrg#
2092ff6cf368SmrgAC_DEFUN([XORG_WITH_GLIB],[
2093ff6cf368SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2094ff6cf368Smrgm4_define([_defopt], m4_default([$2], [auto]))
2095ff6cf368SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
2096ff6cf368Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
2097ff6cf368Smrg	[with_glib=$withval], [with_glib=]_defopt)
2098ff6cf368Smrgm4_undefine([_defopt])
2099ff6cf368Smrg
2100ff6cf368Smrghave_glib=no
2101ff6cf368Smrg# Do not probe GLib if user explicitly disabled unit testing
2102ff6cf368Smrgif test "x$enable_unit_tests" != x"no"; then
2103ff6cf368Smrg  # Do not probe GLib if user explicitly disabled it
2104ff6cf368Smrg  if test "x$with_glib" != x"no"; then
2105ff6cf368Smrg    m4_ifval(
2106ff6cf368Smrg      [$1],
2107ff6cf368Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
2108ff6cf368Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
2109ff6cf368Smrg    )
2110ff6cf368Smrg  fi
2111ff6cf368Smrgfi
2112ff6cf368Smrg
2113ff6cf368Smrg# Not having GLib when unit testing has been explicitly requested is an error
2114ff6cf368Smrgif test "x$enable_unit_tests" = x"yes"; then
2115ff6cf368Smrg  if test "x$have_glib" = x"no"; then
2116ff6cf368Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2117ff6cf368Smrg  fi
2118ff6cf368Smrgfi
2119ff6cf368Smrg
2120ff6cf368Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
2121ff6cf368Smrgif test "x$enable_unit_tests" = x"no"; then
2122ff6cf368Smrg  if test "x$with_glib" = x"yes"; then
2123ff6cf368Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
2124ff6cf368Smrg  fi
2125ff6cf368Smrgfi
2126ff6cf368Smrg
2127ff6cf368Smrg# Not having GLib when it has been explicitly requested is an error
2128ff6cf368Smrgif test "x$with_glib" = x"yes"; then
2129ff6cf368Smrg  if test "x$have_glib" = x"no"; then
2130ff6cf368Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
2131ff6cf368Smrg  fi
2132ff6cf368Smrgfi
2133ff6cf368Smrg
2134ff6cf368SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
2135ff6cf368Smrg]) # XORG_WITH_GLIB
2136ff6cf368Smrg
2137ff6cf368Smrg# XORG_LD_WRAP
2138ff6cf368Smrg# ------------
2139ff6cf368Smrg# Minimum version: 1.13.0
2140ff6cf368Smrg#
2141ff6cf368Smrg# Check if linker supports -wrap, passed via compiler flags
2142ff6cf368Smrg#
2143ff6cf368Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
2144ff6cf368Smrg# Otherwise the value of $enable_unit_tests is blank.
2145ff6cf368Smrg#
2146ff6cf368SmrgAC_DEFUN([XORG_LD_WRAP],[
2147ff6cf368SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no])
2148ff6cf368Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
2149ff6cf368Smrgif test "x$enable_unit_tests" = x"yes"; then
2150ff6cf368Smrg  if test "x$have_ld_wrap" = x"no"; then
2151ff6cf368Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
2152ff6cf368Smrg  fi
2153ff6cf368Smrgfi
2154ff6cf368SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
2155ff6cf368Smrg#
2156ff6cf368Smrg]) # XORG_LD_WRAP
2157ff6cf368Smrg
2158ff6cf368Smrg# XORG_CHECK_LINKER_FLAGS
2159ff6cf368Smrg# -----------------------
2160ff6cf368Smrg# SYNOPSIS
2161ff6cf368Smrg#
2162ff6cf368Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
2163ff6cf368Smrg#
2164ff6cf368Smrg# DESCRIPTION
2165ff6cf368Smrg#
2166ff6cf368Smrg#   Check whether the given linker FLAGS work with the current language's
2167ff6cf368Smrg#   linker, or whether they give an error.
2168ff6cf368Smrg#
2169ff6cf368Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
2170ff6cf368Smrg#   success/failure.
2171ff6cf368Smrg#
2172ff6cf368Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
2173ff6cf368Smrg#
2174ff6cf368Smrg# LICENSE
2175ff6cf368Smrg#
2176ff6cf368Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
2177ff6cf368Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
2178ff6cf368Smrg#   Copyright (c) 2009 Matteo Frigo
2179ff6cf368Smrg#
2180ff6cf368Smrg#   This program is free software: you can redistribute it and/or modify it
2181ff6cf368Smrg#   under the terms of the GNU General Public License as published by the
2182ff6cf368Smrg#   Free Software Foundation, either version 3 of the License, or (at your
2183ff6cf368Smrg#   option) any later version.
2184ff6cf368Smrg#
2185ff6cf368Smrg#   This program is distributed in the hope that it will be useful, but
2186ff6cf368Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
2187ff6cf368Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
2188ff6cf368Smrg#   Public License for more details.
2189ff6cf368Smrg#
2190ff6cf368Smrg#   You should have received a copy of the GNU General Public License along
2191ff6cf368Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
2192ff6cf368Smrg#
2193ff6cf368Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
2194ff6cf368Smrg#   gives unlimited permission to copy, distribute and modify the configure
2195ff6cf368Smrg#   scripts that are the output of Autoconf when processing the Macro. You
2196ff6cf368Smrg#   need not follow the terms of the GNU General Public License when using
2197ff6cf368Smrg#   or distributing such scripts, even though portions of the text of the
2198ff6cf368Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
2199ff6cf368Smrg#   all other use of the material that constitutes the Autoconf Macro.
2200ff6cf368Smrg#
2201ff6cf368Smrg#   This special exception to the GPL applies to versions of the Autoconf
2202ff6cf368Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
2203ff6cf368Smrg#   modified version of the Autoconf Macro, you may extend this special
2204ff6cf368Smrg#   exception to the GPL to apply to your modified version as well.#
2205ff6cf368SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
2206ff6cf368Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
2207ff6cf368Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
2208ff6cf368SmrgAS_LITERAL_IF([$1],
2209ff6cf368Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
2210ff6cf368Smrg      ax_save_FLAGS=$LDFLAGS
2211ff6cf368Smrg      LDFLAGS="$1"
2212ff6cf368Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2213ff6cf368Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2214ff6cf368Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2215ff6cf368Smrg      LDFLAGS=$ax_save_FLAGS])],
2216ff6cf368Smrg  [ax_save_FLAGS=$LDFLAGS
2217ff6cf368Smrg   LDFLAGS="$1"
2218ff6cf368Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
2219ff6cf368Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
2220ff6cf368Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
2221ff6cf368Smrg   LDFLAGS=$ax_save_FLAGS])
2222ff6cf368Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
2223ff6cf368SmrgAC_MSG_RESULT($xorg_check_linker_flags)
2224ff6cf368Smrgif test "x$xorg_check_linker_flags" = xyes; then
2225ff6cf368Smrg	m4_default([$2], :)
2226ff6cf368Smrgelse
2227ff6cf368Smrg	m4_default([$3], :)
2228ff6cf368Smrgfi
2229ff6cf368Smrg]) # XORG_CHECK_LINKER_FLAGS
2230ff6cf368Smrg
22316600fe5bSmrg# XORG_CHECK_MALLOC_ZERO
22326600fe5bSmrg# ----------------------
22336600fe5bSmrg# Minimum version: 1.0.0
22346600fe5bSmrg#
22356600fe5bSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
22366600fe5bSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
22376600fe5bSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
22386600fe5bSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
22396600fe5bSmrgAC_ARG_ENABLE(malloc0returnsnull,
22406600fe5bSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
22416600fe5bSmrg		       [malloc(0) returns NULL (default: auto)]),
22426600fe5bSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
22436600fe5bSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
2244a0195d5fSmrg
22456600fe5bSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
22466600fe5bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2247ff6cf368Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
2248ff6cf368Smrg#include <stdlib.h>
2249ff6cf368Smrg],[
22506600fe5bSmrg    char *m0, *r0, *c0, *p;
22516600fe5bSmrg    m0 = malloc(0);
22526600fe5bSmrg    p = malloc(10);
22536600fe5bSmrg    r0 = realloc(p,0);
2254ff6cf368Smrg    c0 = calloc(0,10);
2255ff6cf368Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2256ff6cf368Smrg])],
22576600fe5bSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
22586f5dd5c2Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
22596f5dd5c2Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
22606600fe5bSmrgfi
22616600fe5bSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2262a0195d5fSmrg
22636600fe5bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
22646600fe5bSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
22656600fe5bSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
22666600fe5bSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
22676600fe5bSmrgelse
22686600fe5bSmrg	MALLOC_ZERO_CFLAGS=""
22696600fe5bSmrg	XMALLOC_ZERO_CFLAGS=""
22706600fe5bSmrg	XTMALLOC_ZERO_CFLAGS=""
22716600fe5bSmrgfi
2272a0195d5fSmrg
22736600fe5bSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
22746600fe5bSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
22756600fe5bSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
22766600fe5bSmrg]) # XORG_CHECK_MALLOC_ZERO
2277a0195d5fSmrg
22786600fe5bSmrg# XORG_WITH_LINT()
22796600fe5bSmrg# ----------------
22806600fe5bSmrg# Minimum version: 1.1.0
22816600fe5bSmrg#
22826f5dd5c2Smrg# This macro enables the use of a tool that flags some suspicious and
22836f5dd5c2Smrg# non-portable constructs (likely to be bugs) in C language source code.
22846f5dd5c2Smrg# It will attempt to locate the tool and use appropriate options.
22856f5dd5c2Smrg# There are various lint type tools on different platforms.
22866f5dd5c2Smrg#
22876f5dd5c2Smrg# Interface to module:
22886f5dd5c2Smrg# LINT:		returns the path to the tool found on the platform
22896f5dd5c2Smrg#		or the value set to LINT on the configure cmd line
22906f5dd5c2Smrg#		also an Automake conditional
22916f5dd5c2Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
22926f5dd5c2Smrg#
22936f5dd5c2Smrg# --with-lint:	'yes' user instructs the module to use lint
22946f5dd5c2Smrg#		'no' user instructs the module not to use lint (default)
22956f5dd5c2Smrg#
22966f5dd5c2Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
22976f5dd5c2Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
22986600fe5bSmrg#
22996600fe5bSmrgAC_DEFUN([XORG_WITH_LINT],[
23006600fe5bSmrg
23016f5dd5c2SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
23026f5dd5c2SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
23036600fe5bSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
23046600fe5bSmrg		[Use a lint-style source code checker (default: disabled)])],
23056600fe5bSmrg		[use_lint=$withval], [use_lint=no])
23066f5dd5c2Smrg
23076f5dd5c2Smrg# Obtain platform specific info like program name and options
23086f5dd5c2Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
23096f5dd5c2Smrgcase $host_os in
23106f5dd5c2Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
23116f5dd5c2Smrg	lint_name=splint
23126f5dd5c2Smrg	lint_options="-badflag"
23136f5dd5c2Smrg	;;
23146f5dd5c2Smrg  *freebsd* | *netbsd*)
23156f5dd5c2Smrg	lint_name=lint
23166f5dd5c2Smrg	lint_options="-u -b"
23176f5dd5c2Smrg	;;
23186f5dd5c2Smrg  *solaris*)
23196f5dd5c2Smrg	lint_name=lint
23206f5dd5c2Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
23216f5dd5c2Smrg	;;
23226f5dd5c2Smrgesac
23236f5dd5c2Smrg
23246f5dd5c2Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
23256f5dd5c2Smrgif test "x$use_lint" = x"yes" ; then
23266f5dd5c2Smrg   AC_PATH_PROG([LINT], [$lint_name])
23276f5dd5c2Smrg   if test "x$LINT" = "x"; then
23286f5dd5c2Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
23296f5dd5c2Smrg   fi
23306f5dd5c2Smrgelif test "x$use_lint" = x"no" ; then
23316f5dd5c2Smrg   if test "x$LINT" != "x"; then
23326f5dd5c2Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
23336f5dd5c2Smrg   fi
23346600fe5bSmrgelse
23356f5dd5c2Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2336a0195d5fSmrgfi
23376f5dd5c2Smrg
23386f5dd5c2Smrg# User supplied flags override default flags
23396f5dd5c2Smrgif test "x$LINT_FLAGS" != "x"; then
23406f5dd5c2Smrg   lint_options=$LINT_FLAGS
2341a0195d5fSmrgfi
2342a0195d5fSmrg
23436f5dd5c2SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
23446f5dd5c2SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2345a0195d5fSmrg
23466600fe5bSmrg]) # XORG_WITH_LINT
2347a0195d5fSmrg
23486600fe5bSmrg# XORG_LINT_LIBRARY(LIBNAME)
23496600fe5bSmrg# --------------------------
23506600fe5bSmrg# Minimum version: 1.1.0
23516600fe5bSmrg#
23526600fe5bSmrg# Sets up flags for building lint libraries for checking programs that call
23536600fe5bSmrg# functions in the library.
23546600fe5bSmrg#
23556f5dd5c2Smrg# Interface to module:
23566f5dd5c2Smrg# LINTLIB		- Automake variable with the name of lint library file to make
23576f5dd5c2Smrg# MAKE_LINT_LIB		- Automake conditional
23586f5dd5c2Smrg#
23596f5dd5c2Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
23606f5dd5c2Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2361a0195d5fSmrg
23626600fe5bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
23636600fe5bSmrgAC_REQUIRE([XORG_WITH_LINT])
23646600fe5bSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
23656600fe5bSmrg	[Create lint library (default: disabled)])],
23666600fe5bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
23676f5dd5c2Smrg
23686f5dd5c2Smrgif test "x$make_lint_lib" = x"yes" ; then
23696f5dd5c2Smrg   LINTLIB=llib-l$1.ln
23706f5dd5c2Smrg   if test "x$LINT" = "x"; then
23716f5dd5c2Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
23726f5dd5c2Smrg   fi
23736f5dd5c2Smrgelif test "x$make_lint_lib" != x"no" ; then
23746f5dd5c2Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
23756600fe5bSmrgfi
23766f5dd5c2Smrg
23776600fe5bSmrgAC_SUBST(LINTLIB)
23786600fe5bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2379a0195d5fSmrg
23806600fe5bSmrg]) # XORG_LINT_LIBRARY
2381a0195d5fSmrg
2382ff6cf368Smrg# XORG_COMPILER_BRAND
2383ff6cf368Smrg# -------------------
2384ff6cf368Smrg# Minimum version: 1.14.0
2385ff6cf368Smrg#
2386ff6cf368Smrg# Checks for various brands of compilers and sets flags as appropriate:
2387ff6cf368Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
2388ff6cf368Smrg#   clang compiler - sets CLANGCC to "yes"
2389ff6cf368Smrg#   Intel compiler - sets INTELCC to "yes"
2390ff6cf368Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
2391ff6cf368Smrg#
2392ff6cf368SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
2393ff6cf368SmrgAC_REQUIRE([AC_PROG_CC_C99])
2394ff6cf368SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
2395ff6cf368SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2396ff6cf368SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2397ff6cf368Smrg]) # XORG_COMPILER_BRAND
2398ff6cf368Smrg
23996600fe5bSmrg# XORG_CWARNFLAGS
24006600fe5bSmrg# ---------------
24016600fe5bSmrg# Minimum version: 1.2.0
24026600fe5bSmrg#
24036600fe5bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
24046600fe5bSmrg#
24056600fe5bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
24066f5dd5c2SmrgAC_REQUIRE([AC_PROG_CC_C99])
2407ff6cf368SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
24086600fe5bSmrgif  test "x$GCC" = xyes ; then
24096600fe5bSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
24106600fe5bSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
24116f5dd5c2Smrg-Wbad-function-cast -Wformat=2"
24126600fe5bSmrg    case `$CC -dumpversion` in
24136600fe5bSmrg    3.4.* | 4.*)
24146600fe5bSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
24156600fe5bSmrg	;;
24166600fe5bSmrg    esac
2417a0195d5fSmrgelse
24186600fe5bSmrg    if test "x$SUNCC" = "xyes"; then
24196600fe5bSmrg	CWARNFLAGS="-v"
24206600fe5bSmrg    fi
2421a0195d5fSmrgfi
24226600fe5bSmrgAC_SUBST(CWARNFLAGS)
24236600fe5bSmrg]) # XORG_CWARNFLAGS
2424a0195d5fSmrg
24256600fe5bSmrg# XORG_STRICT_OPTION
24266600fe5bSmrg# -----------------------
24276600fe5bSmrg# Minimum version: 1.3.0
2428a0195d5fSmrg#
2429ff6cf368Smrg# Add configure option to enable strict compilation flags, such as treating
2430ff6cf368Smrg# warnings as fatal errors.
2431ff6cf368Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
2432ff6cf368Smrg# $CWARNFLAGS.
2433ff6cf368Smrg#
2434ff6cf368Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
2435ff6cf368Smrg# when strict compilation is unconditionally desired.
24366600fe5bSmrgAC_DEFUN([XORG_STRICT_OPTION], [
24376f5dd5c2Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
24386600fe5bSmrgAC_REQUIRE([AC_PROG_CC_C99])
2439ff6cf368SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
24406600fe5bSmrgAC_REQUIRE([XORG_CWARNFLAGS])
24416600fe5bSmrg
24426600fe5bSmrgAC_ARG_ENABLE(strict-compilation,
24436600fe5bSmrg			  AS_HELP_STRING([--enable-strict-compilation],
24446600fe5bSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
24456600fe5bSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2446ff6cf368Smrgif test "x$GCC" = xyes ; then
2447ff6cf368Smrg    STRICT_CFLAGS="-pedantic -Werror"
2448ff6cf368Smrg    # Add -Werror=attributes if supported (gcc 4.2 & later)
2449ff6cf368Smrg    AC_MSG_CHECKING([if $CC supports -Werror=attributes])
2450ff6cf368Smrg    save_CFLAGS="$CFLAGS"
2451ff6cf368Smrg    CFLAGS="$CFLAGS $STRICT_CFLAGS -Werror=attributes"
2452ff6cf368Smrg    AC_COMPILE_IFELSE([AC_LANG_SOURCE([return 0;])],
2453ff6cf368Smrg		      [STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
2454ff6cf368Smrg		       AC_MSG_RESULT([yes])],
2455ff6cf368Smrg		      [AC_MSG_RESULT([no])])
2456ff6cf368Smrg    CFLAGS="$save_CFLAGS"
2457ff6cf368Smrgelif test "x$SUNCC" = "xyes"; then
2458ff6cf368Smrg    STRICT_CFLAGS="-errwarn"
2459ff6cf368Smrgelif test "x$INTELCC" = "xyes"; then
2460ff6cf368Smrg    STRICT_CFLAGS="-Werror"
2461ff6cf368Smrgfi
24626600fe5bSmrgif test "x$STRICT_COMPILE" = "xyes"; then
2463ff6cf368Smrg    CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
24646600fe5bSmrgfi
2465ff6cf368SmrgAC_SUBST([STRICT_CFLAGS])
24666600fe5bSmrgAC_SUBST([CWARNFLAGS])
24676600fe5bSmrg]) # XORG_STRICT_OPTION
2468a0195d5fSmrg
24696600fe5bSmrg# XORG_DEFAULT_OPTIONS
24706600fe5bSmrg# --------------------
24716600fe5bSmrg# Minimum version: 1.3.0
2472a0195d5fSmrg#
24736600fe5bSmrg# Defines default options for X.Org modules.
24746600fe5bSmrg#
24756600fe5bSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
24766f5dd5c2SmrgAC_REQUIRE([AC_PROG_INSTALL])
24776600fe5bSmrgXORG_CWARNFLAGS
24786600fe5bSmrgXORG_STRICT_OPTION
24796600fe5bSmrgXORG_RELEASE_VERSION
24806600fe5bSmrgXORG_CHANGELOG
24816f5dd5c2SmrgXORG_INSTALL
24826600fe5bSmrgXORG_MANPAGE_SECTIONS
24836f5dd5c2Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
24846f5dd5c2Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
24856600fe5bSmrg]) # XORG_DEFAULT_OPTIONS
24866f5dd5c2Smrg
24876f5dd5c2Smrg# XORG_INSTALL()
24886f5dd5c2Smrg# ----------------
24896f5dd5c2Smrg# Minimum version: 1.4.0
24906f5dd5c2Smrg#
24916f5dd5c2Smrg# Defines the variable INSTALL_CMD as the command to copy
24926f5dd5c2Smrg# INSTALL from $prefix/share/util-macros.
24936f5dd5c2Smrg#
24946f5dd5c2SmrgAC_DEFUN([XORG_INSTALL], [
24956f5dd5c2SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
24966f5dd5c2Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
24976f5dd5c2SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
24986f5dd5c2Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
24996f5dd5c2Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
25006f5dd5c2Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
25016f5dd5c2SmrgAC_SUBST([INSTALL_CMD])
25026f5dd5c2Smrg]) # XORG_INSTALL
25036600fe5bSmrgdnl Copyright 2005 Red Hat, Inc
25046600fe5bSmrgdnl
25056600fe5bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
25066600fe5bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
25076600fe5bSmrgdnl the above copyright notice appear in all copies and that both that
25086600fe5bSmrgdnl copyright notice and this permission notice appear in supporting
25096600fe5bSmrgdnl documentation.
25106600fe5bSmrgdnl
25116600fe5bSmrgdnl The above copyright notice and this permission notice shall be included
25126600fe5bSmrgdnl in all copies or substantial portions of the Software.
25136600fe5bSmrgdnl
25146600fe5bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25156600fe5bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25166600fe5bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25176600fe5bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
25186600fe5bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25196600fe5bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25206600fe5bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
25216600fe5bSmrgdnl
25226600fe5bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
25236600fe5bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
25246600fe5bSmrgdnl other dealings in this Software without prior written authorization
25256600fe5bSmrgdnl from the copyright holders.
25266600fe5bSmrgdnl
2527a0195d5fSmrg
25286600fe5bSmrg# XORG_RELEASE_VERSION
25296600fe5bSmrg# --------------------
25306f5dd5c2Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
25316600fe5bSmrg 
25326600fe5bSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
25336600fe5bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
25346600fe5bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
25356600fe5bSmrg		[Major version of this package])
25366600fe5bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
25376600fe5bSmrg	if test "x$PVM" = "x"; then
25386600fe5bSmrg		PVM="0"
25396600fe5bSmrg	fi
25406600fe5bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
25416600fe5bSmrg		[$PVM],
25426600fe5bSmrg		[Minor version of this package])
25436600fe5bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
25446600fe5bSmrg	if test "x$PVP" = "x"; then
25456600fe5bSmrg		PVP="0"
25466600fe5bSmrg	fi
25476600fe5bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
25486600fe5bSmrg		[$PVP],
25496600fe5bSmrg		[Patch version of this package])
25506600fe5bSmrg])
2551a0195d5fSmrg
25526600fe5bSmrg# XORG_CHANGELOG()
25536600fe5bSmrg# ----------------
25546600fe5bSmrg# Minimum version: 1.2.0
25556600fe5bSmrg#
25566600fe5bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
25576600fe5bSmrg# ChangeLog from git.
25586600fe5bSmrg#
25596600fe5bSmrg#
25606600fe5bSmrgAC_DEFUN([XORG_CHANGELOG], [
25616f5dd5c2SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
25626f5dd5c2Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
25636f5dd5c2Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
25646600fe5bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
25656600fe5bSmrgAC_SUBST([CHANGELOG_CMD])
25666600fe5bSmrg]) # XORG_CHANGELOG
2567a0195d5fSmrg
25682ab73d9fSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
25692ab73d9fSmrg# 
25702ab73d9fSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
25712ab73d9fSmrg#
25722ab73d9fSmrg# This program is free software; you can redistribute it and/or modify
25732ab73d9fSmrg# it under the terms of the GNU General Public License as published by
25742ab73d9fSmrg# the Free Software Foundation; either version 2 of the License, or
25752ab73d9fSmrg# (at your option) any later version.
25762ab73d9fSmrg#
25772ab73d9fSmrg# This program is distributed in the hope that it will be useful, but
25782ab73d9fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
25792ab73d9fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25802ab73d9fSmrg# General Public License for more details.
25812ab73d9fSmrg#
25822ab73d9fSmrg# You should have received a copy of the GNU General Public License
25832ab73d9fSmrg# along with this program; if not, write to the Free Software
25842ab73d9fSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25852ab73d9fSmrg#
25862ab73d9fSmrg# As a special exception to the GNU General Public License, if you
25872ab73d9fSmrg# distribute this file as part of a program that contains a
25882ab73d9fSmrg# configuration script generated by Autoconf, you may include it under
25892ab73d9fSmrg# the same distribution terms that you use for the rest of that program.
25902ab73d9fSmrg
25912ab73d9fSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
25922ab73d9fSmrg# ----------------------------------
25932ab73d9fSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
25942ab73d9fSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
25952ab73d9fSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
25962ab73d9fSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
25972ab73d9fSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
25982ab73d9fSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
25992ab73d9fSmrgfi
26002ab73d9fSmrgif test -n "$PKG_CONFIG"; then
26012ab73d9fSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
26022ab73d9fSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
26032ab73d9fSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
26042ab73d9fSmrg		AC_MSG_RESULT([yes])
26052ab73d9fSmrg	else
26062ab73d9fSmrg		AC_MSG_RESULT([no])
26072ab73d9fSmrg		PKG_CONFIG=""
26082ab73d9fSmrg	fi
26092ab73d9fSmrg		
26102ab73d9fSmrgfi[]dnl
26112ab73d9fSmrg])# PKG_PROG_PKG_CONFIG
26122ab73d9fSmrg
26132ab73d9fSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
26142ab73d9fSmrg#
26152ab73d9fSmrg# Check to see whether a particular set of modules exists.  Similar
26162ab73d9fSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
26172ab73d9fSmrg#
26182ab73d9fSmrg#
26192ab73d9fSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
26202ab73d9fSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
26212ab73d9fSmrg# PKG_CHECK_EXISTS manually
26222ab73d9fSmrg# --------------------------------------------------------------
26232ab73d9fSmrgAC_DEFUN([PKG_CHECK_EXISTS],
26242ab73d9fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
26252ab73d9fSmrgif test -n "$PKG_CONFIG" && \
26262ab73d9fSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
26272ab73d9fSmrg  m4_ifval([$2], [$2], [:])
26282ab73d9fSmrgm4_ifvaln([$3], [else
26292ab73d9fSmrg  $3])dnl
26302ab73d9fSmrgfi])
26312ab73d9fSmrg
26322ab73d9fSmrg
26332ab73d9fSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
26342ab73d9fSmrg# ---------------------------------------------
26352ab73d9fSmrgm4_define([_PKG_CONFIG],
26362ab73d9fSmrg[if test -n "$$1"; then
26372ab73d9fSmrg    pkg_cv_[]$1="$$1"
26382ab73d9fSmrg elif test -n "$PKG_CONFIG"; then
26392ab73d9fSmrg    PKG_CHECK_EXISTS([$3],
26402ab73d9fSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
26412ab73d9fSmrg		     [pkg_failed=yes])
26422ab73d9fSmrg else
26432ab73d9fSmrg    pkg_failed=untried
26442ab73d9fSmrgfi[]dnl
26452ab73d9fSmrg])# _PKG_CONFIG
26462ab73d9fSmrg
26472ab73d9fSmrg# _PKG_SHORT_ERRORS_SUPPORTED
26482ab73d9fSmrg# -----------------------------
26492ab73d9fSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
26502ab73d9fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
26512ab73d9fSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
26522ab73d9fSmrg        _pkg_short_errors_supported=yes
26532ab73d9fSmrgelse
26542ab73d9fSmrg        _pkg_short_errors_supported=no
26552ab73d9fSmrgfi[]dnl
26562ab73d9fSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
26572ab73d9fSmrg
26582ab73d9fSmrg
26592ab73d9fSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
26602ab73d9fSmrg# [ACTION-IF-NOT-FOUND])
26612ab73d9fSmrg#
26622ab73d9fSmrg#
26632ab73d9fSmrg# Note that if there is a possibility the first call to
26642ab73d9fSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
26652ab73d9fSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
26662ab73d9fSmrg#
26672ab73d9fSmrg#
26682ab73d9fSmrg# --------------------------------------------------------------
26692ab73d9fSmrgAC_DEFUN([PKG_CHECK_MODULES],
26702ab73d9fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
26712ab73d9fSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
26722ab73d9fSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
26732ab73d9fSmrg
26742ab73d9fSmrgpkg_failed=no
26752ab73d9fSmrgAC_MSG_CHECKING([for $1])
26762ab73d9fSmrg
26772ab73d9fSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
26782ab73d9fSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
26792ab73d9fSmrg
26802ab73d9fSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
26812ab73d9fSmrgand $1[]_LIBS to avoid the need to call pkg-config.
26822ab73d9fSmrgSee the pkg-config man page for more details.])
26832ab73d9fSmrg
26842ab73d9fSmrgif test $pkg_failed = yes; then
26852ab73d9fSmrg        _PKG_SHORT_ERRORS_SUPPORTED
26862ab73d9fSmrg        if test $_pkg_short_errors_supported = yes; then
26872ab73d9fSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
26882ab73d9fSmrg        else 
26892ab73d9fSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
26902ab73d9fSmrg        fi
26912ab73d9fSmrg	# Put the nasty error message in config.log where it belongs
26922ab73d9fSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
26932ab73d9fSmrg
26942ab73d9fSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
26952ab73d9fSmrg[Package requirements ($2) were not met:
26962ab73d9fSmrg
26972ab73d9fSmrg$$1_PKG_ERRORS
26982ab73d9fSmrg
26992ab73d9fSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
27002ab73d9fSmrginstalled software in a non-standard prefix.
27012ab73d9fSmrg
27022ab73d9fSmrg_PKG_TEXT
27032ab73d9fSmrg])],
27042ab73d9fSmrg		[AC_MSG_RESULT([no])
27052ab73d9fSmrg                $4])
27062ab73d9fSmrgelif test $pkg_failed = untried; then
27072ab73d9fSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
27082ab73d9fSmrg[The pkg-config script could not be found or is too old.  Make sure it
27092ab73d9fSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
27102ab73d9fSmrgpath to pkg-config.
27112ab73d9fSmrg
27122ab73d9fSmrg_PKG_TEXT
27132ab73d9fSmrg
27142ab73d9fSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
27152ab73d9fSmrg		[$4])
27162ab73d9fSmrgelse
27172ab73d9fSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
27182ab73d9fSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
27192ab73d9fSmrg        AC_MSG_RESULT([yes])
27202ab73d9fSmrg	ifelse([$3], , :, [$3])
27212ab73d9fSmrgfi[]dnl
27222ab73d9fSmrg])# PKG_CHECK_MODULES
27232ab73d9fSmrg
2724