aclocal.m4 revision 9fe995a9
19fe995a9Smrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
29fe995a9Smrg
39fe995a9Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
49fe995a9Smrg# 2005, 2006  Free Software Foundation, Inc.
59fe995a9Smrg# This file is free software; the Free Software Foundation
69fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
79fe995a9Smrg# with or without modifications, as long as this notice is preserved.
89fe995a9Smrg
99fe995a9Smrg# This program is distributed in the hope that it will be useful,
109fe995a9Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
119fe995a9Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
129fe995a9Smrg# PARTICULAR PURPOSE.
139fe995a9Smrg
149fe995a9Smrgm4_if(m4_PACKAGE_VERSION, [2.61],,
159fe995a9Smrg[m4_fatal([this file was generated for autoconf 2.61.
169fe995a9SmrgYou have another version of autoconf.  If you want to use that,
179fe995a9Smrgyou should regenerate the build system entirely.], [63])])
189fe995a9Smrg
199fe995a9Smrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
209fe995a9Smrg#
219fe995a9Smrg# This file is free software; the Free Software Foundation
229fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
239fe995a9Smrg# with or without modifications, as long as this notice is preserved.
249fe995a9Smrg
259fe995a9Smrg# AM_AUTOMAKE_VERSION(VERSION)
269fe995a9Smrg# ----------------------------
279fe995a9Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
289fe995a9Smrg# generated from the m4 files accompanying Automake X.Y.
299fe995a9Smrg# (This private macro should not be called outside this file.)
309fe995a9SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
319fe995a9Smrg[am__api_version='1.10'
329fe995a9Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
339fe995a9Smrgdnl require some minimum version.  Point them to the right macro.
349fe995a9Smrgm4_if([$1], [1.10], [],
359fe995a9Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
369fe995a9Smrg])
379fe995a9Smrg
389fe995a9Smrg# _AM_AUTOCONF_VERSION(VERSION)
399fe995a9Smrg# -----------------------------
409fe995a9Smrg# aclocal traces this macro to find the Autoconf version.
419fe995a9Smrg# This is a private macro too.  Using m4_define simplifies
429fe995a9Smrg# the logic in aclocal, which can simply ignore this definition.
439fe995a9Smrgm4_define([_AM_AUTOCONF_VERSION], [])
449fe995a9Smrg
459fe995a9Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
469fe995a9Smrg# -------------------------------
479fe995a9Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
489fe995a9Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
499fe995a9SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
509fe995a9Smrg[AM_AUTOMAKE_VERSION([1.10])dnl
519fe995a9Smrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
529fe995a9Smrg
539fe995a9Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
549fe995a9Smrg
559fe995a9Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
569fe995a9Smrg#
579fe995a9Smrg# This file is free software; the Free Software Foundation
589fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
599fe995a9Smrg# with or without modifications, as long as this notice is preserved.
609fe995a9Smrg
619fe995a9Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
629fe995a9Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
639fe995a9Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
649fe995a9Smrg#
659fe995a9Smrg# Of course, Automake must honor this variable whenever it calls a
669fe995a9Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
679fe995a9Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
689fe995a9Smrg# depending on how configure is run.  This is pretty annoying, since
699fe995a9Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
709fe995a9Smrg# source directory, any form will work fine, but in subdirectories a
719fe995a9Smrg# relative path needs to be adjusted first.
729fe995a9Smrg#
739fe995a9Smrg# $ac_aux_dir/missing
749fe995a9Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
759fe995a9Smrg# $top_srcdir/$ac_aux_dir/missing
769fe995a9Smrg#    fails if $ac_aux_dir is absolute,
779fe995a9Smrg#    fails when called from a subdirectory in a VPATH build with
789fe995a9Smrg#          a relative $ac_aux_dir
799fe995a9Smrg#
809fe995a9Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
819fe995a9Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
829fe995a9Smrg# harmless because $srcdir is `.', but things will broke when you
839fe995a9Smrg# start a VPATH build or use an absolute $srcdir.
849fe995a9Smrg#
859fe995a9Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
869fe995a9Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
879fe995a9Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
889fe995a9Smrg# and then we would define $MISSING as
899fe995a9Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
909fe995a9Smrg# This will work as long as MISSING is not called from configure, because
919fe995a9Smrg# unfortunately $(top_srcdir) has no meaning in configure.
929fe995a9Smrg# However there are other variables, like CC, which are often used in
939fe995a9Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
949fe995a9Smrg#
959fe995a9Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
969fe995a9Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
979fe995a9Smrg# configured tree to be moved without reconfiguration.
989fe995a9Smrg
999fe995a9SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1009fe995a9Smrg[dnl Rely on autoconf to set up CDPATH properly.
1019fe995a9SmrgAC_PREREQ([2.50])dnl
1029fe995a9Smrg# expand $ac_aux_dir to an absolute path
1039fe995a9Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
1049fe995a9Smrg])
1059fe995a9Smrg
1069fe995a9Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1079fe995a9Smrg
1089fe995a9Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
1099fe995a9Smrg# Free Software Foundation, Inc.
1109fe995a9Smrg#
1119fe995a9Smrg# This file is free software; the Free Software Foundation
1129fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
1139fe995a9Smrg# with or without modifications, as long as this notice is preserved.
1149fe995a9Smrg
1159fe995a9Smrg# serial 8
1169fe995a9Smrg
1179fe995a9Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1189fe995a9Smrg# -------------------------------------
1199fe995a9Smrg# Define a conditional.
1209fe995a9SmrgAC_DEFUN([AM_CONDITIONAL],
1219fe995a9Smrg[AC_PREREQ(2.52)dnl
1229fe995a9Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1239fe995a9Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1249fe995a9SmrgAC_SUBST([$1_TRUE])dnl
1259fe995a9SmrgAC_SUBST([$1_FALSE])dnl
1269fe995a9Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1279fe995a9Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1289fe995a9Smrgif $2; then
1299fe995a9Smrg  $1_TRUE=
1309fe995a9Smrg  $1_FALSE='#'
1319fe995a9Smrgelse
1329fe995a9Smrg  $1_TRUE='#'
1339fe995a9Smrg  $1_FALSE=
1349fe995a9Smrgfi
1359fe995a9SmrgAC_CONFIG_COMMANDS_PRE(
1369fe995a9Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1379fe995a9Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1389fe995a9SmrgUsually this means the macro was only invoked conditionally.]])
1399fe995a9Smrgfi])])
1409fe995a9Smrg
1419fe995a9Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1429fe995a9Smrg# Free Software Foundation, Inc.
1439fe995a9Smrg#
1449fe995a9Smrg# This file is free software; the Free Software Foundation
1459fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
1469fe995a9Smrg# with or without modifications, as long as this notice is preserved.
1479fe995a9Smrg
1489fe995a9Smrg# serial 9
1499fe995a9Smrg
1509fe995a9Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1519fe995a9Smrg# written in clear, in which case automake, when reading aclocal.m4,
1529fe995a9Smrg# will think it sees a *use*, and therefore will trigger all it's
1539fe995a9Smrg# C support machinery.  Also note that it means that autoscan, seeing
1549fe995a9Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1559fe995a9Smrg
1569fe995a9Smrg
1579fe995a9Smrg# _AM_DEPENDENCIES(NAME)
1589fe995a9Smrg# ----------------------
1599fe995a9Smrg# See how the compiler implements dependency checking.
1609fe995a9Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1619fe995a9Smrg# We try a few techniques and use that to set a single cache variable.
1629fe995a9Smrg#
1639fe995a9Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1649fe995a9Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1659fe995a9Smrg# dependency, and given that the user is not expected to run this macro,
1669fe995a9Smrg# just rely on AC_PROG_CC.
1679fe995a9SmrgAC_DEFUN([_AM_DEPENDENCIES],
1689fe995a9Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1699fe995a9SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1709fe995a9SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1719fe995a9SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1729fe995a9Smrg
1739fe995a9Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1749fe995a9Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1759fe995a9Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1769fe995a9Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1779fe995a9Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1789fe995a9Smrg                   [depcc="$$1"   am_compiler_list=])
1799fe995a9Smrg
1809fe995a9SmrgAC_CACHE_CHECK([dependency style of $depcc],
1819fe995a9Smrg               [am_cv_$1_dependencies_compiler_type],
1829fe995a9Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1839fe995a9Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1849fe995a9Smrg  # making bogus files that we don't know about and never remove.  For
1859fe995a9Smrg  # instance it was reported that on HP-UX the gcc test will end up
1869fe995a9Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
1879fe995a9Smrg  # in D'.
1889fe995a9Smrg  mkdir conftest.dir
1899fe995a9Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1909fe995a9Smrg  # using a relative directory.
1919fe995a9Smrg  cp "$am_depcomp" conftest.dir
1929fe995a9Smrg  cd conftest.dir
1939fe995a9Smrg  # We will build objects and dependencies in a subdirectory because
1949fe995a9Smrg  # it helps to detect inapplicable dependency modes.  For instance
1959fe995a9Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1969fe995a9Smrg  # side effect of compilation, but ICC will put the dependencies in
1979fe995a9Smrg  # the current directory while Tru64 will put them in the object
1989fe995a9Smrg  # directory.
1999fe995a9Smrg  mkdir sub
2009fe995a9Smrg
2019fe995a9Smrg  am_cv_$1_dependencies_compiler_type=none
2029fe995a9Smrg  if test "$am_compiler_list" = ""; then
2039fe995a9Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2049fe995a9Smrg  fi
2059fe995a9Smrg  for depmode in $am_compiler_list; do
2069fe995a9Smrg    # Setup a source with many dependencies, because some compilers
2079fe995a9Smrg    # like to wrap large dependency lists on column 80 (with \), and
2089fe995a9Smrg    # we should not choose a depcomp mode which is confused by this.
2099fe995a9Smrg    #
2109fe995a9Smrg    # We need to recreate these files for each test, as the compiler may
2119fe995a9Smrg    # overwrite some of them when testing with obscure command lines.
2129fe995a9Smrg    # This happens at least with the AIX C compiler.
2139fe995a9Smrg    : > sub/conftest.c
2149fe995a9Smrg    for i in 1 2 3 4 5 6; do
2159fe995a9Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2169fe995a9Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2179fe995a9Smrg      # Solaris 8's {/usr,}/bin/sh.
2189fe995a9Smrg      touch sub/conftst$i.h
2199fe995a9Smrg    done
2209fe995a9Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2219fe995a9Smrg
2229fe995a9Smrg    case $depmode in
2239fe995a9Smrg    nosideeffect)
2249fe995a9Smrg      # after this tag, mechanisms are not by side-effect, so they'll
2259fe995a9Smrg      # only be used when explicitly requested
2269fe995a9Smrg      if test "x$enable_dependency_tracking" = xyes; then
2279fe995a9Smrg	continue
2289fe995a9Smrg      else
2299fe995a9Smrg	break
2309fe995a9Smrg      fi
2319fe995a9Smrg      ;;
2329fe995a9Smrg    none) break ;;
2339fe995a9Smrg    esac
2349fe995a9Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2359fe995a9Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2369fe995a9Smrg    # handle `-M -o', and we need to detect this.
2379fe995a9Smrg    if depmode=$depmode \
2389fe995a9Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
2399fe995a9Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2409fe995a9Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
2419fe995a9Smrg         >/dev/null 2>conftest.err &&
2429fe995a9Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2439fe995a9Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2449fe995a9Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
2459fe995a9Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2469fe995a9Smrg      # icc doesn't choke on unknown options, it will just issue warnings
2479fe995a9Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
2489fe995a9Smrg      # that says an option was ignored or not supported.
2499fe995a9Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2509fe995a9Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2519fe995a9Smrg      # The diagnosis changed in icc 8.0:
2529fe995a9Smrg      #   icc: Command line remark: option '-MP' not supported
2539fe995a9Smrg      if (grep 'ignoring option' conftest.err ||
2549fe995a9Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2559fe995a9Smrg        am_cv_$1_dependencies_compiler_type=$depmode
2569fe995a9Smrg        break
2579fe995a9Smrg      fi
2589fe995a9Smrg    fi
2599fe995a9Smrg  done
2609fe995a9Smrg
2619fe995a9Smrg  cd ..
2629fe995a9Smrg  rm -rf conftest.dir
2639fe995a9Smrgelse
2649fe995a9Smrg  am_cv_$1_dependencies_compiler_type=none
2659fe995a9Smrgfi
2669fe995a9Smrg])
2679fe995a9SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2689fe995a9SmrgAM_CONDITIONAL([am__fastdep$1], [
2699fe995a9Smrg  test "x$enable_dependency_tracking" != xno \
2709fe995a9Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2719fe995a9Smrg])
2729fe995a9Smrg
2739fe995a9Smrg
2749fe995a9Smrg# AM_SET_DEPDIR
2759fe995a9Smrg# -------------
2769fe995a9Smrg# Choose a directory name for dependency files.
2779fe995a9Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
2789fe995a9SmrgAC_DEFUN([AM_SET_DEPDIR],
2799fe995a9Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2809fe995a9SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2819fe995a9Smrg])
2829fe995a9Smrg
2839fe995a9Smrg
2849fe995a9Smrg# AM_DEP_TRACK
2859fe995a9Smrg# ------------
2869fe995a9SmrgAC_DEFUN([AM_DEP_TRACK],
2879fe995a9Smrg[AC_ARG_ENABLE(dependency-tracking,
2889fe995a9Smrg[  --disable-dependency-tracking  speeds up one-time build
2899fe995a9Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
2909fe995a9Smrgif test "x$enable_dependency_tracking" != xno; then
2919fe995a9Smrg  am_depcomp="$ac_aux_dir/depcomp"
2929fe995a9Smrg  AMDEPBACKSLASH='\'
2939fe995a9Smrgfi
2949fe995a9SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2959fe995a9SmrgAC_SUBST([AMDEPBACKSLASH])dnl
2969fe995a9Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
2979fe995a9Smrg])
2989fe995a9Smrg
2999fe995a9Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3009fe995a9Smrg
3019fe995a9Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
3029fe995a9Smrg# Free Software Foundation, Inc.
3039fe995a9Smrg#
3049fe995a9Smrg# This file is free software; the Free Software Foundation
3059fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
3069fe995a9Smrg# with or without modifications, as long as this notice is preserved.
3079fe995a9Smrg
3089fe995a9Smrg#serial 3
3099fe995a9Smrg
3109fe995a9Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3119fe995a9Smrg# ------------------------------
3129fe995a9SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3139fe995a9Smrg[for mf in $CONFIG_FILES; do
3149fe995a9Smrg  # Strip MF so we end up with the name of the file.
3159fe995a9Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
3169fe995a9Smrg  # Check whether this is an Automake generated Makefile or not.
3179fe995a9Smrg  # We used to match only the files named `Makefile.in', but
3189fe995a9Smrg  # some people rename them; so instead we look at the file content.
3199fe995a9Smrg  # Grep'ing the first line is not enough: some people post-process
3209fe995a9Smrg  # each Makefile.in and add a new line on top of each file to say so.
3219fe995a9Smrg  # Grep'ing the whole file is not good either: AIX grep has a line
3229fe995a9Smrg  # limit of 2048, but all sed's we know have understand at least 4000.
3239fe995a9Smrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
3249fe995a9Smrg    dirpart=`AS_DIRNAME("$mf")`
3259fe995a9Smrg  else
3269fe995a9Smrg    continue
3279fe995a9Smrg  fi
3289fe995a9Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
3299fe995a9Smrg  # from the Makefile without running `make'.
3309fe995a9Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3319fe995a9Smrg  test -z "$DEPDIR" && continue
3329fe995a9Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
3339fe995a9Smrg  test -z "am__include" && continue
3349fe995a9Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3359fe995a9Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
3369fe995a9Smrg  U=`sed -n 's/^U = //p' < "$mf"`
3379fe995a9Smrg  # Find all dependency output files, they are included files with
3389fe995a9Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
3399fe995a9Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
3409fe995a9Smrg  # expansion.
3419fe995a9Smrg  for file in `sed -n "
3429fe995a9Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3439fe995a9Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3449fe995a9Smrg    # Make sure the directory exists.
3459fe995a9Smrg    test -f "$dirpart/$file" && continue
3469fe995a9Smrg    fdir=`AS_DIRNAME(["$file"])`
3479fe995a9Smrg    AS_MKDIR_P([$dirpart/$fdir])
3489fe995a9Smrg    # echo "creating $dirpart/$file"
3499fe995a9Smrg    echo '# dummy' > "$dirpart/$file"
3509fe995a9Smrg  done
3519fe995a9Smrgdone
3529fe995a9Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3539fe995a9Smrg
3549fe995a9Smrg
3559fe995a9Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3569fe995a9Smrg# -----------------------------
3579fe995a9Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
3589fe995a9Smrg#
3599fe995a9Smrg# This code is only required when automatic dependency tracking
3609fe995a9Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
3619fe995a9Smrg# need in order to bootstrap the dependency handling code.
3629fe995a9SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
3639fe995a9Smrg[AC_CONFIG_COMMANDS([depfiles],
3649fe995a9Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
3659fe995a9Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
3669fe995a9Smrg])
3679fe995a9Smrg
3689fe995a9Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
3699fe995a9Smrg# Free Software Foundation, Inc.
3709fe995a9Smrg#
3719fe995a9Smrg# This file is free software; the Free Software Foundation
3729fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
3739fe995a9Smrg# with or without modifications, as long as this notice is preserved.
3749fe995a9Smrg
3759fe995a9Smrg# serial 8
3769fe995a9Smrg
3779fe995a9Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
3789fe995a9SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
3799fe995a9Smrg
3809fe995a9Smrg# Do all the work for Automake.                             -*- Autoconf -*-
3819fe995a9Smrg
3829fe995a9Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3839fe995a9Smrg# 2005, 2006 Free Software Foundation, Inc.
3849fe995a9Smrg#
3859fe995a9Smrg# This file is free software; the Free Software Foundation
3869fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
3879fe995a9Smrg# with or without modifications, as long as this notice is preserved.
3889fe995a9Smrg
3899fe995a9Smrg# serial 12
3909fe995a9Smrg
3919fe995a9Smrg# This macro actually does too much.  Some checks are only needed if
3929fe995a9Smrg# your package does certain things.  But this isn't really a big deal.
3939fe995a9Smrg
3949fe995a9Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
3959fe995a9Smrg# AM_INIT_AUTOMAKE([OPTIONS])
3969fe995a9Smrg# -----------------------------------------------
3979fe995a9Smrg# The call with PACKAGE and VERSION arguments is the old style
3989fe995a9Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
3999fe995a9Smrg# and VERSION should now be passed to AC_INIT and removed from
4009fe995a9Smrg# the call to AM_INIT_AUTOMAKE.
4019fe995a9Smrg# We support both call styles for the transition.  After
4029fe995a9Smrg# the next Automake release, Autoconf can make the AC_INIT
4039fe995a9Smrg# arguments mandatory, and then we can depend on a new Autoconf
4049fe995a9Smrg# release and drop the old call support.
4059fe995a9SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4069fe995a9Smrg[AC_PREREQ([2.60])dnl
4079fe995a9Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4089fe995a9Smrgdnl the ones we care about.
4099fe995a9Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4109fe995a9SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4119fe995a9SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4129fe995a9Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4139fe995a9Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4149fe995a9Smrg  # is not polluted with repeated "-I."
4159fe995a9Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4169fe995a9Smrg  # test to see if srcdir already configured
4179fe995a9Smrg  if test -f $srcdir/config.status; then
4189fe995a9Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4199fe995a9Smrg  fi
4209fe995a9Smrgfi
4219fe995a9Smrg
4229fe995a9Smrg# test whether we have cygpath
4239fe995a9Smrgif test -z "$CYGPATH_W"; then
4249fe995a9Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4259fe995a9Smrg    CYGPATH_W='cygpath -w'
4269fe995a9Smrg  else
4279fe995a9Smrg    CYGPATH_W=echo
4289fe995a9Smrg  fi
4299fe995a9Smrgfi
4309fe995a9SmrgAC_SUBST([CYGPATH_W])
4319fe995a9Smrg
4329fe995a9Smrg# Define the identity of the package.
4339fe995a9Smrgdnl Distinguish between old-style and new-style calls.
4349fe995a9Smrgm4_ifval([$2],
4359fe995a9Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4369fe995a9Smrg AC_SUBST([PACKAGE], [$1])dnl
4379fe995a9Smrg AC_SUBST([VERSION], [$2])],
4389fe995a9Smrg[_AM_SET_OPTIONS([$1])dnl
4399fe995a9Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4409fe995a9Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4419fe995a9Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4429fe995a9Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4439fe995a9Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4449fe995a9Smrg
4459fe995a9Smrg_AM_IF_OPTION([no-define],,
4469fe995a9Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
4479fe995a9Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
4489fe995a9Smrg
4499fe995a9Smrg# Some tools Automake needs.
4509fe995a9SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4519fe995a9SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4529fe995a9SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
4539fe995a9SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
4549fe995a9SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
4559fe995a9SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
4569fe995a9SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4579fe995a9SmrgAM_PROG_INSTALL_SH
4589fe995a9SmrgAM_PROG_INSTALL_STRIP
4599fe995a9SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
4609fe995a9Smrg# We need awk for the "check" target.  The system "awk" is bad on
4619fe995a9Smrg# some platforms.
4629fe995a9SmrgAC_REQUIRE([AC_PROG_AWK])dnl
4639fe995a9SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
4649fe995a9SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
4659fe995a9Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4669fe995a9Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4679fe995a9Smrg	      		     [_AM_PROG_TAR([v7])])])
4689fe995a9Smrg_AM_IF_OPTION([no-dependencies],,
4699fe995a9Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
4709fe995a9Smrg                  [_AM_DEPENDENCIES(CC)],
4719fe995a9Smrg                  [define([AC_PROG_CC],
4729fe995a9Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
4739fe995a9SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
4749fe995a9Smrg                  [_AM_DEPENDENCIES(CXX)],
4759fe995a9Smrg                  [define([AC_PROG_CXX],
4769fe995a9Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
4779fe995a9SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
4789fe995a9Smrg                  [_AM_DEPENDENCIES(OBJC)],
4799fe995a9Smrg                  [define([AC_PROG_OBJC],
4809fe995a9Smrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
4819fe995a9Smrg])
4829fe995a9Smrg])
4839fe995a9Smrg
4849fe995a9Smrg
4859fe995a9Smrg# When config.status generates a header, we must update the stamp-h file.
4869fe995a9Smrg# This file resides in the same directory as the config header
4879fe995a9Smrg# that is generated.  The stamp files are numbered to have different names.
4889fe995a9Smrg
4899fe995a9Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
4909fe995a9Smrg# loop where config.status creates the headers, so we can generate
4919fe995a9Smrg# our stamp files there.
4929fe995a9SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
4939fe995a9Smrg[# Compute $1's index in $config_headers.
4949fe995a9Smrg_am_stamp_count=1
4959fe995a9Smrgfor _am_header in $config_headers :; do
4969fe995a9Smrg  case $_am_header in
4979fe995a9Smrg    $1 | $1:* )
4989fe995a9Smrg      break ;;
4999fe995a9Smrg    * )
5009fe995a9Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5019fe995a9Smrg  esac
5029fe995a9Smrgdone
5039fe995a9Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
5049fe995a9Smrg
5059fe995a9Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
5069fe995a9Smrg#
5079fe995a9Smrg# This file is free software; the Free Software Foundation
5089fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
5099fe995a9Smrg# with or without modifications, as long as this notice is preserved.
5109fe995a9Smrg
5119fe995a9Smrg# AM_PROG_INSTALL_SH
5129fe995a9Smrg# ------------------
5139fe995a9Smrg# Define $install_sh.
5149fe995a9SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5159fe995a9Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5169fe995a9Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
5179fe995a9SmrgAC_SUBST(install_sh)])
5189fe995a9Smrg
5199fe995a9Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
5209fe995a9Smrg#
5219fe995a9Smrg# This file is free software; the Free Software Foundation
5229fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
5239fe995a9Smrg# with or without modifications, as long as this notice is preserved.
5249fe995a9Smrg
5259fe995a9Smrg# serial 2
5269fe995a9Smrg
5279fe995a9Smrg# Check whether the underlying file-system supports filenames
5289fe995a9Smrg# with a leading dot.  For instance MS-DOS doesn't.
5299fe995a9SmrgAC_DEFUN([AM_SET_LEADING_DOT],
5309fe995a9Smrg[rm -rf .tst 2>/dev/null
5319fe995a9Smrgmkdir .tst 2>/dev/null
5329fe995a9Smrgif test -d .tst; then
5339fe995a9Smrg  am__leading_dot=.
5349fe995a9Smrgelse
5359fe995a9Smrg  am__leading_dot=_
5369fe995a9Smrgfi
5379fe995a9Smrgrmdir .tst 2>/dev/null
5389fe995a9SmrgAC_SUBST([am__leading_dot])])
5399fe995a9Smrg
5409fe995a9Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
5419fe995a9Smrg# From Jim Meyering
5429fe995a9Smrg
5439fe995a9Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
5449fe995a9Smrg# Free Software Foundation, Inc.
5459fe995a9Smrg#
5469fe995a9Smrg# This file is free software; the Free Software Foundation
5479fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
5489fe995a9Smrg# with or without modifications, as long as this notice is preserved.
5499fe995a9Smrg
5509fe995a9Smrg# serial 4
5519fe995a9Smrg
5529fe995a9SmrgAC_DEFUN([AM_MAINTAINER_MODE],
5539fe995a9Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
5549fe995a9Smrg  dnl maintainer-mode is disabled by default
5559fe995a9Smrg  AC_ARG_ENABLE(maintainer-mode,
5569fe995a9Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
5579fe995a9Smrg			  (and sometimes confusing) to the casual installer],
5589fe995a9Smrg      USE_MAINTAINER_MODE=$enableval,
5599fe995a9Smrg      USE_MAINTAINER_MODE=no)
5609fe995a9Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
5619fe995a9Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
5629fe995a9Smrg  MAINT=$MAINTAINER_MODE_TRUE
5639fe995a9Smrg  AC_SUBST(MAINT)dnl
5649fe995a9Smrg]
5659fe995a9Smrg)
5669fe995a9Smrg
5679fe995a9SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
5689fe995a9Smrg
5699fe995a9Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
5709fe995a9Smrg
5719fe995a9Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
5729fe995a9Smrg#
5739fe995a9Smrg# This file is free software; the Free Software Foundation
5749fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
5759fe995a9Smrg# with or without modifications, as long as this notice is preserved.
5769fe995a9Smrg
5779fe995a9Smrg# serial 3
5789fe995a9Smrg
5799fe995a9Smrg# AM_MAKE_INCLUDE()
5809fe995a9Smrg# -----------------
5819fe995a9Smrg# Check to see how make treats includes.
5829fe995a9SmrgAC_DEFUN([AM_MAKE_INCLUDE],
5839fe995a9Smrg[am_make=${MAKE-make}
5849fe995a9Smrgcat > confinc << 'END'
5859fe995a9Smrgam__doit:
5869fe995a9Smrg	@echo done
5879fe995a9Smrg.PHONY: am__doit
5889fe995a9SmrgEND
5899fe995a9Smrg# If we don't find an include directive, just comment out the code.
5909fe995a9SmrgAC_MSG_CHECKING([for style of include used by $am_make])
5919fe995a9Smrgam__include="#"
5929fe995a9Smrgam__quote=
5939fe995a9Smrg_am_result=none
5949fe995a9Smrg# First try GNU make style include.
5959fe995a9Smrgecho "include confinc" > confmf
5969fe995a9Smrg# We grep out `Entering directory' and `Leaving directory'
5979fe995a9Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
5989fe995a9Smrg# In particular we don't look at `^make:' because GNU make might
5999fe995a9Smrg# be invoked under some other name (usually "gmake"), in which
6009fe995a9Smrg# case it prints its new name instead of `make'.
6019fe995a9Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
6029fe995a9Smrg   am__include=include
6039fe995a9Smrg   am__quote=
6049fe995a9Smrg   _am_result=GNU
6059fe995a9Smrgfi
6069fe995a9Smrg# Now try BSD make style include.
6079fe995a9Smrgif test "$am__include" = "#"; then
6089fe995a9Smrg   echo '.include "confinc"' > confmf
6099fe995a9Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
6109fe995a9Smrg      am__include=.include
6119fe995a9Smrg      am__quote="\""
6129fe995a9Smrg      _am_result=BSD
6139fe995a9Smrg   fi
6149fe995a9Smrgfi
6159fe995a9SmrgAC_SUBST([am__include])
6169fe995a9SmrgAC_SUBST([am__quote])
6179fe995a9SmrgAC_MSG_RESULT([$_am_result])
6189fe995a9Smrgrm -f confinc confmf
6199fe995a9Smrg])
6209fe995a9Smrg
6219fe995a9Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6229fe995a9Smrg
6239fe995a9Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
6249fe995a9Smrg# Free Software Foundation, Inc.
6259fe995a9Smrg#
6269fe995a9Smrg# This file is free software; the Free Software Foundation
6279fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
6289fe995a9Smrg# with or without modifications, as long as this notice is preserved.
6299fe995a9Smrg
6309fe995a9Smrg# serial 5
6319fe995a9Smrg
6329fe995a9Smrg# AM_MISSING_PROG(NAME, PROGRAM)
6339fe995a9Smrg# ------------------------------
6349fe995a9SmrgAC_DEFUN([AM_MISSING_PROG],
6359fe995a9Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
6369fe995a9Smrg$1=${$1-"${am_missing_run}$2"}
6379fe995a9SmrgAC_SUBST($1)])
6389fe995a9Smrg
6399fe995a9Smrg
6409fe995a9Smrg# AM_MISSING_HAS_RUN
6419fe995a9Smrg# ------------------
6429fe995a9Smrg# Define MISSING if not defined so far and test if it supports --run.
6439fe995a9Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
6449fe995a9SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
6459fe995a9Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6469fe995a9SmrgAC_REQUIRE_AUX_FILE([missing])dnl
6479fe995a9Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
6489fe995a9Smrg# Use eval to expand $SHELL
6499fe995a9Smrgif eval "$MISSING --run true"; then
6509fe995a9Smrg  am_missing_run="$MISSING --run "
6519fe995a9Smrgelse
6529fe995a9Smrg  am_missing_run=
6539fe995a9Smrg  AC_MSG_WARN([`missing' script is too old or missing])
6549fe995a9Smrgfi
6559fe995a9Smrg])
6569fe995a9Smrg
6579fe995a9Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
6589fe995a9Smrg#
6599fe995a9Smrg# This file is free software; the Free Software Foundation
6609fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
6619fe995a9Smrg# with or without modifications, as long as this notice is preserved.
6629fe995a9Smrg
6639fe995a9Smrg# AM_PROG_MKDIR_P
6649fe995a9Smrg# ---------------
6659fe995a9Smrg# Check for `mkdir -p'.
6669fe995a9SmrgAC_DEFUN([AM_PROG_MKDIR_P],
6679fe995a9Smrg[AC_PREREQ([2.60])dnl
6689fe995a9SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
6699fe995a9Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
6709fe995a9Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
6719fe995a9Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
6729fe995a9Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
6739fe995a9Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
6749fe995a9Smrgdnl adjustment using top_builddir (which is defined more often than
6759fe995a9Smrgdnl MKDIR_P).
6769fe995a9SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
6779fe995a9Smrgcase $mkdir_p in
6789fe995a9Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
6799fe995a9Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
6809fe995a9Smrgesac
6819fe995a9Smrg])
6829fe995a9Smrg
6839fe995a9Smrg# Helper functions for option handling.                     -*- Autoconf -*-
6849fe995a9Smrg
6859fe995a9Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
6869fe995a9Smrg#
6879fe995a9Smrg# This file is free software; the Free Software Foundation
6889fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
6899fe995a9Smrg# with or without modifications, as long as this notice is preserved.
6909fe995a9Smrg
6919fe995a9Smrg# serial 3
6929fe995a9Smrg
6939fe995a9Smrg# _AM_MANGLE_OPTION(NAME)
6949fe995a9Smrg# -----------------------
6959fe995a9SmrgAC_DEFUN([_AM_MANGLE_OPTION],
6969fe995a9Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
6979fe995a9Smrg
6989fe995a9Smrg# _AM_SET_OPTION(NAME)
6999fe995a9Smrg# ------------------------------
7009fe995a9Smrg# Set option NAME.  Presently that only means defining a flag for this option.
7019fe995a9SmrgAC_DEFUN([_AM_SET_OPTION],
7029fe995a9Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7039fe995a9Smrg
7049fe995a9Smrg# _AM_SET_OPTIONS(OPTIONS)
7059fe995a9Smrg# ----------------------------------
7069fe995a9Smrg# OPTIONS is a space-separated list of Automake options.
7079fe995a9SmrgAC_DEFUN([_AM_SET_OPTIONS],
7089fe995a9Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7099fe995a9Smrg
7109fe995a9Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7119fe995a9Smrg# -------------------------------------------
7129fe995a9Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7139fe995a9SmrgAC_DEFUN([_AM_IF_OPTION],
7149fe995a9Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7159fe995a9Smrg
7169fe995a9Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7179fe995a9Smrg
7189fe995a9Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
7199fe995a9Smrg# Free Software Foundation, Inc.
7209fe995a9Smrg#
7219fe995a9Smrg# This file is free software; the Free Software Foundation
7229fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
7239fe995a9Smrg# with or without modifications, as long as this notice is preserved.
7249fe995a9Smrg
7259fe995a9Smrg# serial 4
7269fe995a9Smrg
7279fe995a9Smrg# AM_SANITY_CHECK
7289fe995a9Smrg# ---------------
7299fe995a9SmrgAC_DEFUN([AM_SANITY_CHECK],
7309fe995a9Smrg[AC_MSG_CHECKING([whether build environment is sane])
7319fe995a9Smrg# Just in case
7329fe995a9Smrgsleep 1
7339fe995a9Smrgecho timestamp > conftest.file
7349fe995a9Smrg# Do `set' in a subshell so we don't clobber the current shell's
7359fe995a9Smrg# arguments.  Must try -L first in case configure is actually a
7369fe995a9Smrg# symlink; some systems play weird games with the mod time of symlinks
7379fe995a9Smrg# (eg FreeBSD returns the mod time of the symlink's containing
7389fe995a9Smrg# directory).
7399fe995a9Smrgif (
7409fe995a9Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
7419fe995a9Smrg   if test "$[*]" = "X"; then
7429fe995a9Smrg      # -L didn't work.
7439fe995a9Smrg      set X `ls -t $srcdir/configure conftest.file`
7449fe995a9Smrg   fi
7459fe995a9Smrg   rm -f conftest.file
7469fe995a9Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
7479fe995a9Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
7489fe995a9Smrg
7499fe995a9Smrg      # If neither matched, then we have a broken ls.  This can happen
7509fe995a9Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
7519fe995a9Smrg      # broken ls alias from the environment.  This has actually
7529fe995a9Smrg      # happened.  Such a system could not be considered "sane".
7539fe995a9Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
7549fe995a9Smrgalias in your environment])
7559fe995a9Smrg   fi
7569fe995a9Smrg
7579fe995a9Smrg   test "$[2]" = conftest.file
7589fe995a9Smrg   )
7599fe995a9Smrgthen
7609fe995a9Smrg   # Ok.
7619fe995a9Smrg   :
7629fe995a9Smrgelse
7639fe995a9Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
7649fe995a9SmrgCheck your system clock])
7659fe995a9Smrgfi
7669fe995a9SmrgAC_MSG_RESULT(yes)])
7679fe995a9Smrg
7689fe995a9Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7699fe995a9Smrg#
7709fe995a9Smrg# This file is free software; the Free Software Foundation
7719fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
7729fe995a9Smrg# with or without modifications, as long as this notice is preserved.
7739fe995a9Smrg
7749fe995a9Smrg# AM_PROG_INSTALL_STRIP
7759fe995a9Smrg# ---------------------
7769fe995a9Smrg# One issue with vendor `install' (even GNU) is that you can't
7779fe995a9Smrg# specify the program used to strip binaries.  This is especially
7789fe995a9Smrg# annoying in cross-compiling environments, where the build's strip
7799fe995a9Smrg# is unlikely to handle the host's binaries.
7809fe995a9Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
7819fe995a9Smrg# always use install-sh in `make install-strip', and initialize
7829fe995a9Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
7839fe995a9SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
7849fe995a9Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
7859fe995a9Smrg# Installed binaries are usually stripped using `strip' when the user
7869fe995a9Smrg# run `make install-strip'.  However `strip' might not be the right
7879fe995a9Smrg# tool to use in cross-compilation environments, therefore Automake
7889fe995a9Smrg# will honor the `STRIP' environment variable to overrule this program.
7899fe995a9Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
7909fe995a9Smrgif test "$cross_compiling" != no; then
7919fe995a9Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
7929fe995a9Smrgfi
7939fe995a9SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
7949fe995a9SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
7959fe995a9Smrg
7969fe995a9Smrg# Copyright (C) 2006  Free Software Foundation, Inc.
7979fe995a9Smrg#
7989fe995a9Smrg# This file is free software; the Free Software Foundation
7999fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
8009fe995a9Smrg# with or without modifications, as long as this notice is preserved.
8019fe995a9Smrg
8029fe995a9Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
8039fe995a9Smrg# ---------------------------
8049fe995a9Smrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
8059fe995a9Smrg# This macro is traced by Automake.
8069fe995a9SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
8079fe995a9Smrg
8089fe995a9Smrg# Check how to create a tarball.                            -*- Autoconf -*-
8099fe995a9Smrg
8109fe995a9Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
8119fe995a9Smrg#
8129fe995a9Smrg# This file is free software; the Free Software Foundation
8139fe995a9Smrg# gives unlimited permission to copy and/or distribute it,
8149fe995a9Smrg# with or without modifications, as long as this notice is preserved.
8159fe995a9Smrg
8169fe995a9Smrg# serial 2
8179fe995a9Smrg
8189fe995a9Smrg# _AM_PROG_TAR(FORMAT)
8199fe995a9Smrg# --------------------
8209fe995a9Smrg# Check how to create a tarball in format FORMAT.
8219fe995a9Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
8229fe995a9Smrg#
8239fe995a9Smrg# Substitute a variable $(am__tar) that is a command
8249fe995a9Smrg# writing to stdout a FORMAT-tarball containing the directory
8259fe995a9Smrg# $tardir.
8269fe995a9Smrg#     tardir=directory && $(am__tar) > result.tar
8279fe995a9Smrg#
8289fe995a9Smrg# Substitute a variable $(am__untar) that extract such
8299fe995a9Smrg# a tarball read from stdin.
8309fe995a9Smrg#     $(am__untar) < result.tar
8319fe995a9SmrgAC_DEFUN([_AM_PROG_TAR],
8329fe995a9Smrg[# Always define AMTAR for backward compatibility.
8339fe995a9SmrgAM_MISSING_PROG([AMTAR], [tar])
8349fe995a9Smrgm4_if([$1], [v7],
8359fe995a9Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
8369fe995a9Smrg     [m4_case([$1], [ustar],, [pax],,
8379fe995a9Smrg              [m4_fatal([Unknown tar format])])
8389fe995a9SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
8399fe995a9Smrg# Loop over all known methods to create a tar archive until one works.
8409fe995a9Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
8419fe995a9Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
8429fe995a9Smrg# Do not fold the above two line into one, because Tru64 sh and
8439fe995a9Smrg# Solaris sh will not grok spaces in the rhs of `-'.
8449fe995a9Smrgfor _am_tool in $_am_tools
8459fe995a9Smrgdo
8469fe995a9Smrg  case $_am_tool in
8479fe995a9Smrg  gnutar)
8489fe995a9Smrg    for _am_tar in tar gnutar gtar;
8499fe995a9Smrg    do
8509fe995a9Smrg      AM_RUN_LOG([$_am_tar --version]) && break
8519fe995a9Smrg    done
8529fe995a9Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
8539fe995a9Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
8549fe995a9Smrg    am__untar="$_am_tar -xf -"
8559fe995a9Smrg    ;;
8569fe995a9Smrg  plaintar)
8579fe995a9Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
8589fe995a9Smrg    # ustar tarball either.
8599fe995a9Smrg    (tar --version) >/dev/null 2>&1 && continue
8609fe995a9Smrg    am__tar='tar chf - "$$tardir"'
8619fe995a9Smrg    am__tar_='tar chf - "$tardir"'
8629fe995a9Smrg    am__untar='tar xf -'
8639fe995a9Smrg    ;;
8649fe995a9Smrg  pax)
8659fe995a9Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
8669fe995a9Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
8679fe995a9Smrg    am__untar='pax -r'
8689fe995a9Smrg    ;;
8699fe995a9Smrg  cpio)
8709fe995a9Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
8719fe995a9Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
8729fe995a9Smrg    am__untar='cpio -i -H $1 -d'
8739fe995a9Smrg    ;;
8749fe995a9Smrg  none)
8759fe995a9Smrg    am__tar=false
8769fe995a9Smrg    am__tar_=false
8779fe995a9Smrg    am__untar=false
8789fe995a9Smrg    ;;
8799fe995a9Smrg  esac
8809fe995a9Smrg
8819fe995a9Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
8829fe995a9Smrg  # and am__untar set.
8839fe995a9Smrg  test -n "${am_cv_prog_tar_$1}" && break
8849fe995a9Smrg
8859fe995a9Smrg  # tar/untar a dummy directory, and stop if the command works
8869fe995a9Smrg  rm -rf conftest.dir
8879fe995a9Smrg  mkdir conftest.dir
8889fe995a9Smrg  echo GrepMe > conftest.dir/file
8899fe995a9Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
8909fe995a9Smrg  rm -rf conftest.dir
8919fe995a9Smrg  if test -s conftest.tar; then
8929fe995a9Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
8939fe995a9Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
8949fe995a9Smrg  fi
8959fe995a9Smrgdone
8969fe995a9Smrgrm -rf conftest.dir
8979fe995a9Smrg
8989fe995a9SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
8999fe995a9SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
9009fe995a9SmrgAC_SUBST([am__tar])
9019fe995a9SmrgAC_SUBST([am__untar])
9029fe995a9Smrg]) # _AM_PROG_TAR
9039fe995a9Smrg
9049fe995a9Smrgdnl
9059fe995a9Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
9069fe995a9Smrgdnl 
9079fe995a9Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9089fe995a9Smrgdnl copy of this software and associated documentation files (the
9099fe995a9Smrgdnl "Software"), to deal in the Software without restriction, including
9109fe995a9Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
9119fe995a9Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
9129fe995a9Smrgdnl to whom the Software is furnished to do so, provided that the above
9139fe995a9Smrgdnl copyright notice(s) and this permission notice appear in all copies of
9149fe995a9Smrgdnl the Software and that both the above copyright notice(s) and this
9159fe995a9Smrgdnl permission notice appear in supporting documentation.
9169fe995a9Smrgdnl
9179fe995a9Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9189fe995a9Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9199fe995a9Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
9209fe995a9Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
9219fe995a9Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
9229fe995a9Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
9239fe995a9Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
9249fe995a9Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
9259fe995a9Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9269fe995a9Smrgdnl
9279fe995a9Smrgdnl Except as contained in this notice, the name of a copyright holder
9289fe995a9Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
9299fe995a9Smrgdnl or other dealings in this Software without prior written authorization
9309fe995a9Smrgdnl of the copyright holder.
9319fe995a9Smrg
9329fe995a9Smrg# XORG_MACROS_VERSION(required-version)
9339fe995a9Smrg# -------------------------------------
9349fe995a9Smrg# Minimum version: 1.1.0
9359fe995a9Smrg#
9369fe995a9Smrg# If you're using a macro added in Version 1.1 or newer, include this in
9379fe995a9Smrg# your configure.ac with the minimum required version, such as:
9389fe995a9Smrg# XORG_MACROS_VERSION(1.1)
9399fe995a9Smrg#
9409fe995a9Smrg# To force at least a version with this macro defined, also add:
9419fe995a9Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9429fe995a9Smrg#
9439fe995a9Smrg#
9449fe995a9Smrg# See the "minimum version" comment for each macro you use to see what 
9459fe995a9Smrg# version you require.
9469fe995a9SmrgAC_DEFUN([XORG_MACROS_VERSION],[
9479fe995a9Smrg	[XORG_MACROS_needed_version=$1
9489fe995a9Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
9499fe995a9Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
9509fe995a9Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
9519fe995a9Smrg	[XORG_MACROS_version=1.1.5
9529fe995a9Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
9539fe995a9Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
9549fe995a9Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
9559fe995a9Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
9569fe995a9Smrg	fi
9579fe995a9Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
9589fe995a9Smrg		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])
9599fe995a9Smrg	fi
9609fe995a9Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
9619fe995a9Smrg]) # XORG_MACROS_VERSION
9629fe995a9Smrg
9639fe995a9Smrg# XORG_PROG_RAWCPP()
9649fe995a9Smrg# ------------------
9659fe995a9Smrg# Minimum version: 1.0.0
9669fe995a9Smrg#
9679fe995a9Smrg# Find cpp program and necessary flags for use in pre-processing text files
9689fe995a9Smrg# such as man pages and config files
9699fe995a9SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9709fe995a9SmrgAC_REQUIRE([AC_PROG_CPP])
9719fe995a9SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9729fe995a9Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9739fe995a9Smrg
9749fe995a9Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9759fe995a9Smrg# which is not the best choice for supporting other OS'es, but covers most
9769fe995a9Smrg# of the ones we need for now.
9779fe995a9SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9789fe995a9SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
9799fe995a9Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9809fe995a9Smrg	AC_MSG_RESULT([no])
9819fe995a9Smrgelse
9829fe995a9Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9839fe995a9Smrg		RAWCPPFLAGS=-undef
9849fe995a9Smrg		AC_MSG_RESULT([yes])
9859fe995a9Smrg	else
9869fe995a9Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9879fe995a9Smrg	fi
9889fe995a9Smrgfi
9899fe995a9Smrgrm -f conftest.$ac_ext
9909fe995a9Smrg
9919fe995a9SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9929fe995a9SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
9939fe995a9Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9949fe995a9Smrg	AC_MSG_RESULT([no])
9959fe995a9Smrgelse
9969fe995a9Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9979fe995a9Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9989fe995a9Smrg		AC_MSG_RESULT([yes])
9999fe995a9Smrg	else
10009fe995a9Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
10019fe995a9Smrg	fi
10029fe995a9Smrgfi
10039fe995a9Smrgrm -f conftest.$ac_ext
10049fe995a9SmrgAC_SUBST(RAWCPPFLAGS)
10059fe995a9Smrg]) # XORG_PROG_RAWCPP
10069fe995a9Smrg
10079fe995a9Smrg# XORG_MANPAGE_SECTIONS()
10089fe995a9Smrg# -----------------------
10099fe995a9Smrg# Minimum version: 1.0.0
10109fe995a9Smrg#
10119fe995a9Smrg# Determine which sections man pages go in for the different man page types
10129fe995a9Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
10139fe995a9Smrg# Not sure if there's any better way than just hardcoding by OS name.
10149fe995a9Smrg# Override default settings by setting environment variables
10159fe995a9Smrg
10169fe995a9SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
10179fe995a9SmrgAC_REQUIRE([AC_CANONICAL_HOST])
10189fe995a9Smrg
10199fe995a9Smrgif test x$APP_MAN_SUFFIX = x    ; then
10209fe995a9Smrg    APP_MAN_SUFFIX=1
10219fe995a9Smrgfi
10229fe995a9Smrgif test x$APP_MAN_DIR = x    ; then
10239fe995a9Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
10249fe995a9Smrgfi
10259fe995a9Smrg
10269fe995a9Smrgif test x$LIB_MAN_SUFFIX = x    ; then
10279fe995a9Smrg    LIB_MAN_SUFFIX=3
10289fe995a9Smrgfi
10299fe995a9Smrgif test x$LIB_MAN_DIR = x    ; then
10309fe995a9Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
10319fe995a9Smrgfi
10329fe995a9Smrg
10339fe995a9Smrgif test x$FILE_MAN_SUFFIX = x    ; then
10349fe995a9Smrg    case $host_os in
10359fe995a9Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
10369fe995a9Smrg	*)		FILE_MAN_SUFFIX=5  ;;
10379fe995a9Smrg    esac
10389fe995a9Smrgfi
10399fe995a9Smrgif test x$FILE_MAN_DIR = x    ; then
10409fe995a9Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10419fe995a9Smrgfi
10429fe995a9Smrg
10439fe995a9Smrgif test x$MISC_MAN_SUFFIX = x    ; then
10449fe995a9Smrg    case $host_os in
10459fe995a9Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
10469fe995a9Smrg	*)		MISC_MAN_SUFFIX=7  ;;
10479fe995a9Smrg    esac
10489fe995a9Smrgfi
10499fe995a9Smrgif test x$MISC_MAN_DIR = x    ; then
10509fe995a9Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
10519fe995a9Smrgfi
10529fe995a9Smrg
10539fe995a9Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
10549fe995a9Smrg    case $host_os in
10559fe995a9Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
10569fe995a9Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
10579fe995a9Smrg    esac
10589fe995a9Smrgfi
10599fe995a9Smrgif test x$DRIVER_MAN_DIR = x    ; then
10609fe995a9Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
10619fe995a9Smrgfi
10629fe995a9Smrg
10639fe995a9Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
10649fe995a9Smrg    case $host_os in
10659fe995a9Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
10669fe995a9Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
10679fe995a9Smrg    esac
10689fe995a9Smrgfi
10699fe995a9Smrgif test x$ADMIN_MAN_DIR = x    ; then
10709fe995a9Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
10719fe995a9Smrgfi
10729fe995a9Smrg
10739fe995a9Smrg
10749fe995a9SmrgAC_SUBST([APP_MAN_SUFFIX])
10759fe995a9SmrgAC_SUBST([LIB_MAN_SUFFIX])
10769fe995a9SmrgAC_SUBST([FILE_MAN_SUFFIX])
10779fe995a9SmrgAC_SUBST([MISC_MAN_SUFFIX])
10789fe995a9SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
10799fe995a9SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
10809fe995a9SmrgAC_SUBST([APP_MAN_DIR])
10819fe995a9SmrgAC_SUBST([LIB_MAN_DIR])
10829fe995a9SmrgAC_SUBST([FILE_MAN_DIR])
10839fe995a9SmrgAC_SUBST([MISC_MAN_DIR])
10849fe995a9SmrgAC_SUBST([DRIVER_MAN_DIR])
10859fe995a9SmrgAC_SUBST([ADMIN_MAN_DIR])
10869fe995a9Smrg]) # XORG_MANPAGE_SECTIONS
10879fe995a9Smrg
10889fe995a9Smrg# XORG_CHECK_LINUXDOC
10899fe995a9Smrg# -------------------
10909fe995a9Smrg# Minimum version: 1.0.0
10919fe995a9Smrg#
10929fe995a9Smrg# Defines the variable MAKE_TEXT if the necessary tools and
10939fe995a9Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10949fe995a9Smrg# Whether or not the necessary tools and files are found can be checked
10959fe995a9Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10969fe995a9SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
10979fe995a9SmrgXORG_SGML_PATH=$prefix/share/sgml
10989fe995a9SmrgHAVE_DEFS_ENT=
10999fe995a9Smrg
11009fe995a9SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
11019fe995a9Smrg
11029fe995a9SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
11039fe995a9SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
11049fe995a9Smrg
11059fe995a9SmrgAC_MSG_CHECKING([Whether to build documentation])
11069fe995a9Smrg
11079fe995a9Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
11089fe995a9Smrg   BUILDDOC=yes
11099fe995a9Smrgelse
11109fe995a9Smrg   BUILDDOC=no
11119fe995a9Smrgfi
11129fe995a9Smrg
11139fe995a9SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
11149fe995a9Smrg
11159fe995a9SmrgAC_MSG_RESULT([$BUILDDOC])
11169fe995a9Smrg
11179fe995a9SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
11189fe995a9Smrg
11199fe995a9Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
11209fe995a9Smrg   BUILDPDFDOC=yes
11219fe995a9Smrgelse
11229fe995a9Smrg   BUILDPDFDOC=no
11239fe995a9Smrgfi
11249fe995a9Smrg
11259fe995a9SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
11269fe995a9Smrg
11279fe995a9SmrgAC_MSG_RESULT([$BUILDPDFDOC])
11289fe995a9Smrg
11299fe995a9SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
11309fe995a9SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
11319fe995a9SmrgMAKE_PDF="$PS2PDF"
11329fe995a9SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
11339fe995a9Smrg
11349fe995a9SmrgAC_SUBST(MAKE_TEXT)
11359fe995a9SmrgAC_SUBST(MAKE_PS)
11369fe995a9SmrgAC_SUBST(MAKE_PDF)
11379fe995a9SmrgAC_SUBST(MAKE_HTML)
11389fe995a9Smrg]) # XORG_CHECK_LINUXDOC
11399fe995a9Smrg
11409fe995a9Smrg# XORG_CHECK_DOCBOOK
11419fe995a9Smrg# -------------------
11429fe995a9Smrg# Minimum version: 1.0.0
11439fe995a9Smrg#
11449fe995a9Smrg# Checks for the ability to build output formats from SGML DocBook source.
11459fe995a9Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
11469fe995a9Smrg# indicates whether the necessary tools and files are found and, if set,
11479fe995a9Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
11489fe995a9SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
11499fe995a9SmrgXORG_SGML_PATH=$prefix/share/sgml
11509fe995a9SmrgHAVE_DEFS_ENT=
11519fe995a9SmrgBUILDTXTDOC=no
11529fe995a9SmrgBUILDPDFDOC=no
11539fe995a9SmrgBUILDPSDOC=no
11549fe995a9SmrgBUILDHTMLDOC=no
11559fe995a9Smrg
11569fe995a9SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
11579fe995a9Smrg
11589fe995a9SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
11599fe995a9SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
11609fe995a9SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
11619fe995a9SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
11629fe995a9Smrg
11639fe995a9SmrgAC_MSG_CHECKING([Whether to build text documentation])
11649fe995a9Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
11659fe995a9Smrg   test x$BUILD_TXTDOC != xno; then
11669fe995a9Smrg	BUILDTXTDOC=yes
11679fe995a9Smrgfi
11689fe995a9SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
11699fe995a9SmrgAC_MSG_RESULT([$BUILDTXTDOC])
11709fe995a9Smrg
11719fe995a9SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
11729fe995a9Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
11739fe995a9Smrg   test x$BUILD_PDFDOC != xno; then
11749fe995a9Smrg	BUILDPDFDOC=yes
11759fe995a9Smrgfi
11769fe995a9SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
11779fe995a9SmrgAC_MSG_RESULT([$BUILDPDFDOC])
11789fe995a9Smrg
11799fe995a9SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
11809fe995a9Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
11819fe995a9Smrg   test x$BUILD_PSDOC != xno; then
11829fe995a9Smrg	BUILDPSDOC=yes
11839fe995a9Smrgfi
11849fe995a9SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
11859fe995a9SmrgAC_MSG_RESULT([$BUILDPSDOC])
11869fe995a9Smrg
11879fe995a9SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
11889fe995a9Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
11899fe995a9Smrg   test x$BUILD_HTMLDOC != xno; then
11909fe995a9Smrg	BUILDHTMLDOC=yes
11919fe995a9Smrgfi
11929fe995a9SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
11939fe995a9SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
11949fe995a9Smrg
11959fe995a9SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
11969fe995a9SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
11979fe995a9SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
11989fe995a9SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
11999fe995a9Smrg
12009fe995a9SmrgAC_SUBST(MAKE_TEXT)
12019fe995a9SmrgAC_SUBST(MAKE_PS)
12029fe995a9SmrgAC_SUBST(MAKE_PDF)
12039fe995a9SmrgAC_SUBST(MAKE_HTML)
12049fe995a9Smrg]) # XORG_CHECK_DOCBOOK
12059fe995a9Smrg
12069fe995a9Smrg# XORG_CHECK_MALLOC_ZERO
12079fe995a9Smrg# ----------------------
12089fe995a9Smrg# Minimum version: 1.0.0
12099fe995a9Smrg#
12109fe995a9Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
12119fe995a9Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
12129fe995a9Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
12139fe995a9SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
12149fe995a9SmrgAC_ARG_ENABLE(malloc0returnsnull,
12159fe995a9Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
12169fe995a9Smrg		       [malloc(0) returns NULL (default: auto)]),
12179fe995a9Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
12189fe995a9Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
12199fe995a9Smrg
12209fe995a9SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
12219fe995a9Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
12229fe995a9Smrg	AC_RUN_IFELSE([
12239fe995a9Smrgchar *malloc();
12249fe995a9Smrgchar *realloc();
12259fe995a9Smrgchar *calloc();
12269fe995a9Smrgmain() {
12279fe995a9Smrg    char *m0, *r0, *c0, *p;
12289fe995a9Smrg    m0 = malloc(0);
12299fe995a9Smrg    p = malloc(10);
12309fe995a9Smrg    r0 = realloc(p,0);
12319fe995a9Smrg    c0 = calloc(0);
12329fe995a9Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
12339fe995a9Smrg}],
12349fe995a9Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
12359fe995a9Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
12369fe995a9Smrgfi
12379fe995a9SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
12389fe995a9Smrg
12399fe995a9Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
12409fe995a9Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
12419fe995a9Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
12429fe995a9Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
12439fe995a9Smrgelse
12449fe995a9Smrg	MALLOC_ZERO_CFLAGS=""
12459fe995a9Smrg	XMALLOC_ZERO_CFLAGS=""
12469fe995a9Smrg	XTMALLOC_ZERO_CFLAGS=""
12479fe995a9Smrgfi
12489fe995a9Smrg
12499fe995a9SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
12509fe995a9SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
12519fe995a9SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
12529fe995a9Smrg]) # XORG_CHECK_MALLOC_ZERO
12539fe995a9Smrg
12549fe995a9Smrg# XORG_WITH_LINT()
12559fe995a9Smrg# ----------------
12569fe995a9Smrg# Minimum version: 1.1.0
12579fe995a9Smrg#
12589fe995a9Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
12599fe995a9Smrg# is specified.   (Use --with-lint=sparse for sparse.)
12609fe995a9Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
12619fe995a9Smrg# Sets $LINT_FLAGS to flags to pass to source checker
12629fe995a9Smrg# Sets LINT automake conditional if enabled (default: disabled)
12639fe995a9Smrg#
12649fe995a9SmrgAC_DEFUN([XORG_WITH_LINT],[
12659fe995a9Smrg
12669fe995a9Smrg# Allow checking code with lint, sparse, etc.
12679fe995a9SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
12689fe995a9Smrg		[Use a lint-style source code checker (default: disabled)])],
12699fe995a9Smrg		[use_lint=$withval], [use_lint=no])
12709fe995a9Smrgif test "x$use_lint" = "xyes" ; then
12719fe995a9Smrg	LINT="lint"
12729fe995a9Smrgelse
12739fe995a9Smrg	LINT="$use_lint"
12749fe995a9Smrgfi
12759fe995a9Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
12769fe995a9Smrg    case $LINT in
12779fe995a9Smrg	lint|*/lint)
12789fe995a9Smrg	    case $host_os in
12799fe995a9Smrg		solaris*)
12809fe995a9Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
12819fe995a9Smrg			;;
12829fe995a9Smrg	    esac
12839fe995a9Smrg	    ;;
12849fe995a9Smrg    esac
12859fe995a9Smrgfi
12869fe995a9Smrg
12879fe995a9SmrgAC_SUBST(LINT)
12889fe995a9SmrgAC_SUBST(LINT_FLAGS)
12899fe995a9SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
12909fe995a9Smrg
12919fe995a9Smrg]) # XORG_WITH_LINT
12929fe995a9Smrg
12939fe995a9Smrg# XORG_LINT_LIBRARY(LIBNAME)
12949fe995a9Smrg# --------------------------
12959fe995a9Smrg# Minimum version: 1.1.0
12969fe995a9Smrg#
12979fe995a9Smrg# Sets up flags for building lint libraries for checking programs that call
12989fe995a9Smrg# functions in the library.
12999fe995a9Smrg# Disabled by default, enable with --enable-lint-library
13009fe995a9Smrg# Sets: 
13019fe995a9Smrg#	@LINTLIB@		- name of lint library file to make
13029fe995a9Smrg#	MAKE_LINT_LIB		- automake conditional
13039fe995a9Smrg#
13049fe995a9Smrg
13059fe995a9SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
13069fe995a9SmrgAC_REQUIRE([XORG_WITH_LINT])
13079fe995a9Smrg# Build lint "library" for more indepth checks of programs calling this library
13089fe995a9SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
13099fe995a9Smrg	[Create lint library (default: disabled)])],
13109fe995a9Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
13119fe995a9Smrgif test "x$make_lint_lib" != "xno" ; then
13129fe995a9Smrg	if test "x$LINT" = "xno" ; then
13139fe995a9Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
13149fe995a9Smrg	fi
13159fe995a9Smrg	if test "x$make_lint_lib" = "xyes" ; then
13169fe995a9Smrg		LINTLIB=llib-l$1.ln
13179fe995a9Smrg	else
13189fe995a9Smrg		LINTLIB=$make_lint_lib
13199fe995a9Smrg	fi
13209fe995a9Smrgfi
13219fe995a9SmrgAC_SUBST(LINTLIB)
13229fe995a9SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
13239fe995a9Smrg
13249fe995a9Smrg]) # XORG_LINT_LIBRARY
13259fe995a9Smrg
13269fe995a9Smrgdnl Copyright 2005 Red Hat, Inc
13279fe995a9Smrgdnl
13289fe995a9Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
13299fe995a9Smrgdnl documentation for any purpose is hereby granted without fee, provided that
13309fe995a9Smrgdnl the above copyright notice appear in all copies and that both that
13319fe995a9Smrgdnl copyright notice and this permission notice appear in supporting
13329fe995a9Smrgdnl documentation.
13339fe995a9Smrgdnl
13349fe995a9Smrgdnl The above copyright notice and this permission notice shall be included
13359fe995a9Smrgdnl in all copies or substantial portions of the Software.
13369fe995a9Smrgdnl
13379fe995a9Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13389fe995a9Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13399fe995a9Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
13409fe995a9Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
13419fe995a9Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
13429fe995a9Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
13439fe995a9Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
13449fe995a9Smrgdnl
13459fe995a9Smrgdnl Except as contained in this notice, the name of the copyright holders shall
13469fe995a9Smrgdnl not be used in advertising or otherwise to promote the sale, use or
13479fe995a9Smrgdnl other dealings in this Software without prior written authorization
13489fe995a9Smrgdnl from the copyright holders.
13499fe995a9Smrgdnl
13509fe995a9Smrg
13519fe995a9Smrg# XORG_RELEASE_VERSION
13529fe995a9Smrg# --------------------
13539fe995a9Smrg# Adds --with/without-release-string and changes the PACKAGE and
13549fe995a9Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
13559fe995a9Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
13569fe995a9Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
13579fe995a9Smrg 
13589fe995a9SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
13599fe995a9Smrg	AC_ARG_WITH(release-version,
13609fe995a9Smrg			AC_HELP_STRING([--with-release-version=STRING],
13619fe995a9Smrg				[Use release version string in package name]),
13629fe995a9Smrg			[RELEASE_VERSION="$withval"],
13639fe995a9Smrg			[RELEASE_VERSION=""])
13649fe995a9Smrg	if test "x$RELEASE_VERSION" != "x"; then
13659fe995a9Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
13669fe995a9Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
13679fe995a9Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
13689fe995a9Smrg	fi
13699fe995a9Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
13709fe995a9Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
13719fe995a9Smrg		[Major version of this package])
13729fe995a9Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
13739fe995a9Smrg	if test "x$PVM" = "x"; then
13749fe995a9Smrg		PVM="0"
13759fe995a9Smrg	fi
13769fe995a9Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
13779fe995a9Smrg		[$PVM],
13789fe995a9Smrg		[Minor version of this package])
13799fe995a9Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
13809fe995a9Smrg	if test "x$PVP" = "x"; then
13819fe995a9Smrg		PVP="0"
13829fe995a9Smrg	fi
13839fe995a9Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
13849fe995a9Smrg		[$PVP],
13859fe995a9Smrg		[Patch version of this package])
13869fe995a9Smrg])
13879fe995a9Smrg
13889fe995a9Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
13899fe995a9Smrg# 
13909fe995a9Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
13919fe995a9Smrg#
13929fe995a9Smrg# This program is free software; you can redistribute it and/or modify
13939fe995a9Smrg# it under the terms of the GNU General Public License as published by
13949fe995a9Smrg# the Free Software Foundation; either version 2 of the License, or
13959fe995a9Smrg# (at your option) any later version.
13969fe995a9Smrg#
13979fe995a9Smrg# This program is distributed in the hope that it will be useful, but
13989fe995a9Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
13999fe995a9Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14009fe995a9Smrg# General Public License for more details.
14019fe995a9Smrg#
14029fe995a9Smrg# You should have received a copy of the GNU General Public License
14039fe995a9Smrg# along with this program; if not, write to the Free Software
14049fe995a9Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
14059fe995a9Smrg#
14069fe995a9Smrg# As a special exception to the GNU General Public License, if you
14079fe995a9Smrg# distribute this file as part of a program that contains a
14089fe995a9Smrg# configuration script generated by Autoconf, you may include it under
14099fe995a9Smrg# the same distribution terms that you use for the rest of that program.
14109fe995a9Smrg
14119fe995a9Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
14129fe995a9Smrg# ----------------------------------
14139fe995a9SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
14149fe995a9Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
14159fe995a9Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
14169fe995a9SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
14179fe995a9Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
14189fe995a9Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
14199fe995a9Smrgfi
14209fe995a9Smrgif test -n "$PKG_CONFIG"; then
14219fe995a9Smrg	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
14229fe995a9Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
14239fe995a9Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
14249fe995a9Smrg		AC_MSG_RESULT([yes])
14259fe995a9Smrg	else
14269fe995a9Smrg		AC_MSG_RESULT([no])
14279fe995a9Smrg		PKG_CONFIG=""
14289fe995a9Smrg	fi
14299fe995a9Smrg		
14309fe995a9Smrgfi[]dnl
14319fe995a9Smrg])# PKG_PROG_PKG_CONFIG
14329fe995a9Smrg
14339fe995a9Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
14349fe995a9Smrg#
14359fe995a9Smrg# Check to see whether a particular set of modules exists.  Similar
14369fe995a9Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
14379fe995a9Smrg#
14389fe995a9Smrg#
14399fe995a9Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
14409fe995a9Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
14419fe995a9Smrg# PKG_CHECK_EXISTS manually
14429fe995a9Smrg# --------------------------------------------------------------
14439fe995a9SmrgAC_DEFUN([PKG_CHECK_EXISTS],
14449fe995a9Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
14459fe995a9Smrgif test -n "$PKG_CONFIG" && \
14469fe995a9Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
14479fe995a9Smrg  m4_ifval([$2], [$2], [:])
14489fe995a9Smrgm4_ifvaln([$3], [else
14499fe995a9Smrg  $3])dnl
14509fe995a9Smrgfi])
14519fe995a9Smrg
14529fe995a9Smrg
14539fe995a9Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
14549fe995a9Smrg# ---------------------------------------------
14559fe995a9Smrgm4_define([_PKG_CONFIG],
14569fe995a9Smrg[if test -n "$PKG_CONFIG"; then
14579fe995a9Smrg        PKG_CHECK_EXISTS([$3],
14589fe995a9Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
14599fe995a9Smrg			 [pkg_failed=yes])
14609fe995a9Smrgelse
14619fe995a9Smrg	pkg_failed=untried
14629fe995a9Smrgfi[]dnl
14639fe995a9Smrg])# _PKG_CONFIG
14649fe995a9Smrg
14659fe995a9Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
14669fe995a9Smrg# [ACTION-IF-NOT-FOUND])
14679fe995a9Smrg#
14689fe995a9Smrg#
14699fe995a9Smrg# Note that if there is a possibility the first call to
14709fe995a9Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
14719fe995a9Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
14729fe995a9Smrg#
14739fe995a9Smrg#
14749fe995a9Smrg# --------------------------------------------------------------
14759fe995a9SmrgAC_DEFUN([PKG_CHECK_MODULES],
14769fe995a9Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
14779fe995a9SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
14789fe995a9SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
14799fe995a9Smrg
14809fe995a9Smrgpkg_failed=no
14819fe995a9SmrgAC_MSG_CHECKING([for $1])
14829fe995a9Smrg
14839fe995a9Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
14849fe995a9Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
14859fe995a9Smrg
14869fe995a9Smrgif test $pkg_failed = yes; then
14879fe995a9Smrg	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
14889fe995a9Smrg	# Put the nasty error message in config.log where it belongs
14899fe995a9Smrg	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
14909fe995a9Smrg
14919fe995a9Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
14929fe995a9Smrg[Package requirements ($2) were not met.
14939fe995a9SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
14949fe995a9Smrginstalled software in a non-standard prefix.
14959fe995a9Smrg
14969fe995a9SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
14979fe995a9Smrgto avoid the need to call pkg-config.  See the pkg-config man page for
14989fe995a9Smrgmore details.])],
14999fe995a9Smrg		[$4])
15009fe995a9Smrgelif test $pkg_failed = untried; then
15019fe995a9Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
15029fe995a9Smrg[The pkg-config script could not be found or is too old.  Make sure it
15039fe995a9Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
15049fe995a9Smrgpath to pkg-config.
15059fe995a9Smrg
15069fe995a9SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
15079fe995a9Smrgto avoid the need to call pkg-config.  See the pkg-config man page for
15089fe995a9Smrgmore details.
15099fe995a9Smrg
15109fe995a9SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
15119fe995a9Smrg		[$4])
15129fe995a9Smrgelse
15139fe995a9Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
15149fe995a9Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
15159fe995a9Smrg        AC_MSG_RESULT([yes])
15169fe995a9Smrg	ifelse([$3], , :, [$3])
15179fe995a9Smrgfi[]dnl
15189fe995a9Smrg])# PKG_CHECK_MODULES
15199fe995a9Smrg
1520