aclocal.m4 revision b9bb67cb
1b9bb67cbSmrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
21cc8c64fSmrg
3b9bb67cbSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4b9bb67cbSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
51cc8c64fSmrg# This file is free software; the Free Software Foundation
61cc8c64fSmrg# gives unlimited permission to copy and/or distribute it,
71cc8c64fSmrg# with or without modifications, as long as this notice is preserved.
81cc8c64fSmrg
91cc8c64fSmrg# This program is distributed in the hope that it will be useful,
101cc8c64fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
111cc8c64fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
121cc8c64fSmrg# PARTICULAR PURPOSE.
131cc8c64fSmrg
14b9bb67cbSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15b9bb67cbSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16b9bb67cbSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17b9bb67cbSmrg[m4_warning([this file was generated for autoconf 2.63.
18b9bb67cbSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19b9bb67cbSmrgIf you have problems, you may need to regenerate the build system entirely.
20b9bb67cbSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
211cc8c64fSmrg
22b9bb67cbSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23b9bb67cbSmrg#
24b9bb67cbSmrg# This file is free software; the Free Software Foundation
25b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
26b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
271cc8c64fSmrg
281cc8c64fSmrg# AM_AUTOMAKE_VERSION(VERSION)
291cc8c64fSmrg# ----------------------------
301cc8c64fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
311cc8c64fSmrg# generated from the m4 files accompanying Automake X.Y.
32b9bb67cbSmrg# (This private macro should not be called outside this file.)
33b9bb67cbSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34b9bb67cbSmrg[am__api_version='1.11'
35b9bb67cbSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36b9bb67cbSmrgdnl require some minimum version.  Point them to the right macro.
37b9bb67cbSmrgm4_if([$1], [1.11], [],
38b9bb67cbSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39b9bb67cbSmrg])
40b9bb67cbSmrg
41b9bb67cbSmrg# _AM_AUTOCONF_VERSION(VERSION)
42b9bb67cbSmrg# -----------------------------
43b9bb67cbSmrg# aclocal traces this macro to find the Autoconf version.
44b9bb67cbSmrg# This is a private macro too.  Using m4_define simplifies
45b9bb67cbSmrg# the logic in aclocal, which can simply ignore this definition.
46b9bb67cbSmrgm4_define([_AM_AUTOCONF_VERSION], [])
471cc8c64fSmrg
481cc8c64fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
491cc8c64fSmrg# -------------------------------
50b9bb67cbSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51b9bb67cbSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
521cc8c64fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53b9bb67cbSmrg[AM_AUTOMAKE_VERSION([1.11])dnl
54b9bb67cbSmrgm4_ifndef([AC_AUTOCONF_VERSION],
55b9bb67cbSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56b9bb67cbSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
571cc8c64fSmrg
58b9bb67cbSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
591cc8c64fSmrg
60b9bb67cbSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
611cc8c64fSmrg#
62b9bb67cbSmrg# This file is free software; the Free Software Foundation
63b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
64b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
651cc8c64fSmrg
661cc8c64fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
671cc8c64fSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
681cc8c64fSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
691cc8c64fSmrg#
701cc8c64fSmrg# Of course, Automake must honor this variable whenever it calls a
711cc8c64fSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
721cc8c64fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
731cc8c64fSmrg# depending on how configure is run.  This is pretty annoying, since
741cc8c64fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
751cc8c64fSmrg# source directory, any form will work fine, but in subdirectories a
761cc8c64fSmrg# relative path needs to be adjusted first.
771cc8c64fSmrg#
781cc8c64fSmrg# $ac_aux_dir/missing
791cc8c64fSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
801cc8c64fSmrg# $top_srcdir/$ac_aux_dir/missing
811cc8c64fSmrg#    fails if $ac_aux_dir is absolute,
821cc8c64fSmrg#    fails when called from a subdirectory in a VPATH build with
831cc8c64fSmrg#          a relative $ac_aux_dir
841cc8c64fSmrg#
851cc8c64fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
861cc8c64fSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
871cc8c64fSmrg# harmless because $srcdir is `.', but things will broke when you
881cc8c64fSmrg# start a VPATH build or use an absolute $srcdir.
891cc8c64fSmrg#
901cc8c64fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
911cc8c64fSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
921cc8c64fSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
931cc8c64fSmrg# and then we would define $MISSING as
941cc8c64fSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
951cc8c64fSmrg# This will work as long as MISSING is not called from configure, because
961cc8c64fSmrg# unfortunately $(top_srcdir) has no meaning in configure.
971cc8c64fSmrg# However there are other variables, like CC, which are often used in
981cc8c64fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
991cc8c64fSmrg#
1001cc8c64fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
1011cc8c64fSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
1021cc8c64fSmrg# configured tree to be moved without reconfiguration.
1031cc8c64fSmrg
104b9bb67cbSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105b9bb67cbSmrg[dnl Rely on autoconf to set up CDPATH properly.
106b9bb67cbSmrgAC_PREREQ([2.50])dnl
1071cc8c64fSmrg# expand $ac_aux_dir to an absolute path
1081cc8c64fSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
1091cc8c64fSmrg])
1101cc8c64fSmrg
111b9bb67cbSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1121cc8c64fSmrg
113b9bb67cbSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114b9bb67cbSmrg# Free Software Foundation, Inc.
115b9bb67cbSmrg#
116b9bb67cbSmrg# This file is free software; the Free Software Foundation
117b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
118b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
1191cc8c64fSmrg
120b9bb67cbSmrg# serial 9
1211cc8c64fSmrg
122b9bb67cbSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123b9bb67cbSmrg# -------------------------------------
124b9bb67cbSmrg# Define a conditional.
125b9bb67cbSmrgAC_DEFUN([AM_CONDITIONAL],
126b9bb67cbSmrg[AC_PREREQ(2.52)dnl
127b9bb67cbSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128b9bb67cbSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129b9bb67cbSmrgAC_SUBST([$1_TRUE])dnl
130b9bb67cbSmrgAC_SUBST([$1_FALSE])dnl
131b9bb67cbSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132b9bb67cbSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133b9bb67cbSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134b9bb67cbSmrgif $2; then
135b9bb67cbSmrg  $1_TRUE=
136b9bb67cbSmrg  $1_FALSE='#'
1371cc8c64fSmrgelse
138b9bb67cbSmrg  $1_TRUE='#'
139b9bb67cbSmrg  $1_FALSE=
1401cc8c64fSmrgfi
141b9bb67cbSmrgAC_CONFIG_COMMANDS_PRE(
142b9bb67cbSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143b9bb67cbSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144b9bb67cbSmrgUsually this means the macro was only invoked conditionally.]])
145b9bb67cbSmrgfi])])
1461cc8c64fSmrg
147b9bb67cbSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148b9bb67cbSmrg# Free Software Foundation, Inc.
149b9bb67cbSmrg#
150b9bb67cbSmrg# This file is free software; the Free Software Foundation
151b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
152b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
1531cc8c64fSmrg
154b9bb67cbSmrg# serial 10
1551cc8c64fSmrg
1561cc8c64fSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1571cc8c64fSmrg# written in clear, in which case automake, when reading aclocal.m4,
1581cc8c64fSmrg# will think it sees a *use*, and therefore will trigger all it's
1591cc8c64fSmrg# C support machinery.  Also note that it means that autoscan, seeing
1601cc8c64fSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1611cc8c64fSmrg
1621cc8c64fSmrg
1631cc8c64fSmrg# _AM_DEPENDENCIES(NAME)
1641cc8c64fSmrg# ----------------------
1651cc8c64fSmrg# See how the compiler implements dependency checking.
1661cc8c64fSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1671cc8c64fSmrg# We try a few techniques and use that to set a single cache variable.
1681cc8c64fSmrg#
1691cc8c64fSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1701cc8c64fSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1711cc8c64fSmrg# dependency, and given that the user is not expected to run this macro,
1721cc8c64fSmrg# just rely on AC_PROG_CC.
1731cc8c64fSmrgAC_DEFUN([_AM_DEPENDENCIES],
1741cc8c64fSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1751cc8c64fSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1761cc8c64fSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1771cc8c64fSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1781cc8c64fSmrg
1791cc8c64fSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1801cc8c64fSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1811cc8c64fSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182b9bb67cbSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1831cc8c64fSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1841cc8c64fSmrg                   [depcc="$$1"   am_compiler_list=])
1851cc8c64fSmrg
1861cc8c64fSmrgAC_CACHE_CHECK([dependency style of $depcc],
1871cc8c64fSmrg               [am_cv_$1_dependencies_compiler_type],
1881cc8c64fSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1891cc8c64fSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1901cc8c64fSmrg  # making bogus files that we don't know about and never remove.  For
1911cc8c64fSmrg  # instance it was reported that on HP-UX the gcc test will end up
1921cc8c64fSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1931cc8c64fSmrg  # in D'.
1941cc8c64fSmrg  mkdir conftest.dir
1951cc8c64fSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1961cc8c64fSmrg  # using a relative directory.
1971cc8c64fSmrg  cp "$am_depcomp" conftest.dir
1981cc8c64fSmrg  cd conftest.dir
1991cc8c64fSmrg  # We will build objects and dependencies in a subdirectory because
2001cc8c64fSmrg  # it helps to detect inapplicable dependency modes.  For instance
2011cc8c64fSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2021cc8c64fSmrg  # side effect of compilation, but ICC will put the dependencies in
2031cc8c64fSmrg  # the current directory while Tru64 will put them in the object
2041cc8c64fSmrg  # directory.
2051cc8c64fSmrg  mkdir sub
2061cc8c64fSmrg
2071cc8c64fSmrg  am_cv_$1_dependencies_compiler_type=none
2081cc8c64fSmrg  if test "$am_compiler_list" = ""; then
2091cc8c64fSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2101cc8c64fSmrg  fi
211b9bb67cbSmrg  am__universal=false
212b9bb67cbSmrg  m4_case([$1], [CC],
213b9bb67cbSmrg    [case " $depcc " in #(
214b9bb67cbSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215b9bb67cbSmrg     esac],
216b9bb67cbSmrg    [CXX],
217b9bb67cbSmrg    [case " $depcc " in #(
218b9bb67cbSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219b9bb67cbSmrg     esac])
220b9bb67cbSmrg
2211cc8c64fSmrg  for depmode in $am_compiler_list; do
2221cc8c64fSmrg    # Setup a source with many dependencies, because some compilers
2231cc8c64fSmrg    # like to wrap large dependency lists on column 80 (with \), and
2241cc8c64fSmrg    # we should not choose a depcomp mode which is confused by this.
2251cc8c64fSmrg    #
2261cc8c64fSmrg    # We need to recreate these files for each test, as the compiler may
2271cc8c64fSmrg    # overwrite some of them when testing with obscure command lines.
2281cc8c64fSmrg    # This happens at least with the AIX C compiler.
2291cc8c64fSmrg    : > sub/conftest.c
2301cc8c64fSmrg    for i in 1 2 3 4 5 6; do
2311cc8c64fSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232b9bb67cbSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233b9bb67cbSmrg      # Solaris 8's {/usr,}/bin/sh.
234b9bb67cbSmrg      touch sub/conftst$i.h
2351cc8c64fSmrg    done
2361cc8c64fSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2371cc8c64fSmrg
238b9bb67cbSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239b9bb67cbSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240b9bb67cbSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241b9bb67cbSmrg    # versions had trouble with output in subdirs
242b9bb67cbSmrg    am__obj=sub/conftest.${OBJEXT-o}
243b9bb67cbSmrg    am__minus_obj="-o $am__obj"
2441cc8c64fSmrg    case $depmode in
245b9bb67cbSmrg    gcc)
246b9bb67cbSmrg      # This depmode causes a compiler race in universal mode.
247b9bb67cbSmrg      test "$am__universal" = false || continue
248b9bb67cbSmrg      ;;
2491cc8c64fSmrg    nosideeffect)
2501cc8c64fSmrg      # after this tag, mechanisms are not by side-effect, so they'll
2511cc8c64fSmrg      # only be used when explicitly requested
2521cc8c64fSmrg      if test "x$enable_dependency_tracking" = xyes; then
2531cc8c64fSmrg	continue
2541cc8c64fSmrg      else
2551cc8c64fSmrg	break
2561cc8c64fSmrg      fi
2571cc8c64fSmrg      ;;
258b9bb67cbSmrg    msvisualcpp | msvcmsys)
259b9bb67cbSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
260b9bb67cbSmrg      # not run yet.  These depmodes are late enough in the game, and
261b9bb67cbSmrg      # so weak that their functioning should not be impacted.
262b9bb67cbSmrg      am__obj=conftest.${OBJEXT-o}
263b9bb67cbSmrg      am__minus_obj=
264b9bb67cbSmrg      ;;
2651cc8c64fSmrg    none) break ;;
2661cc8c64fSmrg    esac
2671cc8c64fSmrg    if depmode=$depmode \
268b9bb67cbSmrg       source=sub/conftest.c object=$am__obj \
2691cc8c64fSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270b9bb67cbSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2711cc8c64fSmrg         >/dev/null 2>conftest.err &&
272b9bb67cbSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2731cc8c64fSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274b9bb67cbSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2751cc8c64fSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2761cc8c64fSmrg      # icc doesn't choke on unknown options, it will just issue warnings
277b9bb67cbSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
278b9bb67cbSmrg      # that says an option was ignored or not supported.
279b9bb67cbSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280b9bb67cbSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281b9bb67cbSmrg      # The diagnosis changed in icc 8.0:
282b9bb67cbSmrg      #   icc: Command line remark: option '-MP' not supported
283b9bb67cbSmrg      if (grep 'ignoring option' conftest.err ||
284b9bb67cbSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2851cc8c64fSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2861cc8c64fSmrg        break
2871cc8c64fSmrg      fi
2881cc8c64fSmrg    fi
2891cc8c64fSmrg  done
2901cc8c64fSmrg
2911cc8c64fSmrg  cd ..
2921cc8c64fSmrg  rm -rf conftest.dir
2931cc8c64fSmrgelse
2941cc8c64fSmrg  am_cv_$1_dependencies_compiler_type=none
2951cc8c64fSmrgfi
2961cc8c64fSmrg])
297b9bb67cbSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
298b9bb67cbSmrgAM_CONDITIONAL([am__fastdep$1], [
299b9bb67cbSmrg  test "x$enable_dependency_tracking" != xno \
300b9bb67cbSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
301b9bb67cbSmrg])
302b9bb67cbSmrg
303b9bb67cbSmrg
304b9bb67cbSmrg# AM_SET_DEPDIR
305b9bb67cbSmrg# -------------
306b9bb67cbSmrg# Choose a directory name for dependency files.
307b9bb67cbSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
308b9bb67cbSmrgAC_DEFUN([AM_SET_DEPDIR],
309b9bb67cbSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
310b9bb67cbSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
311b9bb67cbSmrg])
312b9bb67cbSmrg
313b9bb67cbSmrg
314b9bb67cbSmrg# AM_DEP_TRACK
315b9bb67cbSmrg# ------------
316b9bb67cbSmrgAC_DEFUN([AM_DEP_TRACK],
317b9bb67cbSmrg[AC_ARG_ENABLE(dependency-tracking,
318b9bb67cbSmrg[  --disable-dependency-tracking  speeds up one-time build
319b9bb67cbSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
320b9bb67cbSmrgif test "x$enable_dependency_tracking" != xno; then
321b9bb67cbSmrg  am_depcomp="$ac_aux_dir/depcomp"
322b9bb67cbSmrg  AMDEPBACKSLASH='\'
323b9bb67cbSmrgfi
324b9bb67cbSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325b9bb67cbSmrgAC_SUBST([AMDEPBACKSLASH])dnl
326b9bb67cbSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
327b9bb67cbSmrg])
328b9bb67cbSmrg
329b9bb67cbSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
330b9bb67cbSmrg
331b9bb67cbSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332b9bb67cbSmrg# Free Software Foundation, Inc.
333b9bb67cbSmrg#
334b9bb67cbSmrg# This file is free software; the Free Software Foundation
335b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
336b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
337b9bb67cbSmrg
338b9bb67cbSmrg#serial 5
339b9bb67cbSmrg
340b9bb67cbSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
341b9bb67cbSmrg# ------------------------------
342b9bb67cbSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343b9bb67cbSmrg[{
344b9bb67cbSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345b9bb67cbSmrg  # are listed without --file.  Let's play safe and only enable the eval
346b9bb67cbSmrg  # if we detect the quoting.
347b9bb67cbSmrg  case $CONFIG_FILES in
348b9bb67cbSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
349b9bb67cbSmrg  *)   set x $CONFIG_FILES ;;
350b9bb67cbSmrg  esac
351b9bb67cbSmrg  shift
352b9bb67cbSmrg  for mf
353b9bb67cbSmrg  do
354b9bb67cbSmrg    # Strip MF so we end up with the name of the file.
355b9bb67cbSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356b9bb67cbSmrg    # Check whether this is an Automake generated Makefile or not.
357b9bb67cbSmrg    # We used to match only the files named `Makefile.in', but
358b9bb67cbSmrg    # some people rename them; so instead we look at the file content.
359b9bb67cbSmrg    # Grep'ing the first line is not enough: some people post-process
360b9bb67cbSmrg    # each Makefile.in and add a new line on top of each file to say so.
361b9bb67cbSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
362b9bb67cbSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
363b9bb67cbSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364b9bb67cbSmrg      dirpart=`AS_DIRNAME("$mf")`
365b9bb67cbSmrg    else
366b9bb67cbSmrg      continue
367b9bb67cbSmrg    fi
368b9bb67cbSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
369b9bb67cbSmrg    # from the Makefile without running `make'.
370b9bb67cbSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371b9bb67cbSmrg    test -z "$DEPDIR" && continue
372b9bb67cbSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373b9bb67cbSmrg    test -z "am__include" && continue
374b9bb67cbSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375b9bb67cbSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
376b9bb67cbSmrg    U=`sed -n 's/^U = //p' < "$mf"`
377b9bb67cbSmrg    # Find all dependency output files, they are included files with
378b9bb67cbSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379b9bb67cbSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380b9bb67cbSmrg    # expansion.
381b9bb67cbSmrg    for file in `sed -n "
382b9bb67cbSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383b9bb67cbSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384b9bb67cbSmrg      # Make sure the directory exists.
385b9bb67cbSmrg      test -f "$dirpart/$file" && continue
386b9bb67cbSmrg      fdir=`AS_DIRNAME(["$file"])`
387b9bb67cbSmrg      AS_MKDIR_P([$dirpart/$fdir])
388b9bb67cbSmrg      # echo "creating $dirpart/$file"
389b9bb67cbSmrg      echo '# dummy' > "$dirpart/$file"
390b9bb67cbSmrg    done
391b9bb67cbSmrg  done
392b9bb67cbSmrg}
393b9bb67cbSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394b9bb67cbSmrg
395b9bb67cbSmrg
396b9bb67cbSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
397b9bb67cbSmrg# -----------------------------
398b9bb67cbSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
399b9bb67cbSmrg#
400b9bb67cbSmrg# This code is only required when automatic dependency tracking
401b9bb67cbSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
402b9bb67cbSmrg# need in order to bootstrap the dependency handling code.
403b9bb67cbSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
404b9bb67cbSmrg[AC_CONFIG_COMMANDS([depfiles],
405b9bb67cbSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
406b9bb67cbSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
407b9bb67cbSmrg])
408b9bb67cbSmrg
409b9bb67cbSmrg# Do all the work for Automake.                             -*- Autoconf -*-
410b9bb67cbSmrg
411b9bb67cbSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
412b9bb67cbSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
413b9bb67cbSmrg#
414b9bb67cbSmrg# This file is free software; the Free Software Foundation
415b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
416b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
417b9bb67cbSmrg
418b9bb67cbSmrg# serial 16
419b9bb67cbSmrg
420b9bb67cbSmrg# This macro actually does too much.  Some checks are only needed if
421b9bb67cbSmrg# your package does certain things.  But this isn't really a big deal.
422b9bb67cbSmrg
423b9bb67cbSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
424b9bb67cbSmrg# AM_INIT_AUTOMAKE([OPTIONS])
425b9bb67cbSmrg# -----------------------------------------------
426b9bb67cbSmrg# The call with PACKAGE and VERSION arguments is the old style
427b9bb67cbSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
428b9bb67cbSmrg# and VERSION should now be passed to AC_INIT and removed from
429b9bb67cbSmrg# the call to AM_INIT_AUTOMAKE.
430b9bb67cbSmrg# We support both call styles for the transition.  After
431b9bb67cbSmrg# the next Automake release, Autoconf can make the AC_INIT
432b9bb67cbSmrg# arguments mandatory, and then we can depend on a new Autoconf
433b9bb67cbSmrg# release and drop the old call support.
434b9bb67cbSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
435b9bb67cbSmrg[AC_PREREQ([2.62])dnl
436b9bb67cbSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
437b9bb67cbSmrgdnl the ones we care about.
438b9bb67cbSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
439b9bb67cbSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
440b9bb67cbSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
441b9bb67cbSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
442b9bb67cbSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
443b9bb67cbSmrg  # is not polluted with repeated "-I."
444b9bb67cbSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
445b9bb67cbSmrg  # test to see if srcdir already configured
446b9bb67cbSmrg  if test -f $srcdir/config.status; then
447b9bb67cbSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
448b9bb67cbSmrg  fi
449b9bb67cbSmrgfi
450b9bb67cbSmrg
451b9bb67cbSmrg# test whether we have cygpath
452b9bb67cbSmrgif test -z "$CYGPATH_W"; then
453b9bb67cbSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
454b9bb67cbSmrg    CYGPATH_W='cygpath -w'
455b9bb67cbSmrg  else
456b9bb67cbSmrg    CYGPATH_W=echo
457b9bb67cbSmrg  fi
458b9bb67cbSmrgfi
459b9bb67cbSmrgAC_SUBST([CYGPATH_W])
460b9bb67cbSmrg
461b9bb67cbSmrg# Define the identity of the package.
462b9bb67cbSmrgdnl Distinguish between old-style and new-style calls.
463b9bb67cbSmrgm4_ifval([$2],
464b9bb67cbSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
465b9bb67cbSmrg AC_SUBST([PACKAGE], [$1])dnl
466b9bb67cbSmrg AC_SUBST([VERSION], [$2])],
467b9bb67cbSmrg[_AM_SET_OPTIONS([$1])dnl
468b9bb67cbSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
469b9bb67cbSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
470b9bb67cbSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
471b9bb67cbSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
472b9bb67cbSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
473b9bb67cbSmrg
474b9bb67cbSmrg_AM_IF_OPTION([no-define],,
475b9bb67cbSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
476b9bb67cbSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
477b9bb67cbSmrg
478b9bb67cbSmrg# Some tools Automake needs.
479b9bb67cbSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
480b9bb67cbSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
481b9bb67cbSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
482b9bb67cbSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
483b9bb67cbSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
484b9bb67cbSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
485b9bb67cbSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
486b9bb67cbSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
487b9bb67cbSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
488b9bb67cbSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
489b9bb67cbSmrg# We need awk for the "check" target.  The system "awk" is bad on
490b9bb67cbSmrg# some platforms.
491b9bb67cbSmrgAC_REQUIRE([AC_PROG_AWK])dnl
492b9bb67cbSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
493b9bb67cbSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
494b9bb67cbSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
495b9bb67cbSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
496b9bb67cbSmrg			     [_AM_PROG_TAR([v7])])])
497b9bb67cbSmrg_AM_IF_OPTION([no-dependencies],,
498b9bb67cbSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
499b9bb67cbSmrg		  [_AM_DEPENDENCIES(CC)],
500b9bb67cbSmrg		  [define([AC_PROG_CC],
501b9bb67cbSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
502b9bb67cbSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
503b9bb67cbSmrg		  [_AM_DEPENDENCIES(CXX)],
504b9bb67cbSmrg		  [define([AC_PROG_CXX],
505b9bb67cbSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
506b9bb67cbSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
507b9bb67cbSmrg		  [_AM_DEPENDENCIES(OBJC)],
508b9bb67cbSmrg		  [define([AC_PROG_OBJC],
509b9bb67cbSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
510b9bb67cbSmrg])
511b9bb67cbSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
512b9bb67cbSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
513b9bb67cbSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
514b9bb67cbSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
515b9bb67cbSmrgAC_CONFIG_COMMANDS_PRE(dnl
516b9bb67cbSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
517b9bb67cbSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
518b9bb67cbSmrg])
519b9bb67cbSmrg
520b9bb67cbSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
521b9bb67cbSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
522b9bb67cbSmrgdnl mangled by Autoconf and run in a shell conditional statement.
523b9bb67cbSmrgm4_define([_AC_COMPILER_EXEEXT],
524b9bb67cbSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
525b9bb67cbSmrg
526b9bb67cbSmrg
527b9bb67cbSmrg# When config.status generates a header, we must update the stamp-h file.
528b9bb67cbSmrg# This file resides in the same directory as the config header
529b9bb67cbSmrg# that is generated.  The stamp files are numbered to have different names.
530b9bb67cbSmrg
531b9bb67cbSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
532b9bb67cbSmrg# loop where config.status creates the headers, so we can generate
533b9bb67cbSmrg# our stamp files there.
534b9bb67cbSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
535b9bb67cbSmrg[# Compute $1's index in $config_headers.
536b9bb67cbSmrg_am_arg=$1
537b9bb67cbSmrg_am_stamp_count=1
538b9bb67cbSmrgfor _am_header in $config_headers :; do
539b9bb67cbSmrg  case $_am_header in
540b9bb67cbSmrg    $_am_arg | $_am_arg:* )
541b9bb67cbSmrg      break ;;
542b9bb67cbSmrg    * )
543b9bb67cbSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
544b9bb67cbSmrg  esac
545b9bb67cbSmrgdone
546b9bb67cbSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
547b9bb67cbSmrg
548b9bb67cbSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
549b9bb67cbSmrg#
550b9bb67cbSmrg# This file is free software; the Free Software Foundation
551b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
552b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
553b9bb67cbSmrg
554b9bb67cbSmrg# AM_PROG_INSTALL_SH
555b9bb67cbSmrg# ------------------
556b9bb67cbSmrg# Define $install_sh.
557b9bb67cbSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
558b9bb67cbSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
559b9bb67cbSmrgif test x"${install_sh}" != xset; then
560b9bb67cbSmrg  case $am_aux_dir in
561b9bb67cbSmrg  *\ * | *\	*)
562b9bb67cbSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
563b9bb67cbSmrg  *)
564b9bb67cbSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
565b9bb67cbSmrg  esac
566b9bb67cbSmrgfi
567b9bb67cbSmrgAC_SUBST(install_sh)])
568b9bb67cbSmrg
569b9bb67cbSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
570b9bb67cbSmrg#
571b9bb67cbSmrg# This file is free software; the Free Software Foundation
572b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
573b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
574b9bb67cbSmrg
575b9bb67cbSmrg# serial 2
576b9bb67cbSmrg
577b9bb67cbSmrg# Check whether the underlying file-system supports filenames
578b9bb67cbSmrg# with a leading dot.  For instance MS-DOS doesn't.
579b9bb67cbSmrgAC_DEFUN([AM_SET_LEADING_DOT],
580b9bb67cbSmrg[rm -rf .tst 2>/dev/null
581b9bb67cbSmrgmkdir .tst 2>/dev/null
582b9bb67cbSmrgif test -d .tst; then
583b9bb67cbSmrg  am__leading_dot=.
584b9bb67cbSmrgelse
585b9bb67cbSmrg  am__leading_dot=_
586b9bb67cbSmrgfi
587b9bb67cbSmrgrmdir .tst 2>/dev/null
588b9bb67cbSmrgAC_SUBST([am__leading_dot])])
589b9bb67cbSmrg
590b9bb67cbSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
591b9bb67cbSmrg# From Jim Meyering
592b9bb67cbSmrg
593b9bb67cbSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
594b9bb67cbSmrg# Free Software Foundation, Inc.
595b9bb67cbSmrg#
596b9bb67cbSmrg# This file is free software; the Free Software Foundation
597b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
598b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
599b9bb67cbSmrg
600b9bb67cbSmrg# serial 5
601b9bb67cbSmrg
602b9bb67cbSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
603b9bb67cbSmrg# ----------------------------------
604b9bb67cbSmrg# Control maintainer-specific portions of Makefiles.
605b9bb67cbSmrg# Default is to disable them, unless `enable' is passed literally.
606b9bb67cbSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
607b9bb67cbSmrg# can override the default with the --enable/--disable switch.
608b9bb67cbSmrgAC_DEFUN([AM_MAINTAINER_MODE],
609b9bb67cbSmrg[m4_case(m4_default([$1], [disable]),
610b9bb67cbSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
611b9bb67cbSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
612b9bb67cbSmrg       [m4_define([am_maintainer_other], [enable])
613b9bb67cbSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
614b9bb67cbSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
615b9bb67cbSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
616b9bb67cbSmrg  AC_ARG_ENABLE([maintainer-mode],
617b9bb67cbSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
618b9bb67cbSmrg			  (and sometimes confusing) to the casual installer],
619b9bb67cbSmrg      [USE_MAINTAINER_MODE=$enableval],
620b9bb67cbSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
621b9bb67cbSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
622b9bb67cbSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
623b9bb67cbSmrg  MAINT=$MAINTAINER_MODE_TRUE
624b9bb67cbSmrg  AC_SUBST([MAINT])dnl
625b9bb67cbSmrg]
626b9bb67cbSmrg)
627b9bb67cbSmrg
628b9bb67cbSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
629b9bb67cbSmrg
630b9bb67cbSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
631b9bb67cbSmrg
632b9bb67cbSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
633b9bb67cbSmrg#
634b9bb67cbSmrg# This file is free software; the Free Software Foundation
635b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
636b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
637b9bb67cbSmrg
638b9bb67cbSmrg# serial 4
639b9bb67cbSmrg
640b9bb67cbSmrg# AM_MAKE_INCLUDE()
641b9bb67cbSmrg# -----------------
642b9bb67cbSmrg# Check to see how make treats includes.
643b9bb67cbSmrgAC_DEFUN([AM_MAKE_INCLUDE],
644b9bb67cbSmrg[am_make=${MAKE-make}
645b9bb67cbSmrgcat > confinc << 'END'
646b9bb67cbSmrgam__doit:
647b9bb67cbSmrg	@echo this is the am__doit target
648b9bb67cbSmrg.PHONY: am__doit
649b9bb67cbSmrgEND
650b9bb67cbSmrg# If we don't find an include directive, just comment out the code.
651b9bb67cbSmrgAC_MSG_CHECKING([for style of include used by $am_make])
652b9bb67cbSmrgam__include="#"
653b9bb67cbSmrgam__quote=
654b9bb67cbSmrg_am_result=none
655b9bb67cbSmrg# First try GNU make style include.
656b9bb67cbSmrgecho "include confinc" > confmf
657b9bb67cbSmrg# Ignore all kinds of additional output from `make'.
658b9bb67cbSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
659b9bb67cbSmrg*the\ am__doit\ target*)
660b9bb67cbSmrg  am__include=include
661b9bb67cbSmrg  am__quote=
662b9bb67cbSmrg  _am_result=GNU
663b9bb67cbSmrg  ;;
664b9bb67cbSmrgesac
665b9bb67cbSmrg# Now try BSD make style include.
666b9bb67cbSmrgif test "$am__include" = "#"; then
667b9bb67cbSmrg   echo '.include "confinc"' > confmf
668b9bb67cbSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
669b9bb67cbSmrg   *the\ am__doit\ target*)
670b9bb67cbSmrg     am__include=.include
671b9bb67cbSmrg     am__quote="\""
672b9bb67cbSmrg     _am_result=BSD
673b9bb67cbSmrg     ;;
674b9bb67cbSmrg   esac
675b9bb67cbSmrgfi
676b9bb67cbSmrgAC_SUBST([am__include])
677b9bb67cbSmrgAC_SUBST([am__quote])
678b9bb67cbSmrgAC_MSG_RESULT([$_am_result])
679b9bb67cbSmrgrm -f confinc confmf
680b9bb67cbSmrg])
681b9bb67cbSmrg
682b9bb67cbSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
683b9bb67cbSmrg
684b9bb67cbSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
685b9bb67cbSmrg# Free Software Foundation, Inc.
686b9bb67cbSmrg#
687b9bb67cbSmrg# This file is free software; the Free Software Foundation
688b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
689b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
690b9bb67cbSmrg
691b9bb67cbSmrg# serial 6
692b9bb67cbSmrg
693b9bb67cbSmrg# AM_MISSING_PROG(NAME, PROGRAM)
694b9bb67cbSmrg# ------------------------------
695b9bb67cbSmrgAC_DEFUN([AM_MISSING_PROG],
696b9bb67cbSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
697b9bb67cbSmrg$1=${$1-"${am_missing_run}$2"}
698b9bb67cbSmrgAC_SUBST($1)])
699b9bb67cbSmrg
700b9bb67cbSmrg
701b9bb67cbSmrg# AM_MISSING_HAS_RUN
702b9bb67cbSmrg# ------------------
703b9bb67cbSmrg# Define MISSING if not defined so far and test if it supports --run.
704b9bb67cbSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
705b9bb67cbSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
706b9bb67cbSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
707b9bb67cbSmrgAC_REQUIRE_AUX_FILE([missing])dnl
708b9bb67cbSmrgif test x"${MISSING+set}" != xset; then
709b9bb67cbSmrg  case $am_aux_dir in
710b9bb67cbSmrg  *\ * | *\	*)
711b9bb67cbSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
712b9bb67cbSmrg  *)
713b9bb67cbSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
714b9bb67cbSmrg  esac
715b9bb67cbSmrgfi
716b9bb67cbSmrg# Use eval to expand $SHELL
717b9bb67cbSmrgif eval "$MISSING --run true"; then
718b9bb67cbSmrg  am_missing_run="$MISSING --run "
719b9bb67cbSmrgelse
720b9bb67cbSmrg  am_missing_run=
721b9bb67cbSmrg  AC_MSG_WARN([`missing' script is too old or missing])
722b9bb67cbSmrgfi
723b9bb67cbSmrg])
724b9bb67cbSmrg
725b9bb67cbSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
726b9bb67cbSmrg#
727b9bb67cbSmrg# This file is free software; the Free Software Foundation
728b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
729b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
730b9bb67cbSmrg
731b9bb67cbSmrg# AM_PROG_MKDIR_P
732b9bb67cbSmrg# ---------------
733b9bb67cbSmrg# Check for `mkdir -p'.
734b9bb67cbSmrgAC_DEFUN([AM_PROG_MKDIR_P],
735b9bb67cbSmrg[AC_PREREQ([2.60])dnl
736b9bb67cbSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
737b9bb67cbSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
738b9bb67cbSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
739b9bb67cbSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
740b9bb67cbSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
741b9bb67cbSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
742b9bb67cbSmrgdnl adjustment using top_builddir (which is defined more often than
743b9bb67cbSmrgdnl MKDIR_P).
744b9bb67cbSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
745b9bb67cbSmrgcase $mkdir_p in
746b9bb67cbSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
747b9bb67cbSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
748b9bb67cbSmrgesac
749b9bb67cbSmrg])
750b9bb67cbSmrg
751b9bb67cbSmrg# Helper functions for option handling.                     -*- Autoconf -*-
752b9bb67cbSmrg
753b9bb67cbSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
754b9bb67cbSmrg#
755b9bb67cbSmrg# This file is free software; the Free Software Foundation
756b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
757b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
758b9bb67cbSmrg
759b9bb67cbSmrg# serial 4
760b9bb67cbSmrg
761b9bb67cbSmrg# _AM_MANGLE_OPTION(NAME)
762b9bb67cbSmrg# -----------------------
763b9bb67cbSmrgAC_DEFUN([_AM_MANGLE_OPTION],
764b9bb67cbSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
765b9bb67cbSmrg
766b9bb67cbSmrg# _AM_SET_OPTION(NAME)
767b9bb67cbSmrg# ------------------------------
768b9bb67cbSmrg# Set option NAME.  Presently that only means defining a flag for this option.
769b9bb67cbSmrgAC_DEFUN([_AM_SET_OPTION],
770b9bb67cbSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
771b9bb67cbSmrg
772b9bb67cbSmrg# _AM_SET_OPTIONS(OPTIONS)
773b9bb67cbSmrg# ----------------------------------
774b9bb67cbSmrg# OPTIONS is a space-separated list of Automake options.
775b9bb67cbSmrgAC_DEFUN([_AM_SET_OPTIONS],
776b9bb67cbSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
777b9bb67cbSmrg
778b9bb67cbSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
779b9bb67cbSmrg# -------------------------------------------
780b9bb67cbSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
781b9bb67cbSmrgAC_DEFUN([_AM_IF_OPTION],
782b9bb67cbSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
783b9bb67cbSmrg
784b9bb67cbSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
785b9bb67cbSmrg
786b9bb67cbSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
787b9bb67cbSmrg# Free Software Foundation, Inc.
788b9bb67cbSmrg#
789b9bb67cbSmrg# This file is free software; the Free Software Foundation
790b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
791b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
792b9bb67cbSmrg
793b9bb67cbSmrg# serial 5
794b9bb67cbSmrg
795b9bb67cbSmrg# AM_SANITY_CHECK
796b9bb67cbSmrg# ---------------
797b9bb67cbSmrgAC_DEFUN([AM_SANITY_CHECK],
798b9bb67cbSmrg[AC_MSG_CHECKING([whether build environment is sane])
799b9bb67cbSmrg# Just in case
800b9bb67cbSmrgsleep 1
801b9bb67cbSmrgecho timestamp > conftest.file
802b9bb67cbSmrg# Reject unsafe characters in $srcdir or the absolute working directory
803b9bb67cbSmrg# name.  Accept space and tab only in the latter.
804b9bb67cbSmrgam_lf='
805b9bb67cbSmrg'
806b9bb67cbSmrgcase `pwd` in
807b9bb67cbSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
808b9bb67cbSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
809b9bb67cbSmrgesac
810b9bb67cbSmrgcase $srcdir in
811b9bb67cbSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
812b9bb67cbSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
813b9bb67cbSmrgesac
814b9bb67cbSmrg
815b9bb67cbSmrg# Do `set' in a subshell so we don't clobber the current shell's
816b9bb67cbSmrg# arguments.  Must try -L first in case configure is actually a
817b9bb67cbSmrg# symlink; some systems play weird games with the mod time of symlinks
818b9bb67cbSmrg# (eg FreeBSD returns the mod time of the symlink's containing
819b9bb67cbSmrg# directory).
820b9bb67cbSmrgif (
821b9bb67cbSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
822b9bb67cbSmrg   if test "$[*]" = "X"; then
823b9bb67cbSmrg      # -L didn't work.
824b9bb67cbSmrg      set X `ls -t "$srcdir/configure" conftest.file`
825b9bb67cbSmrg   fi
826b9bb67cbSmrg   rm -f conftest.file
827b9bb67cbSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
828b9bb67cbSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
829b9bb67cbSmrg
830b9bb67cbSmrg      # If neither matched, then we have a broken ls.  This can happen
831b9bb67cbSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
832b9bb67cbSmrg      # broken ls alias from the environment.  This has actually
833b9bb67cbSmrg      # happened.  Such a system could not be considered "sane".
834b9bb67cbSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
835b9bb67cbSmrgalias in your environment])
836b9bb67cbSmrg   fi
837b9bb67cbSmrg
838b9bb67cbSmrg   test "$[2]" = conftest.file
839b9bb67cbSmrg   )
840b9bb67cbSmrgthen
841b9bb67cbSmrg   # Ok.
842b9bb67cbSmrg   :
843b9bb67cbSmrgelse
844b9bb67cbSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
845b9bb67cbSmrgCheck your system clock])
846b9bb67cbSmrgfi
847b9bb67cbSmrgAC_MSG_RESULT(yes)])
848b9bb67cbSmrg
849b9bb67cbSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
850b9bb67cbSmrg#
851b9bb67cbSmrg# This file is free software; the Free Software Foundation
852b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
853b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
854b9bb67cbSmrg
855b9bb67cbSmrg# serial 1
856b9bb67cbSmrg
857b9bb67cbSmrg# AM_SILENT_RULES([DEFAULT])
858b9bb67cbSmrg# --------------------------
859b9bb67cbSmrg# Enable less verbose build rules; with the default set to DEFAULT
860b9bb67cbSmrg# (`yes' being less verbose, `no' or empty being verbose).
861b9bb67cbSmrgAC_DEFUN([AM_SILENT_RULES],
862b9bb67cbSmrg[AC_ARG_ENABLE([silent-rules],
863b9bb67cbSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
864b9bb67cbSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
865b9bb67cbSmrgcase $enable_silent_rules in
866b9bb67cbSmrgyes) AM_DEFAULT_VERBOSITY=0;;
867b9bb67cbSmrgno)  AM_DEFAULT_VERBOSITY=1;;
868b9bb67cbSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
869b9bb67cbSmrgesac
870b9bb67cbSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
871b9bb67cbSmrgAM_BACKSLASH='\'
872b9bb67cbSmrgAC_SUBST([AM_BACKSLASH])dnl
873b9bb67cbSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
874b9bb67cbSmrg])
875b9bb67cbSmrg
876b9bb67cbSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
877b9bb67cbSmrg#
878b9bb67cbSmrg# This file is free software; the Free Software Foundation
879b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
880b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
881b9bb67cbSmrg
882b9bb67cbSmrg# AM_PROG_INSTALL_STRIP
883b9bb67cbSmrg# ---------------------
884b9bb67cbSmrg# One issue with vendor `install' (even GNU) is that you can't
885b9bb67cbSmrg# specify the program used to strip binaries.  This is especially
886b9bb67cbSmrg# annoying in cross-compiling environments, where the build's strip
887b9bb67cbSmrg# is unlikely to handle the host's binaries.
888b9bb67cbSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
889b9bb67cbSmrg# always use install-sh in `make install-strip', and initialize
890b9bb67cbSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
891b9bb67cbSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
892b9bb67cbSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
893b9bb67cbSmrg# Installed binaries are usually stripped using `strip' when the user
894b9bb67cbSmrg# run `make install-strip'.  However `strip' might not be the right
895b9bb67cbSmrg# tool to use in cross-compilation environments, therefore Automake
896b9bb67cbSmrg# will honor the `STRIP' environment variable to overrule this program.
897b9bb67cbSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
898b9bb67cbSmrgif test "$cross_compiling" != no; then
899b9bb67cbSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
900b9bb67cbSmrgfi
901b9bb67cbSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
902b9bb67cbSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
903b9bb67cbSmrg
904b9bb67cbSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
905b9bb67cbSmrg#
906b9bb67cbSmrg# This file is free software; the Free Software Foundation
907b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
908b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
909b9bb67cbSmrg
910b9bb67cbSmrg# serial 2
911b9bb67cbSmrg
912b9bb67cbSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
913b9bb67cbSmrg# ---------------------------
914b9bb67cbSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
915b9bb67cbSmrg# This macro is traced by Automake.
916b9bb67cbSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
917b9bb67cbSmrg
918b9bb67cbSmrg# AM_SUBST_NOTMAKE(VARIABLE)
919b9bb67cbSmrg# ---------------------------
920b9bb67cbSmrg# Public sister of _AM_SUBST_NOTMAKE.
921b9bb67cbSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
922b9bb67cbSmrg
923b9bb67cbSmrg# Check how to create a tarball.                            -*- Autoconf -*-
924b9bb67cbSmrg
925b9bb67cbSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
926b9bb67cbSmrg#
927b9bb67cbSmrg# This file is free software; the Free Software Foundation
928b9bb67cbSmrg# gives unlimited permission to copy and/or distribute it,
929b9bb67cbSmrg# with or without modifications, as long as this notice is preserved.
930b9bb67cbSmrg
931b9bb67cbSmrg# serial 2
932b9bb67cbSmrg
933b9bb67cbSmrg# _AM_PROG_TAR(FORMAT)
934b9bb67cbSmrg# --------------------
935b9bb67cbSmrg# Check how to create a tarball in format FORMAT.
936b9bb67cbSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
937b9bb67cbSmrg#
938b9bb67cbSmrg# Substitute a variable $(am__tar) that is a command
939b9bb67cbSmrg# writing to stdout a FORMAT-tarball containing the directory
940b9bb67cbSmrg# $tardir.
941b9bb67cbSmrg#     tardir=directory && $(am__tar) > result.tar
942b9bb67cbSmrg#
943b9bb67cbSmrg# Substitute a variable $(am__untar) that extract such
944b9bb67cbSmrg# a tarball read from stdin.
945b9bb67cbSmrg#     $(am__untar) < result.tar
946b9bb67cbSmrgAC_DEFUN([_AM_PROG_TAR],
947b9bb67cbSmrg[# Always define AMTAR for backward compatibility.
948b9bb67cbSmrgAM_MISSING_PROG([AMTAR], [tar])
949b9bb67cbSmrgm4_if([$1], [v7],
950b9bb67cbSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
951b9bb67cbSmrg     [m4_case([$1], [ustar],, [pax],,
952b9bb67cbSmrg              [m4_fatal([Unknown tar format])])
953b9bb67cbSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
954b9bb67cbSmrg# Loop over all known methods to create a tar archive until one works.
955b9bb67cbSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
956b9bb67cbSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
957b9bb67cbSmrg# Do not fold the above two line into one, because Tru64 sh and
958b9bb67cbSmrg# Solaris sh will not grok spaces in the rhs of `-'.
959b9bb67cbSmrgfor _am_tool in $_am_tools
960b9bb67cbSmrgdo
961b9bb67cbSmrg  case $_am_tool in
962b9bb67cbSmrg  gnutar)
963b9bb67cbSmrg    for _am_tar in tar gnutar gtar;
964b9bb67cbSmrg    do
965b9bb67cbSmrg      AM_RUN_LOG([$_am_tar --version]) && break
966b9bb67cbSmrg    done
967b9bb67cbSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
968b9bb67cbSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
969b9bb67cbSmrg    am__untar="$_am_tar -xf -"
970b9bb67cbSmrg    ;;
971b9bb67cbSmrg  plaintar)
972b9bb67cbSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
973b9bb67cbSmrg    # ustar tarball either.
974b9bb67cbSmrg    (tar --version) >/dev/null 2>&1 && continue
975b9bb67cbSmrg    am__tar='tar chf - "$$tardir"'
976b9bb67cbSmrg    am__tar_='tar chf - "$tardir"'
977b9bb67cbSmrg    am__untar='tar xf -'
978b9bb67cbSmrg    ;;
979b9bb67cbSmrg  pax)
980b9bb67cbSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
981b9bb67cbSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
982b9bb67cbSmrg    am__untar='pax -r'
983b9bb67cbSmrg    ;;
984b9bb67cbSmrg  cpio)
985b9bb67cbSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
986b9bb67cbSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987b9bb67cbSmrg    am__untar='cpio -i -H $1 -d'
988b9bb67cbSmrg    ;;
989b9bb67cbSmrg  none)
990b9bb67cbSmrg    am__tar=false
991b9bb67cbSmrg    am__tar_=false
992b9bb67cbSmrg    am__untar=false
993b9bb67cbSmrg    ;;
994b9bb67cbSmrg  esac
995b9bb67cbSmrg
996b9bb67cbSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
997b9bb67cbSmrg  # and am__untar set.
998b9bb67cbSmrg  test -n "${am_cv_prog_tar_$1}" && break
999b9bb67cbSmrg
1000b9bb67cbSmrg  # tar/untar a dummy directory, and stop if the command works
1001b9bb67cbSmrg  rm -rf conftest.dir
1002b9bb67cbSmrg  mkdir conftest.dir
1003b9bb67cbSmrg  echo GrepMe > conftest.dir/file
1004b9bb67cbSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1005b9bb67cbSmrg  rm -rf conftest.dir
1006b9bb67cbSmrg  if test -s conftest.tar; then
1007b9bb67cbSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1008b9bb67cbSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1009b9bb67cbSmrg  fi
1010b9bb67cbSmrgdone
1011b9bb67cbSmrgrm -rf conftest.dir
1012b9bb67cbSmrg
1013b9bb67cbSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1014b9bb67cbSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1015b9bb67cbSmrgAC_SUBST([am__tar])
1016b9bb67cbSmrgAC_SUBST([am__untar])
1017b9bb67cbSmrg]) # _AM_PROG_TAR
1018b9bb67cbSmrg
1019b9bb67cbSmrgdnl fontutil.m4.  Generated from fontutil.m4.in by configure.
1020b9bb67cbSmrgdnl
1021b9bb67cbSmrgdnl This file comes from X.Org's font-util 1.1.0
1022b9bb67cbSmrgdnl
1023b9bb67cbSmrgdnl Copyright 2005 Red Hat, Inc
1024b9bb67cbSmrgdnl
1025b9bb67cbSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1026b9bb67cbSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1027b9bb67cbSmrgdnl the above copyright notice appear in all copies and that both that
1028b9bb67cbSmrgdnl copyright notice and this permission notice appear in supporting
1029b9bb67cbSmrgdnl documentation.
1030b9bb67cbSmrgdnl
1031b9bb67cbSmrgdnl The above copyright notice and this permission notice shall be included
1032b9bb67cbSmrgdnl in all copies or substantial portions of the Software.
1033b9bb67cbSmrgdnl
1034b9bb67cbSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1035b9bb67cbSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1036b9bb67cbSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1037b9bb67cbSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1038b9bb67cbSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1039b9bb67cbSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1040b9bb67cbSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1041b9bb67cbSmrgdnl
1042b9bb67cbSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1043b9bb67cbSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1044b9bb67cbSmrgdnl other dealings in this Software without prior written authorization
1045b9bb67cbSmrgdnl from the copyright holders.
1046b9bb67cbSmrgdnl
1047b9bb67cbSmrgdnl --------------------------------------------------------------------
1048b9bb67cbSmrgdnl
1049b9bb67cbSmrgdnl Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
1050b9bb67cbSmrgdnl
1051b9bb67cbSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1052b9bb67cbSmrgdnl copy of this software and associated documentation files (the
1053b9bb67cbSmrgdnl "Software"), to deal in the Software without restriction, including
1054b9bb67cbSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
1055b9bb67cbSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
1056b9bb67cbSmrgdnl to whom the Software is furnished to do so, provided that the above
1057b9bb67cbSmrgdnl copyright notice(s) and this permission notice appear in all copies of
1058b9bb67cbSmrgdnl the Software and that both the above copyright notice(s) and this
1059b9bb67cbSmrgdnl permission notice appear in supporting documentation.
1060b9bb67cbSmrgdnl
1061b9bb67cbSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1062b9bb67cbSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1063b9bb67cbSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1064b9bb67cbSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1065b9bb67cbSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1066b9bb67cbSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1067b9bb67cbSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1068b9bb67cbSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1069b9bb67cbSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1070b9bb67cbSmrgdnl
1071b9bb67cbSmrgdnl Except as contained in this notice, the name of a copyright holder
1072b9bb67cbSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
1073b9bb67cbSmrgdnl or other dealings in this Software without prior written authorization
1074b9bb67cbSmrgdnl of the copyright holder.
1075b9bb67cbSmrg
1076b9bb67cbSmrg# XORG_FONT_MACROS_VERSION(required-version)
1077b9bb67cbSmrg# ------------------------------------------
1078b9bb67cbSmrg# Minimum version: 1.1.0
1079b9bb67cbSmrg#
1080b9bb67cbSmrg# If you're using a macro added in Version 1.1 or newer, include this in
1081b9bb67cbSmrg# your configure.ac with the minimum required version, such as:
1082b9bb67cbSmrg# XORG_FONT_MACROS_VERSION(1.1)
1083b9bb67cbSmrg#
1084b9bb67cbSmrg# To ensure that this macro is defined, also add:
1085b9bb67cbSmrg# m4_ifndef([XORG_FONT_MACROS_VERSION],
1086b9bb67cbSmrg#     [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
1087b9bb67cbSmrg#
1088b9bb67cbSmrg#
1089b9bb67cbSmrg# See the "minimum version" comment for each macro you use to see what
1090b9bb67cbSmrg# version you require.
1091b9bb67cbSmrgm4_defun([XORG_FONT_MACROS_VERSION],[
1092b9bb67cbSmrgm4_define([vers_have], [1.1.0])
1093b9bb67cbSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1094b9bb67cbSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1095b9bb67cbSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1096b9bb67cbSmrg    [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])])
1097b9bb67cbSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1098b9bb67cbSmrg    [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])])
1099b9bb67cbSmrgm4_undefine([vers_have])
1100b9bb67cbSmrgm4_undefine([maj_have])
1101b9bb67cbSmrgm4_undefine([maj_needed])
1102b9bb67cbSmrg]) # XORG_FONT_MACROS_VERSION
1103b9bb67cbSmrg
1104b9bb67cbSmrg# XORG_FONT_CHECK_{maps}()
1105b9bb67cbSmrg# ------------------------
1106b9bb67cbSmrg# Minimum version: 1.0.0
1107b9bb67cbSmrg# These macros add --enable/disable-{maps} where {maps} are ISO8859-*,
1108b9bb67cbSmrg# JISX0201 or KOI8_R.  By default, they are all enabled.
1109b9bb67cbSmrg
1110b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)])
1111b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)])
1112b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)])
1113b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)])
1114b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)])
1115b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)])
1116b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)])
1117b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)])
1118b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)])
1119b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)])
1120b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)])
1121b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)])
1122b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)])
1123b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)])
1124b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)])
1125b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)])
1126b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_JISX0201],  [XORG_FONT_CHECK_ENCODING(JISX0201)])
1127b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_KOI8_R],    [XORG_FONT_CHECK_ENCODING(KOI8-R)])
1128b9bb67cbSmrg
1129b9bb67cbSmrg# XORG_FONT_CHECK_ENCODING(encoding)
1130b9bb67cbSmrg# ----------------------------------
1131b9bb67cbSmrg# Minimum version: 1.1.0
1132b9bb67cbSmrg# This macro adds --enable/disable-<encoding>, enabled by default.
1133b9bb67cbSmrg# It replaced individual copies of this code in the above macros in 1.1.
1134b9bb67cbSmrg# Currently assumes encoding names will be all upper-case - add m4_toupper
1135b9bb67cbSmrg# calls if this is not true in the future.
1136b9bb67cbSmrg
1137b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING],[
1138b9bb67cbSmrg	AC_ARG_ENABLE(m4_tolower($1),
1139b9bb67cbSmrg		AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)),
1140b9bb67cbSmrg				[Build $1 fonts (default: yes)]),
1141b9bb67cbSmrg		[AS_TR_SH($1)=$enableval], [AS_TR_SH($1)=yes])
1142b9bb67cbSmrg	AC_MSG_CHECKING([whether to build $1 fonts])
1143b9bb67cbSmrg	AC_MSG_RESULT($[AS_TR_SH($1)])
1144b9bb67cbSmrg	AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes])
1145b9bb67cbSmrg]) # XORG_FONT_CHECK_ENCODING
1146b9bb67cbSmrg
1147b9bb67cbSmrg# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....)
1148b9bb67cbSmrg# -----------------------------------------------------
1149b9bb67cbSmrg# Minimum version: 1.1.0
1150b9bb67cbSmrg# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once
1151b9bb67cbSmrg
1152b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[
1153b9bb67cbSmrg	m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)])
1154b9bb67cbSmrg]) # XORG_FONT_CHECK_ENCODING_LIST
1155b9bb67cbSmrg
1156b9bb67cbSmrg# XORG_FONT_REQUIRED_PROG(VARNAME, progname)
1157b9bb67cbSmrg# ------------------------------------------
1158b9bb67cbSmrg# Minimum version: 1.1.0
1159b9bb67cbSmrg#
1160b9bb67cbSmrg# Simple wrapper around AC_PATH_PROG that errors if not found
1161b9bb67cbSmrg#
1162b9bb67cbSmrg
1163b9bb67cbSmrgAC_DEFUN([XORG_FONT_REQUIRED_PROG],[
1164b9bb67cbSmrg	AC_PATH_PROG($1, $2)
1165b9bb67cbSmrg	if test x"$1" = x; then
1166b9bb67cbSmrg		AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.])
1167b9bb67cbSmrg	fi
1168b9bb67cbSmrg])
1169b9bb67cbSmrg
1170b9bb67cbSmrg
1171b9bb67cbSmrg# XORG_FONT_FCCACHE()
1172b9bb67cbSmrg# -------------------
1173b9bb67cbSmrg# Minimum version: 1.1.0
1174b9bb67cbSmrg#
1175b9bb67cbSmrg# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found
1176b9bb67cbSmrg# Set RUN_FCCACHE to a rule suitable for substituting into a makefile
1177b9bb67cbSmrg# to run fc-cache if found and not installing to $DESTDIR
1178b9bb67cbSmrg#
1179b9bb67cbSmrg# fc-cache is optional, not required, and should be skipped when making
1180b9bb67cbSmrg# packages (installing to $DESTDIR).
1181b9bb67cbSmrg#
1182b9bb67cbSmrgAC_DEFUN([XORG_FONT_FCCACHE],[
1183b9bb67cbSmrg	AC_PATH_PROG(FCCACHE, fc-cache)
1184b9bb67cbSmrg	FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"'
1185b9bb67cbSmrg	if test x"$FCCACHE" = x ; then
1186b9bb67cbSmrg		RUN_FCCACHE="${FCCACHE_WARN}"
1187b9bb67cbSmrg	else
1188b9bb67cbSmrg		RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else'
1189b9bb67cbSmrg		RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)"
1190b9bb67cbSmrg	fi
1191b9bb67cbSmrg	AC_SUBST([RUN_FCCACHE])
11921cc8c64fSmrg])
11931cc8c64fSmrg
11941cc8c64fSmrg
1195b9bb67cbSmrg# XORG_FONT_COMMON_UTILS()
1196b9bb67cbSmrg# ------------------------
1197b9bb67cbSmrg# Minimum version: 1.1.0
1198b9bb67cbSmrg#
1199b9bb67cbSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types
1200b9bb67cbSmrg
1201b9bb67cbSmrgAC_DEFUN([XORG_FONT_COMMON_UTILS],[
1202b9bb67cbSmrg	XORG_FONT_FCCACHE
1203b9bb67cbSmrg	XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir)
12041cc8c64fSmrg])
12051cc8c64fSmrg
1206b9bb67cbSmrg# XORG_FONT_SCALED_UTILS()
1207b9bb67cbSmrg# ------------------------
1208b9bb67cbSmrg# Minimum version: 1.1.0
1209b9bb67cbSmrg#
1210b9bb67cbSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts
1211b9bb67cbSmrg# (TrueType, OpenType, Type1)
12121cc8c64fSmrg
1213b9bb67cbSmrgAC_DEFUN([XORG_FONT_SCALED_UTILS],[
1214b9bb67cbSmrg	XORG_FONT_COMMON_UTILS
1215b9bb67cbSmrg	XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale)
12161cc8c64fSmrg])
12171cc8c64fSmrg
1218b9bb67cbSmrg# XORG_FONT_BDF_UTILS()
1219b9bb67cbSmrg# ---------------------
1220b9bb67cbSmrg# Minimum version: 1.1.0
1221b9bb67cbSmrg#
1222b9bb67cbSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts
1223b9bb67cbSmrg# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the
1224b9bb67cbSmrg# PCF output files created by bdftopcf
1225b9bb67cbSmrg
1226b9bb67cbSmrgAC_DEFUN([XORG_FONT_BDF_UTILS],[
1227b9bb67cbSmrg	XORG_FONT_COMMON_UTILS
1228b9bb67cbSmrg	XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf)
1229b9bb67cbSmrg	XORG_FONT_CHECK_COMPRESSION
1230b9bb67cbSmrg])
12311cc8c64fSmrg
1232b9bb67cbSmrg# XORG_FONT_CHECK_COMPRESSION()
1233b9bb67cbSmrg# -----------------------------
1234b9bb67cbSmrg# Minimum version: 1.1.0
1235b9bb67cbSmrg#
1236b9bb67cbSmrg# Offer a --with-compression flag to control what compression method is
1237b9bb67cbSmrg# used for pcf font files.   Offers all the methods currently supported
1238b9bb67cbSmrg# by libXfont, including no compression.
1239b9bb67cbSmrg
1240b9bb67cbSmrgAC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[
1241b9bb67cbSmrg	AC_MSG_CHECKING([font compression method])
1242b9bb67cbSmrg	AC_ARG_WITH(compression,
1243b9bb67cbSmrg	 [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>],
1244b9bb67cbSmrg			 [compression method to use on pcf fonts])],
1245b9bb67cbSmrg         [compression="$withval"], [compression="yes"])
1246b9bb67cbSmrg	if test x"$compression" = "xyes" ; then
1247b9bb67cbSmrg		compression="gzip"
1248b9bb67cbSmrg	fi
1249b9bb67cbSmrg	AC_MSG_RESULT([${compression}])
1250b9bb67cbSmrg	case ${compression} in
1251b9bb67cbSmrg	 *compress)	COMPRESS_SUFFIX=".Z" ;;
1252b9bb67cbSmrg	 *gzip)		COMPRESS_SUFFIX=".gz" ;;
1253b9bb67cbSmrg	 *bzip2)	COMPRESS_SUFFIX=".bz2" ;;
1254b9bb67cbSmrg	 no|none)	COMPRESS_SUFFIX="" ; COMPRESS="cat" ;;
1255b9bb67cbSmrg	 *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;;
1256b9bb67cbSmrg	esac
1257b9bb67cbSmrg	if test x"$COMPRESS_SUFFIX" != "x" ; then
1258b9bb67cbSmrg	   XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression})
1259b9bb67cbSmrg	fi
1260b9bb67cbSmrg	AC_SUBST([COMPRESS_SUFFIX])
1261b9bb67cbSmrg])
12621cc8c64fSmrg
1263b9bb67cbSmrg# XORG_FONT_UCS2ANY()
1264b9bb67cbSmrg# -------------------
1265b9bb67cbSmrg# Minimum version: 1.1.0
1266b9bb67cbSmrg#
1267b9bb67cbSmrg# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting
1268b9bb67cbSmrg# Unicode-encoded BDF format bitmap fonts into subsets for older encodings.
1269b9bb67cbSmrg# Also call pkg-config to find the directory with the encoding files needed
1270b9bb67cbSmrg# by ucs2any, and export it as MAPFILES_PATH to the Makefiles
1271b9bb67cbSmrg
1272b9bb67cbSmrgAC_DEFUN([XORG_FONT_UCS2ANY],[
1273b9bb67cbSmrg	XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
1274b9bb67cbSmrg	PKG_CHECK_MODULES(MAPS, [fontutil])
1275b9bb67cbSmrg	AC_MSG_CHECKING([for ucs2any encoding data files])
1276b9bb67cbSmrg	MAPFILES_PATH=`pkg-config --variable=mapdir fontutil`
1277b9bb67cbSmrg	AC_SUBST(MAPFILES_PATH)
1278b9bb67cbSmrg	AC_MSG_RESULT([${MAPFILES_PATH}])
1279b9bb67cbSmrg])
12801cc8c64fSmrg
12811cc8c64fSmrg
12821cc8c64fSmrg
1283b9bb67cbSmrg# XORG_FONTROOTDIR()
1284b9bb67cbSmrg# --------------------
1285b9bb67cbSmrg# Minimum version: 1.1.0
1286b9bb67cbSmrg#
1287b9bb67cbSmrg# Sets FONTROOTDIR to the root directory for font files.  Uses the first
1288b9bb67cbSmrg# found from:
1289b9bb67cbSmrg#	--with-fontrootdir
1290b9bb67cbSmrg#	pkg-config --variable=fontrootdir fontutil
1291b9bb67cbSmrg#	${datadir}/fonts/X11
1292b9bb67cbSmrg
1293b9bb67cbSmrgAC_DEFUN([XORG_FONTROOTDIR],[
1294b9bb67cbSmrg	dnl Ensure $PKG_CONFIG is set first
1295b9bb67cbSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1296b9bb67cbSmrg
1297b9bb67cbSmrg	AC_MSG_CHECKING([for root directory for font files])
1298b9bb67cbSmrg	AC_ARG_WITH(fontrootdir,
1299b9bb67cbSmrg		    AS_HELP_STRING([--with-fontrootdir=DIR],
1300b9bb67cbSmrg			   [Path to root directory for font files]),
1301b9bb67cbSmrg		    [FONTROOTDIR="$withval"])
1302b9bb67cbSmrg	# if --with-fontrootdir not specified...
1303b9bb67cbSmrg	if test "x${FONTROOTDIR}" = "x"; then
1304b9bb67cbSmrg		FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
1305b9bb67cbSmrg	fi
1306b9bb67cbSmrg	# ...and if pkg-config didn't find fontdir in fontutil.pc...
1307b9bb67cbSmrg	if test "x${FONTROOTDIR}" = "x"; then
1308b9bb67cbSmrg		FONTROOTDIR="${datadir}/fonts/X11"
1309b9bb67cbSmrg	fi
1310b9bb67cbSmrg	AC_SUBST(FONTROOTDIR)
1311b9bb67cbSmrg	AC_MSG_RESULT([${FONTROOTDIR}])
1312b9bb67cbSmrg])
13131cc8c64fSmrg
1314b9bb67cbSmrg# XORG_FONTSUBDIR(variable, flag, subdir)
1315b9bb67cbSmrg# ---------------------------------------
1316b9bb67cbSmrg# Minimum version: 1.1.0
1317b9bb67cbSmrg#
1318b9bb67cbSmrg# Offer a --with-<flag> flag to control directory for font installation
1319b9bb67cbSmrg# Default is the specified <subdir> of the font root directory.
1320b9bb67cbSmrg# Sets <variable> to the selected directory
1321b9bb67cbSmrg
1322b9bb67cbSmrgAC_DEFUN([XORG_FONTSUBDIR],[
1323b9bb67cbSmrg	AC_REQUIRE([XORG_FONTROOTDIR])
1324b9bb67cbSmrg
1325b9bb67cbSmrg	AC_MSG_CHECKING([for directory for $3 files])
1326b9bb67cbSmrg	AC_ARG_WITH($2,
1327b9bb67cbSmrg		    [AS_HELP_STRING([--with-$2=DIR],
1328b9bb67cbSmrg		       		   [Path to $3 files [FONTROOTDIR/$3]])],
1329b9bb67cbSmrg		    [$1="${withval}"], [$1='${FONTROOTDIR}/$3'])
1330b9bb67cbSmrg	AC_SUBST($1)
1331b9bb67cbSmrg	AC_MSG_RESULT([${$1}])
1332b9bb67cbSmrg]) # XORG_FONTSUBDIR
1333b9bb67cbSmrg
1334b9bb67cbSmrg# XORG_FONTDIR(subdir)
1335b9bb67cbSmrg# --------------------
1336b9bb67cbSmrg# Minimum version: 1.1.0
1337b9bb67cbSmrg#
1338b9bb67cbSmrg# Offer a --with-fontdir flag to control directory for font installation
1339b9bb67cbSmrg# Default is the specified subdir of the font root directory.
1340b9bb67cbSmrg# Sets FONTDIR to the selected directory
13411cc8c64fSmrg
1342b9bb67cbSmrgAC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])])
13431cc8c64fSmrg
1344b9bb67cbSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1345b9bb67cbSmrgdnl
1346b9bb67cbSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
1347b9bb67cbSmrgdnl 
1348b9bb67cbSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1349b9bb67cbSmrgdnl copy of this software and associated documentation files (the
1350b9bb67cbSmrgdnl "Software"), to deal in the Software without restriction, including
1351b9bb67cbSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
1352b9bb67cbSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
1353b9bb67cbSmrgdnl to whom the Software is furnished to do so, provided that the above
1354b9bb67cbSmrgdnl copyright notice(s) and this permission notice appear in all copies of
1355b9bb67cbSmrgdnl the Software and that both the above copyright notice(s) and this
1356b9bb67cbSmrgdnl permission notice appear in supporting documentation.
1357b9bb67cbSmrgdnl
1358b9bb67cbSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1359b9bb67cbSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1360b9bb67cbSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1361b9bb67cbSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1362b9bb67cbSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1363b9bb67cbSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1364b9bb67cbSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1365b9bb67cbSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1366b9bb67cbSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1367b9bb67cbSmrgdnl
1368b9bb67cbSmrgdnl Except as contained in this notice, the name of a copyright holder
1369b9bb67cbSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
1370b9bb67cbSmrgdnl or other dealings in this Software without prior written authorization
1371b9bb67cbSmrgdnl of the copyright holder.
1372b9bb67cbSmrg
1373b9bb67cbSmrg# XORG_MACROS_VERSION(required-version)
1374b9bb67cbSmrg# -------------------------------------
1375b9bb67cbSmrg# Minimum version: 1.1.0
13761cc8c64fSmrg#
1377b9bb67cbSmrg# If you're using a macro added in Version 1.1 or newer, include this in
1378b9bb67cbSmrg# your configure.ac with the minimum required version, such as:
1379b9bb67cbSmrg# XORG_MACROS_VERSION(1.1)
1380b9bb67cbSmrg#
1381b9bb67cbSmrg# To ensure that this macro is defined, also add:
1382b9bb67cbSmrg# m4_ifndef([XORG_MACROS_VERSION],
1383b9bb67cbSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1384b9bb67cbSmrg#
1385b9bb67cbSmrg#
1386b9bb67cbSmrg# See the "minimum version" comment for each macro you use to see what 
1387b9bb67cbSmrg# version you require.
1388b9bb67cbSmrgm4_defun([XORG_MACROS_VERSION],[
1389b9bb67cbSmrgm4_define([vers_have], [1.3.0])
1390b9bb67cbSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1391b9bb67cbSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1392b9bb67cbSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1393b9bb67cbSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1394b9bb67cbSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1395b9bb67cbSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1396b9bb67cbSmrgm4_undefine([vers_have])
1397b9bb67cbSmrgm4_undefine([maj_have])
1398b9bb67cbSmrgm4_undefine([maj_needed])
1399b9bb67cbSmrg]) # XORG_MACROS_VERSION
1400b9bb67cbSmrg
1401b9bb67cbSmrg# XORG_PROG_RAWCPP()
1402b9bb67cbSmrg# ------------------
1403b9bb67cbSmrg# Minimum version: 1.0.0
1404b9bb67cbSmrg#
1405b9bb67cbSmrg# Find cpp program and necessary flags for use in pre-processing text files
1406b9bb67cbSmrg# such as man pages and config files
1407b9bb67cbSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1408b9bb67cbSmrgAC_REQUIRE([AC_PROG_CPP])
1409b9bb67cbSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
1410b9bb67cbSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1411b9bb67cbSmrg
1412b9bb67cbSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1413b9bb67cbSmrg# which is not the best choice for supporting other OS'es, but covers most
1414b9bb67cbSmrg# of the ones we need for now.
1415b9bb67cbSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1416b9bb67cbSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
1417b9bb67cbSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1418b9bb67cbSmrg	AC_MSG_RESULT([no])
1419b9bb67cbSmrgelse
1420b9bb67cbSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1421b9bb67cbSmrg		RAWCPPFLAGS=-undef
1422b9bb67cbSmrg		AC_MSG_RESULT([yes])
1423b9bb67cbSmrg	# under Cygwin unix is still defined even with -undef
1424b9bb67cbSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1425b9bb67cbSmrg		RAWCPPFLAGS="-undef -ansi"
1426b9bb67cbSmrg		AC_MSG_RESULT([yes, with -ansi])
1427b9bb67cbSmrg	else
1428b9bb67cbSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1429b9bb67cbSmrg	fi
1430b9bb67cbSmrgfi
1431b9bb67cbSmrgrm -f conftest.$ac_ext
14321cc8c64fSmrg
1433b9bb67cbSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1434b9bb67cbSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
1435b9bb67cbSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1436b9bb67cbSmrg	AC_MSG_RESULT([no])
1437b9bb67cbSmrgelse
1438b9bb67cbSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1439b9bb67cbSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1440b9bb67cbSmrg		AC_MSG_RESULT([yes])
1441b9bb67cbSmrg	else
1442b9bb67cbSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1443b9bb67cbSmrg	fi
1444b9bb67cbSmrgfi
1445b9bb67cbSmrgrm -f conftest.$ac_ext
1446b9bb67cbSmrgAC_SUBST(RAWCPPFLAGS)
1447b9bb67cbSmrg]) # XORG_PROG_RAWCPP
14481cc8c64fSmrg
1449b9bb67cbSmrg# XORG_MANPAGE_SECTIONS()
1450b9bb67cbSmrg# -----------------------
1451b9bb67cbSmrg# Minimum version: 1.0.0
1452b9bb67cbSmrg#
1453b9bb67cbSmrg# Determine which sections man pages go in for the different man page types
1454b9bb67cbSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1455b9bb67cbSmrg# Not sure if there's any better way than just hardcoding by OS name.
1456b9bb67cbSmrg# Override default settings by setting environment variables
14571cc8c64fSmrg
1458b9bb67cbSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1459b9bb67cbSmrgAC_REQUIRE([AC_CANONICAL_HOST])
14601cc8c64fSmrg
1461b9bb67cbSmrgif test x$APP_MAN_SUFFIX = x    ; then
1462b9bb67cbSmrg    APP_MAN_SUFFIX=1
1463b9bb67cbSmrgfi
1464b9bb67cbSmrgif test x$APP_MAN_DIR = x    ; then
1465b9bb67cbSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1466b9bb67cbSmrgfi
14671cc8c64fSmrg
1468b9bb67cbSmrgif test x$LIB_MAN_SUFFIX = x    ; then
1469b9bb67cbSmrg    LIB_MAN_SUFFIX=3
1470b9bb67cbSmrgfi
1471b9bb67cbSmrgif test x$LIB_MAN_DIR = x    ; then
1472b9bb67cbSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1473b9bb67cbSmrgfi
14741cc8c64fSmrg
1475b9bb67cbSmrgif test x$FILE_MAN_SUFFIX = x    ; then
1476b9bb67cbSmrg    case $host_os in
1477b9bb67cbSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1478b9bb67cbSmrg	*)		FILE_MAN_SUFFIX=5  ;;
1479b9bb67cbSmrg    esac
1480b9bb67cbSmrgfi
1481b9bb67cbSmrgif test x$FILE_MAN_DIR = x    ; then
1482b9bb67cbSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1483b9bb67cbSmrgfi
14841cc8c64fSmrg
1485b9bb67cbSmrgif test x$MISC_MAN_SUFFIX = x    ; then
1486b9bb67cbSmrg    case $host_os in
1487b9bb67cbSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1488b9bb67cbSmrg	*)		MISC_MAN_SUFFIX=7  ;;
1489b9bb67cbSmrg    esac
14901cc8c64fSmrgfi
1491b9bb67cbSmrgif test x$MISC_MAN_DIR = x    ; then
1492b9bb67cbSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
14931cc8c64fSmrgfi
14941cc8c64fSmrg
1495b9bb67cbSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1496b9bb67cbSmrg    case $host_os in
1497b9bb67cbSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1498b9bb67cbSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1499b9bb67cbSmrg    esac
1500b9bb67cbSmrgfi
1501b9bb67cbSmrgif test x$DRIVER_MAN_DIR = x    ; then
1502b9bb67cbSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1503b9bb67cbSmrgfi
15041cc8c64fSmrg
1505b9bb67cbSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1506b9bb67cbSmrg    case $host_os in
1507b9bb67cbSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1508b9bb67cbSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1509b9bb67cbSmrg    esac
1510b9bb67cbSmrgfi
1511b9bb67cbSmrgif test x$ADMIN_MAN_DIR = x    ; then
1512b9bb67cbSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1513b9bb67cbSmrgfi
15141cc8c64fSmrg
15151cc8c64fSmrg
1516b9bb67cbSmrgAC_SUBST([APP_MAN_SUFFIX])
1517b9bb67cbSmrgAC_SUBST([LIB_MAN_SUFFIX])
1518b9bb67cbSmrgAC_SUBST([FILE_MAN_SUFFIX])
1519b9bb67cbSmrgAC_SUBST([MISC_MAN_SUFFIX])
1520b9bb67cbSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1521b9bb67cbSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1522b9bb67cbSmrgAC_SUBST([APP_MAN_DIR])
1523b9bb67cbSmrgAC_SUBST([LIB_MAN_DIR])
1524b9bb67cbSmrgAC_SUBST([FILE_MAN_DIR])
1525b9bb67cbSmrgAC_SUBST([MISC_MAN_DIR])
1526b9bb67cbSmrgAC_SUBST([DRIVER_MAN_DIR])
1527b9bb67cbSmrgAC_SUBST([ADMIN_MAN_DIR])
1528b9bb67cbSmrg]) # XORG_MANPAGE_SECTIONS
1529b9bb67cbSmrg
1530b9bb67cbSmrg# XORG_CHECK_LINUXDOC
1531b9bb67cbSmrg# -------------------
1532b9bb67cbSmrg# Minimum version: 1.0.0
1533b9bb67cbSmrg#
1534b9bb67cbSmrg# Defines the variable MAKE_TEXT if the necessary tools and
1535b9bb67cbSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1536b9bb67cbSmrg# Whether or not the necessary tools and files are found can be checked
1537b9bb67cbSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1538b9bb67cbSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1539b9bb67cbSmrgif test x$XORG_SGML_PATH = x ; then
1540b9bb67cbSmrg    XORG_SGML_PATH=$prefix/share/sgml
1541b9bb67cbSmrgfi
1542b9bb67cbSmrgHAVE_DEFS_ENT=
15431cc8c64fSmrg
1544b9bb67cbSmrgif test x"$cross_compiling" = x"yes" ; then
1545b9bb67cbSmrg  HAVE_DEFS_ENT=no
1546b9bb67cbSmrgelse
1547b9bb67cbSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1548b9bb67cbSmrgfi
15491cc8c64fSmrg
1550b9bb67cbSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1551b9bb67cbSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
15521cc8c64fSmrg
1553b9bb67cbSmrgAC_MSG_CHECKING([Whether to build documentation])
15541cc8c64fSmrg
1555b9bb67cbSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
1556b9bb67cbSmrg   BUILDDOC=yes
15571cc8c64fSmrgelse
1558b9bb67cbSmrg   BUILDDOC=no
15591cc8c64fSmrgfi
15601cc8c64fSmrg
1561b9bb67cbSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
15621cc8c64fSmrg
1563b9bb67cbSmrgAC_MSG_RESULT([$BUILDDOC])
15641cc8c64fSmrg
1565b9bb67cbSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
15661cc8c64fSmrg
1567b9bb67cbSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
1568b9bb67cbSmrg   BUILDPDFDOC=yes
1569b9bb67cbSmrgelse
1570b9bb67cbSmrg   BUILDPDFDOC=no
1571b9bb67cbSmrgfi
15721cc8c64fSmrg
1573b9bb67cbSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
15741cc8c64fSmrg
1575b9bb67cbSmrgAC_MSG_RESULT([$BUILDPDFDOC])
15761cc8c64fSmrg
1577b9bb67cbSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1578b9bb67cbSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1579b9bb67cbSmrgMAKE_PDF="$PS2PDF"
1580b9bb67cbSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
15811cc8c64fSmrg
1582b9bb67cbSmrgAC_SUBST(MAKE_TEXT)
1583b9bb67cbSmrgAC_SUBST(MAKE_PS)
1584b9bb67cbSmrgAC_SUBST(MAKE_PDF)
1585b9bb67cbSmrgAC_SUBST(MAKE_HTML)
1586b9bb67cbSmrg]) # XORG_CHECK_LINUXDOC
1587b9bb67cbSmrg
1588b9bb67cbSmrg# XORG_CHECK_DOCBOOK
1589b9bb67cbSmrg# -------------------
1590b9bb67cbSmrg# Minimum version: 1.0.0
1591b9bb67cbSmrg#
1592b9bb67cbSmrg# Checks for the ability to build output formats from SGML DocBook source.
1593b9bb67cbSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1594b9bb67cbSmrg# indicates whether the necessary tools and files are found and, if set,
1595b9bb67cbSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1596b9bb67cbSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1597b9bb67cbSmrgif test x$XORG_SGML_PATH = x ; then
1598b9bb67cbSmrg    XORG_SGML_PATH=$prefix/share/sgml
1599b9bb67cbSmrgfi
1600b9bb67cbSmrgHAVE_DEFS_ENT=
1601b9bb67cbSmrgBUILDTXTDOC=no
1602b9bb67cbSmrgBUILDPDFDOC=no
1603b9bb67cbSmrgBUILDPSDOC=no
1604b9bb67cbSmrgBUILDHTMLDOC=no
1605b9bb67cbSmrg
1606b9bb67cbSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1607b9bb67cbSmrg
1608b9bb67cbSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1609b9bb67cbSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1610b9bb67cbSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1611b9bb67cbSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1612b9bb67cbSmrg
1613b9bb67cbSmrgAC_MSG_CHECKING([Whether to build text documentation])
1614b9bb67cbSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1615b9bb67cbSmrg   test x$BUILD_TXTDOC != xno; then
1616b9bb67cbSmrg	BUILDTXTDOC=yes
1617b9bb67cbSmrgfi
1618b9bb67cbSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1619b9bb67cbSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1620b9bb67cbSmrg
1621b9bb67cbSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
1622b9bb67cbSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1623b9bb67cbSmrg   test x$BUILD_PDFDOC != xno; then
1624b9bb67cbSmrg	BUILDPDFDOC=yes
1625b9bb67cbSmrgfi
1626b9bb67cbSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1627b9bb67cbSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1628b9bb67cbSmrg
1629b9bb67cbSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
1630b9bb67cbSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1631b9bb67cbSmrg   test x$BUILD_PSDOC != xno; then
1632b9bb67cbSmrg	BUILDPSDOC=yes
1633b9bb67cbSmrgfi
1634b9bb67cbSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1635b9bb67cbSmrgAC_MSG_RESULT([$BUILDPSDOC])
1636b9bb67cbSmrg
1637b9bb67cbSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
1638b9bb67cbSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1639b9bb67cbSmrg   test x$BUILD_HTMLDOC != xno; then
1640b9bb67cbSmrg	BUILDHTMLDOC=yes
1641b9bb67cbSmrgfi
1642b9bb67cbSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1643b9bb67cbSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1644b9bb67cbSmrg
1645b9bb67cbSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1646b9bb67cbSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1647b9bb67cbSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1648b9bb67cbSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1649b9bb67cbSmrg
1650b9bb67cbSmrgAC_SUBST(MAKE_TEXT)
1651b9bb67cbSmrgAC_SUBST(MAKE_PS)
1652b9bb67cbSmrgAC_SUBST(MAKE_PDF)
1653b9bb67cbSmrgAC_SUBST(MAKE_HTML)
1654b9bb67cbSmrg]) # XORG_CHECK_DOCBOOK
1655b9bb67cbSmrg
1656b9bb67cbSmrg# XORG_CHECK_MALLOC_ZERO
1657b9bb67cbSmrg# ----------------------
1658b9bb67cbSmrg# Minimum version: 1.0.0
1659b9bb67cbSmrg#
1660b9bb67cbSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1661b9bb67cbSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1662b9bb67cbSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1663b9bb67cbSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1664b9bb67cbSmrgAC_ARG_ENABLE(malloc0returnsnull,
1665b9bb67cbSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1666b9bb67cbSmrg		       [malloc(0) returns NULL (default: auto)]),
1667b9bb67cbSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1668b9bb67cbSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1669b9bb67cbSmrg
1670b9bb67cbSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1671b9bb67cbSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1672b9bb67cbSmrg	AC_RUN_IFELSE([
1673b9bb67cbSmrgchar *malloc();
1674b9bb67cbSmrgchar *realloc();
1675b9bb67cbSmrgchar *calloc();
1676b9bb67cbSmrgmain() {
1677b9bb67cbSmrg    char *m0, *r0, *c0, *p;
1678b9bb67cbSmrg    m0 = malloc(0);
1679b9bb67cbSmrg    p = malloc(10);
1680b9bb67cbSmrg    r0 = realloc(p,0);
1681b9bb67cbSmrg    c0 = calloc(0);
1682b9bb67cbSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1683b9bb67cbSmrg}],
1684b9bb67cbSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1685b9bb67cbSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
1686b9bb67cbSmrgfi
1687b9bb67cbSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1688b9bb67cbSmrg
1689b9bb67cbSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1690b9bb67cbSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1691b9bb67cbSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1692b9bb67cbSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1693b9bb67cbSmrgelse
1694b9bb67cbSmrg	MALLOC_ZERO_CFLAGS=""
1695b9bb67cbSmrg	XMALLOC_ZERO_CFLAGS=""
1696b9bb67cbSmrg	XTMALLOC_ZERO_CFLAGS=""
1697b9bb67cbSmrgfi
1698b9bb67cbSmrg
1699b9bb67cbSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1700b9bb67cbSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1701b9bb67cbSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1702b9bb67cbSmrg]) # XORG_CHECK_MALLOC_ZERO
17031cc8c64fSmrg
1704b9bb67cbSmrg# XORG_WITH_LINT()
1705b9bb67cbSmrg# ----------------
1706b9bb67cbSmrg# Minimum version: 1.1.0
1707b9bb67cbSmrg#
1708b9bb67cbSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
1709b9bb67cbSmrg# is specified.   (Use --with-lint=sparse for sparse.)
1710b9bb67cbSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1711b9bb67cbSmrg# Sets $LINT_FLAGS to flags to pass to source checker
1712b9bb67cbSmrg# Sets LINT automake conditional if enabled (default: disabled)
1713b9bb67cbSmrg#
1714b9bb67cbSmrgAC_DEFUN([XORG_WITH_LINT],[
1715b9bb67cbSmrg
1716b9bb67cbSmrg# Allow checking code with lint, sparse, etc.
1717b9bb67cbSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1718b9bb67cbSmrg		[Use a lint-style source code checker (default: disabled)])],
1719b9bb67cbSmrg		[use_lint=$withval], [use_lint=no])
1720b9bb67cbSmrgif test "x$use_lint" = "xyes" ; then
1721b9bb67cbSmrg	LINT="lint"
1722b9bb67cbSmrgelse
1723b9bb67cbSmrg	LINT="$use_lint"
1724b9bb67cbSmrgfi
1725b9bb67cbSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1726b9bb67cbSmrg    case $LINT in
1727b9bb67cbSmrg	lint|*/lint)
1728b9bb67cbSmrg	    case $host_os in
1729b9bb67cbSmrg		solaris*)
1730b9bb67cbSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1731b9bb67cbSmrg			;;
1732b9bb67cbSmrg	    esac
1733b9bb67cbSmrg	    ;;
1734b9bb67cbSmrg    esac
1735b9bb67cbSmrgfi
1736b9bb67cbSmrg
1737b9bb67cbSmrgAC_SUBST(LINT)
1738b9bb67cbSmrgAC_SUBST(LINT_FLAGS)
1739b9bb67cbSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
1740b9bb67cbSmrg
1741b9bb67cbSmrg]) # XORG_WITH_LINT
1742b9bb67cbSmrg
1743b9bb67cbSmrg# XORG_LINT_LIBRARY(LIBNAME)
1744b9bb67cbSmrg# --------------------------
1745b9bb67cbSmrg# Minimum version: 1.1.0
1746b9bb67cbSmrg#
1747b9bb67cbSmrg# Sets up flags for building lint libraries for checking programs that call
1748b9bb67cbSmrg# functions in the library.
1749b9bb67cbSmrg# Disabled by default, enable with --enable-lint-library
1750b9bb67cbSmrg# Sets: 
1751b9bb67cbSmrg#	@LINTLIB@		- name of lint library file to make
1752b9bb67cbSmrg#	MAKE_LINT_LIB		- automake conditional
1753b9bb67cbSmrg#
1754b9bb67cbSmrg
1755b9bb67cbSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1756b9bb67cbSmrgAC_REQUIRE([XORG_WITH_LINT])
1757b9bb67cbSmrg# Build lint "library" for more indepth checks of programs calling this library
1758b9bb67cbSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1759b9bb67cbSmrg	[Create lint library (default: disabled)])],
1760b9bb67cbSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1761b9bb67cbSmrgif test "x$make_lint_lib" != "xno" ; then
1762b9bb67cbSmrg	if test "x$LINT" = "xno" ; then
1763b9bb67cbSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1764b9bb67cbSmrg	fi
1765b9bb67cbSmrg	if test "x$make_lint_lib" = "xyes" ; then
1766b9bb67cbSmrg		LINTLIB=llib-l$1.ln
1767b9bb67cbSmrg	else
1768b9bb67cbSmrg		LINTLIB=$make_lint_lib
1769b9bb67cbSmrg	fi
1770b9bb67cbSmrgfi
1771b9bb67cbSmrgAC_SUBST(LINTLIB)
1772b9bb67cbSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1773b9bb67cbSmrg
1774b9bb67cbSmrg]) # XORG_LINT_LIBRARY
1775b9bb67cbSmrg
1776b9bb67cbSmrg# XORG_CWARNFLAGS
1777b9bb67cbSmrg# ---------------
1778b9bb67cbSmrg# Minimum version: 1.2.0
1779b9bb67cbSmrg#
1780b9bb67cbSmrg# Defines CWARNFLAGS to enable C compiler warnings.
1781b9bb67cbSmrg#
1782b9bb67cbSmrgAC_DEFUN([XORG_CWARNFLAGS], [
1783b9bb67cbSmrgAC_REQUIRE([AC_PROG_CC])
1784b9bb67cbSmrgif  test "x$GCC" = xyes ; then
1785b9bb67cbSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1786b9bb67cbSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1787b9bb67cbSmrg-Wbad-function-cast"
1788b9bb67cbSmrg    case `$CC -dumpversion` in
1789b9bb67cbSmrg    3.4.* | 4.*)
1790b9bb67cbSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1791b9bb67cbSmrg	;;
1792b9bb67cbSmrg    esac
1793b9bb67cbSmrgelse
1794b9bb67cbSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1795b9bb67cbSmrg    if test "x$SUNCC" = "xyes"; then
1796b9bb67cbSmrg	CWARNFLAGS="-v"
1797b9bb67cbSmrg    fi
1798b9bb67cbSmrgfi
1799b9bb67cbSmrgAC_SUBST(CWARNFLAGS)
1800b9bb67cbSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
1801b9bb67cbSmrg]) # XORG_CWARNFLAGS
1802b9bb67cbSmrg
1803b9bb67cbSmrg# XORG_STRICT_OPTION
1804b9bb67cbSmrg# -----------------------
1805b9bb67cbSmrg# Minimum version: 1.3.0
1806b9bb67cbSmrg#
1807b9bb67cbSmrg# Add configure option to enable strict compilation
1808b9bb67cbSmrgAC_DEFUN([XORG_STRICT_OPTION], [
1809b9bb67cbSmrgAC_REQUIRE([AC_PROG_CC])
1810b9bb67cbSmrgAC_REQUIRE([AC_PROG_CC_C99])
1811b9bb67cbSmrgAC_REQUIRE([XORG_CWARNFLAGS])
1812b9bb67cbSmrg
1813b9bb67cbSmrgAC_ARG_ENABLE(strict-compilation,
1814b9bb67cbSmrg			  AS_HELP_STRING([--enable-strict-compilation],
1815b9bb67cbSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1816b9bb67cbSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1817b9bb67cbSmrgif test "x$STRICT_COMPILE" = "xyes"; then
1818b9bb67cbSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1819b9bb67cbSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1820b9bb67cbSmrg	if test "x$GCC" = xyes ; then
1821b9bb67cbSmrg		STRICT_CFLAGS="-pedantic -Werror"
1822b9bb67cbSmrg	elif test "x$SUNCC" = "xyes"; then
1823b9bb67cbSmrg		STRICT_CFLAGS="-errwarn"
1824b9bb67cbSmrg    elif test "x$INTELCC" = "xyes"; then
1825b9bb67cbSmrg		STRICT_CFLAGS="-Werror"
1826b9bb67cbSmrg	fi
1827b9bb67cbSmrgfi
1828b9bb67cbSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1829b9bb67cbSmrgAC_SUBST([CWARNFLAGS])
1830b9bb67cbSmrg]) # XORG_STRICT_OPTION
1831b9bb67cbSmrg
1832b9bb67cbSmrg# XORG_DEFAULT_OPTIONS
1833b9bb67cbSmrg# --------------------
1834b9bb67cbSmrg# Minimum version: 1.3.0
1835b9bb67cbSmrg#
1836b9bb67cbSmrg# Defines default options for X.Org modules.
1837b9bb67cbSmrg#
1838b9bb67cbSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1839b9bb67cbSmrgXORG_CWARNFLAGS
1840b9bb67cbSmrgXORG_STRICT_OPTION
1841b9bb67cbSmrgXORG_RELEASE_VERSION
1842b9bb67cbSmrgXORG_CHANGELOG
1843b9bb67cbSmrgXORG_MANPAGE_SECTIONS
1844b9bb67cbSmrg]) # XORG_DEFAULT_OPTIONS
18451cc8c64fSmrgdnl Copyright 2005 Red Hat, Inc
18461cc8c64fSmrgdnl
18471cc8c64fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
18481cc8c64fSmrgdnl documentation for any purpose is hereby granted without fee, provided that
18491cc8c64fSmrgdnl the above copyright notice appear in all copies and that both that
18501cc8c64fSmrgdnl copyright notice and this permission notice appear in supporting
18511cc8c64fSmrgdnl documentation.
18521cc8c64fSmrgdnl
18531cc8c64fSmrgdnl The above copyright notice and this permission notice shall be included
18541cc8c64fSmrgdnl in all copies or substantial portions of the Software.
18551cc8c64fSmrgdnl
18561cc8c64fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18571cc8c64fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18581cc8c64fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18591cc8c64fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18601cc8c64fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18611cc8c64fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
18621cc8c64fSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
18631cc8c64fSmrgdnl
18641cc8c64fSmrgdnl Except as contained in this notice, the name of the copyright holders shall
18651cc8c64fSmrgdnl not be used in advertising or otherwise to promote the sale, use or
18661cc8c64fSmrgdnl other dealings in this Software without prior written authorization
18671cc8c64fSmrgdnl from the copyright holders.
18681cc8c64fSmrgdnl
18691cc8c64fSmrg
18701cc8c64fSmrg# XORG_RELEASE_VERSION
18711cc8c64fSmrg# --------------------
18721cc8c64fSmrg# Adds --with/without-release-string and changes the PACKAGE and
18731cc8c64fSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1874b9bb67cbSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1875b9bb67cbSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
18761cc8c64fSmrg 
18771cc8c64fSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
18781cc8c64fSmrg	AC_ARG_WITH(release-version,
1879b9bb67cbSmrg			AS_HELP_STRING([--with-release-version=STRING],
18801cc8c64fSmrg				[Use release version string in package name]),
18811cc8c64fSmrg			[RELEASE_VERSION="$withval"],
18821cc8c64fSmrg			[RELEASE_VERSION=""])
18831cc8c64fSmrg	if test "x$RELEASE_VERSION" != "x"; then
18841cc8c64fSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
18851cc8c64fSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
18861cc8c64fSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
18871cc8c64fSmrg	fi
1888b9bb67cbSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1889b9bb67cbSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1890b9bb67cbSmrg		[Major version of this package])
1891b9bb67cbSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1892b9bb67cbSmrg	if test "x$PVM" = "x"; then
1893b9bb67cbSmrg		PVM="0"
1894b9bb67cbSmrg	fi
1895b9bb67cbSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1896b9bb67cbSmrg		[$PVM],
1897b9bb67cbSmrg		[Minor version of this package])
1898b9bb67cbSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1899b9bb67cbSmrg	if test "x$PVP" = "x"; then
1900b9bb67cbSmrg		PVP="0"
1901b9bb67cbSmrg	fi
1902b9bb67cbSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1903b9bb67cbSmrg		[$PVP],
1904b9bb67cbSmrg		[Patch version of this package])
19051cc8c64fSmrg])
19061cc8c64fSmrg
1907b9bb67cbSmrg# XORG_CHANGELOG()
1908b9bb67cbSmrg# ----------------
1909b9bb67cbSmrg# Minimum version: 1.2.0
1910b9bb67cbSmrg#
1911b9bb67cbSmrg# Defines the variable CHANGELOG_CMD as the command to generate
1912b9bb67cbSmrg# ChangeLog from git.
1913b9bb67cbSmrg#
1914b9bb67cbSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1915b9bb67cbSmrg#
1916b9bb67cbSmrgAC_DEFUN([XORG_CHANGELOG], [
1917b9bb67cbSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
1918b9bb67cbSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
1919b9bb67cbSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1920b9bb67cbSmrgAC_SUBST([CHANGELOG_CMD])
1921b9bb67cbSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
1922b9bb67cbSmrg]) # XORG_CHANGELOG
1923b9bb67cbSmrg
1924b9bb67cbSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1925b9bb67cbSmrg# 
1926b9bb67cbSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1927b9bb67cbSmrg#
1928b9bb67cbSmrg# This program is free software; you can redistribute it and/or modify
1929b9bb67cbSmrg# it under the terms of the GNU General Public License as published by
1930b9bb67cbSmrg# the Free Software Foundation; either version 2 of the License, or
1931b9bb67cbSmrg# (at your option) any later version.
1932b9bb67cbSmrg#
1933b9bb67cbSmrg# This program is distributed in the hope that it will be useful, but
1934b9bb67cbSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1935b9bb67cbSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1936b9bb67cbSmrg# General Public License for more details.
1937b9bb67cbSmrg#
1938b9bb67cbSmrg# You should have received a copy of the GNU General Public License
1939b9bb67cbSmrg# along with this program; if not, write to the Free Software
1940b9bb67cbSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1941b9bb67cbSmrg#
1942b9bb67cbSmrg# As a special exception to the GNU General Public License, if you
1943b9bb67cbSmrg# distribute this file as part of a program that contains a
1944b9bb67cbSmrg# configuration script generated by Autoconf, you may include it under
1945b9bb67cbSmrg# the same distribution terms that you use for the rest of that program.
1946b9bb67cbSmrg
1947b9bb67cbSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1948b9bb67cbSmrg# ----------------------------------
1949b9bb67cbSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
1950b9bb67cbSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1951b9bb67cbSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1952b9bb67cbSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1953b9bb67cbSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1954b9bb67cbSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1955b9bb67cbSmrgfi
1956b9bb67cbSmrgif test -n "$PKG_CONFIG"; then
1957b9bb67cbSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
1958b9bb67cbSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1959b9bb67cbSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1960b9bb67cbSmrg		AC_MSG_RESULT([yes])
1961b9bb67cbSmrg	else
1962b9bb67cbSmrg		AC_MSG_RESULT([no])
1963b9bb67cbSmrg		PKG_CONFIG=""
1964b9bb67cbSmrg	fi
1965b9bb67cbSmrg		
1966b9bb67cbSmrgfi[]dnl
1967b9bb67cbSmrg])# PKG_PROG_PKG_CONFIG
1968b9bb67cbSmrg
1969b9bb67cbSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1970b9bb67cbSmrg#
1971b9bb67cbSmrg# Check to see whether a particular set of modules exists.  Similar
1972b9bb67cbSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1973b9bb67cbSmrg#
1974b9bb67cbSmrg#
1975b9bb67cbSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1976b9bb67cbSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
1977b9bb67cbSmrg# PKG_CHECK_EXISTS manually
1978b9bb67cbSmrg# --------------------------------------------------------------
1979b9bb67cbSmrgAC_DEFUN([PKG_CHECK_EXISTS],
1980b9bb67cbSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1981b9bb67cbSmrgif test -n "$PKG_CONFIG" && \
1982b9bb67cbSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1983b9bb67cbSmrg  m4_ifval([$2], [$2], [:])
1984b9bb67cbSmrgm4_ifvaln([$3], [else
1985b9bb67cbSmrg  $3])dnl
1986b9bb67cbSmrgfi])
1987b9bb67cbSmrg
1988b9bb67cbSmrg
1989b9bb67cbSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1990b9bb67cbSmrg# ---------------------------------------------
1991b9bb67cbSmrgm4_define([_PKG_CONFIG],
1992b9bb67cbSmrg[if test -n "$$1"; then
1993b9bb67cbSmrg    pkg_cv_[]$1="$$1"
1994b9bb67cbSmrg elif test -n "$PKG_CONFIG"; then
1995b9bb67cbSmrg    PKG_CHECK_EXISTS([$3],
1996b9bb67cbSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1997b9bb67cbSmrg		     [pkg_failed=yes])
1998b9bb67cbSmrg else
1999b9bb67cbSmrg    pkg_failed=untried
2000b9bb67cbSmrgfi[]dnl
2001b9bb67cbSmrg])# _PKG_CONFIG
2002b9bb67cbSmrg
2003b9bb67cbSmrg# _PKG_SHORT_ERRORS_SUPPORTED
2004b9bb67cbSmrg# -----------------------------
2005b9bb67cbSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
2006b9bb67cbSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2007b9bb67cbSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
2008b9bb67cbSmrg        _pkg_short_errors_supported=yes
2009b9bb67cbSmrgelse
2010b9bb67cbSmrg        _pkg_short_errors_supported=no
2011b9bb67cbSmrgfi[]dnl
2012b9bb67cbSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
2013b9bb67cbSmrg
2014b9bb67cbSmrg
2015b9bb67cbSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2016b9bb67cbSmrg# [ACTION-IF-NOT-FOUND])
2017b9bb67cbSmrg#
2018b9bb67cbSmrg#
2019b9bb67cbSmrg# Note that if there is a possibility the first call to
2020b9bb67cbSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
2021b9bb67cbSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
2022b9bb67cbSmrg#
2023b9bb67cbSmrg#
2024b9bb67cbSmrg# --------------------------------------------------------------
2025b9bb67cbSmrgAC_DEFUN([PKG_CHECK_MODULES],
2026b9bb67cbSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2027b9bb67cbSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
2028b9bb67cbSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
2029b9bb67cbSmrg
2030b9bb67cbSmrgpkg_failed=no
2031b9bb67cbSmrgAC_MSG_CHECKING([for $1])
2032b9bb67cbSmrg
2033b9bb67cbSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
2034b9bb67cbSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
2035b9bb67cbSmrg
2036b9bb67cbSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
2037b9bb67cbSmrgand $1[]_LIBS to avoid the need to call pkg-config.
2038b9bb67cbSmrgSee the pkg-config man page for more details.])
2039b9bb67cbSmrg
2040b9bb67cbSmrgif test $pkg_failed = yes; then
2041b9bb67cbSmrg        _PKG_SHORT_ERRORS_SUPPORTED
2042b9bb67cbSmrg        if test $_pkg_short_errors_supported = yes; then
2043b9bb67cbSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
2044b9bb67cbSmrg        else 
2045b9bb67cbSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
2046b9bb67cbSmrg        fi
2047b9bb67cbSmrg	# Put the nasty error message in config.log where it belongs
2048b9bb67cbSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
2049b9bb67cbSmrg
2050b9bb67cbSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
2051b9bb67cbSmrg[Package requirements ($2) were not met:
2052b9bb67cbSmrg
2053b9bb67cbSmrg$$1_PKG_ERRORS
2054b9bb67cbSmrg
2055b9bb67cbSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
2056b9bb67cbSmrginstalled software in a non-standard prefix.
2057b9bb67cbSmrg
2058b9bb67cbSmrg_PKG_TEXT
2059b9bb67cbSmrg])],
2060b9bb67cbSmrg		[AC_MSG_RESULT([no])
2061b9bb67cbSmrg                $4])
2062b9bb67cbSmrgelif test $pkg_failed = untried; then
2063b9bb67cbSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
2064b9bb67cbSmrg[The pkg-config script could not be found or is too old.  Make sure it
2065b9bb67cbSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
2066b9bb67cbSmrgpath to pkg-config.
2067b9bb67cbSmrg
2068b9bb67cbSmrg_PKG_TEXT
2069b9bb67cbSmrg
2070b9bb67cbSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
2071b9bb67cbSmrg		[$4])
2072b9bb67cbSmrgelse
2073b9bb67cbSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
2074b9bb67cbSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
2075b9bb67cbSmrg        AC_MSG_RESULT([yes])
2076b9bb67cbSmrg	ifelse([$3], , :, [$3])
2077b9bb67cbSmrgfi[]dnl
2078b9bb67cbSmrg])# PKG_CHECK_MODULES
2079b9bb67cbSmrg
2080