aclocal.m4 revision 72b4363a
172b4363aSmrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
272b4363aSmrg
372b4363aSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
472b4363aSmrg# 2005, 2006  Free Software Foundation, Inc.
572b4363aSmrg# This file is free software; the Free Software Foundation
672b4363aSmrg# gives unlimited permission to copy and/or distribute it,
772b4363aSmrg# with or without modifications, as long as this notice is preserved.
872b4363aSmrg
972b4363aSmrg# This program is distributed in the hope that it will be useful,
1072b4363aSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1172b4363aSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1272b4363aSmrg# PARTICULAR PURPOSE.
1372b4363aSmrg
1472b4363aSmrgm4_if(m4_PACKAGE_VERSION, [2.61],,
1572b4363aSmrg[m4_fatal([this file was generated for autoconf 2.61.
1672b4363aSmrgYou have another version of autoconf.  If you want to use that,
1772b4363aSmrgyou should regenerate the build system entirely.], [63])])
1872b4363aSmrg
1972b4363aSmrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
2072b4363aSmrg#
2172b4363aSmrg# This file is free software; the Free Software Foundation
2272b4363aSmrg# gives unlimited permission to copy and/or distribute it,
2372b4363aSmrg# with or without modifications, as long as this notice is preserved.
2472b4363aSmrg
2572b4363aSmrg# AM_AUTOMAKE_VERSION(VERSION)
2672b4363aSmrg# ----------------------------
2772b4363aSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
2872b4363aSmrg# generated from the m4 files accompanying Automake X.Y.
2972b4363aSmrg# (This private macro should not be called outside this file.)
3072b4363aSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3172b4363aSmrg[am__api_version='1.10'
3272b4363aSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3372b4363aSmrgdnl require some minimum version.  Point them to the right macro.
3472b4363aSmrgm4_if([$1], [1.10], [],
3572b4363aSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3672b4363aSmrg])
3772b4363aSmrg
3872b4363aSmrg# _AM_AUTOCONF_VERSION(VERSION)
3972b4363aSmrg# -----------------------------
4072b4363aSmrg# aclocal traces this macro to find the Autoconf version.
4172b4363aSmrg# This is a private macro too.  Using m4_define simplifies
4272b4363aSmrg# the logic in aclocal, which can simply ignore this definition.
4372b4363aSmrgm4_define([_AM_AUTOCONF_VERSION], [])
4472b4363aSmrg
4572b4363aSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
4672b4363aSmrg# -------------------------------
4772b4363aSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
4872b4363aSmrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
4972b4363aSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5072b4363aSmrg[AM_AUTOMAKE_VERSION([1.10])dnl
5172b4363aSmrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
5272b4363aSmrg
5372b4363aSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
5472b4363aSmrg
5572b4363aSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
5672b4363aSmrg#
5772b4363aSmrg# This file is free software; the Free Software Foundation
5872b4363aSmrg# gives unlimited permission to copy and/or distribute it,
5972b4363aSmrg# with or without modifications, as long as this notice is preserved.
6072b4363aSmrg
6172b4363aSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6272b4363aSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6372b4363aSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6472b4363aSmrg#
6572b4363aSmrg# Of course, Automake must honor this variable whenever it calls a
6672b4363aSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
6772b4363aSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
6872b4363aSmrg# depending on how configure is run.  This is pretty annoying, since
6972b4363aSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7072b4363aSmrg# source directory, any form will work fine, but in subdirectories a
7172b4363aSmrg# relative path needs to be adjusted first.
7272b4363aSmrg#
7372b4363aSmrg# $ac_aux_dir/missing
7472b4363aSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
7572b4363aSmrg# $top_srcdir/$ac_aux_dir/missing
7672b4363aSmrg#    fails if $ac_aux_dir is absolute,
7772b4363aSmrg#    fails when called from a subdirectory in a VPATH build with
7872b4363aSmrg#          a relative $ac_aux_dir
7972b4363aSmrg#
8072b4363aSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8172b4363aSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
8272b4363aSmrg# harmless because $srcdir is `.', but things will broke when you
8372b4363aSmrg# start a VPATH build or use an absolute $srcdir.
8472b4363aSmrg#
8572b4363aSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
8672b4363aSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
8772b4363aSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
8872b4363aSmrg# and then we would define $MISSING as
8972b4363aSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9072b4363aSmrg# This will work as long as MISSING is not called from configure, because
9172b4363aSmrg# unfortunately $(top_srcdir) has no meaning in configure.
9272b4363aSmrg# However there are other variables, like CC, which are often used in
9372b4363aSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9472b4363aSmrg#
9572b4363aSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
9672b4363aSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
9772b4363aSmrg# configured tree to be moved without reconfiguration.
9872b4363aSmrg
9972b4363aSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10072b4363aSmrg[dnl Rely on autoconf to set up CDPATH properly.
10172b4363aSmrgAC_PREREQ([2.50])dnl
10272b4363aSmrg# expand $ac_aux_dir to an absolute path
10372b4363aSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
10472b4363aSmrg])
10572b4363aSmrg
10672b4363aSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
10772b4363aSmrg
10872b4363aSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
10972b4363aSmrg# Free Software Foundation, Inc.
11072b4363aSmrg#
11172b4363aSmrg# This file is free software; the Free Software Foundation
11272b4363aSmrg# gives unlimited permission to copy and/or distribute it,
11372b4363aSmrg# with or without modifications, as long as this notice is preserved.
11472b4363aSmrg
11572b4363aSmrg# serial 8
11672b4363aSmrg
11772b4363aSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
11872b4363aSmrg# -------------------------------------
11972b4363aSmrg# Define a conditional.
12072b4363aSmrgAC_DEFUN([AM_CONDITIONAL],
12172b4363aSmrg[AC_PREREQ(2.52)dnl
12272b4363aSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12372b4363aSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12472b4363aSmrgAC_SUBST([$1_TRUE])dnl
12572b4363aSmrgAC_SUBST([$1_FALSE])dnl
12672b4363aSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
12772b4363aSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
12872b4363aSmrgif $2; then
12972b4363aSmrg  $1_TRUE=
13072b4363aSmrg  $1_FALSE='#'
13172b4363aSmrgelse
13272b4363aSmrg  $1_TRUE='#'
13372b4363aSmrg  $1_FALSE=
13472b4363aSmrgfi
13572b4363aSmrgAC_CONFIG_COMMANDS_PRE(
13672b4363aSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
13772b4363aSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
13872b4363aSmrgUsually this means the macro was only invoked conditionally.]])
13972b4363aSmrgfi])])
14072b4363aSmrg
14172b4363aSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
14272b4363aSmrg# Free Software Foundation, Inc.
14372b4363aSmrg#
14472b4363aSmrg# This file is free software; the Free Software Foundation
14572b4363aSmrg# gives unlimited permission to copy and/or distribute it,
14672b4363aSmrg# with or without modifications, as long as this notice is preserved.
14772b4363aSmrg
14872b4363aSmrg# serial 9
14972b4363aSmrg
15072b4363aSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
15172b4363aSmrg# written in clear, in which case automake, when reading aclocal.m4,
15272b4363aSmrg# will think it sees a *use*, and therefore will trigger all it's
15372b4363aSmrg# C support machinery.  Also note that it means that autoscan, seeing
15472b4363aSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
15572b4363aSmrg
15672b4363aSmrg
15772b4363aSmrg# _AM_DEPENDENCIES(NAME)
15872b4363aSmrg# ----------------------
15972b4363aSmrg# See how the compiler implements dependency checking.
16072b4363aSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
16172b4363aSmrg# We try a few techniques and use that to set a single cache variable.
16272b4363aSmrg#
16372b4363aSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
16472b4363aSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
16572b4363aSmrg# dependency, and given that the user is not expected to run this macro,
16672b4363aSmrg# just rely on AC_PROG_CC.
16772b4363aSmrgAC_DEFUN([_AM_DEPENDENCIES],
16872b4363aSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
16972b4363aSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
17072b4363aSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
17172b4363aSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
17272b4363aSmrg
17372b4363aSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
17472b4363aSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
17572b4363aSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
17672b4363aSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
17772b4363aSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
17872b4363aSmrg                   [depcc="$$1"   am_compiler_list=])
17972b4363aSmrg
18072b4363aSmrgAC_CACHE_CHECK([dependency style of $depcc],
18172b4363aSmrg               [am_cv_$1_dependencies_compiler_type],
18272b4363aSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
18372b4363aSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
18472b4363aSmrg  # making bogus files that we don't know about and never remove.  For
18572b4363aSmrg  # instance it was reported that on HP-UX the gcc test will end up
18672b4363aSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
18772b4363aSmrg  # in D'.
18872b4363aSmrg  mkdir conftest.dir
18972b4363aSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19072b4363aSmrg  # using a relative directory.
19172b4363aSmrg  cp "$am_depcomp" conftest.dir
19272b4363aSmrg  cd conftest.dir
19372b4363aSmrg  # We will build objects and dependencies in a subdirectory because
19472b4363aSmrg  # it helps to detect inapplicable dependency modes.  For instance
19572b4363aSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
19672b4363aSmrg  # side effect of compilation, but ICC will put the dependencies in
19772b4363aSmrg  # the current directory while Tru64 will put them in the object
19872b4363aSmrg  # directory.
19972b4363aSmrg  mkdir sub
20072b4363aSmrg
20172b4363aSmrg  am_cv_$1_dependencies_compiler_type=none
20272b4363aSmrg  if test "$am_compiler_list" = ""; then
20372b4363aSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
20472b4363aSmrg  fi
20572b4363aSmrg  for depmode in $am_compiler_list; do
20672b4363aSmrg    # Setup a source with many dependencies, because some compilers
20772b4363aSmrg    # like to wrap large dependency lists on column 80 (with \), and
20872b4363aSmrg    # we should not choose a depcomp mode which is confused by this.
20972b4363aSmrg    #
21072b4363aSmrg    # We need to recreate these files for each test, as the compiler may
21172b4363aSmrg    # overwrite some of them when testing with obscure command lines.
21272b4363aSmrg    # This happens at least with the AIX C compiler.
21372b4363aSmrg    : > sub/conftest.c
21472b4363aSmrg    for i in 1 2 3 4 5 6; do
21572b4363aSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
21672b4363aSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
21772b4363aSmrg      # Solaris 8's {/usr,}/bin/sh.
21872b4363aSmrg      touch sub/conftst$i.h
21972b4363aSmrg    done
22072b4363aSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
22172b4363aSmrg
22272b4363aSmrg    case $depmode in
22372b4363aSmrg    nosideeffect)
22472b4363aSmrg      # after this tag, mechanisms are not by side-effect, so they'll
22572b4363aSmrg      # only be used when explicitly requested
22672b4363aSmrg      if test "x$enable_dependency_tracking" = xyes; then
22772b4363aSmrg	continue
22872b4363aSmrg      else
22972b4363aSmrg	break
23072b4363aSmrg      fi
23172b4363aSmrg      ;;
23272b4363aSmrg    none) break ;;
23372b4363aSmrg    esac
23472b4363aSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
23572b4363aSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
23672b4363aSmrg    # handle `-M -o', and we need to detect this.
23772b4363aSmrg    if depmode=$depmode \
23872b4363aSmrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
23972b4363aSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
24072b4363aSmrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
24172b4363aSmrg         >/dev/null 2>conftest.err &&
24272b4363aSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
24372b4363aSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
24472b4363aSmrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
24572b4363aSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
24672b4363aSmrg      # icc doesn't choke on unknown options, it will just issue warnings
24772b4363aSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
24872b4363aSmrg      # that says an option was ignored or not supported.
24972b4363aSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
25072b4363aSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
25172b4363aSmrg      # The diagnosis changed in icc 8.0:
25272b4363aSmrg      #   icc: Command line remark: option '-MP' not supported
25372b4363aSmrg      if (grep 'ignoring option' conftest.err ||
25472b4363aSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
25572b4363aSmrg        am_cv_$1_dependencies_compiler_type=$depmode
25672b4363aSmrg        break
25772b4363aSmrg      fi
25872b4363aSmrg    fi
25972b4363aSmrg  done
26072b4363aSmrg
26172b4363aSmrg  cd ..
26272b4363aSmrg  rm -rf conftest.dir
26372b4363aSmrgelse
26472b4363aSmrg  am_cv_$1_dependencies_compiler_type=none
26572b4363aSmrgfi
26672b4363aSmrg])
26772b4363aSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
26872b4363aSmrgAM_CONDITIONAL([am__fastdep$1], [
26972b4363aSmrg  test "x$enable_dependency_tracking" != xno \
27072b4363aSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
27172b4363aSmrg])
27272b4363aSmrg
27372b4363aSmrg
27472b4363aSmrg# AM_SET_DEPDIR
27572b4363aSmrg# -------------
27672b4363aSmrg# Choose a directory name for dependency files.
27772b4363aSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
27872b4363aSmrgAC_DEFUN([AM_SET_DEPDIR],
27972b4363aSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
28072b4363aSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
28172b4363aSmrg])
28272b4363aSmrg
28372b4363aSmrg
28472b4363aSmrg# AM_DEP_TRACK
28572b4363aSmrg# ------------
28672b4363aSmrgAC_DEFUN([AM_DEP_TRACK],
28772b4363aSmrg[AC_ARG_ENABLE(dependency-tracking,
28872b4363aSmrg[  --disable-dependency-tracking  speeds up one-time build
28972b4363aSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
29072b4363aSmrgif test "x$enable_dependency_tracking" != xno; then
29172b4363aSmrg  am_depcomp="$ac_aux_dir/depcomp"
29272b4363aSmrg  AMDEPBACKSLASH='\'
29372b4363aSmrgfi
29472b4363aSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
29572b4363aSmrgAC_SUBST([AMDEPBACKSLASH])dnl
29672b4363aSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
29772b4363aSmrg])
29872b4363aSmrg
29972b4363aSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
30072b4363aSmrg
30172b4363aSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
30272b4363aSmrg# Free Software Foundation, Inc.
30372b4363aSmrg#
30472b4363aSmrg# This file is free software; the Free Software Foundation
30572b4363aSmrg# gives unlimited permission to copy and/or distribute it,
30672b4363aSmrg# with or without modifications, as long as this notice is preserved.
30772b4363aSmrg
30872b4363aSmrg#serial 3
30972b4363aSmrg
31072b4363aSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
31172b4363aSmrg# ------------------------------
31272b4363aSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
31372b4363aSmrg[for mf in $CONFIG_FILES; do
31472b4363aSmrg  # Strip MF so we end up with the name of the file.
31572b4363aSmrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
31672b4363aSmrg  # Check whether this is an Automake generated Makefile or not.
31772b4363aSmrg  # We used to match only the files named `Makefile.in', but
31872b4363aSmrg  # some people rename them; so instead we look at the file content.
31972b4363aSmrg  # Grep'ing the first line is not enough: some people post-process
32072b4363aSmrg  # each Makefile.in and add a new line on top of each file to say so.
32172b4363aSmrg  # Grep'ing the whole file is not good either: AIX grep has a line
32272b4363aSmrg  # limit of 2048, but all sed's we know have understand at least 4000.
32372b4363aSmrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
32472b4363aSmrg    dirpart=`AS_DIRNAME("$mf")`
32572b4363aSmrg  else
32672b4363aSmrg    continue
32772b4363aSmrg  fi
32872b4363aSmrg  # Extract the definition of DEPDIR, am__include, and am__quote
32972b4363aSmrg  # from the Makefile without running `make'.
33072b4363aSmrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
33172b4363aSmrg  test -z "$DEPDIR" && continue
33272b4363aSmrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
33372b4363aSmrg  test -z "am__include" && continue
33472b4363aSmrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
33572b4363aSmrg  # When using ansi2knr, U may be empty or an underscore; expand it
33672b4363aSmrg  U=`sed -n 's/^U = //p' < "$mf"`
33772b4363aSmrg  # Find all dependency output files, they are included files with
33872b4363aSmrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
33972b4363aSmrg  # simplest approach to changing $(DEPDIR) to its actual value in the
34072b4363aSmrg  # expansion.
34172b4363aSmrg  for file in `sed -n "
34272b4363aSmrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
34372b4363aSmrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
34472b4363aSmrg    # Make sure the directory exists.
34572b4363aSmrg    test -f "$dirpart/$file" && continue
34672b4363aSmrg    fdir=`AS_DIRNAME(["$file"])`
34772b4363aSmrg    AS_MKDIR_P([$dirpart/$fdir])
34872b4363aSmrg    # echo "creating $dirpart/$file"
34972b4363aSmrg    echo '# dummy' > "$dirpart/$file"
35072b4363aSmrg  done
35172b4363aSmrgdone
35272b4363aSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
35372b4363aSmrg
35472b4363aSmrg
35572b4363aSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
35672b4363aSmrg# -----------------------------
35772b4363aSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
35872b4363aSmrg#
35972b4363aSmrg# This code is only required when automatic dependency tracking
36072b4363aSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
36172b4363aSmrg# need in order to bootstrap the dependency handling code.
36272b4363aSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
36372b4363aSmrg[AC_CONFIG_COMMANDS([depfiles],
36472b4363aSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
36572b4363aSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
36672b4363aSmrg])
36772b4363aSmrg
36872b4363aSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
36972b4363aSmrg# Free Software Foundation, Inc.
37072b4363aSmrg#
37172b4363aSmrg# This file is free software; the Free Software Foundation
37272b4363aSmrg# gives unlimited permission to copy and/or distribute it,
37372b4363aSmrg# with or without modifications, as long as this notice is preserved.
37472b4363aSmrg
37572b4363aSmrg# serial 8
37672b4363aSmrg
37772b4363aSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
37872b4363aSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
37972b4363aSmrg
38072b4363aSmrg# Do all the work for Automake.                             -*- Autoconf -*-
38172b4363aSmrg
38272b4363aSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
38372b4363aSmrg# 2005, 2006 Free Software Foundation, Inc.
38472b4363aSmrg#
38572b4363aSmrg# This file is free software; the Free Software Foundation
38672b4363aSmrg# gives unlimited permission to copy and/or distribute it,
38772b4363aSmrg# with or without modifications, as long as this notice is preserved.
38872b4363aSmrg
38972b4363aSmrg# serial 12
39072b4363aSmrg
39172b4363aSmrg# This macro actually does too much.  Some checks are only needed if
39272b4363aSmrg# your package does certain things.  But this isn't really a big deal.
39372b4363aSmrg
39472b4363aSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
39572b4363aSmrg# AM_INIT_AUTOMAKE([OPTIONS])
39672b4363aSmrg# -----------------------------------------------
39772b4363aSmrg# The call with PACKAGE and VERSION arguments is the old style
39872b4363aSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
39972b4363aSmrg# and VERSION should now be passed to AC_INIT and removed from
40072b4363aSmrg# the call to AM_INIT_AUTOMAKE.
40172b4363aSmrg# We support both call styles for the transition.  After
40272b4363aSmrg# the next Automake release, Autoconf can make the AC_INIT
40372b4363aSmrg# arguments mandatory, and then we can depend on a new Autoconf
40472b4363aSmrg# release and drop the old call support.
40572b4363aSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
40672b4363aSmrg[AC_PREREQ([2.60])dnl
40772b4363aSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
40872b4363aSmrgdnl the ones we care about.
40972b4363aSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
41072b4363aSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
41172b4363aSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
41272b4363aSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
41372b4363aSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
41472b4363aSmrg  # is not polluted with repeated "-I."
41572b4363aSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
41672b4363aSmrg  # test to see if srcdir already configured
41772b4363aSmrg  if test -f $srcdir/config.status; then
41872b4363aSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
41972b4363aSmrg  fi
42072b4363aSmrgfi
42172b4363aSmrg
42272b4363aSmrg# test whether we have cygpath
42372b4363aSmrgif test -z "$CYGPATH_W"; then
42472b4363aSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
42572b4363aSmrg    CYGPATH_W='cygpath -w'
42672b4363aSmrg  else
42772b4363aSmrg    CYGPATH_W=echo
42872b4363aSmrg  fi
42972b4363aSmrgfi
43072b4363aSmrgAC_SUBST([CYGPATH_W])
43172b4363aSmrg
43272b4363aSmrg# Define the identity of the package.
43372b4363aSmrgdnl Distinguish between old-style and new-style calls.
43472b4363aSmrgm4_ifval([$2],
43572b4363aSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
43672b4363aSmrg AC_SUBST([PACKAGE], [$1])dnl
43772b4363aSmrg AC_SUBST([VERSION], [$2])],
43872b4363aSmrg[_AM_SET_OPTIONS([$1])dnl
43972b4363aSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
44072b4363aSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
44172b4363aSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
44272b4363aSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
44372b4363aSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
44472b4363aSmrg
44572b4363aSmrg_AM_IF_OPTION([no-define],,
44672b4363aSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
44772b4363aSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
44872b4363aSmrg
44972b4363aSmrg# Some tools Automake needs.
45072b4363aSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
45172b4363aSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
45272b4363aSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
45372b4363aSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
45472b4363aSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
45572b4363aSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
45672b4363aSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
45772b4363aSmrgAM_PROG_INSTALL_SH
45872b4363aSmrgAM_PROG_INSTALL_STRIP
45972b4363aSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
46072b4363aSmrg# We need awk for the "check" target.  The system "awk" is bad on
46172b4363aSmrg# some platforms.
46272b4363aSmrgAC_REQUIRE([AC_PROG_AWK])dnl
46372b4363aSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
46472b4363aSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
46572b4363aSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
46672b4363aSmrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
46772b4363aSmrg	      		     [_AM_PROG_TAR([v7])])])
46872b4363aSmrg_AM_IF_OPTION([no-dependencies],,
46972b4363aSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
47072b4363aSmrg                  [_AM_DEPENDENCIES(CC)],
47172b4363aSmrg                  [define([AC_PROG_CC],
47272b4363aSmrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
47372b4363aSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
47472b4363aSmrg                  [_AM_DEPENDENCIES(CXX)],
47572b4363aSmrg                  [define([AC_PROG_CXX],
47672b4363aSmrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
47772b4363aSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
47872b4363aSmrg                  [_AM_DEPENDENCIES(OBJC)],
47972b4363aSmrg                  [define([AC_PROG_OBJC],
48072b4363aSmrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
48172b4363aSmrg])
48272b4363aSmrg])
48372b4363aSmrg
48472b4363aSmrg
48572b4363aSmrg# When config.status generates a header, we must update the stamp-h file.
48672b4363aSmrg# This file resides in the same directory as the config header
48772b4363aSmrg# that is generated.  The stamp files are numbered to have different names.
48872b4363aSmrg
48972b4363aSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
49072b4363aSmrg# loop where config.status creates the headers, so we can generate
49172b4363aSmrg# our stamp files there.
49272b4363aSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
49372b4363aSmrg[# Compute $1's index in $config_headers.
49472b4363aSmrg_am_stamp_count=1
49572b4363aSmrgfor _am_header in $config_headers :; do
49672b4363aSmrg  case $_am_header in
49772b4363aSmrg    $1 | $1:* )
49872b4363aSmrg      break ;;
49972b4363aSmrg    * )
50072b4363aSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
50172b4363aSmrg  esac
50272b4363aSmrgdone
50372b4363aSmrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
50472b4363aSmrg
50572b4363aSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
50672b4363aSmrg#
50772b4363aSmrg# This file is free software; the Free Software Foundation
50872b4363aSmrg# gives unlimited permission to copy and/or distribute it,
50972b4363aSmrg# with or without modifications, as long as this notice is preserved.
51072b4363aSmrg
51172b4363aSmrg# AM_PROG_INSTALL_SH
51272b4363aSmrg# ------------------
51372b4363aSmrg# Define $install_sh.
51472b4363aSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
51572b4363aSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
51672b4363aSmrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
51772b4363aSmrgAC_SUBST(install_sh)])
51872b4363aSmrg
51972b4363aSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
52072b4363aSmrg#
52172b4363aSmrg# This file is free software; the Free Software Foundation
52272b4363aSmrg# gives unlimited permission to copy and/or distribute it,
52372b4363aSmrg# with or without modifications, as long as this notice is preserved.
52472b4363aSmrg
52572b4363aSmrg# serial 2
52672b4363aSmrg
52772b4363aSmrg# Check whether the underlying file-system supports filenames
52872b4363aSmrg# with a leading dot.  For instance MS-DOS doesn't.
52972b4363aSmrgAC_DEFUN([AM_SET_LEADING_DOT],
53072b4363aSmrg[rm -rf .tst 2>/dev/null
53172b4363aSmrgmkdir .tst 2>/dev/null
53272b4363aSmrgif test -d .tst; then
53372b4363aSmrg  am__leading_dot=.
53472b4363aSmrgelse
53572b4363aSmrg  am__leading_dot=_
53672b4363aSmrgfi
53772b4363aSmrgrmdir .tst 2>/dev/null
53872b4363aSmrgAC_SUBST([am__leading_dot])])
53972b4363aSmrg
54072b4363aSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
54172b4363aSmrg# From Jim Meyering
54272b4363aSmrg
54372b4363aSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
54472b4363aSmrg# Free Software Foundation, Inc.
54572b4363aSmrg#
54672b4363aSmrg# This file is free software; the Free Software Foundation
54772b4363aSmrg# gives unlimited permission to copy and/or distribute it,
54872b4363aSmrg# with or without modifications, as long as this notice is preserved.
54972b4363aSmrg
55072b4363aSmrg# serial 4
55172b4363aSmrg
55272b4363aSmrgAC_DEFUN([AM_MAINTAINER_MODE],
55372b4363aSmrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
55472b4363aSmrg  dnl maintainer-mode is disabled by default
55572b4363aSmrg  AC_ARG_ENABLE(maintainer-mode,
55672b4363aSmrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
55772b4363aSmrg			  (and sometimes confusing) to the casual installer],
55872b4363aSmrg      USE_MAINTAINER_MODE=$enableval,
55972b4363aSmrg      USE_MAINTAINER_MODE=no)
56072b4363aSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
56172b4363aSmrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
56272b4363aSmrg  MAINT=$MAINTAINER_MODE_TRUE
56372b4363aSmrg  AC_SUBST(MAINT)dnl
56472b4363aSmrg]
56572b4363aSmrg)
56672b4363aSmrg
56772b4363aSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
56872b4363aSmrg
56972b4363aSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
57072b4363aSmrg
57172b4363aSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
57272b4363aSmrg#
57372b4363aSmrg# This file is free software; the Free Software Foundation
57472b4363aSmrg# gives unlimited permission to copy and/or distribute it,
57572b4363aSmrg# with or without modifications, as long as this notice is preserved.
57672b4363aSmrg
57772b4363aSmrg# serial 3
57872b4363aSmrg
57972b4363aSmrg# AM_MAKE_INCLUDE()
58072b4363aSmrg# -----------------
58172b4363aSmrg# Check to see how make treats includes.
58272b4363aSmrgAC_DEFUN([AM_MAKE_INCLUDE],
58372b4363aSmrg[am_make=${MAKE-make}
58472b4363aSmrgcat > confinc << 'END'
58572b4363aSmrgam__doit:
58672b4363aSmrg	@echo done
58772b4363aSmrg.PHONY: am__doit
58872b4363aSmrgEND
58972b4363aSmrg# If we don't find an include directive, just comment out the code.
59072b4363aSmrgAC_MSG_CHECKING([for style of include used by $am_make])
59172b4363aSmrgam__include="#"
59272b4363aSmrgam__quote=
59372b4363aSmrg_am_result=none
59472b4363aSmrg# First try GNU make style include.
59572b4363aSmrgecho "include confinc" > confmf
59672b4363aSmrg# We grep out `Entering directory' and `Leaving directory'
59772b4363aSmrg# messages which can occur if `w' ends up in MAKEFLAGS.
59872b4363aSmrg# In particular we don't look at `^make:' because GNU make might
59972b4363aSmrg# be invoked under some other name (usually "gmake"), in which
60072b4363aSmrg# case it prints its new name instead of `make'.
60172b4363aSmrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
60272b4363aSmrg   am__include=include
60372b4363aSmrg   am__quote=
60472b4363aSmrg   _am_result=GNU
60572b4363aSmrgfi
60672b4363aSmrg# Now try BSD make style include.
60772b4363aSmrgif test "$am__include" = "#"; then
60872b4363aSmrg   echo '.include "confinc"' > confmf
60972b4363aSmrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
61072b4363aSmrg      am__include=.include
61172b4363aSmrg      am__quote="\""
61272b4363aSmrg      _am_result=BSD
61372b4363aSmrg   fi
61472b4363aSmrgfi
61572b4363aSmrgAC_SUBST([am__include])
61672b4363aSmrgAC_SUBST([am__quote])
61772b4363aSmrgAC_MSG_RESULT([$_am_result])
61872b4363aSmrgrm -f confinc confmf
61972b4363aSmrg])
62072b4363aSmrg
62172b4363aSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
62272b4363aSmrg
62372b4363aSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
62472b4363aSmrg# Free Software Foundation, Inc.
62572b4363aSmrg#
62672b4363aSmrg# This file is free software; the Free Software Foundation
62772b4363aSmrg# gives unlimited permission to copy and/or distribute it,
62872b4363aSmrg# with or without modifications, as long as this notice is preserved.
62972b4363aSmrg
63072b4363aSmrg# serial 5
63172b4363aSmrg
63272b4363aSmrg# AM_MISSING_PROG(NAME, PROGRAM)
63372b4363aSmrg# ------------------------------
63472b4363aSmrgAC_DEFUN([AM_MISSING_PROG],
63572b4363aSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
63672b4363aSmrg$1=${$1-"${am_missing_run}$2"}
63772b4363aSmrgAC_SUBST($1)])
63872b4363aSmrg
63972b4363aSmrg
64072b4363aSmrg# AM_MISSING_HAS_RUN
64172b4363aSmrg# ------------------
64272b4363aSmrg# Define MISSING if not defined so far and test if it supports --run.
64372b4363aSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
64472b4363aSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
64572b4363aSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
64672b4363aSmrgAC_REQUIRE_AUX_FILE([missing])dnl
64772b4363aSmrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
64872b4363aSmrg# Use eval to expand $SHELL
64972b4363aSmrgif eval "$MISSING --run true"; then
65072b4363aSmrg  am_missing_run="$MISSING --run "
65172b4363aSmrgelse
65272b4363aSmrg  am_missing_run=
65372b4363aSmrg  AC_MSG_WARN([`missing' script is too old or missing])
65472b4363aSmrgfi
65572b4363aSmrg])
65672b4363aSmrg
65772b4363aSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
65872b4363aSmrg#
65972b4363aSmrg# This file is free software; the Free Software Foundation
66072b4363aSmrg# gives unlimited permission to copy and/or distribute it,
66172b4363aSmrg# with or without modifications, as long as this notice is preserved.
66272b4363aSmrg
66372b4363aSmrg# AM_PROG_MKDIR_P
66472b4363aSmrg# ---------------
66572b4363aSmrg# Check for `mkdir -p'.
66672b4363aSmrgAC_DEFUN([AM_PROG_MKDIR_P],
66772b4363aSmrg[AC_PREREQ([2.60])dnl
66872b4363aSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
66972b4363aSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
67072b4363aSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
67172b4363aSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
67272b4363aSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
67372b4363aSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
67472b4363aSmrgdnl adjustment using top_builddir (which is defined more often than
67572b4363aSmrgdnl MKDIR_P).
67672b4363aSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
67772b4363aSmrgcase $mkdir_p in
67872b4363aSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
67972b4363aSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
68072b4363aSmrgesac
68172b4363aSmrg])
68272b4363aSmrg
68372b4363aSmrg# Helper functions for option handling.                     -*- Autoconf -*-
68472b4363aSmrg
68572b4363aSmrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
68672b4363aSmrg#
68772b4363aSmrg# This file is free software; the Free Software Foundation
68872b4363aSmrg# gives unlimited permission to copy and/or distribute it,
68972b4363aSmrg# with or without modifications, as long as this notice is preserved.
69072b4363aSmrg
69172b4363aSmrg# serial 3
69272b4363aSmrg
69372b4363aSmrg# _AM_MANGLE_OPTION(NAME)
69472b4363aSmrg# -----------------------
69572b4363aSmrgAC_DEFUN([_AM_MANGLE_OPTION],
69672b4363aSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
69772b4363aSmrg
69872b4363aSmrg# _AM_SET_OPTION(NAME)
69972b4363aSmrg# ------------------------------
70072b4363aSmrg# Set option NAME.  Presently that only means defining a flag for this option.
70172b4363aSmrgAC_DEFUN([_AM_SET_OPTION],
70272b4363aSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
70372b4363aSmrg
70472b4363aSmrg# _AM_SET_OPTIONS(OPTIONS)
70572b4363aSmrg# ----------------------------------
70672b4363aSmrg# OPTIONS is a space-separated list of Automake options.
70772b4363aSmrgAC_DEFUN([_AM_SET_OPTIONS],
70872b4363aSmrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
70972b4363aSmrg
71072b4363aSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
71172b4363aSmrg# -------------------------------------------
71272b4363aSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
71372b4363aSmrgAC_DEFUN([_AM_IF_OPTION],
71472b4363aSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
71572b4363aSmrg
71672b4363aSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
71772b4363aSmrg
71872b4363aSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
71972b4363aSmrg# Free Software Foundation, Inc.
72072b4363aSmrg#
72172b4363aSmrg# This file is free software; the Free Software Foundation
72272b4363aSmrg# gives unlimited permission to copy and/or distribute it,
72372b4363aSmrg# with or without modifications, as long as this notice is preserved.
72472b4363aSmrg
72572b4363aSmrg# serial 4
72672b4363aSmrg
72772b4363aSmrg# AM_SANITY_CHECK
72872b4363aSmrg# ---------------
72972b4363aSmrgAC_DEFUN([AM_SANITY_CHECK],
73072b4363aSmrg[AC_MSG_CHECKING([whether build environment is sane])
73172b4363aSmrg# Just in case
73272b4363aSmrgsleep 1
73372b4363aSmrgecho timestamp > conftest.file
73472b4363aSmrg# Do `set' in a subshell so we don't clobber the current shell's
73572b4363aSmrg# arguments.  Must try -L first in case configure is actually a
73672b4363aSmrg# symlink; some systems play weird games with the mod time of symlinks
73772b4363aSmrg# (eg FreeBSD returns the mod time of the symlink's containing
73872b4363aSmrg# directory).
73972b4363aSmrgif (
74072b4363aSmrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
74172b4363aSmrg   if test "$[*]" = "X"; then
74272b4363aSmrg      # -L didn't work.
74372b4363aSmrg      set X `ls -t $srcdir/configure conftest.file`
74472b4363aSmrg   fi
74572b4363aSmrg   rm -f conftest.file
74672b4363aSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
74772b4363aSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
74872b4363aSmrg
74972b4363aSmrg      # If neither matched, then we have a broken ls.  This can happen
75072b4363aSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
75172b4363aSmrg      # broken ls alias from the environment.  This has actually
75272b4363aSmrg      # happened.  Such a system could not be considered "sane".
75372b4363aSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
75472b4363aSmrgalias in your environment])
75572b4363aSmrg   fi
75672b4363aSmrg
75772b4363aSmrg   test "$[2]" = conftest.file
75872b4363aSmrg   )
75972b4363aSmrgthen
76072b4363aSmrg   # Ok.
76172b4363aSmrg   :
76272b4363aSmrgelse
76372b4363aSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
76472b4363aSmrgCheck your system clock])
76572b4363aSmrgfi
76672b4363aSmrgAC_MSG_RESULT(yes)])
76772b4363aSmrg
76872b4363aSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
76972b4363aSmrg#
77072b4363aSmrg# This file is free software; the Free Software Foundation
77172b4363aSmrg# gives unlimited permission to copy and/or distribute it,
77272b4363aSmrg# with or without modifications, as long as this notice is preserved.
77372b4363aSmrg
77472b4363aSmrg# AM_PROG_INSTALL_STRIP
77572b4363aSmrg# ---------------------
77672b4363aSmrg# One issue with vendor `install' (even GNU) is that you can't
77772b4363aSmrg# specify the program used to strip binaries.  This is especially
77872b4363aSmrg# annoying in cross-compiling environments, where the build's strip
77972b4363aSmrg# is unlikely to handle the host's binaries.
78072b4363aSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
78172b4363aSmrg# always use install-sh in `make install-strip', and initialize
78272b4363aSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
78372b4363aSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
78472b4363aSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
78572b4363aSmrg# Installed binaries are usually stripped using `strip' when the user
78672b4363aSmrg# run `make install-strip'.  However `strip' might not be the right
78772b4363aSmrg# tool to use in cross-compilation environments, therefore Automake
78872b4363aSmrg# will honor the `STRIP' environment variable to overrule this program.
78972b4363aSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
79072b4363aSmrgif test "$cross_compiling" != no; then
79172b4363aSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
79272b4363aSmrgfi
79372b4363aSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
79472b4363aSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
79572b4363aSmrg
79672b4363aSmrg# Copyright (C) 2006  Free Software Foundation, Inc.
79772b4363aSmrg#
79872b4363aSmrg# This file is free software; the Free Software Foundation
79972b4363aSmrg# gives unlimited permission to copy and/or distribute it,
80072b4363aSmrg# with or without modifications, as long as this notice is preserved.
80172b4363aSmrg
80272b4363aSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
80372b4363aSmrg# ---------------------------
80472b4363aSmrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
80572b4363aSmrg# This macro is traced by Automake.
80672b4363aSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
80772b4363aSmrg
80872b4363aSmrg# Check how to create a tarball.                            -*- Autoconf -*-
80972b4363aSmrg
81072b4363aSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
81172b4363aSmrg#
81272b4363aSmrg# This file is free software; the Free Software Foundation
81372b4363aSmrg# gives unlimited permission to copy and/or distribute it,
81472b4363aSmrg# with or without modifications, as long as this notice is preserved.
81572b4363aSmrg
81672b4363aSmrg# serial 2
81772b4363aSmrg
81872b4363aSmrg# _AM_PROG_TAR(FORMAT)
81972b4363aSmrg# --------------------
82072b4363aSmrg# Check how to create a tarball in format FORMAT.
82172b4363aSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
82272b4363aSmrg#
82372b4363aSmrg# Substitute a variable $(am__tar) that is a command
82472b4363aSmrg# writing to stdout a FORMAT-tarball containing the directory
82572b4363aSmrg# $tardir.
82672b4363aSmrg#     tardir=directory && $(am__tar) > result.tar
82772b4363aSmrg#
82872b4363aSmrg# Substitute a variable $(am__untar) that extract such
82972b4363aSmrg# a tarball read from stdin.
83072b4363aSmrg#     $(am__untar) < result.tar
83172b4363aSmrgAC_DEFUN([_AM_PROG_TAR],
83272b4363aSmrg[# Always define AMTAR for backward compatibility.
83372b4363aSmrgAM_MISSING_PROG([AMTAR], [tar])
83472b4363aSmrgm4_if([$1], [v7],
83572b4363aSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
83672b4363aSmrg     [m4_case([$1], [ustar],, [pax],,
83772b4363aSmrg              [m4_fatal([Unknown tar format])])
83872b4363aSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
83972b4363aSmrg# Loop over all known methods to create a tar archive until one works.
84072b4363aSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
84172b4363aSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
84272b4363aSmrg# Do not fold the above two line into one, because Tru64 sh and
84372b4363aSmrg# Solaris sh will not grok spaces in the rhs of `-'.
84472b4363aSmrgfor _am_tool in $_am_tools
84572b4363aSmrgdo
84672b4363aSmrg  case $_am_tool in
84772b4363aSmrg  gnutar)
84872b4363aSmrg    for _am_tar in tar gnutar gtar;
84972b4363aSmrg    do
85072b4363aSmrg      AM_RUN_LOG([$_am_tar --version]) && break
85172b4363aSmrg    done
85272b4363aSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
85372b4363aSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
85472b4363aSmrg    am__untar="$_am_tar -xf -"
85572b4363aSmrg    ;;
85672b4363aSmrg  plaintar)
85772b4363aSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
85872b4363aSmrg    # ustar tarball either.
85972b4363aSmrg    (tar --version) >/dev/null 2>&1 && continue
86072b4363aSmrg    am__tar='tar chf - "$$tardir"'
86172b4363aSmrg    am__tar_='tar chf - "$tardir"'
86272b4363aSmrg    am__untar='tar xf -'
86372b4363aSmrg    ;;
86472b4363aSmrg  pax)
86572b4363aSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
86672b4363aSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
86772b4363aSmrg    am__untar='pax -r'
86872b4363aSmrg    ;;
86972b4363aSmrg  cpio)
87072b4363aSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
87172b4363aSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
87272b4363aSmrg    am__untar='cpio -i -H $1 -d'
87372b4363aSmrg    ;;
87472b4363aSmrg  none)
87572b4363aSmrg    am__tar=false
87672b4363aSmrg    am__tar_=false
87772b4363aSmrg    am__untar=false
87872b4363aSmrg    ;;
87972b4363aSmrg  esac
88072b4363aSmrg
88172b4363aSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
88272b4363aSmrg  # and am__untar set.
88372b4363aSmrg  test -n "${am_cv_prog_tar_$1}" && break
88472b4363aSmrg
88572b4363aSmrg  # tar/untar a dummy directory, and stop if the command works
88672b4363aSmrg  rm -rf conftest.dir
88772b4363aSmrg  mkdir conftest.dir
88872b4363aSmrg  echo GrepMe > conftest.dir/file
88972b4363aSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
89072b4363aSmrg  rm -rf conftest.dir
89172b4363aSmrg  if test -s conftest.tar; then
89272b4363aSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
89372b4363aSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
89472b4363aSmrg  fi
89572b4363aSmrgdone
89672b4363aSmrgrm -rf conftest.dir
89772b4363aSmrg
89872b4363aSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
89972b4363aSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
90072b4363aSmrgAC_SUBST([am__tar])
90172b4363aSmrgAC_SUBST([am__untar])
90272b4363aSmrg]) # _AM_PROG_TAR
90372b4363aSmrg
90472b4363aSmrgdnl
90572b4363aSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
90672b4363aSmrgdnl 
90772b4363aSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
90872b4363aSmrgdnl copy of this software and associated documentation files (the
90972b4363aSmrgdnl "Software"), to deal in the Software without restriction, including
91072b4363aSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
91172b4363aSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
91272b4363aSmrgdnl to whom the Software is furnished to do so, provided that the above
91372b4363aSmrgdnl copyright notice(s) and this permission notice appear in all copies of
91472b4363aSmrgdnl the Software and that both the above copyright notice(s) and this
91572b4363aSmrgdnl permission notice appear in supporting documentation.
91672b4363aSmrgdnl
91772b4363aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
91872b4363aSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
91972b4363aSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
92072b4363aSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
92172b4363aSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
92272b4363aSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
92372b4363aSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
92472b4363aSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
92572b4363aSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
92672b4363aSmrgdnl
92772b4363aSmrgdnl Except as contained in this notice, the name of a copyright holder
92872b4363aSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
92972b4363aSmrgdnl or other dealings in this Software without prior written authorization
93072b4363aSmrgdnl of the copyright holder.
93172b4363aSmrg
93272b4363aSmrg# XORG_MACROS_VERSION(required-version)
93372b4363aSmrg# -------------------------------------
93472b4363aSmrg# Minimum version: 1.1.0
93572b4363aSmrg#
93672b4363aSmrg# If you're using a macro added in Version 1.1 or newer, include this in
93772b4363aSmrg# your configure.ac with the minimum required version, such as:
93872b4363aSmrg# XORG_MACROS_VERSION(1.1)
93972b4363aSmrg#
94072b4363aSmrg# To force at least a version with this macro defined, also add:
94172b4363aSmrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
94272b4363aSmrg#
94372b4363aSmrg#
94472b4363aSmrg# See the "minimum version" comment for each macro you use to see what 
94572b4363aSmrg# version you require.
94672b4363aSmrgAC_DEFUN([XORG_MACROS_VERSION],[
94772b4363aSmrg	[XORG_MACROS_needed_version=$1
94872b4363aSmrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
94972b4363aSmrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
95072b4363aSmrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
95172b4363aSmrg	[XORG_MACROS_version=1.1.5
95272b4363aSmrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
95372b4363aSmrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
95472b4363aSmrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
95572b4363aSmrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
95672b4363aSmrg	fi
95772b4363aSmrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
95872b4363aSmrg		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])
95972b4363aSmrg	fi
96072b4363aSmrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
96172b4363aSmrg]) # XORG_MACROS_VERSION
96272b4363aSmrg
96372b4363aSmrg# XORG_PROG_RAWCPP()
96472b4363aSmrg# ------------------
96572b4363aSmrg# Minimum version: 1.0.0
96672b4363aSmrg#
96772b4363aSmrg# Find cpp program and necessary flags for use in pre-processing text files
96872b4363aSmrg# such as man pages and config files
96972b4363aSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
97072b4363aSmrgAC_REQUIRE([AC_PROG_CPP])
97172b4363aSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
97272b4363aSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
97372b4363aSmrg
97472b4363aSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
97572b4363aSmrg# which is not the best choice for supporting other OS'es, but covers most
97672b4363aSmrg# of the ones we need for now.
97772b4363aSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
97872b4363aSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
97972b4363aSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
98072b4363aSmrg	AC_MSG_RESULT([no])
98172b4363aSmrgelse
98272b4363aSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
98372b4363aSmrg		RAWCPPFLAGS=-undef
98472b4363aSmrg		AC_MSG_RESULT([yes])
98572b4363aSmrg	else
98672b4363aSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
98772b4363aSmrg	fi
98872b4363aSmrgfi
98972b4363aSmrgrm -f conftest.$ac_ext
99072b4363aSmrg
99172b4363aSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
99272b4363aSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
99372b4363aSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
99472b4363aSmrg	AC_MSG_RESULT([no])
99572b4363aSmrgelse
99672b4363aSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
99772b4363aSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
99872b4363aSmrg		AC_MSG_RESULT([yes])
99972b4363aSmrg	else
100072b4363aSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
100172b4363aSmrg	fi
100272b4363aSmrgfi
100372b4363aSmrgrm -f conftest.$ac_ext
100472b4363aSmrgAC_SUBST(RAWCPPFLAGS)
100572b4363aSmrg]) # XORG_PROG_RAWCPP
100672b4363aSmrg
100772b4363aSmrg# XORG_MANPAGE_SECTIONS()
100872b4363aSmrg# -----------------------
100972b4363aSmrg# Minimum version: 1.0.0
101072b4363aSmrg#
101172b4363aSmrg# Determine which sections man pages go in for the different man page types
101272b4363aSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
101372b4363aSmrg# Not sure if there's any better way than just hardcoding by OS name.
101472b4363aSmrg# Override default settings by setting environment variables
101572b4363aSmrg
101672b4363aSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
101772b4363aSmrgAC_REQUIRE([AC_CANONICAL_HOST])
101872b4363aSmrg
101972b4363aSmrgif test x$APP_MAN_SUFFIX = x    ; then
102072b4363aSmrg    APP_MAN_SUFFIX=1
102172b4363aSmrgfi
102272b4363aSmrgif test x$APP_MAN_DIR = x    ; then
102372b4363aSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
102472b4363aSmrgfi
102572b4363aSmrg
102672b4363aSmrgif test x$LIB_MAN_SUFFIX = x    ; then
102772b4363aSmrg    LIB_MAN_SUFFIX=3
102872b4363aSmrgfi
102972b4363aSmrgif test x$LIB_MAN_DIR = x    ; then
103072b4363aSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
103172b4363aSmrgfi
103272b4363aSmrg
103372b4363aSmrgif test x$FILE_MAN_SUFFIX = x    ; then
103472b4363aSmrg    case $host_os in
103572b4363aSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
103672b4363aSmrg	*)		FILE_MAN_SUFFIX=5  ;;
103772b4363aSmrg    esac
103872b4363aSmrgfi
103972b4363aSmrgif test x$FILE_MAN_DIR = x    ; then
104072b4363aSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
104172b4363aSmrgfi
104272b4363aSmrg
104372b4363aSmrgif test x$MISC_MAN_SUFFIX = x    ; then
104472b4363aSmrg    case $host_os in
104572b4363aSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
104672b4363aSmrg	*)		MISC_MAN_SUFFIX=7  ;;
104772b4363aSmrg    esac
104872b4363aSmrgfi
104972b4363aSmrgif test x$MISC_MAN_DIR = x    ; then
105072b4363aSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
105172b4363aSmrgfi
105272b4363aSmrg
105372b4363aSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
105472b4363aSmrg    case $host_os in
105572b4363aSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
105672b4363aSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
105772b4363aSmrg    esac
105872b4363aSmrgfi
105972b4363aSmrgif test x$DRIVER_MAN_DIR = x    ; then
106072b4363aSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
106172b4363aSmrgfi
106272b4363aSmrg
106372b4363aSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
106472b4363aSmrg    case $host_os in
106572b4363aSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
106672b4363aSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
106772b4363aSmrg    esac
106872b4363aSmrgfi
106972b4363aSmrgif test x$ADMIN_MAN_DIR = x    ; then
107072b4363aSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
107172b4363aSmrgfi
107272b4363aSmrg
107372b4363aSmrg
107472b4363aSmrgAC_SUBST([APP_MAN_SUFFIX])
107572b4363aSmrgAC_SUBST([LIB_MAN_SUFFIX])
107672b4363aSmrgAC_SUBST([FILE_MAN_SUFFIX])
107772b4363aSmrgAC_SUBST([MISC_MAN_SUFFIX])
107872b4363aSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
107972b4363aSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
108072b4363aSmrgAC_SUBST([APP_MAN_DIR])
108172b4363aSmrgAC_SUBST([LIB_MAN_DIR])
108272b4363aSmrgAC_SUBST([FILE_MAN_DIR])
108372b4363aSmrgAC_SUBST([MISC_MAN_DIR])
108472b4363aSmrgAC_SUBST([DRIVER_MAN_DIR])
108572b4363aSmrgAC_SUBST([ADMIN_MAN_DIR])
108672b4363aSmrg]) # XORG_MANPAGE_SECTIONS
108772b4363aSmrg
108872b4363aSmrg# XORG_CHECK_LINUXDOC
108972b4363aSmrg# -------------------
109072b4363aSmrg# Minimum version: 1.0.0
109172b4363aSmrg#
109272b4363aSmrg# Defines the variable MAKE_TEXT if the necessary tools and
109372b4363aSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
109472b4363aSmrg# Whether or not the necessary tools and files are found can be checked
109572b4363aSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
109672b4363aSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
109772b4363aSmrgXORG_SGML_PATH=$prefix/share/sgml
109872b4363aSmrgHAVE_DEFS_ENT=
109972b4363aSmrg
110072b4363aSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
110172b4363aSmrg
110272b4363aSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
110372b4363aSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
110472b4363aSmrg
110572b4363aSmrgAC_MSG_CHECKING([Whether to build documentation])
110672b4363aSmrg
110772b4363aSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
110872b4363aSmrg   BUILDDOC=yes
110972b4363aSmrgelse
111072b4363aSmrg   BUILDDOC=no
111172b4363aSmrgfi
111272b4363aSmrg
111372b4363aSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
111472b4363aSmrg
111572b4363aSmrgAC_MSG_RESULT([$BUILDDOC])
111672b4363aSmrg
111772b4363aSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
111872b4363aSmrg
111972b4363aSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
112072b4363aSmrg   BUILDPDFDOC=yes
112172b4363aSmrgelse
112272b4363aSmrg   BUILDPDFDOC=no
112372b4363aSmrgfi
112472b4363aSmrg
112572b4363aSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
112672b4363aSmrg
112772b4363aSmrgAC_MSG_RESULT([$BUILDPDFDOC])
112872b4363aSmrg
112972b4363aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
113072b4363aSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
113172b4363aSmrgMAKE_PDF="$PS2PDF"
113272b4363aSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
113372b4363aSmrg
113472b4363aSmrgAC_SUBST(MAKE_TEXT)
113572b4363aSmrgAC_SUBST(MAKE_PS)
113672b4363aSmrgAC_SUBST(MAKE_PDF)
113772b4363aSmrgAC_SUBST(MAKE_HTML)
113872b4363aSmrg]) # XORG_CHECK_LINUXDOC
113972b4363aSmrg
114072b4363aSmrg# XORG_CHECK_DOCBOOK
114172b4363aSmrg# -------------------
114272b4363aSmrg# Minimum version: 1.0.0
114372b4363aSmrg#
114472b4363aSmrg# Checks for the ability to build output formats from SGML DocBook source.
114572b4363aSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
114672b4363aSmrg# indicates whether the necessary tools and files are found and, if set,
114772b4363aSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
114872b4363aSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
114972b4363aSmrgXORG_SGML_PATH=$prefix/share/sgml
115072b4363aSmrgHAVE_DEFS_ENT=
115172b4363aSmrgBUILDTXTDOC=no
115272b4363aSmrgBUILDPDFDOC=no
115372b4363aSmrgBUILDPSDOC=no
115472b4363aSmrgBUILDHTMLDOC=no
115572b4363aSmrg
115672b4363aSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
115772b4363aSmrg
115872b4363aSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
115972b4363aSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
116072b4363aSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
116172b4363aSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
116272b4363aSmrg
116372b4363aSmrgAC_MSG_CHECKING([Whether to build text documentation])
116472b4363aSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
116572b4363aSmrg   test x$BUILD_TXTDOC != xno; then
116672b4363aSmrg	BUILDTXTDOC=yes
116772b4363aSmrgfi
116872b4363aSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
116972b4363aSmrgAC_MSG_RESULT([$BUILDTXTDOC])
117072b4363aSmrg
117172b4363aSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
117272b4363aSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
117372b4363aSmrg   test x$BUILD_PDFDOC != xno; then
117472b4363aSmrg	BUILDPDFDOC=yes
117572b4363aSmrgfi
117672b4363aSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
117772b4363aSmrgAC_MSG_RESULT([$BUILDPDFDOC])
117872b4363aSmrg
117972b4363aSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
118072b4363aSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
118172b4363aSmrg   test x$BUILD_PSDOC != xno; then
118272b4363aSmrg	BUILDPSDOC=yes
118372b4363aSmrgfi
118472b4363aSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
118572b4363aSmrgAC_MSG_RESULT([$BUILDPSDOC])
118672b4363aSmrg
118772b4363aSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
118872b4363aSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
118972b4363aSmrg   test x$BUILD_HTMLDOC != xno; then
119072b4363aSmrg	BUILDHTMLDOC=yes
119172b4363aSmrgfi
119272b4363aSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
119372b4363aSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
119472b4363aSmrg
119572b4363aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
119672b4363aSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
119772b4363aSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
119872b4363aSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
119972b4363aSmrg
120072b4363aSmrgAC_SUBST(MAKE_TEXT)
120172b4363aSmrgAC_SUBST(MAKE_PS)
120272b4363aSmrgAC_SUBST(MAKE_PDF)
120372b4363aSmrgAC_SUBST(MAKE_HTML)
120472b4363aSmrg]) # XORG_CHECK_DOCBOOK
120572b4363aSmrg
120672b4363aSmrg# XORG_CHECK_MALLOC_ZERO
120772b4363aSmrg# ----------------------
120872b4363aSmrg# Minimum version: 1.0.0
120972b4363aSmrg#
121072b4363aSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
121172b4363aSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
121272b4363aSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
121372b4363aSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
121472b4363aSmrgAC_ARG_ENABLE(malloc0returnsnull,
121572b4363aSmrg	AC_HELP_STRING([--enable-malloc0returnsnull],
121672b4363aSmrg		       [malloc(0) returns NULL (default: auto)]),
121772b4363aSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
121872b4363aSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
121972b4363aSmrg
122072b4363aSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
122172b4363aSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
122272b4363aSmrg	AC_RUN_IFELSE([
122372b4363aSmrgchar *malloc();
122472b4363aSmrgchar *realloc();
122572b4363aSmrgchar *calloc();
122672b4363aSmrgmain() {
122772b4363aSmrg    char *m0, *r0, *c0, *p;
122872b4363aSmrg    m0 = malloc(0);
122972b4363aSmrg    p = malloc(10);
123072b4363aSmrg    r0 = realloc(p,0);
123172b4363aSmrg    c0 = calloc(0);
123272b4363aSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
123372b4363aSmrg}],
123472b4363aSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
123572b4363aSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
123672b4363aSmrgfi
123772b4363aSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
123872b4363aSmrg
123972b4363aSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
124072b4363aSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
124172b4363aSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
124272b4363aSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
124372b4363aSmrgelse
124472b4363aSmrg	MALLOC_ZERO_CFLAGS=""
124572b4363aSmrg	XMALLOC_ZERO_CFLAGS=""
124672b4363aSmrg	XTMALLOC_ZERO_CFLAGS=""
124772b4363aSmrgfi
124872b4363aSmrg
124972b4363aSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
125072b4363aSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
125172b4363aSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
125272b4363aSmrg]) # XORG_CHECK_MALLOC_ZERO
125372b4363aSmrg
125472b4363aSmrg# XORG_WITH_LINT()
125572b4363aSmrg# ----------------
125672b4363aSmrg# Minimum version: 1.1.0
125772b4363aSmrg#
125872b4363aSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
125972b4363aSmrg# is specified.   (Use --with-lint=sparse for sparse.)
126072b4363aSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
126172b4363aSmrg# Sets $LINT_FLAGS to flags to pass to source checker
126272b4363aSmrg# Sets LINT automake conditional if enabled (default: disabled)
126372b4363aSmrg#
126472b4363aSmrgAC_DEFUN([XORG_WITH_LINT],[
126572b4363aSmrg
126672b4363aSmrg# Allow checking code with lint, sparse, etc.
126772b4363aSmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
126872b4363aSmrg		[Use a lint-style source code checker (default: disabled)])],
126972b4363aSmrg		[use_lint=$withval], [use_lint=no])
127072b4363aSmrgif test "x$use_lint" = "xyes" ; then
127172b4363aSmrg	LINT="lint"
127272b4363aSmrgelse
127372b4363aSmrg	LINT="$use_lint"
127472b4363aSmrgfi
127572b4363aSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
127672b4363aSmrg    case $LINT in
127772b4363aSmrg	lint|*/lint)
127872b4363aSmrg	    case $host_os in
127972b4363aSmrg		solaris*)
128072b4363aSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
128172b4363aSmrg			;;
128272b4363aSmrg	    esac
128372b4363aSmrg	    ;;
128472b4363aSmrg    esac
128572b4363aSmrgfi
128672b4363aSmrg
128772b4363aSmrgAC_SUBST(LINT)
128872b4363aSmrgAC_SUBST(LINT_FLAGS)
128972b4363aSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
129072b4363aSmrg
129172b4363aSmrg]) # XORG_WITH_LINT
129272b4363aSmrg
129372b4363aSmrg# XORG_LINT_LIBRARY(LIBNAME)
129472b4363aSmrg# --------------------------
129572b4363aSmrg# Minimum version: 1.1.0
129672b4363aSmrg#
129772b4363aSmrg# Sets up flags for building lint libraries for checking programs that call
129872b4363aSmrg# functions in the library.
129972b4363aSmrg# Disabled by default, enable with --enable-lint-library
130072b4363aSmrg# Sets: 
130172b4363aSmrg#	@LINTLIB@		- name of lint library file to make
130272b4363aSmrg#	MAKE_LINT_LIB		- automake conditional
130372b4363aSmrg#
130472b4363aSmrg
130572b4363aSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
130672b4363aSmrgAC_REQUIRE([XORG_WITH_LINT])
130772b4363aSmrg# Build lint "library" for more indepth checks of programs calling this library
130872b4363aSmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
130972b4363aSmrg	[Create lint library (default: disabled)])],
131072b4363aSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
131172b4363aSmrgif test "x$make_lint_lib" != "xno" ; then
131272b4363aSmrg	if test "x$LINT" = "xno" ; then
131372b4363aSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
131472b4363aSmrg	fi
131572b4363aSmrg	if test "x$make_lint_lib" = "xyes" ; then
131672b4363aSmrg		LINTLIB=llib-l$1.ln
131772b4363aSmrg	else
131872b4363aSmrg		LINTLIB=$make_lint_lib
131972b4363aSmrg	fi
132072b4363aSmrgfi
132172b4363aSmrgAC_SUBST(LINTLIB)
132272b4363aSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
132372b4363aSmrg
132472b4363aSmrg]) # XORG_LINT_LIBRARY
132572b4363aSmrg
132672b4363aSmrgdnl Copyright 2005 Red Hat, Inc
132772b4363aSmrgdnl
132872b4363aSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
132972b4363aSmrgdnl documentation for any purpose is hereby granted without fee, provided that
133072b4363aSmrgdnl the above copyright notice appear in all copies and that both that
133172b4363aSmrgdnl copyright notice and this permission notice appear in supporting
133272b4363aSmrgdnl documentation.
133372b4363aSmrgdnl
133472b4363aSmrgdnl The above copyright notice and this permission notice shall be included
133572b4363aSmrgdnl in all copies or substantial portions of the Software.
133672b4363aSmrgdnl
133772b4363aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
133872b4363aSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
133972b4363aSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
134072b4363aSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
134172b4363aSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
134272b4363aSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
134372b4363aSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
134472b4363aSmrgdnl
134572b4363aSmrgdnl Except as contained in this notice, the name of the copyright holders shall
134672b4363aSmrgdnl not be used in advertising or otherwise to promote the sale, use or
134772b4363aSmrgdnl other dealings in this Software without prior written authorization
134872b4363aSmrgdnl from the copyright holders.
134972b4363aSmrgdnl
135072b4363aSmrg
135172b4363aSmrg# XORG_RELEASE_VERSION
135272b4363aSmrg# --------------------
135372b4363aSmrg# Adds --with/without-release-string and changes the PACKAGE and
135472b4363aSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
135572b4363aSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
135672b4363aSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
135772b4363aSmrg 
135872b4363aSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
135972b4363aSmrg	AC_ARG_WITH(release-version,
136072b4363aSmrg			AC_HELP_STRING([--with-release-version=STRING],
136172b4363aSmrg				[Use release version string in package name]),
136272b4363aSmrg			[RELEASE_VERSION="$withval"],
136372b4363aSmrg			[RELEASE_VERSION=""])
136472b4363aSmrg	if test "x$RELEASE_VERSION" != "x"; then
136572b4363aSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
136672b4363aSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
136772b4363aSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
136872b4363aSmrg	fi
136972b4363aSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
137072b4363aSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
137172b4363aSmrg		[Major version of this package])
137272b4363aSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
137372b4363aSmrg	if test "x$PVM" = "x"; then
137472b4363aSmrg		PVM="0"
137572b4363aSmrg	fi
137672b4363aSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
137772b4363aSmrg		[$PVM],
137872b4363aSmrg		[Minor version of this package])
137972b4363aSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
138072b4363aSmrg	if test "x$PVP" = "x"; then
138172b4363aSmrg		PVP="0"
138272b4363aSmrg	fi
138372b4363aSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
138472b4363aSmrg		[$PVP],
138572b4363aSmrg		[Patch version of this package])
138672b4363aSmrg])
138772b4363aSmrg
138872b4363aSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
138972b4363aSmrg# 
139072b4363aSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
139172b4363aSmrg#
139272b4363aSmrg# This program is free software; you can redistribute it and/or modify
139372b4363aSmrg# it under the terms of the GNU General Public License as published by
139472b4363aSmrg# the Free Software Foundation; either version 2 of the License, or
139572b4363aSmrg# (at your option) any later version.
139672b4363aSmrg#
139772b4363aSmrg# This program is distributed in the hope that it will be useful, but
139872b4363aSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
139972b4363aSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
140072b4363aSmrg# General Public License for more details.
140172b4363aSmrg#
140272b4363aSmrg# You should have received a copy of the GNU General Public License
140372b4363aSmrg# along with this program; if not, write to the Free Software
140472b4363aSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
140572b4363aSmrg#
140672b4363aSmrg# As a special exception to the GNU General Public License, if you
140772b4363aSmrg# distribute this file as part of a program that contains a
140872b4363aSmrg# configuration script generated by Autoconf, you may include it under
140972b4363aSmrg# the same distribution terms that you use for the rest of that program.
141072b4363aSmrg
141172b4363aSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
141272b4363aSmrg# ----------------------------------
141372b4363aSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
141472b4363aSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
141572b4363aSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
141672b4363aSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
141772b4363aSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
141872b4363aSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
141972b4363aSmrgfi
142072b4363aSmrgif test -n "$PKG_CONFIG"; then
142172b4363aSmrg	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
142272b4363aSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
142372b4363aSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
142472b4363aSmrg		AC_MSG_RESULT([yes])
142572b4363aSmrg	else
142672b4363aSmrg		AC_MSG_RESULT([no])
142772b4363aSmrg		PKG_CONFIG=""
142872b4363aSmrg	fi
142972b4363aSmrg		
143072b4363aSmrgfi[]dnl
143172b4363aSmrg])# PKG_PROG_PKG_CONFIG
143272b4363aSmrg
143372b4363aSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
143472b4363aSmrg#
143572b4363aSmrg# Check to see whether a particular set of modules exists.  Similar
143672b4363aSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
143772b4363aSmrg#
143872b4363aSmrg#
143972b4363aSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
144072b4363aSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
144172b4363aSmrg# PKG_CHECK_EXISTS manually
144272b4363aSmrg# --------------------------------------------------------------
144372b4363aSmrgAC_DEFUN([PKG_CHECK_EXISTS],
144472b4363aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
144572b4363aSmrgif test -n "$PKG_CONFIG" && \
144672b4363aSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
144772b4363aSmrg  m4_ifval([$2], [$2], [:])
144872b4363aSmrgm4_ifvaln([$3], [else
144972b4363aSmrg  $3])dnl
145072b4363aSmrgfi])
145172b4363aSmrg
145272b4363aSmrg
145372b4363aSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
145472b4363aSmrg# ---------------------------------------------
145572b4363aSmrgm4_define([_PKG_CONFIG],
145672b4363aSmrg[if test -n "$PKG_CONFIG"; then
145772b4363aSmrg        PKG_CHECK_EXISTS([$3],
145872b4363aSmrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
145972b4363aSmrg			 [pkg_failed=yes])
146072b4363aSmrgelse
146172b4363aSmrg	pkg_failed=untried
146272b4363aSmrgfi[]dnl
146372b4363aSmrg])# _PKG_CONFIG
146472b4363aSmrg
146572b4363aSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
146672b4363aSmrg# [ACTION-IF-NOT-FOUND])
146772b4363aSmrg#
146872b4363aSmrg#
146972b4363aSmrg# Note that if there is a possibility the first call to
147072b4363aSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
147172b4363aSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
147272b4363aSmrg#
147372b4363aSmrg#
147472b4363aSmrg# --------------------------------------------------------------
147572b4363aSmrgAC_DEFUN([PKG_CHECK_MODULES],
147672b4363aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
147772b4363aSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
147872b4363aSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
147972b4363aSmrg
148072b4363aSmrgpkg_failed=no
148172b4363aSmrgAC_MSG_CHECKING([for $1])
148272b4363aSmrg
148372b4363aSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
148472b4363aSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
148572b4363aSmrg
148672b4363aSmrgif test $pkg_failed = yes; then
148772b4363aSmrg	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
148872b4363aSmrg	# Put the nasty error message in config.log where it belongs
148972b4363aSmrg	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
149072b4363aSmrg
149172b4363aSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
149272b4363aSmrg[Package requirements ($2) were not met.
149372b4363aSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
149472b4363aSmrginstalled software in a non-standard prefix.
149572b4363aSmrg
149672b4363aSmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
149772b4363aSmrgto avoid the need to call pkg-config.  See the pkg-config man page for
149872b4363aSmrgmore details.])],
149972b4363aSmrg		[$4])
150072b4363aSmrgelif test $pkg_failed = untried; then
150172b4363aSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
150272b4363aSmrg[The pkg-config script could not be found or is too old.  Make sure it
150372b4363aSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
150472b4363aSmrgpath to pkg-config.
150572b4363aSmrg
150672b4363aSmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
150772b4363aSmrgto avoid the need to call pkg-config.  See the pkg-config man page for
150872b4363aSmrgmore details.
150972b4363aSmrg
151072b4363aSmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
151172b4363aSmrg		[$4])
151272b4363aSmrgelse
151372b4363aSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
151472b4363aSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
151572b4363aSmrg        AC_MSG_RESULT([yes])
151672b4363aSmrg	ifelse([$3], , :, [$3])
151772b4363aSmrgfi[]dnl
151872b4363aSmrg])# PKG_CHECK_MODULES
151972b4363aSmrg
1520