aclocal.m4 revision d7ffce2a
1d7ffce2aSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
211d341caSmrg
311d341caSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
44c61c93dSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
511d341caSmrg# This file is free software; the Free Software Foundation
611d341caSmrg# gives unlimited permission to copy and/or distribute it,
711d341caSmrg# with or without modifications, as long as this notice is preserved.
811d341caSmrg
911d341caSmrg# This program is distributed in the hope that it will be useful,
1011d341caSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1111d341caSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1211d341caSmrg# PARTICULAR PURPOSE.
1311d341caSmrg
144c61c93dSmrgm4_ifndef([AC_AUTOCONF_VERSION],
154c61c93dSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16d7ffce2aSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17d7ffce2aSmrg[m4_warning([this file was generated for autoconf 2.68.
184c61c93dSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
194c61c93dSmrgIf you have problems, you may need to regenerate the build system entirely.
204c61c93dSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
2111d341caSmrg
224c61c93dSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2311d341caSmrg#
2411d341caSmrg# This file is free software; the Free Software Foundation
2511d341caSmrg# gives unlimited permission to copy and/or distribute it,
2611d341caSmrg# with or without modifications, as long as this notice is preserved.
2711d341caSmrg
2811d341caSmrg# AM_AUTOMAKE_VERSION(VERSION)
2911d341caSmrg# ----------------------------
3011d341caSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3111d341caSmrg# generated from the m4 files accompanying Automake X.Y.
324c61c93dSmrg# (This private macro should not be called outside this file.)
334c61c93dSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
344c61c93dSmrg[am__api_version='1.11'
354c61c93dSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
364c61c93dSmrgdnl require some minimum version.  Point them to the right macro.
37d7ffce2aSmrgm4_if([$1], [1.11.1], [],
384c61c93dSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
394c61c93dSmrg])
404c61c93dSmrg
414c61c93dSmrg# _AM_AUTOCONF_VERSION(VERSION)
424c61c93dSmrg# -----------------------------
434c61c93dSmrg# aclocal traces this macro to find the Autoconf version.
444c61c93dSmrg# This is a private macro too.  Using m4_define simplifies
454c61c93dSmrg# the logic in aclocal, which can simply ignore this definition.
464c61c93dSmrgm4_define([_AM_AUTOCONF_VERSION], [])
4711d341caSmrg
4811d341caSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
4911d341caSmrg# -------------------------------
504c61c93dSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
514c61c93dSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5211d341caSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53d7ffce2aSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
544c61c93dSmrgm4_ifndef([AC_AUTOCONF_VERSION],
554c61c93dSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
564c61c93dSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5711d341caSmrg
5811d341caSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
5911d341caSmrg
6011d341caSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6111d341caSmrg#
6211d341caSmrg# This file is free software; the Free Software Foundation
6311d341caSmrg# gives unlimited permission to copy and/or distribute it,
6411d341caSmrg# with or without modifications, as long as this notice is preserved.
6511d341caSmrg
6611d341caSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6711d341caSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6811d341caSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6911d341caSmrg#
7011d341caSmrg# Of course, Automake must honor this variable whenever it calls a
7111d341caSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7211d341caSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7311d341caSmrg# depending on how configure is run.  This is pretty annoying, since
7411d341caSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7511d341caSmrg# source directory, any form will work fine, but in subdirectories a
7611d341caSmrg# relative path needs to be adjusted first.
7711d341caSmrg#
7811d341caSmrg# $ac_aux_dir/missing
7911d341caSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8011d341caSmrg# $top_srcdir/$ac_aux_dir/missing
8111d341caSmrg#    fails if $ac_aux_dir is absolute,
8211d341caSmrg#    fails when called from a subdirectory in a VPATH build with
8311d341caSmrg#          a relative $ac_aux_dir
8411d341caSmrg#
8511d341caSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8611d341caSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
8711d341caSmrg# harmless because $srcdir is `.', but things will broke when you
8811d341caSmrg# start a VPATH build or use an absolute $srcdir.
8911d341caSmrg#
9011d341caSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9111d341caSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9211d341caSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9311d341caSmrg# and then we would define $MISSING as
9411d341caSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9511d341caSmrg# This will work as long as MISSING is not called from configure, because
9611d341caSmrg# unfortunately $(top_srcdir) has no meaning in configure.
9711d341caSmrg# However there are other variables, like CC, which are often used in
9811d341caSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9911d341caSmrg#
10011d341caSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
10111d341caSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
10211d341caSmrg# configured tree to be moved without reconfiguration.
10311d341caSmrg
10411d341caSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10511d341caSmrg[dnl Rely on autoconf to set up CDPATH properly.
10611d341caSmrgAC_PREREQ([2.50])dnl
10711d341caSmrg# expand $ac_aux_dir to an absolute path
10811d341caSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
10911d341caSmrg])
11011d341caSmrg
11111d341caSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11211d341caSmrg
1134c61c93dSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11411d341caSmrg# Free Software Foundation, Inc.
11511d341caSmrg#
11611d341caSmrg# This file is free software; the Free Software Foundation
11711d341caSmrg# gives unlimited permission to copy and/or distribute it,
11811d341caSmrg# with or without modifications, as long as this notice is preserved.
11911d341caSmrg
1204c61c93dSmrg# serial 9
12111d341caSmrg
12211d341caSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12311d341caSmrg# -------------------------------------
12411d341caSmrg# Define a conditional.
12511d341caSmrgAC_DEFUN([AM_CONDITIONAL],
12611d341caSmrg[AC_PREREQ(2.52)dnl
12711d341caSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12811d341caSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1294c61c93dSmrgAC_SUBST([$1_TRUE])dnl
1304c61c93dSmrgAC_SUBST([$1_FALSE])dnl
1314c61c93dSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1324c61c93dSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1334c61c93dSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13411d341caSmrgif $2; then
13511d341caSmrg  $1_TRUE=
13611d341caSmrg  $1_FALSE='#'
13711d341caSmrgelse
13811d341caSmrg  $1_TRUE='#'
13911d341caSmrg  $1_FALSE=
14011d341caSmrgfi
14111d341caSmrgAC_CONFIG_COMMANDS_PRE(
14211d341caSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14311d341caSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14411d341caSmrgUsually this means the macro was only invoked conditionally.]])
14511d341caSmrgfi])])
14611d341caSmrg
1474c61c93dSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1484c61c93dSmrg# Free Software Foundation, Inc.
1494c61c93dSmrg#
1504c61c93dSmrg# This file is free software; the Free Software Foundation
1514c61c93dSmrg# gives unlimited permission to copy and/or distribute it,
1524c61c93dSmrg# with or without modifications, as long as this notice is preserved.
1534c61c93dSmrg
1544c61c93dSmrg# serial 10
1554c61c93dSmrg
1564c61c93dSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1574c61c93dSmrg# written in clear, in which case automake, when reading aclocal.m4,
1584c61c93dSmrg# will think it sees a *use*, and therefore will trigger all it's
1594c61c93dSmrg# C support machinery.  Also note that it means that autoscan, seeing
1604c61c93dSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
16111d341caSmrg
1624c61c93dSmrg
1634c61c93dSmrg# _AM_DEPENDENCIES(NAME)
1644c61c93dSmrg# ----------------------
1654c61c93dSmrg# See how the compiler implements dependency checking.
1664c61c93dSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1674c61c93dSmrg# We try a few techniques and use that to set a single cache variable.
1684c61c93dSmrg#
1694c61c93dSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1704c61c93dSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1714c61c93dSmrg# dependency, and given that the user is not expected to run this macro,
1724c61c93dSmrg# just rely on AC_PROG_CC.
1734c61c93dSmrgAC_DEFUN([_AM_DEPENDENCIES],
1744c61c93dSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1754c61c93dSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1764c61c93dSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1774c61c93dSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1784c61c93dSmrg
1794c61c93dSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1804c61c93dSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1814c61c93dSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1824c61c93dSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1834c61c93dSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1844c61c93dSmrg                   [depcc="$$1"   am_compiler_list=])
1854c61c93dSmrg
1864c61c93dSmrgAC_CACHE_CHECK([dependency style of $depcc],
1874c61c93dSmrg               [am_cv_$1_dependencies_compiler_type],
1884c61c93dSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1894c61c93dSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1904c61c93dSmrg  # making bogus files that we don't know about and never remove.  For
1914c61c93dSmrg  # instance it was reported that on HP-UX the gcc test will end up
1924c61c93dSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1934c61c93dSmrg  # in D'.
1944c61c93dSmrg  mkdir conftest.dir
1954c61c93dSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1964c61c93dSmrg  # using a relative directory.
1974c61c93dSmrg  cp "$am_depcomp" conftest.dir
1984c61c93dSmrg  cd conftest.dir
1994c61c93dSmrg  # We will build objects and dependencies in a subdirectory because
2004c61c93dSmrg  # it helps to detect inapplicable dependency modes.  For instance
2014c61c93dSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2024c61c93dSmrg  # side effect of compilation, but ICC will put the dependencies in
2034c61c93dSmrg  # the current directory while Tru64 will put them in the object
2044c61c93dSmrg  # directory.
2054c61c93dSmrg  mkdir sub
2064c61c93dSmrg
2074c61c93dSmrg  am_cv_$1_dependencies_compiler_type=none
2084c61c93dSmrg  if test "$am_compiler_list" = ""; then
2094c61c93dSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2104c61c93dSmrg  fi
2114c61c93dSmrg  am__universal=false
2124c61c93dSmrg  m4_case([$1], [CC],
2134c61c93dSmrg    [case " $depcc " in #(
2144c61c93dSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2154c61c93dSmrg     esac],
2164c61c93dSmrg    [CXX],
2174c61c93dSmrg    [case " $depcc " in #(
2184c61c93dSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2194c61c93dSmrg     esac])
2204c61c93dSmrg
2214c61c93dSmrg  for depmode in $am_compiler_list; do
2224c61c93dSmrg    # Setup a source with many dependencies, because some compilers
2234c61c93dSmrg    # like to wrap large dependency lists on column 80 (with \), and
2244c61c93dSmrg    # we should not choose a depcomp mode which is confused by this.
2254c61c93dSmrg    #
2264c61c93dSmrg    # We need to recreate these files for each test, as the compiler may
2274c61c93dSmrg    # overwrite some of them when testing with obscure command lines.
2284c61c93dSmrg    # This happens at least with the AIX C compiler.
2294c61c93dSmrg    : > sub/conftest.c
2304c61c93dSmrg    for i in 1 2 3 4 5 6; do
2314c61c93dSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2324c61c93dSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2334c61c93dSmrg      # Solaris 8's {/usr,}/bin/sh.
2344c61c93dSmrg      touch sub/conftst$i.h
2354c61c93dSmrg    done
2364c61c93dSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2374c61c93dSmrg
2384c61c93dSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2394c61c93dSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2404c61c93dSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
2414c61c93dSmrg    # versions had trouble with output in subdirs
2424c61c93dSmrg    am__obj=sub/conftest.${OBJEXT-o}
2434c61c93dSmrg    am__minus_obj="-o $am__obj"
2444c61c93dSmrg    case $depmode in
2454c61c93dSmrg    gcc)
2464c61c93dSmrg      # This depmode causes a compiler race in universal mode.
2474c61c93dSmrg      test "$am__universal" = false || continue
2484c61c93dSmrg      ;;
2494c61c93dSmrg    nosideeffect)
2504c61c93dSmrg      # after this tag, mechanisms are not by side-effect, so they'll
2514c61c93dSmrg      # only be used when explicitly requested
2524c61c93dSmrg      if test "x$enable_dependency_tracking" = xyes; then
2534c61c93dSmrg	continue
2544c61c93dSmrg      else
2554c61c93dSmrg	break
2564c61c93dSmrg      fi
2574c61c93dSmrg      ;;
2584c61c93dSmrg    msvisualcpp | msvcmsys)
2594c61c93dSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
2604c61c93dSmrg      # not run yet.  These depmodes are late enough in the game, and
2614c61c93dSmrg      # so weak that their functioning should not be impacted.
2624c61c93dSmrg      am__obj=conftest.${OBJEXT-o}
2634c61c93dSmrg      am__minus_obj=
2644c61c93dSmrg      ;;
2654c61c93dSmrg    none) break ;;
2664c61c93dSmrg    esac
2674c61c93dSmrg    if depmode=$depmode \
2684c61c93dSmrg       source=sub/conftest.c object=$am__obj \
2694c61c93dSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2704c61c93dSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2714c61c93dSmrg         >/dev/null 2>conftest.err &&
2724c61c93dSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2734c61c93dSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2744c61c93dSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2754c61c93dSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2764c61c93dSmrg      # icc doesn't choke on unknown options, it will just issue warnings
2774c61c93dSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
2784c61c93dSmrg      # that says an option was ignored or not supported.
2794c61c93dSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2804c61c93dSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2814c61c93dSmrg      # The diagnosis changed in icc 8.0:
2824c61c93dSmrg      #   icc: Command line remark: option '-MP' not supported
2834c61c93dSmrg      if (grep 'ignoring option' conftest.err ||
2844c61c93dSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2854c61c93dSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2864c61c93dSmrg        break
2874c61c93dSmrg      fi
2884c61c93dSmrg    fi
2894c61c93dSmrg  done
2904c61c93dSmrg
2914c61c93dSmrg  cd ..
2924c61c93dSmrg  rm -rf conftest.dir
2934c61c93dSmrgelse
2944c61c93dSmrg  am_cv_$1_dependencies_compiler_type=none
2954c61c93dSmrgfi
2964c61c93dSmrg])
2974c61c93dSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2984c61c93dSmrgAM_CONDITIONAL([am__fastdep$1], [
2994c61c93dSmrg  test "x$enable_dependency_tracking" != xno \
3004c61c93dSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3014c61c93dSmrg])
3024c61c93dSmrg
3034c61c93dSmrg
3044c61c93dSmrg# AM_SET_DEPDIR
3054c61c93dSmrg# -------------
3064c61c93dSmrg# Choose a directory name for dependency files.
3074c61c93dSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3084c61c93dSmrgAC_DEFUN([AM_SET_DEPDIR],
3094c61c93dSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3104c61c93dSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3114c61c93dSmrg])
3124c61c93dSmrg
3134c61c93dSmrg
3144c61c93dSmrg# AM_DEP_TRACK
3154c61c93dSmrg# ------------
3164c61c93dSmrgAC_DEFUN([AM_DEP_TRACK],
3174c61c93dSmrg[AC_ARG_ENABLE(dependency-tracking,
3184c61c93dSmrg[  --disable-dependency-tracking  speeds up one-time build
3194c61c93dSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3204c61c93dSmrgif test "x$enable_dependency_tracking" != xno; then
3214c61c93dSmrg  am_depcomp="$ac_aux_dir/depcomp"
3224c61c93dSmrg  AMDEPBACKSLASH='\'
3234c61c93dSmrgfi
3244c61c93dSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3254c61c93dSmrgAC_SUBST([AMDEPBACKSLASH])dnl
3264c61c93dSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3274c61c93dSmrg])
3284c61c93dSmrg
3294c61c93dSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3304c61c93dSmrg
3314c61c93dSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33211d341caSmrg# Free Software Foundation, Inc.
33311d341caSmrg#
33411d341caSmrg# This file is free software; the Free Software Foundation
33511d341caSmrg# gives unlimited permission to copy and/or distribute it,
33611d341caSmrg# with or without modifications, as long as this notice is preserved.
33711d341caSmrg
3384c61c93dSmrg#serial 5
3394c61c93dSmrg
3404c61c93dSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3414c61c93dSmrg# ------------------------------
3424c61c93dSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3434c61c93dSmrg[{
3444c61c93dSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
3454c61c93dSmrg  # are listed without --file.  Let's play safe and only enable the eval
3464c61c93dSmrg  # if we detect the quoting.
3474c61c93dSmrg  case $CONFIG_FILES in
3484c61c93dSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
3494c61c93dSmrg  *)   set x $CONFIG_FILES ;;
3504c61c93dSmrg  esac
3514c61c93dSmrg  shift
3524c61c93dSmrg  for mf
3534c61c93dSmrg  do
3544c61c93dSmrg    # Strip MF so we end up with the name of the file.
3554c61c93dSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3564c61c93dSmrg    # Check whether this is an Automake generated Makefile or not.
3574c61c93dSmrg    # We used to match only the files named `Makefile.in', but
3584c61c93dSmrg    # some people rename them; so instead we look at the file content.
3594c61c93dSmrg    # Grep'ing the first line is not enough: some people post-process
3604c61c93dSmrg    # each Makefile.in and add a new line on top of each file to say so.
3614c61c93dSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
3624c61c93dSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
3634c61c93dSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3644c61c93dSmrg      dirpart=`AS_DIRNAME("$mf")`
3654c61c93dSmrg    else
3664c61c93dSmrg      continue
3674c61c93dSmrg    fi
3684c61c93dSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
3694c61c93dSmrg    # from the Makefile without running `make'.
3704c61c93dSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3714c61c93dSmrg    test -z "$DEPDIR" && continue
3724c61c93dSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3734c61c93dSmrg    test -z "am__include" && continue
3744c61c93dSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3754c61c93dSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
3764c61c93dSmrg    U=`sed -n 's/^U = //p' < "$mf"`
3774c61c93dSmrg    # Find all dependency output files, they are included files with
3784c61c93dSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3794c61c93dSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3804c61c93dSmrg    # expansion.
3814c61c93dSmrg    for file in `sed -n "
3824c61c93dSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3834c61c93dSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3844c61c93dSmrg      # Make sure the directory exists.
3854c61c93dSmrg      test -f "$dirpart/$file" && continue
3864c61c93dSmrg      fdir=`AS_DIRNAME(["$file"])`
3874c61c93dSmrg      AS_MKDIR_P([$dirpart/$fdir])
3884c61c93dSmrg      # echo "creating $dirpart/$file"
3894c61c93dSmrg      echo '# dummy' > "$dirpart/$file"
3904c61c93dSmrg    done
3914c61c93dSmrg  done
3924c61c93dSmrg}
3934c61c93dSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3944c61c93dSmrg
3954c61c93dSmrg
3964c61c93dSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3974c61c93dSmrg# -----------------------------
3984c61c93dSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
3994c61c93dSmrg#
4004c61c93dSmrg# This code is only required when automatic dependency tracking
4014c61c93dSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
4024c61c93dSmrg# need in order to bootstrap the dependency handling code.
4034c61c93dSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4044c61c93dSmrg[AC_CONFIG_COMMANDS([depfiles],
4054c61c93dSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4064c61c93dSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4074c61c93dSmrg])
4084c61c93dSmrg
4094c61c93dSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4104c61c93dSmrg
4114c61c93dSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4124c61c93dSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4134c61c93dSmrg#
4144c61c93dSmrg# This file is free software; the Free Software Foundation
4154c61c93dSmrg# gives unlimited permission to copy and/or distribute it,
4164c61c93dSmrg# with or without modifications, as long as this notice is preserved.
4174c61c93dSmrg
4184c61c93dSmrg# serial 16
41911d341caSmrg
42011d341caSmrg# This macro actually does too much.  Some checks are only needed if
42111d341caSmrg# your package does certain things.  But this isn't really a big deal.
42211d341caSmrg
42311d341caSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
42411d341caSmrg# AM_INIT_AUTOMAKE([OPTIONS])
42511d341caSmrg# -----------------------------------------------
42611d341caSmrg# The call with PACKAGE and VERSION arguments is the old style
42711d341caSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
42811d341caSmrg# and VERSION should now be passed to AC_INIT and removed from
42911d341caSmrg# the call to AM_INIT_AUTOMAKE.
43011d341caSmrg# We support both call styles for the transition.  After
43111d341caSmrg# the next Automake release, Autoconf can make the AC_INIT
43211d341caSmrg# arguments mandatory, and then we can depend on a new Autoconf
43311d341caSmrg# release and drop the old call support.
43411d341caSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4354c61c93dSmrg[AC_PREREQ([2.62])dnl
43611d341caSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
43711d341caSmrgdnl the ones we care about.
43811d341caSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
43911d341caSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
44011d341caSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4414c61c93dSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4424c61c93dSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4434c61c93dSmrg  # is not polluted with repeated "-I."
4444c61c93dSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4454c61c93dSmrg  # test to see if srcdir already configured
4464c61c93dSmrg  if test -f $srcdir/config.status; then
4474c61c93dSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4484c61c93dSmrg  fi
44911d341caSmrgfi
45011d341caSmrg
45111d341caSmrg# test whether we have cygpath
45211d341caSmrgif test -z "$CYGPATH_W"; then
45311d341caSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
45411d341caSmrg    CYGPATH_W='cygpath -w'
45511d341caSmrg  else
45611d341caSmrg    CYGPATH_W=echo
45711d341caSmrg  fi
45811d341caSmrgfi
45911d341caSmrgAC_SUBST([CYGPATH_W])
46011d341caSmrg
46111d341caSmrg# Define the identity of the package.
46211d341caSmrgdnl Distinguish between old-style and new-style calls.
46311d341caSmrgm4_ifval([$2],
46411d341caSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
46511d341caSmrg AC_SUBST([PACKAGE], [$1])dnl
46611d341caSmrg AC_SUBST([VERSION], [$2])],
46711d341caSmrg[_AM_SET_OPTIONS([$1])dnl
4684c61c93dSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4694c61c93dSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4704c61c93dSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
47111d341caSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
47211d341caSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
47311d341caSmrg
47411d341caSmrg_AM_IF_OPTION([no-define],,
47511d341caSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
47611d341caSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
47711d341caSmrg
47811d341caSmrg# Some tools Automake needs.
47911d341caSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
48011d341caSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
48111d341caSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
48211d341caSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
48311d341caSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
48411d341caSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
48511d341caSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4864c61c93dSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4874c61c93dSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
48811d341caSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
48911d341caSmrg# We need awk for the "check" target.  The system "awk" is bad on
49011d341caSmrg# some platforms.
49111d341caSmrgAC_REQUIRE([AC_PROG_AWK])dnl
49211d341caSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
49311d341caSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
49411d341caSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4954c61c93dSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4964c61c93dSmrg			     [_AM_PROG_TAR([v7])])])
49711d341caSmrg_AM_IF_OPTION([no-dependencies],,
49811d341caSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
4994c61c93dSmrg		  [_AM_DEPENDENCIES(CC)],
5004c61c93dSmrg		  [define([AC_PROG_CC],
5014c61c93dSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
50211d341caSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5034c61c93dSmrg		  [_AM_DEPENDENCIES(CXX)],
5044c61c93dSmrg		  [define([AC_PROG_CXX],
5054c61c93dSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5064c61c93dSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5074c61c93dSmrg		  [_AM_DEPENDENCIES(OBJC)],
5084c61c93dSmrg		  [define([AC_PROG_OBJC],
5094c61c93dSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
51011d341caSmrg])
5114c61c93dSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5124c61c93dSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5134c61c93dSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5144c61c93dSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5154c61c93dSmrgAC_CONFIG_COMMANDS_PRE(dnl
5164c61c93dSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5174c61c93dSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
51811d341caSmrg])
51911d341caSmrg
5204c61c93dSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5214c61c93dSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5224c61c93dSmrgdnl mangled by Autoconf and run in a shell conditional statement.
5234c61c93dSmrgm4_define([_AC_COMPILER_EXEEXT],
5244c61c93dSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5254c61c93dSmrg
52611d341caSmrg
52711d341caSmrg# When config.status generates a header, we must update the stamp-h file.
52811d341caSmrg# This file resides in the same directory as the config header
52911d341caSmrg# that is generated.  The stamp files are numbered to have different names.
53011d341caSmrg
53111d341caSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
53211d341caSmrg# loop where config.status creates the headers, so we can generate
53311d341caSmrg# our stamp files there.
53411d341caSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
53511d341caSmrg[# Compute $1's index in $config_headers.
5364c61c93dSmrg_am_arg=$1
53711d341caSmrg_am_stamp_count=1
53811d341caSmrgfor _am_header in $config_headers :; do
53911d341caSmrg  case $_am_header in
5404c61c93dSmrg    $_am_arg | $_am_arg:* )
54111d341caSmrg      break ;;
54211d341caSmrg    * )
54311d341caSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
54411d341caSmrg  esac
54511d341caSmrgdone
5464c61c93dSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
54711d341caSmrg
5484c61c93dSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
54911d341caSmrg#
55011d341caSmrg# This file is free software; the Free Software Foundation
55111d341caSmrg# gives unlimited permission to copy and/or distribute it,
55211d341caSmrg# with or without modifications, as long as this notice is preserved.
55311d341caSmrg
55411d341caSmrg# AM_PROG_INSTALL_SH
55511d341caSmrg# ------------------
55611d341caSmrg# Define $install_sh.
55711d341caSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
55811d341caSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5594c61c93dSmrgif test x"${install_sh}" != xset; then
5604c61c93dSmrg  case $am_aux_dir in
5614c61c93dSmrg  *\ * | *\	*)
5624c61c93dSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5634c61c93dSmrg  *)
5644c61c93dSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5654c61c93dSmrg  esac
5664c61c93dSmrgfi
56711d341caSmrgAC_SUBST(install_sh)])
56811d341caSmrg
56911d341caSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
57011d341caSmrg#
57111d341caSmrg# This file is free software; the Free Software Foundation
57211d341caSmrg# gives unlimited permission to copy and/or distribute it,
57311d341caSmrg# with or without modifications, as long as this notice is preserved.
57411d341caSmrg
57511d341caSmrg# serial 2
57611d341caSmrg
57711d341caSmrg# Check whether the underlying file-system supports filenames
57811d341caSmrg# with a leading dot.  For instance MS-DOS doesn't.
57911d341caSmrgAC_DEFUN([AM_SET_LEADING_DOT],
58011d341caSmrg[rm -rf .tst 2>/dev/null
58111d341caSmrgmkdir .tst 2>/dev/null
58211d341caSmrgif test -d .tst; then
58311d341caSmrg  am__leading_dot=.
58411d341caSmrgelse
58511d341caSmrg  am__leading_dot=_
58611d341caSmrgfi
58711d341caSmrgrmdir .tst 2>/dev/null
58811d341caSmrgAC_SUBST([am__leading_dot])])
58911d341caSmrg
59011d341caSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
59111d341caSmrg# From Jim Meyering
59211d341caSmrg
5934c61c93dSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
59411d341caSmrg# Free Software Foundation, Inc.
59511d341caSmrg#
59611d341caSmrg# This file is free software; the Free Software Foundation
59711d341caSmrg# gives unlimited permission to copy and/or distribute it,
59811d341caSmrg# with or without modifications, as long as this notice is preserved.
59911d341caSmrg
6004c61c93dSmrg# serial 5
60111d341caSmrg
6024c61c93dSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6034c61c93dSmrg# ----------------------------------
6044c61c93dSmrg# Control maintainer-specific portions of Makefiles.
6054c61c93dSmrg# Default is to disable them, unless `enable' is passed literally.
6064c61c93dSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6074c61c93dSmrg# can override the default with the --enable/--disable switch.
60811d341caSmrgAC_DEFUN([AM_MAINTAINER_MODE],
6094c61c93dSmrg[m4_case(m4_default([$1], [disable]),
6104c61c93dSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
6114c61c93dSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
6124c61c93dSmrg       [m4_define([am_maintainer_other], [enable])
6134c61c93dSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6144c61c93dSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6154c61c93dSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6164c61c93dSmrg  AC_ARG_ENABLE([maintainer-mode],
6174c61c93dSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
61811d341caSmrg			  (and sometimes confusing) to the casual installer],
6194c61c93dSmrg      [USE_MAINTAINER_MODE=$enableval],
6204c61c93dSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
62111d341caSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6224c61c93dSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
62311d341caSmrg  MAINT=$MAINTAINER_MODE_TRUE
6244c61c93dSmrg  AC_SUBST([MAINT])dnl
62511d341caSmrg]
62611d341caSmrg)
62711d341caSmrg
62811d341caSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
62911d341caSmrg
6304c61c93dSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6314c61c93dSmrg
6324c61c93dSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
6334c61c93dSmrg#
6344c61c93dSmrg# This file is free software; the Free Software Foundation
6354c61c93dSmrg# gives unlimited permission to copy and/or distribute it,
6364c61c93dSmrg# with or without modifications, as long as this notice is preserved.
6374c61c93dSmrg
6384c61c93dSmrg# serial 4
6394c61c93dSmrg
6404c61c93dSmrg# AM_MAKE_INCLUDE()
6414c61c93dSmrg# -----------------
6424c61c93dSmrg# Check to see how make treats includes.
6434c61c93dSmrgAC_DEFUN([AM_MAKE_INCLUDE],
6444c61c93dSmrg[am_make=${MAKE-make}
6454c61c93dSmrgcat > confinc << 'END'
6464c61c93dSmrgam__doit:
6474c61c93dSmrg	@echo this is the am__doit target
6484c61c93dSmrg.PHONY: am__doit
6494c61c93dSmrgEND
6504c61c93dSmrg# If we don't find an include directive, just comment out the code.
6514c61c93dSmrgAC_MSG_CHECKING([for style of include used by $am_make])
6524c61c93dSmrgam__include="#"
6534c61c93dSmrgam__quote=
6544c61c93dSmrg_am_result=none
6554c61c93dSmrg# First try GNU make style include.
6564c61c93dSmrgecho "include confinc" > confmf
6574c61c93dSmrg# Ignore all kinds of additional output from `make'.
6584c61c93dSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6594c61c93dSmrg*the\ am__doit\ target*)
6604c61c93dSmrg  am__include=include
6614c61c93dSmrg  am__quote=
6624c61c93dSmrg  _am_result=GNU
6634c61c93dSmrg  ;;
6644c61c93dSmrgesac
6654c61c93dSmrg# Now try BSD make style include.
6664c61c93dSmrgif test "$am__include" = "#"; then
6674c61c93dSmrg   echo '.include "confinc"' > confmf
6684c61c93dSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6694c61c93dSmrg   *the\ am__doit\ target*)
6704c61c93dSmrg     am__include=.include
6714c61c93dSmrg     am__quote="\""
6724c61c93dSmrg     _am_result=BSD
6734c61c93dSmrg     ;;
6744c61c93dSmrg   esac
6754c61c93dSmrgfi
6764c61c93dSmrgAC_SUBST([am__include])
6774c61c93dSmrgAC_SUBST([am__quote])
6784c61c93dSmrgAC_MSG_RESULT([$_am_result])
6794c61c93dSmrgrm -f confinc confmf
6804c61c93dSmrg])
6814c61c93dSmrg
68211d341caSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
68311d341caSmrg
6844c61c93dSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
68511d341caSmrg# Free Software Foundation, Inc.
68611d341caSmrg#
68711d341caSmrg# This file is free software; the Free Software Foundation
68811d341caSmrg# gives unlimited permission to copy and/or distribute it,
68911d341caSmrg# with or without modifications, as long as this notice is preserved.
69011d341caSmrg
6914c61c93dSmrg# serial 6
69211d341caSmrg
69311d341caSmrg# AM_MISSING_PROG(NAME, PROGRAM)
69411d341caSmrg# ------------------------------
69511d341caSmrgAC_DEFUN([AM_MISSING_PROG],
69611d341caSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
69711d341caSmrg$1=${$1-"${am_missing_run}$2"}
69811d341caSmrgAC_SUBST($1)])
69911d341caSmrg
70011d341caSmrg
70111d341caSmrg# AM_MISSING_HAS_RUN
70211d341caSmrg# ------------------
70311d341caSmrg# Define MISSING if not defined so far and test if it supports --run.
70411d341caSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
70511d341caSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
70611d341caSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7074c61c93dSmrgAC_REQUIRE_AUX_FILE([missing])dnl
7084c61c93dSmrgif test x"${MISSING+set}" != xset; then
7094c61c93dSmrg  case $am_aux_dir in
7104c61c93dSmrg  *\ * | *\	*)
7114c61c93dSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7124c61c93dSmrg  *)
7134c61c93dSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7144c61c93dSmrg  esac
7154c61c93dSmrgfi
71611d341caSmrg# Use eval to expand $SHELL
71711d341caSmrgif eval "$MISSING --run true"; then
71811d341caSmrg  am_missing_run="$MISSING --run "
71911d341caSmrgelse
72011d341caSmrg  am_missing_run=
72111d341caSmrg  AC_MSG_WARN([`missing' script is too old or missing])
72211d341caSmrgfi
72311d341caSmrg])
72411d341caSmrg
7254c61c93dSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
72611d341caSmrg#
72711d341caSmrg# This file is free software; the Free Software Foundation
72811d341caSmrg# gives unlimited permission to copy and/or distribute it,
72911d341caSmrg# with or without modifications, as long as this notice is preserved.
73011d341caSmrg
73111d341caSmrg# AM_PROG_MKDIR_P
73211d341caSmrg# ---------------
7334c61c93dSmrg# Check for `mkdir -p'.
73411d341caSmrgAC_DEFUN([AM_PROG_MKDIR_P],
7354c61c93dSmrg[AC_PREREQ([2.60])dnl
7364c61c93dSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7374c61c93dSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7384c61c93dSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
7394c61c93dSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7404c61c93dSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7414c61c93dSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7424c61c93dSmrgdnl adjustment using top_builddir (which is defined more often than
7434c61c93dSmrgdnl MKDIR_P).
7444c61c93dSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7454c61c93dSmrgcase $mkdir_p in
7464c61c93dSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7474c61c93dSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7484c61c93dSmrgesac
7494c61c93dSmrg])
75011d341caSmrg
75111d341caSmrg# Helper functions for option handling.                     -*- Autoconf -*-
75211d341caSmrg
7534c61c93dSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
75411d341caSmrg#
75511d341caSmrg# This file is free software; the Free Software Foundation
75611d341caSmrg# gives unlimited permission to copy and/or distribute it,
75711d341caSmrg# with or without modifications, as long as this notice is preserved.
75811d341caSmrg
7594c61c93dSmrg# serial 4
76011d341caSmrg
76111d341caSmrg# _AM_MANGLE_OPTION(NAME)
76211d341caSmrg# -----------------------
76311d341caSmrgAC_DEFUN([_AM_MANGLE_OPTION],
76411d341caSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
76511d341caSmrg
76611d341caSmrg# _AM_SET_OPTION(NAME)
76711d341caSmrg# ------------------------------
76811d341caSmrg# Set option NAME.  Presently that only means defining a flag for this option.
76911d341caSmrgAC_DEFUN([_AM_SET_OPTION],
77011d341caSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
77111d341caSmrg
77211d341caSmrg# _AM_SET_OPTIONS(OPTIONS)
77311d341caSmrg# ----------------------------------
77411d341caSmrg# OPTIONS is a space-separated list of Automake options.
77511d341caSmrgAC_DEFUN([_AM_SET_OPTIONS],
7764c61c93dSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
77711d341caSmrg
77811d341caSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
77911d341caSmrg# -------------------------------------------
78011d341caSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
78111d341caSmrgAC_DEFUN([_AM_IF_OPTION],
78211d341caSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
78311d341caSmrg
78411d341caSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
78511d341caSmrg
7864c61c93dSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
78711d341caSmrg# Free Software Foundation, Inc.
78811d341caSmrg#
78911d341caSmrg# This file is free software; the Free Software Foundation
79011d341caSmrg# gives unlimited permission to copy and/or distribute it,
79111d341caSmrg# with or without modifications, as long as this notice is preserved.
79211d341caSmrg
7934c61c93dSmrg# serial 5
79411d341caSmrg
79511d341caSmrg# AM_SANITY_CHECK
79611d341caSmrg# ---------------
79711d341caSmrgAC_DEFUN([AM_SANITY_CHECK],
79811d341caSmrg[AC_MSG_CHECKING([whether build environment is sane])
79911d341caSmrg# Just in case
80011d341caSmrgsleep 1
80111d341caSmrgecho timestamp > conftest.file
8024c61c93dSmrg# Reject unsafe characters in $srcdir or the absolute working directory
8034c61c93dSmrg# name.  Accept space and tab only in the latter.
8044c61c93dSmrgam_lf='
8054c61c93dSmrg'
8064c61c93dSmrgcase `pwd` in
8074c61c93dSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8084c61c93dSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8094c61c93dSmrgesac
8104c61c93dSmrgcase $srcdir in
8114c61c93dSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8124c61c93dSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8134c61c93dSmrgesac
8144c61c93dSmrg
81511d341caSmrg# Do `set' in a subshell so we don't clobber the current shell's
81611d341caSmrg# arguments.  Must try -L first in case configure is actually a
81711d341caSmrg# symlink; some systems play weird games with the mod time of symlinks
81811d341caSmrg# (eg FreeBSD returns the mod time of the symlink's containing
81911d341caSmrg# directory).
82011d341caSmrgif (
8214c61c93dSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
82211d341caSmrg   if test "$[*]" = "X"; then
82311d341caSmrg      # -L didn't work.
8244c61c93dSmrg      set X `ls -t "$srcdir/configure" conftest.file`
82511d341caSmrg   fi
82611d341caSmrg   rm -f conftest.file
82711d341caSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
82811d341caSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
82911d341caSmrg
83011d341caSmrg      # If neither matched, then we have a broken ls.  This can happen
83111d341caSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
83211d341caSmrg      # broken ls alias from the environment.  This has actually
83311d341caSmrg      # happened.  Such a system could not be considered "sane".
83411d341caSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
83511d341caSmrgalias in your environment])
83611d341caSmrg   fi
83711d341caSmrg
83811d341caSmrg   test "$[2]" = conftest.file
83911d341caSmrg   )
84011d341caSmrgthen
84111d341caSmrg   # Ok.
84211d341caSmrg   :
84311d341caSmrgelse
84411d341caSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
84511d341caSmrgCheck your system clock])
84611d341caSmrgfi
84711d341caSmrgAC_MSG_RESULT(yes)])
84811d341caSmrg
8494c61c93dSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
8504c61c93dSmrg#
8514c61c93dSmrg# This file is free software; the Free Software Foundation
8524c61c93dSmrg# gives unlimited permission to copy and/or distribute it,
8534c61c93dSmrg# with or without modifications, as long as this notice is preserved.
8544c61c93dSmrg
8554c61c93dSmrg# serial 1
8564c61c93dSmrg
8574c61c93dSmrg# AM_SILENT_RULES([DEFAULT])
8584c61c93dSmrg# --------------------------
8594c61c93dSmrg# Enable less verbose build rules; with the default set to DEFAULT
8604c61c93dSmrg# (`yes' being less verbose, `no' or empty being verbose).
8614c61c93dSmrgAC_DEFUN([AM_SILENT_RULES],
8624c61c93dSmrg[AC_ARG_ENABLE([silent-rules],
8634c61c93dSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8644c61c93dSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8654c61c93dSmrgcase $enable_silent_rules in
8664c61c93dSmrgyes) AM_DEFAULT_VERBOSITY=0;;
8674c61c93dSmrgno)  AM_DEFAULT_VERBOSITY=1;;
8684c61c93dSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8694c61c93dSmrgesac
8704c61c93dSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8714c61c93dSmrgAM_BACKSLASH='\'
8724c61c93dSmrgAC_SUBST([AM_BACKSLASH])dnl
8734c61c93dSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8744c61c93dSmrg])
8754c61c93dSmrg
87611d341caSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
87711d341caSmrg#
87811d341caSmrg# This file is free software; the Free Software Foundation
87911d341caSmrg# gives unlimited permission to copy and/or distribute it,
88011d341caSmrg# with or without modifications, as long as this notice is preserved.
88111d341caSmrg
88211d341caSmrg# AM_PROG_INSTALL_STRIP
88311d341caSmrg# ---------------------
88411d341caSmrg# One issue with vendor `install' (even GNU) is that you can't
88511d341caSmrg# specify the program used to strip binaries.  This is especially
88611d341caSmrg# annoying in cross-compiling environments, where the build's strip
88711d341caSmrg# is unlikely to handle the host's binaries.
88811d341caSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
88911d341caSmrg# always use install-sh in `make install-strip', and initialize
89011d341caSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
89111d341caSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
89211d341caSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
89311d341caSmrg# Installed binaries are usually stripped using `strip' when the user
89411d341caSmrg# run `make install-strip'.  However `strip' might not be the right
89511d341caSmrg# tool to use in cross-compilation environments, therefore Automake
89611d341caSmrg# will honor the `STRIP' environment variable to overrule this program.
89711d341caSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
89811d341caSmrgif test "$cross_compiling" != no; then
89911d341caSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
90011d341caSmrgfi
9014c61c93dSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
90211d341caSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
90311d341caSmrg
9044c61c93dSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9054c61c93dSmrg#
9064c61c93dSmrg# This file is free software; the Free Software Foundation
9074c61c93dSmrg# gives unlimited permission to copy and/or distribute it,
9084c61c93dSmrg# with or without modifications, as long as this notice is preserved.
9094c61c93dSmrg
9104c61c93dSmrg# serial 2
9114c61c93dSmrg
9124c61c93dSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
9134c61c93dSmrg# ---------------------------
9144c61c93dSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9154c61c93dSmrg# This macro is traced by Automake.
9164c61c93dSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9174c61c93dSmrg
9184c61c93dSmrg# AM_SUBST_NOTMAKE(VARIABLE)
9194c61c93dSmrg# ---------------------------
9204c61c93dSmrg# Public sister of _AM_SUBST_NOTMAKE.
9214c61c93dSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9224c61c93dSmrg
92311d341caSmrg# Check how to create a tarball.                            -*- Autoconf -*-
92411d341caSmrg
92511d341caSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
92611d341caSmrg#
92711d341caSmrg# This file is free software; the Free Software Foundation
92811d341caSmrg# gives unlimited permission to copy and/or distribute it,
92911d341caSmrg# with or without modifications, as long as this notice is preserved.
93011d341caSmrg
93111d341caSmrg# serial 2
93211d341caSmrg
93311d341caSmrg# _AM_PROG_TAR(FORMAT)
93411d341caSmrg# --------------------
93511d341caSmrg# Check how to create a tarball in format FORMAT.
93611d341caSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
93711d341caSmrg#
93811d341caSmrg# Substitute a variable $(am__tar) that is a command
93911d341caSmrg# writing to stdout a FORMAT-tarball containing the directory
94011d341caSmrg# $tardir.
94111d341caSmrg#     tardir=directory && $(am__tar) > result.tar
94211d341caSmrg#
94311d341caSmrg# Substitute a variable $(am__untar) that extract such
94411d341caSmrg# a tarball read from stdin.
94511d341caSmrg#     $(am__untar) < result.tar
94611d341caSmrgAC_DEFUN([_AM_PROG_TAR],
94711d341caSmrg[# Always define AMTAR for backward compatibility.
94811d341caSmrgAM_MISSING_PROG([AMTAR], [tar])
94911d341caSmrgm4_if([$1], [v7],
95011d341caSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
95111d341caSmrg     [m4_case([$1], [ustar],, [pax],,
95211d341caSmrg              [m4_fatal([Unknown tar format])])
95311d341caSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
95411d341caSmrg# Loop over all known methods to create a tar archive until one works.
95511d341caSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
95611d341caSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
95711d341caSmrg# Do not fold the above two line into one, because Tru64 sh and
95811d341caSmrg# Solaris sh will not grok spaces in the rhs of `-'.
95911d341caSmrgfor _am_tool in $_am_tools
96011d341caSmrgdo
96111d341caSmrg  case $_am_tool in
96211d341caSmrg  gnutar)
96311d341caSmrg    for _am_tar in tar gnutar gtar;
96411d341caSmrg    do
96511d341caSmrg      AM_RUN_LOG([$_am_tar --version]) && break
96611d341caSmrg    done
96711d341caSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
96811d341caSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
96911d341caSmrg    am__untar="$_am_tar -xf -"
97011d341caSmrg    ;;
97111d341caSmrg  plaintar)
97211d341caSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
97311d341caSmrg    # ustar tarball either.
97411d341caSmrg    (tar --version) >/dev/null 2>&1 && continue
97511d341caSmrg    am__tar='tar chf - "$$tardir"'
97611d341caSmrg    am__tar_='tar chf - "$tardir"'
97711d341caSmrg    am__untar='tar xf -'
97811d341caSmrg    ;;
97911d341caSmrg  pax)
98011d341caSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
98111d341caSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
98211d341caSmrg    am__untar='pax -r'
98311d341caSmrg    ;;
98411d341caSmrg  cpio)
98511d341caSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
98611d341caSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
98711d341caSmrg    am__untar='cpio -i -H $1 -d'
98811d341caSmrg    ;;
98911d341caSmrg  none)
99011d341caSmrg    am__tar=false
99111d341caSmrg    am__tar_=false
99211d341caSmrg    am__untar=false
99311d341caSmrg    ;;
99411d341caSmrg  esac
99511d341caSmrg
99611d341caSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
99711d341caSmrg  # and am__untar set.
99811d341caSmrg  test -n "${am_cv_prog_tar_$1}" && break
99911d341caSmrg
100011d341caSmrg  # tar/untar a dummy directory, and stop if the command works
100111d341caSmrg  rm -rf conftest.dir
100211d341caSmrg  mkdir conftest.dir
100311d341caSmrg  echo GrepMe > conftest.dir/file
100411d341caSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
100511d341caSmrg  rm -rf conftest.dir
100611d341caSmrg  if test -s conftest.tar; then
100711d341caSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
100811d341caSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
100911d341caSmrg  fi
101011d341caSmrgdone
101111d341caSmrgrm -rf conftest.dir
101211d341caSmrg
101311d341caSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
101411d341caSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
101511d341caSmrgAC_SUBST([am__tar])
101611d341caSmrgAC_SUBST([am__untar])
101711d341caSmrg]) # _AM_PROG_TAR
101811d341caSmrg
1019d7ffce2aSmrgdnl fontutil.m4.  Generated from fontutil.m4.in by configure.
1020d7ffce2aSmrgdnl
1021d7ffce2aSmrgdnl This file comes from X.Org's font-util 1.2.0
1022d7ffce2aSmrgdnl
1023d7ffce2aSmrgdnl Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
10244c61c93dSmrgdnl
10254c61c93dSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1026d7ffce2aSmrgdnl copy of this software and associated documentation files (the "Software"),
1027d7ffce2aSmrgdnl to deal in the Software without restriction, including without limitation
1028d7ffce2aSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1029d7ffce2aSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
1030d7ffce2aSmrgdnl Software is furnished to do so, subject to the following conditions:
1031d7ffce2aSmrgdnl
1032d7ffce2aSmrgdnl The above copyright notice and this permission notice (including the next
1033d7ffce2aSmrgdnl paragraph) shall be included in all copies or substantial portions of the
1034d7ffce2aSmrgdnl Software.
1035d7ffce2aSmrgdnl
1036d7ffce2aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1037d7ffce2aSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1038d7ffce2aSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1039d7ffce2aSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1040d7ffce2aSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1041d7ffce2aSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1042d7ffce2aSmrgdnl DEALINGS IN THE SOFTWARE.
1043d7ffce2aSmrgdnl
1044d7ffce2aSmrgdnl --------------------------------------------------------------------
1045d7ffce2aSmrgdnl
1046d7ffce2aSmrgdnl Copyright 2005 Red Hat, Inc
1047d7ffce2aSmrgdnl
1048d7ffce2aSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1049d7ffce2aSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1050d7ffce2aSmrgdnl the above copyright notice appear in all copies and that both that
1051d7ffce2aSmrgdnl copyright notice and this permission notice appear in supporting
1052d7ffce2aSmrgdnl documentation.
1053d7ffce2aSmrgdnl
1054d7ffce2aSmrgdnl The above copyright notice and this permission notice shall be included
1055d7ffce2aSmrgdnl in all copies or substantial portions of the Software.
10564c61c93dSmrgdnl
10574c61c93dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10584c61c93dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1059d7ffce2aSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1060d7ffce2aSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1061d7ffce2aSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1062d7ffce2aSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1063d7ffce2aSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1064d7ffce2aSmrgdnl
1065d7ffce2aSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1066d7ffce2aSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1067d7ffce2aSmrgdnl other dealings in this Software without prior written authorization
1068d7ffce2aSmrgdnl from the copyright holders.
1069d7ffce2aSmrg
1070d7ffce2aSmrg# XORG_FONT_MACROS_VERSION(required-version)
1071d7ffce2aSmrg# ------------------------------------------
1072d7ffce2aSmrg# Minimum version: 1.1.0
1073d7ffce2aSmrg#
1074d7ffce2aSmrg# If you're using a macro added in Version 1.1 or newer, include this in
1075d7ffce2aSmrg# your configure.ac with the minimum required version, such as:
1076d7ffce2aSmrg# XORG_FONT_MACROS_VERSION(1.1)
1077d7ffce2aSmrg#
1078d7ffce2aSmrg# To ensure that this macro is defined, also add:
1079d7ffce2aSmrg# m4_ifndef([XORG_FONT_MACROS_VERSION],
1080d7ffce2aSmrg#     [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
1081d7ffce2aSmrg#
1082d7ffce2aSmrg#
1083d7ffce2aSmrg# See the "minimum version" comment for each macro you use to see what
1084d7ffce2aSmrg# version you require.
1085d7ffce2aSmrgm4_defun([XORG_FONT_MACROS_VERSION],[
1086d7ffce2aSmrgm4_define([vers_have], [1.2.0])
1087d7ffce2aSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1088d7ffce2aSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1089d7ffce2aSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1090d7ffce2aSmrg    [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])])
1091d7ffce2aSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1092d7ffce2aSmrg    [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])])
1093d7ffce2aSmrgm4_undefine([vers_have])
1094d7ffce2aSmrgm4_undefine([maj_have])
1095d7ffce2aSmrgm4_undefine([maj_needed])
1096d7ffce2aSmrg]) # XORG_FONT_MACROS_VERSION
1097d7ffce2aSmrg
1098d7ffce2aSmrg# XORG_FONT_CHECK_{maps}()
1099d7ffce2aSmrg# ------------------------
1100d7ffce2aSmrg# Minimum version: 1.0.0
1101d7ffce2aSmrg# These macros add --enable/disable-{maps} where {maps} are ISO8859-*,
1102d7ffce2aSmrg# JISX0201 or KOI8_R.  By default, they are all enabled.
1103d7ffce2aSmrg
1104d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)])
1105d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)])
1106d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)])
1107d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)])
1108d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)])
1109d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)])
1110d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)])
1111d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)])
1112d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)])
1113d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)])
1114d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)])
1115d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)])
1116d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)])
1117d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)])
1118d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)])
1119d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)])
1120d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_JISX0201],  [XORG_FONT_CHECK_ENCODING(JISX0201)])
1121d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_KOI8_R],    [XORG_FONT_CHECK_ENCODING(KOI8-R)])
1122d7ffce2aSmrg
1123d7ffce2aSmrg# XORG_FONT_CHECK_ENCODING(encoding)
1124d7ffce2aSmrg# ----------------------------------
1125d7ffce2aSmrg# Minimum version: 1.1.0
1126d7ffce2aSmrg# This macro adds --enable/disable-<encoding>, enabled by default.
1127d7ffce2aSmrg# It replaced individual copies of this code in the above macros in 1.1.
1128d7ffce2aSmrg# Currently assumes encoding names will be all upper-case - add m4_toupper
1129d7ffce2aSmrg# calls if this is not true in the future.
1130d7ffce2aSmrg
1131d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING],[
1132d7ffce2aSmrg	AC_ARG_ENABLE(m4_tolower($1),
1133d7ffce2aSmrg		AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)),
1134d7ffce2aSmrg				[Build $1 fonts (default: yes)]),
1135d7ffce2aSmrg		[AS_TR_SH($1)=$enableval])
1136d7ffce2aSmrg	AC_MSG_CHECKING([whether to build $1 fonts])
1137d7ffce2aSmrg	AC_MSG_RESULT($[AS_TR_SH($1)])
1138d7ffce2aSmrg	AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes])
1139d7ffce2aSmrg]) # XORG_FONT_CHECK_ENCODING
1140d7ffce2aSmrg
1141d7ffce2aSmrg# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....)
1142d7ffce2aSmrg# -----------------------------------------------------
1143d7ffce2aSmrg# Minimum version: 1.1.0
1144d7ffce2aSmrg# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once.
1145d7ffce2aSmrg# Add a shorthand --enable/disable-all-encodings option.
1146d7ffce2aSmrg
1147d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[
1148d7ffce2aSmrg	AC_ARG_ENABLE([all-encodings],
1149d7ffce2aSmrg		AS_HELP_STRING([--disable-all-encodings],
1150d7ffce2aSmrg				[Disable building of all font encodings]),
1151d7ffce2aSmrg		[m4_foreach_w([enc], [$1], [
1152d7ffce2aSmrg			AS_TR_SH(enc)=$enableval
1153d7ffce2aSmrg		])],
1154d7ffce2aSmrg		[m4_foreach_w([enc], [$1], [
1155d7ffce2aSmrg			AS_TR_SH(enc)=yes
1156d7ffce2aSmrg		])])
1157d7ffce2aSmrg	m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)])
1158d7ffce2aSmrg]) # XORG_FONT_CHECK_ENCODING_LIST
1159d7ffce2aSmrg
1160d7ffce2aSmrg# XORG_FONT_REQUIRED_PROG(VARNAME, progname)
1161d7ffce2aSmrg# ------------------------------------------
1162d7ffce2aSmrg# Minimum version: 1.1.0
1163d7ffce2aSmrg#
1164d7ffce2aSmrg# Simple wrapper around AC_PATH_PROG that errors if not found
1165d7ffce2aSmrg#
1166d7ffce2aSmrg
1167d7ffce2aSmrgAC_DEFUN([XORG_FONT_REQUIRED_PROG],[
1168d7ffce2aSmrg	AC_PATH_PROG($1, $2)
1169d7ffce2aSmrg	if test x"$$1" = x; then
1170d7ffce2aSmrg		AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.])
1171d7ffce2aSmrg	fi
1172d7ffce2aSmrg])
1173d7ffce2aSmrg
1174d7ffce2aSmrg
1175d7ffce2aSmrg# XORG_FONT_FCCACHE()
1176d7ffce2aSmrg# -------------------
1177d7ffce2aSmrg# Minimum version: 1.1.0
1178d7ffce2aSmrg#
1179d7ffce2aSmrg# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found
1180d7ffce2aSmrg# Set RUN_FCCACHE to a rule suitable for substituting into a makefile
1181d7ffce2aSmrg# to run fc-cache if found and not installing to $DESTDIR
1182d7ffce2aSmrg#
1183d7ffce2aSmrg# fc-cache is optional, not required, and should be skipped when making
1184d7ffce2aSmrg# packages (installing to $DESTDIR).
1185d7ffce2aSmrg#
1186d7ffce2aSmrgAC_DEFUN([XORG_FONT_FCCACHE],[
1187d7ffce2aSmrg	AC_PATH_PROG(FCCACHE, fc-cache)
1188d7ffce2aSmrg	FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"'
1189d7ffce2aSmrg	if test x"$FCCACHE" = x ; then
1190d7ffce2aSmrg		RUN_FCCACHE="${FCCACHE_WARN}"
1191d7ffce2aSmrg	else
1192d7ffce2aSmrg		RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else'
1193d7ffce2aSmrg		RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)"
1194d7ffce2aSmrg	fi
1195d7ffce2aSmrg	AC_SUBST([RUN_FCCACHE])
1196d7ffce2aSmrg])
1197d7ffce2aSmrg
1198d7ffce2aSmrg
1199d7ffce2aSmrg# XORG_FONT_COMMON_UTILS()
1200d7ffce2aSmrg# ------------------------
1201d7ffce2aSmrg# Minimum version: 1.1.0
1202d7ffce2aSmrg#
1203d7ffce2aSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types
1204d7ffce2aSmrg
1205d7ffce2aSmrgAC_DEFUN([XORG_FONT_COMMON_UTILS],[
1206d7ffce2aSmrg	XORG_FONT_FCCACHE
1207d7ffce2aSmrg	XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir)
1208d7ffce2aSmrg])
1209d7ffce2aSmrg
1210d7ffce2aSmrg# XORG_FONT_SCALED_UTILS()
1211d7ffce2aSmrg# ------------------------
1212d7ffce2aSmrg# Minimum version: 1.1.0
1213d7ffce2aSmrg#
1214d7ffce2aSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts
1215d7ffce2aSmrg# (TrueType, OpenType, Type1)
1216d7ffce2aSmrg
1217d7ffce2aSmrgAC_DEFUN([XORG_FONT_SCALED_UTILS],[
1218d7ffce2aSmrg	XORG_FONT_COMMON_UTILS
1219d7ffce2aSmrg	XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale)
1220d7ffce2aSmrg])
1221d7ffce2aSmrg
1222d7ffce2aSmrg# XORG_FONT_BDF_UTILS()
1223d7ffce2aSmrg# ---------------------
1224d7ffce2aSmrg# Minimum version: 1.1.0
1225d7ffce2aSmrg#
1226d7ffce2aSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts
1227d7ffce2aSmrg# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the
1228d7ffce2aSmrg# PCF output files created by bdftopcf
1229d7ffce2aSmrg
1230d7ffce2aSmrgAC_DEFUN([XORG_FONT_BDF_UTILS],[
1231d7ffce2aSmrg	XORG_FONT_COMMON_UTILS
1232d7ffce2aSmrg	XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf)
1233d7ffce2aSmrg	XORG_FONT_CHECK_COMPRESSION
1234d7ffce2aSmrg])
1235d7ffce2aSmrg
1236d7ffce2aSmrg# XORG_FONT_CHECK_COMPRESSION()
1237d7ffce2aSmrg# -----------------------------
1238d7ffce2aSmrg# Minimum version: 1.1.0
1239d7ffce2aSmrg#
1240d7ffce2aSmrg# Offer a --with-compression flag to control what compression method is
1241d7ffce2aSmrg# used for pcf font files.   Offers all the methods currently supported
1242d7ffce2aSmrg# by libXfont, including no compression.
1243d7ffce2aSmrg
1244d7ffce2aSmrgAC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[
1245d7ffce2aSmrg	AC_MSG_CHECKING([font compression method])
1246d7ffce2aSmrg	AC_ARG_WITH(compression,
1247d7ffce2aSmrg	 [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>],
1248d7ffce2aSmrg			 [compression method to use on pcf fonts])],
1249d7ffce2aSmrg         [compression="$withval"], [compression="yes"])
1250d7ffce2aSmrg	if test x"$compression" = "xyes" ; then
1251d7ffce2aSmrg		compression="gzip"
1252d7ffce2aSmrg	fi
1253d7ffce2aSmrg	AC_MSG_RESULT([${compression}])
1254d7ffce2aSmrg	case ${compression} in
1255d7ffce2aSmrg	 *compress)	COMPRESS_SUFFIX=".Z" ;;
1256d7ffce2aSmrg	 *gzip)		COMPRESS_SUFFIX=".gz" ;;
1257d7ffce2aSmrg	 *bzip2)	COMPRESS_SUFFIX=".bz2" ;;
1258d7ffce2aSmrg	 no|none)	COMPRESS_SUFFIX="" ; COMPRESS="cat" ;;
1259d7ffce2aSmrg	 *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;;
1260d7ffce2aSmrg	esac
1261d7ffce2aSmrg	if test x"$COMPRESS_SUFFIX" != "x" ; then
1262d7ffce2aSmrg	   XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression})
1263d7ffce2aSmrg	fi
1264d7ffce2aSmrg	AC_SUBST([COMPRESS_SUFFIX])
1265d7ffce2aSmrg])
1266d7ffce2aSmrg
1267d7ffce2aSmrg# XORG_FONT_UCS2ANY()
1268d7ffce2aSmrg# -------------------
1269d7ffce2aSmrg# Minimum version: 1.1.0
1270d7ffce2aSmrg#
1271d7ffce2aSmrg# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting
1272d7ffce2aSmrg# Unicode-encoded BDF format bitmap fonts into subsets for older encodings.
1273d7ffce2aSmrg# Also call pkg-config to find the directory with the encoding files needed
1274d7ffce2aSmrg# by ucs2any, and export it as MAPFILES_PATH to the Makefiles
1275d7ffce2aSmrg
1276d7ffce2aSmrgAC_DEFUN([XORG_FONT_UCS2ANY],[
1277d7ffce2aSmrg	XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
1278d7ffce2aSmrg	PKG_CHECK_MODULES(MAPS, [fontutil])
1279d7ffce2aSmrg	AC_MSG_CHECKING([for ucs2any encoding data files])
1280d7ffce2aSmrg	MAPFILES_PATH=`pkg-config --variable=mapdir fontutil`
1281d7ffce2aSmrg	AC_SUBST(MAPFILES_PATH)
1282d7ffce2aSmrg	AC_MSG_RESULT([${MAPFILES_PATH}])
1283d7ffce2aSmrg])
1284d7ffce2aSmrg
1285d7ffce2aSmrg
1286d7ffce2aSmrg
1287d7ffce2aSmrg# XORG_FONT_FC_CONFDIR()
1288d7ffce2aSmrg# --------------------
1289d7ffce2aSmrg# Minimum version: 1.2.0
1290d7ffce2aSmrg#
1291d7ffce2aSmrg# Sets FC_CONFDIR to the fontconfig config directory
1292d7ffce2aSmrg# (which should be --with-confdir=... when building fontconfig)
1293d7ffce2aSmrg# found from:
1294d7ffce2aSmrg#	--with-fc-confdir=...
1295d7ffce2aSmrg#	pkg-config --variable=confdir fontconfig
1296d7ffce2aSmrg#	${sysconfdir}/fonts
1297d7ffce2aSmrg
1298d7ffce2aSmrgAC_DEFUN([XORG_FONT_FC_CONFDIR],[
1299d7ffce2aSmrg	dnl Ensure $PKG_CONFIG is set first
1300d7ffce2aSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1301d7ffce2aSmrg
1302d7ffce2aSmrg	AC_MSG_CHECKING([for fontconfig's configuration directory])
1303d7ffce2aSmrg	AC_ARG_WITH(fc-confdir,
1304d7ffce2aSmrg		    AS_HELP_STRING([--with-fc-confdir=DIR],
1305d7ffce2aSmrg			   [Path to fontconfig's configuration directory]),
1306d7ffce2aSmrg		    [FC_CONFDIR="$withval"])
1307d7ffce2aSmrg	# if --with-fc-confdir was not specified
1308d7ffce2aSmrg	if test "x${FC_CONFDIR}" = "x"; then
1309d7ffce2aSmrg		FC_CONFDIR=`$PKG_CONFIG --variable=confdir fontconfig`
1310d7ffce2aSmrg	fi
1311d7ffce2aSmrg	# ...and if pkg-config didn't find confdir in fontconfig.pc...
1312d7ffce2aSmrg	if test "x${FC_CONFDIR}" = "x"; then
1313d7ffce2aSmrg		FC_CONFDIR="${sysconfdir}/fonts"
1314d7ffce2aSmrg	fi
1315d7ffce2aSmrg	AC_SUBST(FC_CONFDIR)
1316d7ffce2aSmrg	AC_MSG_RESULT([${FC_CONFDIR}])
1317d7ffce2aSmrg])
1318d7ffce2aSmrg
1319d7ffce2aSmrg
1320d7ffce2aSmrg
1321d7ffce2aSmrg# XORG_FONTROOTDIR()
1322d7ffce2aSmrg# --------------------
1323d7ffce2aSmrg# Minimum version: 1.1.0
1324d7ffce2aSmrg#
1325d7ffce2aSmrg# Sets FONTROOTDIR to the root directory for font files.  Uses the first
1326d7ffce2aSmrg# found from:
1327d7ffce2aSmrg#	--with-fontrootdir
1328d7ffce2aSmrg#	pkg-config --variable=fontrootdir fontutil
1329d7ffce2aSmrg#	${datadir}/fonts/X11
1330d7ffce2aSmrg
1331d7ffce2aSmrgAC_DEFUN([XORG_FONTROOTDIR],[
1332d7ffce2aSmrg	dnl Ensure $PKG_CONFIG is set first
1333d7ffce2aSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1334d7ffce2aSmrg
1335d7ffce2aSmrg	AC_MSG_CHECKING([for root directory for font files])
1336d7ffce2aSmrg	AC_ARG_WITH(fontrootdir,
1337d7ffce2aSmrg		    AS_HELP_STRING([--with-fontrootdir=DIR],
1338d7ffce2aSmrg			   [Path to root directory for font files]),
1339d7ffce2aSmrg		    [FONTROOTDIR="$withval"])
1340d7ffce2aSmrg	# if --with-fontrootdir not specified...
1341d7ffce2aSmrg	if test "x${FONTROOTDIR}" = "x"; then
1342d7ffce2aSmrg		FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
1343d7ffce2aSmrg	fi
1344d7ffce2aSmrg	# ...and if pkg-config didn't find fontdir in fontutil.pc...
1345d7ffce2aSmrg	if test "x${FONTROOTDIR}" = "x"; then
1346d7ffce2aSmrg		FONTROOTDIR="${datadir}/fonts/X11"
1347d7ffce2aSmrg	fi
1348d7ffce2aSmrg	AC_SUBST(FONTROOTDIR)
1349d7ffce2aSmrg	AC_MSG_RESULT([${FONTROOTDIR}])
1350d7ffce2aSmrg])
1351d7ffce2aSmrg
1352d7ffce2aSmrg# XORG_FONTSUBDIR(variable, flag, subdir)
1353d7ffce2aSmrg# ---------------------------------------
1354d7ffce2aSmrg# Minimum version: 1.1.0
1355d7ffce2aSmrg#
1356d7ffce2aSmrg# Offer a --with-<flag> flag to control directory for font installation
1357d7ffce2aSmrg# Default is the specified <subdir> of the font root directory.
1358d7ffce2aSmrg# Sets <variable> to the selected directory
1359d7ffce2aSmrg
1360d7ffce2aSmrgAC_DEFUN([XORG_FONTSUBDIR],[
1361d7ffce2aSmrg	AC_REQUIRE([XORG_FONTROOTDIR])
1362d7ffce2aSmrg
1363d7ffce2aSmrg	AC_MSG_CHECKING([for directory for $3 files])
1364d7ffce2aSmrg	AC_ARG_WITH($2,
1365d7ffce2aSmrg		    [AS_HELP_STRING([--with-$2=DIR],
1366d7ffce2aSmrg				    [Path to $3 files [FONTROOTDIR/$3]])],
1367d7ffce2aSmrg		    [$1="${withval}"], [$1='${FONTROOTDIR}/$3'])
1368d7ffce2aSmrg	AC_SUBST($1)
1369d7ffce2aSmrg	AC_MSG_RESULT([${$1}])
1370d7ffce2aSmrg]) # XORG_FONTSUBDIR
1371d7ffce2aSmrg
1372d7ffce2aSmrg# XORG_FONTDIR(subdir)
1373d7ffce2aSmrg# --------------------
1374d7ffce2aSmrg# Minimum version: 1.1.0
1375d7ffce2aSmrg#
1376d7ffce2aSmrg# Offer a --with-fontdir flag to control directory for font installation
1377d7ffce2aSmrg# Default is the specified subdir of the font root directory.
1378d7ffce2aSmrg# Sets FONTDIR to the selected directory
1379d7ffce2aSmrg
1380d7ffce2aSmrgAC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])])
1381d7ffce2aSmrg
1382d7ffce2aSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
13834c61c93dSmrgdnl
1384d7ffce2aSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1385d7ffce2aSmrgdnl 
1386d7ffce2aSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1387d7ffce2aSmrgdnl copy of this software and associated documentation files (the "Software"),
1388d7ffce2aSmrgdnl to deal in the Software without restriction, including without limitation
1389d7ffce2aSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1390d7ffce2aSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
1391d7ffce2aSmrgdnl Software is furnished to do so, subject to the following conditions:
1392d7ffce2aSmrgdnl
1393d7ffce2aSmrgdnl The above copyright notice and this permission notice (including the next
1394d7ffce2aSmrgdnl paragraph) shall be included in all copies or substantial portions of the
1395d7ffce2aSmrgdnl Software.
1396d7ffce2aSmrgdnl
1397d7ffce2aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1398d7ffce2aSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1399d7ffce2aSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1400d7ffce2aSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1401d7ffce2aSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1402d7ffce2aSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1403d7ffce2aSmrgdnl DEALINGS IN THE SOFTWARE.
14044c61c93dSmrg
14054c61c93dSmrg# XORG_MACROS_VERSION(required-version)
14064c61c93dSmrg# -------------------------------------
14074c61c93dSmrg# Minimum version: 1.1.0
14084c61c93dSmrg#
14094c61c93dSmrg# If you're using a macro added in Version 1.1 or newer, include this in
14104c61c93dSmrg# your configure.ac with the minimum required version, such as:
14114c61c93dSmrg# XORG_MACROS_VERSION(1.1)
14124c61c93dSmrg#
14134c61c93dSmrg# To ensure that this macro is defined, also add:
14144c61c93dSmrg# m4_ifndef([XORG_MACROS_VERSION],
14154c61c93dSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
14164c61c93dSmrg#
14174c61c93dSmrg#
14184c61c93dSmrg# See the "minimum version" comment for each macro you use to see what 
14194c61c93dSmrg# version you require.
14204c61c93dSmrgm4_defun([XORG_MACROS_VERSION],[
1421d7ffce2aSmrgm4_define([vers_have], [1.11.0])
14224c61c93dSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
14234c61c93dSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
14244c61c93dSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
14254c61c93dSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
14264c61c93dSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
14274c61c93dSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
14284c61c93dSmrgm4_undefine([vers_have])
14294c61c93dSmrgm4_undefine([maj_have])
14304c61c93dSmrgm4_undefine([maj_needed])
14314c61c93dSmrg]) # XORG_MACROS_VERSION
14324c61c93dSmrg
14334c61c93dSmrg# XORG_PROG_RAWCPP()
14344c61c93dSmrg# ------------------
14354c61c93dSmrg# Minimum version: 1.0.0
14364c61c93dSmrg#
14374c61c93dSmrg# Find cpp program and necessary flags for use in pre-processing text files
14384c61c93dSmrg# such as man pages and config files
14394c61c93dSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
14404c61c93dSmrgAC_REQUIRE([AC_PROG_CPP])
14414c61c93dSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
14424c61c93dSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
14434c61c93dSmrg
14444c61c93dSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
14454c61c93dSmrg# which is not the best choice for supporting other OS'es, but covers most
14464c61c93dSmrg# of the ones we need for now.
14474c61c93dSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
14484c61c93dSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
14494c61c93dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
14504c61c93dSmrg	AC_MSG_RESULT([no])
14514c61c93dSmrgelse
14524c61c93dSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
14534c61c93dSmrg		RAWCPPFLAGS=-undef
14544c61c93dSmrg		AC_MSG_RESULT([yes])
14554c61c93dSmrg	# under Cygwin unix is still defined even with -undef
14564c61c93dSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
14574c61c93dSmrg		RAWCPPFLAGS="-undef -ansi"
14584c61c93dSmrg		AC_MSG_RESULT([yes, with -ansi])
14594c61c93dSmrg	else
14604c61c93dSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
14614c61c93dSmrg	fi
14624c61c93dSmrgfi
14634c61c93dSmrgrm -f conftest.$ac_ext
14644c61c93dSmrg
14654c61c93dSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
14664c61c93dSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
14674c61c93dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
14684c61c93dSmrg	AC_MSG_RESULT([no])
14694c61c93dSmrgelse
14704c61c93dSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
14714c61c93dSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
14724c61c93dSmrg		AC_MSG_RESULT([yes])
14734c61c93dSmrg	else
14744c61c93dSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
14754c61c93dSmrg	fi
14764c61c93dSmrgfi
14774c61c93dSmrgrm -f conftest.$ac_ext
14784c61c93dSmrgAC_SUBST(RAWCPPFLAGS)
14794c61c93dSmrg]) # XORG_PROG_RAWCPP
14804c61c93dSmrg
14814c61c93dSmrg# XORG_MANPAGE_SECTIONS()
14824c61c93dSmrg# -----------------------
14834c61c93dSmrg# Minimum version: 1.0.0
14844c61c93dSmrg#
14854c61c93dSmrg# Determine which sections man pages go in for the different man page types
14864c61c93dSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
14874c61c93dSmrg# Not sure if there's any better way than just hardcoding by OS name.
14884c61c93dSmrg# Override default settings by setting environment variables
1489d7ffce2aSmrg# Added MAN_SUBSTS in version 1.8
1490d7ffce2aSmrg# Added AC_PROG_SED in version 1.8
14914c61c93dSmrg
14924c61c93dSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
14934c61c93dSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1494d7ffce2aSmrgAC_REQUIRE([AC_PROG_SED])
14954c61c93dSmrg
14964c61c93dSmrgif test x$APP_MAN_SUFFIX = x    ; then
14974c61c93dSmrg    APP_MAN_SUFFIX=1
14984c61c93dSmrgfi
14994c61c93dSmrgif test x$APP_MAN_DIR = x    ; then
15004c61c93dSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
15014c61c93dSmrgfi
15024c61c93dSmrg
15034c61c93dSmrgif test x$LIB_MAN_SUFFIX = x    ; then
15044c61c93dSmrg    LIB_MAN_SUFFIX=3
15054c61c93dSmrgfi
15064c61c93dSmrgif test x$LIB_MAN_DIR = x    ; then
15074c61c93dSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
15084c61c93dSmrgfi
15094c61c93dSmrg
15104c61c93dSmrgif test x$FILE_MAN_SUFFIX = x    ; then
15114c61c93dSmrg    case $host_os in
15124c61c93dSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
15134c61c93dSmrg	*)		FILE_MAN_SUFFIX=5  ;;
15144c61c93dSmrg    esac
15154c61c93dSmrgfi
15164c61c93dSmrgif test x$FILE_MAN_DIR = x    ; then
15174c61c93dSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
15184c61c93dSmrgfi
15194c61c93dSmrg
15204c61c93dSmrgif test x$MISC_MAN_SUFFIX = x    ; then
15214c61c93dSmrg    case $host_os in
15224c61c93dSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
15234c61c93dSmrg	*)		MISC_MAN_SUFFIX=7  ;;
15244c61c93dSmrg    esac
15254c61c93dSmrgfi
15264c61c93dSmrgif test x$MISC_MAN_DIR = x    ; then
15274c61c93dSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
15284c61c93dSmrgfi
15294c61c93dSmrg
15304c61c93dSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
15314c61c93dSmrg    case $host_os in
15324c61c93dSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
15334c61c93dSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
15344c61c93dSmrg    esac
15354c61c93dSmrgfi
15364c61c93dSmrgif test x$DRIVER_MAN_DIR = x    ; then
15374c61c93dSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
15384c61c93dSmrgfi
15394c61c93dSmrg
15404c61c93dSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
15414c61c93dSmrg    case $host_os in
15424c61c93dSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
15434c61c93dSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
15444c61c93dSmrg    esac
15454c61c93dSmrgfi
15464c61c93dSmrgif test x$ADMIN_MAN_DIR = x    ; then
15474c61c93dSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
15484c61c93dSmrgfi
15494c61c93dSmrg
15504c61c93dSmrg
15514c61c93dSmrgAC_SUBST([APP_MAN_SUFFIX])
15524c61c93dSmrgAC_SUBST([LIB_MAN_SUFFIX])
15534c61c93dSmrgAC_SUBST([FILE_MAN_SUFFIX])
15544c61c93dSmrgAC_SUBST([MISC_MAN_SUFFIX])
15554c61c93dSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
15564c61c93dSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
15574c61c93dSmrgAC_SUBST([APP_MAN_DIR])
15584c61c93dSmrgAC_SUBST([LIB_MAN_DIR])
15594c61c93dSmrgAC_SUBST([FILE_MAN_DIR])
15604c61c93dSmrgAC_SUBST([MISC_MAN_DIR])
15614c61c93dSmrgAC_SUBST([DRIVER_MAN_DIR])
15624c61c93dSmrgAC_SUBST([ADMIN_MAN_DIR])
1563d7ffce2aSmrg
1564d7ffce2aSmrgXORG_MAN_PAGE="X Version 11"
1565d7ffce2aSmrgAC_SUBST([XORG_MAN_PAGE])
1566d7ffce2aSmrgMAN_SUBSTS="\
1567d7ffce2aSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1568d7ffce2aSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1569d7ffce2aSmrg	-e 's|__xservername__|Xorg|g' \
1570d7ffce2aSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
1571d7ffce2aSmrg	-e 's|__projectroot__|\$(prefix)|g' \
1572d7ffce2aSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1573d7ffce2aSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1574d7ffce2aSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1575d7ffce2aSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1576d7ffce2aSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1577d7ffce2aSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1578d7ffce2aSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1579d7ffce2aSmrgAC_SUBST([MAN_SUBSTS])
1580d7ffce2aSmrg
15814c61c93dSmrg]) # XORG_MANPAGE_SECTIONS
15824c61c93dSmrg
1583d7ffce2aSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1584d7ffce2aSmrg# ------------------------
1585d7ffce2aSmrg# Minimum version: 1.7.0
1586d7ffce2aSmrg#
1587d7ffce2aSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1588d7ffce2aSmrg# provided by xorg-sgml-doctools, if installed.
1589d7ffce2aSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1590d7ffce2aSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1591d7ffce2aSmrgXORG_SGML_PATH=
1592d7ffce2aSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1593d7ffce2aSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1594d7ffce2aSmrg    [m4_ifval([$1],[:],
1595d7ffce2aSmrg        [if test x"$cross_compiling" != x"yes" ; then
1596d7ffce2aSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1597d7ffce2aSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1598d7ffce2aSmrg         fi])
1599d7ffce2aSmrg    ])
1600d7ffce2aSmrg
1601d7ffce2aSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1602d7ffce2aSmrg# the path and the name of the doc stylesheet
1603d7ffce2aSmrgif test "x$XORG_SGML_PATH" != "x" ; then
1604d7ffce2aSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1605d7ffce2aSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1606d7ffce2aSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1607d7ffce2aSmrgelse
1608d7ffce2aSmrg   AC_MSG_RESULT([no])
1609d7ffce2aSmrgfi
1610d7ffce2aSmrg
1611d7ffce2aSmrgAC_SUBST(XORG_SGML_PATH)
1612d7ffce2aSmrgAC_SUBST(STYLESHEET_SRCDIR)
1613d7ffce2aSmrgAC_SUBST(XSL_STYLESHEET)
1614d7ffce2aSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1615d7ffce2aSmrg]) # XORG_CHECK_SGML_DOCTOOLS
1616d7ffce2aSmrg
16174c61c93dSmrg# XORG_CHECK_LINUXDOC
16184c61c93dSmrg# -------------------
16194c61c93dSmrg# Minimum version: 1.0.0
16204c61c93dSmrg#
16214c61c93dSmrg# Defines the variable MAKE_TEXT if the necessary tools and
16224c61c93dSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
16234c61c93dSmrg# Whether or not the necessary tools and files are found can be checked
16244c61c93dSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
16254c61c93dSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1626d7ffce2aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1627d7ffce2aSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
16284c61c93dSmrg
16294c61c93dSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
16304c61c93dSmrg
1631d7ffce2aSmrgAC_MSG_CHECKING([whether to build documentation])
16324c61c93dSmrg
1633d7ffce2aSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
16344c61c93dSmrg   BUILDDOC=yes
16354c61c93dSmrgelse
16364c61c93dSmrg   BUILDDOC=no
16374c61c93dSmrgfi
16384c61c93dSmrg
16394c61c93dSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
16404c61c93dSmrg
16414c61c93dSmrgAC_MSG_RESULT([$BUILDDOC])
16424c61c93dSmrg
1643d7ffce2aSmrgAC_MSG_CHECKING([whether to build pdf documentation])
16444c61c93dSmrg
1645d7ffce2aSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
16464c61c93dSmrg   BUILDPDFDOC=yes
16474c61c93dSmrgelse
16484c61c93dSmrg   BUILDPDFDOC=no
16494c61c93dSmrgfi
16504c61c93dSmrg
16514c61c93dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
16524c61c93dSmrg
16534c61c93dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
16544c61c93dSmrg
1655d7ffce2aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
16564c61c93dSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
16574c61c93dSmrgMAKE_PDF="$PS2PDF"
16584c61c93dSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
16594c61c93dSmrg
16604c61c93dSmrgAC_SUBST(MAKE_TEXT)
16614c61c93dSmrgAC_SUBST(MAKE_PS)
16624c61c93dSmrgAC_SUBST(MAKE_PDF)
16634c61c93dSmrgAC_SUBST(MAKE_HTML)
16644c61c93dSmrg]) # XORG_CHECK_LINUXDOC
16654c61c93dSmrg
16664c61c93dSmrg# XORG_CHECK_DOCBOOK
16674c61c93dSmrg# -------------------
16684c61c93dSmrg# Minimum version: 1.0.0
16694c61c93dSmrg#
16704c61c93dSmrg# Checks for the ability to build output formats from SGML DocBook source.
16714c61c93dSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
16724c61c93dSmrg# indicates whether the necessary tools and files are found and, if set,
16734c61c93dSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
16744c61c93dSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1675d7ffce2aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1676d7ffce2aSmrg
16774c61c93dSmrgBUILDTXTDOC=no
16784c61c93dSmrgBUILDPDFDOC=no
16794c61c93dSmrgBUILDPSDOC=no
16804c61c93dSmrgBUILDHTMLDOC=no
16814c61c93dSmrg
16824c61c93dSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
16834c61c93dSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
16844c61c93dSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
16854c61c93dSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
16864c61c93dSmrg
1687d7ffce2aSmrgAC_MSG_CHECKING([whether to build text documentation])
1688d7ffce2aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
16894c61c93dSmrg   test x$BUILD_TXTDOC != xno; then
16904c61c93dSmrg	BUILDTXTDOC=yes
16914c61c93dSmrgfi
16924c61c93dSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
16934c61c93dSmrgAC_MSG_RESULT([$BUILDTXTDOC])
16944c61c93dSmrg
1695d7ffce2aSmrgAC_MSG_CHECKING([whether to build PDF documentation])
1696d7ffce2aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
16974c61c93dSmrg   test x$BUILD_PDFDOC != xno; then
16984c61c93dSmrg	BUILDPDFDOC=yes
16994c61c93dSmrgfi
17004c61c93dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
17014c61c93dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
17024c61c93dSmrg
1703d7ffce2aSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1704d7ffce2aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
17054c61c93dSmrg   test x$BUILD_PSDOC != xno; then
17064c61c93dSmrg	BUILDPSDOC=yes
17074c61c93dSmrgfi
17084c61c93dSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
17094c61c93dSmrgAC_MSG_RESULT([$BUILDPSDOC])
17104c61c93dSmrg
1711d7ffce2aSmrgAC_MSG_CHECKING([whether to build HTML documentation])
1712d7ffce2aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
17134c61c93dSmrg   test x$BUILD_HTMLDOC != xno; then
17144c61c93dSmrg	BUILDHTMLDOC=yes
17154c61c93dSmrgfi
17164c61c93dSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
17174c61c93dSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
17184c61c93dSmrg
17194c61c93dSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
17204c61c93dSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
17214c61c93dSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
17224c61c93dSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
17234c61c93dSmrg
17244c61c93dSmrgAC_SUBST(MAKE_TEXT)
17254c61c93dSmrgAC_SUBST(MAKE_PS)
17264c61c93dSmrgAC_SUBST(MAKE_PDF)
17274c61c93dSmrgAC_SUBST(MAKE_HTML)
17284c61c93dSmrg]) # XORG_CHECK_DOCBOOK
17294c61c93dSmrg
1730d7ffce2aSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1731d7ffce2aSmrg# ----------------
1732d7ffce2aSmrg# Minimum version: 1.5.0
1733d7ffce2aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1734d7ffce2aSmrg#
1735d7ffce2aSmrg# Documentation tools are not always available on all platforms and sometimes
1736d7ffce2aSmrg# not at the appropriate level. This macro enables a module to test for the
1737d7ffce2aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1738d7ffce2aSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1739d7ffce2aSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1740d7ffce2aSmrg# --with-xmlto assumes 'auto'.
1741d7ffce2aSmrg#
1742d7ffce2aSmrg# Interface to module:
1743d7ffce2aSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1744d7ffce2aSmrg# XMLTO:	returns the path of the xmlto program found
1745d7ffce2aSmrg#		returns the path set by the user in the environment
1746d7ffce2aSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1747d7ffce2aSmrg#		'no' user instructs the module not to use xmlto
1748d7ffce2aSmrg#
1749d7ffce2aSmrg# Added in version 1.10.0
1750d7ffce2aSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1751d7ffce2aSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1752d7ffce2aSmrg#
1753d7ffce2aSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1754d7ffce2aSmrg#
1755d7ffce2aSmrgAC_DEFUN([XORG_WITH_XMLTO],[
1756d7ffce2aSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1757d7ffce2aSmrgm4_define([_defopt], m4_default([$2], [auto]))
1758d7ffce2aSmrgAC_ARG_WITH(xmlto,
1759d7ffce2aSmrg	AS_HELP_STRING([--with-xmlto],
1760d7ffce2aSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1761d7ffce2aSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1762d7ffce2aSmrgm4_undefine([_defopt])
1763d7ffce2aSmrg
1764d7ffce2aSmrgif test "x$use_xmlto" = x"auto"; then
1765d7ffce2aSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1766d7ffce2aSmrg   if test "x$XMLTO" = "x"; then
1767d7ffce2aSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1768d7ffce2aSmrg	have_xmlto=no
1769d7ffce2aSmrg   else
1770d7ffce2aSmrg        have_xmlto=yes
1771d7ffce2aSmrg   fi
1772d7ffce2aSmrgelif test "x$use_xmlto" = x"yes" ; then
1773d7ffce2aSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1774d7ffce2aSmrg   if test "x$XMLTO" = "x"; then
1775d7ffce2aSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1776d7ffce2aSmrg   fi
1777d7ffce2aSmrg   have_xmlto=yes
1778d7ffce2aSmrgelif test "x$use_xmlto" = x"no" ; then
1779d7ffce2aSmrg   if test "x$XMLTO" != "x"; then
1780d7ffce2aSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1781d7ffce2aSmrg   fi
1782d7ffce2aSmrg   have_xmlto=no
1783d7ffce2aSmrgelse
1784d7ffce2aSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1785d7ffce2aSmrgfi
1786d7ffce2aSmrg
1787d7ffce2aSmrg# Test for a minimum version of xmlto, if provided.
1788d7ffce2aSmrgm4_ifval([$1],
1789d7ffce2aSmrg[if test "$have_xmlto" = yes; then
1790d7ffce2aSmrg    # scrape the xmlto version
1791d7ffce2aSmrg    AC_MSG_CHECKING([the xmlto version])
1792d7ffce2aSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1793d7ffce2aSmrg    AC_MSG_RESULT([$xmlto_version])
1794d7ffce2aSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1795d7ffce2aSmrg        [if test "x$use_xmlto" = xauto; then
1796d7ffce2aSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1797d7ffce2aSmrg            have_xmlto=no
1798d7ffce2aSmrg        else
1799d7ffce2aSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1800d7ffce2aSmrg        fi])
1801d7ffce2aSmrgfi])
1802d7ffce2aSmrg
1803d7ffce2aSmrg# Test for the ability of xmlto to generate a text target
1804d7ffce2aSmrghave_xmlto_text=no
1805d7ffce2aSmrgcat > conftest.xml << "EOF"
1806d7ffce2aSmrgEOF
1807d7ffce2aSmrgAS_IF([test "$have_xmlto" = yes],
1808d7ffce2aSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1809d7ffce2aSmrg             [have_xmlto_text=yes],
1810d7ffce2aSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1811d7ffce2aSmrgrm -f conftest.xml
1812d7ffce2aSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1813d7ffce2aSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1814d7ffce2aSmrg]) # XORG_WITH_XMLTO
1815d7ffce2aSmrg
1816d7ffce2aSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1817d7ffce2aSmrg# ----------------
1818d7ffce2aSmrg# Minimum version: 1.5.0
1819d7ffce2aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1820d7ffce2aSmrg#
1821d7ffce2aSmrg# Documentation tools are not always available on all platforms and sometimes
1822d7ffce2aSmrg# not at the appropriate level. This macro enables a module to test for the
1823d7ffce2aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1824d7ffce2aSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1825d7ffce2aSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1826d7ffce2aSmrg# --with-asciidoc assumes 'auto'.
1827d7ffce2aSmrg#
1828d7ffce2aSmrg# Interface to module:
1829d7ffce2aSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1830d7ffce2aSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
1831d7ffce2aSmrg#		 returns the path set by the user in the environment
1832d7ffce2aSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1833d7ffce2aSmrg#		  'no' user instructs the module not to use asciidoc
1834d7ffce2aSmrg#
1835d7ffce2aSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1836d7ffce2aSmrg#
1837d7ffce2aSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1838d7ffce2aSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1839d7ffce2aSmrgm4_define([_defopt], m4_default([$2], [auto]))
1840d7ffce2aSmrgAC_ARG_WITH(asciidoc,
1841d7ffce2aSmrg	AS_HELP_STRING([--with-asciidoc],
1842d7ffce2aSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1843d7ffce2aSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1844d7ffce2aSmrgm4_undefine([_defopt])
1845d7ffce2aSmrg
1846d7ffce2aSmrgif test "x$use_asciidoc" = x"auto"; then
1847d7ffce2aSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1848d7ffce2aSmrg   if test "x$ASCIIDOC" = "x"; then
1849d7ffce2aSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1850d7ffce2aSmrg	have_asciidoc=no
1851d7ffce2aSmrg   else
1852d7ffce2aSmrg        have_asciidoc=yes
1853d7ffce2aSmrg   fi
1854d7ffce2aSmrgelif test "x$use_asciidoc" = x"yes" ; then
1855d7ffce2aSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1856d7ffce2aSmrg   if test "x$ASCIIDOC" = "x"; then
1857d7ffce2aSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1858d7ffce2aSmrg   fi
1859d7ffce2aSmrg   have_asciidoc=yes
1860d7ffce2aSmrgelif test "x$use_asciidoc" = x"no" ; then
1861d7ffce2aSmrg   if test "x$ASCIIDOC" != "x"; then
1862d7ffce2aSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1863d7ffce2aSmrg   fi
1864d7ffce2aSmrg   have_asciidoc=no
1865d7ffce2aSmrgelse
1866d7ffce2aSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1867d7ffce2aSmrgfi
1868d7ffce2aSmrgm4_ifval([$1],
1869d7ffce2aSmrg[if test "$have_asciidoc" = yes; then
1870d7ffce2aSmrg    # scrape the asciidoc version
1871d7ffce2aSmrg    AC_MSG_CHECKING([the asciidoc version])
1872d7ffce2aSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1873d7ffce2aSmrg    AC_MSG_RESULT([$asciidoc_version])
1874d7ffce2aSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1875d7ffce2aSmrg        [if test "x$use_asciidoc" = xauto; then
1876d7ffce2aSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1877d7ffce2aSmrg            have_asciidoc=no
1878d7ffce2aSmrg        else
1879d7ffce2aSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1880d7ffce2aSmrg        fi])
1881d7ffce2aSmrgfi])
1882d7ffce2aSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1883d7ffce2aSmrg]) # XORG_WITH_ASCIIDOC
1884d7ffce2aSmrg
1885d7ffce2aSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1886d7ffce2aSmrg# --------------------------------
1887d7ffce2aSmrg# Minimum version: 1.5.0
1888d7ffce2aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1889d7ffce2aSmrg#
1890d7ffce2aSmrg# Documentation tools are not always available on all platforms and sometimes
1891d7ffce2aSmrg# not at the appropriate level. This macro enables a module to test for the
1892d7ffce2aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1893d7ffce2aSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1894d7ffce2aSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1895d7ffce2aSmrg# --with-doxygen assumes 'auto'.
1896d7ffce2aSmrg#
1897d7ffce2aSmrg# Interface to module:
1898d7ffce2aSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1899d7ffce2aSmrg# DOXYGEN:	 returns the path of the doxygen program found
1900d7ffce2aSmrg#		 returns the path set by the user in the environment
1901d7ffce2aSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1902d7ffce2aSmrg#		  'no' user instructs the module not to use doxygen
1903d7ffce2aSmrg#
1904d7ffce2aSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1905d7ffce2aSmrg#
1906d7ffce2aSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1907d7ffce2aSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1908d7ffce2aSmrgm4_define([_defopt], m4_default([$2], [auto]))
1909d7ffce2aSmrgAC_ARG_WITH(doxygen,
1910d7ffce2aSmrg	AS_HELP_STRING([--with-doxygen],
1911d7ffce2aSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1912d7ffce2aSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1913d7ffce2aSmrgm4_undefine([_defopt])
1914d7ffce2aSmrg
1915d7ffce2aSmrgif test "x$use_doxygen" = x"auto"; then
1916d7ffce2aSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1917d7ffce2aSmrg   if test "x$DOXYGEN" = "x"; then
1918d7ffce2aSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1919d7ffce2aSmrg	have_doxygen=no
1920d7ffce2aSmrg   else
1921d7ffce2aSmrg        have_doxygen=yes
1922d7ffce2aSmrg   fi
1923d7ffce2aSmrgelif test "x$use_doxygen" = x"yes" ; then
1924d7ffce2aSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1925d7ffce2aSmrg   if test "x$DOXYGEN" = "x"; then
1926d7ffce2aSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1927d7ffce2aSmrg   fi
1928d7ffce2aSmrg   have_doxygen=yes
1929d7ffce2aSmrgelif test "x$use_doxygen" = x"no" ; then
1930d7ffce2aSmrg   if test "x$DOXYGEN" != "x"; then
1931d7ffce2aSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1932d7ffce2aSmrg   fi
1933d7ffce2aSmrg   have_doxygen=no
1934d7ffce2aSmrgelse
1935d7ffce2aSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1936d7ffce2aSmrgfi
1937d7ffce2aSmrgm4_ifval([$1],
1938d7ffce2aSmrg[if test "$have_doxygen" = yes; then
1939d7ffce2aSmrg    # scrape the doxygen version
1940d7ffce2aSmrg    AC_MSG_CHECKING([the doxygen version])
1941d7ffce2aSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1942d7ffce2aSmrg    AC_MSG_RESULT([$doxygen_version])
1943d7ffce2aSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1944d7ffce2aSmrg        [if test "x$use_doxygen" = xauto; then
1945d7ffce2aSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1946d7ffce2aSmrg            have_doxygen=no
1947d7ffce2aSmrg        else
1948d7ffce2aSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1949d7ffce2aSmrg        fi])
1950d7ffce2aSmrgfi])
1951d7ffce2aSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1952d7ffce2aSmrg]) # XORG_WITH_DOXYGEN
1953d7ffce2aSmrg
1954d7ffce2aSmrg# XORG_WITH_GROFF([DEFAULT])
1955d7ffce2aSmrg# ----------------
1956d7ffce2aSmrg# Minimum version: 1.6.0
1957d7ffce2aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1958d7ffce2aSmrg#
1959d7ffce2aSmrg# Documentation tools are not always available on all platforms and sometimes
1960d7ffce2aSmrg# not at the appropriate level. This macro enables a module to test for the
1961d7ffce2aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1962d7ffce2aSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
1963d7ffce2aSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
1964d7ffce2aSmrg# --with-groff assumes 'auto'.
1965d7ffce2aSmrg#
1966d7ffce2aSmrg# Interface to module:
1967d7ffce2aSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1968d7ffce2aSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1969d7ffce2aSmrg# HAVE_GROFF_MS: the -ms macros package
1970d7ffce2aSmrg# GROFF:	 returns the path of the groff program found
1971d7ffce2aSmrg#		 returns the path set by the user in the environment
1972d7ffce2aSmrg# --with-groff:	 'yes' user instructs the module to use groff
1973d7ffce2aSmrg#		 'no' user instructs the module not to use groff
1974d7ffce2aSmrg#
1975d7ffce2aSmrg# Added in version 1.9.0:
1976d7ffce2aSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1977d7ffce2aSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1978d7ffce2aSmrg#		   psselect from the psutils package.
1979d7ffce2aSmrg#		   the ghostcript package. Refer to the grohtml man pages
1980d7ffce2aSmrg#
1981d7ffce2aSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1982d7ffce2aSmrg#
1983d7ffce2aSmrg# OS and distros often splits groff in a basic and full package, the former
1984d7ffce2aSmrg# having the groff program and the later having devices, fonts and macros
1985d7ffce2aSmrg# Checking for the groff executable is not enough.
1986d7ffce2aSmrg#
1987d7ffce2aSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
1988d7ffce2aSmrg# unset HAVE_GROFF or GROFF env variables.
1989d7ffce2aSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1990d7ffce2aSmrg#
1991d7ffce2aSmrgAC_DEFUN([XORG_WITH_GROFF],[
1992d7ffce2aSmrgAC_ARG_VAR([GROFF], [Path to groff command])
1993d7ffce2aSmrgm4_define([_defopt], m4_default([$1], [auto]))
1994d7ffce2aSmrgAC_ARG_WITH(groff,
1995d7ffce2aSmrg	AS_HELP_STRING([--with-groff],
1996d7ffce2aSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1997d7ffce2aSmrg	   [use_groff=$withval], [use_groff=]_defopt)
1998d7ffce2aSmrgm4_undefine([_defopt])
1999d7ffce2aSmrg
2000d7ffce2aSmrgif test "x$use_groff" = x"auto"; then
2001d7ffce2aSmrg   AC_PATH_PROG([GROFF], [groff])
2002d7ffce2aSmrg   if test "x$GROFF" = "x"; then
2003d7ffce2aSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
2004d7ffce2aSmrg	have_groff=no
2005d7ffce2aSmrg   else
2006d7ffce2aSmrg        have_groff=yes
2007d7ffce2aSmrg   fi
2008d7ffce2aSmrgelif test "x$use_groff" = x"yes" ; then
2009d7ffce2aSmrg   AC_PATH_PROG([GROFF], [groff])
2010d7ffce2aSmrg   if test "x$GROFF" = "x"; then
2011d7ffce2aSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
2012d7ffce2aSmrg   fi
2013d7ffce2aSmrg   have_groff=yes
2014d7ffce2aSmrgelif test "x$use_groff" = x"no" ; then
2015d7ffce2aSmrg   if test "x$GROFF" != "x"; then
2016d7ffce2aSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
2017d7ffce2aSmrg   fi
2018d7ffce2aSmrg   have_groff=no
2019d7ffce2aSmrgelse
2020d7ffce2aSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
2021d7ffce2aSmrgfi
2022d7ffce2aSmrg
2023d7ffce2aSmrg# We have groff, test for the presence of the macro packages
2024d7ffce2aSmrgif test "x$have_groff" = x"yes"; then
2025d7ffce2aSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
2026d7ffce2aSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
2027d7ffce2aSmrg        groff_ms_works=yes
2028d7ffce2aSmrg    else
2029d7ffce2aSmrg        groff_ms_works=no
2030d7ffce2aSmrg    fi
2031d7ffce2aSmrg    AC_MSG_RESULT([$groff_ms_works])
2032d7ffce2aSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
2033d7ffce2aSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
2034d7ffce2aSmrg        groff_mm_works=yes
2035d7ffce2aSmrg    else
2036d7ffce2aSmrg        groff_mm_works=no
2037d7ffce2aSmrg    fi
2038d7ffce2aSmrg    AC_MSG_RESULT([$groff_mm_works])
2039d7ffce2aSmrgfi
2040d7ffce2aSmrg
2041d7ffce2aSmrg# We have groff, test for HTML dependencies, one command per package
2042d7ffce2aSmrgif test "x$have_groff" = x"yes"; then
2043d7ffce2aSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
2044d7ffce2aSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
2045d7ffce2aSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
2046d7ffce2aSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
2047d7ffce2aSmrg      have_groff_html=yes
2048d7ffce2aSmrg   else
2049d7ffce2aSmrg      have_groff_html=no
2050d7ffce2aSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
2051d7ffce2aSmrg   fi
2052d7ffce2aSmrgfi
2053d7ffce2aSmrg
2054d7ffce2aSmrg# Set Automake conditionals for Makefiles
2055d7ffce2aSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
2056d7ffce2aSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
2057d7ffce2aSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
2058d7ffce2aSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
2059d7ffce2aSmrg]) # XORG_WITH_GROFF
2060d7ffce2aSmrg
2061d7ffce2aSmrg# XORG_WITH_FOP([DEFAULT])
2062d7ffce2aSmrg# ----------------
2063d7ffce2aSmrg# Minimum version: 1.6.0
2064d7ffce2aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2065d7ffce2aSmrg#
2066d7ffce2aSmrg# Documentation tools are not always available on all platforms and sometimes
2067d7ffce2aSmrg# not at the appropriate level. This macro enables a module to test for the
2068d7ffce2aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
2069d7ffce2aSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
2070d7ffce2aSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
2071d7ffce2aSmrg# --with-fop assumes 'auto'.
2072d7ffce2aSmrg#
2073d7ffce2aSmrg# Interface to module:
2074d7ffce2aSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
2075d7ffce2aSmrg# FOP:	 	returns the path of the fop program found
2076d7ffce2aSmrg#		returns the path set by the user in the environment
2077d7ffce2aSmrg# --with-fop: 	'yes' user instructs the module to use fop
2078d7ffce2aSmrg#		'no' user instructs the module not to use fop
2079d7ffce2aSmrg#
2080d7ffce2aSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
2081d7ffce2aSmrg#
2082d7ffce2aSmrgAC_DEFUN([XORG_WITH_FOP],[
2083d7ffce2aSmrgAC_ARG_VAR([FOP], [Path to fop command])
2084d7ffce2aSmrgm4_define([_defopt], m4_default([$1], [auto]))
2085d7ffce2aSmrgAC_ARG_WITH(fop,
2086d7ffce2aSmrg	AS_HELP_STRING([--with-fop],
2087d7ffce2aSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
2088d7ffce2aSmrg	   [use_fop=$withval], [use_fop=]_defopt)
2089d7ffce2aSmrgm4_undefine([_defopt])
2090d7ffce2aSmrg
2091d7ffce2aSmrgif test "x$use_fop" = x"auto"; then
2092d7ffce2aSmrg   AC_PATH_PROG([FOP], [fop])
2093d7ffce2aSmrg   if test "x$FOP" = "x"; then
2094d7ffce2aSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
2095d7ffce2aSmrg	have_fop=no
2096d7ffce2aSmrg   else
2097d7ffce2aSmrg        have_fop=yes
2098d7ffce2aSmrg   fi
2099d7ffce2aSmrgelif test "x$use_fop" = x"yes" ; then
2100d7ffce2aSmrg   AC_PATH_PROG([FOP], [fop])
2101d7ffce2aSmrg   if test "x$FOP" = "x"; then
2102d7ffce2aSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
2103d7ffce2aSmrg   fi
2104d7ffce2aSmrg   have_fop=yes
2105d7ffce2aSmrgelif test "x$use_fop" = x"no" ; then
2106d7ffce2aSmrg   if test "x$FOP" != "x"; then
2107d7ffce2aSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
2108d7ffce2aSmrg   fi
2109d7ffce2aSmrg   have_fop=no
2110d7ffce2aSmrgelse
2111d7ffce2aSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
2112d7ffce2aSmrgfi
2113d7ffce2aSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
2114d7ffce2aSmrg]) # XORG_WITH_FOP
2115d7ffce2aSmrg
2116d7ffce2aSmrg# XORG_WITH_PS2PDF([DEFAULT])
2117d7ffce2aSmrg# ----------------
2118d7ffce2aSmrg# Minimum version: 1.6.0
2119d7ffce2aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
2120d7ffce2aSmrg#
2121d7ffce2aSmrg# Documentation tools are not always available on all platforms and sometimes
2122d7ffce2aSmrg# not at the appropriate level. This macro enables a module to test for the
2123d7ffce2aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
2124d7ffce2aSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
2125d7ffce2aSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
2126d7ffce2aSmrg# --with-ps2pdf assumes 'auto'.
2127d7ffce2aSmrg#
2128d7ffce2aSmrg# Interface to module:
2129d7ffce2aSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
2130d7ffce2aSmrg# PS2PDF:	returns the path of the ps2pdf program found
2131d7ffce2aSmrg#		returns the path set by the user in the environment
2132d7ffce2aSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
2133d7ffce2aSmrg#		 'no' user instructs the module not to use ps2pdf
2134d7ffce2aSmrg#
2135d7ffce2aSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
2136d7ffce2aSmrg#
2137d7ffce2aSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
2138d7ffce2aSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
2139d7ffce2aSmrgm4_define([_defopt], m4_default([$1], [auto]))
2140d7ffce2aSmrgAC_ARG_WITH(ps2pdf,
2141d7ffce2aSmrg	AS_HELP_STRING([--with-ps2pdf],
2142d7ffce2aSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
2143d7ffce2aSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
2144d7ffce2aSmrgm4_undefine([_defopt])
2145d7ffce2aSmrg
2146d7ffce2aSmrgif test "x$use_ps2pdf" = x"auto"; then
2147d7ffce2aSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
2148d7ffce2aSmrg   if test "x$PS2PDF" = "x"; then
2149d7ffce2aSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
2150d7ffce2aSmrg	have_ps2pdf=no
2151d7ffce2aSmrg   else
2152d7ffce2aSmrg        have_ps2pdf=yes
2153d7ffce2aSmrg   fi
2154d7ffce2aSmrgelif test "x$use_ps2pdf" = x"yes" ; then
2155d7ffce2aSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
2156d7ffce2aSmrg   if test "x$PS2PDF" = "x"; then
2157d7ffce2aSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
2158d7ffce2aSmrg   fi
2159d7ffce2aSmrg   have_ps2pdf=yes
2160d7ffce2aSmrgelif test "x$use_ps2pdf" = x"no" ; then
2161d7ffce2aSmrg   if test "x$PS2PDF" != "x"; then
2162d7ffce2aSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
2163d7ffce2aSmrg   fi
2164d7ffce2aSmrg   have_ps2pdf=no
2165d7ffce2aSmrgelse
2166d7ffce2aSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
2167d7ffce2aSmrgfi
2168d7ffce2aSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
2169d7ffce2aSmrg]) # XORG_WITH_PS2PDF
2170d7ffce2aSmrg
2171d7ffce2aSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
2172d7ffce2aSmrg# ----------------
2173d7ffce2aSmrg# Minimum version: 1.6.0
2174d7ffce2aSmrg#
2175d7ffce2aSmrg# Documentation tools are not always available on all platforms and sometimes
2176d7ffce2aSmrg# not at the appropriate level. This macro enables a builder to skip all
2177d7ffce2aSmrg# documentation targets except traditional man pages.
2178d7ffce2aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2179d7ffce2aSmrg# maximum flexibilty in controlling documentation building.
2180d7ffce2aSmrg# Refer to:
2181d7ffce2aSmrg# XORG_WITH_XMLTO         --with-xmlto
2182d7ffce2aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2183d7ffce2aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
2184d7ffce2aSmrg# XORG_WITH_FOP           --with-fop
2185d7ffce2aSmrg# XORG_WITH_GROFF         --with-groff
2186d7ffce2aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
2187d7ffce2aSmrg#
2188d7ffce2aSmrg# Interface to module:
2189d7ffce2aSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
2190d7ffce2aSmrg# --enable-docs: 'yes' user instructs the module to generate docs
2191d7ffce2aSmrg#		 'no' user instructs the module not to generate docs
2192d7ffce2aSmrg# parm1:	specify the default value, yes or no.
2193d7ffce2aSmrg#
2194d7ffce2aSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
2195d7ffce2aSmrgm4_define([docs_default], m4_default([$1], [yes]))
2196d7ffce2aSmrgAC_ARG_ENABLE(docs,
2197d7ffce2aSmrg	AS_HELP_STRING([--enable-docs],
2198d7ffce2aSmrg	   [Enable building the documentation (default: ]docs_default[)]),
2199d7ffce2aSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
2200d7ffce2aSmrgm4_undefine([docs_default])
2201d7ffce2aSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
2202d7ffce2aSmrgAC_MSG_CHECKING([whether to build documentation])
2203d7ffce2aSmrgAC_MSG_RESULT([$build_docs])
2204d7ffce2aSmrg]) # XORG_ENABLE_DOCS
2205d7ffce2aSmrg
2206d7ffce2aSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
2207d7ffce2aSmrg# ----------------
2208d7ffce2aSmrg# Minimum version: 1.6.0
2209d7ffce2aSmrg#
2210d7ffce2aSmrg# This macro enables a builder to skip all developer documentation.
2211d7ffce2aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2212d7ffce2aSmrg# maximum flexibilty in controlling documentation building.
2213d7ffce2aSmrg# Refer to:
2214d7ffce2aSmrg# XORG_WITH_XMLTO         --with-xmlto
2215d7ffce2aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2216d7ffce2aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
2217d7ffce2aSmrg# XORG_WITH_FOP           --with-fop
2218d7ffce2aSmrg# XORG_WITH_GROFF         --with-groff
2219d7ffce2aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
2220d7ffce2aSmrg#
2221d7ffce2aSmrg# Interface to module:
2222d7ffce2aSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
2223d7ffce2aSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
2224d7ffce2aSmrg#			'no' user instructs the module not to generate developer docs
2225d7ffce2aSmrg# parm1:		specify the default value, yes or no.
2226d7ffce2aSmrg#
2227d7ffce2aSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
2228d7ffce2aSmrgm4_define([devel_default], m4_default([$1], [yes]))
2229d7ffce2aSmrgAC_ARG_ENABLE(devel-docs,
2230d7ffce2aSmrg	AS_HELP_STRING([--enable-devel-docs],
2231d7ffce2aSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
2232d7ffce2aSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
2233d7ffce2aSmrgm4_undefine([devel_default])
2234d7ffce2aSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
2235d7ffce2aSmrgAC_MSG_CHECKING([whether to build developer documentation])
2236d7ffce2aSmrgAC_MSG_RESULT([$build_devel_docs])
2237d7ffce2aSmrg]) # XORG_ENABLE_DEVEL_DOCS
2238d7ffce2aSmrg
2239d7ffce2aSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
2240d7ffce2aSmrg# ----------------
2241d7ffce2aSmrg# Minimum version: 1.6.0
2242d7ffce2aSmrg#
2243d7ffce2aSmrg# This macro enables a builder to skip all functional specification targets.
2244d7ffce2aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
2245d7ffce2aSmrg# maximum flexibilty in controlling documentation building.
2246d7ffce2aSmrg# Refer to:
2247d7ffce2aSmrg# XORG_WITH_XMLTO         --with-xmlto
2248d7ffce2aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
2249d7ffce2aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
2250d7ffce2aSmrg# XORG_WITH_FOP           --with-fop
2251d7ffce2aSmrg# XORG_WITH_GROFF         --with-groff
2252d7ffce2aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
2253d7ffce2aSmrg#
2254d7ffce2aSmrg# Interface to module:
2255d7ffce2aSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
2256d7ffce2aSmrg# --enable-specs:	'yes' user instructs the module to generate specs
2257d7ffce2aSmrg#			'no' user instructs the module not to generate specs
2258d7ffce2aSmrg# parm1:		specify the default value, yes or no.
2259d7ffce2aSmrg#
2260d7ffce2aSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
2261d7ffce2aSmrgm4_define([spec_default], m4_default([$1], [yes]))
2262d7ffce2aSmrgAC_ARG_ENABLE(specs,
2263d7ffce2aSmrg	AS_HELP_STRING([--enable-specs],
2264d7ffce2aSmrg	   [Enable building the specs (default: ]spec_default[)]),
2265d7ffce2aSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
2266d7ffce2aSmrgm4_undefine([spec_default])
2267d7ffce2aSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
2268d7ffce2aSmrgAC_MSG_CHECKING([whether to build functional specifications])
2269d7ffce2aSmrgAC_MSG_RESULT([$build_specs])
2270d7ffce2aSmrg]) # XORG_ENABLE_SPECS
2271d7ffce2aSmrg
22724c61c93dSmrg# XORG_CHECK_MALLOC_ZERO
22734c61c93dSmrg# ----------------------
22744c61c93dSmrg# Minimum version: 1.0.0
22754c61c93dSmrg#
22764c61c93dSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
22774c61c93dSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
22784c61c93dSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
22794c61c93dSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
22804c61c93dSmrgAC_ARG_ENABLE(malloc0returnsnull,
22814c61c93dSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
22824c61c93dSmrg		       [malloc(0) returns NULL (default: auto)]),
22834c61c93dSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
22844c61c93dSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
22854c61c93dSmrg
22864c61c93dSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
22874c61c93dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
2288d7ffce2aSmrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
2289d7ffce2aSmrg#include <stdlib.h>
2290d7ffce2aSmrg],[
22914c61c93dSmrg    char *m0, *r0, *c0, *p;
22924c61c93dSmrg    m0 = malloc(0);
22934c61c93dSmrg    p = malloc(10);
22944c61c93dSmrg    r0 = realloc(p,0);
2295d7ffce2aSmrg    c0 = calloc(0,10);
2296d7ffce2aSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
2297d7ffce2aSmrg])],
22984c61c93dSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
2299d7ffce2aSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
2300d7ffce2aSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
23014c61c93dSmrgfi
23024c61c93dSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
23034c61c93dSmrg
23044c61c93dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
23054c61c93dSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
23064c61c93dSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
23074c61c93dSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
23084c61c93dSmrgelse
23094c61c93dSmrg	MALLOC_ZERO_CFLAGS=""
23104c61c93dSmrg	XMALLOC_ZERO_CFLAGS=""
23114c61c93dSmrg	XTMALLOC_ZERO_CFLAGS=""
23124c61c93dSmrgfi
23134c61c93dSmrg
23144c61c93dSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
23154c61c93dSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
23164c61c93dSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
23174c61c93dSmrg]) # XORG_CHECK_MALLOC_ZERO
23184c61c93dSmrg
23194c61c93dSmrg# XORG_WITH_LINT()
23204c61c93dSmrg# ----------------
23214c61c93dSmrg# Minimum version: 1.1.0
23224c61c93dSmrg#
2323d7ffce2aSmrg# This macro enables the use of a tool that flags some suspicious and
2324d7ffce2aSmrg# non-portable constructs (likely to be bugs) in C language source code.
2325d7ffce2aSmrg# It will attempt to locate the tool and use appropriate options.
2326d7ffce2aSmrg# There are various lint type tools on different platforms.
2327d7ffce2aSmrg#
2328d7ffce2aSmrg# Interface to module:
2329d7ffce2aSmrg# LINT:		returns the path to the tool found on the platform
2330d7ffce2aSmrg#		or the value set to LINT on the configure cmd line
2331d7ffce2aSmrg#		also an Automake conditional
2332d7ffce2aSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
2333d7ffce2aSmrg#
2334d7ffce2aSmrg# --with-lint:	'yes' user instructs the module to use lint
2335d7ffce2aSmrg#		'no' user instructs the module not to use lint (default)
2336d7ffce2aSmrg#
2337d7ffce2aSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
2338d7ffce2aSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
23394c61c93dSmrg#
23404c61c93dSmrgAC_DEFUN([XORG_WITH_LINT],[
23414c61c93dSmrg
2342d7ffce2aSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
2343d7ffce2aSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
23444c61c93dSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
23454c61c93dSmrg		[Use a lint-style source code checker (default: disabled)])],
23464c61c93dSmrg		[use_lint=$withval], [use_lint=no])
2347d7ffce2aSmrg
2348d7ffce2aSmrg# Obtain platform specific info like program name and options
2349d7ffce2aSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
2350d7ffce2aSmrgcase $host_os in
2351d7ffce2aSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2352d7ffce2aSmrg	lint_name=splint
2353d7ffce2aSmrg	lint_options="-badflag"
2354d7ffce2aSmrg	;;
2355d7ffce2aSmrg  *freebsd* | *netbsd*)
2356d7ffce2aSmrg	lint_name=lint
2357d7ffce2aSmrg	lint_options="-u -b"
2358d7ffce2aSmrg	;;
2359d7ffce2aSmrg  *solaris*)
2360d7ffce2aSmrg	lint_name=lint
2361d7ffce2aSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2362d7ffce2aSmrg	;;
2363d7ffce2aSmrgesac
2364d7ffce2aSmrg
2365d7ffce2aSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
2366d7ffce2aSmrgif test "x$use_lint" = x"yes" ; then
2367d7ffce2aSmrg   AC_PATH_PROG([LINT], [$lint_name])
2368d7ffce2aSmrg   if test "x$LINT" = "x"; then
2369d7ffce2aSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2370d7ffce2aSmrg   fi
2371d7ffce2aSmrgelif test "x$use_lint" = x"no" ; then
2372d7ffce2aSmrg   if test "x$LINT" != "x"; then
2373d7ffce2aSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2374d7ffce2aSmrg   fi
23754c61c93dSmrgelse
2376d7ffce2aSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
23774c61c93dSmrgfi
2378d7ffce2aSmrg
2379d7ffce2aSmrg# User supplied flags override default flags
2380d7ffce2aSmrgif test "x$LINT_FLAGS" != "x"; then
2381d7ffce2aSmrg   lint_options=$LINT_FLAGS
23824c61c93dSmrgfi
23834c61c93dSmrg
2384d7ffce2aSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2385d7ffce2aSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
23864c61c93dSmrg
23874c61c93dSmrg]) # XORG_WITH_LINT
23884c61c93dSmrg
23894c61c93dSmrg# XORG_LINT_LIBRARY(LIBNAME)
23904c61c93dSmrg# --------------------------
23914c61c93dSmrg# Minimum version: 1.1.0
23924c61c93dSmrg#
23934c61c93dSmrg# Sets up flags for building lint libraries for checking programs that call
23944c61c93dSmrg# functions in the library.
23954c61c93dSmrg#
2396d7ffce2aSmrg# Interface to module:
2397d7ffce2aSmrg# LINTLIB		- Automake variable with the name of lint library file to make
2398d7ffce2aSmrg# MAKE_LINT_LIB		- Automake conditional
2399d7ffce2aSmrg#
2400d7ffce2aSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2401d7ffce2aSmrg#			  - 'no' user instructs the module not to create a lint library (default)
24024c61c93dSmrg
24034c61c93dSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
24044c61c93dSmrgAC_REQUIRE([XORG_WITH_LINT])
24054c61c93dSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
24064c61c93dSmrg	[Create lint library (default: disabled)])],
24074c61c93dSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2408d7ffce2aSmrg
2409d7ffce2aSmrgif test "x$make_lint_lib" = x"yes" ; then
2410d7ffce2aSmrg   LINTLIB=llib-l$1.ln
2411d7ffce2aSmrg   if test "x$LINT" = "x"; then
2412d7ffce2aSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2413d7ffce2aSmrg   fi
2414d7ffce2aSmrgelif test "x$make_lint_lib" != x"no" ; then
2415d7ffce2aSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
24164c61c93dSmrgfi
2417d7ffce2aSmrg
24184c61c93dSmrgAC_SUBST(LINTLIB)
24194c61c93dSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
24204c61c93dSmrg
24214c61c93dSmrg]) # XORG_LINT_LIBRARY
24224c61c93dSmrg
24234c61c93dSmrg# XORG_CWARNFLAGS
24244c61c93dSmrg# ---------------
24254c61c93dSmrg# Minimum version: 1.2.0
24264c61c93dSmrg#
24274c61c93dSmrg# Defines CWARNFLAGS to enable C compiler warnings.
24284c61c93dSmrg#
24294c61c93dSmrgAC_DEFUN([XORG_CWARNFLAGS], [
2430d7ffce2aSmrgAC_REQUIRE([AC_PROG_CC_C99])
24314c61c93dSmrgif  test "x$GCC" = xyes ; then
24324c61c93dSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
24334c61c93dSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
2434d7ffce2aSmrg-Wbad-function-cast -Wformat=2"
24354c61c93dSmrg    case `$CC -dumpversion` in
24364c61c93dSmrg    3.4.* | 4.*)
24374c61c93dSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
24384c61c93dSmrg	;;
24394c61c93dSmrg    esac
24404c61c93dSmrgelse
24414c61c93dSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
24424c61c93dSmrg    if test "x$SUNCC" = "xyes"; then
24434c61c93dSmrg	CWARNFLAGS="-v"
24444c61c93dSmrg    fi
24454c61c93dSmrgfi
24464c61c93dSmrgAC_SUBST(CWARNFLAGS)
24474c61c93dSmrg]) # XORG_CWARNFLAGS
24484c61c93dSmrg
24494c61c93dSmrg# XORG_STRICT_OPTION
24504c61c93dSmrg# -----------------------
24514c61c93dSmrg# Minimum version: 1.3.0
24524c61c93dSmrg#
24534c61c93dSmrg# Add configure option to enable strict compilation
24544c61c93dSmrgAC_DEFUN([XORG_STRICT_OPTION], [
2455d7ffce2aSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
24564c61c93dSmrgAC_REQUIRE([AC_PROG_CC_C99])
24574c61c93dSmrgAC_REQUIRE([XORG_CWARNFLAGS])
24584c61c93dSmrg
24594c61c93dSmrgAC_ARG_ENABLE(strict-compilation,
24604c61c93dSmrg			  AS_HELP_STRING([--enable-strict-compilation],
24614c61c93dSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
24624c61c93dSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
24634c61c93dSmrgif test "x$STRICT_COMPILE" = "xyes"; then
24644c61c93dSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
24654c61c93dSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
24664c61c93dSmrg	if test "x$GCC" = xyes ; then
24674c61c93dSmrg		STRICT_CFLAGS="-pedantic -Werror"
24684c61c93dSmrg	elif test "x$SUNCC" = "xyes"; then
24694c61c93dSmrg		STRICT_CFLAGS="-errwarn"
24704c61c93dSmrg    elif test "x$INTELCC" = "xyes"; then
24714c61c93dSmrg		STRICT_CFLAGS="-Werror"
24724c61c93dSmrg	fi
24734c61c93dSmrgfi
24744c61c93dSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
24754c61c93dSmrgAC_SUBST([CWARNFLAGS])
24764c61c93dSmrg]) # XORG_STRICT_OPTION
24774c61c93dSmrg
24784c61c93dSmrg# XORG_DEFAULT_OPTIONS
24794c61c93dSmrg# --------------------
24804c61c93dSmrg# Minimum version: 1.3.0
24814c61c93dSmrg#
24824c61c93dSmrg# Defines default options for X.Org modules.
24834c61c93dSmrg#
24844c61c93dSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
2485d7ffce2aSmrgAC_REQUIRE([AC_PROG_INSTALL])
24864c61c93dSmrgXORG_CWARNFLAGS
24874c61c93dSmrgXORG_STRICT_OPTION
24884c61c93dSmrgXORG_RELEASE_VERSION
24894c61c93dSmrgXORG_CHANGELOG
2490d7ffce2aSmrgXORG_INSTALL
24914c61c93dSmrgXORG_MANPAGE_SECTIONS
2492d7ffce2aSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2493d7ffce2aSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
24944c61c93dSmrg]) # XORG_DEFAULT_OPTIONS
2495d7ffce2aSmrg
2496d7ffce2aSmrg# XORG_INSTALL()
2497d7ffce2aSmrg# ----------------
2498d7ffce2aSmrg# Minimum version: 1.4.0
2499d7ffce2aSmrg#
2500d7ffce2aSmrg# Defines the variable INSTALL_CMD as the command to copy
2501d7ffce2aSmrg# INSTALL from $prefix/share/util-macros.
2502d7ffce2aSmrg#
2503d7ffce2aSmrgAC_DEFUN([XORG_INSTALL], [
2504d7ffce2aSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2505d7ffce2aSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2506d7ffce2aSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2507d7ffce2aSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2508d7ffce2aSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
2509d7ffce2aSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
2510d7ffce2aSmrgAC_SUBST([INSTALL_CMD])
2511d7ffce2aSmrg]) # XORG_INSTALL
25124c61c93dSmrgdnl Copyright 2005 Red Hat, Inc
25134c61c93dSmrgdnl
25144c61c93dSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
25154c61c93dSmrgdnl documentation for any purpose is hereby granted without fee, provided that
25164c61c93dSmrgdnl the above copyright notice appear in all copies and that both that
25174c61c93dSmrgdnl copyright notice and this permission notice appear in supporting
25184c61c93dSmrgdnl documentation.
25194c61c93dSmrgdnl
25204c61c93dSmrgdnl The above copyright notice and this permission notice shall be included
25214c61c93dSmrgdnl in all copies or substantial portions of the Software.
25224c61c93dSmrgdnl
25234c61c93dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25244c61c93dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25254c61c93dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25264c61c93dSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
25274c61c93dSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25284c61c93dSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25294c61c93dSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
25304c61c93dSmrgdnl
25314c61c93dSmrgdnl Except as contained in this notice, the name of the copyright holders shall
25324c61c93dSmrgdnl not be used in advertising or otherwise to promote the sale, use or
25334c61c93dSmrgdnl other dealings in this Software without prior written authorization
25344c61c93dSmrgdnl from the copyright holders.
25354c61c93dSmrgdnl
25364c61c93dSmrg
25374c61c93dSmrg# XORG_RELEASE_VERSION
25384c61c93dSmrg# --------------------
2539d7ffce2aSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
25404c61c93dSmrg 
25414c61c93dSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
25424c61c93dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
25434c61c93dSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
25444c61c93dSmrg		[Major version of this package])
25454c61c93dSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
25464c61c93dSmrg	if test "x$PVM" = "x"; then
25474c61c93dSmrg		PVM="0"
25484c61c93dSmrg	fi
25494c61c93dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
25504c61c93dSmrg		[$PVM],
25514c61c93dSmrg		[Minor version of this package])
25524c61c93dSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
25534c61c93dSmrg	if test "x$PVP" = "x"; then
25544c61c93dSmrg		PVP="0"
25554c61c93dSmrg	fi
25564c61c93dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
25574c61c93dSmrg		[$PVP],
25584c61c93dSmrg		[Patch version of this package])
25594c61c93dSmrg])
25604c61c93dSmrg
25614c61c93dSmrg# XORG_CHANGELOG()
25624c61c93dSmrg# ----------------
25634c61c93dSmrg# Minimum version: 1.2.0
25644c61c93dSmrg#
25654c61c93dSmrg# Defines the variable CHANGELOG_CMD as the command to generate
25664c61c93dSmrg# ChangeLog from git.
25674c61c93dSmrg#
25684c61c93dSmrg#
25694c61c93dSmrgAC_DEFUN([XORG_CHANGELOG], [
2570d7ffce2aSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
2571d7ffce2aSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2572d7ffce2aSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
25734c61c93dSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
25744c61c93dSmrgAC_SUBST([CHANGELOG_CMD])
25754c61c93dSmrg]) # XORG_CHANGELOG
25764c61c93dSmrg
2577d7ffce2aSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2578d7ffce2aSmrg# 
2579d7ffce2aSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2580d7ffce2aSmrg#
2581d7ffce2aSmrg# This program is free software; you can redistribute it and/or modify
2582d7ffce2aSmrg# it under the terms of the GNU General Public License as published by
2583d7ffce2aSmrg# the Free Software Foundation; either version 2 of the License, or
2584d7ffce2aSmrg# (at your option) any later version.
2585d7ffce2aSmrg#
2586d7ffce2aSmrg# This program is distributed in the hope that it will be useful, but
2587d7ffce2aSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2588d7ffce2aSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2589d7ffce2aSmrg# General Public License for more details.
2590d7ffce2aSmrg#
2591d7ffce2aSmrg# You should have received a copy of the GNU General Public License
2592d7ffce2aSmrg# along with this program; if not, write to the Free Software
2593d7ffce2aSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2594d7ffce2aSmrg#
2595d7ffce2aSmrg# As a special exception to the GNU General Public License, if you
2596d7ffce2aSmrg# distribute this file as part of a program that contains a
2597d7ffce2aSmrg# configuration script generated by Autoconf, you may include it under
2598d7ffce2aSmrg# the same distribution terms that you use for the rest of that program.
2599d7ffce2aSmrg
2600d7ffce2aSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2601d7ffce2aSmrg# ----------------------------------
2602d7ffce2aSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
2603d7ffce2aSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2604d7ffce2aSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2605d7ffce2aSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2606d7ffce2aSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2607d7ffce2aSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2608d7ffce2aSmrgfi
2609d7ffce2aSmrgif test -n "$PKG_CONFIG"; then
2610d7ffce2aSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
2611d7ffce2aSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2612d7ffce2aSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2613d7ffce2aSmrg		AC_MSG_RESULT([yes])
2614d7ffce2aSmrg	else
2615d7ffce2aSmrg		AC_MSG_RESULT([no])
2616d7ffce2aSmrg		PKG_CONFIG=""
2617d7ffce2aSmrg	fi
2618d7ffce2aSmrg		
2619d7ffce2aSmrgfi[]dnl
2620d7ffce2aSmrg])# PKG_PROG_PKG_CONFIG
2621d7ffce2aSmrg
2622d7ffce2aSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2623d7ffce2aSmrg#
2624d7ffce2aSmrg# Check to see whether a particular set of modules exists.  Similar
2625d7ffce2aSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2626d7ffce2aSmrg#
2627d7ffce2aSmrg#
2628d7ffce2aSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
2629d7ffce2aSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
2630d7ffce2aSmrg# PKG_CHECK_EXISTS manually
2631d7ffce2aSmrg# --------------------------------------------------------------
2632d7ffce2aSmrgAC_DEFUN([PKG_CHECK_EXISTS],
2633d7ffce2aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2634d7ffce2aSmrgif test -n "$PKG_CONFIG" && \
2635d7ffce2aSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2636d7ffce2aSmrg  m4_ifval([$2], [$2], [:])
2637d7ffce2aSmrgm4_ifvaln([$3], [else
2638d7ffce2aSmrg  $3])dnl
2639d7ffce2aSmrgfi])
2640d7ffce2aSmrg
2641d7ffce2aSmrg
2642d7ffce2aSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2643d7ffce2aSmrg# ---------------------------------------------
2644d7ffce2aSmrgm4_define([_PKG_CONFIG],
2645d7ffce2aSmrg[if test -n "$$1"; then
2646d7ffce2aSmrg    pkg_cv_[]$1="$$1"
2647d7ffce2aSmrg elif test -n "$PKG_CONFIG"; then
2648d7ffce2aSmrg    PKG_CHECK_EXISTS([$3],
2649d7ffce2aSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
2650d7ffce2aSmrg		     [pkg_failed=yes])
2651d7ffce2aSmrg else
2652d7ffce2aSmrg    pkg_failed=untried
2653d7ffce2aSmrgfi[]dnl
2654d7ffce2aSmrg])# _PKG_CONFIG
2655d7ffce2aSmrg
2656d7ffce2aSmrg# _PKG_SHORT_ERRORS_SUPPORTED
2657d7ffce2aSmrg# -----------------------------
2658d7ffce2aSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2659d7ffce2aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2660d7ffce2aSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2661d7ffce2aSmrg        _pkg_short_errors_supported=yes
2662d7ffce2aSmrgelse
2663d7ffce2aSmrg        _pkg_short_errors_supported=no
2664d7ffce2aSmrgfi[]dnl
2665d7ffce2aSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
2666d7ffce2aSmrg
2667d7ffce2aSmrg
2668d7ffce2aSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2669d7ffce2aSmrg# [ACTION-IF-NOT-FOUND])
2670d7ffce2aSmrg#
2671d7ffce2aSmrg#
2672d7ffce2aSmrg# Note that if there is a possibility the first call to
2673d7ffce2aSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
2674d7ffce2aSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2675d7ffce2aSmrg#
2676d7ffce2aSmrg#
2677d7ffce2aSmrg# --------------------------------------------------------------
2678d7ffce2aSmrgAC_DEFUN([PKG_CHECK_MODULES],
2679d7ffce2aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2680d7ffce2aSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2681d7ffce2aSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2682d7ffce2aSmrg
2683d7ffce2aSmrgpkg_failed=no
2684d7ffce2aSmrgAC_MSG_CHECKING([for $1])
2685d7ffce2aSmrg
2686d7ffce2aSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2687d7ffce2aSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2688d7ffce2aSmrg
2689d7ffce2aSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2690d7ffce2aSmrgand $1[]_LIBS to avoid the need to call pkg-config.
2691d7ffce2aSmrgSee the pkg-config man page for more details.])
2692d7ffce2aSmrg
2693d7ffce2aSmrgif test $pkg_failed = yes; then
2694d7ffce2aSmrg        _PKG_SHORT_ERRORS_SUPPORTED
2695d7ffce2aSmrg        if test $_pkg_short_errors_supported = yes; then
2696d7ffce2aSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
2697d7ffce2aSmrg        else 
2698d7ffce2aSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
2699d7ffce2aSmrg        fi
2700d7ffce2aSmrg	# Put the nasty error message in config.log where it belongs
2701d7ffce2aSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2702d7ffce2aSmrg
2703d7ffce2aSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
2704d7ffce2aSmrg[Package requirements ($2) were not met:
2705d7ffce2aSmrg
2706d7ffce2aSmrg$$1_PKG_ERRORS
2707d7ffce2aSmrg
2708d7ffce2aSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
2709d7ffce2aSmrginstalled software in a non-standard prefix.
2710d7ffce2aSmrg
2711d7ffce2aSmrg_PKG_TEXT
2712d7ffce2aSmrg])],
2713d7ffce2aSmrg		[AC_MSG_RESULT([no])
2714d7ffce2aSmrg                $4])
2715d7ffce2aSmrgelif test $pkg_failed = untried; then
2716d7ffce2aSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
2717d7ffce2aSmrg[The pkg-config script could not be found or is too old.  Make sure it
2718d7ffce2aSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
2719d7ffce2aSmrgpath to pkg-config.
2720d7ffce2aSmrg
2721d7ffce2aSmrg_PKG_TEXT
2722d7ffce2aSmrg
2723d7ffce2aSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
2724d7ffce2aSmrg		[$4])
2725d7ffce2aSmrgelse
2726d7ffce2aSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2727d7ffce2aSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2728d7ffce2aSmrg        AC_MSG_RESULT([yes])
2729d7ffce2aSmrg	ifelse([$3], , :, [$3])
2730d7ffce2aSmrgfi[]dnl
2731d7ffce2aSmrg])# PKG_CHECK_MODULES
2732d7ffce2aSmrg
2733