aclocal.m4 revision 1a30de1f
11a30de1fSmrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
21a30de1fSmrg
31a30de1fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
41a30de1fSmrg# 2005, 2006  Free Software Foundation, Inc.
51a30de1fSmrg# This file is free software; the Free Software Foundation
61a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
71a30de1fSmrg# with or without modifications, as long as this notice is preserved.
81a30de1fSmrg
91a30de1fSmrg# This program is distributed in the hope that it will be useful,
101a30de1fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
111a30de1fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
121a30de1fSmrg# PARTICULAR PURPOSE.
131a30de1fSmrg
141a30de1fSmrgm4_if(m4_PACKAGE_VERSION, [2.61],,
151a30de1fSmrg[m4_fatal([this file was generated for autoconf 2.61.
161a30de1fSmrgYou have another version of autoconf.  If you want to use that,
171a30de1fSmrgyou should regenerate the build system entirely.], [63])])
181a30de1fSmrg
191a30de1fSmrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
201a30de1fSmrg#
211a30de1fSmrg# This file is free software; the Free Software Foundation
221a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
231a30de1fSmrg# with or without modifications, as long as this notice is preserved.
241a30de1fSmrg
251a30de1fSmrg# AM_AUTOMAKE_VERSION(VERSION)
261a30de1fSmrg# ----------------------------
271a30de1fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
281a30de1fSmrg# generated from the m4 files accompanying Automake X.Y.
291a30de1fSmrg# (This private macro should not be called outside this file.)
301a30de1fSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
311a30de1fSmrg[am__api_version='1.10'
321a30de1fSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
331a30de1fSmrgdnl require some minimum version.  Point them to the right macro.
341a30de1fSmrgm4_if([$1], [1.10], [],
351a30de1fSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
361a30de1fSmrg])
371a30de1fSmrg
381a30de1fSmrg# _AM_AUTOCONF_VERSION(VERSION)
391a30de1fSmrg# -----------------------------
401a30de1fSmrg# aclocal traces this macro to find the Autoconf version.
411a30de1fSmrg# This is a private macro too.  Using m4_define simplifies
421a30de1fSmrg# the logic in aclocal, which can simply ignore this definition.
431a30de1fSmrgm4_define([_AM_AUTOCONF_VERSION], [])
441a30de1fSmrg
451a30de1fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
461a30de1fSmrg# -------------------------------
471a30de1fSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
481a30de1fSmrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
491a30de1fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
501a30de1fSmrg[AM_AUTOMAKE_VERSION([1.10])dnl
511a30de1fSmrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
521a30de1fSmrg
531a30de1fSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
541a30de1fSmrg
551a30de1fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
561a30de1fSmrg#
571a30de1fSmrg# This file is free software; the Free Software Foundation
581a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
591a30de1fSmrg# with or without modifications, as long as this notice is preserved.
601a30de1fSmrg
611a30de1fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
621a30de1fSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
631a30de1fSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
641a30de1fSmrg#
651a30de1fSmrg# Of course, Automake must honor this variable whenever it calls a
661a30de1fSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
671a30de1fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
681a30de1fSmrg# depending on how configure is run.  This is pretty annoying, since
691a30de1fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
701a30de1fSmrg# source directory, any form will work fine, but in subdirectories a
711a30de1fSmrg# relative path needs to be adjusted first.
721a30de1fSmrg#
731a30de1fSmrg# $ac_aux_dir/missing
741a30de1fSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
751a30de1fSmrg# $top_srcdir/$ac_aux_dir/missing
761a30de1fSmrg#    fails if $ac_aux_dir is absolute,
771a30de1fSmrg#    fails when called from a subdirectory in a VPATH build with
781a30de1fSmrg#          a relative $ac_aux_dir
791a30de1fSmrg#
801a30de1fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
811a30de1fSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
821a30de1fSmrg# harmless because $srcdir is `.', but things will broke when you
831a30de1fSmrg# start a VPATH build or use an absolute $srcdir.
841a30de1fSmrg#
851a30de1fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
861a30de1fSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
871a30de1fSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
881a30de1fSmrg# and then we would define $MISSING as
891a30de1fSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
901a30de1fSmrg# This will work as long as MISSING is not called from configure, because
911a30de1fSmrg# unfortunately $(top_srcdir) has no meaning in configure.
921a30de1fSmrg# However there are other variables, like CC, which are often used in
931a30de1fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
941a30de1fSmrg#
951a30de1fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
961a30de1fSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
971a30de1fSmrg# configured tree to be moved without reconfiguration.
981a30de1fSmrg
991a30de1fSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1001a30de1fSmrg[dnl Rely on autoconf to set up CDPATH properly.
1011a30de1fSmrgAC_PREREQ([2.50])dnl
1021a30de1fSmrg# expand $ac_aux_dir to an absolute path
1031a30de1fSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
1041a30de1fSmrg])
1051a30de1fSmrg
1061a30de1fSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1071a30de1fSmrg
1081a30de1fSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
1091a30de1fSmrg# Free Software Foundation, Inc.
1101a30de1fSmrg#
1111a30de1fSmrg# This file is free software; the Free Software Foundation
1121a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
1131a30de1fSmrg# with or without modifications, as long as this notice is preserved.
1141a30de1fSmrg
1151a30de1fSmrg# serial 8
1161a30de1fSmrg
1171a30de1fSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1181a30de1fSmrg# -------------------------------------
1191a30de1fSmrg# Define a conditional.
1201a30de1fSmrgAC_DEFUN([AM_CONDITIONAL],
1211a30de1fSmrg[AC_PREREQ(2.52)dnl
1221a30de1fSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1231a30de1fSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1241a30de1fSmrgAC_SUBST([$1_TRUE])dnl
1251a30de1fSmrgAC_SUBST([$1_FALSE])dnl
1261a30de1fSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1271a30de1fSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1281a30de1fSmrgif $2; then
1291a30de1fSmrg  $1_TRUE=
1301a30de1fSmrg  $1_FALSE='#'
1311a30de1fSmrgelse
1321a30de1fSmrg  $1_TRUE='#'
1331a30de1fSmrg  $1_FALSE=
1341a30de1fSmrgfi
1351a30de1fSmrgAC_CONFIG_COMMANDS_PRE(
1361a30de1fSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1371a30de1fSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1381a30de1fSmrgUsually this means the macro was only invoked conditionally.]])
1391a30de1fSmrgfi])])
1401a30de1fSmrg
1411a30de1fSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1421a30de1fSmrg# Free Software Foundation, Inc.
1431a30de1fSmrg#
1441a30de1fSmrg# This file is free software; the Free Software Foundation
1451a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
1461a30de1fSmrg# with or without modifications, as long as this notice is preserved.
1471a30de1fSmrg
1481a30de1fSmrg# serial 9
1491a30de1fSmrg
1501a30de1fSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1511a30de1fSmrg# written in clear, in which case automake, when reading aclocal.m4,
1521a30de1fSmrg# will think it sees a *use*, and therefore will trigger all it's
1531a30de1fSmrg# C support machinery.  Also note that it means that autoscan, seeing
1541a30de1fSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1551a30de1fSmrg
1561a30de1fSmrg
1571a30de1fSmrg# _AM_DEPENDENCIES(NAME)
1581a30de1fSmrg# ----------------------
1591a30de1fSmrg# See how the compiler implements dependency checking.
1601a30de1fSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1611a30de1fSmrg# We try a few techniques and use that to set a single cache variable.
1621a30de1fSmrg#
1631a30de1fSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1641a30de1fSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1651a30de1fSmrg# dependency, and given that the user is not expected to run this macro,
1661a30de1fSmrg# just rely on AC_PROG_CC.
1671a30de1fSmrgAC_DEFUN([_AM_DEPENDENCIES],
1681a30de1fSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1691a30de1fSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1701a30de1fSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1711a30de1fSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1721a30de1fSmrg
1731a30de1fSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1741a30de1fSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1751a30de1fSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1761a30de1fSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1771a30de1fSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1781a30de1fSmrg                   [depcc="$$1"   am_compiler_list=])
1791a30de1fSmrg
1801a30de1fSmrgAC_CACHE_CHECK([dependency style of $depcc],
1811a30de1fSmrg               [am_cv_$1_dependencies_compiler_type],
1821a30de1fSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1831a30de1fSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1841a30de1fSmrg  # making bogus files that we don't know about and never remove.  For
1851a30de1fSmrg  # instance it was reported that on HP-UX the gcc test will end up
1861a30de1fSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1871a30de1fSmrg  # in D'.
1881a30de1fSmrg  mkdir conftest.dir
1891a30de1fSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1901a30de1fSmrg  # using a relative directory.
1911a30de1fSmrg  cp "$am_depcomp" conftest.dir
1921a30de1fSmrg  cd conftest.dir
1931a30de1fSmrg  # We will build objects and dependencies in a subdirectory because
1941a30de1fSmrg  # it helps to detect inapplicable dependency modes.  For instance
1951a30de1fSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1961a30de1fSmrg  # side effect of compilation, but ICC will put the dependencies in
1971a30de1fSmrg  # the current directory while Tru64 will put them in the object
1981a30de1fSmrg  # directory.
1991a30de1fSmrg  mkdir sub
2001a30de1fSmrg
2011a30de1fSmrg  am_cv_$1_dependencies_compiler_type=none
2021a30de1fSmrg  if test "$am_compiler_list" = ""; then
2031a30de1fSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2041a30de1fSmrg  fi
2051a30de1fSmrg  for depmode in $am_compiler_list; do
2061a30de1fSmrg    # Setup a source with many dependencies, because some compilers
2071a30de1fSmrg    # like to wrap large dependency lists on column 80 (with \), and
2081a30de1fSmrg    # we should not choose a depcomp mode which is confused by this.
2091a30de1fSmrg    #
2101a30de1fSmrg    # We need to recreate these files for each test, as the compiler may
2111a30de1fSmrg    # overwrite some of them when testing with obscure command lines.
2121a30de1fSmrg    # This happens at least with the AIX C compiler.
2131a30de1fSmrg    : > sub/conftest.c
2141a30de1fSmrg    for i in 1 2 3 4 5 6; do
2151a30de1fSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2161a30de1fSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2171a30de1fSmrg      # Solaris 8's {/usr,}/bin/sh.
2181a30de1fSmrg      touch sub/conftst$i.h
2191a30de1fSmrg    done
2201a30de1fSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2211a30de1fSmrg
2221a30de1fSmrg    case $depmode in
2231a30de1fSmrg    nosideeffect)
2241a30de1fSmrg      # after this tag, mechanisms are not by side-effect, so they'll
2251a30de1fSmrg      # only be used when explicitly requested
2261a30de1fSmrg      if test "x$enable_dependency_tracking" = xyes; then
2271a30de1fSmrg	continue
2281a30de1fSmrg      else
2291a30de1fSmrg	break
2301a30de1fSmrg      fi
2311a30de1fSmrg      ;;
2321a30de1fSmrg    none) break ;;
2331a30de1fSmrg    esac
2341a30de1fSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2351a30de1fSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2361a30de1fSmrg    # handle `-M -o', and we need to detect this.
2371a30de1fSmrg    if depmode=$depmode \
2381a30de1fSmrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
2391a30de1fSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2401a30de1fSmrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
2411a30de1fSmrg         >/dev/null 2>conftest.err &&
2421a30de1fSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2431a30de1fSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2441a30de1fSmrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
2451a30de1fSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2461a30de1fSmrg      # icc doesn't choke on unknown options, it will just issue warnings
2471a30de1fSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
2481a30de1fSmrg      # that says an option was ignored or not supported.
2491a30de1fSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2501a30de1fSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2511a30de1fSmrg      # The diagnosis changed in icc 8.0:
2521a30de1fSmrg      #   icc: Command line remark: option '-MP' not supported
2531a30de1fSmrg      if (grep 'ignoring option' conftest.err ||
2541a30de1fSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2551a30de1fSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2561a30de1fSmrg        break
2571a30de1fSmrg      fi
2581a30de1fSmrg    fi
2591a30de1fSmrg  done
2601a30de1fSmrg
2611a30de1fSmrg  cd ..
2621a30de1fSmrg  rm -rf conftest.dir
2631a30de1fSmrgelse
2641a30de1fSmrg  am_cv_$1_dependencies_compiler_type=none
2651a30de1fSmrgfi
2661a30de1fSmrg])
2671a30de1fSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2681a30de1fSmrgAM_CONDITIONAL([am__fastdep$1], [
2691a30de1fSmrg  test "x$enable_dependency_tracking" != xno \
2701a30de1fSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2711a30de1fSmrg])
2721a30de1fSmrg
2731a30de1fSmrg
2741a30de1fSmrg# AM_SET_DEPDIR
2751a30de1fSmrg# -------------
2761a30de1fSmrg# Choose a directory name for dependency files.
2771a30de1fSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
2781a30de1fSmrgAC_DEFUN([AM_SET_DEPDIR],
2791a30de1fSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2801a30de1fSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2811a30de1fSmrg])
2821a30de1fSmrg
2831a30de1fSmrg
2841a30de1fSmrg# AM_DEP_TRACK
2851a30de1fSmrg# ------------
2861a30de1fSmrgAC_DEFUN([AM_DEP_TRACK],
2871a30de1fSmrg[AC_ARG_ENABLE(dependency-tracking,
2881a30de1fSmrg[  --disable-dependency-tracking  speeds up one-time build
2891a30de1fSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
2901a30de1fSmrgif test "x$enable_dependency_tracking" != xno; then
2911a30de1fSmrg  am_depcomp="$ac_aux_dir/depcomp"
2921a30de1fSmrg  AMDEPBACKSLASH='\'
2931a30de1fSmrgfi
2941a30de1fSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2951a30de1fSmrgAC_SUBST([AMDEPBACKSLASH])dnl
2961a30de1fSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
2971a30de1fSmrg])
2981a30de1fSmrg
2991a30de1fSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3001a30de1fSmrg
3011a30de1fSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
3021a30de1fSmrg# Free Software Foundation, Inc.
3031a30de1fSmrg#
3041a30de1fSmrg# This file is free software; the Free Software Foundation
3051a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
3061a30de1fSmrg# with or without modifications, as long as this notice is preserved.
3071a30de1fSmrg
3081a30de1fSmrg#serial 3
3091a30de1fSmrg
3101a30de1fSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3111a30de1fSmrg# ------------------------------
3121a30de1fSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3131a30de1fSmrg[for mf in $CONFIG_FILES; do
3141a30de1fSmrg  # Strip MF so we end up with the name of the file.
3151a30de1fSmrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
3161a30de1fSmrg  # Check whether this is an Automake generated Makefile or not.
3171a30de1fSmrg  # We used to match only the files named `Makefile.in', but
3181a30de1fSmrg  # some people rename them; so instead we look at the file content.
3191a30de1fSmrg  # Grep'ing the first line is not enough: some people post-process
3201a30de1fSmrg  # each Makefile.in and add a new line on top of each file to say so.
3211a30de1fSmrg  # Grep'ing the whole file is not good either: AIX grep has a line
3221a30de1fSmrg  # limit of 2048, but all sed's we know have understand at least 4000.
3231a30de1fSmrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
3241a30de1fSmrg    dirpart=`AS_DIRNAME("$mf")`
3251a30de1fSmrg  else
3261a30de1fSmrg    continue
3271a30de1fSmrg  fi
3281a30de1fSmrg  # Extract the definition of DEPDIR, am__include, and am__quote
3291a30de1fSmrg  # from the Makefile without running `make'.
3301a30de1fSmrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3311a30de1fSmrg  test -z "$DEPDIR" && continue
3321a30de1fSmrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
3331a30de1fSmrg  test -z "am__include" && continue
3341a30de1fSmrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3351a30de1fSmrg  # When using ansi2knr, U may be empty or an underscore; expand it
3361a30de1fSmrg  U=`sed -n 's/^U = //p' < "$mf"`
3371a30de1fSmrg  # Find all dependency output files, they are included files with
3381a30de1fSmrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
3391a30de1fSmrg  # simplest approach to changing $(DEPDIR) to its actual value in the
3401a30de1fSmrg  # expansion.
3411a30de1fSmrg  for file in `sed -n "
3421a30de1fSmrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3431a30de1fSmrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3441a30de1fSmrg    # Make sure the directory exists.
3451a30de1fSmrg    test -f "$dirpart/$file" && continue
3461a30de1fSmrg    fdir=`AS_DIRNAME(["$file"])`
3471a30de1fSmrg    AS_MKDIR_P([$dirpart/$fdir])
3481a30de1fSmrg    # echo "creating $dirpart/$file"
3491a30de1fSmrg    echo '# dummy' > "$dirpart/$file"
3501a30de1fSmrg  done
3511a30de1fSmrgdone
3521a30de1fSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3531a30de1fSmrg
3541a30de1fSmrg
3551a30de1fSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3561a30de1fSmrg# -----------------------------
3571a30de1fSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
3581a30de1fSmrg#
3591a30de1fSmrg# This code is only required when automatic dependency tracking
3601a30de1fSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
3611a30de1fSmrg# need in order to bootstrap the dependency handling code.
3621a30de1fSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
3631a30de1fSmrg[AC_CONFIG_COMMANDS([depfiles],
3641a30de1fSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
3651a30de1fSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
3661a30de1fSmrg])
3671a30de1fSmrg
3681a30de1fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
3691a30de1fSmrg# Free Software Foundation, Inc.
3701a30de1fSmrg#
3711a30de1fSmrg# This file is free software; the Free Software Foundation
3721a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
3731a30de1fSmrg# with or without modifications, as long as this notice is preserved.
3741a30de1fSmrg
3751a30de1fSmrg# serial 8
3761a30de1fSmrg
3771a30de1fSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
3781a30de1fSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
3791a30de1fSmrg
3801a30de1fSmrg# Do all the work for Automake.                             -*- Autoconf -*-
3811a30de1fSmrg
3821a30de1fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3831a30de1fSmrg# 2005, 2006 Free Software Foundation, Inc.
3841a30de1fSmrg#
3851a30de1fSmrg# This file is free software; the Free Software Foundation
3861a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
3871a30de1fSmrg# with or without modifications, as long as this notice is preserved.
3881a30de1fSmrg
3891a30de1fSmrg# serial 12
3901a30de1fSmrg
3911a30de1fSmrg# This macro actually does too much.  Some checks are only needed if
3921a30de1fSmrg# your package does certain things.  But this isn't really a big deal.
3931a30de1fSmrg
3941a30de1fSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
3951a30de1fSmrg# AM_INIT_AUTOMAKE([OPTIONS])
3961a30de1fSmrg# -----------------------------------------------
3971a30de1fSmrg# The call with PACKAGE and VERSION arguments is the old style
3981a30de1fSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
3991a30de1fSmrg# and VERSION should now be passed to AC_INIT and removed from
4001a30de1fSmrg# the call to AM_INIT_AUTOMAKE.
4011a30de1fSmrg# We support both call styles for the transition.  After
4021a30de1fSmrg# the next Automake release, Autoconf can make the AC_INIT
4031a30de1fSmrg# arguments mandatory, and then we can depend on a new Autoconf
4041a30de1fSmrg# release and drop the old call support.
4051a30de1fSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4061a30de1fSmrg[AC_PREREQ([2.60])dnl
4071a30de1fSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4081a30de1fSmrgdnl the ones we care about.
4091a30de1fSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4101a30de1fSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4111a30de1fSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4121a30de1fSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4131a30de1fSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4141a30de1fSmrg  # is not polluted with repeated "-I."
4151a30de1fSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4161a30de1fSmrg  # test to see if srcdir already configured
4171a30de1fSmrg  if test -f $srcdir/config.status; then
4181a30de1fSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4191a30de1fSmrg  fi
4201a30de1fSmrgfi
4211a30de1fSmrg
4221a30de1fSmrg# test whether we have cygpath
4231a30de1fSmrgif test -z "$CYGPATH_W"; then
4241a30de1fSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4251a30de1fSmrg    CYGPATH_W='cygpath -w'
4261a30de1fSmrg  else
4271a30de1fSmrg    CYGPATH_W=echo
4281a30de1fSmrg  fi
4291a30de1fSmrgfi
4301a30de1fSmrgAC_SUBST([CYGPATH_W])
4311a30de1fSmrg
4321a30de1fSmrg# Define the identity of the package.
4331a30de1fSmrgdnl Distinguish between old-style and new-style calls.
4341a30de1fSmrgm4_ifval([$2],
4351a30de1fSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4361a30de1fSmrg AC_SUBST([PACKAGE], [$1])dnl
4371a30de1fSmrg AC_SUBST([VERSION], [$2])],
4381a30de1fSmrg[_AM_SET_OPTIONS([$1])dnl
4391a30de1fSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4401a30de1fSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4411a30de1fSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4421a30de1fSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4431a30de1fSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4441a30de1fSmrg
4451a30de1fSmrg_AM_IF_OPTION([no-define],,
4461a30de1fSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4471a30de1fSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4481a30de1fSmrg
4491a30de1fSmrg# Some tools Automake needs.
4501a30de1fSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4511a30de1fSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4521a30de1fSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4531a30de1fSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4541a30de1fSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4551a30de1fSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4561a30de1fSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4571a30de1fSmrgAM_PROG_INSTALL_SH
4581a30de1fSmrgAM_PROG_INSTALL_STRIP
4591a30de1fSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
4601a30de1fSmrg# We need awk for the "check" target.  The system "awk" is bad on
4611a30de1fSmrg# some platforms.
4621a30de1fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
4631a30de1fSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
4641a30de1fSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
4651a30de1fSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4661a30de1fSmrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4671a30de1fSmrg	      		     [_AM_PROG_TAR([v7])])])
4681a30de1fSmrg_AM_IF_OPTION([no-dependencies],,
4691a30de1fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
4701a30de1fSmrg                  [_AM_DEPENDENCIES(CC)],
4711a30de1fSmrg                  [define([AC_PROG_CC],
4721a30de1fSmrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
4731a30de1fSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
4741a30de1fSmrg                  [_AM_DEPENDENCIES(CXX)],
4751a30de1fSmrg                  [define([AC_PROG_CXX],
4761a30de1fSmrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
4771a30de1fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
4781a30de1fSmrg                  [_AM_DEPENDENCIES(OBJC)],
4791a30de1fSmrg                  [define([AC_PROG_OBJC],
4801a30de1fSmrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
4811a30de1fSmrg])
4821a30de1fSmrg])
4831a30de1fSmrg
4841a30de1fSmrg
4851a30de1fSmrg# When config.status generates a header, we must update the stamp-h file.
4861a30de1fSmrg# This file resides in the same directory as the config header
4871a30de1fSmrg# that is generated.  The stamp files are numbered to have different names.
4881a30de1fSmrg
4891a30de1fSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
4901a30de1fSmrg# loop where config.status creates the headers, so we can generate
4911a30de1fSmrg# our stamp files there.
4921a30de1fSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
4931a30de1fSmrg[# Compute $1's index in $config_headers.
4941a30de1fSmrg_am_stamp_count=1
4951a30de1fSmrgfor _am_header in $config_headers :; do
4961a30de1fSmrg  case $_am_header in
4971a30de1fSmrg    $1 | $1:* )
4981a30de1fSmrg      break ;;
4991a30de1fSmrg    * )
5001a30de1fSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5011a30de1fSmrg  esac
5021a30de1fSmrgdone
5031a30de1fSmrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
5041a30de1fSmrg
5051a30de1fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
5061a30de1fSmrg#
5071a30de1fSmrg# This file is free software; the Free Software Foundation
5081a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
5091a30de1fSmrg# with or without modifications, as long as this notice is preserved.
5101a30de1fSmrg
5111a30de1fSmrg# AM_PROG_INSTALL_SH
5121a30de1fSmrg# ------------------
5131a30de1fSmrg# Define $install_sh.
5141a30de1fSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5151a30de1fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5161a30de1fSmrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
5171a30de1fSmrgAC_SUBST(install_sh)])
5181a30de1fSmrg
5191a30de1fSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5201a30de1fSmrg#
5211a30de1fSmrg# This file is free software; the Free Software Foundation
5221a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
5231a30de1fSmrg# with or without modifications, as long as this notice is preserved.
5241a30de1fSmrg
5251a30de1fSmrg# serial 2
5261a30de1fSmrg
5271a30de1fSmrg# Check whether the underlying file-system supports filenames
5281a30de1fSmrg# with a leading dot.  For instance MS-DOS doesn't.
5291a30de1fSmrgAC_DEFUN([AM_SET_LEADING_DOT],
5301a30de1fSmrg[rm -rf .tst 2>/dev/null
5311a30de1fSmrgmkdir .tst 2>/dev/null
5321a30de1fSmrgif test -d .tst; then
5331a30de1fSmrg  am__leading_dot=.
5341a30de1fSmrgelse
5351a30de1fSmrg  am__leading_dot=_
5361a30de1fSmrgfi
5371a30de1fSmrgrmdir .tst 2>/dev/null
5381a30de1fSmrgAC_SUBST([am__leading_dot])])
5391a30de1fSmrg
5401a30de1fSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
5411a30de1fSmrg# From Jim Meyering
5421a30de1fSmrg
5431a30de1fSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
5441a30de1fSmrg# Free Software Foundation, Inc.
5451a30de1fSmrg#
5461a30de1fSmrg# This file is free software; the Free Software Foundation
5471a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
5481a30de1fSmrg# with or without modifications, as long as this notice is preserved.
5491a30de1fSmrg
5501a30de1fSmrg# serial 4
5511a30de1fSmrg
5521a30de1fSmrgAC_DEFUN([AM_MAINTAINER_MODE],
5531a30de1fSmrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
5541a30de1fSmrg  dnl maintainer-mode is disabled by default
5551a30de1fSmrg  AC_ARG_ENABLE(maintainer-mode,
5561a30de1fSmrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
5571a30de1fSmrg			  (and sometimes confusing) to the casual installer],
5581a30de1fSmrg      USE_MAINTAINER_MODE=$enableval,
5591a30de1fSmrg      USE_MAINTAINER_MODE=no)
5601a30de1fSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
5611a30de1fSmrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
5621a30de1fSmrg  MAINT=$MAINTAINER_MODE_TRUE
5631a30de1fSmrg  AC_SUBST(MAINT)dnl
5641a30de1fSmrg]
5651a30de1fSmrg)
5661a30de1fSmrg
5671a30de1fSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
5681a30de1fSmrg
5691a30de1fSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
5701a30de1fSmrg
5711a30de1fSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
5721a30de1fSmrg#
5731a30de1fSmrg# This file is free software; the Free Software Foundation
5741a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
5751a30de1fSmrg# with or without modifications, as long as this notice is preserved.
5761a30de1fSmrg
5771a30de1fSmrg# serial 3
5781a30de1fSmrg
5791a30de1fSmrg# AM_MAKE_INCLUDE()
5801a30de1fSmrg# -----------------
5811a30de1fSmrg# Check to see how make treats includes.
5821a30de1fSmrgAC_DEFUN([AM_MAKE_INCLUDE],
5831a30de1fSmrg[am_make=${MAKE-make}
5841a30de1fSmrgcat > confinc << 'END'
5851a30de1fSmrgam__doit:
5861a30de1fSmrg	@echo done
5871a30de1fSmrg.PHONY: am__doit
5881a30de1fSmrgEND
5891a30de1fSmrg# If we don't find an include directive, just comment out the code.
5901a30de1fSmrgAC_MSG_CHECKING([for style of include used by $am_make])
5911a30de1fSmrgam__include="#"
5921a30de1fSmrgam__quote=
5931a30de1fSmrg_am_result=none
5941a30de1fSmrg# First try GNU make style include.
5951a30de1fSmrgecho "include confinc" > confmf
5961a30de1fSmrg# We grep out `Entering directory' and `Leaving directory'
5971a30de1fSmrg# messages which can occur if `w' ends up in MAKEFLAGS.
5981a30de1fSmrg# In particular we don't look at `^make:' because GNU make might
5991a30de1fSmrg# be invoked under some other name (usually "gmake"), in which
6001a30de1fSmrg# case it prints its new name instead of `make'.
6011a30de1fSmrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
6021a30de1fSmrg   am__include=include
6031a30de1fSmrg   am__quote=
6041a30de1fSmrg   _am_result=GNU
6051a30de1fSmrgfi
6061a30de1fSmrg# Now try BSD make style include.
6071a30de1fSmrgif test "$am__include" = "#"; then
6081a30de1fSmrg   echo '.include "confinc"' > confmf
6091a30de1fSmrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
6101a30de1fSmrg      am__include=.include
6111a30de1fSmrg      am__quote="\""
6121a30de1fSmrg      _am_result=BSD
6131a30de1fSmrg   fi
6141a30de1fSmrgfi
6151a30de1fSmrgAC_SUBST([am__include])
6161a30de1fSmrgAC_SUBST([am__quote])
6171a30de1fSmrgAC_MSG_RESULT([$_am_result])
6181a30de1fSmrgrm -f confinc confmf
6191a30de1fSmrg])
6201a30de1fSmrg
6211a30de1fSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6221a30de1fSmrg
6231a30de1fSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
6241a30de1fSmrg# Free Software Foundation, Inc.
6251a30de1fSmrg#
6261a30de1fSmrg# This file is free software; the Free Software Foundation
6271a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
6281a30de1fSmrg# with or without modifications, as long as this notice is preserved.
6291a30de1fSmrg
6301a30de1fSmrg# serial 5
6311a30de1fSmrg
6321a30de1fSmrg# AM_MISSING_PROG(NAME, PROGRAM)
6331a30de1fSmrg# ------------------------------
6341a30de1fSmrgAC_DEFUN([AM_MISSING_PROG],
6351a30de1fSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
6361a30de1fSmrg$1=${$1-"${am_missing_run}$2"}
6371a30de1fSmrgAC_SUBST($1)])
6381a30de1fSmrg
6391a30de1fSmrg
6401a30de1fSmrg# AM_MISSING_HAS_RUN
6411a30de1fSmrg# ------------------
6421a30de1fSmrg# Define MISSING if not defined so far and test if it supports --run.
6431a30de1fSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
6441a30de1fSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
6451a30de1fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6461a30de1fSmrgAC_REQUIRE_AUX_FILE([missing])dnl
6471a30de1fSmrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
6481a30de1fSmrg# Use eval to expand $SHELL
6491a30de1fSmrgif eval "$MISSING --run true"; then
6501a30de1fSmrg  am_missing_run="$MISSING --run "
6511a30de1fSmrgelse
6521a30de1fSmrg  am_missing_run=
6531a30de1fSmrg  AC_MSG_WARN([`missing' script is too old or missing])
6541a30de1fSmrgfi
6551a30de1fSmrg])
6561a30de1fSmrg
6571a30de1fSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
6581a30de1fSmrg#
6591a30de1fSmrg# This file is free software; the Free Software Foundation
6601a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
6611a30de1fSmrg# with or without modifications, as long as this notice is preserved.
6621a30de1fSmrg
6631a30de1fSmrg# AM_PROG_MKDIR_P
6641a30de1fSmrg# ---------------
6651a30de1fSmrg# Check for `mkdir -p'.
6661a30de1fSmrgAC_DEFUN([AM_PROG_MKDIR_P],
6671a30de1fSmrg[AC_PREREQ([2.60])dnl
6681a30de1fSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
6691a30de1fSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
6701a30de1fSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
6711a30de1fSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
6721a30de1fSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
6731a30de1fSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
6741a30de1fSmrgdnl adjustment using top_builddir (which is defined more often than
6751a30de1fSmrgdnl MKDIR_P).
6761a30de1fSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
6771a30de1fSmrgcase $mkdir_p in
6781a30de1fSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
6791a30de1fSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
6801a30de1fSmrgesac
6811a30de1fSmrg])
6821a30de1fSmrg
6831a30de1fSmrg# Helper functions for option handling.                     -*- Autoconf -*-
6841a30de1fSmrg
6851a30de1fSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
6861a30de1fSmrg#
6871a30de1fSmrg# This file is free software; the Free Software Foundation
6881a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
6891a30de1fSmrg# with or without modifications, as long as this notice is preserved.
6901a30de1fSmrg
6911a30de1fSmrg# serial 3
6921a30de1fSmrg
6931a30de1fSmrg# _AM_MANGLE_OPTION(NAME)
6941a30de1fSmrg# -----------------------
6951a30de1fSmrgAC_DEFUN([_AM_MANGLE_OPTION],
6961a30de1fSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
6971a30de1fSmrg
6981a30de1fSmrg# _AM_SET_OPTION(NAME)
6991a30de1fSmrg# ------------------------------
7001a30de1fSmrg# Set option NAME.  Presently that only means defining a flag for this option.
7011a30de1fSmrgAC_DEFUN([_AM_SET_OPTION],
7021a30de1fSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7031a30de1fSmrg
7041a30de1fSmrg# _AM_SET_OPTIONS(OPTIONS)
7051a30de1fSmrg# ----------------------------------
7061a30de1fSmrg# OPTIONS is a space-separated list of Automake options.
7071a30de1fSmrgAC_DEFUN([_AM_SET_OPTIONS],
7081a30de1fSmrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7091a30de1fSmrg
7101a30de1fSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7111a30de1fSmrg# -------------------------------------------
7121a30de1fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7131a30de1fSmrgAC_DEFUN([_AM_IF_OPTION],
7141a30de1fSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7151a30de1fSmrg
7161a30de1fSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7171a30de1fSmrg
7181a30de1fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
7191a30de1fSmrg# Free Software Foundation, Inc.
7201a30de1fSmrg#
7211a30de1fSmrg# This file is free software; the Free Software Foundation
7221a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
7231a30de1fSmrg# with or without modifications, as long as this notice is preserved.
7241a30de1fSmrg
7251a30de1fSmrg# serial 4
7261a30de1fSmrg
7271a30de1fSmrg# AM_SANITY_CHECK
7281a30de1fSmrg# ---------------
7291a30de1fSmrgAC_DEFUN([AM_SANITY_CHECK],
7301a30de1fSmrg[AC_MSG_CHECKING([whether build environment is sane])
7311a30de1fSmrg# Just in case
7321a30de1fSmrgsleep 1
7331a30de1fSmrgecho timestamp > conftest.file
7341a30de1fSmrg# Do `set' in a subshell so we don't clobber the current shell's
7351a30de1fSmrg# arguments.  Must try -L first in case configure is actually a
7361a30de1fSmrg# symlink; some systems play weird games with the mod time of symlinks
7371a30de1fSmrg# (eg FreeBSD returns the mod time of the symlink's containing
7381a30de1fSmrg# directory).
7391a30de1fSmrgif (
7401a30de1fSmrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
7411a30de1fSmrg   if test "$[*]" = "X"; then
7421a30de1fSmrg      # -L didn't work.
7431a30de1fSmrg      set X `ls -t $srcdir/configure conftest.file`
7441a30de1fSmrg   fi
7451a30de1fSmrg   rm -f conftest.file
7461a30de1fSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
7471a30de1fSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
7481a30de1fSmrg
7491a30de1fSmrg      # If neither matched, then we have a broken ls.  This can happen
7501a30de1fSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
7511a30de1fSmrg      # broken ls alias from the environment.  This has actually
7521a30de1fSmrg      # happened.  Such a system could not be considered "sane".
7531a30de1fSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
7541a30de1fSmrgalias in your environment])
7551a30de1fSmrg   fi
7561a30de1fSmrg
7571a30de1fSmrg   test "$[2]" = conftest.file
7581a30de1fSmrg   )
7591a30de1fSmrgthen
7601a30de1fSmrg   # Ok.
7611a30de1fSmrg   :
7621a30de1fSmrgelse
7631a30de1fSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
7641a30de1fSmrgCheck your system clock])
7651a30de1fSmrgfi
7661a30de1fSmrgAC_MSG_RESULT(yes)])
7671a30de1fSmrg
7681a30de1fSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7691a30de1fSmrg#
7701a30de1fSmrg# This file is free software; the Free Software Foundation
7711a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
7721a30de1fSmrg# with or without modifications, as long as this notice is preserved.
7731a30de1fSmrg
7741a30de1fSmrg# AM_PROG_INSTALL_STRIP
7751a30de1fSmrg# ---------------------
7761a30de1fSmrg# One issue with vendor `install' (even GNU) is that you can't
7771a30de1fSmrg# specify the program used to strip binaries.  This is especially
7781a30de1fSmrg# annoying in cross-compiling environments, where the build's strip
7791a30de1fSmrg# is unlikely to handle the host's binaries.
7801a30de1fSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
7811a30de1fSmrg# always use install-sh in `make install-strip', and initialize
7821a30de1fSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
7831a30de1fSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
7841a30de1fSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
7851a30de1fSmrg# Installed binaries are usually stripped using `strip' when the user
7861a30de1fSmrg# run `make install-strip'.  However `strip' might not be the right
7871a30de1fSmrg# tool to use in cross-compilation environments, therefore Automake
7881a30de1fSmrg# will honor the `STRIP' environment variable to overrule this program.
7891a30de1fSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
7901a30de1fSmrgif test "$cross_compiling" != no; then
7911a30de1fSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
7921a30de1fSmrgfi
7931a30de1fSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
7941a30de1fSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
7951a30de1fSmrg
7961a30de1fSmrg# Copyright (C) 2006  Free Software Foundation, Inc.
7971a30de1fSmrg#
7981a30de1fSmrg# This file is free software; the Free Software Foundation
7991a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
8001a30de1fSmrg# with or without modifications, as long as this notice is preserved.
8011a30de1fSmrg
8021a30de1fSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
8031a30de1fSmrg# ---------------------------
8041a30de1fSmrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
8051a30de1fSmrg# This macro is traced by Automake.
8061a30de1fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
8071a30de1fSmrg
8081a30de1fSmrg# Check how to create a tarball.                            -*- Autoconf -*-
8091a30de1fSmrg
8101a30de1fSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
8111a30de1fSmrg#
8121a30de1fSmrg# This file is free software; the Free Software Foundation
8131a30de1fSmrg# gives unlimited permission to copy and/or distribute it,
8141a30de1fSmrg# with or without modifications, as long as this notice is preserved.
8151a30de1fSmrg
8161a30de1fSmrg# serial 2
8171a30de1fSmrg
8181a30de1fSmrg# _AM_PROG_TAR(FORMAT)
8191a30de1fSmrg# --------------------
8201a30de1fSmrg# Check how to create a tarball in format FORMAT.
8211a30de1fSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
8221a30de1fSmrg#
8231a30de1fSmrg# Substitute a variable $(am__tar) that is a command
8241a30de1fSmrg# writing to stdout a FORMAT-tarball containing the directory
8251a30de1fSmrg# $tardir.
8261a30de1fSmrg#     tardir=directory && $(am__tar) > result.tar
8271a30de1fSmrg#
8281a30de1fSmrg# Substitute a variable $(am__untar) that extract such
8291a30de1fSmrg# a tarball read from stdin.
8301a30de1fSmrg#     $(am__untar) < result.tar
8311a30de1fSmrgAC_DEFUN([_AM_PROG_TAR],
8321a30de1fSmrg[# Always define AMTAR for backward compatibility.
8331a30de1fSmrgAM_MISSING_PROG([AMTAR], [tar])
8341a30de1fSmrgm4_if([$1], [v7],
8351a30de1fSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
8361a30de1fSmrg     [m4_case([$1], [ustar],, [pax],,
8371a30de1fSmrg              [m4_fatal([Unknown tar format])])
8381a30de1fSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
8391a30de1fSmrg# Loop over all known methods to create a tar archive until one works.
8401a30de1fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
8411a30de1fSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
8421a30de1fSmrg# Do not fold the above two line into one, because Tru64 sh and
8431a30de1fSmrg# Solaris sh will not grok spaces in the rhs of `-'.
8441a30de1fSmrgfor _am_tool in $_am_tools
8451a30de1fSmrgdo
8461a30de1fSmrg  case $_am_tool in
8471a30de1fSmrg  gnutar)
8481a30de1fSmrg    for _am_tar in tar gnutar gtar;
8491a30de1fSmrg    do
8501a30de1fSmrg      AM_RUN_LOG([$_am_tar --version]) && break
8511a30de1fSmrg    done
8521a30de1fSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
8531a30de1fSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
8541a30de1fSmrg    am__untar="$_am_tar -xf -"
8551a30de1fSmrg    ;;
8561a30de1fSmrg  plaintar)
8571a30de1fSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
8581a30de1fSmrg    # ustar tarball either.
8591a30de1fSmrg    (tar --version) >/dev/null 2>&1 && continue
8601a30de1fSmrg    am__tar='tar chf - "$$tardir"'
8611a30de1fSmrg    am__tar_='tar chf - "$tardir"'
8621a30de1fSmrg    am__untar='tar xf -'
8631a30de1fSmrg    ;;
8641a30de1fSmrg  pax)
8651a30de1fSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
8661a30de1fSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
8671a30de1fSmrg    am__untar='pax -r'
8681a30de1fSmrg    ;;
8691a30de1fSmrg  cpio)
8701a30de1fSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
8711a30de1fSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
8721a30de1fSmrg    am__untar='cpio -i -H $1 -d'
8731a30de1fSmrg    ;;
8741a30de1fSmrg  none)
8751a30de1fSmrg    am__tar=false
8761a30de1fSmrg    am__tar_=false
8771a30de1fSmrg    am__untar=false
8781a30de1fSmrg    ;;
8791a30de1fSmrg  esac
8801a30de1fSmrg
8811a30de1fSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
8821a30de1fSmrg  # and am__untar set.
8831a30de1fSmrg  test -n "${am_cv_prog_tar_$1}" && break
8841a30de1fSmrg
8851a30de1fSmrg  # tar/untar a dummy directory, and stop if the command works
8861a30de1fSmrg  rm -rf conftest.dir
8871a30de1fSmrg  mkdir conftest.dir
8881a30de1fSmrg  echo GrepMe > conftest.dir/file
8891a30de1fSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
8901a30de1fSmrg  rm -rf conftest.dir
8911a30de1fSmrg  if test -s conftest.tar; then
8921a30de1fSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
8931a30de1fSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
8941a30de1fSmrg  fi
8951a30de1fSmrgdone
8961a30de1fSmrgrm -rf conftest.dir
8971a30de1fSmrg
8981a30de1fSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
8991a30de1fSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
9001a30de1fSmrgAC_SUBST([am__tar])
9011a30de1fSmrgAC_SUBST([am__untar])
9021a30de1fSmrg]) # _AM_PROG_TAR
9031a30de1fSmrg
9041a30de1fSmrgdnl
9051a30de1fSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
9061a30de1fSmrgdnl 
9071a30de1fSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9081a30de1fSmrgdnl copy of this software and associated documentation files (the
9091a30de1fSmrgdnl "Software"), to deal in the Software without restriction, including
9101a30de1fSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
9111a30de1fSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
9121a30de1fSmrgdnl to whom the Software is furnished to do so, provided that the above
9131a30de1fSmrgdnl copyright notice(s) and this permission notice appear in all copies of
9141a30de1fSmrgdnl the Software and that both the above copyright notice(s) and this
9151a30de1fSmrgdnl permission notice appear in supporting documentation.
9161a30de1fSmrgdnl
9171a30de1fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9181a30de1fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9191a30de1fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
9201a30de1fSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
9211a30de1fSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
9221a30de1fSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
9231a30de1fSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
9241a30de1fSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
9251a30de1fSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9261a30de1fSmrgdnl
9271a30de1fSmrgdnl Except as contained in this notice, the name of a copyright holder
9281a30de1fSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
9291a30de1fSmrgdnl or other dealings in this Software without prior written authorization
9301a30de1fSmrgdnl of the copyright holder.
9311a30de1fSmrg
9321a30de1fSmrg# XORG_MACROS_VERSION(required-version)
9331a30de1fSmrg# -------------------------------------
9341a30de1fSmrg# Minimum version: 1.1.0
9351a30de1fSmrg#
9361a30de1fSmrg# If you're using a macro added in Version 1.1 or newer, include this in
9371a30de1fSmrg# your configure.ac with the minimum required version, such as:
9381a30de1fSmrg# XORG_MACROS_VERSION(1.1)
9391a30de1fSmrg#
9401a30de1fSmrg# To force at least a version with this macro defined, also add:
9411a30de1fSmrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9421a30de1fSmrg#
9431a30de1fSmrg#
9441a30de1fSmrg# See the "minimum version" comment for each macro you use to see what 
9451a30de1fSmrg# version you require.
9461a30de1fSmrgAC_DEFUN([XORG_MACROS_VERSION],[
9471a30de1fSmrg	[XORG_MACROS_needed_version=$1
9481a30de1fSmrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
9491a30de1fSmrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
9501a30de1fSmrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
9511a30de1fSmrg	[XORG_MACROS_version=1.1.5
9521a30de1fSmrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
9531a30de1fSmrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
9541a30de1fSmrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
9551a30de1fSmrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
9561a30de1fSmrg	fi
9571a30de1fSmrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
9581a30de1fSmrg		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
9591a30de1fSmrg	fi
9601a30de1fSmrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
9611a30de1fSmrg]) # XORG_MACROS_VERSION
9621a30de1fSmrg
9631a30de1fSmrg# XORG_PROG_RAWCPP()
9641a30de1fSmrg# ------------------
9651a30de1fSmrg# Minimum version: 1.0.0
9661a30de1fSmrg#
9671a30de1fSmrg# Find cpp program and necessary flags for use in pre-processing text files
9681a30de1fSmrg# such as man pages and config files
9691a30de1fSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9701a30de1fSmrgAC_REQUIRE([AC_PROG_CPP])
9711a30de1fSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9721a30de1fSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9731a30de1fSmrg
9741a30de1fSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9751a30de1fSmrg# which is not the best choice for supporting other OS'es, but covers most
9761a30de1fSmrg# of the ones we need for now.
9771a30de1fSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9781a30de1fSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
9791a30de1fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9801a30de1fSmrg	AC_MSG_RESULT([no])
9811a30de1fSmrgelse
9821a30de1fSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9831a30de1fSmrg		RAWCPPFLAGS=-undef
9841a30de1fSmrg		AC_MSG_RESULT([yes])
9851a30de1fSmrg	else
9861a30de1fSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9871a30de1fSmrg	fi
9881a30de1fSmrgfi
9891a30de1fSmrgrm -f conftest.$ac_ext
9901a30de1fSmrg
9911a30de1fSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9921a30de1fSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
9931a30de1fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9941a30de1fSmrg	AC_MSG_RESULT([no])
9951a30de1fSmrgelse
9961a30de1fSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9971a30de1fSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9981a30de1fSmrg		AC_MSG_RESULT([yes])
9991a30de1fSmrg	else
10001a30de1fSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
10011a30de1fSmrg	fi
10021a30de1fSmrgfi
10031a30de1fSmrgrm -f conftest.$ac_ext
10041a30de1fSmrgAC_SUBST(RAWCPPFLAGS)
10051a30de1fSmrg]) # XORG_PROG_RAWCPP
10061a30de1fSmrg
10071a30de1fSmrg# XORG_MANPAGE_SECTIONS()
10081a30de1fSmrg# -----------------------
10091a30de1fSmrg# Minimum version: 1.0.0
10101a30de1fSmrg#
10111a30de1fSmrg# Determine which sections man pages go in for the different man page types
10121a30de1fSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
10131a30de1fSmrg# Not sure if there's any better way than just hardcoding by OS name.
10141a30de1fSmrg# Override default settings by setting environment variables
10151a30de1fSmrg
10161a30de1fSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
10171a30de1fSmrgAC_REQUIRE([AC_CANONICAL_HOST])
10181a30de1fSmrg
10191a30de1fSmrgif test x$APP_MAN_SUFFIX = x    ; then
10201a30de1fSmrg    APP_MAN_SUFFIX=1
10211a30de1fSmrgfi
10221a30de1fSmrgif test x$APP_MAN_DIR = x    ; then
10231a30de1fSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
10241a30de1fSmrgfi
10251a30de1fSmrg
10261a30de1fSmrgif test x$LIB_MAN_SUFFIX = x    ; then
10271a30de1fSmrg    LIB_MAN_SUFFIX=3
10281a30de1fSmrgfi
10291a30de1fSmrgif test x$LIB_MAN_DIR = x    ; then
10301a30de1fSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
10311a30de1fSmrgfi
10321a30de1fSmrg
10331a30de1fSmrgif test x$FILE_MAN_SUFFIX = x    ; then
10341a30de1fSmrg    case $host_os in
10351a30de1fSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
10361a30de1fSmrg	*)		FILE_MAN_SUFFIX=5  ;;
10371a30de1fSmrg    esac
10381a30de1fSmrgfi
10391a30de1fSmrgif test x$FILE_MAN_DIR = x    ; then
10401a30de1fSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10411a30de1fSmrgfi
10421a30de1fSmrg
10431a30de1fSmrgif test x$MISC_MAN_SUFFIX = x    ; then
10441a30de1fSmrg    case $host_os in
10451a30de1fSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
10461a30de1fSmrg	*)		MISC_MAN_SUFFIX=7  ;;
10471a30de1fSmrg    esac
10481a30de1fSmrgfi
10491a30de1fSmrgif test x$MISC_MAN_DIR = x    ; then
10501a30de1fSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
10511a30de1fSmrgfi
10521a30de1fSmrg
10531a30de1fSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
10541a30de1fSmrg    case $host_os in
10551a30de1fSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
10561a30de1fSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
10571a30de1fSmrg    esac
10581a30de1fSmrgfi
10591a30de1fSmrgif test x$DRIVER_MAN_DIR = x    ; then
10601a30de1fSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
10611a30de1fSmrgfi
10621a30de1fSmrg
10631a30de1fSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
10641a30de1fSmrg    case $host_os in
10651a30de1fSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
10661a30de1fSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
10671a30de1fSmrg    esac
10681a30de1fSmrgfi
10691a30de1fSmrgif test x$ADMIN_MAN_DIR = x    ; then
10701a30de1fSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
10711a30de1fSmrgfi
10721a30de1fSmrg
10731a30de1fSmrg
10741a30de1fSmrgAC_SUBST([APP_MAN_SUFFIX])
10751a30de1fSmrgAC_SUBST([LIB_MAN_SUFFIX])
10761a30de1fSmrgAC_SUBST([FILE_MAN_SUFFIX])
10771a30de1fSmrgAC_SUBST([MISC_MAN_SUFFIX])
10781a30de1fSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
10791a30de1fSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
10801a30de1fSmrgAC_SUBST([APP_MAN_DIR])
10811a30de1fSmrgAC_SUBST([LIB_MAN_DIR])
10821a30de1fSmrgAC_SUBST([FILE_MAN_DIR])
10831a30de1fSmrgAC_SUBST([MISC_MAN_DIR])
10841a30de1fSmrgAC_SUBST([DRIVER_MAN_DIR])
10851a30de1fSmrgAC_SUBST([ADMIN_MAN_DIR])
10861a30de1fSmrg]) # XORG_MANPAGE_SECTIONS
10871a30de1fSmrg
10881a30de1fSmrg# XORG_CHECK_LINUXDOC
10891a30de1fSmrg# -------------------
10901a30de1fSmrg# Minimum version: 1.0.0
10911a30de1fSmrg#
10921a30de1fSmrg# Defines the variable MAKE_TEXT if the necessary tools and
10931a30de1fSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10941a30de1fSmrg# Whether or not the necessary tools and files are found can be checked
10951a30de1fSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10961a30de1fSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
10971a30de1fSmrgXORG_SGML_PATH=$prefix/share/sgml
10981a30de1fSmrgHAVE_DEFS_ENT=
10991a30de1fSmrg
11001a30de1fSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
11011a30de1fSmrg
11021a30de1fSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
11031a30de1fSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
11041a30de1fSmrg
11051a30de1fSmrgAC_MSG_CHECKING([Whether to build documentation])
11061a30de1fSmrg
11071a30de1fSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
11081a30de1fSmrg   BUILDDOC=yes
11091a30de1fSmrgelse
11101a30de1fSmrg   BUILDDOC=no
11111a30de1fSmrgfi
11121a30de1fSmrg
11131a30de1fSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
11141a30de1fSmrg
11151a30de1fSmrgAC_MSG_RESULT([$BUILDDOC])
11161a30de1fSmrg
11171a30de1fSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
11181a30de1fSmrg
11191a30de1fSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
11201a30de1fSmrg   BUILDPDFDOC=yes
11211a30de1fSmrgelse
11221a30de1fSmrg   BUILDPDFDOC=no
11231a30de1fSmrgfi
11241a30de1fSmrg
11251a30de1fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
11261a30de1fSmrg
11271a30de1fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
11281a30de1fSmrg
11291a30de1fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
11301a30de1fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
11311a30de1fSmrgMAKE_PDF="$PS2PDF"
11321a30de1fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
11331a30de1fSmrg
11341a30de1fSmrgAC_SUBST(MAKE_TEXT)
11351a30de1fSmrgAC_SUBST(MAKE_PS)
11361a30de1fSmrgAC_SUBST(MAKE_PDF)
11371a30de1fSmrgAC_SUBST(MAKE_HTML)
11381a30de1fSmrg]) # XORG_CHECK_LINUXDOC
11391a30de1fSmrg
11401a30de1fSmrg# XORG_CHECK_DOCBOOK
11411a30de1fSmrg# -------------------
11421a30de1fSmrg# Minimum version: 1.0.0
11431a30de1fSmrg#
11441a30de1fSmrg# Checks for the ability to build output formats from SGML DocBook source.
11451a30de1fSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
11461a30de1fSmrg# indicates whether the necessary tools and files are found and, if set,
11471a30de1fSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
11481a30de1fSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
11491a30de1fSmrgXORG_SGML_PATH=$prefix/share/sgml
11501a30de1fSmrgHAVE_DEFS_ENT=
11511a30de1fSmrgBUILDTXTDOC=no
11521a30de1fSmrgBUILDPDFDOC=no
11531a30de1fSmrgBUILDPSDOC=no
11541a30de1fSmrgBUILDHTMLDOC=no
11551a30de1fSmrg
11561a30de1fSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
11571a30de1fSmrg
11581a30de1fSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
11591a30de1fSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
11601a30de1fSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
11611a30de1fSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
11621a30de1fSmrg
11631a30de1fSmrgAC_MSG_CHECKING([Whether to build text documentation])
11641a30de1fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
11651a30de1fSmrg   test x$BUILD_TXTDOC != xno; then
11661a30de1fSmrg	BUILDTXTDOC=yes
11671a30de1fSmrgfi
11681a30de1fSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
11691a30de1fSmrgAC_MSG_RESULT([$BUILDTXTDOC])
11701a30de1fSmrg
11711a30de1fSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
11721a30de1fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
11731a30de1fSmrg   test x$BUILD_PDFDOC != xno; then
11741a30de1fSmrg	BUILDPDFDOC=yes
11751a30de1fSmrgfi
11761a30de1fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
11771a30de1fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
11781a30de1fSmrg
11791a30de1fSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
11801a30de1fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
11811a30de1fSmrg   test x$BUILD_PSDOC != xno; then
11821a30de1fSmrg	BUILDPSDOC=yes
11831a30de1fSmrgfi
11841a30de1fSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
11851a30de1fSmrgAC_MSG_RESULT([$BUILDPSDOC])
11861a30de1fSmrg
11871a30de1fSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
11881a30de1fSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
11891a30de1fSmrg   test x$BUILD_HTMLDOC != xno; then
11901a30de1fSmrg	BUILDHTMLDOC=yes
11911a30de1fSmrgfi
11921a30de1fSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
11931a30de1fSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
11941a30de1fSmrg
11951a30de1fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
11961a30de1fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
11971a30de1fSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
11981a30de1fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
11991a30de1fSmrg
12001a30de1fSmrgAC_SUBST(MAKE_TEXT)
12011a30de1fSmrgAC_SUBST(MAKE_PS)
12021a30de1fSmrgAC_SUBST(MAKE_PDF)
12031a30de1fSmrgAC_SUBST(MAKE_HTML)
12041a30de1fSmrg]) # XORG_CHECK_DOCBOOK
12051a30de1fSmrg
12061a30de1fSmrg# XORG_CHECK_MALLOC_ZERO
12071a30de1fSmrg# ----------------------
12081a30de1fSmrg# Minimum version: 1.0.0
12091a30de1fSmrg#
12101a30de1fSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
12111a30de1fSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
12121a30de1fSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
12131a30de1fSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
12141a30de1fSmrgAC_ARG_ENABLE(malloc0returnsnull,
12151a30de1fSmrg	AC_HELP_STRING([--enable-malloc0returnsnull],
12161a30de1fSmrg		       [malloc(0) returns NULL (default: auto)]),
12171a30de1fSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
12181a30de1fSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
12191a30de1fSmrg
12201a30de1fSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
12211a30de1fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
12221a30de1fSmrg	AC_RUN_IFELSE([
12231a30de1fSmrgchar *malloc();
12241a30de1fSmrgchar *realloc();
12251a30de1fSmrgchar *calloc();
12261a30de1fSmrgmain() {
12271a30de1fSmrg    char *m0, *r0, *c0, *p;
12281a30de1fSmrg    m0 = malloc(0);
12291a30de1fSmrg    p = malloc(10);
12301a30de1fSmrg    r0 = realloc(p,0);
12311a30de1fSmrg    c0 = calloc(0);
12321a30de1fSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
12331a30de1fSmrg}],
12341a30de1fSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
12351a30de1fSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
12361a30de1fSmrgfi
12371a30de1fSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
12381a30de1fSmrg
12391a30de1fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
12401a30de1fSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
12411a30de1fSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
12421a30de1fSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
12431a30de1fSmrgelse
12441a30de1fSmrg	MALLOC_ZERO_CFLAGS=""
12451a30de1fSmrg	XMALLOC_ZERO_CFLAGS=""
12461a30de1fSmrg	XTMALLOC_ZERO_CFLAGS=""
12471a30de1fSmrgfi
12481a30de1fSmrg
12491a30de1fSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
12501a30de1fSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
12511a30de1fSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
12521a30de1fSmrg]) # XORG_CHECK_MALLOC_ZERO
12531a30de1fSmrg
12541a30de1fSmrg# XORG_WITH_LINT()
12551a30de1fSmrg# ----------------
12561a30de1fSmrg# Minimum version: 1.1.0
12571a30de1fSmrg#
12581a30de1fSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
12591a30de1fSmrg# is specified.   (Use --with-lint=sparse for sparse.)
12601a30de1fSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
12611a30de1fSmrg# Sets $LINT_FLAGS to flags to pass to source checker
12621a30de1fSmrg# Sets LINT automake conditional if enabled (default: disabled)
12631a30de1fSmrg#
12641a30de1fSmrgAC_DEFUN([XORG_WITH_LINT],[
12651a30de1fSmrg
12661a30de1fSmrg# Allow checking code with lint, sparse, etc.
12671a30de1fSmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
12681a30de1fSmrg		[Use a lint-style source code checker (default: disabled)])],
12691a30de1fSmrg		[use_lint=$withval], [use_lint=no])
12701a30de1fSmrgif test "x$use_lint" = "xyes" ; then
12711a30de1fSmrg	LINT="lint"
12721a30de1fSmrgelse
12731a30de1fSmrg	LINT="$use_lint"
12741a30de1fSmrgfi
12751a30de1fSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
12761a30de1fSmrg    case $LINT in
12771a30de1fSmrg	lint|*/lint)
12781a30de1fSmrg	    case $host_os in
12791a30de1fSmrg		solaris*)
12801a30de1fSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
12811a30de1fSmrg			;;
12821a30de1fSmrg	    esac
12831a30de1fSmrg	    ;;
12841a30de1fSmrg    esac
12851a30de1fSmrgfi
12861a30de1fSmrg
12871a30de1fSmrgAC_SUBST(LINT)
12881a30de1fSmrgAC_SUBST(LINT_FLAGS)
12891a30de1fSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
12901a30de1fSmrg
12911a30de1fSmrg]) # XORG_WITH_LINT
12921a30de1fSmrg
12931a30de1fSmrg# XORG_LINT_LIBRARY(LIBNAME)
12941a30de1fSmrg# --------------------------
12951a30de1fSmrg# Minimum version: 1.1.0
12961a30de1fSmrg#
12971a30de1fSmrg# Sets up flags for building lint libraries for checking programs that call
12981a30de1fSmrg# functions in the library.
12991a30de1fSmrg# Disabled by default, enable with --enable-lint-library
13001a30de1fSmrg# Sets: 
13011a30de1fSmrg#	@LINTLIB@		- name of lint library file to make
13021a30de1fSmrg#	MAKE_LINT_LIB		- automake conditional
13031a30de1fSmrg#
13041a30de1fSmrg
13051a30de1fSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
13061a30de1fSmrgAC_REQUIRE([XORG_WITH_LINT])
13071a30de1fSmrg# Build lint "library" for more indepth checks of programs calling this library
13081a30de1fSmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
13091a30de1fSmrg	[Create lint library (default: disabled)])],
13101a30de1fSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
13111a30de1fSmrgif test "x$make_lint_lib" != "xno" ; then
13121a30de1fSmrg	if test "x$LINT" = "xno" ; then
13131a30de1fSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
13141a30de1fSmrg	fi
13151a30de1fSmrg	if test "x$make_lint_lib" = "xyes" ; then
13161a30de1fSmrg		LINTLIB=llib-l$1.ln
13171a30de1fSmrg	else
13181a30de1fSmrg		LINTLIB=$make_lint_lib
13191a30de1fSmrg	fi
13201a30de1fSmrgfi
13211a30de1fSmrgAC_SUBST(LINTLIB)
13221a30de1fSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
13231a30de1fSmrg
13241a30de1fSmrg]) # XORG_LINT_LIBRARY
13251a30de1fSmrg
13261a30de1fSmrgdnl Copyright 2005 Red Hat, Inc
13271a30de1fSmrgdnl
13281a30de1fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
13291a30de1fSmrgdnl documentation for any purpose is hereby granted without fee, provided that
13301a30de1fSmrgdnl the above copyright notice appear in all copies and that both that
13311a30de1fSmrgdnl copyright notice and this permission notice appear in supporting
13321a30de1fSmrgdnl documentation.
13331a30de1fSmrgdnl
13341a30de1fSmrgdnl The above copyright notice and this permission notice shall be included
13351a30de1fSmrgdnl in all copies or substantial portions of the Software.
13361a30de1fSmrgdnl
13371a30de1fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13381a30de1fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13391a30de1fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
13401a30de1fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
13411a30de1fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
13421a30de1fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
13431a30de1fSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
13441a30de1fSmrgdnl
13451a30de1fSmrgdnl Except as contained in this notice, the name of the copyright holders shall
13461a30de1fSmrgdnl not be used in advertising or otherwise to promote the sale, use or
13471a30de1fSmrgdnl other dealings in this Software without prior written authorization
13481a30de1fSmrgdnl from the copyright holders.
13491a30de1fSmrgdnl
13501a30de1fSmrg
13511a30de1fSmrg# XORG_RELEASE_VERSION
13521a30de1fSmrg# --------------------
13531a30de1fSmrg# Adds --with/without-release-string and changes the PACKAGE and
13541a30de1fSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
13551a30de1fSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
13561a30de1fSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
13571a30de1fSmrg 
13581a30de1fSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
13591a30de1fSmrg	AC_ARG_WITH(release-version,
13601a30de1fSmrg			AC_HELP_STRING([--with-release-version=STRING],
13611a30de1fSmrg				[Use release version string in package name]),
13621a30de1fSmrg			[RELEASE_VERSION="$withval"],
13631a30de1fSmrg			[RELEASE_VERSION=""])
13641a30de1fSmrg	if test "x$RELEASE_VERSION" != "x"; then
13651a30de1fSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
13661a30de1fSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
13671a30de1fSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
13681a30de1fSmrg	fi
13691a30de1fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
13701a30de1fSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
13711a30de1fSmrg		[Major version of this package])
13721a30de1fSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
13731a30de1fSmrg	if test "x$PVM" = "x"; then
13741a30de1fSmrg		PVM="0"
13751a30de1fSmrg	fi
13761a30de1fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
13771a30de1fSmrg		[$PVM],
13781a30de1fSmrg		[Minor version of this package])
13791a30de1fSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
13801a30de1fSmrg	if test "x$PVP" = "x"; then
13811a30de1fSmrg		PVP="0"
13821a30de1fSmrg	fi
13831a30de1fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
13841a30de1fSmrg		[$PVP],
13851a30de1fSmrg		[Patch version of this package])
13861a30de1fSmrg])
13871a30de1fSmrg
13881a30de1fSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
13891a30de1fSmrg# 
13901a30de1fSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
13911a30de1fSmrg#
13921a30de1fSmrg# This program is free software; you can redistribute it and/or modify
13931a30de1fSmrg# it under the terms of the GNU General Public License as published by
13941a30de1fSmrg# the Free Software Foundation; either version 2 of the License, or
13951a30de1fSmrg# (at your option) any later version.
13961a30de1fSmrg#
13971a30de1fSmrg# This program is distributed in the hope that it will be useful, but
13981a30de1fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
13991a30de1fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14001a30de1fSmrg# General Public License for more details.
14011a30de1fSmrg#
14021a30de1fSmrg# You should have received a copy of the GNU General Public License
14031a30de1fSmrg# along with this program; if not, write to the Free Software
14041a30de1fSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
14051a30de1fSmrg#
14061a30de1fSmrg# As a special exception to the GNU General Public License, if you
14071a30de1fSmrg# distribute this file as part of a program that contains a
14081a30de1fSmrg# configuration script generated by Autoconf, you may include it under
14091a30de1fSmrg# the same distribution terms that you use for the rest of that program.
14101a30de1fSmrg
14111a30de1fSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
14121a30de1fSmrg# ----------------------------------
14131a30de1fSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
14141a30de1fSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
14151a30de1fSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
14161a30de1fSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
14171a30de1fSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
14181a30de1fSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
14191a30de1fSmrgfi
14201a30de1fSmrgif test -n "$PKG_CONFIG"; then
14211a30de1fSmrg	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
14221a30de1fSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
14231a30de1fSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
14241a30de1fSmrg		AC_MSG_RESULT([yes])
14251a30de1fSmrg	else
14261a30de1fSmrg		AC_MSG_RESULT([no])
14271a30de1fSmrg		PKG_CONFIG=""
14281a30de1fSmrg	fi
14291a30de1fSmrg		
14301a30de1fSmrgfi[]dnl
14311a30de1fSmrg])# PKG_PROG_PKG_CONFIG
14321a30de1fSmrg
14331a30de1fSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
14341a30de1fSmrg#
14351a30de1fSmrg# Check to see whether a particular set of modules exists.  Similar
14361a30de1fSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
14371a30de1fSmrg#
14381a30de1fSmrg#
14391a30de1fSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
14401a30de1fSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
14411a30de1fSmrg# PKG_CHECK_EXISTS manually
14421a30de1fSmrg# --------------------------------------------------------------
14431a30de1fSmrgAC_DEFUN([PKG_CHECK_EXISTS],
14441a30de1fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
14451a30de1fSmrgif test -n "$PKG_CONFIG" && \
14461a30de1fSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
14471a30de1fSmrg  m4_ifval([$2], [$2], [:])
14481a30de1fSmrgm4_ifvaln([$3], [else
14491a30de1fSmrg  $3])dnl
14501a30de1fSmrgfi])
14511a30de1fSmrg
14521a30de1fSmrg
14531a30de1fSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
14541a30de1fSmrg# ---------------------------------------------
14551a30de1fSmrgm4_define([_PKG_CONFIG],
14561a30de1fSmrg[if test -n "$PKG_CONFIG"; then
14571a30de1fSmrg        PKG_CHECK_EXISTS([$3],
14581a30de1fSmrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
14591a30de1fSmrg			 [pkg_failed=yes])
14601a30de1fSmrgelse
14611a30de1fSmrg	pkg_failed=untried
14621a30de1fSmrgfi[]dnl
14631a30de1fSmrg])# _PKG_CONFIG
14641a30de1fSmrg
14651a30de1fSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
14661a30de1fSmrg# [ACTION-IF-NOT-FOUND])
14671a30de1fSmrg#
14681a30de1fSmrg#
14691a30de1fSmrg# Note that if there is a possibility the first call to
14701a30de1fSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
14711a30de1fSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
14721a30de1fSmrg#
14731a30de1fSmrg#
14741a30de1fSmrg# --------------------------------------------------------------
14751a30de1fSmrgAC_DEFUN([PKG_CHECK_MODULES],
14761a30de1fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
14771a30de1fSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
14781a30de1fSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
14791a30de1fSmrg
14801a30de1fSmrgpkg_failed=no
14811a30de1fSmrgAC_MSG_CHECKING([for $1])
14821a30de1fSmrg
14831a30de1fSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
14841a30de1fSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
14851a30de1fSmrg
14861a30de1fSmrgif test $pkg_failed = yes; then
14871a30de1fSmrg	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
14881a30de1fSmrg	# Put the nasty error message in config.log where it belongs
14891a30de1fSmrg	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
14901a30de1fSmrg
14911a30de1fSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
14921a30de1fSmrg[Package requirements ($2) were not met.
14931a30de1fSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
14941a30de1fSmrginstalled software in a non-standard prefix.
14951a30de1fSmrg
14961a30de1fSmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
14971a30de1fSmrgto avoid the need to call pkg-config.  See the pkg-config man page for
14981a30de1fSmrgmore details.])],
14991a30de1fSmrg		[$4])
15001a30de1fSmrgelif test $pkg_failed = untried; then
15011a30de1fSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
15021a30de1fSmrg[The pkg-config script could not be found or is too old.  Make sure it
15031a30de1fSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
15041a30de1fSmrgpath to pkg-config.
15051a30de1fSmrg
15061a30de1fSmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
15071a30de1fSmrgto avoid the need to call pkg-config.  See the pkg-config man page for
15081a30de1fSmrgmore details.
15091a30de1fSmrg
15101a30de1fSmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
15111a30de1fSmrg		[$4])
15121a30de1fSmrgelse
15131a30de1fSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
15141a30de1fSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
15151a30de1fSmrg        AC_MSG_RESULT([yes])
15161a30de1fSmrg	ifelse([$3], , :, [$3])
15171a30de1fSmrgfi[]dnl
15181a30de1fSmrg])# PKG_CHECK_MODULES
15191a30de1fSmrg
1520