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