17cf0acd0Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2439fab64Smrg
3bc5f02f5Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4bc5f02f5Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5439fab64Smrg# This file is free software; the Free Software Foundation
6439fab64Smrg# gives unlimited permission to copy and/or distribute it,
7439fab64Smrg# with or without modifications, as long as this notice is preserved.
8439fab64Smrg
9439fab64Smrg# This program is distributed in the hope that it will be useful,
10439fab64Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11439fab64Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12439fab64Smrg# PARTICULAR PURPOSE.
13439fab64Smrg
14bc5f02f5Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15bc5f02f5Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
167cf0acd0Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
177cf0acd0Smrg[m4_warning([this file was generated for autoconf 2.68.
18bc5f02f5SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19bc5f02f5SmrgIf you have problems, you may need to regenerate the build system entirely.
20bc5f02f5SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21439fab64Smrg
22bc5f02f5Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23bc5f02f5Smrg#
24bc5f02f5Smrg# This file is free software; the Free Software Foundation
25bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
26bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
27439fab64Smrg
28bc5f02f5Smrg# AM_AUTOMAKE_VERSION(VERSION)
29bc5f02f5Smrg# ----------------------------
30bc5f02f5Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31bc5f02f5Smrg# generated from the m4 files accompanying Automake X.Y.
32bc5f02f5Smrg# (This private macro should not be called outside this file.)
33bc5f02f5SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34bc5f02f5Smrg[am__api_version='1.11'
35bc5f02f5Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36bc5f02f5Smrgdnl require some minimum version.  Point them to the right macro.
377cf0acd0Smrgm4_if([$1], [1.11.1], [],
38bc5f02f5Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39bc5f02f5Smrg])
40bc5f02f5Smrg
41bc5f02f5Smrg# _AM_AUTOCONF_VERSION(VERSION)
42bc5f02f5Smrg# -----------------------------
43bc5f02f5Smrg# aclocal traces this macro to find the Autoconf version.
44bc5f02f5Smrg# This is a private macro too.  Using m4_define simplifies
45bc5f02f5Smrg# the logic in aclocal, which can simply ignore this definition.
46bc5f02f5Smrgm4_define([_AM_AUTOCONF_VERSION], [])
47439fab64Smrg
48bc5f02f5Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49bc5f02f5Smrg# -------------------------------
50bc5f02f5Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51bc5f02f5Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52bc5f02f5SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
537cf0acd0Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
54bc5f02f5Smrgm4_ifndef([AC_AUTOCONF_VERSION],
55bc5f02f5Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56bc5f02f5Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57439fab64Smrg
58bc5f02f5Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59bc5f02f5Smrg
60bc5f02f5Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61bc5f02f5Smrg#
62bc5f02f5Smrg# This file is free software; the Free Software Foundation
63bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
64bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
65bc5f02f5Smrg
66bc5f02f5Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67bc5f02f5Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68bc5f02f5Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69bc5f02f5Smrg#
70bc5f02f5Smrg# Of course, Automake must honor this variable whenever it calls a
71bc5f02f5Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72bc5f02f5Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73bc5f02f5Smrg# depending on how configure is run.  This is pretty annoying, since
74bc5f02f5Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75bc5f02f5Smrg# source directory, any form will work fine, but in subdirectories a
76bc5f02f5Smrg# relative path needs to be adjusted first.
77bc5f02f5Smrg#
78bc5f02f5Smrg# $ac_aux_dir/missing
79bc5f02f5Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80bc5f02f5Smrg# $top_srcdir/$ac_aux_dir/missing
81bc5f02f5Smrg#    fails if $ac_aux_dir is absolute,
82bc5f02f5Smrg#    fails when called from a subdirectory in a VPATH build with
83bc5f02f5Smrg#          a relative $ac_aux_dir
84bc5f02f5Smrg#
85bc5f02f5Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86bc5f02f5Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
87bc5f02f5Smrg# harmless because $srcdir is `.', but things will broke when you
88bc5f02f5Smrg# start a VPATH build or use an absolute $srcdir.
89bc5f02f5Smrg#
90bc5f02f5Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91bc5f02f5Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92bc5f02f5Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93bc5f02f5Smrg# and then we would define $MISSING as
94bc5f02f5Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95bc5f02f5Smrg# This will work as long as MISSING is not called from configure, because
96bc5f02f5Smrg# unfortunately $(top_srcdir) has no meaning in configure.
97bc5f02f5Smrg# However there are other variables, like CC, which are often used in
98bc5f02f5Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99bc5f02f5Smrg#
100bc5f02f5Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
101bc5f02f5Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
102bc5f02f5Smrg# configured tree to be moved without reconfiguration.
103bc5f02f5Smrg
104bc5f02f5SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105bc5f02f5Smrg[dnl Rely on autoconf to set up CDPATH properly.
106bc5f02f5SmrgAC_PREREQ([2.50])dnl
107bc5f02f5Smrg# expand $ac_aux_dir to an absolute path
108bc5f02f5Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
109bc5f02f5Smrg])
110439fab64Smrg
1117cf0acd0Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1127cf0acd0Smrg
1137cf0acd0Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1147cf0acd0Smrg# Free Software Foundation, Inc.
1157cf0acd0Smrg#
1167cf0acd0Smrg# This file is free software; the Free Software Foundation
1177cf0acd0Smrg# gives unlimited permission to copy and/or distribute it,
1187cf0acd0Smrg# with or without modifications, as long as this notice is preserved.
1197cf0acd0Smrg
1207cf0acd0Smrg# serial 9
1217cf0acd0Smrg
1227cf0acd0Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1237cf0acd0Smrg# -------------------------------------
1247cf0acd0Smrg# Define a conditional.
1257cf0acd0SmrgAC_DEFUN([AM_CONDITIONAL],
1267cf0acd0Smrg[AC_PREREQ(2.52)dnl
1277cf0acd0Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1287cf0acd0Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1297cf0acd0SmrgAC_SUBST([$1_TRUE])dnl
1307cf0acd0SmrgAC_SUBST([$1_FALSE])dnl
1317cf0acd0Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1327cf0acd0Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1337cf0acd0Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1347cf0acd0Smrgif $2; then
1357cf0acd0Smrg  $1_TRUE=
1367cf0acd0Smrg  $1_FALSE='#'
1377cf0acd0Smrgelse
1387cf0acd0Smrg  $1_TRUE='#'
1397cf0acd0Smrg  $1_FALSE=
1407cf0acd0Smrgfi
1417cf0acd0SmrgAC_CONFIG_COMMANDS_PRE(
1427cf0acd0Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1437cf0acd0Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1447cf0acd0SmrgUsually this means the macro was only invoked conditionally.]])
1457cf0acd0Smrgfi])])
1467cf0acd0Smrg
1477cf0acd0Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1487cf0acd0Smrg# Free Software Foundation, Inc.
1497cf0acd0Smrg#
1507cf0acd0Smrg# This file is free software; the Free Software Foundation
1517cf0acd0Smrg# gives unlimited permission to copy and/or distribute it,
1527cf0acd0Smrg# with or without modifications, as long as this notice is preserved.
1537cf0acd0Smrg
1547cf0acd0Smrg# serial 10
1557cf0acd0Smrg
1567cf0acd0Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1577cf0acd0Smrg# written in clear, in which case automake, when reading aclocal.m4,
1587cf0acd0Smrg# will think it sees a *use*, and therefore will trigger all it's
1597cf0acd0Smrg# C support machinery.  Also note that it means that autoscan, seeing
1607cf0acd0Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1617cf0acd0Smrg
1627cf0acd0Smrg
1637cf0acd0Smrg# _AM_DEPENDENCIES(NAME)
1647cf0acd0Smrg# ----------------------
1657cf0acd0Smrg# See how the compiler implements dependency checking.
1667cf0acd0Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1677cf0acd0Smrg# We try a few techniques and use that to set a single cache variable.
1687cf0acd0Smrg#
1697cf0acd0Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1707cf0acd0Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1717cf0acd0Smrg# dependency, and given that the user is not expected to run this macro,
1727cf0acd0Smrg# just rely on AC_PROG_CC.
1737cf0acd0SmrgAC_DEFUN([_AM_DEPENDENCIES],
1747cf0acd0Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1757cf0acd0SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1767cf0acd0SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1777cf0acd0SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1787cf0acd0Smrg
1797cf0acd0Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1807cf0acd0Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1817cf0acd0Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1827cf0acd0Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1837cf0acd0Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1847cf0acd0Smrg                   [depcc="$$1"   am_compiler_list=])
1857cf0acd0Smrg
1867cf0acd0SmrgAC_CACHE_CHECK([dependency style of $depcc],
1877cf0acd0Smrg               [am_cv_$1_dependencies_compiler_type],
1887cf0acd0Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1897cf0acd0Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1907cf0acd0Smrg  # making bogus files that we don't know about and never remove.  For
1917cf0acd0Smrg  # instance it was reported that on HP-UX the gcc test will end up
1927cf0acd0Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
1937cf0acd0Smrg  # in D'.
1947cf0acd0Smrg  mkdir conftest.dir
1957cf0acd0Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1967cf0acd0Smrg  # using a relative directory.
1977cf0acd0Smrg  cp "$am_depcomp" conftest.dir
1987cf0acd0Smrg  cd conftest.dir
1997cf0acd0Smrg  # We will build objects and dependencies in a subdirectory because
2007cf0acd0Smrg  # it helps to detect inapplicable dependency modes.  For instance
2017cf0acd0Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2027cf0acd0Smrg  # side effect of compilation, but ICC will put the dependencies in
2037cf0acd0Smrg  # the current directory while Tru64 will put them in the object
2047cf0acd0Smrg  # directory.
2057cf0acd0Smrg  mkdir sub
2067cf0acd0Smrg
2077cf0acd0Smrg  am_cv_$1_dependencies_compiler_type=none
2087cf0acd0Smrg  if test "$am_compiler_list" = ""; then
2097cf0acd0Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2107cf0acd0Smrg  fi
2117cf0acd0Smrg  am__universal=false
2127cf0acd0Smrg  m4_case([$1], [CC],
2137cf0acd0Smrg    [case " $depcc " in #(
2147cf0acd0Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2157cf0acd0Smrg     esac],
2167cf0acd0Smrg    [CXX],
2177cf0acd0Smrg    [case " $depcc " in #(
2187cf0acd0Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2197cf0acd0Smrg     esac])
2207cf0acd0Smrg
2217cf0acd0Smrg  for depmode in $am_compiler_list; do
2227cf0acd0Smrg    # Setup a source with many dependencies, because some compilers
2237cf0acd0Smrg    # like to wrap large dependency lists on column 80 (with \), and
2247cf0acd0Smrg    # we should not choose a depcomp mode which is confused by this.
2257cf0acd0Smrg    #
2267cf0acd0Smrg    # We need to recreate these files for each test, as the compiler may
2277cf0acd0Smrg    # overwrite some of them when testing with obscure command lines.
2287cf0acd0Smrg    # This happens at least with the AIX C compiler.
2297cf0acd0Smrg    : > sub/conftest.c
2307cf0acd0Smrg    for i in 1 2 3 4 5 6; do
2317cf0acd0Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2327cf0acd0Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2337cf0acd0Smrg      # Solaris 8's {/usr,}/bin/sh.
2347cf0acd0Smrg      touch sub/conftst$i.h
2357cf0acd0Smrg    done
2367cf0acd0Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2377cf0acd0Smrg
2387cf0acd0Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2397cf0acd0Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2407cf0acd0Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
2417cf0acd0Smrg    # versions had trouble with output in subdirs
2427cf0acd0Smrg    am__obj=sub/conftest.${OBJEXT-o}
2437cf0acd0Smrg    am__minus_obj="-o $am__obj"
2447cf0acd0Smrg    case $depmode in
2457cf0acd0Smrg    gcc)
2467cf0acd0Smrg      # This depmode causes a compiler race in universal mode.
2477cf0acd0Smrg      test "$am__universal" = false || continue
2487cf0acd0Smrg      ;;
2497cf0acd0Smrg    nosideeffect)
2507cf0acd0Smrg      # after this tag, mechanisms are not by side-effect, so they'll
2517cf0acd0Smrg      # only be used when explicitly requested
2527cf0acd0Smrg      if test "x$enable_dependency_tracking" = xyes; then
2537cf0acd0Smrg	continue
2547cf0acd0Smrg      else
2557cf0acd0Smrg	break
2567cf0acd0Smrg      fi
2577cf0acd0Smrg      ;;
2587cf0acd0Smrg    msvisualcpp | msvcmsys)
2597cf0acd0Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
2607cf0acd0Smrg      # not run yet.  These depmodes are late enough in the game, and
2617cf0acd0Smrg      # so weak that their functioning should not be impacted.
2627cf0acd0Smrg      am__obj=conftest.${OBJEXT-o}
2637cf0acd0Smrg      am__minus_obj=
2647cf0acd0Smrg      ;;
2657cf0acd0Smrg    none) break ;;
2667cf0acd0Smrg    esac
2677cf0acd0Smrg    if depmode=$depmode \
2687cf0acd0Smrg       source=sub/conftest.c object=$am__obj \
2697cf0acd0Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2707cf0acd0Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2717cf0acd0Smrg         >/dev/null 2>conftest.err &&
2727cf0acd0Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2737cf0acd0Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2747cf0acd0Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2757cf0acd0Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2767cf0acd0Smrg      # icc doesn't choke on unknown options, it will just issue warnings
2777cf0acd0Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
2787cf0acd0Smrg      # that says an option was ignored or not supported.
2797cf0acd0Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2807cf0acd0Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2817cf0acd0Smrg      # The diagnosis changed in icc 8.0:
2827cf0acd0Smrg      #   icc: Command line remark: option '-MP' not supported
2837cf0acd0Smrg      if (grep 'ignoring option' conftest.err ||
2847cf0acd0Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2857cf0acd0Smrg        am_cv_$1_dependencies_compiler_type=$depmode
2867cf0acd0Smrg        break
2877cf0acd0Smrg      fi
2887cf0acd0Smrg    fi
2897cf0acd0Smrg  done
2907cf0acd0Smrg
2917cf0acd0Smrg  cd ..
2927cf0acd0Smrg  rm -rf conftest.dir
2937cf0acd0Smrgelse
2947cf0acd0Smrg  am_cv_$1_dependencies_compiler_type=none
2957cf0acd0Smrgfi
2967cf0acd0Smrg])
2977cf0acd0SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2987cf0acd0SmrgAM_CONDITIONAL([am__fastdep$1], [
2997cf0acd0Smrg  test "x$enable_dependency_tracking" != xno \
3007cf0acd0Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3017cf0acd0Smrg])
3027cf0acd0Smrg
3037cf0acd0Smrg
3047cf0acd0Smrg# AM_SET_DEPDIR
3057cf0acd0Smrg# -------------
3067cf0acd0Smrg# Choose a directory name for dependency files.
3077cf0acd0Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3087cf0acd0SmrgAC_DEFUN([AM_SET_DEPDIR],
3097cf0acd0Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3107cf0acd0SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3117cf0acd0Smrg])
3127cf0acd0Smrg
3137cf0acd0Smrg
3147cf0acd0Smrg# AM_DEP_TRACK
3157cf0acd0Smrg# ------------
3167cf0acd0SmrgAC_DEFUN([AM_DEP_TRACK],
3177cf0acd0Smrg[AC_ARG_ENABLE(dependency-tracking,
3187cf0acd0Smrg[  --disable-dependency-tracking  speeds up one-time build
3197cf0acd0Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3207cf0acd0Smrgif test "x$enable_dependency_tracking" != xno; then
3217cf0acd0Smrg  am_depcomp="$ac_aux_dir/depcomp"
3227cf0acd0Smrg  AMDEPBACKSLASH='\'
3237cf0acd0Smrgfi
3247cf0acd0SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3257cf0acd0SmrgAC_SUBST([AMDEPBACKSLASH])dnl
3267cf0acd0Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3277cf0acd0Smrg])
3287cf0acd0Smrg
3297cf0acd0Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3307cf0acd0Smrg
3317cf0acd0Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
3327cf0acd0Smrg# Free Software Foundation, Inc.
3337cf0acd0Smrg#
3347cf0acd0Smrg# This file is free software; the Free Software Foundation
3357cf0acd0Smrg# gives unlimited permission to copy and/or distribute it,
3367cf0acd0Smrg# with or without modifications, as long as this notice is preserved.
3377cf0acd0Smrg
3387cf0acd0Smrg#serial 5
3397cf0acd0Smrg
3407cf0acd0Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3417cf0acd0Smrg# ------------------------------
3427cf0acd0SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3437cf0acd0Smrg[{
3447cf0acd0Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
3457cf0acd0Smrg  # are listed without --file.  Let's play safe and only enable the eval
3467cf0acd0Smrg  # if we detect the quoting.
3477cf0acd0Smrg  case $CONFIG_FILES in
3487cf0acd0Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
3497cf0acd0Smrg  *)   set x $CONFIG_FILES ;;
3507cf0acd0Smrg  esac
3517cf0acd0Smrg  shift
3527cf0acd0Smrg  for mf
3537cf0acd0Smrg  do
3547cf0acd0Smrg    # Strip MF so we end up with the name of the file.
3557cf0acd0Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3567cf0acd0Smrg    # Check whether this is an Automake generated Makefile or not.
3577cf0acd0Smrg    # We used to match only the files named `Makefile.in', but
3587cf0acd0Smrg    # some people rename them; so instead we look at the file content.
3597cf0acd0Smrg    # Grep'ing the first line is not enough: some people post-process
3607cf0acd0Smrg    # each Makefile.in and add a new line on top of each file to say so.
3617cf0acd0Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
3627cf0acd0Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
3637cf0acd0Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3647cf0acd0Smrg      dirpart=`AS_DIRNAME("$mf")`
3657cf0acd0Smrg    else
3667cf0acd0Smrg      continue
3677cf0acd0Smrg    fi
3687cf0acd0Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
3697cf0acd0Smrg    # from the Makefile without running `make'.
3707cf0acd0Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3717cf0acd0Smrg    test -z "$DEPDIR" && continue
3727cf0acd0Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3737cf0acd0Smrg    test -z "am__include" && continue
3747cf0acd0Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3757cf0acd0Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
3767cf0acd0Smrg    U=`sed -n 's/^U = //p' < "$mf"`
3777cf0acd0Smrg    # Find all dependency output files, they are included files with
3787cf0acd0Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3797cf0acd0Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3807cf0acd0Smrg    # expansion.
3817cf0acd0Smrg    for file in `sed -n "
3827cf0acd0Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3837cf0acd0Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3847cf0acd0Smrg      # Make sure the directory exists.
3857cf0acd0Smrg      test -f "$dirpart/$file" && continue
3867cf0acd0Smrg      fdir=`AS_DIRNAME(["$file"])`
3877cf0acd0Smrg      AS_MKDIR_P([$dirpart/$fdir])
3887cf0acd0Smrg      # echo "creating $dirpart/$file"
3897cf0acd0Smrg      echo '# dummy' > "$dirpart/$file"
3907cf0acd0Smrg    done
3917cf0acd0Smrg  done
3927cf0acd0Smrg}
3937cf0acd0Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3947cf0acd0Smrg
3957cf0acd0Smrg
3967cf0acd0Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3977cf0acd0Smrg# -----------------------------
3987cf0acd0Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
3997cf0acd0Smrg#
4007cf0acd0Smrg# This code is only required when automatic dependency tracking
4017cf0acd0Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
4027cf0acd0Smrg# need in order to bootstrap the dependency handling code.
4037cf0acd0SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4047cf0acd0Smrg[AC_CONFIG_COMMANDS([depfiles],
4057cf0acd0Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4067cf0acd0Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4077cf0acd0Smrg])
4087cf0acd0Smrg
409bc5f02f5Smrg# Do all the work for Automake.                             -*- Autoconf -*-
410439fab64Smrg
411bc5f02f5Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
412bc5f02f5Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
413bc5f02f5Smrg#
414bc5f02f5Smrg# This file is free software; the Free Software Foundation
415bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
416bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
417439fab64Smrg
418bc5f02f5Smrg# serial 16
419439fab64Smrg
420bc5f02f5Smrg# This macro actually does too much.  Some checks are only needed if
421bc5f02f5Smrg# your package does certain things.  But this isn't really a big deal.
422439fab64Smrg
423439fab64Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
424439fab64Smrg# AM_INIT_AUTOMAKE([OPTIONS])
425439fab64Smrg# -----------------------------------------------
426439fab64Smrg# The call with PACKAGE and VERSION arguments is the old style
427439fab64Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
428439fab64Smrg# and VERSION should now be passed to AC_INIT and removed from
429439fab64Smrg# the call to AM_INIT_AUTOMAKE.
430439fab64Smrg# We support both call styles for the transition.  After
431439fab64Smrg# the next Automake release, Autoconf can make the AC_INIT
432439fab64Smrg# arguments mandatory, and then we can depend on a new Autoconf
433439fab64Smrg# release and drop the old call support.
434439fab64SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
435bc5f02f5Smrg[AC_PREREQ([2.62])dnl
436bc5f02f5Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
437bc5f02f5Smrgdnl the ones we care about.
438bc5f02f5Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
439bc5f02f5SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
440bc5f02f5SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
441bc5f02f5Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
442bc5f02f5Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
443bc5f02f5Smrg  # is not polluted with repeated "-I."
444bc5f02f5Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
445bc5f02f5Smrg  # test to see if srcdir already configured
446bc5f02f5Smrg  if test -f $srcdir/config.status; then
447bc5f02f5Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
448bc5f02f5Smrg  fi
449439fab64Smrgfi
450439fab64Smrg
451439fab64Smrg# test whether we have cygpath
452439fab64Smrgif test -z "$CYGPATH_W"; then
453439fab64Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
454439fab64Smrg    CYGPATH_W='cygpath -w'
455439fab64Smrg  else
456439fab64Smrg    CYGPATH_W=echo
457439fab64Smrg  fi
458439fab64Smrgfi
459439fab64SmrgAC_SUBST([CYGPATH_W])
460439fab64Smrg
461439fab64Smrg# Define the identity of the package.
462439fab64Smrgdnl Distinguish between old-style and new-style calls.
463439fab64Smrgm4_ifval([$2],
464439fab64Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465439fab64Smrg AC_SUBST([PACKAGE], [$1])dnl
466439fab64Smrg AC_SUBST([VERSION], [$2])],
467439fab64Smrg[_AM_SET_OPTIONS([$1])dnl
468bc5f02f5Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469bc5f02f5Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
470bc5f02f5Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471439fab64Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472439fab64Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473439fab64Smrg
474439fab64Smrg_AM_IF_OPTION([no-define],,
475439fab64Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
476439fab64Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
477439fab64Smrg
478439fab64Smrg# Some tools Automake needs.
479439fab64SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
480439fab64SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
481439fab64SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
482439fab64SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
483439fab64SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
484439fab64SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
485439fab64SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
486bc5f02f5SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487bc5f02f5SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488bc5f02f5SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
489439fab64Smrg# We need awk for the "check" target.  The system "awk" is bad on
490439fab64Smrg# some platforms.
491439fab64SmrgAC_REQUIRE([AC_PROG_AWK])dnl
492439fab64SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
493439fab64SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
494bc5f02f5Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
495bc5f02f5Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
496bc5f02f5Smrg			     [_AM_PROG_TAR([v7])])])
497439fab64Smrg_AM_IF_OPTION([no-dependencies],,
498439fab64Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
499bc5f02f5Smrg		  [_AM_DEPENDENCIES(CC)],
500bc5f02f5Smrg		  [define([AC_PROG_CC],
501bc5f02f5Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
502439fab64SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
503bc5f02f5Smrg		  [_AM_DEPENDENCIES(CXX)],
504bc5f02f5Smrg		  [define([AC_PROG_CXX],
505bc5f02f5Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
506bc5f02f5SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
507bc5f02f5Smrg		  [_AM_DEPENDENCIES(OBJC)],
508bc5f02f5Smrg		  [define([AC_PROG_OBJC],
509bc5f02f5Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
510439fab64Smrg])
511bc5f02f5Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
512bc5f02f5Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
513bc5f02f5Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
514bc5f02f5Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
515bc5f02f5SmrgAC_CONFIG_COMMANDS_PRE(dnl
516bc5f02f5Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
517bc5f02f5Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
518439fab64Smrg])
519439fab64Smrg
520bc5f02f5Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
521bc5f02f5Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522bc5f02f5Smrgdnl mangled by Autoconf and run in a shell conditional statement.
523bc5f02f5Smrgm4_define([_AC_COMPILER_EXEEXT],
524bc5f02f5Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525bc5f02f5Smrg
526439fab64Smrg
527439fab64Smrg# When config.status generates a header, we must update the stamp-h file.
528439fab64Smrg# This file resides in the same directory as the config header
529439fab64Smrg# that is generated.  The stamp files are numbered to have different names.
530439fab64Smrg
531439fab64Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
532439fab64Smrg# loop where config.status creates the headers, so we can generate
533439fab64Smrg# our stamp files there.
534439fab64SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
535439fab64Smrg[# Compute $1's index in $config_headers.
536bc5f02f5Smrg_am_arg=$1
537439fab64Smrg_am_stamp_count=1
538439fab64Smrgfor _am_header in $config_headers :; do
539439fab64Smrg  case $_am_header in
540bc5f02f5Smrg    $_am_arg | $_am_arg:* )
541439fab64Smrg      break ;;
542439fab64Smrg    * )
543439fab64Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
544439fab64Smrg  esac
545439fab64Smrgdone
546bc5f02f5Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547439fab64Smrg
548bc5f02f5Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
549bc5f02f5Smrg#
550bc5f02f5Smrg# This file is free software; the Free Software Foundation
551bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
552bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
553439fab64Smrg
554bc5f02f5Smrg# AM_PROG_INSTALL_SH
555bc5f02f5Smrg# ------------------
556bc5f02f5Smrg# Define $install_sh.
557bc5f02f5SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
558bc5f02f5Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
559bc5f02f5Smrgif test x"${install_sh}" != xset; then
560bc5f02f5Smrg  case $am_aux_dir in
561bc5f02f5Smrg  *\ * | *\	*)
562bc5f02f5Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
563bc5f02f5Smrg  *)
564bc5f02f5Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
565bc5f02f5Smrg  esac
566bc5f02f5Smrgfi
567bc5f02f5SmrgAC_SUBST(install_sh)])
568439fab64Smrg
569bc5f02f5Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
570bc5f02f5Smrg#
571bc5f02f5Smrg# This file is free software; the Free Software Foundation
572bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
573bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
574439fab64Smrg
575bc5f02f5Smrg# serial 2
576439fab64Smrg
577bc5f02f5Smrg# Check whether the underlying file-system supports filenames
578bc5f02f5Smrg# with a leading dot.  For instance MS-DOS doesn't.
579bc5f02f5SmrgAC_DEFUN([AM_SET_LEADING_DOT],
580bc5f02f5Smrg[rm -rf .tst 2>/dev/null
581bc5f02f5Smrgmkdir .tst 2>/dev/null
582bc5f02f5Smrgif test -d .tst; then
583bc5f02f5Smrg  am__leading_dot=.
584bc5f02f5Smrgelse
585bc5f02f5Smrg  am__leading_dot=_
586bc5f02f5Smrgfi
587bc5f02f5Smrgrmdir .tst 2>/dev/null
588bc5f02f5SmrgAC_SUBST([am__leading_dot])])
589439fab64Smrg
5907cf0acd0Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
5917cf0acd0Smrg# From Jim Meyering
5927cf0acd0Smrg
5937cf0acd0Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
5947cf0acd0Smrg# Free Software Foundation, Inc.
5957cf0acd0Smrg#
5967cf0acd0Smrg# This file is free software; the Free Software Foundation
5977cf0acd0Smrg# gives unlimited permission to copy and/or distribute it,
5987cf0acd0Smrg# with or without modifications, as long as this notice is preserved.
5997cf0acd0Smrg
6007cf0acd0Smrg# serial 5
6017cf0acd0Smrg
6027cf0acd0Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6037cf0acd0Smrg# ----------------------------------
6047cf0acd0Smrg# Control maintainer-specific portions of Makefiles.
6057cf0acd0Smrg# Default is to disable them, unless `enable' is passed literally.
6067cf0acd0Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6077cf0acd0Smrg# can override the default with the --enable/--disable switch.
6087cf0acd0SmrgAC_DEFUN([AM_MAINTAINER_MODE],
6097cf0acd0Smrg[m4_case(m4_default([$1], [disable]),
6107cf0acd0Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
6117cf0acd0Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
6127cf0acd0Smrg       [m4_define([am_maintainer_other], [enable])
6137cf0acd0Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6147cf0acd0SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6157cf0acd0Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6167cf0acd0Smrg  AC_ARG_ENABLE([maintainer-mode],
6177cf0acd0Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
6187cf0acd0Smrg			  (and sometimes confusing) to the casual installer],
6197cf0acd0Smrg      [USE_MAINTAINER_MODE=$enableval],
6207cf0acd0Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
6217cf0acd0Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6227cf0acd0Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
6237cf0acd0Smrg  MAINT=$MAINTAINER_MODE_TRUE
6247cf0acd0Smrg  AC_SUBST([MAINT])dnl
6257cf0acd0Smrg]
6267cf0acd0Smrg)
6277cf0acd0Smrg
6287cf0acd0SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
6297cf0acd0Smrg
6307cf0acd0Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6317cf0acd0Smrg
6327cf0acd0Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
6337cf0acd0Smrg#
6347cf0acd0Smrg# This file is free software; the Free Software Foundation
6357cf0acd0Smrg# gives unlimited permission to copy and/or distribute it,
6367cf0acd0Smrg# with or without modifications, as long as this notice is preserved.
6377cf0acd0Smrg
6387cf0acd0Smrg# serial 4
6397cf0acd0Smrg
6407cf0acd0Smrg# AM_MAKE_INCLUDE()
6417cf0acd0Smrg# -----------------
6427cf0acd0Smrg# Check to see how make treats includes.
6437cf0acd0SmrgAC_DEFUN([AM_MAKE_INCLUDE],
6447cf0acd0Smrg[am_make=${MAKE-make}
6457cf0acd0Smrgcat > confinc << 'END'
6467cf0acd0Smrgam__doit:
6477cf0acd0Smrg	@echo this is the am__doit target
6487cf0acd0Smrg.PHONY: am__doit
6497cf0acd0SmrgEND
6507cf0acd0Smrg# If we don't find an include directive, just comment out the code.
6517cf0acd0SmrgAC_MSG_CHECKING([for style of include used by $am_make])
6527cf0acd0Smrgam__include="#"
6537cf0acd0Smrgam__quote=
6547cf0acd0Smrg_am_result=none
6557cf0acd0Smrg# First try GNU make style include.
6567cf0acd0Smrgecho "include confinc" > confmf
6577cf0acd0Smrg# Ignore all kinds of additional output from `make'.
6587cf0acd0Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6597cf0acd0Smrg*the\ am__doit\ target*)
6607cf0acd0Smrg  am__include=include
6617cf0acd0Smrg  am__quote=
6627cf0acd0Smrg  _am_result=GNU
6637cf0acd0Smrg  ;;
6647cf0acd0Smrgesac
6657cf0acd0Smrg# Now try BSD make style include.
6667cf0acd0Smrgif test "$am__include" = "#"; then
6677cf0acd0Smrg   echo '.include "confinc"' > confmf
6687cf0acd0Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6697cf0acd0Smrg   *the\ am__doit\ target*)
6707cf0acd0Smrg     am__include=.include
6717cf0acd0Smrg     am__quote="\""
6727cf0acd0Smrg     _am_result=BSD
6737cf0acd0Smrg     ;;
6747cf0acd0Smrg   esac
6757cf0acd0Smrgfi
6767cf0acd0SmrgAC_SUBST([am__include])
6777cf0acd0SmrgAC_SUBST([am__quote])
6787cf0acd0SmrgAC_MSG_RESULT([$_am_result])
6797cf0acd0Smrgrm -f confinc confmf
6807cf0acd0Smrg])
6817cf0acd0Smrg
682bc5f02f5Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
683439fab64Smrg
684bc5f02f5Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
685bc5f02f5Smrg# Free Software Foundation, Inc.
686bc5f02f5Smrg#
687bc5f02f5Smrg# This file is free software; the Free Software Foundation
688bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
689bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
690439fab64Smrg
691bc5f02f5Smrg# serial 6
692439fab64Smrg
693bc5f02f5Smrg# AM_MISSING_PROG(NAME, PROGRAM)
694bc5f02f5Smrg# ------------------------------
695bc5f02f5SmrgAC_DEFUN([AM_MISSING_PROG],
696bc5f02f5Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
697bc5f02f5Smrg$1=${$1-"${am_missing_run}$2"}
698bc5f02f5SmrgAC_SUBST($1)])
699439fab64Smrg
700439fab64Smrg
701bc5f02f5Smrg# AM_MISSING_HAS_RUN
702bc5f02f5Smrg# ------------------
703bc5f02f5Smrg# Define MISSING if not defined so far and test if it supports --run.
704bc5f02f5Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
705bc5f02f5SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
706bc5f02f5Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
707bc5f02f5SmrgAC_REQUIRE_AUX_FILE([missing])dnl
708bc5f02f5Smrgif test x"${MISSING+set}" != xset; then
709bc5f02f5Smrg  case $am_aux_dir in
710bc5f02f5Smrg  *\ * | *\	*)
711bc5f02f5Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
712bc5f02f5Smrg  *)
713bc5f02f5Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
714bc5f02f5Smrg  esac
715bc5f02f5Smrgfi
716bc5f02f5Smrg# Use eval to expand $SHELL
717bc5f02f5Smrgif eval "$MISSING --run true"; then
718bc5f02f5Smrg  am_missing_run="$MISSING --run "
719bc5f02f5Smrgelse
720bc5f02f5Smrg  am_missing_run=
721bc5f02f5Smrg  AC_MSG_WARN([`missing' script is too old or missing])
722bc5f02f5Smrgfi
723bc5f02f5Smrg])
724439fab64Smrg
725bc5f02f5Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726bc5f02f5Smrg#
727bc5f02f5Smrg# This file is free software; the Free Software Foundation
728bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
729bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
730bc5f02f5Smrg
731bc5f02f5Smrg# AM_PROG_MKDIR_P
732bc5f02f5Smrg# ---------------
733bc5f02f5Smrg# Check for `mkdir -p'.
734bc5f02f5SmrgAC_DEFUN([AM_PROG_MKDIR_P],
735bc5f02f5Smrg[AC_PREREQ([2.60])dnl
736bc5f02f5SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
737bc5f02f5Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
738bc5f02f5Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
739bc5f02f5Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
740bc5f02f5Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
741bc5f02f5Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
742bc5f02f5Smrgdnl adjustment using top_builddir (which is defined more often than
743bc5f02f5Smrgdnl MKDIR_P).
744bc5f02f5SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
745bc5f02f5Smrgcase $mkdir_p in
746bc5f02f5Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
747bc5f02f5Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
748bc5f02f5Smrgesac
749bc5f02f5Smrg])
750bc5f02f5Smrg
751bc5f02f5Smrg# Helper functions for option handling.                     -*- Autoconf -*-
752bc5f02f5Smrg
753bc5f02f5Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
754bc5f02f5Smrg#
755bc5f02f5Smrg# This file is free software; the Free Software Foundation
756bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
757bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
758bc5f02f5Smrg
759bc5f02f5Smrg# serial 4
760439fab64Smrg
761439fab64Smrg# _AM_MANGLE_OPTION(NAME)
762439fab64Smrg# -----------------------
763439fab64SmrgAC_DEFUN([_AM_MANGLE_OPTION],
764439fab64Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765439fab64Smrg
766439fab64Smrg# _AM_SET_OPTION(NAME)
767439fab64Smrg# ------------------------------
768439fab64Smrg# Set option NAME.  Presently that only means defining a flag for this option.
769439fab64SmrgAC_DEFUN([_AM_SET_OPTION],
770439fab64Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
771439fab64Smrg
772439fab64Smrg# _AM_SET_OPTIONS(OPTIONS)
773439fab64Smrg# ----------------------------------
774439fab64Smrg# OPTIONS is a space-separated list of Automake options.
775439fab64SmrgAC_DEFUN([_AM_SET_OPTIONS],
776bc5f02f5Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
777439fab64Smrg
778439fab64Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
779439fab64Smrg# -------------------------------------------
780439fab64Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
781439fab64SmrgAC_DEFUN([_AM_IF_OPTION],
782439fab64Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783439fab64Smrg
784bc5f02f5Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785439fab64Smrg
786bc5f02f5Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
787bc5f02f5Smrg# Free Software Foundation, Inc.
788bc5f02f5Smrg#
789bc5f02f5Smrg# This file is free software; the Free Software Foundation
790bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
791bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
792439fab64Smrg
793bc5f02f5Smrg# serial 5
794439fab64Smrg
795439fab64Smrg# AM_SANITY_CHECK
796439fab64Smrg# ---------------
797439fab64SmrgAC_DEFUN([AM_SANITY_CHECK],
798439fab64Smrg[AC_MSG_CHECKING([whether build environment is sane])
799439fab64Smrg# Just in case
800439fab64Smrgsleep 1
801439fab64Smrgecho timestamp > conftest.file
802bc5f02f5Smrg# Reject unsafe characters in $srcdir or the absolute working directory
803bc5f02f5Smrg# name.  Accept space and tab only in the latter.
804bc5f02f5Smrgam_lf='
805bc5f02f5Smrg'
806bc5f02f5Smrgcase `pwd` in
807bc5f02f5Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
808bc5f02f5Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
809bc5f02f5Smrgesac
810bc5f02f5Smrgcase $srcdir in
811bc5f02f5Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
812bc5f02f5Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
813bc5f02f5Smrgesac
814bc5f02f5Smrg
815439fab64Smrg# Do `set' in a subshell so we don't clobber the current shell's
816439fab64Smrg# arguments.  Must try -L first in case configure is actually a
817439fab64Smrg# symlink; some systems play weird games with the mod time of symlinks
818439fab64Smrg# (eg FreeBSD returns the mod time of the symlink's containing
819439fab64Smrg# directory).
820439fab64Smrgif (
821bc5f02f5Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
822439fab64Smrg   if test "$[*]" = "X"; then
823439fab64Smrg      # -L didn't work.
824bc5f02f5Smrg      set X `ls -t "$srcdir/configure" conftest.file`
825439fab64Smrg   fi
826439fab64Smrg   rm -f conftest.file
827439fab64Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
828439fab64Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
829439fab64Smrg
830439fab64Smrg      # If neither matched, then we have a broken ls.  This can happen
831439fab64Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
832439fab64Smrg      # broken ls alias from the environment.  This has actually
833439fab64Smrg      # happened.  Such a system could not be considered "sane".
834439fab64Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
835439fab64Smrgalias in your environment])
836439fab64Smrg   fi
837439fab64Smrg
838439fab64Smrg   test "$[2]" = conftest.file
839439fab64Smrg   )
840439fab64Smrgthen
841439fab64Smrg   # Ok.
842439fab64Smrg   :
843439fab64Smrgelse
844439fab64Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
845439fab64SmrgCheck your system clock])
846439fab64Smrgfi
847439fab64SmrgAC_MSG_RESULT(yes)])
848439fab64Smrg
8497cf0acd0Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
8507cf0acd0Smrg#
8517cf0acd0Smrg# This file is free software; the Free Software Foundation
8527cf0acd0Smrg# gives unlimited permission to copy and/or distribute it,
8537cf0acd0Smrg# with or without modifications, as long as this notice is preserved.
8547cf0acd0Smrg
8557cf0acd0Smrg# serial 1
8567cf0acd0Smrg
8577cf0acd0Smrg# AM_SILENT_RULES([DEFAULT])
8587cf0acd0Smrg# --------------------------
8597cf0acd0Smrg# Enable less verbose build rules; with the default set to DEFAULT
8607cf0acd0Smrg# (`yes' being less verbose, `no' or empty being verbose).
8617cf0acd0SmrgAC_DEFUN([AM_SILENT_RULES],
8627cf0acd0Smrg[AC_ARG_ENABLE([silent-rules],
8637cf0acd0Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8647cf0acd0Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8657cf0acd0Smrgcase $enable_silent_rules in
8667cf0acd0Smrgyes) AM_DEFAULT_VERBOSITY=0;;
8677cf0acd0Smrgno)  AM_DEFAULT_VERBOSITY=1;;
8687cf0acd0Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8697cf0acd0Smrgesac
8707cf0acd0SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8717cf0acd0SmrgAM_BACKSLASH='\'
8727cf0acd0SmrgAC_SUBST([AM_BACKSLASH])dnl
8737cf0acd0Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8747cf0acd0Smrg])
8757cf0acd0Smrg
876bc5f02f5Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
877439fab64Smrg#
878bc5f02f5Smrg# This file is free software; the Free Software Foundation
879bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
880bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
881439fab64Smrg
882439fab64Smrg# AM_PROG_INSTALL_STRIP
883bc5f02f5Smrg# ---------------------
884439fab64Smrg# One issue with vendor `install' (even GNU) is that you can't
885439fab64Smrg# specify the program used to strip binaries.  This is especially
886439fab64Smrg# annoying in cross-compiling environments, where the build's strip
887439fab64Smrg# is unlikely to handle the host's binaries.
888439fab64Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
889439fab64Smrg# always use install-sh in `make install-strip', and initialize
890439fab64Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
891439fab64SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
892439fab64Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
893439fab64Smrg# Installed binaries are usually stripped using `strip' when the user
894439fab64Smrg# run `make install-strip'.  However `strip' might not be the right
895439fab64Smrg# tool to use in cross-compilation environments, therefore Automake
896439fab64Smrg# will honor the `STRIP' environment variable to overrule this program.
897439fab64Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
898439fab64Smrgif test "$cross_compiling" != no; then
899439fab64Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
900439fab64Smrgfi
901bc5f02f5SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
902439fab64SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
903439fab64Smrg
904bc5f02f5Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
905bc5f02f5Smrg#
906bc5f02f5Smrg# This file is free software; the Free Software Foundation
907bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
908bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
909439fab64Smrg
910bc5f02f5Smrg# serial 2
911439fab64Smrg
912bc5f02f5Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
913bc5f02f5Smrg# ---------------------------
914bc5f02f5Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
915bc5f02f5Smrg# This macro is traced by Automake.
916bc5f02f5SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
917439fab64Smrg
918bc5f02f5Smrg# AM_SUBST_NOTMAKE(VARIABLE)
919bc5f02f5Smrg# ---------------------------
920bc5f02f5Smrg# Public sister of _AM_SUBST_NOTMAKE.
921bc5f02f5SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
922439fab64Smrg
923bc5f02f5Smrg# Check how to create a tarball.                            -*- Autoconf -*-
924439fab64Smrg
925bc5f02f5Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
926bc5f02f5Smrg#
927bc5f02f5Smrg# This file is free software; the Free Software Foundation
928bc5f02f5Smrg# gives unlimited permission to copy and/or distribute it,
929bc5f02f5Smrg# with or without modifications, as long as this notice is preserved.
930bc5f02f5Smrg
931bc5f02f5Smrg# serial 2
932bc5f02f5Smrg
933bc5f02f5Smrg# _AM_PROG_TAR(FORMAT)
934bc5f02f5Smrg# --------------------
935bc5f02f5Smrg# Check how to create a tarball in format FORMAT.
936bc5f02f5Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
937bc5f02f5Smrg#
938bc5f02f5Smrg# Substitute a variable $(am__tar) that is a command
939bc5f02f5Smrg# writing to stdout a FORMAT-tarball containing the directory
940bc5f02f5Smrg# $tardir.
941bc5f02f5Smrg#     tardir=directory && $(am__tar) > result.tar
942bc5f02f5Smrg#
943bc5f02f5Smrg# Substitute a variable $(am__untar) that extract such
944bc5f02f5Smrg# a tarball read from stdin.
945bc5f02f5Smrg#     $(am__untar) < result.tar
946bc5f02f5SmrgAC_DEFUN([_AM_PROG_TAR],
947bc5f02f5Smrg[# Always define AMTAR for backward compatibility.
948bc5f02f5SmrgAM_MISSING_PROG([AMTAR], [tar])
949bc5f02f5Smrgm4_if([$1], [v7],
950bc5f02f5Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
951bc5f02f5Smrg     [m4_case([$1], [ustar],, [pax],,
952bc5f02f5Smrg              [m4_fatal([Unknown tar format])])
953bc5f02f5SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
954bc5f02f5Smrg# Loop over all known methods to create a tar archive until one works.
955bc5f02f5Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
956bc5f02f5Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
957bc5f02f5Smrg# Do not fold the above two line into one, because Tru64 sh and
958bc5f02f5Smrg# Solaris sh will not grok spaces in the rhs of `-'.
959bc5f02f5Smrgfor _am_tool in $_am_tools
960bc5f02f5Smrgdo
961bc5f02f5Smrg  case $_am_tool in
962bc5f02f5Smrg  gnutar)
963bc5f02f5Smrg    for _am_tar in tar gnutar gtar;
964bc5f02f5Smrg    do
965bc5f02f5Smrg      AM_RUN_LOG([$_am_tar --version]) && break
966bc5f02f5Smrg    done
967bc5f02f5Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
968bc5f02f5Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
969bc5f02f5Smrg    am__untar="$_am_tar -xf -"
970bc5f02f5Smrg    ;;
971bc5f02f5Smrg  plaintar)
972bc5f02f5Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
973bc5f02f5Smrg    # ustar tarball either.
974bc5f02f5Smrg    (tar --version) >/dev/null 2>&1 && continue
975bc5f02f5Smrg    am__tar='tar chf - "$$tardir"'
976bc5f02f5Smrg    am__tar_='tar chf - "$tardir"'
977bc5f02f5Smrg    am__untar='tar xf -'
978bc5f02f5Smrg    ;;
979bc5f02f5Smrg  pax)
980bc5f02f5Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
981bc5f02f5Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
982bc5f02f5Smrg    am__untar='pax -r'
983bc5f02f5Smrg    ;;
984bc5f02f5Smrg  cpio)
985bc5f02f5Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
986bc5f02f5Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987bc5f02f5Smrg    am__untar='cpio -i -H $1 -d'
988bc5f02f5Smrg    ;;
989bc5f02f5Smrg  none)
990bc5f02f5Smrg    am__tar=false
991bc5f02f5Smrg    am__tar_=false
992bc5f02f5Smrg    am__untar=false
993bc5f02f5Smrg    ;;
994bc5f02f5Smrg  esac
995bc5f02f5Smrg
996bc5f02f5Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
997bc5f02f5Smrg  # and am__untar set.
998bc5f02f5Smrg  test -n "${am_cv_prog_tar_$1}" && break
999bc5f02f5Smrg
1000bc5f02f5Smrg  # tar/untar a dummy directory, and stop if the command works
1001bc5f02f5Smrg  rm -rf conftest.dir
1002bc5f02f5Smrg  mkdir conftest.dir
1003bc5f02f5Smrg  echo GrepMe > conftest.dir/file
1004bc5f02f5Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1005bc5f02f5Smrg  rm -rf conftest.dir
1006bc5f02f5Smrg  if test -s conftest.tar; then
1007bc5f02f5Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
1008bc5f02f5Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1009bc5f02f5Smrg  fi
1010bc5f02f5Smrgdone
1011bc5f02f5Smrgrm -rf conftest.dir
1012bc5f02f5Smrg
1013bc5f02f5SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1014bc5f02f5SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1015bc5f02f5SmrgAC_SUBST([am__tar])
1016bc5f02f5SmrgAC_SUBST([am__untar])
1017bc5f02f5Smrg]) # _AM_PROG_TAR
1018bc5f02f5Smrg
1019bc5f02f5Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1020bc5f02f5Smrgdnl
10217cf0acd0Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
1022bc5f02f5Smrgdnl 
1023bc5f02f5Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10247cf0acd0Smrgdnl copy of this software and associated documentation files (the "Software"),
10257cf0acd0Smrgdnl to deal in the Software without restriction, including without limitation
10267cf0acd0Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
10277cf0acd0Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
10287cf0acd0Smrgdnl Software is furnished to do so, subject to the following conditions:
1029bc5f02f5Smrgdnl
10307cf0acd0Smrgdnl The above copyright notice and this permission notice (including the next
10317cf0acd0Smrgdnl paragraph) shall be included in all copies or substantial portions of the
10327cf0acd0Smrgdnl Software.
1033bc5f02f5Smrgdnl
10347cf0acd0Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10357cf0acd0Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10367cf0acd0Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
10377cf0acd0Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10387cf0acd0Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
10397cf0acd0Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
10407cf0acd0Smrgdnl DEALINGS IN THE SOFTWARE.
1041bc5f02f5Smrg
1042bc5f02f5Smrg# XORG_MACROS_VERSION(required-version)
1043bc5f02f5Smrg# -------------------------------------
1044bc5f02f5Smrg# Minimum version: 1.1.0
1045bc5f02f5Smrg#
1046bc5f02f5Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1047bc5f02f5Smrg# your configure.ac with the minimum required version, such as:
1048bc5f02f5Smrg# XORG_MACROS_VERSION(1.1)
1049bc5f02f5Smrg#
1050bc5f02f5Smrg# To ensure that this macro is defined, also add:
1051bc5f02f5Smrg# m4_ifndef([XORG_MACROS_VERSION],
1052bc5f02f5Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1053bc5f02f5Smrg#
1054bc5f02f5Smrg#
1055bc5f02f5Smrg# See the "minimum version" comment for each macro you use to see what 
1056bc5f02f5Smrg# version you require.
1057bc5f02f5Smrgm4_defun([XORG_MACROS_VERSION],[
10587cf0acd0Smrgm4_define([vers_have], [1.11.0])
1059bc5f02f5Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1060bc5f02f5Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1061bc5f02f5Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1062bc5f02f5Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1063bc5f02f5Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1064bc5f02f5Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1065bc5f02f5Smrgm4_undefine([vers_have])
1066bc5f02f5Smrgm4_undefine([maj_have])
1067bc5f02f5Smrgm4_undefine([maj_needed])
1068bc5f02f5Smrg]) # XORG_MACROS_VERSION
1069bc5f02f5Smrg
1070bc5f02f5Smrg# XORG_PROG_RAWCPP()
1071bc5f02f5Smrg# ------------------
1072bc5f02f5Smrg# Minimum version: 1.0.0
1073bc5f02f5Smrg#
1074bc5f02f5Smrg# Find cpp program and necessary flags for use in pre-processing text files
1075bc5f02f5Smrg# such as man pages and config files
1076bc5f02f5SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1077bc5f02f5SmrgAC_REQUIRE([AC_PROG_CPP])
1078bc5f02f5SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1079bc5f02f5Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1080bc5f02f5Smrg
1081bc5f02f5Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1082bc5f02f5Smrg# which is not the best choice for supporting other OS'es, but covers most
1083bc5f02f5Smrg# of the ones we need for now.
1084bc5f02f5SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1085bc5f02f5SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1086bc5f02f5Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1087bc5f02f5Smrg	AC_MSG_RESULT([no])
1088439fab64Smrgelse
1089bc5f02f5Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1090bc5f02f5Smrg		RAWCPPFLAGS=-undef
1091bc5f02f5Smrg		AC_MSG_RESULT([yes])
1092bc5f02f5Smrg	# under Cygwin unix is still defined even with -undef
1093bc5f02f5Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1094bc5f02f5Smrg		RAWCPPFLAGS="-undef -ansi"
1095bc5f02f5Smrg		AC_MSG_RESULT([yes, with -ansi])
1096bc5f02f5Smrg	else
1097bc5f02f5Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1098bc5f02f5Smrg	fi
1099439fab64Smrgfi
1100bc5f02f5Smrgrm -f conftest.$ac_ext
1101439fab64Smrg
1102bc5f02f5SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1103bc5f02f5SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1104bc5f02f5Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1105bc5f02f5Smrg	AC_MSG_RESULT([no])
1106bc5f02f5Smrgelse
1107bc5f02f5Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1108bc5f02f5Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1109bc5f02f5Smrg		AC_MSG_RESULT([yes])
1110bc5f02f5Smrg	else
1111bc5f02f5Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1112bc5f02f5Smrg	fi
1113bc5f02f5Smrgfi
1114bc5f02f5Smrgrm -f conftest.$ac_ext
1115bc5f02f5SmrgAC_SUBST(RAWCPPFLAGS)
1116bc5f02f5Smrg]) # XORG_PROG_RAWCPP
1117439fab64Smrg
1118bc5f02f5Smrg# XORG_MANPAGE_SECTIONS()
1119bc5f02f5Smrg# -----------------------
1120bc5f02f5Smrg# Minimum version: 1.0.0
1121bc5f02f5Smrg#
1122bc5f02f5Smrg# Determine which sections man pages go in for the different man page types
1123bc5f02f5Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1124bc5f02f5Smrg# Not sure if there's any better way than just hardcoding by OS name.
1125bc5f02f5Smrg# Override default settings by setting environment variables
11267cf0acd0Smrg# Added MAN_SUBSTS in version 1.8
11277cf0acd0Smrg# Added AC_PROG_SED in version 1.8
1128439fab64Smrg
1129bc5f02f5SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1130bc5f02f5SmrgAC_REQUIRE([AC_CANONICAL_HOST])
11317cf0acd0SmrgAC_REQUIRE([AC_PROG_SED])
1132439fab64Smrg
1133bc5f02f5Smrgif test x$APP_MAN_SUFFIX = x    ; then
1134bc5f02f5Smrg    APP_MAN_SUFFIX=1
1135bc5f02f5Smrgfi
1136bc5f02f5Smrgif test x$APP_MAN_DIR = x    ; then
1137bc5f02f5Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1138bc5f02f5Smrgfi
1139439fab64Smrg
1140bc5f02f5Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1141bc5f02f5Smrg    LIB_MAN_SUFFIX=3
1142bc5f02f5Smrgfi
1143bc5f02f5Smrgif test x$LIB_MAN_DIR = x    ; then
1144bc5f02f5Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1145bc5f02f5Smrgfi
1146439fab64Smrg
1147bc5f02f5Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1148bc5f02f5Smrg    case $host_os in
1149bc5f02f5Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1150bc5f02f5Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1151bc5f02f5Smrg    esac
1152bc5f02f5Smrgfi
1153bc5f02f5Smrgif test x$FILE_MAN_DIR = x    ; then
1154bc5f02f5Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1155bc5f02f5Smrgfi
1156439fab64Smrg
1157bc5f02f5Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1158bc5f02f5Smrg    case $host_os in
1159bc5f02f5Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1160bc5f02f5Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1161bc5f02f5Smrg    esac
1162bc5f02f5Smrgfi
1163bc5f02f5Smrgif test x$MISC_MAN_DIR = x    ; then
1164bc5f02f5Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1165bc5f02f5Smrgfi
1166439fab64Smrg
1167bc5f02f5Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1168bc5f02f5Smrg    case $host_os in
1169bc5f02f5Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1170bc5f02f5Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1171bc5f02f5Smrg    esac
1172bc5f02f5Smrgfi
1173bc5f02f5Smrgif test x$DRIVER_MAN_DIR = x    ; then
1174bc5f02f5Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1175bc5f02f5Smrgfi
1176439fab64Smrg
1177bc5f02f5Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1178bc5f02f5Smrg    case $host_os in
1179bc5f02f5Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1180bc5f02f5Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1181439fab64Smrg    esac
1182bc5f02f5Smrgfi
1183bc5f02f5Smrgif test x$ADMIN_MAN_DIR = x    ; then
1184bc5f02f5Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1185bc5f02f5Smrgfi
1186439fab64Smrg
1187bc5f02f5Smrg
1188bc5f02f5SmrgAC_SUBST([APP_MAN_SUFFIX])
1189bc5f02f5SmrgAC_SUBST([LIB_MAN_SUFFIX])
1190bc5f02f5SmrgAC_SUBST([FILE_MAN_SUFFIX])
1191bc5f02f5SmrgAC_SUBST([MISC_MAN_SUFFIX])
1192bc5f02f5SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1193bc5f02f5SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1194bc5f02f5SmrgAC_SUBST([APP_MAN_DIR])
1195bc5f02f5SmrgAC_SUBST([LIB_MAN_DIR])
1196bc5f02f5SmrgAC_SUBST([FILE_MAN_DIR])
1197bc5f02f5SmrgAC_SUBST([MISC_MAN_DIR])
1198bc5f02f5SmrgAC_SUBST([DRIVER_MAN_DIR])
1199bc5f02f5SmrgAC_SUBST([ADMIN_MAN_DIR])
12007cf0acd0Smrg
12017cf0acd0SmrgXORG_MAN_PAGE="X Version 11"
12027cf0acd0SmrgAC_SUBST([XORG_MAN_PAGE])
12037cf0acd0SmrgMAN_SUBSTS="\
12047cf0acd0Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12057cf0acd0Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
12067cf0acd0Smrg	-e 's|__xservername__|Xorg|g' \
12077cf0acd0Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
12087cf0acd0Smrg	-e 's|__projectroot__|\$(prefix)|g' \
12097cf0acd0Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
12107cf0acd0Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
12117cf0acd0Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
12127cf0acd0Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
12137cf0acd0Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
12147cf0acd0Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
12157cf0acd0Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
12167cf0acd0SmrgAC_SUBST([MAN_SUBSTS])
12177cf0acd0Smrg
1218bc5f02f5Smrg]) # XORG_MANPAGE_SECTIONS
1219bc5f02f5Smrg
12207cf0acd0Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
12217cf0acd0Smrg# ------------------------
12227cf0acd0Smrg# Minimum version: 1.7.0
12237cf0acd0Smrg#
12247cf0acd0Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
12257cf0acd0Smrg# provided by xorg-sgml-doctools, if installed.
12267cf0acd0SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
12277cf0acd0SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
12287cf0acd0SmrgXORG_SGML_PATH=
12297cf0acd0SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
12307cf0acd0Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
12317cf0acd0Smrg    [m4_ifval([$1],[:],
12327cf0acd0Smrg        [if test x"$cross_compiling" != x"yes" ; then
12337cf0acd0Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
12347cf0acd0Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
12357cf0acd0Smrg         fi])
12367cf0acd0Smrg    ])
12377cf0acd0Smrg
12387cf0acd0Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
12397cf0acd0Smrg# the path and the name of the doc stylesheet
12407cf0acd0Smrgif test "x$XORG_SGML_PATH" != "x" ; then
12417cf0acd0Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
12427cf0acd0Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
12437cf0acd0Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
12447cf0acd0Smrgelse
12457cf0acd0Smrg   AC_MSG_RESULT([no])
12467cf0acd0Smrgfi
12477cf0acd0Smrg
12487cf0acd0SmrgAC_SUBST(XORG_SGML_PATH)
12497cf0acd0SmrgAC_SUBST(STYLESHEET_SRCDIR)
12507cf0acd0SmrgAC_SUBST(XSL_STYLESHEET)
12517cf0acd0SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
12527cf0acd0Smrg]) # XORG_CHECK_SGML_DOCTOOLS
12537cf0acd0Smrg
1254bc5f02f5Smrg# XORG_CHECK_LINUXDOC
1255bc5f02f5Smrg# -------------------
1256bc5f02f5Smrg# Minimum version: 1.0.0
1257bc5f02f5Smrg#
1258bc5f02f5Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1259bc5f02f5Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1260bc5f02f5Smrg# Whether or not the necessary tools and files are found can be checked
1261bc5f02f5Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1262bc5f02f5SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12637cf0acd0SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
12647cf0acd0SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1265439fab64Smrg
1266bc5f02f5SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1267439fab64Smrg
12687cf0acd0SmrgAC_MSG_CHECKING([whether to build documentation])
1269439fab64Smrg
12707cf0acd0Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1271bc5f02f5Smrg   BUILDDOC=yes
1272bc5f02f5Smrgelse
1273bc5f02f5Smrg   BUILDDOC=no
1274439fab64Smrgfi
1275439fab64Smrg
1276bc5f02f5SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1277439fab64Smrg
1278bc5f02f5SmrgAC_MSG_RESULT([$BUILDDOC])
1279439fab64Smrg
12807cf0acd0SmrgAC_MSG_CHECKING([whether to build pdf documentation])
1281439fab64Smrg
12827cf0acd0Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1283bc5f02f5Smrg   BUILDPDFDOC=yes
1284bc5f02f5Smrgelse
1285bc5f02f5Smrg   BUILDPDFDOC=no
1286bc5f02f5Smrgfi
1287439fab64Smrg
1288bc5f02f5SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1289439fab64Smrg
1290bc5f02f5SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1291439fab64Smrg
12927cf0acd0SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1293bc5f02f5SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1294bc5f02f5SmrgMAKE_PDF="$PS2PDF"
1295bc5f02f5SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1296439fab64Smrg
1297bc5f02f5SmrgAC_SUBST(MAKE_TEXT)
1298bc5f02f5SmrgAC_SUBST(MAKE_PS)
1299bc5f02f5SmrgAC_SUBST(MAKE_PDF)
1300bc5f02f5SmrgAC_SUBST(MAKE_HTML)
1301bc5f02f5Smrg]) # XORG_CHECK_LINUXDOC
1302439fab64Smrg
1303bc5f02f5Smrg# XORG_CHECK_DOCBOOK
1304bc5f02f5Smrg# -------------------
1305bc5f02f5Smrg# Minimum version: 1.0.0
1306bc5f02f5Smrg#
1307bc5f02f5Smrg# Checks for the ability to build output formats from SGML DocBook source.
1308bc5f02f5Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1309bc5f02f5Smrg# indicates whether the necessary tools and files are found and, if set,
1310bc5f02f5Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1311bc5f02f5SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
13127cf0acd0SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
13137cf0acd0Smrg
1314bc5f02f5SmrgBUILDTXTDOC=no
1315bc5f02f5SmrgBUILDPDFDOC=no
1316bc5f02f5SmrgBUILDPSDOC=no
1317bc5f02f5SmrgBUILDHTMLDOC=no
1318bc5f02f5Smrg
1319bc5f02f5SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1320bc5f02f5SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1321bc5f02f5SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1322bc5f02f5SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1323bc5f02f5Smrg
13247cf0acd0SmrgAC_MSG_CHECKING([whether to build text documentation])
13257cf0acd0Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1326bc5f02f5Smrg   test x$BUILD_TXTDOC != xno; then
1327bc5f02f5Smrg	BUILDTXTDOC=yes
1328bc5f02f5Smrgfi
1329bc5f02f5SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1330bc5f02f5SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1331439fab64Smrg
13327cf0acd0SmrgAC_MSG_CHECKING([whether to build PDF documentation])
13337cf0acd0Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1334bc5f02f5Smrg   test x$BUILD_PDFDOC != xno; then
1335bc5f02f5Smrg	BUILDPDFDOC=yes
1336bc5f02f5Smrgfi
1337bc5f02f5SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1338bc5f02f5SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1339439fab64Smrg
13407cf0acd0SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
13417cf0acd0Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1342bc5f02f5Smrg   test x$BUILD_PSDOC != xno; then
1343bc5f02f5Smrg	BUILDPSDOC=yes
1344bc5f02f5Smrgfi
1345bc5f02f5SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1346bc5f02f5SmrgAC_MSG_RESULT([$BUILDPSDOC])
1347439fab64Smrg
13487cf0acd0SmrgAC_MSG_CHECKING([whether to build HTML documentation])
13497cf0acd0Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1350bc5f02f5Smrg   test x$BUILD_HTMLDOC != xno; then
1351bc5f02f5Smrg	BUILDHTMLDOC=yes
1352bc5f02f5Smrgfi
1353bc5f02f5SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1354bc5f02f5SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1355439fab64Smrg
1356bc5f02f5SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1357bc5f02f5SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1358bc5f02f5SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1359bc5f02f5SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1360439fab64Smrg
1361bc5f02f5SmrgAC_SUBST(MAKE_TEXT)
1362bc5f02f5SmrgAC_SUBST(MAKE_PS)
1363bc5f02f5SmrgAC_SUBST(MAKE_PDF)
1364bc5f02f5SmrgAC_SUBST(MAKE_HTML)
1365bc5f02f5Smrg]) # XORG_CHECK_DOCBOOK
1366439fab64Smrg
13677cf0acd0Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
13687cf0acd0Smrg# ----------------
13697cf0acd0Smrg# Minimum version: 1.5.0
13707cf0acd0Smrg# Minimum version for optional DEFAULT argument: 1.11.0
13717cf0acd0Smrg#
13727cf0acd0Smrg# Documentation tools are not always available on all platforms and sometimes
13737cf0acd0Smrg# not at the appropriate level. This macro enables a module to test for the
13747cf0acd0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
13757cf0acd0Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
13767cf0acd0Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
13777cf0acd0Smrg# --with-xmlto assumes 'auto'.
13787cf0acd0Smrg#
13797cf0acd0Smrg# Interface to module:
13807cf0acd0Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
13817cf0acd0Smrg# XMLTO:	returns the path of the xmlto program found
13827cf0acd0Smrg#		returns the path set by the user in the environment
13837cf0acd0Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
13847cf0acd0Smrg#		'no' user instructs the module not to use xmlto
13857cf0acd0Smrg#
13867cf0acd0Smrg# Added in version 1.10.0
13877cf0acd0Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
13887cf0acd0Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
13897cf0acd0Smrg#
13907cf0acd0Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
13917cf0acd0Smrg#
13927cf0acd0SmrgAC_DEFUN([XORG_WITH_XMLTO],[
13937cf0acd0SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
13947cf0acd0Smrgm4_define([_defopt], m4_default([$2], [auto]))
13957cf0acd0SmrgAC_ARG_WITH(xmlto,
13967cf0acd0Smrg	AS_HELP_STRING([--with-xmlto],
13977cf0acd0Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
13987cf0acd0Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
13997cf0acd0Smrgm4_undefine([_defopt])
14007cf0acd0Smrg
14017cf0acd0Smrgif test "x$use_xmlto" = x"auto"; then
14027cf0acd0Smrg   AC_PATH_PROG([XMLTO], [xmlto])
14037cf0acd0Smrg   if test "x$XMLTO" = "x"; then
14047cf0acd0Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
14057cf0acd0Smrg	have_xmlto=no
14067cf0acd0Smrg   else
14077cf0acd0Smrg        have_xmlto=yes
14087cf0acd0Smrg   fi
14097cf0acd0Smrgelif test "x$use_xmlto" = x"yes" ; then
14107cf0acd0Smrg   AC_PATH_PROG([XMLTO], [xmlto])
14117cf0acd0Smrg   if test "x$XMLTO" = "x"; then
14127cf0acd0Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
14137cf0acd0Smrg   fi
14147cf0acd0Smrg   have_xmlto=yes
14157cf0acd0Smrgelif test "x$use_xmlto" = x"no" ; then
14167cf0acd0Smrg   if test "x$XMLTO" != "x"; then
14177cf0acd0Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
14187cf0acd0Smrg   fi
14197cf0acd0Smrg   have_xmlto=no
14207cf0acd0Smrgelse
14217cf0acd0Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
14227cf0acd0Smrgfi
14237cf0acd0Smrg
14247cf0acd0Smrg# Test for a minimum version of xmlto, if provided.
14257cf0acd0Smrgm4_ifval([$1],
14267cf0acd0Smrg[if test "$have_xmlto" = yes; then
14277cf0acd0Smrg    # scrape the xmlto version
14287cf0acd0Smrg    AC_MSG_CHECKING([the xmlto version])
14297cf0acd0Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
14307cf0acd0Smrg    AC_MSG_RESULT([$xmlto_version])
14317cf0acd0Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
14327cf0acd0Smrg        [if test "x$use_xmlto" = xauto; then
14337cf0acd0Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
14347cf0acd0Smrg            have_xmlto=no
14357cf0acd0Smrg        else
14367cf0acd0Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
14377cf0acd0Smrg        fi])
14387cf0acd0Smrgfi])
14397cf0acd0Smrg
14407cf0acd0Smrg# Test for the ability of xmlto to generate a text target
14417cf0acd0Smrghave_xmlto_text=no
14427cf0acd0Smrgcat > conftest.xml << "EOF"
14437cf0acd0SmrgEOF
14447cf0acd0SmrgAS_IF([test "$have_xmlto" = yes],
14457cf0acd0Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
14467cf0acd0Smrg             [have_xmlto_text=yes],
14477cf0acd0Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
14487cf0acd0Smrgrm -f conftest.xml
14497cf0acd0SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
14507cf0acd0SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
14517cf0acd0Smrg]) # XORG_WITH_XMLTO
14527cf0acd0Smrg
14537cf0acd0Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
14547cf0acd0Smrg# ----------------
14557cf0acd0Smrg# Minimum version: 1.5.0
14567cf0acd0Smrg# Minimum version for optional DEFAULT argument: 1.11.0
14577cf0acd0Smrg#
14587cf0acd0Smrg# Documentation tools are not always available on all platforms and sometimes
14597cf0acd0Smrg# not at the appropriate level. This macro enables a module to test for the
14607cf0acd0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
14617cf0acd0Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
14627cf0acd0Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
14637cf0acd0Smrg# --with-asciidoc assumes 'auto'.
14647cf0acd0Smrg#
14657cf0acd0Smrg# Interface to module:
14667cf0acd0Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
14677cf0acd0Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
14687cf0acd0Smrg#		 returns the path set by the user in the environment
14697cf0acd0Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
14707cf0acd0Smrg#		  'no' user instructs the module not to use asciidoc
14717cf0acd0Smrg#
14727cf0acd0Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
14737cf0acd0Smrg#
14747cf0acd0SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
14757cf0acd0SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
14767cf0acd0Smrgm4_define([_defopt], m4_default([$2], [auto]))
14777cf0acd0SmrgAC_ARG_WITH(asciidoc,
14787cf0acd0Smrg	AS_HELP_STRING([--with-asciidoc],
14797cf0acd0Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
14807cf0acd0Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
14817cf0acd0Smrgm4_undefine([_defopt])
14827cf0acd0Smrg
14837cf0acd0Smrgif test "x$use_asciidoc" = x"auto"; then
14847cf0acd0Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
14857cf0acd0Smrg   if test "x$ASCIIDOC" = "x"; then
14867cf0acd0Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
14877cf0acd0Smrg	have_asciidoc=no
14887cf0acd0Smrg   else
14897cf0acd0Smrg        have_asciidoc=yes
14907cf0acd0Smrg   fi
14917cf0acd0Smrgelif test "x$use_asciidoc" = x"yes" ; then
14927cf0acd0Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
14937cf0acd0Smrg   if test "x$ASCIIDOC" = "x"; then
14947cf0acd0Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
14957cf0acd0Smrg   fi
14967cf0acd0Smrg   have_asciidoc=yes
14977cf0acd0Smrgelif test "x$use_asciidoc" = x"no" ; then
14987cf0acd0Smrg   if test "x$ASCIIDOC" != "x"; then
14997cf0acd0Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
15007cf0acd0Smrg   fi
15017cf0acd0Smrg   have_asciidoc=no
15027cf0acd0Smrgelse
15037cf0acd0Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
15047cf0acd0Smrgfi
15057cf0acd0Smrgm4_ifval([$1],
15067cf0acd0Smrg[if test "$have_asciidoc" = yes; then
15077cf0acd0Smrg    # scrape the asciidoc version
15087cf0acd0Smrg    AC_MSG_CHECKING([the asciidoc version])
15097cf0acd0Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
15107cf0acd0Smrg    AC_MSG_RESULT([$asciidoc_version])
15117cf0acd0Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
15127cf0acd0Smrg        [if test "x$use_asciidoc" = xauto; then
15137cf0acd0Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
15147cf0acd0Smrg            have_asciidoc=no
15157cf0acd0Smrg        else
15167cf0acd0Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
15177cf0acd0Smrg        fi])
15187cf0acd0Smrgfi])
15197cf0acd0SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
15207cf0acd0Smrg]) # XORG_WITH_ASCIIDOC
15217cf0acd0Smrg
15227cf0acd0Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
15237cf0acd0Smrg# --------------------------------
15247cf0acd0Smrg# Minimum version: 1.5.0
15257cf0acd0Smrg# Minimum version for optional DEFAULT argument: 1.11.0
15267cf0acd0Smrg#
15277cf0acd0Smrg# Documentation tools are not always available on all platforms and sometimes
15287cf0acd0Smrg# not at the appropriate level. This macro enables a module to test for the
15297cf0acd0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
15307cf0acd0Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
15317cf0acd0Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
15327cf0acd0Smrg# --with-doxygen assumes 'auto'.
15337cf0acd0Smrg#
15347cf0acd0Smrg# Interface to module:
15357cf0acd0Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
15367cf0acd0Smrg# DOXYGEN:	 returns the path of the doxygen program found
15377cf0acd0Smrg#		 returns the path set by the user in the environment
15387cf0acd0Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
15397cf0acd0Smrg#		  'no' user instructs the module not to use doxygen
15407cf0acd0Smrg#
15417cf0acd0Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
15427cf0acd0Smrg#
15437cf0acd0SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
15447cf0acd0SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
15457cf0acd0Smrgm4_define([_defopt], m4_default([$2], [auto]))
15467cf0acd0SmrgAC_ARG_WITH(doxygen,
15477cf0acd0Smrg	AS_HELP_STRING([--with-doxygen],
15487cf0acd0Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
15497cf0acd0Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
15507cf0acd0Smrgm4_undefine([_defopt])
15517cf0acd0Smrg
15527cf0acd0Smrgif test "x$use_doxygen" = x"auto"; then
15537cf0acd0Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15547cf0acd0Smrg   if test "x$DOXYGEN" = "x"; then
15557cf0acd0Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
15567cf0acd0Smrg	have_doxygen=no
15577cf0acd0Smrg   else
15587cf0acd0Smrg        have_doxygen=yes
15597cf0acd0Smrg   fi
15607cf0acd0Smrgelif test "x$use_doxygen" = x"yes" ; then
15617cf0acd0Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
15627cf0acd0Smrg   if test "x$DOXYGEN" = "x"; then
15637cf0acd0Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
15647cf0acd0Smrg   fi
15657cf0acd0Smrg   have_doxygen=yes
15667cf0acd0Smrgelif test "x$use_doxygen" = x"no" ; then
15677cf0acd0Smrg   if test "x$DOXYGEN" != "x"; then
15687cf0acd0Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
15697cf0acd0Smrg   fi
15707cf0acd0Smrg   have_doxygen=no
15717cf0acd0Smrgelse
15727cf0acd0Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
15737cf0acd0Smrgfi
15747cf0acd0Smrgm4_ifval([$1],
15757cf0acd0Smrg[if test "$have_doxygen" = yes; then
15767cf0acd0Smrg    # scrape the doxygen version
15777cf0acd0Smrg    AC_MSG_CHECKING([the doxygen version])
15787cf0acd0Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
15797cf0acd0Smrg    AC_MSG_RESULT([$doxygen_version])
15807cf0acd0Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
15817cf0acd0Smrg        [if test "x$use_doxygen" = xauto; then
15827cf0acd0Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
15837cf0acd0Smrg            have_doxygen=no
15847cf0acd0Smrg        else
15857cf0acd0Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
15867cf0acd0Smrg        fi])
15877cf0acd0Smrgfi])
15887cf0acd0SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
15897cf0acd0Smrg]) # XORG_WITH_DOXYGEN
15907cf0acd0Smrg
15917cf0acd0Smrg# XORG_WITH_GROFF([DEFAULT])
15927cf0acd0Smrg# ----------------
15937cf0acd0Smrg# Minimum version: 1.6.0
15947cf0acd0Smrg# Minimum version for optional DEFAULT argument: 1.11.0
15957cf0acd0Smrg#
15967cf0acd0Smrg# Documentation tools are not always available on all platforms and sometimes
15977cf0acd0Smrg# not at the appropriate level. This macro enables a module to test for the
15987cf0acd0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
15997cf0acd0Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
16007cf0acd0Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
16017cf0acd0Smrg# --with-groff assumes 'auto'.
16027cf0acd0Smrg#
16037cf0acd0Smrg# Interface to module:
16047cf0acd0Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
16057cf0acd0Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
16067cf0acd0Smrg# HAVE_GROFF_MS: the -ms macros package
16077cf0acd0Smrg# GROFF:	 returns the path of the groff program found
16087cf0acd0Smrg#		 returns the path set by the user in the environment
16097cf0acd0Smrg# --with-groff:	 'yes' user instructs the module to use groff
16107cf0acd0Smrg#		 'no' user instructs the module not to use groff
16117cf0acd0Smrg#
16127cf0acd0Smrg# Added in version 1.9.0:
16137cf0acd0Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
16147cf0acd0Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
16157cf0acd0Smrg#		   psselect from the psutils package.
16167cf0acd0Smrg#		   the ghostcript package. Refer to the grohtml man pages
16177cf0acd0Smrg#
16187cf0acd0Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
16197cf0acd0Smrg#
16207cf0acd0Smrg# OS and distros often splits groff in a basic and full package, the former
16217cf0acd0Smrg# having the groff program and the later having devices, fonts and macros
16227cf0acd0Smrg# Checking for the groff executable is not enough.
16237cf0acd0Smrg#
16247cf0acd0Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
16257cf0acd0Smrg# unset HAVE_GROFF or GROFF env variables.
16267cf0acd0Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
16277cf0acd0Smrg#
16287cf0acd0SmrgAC_DEFUN([XORG_WITH_GROFF],[
16297cf0acd0SmrgAC_ARG_VAR([GROFF], [Path to groff command])
16307cf0acd0Smrgm4_define([_defopt], m4_default([$1], [auto]))
16317cf0acd0SmrgAC_ARG_WITH(groff,
16327cf0acd0Smrg	AS_HELP_STRING([--with-groff],
16337cf0acd0Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
16347cf0acd0Smrg	   [use_groff=$withval], [use_groff=]_defopt)
16357cf0acd0Smrgm4_undefine([_defopt])
16367cf0acd0Smrg
16377cf0acd0Smrgif test "x$use_groff" = x"auto"; then
16387cf0acd0Smrg   AC_PATH_PROG([GROFF], [groff])
16397cf0acd0Smrg   if test "x$GROFF" = "x"; then
16407cf0acd0Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
16417cf0acd0Smrg	have_groff=no
16427cf0acd0Smrg   else
16437cf0acd0Smrg        have_groff=yes
16447cf0acd0Smrg   fi
16457cf0acd0Smrgelif test "x$use_groff" = x"yes" ; then
16467cf0acd0Smrg   AC_PATH_PROG([GROFF], [groff])
16477cf0acd0Smrg   if test "x$GROFF" = "x"; then
16487cf0acd0Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
16497cf0acd0Smrg   fi
16507cf0acd0Smrg   have_groff=yes
16517cf0acd0Smrgelif test "x$use_groff" = x"no" ; then
16527cf0acd0Smrg   if test "x$GROFF" != "x"; then
16537cf0acd0Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
16547cf0acd0Smrg   fi
16557cf0acd0Smrg   have_groff=no
16567cf0acd0Smrgelse
16577cf0acd0Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
16587cf0acd0Smrgfi
16597cf0acd0Smrg
16607cf0acd0Smrg# We have groff, test for the presence of the macro packages
16617cf0acd0Smrgif test "x$have_groff" = x"yes"; then
16627cf0acd0Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
16637cf0acd0Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
16647cf0acd0Smrg        groff_ms_works=yes
16657cf0acd0Smrg    else
16667cf0acd0Smrg        groff_ms_works=no
16677cf0acd0Smrg    fi
16687cf0acd0Smrg    AC_MSG_RESULT([$groff_ms_works])
16697cf0acd0Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
16707cf0acd0Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
16717cf0acd0Smrg        groff_mm_works=yes
16727cf0acd0Smrg    else
16737cf0acd0Smrg        groff_mm_works=no
16747cf0acd0Smrg    fi
16757cf0acd0Smrg    AC_MSG_RESULT([$groff_mm_works])
16767cf0acd0Smrgfi
16777cf0acd0Smrg
16787cf0acd0Smrg# We have groff, test for HTML dependencies, one command per package
16797cf0acd0Smrgif test "x$have_groff" = x"yes"; then
16807cf0acd0Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
16817cf0acd0Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
16827cf0acd0Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
16837cf0acd0Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
16847cf0acd0Smrg      have_groff_html=yes
16857cf0acd0Smrg   else
16867cf0acd0Smrg      have_groff_html=no
16877cf0acd0Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
16887cf0acd0Smrg   fi
16897cf0acd0Smrgfi
16907cf0acd0Smrg
16917cf0acd0Smrg# Set Automake conditionals for Makefiles
16927cf0acd0SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
16937cf0acd0SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
16947cf0acd0SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
16957cf0acd0SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
16967cf0acd0Smrg]) # XORG_WITH_GROFF
16977cf0acd0Smrg
16987cf0acd0Smrg# XORG_WITH_FOP([DEFAULT])
16997cf0acd0Smrg# ----------------
17007cf0acd0Smrg# Minimum version: 1.6.0
17017cf0acd0Smrg# Minimum version for optional DEFAULT argument: 1.11.0
17027cf0acd0Smrg#
17037cf0acd0Smrg# Documentation tools are not always available on all platforms and sometimes
17047cf0acd0Smrg# not at the appropriate level. This macro enables a module to test for the
17057cf0acd0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
17067cf0acd0Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
17077cf0acd0Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
17087cf0acd0Smrg# --with-fop assumes 'auto'.
17097cf0acd0Smrg#
17107cf0acd0Smrg# Interface to module:
17117cf0acd0Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
17127cf0acd0Smrg# FOP:	 	returns the path of the fop program found
17137cf0acd0Smrg#		returns the path set by the user in the environment
17147cf0acd0Smrg# --with-fop: 	'yes' user instructs the module to use fop
17157cf0acd0Smrg#		'no' user instructs the module not to use fop
17167cf0acd0Smrg#
17177cf0acd0Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
17187cf0acd0Smrg#
17197cf0acd0SmrgAC_DEFUN([XORG_WITH_FOP],[
17207cf0acd0SmrgAC_ARG_VAR([FOP], [Path to fop command])
17217cf0acd0Smrgm4_define([_defopt], m4_default([$1], [auto]))
17227cf0acd0SmrgAC_ARG_WITH(fop,
17237cf0acd0Smrg	AS_HELP_STRING([--with-fop],
17247cf0acd0Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
17257cf0acd0Smrg	   [use_fop=$withval], [use_fop=]_defopt)
17267cf0acd0Smrgm4_undefine([_defopt])
17277cf0acd0Smrg
17287cf0acd0Smrgif test "x$use_fop" = x"auto"; then
17297cf0acd0Smrg   AC_PATH_PROG([FOP], [fop])
17307cf0acd0Smrg   if test "x$FOP" = "x"; then
17317cf0acd0Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
17327cf0acd0Smrg	have_fop=no
17337cf0acd0Smrg   else
17347cf0acd0Smrg        have_fop=yes
17357cf0acd0Smrg   fi
17367cf0acd0Smrgelif test "x$use_fop" = x"yes" ; then
17377cf0acd0Smrg   AC_PATH_PROG([FOP], [fop])
17387cf0acd0Smrg   if test "x$FOP" = "x"; then
17397cf0acd0Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
17407cf0acd0Smrg   fi
17417cf0acd0Smrg   have_fop=yes
17427cf0acd0Smrgelif test "x$use_fop" = x"no" ; then
17437cf0acd0Smrg   if test "x$FOP" != "x"; then
17447cf0acd0Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
17457cf0acd0Smrg   fi
17467cf0acd0Smrg   have_fop=no
17477cf0acd0Smrgelse
17487cf0acd0Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
17497cf0acd0Smrgfi
17507cf0acd0SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
17517cf0acd0Smrg]) # XORG_WITH_FOP
17527cf0acd0Smrg
17537cf0acd0Smrg# XORG_WITH_PS2PDF([DEFAULT])
17547cf0acd0Smrg# ----------------
17557cf0acd0Smrg# Minimum version: 1.6.0
17567cf0acd0Smrg# Minimum version for optional DEFAULT argument: 1.11.0
17577cf0acd0Smrg#
17587cf0acd0Smrg# Documentation tools are not always available on all platforms and sometimes
17597cf0acd0Smrg# not at the appropriate level. This macro enables a module to test for the
17607cf0acd0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
17617cf0acd0Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
17627cf0acd0Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
17637cf0acd0Smrg# --with-ps2pdf assumes 'auto'.
17647cf0acd0Smrg#
17657cf0acd0Smrg# Interface to module:
17667cf0acd0Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
17677cf0acd0Smrg# PS2PDF:	returns the path of the ps2pdf program found
17687cf0acd0Smrg#		returns the path set by the user in the environment
17697cf0acd0Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
17707cf0acd0Smrg#		 'no' user instructs the module not to use ps2pdf
17717cf0acd0Smrg#
17727cf0acd0Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
17737cf0acd0Smrg#
17747cf0acd0SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
17757cf0acd0SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
17767cf0acd0Smrgm4_define([_defopt], m4_default([$1], [auto]))
17777cf0acd0SmrgAC_ARG_WITH(ps2pdf,
17787cf0acd0Smrg	AS_HELP_STRING([--with-ps2pdf],
17797cf0acd0Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
17807cf0acd0Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
17817cf0acd0Smrgm4_undefine([_defopt])
17827cf0acd0Smrg
17837cf0acd0Smrgif test "x$use_ps2pdf" = x"auto"; then
17847cf0acd0Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
17857cf0acd0Smrg   if test "x$PS2PDF" = "x"; then
17867cf0acd0Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
17877cf0acd0Smrg	have_ps2pdf=no
17887cf0acd0Smrg   else
17897cf0acd0Smrg        have_ps2pdf=yes
17907cf0acd0Smrg   fi
17917cf0acd0Smrgelif test "x$use_ps2pdf" = x"yes" ; then
17927cf0acd0Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
17937cf0acd0Smrg   if test "x$PS2PDF" = "x"; then
17947cf0acd0Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
17957cf0acd0Smrg   fi
17967cf0acd0Smrg   have_ps2pdf=yes
17977cf0acd0Smrgelif test "x$use_ps2pdf" = x"no" ; then
17987cf0acd0Smrg   if test "x$PS2PDF" != "x"; then
17997cf0acd0Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
18007cf0acd0Smrg   fi
18017cf0acd0Smrg   have_ps2pdf=no
18027cf0acd0Smrgelse
18037cf0acd0Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
18047cf0acd0Smrgfi
18057cf0acd0SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
18067cf0acd0Smrg]) # XORG_WITH_PS2PDF
18077cf0acd0Smrg
18087cf0acd0Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
18097cf0acd0Smrg# ----------------
18107cf0acd0Smrg# Minimum version: 1.6.0
18117cf0acd0Smrg#
18127cf0acd0Smrg# Documentation tools are not always available on all platforms and sometimes
18137cf0acd0Smrg# not at the appropriate level. This macro enables a builder to skip all
18147cf0acd0Smrg# documentation targets except traditional man pages.
18157cf0acd0Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18167cf0acd0Smrg# maximum flexibilty in controlling documentation building.
18177cf0acd0Smrg# Refer to:
18187cf0acd0Smrg# XORG_WITH_XMLTO         --with-xmlto
18197cf0acd0Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18207cf0acd0Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18217cf0acd0Smrg# XORG_WITH_FOP           --with-fop
18227cf0acd0Smrg# XORG_WITH_GROFF         --with-groff
18237cf0acd0Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18247cf0acd0Smrg#
18257cf0acd0Smrg# Interface to module:
18267cf0acd0Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
18277cf0acd0Smrg# --enable-docs: 'yes' user instructs the module to generate docs
18287cf0acd0Smrg#		 'no' user instructs the module not to generate docs
18297cf0acd0Smrg# parm1:	specify the default value, yes or no.
18307cf0acd0Smrg#
18317cf0acd0SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
18327cf0acd0Smrgm4_define([docs_default], m4_default([$1], [yes]))
18337cf0acd0SmrgAC_ARG_ENABLE(docs,
18347cf0acd0Smrg	AS_HELP_STRING([--enable-docs],
18357cf0acd0Smrg	   [Enable building the documentation (default: ]docs_default[)]),
18367cf0acd0Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
18377cf0acd0Smrgm4_undefine([docs_default])
18387cf0acd0SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
18397cf0acd0SmrgAC_MSG_CHECKING([whether to build documentation])
18407cf0acd0SmrgAC_MSG_RESULT([$build_docs])
18417cf0acd0Smrg]) # XORG_ENABLE_DOCS
18427cf0acd0Smrg
18437cf0acd0Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
18447cf0acd0Smrg# ----------------
18457cf0acd0Smrg# Minimum version: 1.6.0
18467cf0acd0Smrg#
18477cf0acd0Smrg# This macro enables a builder to skip all developer documentation.
18487cf0acd0Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18497cf0acd0Smrg# maximum flexibilty in controlling documentation building.
18507cf0acd0Smrg# Refer to:
18517cf0acd0Smrg# XORG_WITH_XMLTO         --with-xmlto
18527cf0acd0Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18537cf0acd0Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18547cf0acd0Smrg# XORG_WITH_FOP           --with-fop
18557cf0acd0Smrg# XORG_WITH_GROFF         --with-groff
18567cf0acd0Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18577cf0acd0Smrg#
18587cf0acd0Smrg# Interface to module:
18597cf0acd0Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
18607cf0acd0Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
18617cf0acd0Smrg#			'no' user instructs the module not to generate developer docs
18627cf0acd0Smrg# parm1:		specify the default value, yes or no.
18637cf0acd0Smrg#
18647cf0acd0SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
18657cf0acd0Smrgm4_define([devel_default], m4_default([$1], [yes]))
18667cf0acd0SmrgAC_ARG_ENABLE(devel-docs,
18677cf0acd0Smrg	AS_HELP_STRING([--enable-devel-docs],
18687cf0acd0Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
18697cf0acd0Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
18707cf0acd0Smrgm4_undefine([devel_default])
18717cf0acd0SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
18727cf0acd0SmrgAC_MSG_CHECKING([whether to build developer documentation])
18737cf0acd0SmrgAC_MSG_RESULT([$build_devel_docs])
18747cf0acd0Smrg]) # XORG_ENABLE_DEVEL_DOCS
18757cf0acd0Smrg
18767cf0acd0Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
18777cf0acd0Smrg# ----------------
18787cf0acd0Smrg# Minimum version: 1.6.0
18797cf0acd0Smrg#
18807cf0acd0Smrg# This macro enables a builder to skip all functional specification targets.
18817cf0acd0Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
18827cf0acd0Smrg# maximum flexibilty in controlling documentation building.
18837cf0acd0Smrg# Refer to:
18847cf0acd0Smrg# XORG_WITH_XMLTO         --with-xmlto
18857cf0acd0Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
18867cf0acd0Smrg# XORG_WITH_DOXYGEN       --with-doxygen
18877cf0acd0Smrg# XORG_WITH_FOP           --with-fop
18887cf0acd0Smrg# XORG_WITH_GROFF         --with-groff
18897cf0acd0Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
18907cf0acd0Smrg#
18917cf0acd0Smrg# Interface to module:
18927cf0acd0Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
18937cf0acd0Smrg# --enable-specs:	'yes' user instructs the module to generate specs
18947cf0acd0Smrg#			'no' user instructs the module not to generate specs
18957cf0acd0Smrg# parm1:		specify the default value, yes or no.
18967cf0acd0Smrg#
18977cf0acd0SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
18987cf0acd0Smrgm4_define([spec_default], m4_default([$1], [yes]))
18997cf0acd0SmrgAC_ARG_ENABLE(specs,
19007cf0acd0Smrg	AS_HELP_STRING([--enable-specs],
19017cf0acd0Smrg	   [Enable building the specs (default: ]spec_default[)]),
19027cf0acd0Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
19037cf0acd0Smrgm4_undefine([spec_default])
19047cf0acd0SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
19057cf0acd0SmrgAC_MSG_CHECKING([whether to build functional specifications])
19067cf0acd0SmrgAC_MSG_RESULT([$build_specs])
19077cf0acd0Smrg]) # XORG_ENABLE_SPECS
19087cf0acd0Smrg
1909bc5f02f5Smrg# XORG_CHECK_MALLOC_ZERO
1910bc5f02f5Smrg# ----------------------
1911bc5f02f5Smrg# Minimum version: 1.0.0
1912bc5f02f5Smrg#
1913bc5f02f5Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1914bc5f02f5Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1915bc5f02f5Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1916bc5f02f5SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1917bc5f02f5SmrgAC_ARG_ENABLE(malloc0returnsnull,
19187cf0acd0Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1919bc5f02f5Smrg		       [malloc(0) returns NULL (default: auto)]),
1920bc5f02f5Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1921bc5f02f5Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1922bc5f02f5Smrg
1923bc5f02f5SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1924bc5f02f5Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
19257cf0acd0Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
19267cf0acd0Smrg#include <stdlib.h>
19277cf0acd0Smrg],[
1928bc5f02f5Smrg    char *m0, *r0, *c0, *p;
1929bc5f02f5Smrg    m0 = malloc(0);
1930bc5f02f5Smrg    p = malloc(10);
1931bc5f02f5Smrg    r0 = realloc(p,0);
19327cf0acd0Smrg    c0 = calloc(0,10);
19337cf0acd0Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
19347cf0acd0Smrg])],
1935bc5f02f5Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
19367cf0acd0Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
19377cf0acd0Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1938bc5f02f5Smrgfi
1939bc5f02f5SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1940439fab64Smrg
1941bc5f02f5Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1942bc5f02f5Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1943bc5f02f5Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1944bc5f02f5Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1945bc5f02f5Smrgelse
1946bc5f02f5Smrg	MALLOC_ZERO_CFLAGS=""
1947bc5f02f5Smrg	XMALLOC_ZERO_CFLAGS=""
1948bc5f02f5Smrg	XTMALLOC_ZERO_CFLAGS=""
1949439fab64Smrgfi
1950439fab64Smrg
1951bc5f02f5SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1952bc5f02f5SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1953bc5f02f5SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1954bc5f02f5Smrg]) # XORG_CHECK_MALLOC_ZERO
1955439fab64Smrg
1956bc5f02f5Smrg# XORG_WITH_LINT()
1957bc5f02f5Smrg# ----------------
1958bc5f02f5Smrg# Minimum version: 1.1.0
1959bc5f02f5Smrg#
19607cf0acd0Smrg# This macro enables the use of a tool that flags some suspicious and
19617cf0acd0Smrg# non-portable constructs (likely to be bugs) in C language source code.
19627cf0acd0Smrg# It will attempt to locate the tool and use appropriate options.
19637cf0acd0Smrg# There are various lint type tools on different platforms.
19647cf0acd0Smrg#
19657cf0acd0Smrg# Interface to module:
19667cf0acd0Smrg# LINT:		returns the path to the tool found on the platform
19677cf0acd0Smrg#		or the value set to LINT on the configure cmd line
19687cf0acd0Smrg#		also an Automake conditional
19697cf0acd0Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
19707cf0acd0Smrg#
19717cf0acd0Smrg# --with-lint:	'yes' user instructs the module to use lint
19727cf0acd0Smrg#		'no' user instructs the module not to use lint (default)
19737cf0acd0Smrg#
19747cf0acd0Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
19757cf0acd0Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1976bc5f02f5Smrg#
1977bc5f02f5SmrgAC_DEFUN([XORG_WITH_LINT],[
1978bc5f02f5Smrg
19797cf0acd0SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
19807cf0acd0SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
19817cf0acd0SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1982bc5f02f5Smrg		[Use a lint-style source code checker (default: disabled)])],
1983bc5f02f5Smrg		[use_lint=$withval], [use_lint=no])
19847cf0acd0Smrg
19857cf0acd0Smrg# Obtain platform specific info like program name and options
19867cf0acd0Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
19877cf0acd0Smrgcase $host_os in
19887cf0acd0Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
19897cf0acd0Smrg	lint_name=splint
19907cf0acd0Smrg	lint_options="-badflag"
19917cf0acd0Smrg	;;
19927cf0acd0Smrg  *freebsd* | *netbsd*)
19937cf0acd0Smrg	lint_name=lint
19947cf0acd0Smrg	lint_options="-u -b"
19957cf0acd0Smrg	;;
19967cf0acd0Smrg  *solaris*)
19977cf0acd0Smrg	lint_name=lint
19987cf0acd0Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
19997cf0acd0Smrg	;;
20007cf0acd0Smrgesac
20017cf0acd0Smrg
20027cf0acd0Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
20037cf0acd0Smrgif test "x$use_lint" = x"yes" ; then
20047cf0acd0Smrg   AC_PATH_PROG([LINT], [$lint_name])
20057cf0acd0Smrg   if test "x$LINT" = "x"; then
20067cf0acd0Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
20077cf0acd0Smrg   fi
20087cf0acd0Smrgelif test "x$use_lint" = x"no" ; then
20097cf0acd0Smrg   if test "x$LINT" != "x"; then
20107cf0acd0Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
20117cf0acd0Smrg   fi
2012bc5f02f5Smrgelse
20137cf0acd0Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2014bc5f02f5Smrgfi
20157cf0acd0Smrg
20167cf0acd0Smrg# User supplied flags override default flags
20177cf0acd0Smrgif test "x$LINT_FLAGS" != "x"; then
20187cf0acd0Smrg   lint_options=$LINT_FLAGS
2019bc5f02f5Smrgfi
2020439fab64Smrg
20217cf0acd0SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
20227cf0acd0SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2023439fab64Smrg
2024bc5f02f5Smrg]) # XORG_WITH_LINT
2025439fab64Smrg
2026bc5f02f5Smrg# XORG_LINT_LIBRARY(LIBNAME)
2027bc5f02f5Smrg# --------------------------
2028bc5f02f5Smrg# Minimum version: 1.1.0
2029bc5f02f5Smrg#
2030bc5f02f5Smrg# Sets up flags for building lint libraries for checking programs that call
2031bc5f02f5Smrg# functions in the library.
2032bc5f02f5Smrg#
20337cf0acd0Smrg# Interface to module:
20347cf0acd0Smrg# LINTLIB		- Automake variable with the name of lint library file to make
20357cf0acd0Smrg# MAKE_LINT_LIB		- Automake conditional
20367cf0acd0Smrg#
20377cf0acd0Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
20387cf0acd0Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2039439fab64Smrg
2040bc5f02f5SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2041bc5f02f5SmrgAC_REQUIRE([XORG_WITH_LINT])
20427cf0acd0SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2043bc5f02f5Smrg	[Create lint library (default: disabled)])],
2044bc5f02f5Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
20457cf0acd0Smrg
20467cf0acd0Smrgif test "x$make_lint_lib" = x"yes" ; then
20477cf0acd0Smrg   LINTLIB=llib-l$1.ln
20487cf0acd0Smrg   if test "x$LINT" = "x"; then
20497cf0acd0Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
20507cf0acd0Smrg   fi
20517cf0acd0Smrgelif test "x$make_lint_lib" != x"no" ; then
20527cf0acd0Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2053bc5f02f5Smrgfi
20547cf0acd0Smrg
2055bc5f02f5SmrgAC_SUBST(LINTLIB)
2056bc5f02f5SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2057439fab64Smrg
2058bc5f02f5Smrg]) # XORG_LINT_LIBRARY
2059439fab64Smrg
2060bc5f02f5Smrg# XORG_CWARNFLAGS
2061bc5f02f5Smrg# ---------------
2062bc5f02f5Smrg# Minimum version: 1.2.0
2063bc5f02f5Smrg#
2064bc5f02f5Smrg# Defines CWARNFLAGS to enable C compiler warnings.
2065bc5f02f5Smrg#
2066bc5f02f5SmrgAC_DEFUN([XORG_CWARNFLAGS], [
20677cf0acd0SmrgAC_REQUIRE([AC_PROG_CC_C99])
2068bc5f02f5Smrgif  test "x$GCC" = xyes ; then
2069bc5f02f5Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
2070bc5f02f5Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
20717cf0acd0Smrg-Wbad-function-cast -Wformat=2"
2072bc5f02f5Smrg    case `$CC -dumpversion` in
2073bc5f02f5Smrg    3.4.* | 4.*)
2074bc5f02f5Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
2075bc5f02f5Smrg	;;
2076bc5f02f5Smrg    esac
2077439fab64Smrgelse
2078bc5f02f5Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2079bc5f02f5Smrg    if test "x$SUNCC" = "xyes"; then
2080bc5f02f5Smrg	CWARNFLAGS="-v"
2081bc5f02f5Smrg    fi
2082439fab64Smrgfi
2083bc5f02f5SmrgAC_SUBST(CWARNFLAGS)
2084bc5f02f5Smrg]) # XORG_CWARNFLAGS
20857cf0acd0Smrg
20867cf0acd0Smrg# XORG_STRICT_OPTION
20877cf0acd0Smrg# -----------------------
20887cf0acd0Smrg# Minimum version: 1.3.0
20897cf0acd0Smrg#
20907cf0acd0Smrg# Add configure option to enable strict compilation
20917cf0acd0SmrgAC_DEFUN([XORG_STRICT_OPTION], [
20927cf0acd0Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
20937cf0acd0SmrgAC_REQUIRE([AC_PROG_CC_C99])
20947cf0acd0SmrgAC_REQUIRE([XORG_CWARNFLAGS])
20957cf0acd0Smrg
20967cf0acd0SmrgAC_ARG_ENABLE(strict-compilation,
20977cf0acd0Smrg			  AS_HELP_STRING([--enable-strict-compilation],
20987cf0acd0Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
20997cf0acd0Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
21007cf0acd0Smrgif test "x$STRICT_COMPILE" = "xyes"; then
21017cf0acd0Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
21027cf0acd0Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
21037cf0acd0Smrg	if test "x$GCC" = xyes ; then
21047cf0acd0Smrg		STRICT_CFLAGS="-pedantic -Werror"
21057cf0acd0Smrg	elif test "x$SUNCC" = "xyes"; then
21067cf0acd0Smrg		STRICT_CFLAGS="-errwarn"
21077cf0acd0Smrg    elif test "x$INTELCC" = "xyes"; then
21087cf0acd0Smrg		STRICT_CFLAGS="-Werror"
21097cf0acd0Smrg	fi
21107cf0acd0Smrgfi
21117cf0acd0SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
21127cf0acd0SmrgAC_SUBST([CWARNFLAGS])
21137cf0acd0Smrg]) # XORG_STRICT_OPTION
21147cf0acd0Smrg
21157cf0acd0Smrg# XORG_DEFAULT_OPTIONS
21167cf0acd0Smrg# --------------------
21177cf0acd0Smrg# Minimum version: 1.3.0
21187cf0acd0Smrg#
21197cf0acd0Smrg# Defines default options for X.Org modules.
21207cf0acd0Smrg#
21217cf0acd0SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
21227cf0acd0SmrgAC_REQUIRE([AC_PROG_INSTALL])
21237cf0acd0SmrgXORG_CWARNFLAGS
21247cf0acd0SmrgXORG_STRICT_OPTION
21257cf0acd0SmrgXORG_RELEASE_VERSION
21267cf0acd0SmrgXORG_CHANGELOG
21277cf0acd0SmrgXORG_INSTALL
21287cf0acd0SmrgXORG_MANPAGE_SECTIONS
21297cf0acd0Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
21307cf0acd0Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
21317cf0acd0Smrg]) # XORG_DEFAULT_OPTIONS
21327cf0acd0Smrg
21337cf0acd0Smrg# XORG_INSTALL()
21347cf0acd0Smrg# ----------------
21357cf0acd0Smrg# Minimum version: 1.4.0
21367cf0acd0Smrg#
21377cf0acd0Smrg# Defines the variable INSTALL_CMD as the command to copy
21387cf0acd0Smrg# INSTALL from $prefix/share/util-macros.
21397cf0acd0Smrg#
21407cf0acd0SmrgAC_DEFUN([XORG_INSTALL], [
21417cf0acd0SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
21427cf0acd0Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
21437cf0acd0SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
21447cf0acd0Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
21457cf0acd0Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
21467cf0acd0Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
21477cf0acd0SmrgAC_SUBST([INSTALL_CMD])
21487cf0acd0Smrg]) # XORG_INSTALL
2149439fab64Smrgdnl Copyright 2005 Red Hat, Inc
2150439fab64Smrgdnl
2151439fab64Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
2152439fab64Smrgdnl documentation for any purpose is hereby granted without fee, provided that
2153439fab64Smrgdnl the above copyright notice appear in all copies and that both that
2154439fab64Smrgdnl copyright notice and this permission notice appear in supporting
2155439fab64Smrgdnl documentation.
2156439fab64Smrgdnl
2157439fab64Smrgdnl The above copyright notice and this permission notice shall be included
2158439fab64Smrgdnl in all copies or substantial portions of the Software.
2159439fab64Smrgdnl
2160439fab64Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2161439fab64Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2162439fab64Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2163439fab64Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2164439fab64Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2165439fab64Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2166439fab64Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
2167439fab64Smrgdnl
2168439fab64Smrgdnl Except as contained in this notice, the name of the copyright holders shall
2169439fab64Smrgdnl not be used in advertising or otherwise to promote the sale, use or
2170439fab64Smrgdnl other dealings in this Software without prior written authorization
2171439fab64Smrgdnl from the copyright holders.
2172439fab64Smrgdnl
2173439fab64Smrg
2174439fab64Smrg# XORG_RELEASE_VERSION
2175439fab64Smrg# --------------------
21767cf0acd0Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2177439fab64Smrg 
2178439fab64SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
2179bc5f02f5Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2180bc5f02f5Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2181bc5f02f5Smrg		[Major version of this package])
2182bc5f02f5Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2183bc5f02f5Smrg	if test "x$PVM" = "x"; then
2184bc5f02f5Smrg		PVM="0"
2185bc5f02f5Smrg	fi
2186bc5f02f5Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2187bc5f02f5Smrg		[$PVM],
2188bc5f02f5Smrg		[Minor version of this package])
2189bc5f02f5Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2190bc5f02f5Smrg	if test "x$PVP" = "x"; then
2191bc5f02f5Smrg		PVP="0"
2192bc5f02f5Smrg	fi
2193bc5f02f5Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2194bc5f02f5Smrg		[$PVP],
2195bc5f02f5Smrg		[Patch version of this package])
2196439fab64Smrg])
2197439fab64Smrg
2198bc5f02f5Smrg# XORG_CHANGELOG()
2199bc5f02f5Smrg# ----------------
2200bc5f02f5Smrg# Minimum version: 1.2.0
2201bc5f02f5Smrg#
2202bc5f02f5Smrg# Defines the variable CHANGELOG_CMD as the command to generate
2203bc5f02f5Smrg# ChangeLog from git.
2204bc5f02f5Smrg#
2205bc5f02f5Smrg#
2206bc5f02f5SmrgAC_DEFUN([XORG_CHANGELOG], [
22077cf0acd0SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
22087cf0acd0Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
22097cf0acd0Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2210bc5f02f5Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
2211bc5f02f5SmrgAC_SUBST([CHANGELOG_CMD])
2212bc5f02f5Smrg]) # XORG_CHANGELOG
2213bc5f02f5Smrg
22147cf0acd0Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
22157cf0acd0Smrg# 
22167cf0acd0Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
22177cf0acd0Smrg#
22187cf0acd0Smrg# This program is free software; you can redistribute it and/or modify
22197cf0acd0Smrg# it under the terms of the GNU General Public License as published by
22207cf0acd0Smrg# the Free Software Foundation; either version 2 of the License, or
22217cf0acd0Smrg# (at your option) any later version.
22227cf0acd0Smrg#
22237cf0acd0Smrg# This program is distributed in the hope that it will be useful, but
22247cf0acd0Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
22257cf0acd0Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22267cf0acd0Smrg# General Public License for more details.
22277cf0acd0Smrg#
22287cf0acd0Smrg# You should have received a copy of the GNU General Public License
22297cf0acd0Smrg# along with this program; if not, write to the Free Software
22307cf0acd0Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22317cf0acd0Smrg#
22327cf0acd0Smrg# As a special exception to the GNU General Public License, if you
22337cf0acd0Smrg# distribute this file as part of a program that contains a
22347cf0acd0Smrg# configuration script generated by Autoconf, you may include it under
22357cf0acd0Smrg# the same distribution terms that you use for the rest of that program.
22367cf0acd0Smrg
22377cf0acd0Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
22387cf0acd0Smrg# ----------------------------------
22397cf0acd0SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
22407cf0acd0Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
22417cf0acd0Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
22427cf0acd0SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
22437cf0acd0Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
22447cf0acd0Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
22457cf0acd0Smrgfi
22467cf0acd0Smrgif test -n "$PKG_CONFIG"; then
22477cf0acd0Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
22487cf0acd0Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
22497cf0acd0Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
22507cf0acd0Smrg		AC_MSG_RESULT([yes])
22517cf0acd0Smrg	else
22527cf0acd0Smrg		AC_MSG_RESULT([no])
22537cf0acd0Smrg		PKG_CONFIG=""
22547cf0acd0Smrg	fi
22557cf0acd0Smrg		
22567cf0acd0Smrgfi[]dnl
22577cf0acd0Smrg])# PKG_PROG_PKG_CONFIG
22587cf0acd0Smrg
22597cf0acd0Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
22607cf0acd0Smrg#
22617cf0acd0Smrg# Check to see whether a particular set of modules exists.  Similar
22627cf0acd0Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
22637cf0acd0Smrg#
22647cf0acd0Smrg#
22657cf0acd0Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
22667cf0acd0Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
22677cf0acd0Smrg# PKG_CHECK_EXISTS manually
22687cf0acd0Smrg# --------------------------------------------------------------
22697cf0acd0SmrgAC_DEFUN([PKG_CHECK_EXISTS],
22707cf0acd0Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
22717cf0acd0Smrgif test -n "$PKG_CONFIG" && \
22727cf0acd0Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
22737cf0acd0Smrg  m4_ifval([$2], [$2], [:])
22747cf0acd0Smrgm4_ifvaln([$3], [else
22757cf0acd0Smrg  $3])dnl
22767cf0acd0Smrgfi])
22777cf0acd0Smrg
22787cf0acd0Smrg
22797cf0acd0Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
22807cf0acd0Smrg# ---------------------------------------------
22817cf0acd0Smrgm4_define([_PKG_CONFIG],
22827cf0acd0Smrg[if test -n "$$1"; then
22837cf0acd0Smrg    pkg_cv_[]$1="$$1"
22847cf0acd0Smrg elif test -n "$PKG_CONFIG"; then
22857cf0acd0Smrg    PKG_CHECK_EXISTS([$3],
22867cf0acd0Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
22877cf0acd0Smrg		     [pkg_failed=yes])
22887cf0acd0Smrg else
22897cf0acd0Smrg    pkg_failed=untried
22907cf0acd0Smrgfi[]dnl
22917cf0acd0Smrg])# _PKG_CONFIG
22927cf0acd0Smrg
22937cf0acd0Smrg# _PKG_SHORT_ERRORS_SUPPORTED
22947cf0acd0Smrg# -----------------------------
22957cf0acd0SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
22967cf0acd0Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
22977cf0acd0Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
22987cf0acd0Smrg        _pkg_short_errors_supported=yes
22997cf0acd0Smrgelse
23007cf0acd0Smrg        _pkg_short_errors_supported=no
23017cf0acd0Smrgfi[]dnl
23027cf0acd0Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
23037cf0acd0Smrg
23047cf0acd0Smrg
23057cf0acd0Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
23067cf0acd0Smrg# [ACTION-IF-NOT-FOUND])
23077cf0acd0Smrg#
23087cf0acd0Smrg#
23097cf0acd0Smrg# Note that if there is a possibility the first call to
23107cf0acd0Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
23117cf0acd0Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
23127cf0acd0Smrg#
23137cf0acd0Smrg#
23147cf0acd0Smrg# --------------------------------------------------------------
23157cf0acd0SmrgAC_DEFUN([PKG_CHECK_MODULES],
23167cf0acd0Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
23177cf0acd0SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
23187cf0acd0SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
23197cf0acd0Smrg
23207cf0acd0Smrgpkg_failed=no
23217cf0acd0SmrgAC_MSG_CHECKING([for $1])
23227cf0acd0Smrg
23237cf0acd0Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
23247cf0acd0Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
23257cf0acd0Smrg
23267cf0acd0Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
23277cf0acd0Smrgand $1[]_LIBS to avoid the need to call pkg-config.
23287cf0acd0SmrgSee the pkg-config man page for more details.])
23297cf0acd0Smrg
23307cf0acd0Smrgif test $pkg_failed = yes; then
23317cf0acd0Smrg        _PKG_SHORT_ERRORS_SUPPORTED
23327cf0acd0Smrg        if test $_pkg_short_errors_supported = yes; then
23337cf0acd0Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
23347cf0acd0Smrg        else 
23357cf0acd0Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
23367cf0acd0Smrg        fi
23377cf0acd0Smrg	# Put the nasty error message in config.log where it belongs
23387cf0acd0Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
23397cf0acd0Smrg
23407cf0acd0Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
23417cf0acd0Smrg[Package requirements ($2) were not met:
23427cf0acd0Smrg
23437cf0acd0Smrg$$1_PKG_ERRORS
23447cf0acd0Smrg
23457cf0acd0SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
23467cf0acd0Smrginstalled software in a non-standard prefix.
23477cf0acd0Smrg
23487cf0acd0Smrg_PKG_TEXT
23497cf0acd0Smrg])],
23507cf0acd0Smrg		[AC_MSG_RESULT([no])
23517cf0acd0Smrg                $4])
23527cf0acd0Smrgelif test $pkg_failed = untried; then
23537cf0acd0Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
23547cf0acd0Smrg[The pkg-config script could not be found or is too old.  Make sure it
23557cf0acd0Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
23567cf0acd0Smrgpath to pkg-config.
23577cf0acd0Smrg
23587cf0acd0Smrg_PKG_TEXT
23597cf0acd0Smrg
23607cf0acd0SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
23617cf0acd0Smrg		[$4])
23627cf0acd0Smrgelse
23637cf0acd0Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
23647cf0acd0Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
23657cf0acd0Smrg        AC_MSG_RESULT([yes])
23667cf0acd0Smrg	ifelse([$3], , :, [$3])
23677cf0acd0Smrgfi[]dnl
23687cf0acd0Smrg])# PKG_CHECK_MODULES
23697cf0acd0Smrg
2370