aclocal.m4 revision b3078add
1b3078addSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
25c10afb9Smrg
3b3078addSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4b3078addSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
55c10afb9Smrg# This file is free software; the Free Software Foundation
65c10afb9Smrg# gives unlimited permission to copy and/or distribute it,
75c10afb9Smrg# with or without modifications, as long as this notice is preserved.
85c10afb9Smrg
95c10afb9Smrg# This program is distributed in the hope that it will be useful,
105c10afb9Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
115c10afb9Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
125c10afb9Smrg# PARTICULAR PURPOSE.
135c10afb9Smrg
14b3078addSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15b3078addSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16b3078addSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17b3078addSmrg[m4_warning([this file was generated for autoconf 2.68.
18b3078addSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19b3078addSmrgIf you have problems, you may need to regenerate the build system entirely.
20b3078addSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
215c10afb9Smrg
22b3078addSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23b3078addSmrg#
24b3078addSmrg# This file is free software; the Free Software Foundation
25b3078addSmrg# gives unlimited permission to copy and/or distribute it,
26b3078addSmrg# with or without modifications, as long as this notice is preserved.
275c10afb9Smrg
285c10afb9Smrg# AM_AUTOMAKE_VERSION(VERSION)
295c10afb9Smrg# ----------------------------
305c10afb9Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
315c10afb9Smrg# generated from the m4 files accompanying Automake X.Y.
32b3078addSmrg# (This private macro should not be called outside this file.)
33b3078addSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34b3078addSmrg[am__api_version='1.11'
35b3078addSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36b3078addSmrgdnl require some minimum version.  Point them to the right macro.
37b3078addSmrgm4_if([$1], [1.11.1], [],
38b3078addSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39b3078addSmrg])
40b3078addSmrg
41b3078addSmrg# _AM_AUTOCONF_VERSION(VERSION)
42b3078addSmrg# -----------------------------
43b3078addSmrg# aclocal traces this macro to find the Autoconf version.
44b3078addSmrg# This is a private macro too.  Using m4_define simplifies
45b3078addSmrg# the logic in aclocal, which can simply ignore this definition.
46b3078addSmrgm4_define([_AM_AUTOCONF_VERSION], [])
475c10afb9Smrg
485c10afb9Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
495c10afb9Smrg# -------------------------------
50b3078addSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51b3078addSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
525c10afb9SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53b3078addSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
54b3078addSmrgm4_ifndef([AC_AUTOCONF_VERSION],
55b3078addSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56b3078addSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
575c10afb9Smrg
58b3078addSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
595c10afb9Smrg
60b3078addSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
615c10afb9Smrg#
62b3078addSmrg# This file is free software; the Free Software Foundation
63b3078addSmrg# gives unlimited permission to copy and/or distribute it,
64b3078addSmrg# with or without modifications, as long as this notice is preserved.
655c10afb9Smrg
665c10afb9Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
675c10afb9Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
685c10afb9Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
695c10afb9Smrg#
705c10afb9Smrg# Of course, Automake must honor this variable whenever it calls a
715c10afb9Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
725c10afb9Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
735c10afb9Smrg# depending on how configure is run.  This is pretty annoying, since
745c10afb9Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
755c10afb9Smrg# source directory, any form will work fine, but in subdirectories a
765c10afb9Smrg# relative path needs to be adjusted first.
775c10afb9Smrg#
785c10afb9Smrg# $ac_aux_dir/missing
795c10afb9Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
805c10afb9Smrg# $top_srcdir/$ac_aux_dir/missing
815c10afb9Smrg#    fails if $ac_aux_dir is absolute,
825c10afb9Smrg#    fails when called from a subdirectory in a VPATH build with
835c10afb9Smrg#          a relative $ac_aux_dir
845c10afb9Smrg#
855c10afb9Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
865c10afb9Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
875c10afb9Smrg# harmless because $srcdir is `.', but things will broke when you
885c10afb9Smrg# start a VPATH build or use an absolute $srcdir.
895c10afb9Smrg#
905c10afb9Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
915c10afb9Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
925c10afb9Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
935c10afb9Smrg# and then we would define $MISSING as
945c10afb9Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
955c10afb9Smrg# This will work as long as MISSING is not called from configure, because
965c10afb9Smrg# unfortunately $(top_srcdir) has no meaning in configure.
975c10afb9Smrg# However there are other variables, like CC, which are often used in
985c10afb9Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
995c10afb9Smrg#
1005c10afb9Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
1015c10afb9Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
1025c10afb9Smrg# configured tree to be moved without reconfiguration.
1035c10afb9Smrg
104b3078addSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105b3078addSmrg[dnl Rely on autoconf to set up CDPATH properly.
106b3078addSmrgAC_PREREQ([2.50])dnl
1075c10afb9Smrg# expand $ac_aux_dir to an absolute path
1085c10afb9Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
1095c10afb9Smrg])
1105c10afb9Smrg
111b3078addSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1125c10afb9Smrg
113b3078addSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114b3078addSmrg# Free Software Foundation, Inc.
115b3078addSmrg#
116b3078addSmrg# This file is free software; the Free Software Foundation
117b3078addSmrg# gives unlimited permission to copy and/or distribute it,
118b3078addSmrg# with or without modifications, as long as this notice is preserved.
1195c10afb9Smrg
120b3078addSmrg# serial 9
1215c10afb9Smrg
122b3078addSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123b3078addSmrg# -------------------------------------
124b3078addSmrg# Define a conditional.
125b3078addSmrgAC_DEFUN([AM_CONDITIONAL],
126b3078addSmrg[AC_PREREQ(2.52)dnl
127b3078addSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128b3078addSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129b3078addSmrgAC_SUBST([$1_TRUE])dnl
130b3078addSmrgAC_SUBST([$1_FALSE])dnl
131b3078addSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132b3078addSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133b3078addSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134b3078addSmrgif $2; then
135b3078addSmrg  $1_TRUE=
136b3078addSmrg  $1_FALSE='#'
1375c10afb9Smrgelse
138b3078addSmrg  $1_TRUE='#'
139b3078addSmrg  $1_FALSE=
1405c10afb9Smrgfi
141b3078addSmrgAC_CONFIG_COMMANDS_PRE(
142b3078addSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143b3078addSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144b3078addSmrgUsually this means the macro was only invoked conditionally.]])
145b3078addSmrgfi])])
1465c10afb9Smrg
147b3078addSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148b3078addSmrg# Free Software Foundation, Inc.
149b3078addSmrg#
150b3078addSmrg# This file is free software; the Free Software Foundation
151b3078addSmrg# gives unlimited permission to copy and/or distribute it,
152b3078addSmrg# with or without modifications, as long as this notice is preserved.
1535c10afb9Smrg
154b3078addSmrg# serial 10
1555c10afb9Smrg
1565c10afb9Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1575c10afb9Smrg# written in clear, in which case automake, when reading aclocal.m4,
1585c10afb9Smrg# will think it sees a *use*, and therefore will trigger all it's
1595c10afb9Smrg# C support machinery.  Also note that it means that autoscan, seeing
1605c10afb9Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1615c10afb9Smrg
1625c10afb9Smrg
1635c10afb9Smrg# _AM_DEPENDENCIES(NAME)
1645c10afb9Smrg# ----------------------
1655c10afb9Smrg# See how the compiler implements dependency checking.
1665c10afb9Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1675c10afb9Smrg# We try a few techniques and use that to set a single cache variable.
1685c10afb9Smrg#
1695c10afb9Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1705c10afb9Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1715c10afb9Smrg# dependency, and given that the user is not expected to run this macro,
1725c10afb9Smrg# just rely on AC_PROG_CC.
1735c10afb9SmrgAC_DEFUN([_AM_DEPENDENCIES],
1745c10afb9Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1755c10afb9SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1765c10afb9SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1775c10afb9SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1785c10afb9Smrg
1795c10afb9Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1805c10afb9Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1815c10afb9Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182b3078addSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1835c10afb9Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1845c10afb9Smrg                   [depcc="$$1"   am_compiler_list=])
1855c10afb9Smrg
1865c10afb9SmrgAC_CACHE_CHECK([dependency style of $depcc],
1875c10afb9Smrg               [am_cv_$1_dependencies_compiler_type],
1885c10afb9Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1895c10afb9Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1905c10afb9Smrg  # making bogus files that we don't know about and never remove.  For
1915c10afb9Smrg  # instance it was reported that on HP-UX the gcc test will end up
1925c10afb9Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
1935c10afb9Smrg  # in D'.
1945c10afb9Smrg  mkdir conftest.dir
1955c10afb9Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1965c10afb9Smrg  # using a relative directory.
1975c10afb9Smrg  cp "$am_depcomp" conftest.dir
1985c10afb9Smrg  cd conftest.dir
1995c10afb9Smrg  # We will build objects and dependencies in a subdirectory because
2005c10afb9Smrg  # it helps to detect inapplicable dependency modes.  For instance
2015c10afb9Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2025c10afb9Smrg  # side effect of compilation, but ICC will put the dependencies in
2035c10afb9Smrg  # the current directory while Tru64 will put them in the object
2045c10afb9Smrg  # directory.
2055c10afb9Smrg  mkdir sub
2065c10afb9Smrg
2075c10afb9Smrg  am_cv_$1_dependencies_compiler_type=none
2085c10afb9Smrg  if test "$am_compiler_list" = ""; then
2095c10afb9Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2105c10afb9Smrg  fi
211b3078addSmrg  am__universal=false
212b3078addSmrg  m4_case([$1], [CC],
213b3078addSmrg    [case " $depcc " in #(
214b3078addSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215b3078addSmrg     esac],
216b3078addSmrg    [CXX],
217b3078addSmrg    [case " $depcc " in #(
218b3078addSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219b3078addSmrg     esac])
220b3078addSmrg
2215c10afb9Smrg  for depmode in $am_compiler_list; do
2225c10afb9Smrg    # Setup a source with many dependencies, because some compilers
2235c10afb9Smrg    # like to wrap large dependency lists on column 80 (with \), and
2245c10afb9Smrg    # we should not choose a depcomp mode which is confused by this.
2255c10afb9Smrg    #
2265c10afb9Smrg    # We need to recreate these files for each test, as the compiler may
2275c10afb9Smrg    # overwrite some of them when testing with obscure command lines.
2285c10afb9Smrg    # This happens at least with the AIX C compiler.
2295c10afb9Smrg    : > sub/conftest.c
2305c10afb9Smrg    for i in 1 2 3 4 5 6; do
2315c10afb9Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232b3078addSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233b3078addSmrg      # Solaris 8's {/usr,}/bin/sh.
234b3078addSmrg      touch sub/conftst$i.h
2355c10afb9Smrg    done
2365c10afb9Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2375c10afb9Smrg
238b3078addSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239b3078addSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240b3078addSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241b3078addSmrg    # versions had trouble with output in subdirs
242b3078addSmrg    am__obj=sub/conftest.${OBJEXT-o}
243b3078addSmrg    am__minus_obj="-o $am__obj"
2445c10afb9Smrg    case $depmode in
245b3078addSmrg    gcc)
246b3078addSmrg      # This depmode causes a compiler race in universal mode.
247b3078addSmrg      test "$am__universal" = false || continue
248b3078addSmrg      ;;
2495c10afb9Smrg    nosideeffect)
2505c10afb9Smrg      # after this tag, mechanisms are not by side-effect, so they'll
2515c10afb9Smrg      # only be used when explicitly requested
2525c10afb9Smrg      if test "x$enable_dependency_tracking" = xyes; then
2535c10afb9Smrg	continue
2545c10afb9Smrg      else
2555c10afb9Smrg	break
2565c10afb9Smrg      fi
2575c10afb9Smrg      ;;
258b3078addSmrg    msvisualcpp | msvcmsys)
259b3078addSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
260b3078addSmrg      # not run yet.  These depmodes are late enough in the game, and
261b3078addSmrg      # so weak that their functioning should not be impacted.
262b3078addSmrg      am__obj=conftest.${OBJEXT-o}
263b3078addSmrg      am__minus_obj=
264b3078addSmrg      ;;
2655c10afb9Smrg    none) break ;;
2665c10afb9Smrg    esac
2675c10afb9Smrg    if depmode=$depmode \
268b3078addSmrg       source=sub/conftest.c object=$am__obj \
2695c10afb9Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270b3078addSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2715c10afb9Smrg         >/dev/null 2>conftest.err &&
272b3078addSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2735c10afb9Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274b3078addSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2755c10afb9Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2765c10afb9Smrg      # icc doesn't choke on unknown options, it will just issue warnings
277b3078addSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
278b3078addSmrg      # that says an option was ignored or not supported.
279b3078addSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280b3078addSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281b3078addSmrg      # The diagnosis changed in icc 8.0:
282b3078addSmrg      #   icc: Command line remark: option '-MP' not supported
283b3078addSmrg      if (grep 'ignoring option' conftest.err ||
284b3078addSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2855c10afb9Smrg        am_cv_$1_dependencies_compiler_type=$depmode
2865c10afb9Smrg        break
2875c10afb9Smrg      fi
2885c10afb9Smrg    fi
2895c10afb9Smrg  done
2905c10afb9Smrg
2915c10afb9Smrg  cd ..
2925c10afb9Smrg  rm -rf conftest.dir
2935c10afb9Smrgelse
2945c10afb9Smrg  am_cv_$1_dependencies_compiler_type=none
2955c10afb9Smrgfi
2965c10afb9Smrg])
2975c10afb9SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2985c10afb9SmrgAM_CONDITIONAL([am__fastdep$1], [
2995c10afb9Smrg  test "x$enable_dependency_tracking" != xno \
3005c10afb9Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3015c10afb9Smrg])
3025c10afb9Smrg
3035c10afb9Smrg
3045c10afb9Smrg# AM_SET_DEPDIR
3055c10afb9Smrg# -------------
3065c10afb9Smrg# Choose a directory name for dependency files.
3075c10afb9Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3085c10afb9SmrgAC_DEFUN([AM_SET_DEPDIR],
3095c10afb9Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3105c10afb9SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3115c10afb9Smrg])
3125c10afb9Smrg
3135c10afb9Smrg
3145c10afb9Smrg# AM_DEP_TRACK
3155c10afb9Smrg# ------------
3165c10afb9SmrgAC_DEFUN([AM_DEP_TRACK],
3175c10afb9Smrg[AC_ARG_ENABLE(dependency-tracking,
318b3078addSmrg[  --disable-dependency-tracking  speeds up one-time build
319b3078addSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3205c10afb9Smrgif test "x$enable_dependency_tracking" != xno; then
3215c10afb9Smrg  am_depcomp="$ac_aux_dir/depcomp"
3225c10afb9Smrg  AMDEPBACKSLASH='\'
3235c10afb9Smrgfi
3245c10afb9SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325b3078addSmrgAC_SUBST([AMDEPBACKSLASH])dnl
326b3078addSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3275c10afb9Smrg])
3285c10afb9Smrg
329b3078addSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3305c10afb9Smrg
331b3078addSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332b3078addSmrg# Free Software Foundation, Inc.
333b3078addSmrg#
334b3078addSmrg# This file is free software; the Free Software Foundation
335b3078addSmrg# gives unlimited permission to copy and/or distribute it,
336b3078addSmrg# with or without modifications, as long as this notice is preserved.
3375c10afb9Smrg
338b3078addSmrg#serial 5
3395c10afb9Smrg
3405c10afb9Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3415c10afb9Smrg# ------------------------------
3425c10afb9SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343b3078addSmrg[{
344b3078addSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345b3078addSmrg  # are listed without --file.  Let's play safe and only enable the eval
346b3078addSmrg  # if we detect the quoting.
347b3078addSmrg  case $CONFIG_FILES in
348b3078addSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
349b3078addSmrg  *)   set x $CONFIG_FILES ;;
350b3078addSmrg  esac
351b3078addSmrg  shift
352b3078addSmrg  for mf
353b3078addSmrg  do
354b3078addSmrg    # Strip MF so we end up with the name of the file.
355b3078addSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356b3078addSmrg    # Check whether this is an Automake generated Makefile or not.
357b3078addSmrg    # We used to match only the files named `Makefile.in', but
358b3078addSmrg    # some people rename them; so instead we look at the file content.
359b3078addSmrg    # Grep'ing the first line is not enough: some people post-process
360b3078addSmrg    # each Makefile.in and add a new line on top of each file to say so.
361b3078addSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
362b3078addSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
363b3078addSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364b3078addSmrg      dirpart=`AS_DIRNAME("$mf")`
365b3078addSmrg    else
366b3078addSmrg      continue
367b3078addSmrg    fi
368b3078addSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
369b3078addSmrg    # from the Makefile without running `make'.
370b3078addSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371b3078addSmrg    test -z "$DEPDIR" && continue
372b3078addSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373b3078addSmrg    test -z "am__include" && continue
374b3078addSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375b3078addSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
376b3078addSmrg    U=`sed -n 's/^U = //p' < "$mf"`
377b3078addSmrg    # Find all dependency output files, they are included files with
378b3078addSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379b3078addSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380b3078addSmrg    # expansion.
381b3078addSmrg    for file in `sed -n "
382b3078addSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383b3078addSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384b3078addSmrg      # Make sure the directory exists.
385b3078addSmrg      test -f "$dirpart/$file" && continue
386b3078addSmrg      fdir=`AS_DIRNAME(["$file"])`
387b3078addSmrg      AS_MKDIR_P([$dirpart/$fdir])
388b3078addSmrg      # echo "creating $dirpart/$file"
389b3078addSmrg      echo '# dummy' > "$dirpart/$file"
390b3078addSmrg    done
3915c10afb9Smrg  done
392b3078addSmrg}
3935c10afb9Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3945c10afb9Smrg
3955c10afb9Smrg
3965c10afb9Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3975c10afb9Smrg# -----------------------------
3985c10afb9Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
3995c10afb9Smrg#
4005c10afb9Smrg# This code is only required when automatic dependency tracking
4015c10afb9Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
4025c10afb9Smrg# need in order to bootstrap the dependency handling code.
4035c10afb9SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4045c10afb9Smrg[AC_CONFIG_COMMANDS([depfiles],
4055c10afb9Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4065c10afb9Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4075c10afb9Smrg])
4085c10afb9Smrg
409b3078addSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
410b3078addSmrg# Free Software Foundation, Inc.
411b3078addSmrg#
412b3078addSmrg# This file is free software; the Free Software Foundation
413b3078addSmrg# gives unlimited permission to copy and/or distribute it,
414b3078addSmrg# with or without modifications, as long as this notice is preserved.
4155c10afb9Smrg
416b3078addSmrg# serial 8
4175c10afb9Smrg
418b3078addSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
419b3078addSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
4205c10afb9Smrg
421b3078addSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4225c10afb9Smrg
423b3078addSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
424b3078addSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
425b3078addSmrg#
426b3078addSmrg# This file is free software; the Free Software Foundation
427b3078addSmrg# gives unlimited permission to copy and/or distribute it,
428b3078addSmrg# with or without modifications, as long as this notice is preserved.
4295c10afb9Smrg
430b3078addSmrg# serial 16
4315c10afb9Smrg
432b3078addSmrg# This macro actually does too much.  Some checks are only needed if
433b3078addSmrg# your package does certain things.  But this isn't really a big deal.
434b3078addSmrg
435b3078addSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
436b3078addSmrg# AM_INIT_AUTOMAKE([OPTIONS])
437b3078addSmrg# -----------------------------------------------
438b3078addSmrg# The call with PACKAGE and VERSION arguments is the old style
439b3078addSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
440b3078addSmrg# and VERSION should now be passed to AC_INIT and removed from
441b3078addSmrg# the call to AM_INIT_AUTOMAKE.
442b3078addSmrg# We support both call styles for the transition.  After
443b3078addSmrg# the next Automake release, Autoconf can make the AC_INIT
444b3078addSmrg# arguments mandatory, and then we can depend on a new Autoconf
445b3078addSmrg# release and drop the old call support.
446b3078addSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
447b3078addSmrg[AC_PREREQ([2.62])dnl
448b3078addSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
449b3078addSmrgdnl the ones we care about.
450b3078addSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
451b3078addSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
452b3078addSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
453b3078addSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
454b3078addSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
455b3078addSmrg  # is not polluted with repeated "-I."
456b3078addSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
457b3078addSmrg  # test to see if srcdir already configured
458b3078addSmrg  if test -f $srcdir/config.status; then
459b3078addSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
460b3078addSmrg  fi
4615c10afb9Smrgfi
462b3078addSmrg
463b3078addSmrg# test whether we have cygpath
464b3078addSmrgif test -z "$CYGPATH_W"; then
465b3078addSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
466b3078addSmrg    CYGPATH_W='cygpath -w'
467b3078addSmrg  else
468b3078addSmrg    CYGPATH_W=echo
469b3078addSmrg  fi
4705c10afb9Smrgfi
471b3078addSmrgAC_SUBST([CYGPATH_W])
4725c10afb9Smrg
473b3078addSmrg# Define the identity of the package.
474b3078addSmrgdnl Distinguish between old-style and new-style calls.
475b3078addSmrgm4_ifval([$2],
476b3078addSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
477b3078addSmrg AC_SUBST([PACKAGE], [$1])dnl
478b3078addSmrg AC_SUBST([VERSION], [$2])],
479b3078addSmrg[_AM_SET_OPTIONS([$1])dnl
480b3078addSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
481b3078addSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
482b3078addSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
483b3078addSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
484b3078addSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4855c10afb9Smrg
486b3078addSmrg_AM_IF_OPTION([no-define],,
487b3078addSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
488b3078addSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4895c10afb9Smrg
490b3078addSmrg# Some tools Automake needs.
491b3078addSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
492b3078addSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
493b3078addSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
494b3078addSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
495b3078addSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
496b3078addSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
497b3078addSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
498b3078addSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
499b3078addSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
500b3078addSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
501b3078addSmrg# We need awk for the "check" target.  The system "awk" is bad on
502b3078addSmrg# some platforms.
503b3078addSmrgAC_REQUIRE([AC_PROG_AWK])dnl
504b3078addSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
505b3078addSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
506b3078addSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
507b3078addSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
508b3078addSmrg			     [_AM_PROG_TAR([v7])])])
509b3078addSmrg_AM_IF_OPTION([no-dependencies],,
510b3078addSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
511b3078addSmrg		  [_AM_DEPENDENCIES(CC)],
512b3078addSmrg		  [define([AC_PROG_CC],
513b3078addSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
514b3078addSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
515b3078addSmrg		  [_AM_DEPENDENCIES(CXX)],
516b3078addSmrg		  [define([AC_PROG_CXX],
517b3078addSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
518b3078addSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
519b3078addSmrg		  [_AM_DEPENDENCIES(OBJC)],
520b3078addSmrg		  [define([AC_PROG_OBJC],
521b3078addSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
522b3078addSmrg])
523b3078addSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
524b3078addSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
525b3078addSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
526b3078addSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
527b3078addSmrgAC_CONFIG_COMMANDS_PRE(dnl
528b3078addSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
529b3078addSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
530b3078addSmrg])
5315c10afb9Smrg
532b3078addSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
533b3078addSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
534b3078addSmrgdnl mangled by Autoconf and run in a shell conditional statement.
535b3078addSmrgm4_define([_AC_COMPILER_EXEEXT],
536b3078addSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5375c10afb9Smrg
5385c10afb9Smrg
539b3078addSmrg# When config.status generates a header, we must update the stamp-h file.
540b3078addSmrg# This file resides in the same directory as the config header
541b3078addSmrg# that is generated.  The stamp files are numbered to have different names.
542b3078addSmrg
543b3078addSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
544b3078addSmrg# loop where config.status creates the headers, so we can generate
545b3078addSmrg# our stamp files there.
546b3078addSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
547b3078addSmrg[# Compute $1's index in $config_headers.
548b3078addSmrg_am_arg=$1
549b3078addSmrg_am_stamp_count=1
550b3078addSmrgfor _am_header in $config_headers :; do
551b3078addSmrg  case $_am_header in
552b3078addSmrg    $_am_arg | $_am_arg:* )
553b3078addSmrg      break ;;
554b3078addSmrg    * )
555b3078addSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
556b3078addSmrg  esac
557b3078addSmrgdone
558b3078addSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
5595c10afb9Smrg
560b3078addSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
561b3078addSmrg#
562b3078addSmrg# This file is free software; the Free Software Foundation
563b3078addSmrg# gives unlimited permission to copy and/or distribute it,
564b3078addSmrg# with or without modifications, as long as this notice is preserved.
5655c10afb9Smrg
566b3078addSmrg# AM_PROG_INSTALL_SH
567b3078addSmrg# ------------------
568b3078addSmrg# Define $install_sh.
569b3078addSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
570b3078addSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
571b3078addSmrgif test x"${install_sh}" != xset; then
572b3078addSmrg  case $am_aux_dir in
573b3078addSmrg  *\ * | *\	*)
574b3078addSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
575b3078addSmrg  *)
576b3078addSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
577b3078addSmrg  esac
5785c10afb9Smrgfi
579b3078addSmrgAC_SUBST(install_sh)])
5805c10afb9Smrg
581b3078addSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
582b3078addSmrg#
583b3078addSmrg# This file is free software; the Free Software Foundation
584b3078addSmrg# gives unlimited permission to copy and/or distribute it,
585b3078addSmrg# with or without modifications, as long as this notice is preserved.
5865c10afb9Smrg
587b3078addSmrg# serial 2
5885c10afb9Smrg
589b3078addSmrg# Check whether the underlying file-system supports filenames
590b3078addSmrg# with a leading dot.  For instance MS-DOS doesn't.
591b3078addSmrgAC_DEFUN([AM_SET_LEADING_DOT],
592b3078addSmrg[rm -rf .tst 2>/dev/null
593b3078addSmrgmkdir .tst 2>/dev/null
594b3078addSmrgif test -d .tst; then
595b3078addSmrg  am__leading_dot=.
596b3078addSmrgelse
597b3078addSmrg  am__leading_dot=_
598b3078addSmrgfi
599b3078addSmrgrmdir .tst 2>/dev/null
600b3078addSmrgAC_SUBST([am__leading_dot])])
6015c10afb9Smrg
602b3078addSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
603b3078addSmrg# From Jim Meyering
6045c10afb9Smrg
605b3078addSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
606b3078addSmrg# Free Software Foundation, Inc.
607b3078addSmrg#
608b3078addSmrg# This file is free software; the Free Software Foundation
609b3078addSmrg# gives unlimited permission to copy and/or distribute it,
610b3078addSmrg# with or without modifications, as long as this notice is preserved.
6115c10afb9Smrg
612b3078addSmrg# serial 5
6135c10afb9Smrg
614b3078addSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
615b3078addSmrg# ----------------------------------
616b3078addSmrg# Control maintainer-specific portions of Makefiles.
617b3078addSmrg# Default is to disable them, unless `enable' is passed literally.
618b3078addSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
619b3078addSmrg# can override the default with the --enable/--disable switch.
6205c10afb9SmrgAC_DEFUN([AM_MAINTAINER_MODE],
621b3078addSmrg[m4_case(m4_default([$1], [disable]),
622b3078addSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
623b3078addSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
624b3078addSmrg       [m4_define([am_maintainer_other], [enable])
625b3078addSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
626b3078addSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
627b3078addSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
628b3078addSmrg  AC_ARG_ENABLE([maintainer-mode],
629b3078addSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
630b3078addSmrg			  (and sometimes confusing) to the casual installer],
631b3078addSmrg      [USE_MAINTAINER_MODE=$enableval],
632b3078addSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
6335c10afb9Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
634b3078addSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
6355c10afb9Smrg  MAINT=$MAINTAINER_MODE_TRUE
636b3078addSmrg  AC_SUBST([MAINT])dnl
6375c10afb9Smrg]
6385c10afb9Smrg)
6395c10afb9Smrg
6405c10afb9SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
6415c10afb9Smrg
642b3078addSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6435c10afb9Smrg
644b3078addSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
645b3078addSmrg#
646b3078addSmrg# This file is free software; the Free Software Foundation
647b3078addSmrg# gives unlimited permission to copy and/or distribute it,
648b3078addSmrg# with or without modifications, as long as this notice is preserved.
6495c10afb9Smrg
650b3078addSmrg# serial 4
6515c10afb9Smrg
652b3078addSmrg# AM_MAKE_INCLUDE()
653b3078addSmrg# -----------------
654b3078addSmrg# Check to see how make treats includes.
655b3078addSmrgAC_DEFUN([AM_MAKE_INCLUDE],
656b3078addSmrg[am_make=${MAKE-make}
657b3078addSmrgcat > confinc << 'END'
658b3078addSmrgam__doit:
659b3078addSmrg	@echo this is the am__doit target
660b3078addSmrg.PHONY: am__doit
661b3078addSmrgEND
662b3078addSmrg# If we don't find an include directive, just comment out the code.
663b3078addSmrgAC_MSG_CHECKING([for style of include used by $am_make])
664b3078addSmrgam__include="#"
665b3078addSmrgam__quote=
666b3078addSmrg_am_result=none
667b3078addSmrg# First try GNU make style include.
668b3078addSmrgecho "include confinc" > confmf
669b3078addSmrg# Ignore all kinds of additional output from `make'.
670b3078addSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
671b3078addSmrg*the\ am__doit\ target*)
672b3078addSmrg  am__include=include
673b3078addSmrg  am__quote=
674b3078addSmrg  _am_result=GNU
675b3078addSmrg  ;;
676b3078addSmrgesac
677b3078addSmrg# Now try BSD make style include.
678b3078addSmrgif test "$am__include" = "#"; then
679b3078addSmrg   echo '.include "confinc"' > confmf
680b3078addSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
681b3078addSmrg   *the\ am__doit\ target*)
682b3078addSmrg     am__include=.include
683b3078addSmrg     am__quote="\""
684b3078addSmrg     _am_result=BSD
685b3078addSmrg     ;;
686b3078addSmrg   esac
687b3078addSmrgfi
688b3078addSmrgAC_SUBST([am__include])
689b3078addSmrgAC_SUBST([am__quote])
690b3078addSmrgAC_MSG_RESULT([$_am_result])
691b3078addSmrgrm -f confinc confmf
692b3078addSmrg])
6935c10afb9Smrg
694b3078addSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6955c10afb9Smrg
696b3078addSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
697b3078addSmrg# Free Software Foundation, Inc.
698b3078addSmrg#
699b3078addSmrg# This file is free software; the Free Software Foundation
700b3078addSmrg# gives unlimited permission to copy and/or distribute it,
701b3078addSmrg# with or without modifications, as long as this notice is preserved.
7025c10afb9Smrg
7035c10afb9Smrg# serial 6
7045c10afb9Smrg
705b3078addSmrg# AM_MISSING_PROG(NAME, PROGRAM)
706b3078addSmrg# ------------------------------
707b3078addSmrgAC_DEFUN([AM_MISSING_PROG],
708b3078addSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
709b3078addSmrg$1=${$1-"${am_missing_run}$2"}
710b3078addSmrgAC_SUBST($1)])
7115c10afb9Smrg
7125c10afb9Smrg
713b3078addSmrg# AM_MISSING_HAS_RUN
714b3078addSmrg# ------------------
715b3078addSmrg# Define MISSING if not defined so far and test if it supports --run.
716b3078addSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
717b3078addSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
718b3078addSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
719b3078addSmrgAC_REQUIRE_AUX_FILE([missing])dnl
720b3078addSmrgif test x"${MISSING+set}" != xset; then
721b3078addSmrg  case $am_aux_dir in
722b3078addSmrg  *\ * | *\	*)
723b3078addSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
724b3078addSmrg  *)
725b3078addSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
726b3078addSmrg  esac
7275c10afb9Smrgfi
728b3078addSmrg# Use eval to expand $SHELL
729b3078addSmrgif eval "$MISSING --run true"; then
730b3078addSmrg  am_missing_run="$MISSING --run "
731b3078addSmrgelse
732b3078addSmrg  am_missing_run=
733b3078addSmrg  AC_MSG_WARN([`missing' script is too old or missing])
734b3078addSmrgfi
735b3078addSmrg])
7365c10afb9Smrg
737b3078addSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
7385c10afb9Smrg#
739b3078addSmrg# This file is free software; the Free Software Foundation
740b3078addSmrg# gives unlimited permission to copy and/or distribute it,
741b3078addSmrg# with or without modifications, as long as this notice is preserved.
7425c10afb9Smrg
743b3078addSmrg# AM_PROG_MKDIR_P
744b3078addSmrg# ---------------
745b3078addSmrg# Check for `mkdir -p'.
746b3078addSmrgAC_DEFUN([AM_PROG_MKDIR_P],
747b3078addSmrg[AC_PREREQ([2.60])dnl
748b3078addSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
749b3078addSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
750b3078addSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
751b3078addSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
752b3078addSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
753b3078addSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
754b3078addSmrgdnl adjustment using top_builddir (which is defined more often than
755b3078addSmrgdnl MKDIR_P).
756b3078addSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
757b3078addSmrgcase $mkdir_p in
758b3078addSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
759b3078addSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
760b3078addSmrgesac
761b3078addSmrg])
7625c10afb9Smrg
763b3078addSmrg# Helper functions for option handling.                     -*- Autoconf -*-
7645c10afb9Smrg
765b3078addSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
7665c10afb9Smrg#
767b3078addSmrg# This file is free software; the Free Software Foundation
768b3078addSmrg# gives unlimited permission to copy and/or distribute it,
769b3078addSmrg# with or without modifications, as long as this notice is preserved.
7705c10afb9Smrg
771b3078addSmrg# serial 4
7725c10afb9Smrg
773b3078addSmrg# _AM_MANGLE_OPTION(NAME)
774b3078addSmrg# -----------------------
775b3078addSmrgAC_DEFUN([_AM_MANGLE_OPTION],
776b3078addSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7775c10afb9Smrg
778b3078addSmrg# _AM_SET_OPTION(NAME)
779b3078addSmrg# ------------------------------
780b3078addSmrg# Set option NAME.  Presently that only means defining a flag for this option.
781b3078addSmrgAC_DEFUN([_AM_SET_OPTION],
782b3078addSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7835c10afb9Smrg
784b3078addSmrg# _AM_SET_OPTIONS(OPTIONS)
785b3078addSmrg# ----------------------------------
786b3078addSmrg# OPTIONS is a space-separated list of Automake options.
787b3078addSmrgAC_DEFUN([_AM_SET_OPTIONS],
788b3078addSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7895c10afb9Smrg
790b3078addSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
791b3078addSmrg# -------------------------------------------
792b3078addSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
793b3078addSmrgAC_DEFUN([_AM_IF_OPTION],
794b3078addSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7955c10afb9Smrg
796b3078addSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7975c10afb9Smrg
798b3078addSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
799b3078addSmrg# Free Software Foundation, Inc.
800b3078addSmrg#
801b3078addSmrg# This file is free software; the Free Software Foundation
802b3078addSmrg# gives unlimited permission to copy and/or distribute it,
803b3078addSmrg# with or without modifications, as long as this notice is preserved.
8045c10afb9Smrg
805b3078addSmrg# serial 5
8065c10afb9Smrg
807b3078addSmrg# AM_SANITY_CHECK
808b3078addSmrg# ---------------
809b3078addSmrgAC_DEFUN([AM_SANITY_CHECK],
810b3078addSmrg[AC_MSG_CHECKING([whether build environment is sane])
811b3078addSmrg# Just in case
812b3078addSmrgsleep 1
813b3078addSmrgecho timestamp > conftest.file
814b3078addSmrg# Reject unsafe characters in $srcdir or the absolute working directory
815b3078addSmrg# name.  Accept space and tab only in the latter.
816b3078addSmrgam_lf='
817b3078addSmrg'
818b3078addSmrgcase `pwd` in
819b3078addSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
820b3078addSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
821b3078addSmrgesac
822b3078addSmrgcase $srcdir in
823b3078addSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
824b3078addSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
825b3078addSmrgesac
8265c10afb9Smrg
827b3078addSmrg# Do `set' in a subshell so we don't clobber the current shell's
828b3078addSmrg# arguments.  Must try -L first in case configure is actually a
829b3078addSmrg# symlink; some systems play weird games with the mod time of symlinks
830b3078addSmrg# (eg FreeBSD returns the mod time of the symlink's containing
831b3078addSmrg# directory).
832b3078addSmrgif (
833b3078addSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
834b3078addSmrg   if test "$[*]" = "X"; then
835b3078addSmrg      # -L didn't work.
836b3078addSmrg      set X `ls -t "$srcdir/configure" conftest.file`
837b3078addSmrg   fi
838b3078addSmrg   rm -f conftest.file
839b3078addSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
840b3078addSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8415c10afb9Smrg
842b3078addSmrg      # If neither matched, then we have a broken ls.  This can happen
843b3078addSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
844b3078addSmrg      # broken ls alias from the environment.  This has actually
845b3078addSmrg      # happened.  Such a system could not be considered "sane".
846b3078addSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
847b3078addSmrgalias in your environment])
848b3078addSmrg   fi
8495c10afb9Smrg
850b3078addSmrg   test "$[2]" = conftest.file
851b3078addSmrg   )
852b3078addSmrgthen
853b3078addSmrg   # Ok.
854b3078addSmrg   :
855b3078addSmrgelse
856b3078addSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
857b3078addSmrgCheck your system clock])
858b3078addSmrgfi
859b3078addSmrgAC_MSG_RESULT(yes)])
8605c10afb9Smrg
861b3078addSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
862b3078addSmrg#
863b3078addSmrg# This file is free software; the Free Software Foundation
864b3078addSmrg# gives unlimited permission to copy and/or distribute it,
865b3078addSmrg# with or without modifications, as long as this notice is preserved.
8665c10afb9Smrg
867b3078addSmrg# serial 1
8685c10afb9Smrg
869b3078addSmrg# AM_SILENT_RULES([DEFAULT])
870b3078addSmrg# --------------------------
871b3078addSmrg# Enable less verbose build rules; with the default set to DEFAULT
872b3078addSmrg# (`yes' being less verbose, `no' or empty being verbose).
873b3078addSmrgAC_DEFUN([AM_SILENT_RULES],
874b3078addSmrg[AC_ARG_ENABLE([silent-rules],
875b3078addSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
876b3078addSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
877b3078addSmrgcase $enable_silent_rules in
878b3078addSmrgyes) AM_DEFAULT_VERBOSITY=0;;
879b3078addSmrgno)  AM_DEFAULT_VERBOSITY=1;;
880b3078addSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
881b3078addSmrgesac
882b3078addSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
883b3078addSmrgAM_BACKSLASH='\'
884b3078addSmrgAC_SUBST([AM_BACKSLASH])dnl
885b3078addSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
886b3078addSmrg])
8875c10afb9Smrg
888b3078addSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
889b3078addSmrg#
890b3078addSmrg# This file is free software; the Free Software Foundation
891b3078addSmrg# gives unlimited permission to copy and/or distribute it,
892b3078addSmrg# with or without modifications, as long as this notice is preserved.
8935c10afb9Smrg
894b3078addSmrg# AM_PROG_INSTALL_STRIP
895b3078addSmrg# ---------------------
896b3078addSmrg# One issue with vendor `install' (even GNU) is that you can't
897b3078addSmrg# specify the program used to strip binaries.  This is especially
898b3078addSmrg# annoying in cross-compiling environments, where the build's strip
899b3078addSmrg# is unlikely to handle the host's binaries.
900b3078addSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
901b3078addSmrg# always use install-sh in `make install-strip', and initialize
902b3078addSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
903b3078addSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
904b3078addSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
905b3078addSmrg# Installed binaries are usually stripped using `strip' when the user
906b3078addSmrg# run `make install-strip'.  However `strip' might not be the right
907b3078addSmrg# tool to use in cross-compilation environments, therefore Automake
908b3078addSmrg# will honor the `STRIP' environment variable to overrule this program.
909b3078addSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
910b3078addSmrgif test "$cross_compiling" != no; then
911b3078addSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
912b3078addSmrgfi
913b3078addSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
914b3078addSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9155c10afb9Smrg
916b3078addSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
917b3078addSmrg#
918b3078addSmrg# This file is free software; the Free Software Foundation
919b3078addSmrg# gives unlimited permission to copy and/or distribute it,
920b3078addSmrg# with or without modifications, as long as this notice is preserved.
921b3078addSmrg
922b3078addSmrg# serial 2
923b3078addSmrg
924b3078addSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
925b3078addSmrg# ---------------------------
926b3078addSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
927b3078addSmrg# This macro is traced by Automake.
928b3078addSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
929b3078addSmrg
930b3078addSmrg# AM_SUBST_NOTMAKE(VARIABLE)
931b3078addSmrg# ---------------------------
932b3078addSmrg# Public sister of _AM_SUBST_NOTMAKE.
933b3078addSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
934b3078addSmrg
935b3078addSmrg# Check how to create a tarball.                            -*- Autoconf -*-
936b3078addSmrg
937b3078addSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
938b3078addSmrg#
939b3078addSmrg# This file is free software; the Free Software Foundation
940b3078addSmrg# gives unlimited permission to copy and/or distribute it,
941b3078addSmrg# with or without modifications, as long as this notice is preserved.
942b3078addSmrg
943b3078addSmrg# serial 2
944b3078addSmrg
945b3078addSmrg# _AM_PROG_TAR(FORMAT)
946b3078addSmrg# --------------------
947b3078addSmrg# Check how to create a tarball in format FORMAT.
948b3078addSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
949b3078addSmrg#
950b3078addSmrg# Substitute a variable $(am__tar) that is a command
951b3078addSmrg# writing to stdout a FORMAT-tarball containing the directory
952b3078addSmrg# $tardir.
953b3078addSmrg#     tardir=directory && $(am__tar) > result.tar
954b3078addSmrg#
955b3078addSmrg# Substitute a variable $(am__untar) that extract such
956b3078addSmrg# a tarball read from stdin.
957b3078addSmrg#     $(am__untar) < result.tar
958b3078addSmrgAC_DEFUN([_AM_PROG_TAR],
959b3078addSmrg[# Always define AMTAR for backward compatibility.
960b3078addSmrgAM_MISSING_PROG([AMTAR], [tar])
961b3078addSmrgm4_if([$1], [v7],
962b3078addSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
963b3078addSmrg     [m4_case([$1], [ustar],, [pax],,
964b3078addSmrg              [m4_fatal([Unknown tar format])])
965b3078addSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
966b3078addSmrg# Loop over all known methods to create a tar archive until one works.
967b3078addSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
968b3078addSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
969b3078addSmrg# Do not fold the above two line into one, because Tru64 sh and
970b3078addSmrg# Solaris sh will not grok spaces in the rhs of `-'.
971b3078addSmrgfor _am_tool in $_am_tools
972b3078addSmrgdo
973b3078addSmrg  case $_am_tool in
974b3078addSmrg  gnutar)
975b3078addSmrg    for _am_tar in tar gnutar gtar;
976b3078addSmrg    do
977b3078addSmrg      AM_RUN_LOG([$_am_tar --version]) && break
978b3078addSmrg    done
979b3078addSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
980b3078addSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
981b3078addSmrg    am__untar="$_am_tar -xf -"
982b3078addSmrg    ;;
983b3078addSmrg  plaintar)
984b3078addSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
985b3078addSmrg    # ustar tarball either.
986b3078addSmrg    (tar --version) >/dev/null 2>&1 && continue
987b3078addSmrg    am__tar='tar chf - "$$tardir"'
988b3078addSmrg    am__tar_='tar chf - "$tardir"'
989b3078addSmrg    am__untar='tar xf -'
990b3078addSmrg    ;;
991b3078addSmrg  pax)
992b3078addSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
993b3078addSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
994b3078addSmrg    am__untar='pax -r'
995b3078addSmrg    ;;
996b3078addSmrg  cpio)
997b3078addSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
998b3078addSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
999b3078addSmrg    am__untar='cpio -i -H $1 -d'
1000b3078addSmrg    ;;
1001b3078addSmrg  none)
1002b3078addSmrg    am__tar=false
1003b3078addSmrg    am__tar_=false
1004b3078addSmrg    am__untar=false
1005b3078addSmrg    ;;
1006b3078addSmrg  esac
1007b3078addSmrg
1008b3078addSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
1009b3078addSmrg  # and am__untar set.
1010b3078addSmrg  test -n "${am_cv_prog_tar_$1}" && break
1011b3078addSmrg
1012b3078addSmrg  # tar/untar a dummy directory, and stop if the command works
1013b3078addSmrg  rm -rf conftest.dir
1014b3078addSmrg  mkdir conftest.dir
1015b3078addSmrg  echo GrepMe > conftest.dir/file
1016b3078addSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1017b3078addSmrg  rm -rf conftest.dir
1018b3078addSmrg  if test -s conftest.tar; then
1019b3078addSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1020b3078addSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1021b3078addSmrg  fi
1022b3078addSmrgdone
1023b3078addSmrgrm -rf conftest.dir
10245c10afb9Smrg
1025b3078addSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1026b3078addSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1027b3078addSmrgAC_SUBST([am__tar])
1028b3078addSmrgAC_SUBST([am__untar])
1029b3078addSmrg]) # _AM_PROG_TAR
10305c10afb9Smrg
1031b3078addSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10325c10afb9Smrgdnl
1033b3078addSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
10345c10afb9Smrgdnl 
1035b3078addSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1036b3078addSmrgdnl copy of this software and associated documentation files (the "Software"),
1037b3078addSmrgdnl to deal in the Software without restriction, including without limitation
1038b3078addSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1039b3078addSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
1040b3078addSmrgdnl Software is furnished to do so, subject to the following conditions:
1041b3078addSmrgdnl
1042b3078addSmrgdnl The above copyright notice and this permission notice (including the next
1043b3078addSmrgdnl paragraph) shall be included in all copies or substantial portions of the
1044b3078addSmrgdnl Software.
1045b3078addSmrgdnl
1046b3078addSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1047b3078addSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1048b3078addSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1049b3078addSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1050b3078addSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1051b3078addSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1052b3078addSmrgdnl DEALINGS IN THE SOFTWARE.
1053b3078addSmrg
1054b3078addSmrg# XORG_MACROS_VERSION(required-version)
1055b3078addSmrg# -------------------------------------
1056b3078addSmrg# Minimum version: 1.1.0
1057b3078addSmrg#
1058b3078addSmrg# If you're using a macro added in Version 1.1 or newer, include this in
1059b3078addSmrg# your configure.ac with the minimum required version, such as:
1060b3078addSmrg# XORG_MACROS_VERSION(1.1)
1061b3078addSmrg#
1062b3078addSmrg# To ensure that this macro is defined, also add:
1063b3078addSmrg# m4_ifndef([XORG_MACROS_VERSION],
1064b3078addSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1065b3078addSmrg#
1066b3078addSmrg#
1067b3078addSmrg# See the "minimum version" comment for each macro you use to see what 
1068b3078addSmrg# version you require.
1069b3078addSmrgm4_defun([XORG_MACROS_VERSION],[
1070b3078addSmrgm4_define([vers_have], [1.11.0])
1071b3078addSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1072b3078addSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1073b3078addSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1074b3078addSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1075b3078addSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1076b3078addSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1077b3078addSmrgm4_undefine([vers_have])
1078b3078addSmrgm4_undefine([maj_have])
1079b3078addSmrgm4_undefine([maj_needed])
1080b3078addSmrg]) # XORG_MACROS_VERSION
10815c10afb9Smrg
10825c10afb9Smrg# XORG_PROG_RAWCPP()
10835c10afb9Smrg# ------------------
1084b3078addSmrg# Minimum version: 1.0.0
1085b3078addSmrg#
10865c10afb9Smrg# Find cpp program and necessary flags for use in pre-processing text files
10875c10afb9Smrg# such as man pages and config files
10885c10afb9SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
10895c10afb9SmrgAC_REQUIRE([AC_PROG_CPP])
10905c10afb9SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
10915c10afb9Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
10925c10afb9Smrg
10935c10afb9Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
10945c10afb9Smrg# which is not the best choice for supporting other OS'es, but covers most
10955c10afb9Smrg# of the ones we need for now.
10965c10afb9SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
10975c10afb9SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
10985c10afb9Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10995c10afb9Smrg	AC_MSG_RESULT([no])
11005c10afb9Smrgelse
11015c10afb9Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11025c10afb9Smrg		RAWCPPFLAGS=-undef
11035c10afb9Smrg		AC_MSG_RESULT([yes])
1104b3078addSmrg	# under Cygwin unix is still defined even with -undef
1105b3078addSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1106b3078addSmrg		RAWCPPFLAGS="-undef -ansi"
1107b3078addSmrg		AC_MSG_RESULT([yes, with -ansi])
11085c10afb9Smrg	else
11095c10afb9Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
11105c10afb9Smrg	fi
11115c10afb9Smrgfi
11125c10afb9Smrgrm -f conftest.$ac_ext
11135c10afb9Smrg
11145c10afb9SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
11155c10afb9SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
11165c10afb9Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11175c10afb9Smrg	AC_MSG_RESULT([no])
11185c10afb9Smrgelse
11195c10afb9Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11205c10afb9Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
11215c10afb9Smrg		AC_MSG_RESULT([yes])
11225c10afb9Smrg	else
11235c10afb9Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
11245c10afb9Smrg	fi
11255c10afb9Smrgfi
11265c10afb9Smrgrm -f conftest.$ac_ext
11275c10afb9SmrgAC_SUBST(RAWCPPFLAGS)
11285c10afb9Smrg]) # XORG_PROG_RAWCPP
11295c10afb9Smrg
11305c10afb9Smrg# XORG_MANPAGE_SECTIONS()
11315c10afb9Smrg# -----------------------
1132b3078addSmrg# Minimum version: 1.0.0
1133b3078addSmrg#
11345c10afb9Smrg# Determine which sections man pages go in for the different man page types
11355c10afb9Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
11365c10afb9Smrg# Not sure if there's any better way than just hardcoding by OS name.
11375c10afb9Smrg# Override default settings by setting environment variables
1138b3078addSmrg# Added MAN_SUBSTS in version 1.8
1139b3078addSmrg# Added AC_PROG_SED in version 1.8
11405c10afb9Smrg
11415c10afb9SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
11425c10afb9SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1143b3078addSmrgAC_REQUIRE([AC_PROG_SED])
11445c10afb9Smrg
11455c10afb9Smrgif test x$APP_MAN_SUFFIX = x    ; then
1146b3078addSmrg    APP_MAN_SUFFIX=1
11475c10afb9Smrgfi
11485c10afb9Smrgif test x$APP_MAN_DIR = x    ; then
1149b3078addSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
11505c10afb9Smrgfi
11515c10afb9Smrg
11525c10afb9Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1153b3078addSmrg    LIB_MAN_SUFFIX=3
11545c10afb9Smrgfi
11555c10afb9Smrgif test x$LIB_MAN_DIR = x    ; then
1156b3078addSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
11575c10afb9Smrgfi
11585c10afb9Smrg
11595c10afb9Smrgif test x$FILE_MAN_SUFFIX = x    ; then
11605c10afb9Smrg    case $host_os in
11615c10afb9Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
11625c10afb9Smrg	*)		FILE_MAN_SUFFIX=5  ;;
11635c10afb9Smrg    esac
11645c10afb9Smrgfi
11655c10afb9Smrgif test x$FILE_MAN_DIR = x    ; then
1166b3078addSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
11675c10afb9Smrgfi
11685c10afb9Smrg
11695c10afb9Smrgif test x$MISC_MAN_SUFFIX = x    ; then
11705c10afb9Smrg    case $host_os in
11715c10afb9Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
11725c10afb9Smrg	*)		MISC_MAN_SUFFIX=7  ;;
11735c10afb9Smrg    esac
11745c10afb9Smrgfi
11755c10afb9Smrgif test x$MISC_MAN_DIR = x    ; then
1176b3078addSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
11775c10afb9Smrgfi
11785c10afb9Smrg
11795c10afb9Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
11805c10afb9Smrg    case $host_os in
11815c10afb9Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
11825c10afb9Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
11835c10afb9Smrg    esac
11845c10afb9Smrgfi
11855c10afb9Smrgif test x$DRIVER_MAN_DIR = x    ; then
1186b3078addSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
11875c10afb9Smrgfi
11885c10afb9Smrg
11895c10afb9Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
11905c10afb9Smrg    case $host_os in
11915c10afb9Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
11925c10afb9Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
11935c10afb9Smrg    esac
11945c10afb9Smrgfi
11955c10afb9Smrgif test x$ADMIN_MAN_DIR = x    ; then
11965c10afb9Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
11975c10afb9Smrgfi
11985c10afb9Smrg
11995c10afb9Smrg
12005c10afb9SmrgAC_SUBST([APP_MAN_SUFFIX])
12015c10afb9SmrgAC_SUBST([LIB_MAN_SUFFIX])
12025c10afb9SmrgAC_SUBST([FILE_MAN_SUFFIX])
12035c10afb9SmrgAC_SUBST([MISC_MAN_SUFFIX])
12045c10afb9SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
12055c10afb9SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
12065c10afb9SmrgAC_SUBST([APP_MAN_DIR])
12075c10afb9SmrgAC_SUBST([LIB_MAN_DIR])
12085c10afb9SmrgAC_SUBST([FILE_MAN_DIR])
12095c10afb9SmrgAC_SUBST([MISC_MAN_DIR])
12105c10afb9SmrgAC_SUBST([DRIVER_MAN_DIR])
12115c10afb9SmrgAC_SUBST([ADMIN_MAN_DIR])
1212b3078addSmrg
1213b3078addSmrgXORG_MAN_PAGE="X Version 11"
1214b3078addSmrgAC_SUBST([XORG_MAN_PAGE])
1215b3078addSmrgMAN_SUBSTS="\
1216b3078addSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1217b3078addSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1218b3078addSmrg	-e 's|__xservername__|Xorg|g' \
1219b3078addSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
1220b3078addSmrg	-e 's|__projectroot__|\$(prefix)|g' \
1221b3078addSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1222b3078addSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1223b3078addSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1224b3078addSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1225b3078addSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1226b3078addSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1227b3078addSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1228b3078addSmrgAC_SUBST([MAN_SUBSTS])
1229b3078addSmrg
12305c10afb9Smrg]) # XORG_MANPAGE_SECTIONS
12315c10afb9Smrg
1232b3078addSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1233b3078addSmrg# ------------------------
1234b3078addSmrg# Minimum version: 1.7.0
1235b3078addSmrg#
1236b3078addSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1237b3078addSmrg# provided by xorg-sgml-doctools, if installed.
1238b3078addSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1239b3078addSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1240b3078addSmrgXORG_SGML_PATH=
1241b3078addSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1242b3078addSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1243b3078addSmrg    [m4_ifval([$1],[:],
1244b3078addSmrg        [if test x"$cross_compiling" != x"yes" ; then
1245b3078addSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1246b3078addSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1247b3078addSmrg         fi])
1248b3078addSmrg    ])
1249b3078addSmrg
1250b3078addSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1251b3078addSmrg# the path and the name of the doc stylesheet
1252b3078addSmrgif test "x$XORG_SGML_PATH" != "x" ; then
1253b3078addSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1254b3078addSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1255b3078addSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1256b3078addSmrgelse
1257b3078addSmrg   AC_MSG_RESULT([no])
1258b3078addSmrgfi
1259b3078addSmrg
1260b3078addSmrgAC_SUBST(XORG_SGML_PATH)
1261b3078addSmrgAC_SUBST(STYLESHEET_SRCDIR)
1262b3078addSmrgAC_SUBST(XSL_STYLESHEET)
1263b3078addSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1264b3078addSmrg]) # XORG_CHECK_SGML_DOCTOOLS
1265b3078addSmrg
12665c10afb9Smrg# XORG_CHECK_LINUXDOC
12675c10afb9Smrg# -------------------
1268b3078addSmrg# Minimum version: 1.0.0
1269b3078addSmrg#
12705c10afb9Smrg# Defines the variable MAKE_TEXT if the necessary tools and
12715c10afb9Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
12725c10afb9Smrg# Whether or not the necessary tools and files are found can be checked
12735c10afb9Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
12745c10afb9SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1275b3078addSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1276b3078addSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
12775c10afb9Smrg
12785c10afb9SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
12795c10afb9Smrg
1280b3078addSmrgAC_MSG_CHECKING([whether to build documentation])
12815c10afb9Smrg
1282b3078addSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
12835c10afb9Smrg   BUILDDOC=yes
12845c10afb9Smrgelse
12855c10afb9Smrg   BUILDDOC=no
12865c10afb9Smrgfi
12875c10afb9Smrg
12885c10afb9SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
12895c10afb9Smrg
12905c10afb9SmrgAC_MSG_RESULT([$BUILDDOC])
12915c10afb9Smrg
1292b3078addSmrgAC_MSG_CHECKING([whether to build pdf documentation])
12935c10afb9Smrg
1294b3078addSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
12955c10afb9Smrg   BUILDPDFDOC=yes
12965c10afb9Smrgelse
12975c10afb9Smrg   BUILDPDFDOC=no
12985c10afb9Smrgfi
12995c10afb9Smrg
13005c10afb9SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13015c10afb9Smrg
13025c10afb9SmrgAC_MSG_RESULT([$BUILDPDFDOC])
13035c10afb9Smrg
1304b3078addSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1305b3078addSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
13065c10afb9SmrgMAKE_PDF="$PS2PDF"
1307b3078addSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
13085c10afb9Smrg
13095c10afb9SmrgAC_SUBST(MAKE_TEXT)
13105c10afb9SmrgAC_SUBST(MAKE_PS)
13115c10afb9SmrgAC_SUBST(MAKE_PDF)
13125c10afb9SmrgAC_SUBST(MAKE_HTML)
13135c10afb9Smrg]) # XORG_CHECK_LINUXDOC
13145c10afb9Smrg
1315b3078addSmrg# XORG_CHECK_DOCBOOK
1316b3078addSmrg# -------------------
1317b3078addSmrg# Minimum version: 1.0.0
1318b3078addSmrg#
1319b3078addSmrg# Checks for the ability to build output formats from SGML DocBook source.
1320b3078addSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1321b3078addSmrg# indicates whether the necessary tools and files are found and, if set,
1322b3078addSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1323b3078addSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1324b3078addSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1325b3078addSmrg
1326b3078addSmrgBUILDTXTDOC=no
1327b3078addSmrgBUILDPDFDOC=no
1328b3078addSmrgBUILDPSDOC=no
1329b3078addSmrgBUILDHTMLDOC=no
1330b3078addSmrg
1331b3078addSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1332b3078addSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1333b3078addSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1334b3078addSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1335b3078addSmrg
1336b3078addSmrgAC_MSG_CHECKING([whether to build text documentation])
1337b3078addSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1338b3078addSmrg   test x$BUILD_TXTDOC != xno; then
1339b3078addSmrg	BUILDTXTDOC=yes
1340b3078addSmrgfi
1341b3078addSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1342b3078addSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1343b3078addSmrg
1344b3078addSmrgAC_MSG_CHECKING([whether to build PDF documentation])
1345b3078addSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1346b3078addSmrg   test x$BUILD_PDFDOC != xno; then
1347b3078addSmrg	BUILDPDFDOC=yes
1348b3078addSmrgfi
1349b3078addSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1350b3078addSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1351b3078addSmrg
1352b3078addSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1353b3078addSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1354b3078addSmrg   test x$BUILD_PSDOC != xno; then
1355b3078addSmrg	BUILDPSDOC=yes
1356b3078addSmrgfi
1357b3078addSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1358b3078addSmrgAC_MSG_RESULT([$BUILDPSDOC])
1359b3078addSmrg
1360b3078addSmrgAC_MSG_CHECKING([whether to build HTML documentation])
1361b3078addSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1362b3078addSmrg   test x$BUILD_HTMLDOC != xno; then
1363b3078addSmrg	BUILDHTMLDOC=yes
1364b3078addSmrgfi
1365b3078addSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1366b3078addSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1367b3078addSmrg
1368b3078addSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1369b3078addSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1370b3078addSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1371b3078addSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1372b3078addSmrg
1373b3078addSmrgAC_SUBST(MAKE_TEXT)
1374b3078addSmrgAC_SUBST(MAKE_PS)
1375b3078addSmrgAC_SUBST(MAKE_PDF)
1376b3078addSmrgAC_SUBST(MAKE_HTML)
1377b3078addSmrg]) # XORG_CHECK_DOCBOOK
1378b3078addSmrg
1379b3078addSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1380b3078addSmrg# ----------------
1381b3078addSmrg# Minimum version: 1.5.0
1382b3078addSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1383b3078addSmrg#
1384b3078addSmrg# Documentation tools are not always available on all platforms and sometimes
1385b3078addSmrg# not at the appropriate level. This macro enables a module to test for the
1386b3078addSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1387b3078addSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1388b3078addSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1389b3078addSmrg# --with-xmlto assumes 'auto'.
1390b3078addSmrg#
1391b3078addSmrg# Interface to module:
1392b3078addSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1393b3078addSmrg# XMLTO:	returns the path of the xmlto program found
1394b3078addSmrg#		returns the path set by the user in the environment
1395b3078addSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1396b3078addSmrg#		'no' user instructs the module not to use xmlto
1397b3078addSmrg#
1398b3078addSmrg# Added in version 1.10.0
1399b3078addSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1400b3078addSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1401b3078addSmrg#
1402b3078addSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1403b3078addSmrg#
1404b3078addSmrgAC_DEFUN([XORG_WITH_XMLTO],[
1405b3078addSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1406b3078addSmrgm4_define([_defopt], m4_default([$2], [auto]))
1407b3078addSmrgAC_ARG_WITH(xmlto,
1408b3078addSmrg	AS_HELP_STRING([--with-xmlto],
1409b3078addSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1410b3078addSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1411b3078addSmrgm4_undefine([_defopt])
1412b3078addSmrg
1413b3078addSmrgif test "x$use_xmlto" = x"auto"; then
1414b3078addSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1415b3078addSmrg   if test "x$XMLTO" = "x"; then
1416b3078addSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1417b3078addSmrg	have_xmlto=no
1418b3078addSmrg   else
1419b3078addSmrg        have_xmlto=yes
1420b3078addSmrg   fi
1421b3078addSmrgelif test "x$use_xmlto" = x"yes" ; then
1422b3078addSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1423b3078addSmrg   if test "x$XMLTO" = "x"; then
1424b3078addSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1425b3078addSmrg   fi
1426b3078addSmrg   have_xmlto=yes
1427b3078addSmrgelif test "x$use_xmlto" = x"no" ; then
1428b3078addSmrg   if test "x$XMLTO" != "x"; then
1429b3078addSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1430b3078addSmrg   fi
1431b3078addSmrg   have_xmlto=no
1432b3078addSmrgelse
1433b3078addSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1434b3078addSmrgfi
1435b3078addSmrg
1436b3078addSmrg# Test for a minimum version of xmlto, if provided.
1437b3078addSmrgm4_ifval([$1],
1438b3078addSmrg[if test "$have_xmlto" = yes; then
1439b3078addSmrg    # scrape the xmlto version
1440b3078addSmrg    AC_MSG_CHECKING([the xmlto version])
1441b3078addSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1442b3078addSmrg    AC_MSG_RESULT([$xmlto_version])
1443b3078addSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1444b3078addSmrg        [if test "x$use_xmlto" = xauto; then
1445b3078addSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1446b3078addSmrg            have_xmlto=no
1447b3078addSmrg        else
1448b3078addSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1449b3078addSmrg        fi])
1450b3078addSmrgfi])
1451b3078addSmrg
1452b3078addSmrg# Test for the ability of xmlto to generate a text target
1453b3078addSmrghave_xmlto_text=no
1454b3078addSmrgcat > conftest.xml << "EOF"
1455b3078addSmrgEOF
1456b3078addSmrgAS_IF([test "$have_xmlto" = yes],
1457b3078addSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1458b3078addSmrg             [have_xmlto_text=yes],
1459b3078addSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1460b3078addSmrgrm -f conftest.xml
1461b3078addSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1462b3078addSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1463b3078addSmrg]) # XORG_WITH_XMLTO
1464b3078addSmrg
1465b3078addSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1466b3078addSmrg# ----------------
1467b3078addSmrg# Minimum version: 1.5.0
1468b3078addSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1469b3078addSmrg#
1470b3078addSmrg# Documentation tools are not always available on all platforms and sometimes
1471b3078addSmrg# not at the appropriate level. This macro enables a module to test for the
1472b3078addSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1473b3078addSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1474b3078addSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1475b3078addSmrg# --with-asciidoc assumes 'auto'.
1476b3078addSmrg#
1477b3078addSmrg# Interface to module:
1478b3078addSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1479b3078addSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
1480b3078addSmrg#		 returns the path set by the user in the environment
1481b3078addSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1482b3078addSmrg#		  'no' user instructs the module not to use asciidoc
1483b3078addSmrg#
1484b3078addSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1485b3078addSmrg#
1486b3078addSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1487b3078addSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1488b3078addSmrgm4_define([_defopt], m4_default([$2], [auto]))
1489b3078addSmrgAC_ARG_WITH(asciidoc,
1490b3078addSmrg	AS_HELP_STRING([--with-asciidoc],
1491b3078addSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1492b3078addSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1493b3078addSmrgm4_undefine([_defopt])
1494b3078addSmrg
1495b3078addSmrgif test "x$use_asciidoc" = x"auto"; then
1496b3078addSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1497b3078addSmrg   if test "x$ASCIIDOC" = "x"; then
1498b3078addSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1499b3078addSmrg	have_asciidoc=no
1500b3078addSmrg   else
1501b3078addSmrg        have_asciidoc=yes
1502b3078addSmrg   fi
1503b3078addSmrgelif test "x$use_asciidoc" = x"yes" ; then
1504b3078addSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1505b3078addSmrg   if test "x$ASCIIDOC" = "x"; then
1506b3078addSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1507b3078addSmrg   fi
1508b3078addSmrg   have_asciidoc=yes
1509b3078addSmrgelif test "x$use_asciidoc" = x"no" ; then
1510b3078addSmrg   if test "x$ASCIIDOC" != "x"; then
1511b3078addSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1512b3078addSmrg   fi
1513b3078addSmrg   have_asciidoc=no
1514b3078addSmrgelse
1515b3078addSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1516b3078addSmrgfi
1517b3078addSmrgm4_ifval([$1],
1518b3078addSmrg[if test "$have_asciidoc" = yes; then
1519b3078addSmrg    # scrape the asciidoc version
1520b3078addSmrg    AC_MSG_CHECKING([the asciidoc version])
1521b3078addSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1522b3078addSmrg    AC_MSG_RESULT([$asciidoc_version])
1523b3078addSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1524b3078addSmrg        [if test "x$use_asciidoc" = xauto; then
1525b3078addSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1526b3078addSmrg            have_asciidoc=no
1527b3078addSmrg        else
1528b3078addSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1529b3078addSmrg        fi])
1530b3078addSmrgfi])
1531b3078addSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1532b3078addSmrg]) # XORG_WITH_ASCIIDOC
1533b3078addSmrg
1534b3078addSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1535b3078addSmrg# --------------------------------
1536b3078addSmrg# Minimum version: 1.5.0
1537b3078addSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1538b3078addSmrg#
1539b3078addSmrg# Documentation tools are not always available on all platforms and sometimes
1540b3078addSmrg# not at the appropriate level. This macro enables a module to test for the
1541b3078addSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1542b3078addSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1543b3078addSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1544b3078addSmrg# --with-doxygen assumes 'auto'.
1545b3078addSmrg#
1546b3078addSmrg# Interface to module:
1547b3078addSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1548b3078addSmrg# DOXYGEN:	 returns the path of the doxygen program found
1549b3078addSmrg#		 returns the path set by the user in the environment
1550b3078addSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1551b3078addSmrg#		  'no' user instructs the module not to use doxygen
1552b3078addSmrg#
1553b3078addSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1554b3078addSmrg#
1555b3078addSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1556b3078addSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1557b3078addSmrgm4_define([_defopt], m4_default([$2], [auto]))
1558b3078addSmrgAC_ARG_WITH(doxygen,
1559b3078addSmrg	AS_HELP_STRING([--with-doxygen],
1560b3078addSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1561b3078addSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1562b3078addSmrgm4_undefine([_defopt])
1563b3078addSmrg
1564b3078addSmrgif test "x$use_doxygen" = x"auto"; then
1565b3078addSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1566b3078addSmrg   if test "x$DOXYGEN" = "x"; then
1567b3078addSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1568b3078addSmrg	have_doxygen=no
1569b3078addSmrg   else
1570b3078addSmrg        have_doxygen=yes
1571b3078addSmrg   fi
1572b3078addSmrgelif test "x$use_doxygen" = x"yes" ; then
1573b3078addSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1574b3078addSmrg   if test "x$DOXYGEN" = "x"; then
1575b3078addSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1576b3078addSmrg   fi
1577b3078addSmrg   have_doxygen=yes
1578b3078addSmrgelif test "x$use_doxygen" = x"no" ; then
1579b3078addSmrg   if test "x$DOXYGEN" != "x"; then
1580b3078addSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1581b3078addSmrg   fi
1582b3078addSmrg   have_doxygen=no
1583b3078addSmrgelse
1584b3078addSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1585b3078addSmrgfi
1586b3078addSmrgm4_ifval([$1],
1587b3078addSmrg[if test "$have_doxygen" = yes; then
1588b3078addSmrg    # scrape the doxygen version
1589b3078addSmrg    AC_MSG_CHECKING([the doxygen version])
1590b3078addSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1591b3078addSmrg    AC_MSG_RESULT([$doxygen_version])
1592b3078addSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1593b3078addSmrg        [if test "x$use_doxygen" = xauto; then
1594b3078addSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1595b3078addSmrg            have_doxygen=no
1596b3078addSmrg        else
1597b3078addSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1598b3078addSmrg        fi])
1599b3078addSmrgfi])
1600b3078addSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1601b3078addSmrg]) # XORG_WITH_DOXYGEN
1602b3078addSmrg
1603b3078addSmrg# XORG_WITH_GROFF([DEFAULT])
1604b3078addSmrg# ----------------
1605b3078addSmrg# Minimum version: 1.6.0
1606b3078addSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1607b3078addSmrg#
1608b3078addSmrg# Documentation tools are not always available on all platforms and sometimes
1609b3078addSmrg# not at the appropriate level. This macro enables a module to test for the
1610b3078addSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1611b3078addSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
1612b3078addSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
1613b3078addSmrg# --with-groff assumes 'auto'.
1614b3078addSmrg#
1615b3078addSmrg# Interface to module:
1616b3078addSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1617b3078addSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1618b3078addSmrg# HAVE_GROFF_MS: the -ms macros package
1619b3078addSmrg# GROFF:	 returns the path of the groff program found
1620b3078addSmrg#		 returns the path set by the user in the environment
1621b3078addSmrg# --with-groff:	 'yes' user instructs the module to use groff
1622b3078addSmrg#		 'no' user instructs the module not to use groff
1623b3078addSmrg#
1624b3078addSmrg# Added in version 1.9.0:
1625b3078addSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1626b3078addSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1627b3078addSmrg#		   psselect from the psutils package.
1628b3078addSmrg#		   the ghostcript package. Refer to the grohtml man pages
1629b3078addSmrg#
1630b3078addSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1631b3078addSmrg#
1632b3078addSmrg# OS and distros often splits groff in a basic and full package, the former
1633b3078addSmrg# having the groff program and the later having devices, fonts and macros
1634b3078addSmrg# Checking for the groff executable is not enough.
1635b3078addSmrg#
1636b3078addSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
1637b3078addSmrg# unset HAVE_GROFF or GROFF env variables.
1638b3078addSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1639b3078addSmrg#
1640b3078addSmrgAC_DEFUN([XORG_WITH_GROFF],[
1641b3078addSmrgAC_ARG_VAR([GROFF], [Path to groff command])
1642b3078addSmrgm4_define([_defopt], m4_default([$1], [auto]))
1643b3078addSmrgAC_ARG_WITH(groff,
1644b3078addSmrg	AS_HELP_STRING([--with-groff],
1645b3078addSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1646b3078addSmrg	   [use_groff=$withval], [use_groff=]_defopt)
1647b3078addSmrgm4_undefine([_defopt])
1648b3078addSmrg
1649b3078addSmrgif test "x$use_groff" = x"auto"; then
1650b3078addSmrg   AC_PATH_PROG([GROFF], [groff])
1651b3078addSmrg   if test "x$GROFF" = "x"; then
1652b3078addSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1653b3078addSmrg	have_groff=no
1654b3078addSmrg   else
1655b3078addSmrg        have_groff=yes
1656b3078addSmrg   fi
1657b3078addSmrgelif test "x$use_groff" = x"yes" ; then
1658b3078addSmrg   AC_PATH_PROG([GROFF], [groff])
1659b3078addSmrg   if test "x$GROFF" = "x"; then
1660b3078addSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1661b3078addSmrg   fi
1662b3078addSmrg   have_groff=yes
1663b3078addSmrgelif test "x$use_groff" = x"no" ; then
1664b3078addSmrg   if test "x$GROFF" != "x"; then
1665b3078addSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1666b3078addSmrg   fi
1667b3078addSmrg   have_groff=no
1668b3078addSmrgelse
1669b3078addSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1670b3078addSmrgfi
1671b3078addSmrg
1672b3078addSmrg# We have groff, test for the presence of the macro packages
1673b3078addSmrgif test "x$have_groff" = x"yes"; then
1674b3078addSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1675b3078addSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1676b3078addSmrg        groff_ms_works=yes
1677b3078addSmrg    else
1678b3078addSmrg        groff_ms_works=no
1679b3078addSmrg    fi
1680b3078addSmrg    AC_MSG_RESULT([$groff_ms_works])
1681b3078addSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1682b3078addSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1683b3078addSmrg        groff_mm_works=yes
1684b3078addSmrg    else
1685b3078addSmrg        groff_mm_works=no
1686b3078addSmrg    fi
1687b3078addSmrg    AC_MSG_RESULT([$groff_mm_works])
1688b3078addSmrgfi
1689b3078addSmrg
1690b3078addSmrg# We have groff, test for HTML dependencies, one command per package
1691b3078addSmrgif test "x$have_groff" = x"yes"; then
1692b3078addSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1693b3078addSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1694b3078addSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1695b3078addSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1696b3078addSmrg      have_groff_html=yes
1697b3078addSmrg   else
1698b3078addSmrg      have_groff_html=no
1699b3078addSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1700b3078addSmrg   fi
1701b3078addSmrgfi
1702b3078addSmrg
1703b3078addSmrg# Set Automake conditionals for Makefiles
1704b3078addSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1705b3078addSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1706b3078addSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1707b3078addSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1708b3078addSmrg]) # XORG_WITH_GROFF
1709b3078addSmrg
1710b3078addSmrg# XORG_WITH_FOP([DEFAULT])
1711b3078addSmrg# ----------------
1712b3078addSmrg# Minimum version: 1.6.0
1713b3078addSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1714b3078addSmrg#
1715b3078addSmrg# Documentation tools are not always available on all platforms and sometimes
1716b3078addSmrg# not at the appropriate level. This macro enables a module to test for the
1717b3078addSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1718b3078addSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
1719b3078addSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
1720b3078addSmrg# --with-fop assumes 'auto'.
1721b3078addSmrg#
1722b3078addSmrg# Interface to module:
1723b3078addSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1724b3078addSmrg# FOP:	 	returns the path of the fop program found
1725b3078addSmrg#		returns the path set by the user in the environment
1726b3078addSmrg# --with-fop: 	'yes' user instructs the module to use fop
1727b3078addSmrg#		'no' user instructs the module not to use fop
1728b3078addSmrg#
1729b3078addSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1730b3078addSmrg#
1731b3078addSmrgAC_DEFUN([XORG_WITH_FOP],[
1732b3078addSmrgAC_ARG_VAR([FOP], [Path to fop command])
1733b3078addSmrgm4_define([_defopt], m4_default([$1], [auto]))
1734b3078addSmrgAC_ARG_WITH(fop,
1735b3078addSmrg	AS_HELP_STRING([--with-fop],
1736b3078addSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1737b3078addSmrg	   [use_fop=$withval], [use_fop=]_defopt)
1738b3078addSmrgm4_undefine([_defopt])
1739b3078addSmrg
1740b3078addSmrgif test "x$use_fop" = x"auto"; then
1741b3078addSmrg   AC_PATH_PROG([FOP], [fop])
1742b3078addSmrg   if test "x$FOP" = "x"; then
1743b3078addSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1744b3078addSmrg	have_fop=no
1745b3078addSmrg   else
1746b3078addSmrg        have_fop=yes
1747b3078addSmrg   fi
1748b3078addSmrgelif test "x$use_fop" = x"yes" ; then
1749b3078addSmrg   AC_PATH_PROG([FOP], [fop])
1750b3078addSmrg   if test "x$FOP" = "x"; then
1751b3078addSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1752b3078addSmrg   fi
1753b3078addSmrg   have_fop=yes
1754b3078addSmrgelif test "x$use_fop" = x"no" ; then
1755b3078addSmrg   if test "x$FOP" != "x"; then
1756b3078addSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1757b3078addSmrg   fi
1758b3078addSmrg   have_fop=no
1759b3078addSmrgelse
1760b3078addSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1761b3078addSmrgfi
1762b3078addSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1763b3078addSmrg]) # XORG_WITH_FOP
1764b3078addSmrg
1765b3078addSmrg# XORG_WITH_PS2PDF([DEFAULT])
1766b3078addSmrg# ----------------
1767b3078addSmrg# Minimum version: 1.6.0
1768b3078addSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1769b3078addSmrg#
1770b3078addSmrg# Documentation tools are not always available on all platforms and sometimes
1771b3078addSmrg# not at the appropriate level. This macro enables a module to test for the
1772b3078addSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1773b3078addSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1774b3078addSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1775b3078addSmrg# --with-ps2pdf assumes 'auto'.
1776b3078addSmrg#
1777b3078addSmrg# Interface to module:
1778b3078addSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1779b3078addSmrg# PS2PDF:	returns the path of the ps2pdf program found
1780b3078addSmrg#		returns the path set by the user in the environment
1781b3078addSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1782b3078addSmrg#		 'no' user instructs the module not to use ps2pdf
1783b3078addSmrg#
1784b3078addSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1785b3078addSmrg#
1786b3078addSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1787b3078addSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1788b3078addSmrgm4_define([_defopt], m4_default([$1], [auto]))
1789b3078addSmrgAC_ARG_WITH(ps2pdf,
1790b3078addSmrg	AS_HELP_STRING([--with-ps2pdf],
1791b3078addSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1792b3078addSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1793b3078addSmrgm4_undefine([_defopt])
1794b3078addSmrg
1795b3078addSmrgif test "x$use_ps2pdf" = x"auto"; then
1796b3078addSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1797b3078addSmrg   if test "x$PS2PDF" = "x"; then
1798b3078addSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1799b3078addSmrg	have_ps2pdf=no
1800b3078addSmrg   else
1801b3078addSmrg        have_ps2pdf=yes
1802b3078addSmrg   fi
1803b3078addSmrgelif test "x$use_ps2pdf" = x"yes" ; then
1804b3078addSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1805b3078addSmrg   if test "x$PS2PDF" = "x"; then
1806b3078addSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1807b3078addSmrg   fi
1808b3078addSmrg   have_ps2pdf=yes
1809b3078addSmrgelif test "x$use_ps2pdf" = x"no" ; then
1810b3078addSmrg   if test "x$PS2PDF" != "x"; then
1811b3078addSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1812b3078addSmrg   fi
1813b3078addSmrg   have_ps2pdf=no
1814b3078addSmrgelse
1815b3078addSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1816b3078addSmrgfi
1817b3078addSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1818b3078addSmrg]) # XORG_WITH_PS2PDF
1819b3078addSmrg
1820b3078addSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
1821b3078addSmrg# ----------------
1822b3078addSmrg# Minimum version: 1.6.0
1823b3078addSmrg#
1824b3078addSmrg# Documentation tools are not always available on all platforms and sometimes
1825b3078addSmrg# not at the appropriate level. This macro enables a builder to skip all
1826b3078addSmrg# documentation targets except traditional man pages.
1827b3078addSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1828b3078addSmrg# maximum flexibilty in controlling documentation building.
1829b3078addSmrg# Refer to:
1830b3078addSmrg# XORG_WITH_XMLTO         --with-xmlto
1831b3078addSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1832b3078addSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1833b3078addSmrg# XORG_WITH_FOP           --with-fop
1834b3078addSmrg# XORG_WITH_GROFF         --with-groff
1835b3078addSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1836b3078addSmrg#
1837b3078addSmrg# Interface to module:
1838b3078addSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1839b3078addSmrg# --enable-docs: 'yes' user instructs the module to generate docs
1840b3078addSmrg#		 'no' user instructs the module not to generate docs
1841b3078addSmrg# parm1:	specify the default value, yes or no.
1842b3078addSmrg#
1843b3078addSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1844b3078addSmrgm4_define([default], m4_default([$1], [yes]))
1845b3078addSmrgAC_ARG_ENABLE(docs,
1846b3078addSmrg	AS_HELP_STRING([--enable-docs],
1847b3078addSmrg	   [Enable building the documentation (default: ]default[)]),
1848b3078addSmrg	   [build_docs=$enableval], [build_docs=]default)
1849b3078addSmrgm4_undefine([default])
1850b3078addSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1851b3078addSmrgAC_MSG_CHECKING([whether to build documentation])
1852b3078addSmrgAC_MSG_RESULT([$build_docs])
1853b3078addSmrg]) # XORG_ENABLE_DOCS
1854b3078addSmrg
1855b3078addSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1856b3078addSmrg# ----------------
1857b3078addSmrg# Minimum version: 1.6.0
1858b3078addSmrg#
1859b3078addSmrg# This macro enables a builder to skip all developer documentation.
1860b3078addSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1861b3078addSmrg# maximum flexibilty in controlling documentation building.
1862b3078addSmrg# Refer to:
1863b3078addSmrg# XORG_WITH_XMLTO         --with-xmlto
1864b3078addSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1865b3078addSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1866b3078addSmrg# XORG_WITH_FOP           --with-fop
1867b3078addSmrg# XORG_WITH_GROFF         --with-groff
1868b3078addSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1869b3078addSmrg#
1870b3078addSmrg# Interface to module:
1871b3078addSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1872b3078addSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1873b3078addSmrg#			'no' user instructs the module not to generate developer docs
1874b3078addSmrg# parm1:		specify the default value, yes or no.
1875b3078addSmrg#
1876b3078addSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1877b3078addSmrgm4_define([devel_default], m4_default([$1], [yes]))
1878b3078addSmrgAC_ARG_ENABLE(devel-docs,
1879b3078addSmrg	AS_HELP_STRING([--enable-devel-docs],
1880b3078addSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1881b3078addSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1882b3078addSmrgm4_undefine([devel_default])
1883b3078addSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1884b3078addSmrgAC_MSG_CHECKING([whether to build developer documentation])
1885b3078addSmrgAC_MSG_RESULT([$build_devel_docs])
1886b3078addSmrg]) # XORG_ENABLE_DEVEL_DOCS
1887b3078addSmrg
1888b3078addSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
1889b3078addSmrg# ----------------
1890b3078addSmrg# Minimum version: 1.6.0
1891b3078addSmrg#
1892b3078addSmrg# This macro enables a builder to skip all functional specification targets.
1893b3078addSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1894b3078addSmrg# maximum flexibilty in controlling documentation building.
1895b3078addSmrg# Refer to:
1896b3078addSmrg# XORG_WITH_XMLTO         --with-xmlto
1897b3078addSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1898b3078addSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1899b3078addSmrg# XORG_WITH_FOP           --with-fop
1900b3078addSmrg# XORG_WITH_GROFF         --with-groff
1901b3078addSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1902b3078addSmrg#
1903b3078addSmrg# Interface to module:
1904b3078addSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1905b3078addSmrg# --enable-specs:	'yes' user instructs the module to generate specs
1906b3078addSmrg#			'no' user instructs the module not to generate specs
1907b3078addSmrg# parm1:		specify the default value, yes or no.
1908b3078addSmrg#
1909b3078addSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1910b3078addSmrgm4_define([spec_default], m4_default([$1], [yes]))
1911b3078addSmrgAC_ARG_ENABLE(specs,
1912b3078addSmrg	AS_HELP_STRING([--enable-specs],
1913b3078addSmrg	   [Enable building the specs (default: ]spec_default[)]),
1914b3078addSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
1915b3078addSmrgm4_undefine([spec_default])
1916b3078addSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1917b3078addSmrgAC_MSG_CHECKING([whether to build functional specifications])
1918b3078addSmrgAC_MSG_RESULT([$build_specs])
1919b3078addSmrg]) # XORG_ENABLE_SPECS
1920b3078addSmrg
1921b3078addSmrg# XORG_CHECK_MALLOC_ZERO
1922b3078addSmrg# ----------------------
1923b3078addSmrg# Minimum version: 1.0.0
1924b3078addSmrg#
1925b3078addSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1926b3078addSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1927b3078addSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1928b3078addSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1929b3078addSmrgAC_ARG_ENABLE(malloc0returnsnull,
1930b3078addSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1931b3078addSmrg		       [malloc(0) returns NULL (default: auto)]),
19325c10afb9Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
19335c10afb9Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
19345c10afb9Smrg
19355c10afb9SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
19365c10afb9Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
19375c10afb9Smrg	AC_RUN_IFELSE([
19385c10afb9Smrgchar *malloc();
19395c10afb9Smrgchar *realloc();
19405c10afb9Smrgchar *calloc();
19415c10afb9Smrgmain() {
19425c10afb9Smrg    char *m0, *r0, *c0, *p;
19435c10afb9Smrg    m0 = malloc(0);
19445c10afb9Smrg    p = malloc(10);
19455c10afb9Smrg    r0 = realloc(p,0);
19465c10afb9Smrg    c0 = calloc(0);
19475c10afb9Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
19485c10afb9Smrg}],
19495c10afb9Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1950b3078addSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
1951b3078addSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
19525c10afb9Smrgfi
19535c10afb9SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
19545c10afb9Smrg
19555c10afb9Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
19565c10afb9Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
19575c10afb9Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
19585c10afb9Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
19595c10afb9Smrgelse
19605c10afb9Smrg	MALLOC_ZERO_CFLAGS=""
19615c10afb9Smrg	XMALLOC_ZERO_CFLAGS=""
19625c10afb9Smrg	XTMALLOC_ZERO_CFLAGS=""
19635c10afb9Smrgfi
19645c10afb9Smrg
19655c10afb9SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
19665c10afb9SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
19675c10afb9SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
19685c10afb9Smrg]) # XORG_CHECK_MALLOC_ZERO
19695c10afb9Smrg
1970b3078addSmrg# XORG_WITH_LINT()
1971b3078addSmrg# ----------------
1972b3078addSmrg# Minimum version: 1.1.0
1973b3078addSmrg#
1974b3078addSmrg# This macro enables the use of a tool that flags some suspicious and
1975b3078addSmrg# non-portable constructs (likely to be bugs) in C language source code.
1976b3078addSmrg# It will attempt to locate the tool and use appropriate options.
1977b3078addSmrg# There are various lint type tools on different platforms.
1978b3078addSmrg#
1979b3078addSmrg# Interface to module:
1980b3078addSmrg# LINT:		returns the path to the tool found on the platform
1981b3078addSmrg#		or the value set to LINT on the configure cmd line
1982b3078addSmrg#		also an Automake conditional
1983b3078addSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
1984b3078addSmrg#
1985b3078addSmrg# --with-lint:	'yes' user instructs the module to use lint
1986b3078addSmrg#		'no' user instructs the module not to use lint (default)
1987b3078addSmrg#
1988b3078addSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1989b3078addSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1990b3078addSmrg#
1991b3078addSmrgAC_DEFUN([XORG_WITH_LINT],[
1992b3078addSmrg
1993b3078addSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1994b3078addSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1995b3078addSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1996b3078addSmrg		[Use a lint-style source code checker (default: disabled)])],
1997b3078addSmrg		[use_lint=$withval], [use_lint=no])
1998b3078addSmrg
1999b3078addSmrg# Obtain platform specific info like program name and options
2000b3078addSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
2001b3078addSmrgcase $host_os in
2002b3078addSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
2003b3078addSmrg	lint_name=splint
2004b3078addSmrg	lint_options="-badflag"
2005b3078addSmrg	;;
2006b3078addSmrg  *freebsd* | *netbsd*)
2007b3078addSmrg	lint_name=lint
2008b3078addSmrg	lint_options="-u -b"
2009b3078addSmrg	;;
2010b3078addSmrg  *solaris*)
2011b3078addSmrg	lint_name=lint
2012b3078addSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2013b3078addSmrg	;;
2014b3078addSmrgesac
2015b3078addSmrg
2016b3078addSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
2017b3078addSmrgif test "x$use_lint" = x"yes" ; then
2018b3078addSmrg   AC_PATH_PROG([LINT], [$lint_name])
2019b3078addSmrg   if test "x$LINT" = "x"; then
2020b3078addSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2021b3078addSmrg   fi
2022b3078addSmrgelif test "x$use_lint" = x"no" ; then
2023b3078addSmrg   if test "x$LINT" != "x"; then
2024b3078addSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2025b3078addSmrg   fi
2026b3078addSmrgelse
2027b3078addSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
2028b3078addSmrgfi
2029b3078addSmrg
2030b3078addSmrg# User supplied flags override default flags
2031b3078addSmrgif test "x$LINT_FLAGS" != "x"; then
2032b3078addSmrg   lint_options=$LINT_FLAGS
2033b3078addSmrgfi
2034b3078addSmrg
2035b3078addSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2036b3078addSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2037b3078addSmrg
2038b3078addSmrg]) # XORG_WITH_LINT
2039b3078addSmrg
2040b3078addSmrg# XORG_LINT_LIBRARY(LIBNAME)
2041b3078addSmrg# --------------------------
2042b3078addSmrg# Minimum version: 1.1.0
2043b3078addSmrg#
2044b3078addSmrg# Sets up flags for building lint libraries for checking programs that call
2045b3078addSmrg# functions in the library.
2046b3078addSmrg#
2047b3078addSmrg# Interface to module:
2048b3078addSmrg# LINTLIB		- Automake variable with the name of lint library file to make
2049b3078addSmrg# MAKE_LINT_LIB		- Automake conditional
2050b3078addSmrg#
2051b3078addSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2052b3078addSmrg#			  - 'no' user instructs the module not to create a lint library (default)
2053b3078addSmrg
2054b3078addSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
2055b3078addSmrgAC_REQUIRE([XORG_WITH_LINT])
2056b3078addSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
2057b3078addSmrg	[Create lint library (default: disabled)])],
2058b3078addSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2059b3078addSmrg
2060b3078addSmrgif test "x$make_lint_lib" = x"yes" ; then
2061b3078addSmrg   LINTLIB=llib-l$1.ln
2062b3078addSmrg   if test "x$LINT" = "x"; then
2063b3078addSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2064b3078addSmrg   fi
2065b3078addSmrgelif test "x$make_lint_lib" != x"no" ; then
2066b3078addSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
2067b3078addSmrgfi
2068b3078addSmrg
2069b3078addSmrgAC_SUBST(LINTLIB)
2070b3078addSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
2071b3078addSmrg
2072b3078addSmrg]) # XORG_LINT_LIBRARY
2073b3078addSmrg
2074b3078addSmrg# XORG_CWARNFLAGS
2075b3078addSmrg# ---------------
2076b3078addSmrg# Minimum version: 1.2.0
2077b3078addSmrg#
2078b3078addSmrg# Defines CWARNFLAGS to enable C compiler warnings.
2079b3078addSmrg#
2080b3078addSmrgAC_DEFUN([XORG_CWARNFLAGS], [
2081b3078addSmrgAC_REQUIRE([AC_PROG_CC_C99])
2082b3078addSmrgif  test "x$GCC" = xyes ; then
2083b3078addSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
2084b3078addSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
2085b3078addSmrg-Wbad-function-cast -Wformat=2"
2086b3078addSmrg    case `$CC -dumpversion` in
2087b3078addSmrg    3.4.* | 4.*)
2088b3078addSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
2089b3078addSmrg	;;
2090b3078addSmrg    esac
2091b3078addSmrgelse
2092b3078addSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2093b3078addSmrg    if test "x$SUNCC" = "xyes"; then
2094b3078addSmrg	CWARNFLAGS="-v"
2095b3078addSmrg    fi
2096b3078addSmrgfi
2097b3078addSmrgAC_SUBST(CWARNFLAGS)
2098b3078addSmrg]) # XORG_CWARNFLAGS
2099b3078addSmrg
2100b3078addSmrg# XORG_STRICT_OPTION
2101b3078addSmrg# -----------------------
2102b3078addSmrg# Minimum version: 1.3.0
2103b3078addSmrg#
2104b3078addSmrg# Add configure option to enable strict compilation
2105b3078addSmrgAC_DEFUN([XORG_STRICT_OPTION], [
2106b3078addSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
2107b3078addSmrgAC_REQUIRE([AC_PROG_CC_C99])
2108b3078addSmrgAC_REQUIRE([XORG_CWARNFLAGS])
2109b3078addSmrg
2110b3078addSmrgAC_ARG_ENABLE(strict-compilation,
2111b3078addSmrg			  AS_HELP_STRING([--enable-strict-compilation],
2112b3078addSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
2113b3078addSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2114b3078addSmrgif test "x$STRICT_COMPILE" = "xyes"; then
2115b3078addSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
2116b3078addSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
2117b3078addSmrg	if test "x$GCC" = xyes ; then
2118b3078addSmrg		STRICT_CFLAGS="-pedantic -Werror"
2119b3078addSmrg	elif test "x$SUNCC" = "xyes"; then
2120b3078addSmrg		STRICT_CFLAGS="-errwarn"
2121b3078addSmrg    elif test "x$INTELCC" = "xyes"; then
2122b3078addSmrg		STRICT_CFLAGS="-Werror"
2123b3078addSmrg	fi
2124b3078addSmrgfi
2125b3078addSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
2126b3078addSmrgAC_SUBST([CWARNFLAGS])
2127b3078addSmrg]) # XORG_STRICT_OPTION
2128b3078addSmrg
2129b3078addSmrg# XORG_DEFAULT_OPTIONS
2130b3078addSmrg# --------------------
2131b3078addSmrg# Minimum version: 1.3.0
2132b3078addSmrg#
2133b3078addSmrg# Defines default options for X.Org modules.
2134b3078addSmrg#
2135b3078addSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
2136b3078addSmrgAC_REQUIRE([AC_PROG_INSTALL])
2137b3078addSmrgXORG_CWARNFLAGS
2138b3078addSmrgXORG_STRICT_OPTION
2139b3078addSmrgXORG_RELEASE_VERSION
2140b3078addSmrgXORG_CHANGELOG
2141b3078addSmrgXORG_INSTALL
2142b3078addSmrgXORG_MANPAGE_SECTIONS
2143b3078addSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2144b3078addSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2145b3078addSmrg]) # XORG_DEFAULT_OPTIONS
2146b3078addSmrg
2147b3078addSmrg# XORG_INSTALL()
2148b3078addSmrg# ----------------
2149b3078addSmrg# Minimum version: 1.4.0
2150b3078addSmrg#
2151b3078addSmrg# Defines the variable INSTALL_CMD as the command to copy
2152b3078addSmrg# INSTALL from $prefix/share/util-macros.
2153b3078addSmrg#
2154b3078addSmrgAC_DEFUN([XORG_INSTALL], [
2155b3078addSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2156b3078addSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2157b3078addSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2158b3078addSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2159b3078addSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
2160b3078addSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
2161b3078addSmrgAC_SUBST([INSTALL_CMD])
2162b3078addSmrg]) # XORG_INSTALL
21635c10afb9Smrgdnl Copyright 2005 Red Hat, Inc
21645c10afb9Smrgdnl
21655c10afb9Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
21665c10afb9Smrgdnl documentation for any purpose is hereby granted without fee, provided that
21675c10afb9Smrgdnl the above copyright notice appear in all copies and that both that
21685c10afb9Smrgdnl copyright notice and this permission notice appear in supporting
21695c10afb9Smrgdnl documentation.
21705c10afb9Smrgdnl
21715c10afb9Smrgdnl The above copyright notice and this permission notice shall be included
21725c10afb9Smrgdnl in all copies or substantial portions of the Software.
21735c10afb9Smrgdnl
21745c10afb9Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21755c10afb9Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21765c10afb9Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21775c10afb9Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
21785c10afb9Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21795c10afb9Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21805c10afb9Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
21815c10afb9Smrgdnl
21825c10afb9Smrgdnl Except as contained in this notice, the name of the copyright holders shall
21835c10afb9Smrgdnl not be used in advertising or otherwise to promote the sale, use or
21845c10afb9Smrgdnl other dealings in this Software without prior written authorization
21855c10afb9Smrgdnl from the copyright holders.
21865c10afb9Smrgdnl
21875c10afb9Smrg
21885c10afb9Smrg# XORG_RELEASE_VERSION
21895c10afb9Smrg# --------------------
2190b3078addSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
21915c10afb9Smrg 
21925c10afb9SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
2193b3078addSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2194b3078addSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2195b3078addSmrg		[Major version of this package])
2196b3078addSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2197b3078addSmrg	if test "x$PVM" = "x"; then
2198b3078addSmrg		PVM="0"
21995c10afb9Smrg	fi
2200b3078addSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2201b3078addSmrg		[$PVM],
2202b3078addSmrg		[Minor version of this package])
2203b3078addSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2204b3078addSmrg	if test "x$PVP" = "x"; then
2205b3078addSmrg		PVP="0"
2206b3078addSmrg	fi
2207b3078addSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2208b3078addSmrg		[$PVP],
2209b3078addSmrg		[Patch version of this package])
22105c10afb9Smrg])
22115c10afb9Smrg
2212b3078addSmrg# XORG_CHANGELOG()
2213b3078addSmrg# ----------------
2214b3078addSmrg# Minimum version: 1.2.0
2215b3078addSmrg#
2216b3078addSmrg# Defines the variable CHANGELOG_CMD as the command to generate
2217b3078addSmrg# ChangeLog from git.
2218b3078addSmrg#
2219b3078addSmrg#
2220b3078addSmrgAC_DEFUN([XORG_CHANGELOG], [
2221b3078addSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
2222b3078addSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2223b3078addSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2224b3078addSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
2225b3078addSmrgAC_SUBST([CHANGELOG_CMD])
2226b3078addSmrg]) # XORG_CHANGELOG
2227b3078addSmrg
2228b3078addSmrgdnl $XdotOrg: lib/xtrans/xtrans.m4,v 1.6 2005/07/26 18:59:11 alanc Exp $
2229b3078addSmrgdnl
2230b3078addSmrgdnl Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
2231b3078addSmrgdnl
2232b3078addSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
2233b3078addSmrgdnl copy of this software and associated documentation files (the "Software"),
2234b3078addSmrgdnl to deal in the Software without restriction, including without limitation
2235b3078addSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
2236b3078addSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
2237b3078addSmrgdnl Software is furnished to do so, subject to the following conditions:
2238b3078addSmrgdnl
2239b3078addSmrgdnl The above copyright notice and this permission notice (including the next
2240b3078addSmrgdnl paragraph) shall be included in all copies or substantial portions of the
2241b3078addSmrgdnl Software.
2242b3078addSmrgdnl
2243b3078addSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2244b3078addSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2245b3078addSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
2246b3078addSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2247b3078addSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2248b3078addSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2249b3078addSmrgdnl DEALINGS IN THE SOFTWARE.
2250b3078addSmrgdnl 
2251b3078addSmrg
2252b3078addSmrg# XTRANS_TCP_FLAGS()
2253b3078addSmrg# ------------------
2254b3078addSmrg# Find needed libraries for TCP sockets, and check for IPv6 support
2255b3078addSmrgAC_DEFUN([XTRANS_TCP_FLAGS],[
2256b3078addSmrg # SVR4 hides these in libraries other than libc
2257b3078addSmrg AC_SEARCH_LIBS(socket, [socket])
2258b3078addSmrg AC_SEARCH_LIBS(gethostbyname, [nsl])
2259b3078addSmrg if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then
2260b3078addSmrg   AC_HAVE_LIBRARY([ws2_32])
2261b3078addSmrg fi
2262b3078addSmrg
2263b3078addSmrg # Needs to come after above checks for libsocket & libnsl for SVR4 systems
2264b3078addSmrg AC_ARG_ENABLE(ipv6, 
2265b3078addSmrg	AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
2266b3078addSmrg	[IPV6CONN=$enableval], 
2267b3078addSmrg	[AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
2268b3078addSmrg AC_MSG_CHECKING([if IPv6 support should be built])
2269b3078addSmrg if test "$IPV6CONN" = "yes"; then
2270b3078addSmrg	AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
2271b3078addSmrg fi
2272b3078addSmrg AC_MSG_RESULT($IPV6CONN)
2273b3078addSmrg
2274b3078addSmrg # 4.3BSD-Reno added a new member to struct sockaddr_in
2275b3078addSmrg AC_CHECK_MEMBER([struct sockaddr_in.sin_len], 
2276b3078addSmrg	AC_DEFINE([BSD44SOCKETS],1,
2277b3078addSmrg 	    [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
2278b3078addSmrg#include <sys/types.h>
2279b3078addSmrg#include <sys/socket.h>
2280b3078addSmrg#include <netinet/in.h>
2281b3078addSmrg ])
2282b3078addSmrg
2283b3078addSmrg # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc.
2284b3078addSmrg AC_CHECK_TYPES([socklen_t], [], [], [
2285b3078addSmrgAC_INCLUDES_DEFAULT
2286b3078addSmrg#include <sys/socket.h>])
2287b3078addSmrg 
2288b3078addSmrg]) # XTRANS_TCP_FLAGS
2289b3078addSmrg
2290b3078addSmrg# XTRANS_CONNECTION_FLAGS()
2291b3078addSmrg# -------------------------
2292b3078addSmrg# Standard checks for which Xtrans transports to use by the Xorg packages
2293b3078addSmrg# that use Xtrans functions
2294b3078addSmrgAC_DEFUN([XTRANS_CONNECTION_FLAGS],[
2295b3078addSmrg AC_REQUIRE([AC_CANONICAL_HOST])
2296b3078addSmrg AC_REQUIRE([AC_TYPE_SIGNAL])
2297b3078addSmrg [case $host_os in
2298b3078addSmrg	mingw*)	unixdef="no"   ;;
2299b3078addSmrg	*)	unixdef="yes"  ;;
2300b3078addSmrg esac]
2301b3078addSmrg AC_ARG_ENABLE(unix-transport,
2302b3078addSmrg	AC_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
2303b3078addSmrg	[UNIXCONN=$enableval], [UNIXCONN=$unixdef])
2304b3078addSmrg AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
2305b3078addSmrg if test "$UNIXCONN" = "yes"; then
2306b3078addSmrg	AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
2307b3078addSmrg fi
2308b3078addSmrg AC_MSG_RESULT($UNIXCONN)
2309b3078addSmrg AC_ARG_ENABLE(tcp-transport, 
2310b3078addSmrg	AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
2311b3078addSmrg	[TCPCONN=$enableval], [TCPCONN=yes])
2312b3078addSmrg AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
2313b3078addSmrg AC_MSG_RESULT($TCPCONN)
2314b3078addSmrg if test "$TCPCONN" = "yes"; then
2315b3078addSmrg	AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
2316b3078addSmrg	XTRANS_TCP_FLAGS
2317b3078addSmrg fi
2318b3078addSmrg [case $host_os in
2319b3078addSmrg	solaris*|sco*|sysv4*)	localdef="yes" ;;
2320b3078addSmrg	*)			localdef="no"  ;;
2321b3078addSmrg esac]
2322b3078addSmrg AC_ARG_ENABLE(local-transport,
2323b3078addSmrg	AC_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
2324b3078addSmrg	[LOCALCONN=$enableval], [LOCALCONN=$localdef])
2325b3078addSmrg AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
2326b3078addSmrg AC_MSG_RESULT($LOCALCONN)
2327b3078addSmrg if test "$LOCALCONN" = "yes"; then
2328b3078addSmrg	AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
2329b3078addSmrg fi
2330b3078addSmrg 
2331b3078addSmrg]) # XTRANS_CONNECTION_FLAGS
2332b3078addSmrg
2333b3078addSmrg
2334b3078addSmrg# XTRANS_SECURE_RPC_FLAGS()
2335b3078addSmrg# -------------------------
2336b3078addSmrg# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
2337b3078addSmrg# so that any necessary networking libraries are already found
2338b3078addSmrgAC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
2339b3078addSmrg[AC_REQUIRE([XTRANS_TCP_FLAGS])
2340b3078addSmrg AC_ARG_ENABLE(secure-rpc, 
2341b3078addSmrg	AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
2342b3078addSmrg        [SECURE_RPC=$enableval], [SECURE_RPC="try"])
2343b3078addSmrg
2344b3078addSmrg if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
2345b3078addSmrg	FOUND_SECURE_RPC="no"
2346b3078addSmrg	AC_CHECK_FUNCS([authdes_seccreate authdes_create],
2347b3078addSmrg			[FOUND_SECURE_RPC="yes"])
2348b3078addSmrg	if test "x$FOUND_SECURE_RPC" = "xno" ; then
2349b3078addSmrg		if test "x$SECURE_RPC" = "xyes" ; then
2350b3078addSmrg	AC_MSG_ERROR([Secure RPC requested, but required functions not found])
2351b3078addSmrg		fi	
2352b3078addSmrg		SECURE_RPC="no"
2353b3078addSmrg	else
2354b3078addSmrg		dnl FreeBSD keeps getsecretkey in librpcsvc
2355b3078addSmrg		AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
2356b3078addSmrg		SECURE_RPC="yes"
2357b3078addSmrg	fi
2358b3078addSmrg fi
2359b3078addSmrg AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
2360b3078addSmrg if test "x$SECURE_RPC" = "xyes" ; then
2361b3078addSmrg	AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
2362b3078addSmrg fi
2363b3078addSmrg AC_MSG_RESULT($SECURE_RPC)
2364b3078addSmrg]) # XTRANS_SECURE_RPC_FLAGS
2365b3078addSmrg
2366b3078addSmrg
2367b3078addSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2368b3078addSmrg# 
2369b3078addSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2370b3078addSmrg#
2371b3078addSmrg# This program is free software; you can redistribute it and/or modify
2372b3078addSmrg# it under the terms of the GNU General Public License as published by
2373b3078addSmrg# the Free Software Foundation; either version 2 of the License, or
2374b3078addSmrg# (at your option) any later version.
2375b3078addSmrg#
2376b3078addSmrg# This program is distributed in the hope that it will be useful, but
2377b3078addSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
2378b3078addSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2379b3078addSmrg# General Public License for more details.
2380b3078addSmrg#
2381b3078addSmrg# You should have received a copy of the GNU General Public License
2382b3078addSmrg# along with this program; if not, write to the Free Software
2383b3078addSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2384b3078addSmrg#
2385b3078addSmrg# As a special exception to the GNU General Public License, if you
2386b3078addSmrg# distribute this file as part of a program that contains a
2387b3078addSmrg# configuration script generated by Autoconf, you may include it under
2388b3078addSmrg# the same distribution terms that you use for the rest of that program.
2389b3078addSmrg
2390b3078addSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
2391b3078addSmrg# ----------------------------------
2392b3078addSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
2393b3078addSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2394b3078addSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2395b3078addSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2396b3078addSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2397b3078addSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2398b3078addSmrgfi
2399b3078addSmrgif test -n "$PKG_CONFIG"; then
2400b3078addSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
2401b3078addSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2402b3078addSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2403b3078addSmrg		AC_MSG_RESULT([yes])
2404b3078addSmrg	else
2405b3078addSmrg		AC_MSG_RESULT([no])
2406b3078addSmrg		PKG_CONFIG=""
2407b3078addSmrg	fi
2408b3078addSmrg		
2409b3078addSmrgfi[]dnl
2410b3078addSmrg])# PKG_PROG_PKG_CONFIG
2411b3078addSmrg
2412b3078addSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2413b3078addSmrg#
2414b3078addSmrg# Check to see whether a particular set of modules exists.  Similar
2415b3078addSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
2416b3078addSmrg#
2417b3078addSmrg#
2418b3078addSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
2419b3078addSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
2420b3078addSmrg# PKG_CHECK_EXISTS manually
2421b3078addSmrg# --------------------------------------------------------------
2422b3078addSmrgAC_DEFUN([PKG_CHECK_EXISTS],
2423b3078addSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2424b3078addSmrgif test -n "$PKG_CONFIG" && \
2425b3078addSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
2426b3078addSmrg  m4_ifval([$2], [$2], [:])
2427b3078addSmrgm4_ifvaln([$3], [else
2428b3078addSmrg  $3])dnl
2429b3078addSmrgfi])
2430b3078addSmrg
2431b3078addSmrg
2432b3078addSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
2433b3078addSmrg# ---------------------------------------------
2434b3078addSmrgm4_define([_PKG_CONFIG],
2435b3078addSmrg[if test -n "$$1"; then
2436b3078addSmrg    pkg_cv_[]$1="$$1"
2437b3078addSmrg elif test -n "$PKG_CONFIG"; then
2438b3078addSmrg    PKG_CHECK_EXISTS([$3],
2439b3078addSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
2440b3078addSmrg		     [pkg_failed=yes])
2441b3078addSmrg else
2442b3078addSmrg    pkg_failed=untried
2443b3078addSmrgfi[]dnl
2444b3078addSmrg])# _PKG_CONFIG
2445b3078addSmrg
2446b3078addSmrg# _PKG_SHORT_ERRORS_SUPPORTED
2447b3078addSmrg# -----------------------------
2448b3078addSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2449b3078addSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2450b3078addSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2451b3078addSmrg        _pkg_short_errors_supported=yes
2452b3078addSmrgelse
2453b3078addSmrg        _pkg_short_errors_supported=no
2454b3078addSmrgfi[]dnl
2455b3078addSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
2456b3078addSmrg
2457b3078addSmrg
2458b3078addSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2459b3078addSmrg# [ACTION-IF-NOT-FOUND])
2460b3078addSmrg#
2461b3078addSmrg#
2462b3078addSmrg# Note that if there is a possibility the first call to
2463b3078addSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
2464b3078addSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2465b3078addSmrg#
2466b3078addSmrg#
2467b3078addSmrg# --------------------------------------------------------------
2468b3078addSmrgAC_DEFUN([PKG_CHECK_MODULES],
2469b3078addSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2470b3078addSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2471b3078addSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2472b3078addSmrg
2473b3078addSmrgpkg_failed=no
2474b3078addSmrgAC_MSG_CHECKING([for $1])
2475b3078addSmrg
2476b3078addSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2477b3078addSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2478b3078addSmrg
2479b3078addSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2480b3078addSmrgand $1[]_LIBS to avoid the need to call pkg-config.
2481b3078addSmrgSee the pkg-config man page for more details.])
2482b3078addSmrg
2483b3078addSmrgif test $pkg_failed = yes; then
2484b3078addSmrg        _PKG_SHORT_ERRORS_SUPPORTED
2485b3078addSmrg        if test $_pkg_short_errors_supported = yes; then
2486b3078addSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
2487b3078addSmrg        else 
2488b3078addSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
2489b3078addSmrg        fi
2490b3078addSmrg	# Put the nasty error message in config.log where it belongs
2491b3078addSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2492b3078addSmrg
2493b3078addSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
2494b3078addSmrg[Package requirements ($2) were not met:
2495b3078addSmrg
2496b3078addSmrg$$1_PKG_ERRORS
2497b3078addSmrg
2498b3078addSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
2499b3078addSmrginstalled software in a non-standard prefix.
2500b3078addSmrg
2501b3078addSmrg_PKG_TEXT
2502b3078addSmrg])],
2503b3078addSmrg		[AC_MSG_RESULT([no])
2504b3078addSmrg                $4])
2505b3078addSmrgelif test $pkg_failed = untried; then
2506b3078addSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
2507b3078addSmrg[The pkg-config script could not be found or is too old.  Make sure it
2508b3078addSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
2509b3078addSmrgpath to pkg-config.
2510b3078addSmrg
2511b3078addSmrg_PKG_TEXT
2512b3078addSmrg
2513b3078addSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
2514b3078addSmrg		[$4])
2515b3078addSmrgelse
2516b3078addSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2517b3078addSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2518b3078addSmrg        AC_MSG_RESULT([yes])
2519b3078addSmrg	ifelse([$3], , :, [$3])
2520b3078addSmrgfi[]dnl
2521b3078addSmrg])# PKG_CHECK_MODULES
2522b3078addSmrg
2523