aclocal.m4 revision c3c9b392
1c3c9b392Smrg# generated automatically by aclocal 1.11.1 -*- 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
16c3c9b392Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17c3c9b392Smrg[m4_warning([this file was generated for autoconf 2.68.
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.
37c3c9b392Smrgm4_if([$1], [1.11.1], [],
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],
53c3c9b392Smrg[AM_AUTOMAKE_VERSION([1.11.1])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# Do all the work for Automake.                             -*- Autoconf -*-
41029459361Smrg
4115715adc0Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4125715adc0Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
41329459361Smrg#
41429459361Smrg# This file is free software; the Free Software Foundation
41529459361Smrg# gives unlimited permission to copy and/or distribute it,
41629459361Smrg# with or without modifications, as long as this notice is preserved.
41729459361Smrg
4185715adc0Smrg# serial 16
41929459361Smrg
42029459361Smrg# This macro actually does too much.  Some checks are only needed if
42129459361Smrg# your package does certain things.  But this isn't really a big deal.
42229459361Smrg
42329459361Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
42429459361Smrg# AM_INIT_AUTOMAKE([OPTIONS])
42529459361Smrg# -----------------------------------------------
42629459361Smrg# The call with PACKAGE and VERSION arguments is the old style
42729459361Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
42829459361Smrg# and VERSION should now be passed to AC_INIT and removed from
42929459361Smrg# the call to AM_INIT_AUTOMAKE.
43029459361Smrg# We support both call styles for the transition.  After
43129459361Smrg# the next Automake release, Autoconf can make the AC_INIT
43229459361Smrg# arguments mandatory, and then we can depend on a new Autoconf
43329459361Smrg# release and drop the old call support.
43429459361SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4355715adc0Smrg[AC_PREREQ([2.62])dnl
43629459361Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
43729459361Smrgdnl the ones we care about.
43829459361Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
43929459361SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
44029459361SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4415715adc0Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4425715adc0Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4435715adc0Smrg  # is not polluted with repeated "-I."
4445715adc0Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4455715adc0Smrg  # test to see if srcdir already configured
4465715adc0Smrg  if test -f $srcdir/config.status; then
4475715adc0Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4485715adc0Smrg  fi
44929459361Smrgfi
45029459361Smrg
45129459361Smrg# test whether we have cygpath
45229459361Smrgif test -z "$CYGPATH_W"; then
45329459361Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
45429459361Smrg    CYGPATH_W='cygpath -w'
45529459361Smrg  else
45629459361Smrg    CYGPATH_W=echo
45729459361Smrg  fi
45829459361Smrgfi
45929459361SmrgAC_SUBST([CYGPATH_W])
46029459361Smrg
46129459361Smrg# Define the identity of the package.
46229459361Smrgdnl Distinguish between old-style and new-style calls.
46329459361Smrgm4_ifval([$2],
46429459361Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
46529459361Smrg AC_SUBST([PACKAGE], [$1])dnl
46629459361Smrg AC_SUBST([VERSION], [$2])],
46729459361Smrg[_AM_SET_OPTIONS([$1])dnl
4685715adc0Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4695715adc0Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
4705715adc0Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
47129459361Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
47229459361Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
47329459361Smrg
47429459361Smrg_AM_IF_OPTION([no-define],,
47529459361Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
47629459361Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
47729459361Smrg
47829459361Smrg# Some tools Automake needs.
47929459361SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
48029459361SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
48129459361SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
48229459361SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
48329459361SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
48429459361SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
48529459361SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
4865715adc0SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4875715adc0SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
48829459361SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
48929459361Smrg# We need awk for the "check" target.  The system "awk" is bad on
49029459361Smrg# some platforms.
49129459361SmrgAC_REQUIRE([AC_PROG_AWK])dnl
49229459361SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
49329459361SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
49429459361Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4955715adc0Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4965715adc0Smrg			     [_AM_PROG_TAR([v7])])])
49729459361Smrg_AM_IF_OPTION([no-dependencies],,
49829459361Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
4995715adc0Smrg		  [_AM_DEPENDENCIES(CC)],
5005715adc0Smrg		  [define([AC_PROG_CC],
5015715adc0Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
50229459361SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5035715adc0Smrg		  [_AM_DEPENDENCIES(CXX)],
5045715adc0Smrg		  [define([AC_PROG_CXX],
5055715adc0Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5065715adc0SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5075715adc0Smrg		  [_AM_DEPENDENCIES(OBJC)],
5085715adc0Smrg		  [define([AC_PROG_OBJC],
5095715adc0Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
51029459361Smrg])
5115715adc0Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
5125715adc0Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
5135715adc0Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
5145715adc0Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
5155715adc0SmrgAC_CONFIG_COMMANDS_PRE(dnl
5165715adc0Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5175715adc0Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
51829459361Smrg])
51929459361Smrg
5205715adc0Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5215715adc0Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5225715adc0Smrgdnl mangled by Autoconf and run in a shell conditional statement.
5235715adc0Smrgm4_define([_AC_COMPILER_EXEEXT],
5245715adc0Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5255715adc0Smrg
52629459361Smrg
52729459361Smrg# When config.status generates a header, we must update the stamp-h file.
52829459361Smrg# This file resides in the same directory as the config header
52929459361Smrg# that is generated.  The stamp files are numbered to have different names.
53029459361Smrg
53129459361Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
53229459361Smrg# loop where config.status creates the headers, so we can generate
53329459361Smrg# our stamp files there.
53429459361SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
53529459361Smrg[# Compute $1's index in $config_headers.
5365715adc0Smrg_am_arg=$1
53729459361Smrg_am_stamp_count=1
53829459361Smrgfor _am_header in $config_headers :; do
53929459361Smrg  case $_am_header in
5405715adc0Smrg    $_am_arg | $_am_arg:* )
54129459361Smrg      break ;;
54229459361Smrg    * )
54329459361Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
54429459361Smrg  esac
54529459361Smrgdone
5465715adc0Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
54729459361Smrg
5485715adc0Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
54929459361Smrg#
55029459361Smrg# This file is free software; the Free Software Foundation
55129459361Smrg# gives unlimited permission to copy and/or distribute it,
55229459361Smrg# with or without modifications, as long as this notice is preserved.
55329459361Smrg
55429459361Smrg# AM_PROG_INSTALL_SH
55529459361Smrg# ------------------
55629459361Smrg# Define $install_sh.
55729459361SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
55829459361Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5595715adc0Smrgif test x"${install_sh}" != xset; then
5605715adc0Smrg  case $am_aux_dir in
5615715adc0Smrg  *\ * | *\	*)
5625715adc0Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5635715adc0Smrg  *)
5645715adc0Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5655715adc0Smrg  esac
5665715adc0Smrgfi
56729459361SmrgAC_SUBST(install_sh)])
56829459361Smrg
56929459361Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
57029459361Smrg#
57129459361Smrg# This file is free software; the Free Software Foundation
57229459361Smrg# gives unlimited permission to copy and/or distribute it,
57329459361Smrg# with or without modifications, as long as this notice is preserved.
57429459361Smrg
57529459361Smrg# serial 2
57629459361Smrg
57729459361Smrg# Check whether the underlying file-system supports filenames
57829459361Smrg# with a leading dot.  For instance MS-DOS doesn't.
57929459361SmrgAC_DEFUN([AM_SET_LEADING_DOT],
58029459361Smrg[rm -rf .tst 2>/dev/null
58129459361Smrgmkdir .tst 2>/dev/null
58229459361Smrgif test -d .tst; then
58329459361Smrg  am__leading_dot=.
58429459361Smrgelse
58529459361Smrg  am__leading_dot=_
58629459361Smrgfi
58729459361Smrgrmdir .tst 2>/dev/null
58829459361SmrgAC_SUBST([am__leading_dot])])
58929459361Smrg
59029459361Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
59129459361Smrg# From Jim Meyering
59229459361Smrg
5935715adc0Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
59429459361Smrg# Free Software Foundation, Inc.
59529459361Smrg#
59629459361Smrg# This file is free software; the Free Software Foundation
59729459361Smrg# gives unlimited permission to copy and/or distribute it,
59829459361Smrg# with or without modifications, as long as this notice is preserved.
59929459361Smrg
6005715adc0Smrg# serial 5
60129459361Smrg
6025715adc0Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
6035715adc0Smrg# ----------------------------------
6045715adc0Smrg# Control maintainer-specific portions of Makefiles.
6055715adc0Smrg# Default is to disable them, unless `enable' is passed literally.
6065715adc0Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
6075715adc0Smrg# can override the default with the --enable/--disable switch.
60829459361SmrgAC_DEFUN([AM_MAINTAINER_MODE],
6095715adc0Smrg[m4_case(m4_default([$1], [disable]),
6105715adc0Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
6115715adc0Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
6125715adc0Smrg       [m4_define([am_maintainer_other], [enable])
6135715adc0Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
6145715adc0SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
6155715adc0Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
6165715adc0Smrg  AC_ARG_ENABLE([maintainer-mode],
6175715adc0Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
61829459361Smrg			  (and sometimes confusing) to the casual installer],
6195715adc0Smrg      [USE_MAINTAINER_MODE=$enableval],
6205715adc0Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
62129459361Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
6225715adc0Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
62329459361Smrg  MAINT=$MAINTAINER_MODE_TRUE
6245715adc0Smrg  AC_SUBST([MAINT])dnl
62529459361Smrg]
62629459361Smrg)
62729459361Smrg
62829459361SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
62929459361Smrg
63029459361Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
63129459361Smrg
6325715adc0Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
63329459361Smrg#
63429459361Smrg# This file is free software; the Free Software Foundation
63529459361Smrg# gives unlimited permission to copy and/or distribute it,
63629459361Smrg# with or without modifications, as long as this notice is preserved.
63729459361Smrg
6385715adc0Smrg# serial 4
63929459361Smrg
64029459361Smrg# AM_MAKE_INCLUDE()
64129459361Smrg# -----------------
64229459361Smrg# Check to see how make treats includes.
64329459361SmrgAC_DEFUN([AM_MAKE_INCLUDE],
64429459361Smrg[am_make=${MAKE-make}
64529459361Smrgcat > confinc << 'END'
64629459361Smrgam__doit:
6475715adc0Smrg	@echo this is the am__doit target
64829459361Smrg.PHONY: am__doit
64929459361SmrgEND
65029459361Smrg# If we don't find an include directive, just comment out the code.
65129459361SmrgAC_MSG_CHECKING([for style of include used by $am_make])
65229459361Smrgam__include="#"
65329459361Smrgam__quote=
65429459361Smrg_am_result=none
65529459361Smrg# First try GNU make style include.
65629459361Smrgecho "include confinc" > confmf
6575715adc0Smrg# Ignore all kinds of additional output from `make'.
6585715adc0Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6595715adc0Smrg*the\ am__doit\ target*)
6605715adc0Smrg  am__include=include
6615715adc0Smrg  am__quote=
6625715adc0Smrg  _am_result=GNU
6635715adc0Smrg  ;;
6645715adc0Smrgesac
66529459361Smrg# Now try BSD make style include.
66629459361Smrgif test "$am__include" = "#"; then
66729459361Smrg   echo '.include "confinc"' > confmf
6685715adc0Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6695715adc0Smrg   *the\ am__doit\ target*)
6705715adc0Smrg     am__include=.include
6715715adc0Smrg     am__quote="\""
6725715adc0Smrg     _am_result=BSD
6735715adc0Smrg     ;;
6745715adc0Smrg   esac
67529459361Smrgfi
67629459361SmrgAC_SUBST([am__include])
67729459361SmrgAC_SUBST([am__quote])
67829459361SmrgAC_MSG_RESULT([$_am_result])
67929459361Smrgrm -f confinc confmf
68029459361Smrg])
68129459361Smrg
68229459361Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
68329459361Smrg
6845715adc0Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
68529459361Smrg# 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
6915715adc0Smrg# serial 6
69229459361Smrg
69329459361Smrg# AM_MISSING_PROG(NAME, PROGRAM)
69429459361Smrg# ------------------------------
69529459361SmrgAC_DEFUN([AM_MISSING_PROG],
69629459361Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
69729459361Smrg$1=${$1-"${am_missing_run}$2"}
69829459361SmrgAC_SUBST($1)])
69929459361Smrg
70029459361Smrg
70129459361Smrg# AM_MISSING_HAS_RUN
70229459361Smrg# ------------------
70329459361Smrg# Define MISSING if not defined so far and test if it supports --run.
70429459361Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
70529459361SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
70629459361Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7075715adc0SmrgAC_REQUIRE_AUX_FILE([missing])dnl
7085715adc0Smrgif test x"${MISSING+set}" != xset; then
7095715adc0Smrg  case $am_aux_dir in
7105715adc0Smrg  *\ * | *\	*)
7115715adc0Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
7125715adc0Smrg  *)
7135715adc0Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
7145715adc0Smrg  esac
7155715adc0Smrgfi
71629459361Smrg# Use eval to expand $SHELL
71729459361Smrgif eval "$MISSING --run true"; then
71829459361Smrg  am_missing_run="$MISSING --run "
71929459361Smrgelse
72029459361Smrg  am_missing_run=
72129459361Smrg  AC_MSG_WARN([`missing' script is too old or missing])
72229459361Smrgfi
72329459361Smrg])
72429459361Smrg
7255715adc0Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
72629459361Smrg#
72729459361Smrg# This file is free software; the Free Software Foundation
72829459361Smrg# gives unlimited permission to copy and/or distribute it,
72929459361Smrg# with or without modifications, as long as this notice is preserved.
73029459361Smrg
73129459361Smrg# AM_PROG_MKDIR_P
73229459361Smrg# ---------------
7335715adc0Smrg# Check for `mkdir -p'.
73429459361SmrgAC_DEFUN([AM_PROG_MKDIR_P],
7355715adc0Smrg[AC_PREREQ([2.60])dnl
7365715adc0SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7375715adc0Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7385715adc0Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
7395715adc0Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7405715adc0Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7415715adc0Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7425715adc0Smrgdnl adjustment using top_builddir (which is defined more often than
7435715adc0Smrgdnl MKDIR_P).
7445715adc0SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7455715adc0Smrgcase $mkdir_p in
7465715adc0Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7475715adc0Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7485715adc0Smrgesac
7495715adc0Smrg])
75029459361Smrg
75129459361Smrg# Helper functions for option handling.                     -*- Autoconf -*-
75229459361Smrg
7535715adc0Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
75429459361Smrg#
75529459361Smrg# This file is free software; the Free Software Foundation
75629459361Smrg# gives unlimited permission to copy and/or distribute it,
75729459361Smrg# with or without modifications, as long as this notice is preserved.
75829459361Smrg
7595715adc0Smrg# serial 4
76029459361Smrg
76129459361Smrg# _AM_MANGLE_OPTION(NAME)
76229459361Smrg# -----------------------
76329459361SmrgAC_DEFUN([_AM_MANGLE_OPTION],
76429459361Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
76529459361Smrg
76629459361Smrg# _AM_SET_OPTION(NAME)
76729459361Smrg# ------------------------------
76829459361Smrg# Set option NAME.  Presently that only means defining a flag for this option.
76929459361SmrgAC_DEFUN([_AM_SET_OPTION],
77029459361Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
77129459361Smrg
77229459361Smrg# _AM_SET_OPTIONS(OPTIONS)
77329459361Smrg# ----------------------------------
77429459361Smrg# OPTIONS is a space-separated list of Automake options.
77529459361SmrgAC_DEFUN([_AM_SET_OPTIONS],
7765715adc0Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
77729459361Smrg
77829459361Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
77929459361Smrg# -------------------------------------------
78029459361Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
78129459361SmrgAC_DEFUN([_AM_IF_OPTION],
78229459361Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
78329459361Smrg
78429459361Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
78529459361Smrg
7865715adc0Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
78729459361Smrg# Free Software Foundation, Inc.
78829459361Smrg#
78929459361Smrg# This file is free software; the Free Software Foundation
79029459361Smrg# gives unlimited permission to copy and/or distribute it,
79129459361Smrg# with or without modifications, as long as this notice is preserved.
79229459361Smrg
7935715adc0Smrg# serial 5
79429459361Smrg
79529459361Smrg# AM_SANITY_CHECK
79629459361Smrg# ---------------
79729459361SmrgAC_DEFUN([AM_SANITY_CHECK],
79829459361Smrg[AC_MSG_CHECKING([whether build environment is sane])
79929459361Smrg# Just in case
80029459361Smrgsleep 1
80129459361Smrgecho timestamp > conftest.file
8025715adc0Smrg# Reject unsafe characters in $srcdir or the absolute working directory
8035715adc0Smrg# name.  Accept space and tab only in the latter.
8045715adc0Smrgam_lf='
8055715adc0Smrg'
8065715adc0Smrgcase `pwd` in
8075715adc0Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8085715adc0Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8095715adc0Smrgesac
8105715adc0Smrgcase $srcdir in
8115715adc0Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8125715adc0Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8135715adc0Smrgesac
8145715adc0Smrg
81529459361Smrg# Do `set' in a subshell so we don't clobber the current shell's
81629459361Smrg# arguments.  Must try -L first in case configure is actually a
81729459361Smrg# symlink; some systems play weird games with the mod time of symlinks
81829459361Smrg# (eg FreeBSD returns the mod time of the symlink's containing
81929459361Smrg# directory).
82029459361Smrgif (
8215715adc0Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
82229459361Smrg   if test "$[*]" = "X"; then
82329459361Smrg      # -L didn't work.
8245715adc0Smrg      set X `ls -t "$srcdir/configure" conftest.file`
82529459361Smrg   fi
82629459361Smrg   rm -f conftest.file
82729459361Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
82829459361Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
82929459361Smrg
83029459361Smrg      # If neither matched, then we have a broken ls.  This can happen
83129459361Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
83229459361Smrg      # broken ls alias from the environment.  This has actually
83329459361Smrg      # happened.  Such a system could not be considered "sane".
83429459361Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
83529459361Smrgalias in your environment])
83629459361Smrg   fi
83729459361Smrg
83829459361Smrg   test "$[2]" = conftest.file
83929459361Smrg   )
84029459361Smrgthen
84129459361Smrg   # Ok.
84229459361Smrg   :
84329459361Smrgelse
84429459361Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
84529459361SmrgCheck your system clock])
84629459361Smrgfi
84729459361SmrgAC_MSG_RESULT(yes)])
84829459361Smrg
8495715adc0Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
8505715adc0Smrg#
8515715adc0Smrg# This file is free software; the Free Software Foundation
8525715adc0Smrg# gives unlimited permission to copy and/or distribute it,
8535715adc0Smrg# with or without modifications, as long as this notice is preserved.
8545715adc0Smrg
8555715adc0Smrg# serial 1
8565715adc0Smrg
8575715adc0Smrg# AM_SILENT_RULES([DEFAULT])
8585715adc0Smrg# --------------------------
8595715adc0Smrg# Enable less verbose build rules; with the default set to DEFAULT
8605715adc0Smrg# (`yes' being less verbose, `no' or empty being verbose).
8615715adc0SmrgAC_DEFUN([AM_SILENT_RULES],
8625715adc0Smrg[AC_ARG_ENABLE([silent-rules],
8635715adc0Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8645715adc0Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8655715adc0Smrgcase $enable_silent_rules in
8665715adc0Smrgyes) AM_DEFAULT_VERBOSITY=0;;
8675715adc0Smrgno)  AM_DEFAULT_VERBOSITY=1;;
8685715adc0Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8695715adc0Smrgesac
8705715adc0SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8715715adc0SmrgAM_BACKSLASH='\'
8725715adc0SmrgAC_SUBST([AM_BACKSLASH])dnl
8735715adc0Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8745715adc0Smrg])
8755715adc0Smrg
87629459361Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
87729459361Smrg#
87829459361Smrg# This file is free software; the Free Software Foundation
87929459361Smrg# gives unlimited permission to copy and/or distribute it,
88029459361Smrg# with or without modifications, as long as this notice is preserved.
88129459361Smrg
88229459361Smrg# AM_PROG_INSTALL_STRIP
88329459361Smrg# ---------------------
88429459361Smrg# One issue with vendor `install' (even GNU) is that you can't
88529459361Smrg# specify the program used to strip binaries.  This is especially
88629459361Smrg# annoying in cross-compiling environments, where the build's strip
88729459361Smrg# is unlikely to handle the host's binaries.
88829459361Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
88929459361Smrg# always use install-sh in `make install-strip', and initialize
89029459361Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
89129459361SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
89229459361Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
89329459361Smrg# Installed binaries are usually stripped using `strip' when the user
89429459361Smrg# run `make install-strip'.  However `strip' might not be the right
89529459361Smrg# tool to use in cross-compilation environments, therefore Automake
89629459361Smrg# will honor the `STRIP' environment variable to overrule this program.
89729459361Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
89829459361Smrgif test "$cross_compiling" != no; then
89929459361Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
90029459361Smrgfi
9015715adc0SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
90229459361SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
90329459361Smrg
9045715adc0Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9055715adc0Smrg#
9065715adc0Smrg# This file is free software; the Free Software Foundation
9075715adc0Smrg# gives unlimited permission to copy and/or distribute it,
9085715adc0Smrg# with or without modifications, as long as this notice is preserved.
9095715adc0Smrg
9105715adc0Smrg# serial 2
9115715adc0Smrg
9125715adc0Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
9135715adc0Smrg# ---------------------------
9145715adc0Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9155715adc0Smrg# This macro is traced by Automake.
9165715adc0SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9175715adc0Smrg
9185715adc0Smrg# AM_SUBST_NOTMAKE(VARIABLE)
9195715adc0Smrg# ---------------------------
9205715adc0Smrg# Public sister of _AM_SUBST_NOTMAKE.
9215715adc0SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9225715adc0Smrg
92329459361Smrg# Check how to create a tarball.                            -*- Autoconf -*-
92429459361Smrg
92529459361Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
92629459361Smrg#
92729459361Smrg# This file is free software; the Free Software Foundation
92829459361Smrg# gives unlimited permission to copy and/or distribute it,
92929459361Smrg# with or without modifications, as long as this notice is preserved.
93029459361Smrg
93129459361Smrg# serial 2
93229459361Smrg
93329459361Smrg# _AM_PROG_TAR(FORMAT)
93429459361Smrg# --------------------
93529459361Smrg# Check how to create a tarball in format FORMAT.
93629459361Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
93729459361Smrg#
93829459361Smrg# Substitute a variable $(am__tar) that is a command
93929459361Smrg# writing to stdout a FORMAT-tarball containing the directory
94029459361Smrg# $tardir.
94129459361Smrg#     tardir=directory && $(am__tar) > result.tar
94229459361Smrg#
94329459361Smrg# Substitute a variable $(am__untar) that extract such
94429459361Smrg# a tarball read from stdin.
94529459361Smrg#     $(am__untar) < result.tar
94629459361SmrgAC_DEFUN([_AM_PROG_TAR],
94729459361Smrg[# Always define AMTAR for backward compatibility.
94829459361SmrgAM_MISSING_PROG([AMTAR], [tar])
94929459361Smrgm4_if([$1], [v7],
95029459361Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
95129459361Smrg     [m4_case([$1], [ustar],, [pax],,
95229459361Smrg              [m4_fatal([Unknown tar format])])
95329459361SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
95429459361Smrg# Loop over all known methods to create a tar archive until one works.
95529459361Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
95629459361Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
95729459361Smrg# Do not fold the above two line into one, because Tru64 sh and
95829459361Smrg# Solaris sh will not grok spaces in the rhs of `-'.
95929459361Smrgfor _am_tool in $_am_tools
96029459361Smrgdo
96129459361Smrg  case $_am_tool in
96229459361Smrg  gnutar)
96329459361Smrg    for _am_tar in tar gnutar gtar;
96429459361Smrg    do
96529459361Smrg      AM_RUN_LOG([$_am_tar --version]) && break
96629459361Smrg    done
96729459361Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
96829459361Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
96929459361Smrg    am__untar="$_am_tar -xf -"
97029459361Smrg    ;;
97129459361Smrg  plaintar)
97229459361Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
97329459361Smrg    # ustar tarball either.
97429459361Smrg    (tar --version) >/dev/null 2>&1 && continue
97529459361Smrg    am__tar='tar chf - "$$tardir"'
97629459361Smrg    am__tar_='tar chf - "$tardir"'
97729459361Smrg    am__untar='tar xf -'
97829459361Smrg    ;;
97929459361Smrg  pax)
98029459361Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
98129459361Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
98229459361Smrg    am__untar='pax -r'
98329459361Smrg    ;;
98429459361Smrg  cpio)
98529459361Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
98629459361Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
98729459361Smrg    am__untar='cpio -i -H $1 -d'
98829459361Smrg    ;;
98929459361Smrg  none)
99029459361Smrg    am__tar=false
99129459361Smrg    am__tar_=false
99229459361Smrg    am__untar=false
99329459361Smrg    ;;
99429459361Smrg  esac
99529459361Smrg
99629459361Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
99729459361Smrg  # and am__untar set.
99829459361Smrg  test -n "${am_cv_prog_tar_$1}" && break
99929459361Smrg
100029459361Smrg  # tar/untar a dummy directory, and stop if the command works
100129459361Smrg  rm -rf conftest.dir
100229459361Smrg  mkdir conftest.dir
100329459361Smrg  echo GrepMe > conftest.dir/file
100429459361Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
100529459361Smrg  rm -rf conftest.dir
100629459361Smrg  if test -s conftest.tar; then
100729459361Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
100829459361Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
100929459361Smrg  fi
101029459361Smrgdone
101129459361Smrgrm -rf conftest.dir
101229459361Smrg
101329459361SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
101429459361SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
101529459361SmrgAC_SUBST([am__tar])
101629459361SmrgAC_SUBST([am__untar])
101729459361Smrg]) # _AM_PROG_TAR
101829459361Smrg
10195715adc0Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
102029459361Smrgdnl
1021c3c9b392Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
102229459361Smrgdnl 
102329459361Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1024c3c9b392Smrgdnl copy of this software and associated documentation files (the "Software"),
1025c3c9b392Smrgdnl to deal in the Software without restriction, including without limitation
1026c3c9b392Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1027c3c9b392Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
1028c3c9b392Smrgdnl Software is furnished to do so, subject to the following conditions:
102929459361Smrgdnl
1030c3c9b392Smrgdnl The above copyright notice and this permission notice (including the next
1031c3c9b392Smrgdnl paragraph) shall be included in all copies or substantial portions of the
1032c3c9b392Smrgdnl Software.
103329459361Smrgdnl
1034c3c9b392Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1035c3c9b392Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1036c3c9b392Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1037c3c9b392Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1038c3c9b392Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1039c3c9b392Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1040c3c9b392Smrgdnl DEALINGS IN THE SOFTWARE.
104129459361Smrg
104229459361Smrg# XORG_MACROS_VERSION(required-version)
104329459361Smrg# -------------------------------------
104429459361Smrg# Minimum version: 1.1.0
104529459361Smrg#
104629459361Smrg# If you're using a macro added in Version 1.1 or newer, include this in
104729459361Smrg# your configure.ac with the minimum required version, such as:
104829459361Smrg# XORG_MACROS_VERSION(1.1)
104929459361Smrg#
10505715adc0Smrg# To ensure that this macro is defined, also add:
10515715adc0Smrg# m4_ifndef([XORG_MACROS_VERSION],
10525715adc0Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
105329459361Smrg#
105429459361Smrg#
105529459361Smrg# See the "minimum version" comment for each macro you use to see what 
105629459361Smrg# version you require.
10575715adc0Smrgm4_defun([XORG_MACROS_VERSION],[
1058c3c9b392Smrgm4_define([vers_have], [1.11.0])
10595715adc0Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10605715adc0Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10615715adc0Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
10625715adc0Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
10635715adc0Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
10645715adc0Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
10655715adc0Smrgm4_undefine([vers_have])
10665715adc0Smrgm4_undefine([maj_have])
10675715adc0Smrgm4_undefine([maj_needed])
106829459361Smrg]) # XORG_MACROS_VERSION
106929459361Smrg
107029459361Smrg# XORG_PROG_RAWCPP()
107129459361Smrg# ------------------
107229459361Smrg# Minimum version: 1.0.0
107329459361Smrg#
107429459361Smrg# Find cpp program and necessary flags for use in pre-processing text files
107529459361Smrg# such as man pages and config files
107629459361SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
107729459361SmrgAC_REQUIRE([AC_PROG_CPP])
107829459361SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
107929459361Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
108029459361Smrg
108129459361Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
108229459361Smrg# which is not the best choice for supporting other OS'es, but covers most
108329459361Smrg# of the ones we need for now.
108429459361SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
108529459361SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
108629459361Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
108729459361Smrg	AC_MSG_RESULT([no])
108829459361Smrgelse
108929459361Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
109029459361Smrg		RAWCPPFLAGS=-undef
109129459361Smrg		AC_MSG_RESULT([yes])
10925715adc0Smrg	# under Cygwin unix is still defined even with -undef
10935715adc0Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10945715adc0Smrg		RAWCPPFLAGS="-undef -ansi"
10955715adc0Smrg		AC_MSG_RESULT([yes, with -ansi])
109629459361Smrg	else
109729459361Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
109829459361Smrg	fi
109929459361Smrgfi
110029459361Smrgrm -f conftest.$ac_ext
110129459361Smrg
110229459361SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
110329459361SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
110429459361Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
110529459361Smrg	AC_MSG_RESULT([no])
110629459361Smrgelse
110729459361Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
110829459361Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
110929459361Smrg		AC_MSG_RESULT([yes])
111029459361Smrg	else
111129459361Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
111229459361Smrg	fi
111329459361Smrgfi
111429459361Smrgrm -f conftest.$ac_ext
111529459361SmrgAC_SUBST(RAWCPPFLAGS)
111629459361Smrg]) # XORG_PROG_RAWCPP
111729459361Smrg
111829459361Smrg# XORG_MANPAGE_SECTIONS()
111929459361Smrg# -----------------------
112029459361Smrg# Minimum version: 1.0.0
112129459361Smrg#
112229459361Smrg# Determine which sections man pages go in for the different man page types
112329459361Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
112429459361Smrg# Not sure if there's any better way than just hardcoding by OS name.
112529459361Smrg# Override default settings by setting environment variables
1126c3c9b392Smrg# Added MAN_SUBSTS in version 1.8
1127c3c9b392Smrg# Added AC_PROG_SED in version 1.8
112829459361Smrg
112929459361SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
113029459361SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1131c3c9b392SmrgAC_REQUIRE([AC_PROG_SED])
113229459361Smrg
113329459361Smrgif test x$APP_MAN_SUFFIX = x    ; then
113429459361Smrg    APP_MAN_SUFFIX=1
113529459361Smrgfi
113629459361Smrgif test x$APP_MAN_DIR = x    ; then
113729459361Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
113829459361Smrgfi
113929459361Smrg
114029459361Smrgif test x$LIB_MAN_SUFFIX = x    ; then
114129459361Smrg    LIB_MAN_SUFFIX=3
114229459361Smrgfi
114329459361Smrgif test x$LIB_MAN_DIR = x    ; then
114429459361Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
114529459361Smrgfi
114629459361Smrg
114729459361Smrgif test x$FILE_MAN_SUFFIX = x    ; then
114829459361Smrg    case $host_os in
114929459361Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
115029459361Smrg	*)		FILE_MAN_SUFFIX=5  ;;
115129459361Smrg    esac
115229459361Smrgfi
115329459361Smrgif test x$FILE_MAN_DIR = x    ; then
115429459361Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
115529459361Smrgfi
115629459361Smrg
115729459361Smrgif test x$MISC_MAN_SUFFIX = x    ; then
115829459361Smrg    case $host_os in
115929459361Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
116029459361Smrg	*)		MISC_MAN_SUFFIX=7  ;;
116129459361Smrg    esac
116229459361Smrgfi
116329459361Smrgif test x$MISC_MAN_DIR = x    ; then
116429459361Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
116529459361Smrgfi
116629459361Smrg
116729459361Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
116829459361Smrg    case $host_os in
116929459361Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
117029459361Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
117129459361Smrg    esac
117229459361Smrgfi
117329459361Smrgif test x$DRIVER_MAN_DIR = x    ; then
117429459361Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
117529459361Smrgfi
117629459361Smrg
117729459361Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
117829459361Smrg    case $host_os in
117929459361Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
118029459361Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
118129459361Smrg    esac
118229459361Smrgfi
118329459361Smrgif test x$ADMIN_MAN_DIR = x    ; then
118429459361Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
118529459361Smrgfi
118629459361Smrg
118729459361Smrg
118829459361SmrgAC_SUBST([APP_MAN_SUFFIX])
118929459361SmrgAC_SUBST([LIB_MAN_SUFFIX])
119029459361SmrgAC_SUBST([FILE_MAN_SUFFIX])
119129459361SmrgAC_SUBST([MISC_MAN_SUFFIX])
119229459361SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
119329459361SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
119429459361SmrgAC_SUBST([APP_MAN_DIR])
119529459361SmrgAC_SUBST([LIB_MAN_DIR])
119629459361SmrgAC_SUBST([FILE_MAN_DIR])
119729459361SmrgAC_SUBST([MISC_MAN_DIR])
119829459361SmrgAC_SUBST([DRIVER_MAN_DIR])
119929459361SmrgAC_SUBST([ADMIN_MAN_DIR])
1200c3c9b392Smrg
1201c3c9b392SmrgXORG_MAN_PAGE="X Version 11"
1202c3c9b392SmrgAC_SUBST([XORG_MAN_PAGE])
1203c3c9b392SmrgMAN_SUBSTS="\
1204c3c9b392Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1205c3c9b392Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1206c3c9b392Smrg	-e 's|__xservername__|Xorg|g' \
1207c3c9b392Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
1208c3c9b392Smrg	-e 's|__projectroot__|\$(prefix)|g' \
1209c3c9b392Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1210c3c9b392Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1211c3c9b392Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1212c3c9b392Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1213c3c9b392Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1214c3c9b392Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1215c3c9b392Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1216c3c9b392SmrgAC_SUBST([MAN_SUBSTS])
1217c3c9b392Smrg
121829459361Smrg]) # XORG_MANPAGE_SECTIONS
121929459361Smrg
1220c3c9b392Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1221c3c9b392Smrg# ------------------------
1222c3c9b392Smrg# Minimum version: 1.7.0
1223c3c9b392Smrg#
1224c3c9b392Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1225c3c9b392Smrg# provided by xorg-sgml-doctools, if installed.
1226c3c9b392SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1227c3c9b392SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1228c3c9b392SmrgXORG_SGML_PATH=
1229c3c9b392SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1230c3c9b392Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1231c3c9b392Smrg    [m4_ifval([$1],[:],
1232c3c9b392Smrg        [if test x"$cross_compiling" != x"yes" ; then
1233c3c9b392Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1234c3c9b392Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1235c3c9b392Smrg         fi])
1236c3c9b392Smrg    ])
1237c3c9b392Smrg
1238c3c9b392Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1239c3c9b392Smrg# the path and the name of the doc stylesheet
1240c3c9b392Smrgif test "x$XORG_SGML_PATH" != "x" ; then
1241c3c9b392Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1242c3c9b392Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1243c3c9b392Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1244c3c9b392Smrgelse
1245c3c9b392Smrg   AC_MSG_RESULT([no])
1246c3c9b392Smrgfi
1247c3c9b392Smrg
1248c3c9b392SmrgAC_SUBST(XORG_SGML_PATH)
1249c3c9b392SmrgAC_SUBST(STYLESHEET_SRCDIR)
1250c3c9b392SmrgAC_SUBST(XSL_STYLESHEET)
1251c3c9b392SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1252c3c9b392Smrg]) # XORG_CHECK_SGML_DOCTOOLS
1253c3c9b392Smrg
125429459361Smrg# XORG_CHECK_LINUXDOC
125529459361Smrg# -------------------
125629459361Smrg# Minimum version: 1.0.0
125729459361Smrg#
125829459361Smrg# Defines the variable MAKE_TEXT if the necessary tools and
125929459361Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
126029459361Smrg# Whether or not the necessary tools and files are found can be checked
126129459361Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
126229459361SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1263c3c9b392SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1264c3c9b392SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
126529459361Smrg
126629459361SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
126729459361Smrg
1268c3c9b392SmrgAC_MSG_CHECKING([whether to build documentation])
126929459361Smrg
1270c3c9b392Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
127129459361Smrg   BUILDDOC=yes
127229459361Smrgelse
127329459361Smrg   BUILDDOC=no
127429459361Smrgfi
127529459361Smrg
127629459361SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
127729459361Smrg
127829459361SmrgAC_MSG_RESULT([$BUILDDOC])
127929459361Smrg
1280c3c9b392SmrgAC_MSG_CHECKING([whether to build pdf documentation])
128129459361Smrg
1282c3c9b392Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
128329459361Smrg   BUILDPDFDOC=yes
128429459361Smrgelse
128529459361Smrg   BUILDPDFDOC=no
128629459361Smrgfi
128729459361Smrg
128829459361SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
128929459361Smrg
129029459361SmrgAC_MSG_RESULT([$BUILDPDFDOC])
129129459361Smrg
1292c3c9b392SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
129329459361SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
129429459361SmrgMAKE_PDF="$PS2PDF"
129529459361SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
129629459361Smrg
129729459361SmrgAC_SUBST(MAKE_TEXT)
129829459361SmrgAC_SUBST(MAKE_PS)
129929459361SmrgAC_SUBST(MAKE_PDF)
130029459361SmrgAC_SUBST(MAKE_HTML)
130129459361Smrg]) # XORG_CHECK_LINUXDOC
130229459361Smrg
130329459361Smrg# XORG_CHECK_DOCBOOK
130429459361Smrg# -------------------
130529459361Smrg# Minimum version: 1.0.0
130629459361Smrg#
130729459361Smrg# Checks for the ability to build output formats from SGML DocBook source.
130829459361Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
130929459361Smrg# indicates whether the necessary tools and files are found and, if set,
131029459361Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
131129459361SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1312c3c9b392SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1313c3c9b392Smrg
131429459361SmrgBUILDTXTDOC=no
131529459361SmrgBUILDPDFDOC=no
131629459361SmrgBUILDPSDOC=no
131729459361SmrgBUILDHTMLDOC=no
131829459361Smrg
131929459361SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
132029459361SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
132129459361SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
132229459361SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
132329459361Smrg
1324c3c9b392SmrgAC_MSG_CHECKING([whether to build text documentation])
1325c3c9b392Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
132629459361Smrg   test x$BUILD_TXTDOC != xno; then
132729459361Smrg	BUILDTXTDOC=yes
132829459361Smrgfi
132929459361SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
133029459361SmrgAC_MSG_RESULT([$BUILDTXTDOC])
133129459361Smrg
1332c3c9b392SmrgAC_MSG_CHECKING([whether to build PDF documentation])
1333c3c9b392Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
133429459361Smrg   test x$BUILD_PDFDOC != xno; then
133529459361Smrg	BUILDPDFDOC=yes
133629459361Smrgfi
133729459361SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
133829459361SmrgAC_MSG_RESULT([$BUILDPDFDOC])
133929459361Smrg
1340c3c9b392SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1341c3c9b392Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
134229459361Smrg   test x$BUILD_PSDOC != xno; then
134329459361Smrg	BUILDPSDOC=yes
134429459361Smrgfi
134529459361SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
134629459361SmrgAC_MSG_RESULT([$BUILDPSDOC])
134729459361Smrg
1348c3c9b392SmrgAC_MSG_CHECKING([whether to build HTML documentation])
1349c3c9b392Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
135029459361Smrg   test x$BUILD_HTMLDOC != xno; then
135129459361Smrg	BUILDHTMLDOC=yes
135229459361Smrgfi
135329459361SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
135429459361SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
135529459361Smrg
135629459361SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
135729459361SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
135829459361SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
135929459361SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
136029459361Smrg
136129459361SmrgAC_SUBST(MAKE_TEXT)
136229459361SmrgAC_SUBST(MAKE_PS)
136329459361SmrgAC_SUBST(MAKE_PDF)
136429459361SmrgAC_SUBST(MAKE_HTML)
136529459361Smrg]) # XORG_CHECK_DOCBOOK
136629459361Smrg
1367c3c9b392Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1368c3c9b392Smrg# ----------------
1369c3c9b392Smrg# Minimum version: 1.5.0
1370c3c9b392Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1371c3c9b392Smrg#
1372c3c9b392Smrg# Documentation tools are not always available on all platforms and sometimes
1373c3c9b392Smrg# not at the appropriate level. This macro enables a module to test for the
1374c3c9b392Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1375c3c9b392Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1376c3c9b392Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1377c3c9b392Smrg# --with-xmlto assumes 'auto'.
1378c3c9b392Smrg#
1379c3c9b392Smrg# Interface to module:
1380c3c9b392Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1381c3c9b392Smrg# XMLTO:	returns the path of the xmlto program found
1382c3c9b392Smrg#		returns the path set by the user in the environment
1383c3c9b392Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1384c3c9b392Smrg#		'no' user instructs the module not to use xmlto
1385c3c9b392Smrg#
1386c3c9b392Smrg# Added in version 1.10.0
1387c3c9b392Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1388c3c9b392Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1389c3c9b392Smrg#
1390c3c9b392Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1391c3c9b392Smrg#
1392c3c9b392SmrgAC_DEFUN([XORG_WITH_XMLTO],[
1393c3c9b392SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1394c3c9b392Smrgm4_define([_defopt], m4_default([$2], [auto]))
1395c3c9b392SmrgAC_ARG_WITH(xmlto,
1396c3c9b392Smrg	AS_HELP_STRING([--with-xmlto],
1397c3c9b392Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1398c3c9b392Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1399c3c9b392Smrgm4_undefine([_defopt])
1400c3c9b392Smrg
1401c3c9b392Smrgif test "x$use_xmlto" = x"auto"; then
1402c3c9b392Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1403c3c9b392Smrg   if test "x$XMLTO" = "x"; then
1404c3c9b392Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1405c3c9b392Smrg	have_xmlto=no
1406c3c9b392Smrg   else
1407c3c9b392Smrg        have_xmlto=yes
1408c3c9b392Smrg   fi
1409c3c9b392Smrgelif test "x$use_xmlto" = x"yes" ; then
1410c3c9b392Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1411c3c9b392Smrg   if test "x$XMLTO" = "x"; then
1412c3c9b392Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1413c3c9b392Smrg   fi
1414c3c9b392Smrg   have_xmlto=yes
1415c3c9b392Smrgelif test "x$use_xmlto" = x"no" ; then
1416c3c9b392Smrg   if test "x$XMLTO" != "x"; then
1417c3c9b392Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1418c3c9b392Smrg   fi
1419c3c9b392Smrg   have_xmlto=no
1420c3c9b392Smrgelse
1421c3c9b392Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1422c3c9b392Smrgfi
1423c3c9b392Smrg
1424c3c9b392Smrg# Test for a minimum version of xmlto, if provided.
1425c3c9b392Smrgm4_ifval([$1],
1426c3c9b392Smrg[if test "$have_xmlto" = yes; then
1427c3c9b392Smrg    # scrape the xmlto version
1428c3c9b392Smrg    AC_MSG_CHECKING([the xmlto version])
1429c3c9b392Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1430c3c9b392Smrg    AC_MSG_RESULT([$xmlto_version])
1431c3c9b392Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1432c3c9b392Smrg        [if test "x$use_xmlto" = xauto; then
1433c3c9b392Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1434c3c9b392Smrg            have_xmlto=no
1435c3c9b392Smrg        else
1436c3c9b392Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1437c3c9b392Smrg        fi])
1438c3c9b392Smrgfi])
1439c3c9b392Smrg
1440c3c9b392Smrg# Test for the ability of xmlto to generate a text target
1441c3c9b392Smrghave_xmlto_text=no
1442c3c9b392Smrgcat > conftest.xml << "EOF"
1443c3c9b392SmrgEOF
1444c3c9b392SmrgAS_IF([test "$have_xmlto" = yes],
1445c3c9b392Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1446c3c9b392Smrg             [have_xmlto_text=yes],
1447c3c9b392Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1448c3c9b392Smrgrm -f conftest.xml
1449c3c9b392SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1450c3c9b392SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1451c3c9b392Smrg]) # XORG_WITH_XMLTO
1452c3c9b392Smrg
1453c3c9b392Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1454c3c9b392Smrg# ----------------
1455c3c9b392Smrg# Minimum version: 1.5.0
1456c3c9b392Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1457c3c9b392Smrg#
1458c3c9b392Smrg# Documentation tools are not always available on all platforms and sometimes
1459c3c9b392Smrg# not at the appropriate level. This macro enables a module to test for the
1460c3c9b392Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1461c3c9b392Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1462c3c9b392Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1463c3c9b392Smrg# --with-asciidoc assumes 'auto'.
1464c3c9b392Smrg#
1465c3c9b392Smrg# Interface to module:
1466c3c9b392Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1467c3c9b392Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
1468c3c9b392Smrg#		 returns the path set by the user in the environment
1469c3c9b392Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1470c3c9b392Smrg#		  'no' user instructs the module not to use asciidoc
1471c3c9b392Smrg#
1472c3c9b392Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1473c3c9b392Smrg#
1474c3c9b392SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1475c3c9b392SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1476c3c9b392Smrgm4_define([_defopt], m4_default([$2], [auto]))
1477c3c9b392SmrgAC_ARG_WITH(asciidoc,
1478c3c9b392Smrg	AS_HELP_STRING([--with-asciidoc],
1479c3c9b392Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1480c3c9b392Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1481c3c9b392Smrgm4_undefine([_defopt])
1482c3c9b392Smrg
1483c3c9b392Smrgif test "x$use_asciidoc" = x"auto"; then
1484c3c9b392Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1485c3c9b392Smrg   if test "x$ASCIIDOC" = "x"; then
1486c3c9b392Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1487c3c9b392Smrg	have_asciidoc=no
1488c3c9b392Smrg   else
1489c3c9b392Smrg        have_asciidoc=yes
1490c3c9b392Smrg   fi
1491c3c9b392Smrgelif test "x$use_asciidoc" = x"yes" ; then
1492c3c9b392Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1493c3c9b392Smrg   if test "x$ASCIIDOC" = "x"; then
1494c3c9b392Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1495c3c9b392Smrg   fi
1496c3c9b392Smrg   have_asciidoc=yes
1497c3c9b392Smrgelif test "x$use_asciidoc" = x"no" ; then
1498c3c9b392Smrg   if test "x$ASCIIDOC" != "x"; then
1499c3c9b392Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1500c3c9b392Smrg   fi
1501c3c9b392Smrg   have_asciidoc=no
1502c3c9b392Smrgelse
1503c3c9b392Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1504c3c9b392Smrgfi
1505c3c9b392Smrgm4_ifval([$1],
1506c3c9b392Smrg[if test "$have_asciidoc" = yes; then
1507c3c9b392Smrg    # scrape the asciidoc version
1508c3c9b392Smrg    AC_MSG_CHECKING([the asciidoc version])
1509c3c9b392Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1510c3c9b392Smrg    AC_MSG_RESULT([$asciidoc_version])
1511c3c9b392Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1512c3c9b392Smrg        [if test "x$use_asciidoc" = xauto; then
1513c3c9b392Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1514c3c9b392Smrg            have_asciidoc=no
1515c3c9b392Smrg        else
1516c3c9b392Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1517c3c9b392Smrg        fi])
1518c3c9b392Smrgfi])
1519c3c9b392SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1520c3c9b392Smrg]) # XORG_WITH_ASCIIDOC
1521c3c9b392Smrg
1522c3c9b392Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1523c3c9b392Smrg# --------------------------------
1524c3c9b392Smrg# Minimum version: 1.5.0
1525c3c9b392Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1526c3c9b392Smrg#
1527c3c9b392Smrg# Documentation tools are not always available on all platforms and sometimes
1528c3c9b392Smrg# not at the appropriate level. This macro enables a module to test for the
1529c3c9b392Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1530c3c9b392Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1531c3c9b392Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1532c3c9b392Smrg# --with-doxygen assumes 'auto'.
1533c3c9b392Smrg#
1534c3c9b392Smrg# Interface to module:
1535c3c9b392Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1536c3c9b392Smrg# DOXYGEN:	 returns the path of the doxygen program found
1537c3c9b392Smrg#		 returns the path set by the user in the environment
1538c3c9b392Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1539c3c9b392Smrg#		  'no' user instructs the module not to use doxygen
1540c3c9b392Smrg#
1541c3c9b392Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1542c3c9b392Smrg#
1543c3c9b392SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1544c3c9b392SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1545c3c9b392Smrgm4_define([_defopt], m4_default([$2], [auto]))
1546c3c9b392SmrgAC_ARG_WITH(doxygen,
1547c3c9b392Smrg	AS_HELP_STRING([--with-doxygen],
1548c3c9b392Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1549c3c9b392Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1550c3c9b392Smrgm4_undefine([_defopt])
1551c3c9b392Smrg
1552c3c9b392Smrgif test "x$use_doxygen" = x"auto"; then
1553c3c9b392Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1554c3c9b392Smrg   if test "x$DOXYGEN" = "x"; then
1555c3c9b392Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1556c3c9b392Smrg	have_doxygen=no
1557c3c9b392Smrg   else
1558c3c9b392Smrg        have_doxygen=yes
1559c3c9b392Smrg   fi
1560c3c9b392Smrgelif test "x$use_doxygen" = x"yes" ; then
1561c3c9b392Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1562c3c9b392Smrg   if test "x$DOXYGEN" = "x"; then
1563c3c9b392Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1564c3c9b392Smrg   fi
1565c3c9b392Smrg   have_doxygen=yes
1566c3c9b392Smrgelif test "x$use_doxygen" = x"no" ; then
1567c3c9b392Smrg   if test "x$DOXYGEN" != "x"; then
1568c3c9b392Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1569c3c9b392Smrg   fi
1570c3c9b392Smrg   have_doxygen=no
1571c3c9b392Smrgelse
1572c3c9b392Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1573c3c9b392Smrgfi
1574c3c9b392Smrgm4_ifval([$1],
1575c3c9b392Smrg[if test "$have_doxygen" = yes; then
1576c3c9b392Smrg    # scrape the doxygen version
1577c3c9b392Smrg    AC_MSG_CHECKING([the doxygen version])
1578c3c9b392Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1579c3c9b392Smrg    AC_MSG_RESULT([$doxygen_version])
1580c3c9b392Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1581c3c9b392Smrg        [if test "x$use_doxygen" = xauto; then
1582c3c9b392Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1583c3c9b392Smrg            have_doxygen=no
1584c3c9b392Smrg        else
1585c3c9b392Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1586c3c9b392Smrg        fi])
1587c3c9b392Smrgfi])
1588c3c9b392SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1589c3c9b392Smrg]) # XORG_WITH_DOXYGEN
1590c3c9b392Smrg
1591c3c9b392Smrg# XORG_WITH_GROFF([DEFAULT])
1592c3c9b392Smrg# ----------------
1593c3c9b392Smrg# Minimum version: 1.6.0
1594c3c9b392Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1595c3c9b392Smrg#
1596c3c9b392Smrg# Documentation tools are not always available on all platforms and sometimes
1597c3c9b392Smrg# not at the appropriate level. This macro enables a module to test for the
1598c3c9b392Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1599c3c9b392Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
1600c3c9b392Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
1601c3c9b392Smrg# --with-groff assumes 'auto'.
1602c3c9b392Smrg#
1603c3c9b392Smrg# Interface to module:
1604c3c9b392Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1605c3c9b392Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1606c3c9b392Smrg# HAVE_GROFF_MS: the -ms macros package
1607c3c9b392Smrg# GROFF:	 returns the path of the groff program found
1608c3c9b392Smrg#		 returns the path set by the user in the environment
1609c3c9b392Smrg# --with-groff:	 'yes' user instructs the module to use groff
1610c3c9b392Smrg#		 'no' user instructs the module not to use groff
1611c3c9b392Smrg#
1612c3c9b392Smrg# Added in version 1.9.0:
1613c3c9b392Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1614c3c9b392Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1615c3c9b392Smrg#		   psselect from the psutils package.
1616c3c9b392Smrg#		   the ghostcript package. Refer to the grohtml man pages
1617c3c9b392Smrg#
1618c3c9b392Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1619c3c9b392Smrg#
1620c3c9b392Smrg# OS and distros often splits groff in a basic and full package, the former
1621c3c9b392Smrg# having the groff program and the later having devices, fonts and macros
1622c3c9b392Smrg# Checking for the groff executable is not enough.
1623c3c9b392Smrg#
1624c3c9b392Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
1625c3c9b392Smrg# unset HAVE_GROFF or GROFF env variables.
1626c3c9b392Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1627c3c9b392Smrg#
1628c3c9b392SmrgAC_DEFUN([XORG_WITH_GROFF],[
1629c3c9b392SmrgAC_ARG_VAR([GROFF], [Path to groff command])
1630c3c9b392Smrgm4_define([_defopt], m4_default([$1], [auto]))
1631c3c9b392SmrgAC_ARG_WITH(groff,
1632c3c9b392Smrg	AS_HELP_STRING([--with-groff],
1633c3c9b392Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1634c3c9b392Smrg	   [use_groff=$withval], [use_groff=]_defopt)
1635c3c9b392Smrgm4_undefine([_defopt])
1636c3c9b392Smrg
1637c3c9b392Smrgif test "x$use_groff" = x"auto"; then
1638c3c9b392Smrg   AC_PATH_PROG([GROFF], [groff])
1639c3c9b392Smrg   if test "x$GROFF" = "x"; then
1640c3c9b392Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1641c3c9b392Smrg	have_groff=no
1642c3c9b392Smrg   else
1643c3c9b392Smrg        have_groff=yes
1644c3c9b392Smrg   fi
1645c3c9b392Smrgelif test "x$use_groff" = x"yes" ; then
1646c3c9b392Smrg   AC_PATH_PROG([GROFF], [groff])
1647c3c9b392Smrg   if test "x$GROFF" = "x"; then
1648c3c9b392Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1649c3c9b392Smrg   fi
1650c3c9b392Smrg   have_groff=yes
1651c3c9b392Smrgelif test "x$use_groff" = x"no" ; then
1652c3c9b392Smrg   if test "x$GROFF" != "x"; then
1653c3c9b392Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1654c3c9b392Smrg   fi
1655c3c9b392Smrg   have_groff=no
1656c3c9b392Smrgelse
1657c3c9b392Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1658c3c9b392Smrgfi
1659c3c9b392Smrg
1660c3c9b392Smrg# We have groff, test for the presence of the macro packages
1661c3c9b392Smrgif test "x$have_groff" = x"yes"; then
1662c3c9b392Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1663c3c9b392Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1664c3c9b392Smrg        groff_ms_works=yes
1665c3c9b392Smrg    else
1666c3c9b392Smrg        groff_ms_works=no
1667c3c9b392Smrg    fi
1668c3c9b392Smrg    AC_MSG_RESULT([$groff_ms_works])
1669c3c9b392Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1670c3c9b392Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1671c3c9b392Smrg        groff_mm_works=yes
1672c3c9b392Smrg    else
1673c3c9b392Smrg        groff_mm_works=no
1674c3c9b392Smrg    fi
1675c3c9b392Smrg    AC_MSG_RESULT([$groff_mm_works])
1676c3c9b392Smrgfi
1677c3c9b392Smrg
1678c3c9b392Smrg# We have groff, test for HTML dependencies, one command per package
1679c3c9b392Smrgif test "x$have_groff" = x"yes"; then
1680c3c9b392Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1681c3c9b392Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1682c3c9b392Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1683c3c9b392Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1684c3c9b392Smrg      have_groff_html=yes
1685c3c9b392Smrg   else
1686c3c9b392Smrg      have_groff_html=no
1687c3c9b392Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1688c3c9b392Smrg   fi
1689c3c9b392Smrgfi
1690c3c9b392Smrg
1691c3c9b392Smrg# Set Automake conditionals for Makefiles
1692c3c9b392SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1693c3c9b392SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1694c3c9b392SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1695c3c9b392SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1696c3c9b392Smrg]) # XORG_WITH_GROFF
1697c3c9b392Smrg
1698c3c9b392Smrg# XORG_WITH_FOP([DEFAULT])
1699c3c9b392Smrg# ----------------
1700c3c9b392Smrg# Minimum version: 1.6.0
1701c3c9b392Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1702c3c9b392Smrg#
1703c3c9b392Smrg# Documentation tools are not always available on all platforms and sometimes
1704c3c9b392Smrg# not at the appropriate level. This macro enables a module to test for the
1705c3c9b392Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1706c3c9b392Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
1707c3c9b392Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
1708c3c9b392Smrg# --with-fop assumes 'auto'.
1709c3c9b392Smrg#
1710c3c9b392Smrg# Interface to module:
1711c3c9b392Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1712c3c9b392Smrg# FOP:	 	returns the path of the fop program found
1713c3c9b392Smrg#		returns the path set by the user in the environment
1714c3c9b392Smrg# --with-fop: 	'yes' user instructs the module to use fop
1715c3c9b392Smrg#		'no' user instructs the module not to use fop
1716c3c9b392Smrg#
1717c3c9b392Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1718c3c9b392Smrg#
1719c3c9b392SmrgAC_DEFUN([XORG_WITH_FOP],[
1720c3c9b392SmrgAC_ARG_VAR([FOP], [Path to fop command])
1721c3c9b392Smrgm4_define([_defopt], m4_default([$1], [auto]))
1722c3c9b392SmrgAC_ARG_WITH(fop,
1723c3c9b392Smrg	AS_HELP_STRING([--with-fop],
1724c3c9b392Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1725c3c9b392Smrg	   [use_fop=$withval], [use_fop=]_defopt)
1726c3c9b392Smrgm4_undefine([_defopt])
1727c3c9b392Smrg
1728c3c9b392Smrgif test "x$use_fop" = x"auto"; then
1729c3c9b392Smrg   AC_PATH_PROG([FOP], [fop])
1730c3c9b392Smrg   if test "x$FOP" = "x"; then
1731c3c9b392Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1732c3c9b392Smrg	have_fop=no
1733c3c9b392Smrg   else
1734c3c9b392Smrg        have_fop=yes
1735c3c9b392Smrg   fi
1736c3c9b392Smrgelif test "x$use_fop" = x"yes" ; then
1737c3c9b392Smrg   AC_PATH_PROG([FOP], [fop])
1738c3c9b392Smrg   if test "x$FOP" = "x"; then
1739c3c9b392Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1740c3c9b392Smrg   fi
1741c3c9b392Smrg   have_fop=yes
1742c3c9b392Smrgelif test "x$use_fop" = x"no" ; then
1743c3c9b392Smrg   if test "x$FOP" != "x"; then
1744c3c9b392Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1745c3c9b392Smrg   fi
1746c3c9b392Smrg   have_fop=no
1747c3c9b392Smrgelse
1748c3c9b392Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1749c3c9b392Smrgfi
1750c3c9b392SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1751c3c9b392Smrg]) # XORG_WITH_FOP
1752c3c9b392Smrg
1753c3c9b392Smrg# XORG_WITH_PS2PDF([DEFAULT])
1754c3c9b392Smrg# ----------------
1755c3c9b392Smrg# Minimum version: 1.6.0
1756c3c9b392Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1757c3c9b392Smrg#
1758c3c9b392Smrg# Documentation tools are not always available on all platforms and sometimes
1759c3c9b392Smrg# not at the appropriate level. This macro enables a module to test for the
1760c3c9b392Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1761c3c9b392Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1762c3c9b392Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1763c3c9b392Smrg# --with-ps2pdf assumes 'auto'.
1764c3c9b392Smrg#
1765c3c9b392Smrg# Interface to module:
1766c3c9b392Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1767c3c9b392Smrg# PS2PDF:	returns the path of the ps2pdf program found
1768c3c9b392Smrg#		returns the path set by the user in the environment
1769c3c9b392Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1770c3c9b392Smrg#		 'no' user instructs the module not to use ps2pdf
1771c3c9b392Smrg#
1772c3c9b392Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1773c3c9b392Smrg#
1774c3c9b392SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1775c3c9b392SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1776c3c9b392Smrgm4_define([_defopt], m4_default([$1], [auto]))
1777c3c9b392SmrgAC_ARG_WITH(ps2pdf,
1778c3c9b392Smrg	AS_HELP_STRING([--with-ps2pdf],
1779c3c9b392Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1780c3c9b392Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1781c3c9b392Smrgm4_undefine([_defopt])
1782c3c9b392Smrg
1783c3c9b392Smrgif test "x$use_ps2pdf" = x"auto"; then
1784c3c9b392Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1785c3c9b392Smrg   if test "x$PS2PDF" = "x"; then
1786c3c9b392Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1787c3c9b392Smrg	have_ps2pdf=no
1788c3c9b392Smrg   else
1789c3c9b392Smrg        have_ps2pdf=yes
1790c3c9b392Smrg   fi
1791c3c9b392Smrgelif test "x$use_ps2pdf" = x"yes" ; then
1792c3c9b392Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1793c3c9b392Smrg   if test "x$PS2PDF" = "x"; then
1794c3c9b392Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1795c3c9b392Smrg   fi
1796c3c9b392Smrg   have_ps2pdf=yes
1797c3c9b392Smrgelif test "x$use_ps2pdf" = x"no" ; then
1798c3c9b392Smrg   if test "x$PS2PDF" != "x"; then
1799c3c9b392Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1800c3c9b392Smrg   fi
1801c3c9b392Smrg   have_ps2pdf=no
1802c3c9b392Smrgelse
1803c3c9b392Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1804c3c9b392Smrgfi
1805c3c9b392SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1806c3c9b392Smrg]) # XORG_WITH_PS2PDF
1807c3c9b392Smrg
1808c3c9b392Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
1809c3c9b392Smrg# ----------------
1810c3c9b392Smrg# Minimum version: 1.6.0
1811c3c9b392Smrg#
1812c3c9b392Smrg# Documentation tools are not always available on all platforms and sometimes
1813c3c9b392Smrg# not at the appropriate level. This macro enables a builder to skip all
1814c3c9b392Smrg# documentation targets except traditional man pages.
1815c3c9b392Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1816c3c9b392Smrg# maximum flexibilty in controlling documentation building.
1817c3c9b392Smrg# Refer to:
1818c3c9b392Smrg# XORG_WITH_XMLTO         --with-xmlto
1819c3c9b392Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1820c3c9b392Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1821c3c9b392Smrg# XORG_WITH_FOP           --with-fop
1822c3c9b392Smrg# XORG_WITH_GROFF         --with-groff
1823c3c9b392Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1824c3c9b392Smrg#
1825c3c9b392Smrg# Interface to module:
1826c3c9b392Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1827c3c9b392Smrg# --enable-docs: 'yes' user instructs the module to generate docs
1828c3c9b392Smrg#		 'no' user instructs the module not to generate docs
1829c3c9b392Smrg# parm1:	specify the default value, yes or no.
1830c3c9b392Smrg#
1831c3c9b392SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1832c3c9b392Smrgm4_define([default], m4_default([$1], [yes]))
1833c3c9b392SmrgAC_ARG_ENABLE(docs,
1834c3c9b392Smrg	AS_HELP_STRING([--enable-docs],
1835c3c9b392Smrg	   [Enable building the documentation (default: ]default[)]),
1836c3c9b392Smrg	   [build_docs=$enableval], [build_docs=]default)
1837c3c9b392Smrgm4_undefine([default])
1838c3c9b392SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1839c3c9b392SmrgAC_MSG_CHECKING([whether to build documentation])
1840c3c9b392SmrgAC_MSG_RESULT([$build_docs])
1841c3c9b392Smrg]) # XORG_ENABLE_DOCS
1842c3c9b392Smrg
1843c3c9b392Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1844c3c9b392Smrg# ----------------
1845c3c9b392Smrg# Minimum version: 1.6.0
1846c3c9b392Smrg#
1847c3c9b392Smrg# This macro enables a builder to skip all developer documentation.
1848c3c9b392Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1849c3c9b392Smrg# maximum flexibilty in controlling documentation building.
1850c3c9b392Smrg# Refer to:
1851c3c9b392Smrg# XORG_WITH_XMLTO         --with-xmlto
1852c3c9b392Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1853c3c9b392Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1854c3c9b392Smrg# XORG_WITH_FOP           --with-fop
1855c3c9b392Smrg# XORG_WITH_GROFF         --with-groff
1856c3c9b392Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1857c3c9b392Smrg#
1858c3c9b392Smrg# Interface to module:
1859c3c9b392Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1860c3c9b392Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1861c3c9b392Smrg#			'no' user instructs the module not to generate developer docs
1862c3c9b392Smrg# parm1:		specify the default value, yes or no.
1863c3c9b392Smrg#
1864c3c9b392SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1865c3c9b392Smrgm4_define([devel_default], m4_default([$1], [yes]))
1866c3c9b392SmrgAC_ARG_ENABLE(devel-docs,
1867c3c9b392Smrg	AS_HELP_STRING([--enable-devel-docs],
1868c3c9b392Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1869c3c9b392Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1870c3c9b392Smrgm4_undefine([devel_default])
1871c3c9b392SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1872c3c9b392SmrgAC_MSG_CHECKING([whether to build developer documentation])
1873c3c9b392SmrgAC_MSG_RESULT([$build_devel_docs])
1874c3c9b392Smrg]) # XORG_ENABLE_DEVEL_DOCS
1875c3c9b392Smrg
1876c3c9b392Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
1877c3c9b392Smrg# ----------------
1878c3c9b392Smrg# Minimum version: 1.6.0
1879c3c9b392Smrg#
1880c3c9b392Smrg# This macro enables a builder to skip all functional specification targets.
1881c3c9b392Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1882c3c9b392Smrg# maximum flexibilty in controlling documentation building.
1883c3c9b392Smrg# Refer to:
1884c3c9b392Smrg# XORG_WITH_XMLTO         --with-xmlto
1885c3c9b392Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1886c3c9b392Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1887c3c9b392Smrg# XORG_WITH_FOP           --with-fop
1888c3c9b392Smrg# XORG_WITH_GROFF         --with-groff
1889c3c9b392Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1890c3c9b392Smrg#
1891c3c9b392Smrg# Interface to module:
1892c3c9b392Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1893c3c9b392Smrg# --enable-specs:	'yes' user instructs the module to generate specs
1894c3c9b392Smrg#			'no' user instructs the module not to generate specs
1895c3c9b392Smrg# parm1:		specify the default value, yes or no.
1896c3c9b392Smrg#
1897c3c9b392SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1898c3c9b392Smrgm4_define([spec_default], m4_default([$1], [yes]))
1899c3c9b392SmrgAC_ARG_ENABLE(specs,
1900c3c9b392Smrg	AS_HELP_STRING([--enable-specs],
1901c3c9b392Smrg	   [Enable building the specs (default: ]spec_default[)]),
1902c3c9b392Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
1903c3c9b392Smrgm4_undefine([spec_default])
1904c3c9b392SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1905c3c9b392SmrgAC_MSG_CHECKING([whether to build functional specifications])
1906c3c9b392SmrgAC_MSG_RESULT([$build_specs])
1907c3c9b392Smrg]) # XORG_ENABLE_SPECS
1908c3c9b392Smrg
190929459361Smrg# XORG_CHECK_MALLOC_ZERO
191029459361Smrg# ----------------------
191129459361Smrg# Minimum version: 1.0.0
191229459361Smrg#
191329459361Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
191429459361Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
191529459361Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
191629459361SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
191729459361SmrgAC_ARG_ENABLE(malloc0returnsnull,
19185715adc0Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
191929459361Smrg		       [malloc(0) returns NULL (default: auto)]),
192029459361Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
192129459361Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
192229459361Smrg
192329459361SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
192429459361Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
192529459361Smrg	AC_RUN_IFELSE([
192629459361Smrgchar *malloc();
192729459361Smrgchar *realloc();
192829459361Smrgchar *calloc();
192929459361Smrgmain() {
193029459361Smrg    char *m0, *r0, *c0, *p;
193129459361Smrg    m0 = malloc(0);
193229459361Smrg    p = malloc(10);
193329459361Smrg    r0 = realloc(p,0);
193429459361Smrg    c0 = calloc(0);
193529459361Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
193629459361Smrg}],
193729459361Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1938c3c9b392Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
1939c3c9b392Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
194029459361Smrgfi
194129459361SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
194229459361Smrg
194329459361Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
194429459361Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
194529459361Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
194629459361Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
194729459361Smrgelse
194829459361Smrg	MALLOC_ZERO_CFLAGS=""
194929459361Smrg	XMALLOC_ZERO_CFLAGS=""
195029459361Smrg	XTMALLOC_ZERO_CFLAGS=""
195129459361Smrgfi
195229459361Smrg
195329459361SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
195429459361SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
195529459361SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
195629459361Smrg]) # XORG_CHECK_MALLOC_ZERO
195729459361Smrg
195829459361Smrg# XORG_WITH_LINT()
195929459361Smrg# ----------------
196029459361Smrg# Minimum version: 1.1.0
196129459361Smrg#
1962c3c9b392Smrg# This macro enables the use of a tool that flags some suspicious and
1963c3c9b392Smrg# non-portable constructs (likely to be bugs) in C language source code.
1964c3c9b392Smrg# It will attempt to locate the tool and use appropriate options.
1965c3c9b392Smrg# There are various lint type tools on different platforms.
1966c3c9b392Smrg#
1967c3c9b392Smrg# Interface to module:
1968c3c9b392Smrg# LINT:		returns the path to the tool found on the platform
1969c3c9b392Smrg#		or the value set to LINT on the configure cmd line
1970c3c9b392Smrg#		also an Automake conditional
1971c3c9b392Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
1972c3c9b392Smrg#
1973c3c9b392Smrg# --with-lint:	'yes' user instructs the module to use lint
1974c3c9b392Smrg#		'no' user instructs the module not to use lint (default)
1975c3c9b392Smrg#
1976c3c9b392Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1977c3c9b392Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
197829459361Smrg#
197929459361SmrgAC_DEFUN([XORG_WITH_LINT],[
198029459361Smrg
1981c3c9b392SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1982c3c9b392SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
19835715adc0SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
198429459361Smrg		[Use a lint-style source code checker (default: disabled)])],
198529459361Smrg		[use_lint=$withval], [use_lint=no])
1986c3c9b392Smrg
1987c3c9b392Smrg# Obtain platform specific info like program name and options
1988c3c9b392Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1989c3c9b392Smrgcase $host_os in
1990c3c9b392Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1991c3c9b392Smrg	lint_name=splint
1992c3c9b392Smrg	lint_options="-badflag"
1993c3c9b392Smrg	;;
1994c3c9b392Smrg  *freebsd* | *netbsd*)
1995c3c9b392Smrg	lint_name=lint
1996c3c9b392Smrg	lint_options="-u -b"
1997c3c9b392Smrg	;;
1998c3c9b392Smrg  *solaris*)
1999c3c9b392Smrg	lint_name=lint
2000c3c9b392Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
2001c3c9b392Smrg	;;
2002c3c9b392Smrgesac
2003c3c9b392Smrg
2004c3c9b392Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
2005c3c9b392Smrgif test "x$use_lint" = x"yes" ; then
2006c3c9b392Smrg   AC_PATH_PROG([LINT], [$lint_name])
2007c3c9b392Smrg   if test "x$LINT" = "x"; then
2008c3c9b392Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
2009c3c9b392Smrg   fi
2010c3c9b392Smrgelif test "x$use_lint" = x"no" ; then
2011c3c9b392Smrg   if test "x$LINT" != "x"; then
2012c3c9b392Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
2013c3c9b392Smrg   fi
201429459361Smrgelse
2015c3c9b392Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
201629459361Smrgfi
2017c3c9b392Smrg
2018c3c9b392Smrg# User supplied flags override default flags
2019c3c9b392Smrgif test "x$LINT_FLAGS" != "x"; then
2020c3c9b392Smrg   lint_options=$LINT_FLAGS
202129459361Smrgfi
202229459361Smrg
2023c3c9b392SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
2024c3c9b392SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
202529459361Smrg
202629459361Smrg]) # XORG_WITH_LINT
202729459361Smrg
202829459361Smrg# XORG_LINT_LIBRARY(LIBNAME)
202929459361Smrg# --------------------------
203029459361Smrg# Minimum version: 1.1.0
203129459361Smrg#
203229459361Smrg# Sets up flags for building lint libraries for checking programs that call
203329459361Smrg# functions in the library.
203429459361Smrg#
2035c3c9b392Smrg# Interface to module:
2036c3c9b392Smrg# LINTLIB		- Automake variable with the name of lint library file to make
2037c3c9b392Smrg# MAKE_LINT_LIB		- Automake conditional
2038c3c9b392Smrg#
2039c3c9b392Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
2040c3c9b392Smrg#			  - 'no' user instructs the module not to create a lint library (default)
204129459361Smrg
204229459361SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
204329459361SmrgAC_REQUIRE([XORG_WITH_LINT])
20445715adc0SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
204529459361Smrg	[Create lint library (default: disabled)])],
204629459361Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
2047c3c9b392Smrg
2048c3c9b392Smrgif test "x$make_lint_lib" = x"yes" ; then
2049c3c9b392Smrg   LINTLIB=llib-l$1.ln
2050c3c9b392Smrg   if test "x$LINT" = "x"; then
2051c3c9b392Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
2052c3c9b392Smrg   fi
2053c3c9b392Smrgelif test "x$make_lint_lib" != x"no" ; then
2054c3c9b392Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
205529459361Smrgfi
2056c3c9b392Smrg
205729459361SmrgAC_SUBST(LINTLIB)
205829459361SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
205929459361Smrg
206029459361Smrg]) # XORG_LINT_LIBRARY
206129459361Smrg
20625715adc0Smrg# XORG_CWARNFLAGS
20635715adc0Smrg# ---------------
20645715adc0Smrg# Minimum version: 1.2.0
20655715adc0Smrg#
20665715adc0Smrg# Defines CWARNFLAGS to enable C compiler warnings.
20675715adc0Smrg#
20685715adc0SmrgAC_DEFUN([XORG_CWARNFLAGS], [
2069c3c9b392SmrgAC_REQUIRE([AC_PROG_CC_C99])
20705715adc0Smrgif  test "x$GCC" = xyes ; then
20715715adc0Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
20725715adc0Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
2073c3c9b392Smrg-Wbad-function-cast -Wformat=2"
20745715adc0Smrg    case `$CC -dumpversion` in
20755715adc0Smrg    3.4.* | 4.*)
20765715adc0Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
20775715adc0Smrg	;;
20785715adc0Smrg    esac
20795715adc0Smrgelse
20805715adc0Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
20815715adc0Smrg    if test "x$SUNCC" = "xyes"; then
20825715adc0Smrg	CWARNFLAGS="-v"
20835715adc0Smrg    fi
20845715adc0Smrgfi
20855715adc0SmrgAC_SUBST(CWARNFLAGS)
20865715adc0Smrg]) # XORG_CWARNFLAGS
20875715adc0Smrg
20885715adc0Smrg# XORG_STRICT_OPTION
20895715adc0Smrg# -----------------------
20905715adc0Smrg# Minimum version: 1.3.0
20915715adc0Smrg#
20925715adc0Smrg# Add configure option to enable strict compilation
20935715adc0SmrgAC_DEFUN([XORG_STRICT_OPTION], [
2094c3c9b392Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
20955715adc0SmrgAC_REQUIRE([AC_PROG_CC_C99])
20965715adc0SmrgAC_REQUIRE([XORG_CWARNFLAGS])
20975715adc0Smrg
20985715adc0SmrgAC_ARG_ENABLE(strict-compilation,
20995715adc0Smrg			  AS_HELP_STRING([--enable-strict-compilation],
21005715adc0Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
21015715adc0Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
21025715adc0Smrgif test "x$STRICT_COMPILE" = "xyes"; then
21035715adc0Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
21045715adc0Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
21055715adc0Smrg	if test "x$GCC" = xyes ; then
21065715adc0Smrg		STRICT_CFLAGS="-pedantic -Werror"
21075715adc0Smrg	elif test "x$SUNCC" = "xyes"; then
21085715adc0Smrg		STRICT_CFLAGS="-errwarn"
21095715adc0Smrg    elif test "x$INTELCC" = "xyes"; then
21105715adc0Smrg		STRICT_CFLAGS="-Werror"
21115715adc0Smrg	fi
21125715adc0Smrgfi
21135715adc0SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
21145715adc0SmrgAC_SUBST([CWARNFLAGS])
21155715adc0Smrg]) # XORG_STRICT_OPTION
21165715adc0Smrg
21175715adc0Smrg# XORG_DEFAULT_OPTIONS
21185715adc0Smrg# --------------------
21195715adc0Smrg# Minimum version: 1.3.0
21205715adc0Smrg#
21215715adc0Smrg# Defines default options for X.Org modules.
21225715adc0Smrg#
21235715adc0SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
2124c3c9b392SmrgAC_REQUIRE([AC_PROG_INSTALL])
21255715adc0SmrgXORG_CWARNFLAGS
21265715adc0SmrgXORG_STRICT_OPTION
21275715adc0SmrgXORG_RELEASE_VERSION
21285715adc0SmrgXORG_CHANGELOG
2129c3c9b392SmrgXORG_INSTALL
21305715adc0SmrgXORG_MANPAGE_SECTIONS
2131c3c9b392Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2132c3c9b392Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
21335715adc0Smrg]) # XORG_DEFAULT_OPTIONS
2134c3c9b392Smrg
2135c3c9b392Smrg# XORG_INSTALL()
2136c3c9b392Smrg# ----------------
2137c3c9b392Smrg# Minimum version: 1.4.0
2138c3c9b392Smrg#
2139c3c9b392Smrg# Defines the variable INSTALL_CMD as the command to copy
2140c3c9b392Smrg# INSTALL from $prefix/share/util-macros.
2141c3c9b392Smrg#
2142c3c9b392SmrgAC_DEFUN([XORG_INSTALL], [
2143c3c9b392SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
2144c3c9b392Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2145c3c9b392SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2146c3c9b392Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2147c3c9b392Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
2148c3c9b392Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
2149c3c9b392SmrgAC_SUBST([INSTALL_CMD])
2150c3c9b392Smrg]) # XORG_INSTALL
215129459361Smrgdnl Copyright 2005 Red Hat, Inc
215229459361Smrgdnl
215329459361Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
215429459361Smrgdnl documentation for any purpose is hereby granted without fee, provided that
215529459361Smrgdnl the above copyright notice appear in all copies and that both that
215629459361Smrgdnl copyright notice and this permission notice appear in supporting
215729459361Smrgdnl documentation.
215829459361Smrgdnl
215929459361Smrgdnl The above copyright notice and this permission notice shall be included
216029459361Smrgdnl in all copies or substantial portions of the Software.
216129459361Smrgdnl
216229459361Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
216329459361Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
216429459361Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
216529459361Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
216629459361Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
216729459361Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
216829459361Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
216929459361Smrgdnl
217029459361Smrgdnl Except as contained in this notice, the name of the copyright holders shall
217129459361Smrgdnl not be used in advertising or otherwise to promote the sale, use or
217229459361Smrgdnl other dealings in this Software without prior written authorization
217329459361Smrgdnl from the copyright holders.
217429459361Smrgdnl
217529459361Smrg
217629459361Smrg# XORG_RELEASE_VERSION
217729459361Smrg# --------------------
2178c3c9b392Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
217929459361Smrg 
218029459361SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
218129459361Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
218229459361Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
218329459361Smrg		[Major version of this package])
21845715adc0Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
218529459361Smrg	if test "x$PVM" = "x"; then
218629459361Smrg		PVM="0"
218729459361Smrg	fi
218829459361Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
218929459361Smrg		[$PVM],
219029459361Smrg		[Minor version of this package])
21915715adc0Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
219229459361Smrg	if test "x$PVP" = "x"; then
219329459361Smrg		PVP="0"
219429459361Smrg	fi
219529459361Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
219629459361Smrg		[$PVP],
219729459361Smrg		[Patch version of this package])
219829459361Smrg])
219929459361Smrg
22005715adc0Smrg# XORG_CHANGELOG()
22015715adc0Smrg# ----------------
22025715adc0Smrg# Minimum version: 1.2.0
22035715adc0Smrg#
22045715adc0Smrg# Defines the variable CHANGELOG_CMD as the command to generate
22055715adc0Smrg# ChangeLog from git.
22065715adc0Smrg#
22075715adc0Smrg#
22085715adc0SmrgAC_DEFUN([XORG_CHANGELOG], [
2209c3c9b392SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
2210c3c9b392Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2211c3c9b392Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
22125715adc0Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
22135715adc0SmrgAC_SUBST([CHANGELOG_CMD])
22145715adc0Smrg]) # XORG_CHANGELOG
22155715adc0Smrg
221629459361Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
221729459361Smrg# 
221829459361Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
221929459361Smrg#
222029459361Smrg# This program is free software; you can redistribute it and/or modify
222129459361Smrg# it under the terms of the GNU General Public License as published by
222229459361Smrg# the Free Software Foundation; either version 2 of the License, or
222329459361Smrg# (at your option) any later version.
222429459361Smrg#
222529459361Smrg# This program is distributed in the hope that it will be useful, but
222629459361Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
222729459361Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
222829459361Smrg# General Public License for more details.
222929459361Smrg#
223029459361Smrg# You should have received a copy of the GNU General Public License
223129459361Smrg# along with this program; if not, write to the Free Software
223229459361Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
223329459361Smrg#
223429459361Smrg# As a special exception to the GNU General Public License, if you
223529459361Smrg# distribute this file as part of a program that contains a
223629459361Smrg# configuration script generated by Autoconf, you may include it under
223729459361Smrg# the same distribution terms that you use for the rest of that program.
223829459361Smrg
223929459361Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
224029459361Smrg# ----------------------------------
224129459361SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
224229459361Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
224329459361Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
224429459361SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
224529459361Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
224629459361Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
224729459361Smrgfi
224829459361Smrgif test -n "$PKG_CONFIG"; then
22495715adc0Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
225029459361Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
225129459361Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
225229459361Smrg		AC_MSG_RESULT([yes])
225329459361Smrg	else
225429459361Smrg		AC_MSG_RESULT([no])
225529459361Smrg		PKG_CONFIG=""
225629459361Smrg	fi
225729459361Smrg		
225829459361Smrgfi[]dnl
225929459361Smrg])# PKG_PROG_PKG_CONFIG
226029459361Smrg
226129459361Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
226229459361Smrg#
226329459361Smrg# Check to see whether a particular set of modules exists.  Similar
226429459361Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
226529459361Smrg#
226629459361Smrg#
226729459361Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
226829459361Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
226929459361Smrg# PKG_CHECK_EXISTS manually
227029459361Smrg# --------------------------------------------------------------
227129459361SmrgAC_DEFUN([PKG_CHECK_EXISTS],
227229459361Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
227329459361Smrgif test -n "$PKG_CONFIG" && \
227429459361Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
227529459361Smrg  m4_ifval([$2], [$2], [:])
227629459361Smrgm4_ifvaln([$3], [else
227729459361Smrg  $3])dnl
227829459361Smrgfi])
227929459361Smrg
228029459361Smrg
228129459361Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
228229459361Smrg# ---------------------------------------------
228329459361Smrgm4_define([_PKG_CONFIG],
22845715adc0Smrg[if test -n "$$1"; then
22855715adc0Smrg    pkg_cv_[]$1="$$1"
22865715adc0Smrg elif test -n "$PKG_CONFIG"; then
22875715adc0Smrg    PKG_CHECK_EXISTS([$3],
22885715adc0Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
22895715adc0Smrg		     [pkg_failed=yes])
22905715adc0Smrg else
22915715adc0Smrg    pkg_failed=untried
229229459361Smrgfi[]dnl
229329459361Smrg])# _PKG_CONFIG
229429459361Smrg
22955715adc0Smrg# _PKG_SHORT_ERRORS_SUPPORTED
22965715adc0Smrg# -----------------------------
22975715adc0SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
22985715adc0Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
22995715adc0Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
23005715adc0Smrg        _pkg_short_errors_supported=yes
23015715adc0Smrgelse
23025715adc0Smrg        _pkg_short_errors_supported=no
23035715adc0Smrgfi[]dnl
23045715adc0Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
23055715adc0Smrg
23065715adc0Smrg
230729459361Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
230829459361Smrg# [ACTION-IF-NOT-FOUND])
230929459361Smrg#
231029459361Smrg#
231129459361Smrg# Note that if there is a possibility the first call to
231229459361Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
231329459361Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
231429459361Smrg#
231529459361Smrg#
231629459361Smrg# --------------------------------------------------------------
231729459361SmrgAC_DEFUN([PKG_CHECK_MODULES],
231829459361Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
231929459361SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
232029459361SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
232129459361Smrg
232229459361Smrgpkg_failed=no
232329459361SmrgAC_MSG_CHECKING([for $1])
232429459361Smrg
232529459361Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
232629459361Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
232729459361Smrg
23285715adc0Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
23295715adc0Smrgand $1[]_LIBS to avoid the need to call pkg-config.
23305715adc0SmrgSee the pkg-config man page for more details.])
23315715adc0Smrg
233229459361Smrgif test $pkg_failed = yes; then
23335715adc0Smrg        _PKG_SHORT_ERRORS_SUPPORTED
23345715adc0Smrg        if test $_pkg_short_errors_supported = yes; then
23355715adc0Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
23365715adc0Smrg        else 
23375715adc0Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
23385715adc0Smrg        fi
233929459361Smrg	# Put the nasty error message in config.log where it belongs
23405715adc0Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
234129459361Smrg
234229459361Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
23435715adc0Smrg[Package requirements ($2) were not met:
23445715adc0Smrg
23455715adc0Smrg$$1_PKG_ERRORS
23465715adc0Smrg
234729459361SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
234829459361Smrginstalled software in a non-standard prefix.
234929459361Smrg
23505715adc0Smrg_PKG_TEXT
23515715adc0Smrg])],
23525715adc0Smrg		[AC_MSG_RESULT([no])
23535715adc0Smrg                $4])
235429459361Smrgelif test $pkg_failed = untried; then
235529459361Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
235629459361Smrg[The pkg-config script could not be found or is too old.  Make sure it
235729459361Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
235829459361Smrgpath to pkg-config.
235929459361Smrg
23605715adc0Smrg_PKG_TEXT
236129459361Smrg
23625715adc0SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
236329459361Smrg		[$4])
236429459361Smrgelse
236529459361Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
236629459361Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
236729459361Smrg        AC_MSG_RESULT([yes])
236829459361Smrg	ifelse([$3], , :, [$3])
236929459361Smrgfi[]dnl
237029459361Smrg])# PKG_CHECK_MODULES
237129459361Smrg
2372