aclocal.m4 revision b66d1acb
1b66d1acbSmrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
24fb28925Smrg
3b66d1acbSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4b66d1acbSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
54fb28925Smrg# This file is free software; the Free Software Foundation
64fb28925Smrg# gives unlimited permission to copy and/or distribute it,
74fb28925Smrg# with or without modifications, as long as this notice is preserved.
84fb28925Smrg
94fb28925Smrg# This program is distributed in the hope that it will be useful,
104fb28925Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
114fb28925Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
124fb28925Smrg# PARTICULAR PURPOSE.
134fb28925Smrg
14b66d1acbSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15b66d1acbSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16b66d1acbSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17b66d1acbSmrg[m4_warning([this file was generated for autoconf 2.63.
18b66d1acbSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19b66d1acbSmrgIf you have problems, you may need to regenerate the build system entirely.
20b66d1acbSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
214fb28925Smrg
22b66d1acbSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23b66d1acbSmrg#
24b66d1acbSmrg# This file is free software; the Free Software Foundation
25b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
26b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
274fb28925Smrg
284fb28925Smrg# AM_AUTOMAKE_VERSION(VERSION)
294fb28925Smrg# ----------------------------
304fb28925Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
314fb28925Smrg# generated from the m4 files accompanying Automake X.Y.
32b66d1acbSmrg# (This private macro should not be called outside this file.)
33b66d1acbSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
34b66d1acbSmrg[am__api_version='1.11'
35b66d1acbSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36b66d1acbSmrgdnl require some minimum version.  Point them to the right macro.
37b66d1acbSmrgm4_if([$1], [1.11], [],
38b66d1acbSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39b66d1acbSmrg])
40b66d1acbSmrg
41b66d1acbSmrg# _AM_AUTOCONF_VERSION(VERSION)
42b66d1acbSmrg# -----------------------------
43b66d1acbSmrg# aclocal traces this macro to find the Autoconf version.
44b66d1acbSmrg# This is a private macro too.  Using m4_define simplifies
45b66d1acbSmrg# the logic in aclocal, which can simply ignore this definition.
46b66d1acbSmrgm4_define([_AM_AUTOCONF_VERSION], [])
474fb28925Smrg
484fb28925Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
494fb28925Smrg# -------------------------------
50b66d1acbSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51b66d1acbSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
524fb28925SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53b66d1acbSmrg[AM_AUTOMAKE_VERSION([1.11])dnl
54b66d1acbSmrgm4_ifndef([AC_AUTOCONF_VERSION],
55b66d1acbSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56b66d1acbSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
574fb28925Smrg
58b66d1acbSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
594fb28925Smrg
60b66d1acbSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
614fb28925Smrg#
62b66d1acbSmrg# This file is free software; the Free Software Foundation
63b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
64b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
654fb28925Smrg
664fb28925Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
674fb28925Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
684fb28925Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
694fb28925Smrg#
704fb28925Smrg# Of course, Automake must honor this variable whenever it calls a
714fb28925Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
724fb28925Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
734fb28925Smrg# depending on how configure is run.  This is pretty annoying, since
744fb28925Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
754fb28925Smrg# source directory, any form will work fine, but in subdirectories a
764fb28925Smrg# relative path needs to be adjusted first.
774fb28925Smrg#
784fb28925Smrg# $ac_aux_dir/missing
794fb28925Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
804fb28925Smrg# $top_srcdir/$ac_aux_dir/missing
814fb28925Smrg#    fails if $ac_aux_dir is absolute,
824fb28925Smrg#    fails when called from a subdirectory in a VPATH build with
834fb28925Smrg#          a relative $ac_aux_dir
844fb28925Smrg#
854fb28925Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
864fb28925Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
874fb28925Smrg# harmless because $srcdir is `.', but things will broke when you
884fb28925Smrg# start a VPATH build or use an absolute $srcdir.
894fb28925Smrg#
904fb28925Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
914fb28925Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
924fb28925Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
934fb28925Smrg# and then we would define $MISSING as
944fb28925Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
954fb28925Smrg# This will work as long as MISSING is not called from configure, because
964fb28925Smrg# unfortunately $(top_srcdir) has no meaning in configure.
974fb28925Smrg# However there are other variables, like CC, which are often used in
984fb28925Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
994fb28925Smrg#
1004fb28925Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
1014fb28925Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
1024fb28925Smrg# configured tree to be moved without reconfiguration.
1034fb28925Smrg
104b66d1acbSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
105b66d1acbSmrg[dnl Rely on autoconf to set up CDPATH properly.
106b66d1acbSmrgAC_PREREQ([2.50])dnl
1074fb28925Smrg# expand $ac_aux_dir to an absolute path
1084fb28925Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
1094fb28925Smrg])
1104fb28925Smrg
111b66d1acbSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1124fb28925Smrg
113b66d1acbSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
114b66d1acbSmrg# Free Software Foundation, Inc.
115b66d1acbSmrg#
116b66d1acbSmrg# This file is free software; the Free Software Foundation
117b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
118b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
1194fb28925Smrg
120b66d1acbSmrg# serial 9
1214fb28925Smrg
122b66d1acbSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
123b66d1acbSmrg# -------------------------------------
124b66d1acbSmrg# Define a conditional.
125b66d1acbSmrgAC_DEFUN([AM_CONDITIONAL],
126b66d1acbSmrg[AC_PREREQ(2.52)dnl
127b66d1acbSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
128b66d1acbSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
129b66d1acbSmrgAC_SUBST([$1_TRUE])dnl
130b66d1acbSmrgAC_SUBST([$1_FALSE])dnl
131b66d1acbSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
132b66d1acbSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
133b66d1acbSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
134b66d1acbSmrgif $2; then
135b66d1acbSmrg  $1_TRUE=
136b66d1acbSmrg  $1_FALSE='#'
1374fb28925Smrgelse
138b66d1acbSmrg  $1_TRUE='#'
139b66d1acbSmrg  $1_FALSE=
1404fb28925Smrgfi
141b66d1acbSmrgAC_CONFIG_COMMANDS_PRE(
142b66d1acbSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
143b66d1acbSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
144b66d1acbSmrgUsually this means the macro was only invoked conditionally.]])
145b66d1acbSmrgfi])])
1464fb28925Smrg
147b66d1acbSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
148b66d1acbSmrg# Free Software Foundation, Inc.
149b66d1acbSmrg#
150b66d1acbSmrg# This file is free software; the Free Software Foundation
151b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
152b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
1534fb28925Smrg
154b66d1acbSmrg# serial 10
1554fb28925Smrg
1564fb28925Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1574fb28925Smrg# written in clear, in which case automake, when reading aclocal.m4,
1584fb28925Smrg# will think it sees a *use*, and therefore will trigger all it's
1594fb28925Smrg# C support machinery.  Also note that it means that autoscan, seeing
1604fb28925Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1614fb28925Smrg
1624fb28925Smrg
1634fb28925Smrg# _AM_DEPENDENCIES(NAME)
1644fb28925Smrg# ----------------------
1654fb28925Smrg# See how the compiler implements dependency checking.
1664fb28925Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1674fb28925Smrg# We try a few techniques and use that to set a single cache variable.
1684fb28925Smrg#
1694fb28925Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1704fb28925Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1714fb28925Smrg# dependency, and given that the user is not expected to run this macro,
1724fb28925Smrg# just rely on AC_PROG_CC.
1734fb28925SmrgAC_DEFUN([_AM_DEPENDENCIES],
1744fb28925Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1754fb28925SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1764fb28925SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1774fb28925SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1784fb28925Smrg
1794fb28925Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1804fb28925Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1814fb28925Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
182b66d1acbSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1834fb28925Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1844fb28925Smrg                   [depcc="$$1"   am_compiler_list=])
1854fb28925Smrg
1864fb28925SmrgAC_CACHE_CHECK([dependency style of $depcc],
1874fb28925Smrg               [am_cv_$1_dependencies_compiler_type],
1884fb28925Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1894fb28925Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1904fb28925Smrg  # making bogus files that we don't know about and never remove.  For
1914fb28925Smrg  # instance it was reported that on HP-UX the gcc test will end up
1924fb28925Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
1934fb28925Smrg  # in D'.
1944fb28925Smrg  mkdir conftest.dir
1954fb28925Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1964fb28925Smrg  # using a relative directory.
1974fb28925Smrg  cp "$am_depcomp" conftest.dir
1984fb28925Smrg  cd conftest.dir
1994fb28925Smrg  # We will build objects and dependencies in a subdirectory because
2004fb28925Smrg  # it helps to detect inapplicable dependency modes.  For instance
2014fb28925Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2024fb28925Smrg  # side effect of compilation, but ICC will put the dependencies in
2034fb28925Smrg  # the current directory while Tru64 will put them in the object
2044fb28925Smrg  # directory.
2054fb28925Smrg  mkdir sub
2064fb28925Smrg
2074fb28925Smrg  am_cv_$1_dependencies_compiler_type=none
2084fb28925Smrg  if test "$am_compiler_list" = ""; then
2094fb28925Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2104fb28925Smrg  fi
211b66d1acbSmrg  am__universal=false
212b66d1acbSmrg  m4_case([$1], [CC],
213b66d1acbSmrg    [case " $depcc " in #(
214b66d1acbSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
215b66d1acbSmrg     esac],
216b66d1acbSmrg    [CXX],
217b66d1acbSmrg    [case " $depcc " in #(
218b66d1acbSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
219b66d1acbSmrg     esac])
220b66d1acbSmrg
2214fb28925Smrg  for depmode in $am_compiler_list; do
2224fb28925Smrg    # Setup a source with many dependencies, because some compilers
2234fb28925Smrg    # like to wrap large dependency lists on column 80 (with \), and
2244fb28925Smrg    # we should not choose a depcomp mode which is confused by this.
2254fb28925Smrg    #
2264fb28925Smrg    # We need to recreate these files for each test, as the compiler may
2274fb28925Smrg    # overwrite some of them when testing with obscure command lines.
2284fb28925Smrg    # This happens at least with the AIX C compiler.
2294fb28925Smrg    : > sub/conftest.c
2304fb28925Smrg    for i in 1 2 3 4 5 6; do
2314fb28925Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
232b66d1acbSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
233b66d1acbSmrg      # Solaris 8's {/usr,}/bin/sh.
234b66d1acbSmrg      touch sub/conftst$i.h
2354fb28925Smrg    done
2364fb28925Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2374fb28925Smrg
238b66d1acbSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
239b66d1acbSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
240b66d1acbSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
241b66d1acbSmrg    # versions had trouble with output in subdirs
242b66d1acbSmrg    am__obj=sub/conftest.${OBJEXT-o}
243b66d1acbSmrg    am__minus_obj="-o $am__obj"
2444fb28925Smrg    case $depmode in
245b66d1acbSmrg    gcc)
246b66d1acbSmrg      # This depmode causes a compiler race in universal mode.
247b66d1acbSmrg      test "$am__universal" = false || continue
248b66d1acbSmrg      ;;
2494fb28925Smrg    nosideeffect)
2504fb28925Smrg      # after this tag, mechanisms are not by side-effect, so they'll
2514fb28925Smrg      # only be used when explicitly requested
2524fb28925Smrg      if test "x$enable_dependency_tracking" = xyes; then
2534fb28925Smrg	continue
2544fb28925Smrg      else
2554fb28925Smrg	break
2564fb28925Smrg      fi
2574fb28925Smrg      ;;
258b66d1acbSmrg    msvisualcpp | msvcmsys)
259b66d1acbSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
260b66d1acbSmrg      # not run yet.  These depmodes are late enough in the game, and
261b66d1acbSmrg      # so weak that their functioning should not be impacted.
262b66d1acbSmrg      am__obj=conftest.${OBJEXT-o}
263b66d1acbSmrg      am__minus_obj=
264b66d1acbSmrg      ;;
2654fb28925Smrg    none) break ;;
2664fb28925Smrg    esac
2674fb28925Smrg    if depmode=$depmode \
268b66d1acbSmrg       source=sub/conftest.c object=$am__obj \
2694fb28925Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
270b66d1acbSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2714fb28925Smrg         >/dev/null 2>conftest.err &&
272b66d1acbSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2734fb28925Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
274b66d1acbSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2754fb28925Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2764fb28925Smrg      # icc doesn't choke on unknown options, it will just issue warnings
277b66d1acbSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
278b66d1acbSmrg      # that says an option was ignored or not supported.
279b66d1acbSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
280b66d1acbSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
281b66d1acbSmrg      # The diagnosis changed in icc 8.0:
282b66d1acbSmrg      #   icc: Command line remark: option '-MP' not supported
283b66d1acbSmrg      if (grep 'ignoring option' conftest.err ||
284b66d1acbSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2854fb28925Smrg        am_cv_$1_dependencies_compiler_type=$depmode
2864fb28925Smrg        break
2874fb28925Smrg      fi
2884fb28925Smrg    fi
2894fb28925Smrg  done
2904fb28925Smrg
2914fb28925Smrg  cd ..
2924fb28925Smrg  rm -rf conftest.dir
2934fb28925Smrgelse
2944fb28925Smrg  am_cv_$1_dependencies_compiler_type=none
2954fb28925Smrgfi
2964fb28925Smrg])
2974fb28925SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2984fb28925SmrgAM_CONDITIONAL([am__fastdep$1], [
2994fb28925Smrg  test "x$enable_dependency_tracking" != xno \
3004fb28925Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3014fb28925Smrg])
3024fb28925Smrg
3034fb28925Smrg
3044fb28925Smrg# AM_SET_DEPDIR
3054fb28925Smrg# -------------
3064fb28925Smrg# Choose a directory name for dependency files.
3074fb28925Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3084fb28925SmrgAC_DEFUN([AM_SET_DEPDIR],
3094fb28925Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3104fb28925SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3114fb28925Smrg])
3124fb28925Smrg
3134fb28925Smrg
3144fb28925Smrg# AM_DEP_TRACK
3154fb28925Smrg# ------------
3164fb28925SmrgAC_DEFUN([AM_DEP_TRACK],
3174fb28925Smrg[AC_ARG_ENABLE(dependency-tracking,
318b66d1acbSmrg[  --disable-dependency-tracking  speeds up one-time build
319b66d1acbSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3204fb28925Smrgif test "x$enable_dependency_tracking" != xno; then
3214fb28925Smrg  am_depcomp="$ac_aux_dir/depcomp"
3224fb28925Smrg  AMDEPBACKSLASH='\'
3234fb28925Smrgfi
3244fb28925SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
325b66d1acbSmrgAC_SUBST([AMDEPBACKSLASH])dnl
326b66d1acbSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3274fb28925Smrg])
3284fb28925Smrg
329b66d1acbSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3304fb28925Smrg
331b66d1acbSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
332b66d1acbSmrg# Free Software Foundation, Inc.
333b66d1acbSmrg#
334b66d1acbSmrg# This file is free software; the Free Software Foundation
335b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
336b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
3374fb28925Smrg
338b66d1acbSmrg#serial 5
3394fb28925Smrg
3404fb28925Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3414fb28925Smrg# ------------------------------
3424fb28925SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
343b66d1acbSmrg[{
344b66d1acbSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
345b66d1acbSmrg  # are listed without --file.  Let's play safe and only enable the eval
346b66d1acbSmrg  # if we detect the quoting.
347b66d1acbSmrg  case $CONFIG_FILES in
348b66d1acbSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
349b66d1acbSmrg  *)   set x $CONFIG_FILES ;;
350b66d1acbSmrg  esac
351b66d1acbSmrg  shift
352b66d1acbSmrg  for mf
353b66d1acbSmrg  do
354b66d1acbSmrg    # Strip MF so we end up with the name of the file.
355b66d1acbSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
356b66d1acbSmrg    # Check whether this is an Automake generated Makefile or not.
357b66d1acbSmrg    # We used to match only the files named `Makefile.in', but
358b66d1acbSmrg    # some people rename them; so instead we look at the file content.
359b66d1acbSmrg    # Grep'ing the first line is not enough: some people post-process
360b66d1acbSmrg    # each Makefile.in and add a new line on top of each file to say so.
361b66d1acbSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
362b66d1acbSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
363b66d1acbSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
364b66d1acbSmrg      dirpart=`AS_DIRNAME("$mf")`
365b66d1acbSmrg    else
366b66d1acbSmrg      continue
367b66d1acbSmrg    fi
368b66d1acbSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
369b66d1acbSmrg    # from the Makefile without running `make'.
370b66d1acbSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
371b66d1acbSmrg    test -z "$DEPDIR" && continue
372b66d1acbSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
373b66d1acbSmrg    test -z "am__include" && continue
374b66d1acbSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
375b66d1acbSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
376b66d1acbSmrg    U=`sed -n 's/^U = //p' < "$mf"`
377b66d1acbSmrg    # Find all dependency output files, they are included files with
378b66d1acbSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
379b66d1acbSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
380b66d1acbSmrg    # expansion.
381b66d1acbSmrg    for file in `sed -n "
382b66d1acbSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
383b66d1acbSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
384b66d1acbSmrg      # Make sure the directory exists.
385b66d1acbSmrg      test -f "$dirpart/$file" && continue
386b66d1acbSmrg      fdir=`AS_DIRNAME(["$file"])`
387b66d1acbSmrg      AS_MKDIR_P([$dirpart/$fdir])
388b66d1acbSmrg      # echo "creating $dirpart/$file"
389b66d1acbSmrg      echo '# dummy' > "$dirpart/$file"
390b66d1acbSmrg    done
3914fb28925Smrg  done
392b66d1acbSmrg}
3934fb28925Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3944fb28925Smrg
3954fb28925Smrg
3964fb28925Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3974fb28925Smrg# -----------------------------
3984fb28925Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
3994fb28925Smrg#
4004fb28925Smrg# This code is only required when automatic dependency tracking
4014fb28925Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
4024fb28925Smrg# need in order to bootstrap the dependency handling code.
4034fb28925SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4044fb28925Smrg[AC_CONFIG_COMMANDS([depfiles],
4054fb28925Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4064fb28925Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4074fb28925Smrg])
4084fb28925Smrg
409b66d1acbSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
410b66d1acbSmrg# Free Software Foundation, Inc.
411b66d1acbSmrg#
412b66d1acbSmrg# This file is free software; the Free Software Foundation
413b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
414b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
4154fb28925Smrg
416b66d1acbSmrg# serial 8
4174fb28925Smrg
418b66d1acbSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
419b66d1acbSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
4204fb28925Smrg
421b66d1acbSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4224fb28925Smrg
423b66d1acbSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
424b66d1acbSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
425b66d1acbSmrg#
426b66d1acbSmrg# This file is free software; the Free Software Foundation
427b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
428b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
4294fb28925Smrg
430b66d1acbSmrg# serial 16
4314fb28925Smrg
432b66d1acbSmrg# This macro actually does too much.  Some checks are only needed if
433b66d1acbSmrg# your package does certain things.  But this isn't really a big deal.
434b66d1acbSmrg
435b66d1acbSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
436b66d1acbSmrg# AM_INIT_AUTOMAKE([OPTIONS])
437b66d1acbSmrg# -----------------------------------------------
438b66d1acbSmrg# The call with PACKAGE and VERSION arguments is the old style
439b66d1acbSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
440b66d1acbSmrg# and VERSION should now be passed to AC_INIT and removed from
441b66d1acbSmrg# the call to AM_INIT_AUTOMAKE.
442b66d1acbSmrg# We support both call styles for the transition.  After
443b66d1acbSmrg# the next Automake release, Autoconf can make the AC_INIT
444b66d1acbSmrg# arguments mandatory, and then we can depend on a new Autoconf
445b66d1acbSmrg# release and drop the old call support.
446b66d1acbSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
447b66d1acbSmrg[AC_PREREQ([2.62])dnl
448b66d1acbSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
449b66d1acbSmrgdnl the ones we care about.
450b66d1acbSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
451b66d1acbSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
452b66d1acbSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
453b66d1acbSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
454b66d1acbSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
455b66d1acbSmrg  # is not polluted with repeated "-I."
456b66d1acbSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
457b66d1acbSmrg  # test to see if srcdir already configured
458b66d1acbSmrg  if test -f $srcdir/config.status; then
459b66d1acbSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
460b66d1acbSmrg  fi
4614fb28925Smrgfi
462b66d1acbSmrg
463b66d1acbSmrg# test whether we have cygpath
464b66d1acbSmrgif test -z "$CYGPATH_W"; then
465b66d1acbSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
466b66d1acbSmrg    CYGPATH_W='cygpath -w'
467b66d1acbSmrg  else
468b66d1acbSmrg    CYGPATH_W=echo
469b66d1acbSmrg  fi
4704fb28925Smrgfi
471b66d1acbSmrgAC_SUBST([CYGPATH_W])
4724fb28925Smrg
473b66d1acbSmrg# Define the identity of the package.
474b66d1acbSmrgdnl Distinguish between old-style and new-style calls.
475b66d1acbSmrgm4_ifval([$2],
476b66d1acbSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
477b66d1acbSmrg AC_SUBST([PACKAGE], [$1])dnl
478b66d1acbSmrg AC_SUBST([VERSION], [$2])],
479b66d1acbSmrg[_AM_SET_OPTIONS([$1])dnl
480b66d1acbSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
481b66d1acbSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
482b66d1acbSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
483b66d1acbSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
484b66d1acbSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4854fb28925Smrg
486b66d1acbSmrg_AM_IF_OPTION([no-define],,
487b66d1acbSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
488b66d1acbSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4894fb28925Smrg
490b66d1acbSmrg# Some tools Automake needs.
491b66d1acbSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
492b66d1acbSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
493b66d1acbSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
494b66d1acbSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
495b66d1acbSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
496b66d1acbSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
497b66d1acbSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
498b66d1acbSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
499b66d1acbSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
500b66d1acbSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
501b66d1acbSmrg# We need awk for the "check" target.  The system "awk" is bad on
502b66d1acbSmrg# some platforms.
503b66d1acbSmrgAC_REQUIRE([AC_PROG_AWK])dnl
504b66d1acbSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
505b66d1acbSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
506b66d1acbSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
507b66d1acbSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
508b66d1acbSmrg			     [_AM_PROG_TAR([v7])])])
509b66d1acbSmrg_AM_IF_OPTION([no-dependencies],,
510b66d1acbSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
511b66d1acbSmrg		  [_AM_DEPENDENCIES(CC)],
512b66d1acbSmrg		  [define([AC_PROG_CC],
513b66d1acbSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
514b66d1acbSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
515b66d1acbSmrg		  [_AM_DEPENDENCIES(CXX)],
516b66d1acbSmrg		  [define([AC_PROG_CXX],
517b66d1acbSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
518b66d1acbSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
519b66d1acbSmrg		  [_AM_DEPENDENCIES(OBJC)],
520b66d1acbSmrg		  [define([AC_PROG_OBJC],
521b66d1acbSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
522b66d1acbSmrg])
523b66d1acbSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
524b66d1acbSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
525b66d1acbSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
526b66d1acbSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
527b66d1acbSmrgAC_CONFIG_COMMANDS_PRE(dnl
528b66d1acbSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
529b66d1acbSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
530b66d1acbSmrg])
5314fb28925Smrg
532b66d1acbSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
533b66d1acbSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
534b66d1acbSmrgdnl mangled by Autoconf and run in a shell conditional statement.
535b66d1acbSmrgm4_define([_AC_COMPILER_EXEEXT],
536b66d1acbSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5374fb28925Smrg
5384fb28925Smrg
539b66d1acbSmrg# When config.status generates a header, we must update the stamp-h file.
540b66d1acbSmrg# This file resides in the same directory as the config header
541b66d1acbSmrg# that is generated.  The stamp files are numbered to have different names.
542b66d1acbSmrg
543b66d1acbSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
544b66d1acbSmrg# loop where config.status creates the headers, so we can generate
545b66d1acbSmrg# our stamp files there.
546b66d1acbSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
547b66d1acbSmrg[# Compute $1's index in $config_headers.
548b66d1acbSmrg_am_arg=$1
549b66d1acbSmrg_am_stamp_count=1
550b66d1acbSmrgfor _am_header in $config_headers :; do
551b66d1acbSmrg  case $_am_header in
552b66d1acbSmrg    $_am_arg | $_am_arg:* )
553b66d1acbSmrg      break ;;
554b66d1acbSmrg    * )
555b66d1acbSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
556b66d1acbSmrg  esac
557b66d1acbSmrgdone
558b66d1acbSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
5594fb28925Smrg
560b66d1acbSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
561b66d1acbSmrg#
562b66d1acbSmrg# This file is free software; the Free Software Foundation
563b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
564b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
5654fb28925Smrg
566b66d1acbSmrg# AM_PROG_INSTALL_SH
567b66d1acbSmrg# ------------------
568b66d1acbSmrg# Define $install_sh.
569b66d1acbSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
570b66d1acbSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
571b66d1acbSmrgif test x"${install_sh}" != xset; then
572b66d1acbSmrg  case $am_aux_dir in
573b66d1acbSmrg  *\ * | *\	*)
574b66d1acbSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
575b66d1acbSmrg  *)
576b66d1acbSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
577b66d1acbSmrg  esac
5784fb28925Smrgfi
579b66d1acbSmrgAC_SUBST(install_sh)])
5804fb28925Smrg
581b66d1acbSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
582b66d1acbSmrg#
583b66d1acbSmrg# This file is free software; the Free Software Foundation
584b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
585b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
5864fb28925Smrg
587b66d1acbSmrg# serial 2
5884fb28925Smrg
589b66d1acbSmrg# Check whether the underlying file-system supports filenames
590b66d1acbSmrg# with a leading dot.  For instance MS-DOS doesn't.
591b66d1acbSmrgAC_DEFUN([AM_SET_LEADING_DOT],
592b66d1acbSmrg[rm -rf .tst 2>/dev/null
593b66d1acbSmrgmkdir .tst 2>/dev/null
594b66d1acbSmrgif test -d .tst; then
595b66d1acbSmrg  am__leading_dot=.
596b66d1acbSmrgelse
597b66d1acbSmrg  am__leading_dot=_
598b66d1acbSmrgfi
599b66d1acbSmrgrmdir .tst 2>/dev/null
600b66d1acbSmrgAC_SUBST([am__leading_dot])])
6014fb28925Smrg
602b66d1acbSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
603b66d1acbSmrg# From Jim Meyering
6044fb28925Smrg
605b66d1acbSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
606b66d1acbSmrg# Free Software Foundation, Inc.
607b66d1acbSmrg#
608b66d1acbSmrg# This file is free software; the Free Software Foundation
609b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
610b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
6114fb28925Smrg
612b66d1acbSmrg# serial 5
6134fb28925Smrg
614b66d1acbSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
615b66d1acbSmrg# ----------------------------------
616b66d1acbSmrg# Control maintainer-specific portions of Makefiles.
617b66d1acbSmrg# Default is to disable them, unless `enable' is passed literally.
618b66d1acbSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
619b66d1acbSmrg# can override the default with the --enable/--disable switch.
6204fb28925SmrgAC_DEFUN([AM_MAINTAINER_MODE],
621b66d1acbSmrg[m4_case(m4_default([$1], [disable]),
622b66d1acbSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
623b66d1acbSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
624b66d1acbSmrg       [m4_define([am_maintainer_other], [enable])
625b66d1acbSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
626b66d1acbSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
627b66d1acbSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
628b66d1acbSmrg  AC_ARG_ENABLE([maintainer-mode],
629b66d1acbSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
630b66d1acbSmrg			  (and sometimes confusing) to the casual installer],
631b66d1acbSmrg      [USE_MAINTAINER_MODE=$enableval],
632b66d1acbSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
6334fb28925Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
634b66d1acbSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
6354fb28925Smrg  MAINT=$MAINTAINER_MODE_TRUE
636b66d1acbSmrg  AC_SUBST([MAINT])dnl
6374fb28925Smrg]
6384fb28925Smrg)
6394fb28925Smrg
6404fb28925SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
6414fb28925Smrg
642b66d1acbSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
6434fb28925Smrg
644b66d1acbSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
645b66d1acbSmrg#
646b66d1acbSmrg# This file is free software; the Free Software Foundation
647b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
648b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
6494fb28925Smrg
650b66d1acbSmrg# serial 4
6514fb28925Smrg
652b66d1acbSmrg# AM_MAKE_INCLUDE()
653b66d1acbSmrg# -----------------
654b66d1acbSmrg# Check to see how make treats includes.
655b66d1acbSmrgAC_DEFUN([AM_MAKE_INCLUDE],
656b66d1acbSmrg[am_make=${MAKE-make}
657b66d1acbSmrgcat > confinc << 'END'
658b66d1acbSmrgam__doit:
659b66d1acbSmrg	@echo this is the am__doit target
660b66d1acbSmrg.PHONY: am__doit
661b66d1acbSmrgEND
662b66d1acbSmrg# If we don't find an include directive, just comment out the code.
663b66d1acbSmrgAC_MSG_CHECKING([for style of include used by $am_make])
664b66d1acbSmrgam__include="#"
665b66d1acbSmrgam__quote=
666b66d1acbSmrg_am_result=none
667b66d1acbSmrg# First try GNU make style include.
668b66d1acbSmrgecho "include confinc" > confmf
669b66d1acbSmrg# Ignore all kinds of additional output from `make'.
670b66d1acbSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
671b66d1acbSmrg*the\ am__doit\ target*)
672b66d1acbSmrg  am__include=include
673b66d1acbSmrg  am__quote=
674b66d1acbSmrg  _am_result=GNU
675b66d1acbSmrg  ;;
676b66d1acbSmrgesac
677b66d1acbSmrg# Now try BSD make style include.
678b66d1acbSmrgif test "$am__include" = "#"; then
679b66d1acbSmrg   echo '.include "confinc"' > confmf
680b66d1acbSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
681b66d1acbSmrg   *the\ am__doit\ target*)
682b66d1acbSmrg     am__include=.include
683b66d1acbSmrg     am__quote="\""
684b66d1acbSmrg     _am_result=BSD
685b66d1acbSmrg     ;;
686b66d1acbSmrg   esac
687b66d1acbSmrgfi
688b66d1acbSmrgAC_SUBST([am__include])
689b66d1acbSmrgAC_SUBST([am__quote])
690b66d1acbSmrgAC_MSG_RESULT([$_am_result])
691b66d1acbSmrgrm -f confinc confmf
692b66d1acbSmrg])
6934fb28925Smrg
694b66d1acbSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6954fb28925Smrg
696b66d1acbSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
697b66d1acbSmrg# Free Software Foundation, Inc.
698b66d1acbSmrg#
699b66d1acbSmrg# This file is free software; the Free Software Foundation
700b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
701b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
7024fb28925Smrg
7034fb28925Smrg# serial 6
7044fb28925Smrg
705b66d1acbSmrg# AM_MISSING_PROG(NAME, PROGRAM)
706b66d1acbSmrg# ------------------------------
707b66d1acbSmrgAC_DEFUN([AM_MISSING_PROG],
708b66d1acbSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
709b66d1acbSmrg$1=${$1-"${am_missing_run}$2"}
710b66d1acbSmrgAC_SUBST($1)])
7114fb28925Smrg
7124fb28925Smrg
713b66d1acbSmrg# AM_MISSING_HAS_RUN
714b66d1acbSmrg# ------------------
715b66d1acbSmrg# Define MISSING if not defined so far and test if it supports --run.
716b66d1acbSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
717b66d1acbSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
718b66d1acbSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
719b66d1acbSmrgAC_REQUIRE_AUX_FILE([missing])dnl
720b66d1acbSmrgif test x"${MISSING+set}" != xset; then
721b66d1acbSmrg  case $am_aux_dir in
722b66d1acbSmrg  *\ * | *\	*)
723b66d1acbSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
724b66d1acbSmrg  *)
725b66d1acbSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
726b66d1acbSmrg  esac
7274fb28925Smrgfi
728b66d1acbSmrg# Use eval to expand $SHELL
729b66d1acbSmrgif eval "$MISSING --run true"; then
730b66d1acbSmrg  am_missing_run="$MISSING --run "
731b66d1acbSmrgelse
732b66d1acbSmrg  am_missing_run=
733b66d1acbSmrg  AC_MSG_WARN([`missing' script is too old or missing])
734b66d1acbSmrgfi
735b66d1acbSmrg])
7364fb28925Smrg
737b66d1acbSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
7384fb28925Smrg#
739b66d1acbSmrg# This file is free software; the Free Software Foundation
740b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
741b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
742b66d1acbSmrg
743b66d1acbSmrg# AM_PROG_MKDIR_P
744b66d1acbSmrg# ---------------
745b66d1acbSmrg# Check for `mkdir -p'.
746b66d1acbSmrgAC_DEFUN([AM_PROG_MKDIR_P],
747b66d1acbSmrg[AC_PREREQ([2.60])dnl
748b66d1acbSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
749b66d1acbSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
750b66d1acbSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
751b66d1acbSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
752b66d1acbSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
753b66d1acbSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
754b66d1acbSmrgdnl adjustment using top_builddir (which is defined more often than
755b66d1acbSmrgdnl MKDIR_P).
756b66d1acbSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
757b66d1acbSmrgcase $mkdir_p in
758b66d1acbSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
759b66d1acbSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
760b66d1acbSmrgesac
761b66d1acbSmrg])
762b66d1acbSmrg
763b66d1acbSmrg# Helper functions for option handling.                     -*- Autoconf -*-
764b66d1acbSmrg
765b66d1acbSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
7664fb28925Smrg#
767b66d1acbSmrg# This file is free software; the Free Software Foundation
768b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
769b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
7704fb28925Smrg
771b66d1acbSmrg# serial 4
7724fb28925Smrg
773b66d1acbSmrg# _AM_MANGLE_OPTION(NAME)
774b66d1acbSmrg# -----------------------
775b66d1acbSmrgAC_DEFUN([_AM_MANGLE_OPTION],
776b66d1acbSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7774fb28925Smrg
778b66d1acbSmrg# _AM_SET_OPTION(NAME)
779b66d1acbSmrg# ------------------------------
780b66d1acbSmrg# Set option NAME.  Presently that only means defining a flag for this option.
781b66d1acbSmrgAC_DEFUN([_AM_SET_OPTION],
782b66d1acbSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7834fb28925Smrg
784b66d1acbSmrg# _AM_SET_OPTIONS(OPTIONS)
785b66d1acbSmrg# ----------------------------------
786b66d1acbSmrg# OPTIONS is a space-separated list of Automake options.
787b66d1acbSmrgAC_DEFUN([_AM_SET_OPTIONS],
788b66d1acbSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7894fb28925Smrg
790b66d1acbSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
791b66d1acbSmrg# -------------------------------------------
792b66d1acbSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
793b66d1acbSmrgAC_DEFUN([_AM_IF_OPTION],
794b66d1acbSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
795b66d1acbSmrg
796b66d1acbSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
797b66d1acbSmrg
798b66d1acbSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
799b66d1acbSmrg# Free Software Foundation, Inc.
8004fb28925Smrg#
801b66d1acbSmrg# This file is free software; the Free Software Foundation
802b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
803b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
804b66d1acbSmrg
805b66d1acbSmrg# serial 5
806b66d1acbSmrg
807b66d1acbSmrg# AM_SANITY_CHECK
808b66d1acbSmrg# ---------------
809b66d1acbSmrgAC_DEFUN([AM_SANITY_CHECK],
810b66d1acbSmrg[AC_MSG_CHECKING([whether build environment is sane])
811b66d1acbSmrg# Just in case
812b66d1acbSmrgsleep 1
813b66d1acbSmrgecho timestamp > conftest.file
814b66d1acbSmrg# Reject unsafe characters in $srcdir or the absolute working directory
815b66d1acbSmrg# name.  Accept space and tab only in the latter.
816b66d1acbSmrgam_lf='
817b66d1acbSmrg'
818b66d1acbSmrgcase `pwd` in
819b66d1acbSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
820b66d1acbSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
821b66d1acbSmrgesac
822b66d1acbSmrgcase $srcdir in
823b66d1acbSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
824b66d1acbSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
825b66d1acbSmrgesac
826b66d1acbSmrg
827b66d1acbSmrg# Do `set' in a subshell so we don't clobber the current shell's
828b66d1acbSmrg# arguments.  Must try -L first in case configure is actually a
829b66d1acbSmrg# symlink; some systems play weird games with the mod time of symlinks
830b66d1acbSmrg# (eg FreeBSD returns the mod time of the symlink's containing
831b66d1acbSmrg# directory).
832b66d1acbSmrgif (
833b66d1acbSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
834b66d1acbSmrg   if test "$[*]" = "X"; then
835b66d1acbSmrg      # -L didn't work.
836b66d1acbSmrg      set X `ls -t "$srcdir/configure" conftest.file`
837b66d1acbSmrg   fi
838b66d1acbSmrg   rm -f conftest.file
839b66d1acbSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
840b66d1acbSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
841b66d1acbSmrg
842b66d1acbSmrg      # If neither matched, then we have a broken ls.  This can happen
843b66d1acbSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
844b66d1acbSmrg      # broken ls alias from the environment.  This has actually
845b66d1acbSmrg      # happened.  Such a system could not be considered "sane".
846b66d1acbSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
847b66d1acbSmrgalias in your environment])
848b66d1acbSmrg   fi
849b66d1acbSmrg
850b66d1acbSmrg   test "$[2]" = conftest.file
851b66d1acbSmrg   )
852b66d1acbSmrgthen
853b66d1acbSmrg   # Ok.
854b66d1acbSmrg   :
855b66d1acbSmrgelse
856b66d1acbSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
857b66d1acbSmrgCheck your system clock])
858b66d1acbSmrgfi
859b66d1acbSmrgAC_MSG_RESULT(yes)])
860b66d1acbSmrg
861b66d1acbSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
8624fb28925Smrg#
863b66d1acbSmrg# This file is free software; the Free Software Foundation
864b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
865b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
866b66d1acbSmrg
867b66d1acbSmrg# serial 1
868b66d1acbSmrg
869b66d1acbSmrg# AM_SILENT_RULES([DEFAULT])
870b66d1acbSmrg# --------------------------
871b66d1acbSmrg# Enable less verbose build rules; with the default set to DEFAULT
872b66d1acbSmrg# (`yes' being less verbose, `no' or empty being verbose).
873b66d1acbSmrgAC_DEFUN([AM_SILENT_RULES],
874b66d1acbSmrg[AC_ARG_ENABLE([silent-rules],
875b66d1acbSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
876b66d1acbSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
877b66d1acbSmrgcase $enable_silent_rules in
878b66d1acbSmrgyes) AM_DEFAULT_VERBOSITY=0;;
879b66d1acbSmrgno)  AM_DEFAULT_VERBOSITY=1;;
880b66d1acbSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
881b66d1acbSmrgesac
882b66d1acbSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
883b66d1acbSmrgAM_BACKSLASH='\'
884b66d1acbSmrgAC_SUBST([AM_BACKSLASH])dnl
885b66d1acbSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
886b66d1acbSmrg])
887b66d1acbSmrg
888b66d1acbSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8894fb28925Smrg#
890b66d1acbSmrg# This file is free software; the Free Software Foundation
891b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
892b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
8934fb28925Smrg
894b66d1acbSmrg# AM_PROG_INSTALL_STRIP
895b66d1acbSmrg# ---------------------
896b66d1acbSmrg# One issue with vendor `install' (even GNU) is that you can't
897b66d1acbSmrg# specify the program used to strip binaries.  This is especially
898b66d1acbSmrg# annoying in cross-compiling environments, where the build's strip
899b66d1acbSmrg# is unlikely to handle the host's binaries.
900b66d1acbSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
901b66d1acbSmrg# always use install-sh in `make install-strip', and initialize
902b66d1acbSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
903b66d1acbSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
904b66d1acbSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
905b66d1acbSmrg# Installed binaries are usually stripped using `strip' when the user
906b66d1acbSmrg# run `make install-strip'.  However `strip' might not be the right
907b66d1acbSmrg# tool to use in cross-compilation environments, therefore Automake
908b66d1acbSmrg# will honor the `STRIP' environment variable to overrule this program.
909b66d1acbSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
910b66d1acbSmrgif test "$cross_compiling" != no; then
911b66d1acbSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
912b66d1acbSmrgfi
913b66d1acbSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
914b66d1acbSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9154fb28925Smrg
916b66d1acbSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
917b66d1acbSmrg#
918b66d1acbSmrg# This file is free software; the Free Software Foundation
919b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
920b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
9214fb28925Smrg
922b66d1acbSmrg# serial 2
9234fb28925Smrg
924b66d1acbSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
925b66d1acbSmrg# ---------------------------
926b66d1acbSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
927b66d1acbSmrg# This macro is traced by Automake.
928b66d1acbSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9294fb28925Smrg
930b66d1acbSmrg# AM_SUBST_NOTMAKE(VARIABLE)
931b66d1acbSmrg# ---------------------------
932b66d1acbSmrg# Public sister of _AM_SUBST_NOTMAKE.
933b66d1acbSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9344fb28925Smrg
935b66d1acbSmrg# Check how to create a tarball.                            -*- Autoconf -*-
9364fb28925Smrg
937b66d1acbSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
938b66d1acbSmrg#
939b66d1acbSmrg# This file is free software; the Free Software Foundation
940b66d1acbSmrg# gives unlimited permission to copy and/or distribute it,
941b66d1acbSmrg# with or without modifications, as long as this notice is preserved.
9424fb28925Smrg
943b66d1acbSmrg# serial 2
9444fb28925Smrg
945b66d1acbSmrg# _AM_PROG_TAR(FORMAT)
946b66d1acbSmrg# --------------------
947b66d1acbSmrg# Check how to create a tarball in format FORMAT.
948b66d1acbSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
949b66d1acbSmrg#
950b66d1acbSmrg# Substitute a variable $(am__tar) that is a command
951b66d1acbSmrg# writing to stdout a FORMAT-tarball containing the directory
952b66d1acbSmrg# $tardir.
953b66d1acbSmrg#     tardir=directory && $(am__tar) > result.tar
954b66d1acbSmrg#
955b66d1acbSmrg# Substitute a variable $(am__untar) that extract such
956b66d1acbSmrg# a tarball read from stdin.
957b66d1acbSmrg#     $(am__untar) < result.tar
958b66d1acbSmrgAC_DEFUN([_AM_PROG_TAR],
959b66d1acbSmrg[# Always define AMTAR for backward compatibility.
960b66d1acbSmrgAM_MISSING_PROG([AMTAR], [tar])
961b66d1acbSmrgm4_if([$1], [v7],
962b66d1acbSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
963b66d1acbSmrg     [m4_case([$1], [ustar],, [pax],,
964b66d1acbSmrg              [m4_fatal([Unknown tar format])])
965b66d1acbSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
966b66d1acbSmrg# Loop over all known methods to create a tar archive until one works.
967b66d1acbSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
968b66d1acbSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
969b66d1acbSmrg# Do not fold the above two line into one, because Tru64 sh and
970b66d1acbSmrg# Solaris sh will not grok spaces in the rhs of `-'.
971b66d1acbSmrgfor _am_tool in $_am_tools
972b66d1acbSmrgdo
973b66d1acbSmrg  case $_am_tool in
974b66d1acbSmrg  gnutar)
975b66d1acbSmrg    for _am_tar in tar gnutar gtar;
976b66d1acbSmrg    do
977b66d1acbSmrg      AM_RUN_LOG([$_am_tar --version]) && break
978b66d1acbSmrg    done
979b66d1acbSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
980b66d1acbSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
981b66d1acbSmrg    am__untar="$_am_tar -xf -"
982b66d1acbSmrg    ;;
983b66d1acbSmrg  plaintar)
984b66d1acbSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
985b66d1acbSmrg    # ustar tarball either.
986b66d1acbSmrg    (tar --version) >/dev/null 2>&1 && continue
987b66d1acbSmrg    am__tar='tar chf - "$$tardir"'
988b66d1acbSmrg    am__tar_='tar chf - "$tardir"'
989b66d1acbSmrg    am__untar='tar xf -'
990b66d1acbSmrg    ;;
991b66d1acbSmrg  pax)
992b66d1acbSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
993b66d1acbSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
994b66d1acbSmrg    am__untar='pax -r'
995b66d1acbSmrg    ;;
996b66d1acbSmrg  cpio)
997b66d1acbSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
998b66d1acbSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
999b66d1acbSmrg    am__untar='cpio -i -H $1 -d'
1000b66d1acbSmrg    ;;
1001b66d1acbSmrg  none)
1002b66d1acbSmrg    am__tar=false
1003b66d1acbSmrg    am__tar_=false
1004b66d1acbSmrg    am__untar=false
1005b66d1acbSmrg    ;;
1006b66d1acbSmrg  esac
10074fb28925Smrg
1008b66d1acbSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
1009b66d1acbSmrg  # and am__untar set.
1010b66d1acbSmrg  test -n "${am_cv_prog_tar_$1}" && break
1011b66d1acbSmrg
1012b66d1acbSmrg  # tar/untar a dummy directory, and stop if the command works
1013b66d1acbSmrg  rm -rf conftest.dir
1014b66d1acbSmrg  mkdir conftest.dir
1015b66d1acbSmrg  echo GrepMe > conftest.dir/file
1016b66d1acbSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1017b66d1acbSmrg  rm -rf conftest.dir
1018b66d1acbSmrg  if test -s conftest.tar; then
1019b66d1acbSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
1020b66d1acbSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1021b66d1acbSmrg  fi
1022b66d1acbSmrgdone
1023b66d1acbSmrgrm -rf conftest.dir
10244fb28925Smrg
1025b66d1acbSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1026b66d1acbSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
1027b66d1acbSmrgAC_SUBST([am__tar])
1028b66d1acbSmrgAC_SUBST([am__untar])
1029b66d1acbSmrg]) # _AM_PROG_TAR
1030b66d1acbSmrg
1031b66d1acbSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10324fb28925Smrgdnl
1033b66d1acbSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
10344fb28925Smrgdnl 
1035b66d1acbSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1036b66d1acbSmrgdnl copy of this software and associated documentation files (the
1037b66d1acbSmrgdnl "Software"), to deal in the Software without restriction, including
1038b66d1acbSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
1039b66d1acbSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
1040b66d1acbSmrgdnl to whom the Software is furnished to do so, provided that the above
1041b66d1acbSmrgdnl copyright notice(s) and this permission notice appear in all copies of
1042b66d1acbSmrgdnl the Software and that both the above copyright notice(s) and this
1043b66d1acbSmrgdnl permission notice appear in supporting documentation.
1044b66d1acbSmrgdnl
10454fb28925Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10464fb28925Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1047b66d1acbSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1048b66d1acbSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1049b66d1acbSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1050b66d1acbSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1051b66d1acbSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1052b66d1acbSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1053b66d1acbSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1054b66d1acbSmrgdnl
1055b66d1acbSmrgdnl Except as contained in this notice, the name of a copyright holder
1056b66d1acbSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
1057b66d1acbSmrgdnl or other dealings in this Software without prior written authorization
1058b66d1acbSmrgdnl of the copyright holder.
1059b66d1acbSmrg
1060b66d1acbSmrg# XORG_MACROS_VERSION(required-version)
1061b66d1acbSmrg# -------------------------------------
1062b66d1acbSmrg# Minimum version: 1.1.0
1063b66d1acbSmrg#
1064b66d1acbSmrg# If you're using a macro added in Version 1.1 or newer, include this in
1065b66d1acbSmrg# your configure.ac with the minimum required version, such as:
1066b66d1acbSmrg# XORG_MACROS_VERSION(1.1)
1067b66d1acbSmrg#
1068b66d1acbSmrg# To ensure that this macro is defined, also add:
1069b66d1acbSmrg# m4_ifndef([XORG_MACROS_VERSION],
1070b66d1acbSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
1071b66d1acbSmrg#
1072b66d1acbSmrg#
1073b66d1acbSmrg# See the "minimum version" comment for each macro you use to see what 
1074b66d1acbSmrg# version you require.
1075b66d1acbSmrgm4_defun([XORG_MACROS_VERSION],[
1076b66d1acbSmrgm4_define([vers_have], [1.3.0])
1077b66d1acbSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1078b66d1acbSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1079b66d1acbSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1080b66d1acbSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1081b66d1acbSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1082b66d1acbSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1083b66d1acbSmrgm4_undefine([vers_have])
1084b66d1acbSmrgm4_undefine([maj_have])
1085b66d1acbSmrgm4_undefine([maj_needed])
1086b66d1acbSmrg]) # XORG_MACROS_VERSION
10874fb28925Smrg
10884fb28925Smrg# XORG_PROG_RAWCPP()
10894fb28925Smrg# ------------------
1090b66d1acbSmrg# Minimum version: 1.0.0
1091b66d1acbSmrg#
10924fb28925Smrg# Find cpp program and necessary flags for use in pre-processing text files
10934fb28925Smrg# such as man pages and config files
10944fb28925SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
10954fb28925SmrgAC_REQUIRE([AC_PROG_CPP])
10964fb28925SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
10974fb28925Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
10984fb28925Smrg
10994fb28925Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
11004fb28925Smrg# which is not the best choice for supporting other OS'es, but covers most
11014fb28925Smrg# of the ones we need for now.
11024fb28925SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
11034fb28925SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
11044fb28925Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11054fb28925Smrg	AC_MSG_RESULT([no])
11064fb28925Smrgelse
11074fb28925Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11084fb28925Smrg		RAWCPPFLAGS=-undef
11094fb28925Smrg		AC_MSG_RESULT([yes])
1110b66d1acbSmrg	# under Cygwin unix is still defined even with -undef
1111b66d1acbSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1112b66d1acbSmrg		RAWCPPFLAGS="-undef -ansi"
1113b66d1acbSmrg		AC_MSG_RESULT([yes, with -ansi])
11144fb28925Smrg	else
11154fb28925Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
11164fb28925Smrg	fi
11174fb28925Smrgfi
11184fb28925Smrgrm -f conftest.$ac_ext
11194fb28925Smrg
11204fb28925SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
11214fb28925SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
11224fb28925Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11234fb28925Smrg	AC_MSG_RESULT([no])
11244fb28925Smrgelse
11254fb28925Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11264fb28925Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
11274fb28925Smrg		AC_MSG_RESULT([yes])
11284fb28925Smrg	else
11294fb28925Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
11304fb28925Smrg	fi
11314fb28925Smrgfi
11324fb28925Smrgrm -f conftest.$ac_ext
11334fb28925SmrgAC_SUBST(RAWCPPFLAGS)
11344fb28925Smrg]) # XORG_PROG_RAWCPP
11354fb28925Smrg
11364fb28925Smrg# XORG_MANPAGE_SECTIONS()
11374fb28925Smrg# -----------------------
1138b66d1acbSmrg# Minimum version: 1.0.0
1139b66d1acbSmrg#
11404fb28925Smrg# Determine which sections man pages go in for the different man page types
11414fb28925Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
11424fb28925Smrg# Not sure if there's any better way than just hardcoding by OS name.
11434fb28925Smrg# Override default settings by setting environment variables
11444fb28925Smrg
11454fb28925SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
11464fb28925SmrgAC_REQUIRE([AC_CANONICAL_HOST])
11474fb28925Smrg
11484fb28925Smrgif test x$APP_MAN_SUFFIX = x    ; then
1149b66d1acbSmrg    APP_MAN_SUFFIX=1
11504fb28925Smrgfi
11514fb28925Smrgif test x$APP_MAN_DIR = x    ; then
1152b66d1acbSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
11534fb28925Smrgfi
11544fb28925Smrg
11554fb28925Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1156b66d1acbSmrg    LIB_MAN_SUFFIX=3
11574fb28925Smrgfi
11584fb28925Smrgif test x$LIB_MAN_DIR = x    ; then
1159b66d1acbSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
11604fb28925Smrgfi
11614fb28925Smrg
11624fb28925Smrgif test x$FILE_MAN_SUFFIX = x    ; then
11634fb28925Smrg    case $host_os in
11644fb28925Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
11654fb28925Smrg	*)		FILE_MAN_SUFFIX=5  ;;
11664fb28925Smrg    esac
11674fb28925Smrgfi
11684fb28925Smrgif test x$FILE_MAN_DIR = x    ; then
1169b66d1acbSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
11704fb28925Smrgfi
11714fb28925Smrg
11724fb28925Smrgif test x$MISC_MAN_SUFFIX = x    ; then
11734fb28925Smrg    case $host_os in
11744fb28925Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
11754fb28925Smrg	*)		MISC_MAN_SUFFIX=7  ;;
11764fb28925Smrg    esac
11774fb28925Smrgfi
11784fb28925Smrgif test x$MISC_MAN_DIR = x    ; then
1179b66d1acbSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
11804fb28925Smrgfi
11814fb28925Smrg
11824fb28925Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
11834fb28925Smrg    case $host_os in
11844fb28925Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
11854fb28925Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
11864fb28925Smrg    esac
11874fb28925Smrgfi
11884fb28925Smrgif test x$DRIVER_MAN_DIR = x    ; then
1189b66d1acbSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
11904fb28925Smrgfi
11914fb28925Smrg
11924fb28925Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
11934fb28925Smrg    case $host_os in
11944fb28925Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
11954fb28925Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
11964fb28925Smrg    esac
11974fb28925Smrgfi
11984fb28925Smrgif test x$ADMIN_MAN_DIR = x    ; then
11994fb28925Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
12004fb28925Smrgfi
12014fb28925Smrg
12024fb28925Smrg
12034fb28925SmrgAC_SUBST([APP_MAN_SUFFIX])
12044fb28925SmrgAC_SUBST([LIB_MAN_SUFFIX])
12054fb28925SmrgAC_SUBST([FILE_MAN_SUFFIX])
12064fb28925SmrgAC_SUBST([MISC_MAN_SUFFIX])
12074fb28925SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
12084fb28925SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
12094fb28925SmrgAC_SUBST([APP_MAN_DIR])
12104fb28925SmrgAC_SUBST([LIB_MAN_DIR])
12114fb28925SmrgAC_SUBST([FILE_MAN_DIR])
12124fb28925SmrgAC_SUBST([MISC_MAN_DIR])
12134fb28925SmrgAC_SUBST([DRIVER_MAN_DIR])
12144fb28925SmrgAC_SUBST([ADMIN_MAN_DIR])
12154fb28925Smrg]) # XORG_MANPAGE_SECTIONS
12164fb28925Smrg
12174fb28925Smrg# XORG_CHECK_LINUXDOC
12184fb28925Smrg# -------------------
1219b66d1acbSmrg# Minimum version: 1.0.0
1220b66d1acbSmrg#
12214fb28925Smrg# Defines the variable MAKE_TEXT if the necessary tools and
12224fb28925Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
12234fb28925Smrg# Whether or not the necessary tools and files are found can be checked
12244fb28925Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
12254fb28925SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1226b66d1acbSmrgif test x$XORG_SGML_PATH = x ; then
1227b66d1acbSmrg    XORG_SGML_PATH=$prefix/share/sgml
1228b66d1acbSmrgfi
1229b66d1acbSmrgHAVE_DEFS_ENT=
1230b66d1acbSmrg
1231b66d1acbSmrgif test x"$cross_compiling" = x"yes" ; then
1232b66d1acbSmrg  HAVE_DEFS_ENT=no
1233b66d1acbSmrgelse
1234b66d1acbSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1235b66d1acbSmrgfi
12364fb28925Smrg
12374fb28925SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
12384fb28925SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
12394fb28925Smrg
12404fb28925SmrgAC_MSG_CHECKING([Whether to build documentation])
12414fb28925Smrg
1242b66d1acbSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
12434fb28925Smrg   BUILDDOC=yes
12444fb28925Smrgelse
12454fb28925Smrg   BUILDDOC=no
12464fb28925Smrgfi
12474fb28925Smrg
12484fb28925SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
12494fb28925Smrg
12504fb28925SmrgAC_MSG_RESULT([$BUILDDOC])
12514fb28925Smrg
12524fb28925SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
12534fb28925Smrg
1254b66d1acbSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
12554fb28925Smrg   BUILDPDFDOC=yes
12564fb28925Smrgelse
12574fb28925Smrg   BUILDPDFDOC=no
12584fb28925Smrgfi
12594fb28925Smrg
12604fb28925SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
12614fb28925Smrg
12624fb28925SmrgAC_MSG_RESULT([$BUILDPDFDOC])
12634fb28925Smrg
1264b66d1acbSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
1265b66d1acbSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
12664fb28925SmrgMAKE_PDF="$PS2PDF"
1267b66d1acbSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
12684fb28925Smrg
12694fb28925SmrgAC_SUBST(MAKE_TEXT)
12704fb28925SmrgAC_SUBST(MAKE_PS)
12714fb28925SmrgAC_SUBST(MAKE_PDF)
12724fb28925SmrgAC_SUBST(MAKE_HTML)
12734fb28925Smrg]) # XORG_CHECK_LINUXDOC
12744fb28925Smrg
1275b66d1acbSmrg# XORG_CHECK_DOCBOOK
1276b66d1acbSmrg# -------------------
1277b66d1acbSmrg# Minimum version: 1.0.0
1278b66d1acbSmrg#
1279b66d1acbSmrg# Checks for the ability to build output formats from SGML DocBook source.
1280b66d1acbSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1281b66d1acbSmrg# indicates whether the necessary tools and files are found and, if set,
1282b66d1acbSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1283b66d1acbSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1284b66d1acbSmrgif test x$XORG_SGML_PATH = x ; then
1285b66d1acbSmrg    XORG_SGML_PATH=$prefix/share/sgml
1286b66d1acbSmrgfi
1287b66d1acbSmrgHAVE_DEFS_ENT=
1288b66d1acbSmrgBUILDTXTDOC=no
1289b66d1acbSmrgBUILDPDFDOC=no
1290b66d1acbSmrgBUILDPSDOC=no
1291b66d1acbSmrgBUILDHTMLDOC=no
1292b66d1acbSmrg
1293b66d1acbSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1294b66d1acbSmrg
1295b66d1acbSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1296b66d1acbSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1297b66d1acbSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1298b66d1acbSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1299b66d1acbSmrg
1300b66d1acbSmrgAC_MSG_CHECKING([Whether to build text documentation])
1301b66d1acbSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
1302b66d1acbSmrg   test x$BUILD_TXTDOC != xno; then
1303b66d1acbSmrg	BUILDTXTDOC=yes
1304b66d1acbSmrgfi
1305b66d1acbSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1306b66d1acbSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1307b66d1acbSmrg
1308b66d1acbSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
1309b66d1acbSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
1310b66d1acbSmrg   test x$BUILD_PDFDOC != xno; then
1311b66d1acbSmrg	BUILDPDFDOC=yes
1312b66d1acbSmrgfi
1313b66d1acbSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1314b66d1acbSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1315b66d1acbSmrg
1316b66d1acbSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
1317b66d1acbSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
1318b66d1acbSmrg   test x$BUILD_PSDOC != xno; then
1319b66d1acbSmrg	BUILDPSDOC=yes
1320b66d1acbSmrgfi
1321b66d1acbSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1322b66d1acbSmrgAC_MSG_RESULT([$BUILDPSDOC])
1323b66d1acbSmrg
1324b66d1acbSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
1325b66d1acbSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
1326b66d1acbSmrg   test x$BUILD_HTMLDOC != xno; then
1327b66d1acbSmrg	BUILDHTMLDOC=yes
1328b66d1acbSmrgfi
1329b66d1acbSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1330b66d1acbSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1331b66d1acbSmrg
1332b66d1acbSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1333b66d1acbSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1334b66d1acbSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1335b66d1acbSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1336b66d1acbSmrg
1337b66d1acbSmrgAC_SUBST(MAKE_TEXT)
1338b66d1acbSmrgAC_SUBST(MAKE_PS)
1339b66d1acbSmrgAC_SUBST(MAKE_PDF)
1340b66d1acbSmrgAC_SUBST(MAKE_HTML)
1341b66d1acbSmrg]) # XORG_CHECK_DOCBOOK
1342b66d1acbSmrg
13434fb28925Smrg# XORG_CHECK_MALLOC_ZERO
13444fb28925Smrg# ----------------------
1345b66d1acbSmrg# Minimum version: 1.0.0
1346b66d1acbSmrg#
13474fb28925Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
13484fb28925Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
13494fb28925Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
13504fb28925SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
13514fb28925SmrgAC_ARG_ENABLE(malloc0returnsnull,
1352b66d1acbSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
13534fb28925Smrg		       [malloc(0) returns NULL (default: auto)]),
13544fb28925Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
13554fb28925Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
13564fb28925Smrg
13574fb28925SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
13584fb28925Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
13594fb28925Smrg	AC_RUN_IFELSE([
13604fb28925Smrgchar *malloc();
13614fb28925Smrgchar *realloc();
13624fb28925Smrgchar *calloc();
13634fb28925Smrgmain() {
13644fb28925Smrg    char *m0, *r0, *c0, *p;
13654fb28925Smrg    m0 = malloc(0);
13664fb28925Smrg    p = malloc(10);
13674fb28925Smrg    r0 = realloc(p,0);
13684fb28925Smrg    c0 = calloc(0);
13694fb28925Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
13704fb28925Smrg}],
13714fb28925Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
13724fb28925Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
13734fb28925Smrgfi
13744fb28925SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
13754fb28925Smrg
13764fb28925Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
13774fb28925Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
13784fb28925Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
13794fb28925Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
13804fb28925Smrgelse
13814fb28925Smrg	MALLOC_ZERO_CFLAGS=""
13824fb28925Smrg	XMALLOC_ZERO_CFLAGS=""
13834fb28925Smrg	XTMALLOC_ZERO_CFLAGS=""
13844fb28925Smrgfi
13854fb28925Smrg
13864fb28925SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
13874fb28925SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
13884fb28925SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
13894fb28925Smrg]) # XORG_CHECK_MALLOC_ZERO
13904fb28925Smrg
1391b66d1acbSmrg# XORG_WITH_LINT()
1392b66d1acbSmrg# ----------------
1393b66d1acbSmrg# Minimum version: 1.1.0
1394b66d1acbSmrg#
1395b66d1acbSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
1396b66d1acbSmrg# is specified.   (Use --with-lint=sparse for sparse.)
1397b66d1acbSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
1398b66d1acbSmrg# Sets $LINT_FLAGS to flags to pass to source checker
1399b66d1acbSmrg# Sets LINT automake conditional if enabled (default: disabled)
1400b66d1acbSmrg#
1401b66d1acbSmrgAC_DEFUN([XORG_WITH_LINT],[
1402b66d1acbSmrg
1403b66d1acbSmrg# Allow checking code with lint, sparse, etc.
1404b66d1acbSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1405b66d1acbSmrg		[Use a lint-style source code checker (default: disabled)])],
1406b66d1acbSmrg		[use_lint=$withval], [use_lint=no])
1407b66d1acbSmrgif test "x$use_lint" = "xyes" ; then
1408b66d1acbSmrg	LINT="lint"
1409b66d1acbSmrgelse
1410b66d1acbSmrg	LINT="$use_lint"
1411b66d1acbSmrgfi
1412b66d1acbSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1413b66d1acbSmrg    case $LINT in
1414b66d1acbSmrg	lint|*/lint)
1415b66d1acbSmrg	    case $host_os in
1416b66d1acbSmrg		solaris*)
1417b66d1acbSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1418b66d1acbSmrg			;;
1419b66d1acbSmrg	    esac
1420b66d1acbSmrg	    ;;
1421b66d1acbSmrg    esac
1422b66d1acbSmrgfi
1423b66d1acbSmrg
1424b66d1acbSmrgAC_SUBST(LINT)
1425b66d1acbSmrgAC_SUBST(LINT_FLAGS)
1426b66d1acbSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
1427b66d1acbSmrg
1428b66d1acbSmrg]) # XORG_WITH_LINT
1429b66d1acbSmrg
1430b66d1acbSmrg# XORG_LINT_LIBRARY(LIBNAME)
1431b66d1acbSmrg# --------------------------
1432b66d1acbSmrg# Minimum version: 1.1.0
1433b66d1acbSmrg#
1434b66d1acbSmrg# Sets up flags for building lint libraries for checking programs that call
1435b66d1acbSmrg# functions in the library.
1436b66d1acbSmrg# Disabled by default, enable with --enable-lint-library
1437b66d1acbSmrg# Sets: 
1438b66d1acbSmrg#	@LINTLIB@		- name of lint library file to make
1439b66d1acbSmrg#	MAKE_LINT_LIB		- automake conditional
1440b66d1acbSmrg#
1441b66d1acbSmrg
1442b66d1acbSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1443b66d1acbSmrgAC_REQUIRE([XORG_WITH_LINT])
1444b66d1acbSmrg# Build lint "library" for more indepth checks of programs calling this library
1445b66d1acbSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1446b66d1acbSmrg	[Create lint library (default: disabled)])],
1447b66d1acbSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1448b66d1acbSmrgif test "x$make_lint_lib" != "xno" ; then
1449b66d1acbSmrg	if test "x$LINT" = "xno" ; then
1450b66d1acbSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
1451b66d1acbSmrg	fi
1452b66d1acbSmrg	if test "x$make_lint_lib" = "xyes" ; then
1453b66d1acbSmrg		LINTLIB=llib-l$1.ln
1454b66d1acbSmrg	else
1455b66d1acbSmrg		LINTLIB=$make_lint_lib
1456b66d1acbSmrg	fi
1457b66d1acbSmrgfi
1458b66d1acbSmrgAC_SUBST(LINTLIB)
1459b66d1acbSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1460b66d1acbSmrg
1461b66d1acbSmrg]) # XORG_LINT_LIBRARY
1462b66d1acbSmrg
1463b66d1acbSmrg# XORG_CWARNFLAGS
1464b66d1acbSmrg# ---------------
1465b66d1acbSmrg# Minimum version: 1.2.0
1466b66d1acbSmrg#
1467b66d1acbSmrg# Defines CWARNFLAGS to enable C compiler warnings.
1468b66d1acbSmrg#
1469b66d1acbSmrgAC_DEFUN([XORG_CWARNFLAGS], [
1470b66d1acbSmrgAC_REQUIRE([AC_PROG_CC])
1471b66d1acbSmrgif  test "x$GCC" = xyes ; then
1472b66d1acbSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1473b66d1acbSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1474b66d1acbSmrg-Wbad-function-cast"
1475b66d1acbSmrg    case `$CC -dumpversion` in
1476b66d1acbSmrg    3.4.* | 4.*)
1477b66d1acbSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1478b66d1acbSmrg	;;
1479b66d1acbSmrg    esac
1480b66d1acbSmrgelse
1481b66d1acbSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1482b66d1acbSmrg    if test "x$SUNCC" = "xyes"; then
1483b66d1acbSmrg	CWARNFLAGS="-v"
1484b66d1acbSmrg    fi
1485b66d1acbSmrgfi
1486b66d1acbSmrgAC_SUBST(CWARNFLAGS)
1487b66d1acbSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
1488b66d1acbSmrg]) # XORG_CWARNFLAGS
1489b66d1acbSmrg
1490b66d1acbSmrg# XORG_STRICT_OPTION
1491b66d1acbSmrg# -----------------------
1492b66d1acbSmrg# Minimum version: 1.3.0
1493b66d1acbSmrg#
1494b66d1acbSmrg# Add configure option to enable strict compilation
1495b66d1acbSmrgAC_DEFUN([XORG_STRICT_OPTION], [
1496b66d1acbSmrgAC_REQUIRE([AC_PROG_CC])
1497b66d1acbSmrgAC_REQUIRE([AC_PROG_CC_C99])
1498b66d1acbSmrgAC_REQUIRE([XORG_CWARNFLAGS])
1499b66d1acbSmrg
1500b66d1acbSmrgAC_ARG_ENABLE(strict-compilation,
1501b66d1acbSmrg			  AS_HELP_STRING([--enable-strict-compilation],
1502b66d1acbSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1503b66d1acbSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1504b66d1acbSmrgif test "x$STRICT_COMPILE" = "xyes"; then
1505b66d1acbSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1506b66d1acbSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1507b66d1acbSmrg	if test "x$GCC" = xyes ; then
1508b66d1acbSmrg		STRICT_CFLAGS="-pedantic -Werror"
1509b66d1acbSmrg	elif test "x$SUNCC" = "xyes"; then
1510b66d1acbSmrg		STRICT_CFLAGS="-errwarn"
1511b66d1acbSmrg    elif test "x$INTELCC" = "xyes"; then
1512b66d1acbSmrg		STRICT_CFLAGS="-Werror"
1513b66d1acbSmrg	fi
1514b66d1acbSmrgfi
1515b66d1acbSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1516b66d1acbSmrgAC_SUBST([CWARNFLAGS])
1517b66d1acbSmrg]) # XORG_STRICT_OPTION
1518b66d1acbSmrg
1519b66d1acbSmrg# XORG_DEFAULT_OPTIONS
1520b66d1acbSmrg# --------------------
1521b66d1acbSmrg# Minimum version: 1.3.0
1522b66d1acbSmrg#
1523b66d1acbSmrg# Defines default options for X.Org modules.
1524b66d1acbSmrg#
1525b66d1acbSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1526b66d1acbSmrgXORG_CWARNFLAGS
1527b66d1acbSmrgXORG_STRICT_OPTION
1528b66d1acbSmrgXORG_RELEASE_VERSION
1529b66d1acbSmrgXORG_CHANGELOG
1530b66d1acbSmrgXORG_MANPAGE_SECTIONS
1531b66d1acbSmrg]) # XORG_DEFAULT_OPTIONS
15324fb28925Smrgdnl Copyright 2005 Red Hat, Inc
15334fb28925Smrgdnl
15344fb28925Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
15354fb28925Smrgdnl documentation for any purpose is hereby granted without fee, provided that
15364fb28925Smrgdnl the above copyright notice appear in all copies and that both that
15374fb28925Smrgdnl copyright notice and this permission notice appear in supporting
15384fb28925Smrgdnl documentation.
15394fb28925Smrgdnl
15404fb28925Smrgdnl The above copyright notice and this permission notice shall be included
15414fb28925Smrgdnl in all copies or substantial portions of the Software.
15424fb28925Smrgdnl
15434fb28925Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15444fb28925Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15454fb28925Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15464fb28925Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
15474fb28925Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
15484fb28925Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
15494fb28925Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
15504fb28925Smrgdnl
15514fb28925Smrgdnl Except as contained in this notice, the name of the copyright holders shall
15524fb28925Smrgdnl not be used in advertising or otherwise to promote the sale, use or
15534fb28925Smrgdnl other dealings in this Software without prior written authorization
15544fb28925Smrgdnl from the copyright holders.
15554fb28925Smrgdnl
15564fb28925Smrg
15574fb28925Smrg# XORG_RELEASE_VERSION
15584fb28925Smrg# --------------------
15594fb28925Smrg# Adds --with/without-release-string and changes the PACKAGE and
15604fb28925Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
1561b66d1acbSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
1562b66d1acbSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
15634fb28925Smrg 
15644fb28925SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
15654fb28925Smrg	AC_ARG_WITH(release-version,
1566b66d1acbSmrg			AS_HELP_STRING([--with-release-version=STRING],
15674fb28925Smrg				[Use release version string in package name]),
15684fb28925Smrg			[RELEASE_VERSION="$withval"],
15694fb28925Smrg			[RELEASE_VERSION=""])
15704fb28925Smrg	if test "x$RELEASE_VERSION" != "x"; then
15714fb28925Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
15724fb28925Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
15734fb28925Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
15744fb28925Smrg	fi
1575b66d1acbSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1576b66d1acbSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1577b66d1acbSmrg		[Major version of this package])
1578b66d1acbSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1579b66d1acbSmrg	if test "x$PVM" = "x"; then
1580b66d1acbSmrg		PVM="0"
1581b66d1acbSmrg	fi
1582b66d1acbSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1583b66d1acbSmrg		[$PVM],
1584b66d1acbSmrg		[Minor version of this package])
1585b66d1acbSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1586b66d1acbSmrg	if test "x$PVP" = "x"; then
1587b66d1acbSmrg		PVP="0"
1588b66d1acbSmrg	fi
1589b66d1acbSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1590b66d1acbSmrg		[$PVP],
1591b66d1acbSmrg		[Patch version of this package])
15924fb28925Smrg])
15934fb28925Smrg
1594b66d1acbSmrg# XORG_CHANGELOG()
1595b66d1acbSmrg# ----------------
1596b66d1acbSmrg# Minimum version: 1.2.0
1597b66d1acbSmrg#
1598b66d1acbSmrg# Defines the variable CHANGELOG_CMD as the command to generate
1599b66d1acbSmrg# ChangeLog from git.
1600b66d1acbSmrg#
1601b66d1acbSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
1602b66d1acbSmrg#
1603b66d1acbSmrgAC_DEFUN([XORG_CHANGELOG], [
1604b66d1acbSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
1605b66d1acbSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
1606b66d1acbSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1607b66d1acbSmrgAC_SUBST([CHANGELOG_CMD])
1608b66d1acbSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
1609b66d1acbSmrg]) # XORG_CHANGELOG
1610b66d1acbSmrg
1611b66d1acbSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1612b66d1acbSmrg# 
1613b66d1acbSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1614b66d1acbSmrg#
1615b66d1acbSmrg# This program is free software; you can redistribute it and/or modify
1616b66d1acbSmrg# it under the terms of the GNU General Public License as published by
1617b66d1acbSmrg# the Free Software Foundation; either version 2 of the License, or
1618b66d1acbSmrg# (at your option) any later version.
1619b66d1acbSmrg#
1620b66d1acbSmrg# This program is distributed in the hope that it will be useful, but
1621b66d1acbSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1622b66d1acbSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1623b66d1acbSmrg# General Public License for more details.
1624b66d1acbSmrg#
1625b66d1acbSmrg# You should have received a copy of the GNU General Public License
1626b66d1acbSmrg# along with this program; if not, write to the Free Software
1627b66d1acbSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1628b66d1acbSmrg#
1629b66d1acbSmrg# As a special exception to the GNU General Public License, if you
1630b66d1acbSmrg# distribute this file as part of a program that contains a
1631b66d1acbSmrg# configuration script generated by Autoconf, you may include it under
1632b66d1acbSmrg# the same distribution terms that you use for the rest of that program.
1633b66d1acbSmrg
1634b66d1acbSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1635b66d1acbSmrg# ----------------------------------
1636b66d1acbSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
1637b66d1acbSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1638b66d1acbSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1639b66d1acbSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
1640b66d1acbSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1641b66d1acbSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1642b66d1acbSmrgfi
1643b66d1acbSmrgif test -n "$PKG_CONFIG"; then
1644b66d1acbSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
1645b66d1acbSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1646b66d1acbSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1647b66d1acbSmrg		AC_MSG_RESULT([yes])
1648b66d1acbSmrg	else
1649b66d1acbSmrg		AC_MSG_RESULT([no])
1650b66d1acbSmrg		PKG_CONFIG=""
1651b66d1acbSmrg	fi
1652b66d1acbSmrg		
1653b66d1acbSmrgfi[]dnl
1654b66d1acbSmrg])# PKG_PROG_PKG_CONFIG
1655b66d1acbSmrg
1656b66d1acbSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1657b66d1acbSmrg#
1658b66d1acbSmrg# Check to see whether a particular set of modules exists.  Similar
1659b66d1acbSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1660b66d1acbSmrg#
1661b66d1acbSmrg#
1662b66d1acbSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1663b66d1acbSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
1664b66d1acbSmrg# PKG_CHECK_EXISTS manually
1665b66d1acbSmrg# --------------------------------------------------------------
1666b66d1acbSmrgAC_DEFUN([PKG_CHECK_EXISTS],
1667b66d1acbSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1668b66d1acbSmrgif test -n "$PKG_CONFIG" && \
1669b66d1acbSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1670b66d1acbSmrg  m4_ifval([$2], [$2], [:])
1671b66d1acbSmrgm4_ifvaln([$3], [else
1672b66d1acbSmrg  $3])dnl
1673b66d1acbSmrgfi])
1674b66d1acbSmrg
1675b66d1acbSmrg
1676b66d1acbSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1677b66d1acbSmrg# ---------------------------------------------
1678b66d1acbSmrgm4_define([_PKG_CONFIG],
1679b66d1acbSmrg[if test -n "$$1"; then
1680b66d1acbSmrg    pkg_cv_[]$1="$$1"
1681b66d1acbSmrg elif test -n "$PKG_CONFIG"; then
1682b66d1acbSmrg    PKG_CHECK_EXISTS([$3],
1683b66d1acbSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1684b66d1acbSmrg		     [pkg_failed=yes])
1685b66d1acbSmrg else
1686b66d1acbSmrg    pkg_failed=untried
1687b66d1acbSmrgfi[]dnl
1688b66d1acbSmrg])# _PKG_CONFIG
1689b66d1acbSmrg
1690b66d1acbSmrg# _PKG_SHORT_ERRORS_SUPPORTED
1691b66d1acbSmrg# -----------------------------
1692b66d1acbSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1693b66d1acbSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1694b66d1acbSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1695b66d1acbSmrg        _pkg_short_errors_supported=yes
1696b66d1acbSmrgelse
1697b66d1acbSmrg        _pkg_short_errors_supported=no
1698b66d1acbSmrgfi[]dnl
1699b66d1acbSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
1700b66d1acbSmrg
1701b66d1acbSmrg
1702b66d1acbSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1703b66d1acbSmrg# [ACTION-IF-NOT-FOUND])
1704b66d1acbSmrg#
1705b66d1acbSmrg#
1706b66d1acbSmrg# Note that if there is a possibility the first call to
1707b66d1acbSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
1708b66d1acbSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1709b66d1acbSmrg#
1710b66d1acbSmrg#
1711b66d1acbSmrg# --------------------------------------------------------------
1712b66d1acbSmrgAC_DEFUN([PKG_CHECK_MODULES],
1713b66d1acbSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1714b66d1acbSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1715b66d1acbSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1716b66d1acbSmrg
1717b66d1acbSmrgpkg_failed=no
1718b66d1acbSmrgAC_MSG_CHECKING([for $1])
1719b66d1acbSmrg
1720b66d1acbSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1721b66d1acbSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1722b66d1acbSmrg
1723b66d1acbSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1724b66d1acbSmrgand $1[]_LIBS to avoid the need to call pkg-config.
1725b66d1acbSmrgSee the pkg-config man page for more details.])
1726b66d1acbSmrg
1727b66d1acbSmrgif test $pkg_failed = yes; then
1728b66d1acbSmrg        _PKG_SHORT_ERRORS_SUPPORTED
1729b66d1acbSmrg        if test $_pkg_short_errors_supported = yes; then
1730b66d1acbSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1731b66d1acbSmrg        else 
1732b66d1acbSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1733b66d1acbSmrg        fi
1734b66d1acbSmrg	# Put the nasty error message in config.log where it belongs
1735b66d1acbSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1736b66d1acbSmrg
1737b66d1acbSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
1738b66d1acbSmrg[Package requirements ($2) were not met:
1739b66d1acbSmrg
1740b66d1acbSmrg$$1_PKG_ERRORS
1741b66d1acbSmrg
1742b66d1acbSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1743b66d1acbSmrginstalled software in a non-standard prefix.
1744b66d1acbSmrg
1745b66d1acbSmrg_PKG_TEXT
1746b66d1acbSmrg])],
1747b66d1acbSmrg		[AC_MSG_RESULT([no])
1748b66d1acbSmrg                $4])
1749b66d1acbSmrgelif test $pkg_failed = untried; then
1750b66d1acbSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
1751b66d1acbSmrg[The pkg-config script could not be found or is too old.  Make sure it
1752b66d1acbSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
1753b66d1acbSmrgpath to pkg-config.
1754b66d1acbSmrg
1755b66d1acbSmrg_PKG_TEXT
1756b66d1acbSmrg
1757b66d1acbSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
1758b66d1acbSmrg		[$4])
1759b66d1acbSmrgelse
1760b66d1acbSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1761b66d1acbSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1762b66d1acbSmrg        AC_MSG_RESULT([yes])
1763b66d1acbSmrg	ifelse([$3], , :, [$3])
1764b66d1acbSmrgfi[]dnl
1765b66d1acbSmrg])# PKG_CHECK_MODULES
1766b66d1acbSmrg
1767