aclocal.m4 revision 1b2353db
11b2353dbSmrg# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
21b2353dbSmrg
31b2353dbSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
421c2f794Smrg
521c2f794Smrg# This file is free software; the Free Software Foundation
621c2f794Smrg# gives unlimited permission to copy and/or distribute it,
721c2f794Smrg# with or without modifications, as long as this notice is preserved.
821c2f794Smrg
921c2f794Smrg# This program is distributed in the hope that it will be useful,
1021c2f794Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1121c2f794Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1221c2f794Smrg# PARTICULAR PURPOSE.
1321c2f794Smrg
141b2353dbSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
1512391620Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1612391620Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
171b2353dbSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
181b2353dbSmrg[m4_warning([this file was generated for autoconf 2.69.
1912391620SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
2012391620SmrgIf you have problems, you may need to regenerate the build system entirely.
211b2353dbSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
2221c2f794Smrg
231b2353dbSmrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
2421c2f794Smrg#
2521c2f794Smrg# This file is free software; the Free Software Foundation
2621c2f794Smrg# gives unlimited permission to copy and/or distribute it,
2721c2f794Smrg# with or without modifications, as long as this notice is preserved.
2821c2f794Smrg
2921c2f794Smrg# AM_AUTOMAKE_VERSION(VERSION)
3021c2f794Smrg# ----------------------------
3121c2f794Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3221c2f794Smrg# generated from the m4 files accompanying Automake X.Y.
3321c2f794Smrg# (This private macro should not be called outside this file.)
3421c2f794SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
351b2353dbSmrg[am__api_version='1.14'
3621c2f794Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3721c2f794Smrgdnl require some minimum version.  Point them to the right macro.
381b2353dbSmrgm4_if([$1], [1.14.1], [],
3921c2f794Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
4021c2f794Smrg])
4121c2f794Smrg
4221c2f794Smrg# _AM_AUTOCONF_VERSION(VERSION)
4321c2f794Smrg# -----------------------------
4421c2f794Smrg# aclocal traces this macro to find the Autoconf version.
4521c2f794Smrg# This is a private macro too.  Using m4_define simplifies
4621c2f794Smrg# the logic in aclocal, which can simply ignore this definition.
4721c2f794Smrgm4_define([_AM_AUTOCONF_VERSION], [])
4821c2f794Smrg
4921c2f794Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
5021c2f794Smrg# -------------------------------
5121c2f794Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5212391620Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5321c2f794SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
541b2353dbSmrg[AM_AUTOMAKE_VERSION([1.14.1])dnl
5512391620Smrgm4_ifndef([AC_AUTOCONF_VERSION],
5612391620Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5712391620Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5821c2f794Smrg
5921c2f794Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
6021c2f794Smrg
611b2353dbSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
6221c2f794Smrg#
6321c2f794Smrg# This file is free software; the Free Software Foundation
6421c2f794Smrg# gives unlimited permission to copy and/or distribute it,
6521c2f794Smrg# with or without modifications, as long as this notice is preserved.
6621c2f794Smrg
6721c2f794Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
681b2353dbSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
691b2353dbSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
7021c2f794Smrg#
7121c2f794Smrg# Of course, Automake must honor this variable whenever it calls a
7221c2f794Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7321c2f794Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7421c2f794Smrg# depending on how configure is run.  This is pretty annoying, since
7521c2f794Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7621c2f794Smrg# source directory, any form will work fine, but in subdirectories a
7721c2f794Smrg# relative path needs to be adjusted first.
7821c2f794Smrg#
7921c2f794Smrg# $ac_aux_dir/missing
8021c2f794Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8121c2f794Smrg# $top_srcdir/$ac_aux_dir/missing
8221c2f794Smrg#    fails if $ac_aux_dir is absolute,
8321c2f794Smrg#    fails when called from a subdirectory in a VPATH build with
8421c2f794Smrg#          a relative $ac_aux_dir
8521c2f794Smrg#
8621c2f794Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8721c2f794Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
881b2353dbSmrg# harmless because $srcdir is '.', but things will broke when you
8921c2f794Smrg# start a VPATH build or use an absolute $srcdir.
9021c2f794Smrg#
9121c2f794Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9221c2f794Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9321c2f794Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9421c2f794Smrg# and then we would define $MISSING as
9521c2f794Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9621c2f794Smrg# This will work as long as MISSING is not called from configure, because
9721c2f794Smrg# unfortunately $(top_srcdir) has no meaning in configure.
9821c2f794Smrg# However there are other variables, like CC, which are often used in
9921c2f794Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
10021c2f794Smrg#
10121c2f794Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
10221c2f794Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
10321c2f794Smrg# configured tree to be moved without reconfiguration.
10421c2f794Smrg
10521c2f794SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10621c2f794Smrg[dnl Rely on autoconf to set up CDPATH properly.
10721c2f794SmrgAC_PREREQ([2.50])dnl
10821c2f794Smrg# expand $ac_aux_dir to an absolute path
10921c2f794Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
11021c2f794Smrg])
11121c2f794Smrg
11221c2f794Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11321c2f794Smrg
1141b2353dbSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
11521c2f794Smrg#
11621c2f794Smrg# This file is free software; the Free Software Foundation
11721c2f794Smrg# gives unlimited permission to copy and/or distribute it,
11821c2f794Smrg# with or without modifications, as long as this notice is preserved.
11921c2f794Smrg
12021c2f794Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12121c2f794Smrg# -------------------------------------
12221c2f794Smrg# Define a conditional.
12321c2f794SmrgAC_DEFUN([AM_CONDITIONAL],
1241b2353dbSmrg[AC_PREREQ([2.52])dnl
1251b2353dbSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1261b2353dbSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12721c2f794SmrgAC_SUBST([$1_TRUE])dnl
12821c2f794SmrgAC_SUBST([$1_FALSE])dnl
12921c2f794Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
13021c2f794Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
13112391620Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13221c2f794Smrgif $2; then
13321c2f794Smrg  $1_TRUE=
13421c2f794Smrg  $1_FALSE='#'
13521c2f794Smrgelse
13621c2f794Smrg  $1_TRUE='#'
13721c2f794Smrg  $1_FALSE=
13821c2f794Smrgfi
13921c2f794SmrgAC_CONFIG_COMMANDS_PRE(
14021c2f794Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14121c2f794Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14221c2f794SmrgUsually this means the macro was only invoked conditionally.]])
14321c2f794Smrgfi])])
14421c2f794Smrg
1451b2353dbSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
14621c2f794Smrg#
14721c2f794Smrg# This file is free software; the Free Software Foundation
14821c2f794Smrg# gives unlimited permission to copy and/or distribute it,
14921c2f794Smrg# with or without modifications, as long as this notice is preserved.
15021c2f794Smrg
15121c2f794Smrg
1521b2353dbSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
15321c2f794Smrg# written in clear, in which case automake, when reading aclocal.m4,
15421c2f794Smrg# will think it sees a *use*, and therefore will trigger all it's
15521c2f794Smrg# C support machinery.  Also note that it means that autoscan, seeing
15621c2f794Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
15721c2f794Smrg
15821c2f794Smrg
15921c2f794Smrg# _AM_DEPENDENCIES(NAME)
16021c2f794Smrg# ----------------------
16121c2f794Smrg# See how the compiler implements dependency checking.
1621b2353dbSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
16321c2f794Smrg# We try a few techniques and use that to set a single cache variable.
16421c2f794Smrg#
16521c2f794Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
16621c2f794Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
16721c2f794Smrg# dependency, and given that the user is not expected to run this macro,
16821c2f794Smrg# just rely on AC_PROG_CC.
16921c2f794SmrgAC_DEFUN([_AM_DEPENDENCIES],
17021c2f794Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
17121c2f794SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
17221c2f794SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
17321c2f794SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
17421c2f794Smrg
1751b2353dbSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
1761b2353dbSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
1771b2353dbSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1781b2353dbSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1791b2353dbSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
1801b2353dbSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1811b2353dbSmrg                    [depcc="$$1"   am_compiler_list=])
18221c2f794Smrg
18321c2f794SmrgAC_CACHE_CHECK([dependency style of $depcc],
18421c2f794Smrg               [am_cv_$1_dependencies_compiler_type],
18521c2f794Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
18621c2f794Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
18721c2f794Smrg  # making bogus files that we don't know about and never remove.  For
18821c2f794Smrg  # instance it was reported that on HP-UX the gcc test will end up
1891b2353dbSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
1901b2353dbSmrg  # in D".
19182e12b1bSmrg  rm -rf conftest.dir
19221c2f794Smrg  mkdir conftest.dir
19321c2f794Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19421c2f794Smrg  # using a relative directory.
19521c2f794Smrg  cp "$am_depcomp" conftest.dir
19621c2f794Smrg  cd conftest.dir
19721c2f794Smrg  # We will build objects and dependencies in a subdirectory because
19821c2f794Smrg  # it helps to detect inapplicable dependency modes.  For instance
19921c2f794Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
20021c2f794Smrg  # side effect of compilation, but ICC will put the dependencies in
20121c2f794Smrg  # the current directory while Tru64 will put them in the object
20221c2f794Smrg  # directory.
20321c2f794Smrg  mkdir sub
20421c2f794Smrg
20521c2f794Smrg  am_cv_$1_dependencies_compiler_type=none
20621c2f794Smrg  if test "$am_compiler_list" = ""; then
20721c2f794Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
20821c2f794Smrg  fi
20912391620Smrg  am__universal=false
21012391620Smrg  m4_case([$1], [CC],
21112391620Smrg    [case " $depcc " in #(
21212391620Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21312391620Smrg     esac],
21412391620Smrg    [CXX],
21512391620Smrg    [case " $depcc " in #(
21612391620Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21712391620Smrg     esac])
21812391620Smrg
21921c2f794Smrg  for depmode in $am_compiler_list; do
22021c2f794Smrg    # Setup a source with many dependencies, because some compilers
22121c2f794Smrg    # like to wrap large dependency lists on column 80 (with \), and
22221c2f794Smrg    # we should not choose a depcomp mode which is confused by this.
22321c2f794Smrg    #
22421c2f794Smrg    # We need to recreate these files for each test, as the compiler may
22521c2f794Smrg    # overwrite some of them when testing with obscure command lines.
22621c2f794Smrg    # This happens at least with the AIX C compiler.
22721c2f794Smrg    : > sub/conftest.c
22821c2f794Smrg    for i in 1 2 3 4 5 6; do
22921c2f794Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2301b2353dbSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
2311b2353dbSmrg      # Solaris 10 /bin/sh.
2321b2353dbSmrg      echo '/* dummy */' > sub/conftst$i.h
23321c2f794Smrg    done
23421c2f794Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
23521c2f794Smrg
2361b2353dbSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
23712391620Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2381b2353dbSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
2391b2353dbSmrg    # versions had trouble with output in subdirs.
24012391620Smrg    am__obj=sub/conftest.${OBJEXT-o}
24112391620Smrg    am__minus_obj="-o $am__obj"
24221c2f794Smrg    case $depmode in
24312391620Smrg    gcc)
24412391620Smrg      # This depmode causes a compiler race in universal mode.
24512391620Smrg      test "$am__universal" = false || continue
24612391620Smrg      ;;
24721c2f794Smrg    nosideeffect)
2481b2353dbSmrg      # After this tag, mechanisms are not by side-effect, so they'll
2491b2353dbSmrg      # only be used when explicitly requested.
25021c2f794Smrg      if test "x$enable_dependency_tracking" = xyes; then
25121c2f794Smrg	continue
25221c2f794Smrg      else
25321c2f794Smrg	break
25421c2f794Smrg      fi
25521c2f794Smrg      ;;
25682e12b1bSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
2571b2353dbSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
25812391620Smrg      # not run yet.  These depmodes are late enough in the game, and
25912391620Smrg      # so weak that their functioning should not be impacted.
26012391620Smrg      am__obj=conftest.${OBJEXT-o}
26112391620Smrg      am__minus_obj=
26212391620Smrg      ;;
26321c2f794Smrg    none) break ;;
26421c2f794Smrg    esac
26521c2f794Smrg    if depmode=$depmode \
26612391620Smrg       source=sub/conftest.c object=$am__obj \
26721c2f794Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
26812391620Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
26921c2f794Smrg         >/dev/null 2>conftest.err &&
27021c2f794Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
27121c2f794Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27212391620Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
27321c2f794Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
27421c2f794Smrg      # icc doesn't choke on unknown options, it will just issue warnings
27521c2f794Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
27621c2f794Smrg      # that says an option was ignored or not supported.
27721c2f794Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
27821c2f794Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
27921c2f794Smrg      # The diagnosis changed in icc 8.0:
28021c2f794Smrg      #   icc: Command line remark: option '-MP' not supported
28121c2f794Smrg      if (grep 'ignoring option' conftest.err ||
28221c2f794Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
28321c2f794Smrg        am_cv_$1_dependencies_compiler_type=$depmode
28421c2f794Smrg        break
28521c2f794Smrg      fi
28621c2f794Smrg    fi
28721c2f794Smrg  done
28821c2f794Smrg
28921c2f794Smrg  cd ..
29021c2f794Smrg  rm -rf conftest.dir
29121c2f794Smrgelse
29221c2f794Smrg  am_cv_$1_dependencies_compiler_type=none
29321c2f794Smrgfi
29421c2f794Smrg])
29521c2f794SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
29621c2f794SmrgAM_CONDITIONAL([am__fastdep$1], [
29721c2f794Smrg  test "x$enable_dependency_tracking" != xno \
29821c2f794Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
29921c2f794Smrg])
30021c2f794Smrg
30121c2f794Smrg
30221c2f794Smrg# AM_SET_DEPDIR
30321c2f794Smrg# -------------
30421c2f794Smrg# Choose a directory name for dependency files.
3051b2353dbSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
30621c2f794SmrgAC_DEFUN([AM_SET_DEPDIR],
30721c2f794Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
30821c2f794SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
30921c2f794Smrg])
31021c2f794Smrg
31121c2f794Smrg
31221c2f794Smrg# AM_DEP_TRACK
31321c2f794Smrg# ------------
31421c2f794SmrgAC_DEFUN([AM_DEP_TRACK],
3151b2353dbSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
3161b2353dbSmrgAS_HELP_STRING(
3171b2353dbSmrg  [--enable-dependency-tracking],
3181b2353dbSmrg  [do not reject slow dependency extractors])
3191b2353dbSmrgAS_HELP_STRING(
3201b2353dbSmrg  [--disable-dependency-tracking],
3211b2353dbSmrg  [speeds up one-time build])])
32221c2f794Smrgif test "x$enable_dependency_tracking" != xno; then
32321c2f794Smrg  am_depcomp="$ac_aux_dir/depcomp"
32421c2f794Smrg  AMDEPBACKSLASH='\'
32582e12b1bSmrg  am__nodep='_no'
32621c2f794Smrgfi
32721c2f794SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
32821c2f794SmrgAC_SUBST([AMDEPBACKSLASH])dnl
32921c2f794Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
33082e12b1bSmrgAC_SUBST([am__nodep])dnl
33182e12b1bSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
33221c2f794Smrg])
33321c2f794Smrg
33421c2f794Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
33521c2f794Smrg
3361b2353dbSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
33721c2f794Smrg#
33821c2f794Smrg# This file is free software; the Free Software Foundation
33921c2f794Smrg# gives unlimited permission to copy and/or distribute it,
34021c2f794Smrg# with or without modifications, as long as this notice is preserved.
34121c2f794Smrg
34221c2f794Smrg
34321c2f794Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
34421c2f794Smrg# ------------------------------
34521c2f794SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
34612391620Smrg[{
3471b2353dbSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
34812391620Smrg  # are listed without --file.  Let's play safe and only enable the eval
34912391620Smrg  # if we detect the quoting.
35012391620Smrg  case $CONFIG_FILES in
35112391620Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
35212391620Smrg  *)   set x $CONFIG_FILES ;;
35312391620Smrg  esac
35412391620Smrg  shift
35512391620Smrg  for mf
35612391620Smrg  do
35712391620Smrg    # Strip MF so we end up with the name of the file.
35812391620Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
35912391620Smrg    # Check whether this is an Automake generated Makefile or not.
3601b2353dbSmrg    # We used to match only the files named 'Makefile.in', but
36112391620Smrg    # some people rename them; so instead we look at the file content.
36212391620Smrg    # Grep'ing the first line is not enough: some people post-process
36312391620Smrg    # each Makefile.in and add a new line on top of each file to say so.
36412391620Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
36512391620Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
36612391620Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36712391620Smrg      dirpart=`AS_DIRNAME("$mf")`
36812391620Smrg    else
36912391620Smrg      continue
37012391620Smrg    fi
37112391620Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
3721b2353dbSmrg    # from the Makefile without running 'make'.
37312391620Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
37412391620Smrg    test -z "$DEPDIR" && continue
37512391620Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3761b2353dbSmrg    test -z "$am__include" && continue
37712391620Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37812391620Smrg    # Find all dependency output files, they are included files with
37912391620Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
38012391620Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
38112391620Smrg    # expansion.
38212391620Smrg    for file in `sed -n "
38312391620Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3841b2353dbSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
38512391620Smrg      # Make sure the directory exists.
38612391620Smrg      test -f "$dirpart/$file" && continue
38712391620Smrg      fdir=`AS_DIRNAME(["$file"])`
38812391620Smrg      AS_MKDIR_P([$dirpart/$fdir])
38912391620Smrg      # echo "creating $dirpart/$file"
39012391620Smrg      echo '# dummy' > "$dirpart/$file"
39112391620Smrg    done
39221c2f794Smrg  done
39312391620Smrg}
39421c2f794Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
39521c2f794Smrg
39621c2f794Smrg
39721c2f794Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
39821c2f794Smrg# -----------------------------
39921c2f794Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
40021c2f794Smrg#
40121c2f794Smrg# This code is only required when automatic dependency tracking
4021b2353dbSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
40321c2f794Smrg# need in order to bootstrap the dependency handling code.
40421c2f794SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
40521c2f794Smrg[AC_CONFIG_COMMANDS([depfiles],
40621c2f794Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
40721c2f794Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
40821c2f794Smrg])
40921c2f794Smrg
41021c2f794Smrg# Do all the work for Automake.                             -*- Autoconf -*-
41121c2f794Smrg
4121b2353dbSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
41321c2f794Smrg#
41421c2f794Smrg# This file is free software; the Free Software Foundation
41521c2f794Smrg# gives unlimited permission to copy and/or distribute it,
41621c2f794Smrg# with or without modifications, as long as this notice is preserved.
41721c2f794Smrg
41821c2f794Smrg# This macro actually does too much.  Some checks are only needed if
41921c2f794Smrg# your package does certain things.  But this isn't really a big deal.
42021c2f794Smrg
4211b2353dbSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
4221b2353dbSmrgm4_define([AC_PROG_CC],
4231b2353dbSmrgm4_defn([AC_PROG_CC])
4241b2353dbSmrg[_AM_PROG_CC_C_O
4251b2353dbSmrg])
4261b2353dbSmrg
42721c2f794Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
42821c2f794Smrg# AM_INIT_AUTOMAKE([OPTIONS])
42921c2f794Smrg# -----------------------------------------------
43021c2f794Smrg# The call with PACKAGE and VERSION arguments is the old style
43121c2f794Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
43221c2f794Smrg# and VERSION should now be passed to AC_INIT and removed from
43321c2f794Smrg# the call to AM_INIT_AUTOMAKE.
43421c2f794Smrg# We support both call styles for the transition.  After
43521c2f794Smrg# the next Automake release, Autoconf can make the AC_INIT
43621c2f794Smrg# arguments mandatory, and then we can depend on a new Autoconf
43721c2f794Smrg# release and drop the old call support.
43821c2f794SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4391b2353dbSmrg[AC_PREREQ([2.65])dnl
44021c2f794Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
44121c2f794Smrgdnl the ones we care about.
44221c2f794Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
44321c2f794SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
44421c2f794SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
44521c2f794Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
44621c2f794Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
44721c2f794Smrg  # is not polluted with repeated "-I."
44821c2f794Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
44921c2f794Smrg  # test to see if srcdir already configured
45021c2f794Smrg  if test -f $srcdir/config.status; then
45121c2f794Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
45221c2f794Smrg  fi
45321c2f794Smrgfi
45421c2f794Smrg
45521c2f794Smrg# test whether we have cygpath
45621c2f794Smrgif test -z "$CYGPATH_W"; then
45721c2f794Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
45821c2f794Smrg    CYGPATH_W='cygpath -w'
45921c2f794Smrg  else
46021c2f794Smrg    CYGPATH_W=echo
46121c2f794Smrg  fi
46221c2f794Smrgfi
46321c2f794SmrgAC_SUBST([CYGPATH_W])
46421c2f794Smrg
46521c2f794Smrg# Define the identity of the package.
46621c2f794Smrgdnl Distinguish between old-style and new-style calls.
46721c2f794Smrgm4_ifval([$2],
4681b2353dbSmrg[AC_DIAGNOSE([obsolete],
4691b2353dbSmrg             [$0: two- and three-arguments forms are deprecated.])
4701b2353dbSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
47121c2f794Smrg AC_SUBST([PACKAGE], [$1])dnl
47221c2f794Smrg AC_SUBST([VERSION], [$2])],
47321c2f794Smrg[_AM_SET_OPTIONS([$1])dnl
47421c2f794Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4751b2353dbSmrgm4_if(
4761b2353dbSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
4771b2353dbSmrg  [ok:ok],,
47821c2f794Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
47921c2f794Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
48021c2f794Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
48121c2f794Smrg
48221c2f794Smrg_AM_IF_OPTION([no-define],,
4831b2353dbSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
4841b2353dbSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
48521c2f794Smrg
48621c2f794Smrg# Some tools Automake needs.
48721c2f794SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
48821c2f794SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4891b2353dbSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
4901b2353dbSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
4911b2353dbSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
4921b2353dbSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
4931b2353dbSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
49412391620SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
49512391620SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
4961b2353dbSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
4971b2353dbSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
4981b2353dbSmrg# dies out for good.  For more background, see:
4991b2353dbSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
5001b2353dbSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
5011b2353dbSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
50221c2f794Smrg# We need awk for the "check" target.  The system "awk" is bad on
50321c2f794Smrg# some platforms.
50421c2f794SmrgAC_REQUIRE([AC_PROG_AWK])dnl
50521c2f794SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
50621c2f794SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
50721c2f794Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
50812391620Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
50912391620Smrg			     [_AM_PROG_TAR([v7])])])
51021c2f794Smrg_AM_IF_OPTION([no-dependencies],,
51121c2f794Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
5121b2353dbSmrg		  [_AM_DEPENDENCIES([CC])],
5131b2353dbSmrg		  [m4_define([AC_PROG_CC],
5141b2353dbSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
51521c2f794SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5161b2353dbSmrg		  [_AM_DEPENDENCIES([CXX])],
5171b2353dbSmrg		  [m4_define([AC_PROG_CXX],
5181b2353dbSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
51921c2f794SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5201b2353dbSmrg		  [_AM_DEPENDENCIES([OBJC])],
5211b2353dbSmrg		  [m4_define([AC_PROG_OBJC],
5221b2353dbSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
5231b2353dbSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
5241b2353dbSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
5251b2353dbSmrg		  [m4_define([AC_PROG_OBJCXX],
5261b2353dbSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
52721c2f794Smrg])
5281b2353dbSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
5291b2353dbSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
5301b2353dbSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
5311b2353dbSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
53212391620SmrgAC_CONFIG_COMMANDS_PRE(dnl
53312391620Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
53412391620Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
53521c2f794Smrg
5361b2353dbSmrg# POSIX will say in a future version that running "rm -f" with no argument
5371b2353dbSmrg# is OK; and we want to be able to make that assumption in our Makefile
5381b2353dbSmrg# recipes.  So use an aggressive probe to check that the usage we want is
5391b2353dbSmrg# actually supported "in the wild" to an acceptable degree.
5401b2353dbSmrg# See automake bug#10828.
5411b2353dbSmrg# To make any issue more visible, cause the running configure to be aborted
5421b2353dbSmrg# by default if the 'rm' program in use doesn't match our expectations; the
5431b2353dbSmrg# user can still override this though.
5441b2353dbSmrgif rm -f && rm -fr && rm -rf; then : OK; else
5451b2353dbSmrg  cat >&2 <<'END'
5461b2353dbSmrgOops!
5471b2353dbSmrg
5481b2353dbSmrgYour 'rm' program seems unable to run without file operands specified
5491b2353dbSmrgon the command line, even when the '-f' option is present.  This is contrary
5501b2353dbSmrgto the behaviour of most rm programs out there, and not conforming with
5511b2353dbSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
5521b2353dbSmrg
5531b2353dbSmrgPlease tell bug-automake@gnu.org about your system, including the value
5541b2353dbSmrgof your $PATH and any error possibly output before this message.  This
5551b2353dbSmrgcan help us improve future automake versions.
5561b2353dbSmrg
5571b2353dbSmrgEND
5581b2353dbSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
5591b2353dbSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
5601b2353dbSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
5611b2353dbSmrg    echo >&2
5621b2353dbSmrg  else
5631b2353dbSmrg    cat >&2 <<'END'
5641b2353dbSmrgAborting the configuration process, to ensure you take notice of the issue.
5651b2353dbSmrg
5661b2353dbSmrgYou can download and install GNU coreutils to get an 'rm' implementation
5671b2353dbSmrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
5681b2353dbSmrg
5691b2353dbSmrgIf you want to complete the configuration process using your problematic
5701b2353dbSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
5711b2353dbSmrgto "yes", and re-run configure.
5721b2353dbSmrg
5731b2353dbSmrgEND
5741b2353dbSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
5751b2353dbSmrg  fi
5761b2353dbSmrgfi])
5771b2353dbSmrg
5781b2353dbSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
57912391620Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
58012391620Smrgdnl mangled by Autoconf and run in a shell conditional statement.
58112391620Smrgm4_define([_AC_COMPILER_EXEEXT],
58212391620Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
58312391620Smrg
58421c2f794Smrg# When config.status generates a header, we must update the stamp-h file.
58521c2f794Smrg# This file resides in the same directory as the config header
58621c2f794Smrg# that is generated.  The stamp files are numbered to have different names.
58721c2f794Smrg
58821c2f794Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
58921c2f794Smrg# loop where config.status creates the headers, so we can generate
59021c2f794Smrg# our stamp files there.
59121c2f794SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
59221c2f794Smrg[# Compute $1's index in $config_headers.
59312391620Smrg_am_arg=$1
59421c2f794Smrg_am_stamp_count=1
59521c2f794Smrgfor _am_header in $config_headers :; do
59621c2f794Smrg  case $_am_header in
59712391620Smrg    $_am_arg | $_am_arg:* )
59821c2f794Smrg      break ;;
59921c2f794Smrg    * )
60021c2f794Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
60121c2f794Smrg  esac
60221c2f794Smrgdone
60312391620Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
60421c2f794Smrg
6051b2353dbSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
60621c2f794Smrg#
60721c2f794Smrg# This file is free software; the Free Software Foundation
60821c2f794Smrg# gives unlimited permission to copy and/or distribute it,
60921c2f794Smrg# with or without modifications, as long as this notice is preserved.
61021c2f794Smrg
61121c2f794Smrg# AM_PROG_INSTALL_SH
61221c2f794Smrg# ------------------
61321c2f794Smrg# Define $install_sh.
61421c2f794SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
61521c2f794Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
61612391620Smrgif test x"${install_sh}" != xset; then
61712391620Smrg  case $am_aux_dir in
61812391620Smrg  *\ * | *\	*)
61912391620Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
62012391620Smrg  *)
62112391620Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
62212391620Smrg  esac
62312391620Smrgfi
6241b2353dbSmrgAC_SUBST([install_sh])])
62521c2f794Smrg
6261b2353dbSmrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
62721c2f794Smrg#
62821c2f794Smrg# This file is free software; the Free Software Foundation
62921c2f794Smrg# gives unlimited permission to copy and/or distribute it,
63021c2f794Smrg# with or without modifications, as long as this notice is preserved.
63121c2f794Smrg
63221c2f794Smrg# Check whether the underlying file-system supports filenames
63321c2f794Smrg# with a leading dot.  For instance MS-DOS doesn't.
63421c2f794SmrgAC_DEFUN([AM_SET_LEADING_DOT],
63521c2f794Smrg[rm -rf .tst 2>/dev/null
63621c2f794Smrgmkdir .tst 2>/dev/null
63721c2f794Smrgif test -d .tst; then
63821c2f794Smrg  am__leading_dot=.
63921c2f794Smrgelse
64021c2f794Smrg  am__leading_dot=_
64121c2f794Smrgfi
64221c2f794Smrgrmdir .tst 2>/dev/null
64321c2f794SmrgAC_SUBST([am__leading_dot])])
64421c2f794Smrg
64521c2f794Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
64621c2f794Smrg
6471b2353dbSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
64821c2f794Smrg#
64921c2f794Smrg# This file is free software; the Free Software Foundation
65021c2f794Smrg# gives unlimited permission to copy and/or distribute it,
65121c2f794Smrg# with or without modifications, as long as this notice is preserved.
65221c2f794Smrg
65321c2f794Smrg# AM_MAKE_INCLUDE()
65421c2f794Smrg# -----------------
65521c2f794Smrg# Check to see how make treats includes.
65621c2f794SmrgAC_DEFUN([AM_MAKE_INCLUDE],
65721c2f794Smrg[am_make=${MAKE-make}
65821c2f794Smrgcat > confinc << 'END'
65921c2f794Smrgam__doit:
66012391620Smrg	@echo this is the am__doit target
66121c2f794Smrg.PHONY: am__doit
66221c2f794SmrgEND
66321c2f794Smrg# If we don't find an include directive, just comment out the code.
66421c2f794SmrgAC_MSG_CHECKING([for style of include used by $am_make])
66521c2f794Smrgam__include="#"
66621c2f794Smrgam__quote=
66721c2f794Smrg_am_result=none
66821c2f794Smrg# First try GNU make style include.
66921c2f794Smrgecho "include confinc" > confmf
6701b2353dbSmrg# Ignore all kinds of additional output from 'make'.
67112391620Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
67212391620Smrg*the\ am__doit\ target*)
67312391620Smrg  am__include=include
67412391620Smrg  am__quote=
67512391620Smrg  _am_result=GNU
67612391620Smrg  ;;
67712391620Smrgesac
67821c2f794Smrg# Now try BSD make style include.
67921c2f794Smrgif test "$am__include" = "#"; then
68021c2f794Smrg   echo '.include "confinc"' > confmf
68112391620Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
68212391620Smrg   *the\ am__doit\ target*)
68312391620Smrg     am__include=.include
68412391620Smrg     am__quote="\""
68512391620Smrg     _am_result=BSD
68612391620Smrg     ;;
68712391620Smrg   esac
68821c2f794Smrgfi
68921c2f794SmrgAC_SUBST([am__include])
69021c2f794SmrgAC_SUBST([am__quote])
69121c2f794SmrgAC_MSG_RESULT([$_am_result])
69221c2f794Smrgrm -f confinc confmf
69321c2f794Smrg])
69421c2f794Smrg
69521c2f794Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
69621c2f794Smrg
6971b2353dbSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
69821c2f794Smrg#
69921c2f794Smrg# This file is free software; the Free Software Foundation
70021c2f794Smrg# gives unlimited permission to copy and/or distribute it,
70121c2f794Smrg# with or without modifications, as long as this notice is preserved.
70221c2f794Smrg
70321c2f794Smrg# AM_MISSING_PROG(NAME, PROGRAM)
70421c2f794Smrg# ------------------------------
70521c2f794SmrgAC_DEFUN([AM_MISSING_PROG],
70621c2f794Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
70721c2f794Smrg$1=${$1-"${am_missing_run}$2"}
70821c2f794SmrgAC_SUBST($1)])
70921c2f794Smrg
71021c2f794Smrg# AM_MISSING_HAS_RUN
71121c2f794Smrg# ------------------
7121b2353dbSmrg# Define MISSING if not defined so far and test if it is modern enough.
7131b2353dbSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
71421c2f794SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
71521c2f794Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
71621c2f794SmrgAC_REQUIRE_AUX_FILE([missing])dnl
71712391620Smrgif test x"${MISSING+set}" != xset; then
71812391620Smrg  case $am_aux_dir in
71912391620Smrg  *\ * | *\	*)
72012391620Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
72112391620Smrg  *)
72212391620Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
72312391620Smrg  esac
72412391620Smrgfi
72521c2f794Smrg# Use eval to expand $SHELL
7261b2353dbSmrgif eval "$MISSING --is-lightweight"; then
7271b2353dbSmrg  am_missing_run="$MISSING "
72821c2f794Smrgelse
72921c2f794Smrg  am_missing_run=
7301b2353dbSmrg  AC_MSG_WARN(['missing' script is too old or missing])
73121c2f794Smrgfi
73221c2f794Smrg])
73321c2f794Smrg
73421c2f794Smrg# Helper functions for option handling.                     -*- Autoconf -*-
73521c2f794Smrg
7361b2353dbSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
73721c2f794Smrg#
73821c2f794Smrg# This file is free software; the Free Software Foundation
73921c2f794Smrg# gives unlimited permission to copy and/or distribute it,
74021c2f794Smrg# with or without modifications, as long as this notice is preserved.
74121c2f794Smrg
74221c2f794Smrg# _AM_MANGLE_OPTION(NAME)
74321c2f794Smrg# -----------------------
74421c2f794SmrgAC_DEFUN([_AM_MANGLE_OPTION],
74521c2f794Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
74621c2f794Smrg
74721c2f794Smrg# _AM_SET_OPTION(NAME)
74882e12b1bSmrg# --------------------
74921c2f794Smrg# Set option NAME.  Presently that only means defining a flag for this option.
75021c2f794SmrgAC_DEFUN([_AM_SET_OPTION],
7511b2353dbSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
75221c2f794Smrg
75321c2f794Smrg# _AM_SET_OPTIONS(OPTIONS)
75482e12b1bSmrg# ------------------------
75521c2f794Smrg# OPTIONS is a space-separated list of Automake options.
75621c2f794SmrgAC_DEFUN([_AM_SET_OPTIONS],
75712391620Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
75821c2f794Smrg
75921c2f794Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
76021c2f794Smrg# -------------------------------------------
76121c2f794Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
76221c2f794SmrgAC_DEFUN([_AM_IF_OPTION],
76321c2f794Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
76421c2f794Smrg
7651b2353dbSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
7661b2353dbSmrg#
7671b2353dbSmrg# This file is free software; the Free Software Foundation
7681b2353dbSmrg# gives unlimited permission to copy and/or distribute it,
7691b2353dbSmrg# with or without modifications, as long as this notice is preserved.
77021c2f794Smrg
7711b2353dbSmrg# _AM_PROG_CC_C_O
7721b2353dbSmrg# ---------------
7731b2353dbSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
7741b2353dbSmrg# to automatically call this.
7751b2353dbSmrgAC_DEFUN([_AM_PROG_CC_C_O],
7761b2353dbSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7771b2353dbSmrgAC_REQUIRE_AUX_FILE([compile])dnl
7781b2353dbSmrgAC_LANG_PUSH([C])dnl
7791b2353dbSmrgAC_CACHE_CHECK(
7801b2353dbSmrg  [whether $CC understands -c and -o together],
7811b2353dbSmrg  [am_cv_prog_cc_c_o],
7821b2353dbSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
7831b2353dbSmrg  # Make sure it works both with $CC and with simple cc.
7841b2353dbSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
7851b2353dbSmrg  # compilers refuse to overwrite an existing .o file with -o,
7861b2353dbSmrg  # though they will create one.
7871b2353dbSmrg  am_cv_prog_cc_c_o=yes
7881b2353dbSmrg  for am_i in 1 2; do
7891b2353dbSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
7901b2353dbSmrg         && test -f conftest2.$ac_objext; then
7911b2353dbSmrg      : OK
7921b2353dbSmrg    else
7931b2353dbSmrg      am_cv_prog_cc_c_o=no
7941b2353dbSmrg      break
7951b2353dbSmrg    fi
7961b2353dbSmrg  done
7971b2353dbSmrg  rm -f core conftest*
7981b2353dbSmrg  unset am_i])
7991b2353dbSmrgif test "$am_cv_prog_cc_c_o" != yes; then
8001b2353dbSmrg   # Losing compiler, so override with the script.
8011b2353dbSmrg   # FIXME: It is wrong to rewrite CC.
8021b2353dbSmrg   # But if we don't then we get into trouble of one sort or another.
8031b2353dbSmrg   # A longer-term fix would be to have automake use am__CC in this case,
8041b2353dbSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
8051b2353dbSmrg   CC="$am_aux_dir/compile $CC"
8061b2353dbSmrgfi
8071b2353dbSmrgAC_LANG_POP([C])])
8081b2353dbSmrg
8091b2353dbSmrg# For backward compatibility.
8101b2353dbSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
8111b2353dbSmrg
8121b2353dbSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
81321c2f794Smrg#
81421c2f794Smrg# This file is free software; the Free Software Foundation
81521c2f794Smrg# gives unlimited permission to copy and/or distribute it,
81621c2f794Smrg# with or without modifications, as long as this notice is preserved.
81721c2f794Smrg
8181b2353dbSmrg# AM_RUN_LOG(COMMAND)
8191b2353dbSmrg# -------------------
8201b2353dbSmrg# Run COMMAND, save the exit status in ac_status, and log it.
8211b2353dbSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
8221b2353dbSmrgAC_DEFUN([AM_RUN_LOG],
8231b2353dbSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
8241b2353dbSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
8251b2353dbSmrg   ac_status=$?
8261b2353dbSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
8271b2353dbSmrg   (exit $ac_status); }])
8281b2353dbSmrg
8291b2353dbSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
8301b2353dbSmrg
8311b2353dbSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
8321b2353dbSmrg#
8331b2353dbSmrg# This file is free software; the Free Software Foundation
8341b2353dbSmrg# gives unlimited permission to copy and/or distribute it,
8351b2353dbSmrg# with or without modifications, as long as this notice is preserved.
83621c2f794Smrg
83721c2f794Smrg# AM_SANITY_CHECK
83821c2f794Smrg# ---------------
83921c2f794SmrgAC_DEFUN([AM_SANITY_CHECK],
84021c2f794Smrg[AC_MSG_CHECKING([whether build environment is sane])
84112391620Smrg# Reject unsafe characters in $srcdir or the absolute working directory
84212391620Smrg# name.  Accept space and tab only in the latter.
84312391620Smrgam_lf='
84412391620Smrg'
84512391620Smrgcase `pwd` in
84612391620Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
84712391620Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
84812391620Smrgesac
84912391620Smrgcase $srcdir in
85012391620Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8511b2353dbSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
85212391620Smrgesac
85312391620Smrg
8541b2353dbSmrg# Do 'set' in a subshell so we don't clobber the current shell's
85521c2f794Smrg# arguments.  Must try -L first in case configure is actually a
85621c2f794Smrg# symlink; some systems play weird games with the mod time of symlinks
85721c2f794Smrg# (eg FreeBSD returns the mod time of the symlink's containing
85821c2f794Smrg# directory).
85921c2f794Smrgif (
8601b2353dbSmrg   am_has_slept=no
8611b2353dbSmrg   for am_try in 1 2; do
8621b2353dbSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
8631b2353dbSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8641b2353dbSmrg     if test "$[*]" = "X"; then
8651b2353dbSmrg	# -L didn't work.
8661b2353dbSmrg	set X `ls -t "$srcdir/configure" conftest.file`
8671b2353dbSmrg     fi
8681b2353dbSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
8691b2353dbSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
8701b2353dbSmrg
8711b2353dbSmrg	# If neither matched, then we have a broken ls.  This can happen
8721b2353dbSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
8731b2353dbSmrg	# broken ls alias from the environment.  This has actually
8741b2353dbSmrg	# happened.  Such a system could not be considered "sane".
8751b2353dbSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8761b2353dbSmrg  alias in your environment])
8771b2353dbSmrg     fi
8781b2353dbSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
8791b2353dbSmrg       break
8801b2353dbSmrg     fi
8811b2353dbSmrg     # Just in case.
8821b2353dbSmrg     sleep 1
8831b2353dbSmrg     am_has_slept=yes
8841b2353dbSmrg   done
88521c2f794Smrg   test "$[2]" = conftest.file
88621c2f794Smrg   )
88721c2f794Smrgthen
88821c2f794Smrg   # Ok.
88921c2f794Smrg   :
89021c2f794Smrgelse
89121c2f794Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
89221c2f794SmrgCheck your system clock])
89321c2f794Smrgfi
8941b2353dbSmrgAC_MSG_RESULT([yes])
8951b2353dbSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
8961b2353dbSmrg# generated files are strictly newer.
8971b2353dbSmrgam_sleep_pid=
8981b2353dbSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
8991b2353dbSmrg  ( sleep 1 ) &
9001b2353dbSmrg  am_sleep_pid=$!
9011b2353dbSmrgfi
9021b2353dbSmrgAC_CONFIG_COMMANDS_PRE(
9031b2353dbSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
9041b2353dbSmrg   if test -n "$am_sleep_pid"; then
9051b2353dbSmrg     # Hide warnings about reused PIDs.
9061b2353dbSmrg     wait $am_sleep_pid 2>/dev/null
9071b2353dbSmrg   fi
9081b2353dbSmrg   AC_MSG_RESULT([done])])
9091b2353dbSmrgrm -f conftest.file
9101b2353dbSmrg])
91121c2f794Smrg
9121b2353dbSmrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
91312391620Smrg#
91412391620Smrg# This file is free software; the Free Software Foundation
91512391620Smrg# gives unlimited permission to copy and/or distribute it,
91612391620Smrg# with or without modifications, as long as this notice is preserved.
91712391620Smrg
91812391620Smrg# AM_SILENT_RULES([DEFAULT])
91912391620Smrg# --------------------------
92012391620Smrg# Enable less verbose build rules; with the default set to DEFAULT
9211b2353dbSmrg# ("yes" being less verbose, "no" or empty being verbose).
92212391620SmrgAC_DEFUN([AM_SILENT_RULES],
9231b2353dbSmrg[AC_ARG_ENABLE([silent-rules], [dnl
9241b2353dbSmrgAS_HELP_STRING(
9251b2353dbSmrg  [--enable-silent-rules],
9261b2353dbSmrg  [less verbose build output (undo: "make V=1")])
9271b2353dbSmrgAS_HELP_STRING(
9281b2353dbSmrg  [--disable-silent-rules],
9291b2353dbSmrg  [verbose build output (undo: "make V=0")])dnl
9301b2353dbSmrg])
9311b2353dbSmrgcase $enable_silent_rules in @%:@ (((
9321b2353dbSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
9331b2353dbSmrg   no) AM_DEFAULT_VERBOSITY=1;;
9341b2353dbSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
93512391620Smrgesac
9361b2353dbSmrgdnl
9371b2353dbSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
9381b2353dbSmrgdnl do not support nested variable expansions.
9391b2353dbSmrgdnl See automake bug#9928 and bug#10237.
9401b2353dbSmrgam_make=${MAKE-make}
9411b2353dbSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
9421b2353dbSmrg   [am_cv_make_support_nested_variables],
9431b2353dbSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
9441b2353dbSmrgBAR0=false
9451b2353dbSmrgBAR1=true
9461b2353dbSmrgV=1
9471b2353dbSmrgam__doit:
9481b2353dbSmrg	@$(TRUE)
9491b2353dbSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
9501b2353dbSmrg  am_cv_make_support_nested_variables=yes
9511b2353dbSmrgelse
9521b2353dbSmrg  am_cv_make_support_nested_variables=no
9531b2353dbSmrgfi])
9541b2353dbSmrgif test $am_cv_make_support_nested_variables = yes; then
9551b2353dbSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
9561b2353dbSmrg  AM_V='$(V)'
9571b2353dbSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
9581b2353dbSmrgelse
9591b2353dbSmrg  AM_V=$AM_DEFAULT_VERBOSITY
9601b2353dbSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
9611b2353dbSmrgfi
9621b2353dbSmrgAC_SUBST([AM_V])dnl
9631b2353dbSmrgAM_SUBST_NOTMAKE([AM_V])dnl
9641b2353dbSmrgAC_SUBST([AM_DEFAULT_V])dnl
9651b2353dbSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
96612391620SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
96712391620SmrgAM_BACKSLASH='\'
96812391620SmrgAC_SUBST([AM_BACKSLASH])dnl
96912391620Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
97012391620Smrg])
97112391620Smrg
9721b2353dbSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
97321c2f794Smrg#
97421c2f794Smrg# This file is free software; the Free Software Foundation
97521c2f794Smrg# gives unlimited permission to copy and/or distribute it,
97621c2f794Smrg# with or without modifications, as long as this notice is preserved.
97721c2f794Smrg
97821c2f794Smrg# AM_PROG_INSTALL_STRIP
97921c2f794Smrg# ---------------------
9801b2353dbSmrg# One issue with vendor 'install' (even GNU) is that you can't
98121c2f794Smrg# specify the program used to strip binaries.  This is especially
98221c2f794Smrg# annoying in cross-compiling environments, where the build's strip
98321c2f794Smrg# is unlikely to handle the host's binaries.
98421c2f794Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9851b2353dbSmrg# always use install-sh in "make install-strip", and initialize
98621c2f794Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
98721c2f794SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
98821c2f794Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9891b2353dbSmrg# Installed binaries are usually stripped using 'strip' when the user
9901b2353dbSmrg# run "make install-strip".  However 'strip' might not be the right
99121c2f794Smrg# tool to use in cross-compilation environments, therefore Automake
9921b2353dbSmrg# will honor the 'STRIP' environment variable to overrule this program.
9931b2353dbSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
99421c2f794Smrgif test "$cross_compiling" != no; then
99521c2f794Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
99621c2f794Smrgfi
99721c2f794SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
99821c2f794SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
99921c2f794Smrg
10001b2353dbSmrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
100121c2f794Smrg#
100221c2f794Smrg# This file is free software; the Free Software Foundation
100321c2f794Smrg# gives unlimited permission to copy and/or distribute it,
100421c2f794Smrg# with or without modifications, as long as this notice is preserved.
100521c2f794Smrg
100621c2f794Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
100721c2f794Smrg# ---------------------------
100812391620Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
100921c2f794Smrg# This macro is traced by Automake.
101021c2f794SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
101121c2f794Smrg
101212391620Smrg# AM_SUBST_NOTMAKE(VARIABLE)
101382e12b1bSmrg# --------------------------
101412391620Smrg# Public sister of _AM_SUBST_NOTMAKE.
101512391620SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
101612391620Smrg
101721c2f794Smrg# Check how to create a tarball.                            -*- Autoconf -*-
101821c2f794Smrg
10191b2353dbSmrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
102021c2f794Smrg#
102121c2f794Smrg# This file is free software; the Free Software Foundation
102221c2f794Smrg# gives unlimited permission to copy and/or distribute it,
102321c2f794Smrg# with or without modifications, as long as this notice is preserved.
102421c2f794Smrg
102521c2f794Smrg# _AM_PROG_TAR(FORMAT)
102621c2f794Smrg# --------------------
102721c2f794Smrg# Check how to create a tarball in format FORMAT.
10281b2353dbSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
102921c2f794Smrg#
103021c2f794Smrg# Substitute a variable $(am__tar) that is a command
103121c2f794Smrg# writing to stdout a FORMAT-tarball containing the directory
103221c2f794Smrg# $tardir.
103321c2f794Smrg#     tardir=directory && $(am__tar) > result.tar
103421c2f794Smrg#
103521c2f794Smrg# Substitute a variable $(am__untar) that extract such
103621c2f794Smrg# a tarball read from stdin.
103721c2f794Smrg#     $(am__untar) < result.tar
10381b2353dbSmrg#
103921c2f794SmrgAC_DEFUN([_AM_PROG_TAR],
10401b2353dbSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
10411b2353dbSmrg# in the wild :-(  We should find a proper way to deprecate it ...
10421b2353dbSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
10431b2353dbSmrg
10441b2353dbSmrg# We'll loop over all known methods to create a tar archive until one works.
104521c2f794Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
104621c2f794Smrg
10471b2353dbSmrgm4_if([$1], [v7],
10481b2353dbSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
10491b2353dbSmrg
10501b2353dbSmrg  [m4_case([$1],
10511b2353dbSmrg    [ustar],
10521b2353dbSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
10531b2353dbSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
10541b2353dbSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
10551b2353dbSmrg      # and bug#13588).
10561b2353dbSmrg      am_max_uid=2097151 # 2^21 - 1
10571b2353dbSmrg      am_max_gid=$am_max_uid
10581b2353dbSmrg      # The $UID and $GID variables are not portable, so we need to resort
10591b2353dbSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
10601b2353dbSmrg      # below are definitely unexpected, so allow the users to see them
10611b2353dbSmrg      # (that is, avoid stderr redirection).
10621b2353dbSmrg      am_uid=`id -u || echo unknown`
10631b2353dbSmrg      am_gid=`id -g || echo unknown`
10641b2353dbSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
10651b2353dbSmrg      if test $am_uid -le $am_max_uid; then
10661b2353dbSmrg         AC_MSG_RESULT([yes])
10671b2353dbSmrg      else
10681b2353dbSmrg         AC_MSG_RESULT([no])
10691b2353dbSmrg         _am_tools=none
10701b2353dbSmrg      fi
10711b2353dbSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
10721b2353dbSmrg      if test $am_gid -le $am_max_gid; then
10731b2353dbSmrg         AC_MSG_RESULT([yes])
10741b2353dbSmrg      else
10751b2353dbSmrg        AC_MSG_RESULT([no])
10761b2353dbSmrg        _am_tools=none
10771b2353dbSmrg      fi],
10781b2353dbSmrg
10791b2353dbSmrg  [pax],
10801b2353dbSmrg    [],
10811b2353dbSmrg
10821b2353dbSmrg  [m4_fatal([Unknown tar format])])
10831b2353dbSmrg
10841b2353dbSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
10851b2353dbSmrg
10861b2353dbSmrg  # Go ahead even if we have the value already cached.  We do so because we
10871b2353dbSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
10881b2353dbSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
10891b2353dbSmrg
10901b2353dbSmrg  for _am_tool in $_am_tools; do
10911b2353dbSmrg    case $_am_tool in
10921b2353dbSmrg    gnutar)
10931b2353dbSmrg      for _am_tar in tar gnutar gtar; do
10941b2353dbSmrg        AM_RUN_LOG([$_am_tar --version]) && break
10951b2353dbSmrg      done
10961b2353dbSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
10971b2353dbSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
10981b2353dbSmrg      am__untar="$_am_tar -xf -"
10991b2353dbSmrg      ;;
11001b2353dbSmrg    plaintar)
11011b2353dbSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
11021b2353dbSmrg      # ustar tarball either.
11031b2353dbSmrg      (tar --version) >/dev/null 2>&1 && continue
11041b2353dbSmrg      am__tar='tar chf - "$$tardir"'
11051b2353dbSmrg      am__tar_='tar chf - "$tardir"'
11061b2353dbSmrg      am__untar='tar xf -'
11071b2353dbSmrg      ;;
11081b2353dbSmrg    pax)
11091b2353dbSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
11101b2353dbSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
11111b2353dbSmrg      am__untar='pax -r'
11121b2353dbSmrg      ;;
11131b2353dbSmrg    cpio)
11141b2353dbSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
11151b2353dbSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
11161b2353dbSmrg      am__untar='cpio -i -H $1 -d'
11171b2353dbSmrg      ;;
11181b2353dbSmrg    none)
11191b2353dbSmrg      am__tar=false
11201b2353dbSmrg      am__tar_=false
11211b2353dbSmrg      am__untar=false
11221b2353dbSmrg      ;;
11231b2353dbSmrg    esac
112421c2f794Smrg
11251b2353dbSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
11261b2353dbSmrg    # and am__untar set.
11271b2353dbSmrg    test -n "${am_cv_prog_tar_$1}" && break
11281b2353dbSmrg
11291b2353dbSmrg    # tar/untar a dummy directory, and stop if the command works.
11301b2353dbSmrg    rm -rf conftest.dir
11311b2353dbSmrg    mkdir conftest.dir
11321b2353dbSmrg    echo GrepMe > conftest.dir/file
11331b2353dbSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
11341b2353dbSmrg    rm -rf conftest.dir
11351b2353dbSmrg    if test -s conftest.tar; then
11361b2353dbSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
11371b2353dbSmrg      AM_RUN_LOG([cat conftest.dir/file])
11381b2353dbSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
11391b2353dbSmrg    fi
11401b2353dbSmrg  done
114121c2f794Smrg  rm -rf conftest.dir
114221c2f794Smrg
11431b2353dbSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
11441b2353dbSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
11451b2353dbSmrg
114621c2f794SmrgAC_SUBST([am__tar])
114721c2f794SmrgAC_SUBST([am__untar])
114821c2f794Smrg]) # _AM_PROG_TAR
114921c2f794Smrg
115082e12b1bSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
115182e12b1bSmrg# 
115282e12b1bSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
115382e12b1bSmrg#
115482e12b1bSmrg# This program is free software; you can redistribute it and/or modify
115582e12b1bSmrg# it under the terms of the GNU General Public License as published by
115682e12b1bSmrg# the Free Software Foundation; either version 2 of the License, or
115782e12b1bSmrg# (at your option) any later version.
115882e12b1bSmrg#
115982e12b1bSmrg# This program is distributed in the hope that it will be useful, but
116082e12b1bSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
116182e12b1bSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
116282e12b1bSmrg# General Public License for more details.
116382e12b1bSmrg#
116482e12b1bSmrg# You should have received a copy of the GNU General Public License
116582e12b1bSmrg# along with this program; if not, write to the Free Software
116682e12b1bSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
116782e12b1bSmrg#
116882e12b1bSmrg# As a special exception to the GNU General Public License, if you
116982e12b1bSmrg# distribute this file as part of a program that contains a
117082e12b1bSmrg# configuration script generated by Autoconf, you may include it under
117182e12b1bSmrg# the same distribution terms that you use for the rest of that program.
117282e12b1bSmrg
117382e12b1bSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
117482e12b1bSmrg# ----------------------------------
117582e12b1bSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
117682e12b1bSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
117782e12b1bSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
117882e12b1bSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
117982e12b1bSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
118082e12b1bSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
118182e12b1bSmrgfi
118282e12b1bSmrgif test -n "$PKG_CONFIG"; then
118382e12b1bSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
118482e12b1bSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
118582e12b1bSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
118682e12b1bSmrg		AC_MSG_RESULT([yes])
118782e12b1bSmrg	else
118882e12b1bSmrg		AC_MSG_RESULT([no])
118982e12b1bSmrg		PKG_CONFIG=""
119082e12b1bSmrg	fi
119182e12b1bSmrg		
119282e12b1bSmrgfi[]dnl
119382e12b1bSmrg])# PKG_PROG_PKG_CONFIG
119482e12b1bSmrg
119582e12b1bSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
119682e12b1bSmrg#
119782e12b1bSmrg# Check to see whether a particular set of modules exists.  Similar
119882e12b1bSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
119982e12b1bSmrg#
120082e12b1bSmrg#
120182e12b1bSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
120282e12b1bSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
120382e12b1bSmrg# PKG_CHECK_EXISTS manually
120482e12b1bSmrg# --------------------------------------------------------------
120582e12b1bSmrgAC_DEFUN([PKG_CHECK_EXISTS],
120682e12b1bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
120782e12b1bSmrgif test -n "$PKG_CONFIG" && \
120882e12b1bSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
120982e12b1bSmrg  m4_ifval([$2], [$2], [:])
121082e12b1bSmrgm4_ifvaln([$3], [else
121182e12b1bSmrg  $3])dnl
121282e12b1bSmrgfi])
121382e12b1bSmrg
121482e12b1bSmrg
121582e12b1bSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
121682e12b1bSmrg# ---------------------------------------------
121782e12b1bSmrgm4_define([_PKG_CONFIG],
121882e12b1bSmrg[if test -n "$$1"; then
121982e12b1bSmrg    pkg_cv_[]$1="$$1"
122082e12b1bSmrg elif test -n "$PKG_CONFIG"; then
122182e12b1bSmrg    PKG_CHECK_EXISTS([$3],
122282e12b1bSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
122382e12b1bSmrg		     [pkg_failed=yes])
122482e12b1bSmrg else
122582e12b1bSmrg    pkg_failed=untried
122682e12b1bSmrgfi[]dnl
122782e12b1bSmrg])# _PKG_CONFIG
122882e12b1bSmrg
122982e12b1bSmrg# _PKG_SHORT_ERRORS_SUPPORTED
123082e12b1bSmrg# -----------------------------
123182e12b1bSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
123282e12b1bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
123382e12b1bSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
123482e12b1bSmrg        _pkg_short_errors_supported=yes
123582e12b1bSmrgelse
123682e12b1bSmrg        _pkg_short_errors_supported=no
123782e12b1bSmrgfi[]dnl
123882e12b1bSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
123982e12b1bSmrg
124082e12b1bSmrg
124182e12b1bSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
124282e12b1bSmrg# [ACTION-IF-NOT-FOUND])
124382e12b1bSmrg#
124482e12b1bSmrg#
124582e12b1bSmrg# Note that if there is a possibility the first call to
124682e12b1bSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
124782e12b1bSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
124882e12b1bSmrg#
124982e12b1bSmrg#
125082e12b1bSmrg# --------------------------------------------------------------
125182e12b1bSmrgAC_DEFUN([PKG_CHECK_MODULES],
125282e12b1bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
125382e12b1bSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
125482e12b1bSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
125582e12b1bSmrg
125682e12b1bSmrgpkg_failed=no
125782e12b1bSmrgAC_MSG_CHECKING([for $1])
125882e12b1bSmrg
125982e12b1bSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
126082e12b1bSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
126182e12b1bSmrg
126282e12b1bSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
126382e12b1bSmrgand $1[]_LIBS to avoid the need to call pkg-config.
126482e12b1bSmrgSee the pkg-config man page for more details.])
126582e12b1bSmrg
126682e12b1bSmrgif test $pkg_failed = yes; then
126782e12b1bSmrg        _PKG_SHORT_ERRORS_SUPPORTED
126882e12b1bSmrg        if test $_pkg_short_errors_supported = yes; then
126982e12b1bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
127082e12b1bSmrg        else 
127182e12b1bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
127282e12b1bSmrg        fi
127382e12b1bSmrg	# Put the nasty error message in config.log where it belongs
127482e12b1bSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
127582e12b1bSmrg
127682e12b1bSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
127782e12b1bSmrg[Package requirements ($2) were not met:
127882e12b1bSmrg
127982e12b1bSmrg$$1_PKG_ERRORS
128082e12b1bSmrg
128182e12b1bSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
128282e12b1bSmrginstalled software in a non-standard prefix.
128382e12b1bSmrg
128482e12b1bSmrg_PKG_TEXT
128582e12b1bSmrg])],
128682e12b1bSmrg		[AC_MSG_RESULT([no])
128782e12b1bSmrg                $4])
128882e12b1bSmrgelif test $pkg_failed = untried; then
128982e12b1bSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
129082e12b1bSmrg[The pkg-config script could not be found or is too old.  Make sure it
129182e12b1bSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
129282e12b1bSmrgpath to pkg-config.
129382e12b1bSmrg
129482e12b1bSmrg_PKG_TEXT
129582e12b1bSmrg
129682e12b1bSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
129782e12b1bSmrg		[$4])
129882e12b1bSmrgelse
129982e12b1bSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
130082e12b1bSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
130182e12b1bSmrg        AC_MSG_RESULT([yes])
130282e12b1bSmrg	ifelse([$3], , :, [$3])
130382e12b1bSmrgfi[]dnl
130482e12b1bSmrg])# PKG_CHECK_MODULES
130582e12b1bSmrg
130612391620Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
130721c2f794Smrgdnl
130812391620Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
13091b2353dbSmrgdnl
131021c2f794Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
131112391620Smrgdnl copy of this software and associated documentation files (the "Software"),
131212391620Smrgdnl to deal in the Software without restriction, including without limitation
131312391620Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
131412391620Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
131512391620Smrgdnl Software is furnished to do so, subject to the following conditions:
131621c2f794Smrgdnl
131712391620Smrgdnl The above copyright notice and this permission notice (including the next
131812391620Smrgdnl paragraph) shall be included in all copies or substantial portions of the
131912391620Smrgdnl Software.
132021c2f794Smrgdnl
132112391620Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
132212391620Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
132312391620Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
132412391620Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
132512391620Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
132612391620Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
132712391620Smrgdnl DEALINGS IN THE SOFTWARE.
132821c2f794Smrg
132921c2f794Smrg# XORG_MACROS_VERSION(required-version)
133021c2f794Smrg# -------------------------------------
133121c2f794Smrg# Minimum version: 1.1.0
133221c2f794Smrg#
133321c2f794Smrg# If you're using a macro added in Version 1.1 or newer, include this in
133421c2f794Smrg# your configure.ac with the minimum required version, such as:
133521c2f794Smrg# XORG_MACROS_VERSION(1.1)
133621c2f794Smrg#
133712391620Smrg# To ensure that this macro is defined, also add:
133812391620Smrg# m4_ifndef([XORG_MACROS_VERSION],
133912391620Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
134021c2f794Smrg#
134121c2f794Smrg#
13421b2353dbSmrg# See the "minimum version" comment for each macro you use to see what
134321c2f794Smrg# version you require.
134412391620Smrgm4_defun([XORG_MACROS_VERSION],[
13451b2353dbSmrgm4_define([vers_have], [1.19.0])
134612391620Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
134712391620Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
134812391620Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
134912391620Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
135012391620Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
135112391620Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
135212391620Smrgm4_undefine([vers_have])
135312391620Smrgm4_undefine([maj_have])
135412391620Smrgm4_undefine([maj_needed])
135521c2f794Smrg]) # XORG_MACROS_VERSION
135621c2f794Smrg
135721c2f794Smrg# XORG_PROG_RAWCPP()
135821c2f794Smrg# ------------------
135921c2f794Smrg# Minimum version: 1.0.0
136021c2f794Smrg#
136121c2f794Smrg# Find cpp program and necessary flags for use in pre-processing text files
136221c2f794Smrg# such as man pages and config files
136321c2f794SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
136421c2f794SmrgAC_REQUIRE([AC_PROG_CPP])
13651b2353dbSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
136621c2f794Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
136721c2f794Smrg
136821c2f794Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
136921c2f794Smrg# which is not the best choice for supporting other OS'es, but covers most
137021c2f794Smrg# of the ones we need for now.
137121c2f794SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
137282e12b1bSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
137321c2f794Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
137421c2f794Smrg	AC_MSG_RESULT([no])
137521c2f794Smrgelse
137621c2f794Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
137721c2f794Smrg		RAWCPPFLAGS=-undef
137821c2f794Smrg		AC_MSG_RESULT([yes])
137912391620Smrg	# under Cygwin unix is still defined even with -undef
138012391620Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
138112391620Smrg		RAWCPPFLAGS="-undef -ansi"
138212391620Smrg		AC_MSG_RESULT([yes, with -ansi])
138321c2f794Smrg	else
138421c2f794Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
138521c2f794Smrg	fi
138621c2f794Smrgfi
138721c2f794Smrgrm -f conftest.$ac_ext
138821c2f794Smrg
138921c2f794SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
139082e12b1bSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
139121c2f794Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
139221c2f794Smrg	AC_MSG_RESULT([no])
139321c2f794Smrgelse
139421c2f794Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
13951b2353dbSmrg		TRADITIONALCPPFLAGS="-traditional"
139621c2f794Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
139721c2f794Smrg		AC_MSG_RESULT([yes])
139821c2f794Smrg	else
139921c2f794Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
140021c2f794Smrg	fi
140121c2f794Smrgfi
140221c2f794Smrgrm -f conftest.$ac_ext
140321c2f794SmrgAC_SUBST(RAWCPPFLAGS)
14041b2353dbSmrgAC_SUBST(TRADITIONALCPPFLAGS)
140521c2f794Smrg]) # XORG_PROG_RAWCPP
140621c2f794Smrg
140721c2f794Smrg# XORG_MANPAGE_SECTIONS()
140821c2f794Smrg# -----------------------
140921c2f794Smrg# Minimum version: 1.0.0
141021c2f794Smrg#
141121c2f794Smrg# Determine which sections man pages go in for the different man page types
141221c2f794Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
141321c2f794Smrg# Not sure if there's any better way than just hardcoding by OS name.
141421c2f794Smrg# Override default settings by setting environment variables
141512391620Smrg# Added MAN_SUBSTS in version 1.8
141612391620Smrg# Added AC_PROG_SED in version 1.8
141721c2f794Smrg
141821c2f794SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
141921c2f794SmrgAC_REQUIRE([AC_CANONICAL_HOST])
142012391620SmrgAC_REQUIRE([AC_PROG_SED])
142121c2f794Smrg
142221c2f794Smrgif test x$APP_MAN_SUFFIX = x    ; then
142321c2f794Smrg    APP_MAN_SUFFIX=1
142421c2f794Smrgfi
142521c2f794Smrgif test x$APP_MAN_DIR = x    ; then
142621c2f794Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
142721c2f794Smrgfi
142821c2f794Smrg
142921c2f794Smrgif test x$LIB_MAN_SUFFIX = x    ; then
143021c2f794Smrg    LIB_MAN_SUFFIX=3
143121c2f794Smrgfi
143221c2f794Smrgif test x$LIB_MAN_DIR = x    ; then
143321c2f794Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
143421c2f794Smrgfi
143521c2f794Smrg
143621c2f794Smrgif test x$FILE_MAN_SUFFIX = x    ; then
143721c2f794Smrg    case $host_os in
143821c2f794Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
143921c2f794Smrg	*)		FILE_MAN_SUFFIX=5  ;;
144021c2f794Smrg    esac
144121c2f794Smrgfi
144221c2f794Smrgif test x$FILE_MAN_DIR = x    ; then
144321c2f794Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
144421c2f794Smrgfi
144521c2f794Smrg
144621c2f794Smrgif test x$MISC_MAN_SUFFIX = x    ; then
144721c2f794Smrg    case $host_os in
144821c2f794Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
144921c2f794Smrg	*)		MISC_MAN_SUFFIX=7  ;;
145021c2f794Smrg    esac
145121c2f794Smrgfi
145221c2f794Smrgif test x$MISC_MAN_DIR = x    ; then
145321c2f794Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
145421c2f794Smrgfi
145521c2f794Smrg
145621c2f794Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
145721c2f794Smrg    case $host_os in
145821c2f794Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
145921c2f794Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
146021c2f794Smrg    esac
146121c2f794Smrgfi
146221c2f794Smrgif test x$DRIVER_MAN_DIR = x    ; then
146321c2f794Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
146421c2f794Smrgfi
146521c2f794Smrg
146621c2f794Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
146721c2f794Smrg    case $host_os in
146821c2f794Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
146921c2f794Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
147021c2f794Smrg    esac
147121c2f794Smrgfi
147221c2f794Smrgif test x$ADMIN_MAN_DIR = x    ; then
147321c2f794Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
147421c2f794Smrgfi
147521c2f794Smrg
147621c2f794Smrg
147721c2f794SmrgAC_SUBST([APP_MAN_SUFFIX])
147821c2f794SmrgAC_SUBST([LIB_MAN_SUFFIX])
147921c2f794SmrgAC_SUBST([FILE_MAN_SUFFIX])
148021c2f794SmrgAC_SUBST([MISC_MAN_SUFFIX])
148121c2f794SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
148221c2f794SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
148321c2f794SmrgAC_SUBST([APP_MAN_DIR])
148421c2f794SmrgAC_SUBST([LIB_MAN_DIR])
148521c2f794SmrgAC_SUBST([FILE_MAN_DIR])
148621c2f794SmrgAC_SUBST([MISC_MAN_DIR])
148721c2f794SmrgAC_SUBST([DRIVER_MAN_DIR])
148821c2f794SmrgAC_SUBST([ADMIN_MAN_DIR])
148912391620Smrg
149012391620SmrgXORG_MAN_PAGE="X Version 11"
149112391620SmrgAC_SUBST([XORG_MAN_PAGE])
149212391620SmrgMAN_SUBSTS="\
149312391620Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
149412391620Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
149512391620Smrg	-e 's|__xservername__|Xorg|g' \
149612391620Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
149712391620Smrg	-e 's|__projectroot__|\$(prefix)|g' \
149812391620Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
149912391620Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
150012391620Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
150112391620Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
150212391620Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
150312391620Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
150412391620Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
150512391620SmrgAC_SUBST([MAN_SUBSTS])
150612391620Smrg
150721c2f794Smrg]) # XORG_MANPAGE_SECTIONS
150821c2f794Smrg
150912391620Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
151012391620Smrg# ------------------------
151112391620Smrg# Minimum version: 1.7.0
151212391620Smrg#
151312391620Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
151412391620Smrg# provided by xorg-sgml-doctools, if installed.
151512391620SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
151612391620SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
151712391620SmrgXORG_SGML_PATH=
151812391620SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
151912391620Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
152012391620Smrg    [m4_ifval([$1],[:],
152112391620Smrg        [if test x"$cross_compiling" != x"yes" ; then
152212391620Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
152312391620Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
152412391620Smrg         fi])
152512391620Smrg    ])
152612391620Smrg
152712391620Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
152812391620Smrg# the path and the name of the doc stylesheet
152912391620Smrgif test "x$XORG_SGML_PATH" != "x" ; then
153012391620Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
153112391620Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
153212391620Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
153312391620Smrgelse
153412391620Smrg   AC_MSG_RESULT([no])
153512391620Smrgfi
153612391620Smrg
153712391620SmrgAC_SUBST(XORG_SGML_PATH)
153812391620SmrgAC_SUBST(STYLESHEET_SRCDIR)
153912391620SmrgAC_SUBST(XSL_STYLESHEET)
154012391620SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
154112391620Smrg]) # XORG_CHECK_SGML_DOCTOOLS
154212391620Smrg
154321c2f794Smrg# XORG_CHECK_LINUXDOC
154421c2f794Smrg# -------------------
154521c2f794Smrg# Minimum version: 1.0.0
154621c2f794Smrg#
154721c2f794Smrg# Defines the variable MAKE_TEXT if the necessary tools and
154821c2f794Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
154921c2f794Smrg# Whether or not the necessary tools and files are found can be checked
155021c2f794Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
155121c2f794SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
155212391620SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
155312391620SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
155421c2f794Smrg
155521c2f794SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
155621c2f794Smrg
155712391620SmrgAC_MSG_CHECKING([whether to build documentation])
155821c2f794Smrg
155912391620Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
156021c2f794Smrg   BUILDDOC=yes
156121c2f794Smrgelse
156221c2f794Smrg   BUILDDOC=no
156321c2f794Smrgfi
156421c2f794Smrg
156521c2f794SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
156621c2f794Smrg
156721c2f794SmrgAC_MSG_RESULT([$BUILDDOC])
156821c2f794Smrg
156912391620SmrgAC_MSG_CHECKING([whether to build pdf documentation])
157021c2f794Smrg
157112391620Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
157221c2f794Smrg   BUILDPDFDOC=yes
157321c2f794Smrgelse
157421c2f794Smrg   BUILDPDFDOC=no
157521c2f794Smrgfi
157621c2f794Smrg
157721c2f794SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
157821c2f794Smrg
157921c2f794SmrgAC_MSG_RESULT([$BUILDPDFDOC])
158021c2f794Smrg
158112391620SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
158221c2f794SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
158321c2f794SmrgMAKE_PDF="$PS2PDF"
158421c2f794SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
158521c2f794Smrg
158621c2f794SmrgAC_SUBST(MAKE_TEXT)
158721c2f794SmrgAC_SUBST(MAKE_PS)
158821c2f794SmrgAC_SUBST(MAKE_PDF)
158921c2f794SmrgAC_SUBST(MAKE_HTML)
159021c2f794Smrg]) # XORG_CHECK_LINUXDOC
159121c2f794Smrg
159221c2f794Smrg# XORG_CHECK_DOCBOOK
159321c2f794Smrg# -------------------
159421c2f794Smrg# Minimum version: 1.0.0
159521c2f794Smrg#
159621c2f794Smrg# Checks for the ability to build output formats from SGML DocBook source.
159721c2f794Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
159821c2f794Smrg# indicates whether the necessary tools and files are found and, if set,
159921c2f794Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
160021c2f794SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
160112391620SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
160212391620Smrg
160321c2f794SmrgBUILDTXTDOC=no
160421c2f794SmrgBUILDPDFDOC=no
160521c2f794SmrgBUILDPSDOC=no
160621c2f794SmrgBUILDHTMLDOC=no
160721c2f794Smrg
160821c2f794SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
160921c2f794SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
161021c2f794SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
161121c2f794SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
161221c2f794Smrg
161312391620SmrgAC_MSG_CHECKING([whether to build text documentation])
161412391620Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
161521c2f794Smrg   test x$BUILD_TXTDOC != xno; then
161621c2f794Smrg	BUILDTXTDOC=yes
161721c2f794Smrgfi
161821c2f794SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
161921c2f794SmrgAC_MSG_RESULT([$BUILDTXTDOC])
162021c2f794Smrg
162112391620SmrgAC_MSG_CHECKING([whether to build PDF documentation])
162212391620Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
162321c2f794Smrg   test x$BUILD_PDFDOC != xno; then
162421c2f794Smrg	BUILDPDFDOC=yes
162521c2f794Smrgfi
162621c2f794SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
162721c2f794SmrgAC_MSG_RESULT([$BUILDPDFDOC])
162821c2f794Smrg
162912391620SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
163012391620Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
163121c2f794Smrg   test x$BUILD_PSDOC != xno; then
163221c2f794Smrg	BUILDPSDOC=yes
163321c2f794Smrgfi
163421c2f794SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
163521c2f794SmrgAC_MSG_RESULT([$BUILDPSDOC])
163621c2f794Smrg
163712391620SmrgAC_MSG_CHECKING([whether to build HTML documentation])
163812391620Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
163921c2f794Smrg   test x$BUILD_HTMLDOC != xno; then
164021c2f794Smrg	BUILDHTMLDOC=yes
164121c2f794Smrgfi
164221c2f794SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
164321c2f794SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
164421c2f794Smrg
164521c2f794SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
164621c2f794SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
164721c2f794SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
164821c2f794SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
164921c2f794Smrg
165021c2f794SmrgAC_SUBST(MAKE_TEXT)
165121c2f794SmrgAC_SUBST(MAKE_PS)
165221c2f794SmrgAC_SUBST(MAKE_PDF)
165321c2f794SmrgAC_SUBST(MAKE_HTML)
165421c2f794Smrg]) # XORG_CHECK_DOCBOOK
165521c2f794Smrg
165612391620Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
165712391620Smrg# ----------------
165812391620Smrg# Minimum version: 1.5.0
165912391620Smrg# Minimum version for optional DEFAULT argument: 1.11.0
166012391620Smrg#
166112391620Smrg# Documentation tools are not always available on all platforms and sometimes
166212391620Smrg# not at the appropriate level. This macro enables a module to test for the
166312391620Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
166412391620Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
166512391620Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
166612391620Smrg# --with-xmlto assumes 'auto'.
166712391620Smrg#
166812391620Smrg# Interface to module:
166912391620Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
167012391620Smrg# XMLTO:	returns the path of the xmlto program found
167112391620Smrg#		returns the path set by the user in the environment
167212391620Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
167312391620Smrg#		'no' user instructs the module not to use xmlto
167412391620Smrg#
167512391620Smrg# Added in version 1.10.0
167612391620Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
167712391620Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
167812391620Smrg#
167912391620Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
168012391620Smrg#
168112391620SmrgAC_DEFUN([XORG_WITH_XMLTO],[
168212391620SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
168312391620Smrgm4_define([_defopt], m4_default([$2], [auto]))
168412391620SmrgAC_ARG_WITH(xmlto,
168512391620Smrg	AS_HELP_STRING([--with-xmlto],
168612391620Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
168712391620Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
168812391620Smrgm4_undefine([_defopt])
168912391620Smrg
169012391620Smrgif test "x$use_xmlto" = x"auto"; then
169112391620Smrg   AC_PATH_PROG([XMLTO], [xmlto])
169212391620Smrg   if test "x$XMLTO" = "x"; then
169312391620Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
169412391620Smrg	have_xmlto=no
169512391620Smrg   else
169612391620Smrg        have_xmlto=yes
169712391620Smrg   fi
169812391620Smrgelif test "x$use_xmlto" = x"yes" ; then
169912391620Smrg   AC_PATH_PROG([XMLTO], [xmlto])
170012391620Smrg   if test "x$XMLTO" = "x"; then
170112391620Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
170212391620Smrg   fi
170312391620Smrg   have_xmlto=yes
170412391620Smrgelif test "x$use_xmlto" = x"no" ; then
170512391620Smrg   if test "x$XMLTO" != "x"; then
170612391620Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
170712391620Smrg   fi
170812391620Smrg   have_xmlto=no
170912391620Smrgelse
171012391620Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
171112391620Smrgfi
171212391620Smrg
171312391620Smrg# Test for a minimum version of xmlto, if provided.
171412391620Smrgm4_ifval([$1],
171512391620Smrg[if test "$have_xmlto" = yes; then
171612391620Smrg    # scrape the xmlto version
171712391620Smrg    AC_MSG_CHECKING([the xmlto version])
171812391620Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
171912391620Smrg    AC_MSG_RESULT([$xmlto_version])
172012391620Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
172112391620Smrg        [if test "x$use_xmlto" = xauto; then
172212391620Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
172312391620Smrg            have_xmlto=no
172412391620Smrg        else
172512391620Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
172612391620Smrg        fi])
172712391620Smrgfi])
172812391620Smrg
172912391620Smrg# Test for the ability of xmlto to generate a text target
173012391620Smrghave_xmlto_text=no
173112391620Smrgcat > conftest.xml << "EOF"
173212391620SmrgEOF
173312391620SmrgAS_IF([test "$have_xmlto" = yes],
173412391620Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
173512391620Smrg             [have_xmlto_text=yes],
173612391620Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
173712391620Smrgrm -f conftest.xml
173812391620SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
173912391620SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
174012391620Smrg]) # XORG_WITH_XMLTO
174112391620Smrg
174282e12b1bSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
174382e12b1bSmrg# --------------------------------------------
174482e12b1bSmrg# Minimum version: 1.12.0
174582e12b1bSmrg# Minimum version for optional DEFAULT argument: 1.12.0
174682e12b1bSmrg#
174782e12b1bSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
174882e12b1bSmrg# XML-based language used for the transformation of XML documents.
174982e12b1bSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
175082e12b1bSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
175182e12b1bSmrg# The XSLT processor is often used as a standalone tool for transformations.
175282e12b1bSmrg# It should not be assumed that this tool is used only to work with documnetation.
175382e12b1bSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
175482e12b1bSmrg#
175582e12b1bSmrg# Interface to module:
175682e12b1bSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
175782e12b1bSmrg# XSLTPROC:	 returns the path of the xsltproc program found
175882e12b1bSmrg#		 returns the path set by the user in the environment
175982e12b1bSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
176082e12b1bSmrg#		  'no' user instructs the module not to use xsltproc
176182e12b1bSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
176282e12b1bSmrg#
176382e12b1bSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
176482e12b1bSmrg#
176582e12b1bSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
176682e12b1bSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
176782e12b1bSmrg# Preserves the interface, should it be implemented later
176882e12b1bSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
176982e12b1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
177082e12b1bSmrgAC_ARG_WITH(xsltproc,
177182e12b1bSmrg	AS_HELP_STRING([--with-xsltproc],
177282e12b1bSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
177382e12b1bSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
177482e12b1bSmrgm4_undefine([_defopt])
177582e12b1bSmrg
177682e12b1bSmrgif test "x$use_xsltproc" = x"auto"; then
177782e12b1bSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
177882e12b1bSmrg   if test "x$XSLTPROC" = "x"; then
177982e12b1bSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
178082e12b1bSmrg	have_xsltproc=no
178182e12b1bSmrg   else
178282e12b1bSmrg        have_xsltproc=yes
178382e12b1bSmrg   fi
178482e12b1bSmrgelif test "x$use_xsltproc" = x"yes" ; then
178582e12b1bSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
178682e12b1bSmrg   if test "x$XSLTPROC" = "x"; then
178782e12b1bSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
178882e12b1bSmrg   fi
178982e12b1bSmrg   have_xsltproc=yes
179082e12b1bSmrgelif test "x$use_xsltproc" = x"no" ; then
179182e12b1bSmrg   if test "x$XSLTPROC" != "x"; then
179282e12b1bSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
179382e12b1bSmrg   fi
179482e12b1bSmrg   have_xsltproc=no
179582e12b1bSmrgelse
179682e12b1bSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
179782e12b1bSmrgfi
179882e12b1bSmrg
179982e12b1bSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
180082e12b1bSmrg]) # XORG_WITH_XSLTPROC
180182e12b1bSmrg
180282e12b1bSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
180382e12b1bSmrg# ----------------------------------------
180482e12b1bSmrg# Minimum version: 1.15.0
180582e12b1bSmrg#
180682e12b1bSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
180782e12b1bSmrg# scanning arbitrary text files, extracting information from those text files,
180882e12b1bSmrg# and printing reports based on that information.
180982e12b1bSmrg#
181082e12b1bSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
181182e12b1bSmrg#
181282e12b1bSmrg# Interface to module:
181382e12b1bSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
181482e12b1bSmrg# PERL:	     returns the path of the perl program found
181582e12b1bSmrg#	     returns the path set by the user in the environment
181682e12b1bSmrg# --with-perl: 'yes' user instructs the module to use perl
181782e12b1bSmrg#	       'no' user instructs the module not to use perl
181882e12b1bSmrg# have_perl: returns yes if perl found in PATH or no
181982e12b1bSmrg#
182082e12b1bSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
182182e12b1bSmrg#
182282e12b1bSmrgAC_DEFUN([XORG_WITH_PERL],[
182382e12b1bSmrgAC_ARG_VAR([PERL], [Path to perl command])
182482e12b1bSmrg# Preserves the interface, should it be implemented later
182582e12b1bSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
182682e12b1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
182782e12b1bSmrgAC_ARG_WITH(perl,
182882e12b1bSmrg	AS_HELP_STRING([--with-perl],
182982e12b1bSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
183082e12b1bSmrg	   [use_perl=$withval], [use_perl=]_defopt)
183182e12b1bSmrgm4_undefine([_defopt])
183282e12b1bSmrg
183382e12b1bSmrgif test "x$use_perl" = x"auto"; then
183482e12b1bSmrg   AC_PATH_PROG([PERL], [perl])
183582e12b1bSmrg   if test "x$PERL" = "x"; then
183682e12b1bSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
183782e12b1bSmrg	have_perl=no
183882e12b1bSmrg   else
183982e12b1bSmrg        have_perl=yes
184082e12b1bSmrg   fi
184182e12b1bSmrgelif test "x$use_perl" = x"yes" ; then
184282e12b1bSmrg   AC_PATH_PROG([PERL], [perl])
184382e12b1bSmrg   if test "x$PERL" = "x"; then
184482e12b1bSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
184582e12b1bSmrg   fi
184682e12b1bSmrg   have_perl=yes
184782e12b1bSmrgelif test "x$use_perl" = x"no" ; then
184882e12b1bSmrg   if test "x$PERL" != "x"; then
184982e12b1bSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
185082e12b1bSmrg   fi
185182e12b1bSmrg   have_perl=no
185282e12b1bSmrgelse
185382e12b1bSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
185482e12b1bSmrgfi
185582e12b1bSmrg
185682e12b1bSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
185782e12b1bSmrg]) # XORG_WITH_PERL
185882e12b1bSmrg
185912391620Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
186012391620Smrg# ----------------
186112391620Smrg# Minimum version: 1.5.0
186212391620Smrg# Minimum version for optional DEFAULT argument: 1.11.0
186312391620Smrg#
186412391620Smrg# Documentation tools are not always available on all platforms and sometimes
186512391620Smrg# not at the appropriate level. This macro enables a module to test for the
186612391620Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
186712391620Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
186812391620Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
186912391620Smrg# --with-asciidoc assumes 'auto'.
187012391620Smrg#
187112391620Smrg# Interface to module:
187212391620Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
187312391620Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
187412391620Smrg#		 returns the path set by the user in the environment
187512391620Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
187612391620Smrg#		  'no' user instructs the module not to use asciidoc
187712391620Smrg#
187812391620Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
187912391620Smrg#
188012391620SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
188112391620SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
188212391620Smrgm4_define([_defopt], m4_default([$2], [auto]))
188312391620SmrgAC_ARG_WITH(asciidoc,
188412391620Smrg	AS_HELP_STRING([--with-asciidoc],
188512391620Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
188612391620Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
188712391620Smrgm4_undefine([_defopt])
188812391620Smrg
188912391620Smrgif test "x$use_asciidoc" = x"auto"; then
189012391620Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
189112391620Smrg   if test "x$ASCIIDOC" = "x"; then
189212391620Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
189312391620Smrg	have_asciidoc=no
189412391620Smrg   else
189512391620Smrg        have_asciidoc=yes
189612391620Smrg   fi
189712391620Smrgelif test "x$use_asciidoc" = x"yes" ; then
189812391620Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
189912391620Smrg   if test "x$ASCIIDOC" = "x"; then
190012391620Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
190112391620Smrg   fi
190212391620Smrg   have_asciidoc=yes
190312391620Smrgelif test "x$use_asciidoc" = x"no" ; then
190412391620Smrg   if test "x$ASCIIDOC" != "x"; then
190512391620Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
190612391620Smrg   fi
190712391620Smrg   have_asciidoc=no
190812391620Smrgelse
190912391620Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
191012391620Smrgfi
191112391620Smrgm4_ifval([$1],
191212391620Smrg[if test "$have_asciidoc" = yes; then
191312391620Smrg    # scrape the asciidoc version
191412391620Smrg    AC_MSG_CHECKING([the asciidoc version])
191512391620Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
191612391620Smrg    AC_MSG_RESULT([$asciidoc_version])
191712391620Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
191812391620Smrg        [if test "x$use_asciidoc" = xauto; then
191912391620Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
192012391620Smrg            have_asciidoc=no
192112391620Smrg        else
192212391620Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
192312391620Smrg        fi])
192412391620Smrgfi])
192512391620SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
192612391620Smrg]) # XORG_WITH_ASCIIDOC
192712391620Smrg
192812391620Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
19291b2353dbSmrg# -------------------------------------------
193012391620Smrg# Minimum version: 1.5.0
193112391620Smrg# Minimum version for optional DEFAULT argument: 1.11.0
19321b2353dbSmrg# Minimum version for optional DOT checking: 1.18.0
193312391620Smrg#
193412391620Smrg# Documentation tools are not always available on all platforms and sometimes
193512391620Smrg# not at the appropriate level. This macro enables a module to test for the
193612391620Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
193712391620Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
193812391620Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
193912391620Smrg# --with-doxygen assumes 'auto'.
194012391620Smrg#
194112391620Smrg# Interface to module:
194212391620Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
194312391620Smrg# DOXYGEN:	 returns the path of the doxygen program found
194412391620Smrg#		 returns the path set by the user in the environment
194512391620Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
194612391620Smrg#		  'no' user instructs the module not to use doxygen
194712391620Smrg#
194812391620Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
194912391620Smrg#
195012391620SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
195112391620SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
19521b2353dbSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
195312391620Smrgm4_define([_defopt], m4_default([$2], [auto]))
195412391620SmrgAC_ARG_WITH(doxygen,
195512391620Smrg	AS_HELP_STRING([--with-doxygen],
195612391620Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
195712391620Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
195812391620Smrgm4_undefine([_defopt])
195912391620Smrg
196012391620Smrgif test "x$use_doxygen" = x"auto"; then
196112391620Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
196212391620Smrg   if test "x$DOXYGEN" = "x"; then
196312391620Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
196412391620Smrg	have_doxygen=no
196512391620Smrg   else
196612391620Smrg        have_doxygen=yes
196712391620Smrg   fi
196812391620Smrgelif test "x$use_doxygen" = x"yes" ; then
196912391620Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
197012391620Smrg   if test "x$DOXYGEN" = "x"; then
197112391620Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
197212391620Smrg   fi
197312391620Smrg   have_doxygen=yes
197412391620Smrgelif test "x$use_doxygen" = x"no" ; then
197512391620Smrg   if test "x$DOXYGEN" != "x"; then
197612391620Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
197712391620Smrg   fi
197812391620Smrg   have_doxygen=no
197912391620Smrgelse
198012391620Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
198112391620Smrgfi
198212391620Smrgm4_ifval([$1],
198312391620Smrg[if test "$have_doxygen" = yes; then
198412391620Smrg    # scrape the doxygen version
198512391620Smrg    AC_MSG_CHECKING([the doxygen version])
198612391620Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
198712391620Smrg    AC_MSG_RESULT([$doxygen_version])
198812391620Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
198912391620Smrg        [if test "x$use_doxygen" = xauto; then
199012391620Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
199112391620Smrg            have_doxygen=no
199212391620Smrg        else
199312391620Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
199412391620Smrg        fi])
199512391620Smrgfi])
19961b2353dbSmrg
19971b2353dbSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
19981b2353dbSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
19991b2353dbSmrgdnl 	HAVE_DOT = @HAVE_DOT@
20001b2353dbSmrgHAVE_DOT=no
20011b2353dbSmrgif test "x$have_doxygen" = "xyes"; then
20021b2353dbSmrg  AC_PATH_PROG([DOT], [dot])
20031b2353dbSmrg    if test "x$DOT" != "x"; then
20041b2353dbSmrg      HAVE_DOT=yes
20051b2353dbSmrg    fi
20061b2353dbSmrgfi
20071b2353dbSmrg
20081b2353dbSmrgAC_SUBST([HAVE_DOT])
20091b2353dbSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
201012391620SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
201112391620Smrg]) # XORG_WITH_DOXYGEN
201212391620Smrg
201312391620Smrg# XORG_WITH_GROFF([DEFAULT])
201412391620Smrg# ----------------
201512391620Smrg# Minimum version: 1.6.0
201612391620Smrg# Minimum version for optional DEFAULT argument: 1.11.0
201712391620Smrg#
201812391620Smrg# Documentation tools are not always available on all platforms and sometimes
201912391620Smrg# not at the appropriate level. This macro enables a module to test for the
202012391620Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
202112391620Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
202212391620Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
202312391620Smrg# --with-groff assumes 'auto'.
202412391620Smrg#
202512391620Smrg# Interface to module:
202612391620Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
202712391620Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
202812391620Smrg# HAVE_GROFF_MS: the -ms macros package
202912391620Smrg# GROFF:	 returns the path of the groff program found
203012391620Smrg#		 returns the path set by the user in the environment
203112391620Smrg# --with-groff:	 'yes' user instructs the module to use groff
203212391620Smrg#		 'no' user instructs the module not to use groff
203312391620Smrg#
203412391620Smrg# Added in version 1.9.0:
203512391620Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
203612391620Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
203712391620Smrg#		   psselect from the psutils package.
203812391620Smrg#		   the ghostcript package. Refer to the grohtml man pages
203912391620Smrg#
204012391620Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
204112391620Smrg#
204212391620Smrg# OS and distros often splits groff in a basic and full package, the former
204312391620Smrg# having the groff program and the later having devices, fonts and macros
204412391620Smrg# Checking for the groff executable is not enough.
204512391620Smrg#
204612391620Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
204712391620Smrg# unset HAVE_GROFF or GROFF env variables.
204812391620Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
204912391620Smrg#
205012391620SmrgAC_DEFUN([XORG_WITH_GROFF],[
205112391620SmrgAC_ARG_VAR([GROFF], [Path to groff command])
205212391620Smrgm4_define([_defopt], m4_default([$1], [auto]))
205312391620SmrgAC_ARG_WITH(groff,
205412391620Smrg	AS_HELP_STRING([--with-groff],
205512391620Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
205612391620Smrg	   [use_groff=$withval], [use_groff=]_defopt)
205712391620Smrgm4_undefine([_defopt])
205812391620Smrg
205912391620Smrgif test "x$use_groff" = x"auto"; then
206012391620Smrg   AC_PATH_PROG([GROFF], [groff])
206112391620Smrg   if test "x$GROFF" = "x"; then
206212391620Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
206312391620Smrg	have_groff=no
206412391620Smrg   else
206512391620Smrg        have_groff=yes
206612391620Smrg   fi
206712391620Smrgelif test "x$use_groff" = x"yes" ; then
206812391620Smrg   AC_PATH_PROG([GROFF], [groff])
206912391620Smrg   if test "x$GROFF" = "x"; then
207012391620Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
207112391620Smrg   fi
207212391620Smrg   have_groff=yes
207312391620Smrgelif test "x$use_groff" = x"no" ; then
207412391620Smrg   if test "x$GROFF" != "x"; then
207512391620Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
207612391620Smrg   fi
207712391620Smrg   have_groff=no
207812391620Smrgelse
207912391620Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
208012391620Smrgfi
208112391620Smrg
208212391620Smrg# We have groff, test for the presence of the macro packages
208312391620Smrgif test "x$have_groff" = x"yes"; then
208412391620Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
208512391620Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
208612391620Smrg        groff_ms_works=yes
208712391620Smrg    else
208812391620Smrg        groff_ms_works=no
208912391620Smrg    fi
209012391620Smrg    AC_MSG_RESULT([$groff_ms_works])
209112391620Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
209212391620Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
209312391620Smrg        groff_mm_works=yes
209412391620Smrg    else
209512391620Smrg        groff_mm_works=no
209612391620Smrg    fi
209712391620Smrg    AC_MSG_RESULT([$groff_mm_works])
209812391620Smrgfi
209912391620Smrg
210012391620Smrg# We have groff, test for HTML dependencies, one command per package
210112391620Smrgif test "x$have_groff" = x"yes"; then
210212391620Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
210312391620Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
210412391620Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
210512391620Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
210612391620Smrg      have_groff_html=yes
210712391620Smrg   else
210812391620Smrg      have_groff_html=no
210912391620Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
211012391620Smrg   fi
211112391620Smrgfi
211212391620Smrg
211312391620Smrg# Set Automake conditionals for Makefiles
211412391620SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
211512391620SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
211612391620SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
211712391620SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
211812391620Smrg]) # XORG_WITH_GROFF
211912391620Smrg
212082e12b1bSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
212182e12b1bSmrg# ---------------------------------------
212212391620Smrg# Minimum version: 1.6.0
212312391620Smrg# Minimum version for optional DEFAULT argument: 1.11.0
212482e12b1bSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
212512391620Smrg#
212612391620Smrg# Documentation tools are not always available on all platforms and sometimes
212712391620Smrg# not at the appropriate level. This macro enables a module to test for the
212812391620Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
212912391620Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
213012391620Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
213112391620Smrg# --with-fop assumes 'auto'.
213212391620Smrg#
213312391620Smrg# Interface to module:
213412391620Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
213512391620Smrg# FOP:	 	returns the path of the fop program found
213612391620Smrg#		returns the path set by the user in the environment
213712391620Smrg# --with-fop: 	'yes' user instructs the module to use fop
213812391620Smrg#		'no' user instructs the module not to use fop
213912391620Smrg#
214012391620Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
214112391620Smrg#
214212391620SmrgAC_DEFUN([XORG_WITH_FOP],[
214312391620SmrgAC_ARG_VAR([FOP], [Path to fop command])
214482e12b1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
214512391620SmrgAC_ARG_WITH(fop,
214612391620Smrg	AS_HELP_STRING([--with-fop],
214712391620Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
214812391620Smrg	   [use_fop=$withval], [use_fop=]_defopt)
214912391620Smrgm4_undefine([_defopt])
215012391620Smrg
215112391620Smrgif test "x$use_fop" = x"auto"; then
215212391620Smrg   AC_PATH_PROG([FOP], [fop])
215312391620Smrg   if test "x$FOP" = "x"; then
215412391620Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
215512391620Smrg	have_fop=no
215612391620Smrg   else
215712391620Smrg        have_fop=yes
215812391620Smrg   fi
215912391620Smrgelif test "x$use_fop" = x"yes" ; then
216012391620Smrg   AC_PATH_PROG([FOP], [fop])
216112391620Smrg   if test "x$FOP" = "x"; then
216212391620Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
216312391620Smrg   fi
216412391620Smrg   have_fop=yes
216512391620Smrgelif test "x$use_fop" = x"no" ; then
216612391620Smrg   if test "x$FOP" != "x"; then
216712391620Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
216812391620Smrg   fi
216912391620Smrg   have_fop=no
217012391620Smrgelse
217112391620Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
217212391620Smrgfi
217382e12b1bSmrg
217482e12b1bSmrg# Test for a minimum version of fop, if provided.
217582e12b1bSmrgm4_ifval([$1],
217682e12b1bSmrg[if test "$have_fop" = yes; then
217782e12b1bSmrg    # scrape the fop version
217882e12b1bSmrg    AC_MSG_CHECKING([for fop minimum version])
217982e12b1bSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
218082e12b1bSmrg    AC_MSG_RESULT([$fop_version])
218182e12b1bSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
218282e12b1bSmrg        [if test "x$use_fop" = xauto; then
218382e12b1bSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
218482e12b1bSmrg            have_fop=no
218582e12b1bSmrg        else
218682e12b1bSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
218782e12b1bSmrg        fi])
218882e12b1bSmrgfi])
218912391620SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
219012391620Smrg]) # XORG_WITH_FOP
219112391620Smrg
21921b2353dbSmrg# XORG_WITH_M4([MIN-VERSION])
21931b2353dbSmrg# ---------------------------
21941b2353dbSmrg# Minimum version: 1.19.0
21951b2353dbSmrg#
21961b2353dbSmrg# This macro attempts to locate an m4 macro processor which supports
21971b2353dbSmrg# -I option and is only useful for modules relying on M4 in order to
21981b2353dbSmrg# expand macros in source code files.
21991b2353dbSmrg#
22001b2353dbSmrg# Interface to module:
22011b2353dbSmrg# M4:	 	returns the path of the m4 program found
22021b2353dbSmrg#		returns the path set by the user in the environment
22031b2353dbSmrg#
22041b2353dbSmrgAC_DEFUN([XORG_WITH_M4], [
22051b2353dbSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
22061b2353dbSmrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
22071b2353dbSmrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
22081b2353dbSmrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
22091b2353dbSmrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
22101b2353dbSmrg   [$PATH:/usr/gnu/bin])])
22111b2353dbSmrg
22121b2353dbSmrgAC_SUBST([M4], [$ac_cv_path_M4])
22131b2353dbSmrg]) # XORG_WITH_M4
22141b2353dbSmrg
221512391620Smrg# XORG_WITH_PS2PDF([DEFAULT])
221612391620Smrg# ----------------
221712391620Smrg# Minimum version: 1.6.0
221812391620Smrg# Minimum version for optional DEFAULT argument: 1.11.0
221912391620Smrg#
222012391620Smrg# Documentation tools are not always available on all platforms and sometimes
222112391620Smrg# not at the appropriate level. This macro enables a module to test for the
222212391620Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
222312391620Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
222412391620Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
222512391620Smrg# --with-ps2pdf assumes 'auto'.
222612391620Smrg#
222712391620Smrg# Interface to module:
222812391620Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
222912391620Smrg# PS2PDF:	returns the path of the ps2pdf program found
223012391620Smrg#		returns the path set by the user in the environment
223112391620Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
223212391620Smrg#		 'no' user instructs the module not to use ps2pdf
223312391620Smrg#
223412391620Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
223512391620Smrg#
223612391620SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
223712391620SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
223812391620Smrgm4_define([_defopt], m4_default([$1], [auto]))
223912391620SmrgAC_ARG_WITH(ps2pdf,
224012391620Smrg	AS_HELP_STRING([--with-ps2pdf],
224112391620Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
224212391620Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
224312391620Smrgm4_undefine([_defopt])
224412391620Smrg
224512391620Smrgif test "x$use_ps2pdf" = x"auto"; then
224612391620Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
224712391620Smrg   if test "x$PS2PDF" = "x"; then
224812391620Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
224912391620Smrg	have_ps2pdf=no
225012391620Smrg   else
225112391620Smrg        have_ps2pdf=yes
225212391620Smrg   fi
225312391620Smrgelif test "x$use_ps2pdf" = x"yes" ; then
225412391620Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
225512391620Smrg   if test "x$PS2PDF" = "x"; then
225612391620Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
225712391620Smrg   fi
225812391620Smrg   have_ps2pdf=yes
225912391620Smrgelif test "x$use_ps2pdf" = x"no" ; then
226012391620Smrg   if test "x$PS2PDF" != "x"; then
226112391620Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
226212391620Smrg   fi
226312391620Smrg   have_ps2pdf=no
226412391620Smrgelse
226512391620Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
226612391620Smrgfi
226712391620SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
226812391620Smrg]) # XORG_WITH_PS2PDF
226912391620Smrg
227012391620Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
227112391620Smrg# ----------------
227212391620Smrg# Minimum version: 1.6.0
227312391620Smrg#
227412391620Smrg# Documentation tools are not always available on all platforms and sometimes
227512391620Smrg# not at the appropriate level. This macro enables a builder to skip all
227612391620Smrg# documentation targets except traditional man pages.
227712391620Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
227812391620Smrg# maximum flexibilty in controlling documentation building.
227912391620Smrg# Refer to:
228012391620Smrg# XORG_WITH_XMLTO         --with-xmlto
228112391620Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
228212391620Smrg# XORG_WITH_DOXYGEN       --with-doxygen
228312391620Smrg# XORG_WITH_FOP           --with-fop
228412391620Smrg# XORG_WITH_GROFF         --with-groff
228512391620Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
228612391620Smrg#
228712391620Smrg# Interface to module:
228812391620Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
228912391620Smrg# --enable-docs: 'yes' user instructs the module to generate docs
229012391620Smrg#		 'no' user instructs the module not to generate docs
229112391620Smrg# parm1:	specify the default value, yes or no.
229212391620Smrg#
229312391620SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
229482e12b1bSmrgm4_define([docs_default], m4_default([$1], [yes]))
229512391620SmrgAC_ARG_ENABLE(docs,
229612391620Smrg	AS_HELP_STRING([--enable-docs],
229782e12b1bSmrg	   [Enable building the documentation (default: ]docs_default[)]),
229882e12b1bSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
229982e12b1bSmrgm4_undefine([docs_default])
230012391620SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
230112391620SmrgAC_MSG_CHECKING([whether to build documentation])
230212391620SmrgAC_MSG_RESULT([$build_docs])
230312391620Smrg]) # XORG_ENABLE_DOCS
230412391620Smrg
230512391620Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
230612391620Smrg# ----------------
230712391620Smrg# Minimum version: 1.6.0
230812391620Smrg#
230912391620Smrg# This macro enables a builder to skip all developer documentation.
231012391620Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
231112391620Smrg# maximum flexibilty in controlling documentation building.
231212391620Smrg# Refer to:
231312391620Smrg# XORG_WITH_XMLTO         --with-xmlto
231412391620Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
231512391620Smrg# XORG_WITH_DOXYGEN       --with-doxygen
231612391620Smrg# XORG_WITH_FOP           --with-fop
231712391620Smrg# XORG_WITH_GROFF         --with-groff
231812391620Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
231912391620Smrg#
232012391620Smrg# Interface to module:
232112391620Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
232212391620Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
232312391620Smrg#			'no' user instructs the module not to generate developer docs
232412391620Smrg# parm1:		specify the default value, yes or no.
232512391620Smrg#
232612391620SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
232712391620Smrgm4_define([devel_default], m4_default([$1], [yes]))
232812391620SmrgAC_ARG_ENABLE(devel-docs,
232912391620Smrg	AS_HELP_STRING([--enable-devel-docs],
233012391620Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
233112391620Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
233212391620Smrgm4_undefine([devel_default])
233312391620SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
233412391620SmrgAC_MSG_CHECKING([whether to build developer documentation])
233512391620SmrgAC_MSG_RESULT([$build_devel_docs])
233612391620Smrg]) # XORG_ENABLE_DEVEL_DOCS
233712391620Smrg
233812391620Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
233912391620Smrg# ----------------
234012391620Smrg# Minimum version: 1.6.0
234112391620Smrg#
234212391620Smrg# This macro enables a builder to skip all functional specification targets.
234312391620Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
234412391620Smrg# maximum flexibilty in controlling documentation building.
234512391620Smrg# Refer to:
234612391620Smrg# XORG_WITH_XMLTO         --with-xmlto
234712391620Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
234812391620Smrg# XORG_WITH_DOXYGEN       --with-doxygen
234912391620Smrg# XORG_WITH_FOP           --with-fop
235012391620Smrg# XORG_WITH_GROFF         --with-groff
235112391620Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
235212391620Smrg#
235312391620Smrg# Interface to module:
235412391620Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
235512391620Smrg# --enable-specs:	'yes' user instructs the module to generate specs
235612391620Smrg#			'no' user instructs the module not to generate specs
235712391620Smrg# parm1:		specify the default value, yes or no.
235812391620Smrg#
235912391620SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
236012391620Smrgm4_define([spec_default], m4_default([$1], [yes]))
236112391620SmrgAC_ARG_ENABLE(specs,
236212391620Smrg	AS_HELP_STRING([--enable-specs],
236312391620Smrg	   [Enable building the specs (default: ]spec_default[)]),
236412391620Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
236512391620Smrgm4_undefine([spec_default])
236612391620SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
236712391620SmrgAC_MSG_CHECKING([whether to build functional specifications])
236812391620SmrgAC_MSG_RESULT([$build_specs])
236912391620Smrg]) # XORG_ENABLE_SPECS
237012391620Smrg
237182e12b1bSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
237282e12b1bSmrg# ----------------------------------------------
237382e12b1bSmrg# Minimum version: 1.13.0
237482e12b1bSmrg#
237582e12b1bSmrg# This macro enables a builder to enable/disable unit testing
237682e12b1bSmrg# It makes no assumption about the test cases implementation
237782e12b1bSmrg# Test cases may or may not use Automake "Support for test suites"
237882e12b1bSmrg# They may or may not use the software utility library GLib
237982e12b1bSmrg#
238082e12b1bSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
238182e12b1bSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
238282e12b1bSmrg# The variable enable_unit_tests is used by other macros in this file.
238382e12b1bSmrg#
238482e12b1bSmrg# Interface to module:
238582e12b1bSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
238682e12b1bSmrg# enable_unit_tests:    used in configure.ac for additional configuration
238782e12b1bSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
238882e12b1bSmrg#			'no' user instructs the module not to build tests
238982e12b1bSmrg# parm1:		specify the default value, yes or no.
239082e12b1bSmrg#
239182e12b1bSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
239282e12b1bSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
239382e12b1bSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
239482e12b1bSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
239582e12b1bSmrgm4_define([_defopt], m4_default([$1], [auto]))
239682e12b1bSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
239782e12b1bSmrg	[Enable building unit test cases (default: ]_defopt[)]),
239882e12b1bSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
239982e12b1bSmrgm4_undefine([_defopt])
240082e12b1bSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
240182e12b1bSmrgAC_MSG_CHECKING([whether to build unit test cases])
240282e12b1bSmrgAC_MSG_RESULT([$enable_unit_tests])
240382e12b1bSmrg]) # XORG_ENABLE_UNIT_TESTS
240482e12b1bSmrg
240582e12b1bSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
240682e12b1bSmrg# ------------------------------------------------------
240782e12b1bSmrg# Minimum version: 1.17.0
240882e12b1bSmrg#
240982e12b1bSmrg# This macro enables a builder to enable/disable integration testing
241082e12b1bSmrg# It makes no assumption about the test cases' implementation
241182e12b1bSmrg# Test cases may or may not use Automake "Support for test suites"
241282e12b1bSmrg#
241382e12b1bSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
241482e12b1bSmrg# usually requires less dependencies and may be built and run under less
241582e12b1bSmrg# stringent environments than integration tests.
241682e12b1bSmrg#
241782e12b1bSmrg# Interface to module:
241882e12b1bSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
241982e12b1bSmrg# enable_integration_tests:   used in configure.ac for additional configuration
242082e12b1bSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
242182e12b1bSmrg#                             'no' user instructs the module not to build tests
242282e12b1bSmrg# parm1:                      specify the default value, yes or no.
242382e12b1bSmrg#
242482e12b1bSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
242582e12b1bSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
242682e12b1bSmrgm4_define([_defopt], m4_default([$1], [auto]))
242782e12b1bSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
242882e12b1bSmrg	[Enable building integration test cases (default: ]_defopt[)]),
242982e12b1bSmrg	[enable_integration_tests=$enableval],
243082e12b1bSmrg	[enable_integration_tests=]_defopt)
243182e12b1bSmrgm4_undefine([_defopt])
243282e12b1bSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
243382e12b1bSmrg	[test "x$enable_integration_tests" != xno])
243482e12b1bSmrgAC_MSG_CHECKING([whether to build unit test cases])
243582e12b1bSmrgAC_MSG_RESULT([$enable_integration_tests])
243682e12b1bSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
243782e12b1bSmrg
243882e12b1bSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
243982e12b1bSmrg# ----------------------------------------
244082e12b1bSmrg# Minimum version: 1.13.0
244182e12b1bSmrg#
244282e12b1bSmrg# GLib is a library which provides advanced data structures and functions.
244382e12b1bSmrg# This macro enables a module to test for the presence of Glib.
244482e12b1bSmrg#
244582e12b1bSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
244682e12b1bSmrg# Otherwise the value of $enable_unit_tests is blank.
244782e12b1bSmrg#
244882e12b1bSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
244982e12b1bSmrg# test support usually requires less dependencies and may be built and run under
245082e12b1bSmrg# less stringent environments than integration tests.
245182e12b1bSmrg#
245282e12b1bSmrg# Interface to module:
245382e12b1bSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
245482e12b1bSmrg# with_glib: used in configure.ac to know if GLib has been found
245582e12b1bSmrg# --with-glib:	'yes' user instructs the module to use glib
245682e12b1bSmrg#		'no' user instructs the module not to use glib
245782e12b1bSmrg#
245882e12b1bSmrgAC_DEFUN([XORG_WITH_GLIB],[
245982e12b1bSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
246082e12b1bSmrgm4_define([_defopt], m4_default([$2], [auto]))
246182e12b1bSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
246282e12b1bSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
246382e12b1bSmrg	[with_glib=$withval], [with_glib=]_defopt)
246482e12b1bSmrgm4_undefine([_defopt])
246582e12b1bSmrg
246682e12b1bSmrghave_glib=no
246782e12b1bSmrg# Do not probe GLib if user explicitly disabled unit testing
246882e12b1bSmrgif test "x$enable_unit_tests" != x"no"; then
246982e12b1bSmrg  # Do not probe GLib if user explicitly disabled it
247082e12b1bSmrg  if test "x$with_glib" != x"no"; then
247182e12b1bSmrg    m4_ifval(
247282e12b1bSmrg      [$1],
247382e12b1bSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
247482e12b1bSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
247582e12b1bSmrg    )
247682e12b1bSmrg  fi
247782e12b1bSmrgfi
247882e12b1bSmrg
247982e12b1bSmrg# Not having GLib when unit testing has been explicitly requested is an error
248082e12b1bSmrgif test "x$enable_unit_tests" = x"yes"; then
248182e12b1bSmrg  if test "x$have_glib" = x"no"; then
248282e12b1bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
248382e12b1bSmrg  fi
248482e12b1bSmrgfi
248582e12b1bSmrg
248682e12b1bSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
248782e12b1bSmrgif test "x$enable_unit_tests" = x"no"; then
248882e12b1bSmrg  if test "x$with_glib" = x"yes"; then
248982e12b1bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
249082e12b1bSmrg  fi
249182e12b1bSmrgfi
249282e12b1bSmrg
249382e12b1bSmrg# Not having GLib when it has been explicitly requested is an error
249482e12b1bSmrgif test "x$with_glib" = x"yes"; then
249582e12b1bSmrg  if test "x$have_glib" = x"no"; then
249682e12b1bSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
249782e12b1bSmrg  fi
249882e12b1bSmrgfi
249982e12b1bSmrg
250082e12b1bSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
250182e12b1bSmrg]) # XORG_WITH_GLIB
250282e12b1bSmrg
250382e12b1bSmrg# XORG_LD_WRAP([required|optional])
250482e12b1bSmrg# ---------------------------------
250582e12b1bSmrg# Minimum version: 1.13.0
250682e12b1bSmrg#
250782e12b1bSmrg# Check if linker supports -wrap, passed via compiler flags
250882e12b1bSmrg#
250982e12b1bSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
251082e12b1bSmrg# Otherwise the value of $enable_unit_tests is blank.
251182e12b1bSmrg#
251282e12b1bSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
251382e12b1bSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
251482e12b1bSmrg# available, an argument of "optional" allows use when some unit tests require
251582e12b1bSmrg# ld -wrap and others do not.
251682e12b1bSmrg#
251782e12b1bSmrgAC_DEFUN([XORG_LD_WRAP],[
251882e12b1bSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
251982e12b1bSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
252082e12b1bSmrg                      void __wrap_exit(int status) { return; }],
252182e12b1bSmrg                     [exit(0);])])
252282e12b1bSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
252382e12b1bSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
252482e12b1bSmrg  if test "x$have_ld_wrap" = x"no"; then
252582e12b1bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
252682e12b1bSmrg  fi
252782e12b1bSmrgfi
252882e12b1bSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
252982e12b1bSmrg#
253082e12b1bSmrg]) # XORG_LD_WRAP
253182e12b1bSmrg
253282e12b1bSmrg# XORG_CHECK_LINKER_FLAGS
253382e12b1bSmrg# -----------------------
253482e12b1bSmrg# SYNOPSIS
253582e12b1bSmrg#
253682e12b1bSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
253782e12b1bSmrg#
253882e12b1bSmrg# DESCRIPTION
253982e12b1bSmrg#
254082e12b1bSmrg#   Check whether the given linker FLAGS work with the current language's
254182e12b1bSmrg#   linker, or whether they give an error.
254282e12b1bSmrg#
254382e12b1bSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
254482e12b1bSmrg#   success/failure.
254582e12b1bSmrg#
254682e12b1bSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
254782e12b1bSmrg#
254882e12b1bSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
254982e12b1bSmrg#
255082e12b1bSmrg# LICENSE
255182e12b1bSmrg#
255282e12b1bSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
255382e12b1bSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
255482e12b1bSmrg#   Copyright (c) 2009 Matteo Frigo
255582e12b1bSmrg#
255682e12b1bSmrg#   This program is free software: you can redistribute it and/or modify it
255782e12b1bSmrg#   under the terms of the GNU General Public License as published by the
255882e12b1bSmrg#   Free Software Foundation, either version 3 of the License, or (at your
255982e12b1bSmrg#   option) any later version.
256082e12b1bSmrg#
256182e12b1bSmrg#   This program is distributed in the hope that it will be useful, but
256282e12b1bSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
256382e12b1bSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
256482e12b1bSmrg#   Public License for more details.
256582e12b1bSmrg#
256682e12b1bSmrg#   You should have received a copy of the GNU General Public License along
256782e12b1bSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
256882e12b1bSmrg#
256982e12b1bSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
257082e12b1bSmrg#   gives unlimited permission to copy, distribute and modify the configure
257182e12b1bSmrg#   scripts that are the output of Autoconf when processing the Macro. You
257282e12b1bSmrg#   need not follow the terms of the GNU General Public License when using
257382e12b1bSmrg#   or distributing such scripts, even though portions of the text of the
257482e12b1bSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
257582e12b1bSmrg#   all other use of the material that constitutes the Autoconf Macro.
257682e12b1bSmrg#
257782e12b1bSmrg#   This special exception to the GPL applies to versions of the Autoconf
257882e12b1bSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
257982e12b1bSmrg#   modified version of the Autoconf Macro, you may extend this special
258082e12b1bSmrg#   exception to the GPL to apply to your modified version as well.#
258182e12b1bSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
258282e12b1bSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
258382e12b1bSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
258482e12b1bSmrgAS_LITERAL_IF([$1],
258582e12b1bSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
258682e12b1bSmrg      ax_save_FLAGS=$LDFLAGS
258782e12b1bSmrg      LDFLAGS="$1"
258882e12b1bSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
258982e12b1bSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
259082e12b1bSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
259182e12b1bSmrg      LDFLAGS=$ax_save_FLAGS])],
259282e12b1bSmrg  [ax_save_FLAGS=$LDFLAGS
259382e12b1bSmrg   LDFLAGS="$1"
259482e12b1bSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
259582e12b1bSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
259682e12b1bSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
259782e12b1bSmrg   LDFLAGS=$ax_save_FLAGS])
259882e12b1bSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
259982e12b1bSmrgAC_MSG_RESULT($xorg_check_linker_flags)
260082e12b1bSmrgif test "x$xorg_check_linker_flags" = xyes; then
260182e12b1bSmrg	m4_default([$2], :)
260282e12b1bSmrgelse
260382e12b1bSmrg	m4_default([$3], :)
260482e12b1bSmrgfi
260582e12b1bSmrg]) # XORG_CHECK_LINKER_FLAGS
260682e12b1bSmrg
260782e12b1bSmrg# XORG_MEMORY_CHECK_FLAGS
260882e12b1bSmrg# -----------------------
260982e12b1bSmrg# Minimum version: 1.16.0
261082e12b1bSmrg#
261182e12b1bSmrg# This macro attempts to find appropriate memory checking functionality
261282e12b1bSmrg# for various platforms which unit testing code may use to catch various
261382e12b1bSmrg# forms of memory allocation and access errors in testing.
261482e12b1bSmrg#
261582e12b1bSmrg# Interface to module:
261682e12b1bSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
261782e12b1bSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
261882e12b1bSmrg#
261982e12b1bSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
262082e12b1bSmrg#
262182e12b1bSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
262282e12b1bSmrg
262382e12b1bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
262482e12b1bSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
262582e12b1bSmrg           [Environment variables to enable memory checking in tests])
262682e12b1bSmrg
262782e12b1bSmrg# Check for different types of support on different platforms
262882e12b1bSmrgcase $host_os in
262982e12b1bSmrg    solaris*)
263082e12b1bSmrg        AC_CHECK_LIB([umem], [umem_alloc],
263182e12b1bSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
263282e12b1bSmrg        ;;
263382e12b1bSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
263482e12b1bSmrg        # both directly and inverted, so should not be 0 or 255.
263582e12b1bSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
263682e12b1bSmrg        ;;
263782e12b1bSmrg    darwin*)
263882e12b1bSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
263982e12b1bSmrg        ;;
264082e12b1bSmrg    *bsd*)
264182e12b1bSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
264282e12b1bSmrg        ;;
264382e12b1bSmrgesac
264482e12b1bSmrg
264582e12b1bSmrg# User supplied flags override default flags
264682e12b1bSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
264782e12b1bSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
264882e12b1bSmrgfi
264982e12b1bSmrg
265082e12b1bSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
265182e12b1bSmrg]) # XORG_WITH_LINT
265282e12b1bSmrg
265321c2f794Smrg# XORG_CHECK_MALLOC_ZERO
265421c2f794Smrg# ----------------------
265521c2f794Smrg# Minimum version: 1.0.0
265621c2f794Smrg#
265721c2f794Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
265821c2f794Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
265921c2f794Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
266021c2f794SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
266121c2f794SmrgAC_ARG_ENABLE(malloc0returnsnull,
266212391620Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
266321c2f794Smrg		       [malloc(0) returns NULL (default: auto)]),
266421c2f794Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
266521c2f794Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
266621c2f794Smrg
266721c2f794SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
266821c2f794Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
26691b2353dbSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
26701b2353dbSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
267182e12b1bSmrg#include <stdlib.h>
267282e12b1bSmrg],[
267321c2f794Smrg    char *m0, *r0, *c0, *p;
267421c2f794Smrg    m0 = malloc(0);
267521c2f794Smrg    p = malloc(10);
267621c2f794Smrg    r0 = realloc(p,0);
267782e12b1bSmrg    c0 = calloc(0,10);
267882e12b1bSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
267982e12b1bSmrg])],
26801b2353dbSmrg		[xorg_cv_malloc0_returns_null=yes],
26811b2353dbSmrg		[xorg_cv_malloc0_returns_null=no])])
26821b2353dbSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
268321c2f794Smrgfi
268421c2f794SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
268521c2f794Smrg
268621c2f794Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
268721c2f794Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
268821c2f794Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
268921c2f794Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
269021c2f794Smrgelse
269121c2f794Smrg	MALLOC_ZERO_CFLAGS=""
269221c2f794Smrg	XMALLOC_ZERO_CFLAGS=""
269321c2f794Smrg	XTMALLOC_ZERO_CFLAGS=""
269421c2f794Smrgfi
269521c2f794Smrg
269621c2f794SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
269721c2f794SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
269821c2f794SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
269921c2f794Smrg]) # XORG_CHECK_MALLOC_ZERO
270021c2f794Smrg
270121c2f794Smrg# XORG_WITH_LINT()
270221c2f794Smrg# ----------------
270321c2f794Smrg# Minimum version: 1.1.0
270421c2f794Smrg#
270512391620Smrg# This macro enables the use of a tool that flags some suspicious and
270612391620Smrg# non-portable constructs (likely to be bugs) in C language source code.
270712391620Smrg# It will attempt to locate the tool and use appropriate options.
270812391620Smrg# There are various lint type tools on different platforms.
270912391620Smrg#
271012391620Smrg# Interface to module:
271112391620Smrg# LINT:		returns the path to the tool found on the platform
271212391620Smrg#		or the value set to LINT on the configure cmd line
271312391620Smrg#		also an Automake conditional
271412391620Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
271512391620Smrg#
271612391620Smrg# --with-lint:	'yes' user instructs the module to use lint
271712391620Smrg#		'no' user instructs the module not to use lint (default)
271812391620Smrg#
271912391620Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
272012391620Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
272121c2f794Smrg#
272221c2f794SmrgAC_DEFUN([XORG_WITH_LINT],[
272321c2f794Smrg
272412391620SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
272512391620SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
272612391620SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
272721c2f794Smrg		[Use a lint-style source code checker (default: disabled)])],
272821c2f794Smrg		[use_lint=$withval], [use_lint=no])
272912391620Smrg
273012391620Smrg# Obtain platform specific info like program name and options
273112391620Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
273212391620Smrgcase $host_os in
273312391620Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
273412391620Smrg	lint_name=splint
273512391620Smrg	lint_options="-badflag"
273612391620Smrg	;;
273712391620Smrg  *freebsd* | *netbsd*)
273812391620Smrg	lint_name=lint
273912391620Smrg	lint_options="-u -b"
274012391620Smrg	;;
274112391620Smrg  *solaris*)
274212391620Smrg	lint_name=lint
274312391620Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
274412391620Smrg	;;
274512391620Smrgesac
274612391620Smrg
274712391620Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
274812391620Smrgif test "x$use_lint" = x"yes" ; then
274912391620Smrg   AC_PATH_PROG([LINT], [$lint_name])
275012391620Smrg   if test "x$LINT" = "x"; then
275112391620Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
275212391620Smrg   fi
275312391620Smrgelif test "x$use_lint" = x"no" ; then
275412391620Smrg   if test "x$LINT" != "x"; then
275512391620Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
275612391620Smrg   fi
275721c2f794Smrgelse
275812391620Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
275921c2f794Smrgfi
276012391620Smrg
276112391620Smrg# User supplied flags override default flags
276212391620Smrgif test "x$LINT_FLAGS" != "x"; then
276312391620Smrg   lint_options=$LINT_FLAGS
276421c2f794Smrgfi
276521c2f794Smrg
276612391620SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
276712391620SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
276821c2f794Smrg
276921c2f794Smrg]) # XORG_WITH_LINT
277021c2f794Smrg
277121c2f794Smrg# XORG_LINT_LIBRARY(LIBNAME)
277221c2f794Smrg# --------------------------
277321c2f794Smrg# Minimum version: 1.1.0
277421c2f794Smrg#
277521c2f794Smrg# Sets up flags for building lint libraries for checking programs that call
277621c2f794Smrg# functions in the library.
277721c2f794Smrg#
277812391620Smrg# Interface to module:
277912391620Smrg# LINTLIB		- Automake variable with the name of lint library file to make
278012391620Smrg# MAKE_LINT_LIB		- Automake conditional
278112391620Smrg#
278212391620Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
278312391620Smrg#			  - 'no' user instructs the module not to create a lint library (default)
278421c2f794Smrg
278521c2f794SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
278621c2f794SmrgAC_REQUIRE([XORG_WITH_LINT])
278712391620SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
278821c2f794Smrg	[Create lint library (default: disabled)])],
278921c2f794Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
279012391620Smrg
279112391620Smrgif test "x$make_lint_lib" = x"yes" ; then
279212391620Smrg   LINTLIB=llib-l$1.ln
279312391620Smrg   if test "x$LINT" = "x"; then
279412391620Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
279512391620Smrg   fi
279612391620Smrgelif test "x$make_lint_lib" != x"no" ; then
279712391620Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
279821c2f794Smrgfi
279912391620Smrg
280021c2f794SmrgAC_SUBST(LINTLIB)
280121c2f794SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
280221c2f794Smrg
280321c2f794Smrg]) # XORG_LINT_LIBRARY
280421c2f794Smrg
280582e12b1bSmrg# XORG_COMPILER_BRAND
280682e12b1bSmrg# -------------------
280782e12b1bSmrg# Minimum version: 1.14.0
280882e12b1bSmrg#
280982e12b1bSmrg# Checks for various brands of compilers and sets flags as appropriate:
281082e12b1bSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
281182e12b1bSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
281282e12b1bSmrg#   clang compiler - sets CLANGCC to "yes"
281382e12b1bSmrg#   Intel compiler - sets INTELCC to "yes"
281482e12b1bSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
281582e12b1bSmrg#
281682e12b1bSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
281782e12b1bSmrgAC_LANG_CASE(
281882e12b1bSmrg	[C], [
281982e12b1bSmrg		AC_REQUIRE([AC_PROG_CC_C99])
282082e12b1bSmrg	],
282182e12b1bSmrg	[C++], [
282282e12b1bSmrg		AC_REQUIRE([AC_PROG_CXX])
282382e12b1bSmrg	]
282482e12b1bSmrg)
282582e12b1bSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
282682e12b1bSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
282782e12b1bSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
282882e12b1bSmrg]) # XORG_COMPILER_BRAND
282982e12b1bSmrg
283082e12b1bSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
283182e12b1bSmrg# ---------------
283282e12b1bSmrg# Minimum version: 1.16.0
283382e12b1bSmrg#
283482e12b1bSmrg# Test if the compiler works when passed the given flag as a command line argument.
283582e12b1bSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
283682e12b1bSmrg# next flag in the list until there are no more options.
283782e12b1bSmrg#
283882e12b1bSmrg# Note that this does not guarantee that the compiler supports the flag as some
283982e12b1bSmrg# compilers will simply ignore arguments that they do not understand, but we do
284082e12b1bSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
284182e12b1bSmrg# -Werror=unused-command-line-argument
284282e12b1bSmrg#
284382e12b1bSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
284482e12b1bSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
284582e12b1bSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
284682e12b1bSmrg
284782e12b1bSmrgAC_LANG_COMPILER_REQUIRE
284882e12b1bSmrg
284982e12b1bSmrgAC_LANG_CASE(
285082e12b1bSmrg	[C], [
285182e12b1bSmrg		AC_REQUIRE([AC_PROG_CC_C99])
285282e12b1bSmrg		define([PREFIX], [C])
285382e12b1bSmrg		define([CACHE_PREFIX], [cc])
285482e12b1bSmrg		define([COMPILER], [$CC])
285582e12b1bSmrg	],
285682e12b1bSmrg	[C++], [
285782e12b1bSmrg		define([PREFIX], [CXX])
285882e12b1bSmrg		define([CACHE_PREFIX], [cxx])
285982e12b1bSmrg		define([COMPILER], [$CXX])
286082e12b1bSmrg	]
286182e12b1bSmrg)
286282e12b1bSmrg
286382e12b1bSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
286482e12b1bSmrg
286582e12b1bSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
286682e12b1bSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
286782e12b1bSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
286882e12b1bSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
286982e12b1bSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
287082e12b1bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
287182e12b1bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
287282e12b1bSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
287382e12b1bSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
287482e12b1bSmrgfi
287582e12b1bSmrg
287682e12b1bSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
287782e12b1bSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
287882e12b1bSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
287982e12b1bSmrg	fi
288082e12b1bSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
288182e12b1bSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
288282e12b1bSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
288382e12b1bSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
288482e12b1bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
288582e12b1bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
288682e12b1bSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
288782e12b1bSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
288882e12b1bSmrgfi
288982e12b1bSmrg
289082e12b1bSmrgfound="no"
289182e12b1bSmrgm4_foreach([flag], m4_cdr($@), [
289282e12b1bSmrg	if test $found = "no" ; then
28931b2353dbSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
289482e12b1bSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
289582e12b1bSmrg		fi
289682e12b1bSmrg
28971b2353dbSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
289882e12b1bSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
289982e12b1bSmrg		fi
290082e12b1bSmrg
290182e12b1bSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
290282e12b1bSmrg
290382e12b1bSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
290482e12b1bSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
290582e12b1bSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
290682e12b1bSmrg		AC_CACHE_VAL($cacheid,
290782e12b1bSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
290882e12b1bSmrg					     [eval $cacheid=yes],
290982e12b1bSmrg					     [eval $cacheid=no])])
291082e12b1bSmrg
291182e12b1bSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
291282e12b1bSmrg
291382e12b1bSmrg		eval supported=\$$cacheid
291482e12b1bSmrg		AC_MSG_RESULT([$supported])
291582e12b1bSmrg		if test "$supported" = "yes" ; then
291682e12b1bSmrg			$1="$$1 ]flag["
291782e12b1bSmrg			found="yes"
291882e12b1bSmrg		fi
291982e12b1bSmrg	fi
292082e12b1bSmrg])
292182e12b1bSmrg]) # XORG_TESTSET_CFLAG
292282e12b1bSmrg
292382e12b1bSmrg# XORG_COMPILER_FLAGS
292482e12b1bSmrg# ---------------
292582e12b1bSmrg# Minimum version: 1.16.0
292682e12b1bSmrg#
292782e12b1bSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
292882e12b1bSmrg# arguments supported by the selected compiler which do NOT alter the generated
292982e12b1bSmrg# code.  These arguments will cause the compiler to print various warnings
293082e12b1bSmrg# during compilation AND turn a conservative set of warnings into errors.
293182e12b1bSmrg#
293282e12b1bSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
293382e12b1bSmrg# future versions of util-macros as options are added to new compilers.
293482e12b1bSmrg#
293582e12b1bSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
293682e12b1bSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
293782e12b1bSmrg
293882e12b1bSmrgAC_ARG_ENABLE(selective-werror,
293982e12b1bSmrg              AS_HELP_STRING([--disable-selective-werror],
294082e12b1bSmrg                             [Turn off selective compiler errors. (default: enabled)]),
294182e12b1bSmrg              [SELECTIVE_WERROR=$enableval],
294282e12b1bSmrg              [SELECTIVE_WERROR=yes])
294382e12b1bSmrg
294482e12b1bSmrgAC_LANG_CASE(
294582e12b1bSmrg        [C], [
294682e12b1bSmrg                define([PREFIX], [C])
294782e12b1bSmrg        ],
294882e12b1bSmrg        [C++], [
294982e12b1bSmrg                define([PREFIX], [CXX])
295082e12b1bSmrg        ]
295182e12b1bSmrg)
295282e12b1bSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
295382e12b1bSmrgif test "x$SUNCC" = "xyes"; then
295482e12b1bSmrg    [BASE_]PREFIX[FLAGS]="-v"
295582e12b1bSmrgelse
295682e12b1bSmrg    [BASE_]PREFIX[FLAGS]=""
295782e12b1bSmrgfi
295882e12b1bSmrg
295982e12b1bSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
296082e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
296182e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
296282e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
296382e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
296482e12b1bSmrg
296582e12b1bSmrgAC_LANG_CASE(
296682e12b1bSmrg	[C], [
296782e12b1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
296882e12b1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
296982e12b1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
297082e12b1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
29711b2353dbSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
297282e12b1bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
297382e12b1bSmrg	]
297482e12b1bSmrg)
297582e12b1bSmrg
297682e12b1bSmrg# This chunk adds additional warnings that could catch undesired effects.
297782e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
297882e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
297982e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
298082e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
298182e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
298282e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
29831b2353dbSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
298482e12b1bSmrg
298582e12b1bSmrg# These are currently disabled because they are noisy.  They will be enabled
298682e12b1bSmrg# in the future once the codebase is sufficiently modernized to silence
298782e12b1bSmrg# them.  For now, I don't want them to drown out the other warnings.
298882e12b1bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
298982e12b1bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
29901b2353dbSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
299182e12b1bSmrg
299282e12b1bSmrg# Turn some warnings into errors, so we don't accidently get successful builds
299382e12b1bSmrg# when there are problems that should be fixed.
299482e12b1bSmrg
299582e12b1bSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
299682e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
299782e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
299882e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
299982e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
300082e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
300182e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
300282e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
300382e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
300482e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
300582e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
300682e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
300782e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
300882e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
300982e12b1bSmrgelse
301082e12b1bSmrgAC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
301182e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
301282e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
301382e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
301482e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
301582e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
301682e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
301782e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
301882e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
301982e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
302082e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
302182e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
302282e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
302382e12b1bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
302482e12b1bSmrgfi
302582e12b1bSmrg
302682e12b1bSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
302782e12b1bSmrg]) # XORG_COMPILER_FLAGS
302882e12b1bSmrg
302912391620Smrg# XORG_CWARNFLAGS
303012391620Smrg# ---------------
303112391620Smrg# Minimum version: 1.2.0
303282e12b1bSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
303312391620Smrg#
303412391620Smrg# Defines CWARNFLAGS to enable C compiler warnings.
303512391620Smrg#
303682e12b1bSmrg# This function is deprecated because it defines -fno-strict-aliasing
303782e12b1bSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
303882e12b1bSmrg# is needed, then it should be added explicitly in the module when
303982e12b1bSmrg# it is updated to use BASE_CFLAGS.
304082e12b1bSmrg#
304112391620SmrgAC_DEFUN([XORG_CWARNFLAGS], [
304282e12b1bSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
304382e12b1bSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
304482e12b1bSmrgAC_LANG_CASE(
304582e12b1bSmrg	[C], [
304682e12b1bSmrg		CWARNFLAGS="$BASE_CFLAGS"
304782e12b1bSmrg		if  test "x$GCC" = xyes ; then
304882e12b1bSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
304982e12b1bSmrg		fi
305082e12b1bSmrg		AC_SUBST(CWARNFLAGS)
305182e12b1bSmrg	]
305282e12b1bSmrg)
305312391620Smrg]) # XORG_CWARNFLAGS
305412391620Smrg
305512391620Smrg# XORG_STRICT_OPTION
305612391620Smrg# -----------------------
305712391620Smrg# Minimum version: 1.3.0
305812391620Smrg#
305982e12b1bSmrg# Add configure option to enable strict compilation flags, such as treating
306082e12b1bSmrg# warnings as fatal errors.
306182e12b1bSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
306282e12b1bSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
306382e12b1bSmrg#
306482e12b1bSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
306582e12b1bSmrg# when strict compilation is unconditionally desired.
306612391620SmrgAC_DEFUN([XORG_STRICT_OPTION], [
306712391620SmrgAC_REQUIRE([XORG_CWARNFLAGS])
306882e12b1bSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
306912391620Smrg
307012391620SmrgAC_ARG_ENABLE(strict-compilation,
307112391620Smrg			  AS_HELP_STRING([--enable-strict-compilation],
307212391620Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
307312391620Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
307482e12b1bSmrg
307582e12b1bSmrgAC_LANG_CASE(
307682e12b1bSmrg        [C], [
307782e12b1bSmrg                define([PREFIX], [C])
307882e12b1bSmrg        ],
307982e12b1bSmrg        [C++], [
308082e12b1bSmrg                define([PREFIX], [CXX])
308182e12b1bSmrg        ]
308282e12b1bSmrg)
308382e12b1bSmrg
308482e12b1bSmrg[STRICT_]PREFIX[FLAGS]=""
308582e12b1bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
308682e12b1bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
308782e12b1bSmrg
308882e12b1bSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
308982e12b1bSmrg# activate it with -Werror, so we add it here explicitly.
309082e12b1bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
309182e12b1bSmrg
309212391620Smrgif test "x$STRICT_COMPILE" = "xyes"; then
309382e12b1bSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
309482e12b1bSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
309512391620Smrgfi
309682e12b1bSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
309782e12b1bSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
309882e12b1bSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
309912391620Smrg]) # XORG_STRICT_OPTION
310012391620Smrg
310112391620Smrg# XORG_DEFAULT_OPTIONS
310212391620Smrg# --------------------
310312391620Smrg# Minimum version: 1.3.0
310412391620Smrg#
310512391620Smrg# Defines default options for X.Org modules.
310612391620Smrg#
310712391620SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
310812391620SmrgAC_REQUIRE([AC_PROG_INSTALL])
310982e12b1bSmrgXORG_COMPILER_FLAGS
311012391620SmrgXORG_CWARNFLAGS
311112391620SmrgXORG_STRICT_OPTION
311212391620SmrgXORG_RELEASE_VERSION
311312391620SmrgXORG_CHANGELOG
311412391620SmrgXORG_INSTALL
311512391620SmrgXORG_MANPAGE_SECTIONS
311612391620Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
311712391620Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
311812391620Smrg]) # XORG_DEFAULT_OPTIONS
311912391620Smrg
312012391620Smrg# XORG_INSTALL()
312112391620Smrg# ----------------
312212391620Smrg# Minimum version: 1.4.0
312312391620Smrg#
312412391620Smrg# Defines the variable INSTALL_CMD as the command to copy
312512391620Smrg# INSTALL from $prefix/share/util-macros.
312612391620Smrg#
312712391620SmrgAC_DEFUN([XORG_INSTALL], [
312812391620SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
312912391620Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
313012391620SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
313112391620Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
313212391620Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
313312391620Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
313412391620SmrgAC_SUBST([INSTALL_CMD])
313512391620Smrg]) # XORG_INSTALL
313621c2f794Smrgdnl Copyright 2005 Red Hat, Inc
313721c2f794Smrgdnl
313821c2f794Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
313921c2f794Smrgdnl documentation for any purpose is hereby granted without fee, provided that
314021c2f794Smrgdnl the above copyright notice appear in all copies and that both that
314121c2f794Smrgdnl copyright notice and this permission notice appear in supporting
314221c2f794Smrgdnl documentation.
314321c2f794Smrgdnl
314421c2f794Smrgdnl The above copyright notice and this permission notice shall be included
314521c2f794Smrgdnl in all copies or substantial portions of the Software.
314621c2f794Smrgdnl
314721c2f794Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
314821c2f794Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
314921c2f794Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
315021c2f794Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
315121c2f794Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
315221c2f794Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
315321c2f794Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
315421c2f794Smrgdnl
315521c2f794Smrgdnl Except as contained in this notice, the name of the copyright holders shall
315621c2f794Smrgdnl not be used in advertising or otherwise to promote the sale, use or
315721c2f794Smrgdnl other dealings in this Software without prior written authorization
315821c2f794Smrgdnl from the copyright holders.
315921c2f794Smrgdnl
316021c2f794Smrg
316121c2f794Smrg# XORG_RELEASE_VERSION
316221c2f794Smrg# --------------------
316312391620Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
31641b2353dbSmrg
316521c2f794SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
316621c2f794Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
316721c2f794Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
316821c2f794Smrg		[Major version of this package])
316921c2f794Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
317021c2f794Smrg	if test "x$PVM" = "x"; then
317121c2f794Smrg		PVM="0"
317221c2f794Smrg	fi
317321c2f794Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
317421c2f794Smrg		[$PVM],
317521c2f794Smrg		[Minor version of this package])
317621c2f794Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
317721c2f794Smrg	if test "x$PVP" = "x"; then
317821c2f794Smrg		PVP="0"
317921c2f794Smrg	fi
318021c2f794Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
318121c2f794Smrg		[$PVP],
318221c2f794Smrg		[Patch version of this package])
318321c2f794Smrg])
318421c2f794Smrg
318512391620Smrg# XORG_CHANGELOG()
318612391620Smrg# ----------------
318712391620Smrg# Minimum version: 1.2.0
318812391620Smrg#
318912391620Smrg# Defines the variable CHANGELOG_CMD as the command to generate
319012391620Smrg# ChangeLog from git.
319112391620Smrg#
319212391620Smrg#
319312391620SmrgAC_DEFUN([XORG_CHANGELOG], [
319412391620SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
319512391620Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
319612391620Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
319712391620Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
319812391620SmrgAC_SUBST([CHANGELOG_CMD])
319912391620Smrg]) # XORG_CHANGELOG
320012391620Smrg
3201