aclocal.m4 revision 5715adc0
15715adc0Smrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
229459361Smrg
329459361Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
45715adc0Smrg# 2005, 2006, 2007, 2008, 2009  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
145715adc0Smrgm4_ifndef([AC_AUTOCONF_VERSION],
155715adc0Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
165715adc0Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
175715adc0Smrg[m4_warning([this file was generated for autoconf 2.63.
185715adc0SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
195715adc0SmrgIf you have problems, you may need to regenerate the build system entirely.
205715adc0SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
215715adc0Smrg
225715adc0Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2329459361Smrg#
2429459361Smrg# This file is free software; the Free Software Foundation
2529459361Smrg# gives unlimited permission to copy and/or distribute it,
2629459361Smrg# with or without modifications, as long as this notice is preserved.
2729459361Smrg
2829459361Smrg# AM_AUTOMAKE_VERSION(VERSION)
2929459361Smrg# ----------------------------
3029459361Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3129459361Smrg# generated from the m4 files accompanying Automake X.Y.
325715adc0Smrg# (This private macro should not be called outside this file.)
335715adc0SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
345715adc0Smrg[am__api_version='1.11'
355715adc0Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
365715adc0Smrgdnl require some minimum version.  Point them to the right macro.
375715adc0Smrgm4_if([$1], [1.11], [],
385715adc0Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
395715adc0Smrg])
405715adc0Smrg
415715adc0Smrg# _AM_AUTOCONF_VERSION(VERSION)
425715adc0Smrg# -----------------------------
435715adc0Smrg# aclocal traces this macro to find the Autoconf version.
445715adc0Smrg# This is a private macro too.  Using m4_define simplifies
455715adc0Smrg# the logic in aclocal, which can simply ignore this definition.
465715adc0Smrgm4_define([_AM_AUTOCONF_VERSION], [])
4729459361Smrg
4829459361Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
4929459361Smrg# -------------------------------
505715adc0Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
515715adc0Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5229459361SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
535715adc0Smrg[AM_AUTOMAKE_VERSION([1.11])dnl
545715adc0Smrgm4_ifndef([AC_AUTOCONF_VERSION],
555715adc0Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
565715adc0Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5729459361Smrg
5829459361Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
5929459361Smrg
6029459361Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
6129459361Smrg#
6229459361Smrg# This file is free software; the Free Software Foundation
6329459361Smrg# gives unlimited permission to copy and/or distribute it,
6429459361Smrg# with or without modifications, as long as this notice is preserved.
6529459361Smrg
6629459361Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6729459361Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
6829459361Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
6929459361Smrg#
7029459361Smrg# Of course, Automake must honor this variable whenever it calls a
7129459361Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7229459361Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7329459361Smrg# depending on how configure is run.  This is pretty annoying, since
7429459361Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7529459361Smrg# source directory, any form will work fine, but in subdirectories a
7629459361Smrg# relative path needs to be adjusted first.
7729459361Smrg#
7829459361Smrg# $ac_aux_dir/missing
7929459361Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8029459361Smrg# $top_srcdir/$ac_aux_dir/missing
8129459361Smrg#    fails if $ac_aux_dir is absolute,
8229459361Smrg#    fails when called from a subdirectory in a VPATH build with
8329459361Smrg#          a relative $ac_aux_dir
8429459361Smrg#
8529459361Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8629459361Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
8729459361Smrg# harmless because $srcdir is `.', but things will broke when you
8829459361Smrg# start a VPATH build or use an absolute $srcdir.
8929459361Smrg#
9029459361Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9129459361Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9229459361Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9329459361Smrg# and then we would define $MISSING as
9429459361Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9529459361Smrg# This will work as long as MISSING is not called from configure, because
9629459361Smrg# unfortunately $(top_srcdir) has no meaning in configure.
9729459361Smrg# However there are other variables, like CC, which are often used in
9829459361Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9929459361Smrg#
10029459361Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
10129459361Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
10229459361Smrg# configured tree to be moved without reconfiguration.
10329459361Smrg
10429459361SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10529459361Smrg[dnl Rely on autoconf to set up CDPATH properly.
10629459361SmrgAC_PREREQ([2.50])dnl
10729459361Smrg# expand $ac_aux_dir to an absolute path
10829459361Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
10929459361Smrg])
11029459361Smrg
11129459361Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11229459361Smrg
1135715adc0Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
11429459361Smrg# Free Software Foundation, Inc.
11529459361Smrg#
11629459361Smrg# This file is free software; the Free Software Foundation
11729459361Smrg# gives unlimited permission to copy and/or distribute it,
11829459361Smrg# with or without modifications, as long as this notice is preserved.
11929459361Smrg
1205715adc0Smrg# serial 9
12129459361Smrg
12229459361Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12329459361Smrg# -------------------------------------
12429459361Smrg# Define a conditional.
12529459361SmrgAC_DEFUN([AM_CONDITIONAL],
12629459361Smrg[AC_PREREQ(2.52)dnl
12729459361Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12829459361Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1295715adc0SmrgAC_SUBST([$1_TRUE])dnl
1305715adc0SmrgAC_SUBST([$1_FALSE])dnl
1315715adc0Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1325715adc0Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1335715adc0Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13429459361Smrgif $2; then
13529459361Smrg  $1_TRUE=
13629459361Smrg  $1_FALSE='#'
13729459361Smrgelse
13829459361Smrg  $1_TRUE='#'
13929459361Smrg  $1_FALSE=
14029459361Smrgfi
14129459361SmrgAC_CONFIG_COMMANDS_PRE(
14229459361Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14329459361Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14429459361SmrgUsually this means the macro was only invoked conditionally.]])
14529459361Smrgfi])])
14629459361Smrg
1475715adc0Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
14829459361Smrg# Free Software Foundation, Inc.
14929459361Smrg#
15029459361Smrg# This file is free software; the Free Software Foundation
15129459361Smrg# gives unlimited permission to copy and/or distribute it,
15229459361Smrg# with or without modifications, as long as this notice is preserved.
15329459361Smrg
1545715adc0Smrg# serial 10
15529459361Smrg
15629459361Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
15729459361Smrg# written in clear, in which case automake, when reading aclocal.m4,
15829459361Smrg# will think it sees a *use*, and therefore will trigger all it's
15929459361Smrg# C support machinery.  Also note that it means that autoscan, seeing
16029459361Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
16129459361Smrg
16229459361Smrg
16329459361Smrg# _AM_DEPENDENCIES(NAME)
16429459361Smrg# ----------------------
16529459361Smrg# See how the compiler implements dependency checking.
16629459361Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
16729459361Smrg# We try a few techniques and use that to set a single cache variable.
16829459361Smrg#
16929459361Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
17029459361Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
17129459361Smrg# dependency, and given that the user is not expected to run this macro,
17229459361Smrg# just rely on AC_PROG_CC.
17329459361SmrgAC_DEFUN([_AM_DEPENDENCIES],
17429459361Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
17529459361SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
17629459361SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
17729459361SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
17829459361Smrg
17929459361Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
18029459361Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
18129459361Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1825715adc0Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
18329459361Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
18429459361Smrg                   [depcc="$$1"   am_compiler_list=])
18529459361Smrg
18629459361SmrgAC_CACHE_CHECK([dependency style of $depcc],
18729459361Smrg               [am_cv_$1_dependencies_compiler_type],
18829459361Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
18929459361Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
19029459361Smrg  # making bogus files that we don't know about and never remove.  For
19129459361Smrg  # instance it was reported that on HP-UX the gcc test will end up
19229459361Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
19329459361Smrg  # in D'.
19429459361Smrg  mkdir conftest.dir
19529459361Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19629459361Smrg  # using a relative directory.
19729459361Smrg  cp "$am_depcomp" conftest.dir
19829459361Smrg  cd conftest.dir
19929459361Smrg  # We will build objects and dependencies in a subdirectory because
20029459361Smrg  # it helps to detect inapplicable dependency modes.  For instance
20129459361Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
20229459361Smrg  # side effect of compilation, but ICC will put the dependencies in
20329459361Smrg  # the current directory while Tru64 will put them in the object
20429459361Smrg  # directory.
20529459361Smrg  mkdir sub
20629459361Smrg
20729459361Smrg  am_cv_$1_dependencies_compiler_type=none
20829459361Smrg  if test "$am_compiler_list" = ""; then
20929459361Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
21029459361Smrg  fi
2115715adc0Smrg  am__universal=false
2125715adc0Smrg  m4_case([$1], [CC],
2135715adc0Smrg    [case " $depcc " in #(
2145715adc0Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2155715adc0Smrg     esac],
2165715adc0Smrg    [CXX],
2175715adc0Smrg    [case " $depcc " in #(
2185715adc0Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2195715adc0Smrg     esac])
2205715adc0Smrg
22129459361Smrg  for depmode in $am_compiler_list; do
22229459361Smrg    # Setup a source with many dependencies, because some compilers
22329459361Smrg    # like to wrap large dependency lists on column 80 (with \), and
22429459361Smrg    # we should not choose a depcomp mode which is confused by this.
22529459361Smrg    #
22629459361Smrg    # We need to recreate these files for each test, as the compiler may
22729459361Smrg    # overwrite some of them when testing with obscure command lines.
22829459361Smrg    # This happens at least with the AIX C compiler.
22929459361Smrg    : > sub/conftest.c
23029459361Smrg    for i in 1 2 3 4 5 6; do
23129459361Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23229459361Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
23329459361Smrg      # Solaris 8's {/usr,}/bin/sh.
23429459361Smrg      touch sub/conftst$i.h
23529459361Smrg    done
23629459361Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
23729459361Smrg
2385715adc0Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
2395715adc0Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2405715adc0Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
2415715adc0Smrg    # versions had trouble with output in subdirs
2425715adc0Smrg    am__obj=sub/conftest.${OBJEXT-o}
2435715adc0Smrg    am__minus_obj="-o $am__obj"
24429459361Smrg    case $depmode in
2455715adc0Smrg    gcc)
2465715adc0Smrg      # This depmode causes a compiler race in universal mode.
2475715adc0Smrg      test "$am__universal" = false || continue
2485715adc0Smrg      ;;
24929459361Smrg    nosideeffect)
25029459361Smrg      # after this tag, mechanisms are not by side-effect, so they'll
25129459361Smrg      # only be used when explicitly requested
25229459361Smrg      if test "x$enable_dependency_tracking" = xyes; then
25329459361Smrg	continue
25429459361Smrg      else
25529459361Smrg	break
25629459361Smrg      fi
25729459361Smrg      ;;
2585715adc0Smrg    msvisualcpp | msvcmsys)
2595715adc0Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
2605715adc0Smrg      # not run yet.  These depmodes are late enough in the game, and
2615715adc0Smrg      # so weak that their functioning should not be impacted.
2625715adc0Smrg      am__obj=conftest.${OBJEXT-o}
2635715adc0Smrg      am__minus_obj=
2645715adc0Smrg      ;;
26529459361Smrg    none) break ;;
26629459361Smrg    esac
26729459361Smrg    if depmode=$depmode \
2685715adc0Smrg       source=sub/conftest.c object=$am__obj \
26929459361Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2705715adc0Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
27129459361Smrg         >/dev/null 2>conftest.err &&
2725715adc0Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
27329459361Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2745715adc0Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
27529459361Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
27629459361Smrg      # icc doesn't choke on unknown options, it will just issue warnings
27729459361Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
27829459361Smrg      # that says an option was ignored or not supported.
27929459361Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
28029459361Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
28129459361Smrg      # The diagnosis changed in icc 8.0:
28229459361Smrg      #   icc: Command line remark: option '-MP' not supported
28329459361Smrg      if (grep 'ignoring option' conftest.err ||
28429459361Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
28529459361Smrg        am_cv_$1_dependencies_compiler_type=$depmode
28629459361Smrg        break
28729459361Smrg      fi
28829459361Smrg    fi
28929459361Smrg  done
29029459361Smrg
29129459361Smrg  cd ..
29229459361Smrg  rm -rf conftest.dir
29329459361Smrgelse
29429459361Smrg  am_cv_$1_dependencies_compiler_type=none
29529459361Smrgfi
29629459361Smrg])
29729459361SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
29829459361SmrgAM_CONDITIONAL([am__fastdep$1], [
29929459361Smrg  test "x$enable_dependency_tracking" != xno \
30029459361Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
30129459361Smrg])
30229459361Smrg
30329459361Smrg
30429459361Smrg# AM_SET_DEPDIR
30529459361Smrg# -------------
30629459361Smrg# Choose a directory name for dependency files.
30729459361Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
30829459361SmrgAC_DEFUN([AM_SET_DEPDIR],
30929459361Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
31029459361SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
31129459361Smrg])
31229459361Smrg
31329459361Smrg
31429459361Smrg# AM_DEP_TRACK
31529459361Smrg# ------------
31629459361SmrgAC_DEFUN([AM_DEP_TRACK],
31729459361Smrg[AC_ARG_ENABLE(dependency-tracking,
31829459361Smrg[  --disable-dependency-tracking  speeds up one-time build
31929459361Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
32029459361Smrgif test "x$enable_dependency_tracking" != xno; then
32129459361Smrg  am_depcomp="$ac_aux_dir/depcomp"
32229459361Smrg  AMDEPBACKSLASH='\'
32329459361Smrgfi
32429459361SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3255715adc0SmrgAC_SUBST([AMDEPBACKSLASH])dnl
3265715adc0Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
32729459361Smrg])
32829459361Smrg
32929459361Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
33029459361Smrg
3315715adc0Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
33229459361Smrg# Free Software Foundation, Inc.
33329459361Smrg#
33429459361Smrg# This file is free software; the Free Software Foundation
33529459361Smrg# gives unlimited permission to copy and/or distribute it,
33629459361Smrg# with or without modifications, as long as this notice is preserved.
33729459361Smrg
3385715adc0Smrg#serial 5
33929459361Smrg
34029459361Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
34129459361Smrg# ------------------------------
34229459361SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3435715adc0Smrg[{
3445715adc0Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
3455715adc0Smrg  # are listed without --file.  Let's play safe and only enable the eval
3465715adc0Smrg  # if we detect the quoting.
3475715adc0Smrg  case $CONFIG_FILES in
3485715adc0Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
3495715adc0Smrg  *)   set x $CONFIG_FILES ;;
3505715adc0Smrg  esac
3515715adc0Smrg  shift
3525715adc0Smrg  for mf
3535715adc0Smrg  do
3545715adc0Smrg    # Strip MF so we end up with the name of the file.
3555715adc0Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3565715adc0Smrg    # Check whether this is an Automake generated Makefile or not.
3575715adc0Smrg    # We used to match only the files named `Makefile.in', but
3585715adc0Smrg    # some people rename them; so instead we look at the file content.
3595715adc0Smrg    # Grep'ing the first line is not enough: some people post-process
3605715adc0Smrg    # each Makefile.in and add a new line on top of each file to say so.
3615715adc0Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
3625715adc0Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
3635715adc0Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3645715adc0Smrg      dirpart=`AS_DIRNAME("$mf")`
3655715adc0Smrg    else
3665715adc0Smrg      continue
3675715adc0Smrg    fi
3685715adc0Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
3695715adc0Smrg    # from the Makefile without running `make'.
3705715adc0Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3715715adc0Smrg    test -z "$DEPDIR" && continue
3725715adc0Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3735715adc0Smrg    test -z "am__include" && continue
3745715adc0Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3755715adc0Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
3765715adc0Smrg    U=`sed -n 's/^U = //p' < "$mf"`
3775715adc0Smrg    # Find all dependency output files, they are included files with
3785715adc0Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3795715adc0Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3805715adc0Smrg    # expansion.
3815715adc0Smrg    for file in `sed -n "
3825715adc0Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3835715adc0Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3845715adc0Smrg      # Make sure the directory exists.
3855715adc0Smrg      test -f "$dirpart/$file" && continue
3865715adc0Smrg      fdir=`AS_DIRNAME(["$file"])`
3875715adc0Smrg      AS_MKDIR_P([$dirpart/$fdir])
3885715adc0Smrg      # echo "creating $dirpart/$file"
3895715adc0Smrg      echo '# dummy' > "$dirpart/$file"
3905715adc0Smrg    done
39129459361Smrg  done
3925715adc0Smrg}
39329459361Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
39429459361Smrg
39529459361Smrg
39629459361Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
39729459361Smrg# -----------------------------
39829459361Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
39929459361Smrg#
40029459361Smrg# This code is only required when automatic dependency tracking
40129459361Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
40229459361Smrg# need in order to bootstrap the dependency handling code.
40329459361SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
40429459361Smrg[AC_CONFIG_COMMANDS([depfiles],
40529459361Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
40629459361Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
40729459361Smrg])
40829459361Smrg
40929459361Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
41029459361Smrg# Free Software Foundation, Inc.
41129459361Smrg#
41229459361Smrg# This file is free software; the Free Software Foundation
41329459361Smrg# gives unlimited permission to copy and/or distribute it,
41429459361Smrg# with or without modifications, as long as this notice is preserved.
41529459361Smrg
41629459361Smrg# serial 8
41729459361Smrg
41829459361Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
41929459361SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
42029459361Smrg
42129459361Smrg# Do all the work for Automake.                             -*- Autoconf -*-
42229459361Smrg
4235715adc0Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4245715adc0Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
42529459361Smrg#
42629459361Smrg# This file is free software; the Free Software Foundation
42729459361Smrg# gives unlimited permission to copy and/or distribute it,
42829459361Smrg# with or without modifications, as long as this notice is preserved.
42929459361Smrg
4305715adc0Smrg# serial 16
43129459361Smrg
43229459361Smrg# This macro actually does too much.  Some checks are only needed if
43329459361Smrg# your package does certain things.  But this isn't really a big deal.
43429459361Smrg
43529459361Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
43629459361Smrg# AM_INIT_AUTOMAKE([OPTIONS])
43729459361Smrg# -----------------------------------------------
43829459361Smrg# The call with PACKAGE and VERSION arguments is the old style
43929459361Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
44029459361Smrg# and VERSION should now be passed to AC_INIT and removed from
44129459361Smrg# the call to AM_INIT_AUTOMAKE.
44229459361Smrg# We support both call styles for the transition.  After
44329459361Smrg# the next Automake release, Autoconf can make the AC_INIT
44429459361Smrg# arguments mandatory, and then we can depend on a new Autoconf
44529459361Smrg# release and drop the old call support.
44629459361SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4475715adc0Smrg[AC_PREREQ([2.62])dnl
44829459361Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
44929459361Smrgdnl the ones we care about.
45029459361Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
45129459361SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
45229459361SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4535715adc0Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4545715adc0Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4555715adc0Smrg  # is not polluted with repeated "-I."
4565715adc0Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4575715adc0Smrg  # test to see if srcdir already configured
4585715adc0Smrg  if test -f $srcdir/config.status; then
4595715adc0Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4605715adc0Smrg  fi
46129459361Smrgfi
46229459361Smrg
46329459361Smrg# test whether we have cygpath
46429459361Smrgif test -z "$CYGPATH_W"; then
46529459361Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
46629459361Smrg    CYGPATH_W='cygpath -w'
46729459361Smrg  else
46829459361Smrg    CYGPATH_W=echo
46929459361Smrg  fi
47029459361Smrgfi
47129459361SmrgAC_SUBST([CYGPATH_W])
47229459361Smrg
47329459361Smrg# Define the identity of the package.
47429459361Smrgdnl Distinguish between old-style and new-style calls.
47529459361Smrgm4_ifval([$2],
47629459361Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
47729459361Smrg AC_SUBST([PACKAGE], [$1])dnl
47829459361Smrg AC_SUBST([VERSION], [$2])],
47929459361Smrg[_AM_SET_OPTIONS([$1])dnl
4805715adc0Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4815715adc0Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4825715adc0Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
48329459361Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
48429459361Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
48529459361Smrg
48629459361Smrg_AM_IF_OPTION([no-define],,
48729459361Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
48829459361Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
48929459361Smrg
49029459361Smrg# Some tools Automake needs.
49129459361SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
49229459361SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
49329459361SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
49429459361SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
49529459361SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
49629459361SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
49729459361SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4985715adc0SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4995715adc0SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
50029459361SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
50129459361Smrg# We need awk for the "check" target.  The system "awk" is bad on
50229459361Smrg# some platforms.
50329459361SmrgAC_REQUIRE([AC_PROG_AWK])dnl
50429459361SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
50529459361SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
50629459361Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
5075715adc0Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
5085715adc0Smrg			     [_AM_PROG_TAR([v7])])])
50929459361Smrg_AM_IF_OPTION([no-dependencies],,
51029459361Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
5115715adc0Smrg		  [_AM_DEPENDENCIES(CC)],
5125715adc0Smrg		  [define([AC_PROG_CC],
5135715adc0Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
51429459361SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5155715adc0Smrg		  [_AM_DEPENDENCIES(CXX)],
5165715adc0Smrg		  [define([AC_PROG_CXX],
5175715adc0Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5185715adc0SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5195715adc0Smrg		  [_AM_DEPENDENCIES(OBJC)],
5205715adc0Smrg		  [define([AC_PROG_OBJC],
5215715adc0Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
52229459361Smrg])
5235715adc0Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5245715adc0Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5255715adc0Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5265715adc0Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5275715adc0SmrgAC_CONFIG_COMMANDS_PRE(dnl
5285715adc0Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5295715adc0Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
53029459361Smrg])
53129459361Smrg
5325715adc0Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5335715adc0Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5345715adc0Smrgdnl mangled by Autoconf and run in a shell conditional statement.
5355715adc0Smrgm4_define([_AC_COMPILER_EXEEXT],
5365715adc0Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5375715adc0Smrg
53829459361Smrg
53929459361Smrg# When config.status generates a header, we must update the stamp-h file.
54029459361Smrg# This file resides in the same directory as the config header
54129459361Smrg# that is generated.  The stamp files are numbered to have different names.
54229459361Smrg
54329459361Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
54429459361Smrg# loop where config.status creates the headers, so we can generate
54529459361Smrg# our stamp files there.
54629459361SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
54729459361Smrg[# Compute $1's index in $config_headers.
5485715adc0Smrg_am_arg=$1
54929459361Smrg_am_stamp_count=1
55029459361Smrgfor _am_header in $config_headers :; do
55129459361Smrg  case $_am_header in
5525715adc0Smrg    $_am_arg | $_am_arg:* )
55329459361Smrg      break ;;
55429459361Smrg    * )
55529459361Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
55629459361Smrg  esac
55729459361Smrgdone
5585715adc0Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
55929459361Smrg
5605715adc0Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
56129459361Smrg#
56229459361Smrg# This file is free software; the Free Software Foundation
56329459361Smrg# gives unlimited permission to copy and/or distribute it,
56429459361Smrg# with or without modifications, as long as this notice is preserved.
56529459361Smrg
56629459361Smrg# AM_PROG_INSTALL_SH
56729459361Smrg# ------------------
56829459361Smrg# Define $install_sh.
56929459361SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
57029459361Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5715715adc0Smrgif test x"${install_sh}" != xset; then
5725715adc0Smrg  case $am_aux_dir in
5735715adc0Smrg  *\ * | *\	*)
5745715adc0Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5755715adc0Smrg  *)
5765715adc0Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5775715adc0Smrg  esac
5785715adc0Smrgfi
57929459361SmrgAC_SUBST(install_sh)])
58029459361Smrg
58129459361Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
58229459361Smrg#
58329459361Smrg# This file is free software; the Free Software Foundation
58429459361Smrg# gives unlimited permission to copy and/or distribute it,
58529459361Smrg# with or without modifications, as long as this notice is preserved.
58629459361Smrg
58729459361Smrg# serial 2
58829459361Smrg
58929459361Smrg# Check whether the underlying file-system supports filenames
59029459361Smrg# with a leading dot.  For instance MS-DOS doesn't.
59129459361SmrgAC_DEFUN([AM_SET_LEADING_DOT],
59229459361Smrg[rm -rf .tst 2>/dev/null
59329459361Smrgmkdir .tst 2>/dev/null
59429459361Smrgif test -d .tst; then
59529459361Smrg  am__leading_dot=.
59629459361Smrgelse
59729459361Smrg  am__leading_dot=_
59829459361Smrgfi
59929459361Smrgrmdir .tst 2>/dev/null
60029459361SmrgAC_SUBST([am__leading_dot])])
60129459361Smrg
60229459361Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
60329459361Smrg# From Jim Meyering
60429459361Smrg
6055715adc0Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
60629459361Smrg# Free Software Foundation, Inc.
60729459361Smrg#
60829459361Smrg# This file is free software; the Free Software Foundation
60929459361Smrg# gives unlimited permission to copy and/or distribute it,
61029459361Smrg# with or without modifications, as long as this notice is preserved.
61129459361Smrg
6125715adc0Smrg# serial 5
61329459361Smrg
6145715adc0Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6155715adc0Smrg# ----------------------------------
6165715adc0Smrg# Control maintainer-specific portions of Makefiles.
6175715adc0Smrg# Default is to disable them, unless `enable' is passed literally.
6185715adc0Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6195715adc0Smrg# can override the default with the --enable/--disable switch.
62029459361SmrgAC_DEFUN([AM_MAINTAINER_MODE],
6215715adc0Smrg[m4_case(m4_default([$1], [disable]),
6225715adc0Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
6235715adc0Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
6245715adc0Smrg       [m4_define([am_maintainer_other], [enable])
6255715adc0Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6265715adc0SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6275715adc0Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6285715adc0Smrg  AC_ARG_ENABLE([maintainer-mode],
6295715adc0Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
63029459361Smrg			  (and sometimes confusing) to the casual installer],
6315715adc0Smrg      [USE_MAINTAINER_MODE=$enableval],
6325715adc0Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
63329459361Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6345715adc0Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
63529459361Smrg  MAINT=$MAINTAINER_MODE_TRUE
6365715adc0Smrg  AC_SUBST([MAINT])dnl
63729459361Smrg]
63829459361Smrg)
63929459361Smrg
64029459361SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
64129459361Smrg
64229459361Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
64329459361Smrg
6445715adc0Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
64529459361Smrg#
64629459361Smrg# This file is free software; the Free Software Foundation
64729459361Smrg# gives unlimited permission to copy and/or distribute it,
64829459361Smrg# with or without modifications, as long as this notice is preserved.
64929459361Smrg
6505715adc0Smrg# serial 4
65129459361Smrg
65229459361Smrg# AM_MAKE_INCLUDE()
65329459361Smrg# -----------------
65429459361Smrg# Check to see how make treats includes.
65529459361SmrgAC_DEFUN([AM_MAKE_INCLUDE],
65629459361Smrg[am_make=${MAKE-make}
65729459361Smrgcat > confinc << 'END'
65829459361Smrgam__doit:
6595715adc0Smrg	@echo this is the am__doit target
66029459361Smrg.PHONY: am__doit
66129459361SmrgEND
66229459361Smrg# If we don't find an include directive, just comment out the code.
66329459361SmrgAC_MSG_CHECKING([for style of include used by $am_make])
66429459361Smrgam__include="#"
66529459361Smrgam__quote=
66629459361Smrg_am_result=none
66729459361Smrg# First try GNU make style include.
66829459361Smrgecho "include confinc" > confmf
6695715adc0Smrg# Ignore all kinds of additional output from `make'.
6705715adc0Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6715715adc0Smrg*the\ am__doit\ target*)
6725715adc0Smrg  am__include=include
6735715adc0Smrg  am__quote=
6745715adc0Smrg  _am_result=GNU
6755715adc0Smrg  ;;
6765715adc0Smrgesac
67729459361Smrg# Now try BSD make style include.
67829459361Smrgif test "$am__include" = "#"; then
67929459361Smrg   echo '.include "confinc"' > confmf
6805715adc0Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6815715adc0Smrg   *the\ am__doit\ target*)
6825715adc0Smrg     am__include=.include
6835715adc0Smrg     am__quote="\""
6845715adc0Smrg     _am_result=BSD
6855715adc0Smrg     ;;
6865715adc0Smrg   esac
68729459361Smrgfi
68829459361SmrgAC_SUBST([am__include])
68929459361SmrgAC_SUBST([am__quote])
69029459361SmrgAC_MSG_RESULT([$_am_result])
69129459361Smrgrm -f confinc confmf
69229459361Smrg])
69329459361Smrg
69429459361Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
69529459361Smrg
6965715adc0Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
69729459361Smrg# Free Software Foundation, Inc.
69829459361Smrg#
69929459361Smrg# This file is free software; the Free Software Foundation
70029459361Smrg# gives unlimited permission to copy and/or distribute it,
70129459361Smrg# with or without modifications, as long as this notice is preserved.
70229459361Smrg
7035715adc0Smrg# serial 6
70429459361Smrg
70529459361Smrg# AM_MISSING_PROG(NAME, PROGRAM)
70629459361Smrg# ------------------------------
70729459361SmrgAC_DEFUN([AM_MISSING_PROG],
70829459361Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
70929459361Smrg$1=${$1-"${am_missing_run}$2"}
71029459361SmrgAC_SUBST($1)])
71129459361Smrg
71229459361Smrg
71329459361Smrg# AM_MISSING_HAS_RUN
71429459361Smrg# ------------------
71529459361Smrg# Define MISSING if not defined so far and test if it supports --run.
71629459361Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
71729459361SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
71829459361Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7195715adc0SmrgAC_REQUIRE_AUX_FILE([missing])dnl
7205715adc0Smrgif test x"${MISSING+set}" != xset; then
7215715adc0Smrg  case $am_aux_dir in
7225715adc0Smrg  *\ * | *\	*)
7235715adc0Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7245715adc0Smrg  *)
7255715adc0Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7265715adc0Smrg  esac
7275715adc0Smrgfi
72829459361Smrg# Use eval to expand $SHELL
72929459361Smrgif eval "$MISSING --run true"; then
73029459361Smrg  am_missing_run="$MISSING --run "
73129459361Smrgelse
73229459361Smrg  am_missing_run=
73329459361Smrg  AC_MSG_WARN([`missing' script is too old or missing])
73429459361Smrgfi
73529459361Smrg])
73629459361Smrg
7375715adc0Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
73829459361Smrg#
73929459361Smrg# This file is free software; the Free Software Foundation
74029459361Smrg# gives unlimited permission to copy and/or distribute it,
74129459361Smrg# with or without modifications, as long as this notice is preserved.
74229459361Smrg
74329459361Smrg# AM_PROG_MKDIR_P
74429459361Smrg# ---------------
7455715adc0Smrg# Check for `mkdir -p'.
74629459361SmrgAC_DEFUN([AM_PROG_MKDIR_P],
7475715adc0Smrg[AC_PREREQ([2.60])dnl
7485715adc0SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7495715adc0Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7505715adc0Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
7515715adc0Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7525715adc0Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7535715adc0Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7545715adc0Smrgdnl adjustment using top_builddir (which is defined more often than
7555715adc0Smrgdnl MKDIR_P).
7565715adc0SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7575715adc0Smrgcase $mkdir_p in
7585715adc0Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7595715adc0Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7605715adc0Smrgesac
7615715adc0Smrg])
76229459361Smrg
76329459361Smrg# Helper functions for option handling.                     -*- Autoconf -*-
76429459361Smrg
7655715adc0Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
76629459361Smrg#
76729459361Smrg# This file is free software; the Free Software Foundation
76829459361Smrg# gives unlimited permission to copy and/or distribute it,
76929459361Smrg# with or without modifications, as long as this notice is preserved.
77029459361Smrg
7715715adc0Smrg# serial 4
77229459361Smrg
77329459361Smrg# _AM_MANGLE_OPTION(NAME)
77429459361Smrg# -----------------------
77529459361SmrgAC_DEFUN([_AM_MANGLE_OPTION],
77629459361Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
77729459361Smrg
77829459361Smrg# _AM_SET_OPTION(NAME)
77929459361Smrg# ------------------------------
78029459361Smrg# Set option NAME.  Presently that only means defining a flag for this option.
78129459361SmrgAC_DEFUN([_AM_SET_OPTION],
78229459361Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
78329459361Smrg
78429459361Smrg# _AM_SET_OPTIONS(OPTIONS)
78529459361Smrg# ----------------------------------
78629459361Smrg# OPTIONS is a space-separated list of Automake options.
78729459361SmrgAC_DEFUN([_AM_SET_OPTIONS],
7885715adc0Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
78929459361Smrg
79029459361Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
79129459361Smrg# -------------------------------------------
79229459361Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
79329459361SmrgAC_DEFUN([_AM_IF_OPTION],
79429459361Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
79529459361Smrg
79629459361Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
79729459361Smrg
7985715adc0Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
79929459361Smrg# Free Software Foundation, Inc.
80029459361Smrg#
80129459361Smrg# This file is free software; the Free Software Foundation
80229459361Smrg# gives unlimited permission to copy and/or distribute it,
80329459361Smrg# with or without modifications, as long as this notice is preserved.
80429459361Smrg
8055715adc0Smrg# serial 5
80629459361Smrg
80729459361Smrg# AM_SANITY_CHECK
80829459361Smrg# ---------------
80929459361SmrgAC_DEFUN([AM_SANITY_CHECK],
81029459361Smrg[AC_MSG_CHECKING([whether build environment is sane])
81129459361Smrg# Just in case
81229459361Smrgsleep 1
81329459361Smrgecho timestamp > conftest.file
8145715adc0Smrg# Reject unsafe characters in $srcdir or the absolute working directory
8155715adc0Smrg# name.  Accept space and tab only in the latter.
8165715adc0Smrgam_lf='
8175715adc0Smrg'
8185715adc0Smrgcase `pwd` in
8195715adc0Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8205715adc0Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8215715adc0Smrgesac
8225715adc0Smrgcase $srcdir in
8235715adc0Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8245715adc0Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8255715adc0Smrgesac
8265715adc0Smrg
82729459361Smrg# Do `set' in a subshell so we don't clobber the current shell's
82829459361Smrg# arguments.  Must try -L first in case configure is actually a
82929459361Smrg# symlink; some systems play weird games with the mod time of symlinks
83029459361Smrg# (eg FreeBSD returns the mod time of the symlink's containing
83129459361Smrg# directory).
83229459361Smrgif (
8335715adc0Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
83429459361Smrg   if test "$[*]" = "X"; then
83529459361Smrg      # -L didn't work.
8365715adc0Smrg      set X `ls -t "$srcdir/configure" conftest.file`
83729459361Smrg   fi
83829459361Smrg   rm -f conftest.file
83929459361Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
84029459361Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
84129459361Smrg
84229459361Smrg      # If neither matched, then we have a broken ls.  This can happen
84329459361Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
84429459361Smrg      # broken ls alias from the environment.  This has actually
84529459361Smrg      # happened.  Such a system could not be considered "sane".
84629459361Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
84729459361Smrgalias in your environment])
84829459361Smrg   fi
84929459361Smrg
85029459361Smrg   test "$[2]" = conftest.file
85129459361Smrg   )
85229459361Smrgthen
85329459361Smrg   # Ok.
85429459361Smrg   :
85529459361Smrgelse
85629459361Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
85729459361SmrgCheck your system clock])
85829459361Smrgfi
85929459361SmrgAC_MSG_RESULT(yes)])
86029459361Smrg
8615715adc0Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
8625715adc0Smrg#
8635715adc0Smrg# This file is free software; the Free Software Foundation
8645715adc0Smrg# gives unlimited permission to copy and/or distribute it,
8655715adc0Smrg# with or without modifications, as long as this notice is preserved.
8665715adc0Smrg
8675715adc0Smrg# serial 1
8685715adc0Smrg
8695715adc0Smrg# AM_SILENT_RULES([DEFAULT])
8705715adc0Smrg# --------------------------
8715715adc0Smrg# Enable less verbose build rules; with the default set to DEFAULT
8725715adc0Smrg# (`yes' being less verbose, `no' or empty being verbose).
8735715adc0SmrgAC_DEFUN([AM_SILENT_RULES],
8745715adc0Smrg[AC_ARG_ENABLE([silent-rules],
8755715adc0Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8765715adc0Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8775715adc0Smrgcase $enable_silent_rules in
8785715adc0Smrgyes) AM_DEFAULT_VERBOSITY=0;;
8795715adc0Smrgno)  AM_DEFAULT_VERBOSITY=1;;
8805715adc0Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8815715adc0Smrgesac
8825715adc0SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8835715adc0SmrgAM_BACKSLASH='\'
8845715adc0SmrgAC_SUBST([AM_BACKSLASH])dnl
8855715adc0Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8865715adc0Smrg])
8875715adc0Smrg
88829459361Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
88929459361Smrg#
89029459361Smrg# This file is free software; the Free Software Foundation
89129459361Smrg# gives unlimited permission to copy and/or distribute it,
89229459361Smrg# with or without modifications, as long as this notice is preserved.
89329459361Smrg
89429459361Smrg# AM_PROG_INSTALL_STRIP
89529459361Smrg# ---------------------
89629459361Smrg# One issue with vendor `install' (even GNU) is that you can't
89729459361Smrg# specify the program used to strip binaries.  This is especially
89829459361Smrg# annoying in cross-compiling environments, where the build's strip
89929459361Smrg# is unlikely to handle the host's binaries.
90029459361Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
90129459361Smrg# always use install-sh in `make install-strip', and initialize
90229459361Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
90329459361SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
90429459361Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
90529459361Smrg# Installed binaries are usually stripped using `strip' when the user
90629459361Smrg# run `make install-strip'.  However `strip' might not be the right
90729459361Smrg# tool to use in cross-compilation environments, therefore Automake
90829459361Smrg# will honor the `STRIP' environment variable to overrule this program.
90929459361Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
91029459361Smrgif test "$cross_compiling" != no; then
91129459361Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
91229459361Smrgfi
9135715adc0SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
91429459361SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
91529459361Smrg
9165715adc0Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9175715adc0Smrg#
9185715adc0Smrg# This file is free software; the Free Software Foundation
9195715adc0Smrg# gives unlimited permission to copy and/or distribute it,
9205715adc0Smrg# with or without modifications, as long as this notice is preserved.
9215715adc0Smrg
9225715adc0Smrg# serial 2
9235715adc0Smrg
9245715adc0Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
9255715adc0Smrg# ---------------------------
9265715adc0Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9275715adc0Smrg# This macro is traced by Automake.
9285715adc0SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9295715adc0Smrg
9305715adc0Smrg# AM_SUBST_NOTMAKE(VARIABLE)
9315715adc0Smrg# ---------------------------
9325715adc0Smrg# Public sister of _AM_SUBST_NOTMAKE.
9335715adc0SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9345715adc0Smrg
93529459361Smrg# Check how to create a tarball.                            -*- Autoconf -*-
93629459361Smrg
93729459361Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
93829459361Smrg#
93929459361Smrg# This file is free software; the Free Software Foundation
94029459361Smrg# gives unlimited permission to copy and/or distribute it,
94129459361Smrg# with or without modifications, as long as this notice is preserved.
94229459361Smrg
94329459361Smrg# serial 2
94429459361Smrg
94529459361Smrg# _AM_PROG_TAR(FORMAT)
94629459361Smrg# --------------------
94729459361Smrg# Check how to create a tarball in format FORMAT.
94829459361Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
94929459361Smrg#
95029459361Smrg# Substitute a variable $(am__tar) that is a command
95129459361Smrg# writing to stdout a FORMAT-tarball containing the directory
95229459361Smrg# $tardir.
95329459361Smrg#     tardir=directory && $(am__tar) > result.tar
95429459361Smrg#
95529459361Smrg# Substitute a variable $(am__untar) that extract such
95629459361Smrg# a tarball read from stdin.
95729459361Smrg#     $(am__untar) < result.tar
95829459361SmrgAC_DEFUN([_AM_PROG_TAR],
95929459361Smrg[# Always define AMTAR for backward compatibility.
96029459361SmrgAM_MISSING_PROG([AMTAR], [tar])
96129459361Smrgm4_if([$1], [v7],
96229459361Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
96329459361Smrg     [m4_case([$1], [ustar],, [pax],,
96429459361Smrg              [m4_fatal([Unknown tar format])])
96529459361SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
96629459361Smrg# Loop over all known methods to create a tar archive until one works.
96729459361Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
96829459361Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
96929459361Smrg# Do not fold the above two line into one, because Tru64 sh and
97029459361Smrg# Solaris sh will not grok spaces in the rhs of `-'.
97129459361Smrgfor _am_tool in $_am_tools
97229459361Smrgdo
97329459361Smrg  case $_am_tool in
97429459361Smrg  gnutar)
97529459361Smrg    for _am_tar in tar gnutar gtar;
97629459361Smrg    do
97729459361Smrg      AM_RUN_LOG([$_am_tar --version]) && break
97829459361Smrg    done
97929459361Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
98029459361Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
98129459361Smrg    am__untar="$_am_tar -xf -"
98229459361Smrg    ;;
98329459361Smrg  plaintar)
98429459361Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
98529459361Smrg    # ustar tarball either.
98629459361Smrg    (tar --version) >/dev/null 2>&1 && continue
98729459361Smrg    am__tar='tar chf - "$$tardir"'
98829459361Smrg    am__tar_='tar chf - "$tardir"'
98929459361Smrg    am__untar='tar xf -'
99029459361Smrg    ;;
99129459361Smrg  pax)
99229459361Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
99329459361Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
99429459361Smrg    am__untar='pax -r'
99529459361Smrg    ;;
99629459361Smrg  cpio)
99729459361Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
99829459361Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
99929459361Smrg    am__untar='cpio -i -H $1 -d'
100029459361Smrg    ;;
100129459361Smrg  none)
100229459361Smrg    am__tar=false
100329459361Smrg    am__tar_=false
100429459361Smrg    am__untar=false
100529459361Smrg    ;;
100629459361Smrg  esac
100729459361Smrg
100829459361Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
100929459361Smrg  # and am__untar set.
101029459361Smrg  test -n "${am_cv_prog_tar_$1}" && break
101129459361Smrg
101229459361Smrg  # tar/untar a dummy directory, and stop if the command works
101329459361Smrg  rm -rf conftest.dir
101429459361Smrg  mkdir conftest.dir
101529459361Smrg  echo GrepMe > conftest.dir/file
101629459361Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
101729459361Smrg  rm -rf conftest.dir
101829459361Smrg  if test -s conftest.tar; then
101929459361Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
102029459361Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
102129459361Smrg  fi
102229459361Smrgdone
102329459361Smrgrm -rf conftest.dir
102429459361Smrg
102529459361SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
102629459361SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
102729459361SmrgAC_SUBST([am__tar])
102829459361SmrgAC_SUBST([am__untar])
102929459361Smrg]) # _AM_PROG_TAR
103029459361Smrg
10315715adc0Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
103229459361Smrgdnl
103329459361Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
103429459361Smrgdnl 
103529459361Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
103629459361Smrgdnl copy of this software and associated documentation files (the
103729459361Smrgdnl "Software"), to deal in the Software without restriction, including
103829459361Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
103929459361Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
104029459361Smrgdnl to whom the Software is furnished to do so, provided that the above
104129459361Smrgdnl copyright notice(s) and this permission notice appear in all copies of
104229459361Smrgdnl the Software and that both the above copyright notice(s) and this
104329459361Smrgdnl permission notice appear in supporting documentation.
104429459361Smrgdnl
104529459361Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
104629459361Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
104729459361Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
104829459361Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
104929459361Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
105029459361Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
105129459361Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
105229459361Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
105329459361Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
105429459361Smrgdnl
105529459361Smrgdnl Except as contained in this notice, the name of a copyright holder
105629459361Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
105729459361Smrgdnl or other dealings in this Software without prior written authorization
105829459361Smrgdnl of the copyright holder.
105929459361Smrg
106029459361Smrg# XORG_MACROS_VERSION(required-version)
106129459361Smrg# -------------------------------------
106229459361Smrg# Minimum version: 1.1.0
106329459361Smrg#
106429459361Smrg# If you're using a macro added in Version 1.1 or newer, include this in
106529459361Smrg# your configure.ac with the minimum required version, such as:
106629459361Smrg# XORG_MACROS_VERSION(1.1)
106729459361Smrg#
10685715adc0Smrg# To ensure that this macro is defined, also add:
10695715adc0Smrg# m4_ifndef([XORG_MACROS_VERSION],
10705715adc0Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
107129459361Smrg#
107229459361Smrg#
107329459361Smrg# See the "minimum version" comment for each macro you use to see what 
107429459361Smrg# version you require.
10755715adc0Smrgm4_defun([XORG_MACROS_VERSION],[
10765715adc0Smrgm4_define([vers_have], [1.3.0])
10775715adc0Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10785715adc0Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10795715adc0Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
10805715adc0Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
10815715adc0Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
10825715adc0Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
10835715adc0Smrgm4_undefine([vers_have])
10845715adc0Smrgm4_undefine([maj_have])
10855715adc0Smrgm4_undefine([maj_needed])
108629459361Smrg]) # XORG_MACROS_VERSION
108729459361Smrg
108829459361Smrg# XORG_PROG_RAWCPP()
108929459361Smrg# ------------------
109029459361Smrg# Minimum version: 1.0.0
109129459361Smrg#
109229459361Smrg# Find cpp program and necessary flags for use in pre-processing text files
109329459361Smrg# such as man pages and config files
109429459361SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
109529459361SmrgAC_REQUIRE([AC_PROG_CPP])
109629459361SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
109729459361Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
109829459361Smrg
109929459361Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
110029459361Smrg# which is not the best choice for supporting other OS'es, but covers most
110129459361Smrg# of the ones we need for now.
110229459361SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
110329459361SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
110429459361Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
110529459361Smrg	AC_MSG_RESULT([no])
110629459361Smrgelse
110729459361Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
110829459361Smrg		RAWCPPFLAGS=-undef
110929459361Smrg		AC_MSG_RESULT([yes])
11105715adc0Smrg	# under Cygwin unix is still defined even with -undef
11115715adc0Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
11125715adc0Smrg		RAWCPPFLAGS="-undef -ansi"
11135715adc0Smrg		AC_MSG_RESULT([yes, with -ansi])
111429459361Smrg	else
111529459361Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
111629459361Smrg	fi
111729459361Smrgfi
111829459361Smrgrm -f conftest.$ac_ext
111929459361Smrg
112029459361SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
112129459361SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
112229459361Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
112329459361Smrg	AC_MSG_RESULT([no])
112429459361Smrgelse
112529459361Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
112629459361Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
112729459361Smrg		AC_MSG_RESULT([yes])
112829459361Smrg	else
112929459361Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
113029459361Smrg	fi
113129459361Smrgfi
113229459361Smrgrm -f conftest.$ac_ext
113329459361SmrgAC_SUBST(RAWCPPFLAGS)
113429459361Smrg]) # XORG_PROG_RAWCPP
113529459361Smrg
113629459361Smrg# XORG_MANPAGE_SECTIONS()
113729459361Smrg# -----------------------
113829459361Smrg# Minimum version: 1.0.0
113929459361Smrg#
114029459361Smrg# Determine which sections man pages go in for the different man page types
114129459361Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
114229459361Smrg# Not sure if there's any better way than just hardcoding by OS name.
114329459361Smrg# Override default settings by setting environment variables
114429459361Smrg
114529459361SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
114629459361SmrgAC_REQUIRE([AC_CANONICAL_HOST])
114729459361Smrg
114829459361Smrgif test x$APP_MAN_SUFFIX = x    ; then
114929459361Smrg    APP_MAN_SUFFIX=1
115029459361Smrgfi
115129459361Smrgif test x$APP_MAN_DIR = x    ; then
115229459361Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
115329459361Smrgfi
115429459361Smrg
115529459361Smrgif test x$LIB_MAN_SUFFIX = x    ; then
115629459361Smrg    LIB_MAN_SUFFIX=3
115729459361Smrgfi
115829459361Smrgif test x$LIB_MAN_DIR = x    ; then
115929459361Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
116029459361Smrgfi
116129459361Smrg
116229459361Smrgif test x$FILE_MAN_SUFFIX = x    ; then
116329459361Smrg    case $host_os in
116429459361Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
116529459361Smrg	*)		FILE_MAN_SUFFIX=5  ;;
116629459361Smrg    esac
116729459361Smrgfi
116829459361Smrgif test x$FILE_MAN_DIR = x    ; then
116929459361Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
117029459361Smrgfi
117129459361Smrg
117229459361Smrgif test x$MISC_MAN_SUFFIX = x    ; then
117329459361Smrg    case $host_os in
117429459361Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
117529459361Smrg	*)		MISC_MAN_SUFFIX=7  ;;
117629459361Smrg    esac
117729459361Smrgfi
117829459361Smrgif test x$MISC_MAN_DIR = x    ; then
117929459361Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
118029459361Smrgfi
118129459361Smrg
118229459361Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
118329459361Smrg    case $host_os in
118429459361Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
118529459361Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
118629459361Smrg    esac
118729459361Smrgfi
118829459361Smrgif test x$DRIVER_MAN_DIR = x    ; then
118929459361Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
119029459361Smrgfi
119129459361Smrg
119229459361Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
119329459361Smrg    case $host_os in
119429459361Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
119529459361Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
119629459361Smrg    esac
119729459361Smrgfi
119829459361Smrgif test x$ADMIN_MAN_DIR = x    ; then
119929459361Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
120029459361Smrgfi
120129459361Smrg
120229459361Smrg
120329459361SmrgAC_SUBST([APP_MAN_SUFFIX])
120429459361SmrgAC_SUBST([LIB_MAN_SUFFIX])
120529459361SmrgAC_SUBST([FILE_MAN_SUFFIX])
120629459361SmrgAC_SUBST([MISC_MAN_SUFFIX])
120729459361SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
120829459361SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
120929459361SmrgAC_SUBST([APP_MAN_DIR])
121029459361SmrgAC_SUBST([LIB_MAN_DIR])
121129459361SmrgAC_SUBST([FILE_MAN_DIR])
121229459361SmrgAC_SUBST([MISC_MAN_DIR])
121329459361SmrgAC_SUBST([DRIVER_MAN_DIR])
121429459361SmrgAC_SUBST([ADMIN_MAN_DIR])
121529459361Smrg]) # XORG_MANPAGE_SECTIONS
121629459361Smrg
121729459361Smrg# XORG_CHECK_LINUXDOC
121829459361Smrg# -------------------
121929459361Smrg# Minimum version: 1.0.0
122029459361Smrg#
122129459361Smrg# Defines the variable MAKE_TEXT if the necessary tools and
122229459361Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
122329459361Smrg# Whether or not the necessary tools and files are found can be checked
122429459361Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
122529459361SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
12265715adc0Smrgif test x$XORG_SGML_PATH = x ; then
12275715adc0Smrg    XORG_SGML_PATH=$prefix/share/sgml
12285715adc0Smrgfi
122929459361SmrgHAVE_DEFS_ENT=
123029459361Smrg
12315715adc0Smrgif test x"$cross_compiling" = x"yes" ; then
12325715adc0Smrg  HAVE_DEFS_ENT=no
12335715adc0Smrgelse
12345715adc0Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
12355715adc0Smrgfi
123629459361Smrg
123729459361SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
123829459361SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
123929459361Smrg
124029459361SmrgAC_MSG_CHECKING([Whether to build documentation])
124129459361Smrg
124229459361Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
124329459361Smrg   BUILDDOC=yes
124429459361Smrgelse
124529459361Smrg   BUILDDOC=no
124629459361Smrgfi
124729459361Smrg
124829459361SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
124929459361Smrg
125029459361SmrgAC_MSG_RESULT([$BUILDDOC])
125129459361Smrg
125229459361SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
125329459361Smrg
125429459361Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
125529459361Smrg   BUILDPDFDOC=yes
125629459361Smrgelse
125729459361Smrg   BUILDPDFDOC=no
125829459361Smrgfi
125929459361Smrg
126029459361SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
126129459361Smrg
126229459361SmrgAC_MSG_RESULT([$BUILDPDFDOC])
126329459361Smrg
126429459361SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
126529459361SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
126629459361SmrgMAKE_PDF="$PS2PDF"
126729459361SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
126829459361Smrg
126929459361SmrgAC_SUBST(MAKE_TEXT)
127029459361SmrgAC_SUBST(MAKE_PS)
127129459361SmrgAC_SUBST(MAKE_PDF)
127229459361SmrgAC_SUBST(MAKE_HTML)
127329459361Smrg]) # XORG_CHECK_LINUXDOC
127429459361Smrg
127529459361Smrg# XORG_CHECK_DOCBOOK
127629459361Smrg# -------------------
127729459361Smrg# Minimum version: 1.0.0
127829459361Smrg#
127929459361Smrg# Checks for the ability to build output formats from SGML DocBook source.
128029459361Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
128129459361Smrg# indicates whether the necessary tools and files are found and, if set,
128229459361Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
128329459361SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
12845715adc0Smrgif test x$XORG_SGML_PATH = x ; then
12855715adc0Smrg    XORG_SGML_PATH=$prefix/share/sgml
12865715adc0Smrgfi
128729459361SmrgHAVE_DEFS_ENT=
128829459361SmrgBUILDTXTDOC=no
128929459361SmrgBUILDPDFDOC=no
129029459361SmrgBUILDPSDOC=no
129129459361SmrgBUILDHTMLDOC=no
129229459361Smrg
129329459361SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
129429459361Smrg
129529459361SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
129629459361SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
129729459361SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
129829459361SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
129929459361Smrg
130029459361SmrgAC_MSG_CHECKING([Whether to build text documentation])
130129459361Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
130229459361Smrg   test x$BUILD_TXTDOC != xno; then
130329459361Smrg	BUILDTXTDOC=yes
130429459361Smrgfi
130529459361SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
130629459361SmrgAC_MSG_RESULT([$BUILDTXTDOC])
130729459361Smrg
130829459361SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
130929459361Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
131029459361Smrg   test x$BUILD_PDFDOC != xno; then
131129459361Smrg	BUILDPDFDOC=yes
131229459361Smrgfi
131329459361SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
131429459361SmrgAC_MSG_RESULT([$BUILDPDFDOC])
131529459361Smrg
131629459361SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
131729459361Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
131829459361Smrg   test x$BUILD_PSDOC != xno; then
131929459361Smrg	BUILDPSDOC=yes
132029459361Smrgfi
132129459361SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
132229459361SmrgAC_MSG_RESULT([$BUILDPSDOC])
132329459361Smrg
132429459361SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
132529459361Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
132629459361Smrg   test x$BUILD_HTMLDOC != xno; then
132729459361Smrg	BUILDHTMLDOC=yes
132829459361Smrgfi
132929459361SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
133029459361SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
133129459361Smrg
133229459361SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
133329459361SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
133429459361SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
133529459361SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
133629459361Smrg
133729459361SmrgAC_SUBST(MAKE_TEXT)
133829459361SmrgAC_SUBST(MAKE_PS)
133929459361SmrgAC_SUBST(MAKE_PDF)
134029459361SmrgAC_SUBST(MAKE_HTML)
134129459361Smrg]) # XORG_CHECK_DOCBOOK
134229459361Smrg
134329459361Smrg# XORG_CHECK_MALLOC_ZERO
134429459361Smrg# ----------------------
134529459361Smrg# Minimum version: 1.0.0
134629459361Smrg#
134729459361Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
134829459361Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
134929459361Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
135029459361SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
135129459361SmrgAC_ARG_ENABLE(malloc0returnsnull,
13525715adc0Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
135329459361Smrg		       [malloc(0) returns NULL (default: auto)]),
135429459361Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
135529459361Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
135629459361Smrg
135729459361SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
135829459361Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
135929459361Smrg	AC_RUN_IFELSE([
136029459361Smrgchar *malloc();
136129459361Smrgchar *realloc();
136229459361Smrgchar *calloc();
136329459361Smrgmain() {
136429459361Smrg    char *m0, *r0, *c0, *p;
136529459361Smrg    m0 = malloc(0);
136629459361Smrg    p = malloc(10);
136729459361Smrg    r0 = realloc(p,0);
136829459361Smrg    c0 = calloc(0);
136929459361Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
137029459361Smrg}],
137129459361Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
137229459361Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
137329459361Smrgfi
137429459361SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
137529459361Smrg
137629459361Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
137729459361Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
137829459361Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
137929459361Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
138029459361Smrgelse
138129459361Smrg	MALLOC_ZERO_CFLAGS=""
138229459361Smrg	XMALLOC_ZERO_CFLAGS=""
138329459361Smrg	XTMALLOC_ZERO_CFLAGS=""
138429459361Smrgfi
138529459361Smrg
138629459361SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
138729459361SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
138829459361SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
138929459361Smrg]) # XORG_CHECK_MALLOC_ZERO
139029459361Smrg
139129459361Smrg# XORG_WITH_LINT()
139229459361Smrg# ----------------
139329459361Smrg# Minimum version: 1.1.0
139429459361Smrg#
139529459361Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
139629459361Smrg# is specified.   (Use --with-lint=sparse for sparse.)
139729459361Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
139829459361Smrg# Sets $LINT_FLAGS to flags to pass to source checker
139929459361Smrg# Sets LINT automake conditional if enabled (default: disabled)
140029459361Smrg#
140129459361SmrgAC_DEFUN([XORG_WITH_LINT],[
140229459361Smrg
140329459361Smrg# Allow checking code with lint, sparse, etc.
14045715adc0SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
140529459361Smrg		[Use a lint-style source code checker (default: disabled)])],
140629459361Smrg		[use_lint=$withval], [use_lint=no])
140729459361Smrgif test "x$use_lint" = "xyes" ; then
140829459361Smrg	LINT="lint"
140929459361Smrgelse
141029459361Smrg	LINT="$use_lint"
141129459361Smrgfi
141229459361Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
141329459361Smrg    case $LINT in
141429459361Smrg	lint|*/lint)
141529459361Smrg	    case $host_os in
141629459361Smrg		solaris*)
141729459361Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
141829459361Smrg			;;
141929459361Smrg	    esac
142029459361Smrg	    ;;
142129459361Smrg    esac
142229459361Smrgfi
142329459361Smrg
142429459361SmrgAC_SUBST(LINT)
142529459361SmrgAC_SUBST(LINT_FLAGS)
142629459361SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
142729459361Smrg
142829459361Smrg]) # XORG_WITH_LINT
142929459361Smrg
143029459361Smrg# XORG_LINT_LIBRARY(LIBNAME)
143129459361Smrg# --------------------------
143229459361Smrg# Minimum version: 1.1.0
143329459361Smrg#
143429459361Smrg# Sets up flags for building lint libraries for checking programs that call
143529459361Smrg# functions in the library.
143629459361Smrg# Disabled by default, enable with --enable-lint-library
143729459361Smrg# Sets: 
143829459361Smrg#	@LINTLIB@		- name of lint library file to make
143929459361Smrg#	MAKE_LINT_LIB		- automake conditional
144029459361Smrg#
144129459361Smrg
144229459361SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
144329459361SmrgAC_REQUIRE([XORG_WITH_LINT])
144429459361Smrg# Build lint "library" for more indepth checks of programs calling this library
14455715adc0SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
144629459361Smrg	[Create lint library (default: disabled)])],
144729459361Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
144829459361Smrgif test "x$make_lint_lib" != "xno" ; then
144929459361Smrg	if test "x$LINT" = "xno" ; then
145029459361Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
145129459361Smrg	fi
145229459361Smrg	if test "x$make_lint_lib" = "xyes" ; then
145329459361Smrg		LINTLIB=llib-l$1.ln
145429459361Smrg	else
145529459361Smrg		LINTLIB=$make_lint_lib
145629459361Smrg	fi
145729459361Smrgfi
145829459361SmrgAC_SUBST(LINTLIB)
145929459361SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
146029459361Smrg
146129459361Smrg]) # XORG_LINT_LIBRARY
146229459361Smrg
14635715adc0Smrg# XORG_CWARNFLAGS
14645715adc0Smrg# ---------------
14655715adc0Smrg# Minimum version: 1.2.0
14665715adc0Smrg#
14675715adc0Smrg# Defines CWARNFLAGS to enable C compiler warnings.
14685715adc0Smrg#
14695715adc0SmrgAC_DEFUN([XORG_CWARNFLAGS], [
14705715adc0SmrgAC_REQUIRE([AC_PROG_CC])
14715715adc0Smrgif  test "x$GCC" = xyes ; then
14725715adc0Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
14735715adc0Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
14745715adc0Smrg-Wbad-function-cast"
14755715adc0Smrg    case `$CC -dumpversion` in
14765715adc0Smrg    3.4.* | 4.*)
14775715adc0Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
14785715adc0Smrg	;;
14795715adc0Smrg    esac
14805715adc0Smrgelse
14815715adc0Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
14825715adc0Smrg    if test "x$SUNCC" = "xyes"; then
14835715adc0Smrg	CWARNFLAGS="-v"
14845715adc0Smrg    fi
14855715adc0Smrgfi
14865715adc0SmrgAC_SUBST(CWARNFLAGS)
14875715adc0Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
14885715adc0Smrg]) # XORG_CWARNFLAGS
14895715adc0Smrg
14905715adc0Smrg# XORG_STRICT_OPTION
14915715adc0Smrg# -----------------------
14925715adc0Smrg# Minimum version: 1.3.0
14935715adc0Smrg#
14945715adc0Smrg# Add configure option to enable strict compilation
14955715adc0SmrgAC_DEFUN([XORG_STRICT_OPTION], [
14965715adc0SmrgAC_REQUIRE([AC_PROG_CC])
14975715adc0SmrgAC_REQUIRE([AC_PROG_CC_C99])
14985715adc0SmrgAC_REQUIRE([XORG_CWARNFLAGS])
14995715adc0Smrg
15005715adc0SmrgAC_ARG_ENABLE(strict-compilation,
15015715adc0Smrg			  AS_HELP_STRING([--enable-strict-compilation],
15025715adc0Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
15035715adc0Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
15045715adc0Smrgif test "x$STRICT_COMPILE" = "xyes"; then
15055715adc0Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
15065715adc0Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
15075715adc0Smrg	if test "x$GCC" = xyes ; then
15085715adc0Smrg		STRICT_CFLAGS="-pedantic -Werror"
15095715adc0Smrg	elif test "x$SUNCC" = "xyes"; then
15105715adc0Smrg		STRICT_CFLAGS="-errwarn"
15115715adc0Smrg    elif test "x$INTELCC" = "xyes"; then
15125715adc0Smrg		STRICT_CFLAGS="-Werror"
15135715adc0Smrg	fi
15145715adc0Smrgfi
15155715adc0SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
15165715adc0SmrgAC_SUBST([CWARNFLAGS])
15175715adc0Smrg]) # XORG_STRICT_OPTION
15185715adc0Smrg
15195715adc0Smrg# XORG_DEFAULT_OPTIONS
15205715adc0Smrg# --------------------
15215715adc0Smrg# Minimum version: 1.3.0
15225715adc0Smrg#
15235715adc0Smrg# Defines default options for X.Org modules.
15245715adc0Smrg#
15255715adc0SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
15265715adc0SmrgXORG_CWARNFLAGS
15275715adc0SmrgXORG_STRICT_OPTION
15285715adc0SmrgXORG_RELEASE_VERSION
15295715adc0SmrgXORG_CHANGELOG
15305715adc0SmrgXORG_MANPAGE_SECTIONS
15315715adc0Smrg]) # XORG_DEFAULT_OPTIONS
153229459361Smrgdnl Copyright 2005 Red Hat, Inc
153329459361Smrgdnl
153429459361Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
153529459361Smrgdnl documentation for any purpose is hereby granted without fee, provided that
153629459361Smrgdnl the above copyright notice appear in all copies and that both that
153729459361Smrgdnl copyright notice and this permission notice appear in supporting
153829459361Smrgdnl documentation.
153929459361Smrgdnl
154029459361Smrgdnl The above copyright notice and this permission notice shall be included
154129459361Smrgdnl in all copies or substantial portions of the Software.
154229459361Smrgdnl
154329459361Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
154429459361Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
154529459361Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
154629459361Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
154729459361Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
154829459361Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
154929459361Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
155029459361Smrgdnl
155129459361Smrgdnl Except as contained in this notice, the name of the copyright holders shall
155229459361Smrgdnl not be used in advertising or otherwise to promote the sale, use or
155329459361Smrgdnl other dealings in this Software without prior written authorization
155429459361Smrgdnl from the copyright holders.
155529459361Smrgdnl
155629459361Smrg
155729459361Smrg# XORG_RELEASE_VERSION
155829459361Smrg# --------------------
155929459361Smrg# Adds --with/without-release-string and changes the PACKAGE and
156029459361Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
156129459361Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
156229459361Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
156329459361Smrg 
156429459361SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
156529459361Smrg	AC_ARG_WITH(release-version,
15665715adc0Smrg			AS_HELP_STRING([--with-release-version=STRING],
156729459361Smrg				[Use release version string in package name]),
156829459361Smrg			[RELEASE_VERSION="$withval"],
156929459361Smrg			[RELEASE_VERSION=""])
157029459361Smrg	if test "x$RELEASE_VERSION" != "x"; then
157129459361Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
157229459361Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
157329459361Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
157429459361Smrg	fi
157529459361Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
157629459361Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
157729459361Smrg		[Major version of this package])
15785715adc0Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
157929459361Smrg	if test "x$PVM" = "x"; then
158029459361Smrg		PVM="0"
158129459361Smrg	fi
158229459361Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
158329459361Smrg		[$PVM],
158429459361Smrg		[Minor version of this package])
15855715adc0Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
158629459361Smrg	if test "x$PVP" = "x"; then
158729459361Smrg		PVP="0"
158829459361Smrg	fi
158929459361Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
159029459361Smrg		[$PVP],
159129459361Smrg		[Patch version of this package])
159229459361Smrg])
159329459361Smrg
15945715adc0Smrg# XORG_CHANGELOG()
15955715adc0Smrg# ----------------
15965715adc0Smrg# Minimum version: 1.2.0
15975715adc0Smrg#
15985715adc0Smrg# Defines the variable CHANGELOG_CMD as the command to generate
15995715adc0Smrg# ChangeLog from git.
16005715adc0Smrg#
16015715adc0Smrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
16025715adc0Smrg#
16035715adc0SmrgAC_DEFUN([XORG_CHANGELOG], [
16045715adc0SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
16055715adc0Smrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
16065715adc0Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
16075715adc0SmrgAC_SUBST([CHANGELOG_CMD])
16085715adc0SmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
16095715adc0Smrg]) # XORG_CHANGELOG
16105715adc0Smrg
161129459361Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
161229459361Smrg# 
161329459361Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
161429459361Smrg#
161529459361Smrg# This program is free software; you can redistribute it and/or modify
161629459361Smrg# it under the terms of the GNU General Public License as published by
161729459361Smrg# the Free Software Foundation; either version 2 of the License, or
161829459361Smrg# (at your option) any later version.
161929459361Smrg#
162029459361Smrg# This program is distributed in the hope that it will be useful, but
162129459361Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
162229459361Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
162329459361Smrg# General Public License for more details.
162429459361Smrg#
162529459361Smrg# You should have received a copy of the GNU General Public License
162629459361Smrg# along with this program; if not, write to the Free Software
162729459361Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
162829459361Smrg#
162929459361Smrg# As a special exception to the GNU General Public License, if you
163029459361Smrg# distribute this file as part of a program that contains a
163129459361Smrg# configuration script generated by Autoconf, you may include it under
163229459361Smrg# the same distribution terms that you use for the rest of that program.
163329459361Smrg
163429459361Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
163529459361Smrg# ----------------------------------
163629459361SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
163729459361Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
163829459361Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
163929459361SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
164029459361Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
164129459361Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
164229459361Smrgfi
164329459361Smrgif test -n "$PKG_CONFIG"; then
16445715adc0Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
164529459361Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
164629459361Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
164729459361Smrg		AC_MSG_RESULT([yes])
164829459361Smrg	else
164929459361Smrg		AC_MSG_RESULT([no])
165029459361Smrg		PKG_CONFIG=""
165129459361Smrg	fi
165229459361Smrg		
165329459361Smrgfi[]dnl
165429459361Smrg])# PKG_PROG_PKG_CONFIG
165529459361Smrg
165629459361Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
165729459361Smrg#
165829459361Smrg# Check to see whether a particular set of modules exists.  Similar
165929459361Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
166029459361Smrg#
166129459361Smrg#
166229459361Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
166329459361Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
166429459361Smrg# PKG_CHECK_EXISTS manually
166529459361Smrg# --------------------------------------------------------------
166629459361SmrgAC_DEFUN([PKG_CHECK_EXISTS],
166729459361Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
166829459361Smrgif test -n "$PKG_CONFIG" && \
166929459361Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
167029459361Smrg  m4_ifval([$2], [$2], [:])
167129459361Smrgm4_ifvaln([$3], [else
167229459361Smrg  $3])dnl
167329459361Smrgfi])
167429459361Smrg
167529459361Smrg
167629459361Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
167729459361Smrg# ---------------------------------------------
167829459361Smrgm4_define([_PKG_CONFIG],
16795715adc0Smrg[if test -n "$$1"; then
16805715adc0Smrg    pkg_cv_[]$1="$$1"
16815715adc0Smrg elif test -n "$PKG_CONFIG"; then
16825715adc0Smrg    PKG_CHECK_EXISTS([$3],
16835715adc0Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
16845715adc0Smrg		     [pkg_failed=yes])
16855715adc0Smrg else
16865715adc0Smrg    pkg_failed=untried
168729459361Smrgfi[]dnl
168829459361Smrg])# _PKG_CONFIG
168929459361Smrg
16905715adc0Smrg# _PKG_SHORT_ERRORS_SUPPORTED
16915715adc0Smrg# -----------------------------
16925715adc0SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
16935715adc0Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
16945715adc0Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
16955715adc0Smrg        _pkg_short_errors_supported=yes
16965715adc0Smrgelse
16975715adc0Smrg        _pkg_short_errors_supported=no
16985715adc0Smrgfi[]dnl
16995715adc0Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
17005715adc0Smrg
17015715adc0Smrg
170229459361Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
170329459361Smrg# [ACTION-IF-NOT-FOUND])
170429459361Smrg#
170529459361Smrg#
170629459361Smrg# Note that if there is a possibility the first call to
170729459361Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
170829459361Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
170929459361Smrg#
171029459361Smrg#
171129459361Smrg# --------------------------------------------------------------
171229459361SmrgAC_DEFUN([PKG_CHECK_MODULES],
171329459361Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
171429459361SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
171529459361SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
171629459361Smrg
171729459361Smrgpkg_failed=no
171829459361SmrgAC_MSG_CHECKING([for $1])
171929459361Smrg
172029459361Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
172129459361Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
172229459361Smrg
17235715adc0Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
17245715adc0Smrgand $1[]_LIBS to avoid the need to call pkg-config.
17255715adc0SmrgSee the pkg-config man page for more details.])
17265715adc0Smrg
172729459361Smrgif test $pkg_failed = yes; then
17285715adc0Smrg        _PKG_SHORT_ERRORS_SUPPORTED
17295715adc0Smrg        if test $_pkg_short_errors_supported = yes; then
17305715adc0Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
17315715adc0Smrg        else 
17325715adc0Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
17335715adc0Smrg        fi
173429459361Smrg	# Put the nasty error message in config.log where it belongs
17355715adc0Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
173629459361Smrg
173729459361Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
17385715adc0Smrg[Package requirements ($2) were not met:
17395715adc0Smrg
17405715adc0Smrg$$1_PKG_ERRORS
17415715adc0Smrg
174229459361SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
174329459361Smrginstalled software in a non-standard prefix.
174429459361Smrg
17455715adc0Smrg_PKG_TEXT
17465715adc0Smrg])],
17475715adc0Smrg		[AC_MSG_RESULT([no])
17485715adc0Smrg                $4])
174929459361Smrgelif test $pkg_failed = untried; then
175029459361Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
175129459361Smrg[The pkg-config script could not be found or is too old.  Make sure it
175229459361Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
175329459361Smrgpath to pkg-config.
175429459361Smrg
17555715adc0Smrg_PKG_TEXT
175629459361Smrg
17575715adc0SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
175829459361Smrg		[$4])
175929459361Smrgelse
176029459361Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
176129459361Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
176229459361Smrg        AC_MSG_RESULT([yes])
176329459361Smrg	ifelse([$3], , :, [$3])
176429459361Smrgfi[]dnl
176529459361Smrg])# PKG_CHECK_MODULES
176629459361Smrg
1767