aclocal.m4 revision 35d5702b
135d5702bSmrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
2a6fdc6faSmrg
335d5702bSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
435d5702bSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5a6fdc6faSmrg# This file is free software; the Free Software Foundation
6a6fdc6faSmrg# gives unlimited permission to copy and/or distribute it,
7a6fdc6faSmrg# with or without modifications, as long as this notice is preserved.
8a6fdc6faSmrg
9a6fdc6faSmrg# This program is distributed in the hope that it will be useful,
10a6fdc6faSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11a6fdc6faSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12a6fdc6faSmrg# PARTICULAR PURPOSE.
13a6fdc6faSmrg
1435d5702bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
1535d5702bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1635d5702bSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
1735d5702bSmrg[m4_warning([this file was generated for autoconf 2.63.
1835d5702bSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
1935d5702bSmrgIf you have problems, you may need to regenerate the build system entirely.
2035d5702bSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21a6fdc6faSmrg
2235d5702bSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2335d5702bSmrg#
2435d5702bSmrg# This file is free software; the Free Software Foundation
2535d5702bSmrg# gives unlimited permission to copy and/or distribute it,
2635d5702bSmrg# with or without modifications, as long as this notice is preserved.
27a6fdc6faSmrg
28a6fdc6faSmrg# AM_AUTOMAKE_VERSION(VERSION)
29a6fdc6faSmrg# ----------------------------
30a6fdc6faSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
31a6fdc6faSmrg# generated from the m4 files accompanying Automake X.Y.
3235d5702bSmrg# (This private macro should not be called outside this file.)
3335d5702bSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3435d5702bSmrg[am__api_version='1.11'
3535d5702bSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3635d5702bSmrgdnl require some minimum version.  Point them to the right macro.
3735d5702bSmrgm4_if([$1], [1.11], [],
3835d5702bSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3935d5702bSmrg])
4035d5702bSmrg
4135d5702bSmrg# _AM_AUTOCONF_VERSION(VERSION)
4235d5702bSmrg# -----------------------------
4335d5702bSmrg# aclocal traces this macro to find the Autoconf version.
4435d5702bSmrg# This is a private macro too.  Using m4_define simplifies
4535d5702bSmrg# the logic in aclocal, which can simply ignore this definition.
4635d5702bSmrgm4_define([_AM_AUTOCONF_VERSION], [])
47a6fdc6faSmrg
48a6fdc6faSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
49a6fdc6faSmrg# -------------------------------
5035d5702bSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5135d5702bSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52a6fdc6faSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5335d5702bSmrg[AM_AUTOMAKE_VERSION([1.11])dnl
5435d5702bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
5535d5702bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5635d5702bSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57a6fdc6faSmrg
5835d5702bSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59a6fdc6faSmrg
6035d5702bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
61a6fdc6faSmrg#
6235d5702bSmrg# This file is free software; the Free Software Foundation
6335d5702bSmrg# gives unlimited permission to copy and/or distribute it,
6435d5702bSmrg# with or without modifications, as long as this notice is preserved.
65a6fdc6faSmrg
66a6fdc6faSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
67a6fdc6faSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
68a6fdc6faSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69a6fdc6faSmrg#
70a6fdc6faSmrg# Of course, Automake must honor this variable whenever it calls a
71a6fdc6faSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
72a6fdc6faSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
73a6fdc6faSmrg# depending on how configure is run.  This is pretty annoying, since
74a6fdc6faSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
75a6fdc6faSmrg# source directory, any form will work fine, but in subdirectories a
76a6fdc6faSmrg# relative path needs to be adjusted first.
77a6fdc6faSmrg#
78a6fdc6faSmrg# $ac_aux_dir/missing
79a6fdc6faSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
80a6fdc6faSmrg# $top_srcdir/$ac_aux_dir/missing
81a6fdc6faSmrg#    fails if $ac_aux_dir is absolute,
82a6fdc6faSmrg#    fails when called from a subdirectory in a VPATH build with
83a6fdc6faSmrg#          a relative $ac_aux_dir
84a6fdc6faSmrg#
85a6fdc6faSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
86a6fdc6faSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
87a6fdc6faSmrg# harmless because $srcdir is `.', but things will broke when you
88a6fdc6faSmrg# start a VPATH build or use an absolute $srcdir.
89a6fdc6faSmrg#
90a6fdc6faSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
91a6fdc6faSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
92a6fdc6faSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
93a6fdc6faSmrg# and then we would define $MISSING as
94a6fdc6faSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
95a6fdc6faSmrg# This will work as long as MISSING is not called from configure, because
96a6fdc6faSmrg# unfortunately $(top_srcdir) has no meaning in configure.
97a6fdc6faSmrg# However there are other variables, like CC, which are often used in
98a6fdc6faSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
99a6fdc6faSmrg#
100a6fdc6faSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
101a6fdc6faSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
102a6fdc6faSmrg# configured tree to be moved without reconfiguration.
103a6fdc6faSmrg
10435d5702bSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10535d5702bSmrg[dnl Rely on autoconf to set up CDPATH properly.
10635d5702bSmrgAC_PREREQ([2.50])dnl
107a6fdc6faSmrg# expand $ac_aux_dir to an absolute path
108a6fdc6faSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
109a6fdc6faSmrg])
110a6fdc6faSmrg
11135d5702bSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112a6fdc6faSmrg
11335d5702bSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11435d5702bSmrg# Free Software Foundation, Inc.
11535d5702bSmrg#
11635d5702bSmrg# This file is free software; the Free Software Foundation
11735d5702bSmrg# gives unlimited permission to copy and/or distribute it,
11835d5702bSmrg# with or without modifications, as long as this notice is preserved.
119a6fdc6faSmrg
12035d5702bSmrg# serial 9
121a6fdc6faSmrg
12235d5702bSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12335d5702bSmrg# -------------------------------------
12435d5702bSmrg# Define a conditional.
12535d5702bSmrgAC_DEFUN([AM_CONDITIONAL],
12635d5702bSmrg[AC_PREREQ(2.52)dnl
12735d5702bSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12835d5702bSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12935d5702bSmrgAC_SUBST([$1_TRUE])dnl
13035d5702bSmrgAC_SUBST([$1_FALSE])dnl
13135d5702bSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
13235d5702bSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
13335d5702bSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13435d5702bSmrgif $2; then
13535d5702bSmrg  $1_TRUE=
13635d5702bSmrg  $1_FALSE='#'
137a6fdc6faSmrgelse
13835d5702bSmrg  $1_TRUE='#'
13935d5702bSmrg  $1_FALSE=
140a6fdc6faSmrgfi
14135d5702bSmrgAC_CONFIG_COMMANDS_PRE(
14235d5702bSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14335d5702bSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14435d5702bSmrgUsually this means the macro was only invoked conditionally.]])
14535d5702bSmrgfi])])
146a6fdc6faSmrg
14735d5702bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
14835d5702bSmrg# Free Software Foundation, Inc.
14935d5702bSmrg#
15035d5702bSmrg# This file is free software; the Free Software Foundation
15135d5702bSmrg# gives unlimited permission to copy and/or distribute it,
15235d5702bSmrg# with or without modifications, as long as this notice is preserved.
153a6fdc6faSmrg
15435d5702bSmrg# serial 10
155a6fdc6faSmrg
156a6fdc6faSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
157a6fdc6faSmrg# written in clear, in which case automake, when reading aclocal.m4,
158a6fdc6faSmrg# will think it sees a *use*, and therefore will trigger all it's
159a6fdc6faSmrg# C support machinery.  Also note that it means that autoscan, seeing
160a6fdc6faSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161a6fdc6faSmrg
162a6fdc6faSmrg
163a6fdc6faSmrg# _AM_DEPENDENCIES(NAME)
164a6fdc6faSmrg# ----------------------
165a6fdc6faSmrg# See how the compiler implements dependency checking.
166a6fdc6faSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
167a6fdc6faSmrg# We try a few techniques and use that to set a single cache variable.
168a6fdc6faSmrg#
169a6fdc6faSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
170a6fdc6faSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
171a6fdc6faSmrg# dependency, and given that the user is not expected to run this macro,
172a6fdc6faSmrg# just rely on AC_PROG_CC.
173a6fdc6faSmrgAC_DEFUN([_AM_DEPENDENCIES],
174a6fdc6faSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
175a6fdc6faSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
176a6fdc6faSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
177a6fdc6faSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178a6fdc6faSmrg
179a6fdc6faSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
180a6fdc6faSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
181a6fdc6faSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
18235d5702bSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
183a6fdc6faSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
184a6fdc6faSmrg                   [depcc="$$1"   am_compiler_list=])
185a6fdc6faSmrg
186a6fdc6faSmrgAC_CACHE_CHECK([dependency style of $depcc],
187a6fdc6faSmrg               [am_cv_$1_dependencies_compiler_type],
188a6fdc6faSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
189a6fdc6faSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
190a6fdc6faSmrg  # making bogus files that we don't know about and never remove.  For
191a6fdc6faSmrg  # instance it was reported that on HP-UX the gcc test will end up
192a6fdc6faSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
193a6fdc6faSmrg  # in D'.
194a6fdc6faSmrg  mkdir conftest.dir
195a6fdc6faSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
196a6fdc6faSmrg  # using a relative directory.
197a6fdc6faSmrg  cp "$am_depcomp" conftest.dir
198a6fdc6faSmrg  cd conftest.dir
199a6fdc6faSmrg  # We will build objects and dependencies in a subdirectory because
200a6fdc6faSmrg  # it helps to detect inapplicable dependency modes.  For instance
201a6fdc6faSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
202a6fdc6faSmrg  # side effect of compilation, but ICC will put the dependencies in
203a6fdc6faSmrg  # the current directory while Tru64 will put them in the object
204a6fdc6faSmrg  # directory.
205a6fdc6faSmrg  mkdir sub
206a6fdc6faSmrg
207a6fdc6faSmrg  am_cv_$1_dependencies_compiler_type=none
208a6fdc6faSmrg  if test "$am_compiler_list" = ""; then
209a6fdc6faSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
210a6fdc6faSmrg  fi
21135d5702bSmrg  am__universal=false
21235d5702bSmrg  m4_case([$1], [CC],
21335d5702bSmrg    [case " $depcc " in #(
21435d5702bSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21535d5702bSmrg     esac],
21635d5702bSmrg    [CXX],
21735d5702bSmrg    [case " $depcc " in #(
21835d5702bSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21935d5702bSmrg     esac])
22035d5702bSmrg
221a6fdc6faSmrg  for depmode in $am_compiler_list; do
222a6fdc6faSmrg    # Setup a source with many dependencies, because some compilers
223a6fdc6faSmrg    # like to wrap large dependency lists on column 80 (with \), and
224a6fdc6faSmrg    # we should not choose a depcomp mode which is confused by this.
225a6fdc6faSmrg    #
226a6fdc6faSmrg    # We need to recreate these files for each test, as the compiler may
227a6fdc6faSmrg    # overwrite some of them when testing with obscure command lines.
228a6fdc6faSmrg    # This happens at least with the AIX C compiler.
229a6fdc6faSmrg    : > sub/conftest.c
230a6fdc6faSmrg    for i in 1 2 3 4 5 6; do
231a6fdc6faSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23235d5702bSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
23335d5702bSmrg      # Solaris 8's {/usr,}/bin/sh.
23435d5702bSmrg      touch sub/conftst$i.h
235a6fdc6faSmrg    done
236a6fdc6faSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
237a6fdc6faSmrg
23835d5702bSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
23935d5702bSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
24035d5702bSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
24135d5702bSmrg    # versions had trouble with output in subdirs
24235d5702bSmrg    am__obj=sub/conftest.${OBJEXT-o}
24335d5702bSmrg    am__minus_obj="-o $am__obj"
244a6fdc6faSmrg    case $depmode in
24535d5702bSmrg    gcc)
24635d5702bSmrg      # This depmode causes a compiler race in universal mode.
24735d5702bSmrg      test "$am__universal" = false || continue
24835d5702bSmrg      ;;
249a6fdc6faSmrg    nosideeffect)
250a6fdc6faSmrg      # after this tag, mechanisms are not by side-effect, so they'll
251a6fdc6faSmrg      # only be used when explicitly requested
252a6fdc6faSmrg      if test "x$enable_dependency_tracking" = xyes; then
253a6fdc6faSmrg	continue
254a6fdc6faSmrg      else
255a6fdc6faSmrg	break
256a6fdc6faSmrg      fi
257a6fdc6faSmrg      ;;
25835d5702bSmrg    msvisualcpp | msvcmsys)
25935d5702bSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
26035d5702bSmrg      # not run yet.  These depmodes are late enough in the game, and
26135d5702bSmrg      # so weak that their functioning should not be impacted.
26235d5702bSmrg      am__obj=conftest.${OBJEXT-o}
26335d5702bSmrg      am__minus_obj=
26435d5702bSmrg      ;;
265a6fdc6faSmrg    none) break ;;
266a6fdc6faSmrg    esac
267a6fdc6faSmrg    if depmode=$depmode \
26835d5702bSmrg       source=sub/conftest.c object=$am__obj \
269a6fdc6faSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
27035d5702bSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
271a6fdc6faSmrg         >/dev/null 2>conftest.err &&
27235d5702bSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
273a6fdc6faSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27435d5702bSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
275a6fdc6faSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
276a6fdc6faSmrg      # icc doesn't choke on unknown options, it will just issue warnings
27735d5702bSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
27835d5702bSmrg      # that says an option was ignored or not supported.
27935d5702bSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
28035d5702bSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
28135d5702bSmrg      # The diagnosis changed in icc 8.0:
28235d5702bSmrg      #   icc: Command line remark: option '-MP' not supported
28335d5702bSmrg      if (grep 'ignoring option' conftest.err ||
28435d5702bSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
285a6fdc6faSmrg        am_cv_$1_dependencies_compiler_type=$depmode
286a6fdc6faSmrg        break
287a6fdc6faSmrg      fi
288a6fdc6faSmrg    fi
289a6fdc6faSmrg  done
290a6fdc6faSmrg
291a6fdc6faSmrg  cd ..
292a6fdc6faSmrg  rm -rf conftest.dir
293a6fdc6faSmrgelse
294a6fdc6faSmrg  am_cv_$1_dependencies_compiler_type=none
295a6fdc6faSmrgfi
296a6fdc6faSmrg])
29735d5702bSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
29835d5702bSmrgAM_CONDITIONAL([am__fastdep$1], [
29935d5702bSmrg  test "x$enable_dependency_tracking" != xno \
30035d5702bSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
30135d5702bSmrg])
30235d5702bSmrg
30335d5702bSmrg
30435d5702bSmrg# AM_SET_DEPDIR
30535d5702bSmrg# -------------
30635d5702bSmrg# Choose a directory name for dependency files.
30735d5702bSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
30835d5702bSmrgAC_DEFUN([AM_SET_DEPDIR],
30935d5702bSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
31035d5702bSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
31135d5702bSmrg])
31235d5702bSmrg
31335d5702bSmrg
31435d5702bSmrg# AM_DEP_TRACK
31535d5702bSmrg# ------------
31635d5702bSmrgAC_DEFUN([AM_DEP_TRACK],
31735d5702bSmrg[AC_ARG_ENABLE(dependency-tracking,
31835d5702bSmrg[  --disable-dependency-tracking  speeds up one-time build
31935d5702bSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
32035d5702bSmrgif test "x$enable_dependency_tracking" != xno; then
32135d5702bSmrg  am_depcomp="$ac_aux_dir/depcomp"
32235d5702bSmrg  AMDEPBACKSLASH='\'
32335d5702bSmrgfi
32435d5702bSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
32535d5702bSmrgAC_SUBST([AMDEPBACKSLASH])dnl
32635d5702bSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
32735d5702bSmrg])
32835d5702bSmrg
32935d5702bSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
33035d5702bSmrg
33135d5702bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33235d5702bSmrg# Free Software Foundation, Inc.
33335d5702bSmrg#
33435d5702bSmrg# This file is free software; the Free Software Foundation
33535d5702bSmrg# gives unlimited permission to copy and/or distribute it,
33635d5702bSmrg# with or without modifications, as long as this notice is preserved.
33735d5702bSmrg
33835d5702bSmrg#serial 5
33935d5702bSmrg
34035d5702bSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
34135d5702bSmrg# ------------------------------
34235d5702bSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
34335d5702bSmrg[{
34435d5702bSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
34535d5702bSmrg  # are listed without --file.  Let's play safe and only enable the eval
34635d5702bSmrg  # if we detect the quoting.
34735d5702bSmrg  case $CONFIG_FILES in
34835d5702bSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
34935d5702bSmrg  *)   set x $CONFIG_FILES ;;
35035d5702bSmrg  esac
35135d5702bSmrg  shift
35235d5702bSmrg  for mf
35335d5702bSmrg  do
35435d5702bSmrg    # Strip MF so we end up with the name of the file.
35535d5702bSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
35635d5702bSmrg    # Check whether this is an Automake generated Makefile or not.
35735d5702bSmrg    # We used to match only the files named `Makefile.in', but
35835d5702bSmrg    # some people rename them; so instead we look at the file content.
35935d5702bSmrg    # Grep'ing the first line is not enough: some people post-process
36035d5702bSmrg    # each Makefile.in and add a new line on top of each file to say so.
36135d5702bSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
36235d5702bSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
36335d5702bSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36435d5702bSmrg      dirpart=`AS_DIRNAME("$mf")`
36535d5702bSmrg    else
36635d5702bSmrg      continue
36735d5702bSmrg    fi
36835d5702bSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
36935d5702bSmrg    # from the Makefile without running `make'.
37035d5702bSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
37135d5702bSmrg    test -z "$DEPDIR" && continue
37235d5702bSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
37335d5702bSmrg    test -z "am__include" && continue
37435d5702bSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37535d5702bSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
37635d5702bSmrg    U=`sed -n 's/^U = //p' < "$mf"`
37735d5702bSmrg    # Find all dependency output files, they are included files with
37835d5702bSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
37935d5702bSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
38035d5702bSmrg    # expansion.
38135d5702bSmrg    for file in `sed -n "
38235d5702bSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
38335d5702bSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
38435d5702bSmrg      # Make sure the directory exists.
38535d5702bSmrg      test -f "$dirpart/$file" && continue
38635d5702bSmrg      fdir=`AS_DIRNAME(["$file"])`
38735d5702bSmrg      AS_MKDIR_P([$dirpart/$fdir])
38835d5702bSmrg      # echo "creating $dirpart/$file"
38935d5702bSmrg      echo '# dummy' > "$dirpart/$file"
39035d5702bSmrg    done
39135d5702bSmrg  done
39235d5702bSmrg}
39335d5702bSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
39435d5702bSmrg
39535d5702bSmrg
39635d5702bSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
39735d5702bSmrg# -----------------------------
39835d5702bSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
39935d5702bSmrg#
40035d5702bSmrg# This code is only required when automatic dependency tracking
40135d5702bSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
40235d5702bSmrg# need in order to bootstrap the dependency handling code.
40335d5702bSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
40435d5702bSmrg[AC_CONFIG_COMMANDS([depfiles],
40535d5702bSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
40635d5702bSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
40735d5702bSmrg])
40835d5702bSmrg
40935d5702bSmrg# Do all the work for Automake.                             -*- Autoconf -*-
41035d5702bSmrg
41135d5702bSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
41235d5702bSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
41335d5702bSmrg#
41435d5702bSmrg# This file is free software; the Free Software Foundation
41535d5702bSmrg# gives unlimited permission to copy and/or distribute it,
41635d5702bSmrg# with or without modifications, as long as this notice is preserved.
41735d5702bSmrg
41835d5702bSmrg# serial 16
41935d5702bSmrg
42035d5702bSmrg# This macro actually does too much.  Some checks are only needed if
42135d5702bSmrg# your package does certain things.  But this isn't really a big deal.
42235d5702bSmrg
42335d5702bSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
42435d5702bSmrg# AM_INIT_AUTOMAKE([OPTIONS])
42535d5702bSmrg# -----------------------------------------------
42635d5702bSmrg# The call with PACKAGE and VERSION arguments is the old style
42735d5702bSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
42835d5702bSmrg# and VERSION should now be passed to AC_INIT and removed from
42935d5702bSmrg# the call to AM_INIT_AUTOMAKE.
43035d5702bSmrg# We support both call styles for the transition.  After
43135d5702bSmrg# the next Automake release, Autoconf can make the AC_INIT
43235d5702bSmrg# arguments mandatory, and then we can depend on a new Autoconf
43335d5702bSmrg# release and drop the old call support.
43435d5702bSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
43535d5702bSmrg[AC_PREREQ([2.62])dnl
43635d5702bSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
43735d5702bSmrgdnl the ones we care about.
43835d5702bSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
43935d5702bSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
44035d5702bSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
44135d5702bSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
44235d5702bSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
44335d5702bSmrg  # is not polluted with repeated "-I."
44435d5702bSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
44535d5702bSmrg  # test to see if srcdir already configured
44635d5702bSmrg  if test -f $srcdir/config.status; then
44735d5702bSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
44835d5702bSmrg  fi
44935d5702bSmrgfi
45035d5702bSmrg
45135d5702bSmrg# test whether we have cygpath
45235d5702bSmrgif test -z "$CYGPATH_W"; then
45335d5702bSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
45435d5702bSmrg    CYGPATH_W='cygpath -w'
45535d5702bSmrg  else
45635d5702bSmrg    CYGPATH_W=echo
45735d5702bSmrg  fi
45835d5702bSmrgfi
45935d5702bSmrgAC_SUBST([CYGPATH_W])
46035d5702bSmrg
46135d5702bSmrg# Define the identity of the package.
46235d5702bSmrgdnl Distinguish between old-style and new-style calls.
46335d5702bSmrgm4_ifval([$2],
46435d5702bSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
46535d5702bSmrg AC_SUBST([PACKAGE], [$1])dnl
46635d5702bSmrg AC_SUBST([VERSION], [$2])],
46735d5702bSmrg[_AM_SET_OPTIONS([$1])dnl
46835d5702bSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
46935d5702bSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
47035d5702bSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
47135d5702bSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
47235d5702bSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
47335d5702bSmrg
47435d5702bSmrg_AM_IF_OPTION([no-define],,
47535d5702bSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
47635d5702bSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
47735d5702bSmrg
47835d5702bSmrg# Some tools Automake needs.
47935d5702bSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
48035d5702bSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
48135d5702bSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
48235d5702bSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
48335d5702bSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
48435d5702bSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
48535d5702bSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
48635d5702bSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
48735d5702bSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
48835d5702bSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
48935d5702bSmrg# We need awk for the "check" target.  The system "awk" is bad on
49035d5702bSmrg# some platforms.
49135d5702bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
49235d5702bSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
49335d5702bSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
49435d5702bSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
49535d5702bSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
49635d5702bSmrg			     [_AM_PROG_TAR([v7])])])
49735d5702bSmrg_AM_IF_OPTION([no-dependencies],,
49835d5702bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
49935d5702bSmrg		  [_AM_DEPENDENCIES(CC)],
50035d5702bSmrg		  [define([AC_PROG_CC],
50135d5702bSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
50235d5702bSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
50335d5702bSmrg		  [_AM_DEPENDENCIES(CXX)],
50435d5702bSmrg		  [define([AC_PROG_CXX],
50535d5702bSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
50635d5702bSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
50735d5702bSmrg		  [_AM_DEPENDENCIES(OBJC)],
50835d5702bSmrg		  [define([AC_PROG_OBJC],
50935d5702bSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
51035d5702bSmrg])
51135d5702bSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
51235d5702bSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
51335d5702bSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
51435d5702bSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
51535d5702bSmrgAC_CONFIG_COMMANDS_PRE(dnl
51635d5702bSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
51735d5702bSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
51835d5702bSmrg])
51935d5702bSmrg
52035d5702bSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
52135d5702bSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
52235d5702bSmrgdnl mangled by Autoconf and run in a shell conditional statement.
52335d5702bSmrgm4_define([_AC_COMPILER_EXEEXT],
52435d5702bSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
52535d5702bSmrg
52635d5702bSmrg
52735d5702bSmrg# When config.status generates a header, we must update the stamp-h file.
52835d5702bSmrg# This file resides in the same directory as the config header
52935d5702bSmrg# that is generated.  The stamp files are numbered to have different names.
53035d5702bSmrg
53135d5702bSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
53235d5702bSmrg# loop where config.status creates the headers, so we can generate
53335d5702bSmrg# our stamp files there.
53435d5702bSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
53535d5702bSmrg[# Compute $1's index in $config_headers.
53635d5702bSmrg_am_arg=$1
53735d5702bSmrg_am_stamp_count=1
53835d5702bSmrgfor _am_header in $config_headers :; do
53935d5702bSmrg  case $_am_header in
54035d5702bSmrg    $_am_arg | $_am_arg:* )
54135d5702bSmrg      break ;;
54235d5702bSmrg    * )
54335d5702bSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
54435d5702bSmrg  esac
54535d5702bSmrgdone
54635d5702bSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
54735d5702bSmrg
54835d5702bSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
54935d5702bSmrg#
55035d5702bSmrg# This file is free software; the Free Software Foundation
55135d5702bSmrg# gives unlimited permission to copy and/or distribute it,
55235d5702bSmrg# with or without modifications, as long as this notice is preserved.
55335d5702bSmrg
55435d5702bSmrg# AM_PROG_INSTALL_SH
55535d5702bSmrg# ------------------
55635d5702bSmrg# Define $install_sh.
55735d5702bSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
55835d5702bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
55935d5702bSmrgif test x"${install_sh}" != xset; then
56035d5702bSmrg  case $am_aux_dir in
56135d5702bSmrg  *\ * | *\	*)
56235d5702bSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
56335d5702bSmrg  *)
56435d5702bSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
56535d5702bSmrg  esac
56635d5702bSmrgfi
56735d5702bSmrgAC_SUBST(install_sh)])
56835d5702bSmrg
56935d5702bSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
57035d5702bSmrg#
57135d5702bSmrg# This file is free software; the Free Software Foundation
57235d5702bSmrg# gives unlimited permission to copy and/or distribute it,
57335d5702bSmrg# with or without modifications, as long as this notice is preserved.
57435d5702bSmrg
57535d5702bSmrg# serial 2
57635d5702bSmrg
57735d5702bSmrg# Check whether the underlying file-system supports filenames
57835d5702bSmrg# with a leading dot.  For instance MS-DOS doesn't.
57935d5702bSmrgAC_DEFUN([AM_SET_LEADING_DOT],
58035d5702bSmrg[rm -rf .tst 2>/dev/null
58135d5702bSmrgmkdir .tst 2>/dev/null
58235d5702bSmrgif test -d .tst; then
58335d5702bSmrg  am__leading_dot=.
58435d5702bSmrgelse
58535d5702bSmrg  am__leading_dot=_
58635d5702bSmrgfi
58735d5702bSmrgrmdir .tst 2>/dev/null
58835d5702bSmrgAC_SUBST([am__leading_dot])])
58935d5702bSmrg
59035d5702bSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
59135d5702bSmrg# From Jim Meyering
59235d5702bSmrg
59335d5702bSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
59435d5702bSmrg# Free Software Foundation, Inc.
59535d5702bSmrg#
59635d5702bSmrg# This file is free software; the Free Software Foundation
59735d5702bSmrg# gives unlimited permission to copy and/or distribute it,
59835d5702bSmrg# with or without modifications, as long as this notice is preserved.
59935d5702bSmrg
60035d5702bSmrg# serial 5
60135d5702bSmrg
60235d5702bSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
60335d5702bSmrg# ----------------------------------
60435d5702bSmrg# Control maintainer-specific portions of Makefiles.
60535d5702bSmrg# Default is to disable them, unless `enable' is passed literally.
60635d5702bSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
60735d5702bSmrg# can override the default with the --enable/--disable switch.
60835d5702bSmrgAC_DEFUN([AM_MAINTAINER_MODE],
60935d5702bSmrg[m4_case(m4_default([$1], [disable]),
61035d5702bSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
61135d5702bSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
61235d5702bSmrg       [m4_define([am_maintainer_other], [enable])
61335d5702bSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
61435d5702bSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
61535d5702bSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
61635d5702bSmrg  AC_ARG_ENABLE([maintainer-mode],
61735d5702bSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
61835d5702bSmrg			  (and sometimes confusing) to the casual installer],
61935d5702bSmrg      [USE_MAINTAINER_MODE=$enableval],
62035d5702bSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
62135d5702bSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
62235d5702bSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
62335d5702bSmrg  MAINT=$MAINTAINER_MODE_TRUE
62435d5702bSmrg  AC_SUBST([MAINT])dnl
62535d5702bSmrg]
62635d5702bSmrg)
62735d5702bSmrg
62835d5702bSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
62935d5702bSmrg
63035d5702bSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
63135d5702bSmrg
63235d5702bSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
63335d5702bSmrg#
63435d5702bSmrg# This file is free software; the Free Software Foundation
63535d5702bSmrg# gives unlimited permission to copy and/or distribute it,
63635d5702bSmrg# with or without modifications, as long as this notice is preserved.
63735d5702bSmrg
63835d5702bSmrg# serial 4
63935d5702bSmrg
64035d5702bSmrg# AM_MAKE_INCLUDE()
64135d5702bSmrg# -----------------
64235d5702bSmrg# Check to see how make treats includes.
64335d5702bSmrgAC_DEFUN([AM_MAKE_INCLUDE],
64435d5702bSmrg[am_make=${MAKE-make}
64535d5702bSmrgcat > confinc << 'END'
64635d5702bSmrgam__doit:
64735d5702bSmrg	@echo this is the am__doit target
64835d5702bSmrg.PHONY: am__doit
64935d5702bSmrgEND
65035d5702bSmrg# If we don't find an include directive, just comment out the code.
65135d5702bSmrgAC_MSG_CHECKING([for style of include used by $am_make])
65235d5702bSmrgam__include="#"
65335d5702bSmrgam__quote=
65435d5702bSmrg_am_result=none
65535d5702bSmrg# First try GNU make style include.
65635d5702bSmrgecho "include confinc" > confmf
65735d5702bSmrg# Ignore all kinds of additional output from `make'.
65835d5702bSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
65935d5702bSmrg*the\ am__doit\ target*)
66035d5702bSmrg  am__include=include
66135d5702bSmrg  am__quote=
66235d5702bSmrg  _am_result=GNU
66335d5702bSmrg  ;;
66435d5702bSmrgesac
66535d5702bSmrg# Now try BSD make style include.
66635d5702bSmrgif test "$am__include" = "#"; then
66735d5702bSmrg   echo '.include "confinc"' > confmf
66835d5702bSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
66935d5702bSmrg   *the\ am__doit\ target*)
67035d5702bSmrg     am__include=.include
67135d5702bSmrg     am__quote="\""
67235d5702bSmrg     _am_result=BSD
67335d5702bSmrg     ;;
67435d5702bSmrg   esac
67535d5702bSmrgfi
67635d5702bSmrgAC_SUBST([am__include])
67735d5702bSmrgAC_SUBST([am__quote])
67835d5702bSmrgAC_MSG_RESULT([$_am_result])
67935d5702bSmrgrm -f confinc confmf
68035d5702bSmrg])
68135d5702bSmrg
68235d5702bSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
68335d5702bSmrg
68435d5702bSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
68535d5702bSmrg# Free Software Foundation, Inc.
68635d5702bSmrg#
68735d5702bSmrg# This file is free software; the Free Software Foundation
68835d5702bSmrg# gives unlimited permission to copy and/or distribute it,
68935d5702bSmrg# with or without modifications, as long as this notice is preserved.
69035d5702bSmrg
69135d5702bSmrg# serial 6
69235d5702bSmrg
69335d5702bSmrg# AM_MISSING_PROG(NAME, PROGRAM)
69435d5702bSmrg# ------------------------------
69535d5702bSmrgAC_DEFUN([AM_MISSING_PROG],
69635d5702bSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
69735d5702bSmrg$1=${$1-"${am_missing_run}$2"}
69835d5702bSmrgAC_SUBST($1)])
69935d5702bSmrg
70035d5702bSmrg
70135d5702bSmrg# AM_MISSING_HAS_RUN
70235d5702bSmrg# ------------------
70335d5702bSmrg# Define MISSING if not defined so far and test if it supports --run.
70435d5702bSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
70535d5702bSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
70635d5702bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
70735d5702bSmrgAC_REQUIRE_AUX_FILE([missing])dnl
70835d5702bSmrgif test x"${MISSING+set}" != xset; then
70935d5702bSmrg  case $am_aux_dir in
71035d5702bSmrg  *\ * | *\	*)
71135d5702bSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
71235d5702bSmrg  *)
71335d5702bSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
71435d5702bSmrg  esac
71535d5702bSmrgfi
71635d5702bSmrg# Use eval to expand $SHELL
71735d5702bSmrgif eval "$MISSING --run true"; then
71835d5702bSmrg  am_missing_run="$MISSING --run "
71935d5702bSmrgelse
72035d5702bSmrg  am_missing_run=
72135d5702bSmrg  AC_MSG_WARN([`missing' script is too old or missing])
72235d5702bSmrgfi
72335d5702bSmrg])
72435d5702bSmrg
72535d5702bSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
72635d5702bSmrg#
72735d5702bSmrg# This file is free software; the Free Software Foundation
72835d5702bSmrg# gives unlimited permission to copy and/or distribute it,
72935d5702bSmrg# with or without modifications, as long as this notice is preserved.
73035d5702bSmrg
73135d5702bSmrg# AM_PROG_MKDIR_P
73235d5702bSmrg# ---------------
73335d5702bSmrg# Check for `mkdir -p'.
73435d5702bSmrgAC_DEFUN([AM_PROG_MKDIR_P],
73535d5702bSmrg[AC_PREREQ([2.60])dnl
73635d5702bSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
73735d5702bSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
73835d5702bSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
73935d5702bSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
74035d5702bSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
74135d5702bSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
74235d5702bSmrgdnl adjustment using top_builddir (which is defined more often than
74335d5702bSmrgdnl MKDIR_P).
74435d5702bSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
74535d5702bSmrgcase $mkdir_p in
74635d5702bSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
74735d5702bSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
74835d5702bSmrgesac
74935d5702bSmrg])
75035d5702bSmrg
75135d5702bSmrg# Helper functions for option handling.                     -*- Autoconf -*-
75235d5702bSmrg
75335d5702bSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
75435d5702bSmrg#
75535d5702bSmrg# This file is free software; the Free Software Foundation
75635d5702bSmrg# gives unlimited permission to copy and/or distribute it,
75735d5702bSmrg# with or without modifications, as long as this notice is preserved.
75835d5702bSmrg
75935d5702bSmrg# serial 4
76035d5702bSmrg
76135d5702bSmrg# _AM_MANGLE_OPTION(NAME)
76235d5702bSmrg# -----------------------
76335d5702bSmrgAC_DEFUN([_AM_MANGLE_OPTION],
76435d5702bSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
76535d5702bSmrg
76635d5702bSmrg# _AM_SET_OPTION(NAME)
76735d5702bSmrg# ------------------------------
76835d5702bSmrg# Set option NAME.  Presently that only means defining a flag for this option.
76935d5702bSmrgAC_DEFUN([_AM_SET_OPTION],
77035d5702bSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
77135d5702bSmrg
77235d5702bSmrg# _AM_SET_OPTIONS(OPTIONS)
77335d5702bSmrg# ----------------------------------
77435d5702bSmrg# OPTIONS is a space-separated list of Automake options.
77535d5702bSmrgAC_DEFUN([_AM_SET_OPTIONS],
77635d5702bSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
77735d5702bSmrg
77835d5702bSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
77935d5702bSmrg# -------------------------------------------
78035d5702bSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
78135d5702bSmrgAC_DEFUN([_AM_IF_OPTION],
78235d5702bSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
78335d5702bSmrg
78435d5702bSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
78535d5702bSmrg
78635d5702bSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
78735d5702bSmrg# Free Software Foundation, Inc.
78835d5702bSmrg#
78935d5702bSmrg# This file is free software; the Free Software Foundation
79035d5702bSmrg# gives unlimited permission to copy and/or distribute it,
79135d5702bSmrg# with or without modifications, as long as this notice is preserved.
79235d5702bSmrg
79335d5702bSmrg# serial 5
79435d5702bSmrg
79535d5702bSmrg# AM_SANITY_CHECK
79635d5702bSmrg# ---------------
79735d5702bSmrgAC_DEFUN([AM_SANITY_CHECK],
79835d5702bSmrg[AC_MSG_CHECKING([whether build environment is sane])
79935d5702bSmrg# Just in case
80035d5702bSmrgsleep 1
80135d5702bSmrgecho timestamp > conftest.file
80235d5702bSmrg# Reject unsafe characters in $srcdir or the absolute working directory
80335d5702bSmrg# name.  Accept space and tab only in the latter.
80435d5702bSmrgam_lf='
80535d5702bSmrg'
80635d5702bSmrgcase `pwd` in
80735d5702bSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
80835d5702bSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
80935d5702bSmrgesac
81035d5702bSmrgcase $srcdir in
81135d5702bSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
81235d5702bSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
81335d5702bSmrgesac
81435d5702bSmrg
81535d5702bSmrg# Do `set' in a subshell so we don't clobber the current shell's
81635d5702bSmrg# arguments.  Must try -L first in case configure is actually a
81735d5702bSmrg# symlink; some systems play weird games with the mod time of symlinks
81835d5702bSmrg# (eg FreeBSD returns the mod time of the symlink's containing
81935d5702bSmrg# directory).
82035d5702bSmrgif (
82135d5702bSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
82235d5702bSmrg   if test "$[*]" = "X"; then
82335d5702bSmrg      # -L didn't work.
82435d5702bSmrg      set X `ls -t "$srcdir/configure" conftest.file`
82535d5702bSmrg   fi
82635d5702bSmrg   rm -f conftest.file
82735d5702bSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
82835d5702bSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
82935d5702bSmrg
83035d5702bSmrg      # If neither matched, then we have a broken ls.  This can happen
83135d5702bSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
83235d5702bSmrg      # broken ls alias from the environment.  This has actually
83335d5702bSmrg      # happened.  Such a system could not be considered "sane".
83435d5702bSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
83535d5702bSmrgalias in your environment])
83635d5702bSmrg   fi
83735d5702bSmrg
83835d5702bSmrg   test "$[2]" = conftest.file
83935d5702bSmrg   )
84035d5702bSmrgthen
84135d5702bSmrg   # Ok.
84235d5702bSmrg   :
84335d5702bSmrgelse
84435d5702bSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
84535d5702bSmrgCheck your system clock])
84635d5702bSmrgfi
84735d5702bSmrgAC_MSG_RESULT(yes)])
84835d5702bSmrg
84935d5702bSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
85035d5702bSmrg#
85135d5702bSmrg# This file is free software; the Free Software Foundation
85235d5702bSmrg# gives unlimited permission to copy and/or distribute it,
85335d5702bSmrg# with or without modifications, as long as this notice is preserved.
85435d5702bSmrg
85535d5702bSmrg# serial 1
85635d5702bSmrg
85735d5702bSmrg# AM_SILENT_RULES([DEFAULT])
85835d5702bSmrg# --------------------------
85935d5702bSmrg# Enable less verbose build rules; with the default set to DEFAULT
86035d5702bSmrg# (`yes' being less verbose, `no' or empty being verbose).
86135d5702bSmrgAC_DEFUN([AM_SILENT_RULES],
86235d5702bSmrg[AC_ARG_ENABLE([silent-rules],
86335d5702bSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
86435d5702bSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
86535d5702bSmrgcase $enable_silent_rules in
86635d5702bSmrgyes) AM_DEFAULT_VERBOSITY=0;;
86735d5702bSmrgno)  AM_DEFAULT_VERBOSITY=1;;
86835d5702bSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
86935d5702bSmrgesac
87035d5702bSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
87135d5702bSmrgAM_BACKSLASH='\'
87235d5702bSmrgAC_SUBST([AM_BACKSLASH])dnl
87335d5702bSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
87435d5702bSmrg])
87535d5702bSmrg
87635d5702bSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
87735d5702bSmrg#
87835d5702bSmrg# This file is free software; the Free Software Foundation
87935d5702bSmrg# gives unlimited permission to copy and/or distribute it,
88035d5702bSmrg# with or without modifications, as long as this notice is preserved.
88135d5702bSmrg
88235d5702bSmrg# AM_PROG_INSTALL_STRIP
88335d5702bSmrg# ---------------------
88435d5702bSmrg# One issue with vendor `install' (even GNU) is that you can't
88535d5702bSmrg# specify the program used to strip binaries.  This is especially
88635d5702bSmrg# annoying in cross-compiling environments, where the build's strip
88735d5702bSmrg# is unlikely to handle the host's binaries.
88835d5702bSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
88935d5702bSmrg# always use install-sh in `make install-strip', and initialize
89035d5702bSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
89135d5702bSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
89235d5702bSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
89335d5702bSmrg# Installed binaries are usually stripped using `strip' when the user
89435d5702bSmrg# run `make install-strip'.  However `strip' might not be the right
89535d5702bSmrg# tool to use in cross-compilation environments, therefore Automake
89635d5702bSmrg# will honor the `STRIP' environment variable to overrule this program.
89735d5702bSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
89835d5702bSmrgif test "$cross_compiling" != no; then
89935d5702bSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
90035d5702bSmrgfi
90135d5702bSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
90235d5702bSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
90335d5702bSmrg
90435d5702bSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
90535d5702bSmrg#
90635d5702bSmrg# This file is free software; the Free Software Foundation
90735d5702bSmrg# gives unlimited permission to copy and/or distribute it,
90835d5702bSmrg# with or without modifications, as long as this notice is preserved.
90935d5702bSmrg
91035d5702bSmrg# serial 2
91135d5702bSmrg
91235d5702bSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
91335d5702bSmrg# ---------------------------
91435d5702bSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
91535d5702bSmrg# This macro is traced by Automake.
91635d5702bSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
91735d5702bSmrg
91835d5702bSmrg# AM_SUBST_NOTMAKE(VARIABLE)
91935d5702bSmrg# ---------------------------
92035d5702bSmrg# Public sister of _AM_SUBST_NOTMAKE.
92135d5702bSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
92235d5702bSmrg
92335d5702bSmrg# Check how to create a tarball.                            -*- Autoconf -*-
92435d5702bSmrg
92535d5702bSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
92635d5702bSmrg#
92735d5702bSmrg# This file is free software; the Free Software Foundation
92835d5702bSmrg# gives unlimited permission to copy and/or distribute it,
92935d5702bSmrg# with or without modifications, as long as this notice is preserved.
93035d5702bSmrg
93135d5702bSmrg# serial 2
93235d5702bSmrg
93335d5702bSmrg# _AM_PROG_TAR(FORMAT)
93435d5702bSmrg# --------------------
93535d5702bSmrg# Check how to create a tarball in format FORMAT.
93635d5702bSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
93735d5702bSmrg#
93835d5702bSmrg# Substitute a variable $(am__tar) that is a command
93935d5702bSmrg# writing to stdout a FORMAT-tarball containing the directory
94035d5702bSmrg# $tardir.
94135d5702bSmrg#     tardir=directory && $(am__tar) > result.tar
94235d5702bSmrg#
94335d5702bSmrg# Substitute a variable $(am__untar) that extract such
94435d5702bSmrg# a tarball read from stdin.
94535d5702bSmrg#     $(am__untar) < result.tar
94635d5702bSmrgAC_DEFUN([_AM_PROG_TAR],
94735d5702bSmrg[# Always define AMTAR for backward compatibility.
94835d5702bSmrgAM_MISSING_PROG([AMTAR], [tar])
94935d5702bSmrgm4_if([$1], [v7],
95035d5702bSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
95135d5702bSmrg     [m4_case([$1], [ustar],, [pax],,
95235d5702bSmrg              [m4_fatal([Unknown tar format])])
95335d5702bSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
95435d5702bSmrg# Loop over all known methods to create a tar archive until one works.
95535d5702bSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
95635d5702bSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
95735d5702bSmrg# Do not fold the above two line into one, because Tru64 sh and
95835d5702bSmrg# Solaris sh will not grok spaces in the rhs of `-'.
95935d5702bSmrgfor _am_tool in $_am_tools
96035d5702bSmrgdo
96135d5702bSmrg  case $_am_tool in
96235d5702bSmrg  gnutar)
96335d5702bSmrg    for _am_tar in tar gnutar gtar;
96435d5702bSmrg    do
96535d5702bSmrg      AM_RUN_LOG([$_am_tar --version]) && break
96635d5702bSmrg    done
96735d5702bSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
96835d5702bSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
96935d5702bSmrg    am__untar="$_am_tar -xf -"
97035d5702bSmrg    ;;
97135d5702bSmrg  plaintar)
97235d5702bSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
97335d5702bSmrg    # ustar tarball either.
97435d5702bSmrg    (tar --version) >/dev/null 2>&1 && continue
97535d5702bSmrg    am__tar='tar chf - "$$tardir"'
97635d5702bSmrg    am__tar_='tar chf - "$tardir"'
97735d5702bSmrg    am__untar='tar xf -'
97835d5702bSmrg    ;;
97935d5702bSmrg  pax)
98035d5702bSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
98135d5702bSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
98235d5702bSmrg    am__untar='pax -r'
98335d5702bSmrg    ;;
98435d5702bSmrg  cpio)
98535d5702bSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
98635d5702bSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
98735d5702bSmrg    am__untar='cpio -i -H $1 -d'
98835d5702bSmrg    ;;
98935d5702bSmrg  none)
99035d5702bSmrg    am__tar=false
99135d5702bSmrg    am__tar_=false
99235d5702bSmrg    am__untar=false
99335d5702bSmrg    ;;
99435d5702bSmrg  esac
99535d5702bSmrg
99635d5702bSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
99735d5702bSmrg  # and am__untar set.
99835d5702bSmrg  test -n "${am_cv_prog_tar_$1}" && break
99935d5702bSmrg
100035d5702bSmrg  # tar/untar a dummy directory, and stop if the command works
100135d5702bSmrg  rm -rf conftest.dir
100235d5702bSmrg  mkdir conftest.dir
100335d5702bSmrg  echo GrepMe > conftest.dir/file
100435d5702bSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
100535d5702bSmrg  rm -rf conftest.dir
100635d5702bSmrg  if test -s conftest.tar; then
100735d5702bSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
100835d5702bSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
100935d5702bSmrg  fi
101035d5702bSmrgdone
101135d5702bSmrgrm -rf conftest.dir
101235d5702bSmrg
101335d5702bSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
101435d5702bSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
101535d5702bSmrgAC_SUBST([am__tar])
101635d5702bSmrgAC_SUBST([am__untar])
101735d5702bSmrg]) # _AM_PROG_TAR
101835d5702bSmrg
101935d5702bSmrgdnl fontutil.m4.  Generated from fontutil.m4.in by configure.
102035d5702bSmrgdnl
102135d5702bSmrgdnl This file comes from X.Org's font-util 1.1.0
102235d5702bSmrgdnl
102335d5702bSmrgdnl Copyright 2005 Red Hat, Inc
102435d5702bSmrgdnl
102535d5702bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
102635d5702bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
102735d5702bSmrgdnl the above copyright notice appear in all copies and that both that
102835d5702bSmrgdnl copyright notice and this permission notice appear in supporting
102935d5702bSmrgdnl documentation.
103035d5702bSmrgdnl
103135d5702bSmrgdnl The above copyright notice and this permission notice shall be included
103235d5702bSmrgdnl in all copies or substantial portions of the Software.
103335d5702bSmrgdnl
103435d5702bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
103535d5702bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
103635d5702bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
103735d5702bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
103835d5702bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
103935d5702bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
104035d5702bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
104135d5702bSmrgdnl
104235d5702bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
104335d5702bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
104435d5702bSmrgdnl other dealings in this Software without prior written authorization
104535d5702bSmrgdnl from the copyright holders.
104635d5702bSmrgdnl
104735d5702bSmrgdnl --------------------------------------------------------------------
104835d5702bSmrgdnl
104935d5702bSmrgdnl Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
105035d5702bSmrgdnl
105135d5702bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
105235d5702bSmrgdnl copy of this software and associated documentation files (the
105335d5702bSmrgdnl "Software"), to deal in the Software without restriction, including
105435d5702bSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
105535d5702bSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
105635d5702bSmrgdnl to whom the Software is furnished to do so, provided that the above
105735d5702bSmrgdnl copyright notice(s) and this permission notice appear in all copies of
105835d5702bSmrgdnl the Software and that both the above copyright notice(s) and this
105935d5702bSmrgdnl permission notice appear in supporting documentation.
106035d5702bSmrgdnl
106135d5702bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
106235d5702bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
106335d5702bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
106435d5702bSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
106535d5702bSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
106635d5702bSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
106735d5702bSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
106835d5702bSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
106935d5702bSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
107035d5702bSmrgdnl
107135d5702bSmrgdnl Except as contained in this notice, the name of a copyright holder
107235d5702bSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
107335d5702bSmrgdnl or other dealings in this Software without prior written authorization
107435d5702bSmrgdnl of the copyright holder.
107535d5702bSmrg
107635d5702bSmrg# XORG_FONT_MACROS_VERSION(required-version)
107735d5702bSmrg# ------------------------------------------
107835d5702bSmrg# Minimum version: 1.1.0
107935d5702bSmrg#
108035d5702bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
108135d5702bSmrg# your configure.ac with the minimum required version, such as:
108235d5702bSmrg# XORG_FONT_MACROS_VERSION(1.1)
108335d5702bSmrg#
108435d5702bSmrg# To ensure that this macro is defined, also add:
108535d5702bSmrg# m4_ifndef([XORG_FONT_MACROS_VERSION],
108635d5702bSmrg#     [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
108735d5702bSmrg#
108835d5702bSmrg#
108935d5702bSmrg# See the "minimum version" comment for each macro you use to see what
109035d5702bSmrg# version you require.
109135d5702bSmrgm4_defun([XORG_FONT_MACROS_VERSION],[
109235d5702bSmrgm4_define([vers_have], [1.1.0])
109335d5702bSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
109435d5702bSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
109535d5702bSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
109635d5702bSmrg    [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])])
109735d5702bSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
109835d5702bSmrg    [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])])
109935d5702bSmrgm4_undefine([vers_have])
110035d5702bSmrgm4_undefine([maj_have])
110135d5702bSmrgm4_undefine([maj_needed])
110235d5702bSmrg]) # XORG_FONT_MACROS_VERSION
110335d5702bSmrg
110435d5702bSmrg# XORG_FONT_CHECK_{maps}()
110535d5702bSmrg# ------------------------
110635d5702bSmrg# Minimum version: 1.0.0
110735d5702bSmrg# These macros add --enable/disable-{maps} where {maps} are ISO8859-*,
110835d5702bSmrg# JISX0201 or KOI8_R.  By default, they are all enabled.
110935d5702bSmrg
111035d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)])
111135d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)])
111235d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)])
111335d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)])
111435d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)])
111535d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)])
111635d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)])
111735d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)])
111835d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)])
111935d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)])
112035d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)])
112135d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)])
112235d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)])
112335d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)])
112435d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)])
112535d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)])
112635d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_JISX0201],  [XORG_FONT_CHECK_ENCODING(JISX0201)])
112735d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_KOI8_R],    [XORG_FONT_CHECK_ENCODING(KOI8-R)])
112835d5702bSmrg
112935d5702bSmrg# XORG_FONT_CHECK_ENCODING(encoding)
113035d5702bSmrg# ----------------------------------
113135d5702bSmrg# Minimum version: 1.1.0
113235d5702bSmrg# This macro adds --enable/disable-<encoding>, enabled by default.
113335d5702bSmrg# It replaced individual copies of this code in the above macros in 1.1.
113435d5702bSmrg# Currently assumes encoding names will be all upper-case - add m4_toupper
113535d5702bSmrg# calls if this is not true in the future.
113635d5702bSmrg
113735d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING],[
113835d5702bSmrg	AC_ARG_ENABLE(m4_tolower($1),
113935d5702bSmrg		AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)),
114035d5702bSmrg				[Build $1 fonts (default: yes)]),
114135d5702bSmrg		[AS_TR_SH($1)=$enableval], [AS_TR_SH($1)=yes])
114235d5702bSmrg	AC_MSG_CHECKING([whether to build $1 fonts])
114335d5702bSmrg	AC_MSG_RESULT($[AS_TR_SH($1)])
114435d5702bSmrg	AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes])
114535d5702bSmrg]) # XORG_FONT_CHECK_ENCODING
114635d5702bSmrg
114735d5702bSmrg# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....)
114835d5702bSmrg# -----------------------------------------------------
114935d5702bSmrg# Minimum version: 1.1.0
115035d5702bSmrg# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once
115135d5702bSmrg
115235d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[
115335d5702bSmrg	m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)])
115435d5702bSmrg]) # XORG_FONT_CHECK_ENCODING_LIST
115535d5702bSmrg
115635d5702bSmrg# XORG_FONT_REQUIRED_PROG(VARNAME, progname)
115735d5702bSmrg# ------------------------------------------
115835d5702bSmrg# Minimum version: 1.1.0
115935d5702bSmrg#
116035d5702bSmrg# Simple wrapper around AC_PATH_PROG that errors if not found
116135d5702bSmrg#
116235d5702bSmrg
116335d5702bSmrgAC_DEFUN([XORG_FONT_REQUIRED_PROG],[
116435d5702bSmrg	AC_PATH_PROG($1, $2)
116535d5702bSmrg	if test x"$1" = x; then
116635d5702bSmrg		AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.])
116735d5702bSmrg	fi
116835d5702bSmrg])
116935d5702bSmrg
117035d5702bSmrg
117135d5702bSmrg# XORG_FONT_FCCACHE()
117235d5702bSmrg# -------------------
117335d5702bSmrg# Minimum version: 1.1.0
117435d5702bSmrg#
117535d5702bSmrg# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found
117635d5702bSmrg# Set RUN_FCCACHE to a rule suitable for substituting into a makefile
117735d5702bSmrg# to run fc-cache if found and not installing to $DESTDIR
117835d5702bSmrg#
117935d5702bSmrg# fc-cache is optional, not required, and should be skipped when making
118035d5702bSmrg# packages (installing to $DESTDIR).
118135d5702bSmrg#
118235d5702bSmrgAC_DEFUN([XORG_FONT_FCCACHE],[
118335d5702bSmrg	AC_PATH_PROG(FCCACHE, fc-cache)
118435d5702bSmrg	FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"'
118535d5702bSmrg	if test x"$FCCACHE" = x ; then
118635d5702bSmrg		RUN_FCCACHE="${FCCACHE_WARN}"
118735d5702bSmrg	else
118835d5702bSmrg		RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else'
118935d5702bSmrg		RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)"
119035d5702bSmrg	fi
119135d5702bSmrg	AC_SUBST([RUN_FCCACHE])
1192a6fdc6faSmrg])
1193a6fdc6faSmrg
1194a6fdc6faSmrg
119535d5702bSmrg# XORG_FONT_COMMON_UTILS()
119635d5702bSmrg# ------------------------
119735d5702bSmrg# Minimum version: 1.1.0
119835d5702bSmrg#
119935d5702bSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types
120035d5702bSmrg
120135d5702bSmrgAC_DEFUN([XORG_FONT_COMMON_UTILS],[
120235d5702bSmrg	XORG_FONT_FCCACHE
120335d5702bSmrg	XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir)
1204a6fdc6faSmrg])
1205a6fdc6faSmrg
120635d5702bSmrg# XORG_FONT_SCALED_UTILS()
120735d5702bSmrg# ------------------------
120835d5702bSmrg# Minimum version: 1.1.0
120935d5702bSmrg#
121035d5702bSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts
121135d5702bSmrg# (TrueType, OpenType, Type1)
1212a6fdc6faSmrg
121335d5702bSmrgAC_DEFUN([XORG_FONT_SCALED_UTILS],[
121435d5702bSmrg	XORG_FONT_COMMON_UTILS
121535d5702bSmrg	XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale)
1216a6fdc6faSmrg])
1217a6fdc6faSmrg
121835d5702bSmrg# XORG_FONT_BDF_UTILS()
121935d5702bSmrg# ---------------------
122035d5702bSmrg# Minimum version: 1.1.0
122135d5702bSmrg#
122235d5702bSmrg# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts
122335d5702bSmrg# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the
122435d5702bSmrg# PCF output files created by bdftopcf
122535d5702bSmrg
122635d5702bSmrgAC_DEFUN([XORG_FONT_BDF_UTILS],[
122735d5702bSmrg	XORG_FONT_COMMON_UTILS
122835d5702bSmrg	XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf)
122935d5702bSmrg	XORG_FONT_CHECK_COMPRESSION
123035d5702bSmrg])
1231a6fdc6faSmrg
123235d5702bSmrg# XORG_FONT_CHECK_COMPRESSION()
123335d5702bSmrg# -----------------------------
123435d5702bSmrg# Minimum version: 1.1.0
123535d5702bSmrg#
123635d5702bSmrg# Offer a --with-compression flag to control what compression method is
123735d5702bSmrg# used for pcf font files.   Offers all the methods currently supported
123835d5702bSmrg# by libXfont, including no compression.
123935d5702bSmrg
124035d5702bSmrgAC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[
124135d5702bSmrg	AC_MSG_CHECKING([font compression method])
124235d5702bSmrg	AC_ARG_WITH(compression,
124335d5702bSmrg	 [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>],
124435d5702bSmrg			 [compression method to use on pcf fonts])],
124535d5702bSmrg         [compression="$withval"], [compression="yes"])
124635d5702bSmrg	if test x"$compression" = "xyes" ; then
124735d5702bSmrg		compression="gzip"
124835d5702bSmrg	fi
124935d5702bSmrg	AC_MSG_RESULT([${compression}])
125035d5702bSmrg	case ${compression} in
125135d5702bSmrg	 *compress)	COMPRESS_SUFFIX=".Z" ;;
125235d5702bSmrg	 *gzip)		COMPRESS_SUFFIX=".gz" ;;
125335d5702bSmrg	 *bzip2)	COMPRESS_SUFFIX=".bz2" ;;
125435d5702bSmrg	 no|none)	COMPRESS_SUFFIX="" ; COMPRESS="cat" ;;
125535d5702bSmrg	 *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;;
125635d5702bSmrg	esac
125735d5702bSmrg	if test x"$COMPRESS_SUFFIX" != "x" ; then
125835d5702bSmrg	   XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression})
125935d5702bSmrg	fi
126035d5702bSmrg	AC_SUBST([COMPRESS_SUFFIX])
126135d5702bSmrg])
1262a6fdc6faSmrg
126335d5702bSmrg# XORG_FONT_UCS2ANY()
126435d5702bSmrg# -------------------
126535d5702bSmrg# Minimum version: 1.1.0
126635d5702bSmrg#
126735d5702bSmrg# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting
126835d5702bSmrg# Unicode-encoded BDF format bitmap fonts into subsets for older encodings.
126935d5702bSmrg# Also call pkg-config to find the directory with the encoding files needed
127035d5702bSmrg# by ucs2any, and export it as MAPFILES_PATH to the Makefiles
127135d5702bSmrg
127235d5702bSmrgAC_DEFUN([XORG_FONT_UCS2ANY],[
127335d5702bSmrg	XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
127435d5702bSmrg	PKG_CHECK_MODULES(MAPS, [fontutil])
127535d5702bSmrg	AC_MSG_CHECKING([for ucs2any encoding data files])
127635d5702bSmrg	MAPFILES_PATH=`pkg-config --variable=mapdir fontutil`
127735d5702bSmrg	AC_SUBST(MAPFILES_PATH)
127835d5702bSmrg	AC_MSG_RESULT([${MAPFILES_PATH}])
127935d5702bSmrg])
1280a6fdc6faSmrg
1281a6fdc6faSmrg
1282a6fdc6faSmrg
128335d5702bSmrg# XORG_FONTROOTDIR()
128435d5702bSmrg# --------------------
128535d5702bSmrg# Minimum version: 1.1.0
128635d5702bSmrg#
128735d5702bSmrg# Sets FONTROOTDIR to the root directory for font files.  Uses the first
128835d5702bSmrg# found from:
128935d5702bSmrg#	--with-fontrootdir
129035d5702bSmrg#	pkg-config --variable=fontrootdir fontutil
129135d5702bSmrg#	${datadir}/fonts/X11
129235d5702bSmrg
129335d5702bSmrgAC_DEFUN([XORG_FONTROOTDIR],[
129435d5702bSmrg	dnl Ensure $PKG_CONFIG is set first
129535d5702bSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
129635d5702bSmrg
129735d5702bSmrg	AC_MSG_CHECKING([for root directory for font files])
129835d5702bSmrg	AC_ARG_WITH(fontrootdir,
129935d5702bSmrg		    AS_HELP_STRING([--with-fontrootdir=DIR],
130035d5702bSmrg			   [Path to root directory for font files]),
130135d5702bSmrg		    [FONTROOTDIR="$withval"])
130235d5702bSmrg	# if --with-fontrootdir not specified...
130335d5702bSmrg	if test "x${FONTROOTDIR}" = "x"; then
130435d5702bSmrg		FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
130535d5702bSmrg	fi
130635d5702bSmrg	# ...and if pkg-config didn't find fontdir in fontutil.pc...
130735d5702bSmrg	if test "x${FONTROOTDIR}" = "x"; then
130835d5702bSmrg		FONTROOTDIR="${datadir}/fonts/X11"
130935d5702bSmrg	fi
131035d5702bSmrg	AC_SUBST(FONTROOTDIR)
131135d5702bSmrg	AC_MSG_RESULT([${FONTROOTDIR}])
131235d5702bSmrg])
1313a6fdc6faSmrg
131435d5702bSmrg# XORG_FONTSUBDIR(variable, flag, subdir)
131535d5702bSmrg# ---------------------------------------
131635d5702bSmrg# Minimum version: 1.1.0
131735d5702bSmrg#
131835d5702bSmrg# Offer a --with-<flag> flag to control directory for font installation
131935d5702bSmrg# Default is the specified <subdir> of the font root directory.
132035d5702bSmrg# Sets <variable> to the selected directory
132135d5702bSmrg
132235d5702bSmrgAC_DEFUN([XORG_FONTSUBDIR],[
132335d5702bSmrg	AC_REQUIRE([XORG_FONTROOTDIR])
132435d5702bSmrg
132535d5702bSmrg	AC_MSG_CHECKING([for directory for $3 files])
132635d5702bSmrg	AC_ARG_WITH($2,
132735d5702bSmrg		    [AS_HELP_STRING([--with-$2=DIR],
132835d5702bSmrg		       		   [Path to $3 files [FONTROOTDIR/$3]])],
132935d5702bSmrg		    [$1="${withval}"], [$1='${FONTROOTDIR}/$3'])
133035d5702bSmrg	AC_SUBST($1)
133135d5702bSmrg	AC_MSG_RESULT([${$1}])
133235d5702bSmrg]) # XORG_FONTSUBDIR
133335d5702bSmrg
133435d5702bSmrg# XORG_FONTDIR(subdir)
133535d5702bSmrg# --------------------
133635d5702bSmrg# Minimum version: 1.1.0
133735d5702bSmrg#
133835d5702bSmrg# Offer a --with-fontdir flag to control directory for font installation
133935d5702bSmrg# Default is the specified subdir of the font root directory.
134035d5702bSmrg# Sets FONTDIR to the selected directory
1341a6fdc6faSmrg
134235d5702bSmrgAC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])])
1343a6fdc6faSmrg
134435d5702bSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
134535d5702bSmrgdnl
134635d5702bSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
134735d5702bSmrgdnl 
134835d5702bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
134935d5702bSmrgdnl copy of this software and associated documentation files (the
135035d5702bSmrgdnl "Software"), to deal in the Software without restriction, including
135135d5702bSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
135235d5702bSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
135335d5702bSmrgdnl to whom the Software is furnished to do so, provided that the above
135435d5702bSmrgdnl copyright notice(s) and this permission notice appear in all copies of
135535d5702bSmrgdnl the Software and that both the above copyright notice(s) and this
135635d5702bSmrgdnl permission notice appear in supporting documentation.
135735d5702bSmrgdnl
135835d5702bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
135935d5702bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
136035d5702bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
136135d5702bSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
136235d5702bSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
136335d5702bSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
136435d5702bSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
136535d5702bSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
136635d5702bSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
136735d5702bSmrgdnl
136835d5702bSmrgdnl Except as contained in this notice, the name of a copyright holder
136935d5702bSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
137035d5702bSmrgdnl or other dealings in this Software without prior written authorization
137135d5702bSmrgdnl of the copyright holder.
137235d5702bSmrg
137335d5702bSmrg# XORG_MACROS_VERSION(required-version)
137435d5702bSmrg# -------------------------------------
137535d5702bSmrg# Minimum version: 1.1.0
1376a6fdc6faSmrg#
137735d5702bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
137835d5702bSmrg# your configure.ac with the minimum required version, such as:
137935d5702bSmrg# XORG_MACROS_VERSION(1.1)
138035d5702bSmrg#
138135d5702bSmrg# To ensure that this macro is defined, also add:
138235d5702bSmrg# m4_ifndef([XORG_MACROS_VERSION],
138335d5702bSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
138435d5702bSmrg#
138535d5702bSmrg#
138635d5702bSmrg# See the "minimum version" comment for each macro you use to see what 
138735d5702bSmrg# version you require.
138835d5702bSmrgm4_defun([XORG_MACROS_VERSION],[
138935d5702bSmrgm4_define([vers_have], [1.3.0])
139035d5702bSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
139135d5702bSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
139235d5702bSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
139335d5702bSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
139435d5702bSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
139535d5702bSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
139635d5702bSmrgm4_undefine([vers_have])
139735d5702bSmrgm4_undefine([maj_have])
139835d5702bSmrgm4_undefine([maj_needed])
139935d5702bSmrg]) # XORG_MACROS_VERSION
140035d5702bSmrg
140135d5702bSmrg# XORG_PROG_RAWCPP()
140235d5702bSmrg# ------------------
140335d5702bSmrg# Minimum version: 1.0.0
140435d5702bSmrg#
140535d5702bSmrg# Find cpp program and necessary flags for use in pre-processing text files
140635d5702bSmrg# such as man pages and config files
140735d5702bSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
140835d5702bSmrgAC_REQUIRE([AC_PROG_CPP])
140935d5702bSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
141035d5702bSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
141135d5702bSmrg
141235d5702bSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
141335d5702bSmrg# which is not the best choice for supporting other OS'es, but covers most
141435d5702bSmrg# of the ones we need for now.
141535d5702bSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
141635d5702bSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
141735d5702bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
141835d5702bSmrg	AC_MSG_RESULT([no])
141935d5702bSmrgelse
142035d5702bSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
142135d5702bSmrg		RAWCPPFLAGS=-undef
142235d5702bSmrg		AC_MSG_RESULT([yes])
142335d5702bSmrg	# under Cygwin unix is still defined even with -undef
142435d5702bSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
142535d5702bSmrg		RAWCPPFLAGS="-undef -ansi"
142635d5702bSmrg		AC_MSG_RESULT([yes, with -ansi])
142735d5702bSmrg	else
142835d5702bSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
142935d5702bSmrg	fi
143035d5702bSmrgfi
143135d5702bSmrgrm -f conftest.$ac_ext
1432a6fdc6faSmrg
143335d5702bSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
143435d5702bSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
143535d5702bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
143635d5702bSmrg	AC_MSG_RESULT([no])
143735d5702bSmrgelse
143835d5702bSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
143935d5702bSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
144035d5702bSmrg		AC_MSG_RESULT([yes])
144135d5702bSmrg	else
144235d5702bSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
144335d5702bSmrg	fi
144435d5702bSmrgfi
144535d5702bSmrgrm -f conftest.$ac_ext
144635d5702bSmrgAC_SUBST(RAWCPPFLAGS)
144735d5702bSmrg]) # XORG_PROG_RAWCPP
1448a6fdc6faSmrg
144935d5702bSmrg# XORG_MANPAGE_SECTIONS()
145035d5702bSmrg# -----------------------
145135d5702bSmrg# Minimum version: 1.0.0
145235d5702bSmrg#
145335d5702bSmrg# Determine which sections man pages go in for the different man page types
145435d5702bSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
145535d5702bSmrg# Not sure if there's any better way than just hardcoding by OS name.
145635d5702bSmrg# Override default settings by setting environment variables
1457a6fdc6faSmrg
145835d5702bSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
145935d5702bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1460a6fdc6faSmrg
146135d5702bSmrgif test x$APP_MAN_SUFFIX = x    ; then
146235d5702bSmrg    APP_MAN_SUFFIX=1
146335d5702bSmrgfi
146435d5702bSmrgif test x$APP_MAN_DIR = x    ; then
146535d5702bSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
146635d5702bSmrgfi
1467a6fdc6faSmrg
146835d5702bSmrgif test x$LIB_MAN_SUFFIX = x    ; then
146935d5702bSmrg    LIB_MAN_SUFFIX=3
147035d5702bSmrgfi
147135d5702bSmrgif test x$LIB_MAN_DIR = x    ; then
147235d5702bSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
147335d5702bSmrgfi
1474a6fdc6faSmrg
147535d5702bSmrgif test x$FILE_MAN_SUFFIX = x    ; then
147635d5702bSmrg    case $host_os in
147735d5702bSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
147835d5702bSmrg	*)		FILE_MAN_SUFFIX=5  ;;
147935d5702bSmrg    esac
148035d5702bSmrgfi
148135d5702bSmrgif test x$FILE_MAN_DIR = x    ; then
148235d5702bSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
148335d5702bSmrgfi
1484a6fdc6faSmrg
148535d5702bSmrgif test x$MISC_MAN_SUFFIX = x    ; then
148635d5702bSmrg    case $host_os in
148735d5702bSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
148835d5702bSmrg	*)		MISC_MAN_SUFFIX=7  ;;
148935d5702bSmrg    esac
1490a6fdc6faSmrgfi
149135d5702bSmrgif test x$MISC_MAN_DIR = x    ; then
149235d5702bSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1493a6fdc6faSmrgfi
1494a6fdc6faSmrg
149535d5702bSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
149635d5702bSmrg    case $host_os in
149735d5702bSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
149835d5702bSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
149935d5702bSmrg    esac
150035d5702bSmrgfi
150135d5702bSmrgif test x$DRIVER_MAN_DIR = x    ; then
150235d5702bSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
150335d5702bSmrgfi
1504a6fdc6faSmrg
150535d5702bSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
150635d5702bSmrg    case $host_os in
150735d5702bSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
150835d5702bSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
150935d5702bSmrg    esac
151035d5702bSmrgfi
151135d5702bSmrgif test x$ADMIN_MAN_DIR = x    ; then
151235d5702bSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
151335d5702bSmrgfi
1514a6fdc6faSmrg
1515a6fdc6faSmrg
151635d5702bSmrgAC_SUBST([APP_MAN_SUFFIX])
151735d5702bSmrgAC_SUBST([LIB_MAN_SUFFIX])
151835d5702bSmrgAC_SUBST([FILE_MAN_SUFFIX])
151935d5702bSmrgAC_SUBST([MISC_MAN_SUFFIX])
152035d5702bSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
152135d5702bSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
152235d5702bSmrgAC_SUBST([APP_MAN_DIR])
152335d5702bSmrgAC_SUBST([LIB_MAN_DIR])
152435d5702bSmrgAC_SUBST([FILE_MAN_DIR])
152535d5702bSmrgAC_SUBST([MISC_MAN_DIR])
152635d5702bSmrgAC_SUBST([DRIVER_MAN_DIR])
152735d5702bSmrgAC_SUBST([ADMIN_MAN_DIR])
152835d5702bSmrg]) # XORG_MANPAGE_SECTIONS
152935d5702bSmrg
153035d5702bSmrg# XORG_CHECK_LINUXDOC
153135d5702bSmrg# -------------------
153235d5702bSmrg# Minimum version: 1.0.0
153335d5702bSmrg#
153435d5702bSmrg# Defines the variable MAKE_TEXT if the necessary tools and
153535d5702bSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
153635d5702bSmrg# Whether or not the necessary tools and files are found can be checked
153735d5702bSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
153835d5702bSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
153935d5702bSmrgif test x$XORG_SGML_PATH = x ; then
154035d5702bSmrg    XORG_SGML_PATH=$prefix/share/sgml
154135d5702bSmrgfi
154235d5702bSmrgHAVE_DEFS_ENT=
1543a6fdc6faSmrg
154435d5702bSmrgif test x"$cross_compiling" = x"yes" ; then
154535d5702bSmrg  HAVE_DEFS_ENT=no
154635d5702bSmrgelse
154735d5702bSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
154835d5702bSmrgfi
1549a6fdc6faSmrg
155035d5702bSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
155135d5702bSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1552a6fdc6faSmrg
155335d5702bSmrgAC_MSG_CHECKING([Whether to build documentation])
1554a6fdc6faSmrg
155535d5702bSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
155635d5702bSmrg   BUILDDOC=yes
1557a6fdc6faSmrgelse
155835d5702bSmrg   BUILDDOC=no
1559a6fdc6faSmrgfi
1560a6fdc6faSmrg
156135d5702bSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1562a6fdc6faSmrg
156335d5702bSmrgAC_MSG_RESULT([$BUILDDOC])
1564a6fdc6faSmrg
156535d5702bSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1566a6fdc6faSmrg
156735d5702bSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
156835d5702bSmrg   BUILDPDFDOC=yes
156935d5702bSmrgelse
157035d5702bSmrg   BUILDPDFDOC=no
157135d5702bSmrgfi
1572a6fdc6faSmrg
157335d5702bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1574a6fdc6faSmrg
157535d5702bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1576a6fdc6faSmrg
157735d5702bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
157835d5702bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
157935d5702bSmrgMAKE_PDF="$PS2PDF"
158035d5702bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1581a6fdc6faSmrg
158235d5702bSmrgAC_SUBST(MAKE_TEXT)
158335d5702bSmrgAC_SUBST(MAKE_PS)
158435d5702bSmrgAC_SUBST(MAKE_PDF)
158535d5702bSmrgAC_SUBST(MAKE_HTML)
158635d5702bSmrg]) # XORG_CHECK_LINUXDOC
158735d5702bSmrg
158835d5702bSmrg# XORG_CHECK_DOCBOOK
158935d5702bSmrg# -------------------
159035d5702bSmrg# Minimum version: 1.0.0
159135d5702bSmrg#
159235d5702bSmrg# Checks for the ability to build output formats from SGML DocBook source.
159335d5702bSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
159435d5702bSmrg# indicates whether the necessary tools and files are found and, if set,
159535d5702bSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
159635d5702bSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
159735d5702bSmrgif test x$XORG_SGML_PATH = x ; then
159835d5702bSmrg    XORG_SGML_PATH=$prefix/share/sgml
159935d5702bSmrgfi
160035d5702bSmrgHAVE_DEFS_ENT=
160135d5702bSmrgBUILDTXTDOC=no
160235d5702bSmrgBUILDPDFDOC=no
160335d5702bSmrgBUILDPSDOC=no
160435d5702bSmrgBUILDHTMLDOC=no
160535d5702bSmrg
160635d5702bSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
160735d5702bSmrg
160835d5702bSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
160935d5702bSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
161035d5702bSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
161135d5702bSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
161235d5702bSmrg
161335d5702bSmrgAC_MSG_CHECKING([Whether to build text documentation])
161435d5702bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
161535d5702bSmrg   test x$BUILD_TXTDOC != xno; then
161635d5702bSmrg	BUILDTXTDOC=yes
161735d5702bSmrgfi
161835d5702bSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
161935d5702bSmrgAC_MSG_RESULT([$BUILDTXTDOC])
162035d5702bSmrg
162135d5702bSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
162235d5702bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
162335d5702bSmrg   test x$BUILD_PDFDOC != xno; then
162435d5702bSmrg	BUILDPDFDOC=yes
162535d5702bSmrgfi
162635d5702bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
162735d5702bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
162835d5702bSmrg
162935d5702bSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
163035d5702bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
163135d5702bSmrg   test x$BUILD_PSDOC != xno; then
163235d5702bSmrg	BUILDPSDOC=yes
163335d5702bSmrgfi
163435d5702bSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
163535d5702bSmrgAC_MSG_RESULT([$BUILDPSDOC])
163635d5702bSmrg
163735d5702bSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
163835d5702bSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
163935d5702bSmrg   test x$BUILD_HTMLDOC != xno; then
164035d5702bSmrg	BUILDHTMLDOC=yes
164135d5702bSmrgfi
164235d5702bSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
164335d5702bSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
164435d5702bSmrg
164535d5702bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
164635d5702bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
164735d5702bSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
164835d5702bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
164935d5702bSmrg
165035d5702bSmrgAC_SUBST(MAKE_TEXT)
165135d5702bSmrgAC_SUBST(MAKE_PS)
165235d5702bSmrgAC_SUBST(MAKE_PDF)
165335d5702bSmrgAC_SUBST(MAKE_HTML)
165435d5702bSmrg]) # XORG_CHECK_DOCBOOK
165535d5702bSmrg
165635d5702bSmrg# XORG_CHECK_MALLOC_ZERO
165735d5702bSmrg# ----------------------
165835d5702bSmrg# Minimum version: 1.0.0
165935d5702bSmrg#
166035d5702bSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
166135d5702bSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
166235d5702bSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
166335d5702bSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
166435d5702bSmrgAC_ARG_ENABLE(malloc0returnsnull,
166535d5702bSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
166635d5702bSmrg		       [malloc(0) returns NULL (default: auto)]),
166735d5702bSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
166835d5702bSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
166935d5702bSmrg
167035d5702bSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
167135d5702bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
167235d5702bSmrg	AC_RUN_IFELSE([
167335d5702bSmrgchar *malloc();
167435d5702bSmrgchar *realloc();
167535d5702bSmrgchar *calloc();
167635d5702bSmrgmain() {
167735d5702bSmrg    char *m0, *r0, *c0, *p;
167835d5702bSmrg    m0 = malloc(0);
167935d5702bSmrg    p = malloc(10);
168035d5702bSmrg    r0 = realloc(p,0);
168135d5702bSmrg    c0 = calloc(0);
168235d5702bSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
168335d5702bSmrg}],
168435d5702bSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
168535d5702bSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
168635d5702bSmrgfi
168735d5702bSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
168835d5702bSmrg
168935d5702bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
169035d5702bSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
169135d5702bSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
169235d5702bSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
169335d5702bSmrgelse
169435d5702bSmrg	MALLOC_ZERO_CFLAGS=""
169535d5702bSmrg	XMALLOC_ZERO_CFLAGS=""
169635d5702bSmrg	XTMALLOC_ZERO_CFLAGS=""
169735d5702bSmrgfi
169835d5702bSmrg
169935d5702bSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
170035d5702bSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
170135d5702bSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
170235d5702bSmrg]) # XORG_CHECK_MALLOC_ZERO
1703a6fdc6faSmrg
170435d5702bSmrg# XORG_WITH_LINT()
170535d5702bSmrg# ----------------
170635d5702bSmrg# Minimum version: 1.1.0
170735d5702bSmrg#
170835d5702bSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
170935d5702bSmrg# is specified.   (Use --with-lint=sparse for sparse.)
171035d5702bSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
171135d5702bSmrg# Sets $LINT_FLAGS to flags to pass to source checker
171235d5702bSmrg# Sets LINT automake conditional if enabled (default: disabled)
171335d5702bSmrg#
171435d5702bSmrgAC_DEFUN([XORG_WITH_LINT],[
171535d5702bSmrg
171635d5702bSmrg# Allow checking code with lint, sparse, etc.
171735d5702bSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
171835d5702bSmrg		[Use a lint-style source code checker (default: disabled)])],
171935d5702bSmrg		[use_lint=$withval], [use_lint=no])
172035d5702bSmrgif test "x$use_lint" = "xyes" ; then
172135d5702bSmrg	LINT="lint"
172235d5702bSmrgelse
172335d5702bSmrg	LINT="$use_lint"
172435d5702bSmrgfi
172535d5702bSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
172635d5702bSmrg    case $LINT in
172735d5702bSmrg	lint|*/lint)
172835d5702bSmrg	    case $host_os in
172935d5702bSmrg		solaris*)
173035d5702bSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
173135d5702bSmrg			;;
173235d5702bSmrg	    esac
173335d5702bSmrg	    ;;
173435d5702bSmrg    esac
173535d5702bSmrgfi
173635d5702bSmrg
173735d5702bSmrgAC_SUBST(LINT)
173835d5702bSmrgAC_SUBST(LINT_FLAGS)
173935d5702bSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
174035d5702bSmrg
174135d5702bSmrg]) # XORG_WITH_LINT
174235d5702bSmrg
174335d5702bSmrg# XORG_LINT_LIBRARY(LIBNAME)
174435d5702bSmrg# --------------------------
174535d5702bSmrg# Minimum version: 1.1.0
174635d5702bSmrg#
174735d5702bSmrg# Sets up flags for building lint libraries for checking programs that call
174835d5702bSmrg# functions in the library.
174935d5702bSmrg# Disabled by default, enable with --enable-lint-library
175035d5702bSmrg# Sets: 
175135d5702bSmrg#	@LINTLIB@		- name of lint library file to make
175235d5702bSmrg#	MAKE_LINT_LIB		- automake conditional
175335d5702bSmrg#
175435d5702bSmrg
175535d5702bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
175635d5702bSmrgAC_REQUIRE([XORG_WITH_LINT])
175735d5702bSmrg# Build lint "library" for more indepth checks of programs calling this library
175835d5702bSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
175935d5702bSmrg	[Create lint library (default: disabled)])],
176035d5702bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
176135d5702bSmrgif test "x$make_lint_lib" != "xno" ; then
176235d5702bSmrg	if test "x$LINT" = "xno" ; then
176335d5702bSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
176435d5702bSmrg	fi
176535d5702bSmrg	if test "x$make_lint_lib" = "xyes" ; then
176635d5702bSmrg		LINTLIB=llib-l$1.ln
176735d5702bSmrg	else
176835d5702bSmrg		LINTLIB=$make_lint_lib
176935d5702bSmrg	fi
177035d5702bSmrgfi
177135d5702bSmrgAC_SUBST(LINTLIB)
177235d5702bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
177335d5702bSmrg
177435d5702bSmrg]) # XORG_LINT_LIBRARY
177535d5702bSmrg
177635d5702bSmrg# XORG_CWARNFLAGS
177735d5702bSmrg# ---------------
177835d5702bSmrg# Minimum version: 1.2.0
177935d5702bSmrg#
178035d5702bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
178135d5702bSmrg#
178235d5702bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
178335d5702bSmrgAC_REQUIRE([AC_PROG_CC])
178435d5702bSmrgif  test "x$GCC" = xyes ; then
178535d5702bSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
178635d5702bSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
178735d5702bSmrg-Wbad-function-cast"
178835d5702bSmrg    case `$CC -dumpversion` in
178935d5702bSmrg    3.4.* | 4.*)
179035d5702bSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
179135d5702bSmrg	;;
179235d5702bSmrg    esac
179335d5702bSmrgelse
179435d5702bSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
179535d5702bSmrg    if test "x$SUNCC" = "xyes"; then
179635d5702bSmrg	CWARNFLAGS="-v"
179735d5702bSmrg    fi
179835d5702bSmrgfi
179935d5702bSmrgAC_SUBST(CWARNFLAGS)
180035d5702bSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
180135d5702bSmrg]) # XORG_CWARNFLAGS
180235d5702bSmrg
180335d5702bSmrg# XORG_STRICT_OPTION
180435d5702bSmrg# -----------------------
180535d5702bSmrg# Minimum version: 1.3.0
180635d5702bSmrg#
180735d5702bSmrg# Add configure option to enable strict compilation
180835d5702bSmrgAC_DEFUN([XORG_STRICT_OPTION], [
180935d5702bSmrgAC_REQUIRE([AC_PROG_CC])
181035d5702bSmrgAC_REQUIRE([AC_PROG_CC_C99])
181135d5702bSmrgAC_REQUIRE([XORG_CWARNFLAGS])
181235d5702bSmrg
181335d5702bSmrgAC_ARG_ENABLE(strict-compilation,
181435d5702bSmrg			  AS_HELP_STRING([--enable-strict-compilation],
181535d5702bSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
181635d5702bSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
181735d5702bSmrgif test "x$STRICT_COMPILE" = "xyes"; then
181835d5702bSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
181935d5702bSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
182035d5702bSmrg	if test "x$GCC" = xyes ; then
182135d5702bSmrg		STRICT_CFLAGS="-pedantic -Werror"
182235d5702bSmrg	elif test "x$SUNCC" = "xyes"; then
182335d5702bSmrg		STRICT_CFLAGS="-errwarn"
182435d5702bSmrg    elif test "x$INTELCC" = "xyes"; then
182535d5702bSmrg		STRICT_CFLAGS="-Werror"
182635d5702bSmrg	fi
182735d5702bSmrgfi
182835d5702bSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
182935d5702bSmrgAC_SUBST([CWARNFLAGS])
183035d5702bSmrg]) # XORG_STRICT_OPTION
183135d5702bSmrg
183235d5702bSmrg# XORG_DEFAULT_OPTIONS
183335d5702bSmrg# --------------------
183435d5702bSmrg# Minimum version: 1.3.0
183535d5702bSmrg#
183635d5702bSmrg# Defines default options for X.Org modules.
183735d5702bSmrg#
183835d5702bSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
183935d5702bSmrgXORG_CWARNFLAGS
184035d5702bSmrgXORG_STRICT_OPTION
184135d5702bSmrgXORG_RELEASE_VERSION
184235d5702bSmrgXORG_CHANGELOG
184335d5702bSmrgXORG_MANPAGE_SECTIONS
184435d5702bSmrg]) # XORG_DEFAULT_OPTIONS
1845a6fdc6faSmrgdnl Copyright 2005 Red Hat, Inc
1846a6fdc6faSmrgdnl
1847a6fdc6faSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1848a6fdc6faSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1849a6fdc6faSmrgdnl the above copyright notice appear in all copies and that both that
1850a6fdc6faSmrgdnl copyright notice and this permission notice appear in supporting
1851a6fdc6faSmrgdnl documentation.
1852a6fdc6faSmrgdnl
1853a6fdc6faSmrgdnl The above copyright notice and this permission notice shall be included
1854a6fdc6faSmrgdnl in all copies or substantial portions of the Software.
1855a6fdc6faSmrgdnl
1856a6fdc6faSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1857a6fdc6faSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1858a6fdc6faSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1859a6fdc6faSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1860a6fdc6faSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1861a6fdc6faSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1862a6fdc6faSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1863a6fdc6faSmrgdnl
1864a6fdc6faSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1865a6fdc6faSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1866a6fdc6faSmrgdnl other dealings in this Software without prior written authorization
1867a6fdc6faSmrgdnl from the copyright holders.
1868a6fdc6faSmrgdnl
1869a6fdc6faSmrg
1870a6fdc6faSmrg# XORG_RELEASE_VERSION
1871a6fdc6faSmrg# --------------------
1872a6fdc6faSmrg# Adds --with/without-release-string and changes the PACKAGE and
1873a6fdc6faSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
187435d5702bSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
187535d5702bSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1876a6fdc6faSmrg 
1877a6fdc6faSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1878a6fdc6faSmrg	AC_ARG_WITH(release-version,
187935d5702bSmrg			AS_HELP_STRING([--with-release-version=STRING],
1880a6fdc6faSmrg				[Use release version string in package name]),
1881a6fdc6faSmrg			[RELEASE_VERSION="$withval"],
1882a6fdc6faSmrg			[RELEASE_VERSION=""])
1883a6fdc6faSmrg	if test "x$RELEASE_VERSION" != "x"; then
1884a6fdc6faSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
1885a6fdc6faSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1886a6fdc6faSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1887a6fdc6faSmrg	fi
188835d5702bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
188935d5702bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
189035d5702bSmrg		[Major version of this package])
189135d5702bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
189235d5702bSmrg	if test "x$PVM" = "x"; then
189335d5702bSmrg		PVM="0"
189435d5702bSmrg	fi
189535d5702bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
189635d5702bSmrg		[$PVM],
189735d5702bSmrg		[Minor version of this package])
189835d5702bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
189935d5702bSmrg	if test "x$PVP" = "x"; then
190035d5702bSmrg		PVP="0"
190135d5702bSmrg	fi
190235d5702bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
190335d5702bSmrg		[$PVP],
190435d5702bSmrg		[Patch version of this package])
1905a6fdc6faSmrg])
1906a6fdc6faSmrg
190735d5702bSmrg# XORG_CHANGELOG()
190835d5702bSmrg# ----------------
190935d5702bSmrg# Minimum version: 1.2.0
191035d5702bSmrg#
191135d5702bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
191235d5702bSmrg# ChangeLog from git.
191335d5702bSmrg#
191435d5702bSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
191535d5702bSmrg#
191635d5702bSmrgAC_DEFUN([XORG_CHANGELOG], [
191735d5702bSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
191835d5702bSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
191935d5702bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
192035d5702bSmrgAC_SUBST([CHANGELOG_CMD])
192135d5702bSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
192235d5702bSmrg]) # XORG_CHANGELOG
192335d5702bSmrg
192435d5702bSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
192535d5702bSmrg# 
192635d5702bSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
192735d5702bSmrg#
192835d5702bSmrg# This program is free software; you can redistribute it and/or modify
192935d5702bSmrg# it under the terms of the GNU General Public License as published by
193035d5702bSmrg# the Free Software Foundation; either version 2 of the License, or
193135d5702bSmrg# (at your option) any later version.
193235d5702bSmrg#
193335d5702bSmrg# This program is distributed in the hope that it will be useful, but
193435d5702bSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
193535d5702bSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
193635d5702bSmrg# General Public License for more details.
193735d5702bSmrg#
193835d5702bSmrg# You should have received a copy of the GNU General Public License
193935d5702bSmrg# along with this program; if not, write to the Free Software
194035d5702bSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
194135d5702bSmrg#
194235d5702bSmrg# As a special exception to the GNU General Public License, if you
194335d5702bSmrg# distribute this file as part of a program that contains a
194435d5702bSmrg# configuration script generated by Autoconf, you may include it under
194535d5702bSmrg# the same distribution terms that you use for the rest of that program.
194635d5702bSmrg
194735d5702bSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
194835d5702bSmrg# ----------------------------------
194935d5702bSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
195035d5702bSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
195135d5702bSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
195235d5702bSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
195335d5702bSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
195435d5702bSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
195535d5702bSmrgfi
195635d5702bSmrgif test -n "$PKG_CONFIG"; then
195735d5702bSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
195835d5702bSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
195935d5702bSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
196035d5702bSmrg		AC_MSG_RESULT([yes])
196135d5702bSmrg	else
196235d5702bSmrg		AC_MSG_RESULT([no])
196335d5702bSmrg		PKG_CONFIG=""
196435d5702bSmrg	fi
196535d5702bSmrg		
196635d5702bSmrgfi[]dnl
196735d5702bSmrg])# PKG_PROG_PKG_CONFIG
196835d5702bSmrg
196935d5702bSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
197035d5702bSmrg#
197135d5702bSmrg# Check to see whether a particular set of modules exists.  Similar
197235d5702bSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
197335d5702bSmrg#
197435d5702bSmrg#
197535d5702bSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
197635d5702bSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
197735d5702bSmrg# PKG_CHECK_EXISTS manually
197835d5702bSmrg# --------------------------------------------------------------
197935d5702bSmrgAC_DEFUN([PKG_CHECK_EXISTS],
198035d5702bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
198135d5702bSmrgif test -n "$PKG_CONFIG" && \
198235d5702bSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
198335d5702bSmrg  m4_ifval([$2], [$2], [:])
198435d5702bSmrgm4_ifvaln([$3], [else
198535d5702bSmrg  $3])dnl
198635d5702bSmrgfi])
198735d5702bSmrg
198835d5702bSmrg
198935d5702bSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
199035d5702bSmrg# ---------------------------------------------
199135d5702bSmrgm4_define([_PKG_CONFIG],
199235d5702bSmrg[if test -n "$$1"; then
199335d5702bSmrg    pkg_cv_[]$1="$$1"
199435d5702bSmrg elif test -n "$PKG_CONFIG"; then
199535d5702bSmrg    PKG_CHECK_EXISTS([$3],
199635d5702bSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
199735d5702bSmrg		     [pkg_failed=yes])
199835d5702bSmrg else
199935d5702bSmrg    pkg_failed=untried
200035d5702bSmrgfi[]dnl
200135d5702bSmrg])# _PKG_CONFIG
200235d5702bSmrg
200335d5702bSmrg# _PKG_SHORT_ERRORS_SUPPORTED
200435d5702bSmrg# -----------------------------
200535d5702bSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
200635d5702bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
200735d5702bSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
200835d5702bSmrg        _pkg_short_errors_supported=yes
200935d5702bSmrgelse
201035d5702bSmrg        _pkg_short_errors_supported=no
201135d5702bSmrgfi[]dnl
201235d5702bSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
201335d5702bSmrg
201435d5702bSmrg
201535d5702bSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
201635d5702bSmrg# [ACTION-IF-NOT-FOUND])
201735d5702bSmrg#
201835d5702bSmrg#
201935d5702bSmrg# Note that if there is a possibility the first call to
202035d5702bSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
202135d5702bSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
202235d5702bSmrg#
202335d5702bSmrg#
202435d5702bSmrg# --------------------------------------------------------------
202535d5702bSmrgAC_DEFUN([PKG_CHECK_MODULES],
202635d5702bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
202735d5702bSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
202835d5702bSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
202935d5702bSmrg
203035d5702bSmrgpkg_failed=no
203135d5702bSmrgAC_MSG_CHECKING([for $1])
203235d5702bSmrg
203335d5702bSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
203435d5702bSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
203535d5702bSmrg
203635d5702bSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
203735d5702bSmrgand $1[]_LIBS to avoid the need to call pkg-config.
203835d5702bSmrgSee the pkg-config man page for more details.])
203935d5702bSmrg
204035d5702bSmrgif test $pkg_failed = yes; then
204135d5702bSmrg        _PKG_SHORT_ERRORS_SUPPORTED
204235d5702bSmrg        if test $_pkg_short_errors_supported = yes; then
204335d5702bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
204435d5702bSmrg        else 
204535d5702bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
204635d5702bSmrg        fi
204735d5702bSmrg	# Put the nasty error message in config.log where it belongs
204835d5702bSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
204935d5702bSmrg
205035d5702bSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
205135d5702bSmrg[Package requirements ($2) were not met:
205235d5702bSmrg
205335d5702bSmrg$$1_PKG_ERRORS
205435d5702bSmrg
205535d5702bSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
205635d5702bSmrginstalled software in a non-standard prefix.
205735d5702bSmrg
205835d5702bSmrg_PKG_TEXT
205935d5702bSmrg])],
206035d5702bSmrg		[AC_MSG_RESULT([no])
206135d5702bSmrg                $4])
206235d5702bSmrgelif test $pkg_failed = untried; then
206335d5702bSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
206435d5702bSmrg[The pkg-config script could not be found or is too old.  Make sure it
206535d5702bSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
206635d5702bSmrgpath to pkg-config.
206735d5702bSmrg
206835d5702bSmrg_PKG_TEXT
206935d5702bSmrg
207035d5702bSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
207135d5702bSmrg		[$4])
207235d5702bSmrgelse
207335d5702bSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
207435d5702bSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
207535d5702bSmrg        AC_MSG_RESULT([yes])
207635d5702bSmrg	ifelse([$3], , :, [$3])
207735d5702bSmrgfi[]dnl
207835d5702bSmrg])# PKG_CHECK_MODULES
207935d5702bSmrg
2080