aclocal.m4 revision 5e358eca
15e358ecaSmrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
2b3307321Smrg
3afe13c8eSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
45e358ecaSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5b3307321Smrg# This file is free software; the Free Software Foundation
6b3307321Smrg# gives unlimited permission to copy and/or distribute it,
7b3307321Smrg# with or without modifications, as long as this notice is preserved.
8b3307321Smrg
9b3307321Smrg# This program is distributed in the hope that it will be useful,
10b3307321Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11b3307321Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12b3307321Smrg# PARTICULAR PURPOSE.
13b3307321Smrg
14afe13c8eSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15afe13c8eSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
165e358ecaSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
175e358ecaSmrg[m4_warning([this file was generated for autoconf 2.63.
18afe13c8eSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19afe13c8eSmrgIf you have problems, you may need to regenerate the build system entirely.
20afe13c8eSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21b3307321Smrg
225e358ecaSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
23afe13c8eSmrg#
245e358ecaSmrg# This file is free software; the Free Software Foundation
255e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
265e358ecaSmrg# with or without modifications, as long as this notice is preserved.
27b3307321Smrg
285e358ecaSmrg# AM_AUTOMAKE_VERSION(VERSION)
295e358ecaSmrg# ----------------------------
305e358ecaSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
315e358ecaSmrg# generated from the m4 files accompanying Automake X.Y.
325e358ecaSmrg# (This private macro should not be called outside this file.)
335e358ecaSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
345e358ecaSmrg[am__api_version='1.11'
355e358ecaSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
365e358ecaSmrgdnl require some minimum version.  Point them to the right macro.
375e358ecaSmrgm4_if([$1], [1.11], [],
385e358ecaSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
395e358ecaSmrg])
40b3307321Smrg
415e358ecaSmrg# _AM_AUTOCONF_VERSION(VERSION)
425e358ecaSmrg# -----------------------------
435e358ecaSmrg# aclocal traces this macro to find the Autoconf version.
445e358ecaSmrg# This is a private macro too.  Using m4_define simplifies
455e358ecaSmrg# the logic in aclocal, which can simply ignore this definition.
465e358ecaSmrgm4_define([_AM_AUTOCONF_VERSION], [])
47b3307321Smrg
485e358ecaSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
495e358ecaSmrg# -------------------------------
505e358ecaSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
515e358ecaSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
525e358ecaSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
535e358ecaSmrg[AM_AUTOMAKE_VERSION([1.11])dnl
545e358ecaSmrgm4_ifndef([AC_AUTOCONF_VERSION],
555e358ecaSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
565e358ecaSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57b3307321Smrg
585e358ecaSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
59b3307321Smrg
605e358ecaSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
615e358ecaSmrg#
625e358ecaSmrg# This file is free software; the Free Software Foundation
635e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
645e358ecaSmrg# with or without modifications, as long as this notice is preserved.
65b3307321Smrg
665e358ecaSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
675e358ecaSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
685e358ecaSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
69afe13c8eSmrg#
705e358ecaSmrg# Of course, Automake must honor this variable whenever it calls a
715e358ecaSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
725e358ecaSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
735e358ecaSmrg# depending on how configure is run.  This is pretty annoying, since
745e358ecaSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
755e358ecaSmrg# source directory, any form will work fine, but in subdirectories a
765e358ecaSmrg# relative path needs to be adjusted first.
77afe13c8eSmrg#
785e358ecaSmrg# $ac_aux_dir/missing
795e358ecaSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
805e358ecaSmrg# $top_srcdir/$ac_aux_dir/missing
815e358ecaSmrg#    fails if $ac_aux_dir is absolute,
825e358ecaSmrg#    fails when called from a subdirectory in a VPATH build with
835e358ecaSmrg#          a relative $ac_aux_dir
84afe13c8eSmrg#
855e358ecaSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
865e358ecaSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
875e358ecaSmrg# harmless because $srcdir is `.', but things will broke when you
885e358ecaSmrg# start a VPATH build or use an absolute $srcdir.
89afe13c8eSmrg#
905e358ecaSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
915e358ecaSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
925e358ecaSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
935e358ecaSmrg# and then we would define $MISSING as
945e358ecaSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
955e358ecaSmrg# This will work as long as MISSING is not called from configure, because
965e358ecaSmrg# unfortunately $(top_srcdir) has no meaning in configure.
975e358ecaSmrg# However there are other variables, like CC, which are often used in
985e358ecaSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
995e358ecaSmrg#
1005e358ecaSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
1015e358ecaSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
1025e358ecaSmrg# configured tree to be moved without reconfiguration.
103b3307321Smrg
1045e358ecaSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1055e358ecaSmrg[dnl Rely on autoconf to set up CDPATH properly.
1065e358ecaSmrgAC_PREREQ([2.50])dnl
1075e358ecaSmrg# expand $ac_aux_dir to an absolute path
1085e358ecaSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
1095e358ecaSmrg])
110b3307321Smrg
1115e358ecaSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
112b3307321Smrg
1135e358ecaSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1145e358ecaSmrg# Free Software Foundation, Inc.
1155e358ecaSmrg#
1165e358ecaSmrg# This file is free software; the Free Software Foundation
1175e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
1185e358ecaSmrg# with or without modifications, as long as this notice is preserved.
119b3307321Smrg
1205e358ecaSmrg# serial 9
121b3307321Smrg
1225e358ecaSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1235e358ecaSmrg# -------------------------------------
1245e358ecaSmrg# Define a conditional.
1255e358ecaSmrgAC_DEFUN([AM_CONDITIONAL],
1265e358ecaSmrg[AC_PREREQ(2.52)dnl
1275e358ecaSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1285e358ecaSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1295e358ecaSmrgAC_SUBST([$1_TRUE])dnl
1305e358ecaSmrgAC_SUBST([$1_FALSE])dnl
1315e358ecaSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1325e358ecaSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1335e358ecaSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1345e358ecaSmrgif $2; then
1355e358ecaSmrg  $1_TRUE=
1365e358ecaSmrg  $1_FALSE='#'
1375e358ecaSmrgelse
1385e358ecaSmrg  $1_TRUE='#'
1395e358ecaSmrg  $1_FALSE=
1405e358ecaSmrgfi
1415e358ecaSmrgAC_CONFIG_COMMANDS_PRE(
1425e358ecaSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1435e358ecaSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1445e358ecaSmrgUsually this means the macro was only invoked conditionally.]])
1455e358ecaSmrgfi])])
146b3307321Smrg
1475e358ecaSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1485e358ecaSmrg# Free Software Foundation, Inc.
1495e358ecaSmrg#
1505e358ecaSmrg# This file is free software; the Free Software Foundation
1515e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
1525e358ecaSmrg# with or without modifications, as long as this notice is preserved.
153b3307321Smrg
1545e358ecaSmrg# serial 10
155b3307321Smrg
1565e358ecaSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1575e358ecaSmrg# written in clear, in which case automake, when reading aclocal.m4,
1585e358ecaSmrg# will think it sees a *use*, and therefore will trigger all it's
1595e358ecaSmrg# C support machinery.  Also note that it means that autoscan, seeing
1605e358ecaSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
161b3307321Smrg
162b3307321Smrg
1635e358ecaSmrg# _AM_DEPENDENCIES(NAME)
1645e358ecaSmrg# ----------------------
1655e358ecaSmrg# See how the compiler implements dependency checking.
1665e358ecaSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1675e358ecaSmrg# We try a few techniques and use that to set a single cache variable.
168afe13c8eSmrg#
1695e358ecaSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1705e358ecaSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1715e358ecaSmrg# dependency, and given that the user is not expected to run this macro,
1725e358ecaSmrg# just rely on AC_PROG_CC.
1735e358ecaSmrgAC_DEFUN([_AM_DEPENDENCIES],
1745e358ecaSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1755e358ecaSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1765e358ecaSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1775e358ecaSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
178b3307321Smrg
1795e358ecaSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1805e358ecaSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1815e358ecaSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1825e358ecaSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1835e358ecaSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1845e358ecaSmrg                   [depcc="$$1"   am_compiler_list=])
185b3307321Smrg
1865e358ecaSmrgAC_CACHE_CHECK([dependency style of $depcc],
1875e358ecaSmrg               [am_cv_$1_dependencies_compiler_type],
1885e358ecaSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1895e358ecaSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1905e358ecaSmrg  # making bogus files that we don't know about and never remove.  For
1915e358ecaSmrg  # instance it was reported that on HP-UX the gcc test will end up
1925e358ecaSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1935e358ecaSmrg  # in D'.
1945e358ecaSmrg  mkdir conftest.dir
1955e358ecaSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1965e358ecaSmrg  # using a relative directory.
1975e358ecaSmrg  cp "$am_depcomp" conftest.dir
1985e358ecaSmrg  cd conftest.dir
1995e358ecaSmrg  # We will build objects and dependencies in a subdirectory because
2005e358ecaSmrg  # it helps to detect inapplicable dependency modes.  For instance
2015e358ecaSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2025e358ecaSmrg  # side effect of compilation, but ICC will put the dependencies in
2035e358ecaSmrg  # the current directory while Tru64 will put them in the object
2045e358ecaSmrg  # directory.
2055e358ecaSmrg  mkdir sub
2065e358ecaSmrg
2075e358ecaSmrg  am_cv_$1_dependencies_compiler_type=none
2085e358ecaSmrg  if test "$am_compiler_list" = ""; then
2095e358ecaSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2105e358ecaSmrg  fi
2115e358ecaSmrg  am__universal=false
2125e358ecaSmrg  m4_case([$1], [CC],
2135e358ecaSmrg    [case " $depcc " in #(
2145e358ecaSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2155e358ecaSmrg     esac],
2165e358ecaSmrg    [CXX],
2175e358ecaSmrg    [case " $depcc " in #(
2185e358ecaSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2195e358ecaSmrg     esac])
2205e358ecaSmrg
2215e358ecaSmrg  for depmode in $am_compiler_list; do
2225e358ecaSmrg    # Setup a source with many dependencies, because some compilers
2235e358ecaSmrg    # like to wrap large dependency lists on column 80 (with \), and
2245e358ecaSmrg    # we should not choose a depcomp mode which is confused by this.
2255e358ecaSmrg    #
2265e358ecaSmrg    # We need to recreate these files for each test, as the compiler may
2275e358ecaSmrg    # overwrite some of them when testing with obscure command lines.
2285e358ecaSmrg    # This happens at least with the AIX C compiler.
2295e358ecaSmrg    : > sub/conftest.c
2305e358ecaSmrg    for i in 1 2 3 4 5 6; do
2315e358ecaSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2325e358ecaSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2335e358ecaSmrg      # Solaris 8's {/usr,}/bin/sh.
2345e358ecaSmrg      touch sub/conftst$i.h
2355e358ecaSmrg    done
2365e358ecaSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2375e358ecaSmrg
2385e358ecaSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2395e358ecaSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2405e358ecaSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
2415e358ecaSmrg    # versions had trouble with output in subdirs
2425e358ecaSmrg    am__obj=sub/conftest.${OBJEXT-o}
2435e358ecaSmrg    am__minus_obj="-o $am__obj"
2445e358ecaSmrg    case $depmode in
2455e358ecaSmrg    gcc)
2465e358ecaSmrg      # This depmode causes a compiler race in universal mode.
2475e358ecaSmrg      test "$am__universal" = false || continue
2485e358ecaSmrg      ;;
2495e358ecaSmrg    nosideeffect)
2505e358ecaSmrg      # after this tag, mechanisms are not by side-effect, so they'll
2515e358ecaSmrg      # only be used when explicitly requested
2525e358ecaSmrg      if test "x$enable_dependency_tracking" = xyes; then
2535e358ecaSmrg	continue
2545e358ecaSmrg      else
2555e358ecaSmrg	break
2565e358ecaSmrg      fi
2575e358ecaSmrg      ;;
2585e358ecaSmrg    msvisualcpp | msvcmsys)
2595e358ecaSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
2605e358ecaSmrg      # not run yet.  These depmodes are late enough in the game, and
2615e358ecaSmrg      # so weak that their functioning should not be impacted.
2625e358ecaSmrg      am__obj=conftest.${OBJEXT-o}
2635e358ecaSmrg      am__minus_obj=
2645e358ecaSmrg      ;;
2655e358ecaSmrg    none) break ;;
2665e358ecaSmrg    esac
2675e358ecaSmrg    if depmode=$depmode \
2685e358ecaSmrg       source=sub/conftest.c object=$am__obj \
2695e358ecaSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2705e358ecaSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2715e358ecaSmrg         >/dev/null 2>conftest.err &&
2725e358ecaSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2735e358ecaSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2745e358ecaSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2755e358ecaSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2765e358ecaSmrg      # icc doesn't choke on unknown options, it will just issue warnings
2775e358ecaSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
2785e358ecaSmrg      # that says an option was ignored or not supported.
2795e358ecaSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2805e358ecaSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2815e358ecaSmrg      # The diagnosis changed in icc 8.0:
2825e358ecaSmrg      #   icc: Command line remark: option '-MP' not supported
2835e358ecaSmrg      if (grep 'ignoring option' conftest.err ||
2845e358ecaSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2855e358ecaSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2865e358ecaSmrg        break
2875e358ecaSmrg      fi
2885e358ecaSmrg    fi
2895e358ecaSmrg  done
2905e358ecaSmrg
2915e358ecaSmrg  cd ..
2925e358ecaSmrg  rm -rf conftest.dir
293afe13c8eSmrgelse
2945e358ecaSmrg  am_cv_$1_dependencies_compiler_type=none
295afe13c8eSmrgfi
2965e358ecaSmrg])
2975e358ecaSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2985e358ecaSmrgAM_CONDITIONAL([am__fastdep$1], [
2995e358ecaSmrg  test "x$enable_dependency_tracking" != xno \
3005e358ecaSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3015e358ecaSmrg])
302b3307321Smrg
3035e358ecaSmrg
3045e358ecaSmrg# AM_SET_DEPDIR
3055e358ecaSmrg# -------------
3065e358ecaSmrg# Choose a directory name for dependency files.
3075e358ecaSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
3085e358ecaSmrgAC_DEFUN([AM_SET_DEPDIR],
3095e358ecaSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3105e358ecaSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3115e358ecaSmrg])
3125e358ecaSmrg
3135e358ecaSmrg
3145e358ecaSmrg# AM_DEP_TRACK
3155e358ecaSmrg# ------------
3165e358ecaSmrgAC_DEFUN([AM_DEP_TRACK],
3175e358ecaSmrg[AC_ARG_ENABLE(dependency-tracking,
3185e358ecaSmrg[  --disable-dependency-tracking  speeds up one-time build
3195e358ecaSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
3205e358ecaSmrgif test "x$enable_dependency_tracking" != xno; then
3215e358ecaSmrg  am_depcomp="$ac_aux_dir/depcomp"
3225e358ecaSmrg  AMDEPBACKSLASH='\'
323afe13c8eSmrgfi
3245e358ecaSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3255e358ecaSmrgAC_SUBST([AMDEPBACKSLASH])dnl
3265e358ecaSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3275e358ecaSmrg])
328b3307321Smrg
3295e358ecaSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3305e358ecaSmrg
3315e358ecaSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
3325e358ecaSmrg# Free Software Foundation, Inc.
333b3307321Smrg#
3345e358ecaSmrg# This file is free software; the Free Software Foundation
3355e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
3365e358ecaSmrg# with or without modifications, as long as this notice is preserved.
337b3307321Smrg
3385e358ecaSmrg#serial 5
339b3307321Smrg
3405e358ecaSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3415e358ecaSmrg# ------------------------------
3425e358ecaSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3435e358ecaSmrg[{
3445e358ecaSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
3455e358ecaSmrg  # are listed without --file.  Let's play safe and only enable the eval
3465e358ecaSmrg  # if we detect the quoting.
3475e358ecaSmrg  case $CONFIG_FILES in
3485e358ecaSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
3495e358ecaSmrg  *)   set x $CONFIG_FILES ;;
3505e358ecaSmrg  esac
3515e358ecaSmrg  shift
3525e358ecaSmrg  for mf
3535e358ecaSmrg  do
3545e358ecaSmrg    # Strip MF so we end up with the name of the file.
3555e358ecaSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3565e358ecaSmrg    # Check whether this is an Automake generated Makefile or not.
3575e358ecaSmrg    # We used to match only the files named `Makefile.in', but
3585e358ecaSmrg    # some people rename them; so instead we look at the file content.
3595e358ecaSmrg    # Grep'ing the first line is not enough: some people post-process
3605e358ecaSmrg    # each Makefile.in and add a new line on top of each file to say so.
3615e358ecaSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
3625e358ecaSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
3635e358ecaSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3645e358ecaSmrg      dirpart=`AS_DIRNAME("$mf")`
3655e358ecaSmrg    else
3665e358ecaSmrg      continue
3675e358ecaSmrg    fi
3685e358ecaSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
3695e358ecaSmrg    # from the Makefile without running `make'.
3705e358ecaSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3715e358ecaSmrg    test -z "$DEPDIR" && continue
3725e358ecaSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3735e358ecaSmrg    test -z "am__include" && continue
3745e358ecaSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3755e358ecaSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
3765e358ecaSmrg    U=`sed -n 's/^U = //p' < "$mf"`
3775e358ecaSmrg    # Find all dependency output files, they are included files with
3785e358ecaSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3795e358ecaSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3805e358ecaSmrg    # expansion.
3815e358ecaSmrg    for file in `sed -n "
3825e358ecaSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3835e358ecaSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3845e358ecaSmrg      # Make sure the directory exists.
3855e358ecaSmrg      test -f "$dirpart/$file" && continue
3865e358ecaSmrg      fdir=`AS_DIRNAME(["$file"])`
3875e358ecaSmrg      AS_MKDIR_P([$dirpart/$fdir])
3885e358ecaSmrg      # echo "creating $dirpart/$file"
3895e358ecaSmrg      echo '# dummy' > "$dirpart/$file"
3905e358ecaSmrg    done
3915e358ecaSmrg  done
3925e358ecaSmrg}
3935e358ecaSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
394b3307321Smrg
395b3307321Smrg
3965e358ecaSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3975e358ecaSmrg# -----------------------------
3985e358ecaSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
3995e358ecaSmrg#
4005e358ecaSmrg# This code is only required when automatic dependency tracking
4015e358ecaSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
4025e358ecaSmrg# need in order to bootstrap the dependency handling code.
4035e358ecaSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4045e358ecaSmrg[AC_CONFIG_COMMANDS([depfiles],
4055e358ecaSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4065e358ecaSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4075e358ecaSmrg])
408b3307321Smrg
4095e358ecaSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
4105e358ecaSmrg# Free Software Foundation, Inc.
4115e358ecaSmrg#
4125e358ecaSmrg# This file is free software; the Free Software Foundation
4135e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
4145e358ecaSmrg# with or without modifications, as long as this notice is preserved.
415b3307321Smrg
4165e358ecaSmrg# serial 8
417b3307321Smrg
4185e358ecaSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
4195e358ecaSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
4205e358ecaSmrg
4215e358ecaSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4225e358ecaSmrg
4235e358ecaSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4245e358ecaSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
4255e358ecaSmrg#
4265e358ecaSmrg# This file is free software; the Free Software Foundation
4275e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
4285e358ecaSmrg# with or without modifications, as long as this notice is preserved.
4295e358ecaSmrg
4305e358ecaSmrg# serial 16
4315e358ecaSmrg
4325e358ecaSmrg# This macro actually does too much.  Some checks are only needed if
4335e358ecaSmrg# your package does certain things.  But this isn't really a big deal.
4345e358ecaSmrg
4355e358ecaSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4365e358ecaSmrg# AM_INIT_AUTOMAKE([OPTIONS])
4375e358ecaSmrg# -----------------------------------------------
4385e358ecaSmrg# The call with PACKAGE and VERSION arguments is the old style
4395e358ecaSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
4405e358ecaSmrg# and VERSION should now be passed to AC_INIT and removed from
4415e358ecaSmrg# the call to AM_INIT_AUTOMAKE.
4425e358ecaSmrg# We support both call styles for the transition.  After
4435e358ecaSmrg# the next Automake release, Autoconf can make the AC_INIT
4445e358ecaSmrg# arguments mandatory, and then we can depend on a new Autoconf
4455e358ecaSmrg# release and drop the old call support.
4465e358ecaSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4475e358ecaSmrg[AC_PREREQ([2.62])dnl
4485e358ecaSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4495e358ecaSmrgdnl the ones we care about.
4505e358ecaSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4515e358ecaSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4525e358ecaSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4535e358ecaSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4545e358ecaSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4555e358ecaSmrg  # is not polluted with repeated "-I."
4565e358ecaSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4575e358ecaSmrg  # test to see if srcdir already configured
4585e358ecaSmrg  if test -f $srcdir/config.status; then
4595e358ecaSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4605e358ecaSmrg  fi
461afe13c8eSmrgfi
4625e358ecaSmrg
4635e358ecaSmrg# test whether we have cygpath
4645e358ecaSmrgif test -z "$CYGPATH_W"; then
4655e358ecaSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4665e358ecaSmrg    CYGPATH_W='cygpath -w'
4675e358ecaSmrg  else
4685e358ecaSmrg    CYGPATH_W=echo
4695e358ecaSmrg  fi
470b3307321Smrgfi
4715e358ecaSmrgAC_SUBST([CYGPATH_W])
472b3307321Smrg
4735e358ecaSmrg# Define the identity of the package.
4745e358ecaSmrgdnl Distinguish between old-style and new-style calls.
4755e358ecaSmrgm4_ifval([$2],
4765e358ecaSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4775e358ecaSmrg AC_SUBST([PACKAGE], [$1])dnl
4785e358ecaSmrg AC_SUBST([VERSION], [$2])],
4795e358ecaSmrg[_AM_SET_OPTIONS([$1])dnl
4805e358ecaSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4815e358ecaSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4825e358ecaSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4835e358ecaSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4845e358ecaSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
485b3307321Smrg
4865e358ecaSmrg_AM_IF_OPTION([no-define],,
4875e358ecaSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4885e358ecaSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
489b3307321Smrg
4905e358ecaSmrg# Some tools Automake needs.
4915e358ecaSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4925e358ecaSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4935e358ecaSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4945e358ecaSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4955e358ecaSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4965e358ecaSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4975e358ecaSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4985e358ecaSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4995e358ecaSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
5005e358ecaSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
5015e358ecaSmrg# We need awk for the "check" target.  The system "awk" is bad on
5025e358ecaSmrg# some platforms.
5035e358ecaSmrgAC_REQUIRE([AC_PROG_AWK])dnl
5045e358ecaSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
5055e358ecaSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
5065e358ecaSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
5075e358ecaSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
5085e358ecaSmrg			     [_AM_PROG_TAR([v7])])])
5095e358ecaSmrg_AM_IF_OPTION([no-dependencies],,
5105e358ecaSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
5115e358ecaSmrg		  [_AM_DEPENDENCIES(CC)],
5125e358ecaSmrg		  [define([AC_PROG_CC],
5135e358ecaSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
5145e358ecaSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5155e358ecaSmrg		  [_AM_DEPENDENCIES(CXX)],
5165e358ecaSmrg		  [define([AC_PROG_CXX],
5175e358ecaSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5185e358ecaSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5195e358ecaSmrg		  [_AM_DEPENDENCIES(OBJC)],
5205e358ecaSmrg		  [define([AC_PROG_OBJC],
5215e358ecaSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
5225e358ecaSmrg])
5235e358ecaSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5245e358ecaSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5255e358ecaSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5265e358ecaSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5275e358ecaSmrgAC_CONFIG_COMMANDS_PRE(dnl
5285e358ecaSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5295e358ecaSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5305e358ecaSmrg])
531b3307321Smrg
5325e358ecaSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5335e358ecaSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5345e358ecaSmrgdnl mangled by Autoconf and run in a shell conditional statement.
5355e358ecaSmrgm4_define([_AC_COMPILER_EXEEXT],
5365e358ecaSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
537b3307321Smrg
538b3307321Smrg
5395e358ecaSmrg# When config.status generates a header, we must update the stamp-h file.
5405e358ecaSmrg# This file resides in the same directory as the config header
5415e358ecaSmrg# that is generated.  The stamp files are numbered to have different names.
5425e358ecaSmrg
5435e358ecaSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
5445e358ecaSmrg# loop where config.status creates the headers, so we can generate
5455e358ecaSmrg# our stamp files there.
5465e358ecaSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
5475e358ecaSmrg[# Compute $1's index in $config_headers.
5485e358ecaSmrg_am_arg=$1
5495e358ecaSmrg_am_stamp_count=1
5505e358ecaSmrgfor _am_header in $config_headers :; do
5515e358ecaSmrg  case $_am_header in
5525e358ecaSmrg    $_am_arg | $_am_arg:* )
5535e358ecaSmrg      break ;;
5545e358ecaSmrg    * )
5555e358ecaSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5565e358ecaSmrg  esac
5575e358ecaSmrgdone
5585e358ecaSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
5595e358ecaSmrg
5605e358ecaSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
5615e358ecaSmrg#
5625e358ecaSmrg# This file is free software; the Free Software Foundation
5635e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
5645e358ecaSmrg# with or without modifications, as long as this notice is preserved.
565b3307321Smrg
5665e358ecaSmrg# AM_PROG_INSTALL_SH
5675e358ecaSmrg# ------------------
5685e358ecaSmrg# Define $install_sh.
5695e358ecaSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5705e358ecaSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5715e358ecaSmrgif test x"${install_sh}" != xset; then
5725e358ecaSmrg  case $am_aux_dir in
5735e358ecaSmrg  *\ * | *\	*)
5745e358ecaSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5755e358ecaSmrg  *)
5765e358ecaSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5775e358ecaSmrg  esac
578afe13c8eSmrgfi
5795e358ecaSmrgAC_SUBST(install_sh)])
580b3307321Smrg
5815e358ecaSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5825e358ecaSmrg#
5835e358ecaSmrg# This file is free software; the Free Software Foundation
5845e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
5855e358ecaSmrg# with or without modifications, as long as this notice is preserved.
586b3307321Smrg
5875e358ecaSmrg# serial 2
588afe13c8eSmrg
5895e358ecaSmrg# Check whether the underlying file-system supports filenames
5905e358ecaSmrg# with a leading dot.  For instance MS-DOS doesn't.
5915e358ecaSmrgAC_DEFUN([AM_SET_LEADING_DOT],
5925e358ecaSmrg[rm -rf .tst 2>/dev/null
5935e358ecaSmrgmkdir .tst 2>/dev/null
5945e358ecaSmrgif test -d .tst; then
5955e358ecaSmrg  am__leading_dot=.
596b3307321Smrgelse
5975e358ecaSmrg  am__leading_dot=_
598b3307321Smrgfi
5995e358ecaSmrgrmdir .tst 2>/dev/null
6005e358ecaSmrgAC_SUBST([am__leading_dot])])
601b3307321Smrg
6025e358ecaSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
6035e358ecaSmrg# From Jim Meyering
604b3307321Smrg
6055e358ecaSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
6065e358ecaSmrg# Free Software Foundation, Inc.
6075e358ecaSmrg#
6085e358ecaSmrg# This file is free software; the Free Software Foundation
6095e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
6105e358ecaSmrg# with or without modifications, as long as this notice is preserved.
611b3307321Smrg
6125e358ecaSmrg# serial 5
613b3307321Smrg
6145e358ecaSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6155e358ecaSmrg# ----------------------------------
6165e358ecaSmrg# Control maintainer-specific portions of Makefiles.
6175e358ecaSmrg# Default is to disable them, unless `enable' is passed literally.
6185e358ecaSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6195e358ecaSmrg# can override the default with the --enable/--disable switch.
6205e358ecaSmrgAC_DEFUN([AM_MAINTAINER_MODE],
6215e358ecaSmrg[m4_case(m4_default([$1], [disable]),
6225e358ecaSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
6235e358ecaSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
6245e358ecaSmrg       [m4_define([am_maintainer_other], [enable])
6255e358ecaSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6265e358ecaSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6275e358ecaSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6285e358ecaSmrg  AC_ARG_ENABLE([maintainer-mode],
6295e358ecaSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
6305e358ecaSmrg			  (and sometimes confusing) to the casual installer],
6315e358ecaSmrg      [USE_MAINTAINER_MODE=$enableval],
6325e358ecaSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
6335e358ecaSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6345e358ecaSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
6355e358ecaSmrg  MAINT=$MAINTAINER_MODE_TRUE
6365e358ecaSmrg  AC_SUBST([MAINT])dnl
6375e358ecaSmrg]
6385e358ecaSmrg)
639b3307321Smrg
6405e358ecaSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
641afe13c8eSmrg
6425e358ecaSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
643afe13c8eSmrg
6445e358ecaSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
6455e358ecaSmrg#
6465e358ecaSmrg# This file is free software; the Free Software Foundation
6475e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
6485e358ecaSmrg# with or without modifications, as long as this notice is preserved.
649afe13c8eSmrg
6505e358ecaSmrg# serial 4
651b3307321Smrg
6525e358ecaSmrg# AM_MAKE_INCLUDE()
6535e358ecaSmrg# -----------------
6545e358ecaSmrg# Check to see how make treats includes.
6555e358ecaSmrgAC_DEFUN([AM_MAKE_INCLUDE],
6565e358ecaSmrg[am_make=${MAKE-make}
6575e358ecaSmrgcat > confinc << 'END'
6585e358ecaSmrgam__doit:
6595e358ecaSmrg	@echo this is the am__doit target
6605e358ecaSmrg.PHONY: am__doit
6615e358ecaSmrgEND
6625e358ecaSmrg# If we don't find an include directive, just comment out the code.
6635e358ecaSmrgAC_MSG_CHECKING([for style of include used by $am_make])
6645e358ecaSmrgam__include="#"
6655e358ecaSmrgam__quote=
6665e358ecaSmrg_am_result=none
6675e358ecaSmrg# First try GNU make style include.
6685e358ecaSmrgecho "include confinc" > confmf
6695e358ecaSmrg# Ignore all kinds of additional output from `make'.
6705e358ecaSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6715e358ecaSmrg*the\ am__doit\ target*)
6725e358ecaSmrg  am__include=include
6735e358ecaSmrg  am__quote=
6745e358ecaSmrg  _am_result=GNU
6755e358ecaSmrg  ;;
6765e358ecaSmrgesac
6775e358ecaSmrg# Now try BSD make style include.
6785e358ecaSmrgif test "$am__include" = "#"; then
6795e358ecaSmrg   echo '.include "confinc"' > confmf
6805e358ecaSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6815e358ecaSmrg   *the\ am__doit\ target*)
6825e358ecaSmrg     am__include=.include
6835e358ecaSmrg     am__quote="\""
6845e358ecaSmrg     _am_result=BSD
6855e358ecaSmrg     ;;
6865e358ecaSmrg   esac
687afe13c8eSmrgfi
6885e358ecaSmrgAC_SUBST([am__include])
6895e358ecaSmrgAC_SUBST([am__quote])
6905e358ecaSmrgAC_MSG_RESULT([$_am_result])
6915e358ecaSmrgrm -f confinc confmf
6925e358ecaSmrg])
693b3307321Smrg
6945e358ecaSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
695b3307321Smrg
6965e358ecaSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
6975e358ecaSmrg# Free Software Foundation, Inc.
6985e358ecaSmrg#
6995e358ecaSmrg# This file is free software; the Free Software Foundation
7005e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
7015e358ecaSmrg# with or without modifications, as long as this notice is preserved.
702b3307321Smrg
7035e358ecaSmrg# serial 6
704b3307321Smrg
7055e358ecaSmrg# AM_MISSING_PROG(NAME, PROGRAM)
7065e358ecaSmrg# ------------------------------
7075e358ecaSmrgAC_DEFUN([AM_MISSING_PROG],
7085e358ecaSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
7095e358ecaSmrg$1=${$1-"${am_missing_run}$2"}
7105e358ecaSmrgAC_SUBST($1)])
711b3307321Smrg
712b3307321Smrg
7135e358ecaSmrg# AM_MISSING_HAS_RUN
7145e358ecaSmrg# ------------------
7155e358ecaSmrg# Define MISSING if not defined so far and test if it supports --run.
7165e358ecaSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
7175e358ecaSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7185e358ecaSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7195e358ecaSmrgAC_REQUIRE_AUX_FILE([missing])dnl
7205e358ecaSmrgif test x"${MISSING+set}" != xset; then
7215e358ecaSmrg  case $am_aux_dir in
7225e358ecaSmrg  *\ * | *\	*)
7235e358ecaSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7245e358ecaSmrg  *)
7255e358ecaSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7265e358ecaSmrg  esac
727afe13c8eSmrgfi
7285e358ecaSmrg# Use eval to expand $SHELL
7295e358ecaSmrgif eval "$MISSING --run true"; then
7305e358ecaSmrg  am_missing_run="$MISSING --run "
731afe13c8eSmrgelse
7325e358ecaSmrg  am_missing_run=
7335e358ecaSmrg  AC_MSG_WARN([`missing' script is too old or missing])
734afe13c8eSmrgfi
7355e358ecaSmrg])
736b3307321Smrg
7375e358ecaSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
738afe13c8eSmrg#
7395e358ecaSmrg# This file is free software; the Free Software Foundation
7405e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
7415e358ecaSmrg# with or without modifications, as long as this notice is preserved.
742b3307321Smrg
7435e358ecaSmrg# AM_PROG_MKDIR_P
7445e358ecaSmrg# ---------------
7455e358ecaSmrg# Check for `mkdir -p'.
7465e358ecaSmrgAC_DEFUN([AM_PROG_MKDIR_P],
7475e358ecaSmrg[AC_PREREQ([2.60])dnl
7485e358ecaSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7495e358ecaSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7505e358ecaSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
7515e358ecaSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7525e358ecaSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7535e358ecaSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7545e358ecaSmrgdnl adjustment using top_builddir (which is defined more often than
7555e358ecaSmrgdnl MKDIR_P).
7565e358ecaSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7575e358ecaSmrgcase $mkdir_p in
7585e358ecaSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7595e358ecaSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7605e358ecaSmrgesac
7615e358ecaSmrg])
762b3307321Smrg
7635e358ecaSmrg# Helper functions for option handling.                     -*- Autoconf -*-
764b3307321Smrg
7655e358ecaSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
766afe13c8eSmrg#
7675e358ecaSmrg# This file is free software; the Free Software Foundation
7685e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
7695e358ecaSmrg# with or without modifications, as long as this notice is preserved.
770b3307321Smrg
7715e358ecaSmrg# serial 4
772b3307321Smrg
7735e358ecaSmrg# _AM_MANGLE_OPTION(NAME)
7745e358ecaSmrg# -----------------------
7755e358ecaSmrgAC_DEFUN([_AM_MANGLE_OPTION],
7765e358ecaSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
777b3307321Smrg
7785e358ecaSmrg# _AM_SET_OPTION(NAME)
7795e358ecaSmrg# ------------------------------
7805e358ecaSmrg# Set option NAME.  Presently that only means defining a flag for this option.
7815e358ecaSmrgAC_DEFUN([_AM_SET_OPTION],
7825e358ecaSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
783b3307321Smrg
7845e358ecaSmrg# _AM_SET_OPTIONS(OPTIONS)
7855e358ecaSmrg# ----------------------------------
7865e358ecaSmrg# OPTIONS is a space-separated list of Automake options.
7875e358ecaSmrgAC_DEFUN([_AM_SET_OPTIONS],
7885e358ecaSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
789b3307321Smrg
7905e358ecaSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7915e358ecaSmrg# -------------------------------------------
7925e358ecaSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7935e358ecaSmrgAC_DEFUN([_AM_IF_OPTION],
7945e358ecaSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7955e358ecaSmrg
7965e358ecaSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7975e358ecaSmrg
7985e358ecaSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
7995e358ecaSmrg# Free Software Foundation, Inc.
800afe13c8eSmrg#
801afe13c8eSmrg# This file is free software; the Free Software Foundation
802afe13c8eSmrg# gives unlimited permission to copy and/or distribute it,
803afe13c8eSmrg# with or without modifications, as long as this notice is preserved.
804b3307321Smrg
8055e358ecaSmrg# serial 5
806b3307321Smrg
8075e358ecaSmrg# AM_SANITY_CHECK
8085e358ecaSmrg# ---------------
8095e358ecaSmrgAC_DEFUN([AM_SANITY_CHECK],
8105e358ecaSmrg[AC_MSG_CHECKING([whether build environment is sane])
8115e358ecaSmrg# Just in case
8125e358ecaSmrgsleep 1
8135e358ecaSmrgecho timestamp > conftest.file
8145e358ecaSmrg# Reject unsafe characters in $srcdir or the absolute working directory
8155e358ecaSmrg# name.  Accept space and tab only in the latter.
8165e358ecaSmrgam_lf='
8175e358ecaSmrg'
8185e358ecaSmrgcase `pwd` in
8195e358ecaSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8205e358ecaSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8215e358ecaSmrgesac
8225e358ecaSmrgcase $srcdir in
8235e358ecaSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8245e358ecaSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8255e358ecaSmrgesac
826b3307321Smrg
8275e358ecaSmrg# Do `set' in a subshell so we don't clobber the current shell's
8285e358ecaSmrg# arguments.  Must try -L first in case configure is actually a
8295e358ecaSmrg# symlink; some systems play weird games with the mod time of symlinks
8305e358ecaSmrg# (eg FreeBSD returns the mod time of the symlink's containing
8315e358ecaSmrg# directory).
8325e358ecaSmrgif (
8335e358ecaSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8345e358ecaSmrg   if test "$[*]" = "X"; then
8355e358ecaSmrg      # -L didn't work.
8365e358ecaSmrg      set X `ls -t "$srcdir/configure" conftest.file`
8375e358ecaSmrg   fi
8385e358ecaSmrg   rm -f conftest.file
8395e358ecaSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
8405e358ecaSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
841b3307321Smrg
8425e358ecaSmrg      # If neither matched, then we have a broken ls.  This can happen
8435e358ecaSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
8445e358ecaSmrg      # broken ls alias from the environment.  This has actually
8455e358ecaSmrg      # happened.  Such a system could not be considered "sane".
8465e358ecaSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8475e358ecaSmrgalias in your environment])
8485e358ecaSmrg   fi
849b3307321Smrg
8505e358ecaSmrg   test "$[2]" = conftest.file
8515e358ecaSmrg   )
8525e358ecaSmrgthen
8535e358ecaSmrg   # Ok.
8545e358ecaSmrg   :
8555e358ecaSmrgelse
8565e358ecaSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
8575e358ecaSmrgCheck your system clock])
8585e358ecaSmrgfi
8595e358ecaSmrgAC_MSG_RESULT(yes)])
8605e358ecaSmrg
8615e358ecaSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
862afe13c8eSmrg#
863afe13c8eSmrg# This file is free software; the Free Software Foundation
864afe13c8eSmrg# gives unlimited permission to copy and/or distribute it,
865afe13c8eSmrg# with or without modifications, as long as this notice is preserved.
866b3307321Smrg
8675e358ecaSmrg# serial 1
868b3307321Smrg
8695e358ecaSmrg# AM_SILENT_RULES([DEFAULT])
8705e358ecaSmrg# --------------------------
8715e358ecaSmrg# Enable less verbose build rules; with the default set to DEFAULT
8725e358ecaSmrg# (`yes' being less verbose, `no' or empty being verbose).
8735e358ecaSmrgAC_DEFUN([AM_SILENT_RULES],
8745e358ecaSmrg[AC_ARG_ENABLE([silent-rules],
8755e358ecaSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8765e358ecaSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8775e358ecaSmrgcase $enable_silent_rules in
8785e358ecaSmrgyes) AM_DEFAULT_VERBOSITY=0;;
8795e358ecaSmrgno)  AM_DEFAULT_VERBOSITY=1;;
8805e358ecaSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8815e358ecaSmrgesac
8825e358ecaSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8835e358ecaSmrgAM_BACKSLASH='\'
8845e358ecaSmrgAC_SUBST([AM_BACKSLASH])dnl
8855e358ecaSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
886afe13c8eSmrg])
887afe13c8eSmrg
8885e358ecaSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8895e358ecaSmrg#
8905e358ecaSmrg# This file is free software; the Free Software Foundation
8915e358ecaSmrg# gives unlimited permission to copy and/or distribute it,
8925e358ecaSmrg# with or without modifications, as long as this notice is preserved.
8935e358ecaSmrg
8945e358ecaSmrg# AM_PROG_INSTALL_STRIP
8955e358ecaSmrg# ---------------------
8965e358ecaSmrg# One issue with vendor `install' (even GNU) is that you can't
8975e358ecaSmrg# specify the program used to strip binaries.  This is especially
8985e358ecaSmrg# annoying in cross-compiling environments, where the build's strip
8995e358ecaSmrg# is unlikely to handle the host's binaries.
9005e358ecaSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9015e358ecaSmrg# always use install-sh in `make install-strip', and initialize
9025e358ecaSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
9035e358ecaSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
9045e358ecaSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9055e358ecaSmrg# Installed binaries are usually stripped using `strip' when the user
9065e358ecaSmrg# run `make install-strip'.  However `strip' might not be the right
9075e358ecaSmrg# tool to use in cross-compilation environments, therefore Automake
9085e358ecaSmrg# will honor the `STRIP' environment variable to overrule this program.
9095e358ecaSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
9105e358ecaSmrgif test "$cross_compiling" != no; then
9115e358ecaSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
9125e358ecaSmrgfi
9135e358ecaSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9145e358ecaSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
915afe13c8eSmrg
9165e358ecaSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
917afe13c8eSmrg#
918afe13c8eSmrg# This file is free software; the Free Software Foundation
919afe13c8eSmrg# gives unlimited permission to copy and/or distribute it,
920afe13c8eSmrg# with or without modifications, as long as this notice is preserved.
921afe13c8eSmrg
9225e358ecaSmrg# serial 2
923afe13c8eSmrg
9245e358ecaSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
9255e358ecaSmrg# ---------------------------
9265e358ecaSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9275e358ecaSmrg# This macro is traced by Automake.
9285e358ecaSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
929afe13c8eSmrg
9305e358ecaSmrg# AM_SUBST_NOTMAKE(VARIABLE)
9315e358ecaSmrg# ---------------------------
9325e358ecaSmrg# Public sister of _AM_SUBST_NOTMAKE.
9335e358ecaSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9345e358ecaSmrg
9355e358ecaSmrg# Check how to create a tarball.                            -*- Autoconf -*-
9365e358ecaSmrg
9375e358ecaSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
938afe13c8eSmrg#
939afe13c8eSmrg# This file is free software; the Free Software Foundation
940afe13c8eSmrg# gives unlimited permission to copy and/or distribute it,
941afe13c8eSmrg# with or without modifications, as long as this notice is preserved.
942b3307321Smrg
9435e358ecaSmrg# serial 2
944b3307321Smrg
9455e358ecaSmrg# _AM_PROG_TAR(FORMAT)
9465e358ecaSmrg# --------------------
9475e358ecaSmrg# Check how to create a tarball in format FORMAT.
9485e358ecaSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
949b3307321Smrg#
9505e358ecaSmrg# Substitute a variable $(am__tar) that is a command
9515e358ecaSmrg# writing to stdout a FORMAT-tarball containing the directory
9525e358ecaSmrg# $tardir.
9535e358ecaSmrg#     tardir=directory && $(am__tar) > result.tar
9545e358ecaSmrg#
9555e358ecaSmrg# Substitute a variable $(am__untar) that extract such
9565e358ecaSmrg# a tarball read from stdin.
9575e358ecaSmrg#     $(am__untar) < result.tar
9585e358ecaSmrgAC_DEFUN([_AM_PROG_TAR],
9595e358ecaSmrg[# Always define AMTAR for backward compatibility.
9605e358ecaSmrgAM_MISSING_PROG([AMTAR], [tar])
9615e358ecaSmrgm4_if([$1], [v7],
9625e358ecaSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
9635e358ecaSmrg     [m4_case([$1], [ustar],, [pax],,
9645e358ecaSmrg              [m4_fatal([Unknown tar format])])
9655e358ecaSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
9665e358ecaSmrg# Loop over all known methods to create a tar archive until one works.
9675e358ecaSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9685e358ecaSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
9695e358ecaSmrg# Do not fold the above two line into one, because Tru64 sh and
9705e358ecaSmrg# Solaris sh will not grok spaces in the rhs of `-'.
9715e358ecaSmrgfor _am_tool in $_am_tools
9725e358ecaSmrgdo
9735e358ecaSmrg  case $_am_tool in
9745e358ecaSmrg  gnutar)
9755e358ecaSmrg    for _am_tar in tar gnutar gtar;
9765e358ecaSmrg    do
9775e358ecaSmrg      AM_RUN_LOG([$_am_tar --version]) && break
9785e358ecaSmrg    done
9795e358ecaSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9805e358ecaSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9815e358ecaSmrg    am__untar="$_am_tar -xf -"
9825e358ecaSmrg    ;;
9835e358ecaSmrg  plaintar)
9845e358ecaSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
9855e358ecaSmrg    # ustar tarball either.
9865e358ecaSmrg    (tar --version) >/dev/null 2>&1 && continue
9875e358ecaSmrg    am__tar='tar chf - "$$tardir"'
9885e358ecaSmrg    am__tar_='tar chf - "$tardir"'
9895e358ecaSmrg    am__untar='tar xf -'
9905e358ecaSmrg    ;;
9915e358ecaSmrg  pax)
9925e358ecaSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
9935e358ecaSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
9945e358ecaSmrg    am__untar='pax -r'
9955e358ecaSmrg    ;;
9965e358ecaSmrg  cpio)
9975e358ecaSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9985e358ecaSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9995e358ecaSmrg    am__untar='cpio -i -H $1 -d'
10005e358ecaSmrg    ;;
10015e358ecaSmrg  none)
10025e358ecaSmrg    am__tar=false
10035e358ecaSmrg    am__tar_=false
10045e358ecaSmrg    am__untar=false
10055e358ecaSmrg    ;;
10065e358ecaSmrg  esac
1007b3307321Smrg
10085e358ecaSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
10095e358ecaSmrg  # and am__untar set.
10105e358ecaSmrg  test -n "${am_cv_prog_tar_$1}" && break
1011b3307321Smrg
10125e358ecaSmrg  # tar/untar a dummy directory, and stop if the command works
10135e358ecaSmrg  rm -rf conftest.dir
1014b3307321Smrg  mkdir conftest.dir
10155e358ecaSmrg  echo GrepMe > conftest.dir/file
10165e358ecaSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10175e358ecaSmrg  rm -rf conftest.dir
10185e358ecaSmrg  if test -s conftest.tar; then
10195e358ecaSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
10205e358ecaSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1021b3307321Smrg  fi
10225e358ecaSmrgdone
10235e358ecaSmrgrm -rf conftest.dir
1024b3307321Smrg
10255e358ecaSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10265e358ecaSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
10275e358ecaSmrgAC_SUBST([am__tar])
10285e358ecaSmrgAC_SUBST([am__untar])
10295e358ecaSmrg]) # _AM_PROG_TAR
1030b3307321Smrg
10315e358ecaSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10325e358ecaSmrgdnl
10335e358ecaSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
10345e358ecaSmrgdnl 
10355e358ecaSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
10365e358ecaSmrgdnl copy of this software and associated documentation files (the
10375e358ecaSmrgdnl "Software"), to deal in the Software without restriction, including
10385e358ecaSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
10395e358ecaSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
10405e358ecaSmrgdnl to whom the Software is furnished to do so, provided that the above
10415e358ecaSmrgdnl copyright notice(s) and this permission notice appear in all copies of
10425e358ecaSmrgdnl the Software and that both the above copyright notice(s) and this
10435e358ecaSmrgdnl permission notice appear in supporting documentation.
10445e358ecaSmrgdnl
10455e358ecaSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10465e358ecaSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10475e358ecaSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
10485e358ecaSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
10495e358ecaSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
10505e358ecaSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
10515e358ecaSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
10525e358ecaSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
10535e358ecaSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
10545e358ecaSmrgdnl
10555e358ecaSmrgdnl Except as contained in this notice, the name of a copyright holder
10565e358ecaSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
10575e358ecaSmrgdnl or other dealings in this Software without prior written authorization
10585e358ecaSmrgdnl of the copyright holder.
1059b3307321Smrg
10605e358ecaSmrg# XORG_MACROS_VERSION(required-version)
10615e358ecaSmrg# -------------------------------------
10625e358ecaSmrg# Minimum version: 1.1.0
10635e358ecaSmrg#
10645e358ecaSmrg# If you're using a macro added in Version 1.1 or newer, include this in
10655e358ecaSmrg# your configure.ac with the minimum required version, such as:
10665e358ecaSmrg# XORG_MACROS_VERSION(1.1)
10675e358ecaSmrg#
10685e358ecaSmrg# To ensure that this macro is defined, also add:
10695e358ecaSmrg# m4_ifndef([XORG_MACROS_VERSION],
10705e358ecaSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10715e358ecaSmrg#
10725e358ecaSmrg#
10735e358ecaSmrg# See the "minimum version" comment for each macro you use to see what 
10745e358ecaSmrg# version you require.
10755e358ecaSmrgm4_defun([XORG_MACROS_VERSION],[
10765e358ecaSmrgm4_define([vers_have], [1.3.0])
10775e358ecaSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10785e358ecaSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10795e358ecaSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
10805e358ecaSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
10815e358ecaSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
10825e358ecaSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
10835e358ecaSmrgm4_undefine([vers_have])
10845e358ecaSmrgm4_undefine([maj_have])
10855e358ecaSmrgm4_undefine([maj_needed])
10865e358ecaSmrg]) # XORG_MACROS_VERSION
1087b3307321Smrg
10885e358ecaSmrg# XORG_PROG_RAWCPP()
10895e358ecaSmrg# ------------------
10905e358ecaSmrg# Minimum version: 1.0.0
10915e358ecaSmrg#
10925e358ecaSmrg# Find cpp program and necessary flags for use in pre-processing text files
10935e358ecaSmrg# such as man pages and config files
10945e358ecaSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
10955e358ecaSmrgAC_REQUIRE([AC_PROG_CPP])
10965e358ecaSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
10975e358ecaSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1098b3307321Smrg
10995e358ecaSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
11005e358ecaSmrg# which is not the best choice for supporting other OS'es, but covers most
11015e358ecaSmrg# of the ones we need for now.
11025e358ecaSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
11035e358ecaSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
11045e358ecaSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11055e358ecaSmrg	AC_MSG_RESULT([no])
11065e358ecaSmrgelse
11075e358ecaSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11085e358ecaSmrg		RAWCPPFLAGS=-undef
11095e358ecaSmrg		AC_MSG_RESULT([yes])
11105e358ecaSmrg	# under Cygwin unix is still defined even with -undef
11115e358ecaSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11125e358ecaSmrg		RAWCPPFLAGS="-undef -ansi"
11135e358ecaSmrg		AC_MSG_RESULT([yes, with -ansi])
11145e358ecaSmrg	else
11155e358ecaSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
11165e358ecaSmrg	fi
1117b3307321Smrgfi
11185e358ecaSmrgrm -f conftest.$ac_ext
1119b3307321Smrg
11205e358ecaSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
11215e358ecaSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
11225e358ecaSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11235e358ecaSmrg	AC_MSG_RESULT([no])
11245e358ecaSmrgelse
11255e358ecaSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
11265e358ecaSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
11275e358ecaSmrg		AC_MSG_RESULT([yes])
11285e358ecaSmrg	else
11295e358ecaSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
11305e358ecaSmrg	fi
11315e358ecaSmrgfi
11325e358ecaSmrgrm -f conftest.$ac_ext
11335e358ecaSmrgAC_SUBST(RAWCPPFLAGS)
11345e358ecaSmrg]) # XORG_PROG_RAWCPP
1135b3307321Smrg
11365e358ecaSmrg# XORG_MANPAGE_SECTIONS()
11375e358ecaSmrg# -----------------------
11385e358ecaSmrg# Minimum version: 1.0.0
1139afe13c8eSmrg#
11405e358ecaSmrg# Determine which sections man pages go in for the different man page types
11415e358ecaSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
11425e358ecaSmrg# Not sure if there's any better way than just hardcoding by OS name.
11435e358ecaSmrg# Override default settings by setting environment variables
1144b3307321Smrg
11455e358ecaSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
11465e358ecaSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1147b3307321Smrg
11485e358ecaSmrgif test x$APP_MAN_SUFFIX = x    ; then
11495e358ecaSmrg    APP_MAN_SUFFIX=1
11505e358ecaSmrgfi
11515e358ecaSmrgif test x$APP_MAN_DIR = x    ; then
11525e358ecaSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
11535e358ecaSmrgfi
1154b3307321Smrg
11555e358ecaSmrgif test x$LIB_MAN_SUFFIX = x    ; then
11565e358ecaSmrg    LIB_MAN_SUFFIX=3
11575e358ecaSmrgfi
11585e358ecaSmrgif test x$LIB_MAN_DIR = x    ; then
11595e358ecaSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
11605e358ecaSmrgfi
1161b3307321Smrg
11625e358ecaSmrgif test x$FILE_MAN_SUFFIX = x    ; then
11635e358ecaSmrg    case $host_os in
11645e358ecaSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
11655e358ecaSmrg	*)		FILE_MAN_SUFFIX=5  ;;
11665e358ecaSmrg    esac
11675e358ecaSmrgfi
11685e358ecaSmrgif test x$FILE_MAN_DIR = x    ; then
11695e358ecaSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
11705e358ecaSmrgfi
1171b3307321Smrg
11725e358ecaSmrgif test x$MISC_MAN_SUFFIX = x    ; then
11735e358ecaSmrg    case $host_os in
11745e358ecaSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
11755e358ecaSmrg	*)		MISC_MAN_SUFFIX=7  ;;
11765e358ecaSmrg    esac
11775e358ecaSmrgfi
11785e358ecaSmrgif test x$MISC_MAN_DIR = x    ; then
11795e358ecaSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
11805e358ecaSmrgfi
1181b3307321Smrg
11825e358ecaSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
11835e358ecaSmrg    case $host_os in
11845e358ecaSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
11855e358ecaSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
11865e358ecaSmrg    esac
11875e358ecaSmrgfi
11885e358ecaSmrgif test x$DRIVER_MAN_DIR = x    ; then
11895e358ecaSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
11905e358ecaSmrgfi
1191b3307321Smrg
11925e358ecaSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
11935e358ecaSmrg    case $host_os in
11945e358ecaSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
11955e358ecaSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
11965e358ecaSmrg    esac
11975e358ecaSmrgfi
11985e358ecaSmrgif test x$ADMIN_MAN_DIR = x    ; then
11995e358ecaSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
12005e358ecaSmrgfi
1201b3307321Smrg
1202b3307321Smrg
12035e358ecaSmrgAC_SUBST([APP_MAN_SUFFIX])
12045e358ecaSmrgAC_SUBST([LIB_MAN_SUFFIX])
12055e358ecaSmrgAC_SUBST([FILE_MAN_SUFFIX])
12065e358ecaSmrgAC_SUBST([MISC_MAN_SUFFIX])
12075e358ecaSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
12085e358ecaSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
12095e358ecaSmrgAC_SUBST([APP_MAN_DIR])
12105e358ecaSmrgAC_SUBST([LIB_MAN_DIR])
12115e358ecaSmrgAC_SUBST([FILE_MAN_DIR])
12125e358ecaSmrgAC_SUBST([MISC_MAN_DIR])
12135e358ecaSmrgAC_SUBST([DRIVER_MAN_DIR])
12145e358ecaSmrgAC_SUBST([ADMIN_MAN_DIR])
12155e358ecaSmrg]) # XORG_MANPAGE_SECTIONS
12165e358ecaSmrg
12175e358ecaSmrg# XORG_CHECK_LINUXDOC
12185e358ecaSmrg# -------------------
12195e358ecaSmrg# Minimum version: 1.0.0
1220afe13c8eSmrg#
12215e358ecaSmrg# Defines the variable MAKE_TEXT if the necessary tools and
12225e358ecaSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
12235e358ecaSmrg# Whether or not the necessary tools and files are found can be checked
12245e358ecaSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
12255e358ecaSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12265e358ecaSmrgif test x$XORG_SGML_PATH = x ; then
12275e358ecaSmrg    XORG_SGML_PATH=$prefix/share/sgml
12285e358ecaSmrgfi
12295e358ecaSmrgHAVE_DEFS_ENT=
1230afe13c8eSmrg
12315e358ecaSmrgif test x"$cross_compiling" = x"yes" ; then
12325e358ecaSmrg  HAVE_DEFS_ENT=no
12335e358ecaSmrgelse
12345e358ecaSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
12355e358ecaSmrgfi
1236afe13c8eSmrg
12375e358ecaSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
12385e358ecaSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
1239afe13c8eSmrg
12405e358ecaSmrgAC_MSG_CHECKING([Whether to build documentation])
1241afe13c8eSmrg
12425e358ecaSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
12435e358ecaSmrg   BUILDDOC=yes
12445e358ecaSmrgelse
12455e358ecaSmrg   BUILDDOC=no
1246afe13c8eSmrgfi
1247afe13c8eSmrg
12485e358ecaSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1249afe13c8eSmrg
12505e358ecaSmrgAC_MSG_RESULT([$BUILDDOC])
1251afe13c8eSmrg
12525e358ecaSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
1253afe13c8eSmrg
12545e358ecaSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
12555e358ecaSmrg   BUILDPDFDOC=yes
12565e358ecaSmrgelse
12575e358ecaSmrg   BUILDPDFDOC=no
12585e358ecaSmrgfi
1259afe13c8eSmrg
12605e358ecaSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1261afe13c8eSmrg
12625e358ecaSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1263afe13c8eSmrg
12645e358ecaSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
12655e358ecaSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
12665e358ecaSmrgMAKE_PDF="$PS2PDF"
12675e358ecaSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1268afe13c8eSmrg
12695e358ecaSmrgAC_SUBST(MAKE_TEXT)
12705e358ecaSmrgAC_SUBST(MAKE_PS)
12715e358ecaSmrgAC_SUBST(MAKE_PDF)
12725e358ecaSmrgAC_SUBST(MAKE_HTML)
12735e358ecaSmrg]) # XORG_CHECK_LINUXDOC
1274afe13c8eSmrg
12755e358ecaSmrg# XORG_CHECK_DOCBOOK
12765e358ecaSmrg# -------------------
12775e358ecaSmrg# Minimum version: 1.0.0
1278afe13c8eSmrg#
12795e358ecaSmrg# Checks for the ability to build output formats from SGML DocBook source.
12805e358ecaSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
12815e358ecaSmrg# indicates whether the necessary tools and files are found and, if set,
12825e358ecaSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
12835e358ecaSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
12845e358ecaSmrgif test x$XORG_SGML_PATH = x ; then
12855e358ecaSmrg    XORG_SGML_PATH=$prefix/share/sgml
12865e358ecaSmrgfi
12875e358ecaSmrgHAVE_DEFS_ENT=
12885e358ecaSmrgBUILDTXTDOC=no
12895e358ecaSmrgBUILDPDFDOC=no
12905e358ecaSmrgBUILDPSDOC=no
12915e358ecaSmrgBUILDHTMLDOC=no
1292b3307321Smrg
12935e358ecaSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
1294b3307321Smrg
12955e358ecaSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
12965e358ecaSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
12975e358ecaSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
12985e358ecaSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1299afe13c8eSmrg
13005e358ecaSmrgAC_MSG_CHECKING([Whether to build text documentation])
13015e358ecaSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
13025e358ecaSmrg   test x$BUILD_TXTDOC != xno; then
13035e358ecaSmrg	BUILDTXTDOC=yes
13045e358ecaSmrgfi
13055e358ecaSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
13065e358ecaSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1307afe13c8eSmrg
13085e358ecaSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
13095e358ecaSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
13105e358ecaSmrg   test x$BUILD_PDFDOC != xno; then
13115e358ecaSmrg	BUILDPDFDOC=yes
13125e358ecaSmrgfi
13135e358ecaSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
13145e358ecaSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1315afe13c8eSmrg
13165e358ecaSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
13175e358ecaSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
13185e358ecaSmrg   test x$BUILD_PSDOC != xno; then
13195e358ecaSmrg	BUILDPSDOC=yes
13205e358ecaSmrgfi
13215e358ecaSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
13225e358ecaSmrgAC_MSG_RESULT([$BUILDPSDOC])
1323afe13c8eSmrg
13245e358ecaSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
13255e358ecaSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
13265e358ecaSmrg   test x$BUILD_HTMLDOC != xno; then
13275e358ecaSmrg	BUILDHTMLDOC=yes
13285e358ecaSmrgfi
13295e358ecaSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
13305e358ecaSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1331afe13c8eSmrg
13325e358ecaSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
13335e358ecaSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
13345e358ecaSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
13355e358ecaSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1336afe13c8eSmrg
13375e358ecaSmrgAC_SUBST(MAKE_TEXT)
13385e358ecaSmrgAC_SUBST(MAKE_PS)
13395e358ecaSmrgAC_SUBST(MAKE_PDF)
13405e358ecaSmrgAC_SUBST(MAKE_HTML)
13415e358ecaSmrg]) # XORG_CHECK_DOCBOOK
1342afe13c8eSmrg
13435e358ecaSmrg# XORG_CHECK_MALLOC_ZERO
13445e358ecaSmrg# ----------------------
13455e358ecaSmrg# Minimum version: 1.0.0
1346afe13c8eSmrg#
13475e358ecaSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
13485e358ecaSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
13495e358ecaSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
13505e358ecaSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
13515e358ecaSmrgAC_ARG_ENABLE(malloc0returnsnull,
13525e358ecaSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
13535e358ecaSmrg		       [malloc(0) returns NULL (default: auto)]),
13545e358ecaSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
13555e358ecaSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1356afe13c8eSmrg
13575e358ecaSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
13585e358ecaSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
13595e358ecaSmrg	AC_RUN_IFELSE([
13605e358ecaSmrgchar *malloc();
13615e358ecaSmrgchar *realloc();
13625e358ecaSmrgchar *calloc();
13635e358ecaSmrgmain() {
13645e358ecaSmrg    char *m0, *r0, *c0, *p;
13655e358ecaSmrg    m0 = malloc(0);
13665e358ecaSmrg    p = malloc(10);
13675e358ecaSmrg    r0 = realloc(p,0);
13685e358ecaSmrg    c0 = calloc(0);
13695e358ecaSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
13705e358ecaSmrg}],
13715e358ecaSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
13725e358ecaSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
1373b3307321Smrgfi
13745e358ecaSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
13755e358ecaSmrg
13765e358ecaSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
13775e358ecaSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
13785e358ecaSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
13795e358ecaSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
13805e358ecaSmrgelse
13815e358ecaSmrg	MALLOC_ZERO_CFLAGS=""
13825e358ecaSmrg	XMALLOC_ZERO_CFLAGS=""
13835e358ecaSmrg	XTMALLOC_ZERO_CFLAGS=""
1384b3307321Smrgfi
1385b3307321Smrg
13865e358ecaSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
13875e358ecaSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
13885e358ecaSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
13895e358ecaSmrg]) # XORG_CHECK_MALLOC_ZERO
13905e358ecaSmrg
13915e358ecaSmrg# XORG_WITH_LINT()
13925e358ecaSmrg# ----------------
13935e358ecaSmrg# Minimum version: 1.1.0
13945e358ecaSmrg#
13955e358ecaSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
13965e358ecaSmrg# is specified.   (Use --with-lint=sparse for sparse.)
13975e358ecaSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
13985e358ecaSmrg# Sets $LINT_FLAGS to flags to pass to source checker
13995e358ecaSmrg# Sets LINT automake conditional if enabled (default: disabled)
1400afe13c8eSmrg#
14015e358ecaSmrgAC_DEFUN([XORG_WITH_LINT],[
1402b3307321Smrg
14035e358ecaSmrg# Allow checking code with lint, sparse, etc.
14045e358ecaSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
14055e358ecaSmrg		[Use a lint-style source code checker (default: disabled)])],
14065e358ecaSmrg		[use_lint=$withval], [use_lint=no])
14075e358ecaSmrgif test "x$use_lint" = "xyes" ; then
14085e358ecaSmrg	LINT="lint"
14095e358ecaSmrgelse
14105e358ecaSmrg	LINT="$use_lint"
14115e358ecaSmrgfi
14125e358ecaSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
14135e358ecaSmrg    case $LINT in
14145e358ecaSmrg	lint|*/lint)
14155e358ecaSmrg	    case $host_os in
14165e358ecaSmrg		solaris*)
14175e358ecaSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
14185e358ecaSmrg			;;
14195e358ecaSmrg	    esac
14205e358ecaSmrg	    ;;
14215e358ecaSmrg    esac
1422afe13c8eSmrgfi
1423b3307321Smrg
14245e358ecaSmrgAC_SUBST(LINT)
14255e358ecaSmrgAC_SUBST(LINT_FLAGS)
14265e358ecaSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
1427b3307321Smrg
14285e358ecaSmrg]) # XORG_WITH_LINT
1429b3307321Smrg
14305e358ecaSmrg# XORG_LINT_LIBRARY(LIBNAME)
14315e358ecaSmrg# --------------------------
14325e358ecaSmrg# Minimum version: 1.1.0
14335e358ecaSmrg#
14345e358ecaSmrg# Sets up flags for building lint libraries for checking programs that call
14355e358ecaSmrg# functions in the library.
14365e358ecaSmrg# Disabled by default, enable with --enable-lint-library
14375e358ecaSmrg# Sets: 
14385e358ecaSmrg#	@LINTLIB@		- name of lint library file to make
14395e358ecaSmrg#	MAKE_LINT_LIB		- automake conditional
14405e358ecaSmrg#
1441b3307321Smrg
14425e358ecaSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
14435e358ecaSmrgAC_REQUIRE([XORG_WITH_LINT])
14445e358ecaSmrg# Build lint "library" for more indepth checks of programs calling this library
14455e358ecaSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
14465e358ecaSmrg	[Create lint library (default: disabled)])],
14475e358ecaSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
14485e358ecaSmrgif test "x$make_lint_lib" != "xno" ; then
14495e358ecaSmrg	if test "x$LINT" = "xno" ; then
14505e358ecaSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
14515e358ecaSmrg	fi
14525e358ecaSmrg	if test "x$make_lint_lib" = "xyes" ; then
14535e358ecaSmrg		LINTLIB=llib-l$1.ln
14545e358ecaSmrg	else
14555e358ecaSmrg		LINTLIB=$make_lint_lib
14565e358ecaSmrg	fi
14575e358ecaSmrgfi
14585e358ecaSmrgAC_SUBST(LINTLIB)
14595e358ecaSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1460afe13c8eSmrg
14615e358ecaSmrg]) # XORG_LINT_LIBRARY
1462b3307321Smrg
14635e358ecaSmrg# XORG_CWARNFLAGS
14645e358ecaSmrg# ---------------
14655e358ecaSmrg# Minimum version: 1.2.0
14665e358ecaSmrg#
14675e358ecaSmrg# Defines CWARNFLAGS to enable C compiler warnings.
14685e358ecaSmrg#
14695e358ecaSmrgAC_DEFUN([XORG_CWARNFLAGS], [
14705e358ecaSmrgAC_REQUIRE([AC_PROG_CC])
14715e358ecaSmrgif  test "x$GCC" = xyes ; then
14725e358ecaSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
14735e358ecaSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
14745e358ecaSmrg-Wbad-function-cast"
14755e358ecaSmrg    case `$CC -dumpversion` in
14765e358ecaSmrg    3.4.* | 4.*)
14775e358ecaSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
14785e358ecaSmrg	;;
14795e358ecaSmrg    esac
1480b3307321Smrgelse
14815e358ecaSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
14825e358ecaSmrg    if test "x$SUNCC" = "xyes"; then
14835e358ecaSmrg	CWARNFLAGS="-v"
14845e358ecaSmrg    fi
1485b3307321Smrgfi
14865e358ecaSmrgAC_SUBST(CWARNFLAGS)
14875e358ecaSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
14885e358ecaSmrg]) # XORG_CWARNFLAGS
1489b3307321Smrg
14905e358ecaSmrg# XORG_STRICT_OPTION
14915e358ecaSmrg# -----------------------
14925e358ecaSmrg# Minimum version: 1.3.0
1493afe13c8eSmrg#
14945e358ecaSmrg# Add configure option to enable strict compilation
14955e358ecaSmrgAC_DEFUN([XORG_STRICT_OPTION], [
14965e358ecaSmrgAC_REQUIRE([AC_PROG_CC])
14975e358ecaSmrgAC_REQUIRE([AC_PROG_CC_C99])
14985e358ecaSmrgAC_REQUIRE([XORG_CWARNFLAGS])
14995e358ecaSmrg
15005e358ecaSmrgAC_ARG_ENABLE(strict-compilation,
15015e358ecaSmrg			  AS_HELP_STRING([--enable-strict-compilation],
15025e358ecaSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
15035e358ecaSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
15045e358ecaSmrgif test "x$STRICT_COMPILE" = "xyes"; then
15055e358ecaSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
15065e358ecaSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
15075e358ecaSmrg	if test "x$GCC" = xyes ; then
15085e358ecaSmrg		STRICT_CFLAGS="-pedantic -Werror"
15095e358ecaSmrg	elif test "x$SUNCC" = "xyes"; then
15105e358ecaSmrg		STRICT_CFLAGS="-errwarn"
15115e358ecaSmrg    elif test "x$INTELCC" = "xyes"; then
15125e358ecaSmrg		STRICT_CFLAGS="-Werror"
15135e358ecaSmrg	fi
15145e358ecaSmrgfi
15155e358ecaSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
15165e358ecaSmrgAC_SUBST([CWARNFLAGS])
15175e358ecaSmrg]) # XORG_STRICT_OPTION
1518b3307321Smrg
15195e358ecaSmrg# XORG_DEFAULT_OPTIONS
15205e358ecaSmrg# --------------------
15215e358ecaSmrg# Minimum version: 1.3.0
1522afe13c8eSmrg#
15235e358ecaSmrg# Defines default options for X.Org modules.
15245e358ecaSmrg#
15255e358ecaSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
15265e358ecaSmrgXORG_CWARNFLAGS
15275e358ecaSmrgXORG_STRICT_OPTION
15285e358ecaSmrgXORG_RELEASE_VERSION
15295e358ecaSmrgXORG_CHANGELOG
15305e358ecaSmrgXORG_MANPAGE_SECTIONS
15315e358ecaSmrg]) # XORG_DEFAULT_OPTIONS
15325e358ecaSmrgdnl Copyright 2005 Red Hat, Inc
15335e358ecaSmrgdnl
15345e358ecaSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
15355e358ecaSmrgdnl documentation for any purpose is hereby granted without fee, provided that
15365e358ecaSmrgdnl the above copyright notice appear in all copies and that both that
15375e358ecaSmrgdnl copyright notice and this permission notice appear in supporting
15385e358ecaSmrgdnl documentation.
15395e358ecaSmrgdnl
15405e358ecaSmrgdnl The above copyright notice and this permission notice shall be included
15415e358ecaSmrgdnl in all copies or substantial portions of the Software.
15425e358ecaSmrgdnl
15435e358ecaSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15445e358ecaSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15455e358ecaSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15465e358ecaSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
15475e358ecaSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
15485e358ecaSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
15495e358ecaSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
15505e358ecaSmrgdnl
15515e358ecaSmrgdnl Except as contained in this notice, the name of the copyright holders shall
15525e358ecaSmrgdnl not be used in advertising or otherwise to promote the sale, use or
15535e358ecaSmrgdnl other dealings in this Software without prior written authorization
15545e358ecaSmrgdnl from the copyright holders.
15555e358ecaSmrgdnl
1556b3307321Smrg
15575e358ecaSmrg# XORG_RELEASE_VERSION
15585e358ecaSmrg# --------------------
15595e358ecaSmrg# Adds --with/without-release-string and changes the PACKAGE and
15605e358ecaSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
15615e358ecaSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
15625e358ecaSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
15635e358ecaSmrg 
15645e358ecaSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
15655e358ecaSmrg	AC_ARG_WITH(release-version,
15665e358ecaSmrg			AS_HELP_STRING([--with-release-version=STRING],
15675e358ecaSmrg				[Use release version string in package name]),
15685e358ecaSmrg			[RELEASE_VERSION="$withval"],
15695e358ecaSmrg			[RELEASE_VERSION=""])
15705e358ecaSmrg	if test "x$RELEASE_VERSION" != "x"; then
15715e358ecaSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
15725e358ecaSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
15735e358ecaSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
15745e358ecaSmrg	fi
15755e358ecaSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
15765e358ecaSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
15775e358ecaSmrg		[Major version of this package])
15785e358ecaSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
15795e358ecaSmrg	if test "x$PVM" = "x"; then
15805e358ecaSmrg		PVM="0"
15815e358ecaSmrg	fi
15825e358ecaSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
15835e358ecaSmrg		[$PVM],
15845e358ecaSmrg		[Minor version of this package])
15855e358ecaSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
15865e358ecaSmrg	if test "x$PVP" = "x"; then
15875e358ecaSmrg		PVP="0"
15885e358ecaSmrg	fi
15895e358ecaSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
15905e358ecaSmrg		[$PVP],
15915e358ecaSmrg		[Patch version of this package])
15925e358ecaSmrg])
1593b3307321Smrg
15945e358ecaSmrg# XORG_CHANGELOG()
15955e358ecaSmrg# ----------------
15965e358ecaSmrg# Minimum version: 1.2.0
15975e358ecaSmrg#
15985e358ecaSmrg# Defines the variable CHANGELOG_CMD as the command to generate
15995e358ecaSmrg# ChangeLog from git.
16005e358ecaSmrg#
16015e358ecaSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
16025e358ecaSmrg#
16035e358ecaSmrgAC_DEFUN([XORG_CHANGELOG], [
16045e358ecaSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
16055e358ecaSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
16065e358ecaSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
16075e358ecaSmrgAC_SUBST([CHANGELOG_CMD])
16085e358ecaSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
16095e358ecaSmrg]) # XORG_CHANGELOG
1610b3307321Smrg
16115e358ecaSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
16125e358ecaSmrg# 
16135e358ecaSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
16145e358ecaSmrg#
16155e358ecaSmrg# This program is free software; you can redistribute it and/or modify
16165e358ecaSmrg# it under the terms of the GNU General Public License as published by
16175e358ecaSmrg# the Free Software Foundation; either version 2 of the License, or
16185e358ecaSmrg# (at your option) any later version.
16195e358ecaSmrg#
16205e358ecaSmrg# This program is distributed in the hope that it will be useful, but
16215e358ecaSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
16225e358ecaSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16235e358ecaSmrg# General Public License for more details.
16245e358ecaSmrg#
16255e358ecaSmrg# You should have received a copy of the GNU General Public License
16265e358ecaSmrg# along with this program; if not, write to the Free Software
16275e358ecaSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16285e358ecaSmrg#
16295e358ecaSmrg# As a special exception to the GNU General Public License, if you
16305e358ecaSmrg# distribute this file as part of a program that contains a
16315e358ecaSmrg# configuration script generated by Autoconf, you may include it under
16325e358ecaSmrg# the same distribution terms that you use for the rest of that program.
1633b3307321Smrg
16345e358ecaSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1635afe13c8eSmrg# ----------------------------------
16365e358ecaSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
16375e358ecaSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
16385e358ecaSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
16395e358ecaSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
16405e358ecaSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
16415e358ecaSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
16425e358ecaSmrgfi
16435e358ecaSmrgif test -n "$PKG_CONFIG"; then
16445e358ecaSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
16455e358ecaSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
16465e358ecaSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
16475e358ecaSmrg		AC_MSG_RESULT([yes])
16485e358ecaSmrg	else
16495e358ecaSmrg		AC_MSG_RESULT([no])
16505e358ecaSmrg		PKG_CONFIG=""
16515e358ecaSmrg	fi
16525e358ecaSmrg		
16535e358ecaSmrgfi[]dnl
16545e358ecaSmrg])# PKG_PROG_PKG_CONFIG
1655b3307321Smrg
16565e358ecaSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
16575e358ecaSmrg#
16585e358ecaSmrg# Check to see whether a particular set of modules exists.  Similar
16595e358ecaSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
16605e358ecaSmrg#
16615e358ecaSmrg#
16625e358ecaSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
16635e358ecaSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
16645e358ecaSmrg# PKG_CHECK_EXISTS manually
16655e358ecaSmrg# --------------------------------------------------------------
16665e358ecaSmrgAC_DEFUN([PKG_CHECK_EXISTS],
16675e358ecaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
16685e358ecaSmrgif test -n "$PKG_CONFIG" && \
16695e358ecaSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
16705e358ecaSmrg  m4_ifval([$2], [$2], [:])
16715e358ecaSmrgm4_ifvaln([$3], [else
16725e358ecaSmrg  $3])dnl
16735e358ecaSmrgfi])
1674b3307321Smrg
1675b3307321Smrg
16765e358ecaSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
16775e358ecaSmrg# ---------------------------------------------
16785e358ecaSmrgm4_define([_PKG_CONFIG],
16795e358ecaSmrg[if test -n "$$1"; then
16805e358ecaSmrg    pkg_cv_[]$1="$$1"
16815e358ecaSmrg elif test -n "$PKG_CONFIG"; then
16825e358ecaSmrg    PKG_CHECK_EXISTS([$3],
16835e358ecaSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
16845e358ecaSmrg		     [pkg_failed=yes])
16855e358ecaSmrg else
16865e358ecaSmrg    pkg_failed=untried
16875e358ecaSmrgfi[]dnl
16885e358ecaSmrg])# _PKG_CONFIG
1689b3307321Smrg
16905e358ecaSmrg# _PKG_SHORT_ERRORS_SUPPORTED
16915e358ecaSmrg# -----------------------------
16925e358ecaSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
16935e358ecaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
16945e358ecaSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
16955e358ecaSmrg        _pkg_short_errors_supported=yes
1696afe13c8eSmrgelse
16975e358ecaSmrg        _pkg_short_errors_supported=no
16985e358ecaSmrgfi[]dnl
16995e358ecaSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
1700b3307321Smrg
17015e358ecaSmrg
17025e358ecaSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
17035e358ecaSmrg# [ACTION-IF-NOT-FOUND])
1704b3307321Smrg#
17055e358ecaSmrg#
17065e358ecaSmrg# Note that if there is a possibility the first call to
17075e358ecaSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
17085e358ecaSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
17095e358ecaSmrg#
17105e358ecaSmrg#
17115e358ecaSmrg# --------------------------------------------------------------
17125e358ecaSmrgAC_DEFUN([PKG_CHECK_MODULES],
17135e358ecaSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
17145e358ecaSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
17155e358ecaSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1716b3307321Smrg
17175e358ecaSmrgpkg_failed=no
17185e358ecaSmrgAC_MSG_CHECKING([for $1])
1719b3307321Smrg
17205e358ecaSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
17215e358ecaSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1722b3307321Smrg
17235e358ecaSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
17245e358ecaSmrgand $1[]_LIBS to avoid the need to call pkg-config.
17255e358ecaSmrgSee the pkg-config man page for more details.])
1726b3307321Smrg
17275e358ecaSmrgif test $pkg_failed = yes; then
17285e358ecaSmrg        _PKG_SHORT_ERRORS_SUPPORTED
17295e358ecaSmrg        if test $_pkg_short_errors_supported = yes; then
17305e358ecaSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
17315e358ecaSmrg        else 
17325e358ecaSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
17335e358ecaSmrg        fi
17345e358ecaSmrg	# Put the nasty error message in config.log where it belongs
17355e358ecaSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1736b3307321Smrg
17375e358ecaSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
17385e358ecaSmrg[Package requirements ($2) were not met:
1739b3307321Smrg
17405e358ecaSmrg$$1_PKG_ERRORS
1741b3307321Smrg
17425e358ecaSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
17435e358ecaSmrginstalled software in a non-standard prefix.
1744b3307321Smrg
17455e358ecaSmrg_PKG_TEXT
17465e358ecaSmrg])],
17475e358ecaSmrg		[AC_MSG_RESULT([no])
17485e358ecaSmrg                $4])
17495e358ecaSmrgelif test $pkg_failed = untried; then
17505e358ecaSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
17515e358ecaSmrg[The pkg-config script could not be found or is too old.  Make sure it
17525e358ecaSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
17535e358ecaSmrgpath to pkg-config.
1754b3307321Smrg
17555e358ecaSmrg_PKG_TEXT
1756b3307321Smrg
17575e358ecaSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
17585e358ecaSmrg		[$4])
17595e358ecaSmrgelse
17605e358ecaSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
17615e358ecaSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
17625e358ecaSmrg        AC_MSG_RESULT([yes])
17635e358ecaSmrg	ifelse([$3], , :, [$3])
17645e358ecaSmrgfi[]dnl
17655e358ecaSmrg])# PKG_CHECK_MODULES
1766b3307321Smrg
1767