aclocal.m4 revision 29459361
129459361Smrg# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
229459361Smrg
329459361Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
429459361Smrg# 2005  Free Software Foundation, Inc.
529459361Smrg# This file is free software; the Free Software Foundation
629459361Smrg# gives unlimited permission to copy and/or distribute it,
729459361Smrg# with or without modifications, as long as this notice is preserved.
829459361Smrg
929459361Smrg# This program is distributed in the hope that it will be useful,
1029459361Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1129459361Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1229459361Smrg# PARTICULAR PURPOSE.
1329459361Smrg
1429459361Smrg# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
1529459361Smrg#
1629459361Smrg# This file is free software; the Free Software Foundation
1729459361Smrg# gives unlimited permission to copy and/or distribute it,
1829459361Smrg# with or without modifications, as long as this notice is preserved.
1929459361Smrg
2029459361Smrg# AM_AUTOMAKE_VERSION(VERSION)
2129459361Smrg# ----------------------------
2229459361Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
2329459361Smrg# generated from the m4 files accompanying Automake X.Y.
2429459361SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
2529459361Smrg
2629459361Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
2729459361Smrg# -------------------------------
2829459361Smrg# Call AM_AUTOMAKE_VERSION so it can be traced.
2929459361Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
3029459361SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
3129459361Smrg	 [AM_AUTOMAKE_VERSION([1.9.6])])
3229459361Smrg
3329459361Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
3429459361Smrg
3529459361Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
3629459361Smrg#
3729459361Smrg# This file is free software; the Free Software Foundation
3829459361Smrg# gives unlimited permission to copy and/or distribute it,
3929459361Smrg# with or without modifications, as long as this notice is preserved.
4029459361Smrg
4129459361Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
4229459361Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
4329459361Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
4429459361Smrg#
4529459361Smrg# Of course, Automake must honor this variable whenever it calls a
4629459361Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
4729459361Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
4829459361Smrg# depending on how configure is run.  This is pretty annoying, since
4929459361Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
5029459361Smrg# source directory, any form will work fine, but in subdirectories a
5129459361Smrg# relative path needs to be adjusted first.
5229459361Smrg#
5329459361Smrg# $ac_aux_dir/missing
5429459361Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
5529459361Smrg# $top_srcdir/$ac_aux_dir/missing
5629459361Smrg#    fails if $ac_aux_dir is absolute,
5729459361Smrg#    fails when called from a subdirectory in a VPATH build with
5829459361Smrg#          a relative $ac_aux_dir
5929459361Smrg#
6029459361Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
6129459361Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
6229459361Smrg# harmless because $srcdir is `.', but things will broke when you
6329459361Smrg# start a VPATH build or use an absolute $srcdir.
6429459361Smrg#
6529459361Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
6629459361Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
6729459361Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
6829459361Smrg# and then we would define $MISSING as
6929459361Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
7029459361Smrg# This will work as long as MISSING is not called from configure, because
7129459361Smrg# unfortunately $(top_srcdir) has no meaning in configure.
7229459361Smrg# However there are other variables, like CC, which are often used in
7329459361Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
7429459361Smrg#
7529459361Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
7629459361Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
7729459361Smrg# configured tree to be moved without reconfiguration.
7829459361Smrg
7929459361SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
8029459361Smrg[dnl Rely on autoconf to set up CDPATH properly.
8129459361SmrgAC_PREREQ([2.50])dnl
8229459361Smrg# expand $ac_aux_dir to an absolute path
8329459361Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
8429459361Smrg])
8529459361Smrg
8629459361Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
8729459361Smrg
8829459361Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
8929459361Smrg# Free Software Foundation, Inc.
9029459361Smrg#
9129459361Smrg# This file is free software; the Free Software Foundation
9229459361Smrg# gives unlimited permission to copy and/or distribute it,
9329459361Smrg# with or without modifications, as long as this notice is preserved.
9429459361Smrg
9529459361Smrg# serial 7
9629459361Smrg
9729459361Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
9829459361Smrg# -------------------------------------
9929459361Smrg# Define a conditional.
10029459361SmrgAC_DEFUN([AM_CONDITIONAL],
10129459361Smrg[AC_PREREQ(2.52)dnl
10229459361Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
10329459361Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
10429459361SmrgAC_SUBST([$1_TRUE])
10529459361SmrgAC_SUBST([$1_FALSE])
10629459361Smrgif $2; then
10729459361Smrg  $1_TRUE=
10829459361Smrg  $1_FALSE='#'
10929459361Smrgelse
11029459361Smrg  $1_TRUE='#'
11129459361Smrg  $1_FALSE=
11229459361Smrgfi
11329459361SmrgAC_CONFIG_COMMANDS_PRE(
11429459361Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
11529459361Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
11629459361SmrgUsually this means the macro was only invoked conditionally.]])
11729459361Smrgfi])])
11829459361Smrg
11929459361Smrg
12029459361Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
12129459361Smrg# Free Software Foundation, Inc.
12229459361Smrg#
12329459361Smrg# This file is free software; the Free Software Foundation
12429459361Smrg# gives unlimited permission to copy and/or distribute it,
12529459361Smrg# with or without modifications, as long as this notice is preserved.
12629459361Smrg
12729459361Smrg# serial 8
12829459361Smrg
12929459361Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
13029459361Smrg# written in clear, in which case automake, when reading aclocal.m4,
13129459361Smrg# will think it sees a *use*, and therefore will trigger all it's
13229459361Smrg# C support machinery.  Also note that it means that autoscan, seeing
13329459361Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
13429459361Smrg
13529459361Smrg
13629459361Smrg# _AM_DEPENDENCIES(NAME)
13729459361Smrg# ----------------------
13829459361Smrg# See how the compiler implements dependency checking.
13929459361Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
14029459361Smrg# We try a few techniques and use that to set a single cache variable.
14129459361Smrg#
14229459361Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
14329459361Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
14429459361Smrg# dependency, and given that the user is not expected to run this macro,
14529459361Smrg# just rely on AC_PROG_CC.
14629459361SmrgAC_DEFUN([_AM_DEPENDENCIES],
14729459361Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
14829459361SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
14929459361SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
15029459361SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
15129459361Smrg
15229459361Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
15329459361Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
15429459361Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
15529459361Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
15629459361Smrg                   [depcc="$$1"   am_compiler_list=])
15729459361Smrg
15829459361SmrgAC_CACHE_CHECK([dependency style of $depcc],
15929459361Smrg               [am_cv_$1_dependencies_compiler_type],
16029459361Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
16129459361Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
16229459361Smrg  # making bogus files that we don't know about and never remove.  For
16329459361Smrg  # instance it was reported that on HP-UX the gcc test will end up
16429459361Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
16529459361Smrg  # in D'.
16629459361Smrg  mkdir conftest.dir
16729459361Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
16829459361Smrg  # using a relative directory.
16929459361Smrg  cp "$am_depcomp" conftest.dir
17029459361Smrg  cd conftest.dir
17129459361Smrg  # We will build objects and dependencies in a subdirectory because
17229459361Smrg  # it helps to detect inapplicable dependency modes.  For instance
17329459361Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
17429459361Smrg  # side effect of compilation, but ICC will put the dependencies in
17529459361Smrg  # the current directory while Tru64 will put them in the object
17629459361Smrg  # directory.
17729459361Smrg  mkdir sub
17829459361Smrg
17929459361Smrg  am_cv_$1_dependencies_compiler_type=none
18029459361Smrg  if test "$am_compiler_list" = ""; then
18129459361Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
18229459361Smrg  fi
18329459361Smrg  for depmode in $am_compiler_list; do
18429459361Smrg    # Setup a source with many dependencies, because some compilers
18529459361Smrg    # like to wrap large dependency lists on column 80 (with \), and
18629459361Smrg    # we should not choose a depcomp mode which is confused by this.
18729459361Smrg    #
18829459361Smrg    # We need to recreate these files for each test, as the compiler may
18929459361Smrg    # overwrite some of them when testing with obscure command lines.
19029459361Smrg    # This happens at least with the AIX C compiler.
19129459361Smrg    : > sub/conftest.c
19229459361Smrg    for i in 1 2 3 4 5 6; do
19329459361Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
19429459361Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
19529459361Smrg      # Solaris 8's {/usr,}/bin/sh.
19629459361Smrg      touch sub/conftst$i.h
19729459361Smrg    done
19829459361Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
19929459361Smrg
20029459361Smrg    case $depmode in
20129459361Smrg    nosideeffect)
20229459361Smrg      # after this tag, mechanisms are not by side-effect, so they'll
20329459361Smrg      # only be used when explicitly requested
20429459361Smrg      if test "x$enable_dependency_tracking" = xyes; then
20529459361Smrg	continue
20629459361Smrg      else
20729459361Smrg	break
20829459361Smrg      fi
20929459361Smrg      ;;
21029459361Smrg    none) break ;;
21129459361Smrg    esac
21229459361Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
21329459361Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
21429459361Smrg    # handle `-M -o', and we need to detect this.
21529459361Smrg    if depmode=$depmode \
21629459361Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
21729459361Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
21829459361Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
21929459361Smrg         >/dev/null 2>conftest.err &&
22029459361Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
22129459361Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
22229459361Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
22329459361Smrg      # icc doesn't choke on unknown options, it will just issue warnings
22429459361Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
22529459361Smrg      # that says an option was ignored or not supported.
22629459361Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
22729459361Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
22829459361Smrg      # The diagnosis changed in icc 8.0:
22929459361Smrg      #   icc: Command line remark: option '-MP' not supported
23029459361Smrg      if (grep 'ignoring option' conftest.err ||
23129459361Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
23229459361Smrg        am_cv_$1_dependencies_compiler_type=$depmode
23329459361Smrg        break
23429459361Smrg      fi
23529459361Smrg    fi
23629459361Smrg  done
23729459361Smrg
23829459361Smrg  cd ..
23929459361Smrg  rm -rf conftest.dir
24029459361Smrgelse
24129459361Smrg  am_cv_$1_dependencies_compiler_type=none
24229459361Smrgfi
24329459361Smrg])
24429459361SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
24529459361SmrgAM_CONDITIONAL([am__fastdep$1], [
24629459361Smrg  test "x$enable_dependency_tracking" != xno \
24729459361Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
24829459361Smrg])
24929459361Smrg
25029459361Smrg
25129459361Smrg# AM_SET_DEPDIR
25229459361Smrg# -------------
25329459361Smrg# Choose a directory name for dependency files.
25429459361Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
25529459361SmrgAC_DEFUN([AM_SET_DEPDIR],
25629459361Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
25729459361SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
25829459361Smrg])
25929459361Smrg
26029459361Smrg
26129459361Smrg# AM_DEP_TRACK
26229459361Smrg# ------------
26329459361SmrgAC_DEFUN([AM_DEP_TRACK],
26429459361Smrg[AC_ARG_ENABLE(dependency-tracking,
26529459361Smrg[  --disable-dependency-tracking  speeds up one-time build
26629459361Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
26729459361Smrgif test "x$enable_dependency_tracking" != xno; then
26829459361Smrg  am_depcomp="$ac_aux_dir/depcomp"
26929459361Smrg  AMDEPBACKSLASH='\'
27029459361Smrgfi
27129459361SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
27229459361SmrgAC_SUBST([AMDEPBACKSLASH])
27329459361Smrg])
27429459361Smrg
27529459361Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
27629459361Smrg
27729459361Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
27829459361Smrg# Free Software Foundation, Inc.
27929459361Smrg#
28029459361Smrg# This file is free software; the Free Software Foundation
28129459361Smrg# gives unlimited permission to copy and/or distribute it,
28229459361Smrg# with or without modifications, as long as this notice is preserved.
28329459361Smrg
28429459361Smrg#serial 3
28529459361Smrg
28629459361Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
28729459361Smrg# ------------------------------
28829459361SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
28929459361Smrg[for mf in $CONFIG_FILES; do
29029459361Smrg  # Strip MF so we end up with the name of the file.
29129459361Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
29229459361Smrg  # Check whether this is an Automake generated Makefile or not.
29329459361Smrg  # We used to match only the files named `Makefile.in', but
29429459361Smrg  # some people rename them; so instead we look at the file content.
29529459361Smrg  # Grep'ing the first line is not enough: some people post-process
29629459361Smrg  # each Makefile.in and add a new line on top of each file to say so.
29729459361Smrg  # So let's grep whole file.
29829459361Smrg  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
29929459361Smrg    dirpart=`AS_DIRNAME("$mf")`
30029459361Smrg  else
30129459361Smrg    continue
30229459361Smrg  fi
30329459361Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
30429459361Smrg  # from the Makefile without running `make'.
30529459361Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
30629459361Smrg  test -z "$DEPDIR" && continue
30729459361Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
30829459361Smrg  test -z "am__include" && continue
30929459361Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
31029459361Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
31129459361Smrg  U=`sed -n 's/^U = //p' < "$mf"`
31229459361Smrg  # Find all dependency output files, they are included files with
31329459361Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
31429459361Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
31529459361Smrg  # expansion.
31629459361Smrg  for file in `sed -n "
31729459361Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
31829459361Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
31929459361Smrg    # Make sure the directory exists.
32029459361Smrg    test -f "$dirpart/$file" && continue
32129459361Smrg    fdir=`AS_DIRNAME(["$file"])`
32229459361Smrg    AS_MKDIR_P([$dirpart/$fdir])
32329459361Smrg    # echo "creating $dirpart/$file"
32429459361Smrg    echo '# dummy' > "$dirpart/$file"
32529459361Smrg  done
32629459361Smrgdone
32729459361Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
32829459361Smrg
32929459361Smrg
33029459361Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
33129459361Smrg# -----------------------------
33229459361Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
33329459361Smrg#
33429459361Smrg# This code is only required when automatic dependency tracking
33529459361Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
33629459361Smrg# need in order to bootstrap the dependency handling code.
33729459361SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
33829459361Smrg[AC_CONFIG_COMMANDS([depfiles],
33929459361Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
34029459361Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
34129459361Smrg])
34229459361Smrg
34329459361Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
34429459361Smrg# Free Software Foundation, Inc.
34529459361Smrg#
34629459361Smrg# This file is free software; the Free Software Foundation
34729459361Smrg# gives unlimited permission to copy and/or distribute it,
34829459361Smrg# with or without modifications, as long as this notice is preserved.
34929459361Smrg
35029459361Smrg# serial 8
35129459361Smrg
35229459361Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
35329459361SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
35429459361Smrg
35529459361Smrg# Do all the work for Automake.                             -*- Autoconf -*-
35629459361Smrg
35729459361Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
35829459361Smrg# Free Software Foundation, Inc.
35929459361Smrg#
36029459361Smrg# This file is free software; the Free Software Foundation
36129459361Smrg# gives unlimited permission to copy and/or distribute it,
36229459361Smrg# with or without modifications, as long as this notice is preserved.
36329459361Smrg
36429459361Smrg# serial 12
36529459361Smrg
36629459361Smrg# This macro actually does too much.  Some checks are only needed if
36729459361Smrg# your package does certain things.  But this isn't really a big deal.
36829459361Smrg
36929459361Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
37029459361Smrg# AM_INIT_AUTOMAKE([OPTIONS])
37129459361Smrg# -----------------------------------------------
37229459361Smrg# The call with PACKAGE and VERSION arguments is the old style
37329459361Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
37429459361Smrg# and VERSION should now be passed to AC_INIT and removed from
37529459361Smrg# the call to AM_INIT_AUTOMAKE.
37629459361Smrg# We support both call styles for the transition.  After
37729459361Smrg# the next Automake release, Autoconf can make the AC_INIT
37829459361Smrg# arguments mandatory, and then we can depend on a new Autoconf
37929459361Smrg# release and drop the old call support.
38029459361SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
38129459361Smrg[AC_PREREQ([2.58])dnl
38229459361Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
38329459361Smrgdnl the ones we care about.
38429459361Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
38529459361SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
38629459361SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
38729459361Smrg# test to see if srcdir already configured
38829459361Smrgif test "`cd $srcdir && pwd`" != "`pwd`" &&
38929459361Smrg   test -f $srcdir/config.status; then
39029459361Smrg  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
39129459361Smrgfi
39229459361Smrg
39329459361Smrg# test whether we have cygpath
39429459361Smrgif test -z "$CYGPATH_W"; then
39529459361Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
39629459361Smrg    CYGPATH_W='cygpath -w'
39729459361Smrg  else
39829459361Smrg    CYGPATH_W=echo
39929459361Smrg  fi
40029459361Smrgfi
40129459361SmrgAC_SUBST([CYGPATH_W])
40229459361Smrg
40329459361Smrg# Define the identity of the package.
40429459361Smrgdnl Distinguish between old-style and new-style calls.
40529459361Smrgm4_ifval([$2],
40629459361Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
40729459361Smrg AC_SUBST([PACKAGE], [$1])dnl
40829459361Smrg AC_SUBST([VERSION], [$2])],
40929459361Smrg[_AM_SET_OPTIONS([$1])dnl
41029459361Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
41129459361Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
41229459361Smrg
41329459361Smrg_AM_IF_OPTION([no-define],,
41429459361Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
41529459361Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
41629459361Smrg
41729459361Smrg# Some tools Automake needs.
41829459361SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
41929459361SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
42029459361SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
42129459361SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
42229459361SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
42329459361SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
42429459361SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
42529459361SmrgAM_PROG_INSTALL_SH
42629459361SmrgAM_PROG_INSTALL_STRIP
42729459361SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
42829459361Smrg# We need awk for the "check" target.  The system "awk" is bad on
42929459361Smrg# some platforms.
43029459361SmrgAC_REQUIRE([AC_PROG_AWK])dnl
43129459361SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
43229459361SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
43329459361Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
43429459361Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
43529459361Smrg	      		     [_AM_PROG_TAR([v7])])])
43629459361Smrg_AM_IF_OPTION([no-dependencies],,
43729459361Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
43829459361Smrg                  [_AM_DEPENDENCIES(CC)],
43929459361Smrg                  [define([AC_PROG_CC],
44029459361Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
44129459361SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
44229459361Smrg                  [_AM_DEPENDENCIES(CXX)],
44329459361Smrg                  [define([AC_PROG_CXX],
44429459361Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
44529459361Smrg])
44629459361Smrg])
44729459361Smrg
44829459361Smrg
44929459361Smrg# When config.status generates a header, we must update the stamp-h file.
45029459361Smrg# This file resides in the same directory as the config header
45129459361Smrg# that is generated.  The stamp files are numbered to have different names.
45229459361Smrg
45329459361Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
45429459361Smrg# loop where config.status creates the headers, so we can generate
45529459361Smrg# our stamp files there.
45629459361SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
45729459361Smrg[# Compute $1's index in $config_headers.
45829459361Smrg_am_stamp_count=1
45929459361Smrgfor _am_header in $config_headers :; do
46029459361Smrg  case $_am_header in
46129459361Smrg    $1 | $1:* )
46229459361Smrg      break ;;
46329459361Smrg    * )
46429459361Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
46529459361Smrg  esac
46629459361Smrgdone
46729459361Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
46829459361Smrg
46929459361Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
47029459361Smrg#
47129459361Smrg# This file is free software; the Free Software Foundation
47229459361Smrg# gives unlimited permission to copy and/or distribute it,
47329459361Smrg# with or without modifications, as long as this notice is preserved.
47429459361Smrg
47529459361Smrg# AM_PROG_INSTALL_SH
47629459361Smrg# ------------------
47729459361Smrg# Define $install_sh.
47829459361SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
47929459361Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
48029459361Smrginstall_sh=${install_sh-"$am_aux_dir/install-sh"}
48129459361SmrgAC_SUBST(install_sh)])
48229459361Smrg
48329459361Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
48429459361Smrg#
48529459361Smrg# This file is free software; the Free Software Foundation
48629459361Smrg# gives unlimited permission to copy and/or distribute it,
48729459361Smrg# with or without modifications, as long as this notice is preserved.
48829459361Smrg
48929459361Smrg# serial 2
49029459361Smrg
49129459361Smrg# Check whether the underlying file-system supports filenames
49229459361Smrg# with a leading dot.  For instance MS-DOS doesn't.
49329459361SmrgAC_DEFUN([AM_SET_LEADING_DOT],
49429459361Smrg[rm -rf .tst 2>/dev/null
49529459361Smrgmkdir .tst 2>/dev/null
49629459361Smrgif test -d .tst; then
49729459361Smrg  am__leading_dot=.
49829459361Smrgelse
49929459361Smrg  am__leading_dot=_
50029459361Smrgfi
50129459361Smrgrmdir .tst 2>/dev/null
50229459361SmrgAC_SUBST([am__leading_dot])])
50329459361Smrg
50429459361Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
50529459361Smrg# From Jim Meyering
50629459361Smrg
50729459361Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
50829459361Smrg# Free Software Foundation, Inc.
50929459361Smrg#
51029459361Smrg# This file is free software; the Free Software Foundation
51129459361Smrg# gives unlimited permission to copy and/or distribute it,
51229459361Smrg# with or without modifications, as long as this notice is preserved.
51329459361Smrg
51429459361Smrg# serial 4
51529459361Smrg
51629459361SmrgAC_DEFUN([AM_MAINTAINER_MODE],
51729459361Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
51829459361Smrg  dnl maintainer-mode is disabled by default
51929459361Smrg  AC_ARG_ENABLE(maintainer-mode,
52029459361Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
52129459361Smrg			  (and sometimes confusing) to the casual installer],
52229459361Smrg      USE_MAINTAINER_MODE=$enableval,
52329459361Smrg      USE_MAINTAINER_MODE=no)
52429459361Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
52529459361Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
52629459361Smrg  MAINT=$MAINTAINER_MODE_TRUE
52729459361Smrg  AC_SUBST(MAINT)dnl
52829459361Smrg]
52929459361Smrg)
53029459361Smrg
53129459361SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
53229459361Smrg
53329459361Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
53429459361Smrg
53529459361Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
53629459361Smrg#
53729459361Smrg# This file is free software; the Free Software Foundation
53829459361Smrg# gives unlimited permission to copy and/or distribute it,
53929459361Smrg# with or without modifications, as long as this notice is preserved.
54029459361Smrg
54129459361Smrg# serial 3
54229459361Smrg
54329459361Smrg# AM_MAKE_INCLUDE()
54429459361Smrg# -----------------
54529459361Smrg# Check to see how make treats includes.
54629459361SmrgAC_DEFUN([AM_MAKE_INCLUDE],
54729459361Smrg[am_make=${MAKE-make}
54829459361Smrgcat > confinc << 'END'
54929459361Smrgam__doit:
55029459361Smrg	@echo done
55129459361Smrg.PHONY: am__doit
55229459361SmrgEND
55329459361Smrg# If we don't find an include directive, just comment out the code.
55429459361SmrgAC_MSG_CHECKING([for style of include used by $am_make])
55529459361Smrgam__include="#"
55629459361Smrgam__quote=
55729459361Smrg_am_result=none
55829459361Smrg# First try GNU make style include.
55929459361Smrgecho "include confinc" > confmf
56029459361Smrg# We grep out `Entering directory' and `Leaving directory'
56129459361Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
56229459361Smrg# In particular we don't look at `^make:' because GNU make might
56329459361Smrg# be invoked under some other name (usually "gmake"), in which
56429459361Smrg# case it prints its new name instead of `make'.
56529459361Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
56629459361Smrg   am__include=include
56729459361Smrg   am__quote=
56829459361Smrg   _am_result=GNU
56929459361Smrgfi
57029459361Smrg# Now try BSD make style include.
57129459361Smrgif test "$am__include" = "#"; then
57229459361Smrg   echo '.include "confinc"' > confmf
57329459361Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
57429459361Smrg      am__include=.include
57529459361Smrg      am__quote="\""
57629459361Smrg      _am_result=BSD
57729459361Smrg   fi
57829459361Smrgfi
57929459361SmrgAC_SUBST([am__include])
58029459361SmrgAC_SUBST([am__quote])
58129459361SmrgAC_MSG_RESULT([$_am_result])
58229459361Smrgrm -f confinc confmf
58329459361Smrg])
58429459361Smrg
58529459361Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
58629459361Smrg
58729459361Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
58829459361Smrg# Free Software Foundation, Inc.
58929459361Smrg#
59029459361Smrg# This file is free software; the Free Software Foundation
59129459361Smrg# gives unlimited permission to copy and/or distribute it,
59229459361Smrg# with or without modifications, as long as this notice is preserved.
59329459361Smrg
59429459361Smrg# serial 4
59529459361Smrg
59629459361Smrg# AM_MISSING_PROG(NAME, PROGRAM)
59729459361Smrg# ------------------------------
59829459361SmrgAC_DEFUN([AM_MISSING_PROG],
59929459361Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
60029459361Smrg$1=${$1-"${am_missing_run}$2"}
60129459361SmrgAC_SUBST($1)])
60229459361Smrg
60329459361Smrg
60429459361Smrg# AM_MISSING_HAS_RUN
60529459361Smrg# ------------------
60629459361Smrg# Define MISSING if not defined so far and test if it supports --run.
60729459361Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
60829459361SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
60929459361Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
61029459361Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
61129459361Smrg# Use eval to expand $SHELL
61229459361Smrgif eval "$MISSING --run true"; then
61329459361Smrg  am_missing_run="$MISSING --run "
61429459361Smrgelse
61529459361Smrg  am_missing_run=
61629459361Smrg  AC_MSG_WARN([`missing' script is too old or missing])
61729459361Smrgfi
61829459361Smrg])
61929459361Smrg
62029459361Smrg# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
62129459361Smrg#
62229459361Smrg# This file is free software; the Free Software Foundation
62329459361Smrg# gives unlimited permission to copy and/or distribute it,
62429459361Smrg# with or without modifications, as long as this notice is preserved.
62529459361Smrg
62629459361Smrg# AM_PROG_MKDIR_P
62729459361Smrg# ---------------
62829459361Smrg# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
62929459361Smrg#
63029459361Smrg# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
63129459361Smrg# created by `make install' are always world readable, even if the
63229459361Smrg# installer happens to have an overly restrictive umask (e.g. 077).
63329459361Smrg# This was a mistake.  There are at least two reasons why we must not
63429459361Smrg# use `-m 0755':
63529459361Smrg#   - it causes special bits like SGID to be ignored,
63629459361Smrg#   - it may be too restrictive (some setups expect 775 directories).
63729459361Smrg#
63829459361Smrg# Do not use -m 0755 and let people choose whatever they expect by
63929459361Smrg# setting umask.
64029459361Smrg#
64129459361Smrg# We cannot accept any implementation of `mkdir' that recognizes `-p'.
64229459361Smrg# Some implementations (such as Solaris 8's) are not thread-safe: if a
64329459361Smrg# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
64429459361Smrg# concurrently, both version can detect that a/ is missing, but only
64529459361Smrg# one can create it and the other will error out.  Consequently we
64629459361Smrg# restrict ourselves to GNU make (using the --version option ensures
64729459361Smrg# this.)
64829459361SmrgAC_DEFUN([AM_PROG_MKDIR_P],
64929459361Smrg[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
65029459361Smrg  # We used to keeping the `.' as first argument, in order to
65129459361Smrg  # allow $(mkdir_p) to be used without argument.  As in
65229459361Smrg  #   $(mkdir_p) $(somedir)
65329459361Smrg  # where $(somedir) is conditionally defined.  However this is wrong
65429459361Smrg  # for two reasons:
65529459361Smrg  #  1. if the package is installed by a user who cannot write `.'
65629459361Smrg  #     make install will fail,
65729459361Smrg  #  2. the above comment should most certainly read
65829459361Smrg  #     $(mkdir_p) $(DESTDIR)$(somedir)
65929459361Smrg  #     so it does not work when $(somedir) is undefined and
66029459361Smrg  #     $(DESTDIR) is not.
66129459361Smrg  #  To support the latter case, we have to write
66229459361Smrg  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
66329459361Smrg  #  so the `.' trick is pointless.
66429459361Smrg  mkdir_p='mkdir -p --'
66529459361Smrgelse
66629459361Smrg  # On NextStep and OpenStep, the `mkdir' command does not
66729459361Smrg  # recognize any option.  It will interpret all options as
66829459361Smrg  # directories to create, and then abort because `.' already
66929459361Smrg  # exists.
67029459361Smrg  for d in ./-p ./--version;
67129459361Smrg  do
67229459361Smrg    test -d $d && rmdir $d
67329459361Smrg  done
67429459361Smrg  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
67529459361Smrg  if test -f "$ac_aux_dir/mkinstalldirs"; then
67629459361Smrg    mkdir_p='$(mkinstalldirs)'
67729459361Smrg  else
67829459361Smrg    mkdir_p='$(install_sh) -d'
67929459361Smrg  fi
68029459361Smrgfi
68129459361SmrgAC_SUBST([mkdir_p])])
68229459361Smrg
68329459361Smrg# Helper functions for option handling.                     -*- Autoconf -*-
68429459361Smrg
68529459361Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
68629459361Smrg#
68729459361Smrg# This file is free software; the Free Software Foundation
68829459361Smrg# gives unlimited permission to copy and/or distribute it,
68929459361Smrg# with or without modifications, as long as this notice is preserved.
69029459361Smrg
69129459361Smrg# serial 3
69229459361Smrg
69329459361Smrg# _AM_MANGLE_OPTION(NAME)
69429459361Smrg# -----------------------
69529459361SmrgAC_DEFUN([_AM_MANGLE_OPTION],
69629459361Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
69729459361Smrg
69829459361Smrg# _AM_SET_OPTION(NAME)
69929459361Smrg# ------------------------------
70029459361Smrg# Set option NAME.  Presently that only means defining a flag for this option.
70129459361SmrgAC_DEFUN([_AM_SET_OPTION],
70229459361Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
70329459361Smrg
70429459361Smrg# _AM_SET_OPTIONS(OPTIONS)
70529459361Smrg# ----------------------------------
70629459361Smrg# OPTIONS is a space-separated list of Automake options.
70729459361SmrgAC_DEFUN([_AM_SET_OPTIONS],
70829459361Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
70929459361Smrg
71029459361Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
71129459361Smrg# -------------------------------------------
71229459361Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
71329459361SmrgAC_DEFUN([_AM_IF_OPTION],
71429459361Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
71529459361Smrg
71629459361Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
71729459361Smrg
71829459361Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
71929459361Smrg# Free Software Foundation, Inc.
72029459361Smrg#
72129459361Smrg# This file is free software; the Free Software Foundation
72229459361Smrg# gives unlimited permission to copy and/or distribute it,
72329459361Smrg# with or without modifications, as long as this notice is preserved.
72429459361Smrg
72529459361Smrg# serial 4
72629459361Smrg
72729459361Smrg# AM_SANITY_CHECK
72829459361Smrg# ---------------
72929459361SmrgAC_DEFUN([AM_SANITY_CHECK],
73029459361Smrg[AC_MSG_CHECKING([whether build environment is sane])
73129459361Smrg# Just in case
73229459361Smrgsleep 1
73329459361Smrgecho timestamp > conftest.file
73429459361Smrg# Do `set' in a subshell so we don't clobber the current shell's
73529459361Smrg# arguments.  Must try -L first in case configure is actually a
73629459361Smrg# symlink; some systems play weird games with the mod time of symlinks
73729459361Smrg# (eg FreeBSD returns the mod time of the symlink's containing
73829459361Smrg# directory).
73929459361Smrgif (
74029459361Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
74129459361Smrg   if test "$[*]" = "X"; then
74229459361Smrg      # -L didn't work.
74329459361Smrg      set X `ls -t $srcdir/configure conftest.file`
74429459361Smrg   fi
74529459361Smrg   rm -f conftest.file
74629459361Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
74729459361Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
74829459361Smrg
74929459361Smrg      # If neither matched, then we have a broken ls.  This can happen
75029459361Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
75129459361Smrg      # broken ls alias from the environment.  This has actually
75229459361Smrg      # happened.  Such a system could not be considered "sane".
75329459361Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
75429459361Smrgalias in your environment])
75529459361Smrg   fi
75629459361Smrg
75729459361Smrg   test "$[2]" = conftest.file
75829459361Smrg   )
75929459361Smrgthen
76029459361Smrg   # Ok.
76129459361Smrg   :
76229459361Smrgelse
76329459361Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
76429459361SmrgCheck your system clock])
76529459361Smrgfi
76629459361SmrgAC_MSG_RESULT(yes)])
76729459361Smrg
76829459361Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
76929459361Smrg#
77029459361Smrg# This file is free software; the Free Software Foundation
77129459361Smrg# gives unlimited permission to copy and/or distribute it,
77229459361Smrg# with or without modifications, as long as this notice is preserved.
77329459361Smrg
77429459361Smrg# AM_PROG_INSTALL_STRIP
77529459361Smrg# ---------------------
77629459361Smrg# One issue with vendor `install' (even GNU) is that you can't
77729459361Smrg# specify the program used to strip binaries.  This is especially
77829459361Smrg# annoying in cross-compiling environments, where the build's strip
77929459361Smrg# is unlikely to handle the host's binaries.
78029459361Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
78129459361Smrg# always use install-sh in `make install-strip', and initialize
78229459361Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
78329459361SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
78429459361Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
78529459361Smrg# Installed binaries are usually stripped using `strip' when the user
78629459361Smrg# run `make install-strip'.  However `strip' might not be the right
78729459361Smrg# tool to use in cross-compilation environments, therefore Automake
78829459361Smrg# will honor the `STRIP' environment variable to overrule this program.
78929459361Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
79029459361Smrgif test "$cross_compiling" != no; then
79129459361Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
79229459361Smrgfi
79329459361SmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
79429459361SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
79529459361Smrg
79629459361Smrg# Check how to create a tarball.                            -*- Autoconf -*-
79729459361Smrg
79829459361Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
79929459361Smrg#
80029459361Smrg# This file is free software; the Free Software Foundation
80129459361Smrg# gives unlimited permission to copy and/or distribute it,
80229459361Smrg# with or without modifications, as long as this notice is preserved.
80329459361Smrg
80429459361Smrg# serial 2
80529459361Smrg
80629459361Smrg# _AM_PROG_TAR(FORMAT)
80729459361Smrg# --------------------
80829459361Smrg# Check how to create a tarball in format FORMAT.
80929459361Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
81029459361Smrg#
81129459361Smrg# Substitute a variable $(am__tar) that is a command
81229459361Smrg# writing to stdout a FORMAT-tarball containing the directory
81329459361Smrg# $tardir.
81429459361Smrg#     tardir=directory && $(am__tar) > result.tar
81529459361Smrg#
81629459361Smrg# Substitute a variable $(am__untar) that extract such
81729459361Smrg# a tarball read from stdin.
81829459361Smrg#     $(am__untar) < result.tar
81929459361SmrgAC_DEFUN([_AM_PROG_TAR],
82029459361Smrg[# Always define AMTAR for backward compatibility.
82129459361SmrgAM_MISSING_PROG([AMTAR], [tar])
82229459361Smrgm4_if([$1], [v7],
82329459361Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
82429459361Smrg     [m4_case([$1], [ustar],, [pax],,
82529459361Smrg              [m4_fatal([Unknown tar format])])
82629459361SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
82729459361Smrg# Loop over all known methods to create a tar archive until one works.
82829459361Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
82929459361Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
83029459361Smrg# Do not fold the above two line into one, because Tru64 sh and
83129459361Smrg# Solaris sh will not grok spaces in the rhs of `-'.
83229459361Smrgfor _am_tool in $_am_tools
83329459361Smrgdo
83429459361Smrg  case $_am_tool in
83529459361Smrg  gnutar)
83629459361Smrg    for _am_tar in tar gnutar gtar;
83729459361Smrg    do
83829459361Smrg      AM_RUN_LOG([$_am_tar --version]) && break
83929459361Smrg    done
84029459361Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
84129459361Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
84229459361Smrg    am__untar="$_am_tar -xf -"
84329459361Smrg    ;;
84429459361Smrg  plaintar)
84529459361Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
84629459361Smrg    # ustar tarball either.
84729459361Smrg    (tar --version) >/dev/null 2>&1 && continue
84829459361Smrg    am__tar='tar chf - "$$tardir"'
84929459361Smrg    am__tar_='tar chf - "$tardir"'
85029459361Smrg    am__untar='tar xf -'
85129459361Smrg    ;;
85229459361Smrg  pax)
85329459361Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
85429459361Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
85529459361Smrg    am__untar='pax -r'
85629459361Smrg    ;;
85729459361Smrg  cpio)
85829459361Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
85929459361Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
86029459361Smrg    am__untar='cpio -i -H $1 -d'
86129459361Smrg    ;;
86229459361Smrg  none)
86329459361Smrg    am__tar=false
86429459361Smrg    am__tar_=false
86529459361Smrg    am__untar=false
86629459361Smrg    ;;
86729459361Smrg  esac
86829459361Smrg
86929459361Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
87029459361Smrg  # and am__untar set.
87129459361Smrg  test -n "${am_cv_prog_tar_$1}" && break
87229459361Smrg
87329459361Smrg  # tar/untar a dummy directory, and stop if the command works
87429459361Smrg  rm -rf conftest.dir
87529459361Smrg  mkdir conftest.dir
87629459361Smrg  echo GrepMe > conftest.dir/file
87729459361Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
87829459361Smrg  rm -rf conftest.dir
87929459361Smrg  if test -s conftest.tar; then
88029459361Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
88129459361Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
88229459361Smrg  fi
88329459361Smrgdone
88429459361Smrgrm -rf conftest.dir
88529459361Smrg
88629459361SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
88729459361SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
88829459361SmrgAC_SUBST([am__tar])
88929459361SmrgAC_SUBST([am__untar])
89029459361Smrg]) # _AM_PROG_TAR
89129459361Smrg
89229459361Smrgdnl
89329459361Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
89429459361Smrgdnl 
89529459361Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
89629459361Smrgdnl copy of this software and associated documentation files (the
89729459361Smrgdnl "Software"), to deal in the Software without restriction, including
89829459361Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
89929459361Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
90029459361Smrgdnl to whom the Software is furnished to do so, provided that the above
90129459361Smrgdnl copyright notice(s) and this permission notice appear in all copies of
90229459361Smrgdnl the Software and that both the above copyright notice(s) and this
90329459361Smrgdnl permission notice appear in supporting documentation.
90429459361Smrgdnl
90529459361Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
90629459361Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
90729459361Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
90829459361Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
90929459361Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
91029459361Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
91129459361Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
91229459361Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
91329459361Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
91429459361Smrgdnl
91529459361Smrgdnl Except as contained in this notice, the name of a copyright holder
91629459361Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
91729459361Smrgdnl or other dealings in this Software without prior written authorization
91829459361Smrgdnl of the copyright holder.
91929459361Smrg
92029459361Smrg# XORG_MACROS_VERSION(required-version)
92129459361Smrg# -------------------------------------
92229459361Smrg# Minimum version: 1.1.0
92329459361Smrg#
92429459361Smrg# If you're using a macro added in Version 1.1 or newer, include this in
92529459361Smrg# your configure.ac with the minimum required version, such as:
92629459361Smrg# XORG_MACROS_VERSION(1.1)
92729459361Smrg#
92829459361Smrg# To force at least a version with this macro defined, also add:
92929459361Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
93029459361Smrg#
93129459361Smrg#
93229459361Smrg# See the "minimum version" comment for each macro you use to see what 
93329459361Smrg# version you require.
93429459361SmrgAC_DEFUN([XORG_MACROS_VERSION],[
93529459361Smrg	[XORG_MACROS_needed_version=$1
93629459361Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
93729459361Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
93829459361Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
93929459361Smrg	[XORG_MACROS_version=1.1.5
94029459361Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
94129459361Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
94229459361Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
94329459361Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
94429459361Smrg	fi
94529459361Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
94629459361Smrg		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])
94729459361Smrg	fi
94829459361Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
94929459361Smrg]) # XORG_MACROS_VERSION
95029459361Smrg
95129459361Smrg# XORG_PROG_RAWCPP()
95229459361Smrg# ------------------
95329459361Smrg# Minimum version: 1.0.0
95429459361Smrg#
95529459361Smrg# Find cpp program and necessary flags for use in pre-processing text files
95629459361Smrg# such as man pages and config files
95729459361SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
95829459361SmrgAC_REQUIRE([AC_PROG_CPP])
95929459361SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
96029459361Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
96129459361Smrg
96229459361Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
96329459361Smrg# which is not the best choice for supporting other OS'es, but covers most
96429459361Smrg# of the ones we need for now.
96529459361SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
96629459361SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
96729459361Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
96829459361Smrg	AC_MSG_RESULT([no])
96929459361Smrgelse
97029459361Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
97129459361Smrg		RAWCPPFLAGS=-undef
97229459361Smrg		AC_MSG_RESULT([yes])
97329459361Smrg	else
97429459361Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
97529459361Smrg	fi
97629459361Smrgfi
97729459361Smrgrm -f conftest.$ac_ext
97829459361Smrg
97929459361SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
98029459361SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
98129459361Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
98229459361Smrg	AC_MSG_RESULT([no])
98329459361Smrgelse
98429459361Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
98529459361Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
98629459361Smrg		AC_MSG_RESULT([yes])
98729459361Smrg	else
98829459361Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
98929459361Smrg	fi
99029459361Smrgfi
99129459361Smrgrm -f conftest.$ac_ext
99229459361SmrgAC_SUBST(RAWCPPFLAGS)
99329459361Smrg]) # XORG_PROG_RAWCPP
99429459361Smrg
99529459361Smrg# XORG_MANPAGE_SECTIONS()
99629459361Smrg# -----------------------
99729459361Smrg# Minimum version: 1.0.0
99829459361Smrg#
99929459361Smrg# Determine which sections man pages go in for the different man page types
100029459361Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
100129459361Smrg# Not sure if there's any better way than just hardcoding by OS name.
100229459361Smrg# Override default settings by setting environment variables
100329459361Smrg
100429459361SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
100529459361SmrgAC_REQUIRE([AC_CANONICAL_HOST])
100629459361Smrg
100729459361Smrgif test x$APP_MAN_SUFFIX = x    ; then
100829459361Smrg    APP_MAN_SUFFIX=1
100929459361Smrgfi
101029459361Smrgif test x$APP_MAN_DIR = x    ; then
101129459361Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
101229459361Smrgfi
101329459361Smrg
101429459361Smrgif test x$LIB_MAN_SUFFIX = x    ; then
101529459361Smrg    LIB_MAN_SUFFIX=3
101629459361Smrgfi
101729459361Smrgif test x$LIB_MAN_DIR = x    ; then
101829459361Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
101929459361Smrgfi
102029459361Smrg
102129459361Smrgif test x$FILE_MAN_SUFFIX = x    ; then
102229459361Smrg    case $host_os in
102329459361Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
102429459361Smrg	*)		FILE_MAN_SUFFIX=5  ;;
102529459361Smrg    esac
102629459361Smrgfi
102729459361Smrgif test x$FILE_MAN_DIR = x    ; then
102829459361Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
102929459361Smrgfi
103029459361Smrg
103129459361Smrgif test x$MISC_MAN_SUFFIX = x    ; then
103229459361Smrg    case $host_os in
103329459361Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
103429459361Smrg	*)		MISC_MAN_SUFFIX=7  ;;
103529459361Smrg    esac
103629459361Smrgfi
103729459361Smrgif test x$MISC_MAN_DIR = x    ; then
103829459361Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
103929459361Smrgfi
104029459361Smrg
104129459361Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
104229459361Smrg    case $host_os in
104329459361Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
104429459361Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
104529459361Smrg    esac
104629459361Smrgfi
104729459361Smrgif test x$DRIVER_MAN_DIR = x    ; then
104829459361Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
104929459361Smrgfi
105029459361Smrg
105129459361Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
105229459361Smrg    case $host_os in
105329459361Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
105429459361Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
105529459361Smrg    esac
105629459361Smrgfi
105729459361Smrgif test x$ADMIN_MAN_DIR = x    ; then
105829459361Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
105929459361Smrgfi
106029459361Smrg
106129459361Smrg
106229459361SmrgAC_SUBST([APP_MAN_SUFFIX])
106329459361SmrgAC_SUBST([LIB_MAN_SUFFIX])
106429459361SmrgAC_SUBST([FILE_MAN_SUFFIX])
106529459361SmrgAC_SUBST([MISC_MAN_SUFFIX])
106629459361SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
106729459361SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
106829459361SmrgAC_SUBST([APP_MAN_DIR])
106929459361SmrgAC_SUBST([LIB_MAN_DIR])
107029459361SmrgAC_SUBST([FILE_MAN_DIR])
107129459361SmrgAC_SUBST([MISC_MAN_DIR])
107229459361SmrgAC_SUBST([DRIVER_MAN_DIR])
107329459361SmrgAC_SUBST([ADMIN_MAN_DIR])
107429459361Smrg]) # XORG_MANPAGE_SECTIONS
107529459361Smrg
107629459361Smrg# XORG_CHECK_LINUXDOC
107729459361Smrg# -------------------
107829459361Smrg# Minimum version: 1.0.0
107929459361Smrg#
108029459361Smrg# Defines the variable MAKE_TEXT if the necessary tools and
108129459361Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
108229459361Smrg# Whether or not the necessary tools and files are found can be checked
108329459361Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
108429459361SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
108529459361SmrgXORG_SGML_PATH=$prefix/share/sgml
108629459361SmrgHAVE_DEFS_ENT=
108729459361Smrg
108829459361SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
108929459361Smrg
109029459361SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
109129459361SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
109229459361Smrg
109329459361SmrgAC_MSG_CHECKING([Whether to build documentation])
109429459361Smrg
109529459361Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
109629459361Smrg   BUILDDOC=yes
109729459361Smrgelse
109829459361Smrg   BUILDDOC=no
109929459361Smrgfi
110029459361Smrg
110129459361SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
110229459361Smrg
110329459361SmrgAC_MSG_RESULT([$BUILDDOC])
110429459361Smrg
110529459361SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
110629459361Smrg
110729459361Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
110829459361Smrg   BUILDPDFDOC=yes
110929459361Smrgelse
111029459361Smrg   BUILDPDFDOC=no
111129459361Smrgfi
111229459361Smrg
111329459361SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
111429459361Smrg
111529459361SmrgAC_MSG_RESULT([$BUILDPDFDOC])
111629459361Smrg
111729459361SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
111829459361SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
111929459361SmrgMAKE_PDF="$PS2PDF"
112029459361SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
112129459361Smrg
112229459361SmrgAC_SUBST(MAKE_TEXT)
112329459361SmrgAC_SUBST(MAKE_PS)
112429459361SmrgAC_SUBST(MAKE_PDF)
112529459361SmrgAC_SUBST(MAKE_HTML)
112629459361Smrg]) # XORG_CHECK_LINUXDOC
112729459361Smrg
112829459361Smrg# XORG_CHECK_DOCBOOK
112929459361Smrg# -------------------
113029459361Smrg# Minimum version: 1.0.0
113129459361Smrg#
113229459361Smrg# Checks for the ability to build output formats from SGML DocBook source.
113329459361Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
113429459361Smrg# indicates whether the necessary tools and files are found and, if set,
113529459361Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
113629459361SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
113729459361SmrgXORG_SGML_PATH=$prefix/share/sgml
113829459361SmrgHAVE_DEFS_ENT=
113929459361SmrgBUILDTXTDOC=no
114029459361SmrgBUILDPDFDOC=no
114129459361SmrgBUILDPSDOC=no
114229459361SmrgBUILDHTMLDOC=no
114329459361Smrg
114429459361SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
114529459361Smrg
114629459361SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
114729459361SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
114829459361SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
114929459361SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
115029459361Smrg
115129459361SmrgAC_MSG_CHECKING([Whether to build text documentation])
115229459361Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
115329459361Smrg   test x$BUILD_TXTDOC != xno; then
115429459361Smrg	BUILDTXTDOC=yes
115529459361Smrgfi
115629459361SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
115729459361SmrgAC_MSG_RESULT([$BUILDTXTDOC])
115829459361Smrg
115929459361SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
116029459361Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
116129459361Smrg   test x$BUILD_PDFDOC != xno; then
116229459361Smrg	BUILDPDFDOC=yes
116329459361Smrgfi
116429459361SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
116529459361SmrgAC_MSG_RESULT([$BUILDPDFDOC])
116629459361Smrg
116729459361SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
116829459361Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
116929459361Smrg   test x$BUILD_PSDOC != xno; then
117029459361Smrg	BUILDPSDOC=yes
117129459361Smrgfi
117229459361SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
117329459361SmrgAC_MSG_RESULT([$BUILDPSDOC])
117429459361Smrg
117529459361SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
117629459361Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
117729459361Smrg   test x$BUILD_HTMLDOC != xno; then
117829459361Smrg	BUILDHTMLDOC=yes
117929459361Smrgfi
118029459361SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
118129459361SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
118229459361Smrg
118329459361SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
118429459361SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
118529459361SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
118629459361SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
118729459361Smrg
118829459361SmrgAC_SUBST(MAKE_TEXT)
118929459361SmrgAC_SUBST(MAKE_PS)
119029459361SmrgAC_SUBST(MAKE_PDF)
119129459361SmrgAC_SUBST(MAKE_HTML)
119229459361Smrg]) # XORG_CHECK_DOCBOOK
119329459361Smrg
119429459361Smrg# XORG_CHECK_MALLOC_ZERO
119529459361Smrg# ----------------------
119629459361Smrg# Minimum version: 1.0.0
119729459361Smrg#
119829459361Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
119929459361Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
120029459361Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
120129459361SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
120229459361SmrgAC_ARG_ENABLE(malloc0returnsnull,
120329459361Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
120429459361Smrg		       [malloc(0) returns NULL (default: auto)]),
120529459361Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
120629459361Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
120729459361Smrg
120829459361SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
120929459361Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
121029459361Smrg	AC_RUN_IFELSE([
121129459361Smrgchar *malloc();
121229459361Smrgchar *realloc();
121329459361Smrgchar *calloc();
121429459361Smrgmain() {
121529459361Smrg    char *m0, *r0, *c0, *p;
121629459361Smrg    m0 = malloc(0);
121729459361Smrg    p = malloc(10);
121829459361Smrg    r0 = realloc(p,0);
121929459361Smrg    c0 = calloc(0);
122029459361Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
122129459361Smrg}],
122229459361Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
122329459361Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
122429459361Smrgfi
122529459361SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
122629459361Smrg
122729459361Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
122829459361Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
122929459361Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
123029459361Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
123129459361Smrgelse
123229459361Smrg	MALLOC_ZERO_CFLAGS=""
123329459361Smrg	XMALLOC_ZERO_CFLAGS=""
123429459361Smrg	XTMALLOC_ZERO_CFLAGS=""
123529459361Smrgfi
123629459361Smrg
123729459361SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
123829459361SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
123929459361SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
124029459361Smrg]) # XORG_CHECK_MALLOC_ZERO
124129459361Smrg
124229459361Smrg# XORG_WITH_LINT()
124329459361Smrg# ----------------
124429459361Smrg# Minimum version: 1.1.0
124529459361Smrg#
124629459361Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
124729459361Smrg# is specified.   (Use --with-lint=sparse for sparse.)
124829459361Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
124929459361Smrg# Sets $LINT_FLAGS to flags to pass to source checker
125029459361Smrg# Sets LINT automake conditional if enabled (default: disabled)
125129459361Smrg#
125229459361SmrgAC_DEFUN([XORG_WITH_LINT],[
125329459361Smrg
125429459361Smrg# Allow checking code with lint, sparse, etc.
125529459361SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
125629459361Smrg		[Use a lint-style source code checker (default: disabled)])],
125729459361Smrg		[use_lint=$withval], [use_lint=no])
125829459361Smrgif test "x$use_lint" = "xyes" ; then
125929459361Smrg	LINT="lint"
126029459361Smrgelse
126129459361Smrg	LINT="$use_lint"
126229459361Smrgfi
126329459361Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
126429459361Smrg    case $LINT in
126529459361Smrg	lint|*/lint)
126629459361Smrg	    case $host_os in
126729459361Smrg		solaris*)
126829459361Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
126929459361Smrg			;;
127029459361Smrg	    esac
127129459361Smrg	    ;;
127229459361Smrg    esac
127329459361Smrgfi
127429459361Smrg
127529459361SmrgAC_SUBST(LINT)
127629459361SmrgAC_SUBST(LINT_FLAGS)
127729459361SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
127829459361Smrg
127929459361Smrg]) # XORG_WITH_LINT
128029459361Smrg
128129459361Smrg# XORG_LINT_LIBRARY(LIBNAME)
128229459361Smrg# --------------------------
128329459361Smrg# Minimum version: 1.1.0
128429459361Smrg#
128529459361Smrg# Sets up flags for building lint libraries for checking programs that call
128629459361Smrg# functions in the library.
128729459361Smrg# Disabled by default, enable with --enable-lint-library
128829459361Smrg# Sets: 
128929459361Smrg#	@LINTLIB@		- name of lint library file to make
129029459361Smrg#	MAKE_LINT_LIB		- automake conditional
129129459361Smrg#
129229459361Smrg
129329459361SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
129429459361SmrgAC_REQUIRE([XORG_WITH_LINT])
129529459361Smrg# Build lint "library" for more indepth checks of programs calling this library
129629459361SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
129729459361Smrg	[Create lint library (default: disabled)])],
129829459361Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
129929459361Smrgif test "x$make_lint_lib" != "xno" ; then
130029459361Smrg	if test "x$LINT" = "xno" ; then
130129459361Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
130229459361Smrg	fi
130329459361Smrg	if test "x$make_lint_lib" = "xyes" ; then
130429459361Smrg		LINTLIB=llib-l$1.ln
130529459361Smrg	else
130629459361Smrg		LINTLIB=$make_lint_lib
130729459361Smrg	fi
130829459361Smrgfi
130929459361SmrgAC_SUBST(LINTLIB)
131029459361SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
131129459361Smrg
131229459361Smrg]) # XORG_LINT_LIBRARY
131329459361Smrg
131429459361Smrgdnl Copyright 2005 Red Hat, Inc
131529459361Smrgdnl
131629459361Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
131729459361Smrgdnl documentation for any purpose is hereby granted without fee, provided that
131829459361Smrgdnl the above copyright notice appear in all copies and that both that
131929459361Smrgdnl copyright notice and this permission notice appear in supporting
132029459361Smrgdnl documentation.
132129459361Smrgdnl
132229459361Smrgdnl The above copyright notice and this permission notice shall be included
132329459361Smrgdnl in all copies or substantial portions of the Software.
132429459361Smrgdnl
132529459361Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
132629459361Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
132729459361Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
132829459361Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
132929459361Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
133029459361Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
133129459361Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
133229459361Smrgdnl
133329459361Smrgdnl Except as contained in this notice, the name of the copyright holders shall
133429459361Smrgdnl not be used in advertising or otherwise to promote the sale, use or
133529459361Smrgdnl other dealings in this Software without prior written authorization
133629459361Smrgdnl from the copyright holders.
133729459361Smrgdnl
133829459361Smrg
133929459361Smrg# XORG_RELEASE_VERSION
134029459361Smrg# --------------------
134129459361Smrg# Adds --with/without-release-string and changes the PACKAGE and
134229459361Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
134329459361Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
134429459361Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
134529459361Smrg 
134629459361SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
134729459361Smrg	AC_ARG_WITH(release-version,
134829459361Smrg			AC_HELP_STRING([--with-release-version=STRING],
134929459361Smrg				[Use release version string in package name]),
135029459361Smrg			[RELEASE_VERSION="$withval"],
135129459361Smrg			[RELEASE_VERSION=""])
135229459361Smrg	if test "x$RELEASE_VERSION" != "x"; then
135329459361Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
135429459361Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
135529459361Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
135629459361Smrg	fi
135729459361Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
135829459361Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
135929459361Smrg		[Major version of this package])
136029459361Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2`
136129459361Smrg	if test "x$PVM" = "x"; then
136229459361Smrg		PVM="0"
136329459361Smrg	fi
136429459361Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
136529459361Smrg		[$PVM],
136629459361Smrg		[Minor version of this package])
136729459361Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3`
136829459361Smrg	if test "x$PVP" = "x"; then
136929459361Smrg		PVP="0"
137029459361Smrg	fi
137129459361Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
137229459361Smrg		[$PVP],
137329459361Smrg		[Patch version of this package])
137429459361Smrg])
137529459361Smrg
137629459361Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
137729459361Smrg# 
137829459361Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
137929459361Smrg#
138029459361Smrg# This program is free software; you can redistribute it and/or modify
138129459361Smrg# it under the terms of the GNU General Public License as published by
138229459361Smrg# the Free Software Foundation; either version 2 of the License, or
138329459361Smrg# (at your option) any later version.
138429459361Smrg#
138529459361Smrg# This program is distributed in the hope that it will be useful, but
138629459361Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
138729459361Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
138829459361Smrg# General Public License for more details.
138929459361Smrg#
139029459361Smrg# You should have received a copy of the GNU General Public License
139129459361Smrg# along with this program; if not, write to the Free Software
139229459361Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
139329459361Smrg#
139429459361Smrg# As a special exception to the GNU General Public License, if you
139529459361Smrg# distribute this file as part of a program that contains a
139629459361Smrg# configuration script generated by Autoconf, you may include it under
139729459361Smrg# the same distribution terms that you use for the rest of that program.
139829459361Smrg
139929459361Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
140029459361Smrg# ----------------------------------
140129459361SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
140229459361Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
140329459361Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
140429459361SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
140529459361Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
140629459361Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
140729459361Smrgfi
140829459361Smrgif test -n "$PKG_CONFIG"; then
140929459361Smrg	_pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
141029459361Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
141129459361Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
141229459361Smrg		AC_MSG_RESULT([yes])
141329459361Smrg	else
141429459361Smrg		AC_MSG_RESULT([no])
141529459361Smrg		PKG_CONFIG=""
141629459361Smrg	fi
141729459361Smrg		
141829459361Smrgfi[]dnl
141929459361Smrg])# PKG_PROG_PKG_CONFIG
142029459361Smrg
142129459361Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
142229459361Smrg#
142329459361Smrg# Check to see whether a particular set of modules exists.  Similar
142429459361Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
142529459361Smrg#
142629459361Smrg#
142729459361Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
142829459361Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
142929459361Smrg# PKG_CHECK_EXISTS manually
143029459361Smrg# --------------------------------------------------------------
143129459361SmrgAC_DEFUN([PKG_CHECK_EXISTS],
143229459361Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
143329459361Smrgif test -n "$PKG_CONFIG" && \
143429459361Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
143529459361Smrg  m4_ifval([$2], [$2], [:])
143629459361Smrgm4_ifvaln([$3], [else
143729459361Smrg  $3])dnl
143829459361Smrgfi])
143929459361Smrg
144029459361Smrg
144129459361Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
144229459361Smrg# ---------------------------------------------
144329459361Smrgm4_define([_PKG_CONFIG],
144429459361Smrg[if test -n "$PKG_CONFIG"; then
144529459361Smrg        PKG_CHECK_EXISTS([$3],
144629459361Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
144729459361Smrg			 [pkg_failed=yes])
144829459361Smrgelse
144929459361Smrg	pkg_failed=untried
145029459361Smrgfi[]dnl
145129459361Smrg])# _PKG_CONFIG
145229459361Smrg
145329459361Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
145429459361Smrg# [ACTION-IF-NOT-FOUND])
145529459361Smrg#
145629459361Smrg#
145729459361Smrg# Note that if there is a possibility the first call to
145829459361Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
145929459361Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
146029459361Smrg#
146129459361Smrg#
146229459361Smrg# --------------------------------------------------------------
146329459361SmrgAC_DEFUN([PKG_CHECK_MODULES],
146429459361Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
146529459361SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
146629459361SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
146729459361Smrg
146829459361Smrgpkg_failed=no
146929459361SmrgAC_MSG_CHECKING([for $1])
147029459361Smrg
147129459361Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
147229459361Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
147329459361Smrg
147429459361Smrgif test $pkg_failed = yes; then
147529459361Smrg	$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
147629459361Smrg	# Put the nasty error message in config.log where it belongs
147729459361Smrg	echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
147829459361Smrg
147929459361Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
148029459361Smrg[Package requirements ($2) were not met.
148129459361SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
148229459361Smrginstalled software in a non-standard prefix.
148329459361Smrg
148429459361SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
148529459361Smrgto avoid the need to call pkg-config.  See the pkg-config man page for
148629459361Smrgmore details.])],
148729459361Smrg		[$4])
148829459361Smrgelif test $pkg_failed = untried; then
148929459361Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
149029459361Smrg[The pkg-config script could not be found or is too old.  Make sure it
149129459361Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
149229459361Smrgpath to pkg-config.
149329459361Smrg
149429459361SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables
149529459361Smrgto avoid the need to call pkg-config.  See the pkg-config man page for
149629459361Smrgmore details.
149729459361Smrg
149829459361SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
149929459361Smrg		[$4])
150029459361Smrgelse
150129459361Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
150229459361Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
150329459361Smrg        AC_MSG_RESULT([yes])
150429459361Smrg	ifelse([$3], , :, [$3])
150529459361Smrgfi[]dnl
150629459361Smrg])# PKG_CHECK_MODULES
150729459361Smrg
1508