aclocal.m4 revision 07d2e718
183e5f723Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2f46a6179Smrg
3f46a6179Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
434345a63Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5f46a6179Smrg# This file is free software; the Free Software Foundation
6f46a6179Smrg# gives unlimited permission to copy and/or distribute it,
7f46a6179Smrg# with or without modifications, as long as this notice is preserved.
8f46a6179Smrg
9f46a6179Smrg# This program is distributed in the hope that it will be useful,
10f46a6179Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11f46a6179Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12f46a6179Smrg# PARTICULAR PURPOSE.
13f46a6179Smrg
14f46a6179Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15f46a6179Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1607d2e718Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.66],,
1707d2e718Smrg[m4_warning([this file was generated for autoconf 2.66.
18f46a6179SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19f46a6179SmrgIf you have problems, you may need to regenerate the build system entirely.
20f46a6179SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21f46a6179Smrg
2207d2e718Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
2307d2e718Smrg# serial 1 (pkg-config-0.24)
2407d2e718Smrg# 
2507d2e718Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2607d2e718Smrg#
2707d2e718Smrg# This program is free software; you can redistribute it and/or modify
2807d2e718Smrg# it under the terms of the GNU General Public License as published by
2907d2e718Smrg# the Free Software Foundation; either version 2 of the License, or
3007d2e718Smrg# (at your option) any later version.
3107d2e718Smrg#
3207d2e718Smrg# This program is distributed in the hope that it will be useful, but
3307d2e718Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
3407d2e718Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3507d2e718Smrg# General Public License for more details.
3607d2e718Smrg#
3707d2e718Smrg# You should have received a copy of the GNU General Public License
3807d2e718Smrg# along with this program; if not, write to the Free Software
3907d2e718Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4007d2e718Smrg#
4107d2e718Smrg# As a special exception to the GNU General Public License, if you
4207d2e718Smrg# distribute this file as part of a program that contains a
4307d2e718Smrg# configuration script generated by Autoconf, you may include it under
4407d2e718Smrg# the same distribution terms that you use for the rest of that program.
4507d2e718Smrg
4607d2e718Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
4707d2e718Smrg# ----------------------------------
4807d2e718SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
4907d2e718Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
5007d2e718Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
5107d2e718SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
5207d2e718SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
5307d2e718SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
5407d2e718Smrg
5507d2e718Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
5607d2e718Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
5707d2e718Smrgfi
5807d2e718Smrgif test -n "$PKG_CONFIG"; then
5907d2e718Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
6007d2e718Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
6107d2e718Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
6207d2e718Smrg		AC_MSG_RESULT([yes])
6307d2e718Smrg	else
6407d2e718Smrg		AC_MSG_RESULT([no])
6507d2e718Smrg		PKG_CONFIG=""
6607d2e718Smrg	fi
6707d2e718Smrgfi[]dnl
6807d2e718Smrg])# PKG_PROG_PKG_CONFIG
6907d2e718Smrg
7007d2e718Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
7107d2e718Smrg#
7207d2e718Smrg# Check to see whether a particular set of modules exists.  Similar
7307d2e718Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
7407d2e718Smrg#
7507d2e718Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
7607d2e718Smrg# only at the first occurence in configure.ac, so if the first place
7707d2e718Smrg# it's called might be skipped (such as if it is within an "if", you
7807d2e718Smrg# have to call PKG_CHECK_EXISTS manually
7907d2e718Smrg# --------------------------------------------------------------
8007d2e718SmrgAC_DEFUN([PKG_CHECK_EXISTS],
8107d2e718Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8207d2e718Smrgif test -n "$PKG_CONFIG" && \
8307d2e718Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8407d2e718Smrg  m4_default([$2], [:])
8507d2e718Smrgm4_ifvaln([$3], [else
8607d2e718Smrg  $3])dnl
8707d2e718Smrgfi])
8807d2e718Smrg
8907d2e718Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9007d2e718Smrg# ---------------------------------------------
9107d2e718Smrgm4_define([_PKG_CONFIG],
9207d2e718Smrg[if test -n "$$1"; then
9307d2e718Smrg    pkg_cv_[]$1="$$1"
9407d2e718Smrg elif test -n "$PKG_CONFIG"; then
9507d2e718Smrg    PKG_CHECK_EXISTS([$3],
9607d2e718Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
9707d2e718Smrg		     [pkg_failed=yes])
9807d2e718Smrg else
9907d2e718Smrg    pkg_failed=untried
10007d2e718Smrgfi[]dnl
10107d2e718Smrg])# _PKG_CONFIG
10207d2e718Smrg
10307d2e718Smrg# _PKG_SHORT_ERRORS_SUPPORTED
10407d2e718Smrg# -----------------------------
10507d2e718SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
10607d2e718Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10707d2e718Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
10807d2e718Smrg        _pkg_short_errors_supported=yes
10907d2e718Smrgelse
11007d2e718Smrg        _pkg_short_errors_supported=no
11107d2e718Smrgfi[]dnl
11207d2e718Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
11307d2e718Smrg
11407d2e718Smrg
11507d2e718Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
11607d2e718Smrg# [ACTION-IF-NOT-FOUND])
11707d2e718Smrg#
11807d2e718Smrg#
11907d2e718Smrg# Note that if there is a possibility the first call to
12007d2e718Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
12107d2e718Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
12207d2e718Smrg#
12307d2e718Smrg#
12407d2e718Smrg# --------------------------------------------------------------
12507d2e718SmrgAC_DEFUN([PKG_CHECK_MODULES],
12607d2e718Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
12707d2e718SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
12807d2e718SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
12907d2e718Smrg
13007d2e718Smrgpkg_failed=no
13107d2e718SmrgAC_MSG_CHECKING([for $1])
13207d2e718Smrg
13307d2e718Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
13407d2e718Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
13507d2e718Smrg
13607d2e718Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
13707d2e718Smrgand $1[]_LIBS to avoid the need to call pkg-config.
13807d2e718SmrgSee the pkg-config man page for more details.])
13907d2e718Smrg
14007d2e718Smrgif test $pkg_failed = yes; then
14107d2e718Smrg   	AC_MSG_RESULT([no])
14207d2e718Smrg        _PKG_SHORT_ERRORS_SUPPORTED
14307d2e718Smrg        if test $_pkg_short_errors_supported = yes; then
14407d2e718Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
14507d2e718Smrg        else 
14607d2e718Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
14707d2e718Smrg        fi
14807d2e718Smrg	# Put the nasty error message in config.log where it belongs
14907d2e718Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
15007d2e718Smrg
15107d2e718Smrg	m4_default([$4], [AC_MSG_ERROR(
15207d2e718Smrg[Package requirements ($2) were not met:
15307d2e718Smrg
15407d2e718Smrg$$1_PKG_ERRORS
15507d2e718Smrg
15607d2e718SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
15707d2e718Smrginstalled software in a non-standard prefix.
15807d2e718Smrg
15907d2e718Smrg_PKG_TEXT])
16007d2e718Smrg        ])
16107d2e718Smrgelif test $pkg_failed = untried; then
16207d2e718Smrg     	AC_MSG_RESULT([no])
16307d2e718Smrg	m4_default([$4], [AC_MSG_FAILURE(
16407d2e718Smrg[The pkg-config script could not be found or is too old.  Make sure it
16507d2e718Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
16607d2e718Smrgpath to pkg-config.
16707d2e718Smrg
16807d2e718Smrg_PKG_TEXT
16907d2e718Smrg
17007d2e718SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])
17107d2e718Smrg        ])
17207d2e718Smrgelse
17307d2e718Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
17407d2e718Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
17507d2e718Smrg        AC_MSG_RESULT([yes])
17607d2e718Smrg	$3
17707d2e718Smrgfi[]dnl
17807d2e718Smrg])# PKG_CHECK_MODULES
17907d2e718Smrg
1805fac8b10Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
1815fac8b10Smrg#
1825fac8b10Smrg# This file is free software; the Free Software Foundation
1835fac8b10Smrg# gives unlimited permission to copy and/or distribute it,
1845fac8b10Smrg# with or without modifications, as long as this notice is preserved.
185f46a6179Smrg
1865fac8b10Smrg# AM_AUTOMAKE_VERSION(VERSION)
1875fac8b10Smrg# ----------------------------
1885fac8b10Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
1895fac8b10Smrg# generated from the m4 files accompanying Automake X.Y.
1905fac8b10Smrg# (This private macro should not be called outside this file.)
1915fac8b10SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
1925fac8b10Smrg[am__api_version='1.11'
1935fac8b10Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1945fac8b10Smrgdnl require some minimum version.  Point them to the right macro.
19583e5f723Smrgm4_if([$1], [1.11.1], [],
1965fac8b10Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1975fac8b10Smrg])
1985fac8b10Smrg
1995fac8b10Smrg# _AM_AUTOCONF_VERSION(VERSION)
2005fac8b10Smrg# -----------------------------
2015fac8b10Smrg# aclocal traces this macro to find the Autoconf version.
2025fac8b10Smrg# This is a private macro too.  Using m4_define simplifies
2035fac8b10Smrg# the logic in aclocal, which can simply ignore this definition.
2045fac8b10Smrgm4_define([_AM_AUTOCONF_VERSION], [])
2055fac8b10Smrg
2065fac8b10Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
2075fac8b10Smrg# -------------------------------
2085fac8b10Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
2095fac8b10Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
2105fac8b10SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
21183e5f723Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
2125fac8b10Smrgm4_ifndef([AC_AUTOCONF_VERSION],
2135fac8b10Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
2145fac8b10Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
2155fac8b10Smrg
2165fac8b10Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
2175fac8b10Smrg
2185fac8b10Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
219f46a6179Smrg#
2205fac8b10Smrg# This file is free software; the Free Software Foundation
2215fac8b10Smrg# gives unlimited permission to copy and/or distribute it,
2225fac8b10Smrg# with or without modifications, as long as this notice is preserved.
2235fac8b10Smrg
2245fac8b10Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
2255fac8b10Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
2265fac8b10Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
227f46a6179Smrg#
2285fac8b10Smrg# Of course, Automake must honor this variable whenever it calls a
2295fac8b10Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
2305fac8b10Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
2315fac8b10Smrg# depending on how configure is run.  This is pretty annoying, since
2325fac8b10Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
2335fac8b10Smrg# source directory, any form will work fine, but in subdirectories a
2345fac8b10Smrg# relative path needs to be adjusted first.
235f46a6179Smrg#
2365fac8b10Smrg# $ac_aux_dir/missing
2375fac8b10Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
2385fac8b10Smrg# $top_srcdir/$ac_aux_dir/missing
2395fac8b10Smrg#    fails if $ac_aux_dir is absolute,
2405fac8b10Smrg#    fails when called from a subdirectory in a VPATH build with
2415fac8b10Smrg#          a relative $ac_aux_dir
242f46a6179Smrg#
2435fac8b10Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
2445fac8b10Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
2455fac8b10Smrg# harmless because $srcdir is `.', but things will broke when you
2465fac8b10Smrg# start a VPATH build or use an absolute $srcdir.
247f46a6179Smrg#
2485fac8b10Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
2495fac8b10Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
2505fac8b10Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
2515fac8b10Smrg# and then we would define $MISSING as
2525fac8b10Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
2535fac8b10Smrg# This will work as long as MISSING is not called from configure, because
2545fac8b10Smrg# unfortunately $(top_srcdir) has no meaning in configure.
2555fac8b10Smrg# However there are other variables, like CC, which are often used in
2565fac8b10Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
2575fac8b10Smrg#
2585fac8b10Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
2595fac8b10Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
2605fac8b10Smrg# configured tree to be moved without reconfiguration.
261f46a6179Smrg
2625fac8b10SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
2635fac8b10Smrg[dnl Rely on autoconf to set up CDPATH properly.
2645fac8b10SmrgAC_PREREQ([2.50])dnl
2655fac8b10Smrg# expand $ac_aux_dir to an absolute path
2665fac8b10Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
2675fac8b10Smrg])
268f46a6179Smrg
2695fac8b10Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
270f46a6179Smrg
2715fac8b10Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
2725fac8b10Smrg# Free Software Foundation, Inc.
273f46a6179Smrg#
2745fac8b10Smrg# This file is free software; the Free Software Foundation
2755fac8b10Smrg# gives unlimited permission to copy and/or distribute it,
2765fac8b10Smrg# with or without modifications, as long as this notice is preserved.
277f46a6179Smrg
2785fac8b10Smrg# serial 9
279f46a6179Smrg
2805fac8b10Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
2815fac8b10Smrg# -------------------------------------
2825fac8b10Smrg# Define a conditional.
2835fac8b10SmrgAC_DEFUN([AM_CONDITIONAL],
2845fac8b10Smrg[AC_PREREQ(2.52)dnl
2855fac8b10Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
2865fac8b10Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
2875fac8b10SmrgAC_SUBST([$1_TRUE])dnl
2885fac8b10SmrgAC_SUBST([$1_FALSE])dnl
2895fac8b10Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
2905fac8b10Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
2915fac8b10Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
2925fac8b10Smrgif $2; then
2935fac8b10Smrg  $1_TRUE=
2945fac8b10Smrg  $1_FALSE='#'
2955fac8b10Smrgelse
2965fac8b10Smrg  $1_TRUE='#'
2975fac8b10Smrg  $1_FALSE=
298f46a6179Smrgfi
2995fac8b10SmrgAC_CONFIG_COMMANDS_PRE(
3005fac8b10Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
3015fac8b10Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
3025fac8b10SmrgUsually this means the macro was only invoked conditionally.]])
3035fac8b10Smrgfi])])
304f46a6179Smrg
3055fac8b10Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
3065fac8b10Smrg# Free Software Foundation, Inc.
3075fac8b10Smrg#
3085fac8b10Smrg# This file is free software; the Free Software Foundation
3095fac8b10Smrg# gives unlimited permission to copy and/or distribute it,
3105fac8b10Smrg# with or without modifications, as long as this notice is preserved.
311f46a6179Smrg
3125fac8b10Smrg# serial 10
313f46a6179Smrg
3145fac8b10Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
3155fac8b10Smrg# written in clear, in which case automake, when reading aclocal.m4,
3165fac8b10Smrg# will think it sees a *use*, and therefore will trigger all it's
3175fac8b10Smrg# C support machinery.  Also note that it means that autoscan, seeing
3185fac8b10Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
319f46a6179Smrg
320f46a6179Smrg
3215fac8b10Smrg# _AM_DEPENDENCIES(NAME)
3225fac8b10Smrg# ----------------------
3235fac8b10Smrg# See how the compiler implements dependency checking.
3245fac8b10Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
3255fac8b10Smrg# We try a few techniques and use that to set a single cache variable.
326f46a6179Smrg#
3275fac8b10Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
3285fac8b10Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
3295fac8b10Smrg# dependency, and given that the user is not expected to run this macro,
3305fac8b10Smrg# just rely on AC_PROG_CC.
3315fac8b10SmrgAC_DEFUN([_AM_DEPENDENCIES],
3325fac8b10Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
3335fac8b10SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
3345fac8b10SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
3355fac8b10SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
336f46a6179Smrg
3375fac8b10Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
3385fac8b10Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
3395fac8b10Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
3405fac8b10Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
3415fac8b10Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
3425fac8b10Smrg                   [depcc="$$1"   am_compiler_list=])
343f46a6179Smrg
3445fac8b10SmrgAC_CACHE_CHECK([dependency style of $depcc],
3455fac8b10Smrg               [am_cv_$1_dependencies_compiler_type],
3465fac8b10Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
3475fac8b10Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
3485fac8b10Smrg  # making bogus files that we don't know about and never remove.  For
3495fac8b10Smrg  # instance it was reported that on HP-UX the gcc test will end up
3505fac8b10Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
3515fac8b10Smrg  # in D'.
3525fac8b10Smrg  mkdir conftest.dir
3535fac8b10Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
3545fac8b10Smrg  # using a relative directory.
3555fac8b10Smrg  cp "$am_depcomp" conftest.dir
3565fac8b10Smrg  cd conftest.dir
3575fac8b10Smrg  # We will build objects and dependencies in a subdirectory because
3585fac8b10Smrg  # it helps to detect inapplicable dependency modes.  For instance
3595fac8b10Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
3605fac8b10Smrg  # side effect of compilation, but ICC will put the dependencies in
3615fac8b10Smrg  # the current directory while Tru64 will put them in the object
3625fac8b10Smrg  # directory.
3635fac8b10Smrg  mkdir sub
364f46a6179Smrg
3655fac8b10Smrg  am_cv_$1_dependencies_compiler_type=none
3665fac8b10Smrg  if test "$am_compiler_list" = ""; then
3675fac8b10Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
3685fac8b10Smrg  fi
3695fac8b10Smrg  am__universal=false
3705fac8b10Smrg  m4_case([$1], [CC],
3715fac8b10Smrg    [case " $depcc " in #(
3725fac8b10Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
3735fac8b10Smrg     esac],
3745fac8b10Smrg    [CXX],
3755fac8b10Smrg    [case " $depcc " in #(
3765fac8b10Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
3775fac8b10Smrg     esac])
378f46a6179Smrg
3795fac8b10Smrg  for depmode in $am_compiler_list; do
3805fac8b10Smrg    # Setup a source with many dependencies, because some compilers
3815fac8b10Smrg    # like to wrap large dependency lists on column 80 (with \), and
3825fac8b10Smrg    # we should not choose a depcomp mode which is confused by this.
3835fac8b10Smrg    #
3845fac8b10Smrg    # We need to recreate these files for each test, as the compiler may
3855fac8b10Smrg    # overwrite some of them when testing with obscure command lines.
3865fac8b10Smrg    # This happens at least with the AIX C compiler.
3875fac8b10Smrg    : > sub/conftest.c
3885fac8b10Smrg    for i in 1 2 3 4 5 6; do
3895fac8b10Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
3905fac8b10Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
3915fac8b10Smrg      # Solaris 8's {/usr,}/bin/sh.
3925fac8b10Smrg      touch sub/conftst$i.h
3935fac8b10Smrg    done
3945fac8b10Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
395f46a6179Smrg
3965fac8b10Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
3975fac8b10Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
3985fac8b10Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
3995fac8b10Smrg    # versions had trouble with output in subdirs
4005fac8b10Smrg    am__obj=sub/conftest.${OBJEXT-o}
4015fac8b10Smrg    am__minus_obj="-o $am__obj"
4025fac8b10Smrg    case $depmode in
4035fac8b10Smrg    gcc)
4045fac8b10Smrg      # This depmode causes a compiler race in universal mode.
4055fac8b10Smrg      test "$am__universal" = false || continue
4065fac8b10Smrg      ;;
4075fac8b10Smrg    nosideeffect)
4085fac8b10Smrg      # after this tag, mechanisms are not by side-effect, so they'll
4095fac8b10Smrg      # only be used when explicitly requested
4105fac8b10Smrg      if test "x$enable_dependency_tracking" = xyes; then
4115fac8b10Smrg	continue
4125fac8b10Smrg      else
4135fac8b10Smrg	break
4145fac8b10Smrg      fi
4155fac8b10Smrg      ;;
4165fac8b10Smrg    msvisualcpp | msvcmsys)
4175fac8b10Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
4185fac8b10Smrg      # not run yet.  These depmodes are late enough in the game, and
4195fac8b10Smrg      # so weak that their functioning should not be impacted.
4205fac8b10Smrg      am__obj=conftest.${OBJEXT-o}
4215fac8b10Smrg      am__minus_obj=
4225fac8b10Smrg      ;;
4235fac8b10Smrg    none) break ;;
4245fac8b10Smrg    esac
4255fac8b10Smrg    if depmode=$depmode \
4265fac8b10Smrg       source=sub/conftest.c object=$am__obj \
4275fac8b10Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
4285fac8b10Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
4295fac8b10Smrg         >/dev/null 2>conftest.err &&
4305fac8b10Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
4315fac8b10Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
4325fac8b10Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
4335fac8b10Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
4345fac8b10Smrg      # icc doesn't choke on unknown options, it will just issue warnings
4355fac8b10Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
4365fac8b10Smrg      # that says an option was ignored or not supported.
4375fac8b10Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
4385fac8b10Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
4395fac8b10Smrg      # The diagnosis changed in icc 8.0:
4405fac8b10Smrg      #   icc: Command line remark: option '-MP' not supported
4415fac8b10Smrg      if (grep 'ignoring option' conftest.err ||
4425fac8b10Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
4435fac8b10Smrg        am_cv_$1_dependencies_compiler_type=$depmode
4445fac8b10Smrg        break
4455fac8b10Smrg      fi
4465fac8b10Smrg    fi
4475fac8b10Smrg  done
448f46a6179Smrg
4495fac8b10Smrg  cd ..
4505fac8b10Smrg  rm -rf conftest.dir
451f46a6179Smrgelse
4525fac8b10Smrg  am_cv_$1_dependencies_compiler_type=none
453f46a6179Smrgfi
4545fac8b10Smrg])
4555fac8b10SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
4565fac8b10SmrgAM_CONDITIONAL([am__fastdep$1], [
4575fac8b10Smrg  test "x$enable_dependency_tracking" != xno \
4585fac8b10Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
4595fac8b10Smrg])
460f46a6179Smrg
461f46a6179Smrg
4625fac8b10Smrg# AM_SET_DEPDIR
4635fac8b10Smrg# -------------
4645fac8b10Smrg# Choose a directory name for dependency files.
4655fac8b10Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
4665fac8b10SmrgAC_DEFUN([AM_SET_DEPDIR],
4675fac8b10Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
4685fac8b10SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
4695fac8b10Smrg])
470f46a6179Smrg
471f46a6179Smrg
4725fac8b10Smrg# AM_DEP_TRACK
4735fac8b10Smrg# ------------
4745fac8b10SmrgAC_DEFUN([AM_DEP_TRACK],
4755fac8b10Smrg[AC_ARG_ENABLE(dependency-tracking,
4765fac8b10Smrg[  --disable-dependency-tracking  speeds up one-time build
4775fac8b10Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
4785fac8b10Smrgif test "x$enable_dependency_tracking" != xno; then
4795fac8b10Smrg  am_depcomp="$ac_aux_dir/depcomp"
4805fac8b10Smrg  AMDEPBACKSLASH='\'
48134345a63Smrgfi
4825fac8b10SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
4835fac8b10SmrgAC_SUBST([AMDEPBACKSLASH])dnl
4845fac8b10Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
4855fac8b10Smrg])
486f46a6179Smrg
4875fac8b10Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
488f46a6179Smrg
4895fac8b10Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
4905fac8b10Smrg# Free Software Foundation, Inc.
4915fac8b10Smrg#
4925fac8b10Smrg# This file is free software; the Free Software Foundation
4935fac8b10Smrg# gives unlimited permission to copy and/or distribute it,
4945fac8b10Smrg# with or without modifications, as long as this notice is preserved.
495f46a6179Smrg
4965fac8b10Smrg#serial 5
497f46a6179Smrg
4985fac8b10Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
4995fac8b10Smrg# ------------------------------
5005fac8b10SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
5015fac8b10Smrg[{
5025fac8b10Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
5035fac8b10Smrg  # are listed without --file.  Let's play safe and only enable the eval
5045fac8b10Smrg  # if we detect the quoting.
5055fac8b10Smrg  case $CONFIG_FILES in
5065fac8b10Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
5075fac8b10Smrg  *)   set x $CONFIG_FILES ;;
5085fac8b10Smrg  esac
5095fac8b10Smrg  shift
5105fac8b10Smrg  for mf
5115fac8b10Smrg  do
5125fac8b10Smrg    # Strip MF so we end up with the name of the file.
5135fac8b10Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
5145fac8b10Smrg    # Check whether this is an Automake generated Makefile or not.
5155fac8b10Smrg    # We used to match only the files named `Makefile.in', but
5165fac8b10Smrg    # some people rename them; so instead we look at the file content.
5175fac8b10Smrg    # Grep'ing the first line is not enough: some people post-process
5185fac8b10Smrg    # each Makefile.in and add a new line on top of each file to say so.
5195fac8b10Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
5205fac8b10Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
5215fac8b10Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
5225fac8b10Smrg      dirpart=`AS_DIRNAME("$mf")`
5235fac8b10Smrg    else
5245fac8b10Smrg      continue
5255fac8b10Smrg    fi
5265fac8b10Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
5275fac8b10Smrg    # from the Makefile without running `make'.
5285fac8b10Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
5295fac8b10Smrg    test -z "$DEPDIR" && continue
5305fac8b10Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
5315fac8b10Smrg    test -z "am__include" && continue
5325fac8b10Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
5335fac8b10Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
5345fac8b10Smrg    U=`sed -n 's/^U = //p' < "$mf"`
5355fac8b10Smrg    # Find all dependency output files, they are included files with
5365fac8b10Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
5375fac8b10Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
5385fac8b10Smrg    # expansion.
5395fac8b10Smrg    for file in `sed -n "
5405fac8b10Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
5415fac8b10Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
5425fac8b10Smrg      # Make sure the directory exists.
5435fac8b10Smrg      test -f "$dirpart/$file" && continue
5445fac8b10Smrg      fdir=`AS_DIRNAME(["$file"])`
5455fac8b10Smrg      AS_MKDIR_P([$dirpart/$fdir])
5465fac8b10Smrg      # echo "creating $dirpart/$file"
5475fac8b10Smrg      echo '# dummy' > "$dirpart/$file"
5485fac8b10Smrg    done
5495fac8b10Smrg  done
5505fac8b10Smrg}
5515fac8b10Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
552f46a6179Smrg
553f46a6179Smrg
5545fac8b10Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
5555fac8b10Smrg# -----------------------------
5565fac8b10Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
5575fac8b10Smrg#
5585fac8b10Smrg# This code is only required when automatic dependency tracking
5595fac8b10Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
5605fac8b10Smrg# need in order to bootstrap the dependency handling code.
5615fac8b10SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
5625fac8b10Smrg[AC_CONFIG_COMMANDS([depfiles],
5635fac8b10Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
5645fac8b10Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
5655fac8b10Smrg])
566f46a6179Smrg
5675fac8b10Smrg# Do all the work for Automake.                             -*- Autoconf -*-
568f46a6179Smrg
5695fac8b10Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5705fac8b10Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
571f46a6179Smrg#
5725fac8b10Smrg# This file is free software; the Free Software Foundation
5735fac8b10Smrg# gives unlimited permission to copy and/or distribute it,
5745fac8b10Smrg# with or without modifications, as long as this notice is preserved.
575f46a6179Smrg
5765fac8b10Smrg# serial 16
577f46a6179Smrg
5785fac8b10Smrg# This macro actually does too much.  Some checks are only needed if
5795fac8b10Smrg# your package does certain things.  But this isn't really a big deal.
580f46a6179Smrg
5815fac8b10Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
5825fac8b10Smrg# AM_INIT_AUTOMAKE([OPTIONS])
5835fac8b10Smrg# -----------------------------------------------
5845fac8b10Smrg# The call with PACKAGE and VERSION arguments is the old style
5855fac8b10Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
5865fac8b10Smrg# and VERSION should now be passed to AC_INIT and removed from
5875fac8b10Smrg# the call to AM_INIT_AUTOMAKE.
5885fac8b10Smrg# We support both call styles for the transition.  After
5895fac8b10Smrg# the next Automake release, Autoconf can make the AC_INIT
5905fac8b10Smrg# arguments mandatory, and then we can depend on a new Autoconf
5915fac8b10Smrg# release and drop the old call support.
5925fac8b10SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
5935fac8b10Smrg[AC_PREREQ([2.62])dnl
5945fac8b10Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
5955fac8b10Smrgdnl the ones we care about.
5965fac8b10Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
5975fac8b10SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
5985fac8b10SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
5995fac8b10Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
6005fac8b10Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
6015fac8b10Smrg  # is not polluted with repeated "-I."
6025fac8b10Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
6035fac8b10Smrg  # test to see if srcdir already configured
6045fac8b10Smrg  if test -f $srcdir/config.status; then
6055fac8b10Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
6065fac8b10Smrg  fi
607f46a6179Smrgfi
608f46a6179Smrg
6095fac8b10Smrg# test whether we have cygpath
6105fac8b10Smrgif test -z "$CYGPATH_W"; then
6115fac8b10Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
6125fac8b10Smrg    CYGPATH_W='cygpath -w'
6135fac8b10Smrg  else
6145fac8b10Smrg    CYGPATH_W=echo
6155fac8b10Smrg  fi
6165fac8b10Smrgfi
6175fac8b10SmrgAC_SUBST([CYGPATH_W])
618f46a6179Smrg
6195fac8b10Smrg# Define the identity of the package.
6205fac8b10Smrgdnl Distinguish between old-style and new-style calls.
6215fac8b10Smrgm4_ifval([$2],
6225fac8b10Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
6235fac8b10Smrg AC_SUBST([PACKAGE], [$1])dnl
6245fac8b10Smrg AC_SUBST([VERSION], [$2])],
6255fac8b10Smrg[_AM_SET_OPTIONS([$1])dnl
6265fac8b10Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
6275fac8b10Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
6285fac8b10Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
6295fac8b10Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
6305fac8b10Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
631f46a6179Smrg
6325fac8b10Smrg_AM_IF_OPTION([no-define],,
6335fac8b10Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
6345fac8b10Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
6355fac8b10Smrg
6365fac8b10Smrg# Some tools Automake needs.
6375fac8b10SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
6385fac8b10SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
6395fac8b10SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
6405fac8b10SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
6415fac8b10SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
6425fac8b10SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
6435fac8b10SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
6445fac8b10SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
6455fac8b10SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
6465fac8b10SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
6475fac8b10Smrg# We need awk for the "check" target.  The system "awk" is bad on
6485fac8b10Smrg# some platforms.
6495fac8b10SmrgAC_REQUIRE([AC_PROG_AWK])dnl
6505fac8b10SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
6515fac8b10SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
6525fac8b10Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
6535fac8b10Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
6545fac8b10Smrg			     [_AM_PROG_TAR([v7])])])
6555fac8b10Smrg_AM_IF_OPTION([no-dependencies],,
6565fac8b10Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
6575fac8b10Smrg		  [_AM_DEPENDENCIES(CC)],
6585fac8b10Smrg		  [define([AC_PROG_CC],
6595fac8b10Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
6605fac8b10SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
6615fac8b10Smrg		  [_AM_DEPENDENCIES(CXX)],
6625fac8b10Smrg		  [define([AC_PROG_CXX],
6635fac8b10Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
6645fac8b10SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
6655fac8b10Smrg		  [_AM_DEPENDENCIES(OBJC)],
6665fac8b10Smrg		  [define([AC_PROG_OBJC],
6675fac8b10Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
6685fac8b10Smrg])
6695fac8b10Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
6705fac8b10Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
6715fac8b10Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
6725fac8b10Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
6735fac8b10SmrgAC_CONFIG_COMMANDS_PRE(dnl
6745fac8b10Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
6755fac8b10Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
676f46a6179Smrg])
677f46a6179Smrg
6785fac8b10Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
6795fac8b10Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
6805fac8b10Smrgdnl mangled by Autoconf and run in a shell conditional statement.
6815fac8b10Smrgm4_define([_AC_COMPILER_EXEEXT],
6825fac8b10Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
68334345a63Smrg
6845fac8b10Smrg
6855fac8b10Smrg# When config.status generates a header, we must update the stamp-h file.
6865fac8b10Smrg# This file resides in the same directory as the config header
6875fac8b10Smrg# that is generated.  The stamp files are numbered to have different names.
6885fac8b10Smrg
6895fac8b10Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
6905fac8b10Smrg# loop where config.status creates the headers, so we can generate
6915fac8b10Smrg# our stamp files there.
6925fac8b10SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
6935fac8b10Smrg[# Compute $1's index in $config_headers.
6945fac8b10Smrg_am_arg=$1
6955fac8b10Smrg_am_stamp_count=1
6965fac8b10Smrgfor _am_header in $config_headers :; do
6975fac8b10Smrg  case $_am_header in
6985fac8b10Smrg    $_am_arg | $_am_arg:* )
6995fac8b10Smrg      break ;;
7005fac8b10Smrg    * )
7015fac8b10Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
7025fac8b10Smrg  esac
7035fac8b10Smrgdone
7045fac8b10Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
7055fac8b10Smrg
7065fac8b10Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
707f46a6179Smrg#
708f46a6179Smrg# This file is free software; the Free Software Foundation
709f46a6179Smrg# gives unlimited permission to copy and/or distribute it,
710f46a6179Smrg# with or without modifications, as long as this notice is preserved.
711f46a6179Smrg
7125fac8b10Smrg# AM_PROG_INSTALL_SH
7135fac8b10Smrg# ------------------
7145fac8b10Smrg# Define $install_sh.
7155fac8b10SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
7165fac8b10Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7175fac8b10Smrgif test x"${install_sh}" != xset; then
7185fac8b10Smrg  case $am_aux_dir in
7195fac8b10Smrg  *\ * | *\	*)
7205fac8b10Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
7215fac8b10Smrg  *)
7225fac8b10Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
7235fac8b10Smrg  esac
7245fac8b10Smrgfi
7255fac8b10SmrgAC_SUBST(install_sh)])
726f46a6179Smrg
7275fac8b10Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
7285fac8b10Smrg#
7295fac8b10Smrg# This file is free software; the Free Software Foundation
7305fac8b10Smrg# gives unlimited permission to copy and/or distribute it,
7315fac8b10Smrg# with or without modifications, as long as this notice is preserved.
732f46a6179Smrg
7335fac8b10Smrg# serial 2
734f46a6179Smrg
7355fac8b10Smrg# Check whether the underlying file-system supports filenames
7365fac8b10Smrg# with a leading dot.  For instance MS-DOS doesn't.
7375fac8b10SmrgAC_DEFUN([AM_SET_LEADING_DOT],
7385fac8b10Smrg[rm -rf .tst 2>/dev/null
7395fac8b10Smrgmkdir .tst 2>/dev/null
7405fac8b10Smrgif test -d .tst; then
7415fac8b10Smrg  am__leading_dot=.
7425fac8b10Smrgelse
7435fac8b10Smrg  am__leading_dot=_
7445fac8b10Smrgfi
7455fac8b10Smrgrmdir .tst 2>/dev/null
7465fac8b10SmrgAC_SUBST([am__leading_dot])])
747f46a6179Smrg
7485fac8b10Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
7495fac8b10Smrg# From Jim Meyering
7505fac8b10Smrg
7515fac8b10Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
7525fac8b10Smrg# Free Software Foundation, Inc.
753f46a6179Smrg#
754f46a6179Smrg# This file is free software; the Free Software Foundation
755f46a6179Smrg# gives unlimited permission to copy and/or distribute it,
756f46a6179Smrg# with or without modifications, as long as this notice is preserved.
757f46a6179Smrg
7585fac8b10Smrg# serial 5
7595fac8b10Smrg
7605fac8b10Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
7615fac8b10Smrg# ----------------------------------
7625fac8b10Smrg# Control maintainer-specific portions of Makefiles.
7635fac8b10Smrg# Default is to disable them, unless `enable' is passed literally.
7645fac8b10Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
7655fac8b10Smrg# can override the default with the --enable/--disable switch.
7665fac8b10SmrgAC_DEFUN([AM_MAINTAINER_MODE],
7675fac8b10Smrg[m4_case(m4_default([$1], [disable]),
7685fac8b10Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
7695fac8b10Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
7705fac8b10Smrg       [m4_define([am_maintainer_other], [enable])
7715fac8b10Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
7725fac8b10SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
7735fac8b10Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
7745fac8b10Smrg  AC_ARG_ENABLE([maintainer-mode],
7755fac8b10Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
7765fac8b10Smrg			  (and sometimes confusing) to the casual installer],
7775fac8b10Smrg      [USE_MAINTAINER_MODE=$enableval],
7785fac8b10Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
7795fac8b10Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
7805fac8b10Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
7815fac8b10Smrg  MAINT=$MAINTAINER_MODE_TRUE
7825fac8b10Smrg  AC_SUBST([MAINT])dnl
7835fac8b10Smrg]
7845fac8b10Smrg)
7855fac8b10Smrg
7865fac8b10SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
7875fac8b10Smrg
7885fac8b10Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
7895fac8b10Smrg
7905fac8b10Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
791f46a6179Smrg#
7925fac8b10Smrg# This file is free software; the Free Software Foundation
7935fac8b10Smrg# gives unlimited permission to copy and/or distribute it,
7945fac8b10Smrg# with or without modifications, as long as this notice is preserved.
795f46a6179Smrg
7965fac8b10Smrg# serial 4
7975fac8b10Smrg
7985fac8b10Smrg# AM_MAKE_INCLUDE()
7995fac8b10Smrg# -----------------
8005fac8b10Smrg# Check to see how make treats includes.
8015fac8b10SmrgAC_DEFUN([AM_MAKE_INCLUDE],
8025fac8b10Smrg[am_make=${MAKE-make}
8035fac8b10Smrgcat > confinc << 'END'
8045fac8b10Smrgam__doit:
8055fac8b10Smrg	@echo this is the am__doit target
8065fac8b10Smrg.PHONY: am__doit
8075fac8b10SmrgEND
8085fac8b10Smrg# If we don't find an include directive, just comment out the code.
8095fac8b10SmrgAC_MSG_CHECKING([for style of include used by $am_make])
8105fac8b10Smrgam__include="#"
8115fac8b10Smrgam__quote=
8125fac8b10Smrg_am_result=none
8135fac8b10Smrg# First try GNU make style include.
8145fac8b10Smrgecho "include confinc" > confmf
8155fac8b10Smrg# Ignore all kinds of additional output from `make'.
8165fac8b10Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
8175fac8b10Smrg*the\ am__doit\ target*)
8185fac8b10Smrg  am__include=include
8195fac8b10Smrg  am__quote=
8205fac8b10Smrg  _am_result=GNU
8215fac8b10Smrg  ;;
8225fac8b10Smrgesac
8235fac8b10Smrg# Now try BSD make style include.
8245fac8b10Smrgif test "$am__include" = "#"; then
8255fac8b10Smrg   echo '.include "confinc"' > confmf
8265fac8b10Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
8275fac8b10Smrg   *the\ am__doit\ target*)
8285fac8b10Smrg     am__include=.include
8295fac8b10Smrg     am__quote="\""
8305fac8b10Smrg     _am_result=BSD
8315fac8b10Smrg     ;;
8325fac8b10Smrg   esac
8335fac8b10Smrgfi
8345fac8b10SmrgAC_SUBST([am__include])
8355fac8b10SmrgAC_SUBST([am__quote])
8365fac8b10SmrgAC_MSG_RESULT([$_am_result])
8375fac8b10Smrgrm -f confinc confmf
838f46a6179Smrg])
839f46a6179Smrg
8405fac8b10Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
841f46a6179Smrg
8425fac8b10Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
843f46a6179Smrg# Free Software Foundation, Inc.
844f46a6179Smrg#
845f46a6179Smrg# This file is free software; the Free Software Foundation
846f46a6179Smrg# gives unlimited permission to copy and/or distribute it,
847f46a6179Smrg# with or without modifications, as long as this notice is preserved.
848f46a6179Smrg
8495fac8b10Smrg# serial 6
850f46a6179Smrg
8515fac8b10Smrg# AM_MISSING_PROG(NAME, PROGRAM)
8525fac8b10Smrg# ------------------------------
8535fac8b10SmrgAC_DEFUN([AM_MISSING_PROG],
8545fac8b10Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
8555fac8b10Smrg$1=${$1-"${am_missing_run}$2"}
8565fac8b10SmrgAC_SUBST($1)])
8575fac8b10Smrg
8585fac8b10Smrg
8595fac8b10Smrg# AM_MISSING_HAS_RUN
8605fac8b10Smrg# ------------------
8615fac8b10Smrg# Define MISSING if not defined so far and test if it supports --run.
8625fac8b10Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
8635fac8b10SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
8645fac8b10Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8655fac8b10SmrgAC_REQUIRE_AUX_FILE([missing])dnl
8665fac8b10Smrgif test x"${MISSING+set}" != xset; then
8675fac8b10Smrg  case $am_aux_dir in
8685fac8b10Smrg  *\ * | *\	*)
8695fac8b10Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
8705fac8b10Smrg  *)
8715fac8b10Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
8725fac8b10Smrg  esac
8735fac8b10Smrgfi
8745fac8b10Smrg# Use eval to expand $SHELL
8755fac8b10Smrgif eval "$MISSING --run true"; then
8765fac8b10Smrg  am_missing_run="$MISSING --run "
877f46a6179Smrgelse
8785fac8b10Smrg  am_missing_run=
8795fac8b10Smrg  AC_MSG_WARN([`missing' script is too old or missing])
880f46a6179Smrgfi
8815fac8b10Smrg])
882f46a6179Smrg
8835fac8b10Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
884f46a6179Smrg#
885f46a6179Smrg# This file is free software; the Free Software Foundation
886f46a6179Smrg# gives unlimited permission to copy and/or distribute it,
887f46a6179Smrg# with or without modifications, as long as this notice is preserved.
888f46a6179Smrg
8895fac8b10Smrg# AM_PROG_MKDIR_P
8905fac8b10Smrg# ---------------
8915fac8b10Smrg# Check for `mkdir -p'.
8925fac8b10SmrgAC_DEFUN([AM_PROG_MKDIR_P],
8935fac8b10Smrg[AC_PREREQ([2.60])dnl
8945fac8b10SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
8955fac8b10Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
8965fac8b10Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
8975fac8b10Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
8985fac8b10Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
8995fac8b10Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
9005fac8b10Smrgdnl adjustment using top_builddir (which is defined more often than
9015fac8b10Smrgdnl MKDIR_P).
9025fac8b10SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
9035fac8b10Smrgcase $mkdir_p in
9045fac8b10Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
9055fac8b10Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
9065fac8b10Smrgesac
9075fac8b10Smrg])
908f46a6179Smrg
9095fac8b10Smrg# Helper functions for option handling.                     -*- Autoconf -*-
910f46a6179Smrg
9115fac8b10Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
912f46a6179Smrg#
9135fac8b10Smrg# This file is free software; the Free Software Foundation
9145fac8b10Smrg# gives unlimited permission to copy and/or distribute it,
9155fac8b10Smrg# with or without modifications, as long as this notice is preserved.
916f46a6179Smrg
9175fac8b10Smrg# serial 4
918f46a6179Smrg
9195fac8b10Smrg# _AM_MANGLE_OPTION(NAME)
9205fac8b10Smrg# -----------------------
9215fac8b10SmrgAC_DEFUN([_AM_MANGLE_OPTION],
9225fac8b10Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
923f46a6179Smrg
9245fac8b10Smrg# _AM_SET_OPTION(NAME)
9255fac8b10Smrg# ------------------------------
9265fac8b10Smrg# Set option NAME.  Presently that only means defining a flag for this option.
9275fac8b10SmrgAC_DEFUN([_AM_SET_OPTION],
9285fac8b10Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
92934345a63Smrg
9305fac8b10Smrg# _AM_SET_OPTIONS(OPTIONS)
9315fac8b10Smrg# ----------------------------------
9325fac8b10Smrg# OPTIONS is a space-separated list of Automake options.
9335fac8b10SmrgAC_DEFUN([_AM_SET_OPTIONS],
9345fac8b10Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
935f46a6179Smrg
9365fac8b10Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
9375fac8b10Smrg# -------------------------------------------
9385fac8b10Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9395fac8b10SmrgAC_DEFUN([_AM_IF_OPTION],
9405fac8b10Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
941f46a6179Smrg
9425fac8b10Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
943f46a6179Smrg
9445fac8b10Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
9455fac8b10Smrg# Free Software Foundation, Inc.
9465fac8b10Smrg#
9475fac8b10Smrg# This file is free software; the Free Software Foundation
9485fac8b10Smrg# gives unlimited permission to copy and/or distribute it,
9495fac8b10Smrg# with or without modifications, as long as this notice is preserved.
950f46a6179Smrg
9515fac8b10Smrg# serial 5
9525fac8b10Smrg
9535fac8b10Smrg# AM_SANITY_CHECK
9545fac8b10Smrg# ---------------
9555fac8b10SmrgAC_DEFUN([AM_SANITY_CHECK],
9565fac8b10Smrg[AC_MSG_CHECKING([whether build environment is sane])
9575fac8b10Smrg# Just in case
9585fac8b10Smrgsleep 1
9595fac8b10Smrgecho timestamp > conftest.file
9605fac8b10Smrg# Reject unsafe characters in $srcdir or the absolute working directory
9615fac8b10Smrg# name.  Accept space and tab only in the latter.
9625fac8b10Smrgam_lf='
9635fac8b10Smrg'
9645fac8b10Smrgcase `pwd` in
9655fac8b10Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
9665fac8b10Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
9675fac8b10Smrgesac
9685fac8b10Smrgcase $srcdir in
9695fac8b10Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
9705fac8b10Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
9715fac8b10Smrgesac
972f46a6179Smrg
9735fac8b10Smrg# Do `set' in a subshell so we don't clobber the current shell's
9745fac8b10Smrg# arguments.  Must try -L first in case configure is actually a
9755fac8b10Smrg# symlink; some systems play weird games with the mod time of symlinks
9765fac8b10Smrg# (eg FreeBSD returns the mod time of the symlink's containing
9775fac8b10Smrg# directory).
9785fac8b10Smrgif (
9795fac8b10Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
9805fac8b10Smrg   if test "$[*]" = "X"; then
9815fac8b10Smrg      # -L didn't work.
9825fac8b10Smrg      set X `ls -t "$srcdir/configure" conftest.file`
9835fac8b10Smrg   fi
9845fac8b10Smrg   rm -f conftest.file
9855fac8b10Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
9865fac8b10Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
987f46a6179Smrg
9885fac8b10Smrg      # If neither matched, then we have a broken ls.  This can happen
9895fac8b10Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
9905fac8b10Smrg      # broken ls alias from the environment.  This has actually
9915fac8b10Smrg      # happened.  Such a system could not be considered "sane".
9925fac8b10Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
9935fac8b10Smrgalias in your environment])
9945fac8b10Smrg   fi
995f46a6179Smrg
9965fac8b10Smrg   test "$[2]" = conftest.file
9975fac8b10Smrg   )
9985fac8b10Smrgthen
9995fac8b10Smrg   # Ok.
10005fac8b10Smrg   :
10015fac8b10Smrgelse
10025fac8b10Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
10035fac8b10SmrgCheck your system clock])
10045fac8b10Smrgfi
10055fac8b10SmrgAC_MSG_RESULT(yes)])
1006f46a6179Smrg
10075fac8b10Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
1008f46a6179Smrg#
1009f46a6179Smrg# This file is free software; the Free Software Foundation
1010f46a6179Smrg# gives unlimited permission to copy and/or distribute it,
1011f46a6179Smrg# with or without modifications, as long as this notice is preserved.
1012f46a6179Smrg
10135fac8b10Smrg# serial 1
1014f46a6179Smrg
10155fac8b10Smrg# AM_SILENT_RULES([DEFAULT])
10165fac8b10Smrg# --------------------------
10175fac8b10Smrg# Enable less verbose build rules; with the default set to DEFAULT
10185fac8b10Smrg# (`yes' being less verbose, `no' or empty being verbose).
10195fac8b10SmrgAC_DEFUN([AM_SILENT_RULES],
10205fac8b10Smrg[AC_ARG_ENABLE([silent-rules],
10215fac8b10Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
10225fac8b10Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
10235fac8b10Smrgcase $enable_silent_rules in
10245fac8b10Smrgyes) AM_DEFAULT_VERBOSITY=0;;
10255fac8b10Smrgno)  AM_DEFAULT_VERBOSITY=1;;
10265fac8b10Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
10275fac8b10Smrgesac
10285fac8b10SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
10295fac8b10SmrgAM_BACKSLASH='\'
10305fac8b10SmrgAC_SUBST([AM_BACKSLASH])dnl
10315fac8b10Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1032f46a6179Smrg])
1033f46a6179Smrg
10345fac8b10Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1035f46a6179Smrg#
1036f46a6179Smrg# This file is free software; the Free Software Foundation
1037f46a6179Smrg# gives unlimited permission to copy and/or distribute it,
1038f46a6179Smrg# with or without modifications, as long as this notice is preserved.
1039f46a6179Smrg
10405fac8b10Smrg# AM_PROG_INSTALL_STRIP
10415fac8b10Smrg# ---------------------
10425fac8b10Smrg# One issue with vendor `install' (even GNU) is that you can't
10435fac8b10Smrg# specify the program used to strip binaries.  This is especially
10445fac8b10Smrg# annoying in cross-compiling environments, where the build's strip
10455fac8b10Smrg# is unlikely to handle the host's binaries.
10465fac8b10Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
10475fac8b10Smrg# always use install-sh in `make install-strip', and initialize
10485fac8b10Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
10495fac8b10SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
10505fac8b10Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
10515fac8b10Smrg# Installed binaries are usually stripped using `strip' when the user
10525fac8b10Smrg# run `make install-strip'.  However `strip' might not be the right
10535fac8b10Smrg# tool to use in cross-compilation environments, therefore Automake
10545fac8b10Smrg# will honor the `STRIP' environment variable to overrule this program.
10555fac8b10Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
10565fac8b10Smrgif test "$cross_compiling" != no; then
10575fac8b10Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
10585fac8b10Smrgfi
10595fac8b10SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10605fac8b10SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1061f46a6179Smrg
10625fac8b10Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
1063f46a6179Smrg#
1064f46a6179Smrg# This file is free software; the Free Software Foundation
1065f46a6179Smrg# gives unlimited permission to copy and/or distribute it,
1066f46a6179Smrg# with or without modifications, as long as this notice is preserved.
1067f46a6179Smrg
10685fac8b10Smrg# serial 2
1069f46a6179Smrg
10705fac8b10Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
10715fac8b10Smrg# ---------------------------
10725fac8b10Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
10735fac8b10Smrg# This macro is traced by Automake.
10745fac8b10SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1075f46a6179Smrg
10765fac8b10Smrg# AM_SUBST_NOTMAKE(VARIABLE)
10775fac8b10Smrg# ---------------------------
10785fac8b10Smrg# Public sister of _AM_SUBST_NOTMAKE.
10795fac8b10SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1080f46a6179Smrg
10815fac8b10Smrg# Check how to create a tarball.                            -*- Autoconf -*-
1082f46a6179Smrg
10835fac8b10Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
10845fac8b10Smrg#
10855fac8b10Smrg# This file is free software; the Free Software Foundation
10865fac8b10Smrg# gives unlimited permission to copy and/or distribute it,
10875fac8b10Smrg# with or without modifications, as long as this notice is preserved.
1088f46a6179Smrg
10895fac8b10Smrg# serial 2
1090f46a6179Smrg
10915fac8b10Smrg# _AM_PROG_TAR(FORMAT)
10925fac8b10Smrg# --------------------
10935fac8b10Smrg# Check how to create a tarball in format FORMAT.
10945fac8b10Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
10955fac8b10Smrg#
10965fac8b10Smrg# Substitute a variable $(am__tar) that is a command
10975fac8b10Smrg# writing to stdout a FORMAT-tarball containing the directory
10985fac8b10Smrg# $tardir.
10995fac8b10Smrg#     tardir=directory && $(am__tar) > result.tar
11005fac8b10Smrg#
11015fac8b10Smrg# Substitute a variable $(am__untar) that extract such
11025fac8b10Smrg# a tarball read from stdin.
11035fac8b10Smrg#     $(am__untar) < result.tar
11045fac8b10SmrgAC_DEFUN([_AM_PROG_TAR],
11055fac8b10Smrg[# Always define AMTAR for backward compatibility.
11065fac8b10SmrgAM_MISSING_PROG([AMTAR], [tar])
11075fac8b10Smrgm4_if([$1], [v7],
11085fac8b10Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
11095fac8b10Smrg     [m4_case([$1], [ustar],, [pax],,
11105fac8b10Smrg              [m4_fatal([Unknown tar format])])
11115fac8b10SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
11125fac8b10Smrg# Loop over all known methods to create a tar archive until one works.
11135fac8b10Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
11145fac8b10Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
11155fac8b10Smrg# Do not fold the above two line into one, because Tru64 sh and
11165fac8b10Smrg# Solaris sh will not grok spaces in the rhs of `-'.
11175fac8b10Smrgfor _am_tool in $_am_tools
11185fac8b10Smrgdo
11195fac8b10Smrg  case $_am_tool in
11205fac8b10Smrg  gnutar)
11215fac8b10Smrg    for _am_tar in tar gnutar gtar;
11225fac8b10Smrg    do
11235fac8b10Smrg      AM_RUN_LOG([$_am_tar --version]) && break
11245fac8b10Smrg    done
11255fac8b10Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
11265fac8b10Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
11275fac8b10Smrg    am__untar="$_am_tar -xf -"
11285fac8b10Smrg    ;;
11295fac8b10Smrg  plaintar)
11305fac8b10Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
11315fac8b10Smrg    # ustar tarball either.
11325fac8b10Smrg    (tar --version) >/dev/null 2>&1 && continue
11335fac8b10Smrg    am__tar='tar chf - "$$tardir"'
11345fac8b10Smrg    am__tar_='tar chf - "$tardir"'
11355fac8b10Smrg    am__untar='tar xf -'
11365fac8b10Smrg    ;;
11375fac8b10Smrg  pax)
11385fac8b10Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
11395fac8b10Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
11405fac8b10Smrg    am__untar='pax -r'
11415fac8b10Smrg    ;;
11425fac8b10Smrg  cpio)
11435fac8b10Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
11445fac8b10Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
11455fac8b10Smrg    am__untar='cpio -i -H $1 -d'
11465fac8b10Smrg    ;;
11475fac8b10Smrg  none)
11485fac8b10Smrg    am__tar=false
11495fac8b10Smrg    am__tar_=false
11505fac8b10Smrg    am__untar=false
11515fac8b10Smrg    ;;
11525fac8b10Smrg  esac
1153f46a6179Smrg
11545fac8b10Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
11555fac8b10Smrg  # and am__untar set.
11565fac8b10Smrg  test -n "${am_cv_prog_tar_$1}" && break
115734345a63Smrg
11585fac8b10Smrg  # tar/untar a dummy directory, and stop if the command works
11595fac8b10Smrg  rm -rf conftest.dir
11605fac8b10Smrg  mkdir conftest.dir
11615fac8b10Smrg  echo GrepMe > conftest.dir/file
11625fac8b10Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
11635fac8b10Smrg  rm -rf conftest.dir
11645fac8b10Smrg  if test -s conftest.tar; then
11655fac8b10Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
11665fac8b10Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
11675fac8b10Smrg  fi
11685fac8b10Smrgdone
11695fac8b10Smrgrm -rf conftest.dir
1170f46a6179Smrg
11715fac8b10SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
11725fac8b10SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
11735fac8b10SmrgAC_SUBST([am__tar])
11745fac8b10SmrgAC_SUBST([am__untar])
11755fac8b10Smrg]) # _AM_PROG_TAR
1176f46a6179Smrg
11775fac8b10Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
11785fac8b10Smrgdnl
117983e5f723Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
11805fac8b10Smrgdnl 
11815fac8b10Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
118283e5f723Smrgdnl copy of this software and associated documentation files (the "Software"),
118383e5f723Smrgdnl to deal in the Software without restriction, including without limitation
118483e5f723Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
118583e5f723Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
118683e5f723Smrgdnl Software is furnished to do so, subject to the following conditions:
11875fac8b10Smrgdnl
118883e5f723Smrgdnl The above copyright notice and this permission notice (including the next
118983e5f723Smrgdnl paragraph) shall be included in all copies or substantial portions of the
119083e5f723Smrgdnl Software.
11915fac8b10Smrgdnl
119283e5f723Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
119383e5f723Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
119483e5f723Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
119583e5f723Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
119683e5f723Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
119783e5f723Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
119883e5f723Smrgdnl DEALINGS IN THE SOFTWARE.
1199f46a6179Smrg
12005fac8b10Smrg# XORG_MACROS_VERSION(required-version)
12015fac8b10Smrg# -------------------------------------
12025fac8b10Smrg# Minimum version: 1.1.0
1203f46a6179Smrg#
12045fac8b10Smrg# If you're using a macro added in Version 1.1 or newer, include this in
12055fac8b10Smrg# your configure.ac with the minimum required version, such as:
12065fac8b10Smrg# XORG_MACROS_VERSION(1.1)
12075fac8b10Smrg#
12085fac8b10Smrg# To ensure that this macro is defined, also add:
12095fac8b10Smrg# m4_ifndef([XORG_MACROS_VERSION],
12105fac8b10Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
12115fac8b10Smrg#
12125fac8b10Smrg#
12135fac8b10Smrg# See the "minimum version" comment for each macro you use to see what 
12145fac8b10Smrg# version you require.
12155fac8b10Smrgm4_defun([XORG_MACROS_VERSION],[
121607d2e718Smrgm4_define([vers_have], [1.10.1])
12175fac8b10Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
12185fac8b10Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
12195fac8b10Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
12205fac8b10Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
12215fac8b10Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
12225fac8b10Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
12235fac8b10Smrgm4_undefine([vers_have])
12245fac8b10Smrgm4_undefine([maj_have])
12255fac8b10Smrgm4_undefine([maj_needed])
12265fac8b10Smrg]) # XORG_MACROS_VERSION
12275fac8b10Smrg
12285fac8b10Smrg# XORG_PROG_RAWCPP()
12295fac8b10Smrg# ------------------
12305fac8b10Smrg# Minimum version: 1.0.0
12315fac8b10Smrg#
12325fac8b10Smrg# Find cpp program and necessary flags for use in pre-processing text files
12335fac8b10Smrg# such as man pages and config files
12345fac8b10SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
12355fac8b10SmrgAC_REQUIRE([AC_PROG_CPP])
12365fac8b10SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
12375fac8b10Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
12385fac8b10Smrg
12395fac8b10Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
12405fac8b10Smrg# which is not the best choice for supporting other OS'es, but covers most
12415fac8b10Smrg# of the ones we need for now.
12425fac8b10SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
12435fac8b10SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
12445fac8b10Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
12455fac8b10Smrg	AC_MSG_RESULT([no])
12465fac8b10Smrgelse
12475fac8b10Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
12485fac8b10Smrg		RAWCPPFLAGS=-undef
12495fac8b10Smrg		AC_MSG_RESULT([yes])
12505fac8b10Smrg	# under Cygwin unix is still defined even with -undef
12515fac8b10Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
12525fac8b10Smrg		RAWCPPFLAGS="-undef -ansi"
12535fac8b10Smrg		AC_MSG_RESULT([yes, with -ansi])
12545fac8b10Smrg	else
12555fac8b10Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
12565fac8b10Smrg	fi
12575fac8b10Smrgfi
12585fac8b10Smrgrm -f conftest.$ac_ext
1259f46a6179Smrg
12605fac8b10SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
12615fac8b10SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
12625fac8b10Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
12635fac8b10Smrg	AC_MSG_RESULT([no])
12645fac8b10Smrgelse
12655fac8b10Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
12665fac8b10Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
12675fac8b10Smrg		AC_MSG_RESULT([yes])
12685fac8b10Smrg	else
12695fac8b10Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
12705fac8b10Smrg	fi
127134345a63Smrgfi
12725fac8b10Smrgrm -f conftest.$ac_ext
12735fac8b10SmrgAC_SUBST(RAWCPPFLAGS)
12745fac8b10Smrg]) # XORG_PROG_RAWCPP
1275f46a6179Smrg
12765fac8b10Smrg# XORG_MANPAGE_SECTIONS()
12775fac8b10Smrg# -----------------------
12785fac8b10Smrg# Minimum version: 1.0.0
1279f46a6179Smrg#
12805fac8b10Smrg# Determine which sections man pages go in for the different man page types
12815fac8b10Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
12825fac8b10Smrg# Not sure if there's any better way than just hardcoding by OS name.
12835fac8b10Smrg# Override default settings by setting environment variables
128483e5f723Smrg# Added MAN_SUBSTS in version 1.8
128583e5f723Smrg# Added AC_PROG_SED in version 1.8
1286f46a6179Smrg
12875fac8b10SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
12885fac8b10SmrgAC_REQUIRE([AC_CANONICAL_HOST])
128983e5f723SmrgAC_REQUIRE([AC_PROG_SED])
1290f46a6179Smrg
12915fac8b10Smrgif test x$APP_MAN_SUFFIX = x    ; then
12925fac8b10Smrg    APP_MAN_SUFFIX=1
12935fac8b10Smrgfi
12945fac8b10Smrgif test x$APP_MAN_DIR = x    ; then
12955fac8b10Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1296f46a6179Smrgfi
1297f46a6179Smrg
12985fac8b10Smrgif test x$LIB_MAN_SUFFIX = x    ; then
12995fac8b10Smrg    LIB_MAN_SUFFIX=3
13005fac8b10Smrgfi
13015fac8b10Smrgif test x$LIB_MAN_DIR = x    ; then
13025fac8b10Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
13035fac8b10Smrgfi
1304f46a6179Smrg
13055fac8b10Smrgif test x$FILE_MAN_SUFFIX = x    ; then
13065fac8b10Smrg    case $host_os in
13075fac8b10Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
13085fac8b10Smrg	*)		FILE_MAN_SUFFIX=5  ;;
13095fac8b10Smrg    esac
13105fac8b10Smrgfi
13115fac8b10Smrgif test x$FILE_MAN_DIR = x    ; then
13125fac8b10Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
13135fac8b10Smrgfi
1314f46a6179Smrg
13155fac8b10Smrgif test x$MISC_MAN_SUFFIX = x    ; then
13165fac8b10Smrg    case $host_os in
13175fac8b10Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
13185fac8b10Smrg	*)		MISC_MAN_SUFFIX=7  ;;
13195fac8b10Smrg    esac
13205fac8b10Smrgfi
13215fac8b10Smrgif test x$MISC_MAN_DIR = x    ; then
13225fac8b10Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
13235fac8b10Smrgfi
1324f46a6179Smrg
13255fac8b10Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
13265fac8b10Smrg    case $host_os in
13275fac8b10Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
13285fac8b10Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
13295fac8b10Smrg    esac
13305fac8b10Smrgfi
13315fac8b10Smrgif test x$DRIVER_MAN_DIR = x    ; then
13325fac8b10Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
13335fac8b10Smrgfi
1334f46a6179Smrg
13355fac8b10Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
13365fac8b10Smrg    case $host_os in
13375fac8b10Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
13385fac8b10Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
13395fac8b10Smrg    esac
13405fac8b10Smrgfi
13415fac8b10Smrgif test x$ADMIN_MAN_DIR = x    ; then
13425fac8b10Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
13435fac8b10Smrgfi
1344f46a6179Smrg
1345f46a6179Smrg
13465fac8b10SmrgAC_SUBST([APP_MAN_SUFFIX])
13475fac8b10SmrgAC_SUBST([LIB_MAN_SUFFIX])
13485fac8b10SmrgAC_SUBST([FILE_MAN_SUFFIX])
13495fac8b10SmrgAC_SUBST([MISC_MAN_SUFFIX])
13505fac8b10SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
13515fac8b10SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
13525fac8b10SmrgAC_SUBST([APP_MAN_DIR])
13535fac8b10SmrgAC_SUBST([LIB_MAN_DIR])
13545fac8b10SmrgAC_SUBST([FILE_MAN_DIR])
13555fac8b10SmrgAC_SUBST([MISC_MAN_DIR])
13565fac8b10SmrgAC_SUBST([DRIVER_MAN_DIR])
13575fac8b10SmrgAC_SUBST([ADMIN_MAN_DIR])
135883e5f723Smrg
135983e5f723SmrgXORG_MAN_PAGE="X Version 11"
136083e5f723SmrgAC_SUBST([XORG_MAN_PAGE])
136183e5f723SmrgMAN_SUBSTS="\
136283e5f723Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
136383e5f723Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
136483e5f723Smrg	-e 's|__xservername__|Xorg|g' \
136583e5f723Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
136683e5f723Smrg	-e 's|__projectroot__|\$(prefix)|g' \
136783e5f723Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
136883e5f723Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
136983e5f723Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
137083e5f723Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
137183e5f723Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
137283e5f723Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
137383e5f723Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
137483e5f723SmrgAC_SUBST([MAN_SUBSTS])
137583e5f723Smrg
13765fac8b10Smrg]) # XORG_MANPAGE_SECTIONS
1377f46a6179Smrg
137883e5f723Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
137983e5f723Smrg# ------------------------
138083e5f723Smrg# Minimum version: 1.7.0
138183e5f723Smrg#
138283e5f723Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
138383e5f723Smrg# provided by xorg-sgml-doctools, if installed.
138483e5f723SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
138583e5f723SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
138683e5f723SmrgXORG_SGML_PATH=
138783e5f723SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
138883e5f723Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
138983e5f723Smrg    [m4_ifval([$1],[:],
139083e5f723Smrg        [if test x"$cross_compiling" != x"yes" ; then
139183e5f723Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
139283e5f723Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
139383e5f723Smrg         fi])
139483e5f723Smrg    ])
139583e5f723Smrg
139683e5f723Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
139783e5f723Smrg# the path and the name of the doc stylesheet
139883e5f723Smrgif test "x$XORG_SGML_PATH" != "x" ; then
139983e5f723Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
140083e5f723Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
140183e5f723Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
140283e5f723Smrgelse
140383e5f723Smrg   AC_MSG_RESULT([no])
140483e5f723Smrgfi
140583e5f723Smrg
140683e5f723SmrgAC_SUBST(XORG_SGML_PATH)
140783e5f723SmrgAC_SUBST(STYLESHEET_SRCDIR)
140883e5f723SmrgAC_SUBST(XSL_STYLESHEET)
140983e5f723SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
141083e5f723Smrg]) # XORG_CHECK_SGML_DOCTOOLS
141183e5f723Smrg
14125fac8b10Smrg# XORG_CHECK_LINUXDOC
14135fac8b10Smrg# -------------------
14145fac8b10Smrg# Minimum version: 1.0.0
14155fac8b10Smrg#
14165fac8b10Smrg# Defines the variable MAKE_TEXT if the necessary tools and
14175fac8b10Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
14185fac8b10Smrg# Whether or not the necessary tools and files are found can be checked
14195fac8b10Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
14205fac8b10SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
142183e5f723SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
142283e5f723SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1423f46a6179Smrg
14245fac8b10SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1425f46a6179Smrg
142683e5f723SmrgAC_MSG_CHECKING([whether to build documentation])
1427f46a6179Smrg
142883e5f723Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
14295fac8b10Smrg   BUILDDOC=yes
14305fac8b10Smrgelse
14315fac8b10Smrg   BUILDDOC=no
14325fac8b10Smrgfi
1433f46a6179Smrg
14345fac8b10SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1435f46a6179Smrg
14365fac8b10SmrgAC_MSG_RESULT([$BUILDDOC])
1437f46a6179Smrg
143883e5f723SmrgAC_MSG_CHECKING([whether to build pdf documentation])
14395fac8b10Smrg
144083e5f723Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
14415fac8b10Smrg   BUILDPDFDOC=yes
1442f46a6179Smrgelse
14435fac8b10Smrg   BUILDPDFDOC=no
1444f46a6179Smrgfi
1445f46a6179Smrg
14465fac8b10SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1447f46a6179Smrg
14485fac8b10SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1449f46a6179Smrg
145083e5f723SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
14515fac8b10SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
14525fac8b10SmrgMAKE_PDF="$PS2PDF"
14535fac8b10SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1454f46a6179Smrg
14555fac8b10SmrgAC_SUBST(MAKE_TEXT)
14565fac8b10SmrgAC_SUBST(MAKE_PS)
14575fac8b10SmrgAC_SUBST(MAKE_PDF)
14585fac8b10SmrgAC_SUBST(MAKE_HTML)
14595fac8b10Smrg]) # XORG_CHECK_LINUXDOC
1460f46a6179Smrg
14615fac8b10Smrg# XORG_CHECK_DOCBOOK
14625fac8b10Smrg# -------------------
14635fac8b10Smrg# Minimum version: 1.0.0
14645fac8b10Smrg#
14655fac8b10Smrg# Checks for the ability to build output formats from SGML DocBook source.
14665fac8b10Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
14675fac8b10Smrg# indicates whether the necessary tools and files are found and, if set,
14685fac8b10Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
14695fac8b10SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
147083e5f723SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
147183e5f723Smrg
14725fac8b10SmrgBUILDTXTDOC=no
14735fac8b10SmrgBUILDPDFDOC=no
14745fac8b10SmrgBUILDPSDOC=no
14755fac8b10SmrgBUILDHTMLDOC=no
1476f46a6179Smrg
14775fac8b10SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
14785fac8b10SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
14795fac8b10SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
14805fac8b10SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1481f46a6179Smrg
148283e5f723SmrgAC_MSG_CHECKING([whether to build text documentation])
148383e5f723Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
14845fac8b10Smrg   test x$BUILD_TXTDOC != xno; then
14855fac8b10Smrg	BUILDTXTDOC=yes
14865fac8b10Smrgfi
14875fac8b10SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
14885fac8b10SmrgAC_MSG_RESULT([$BUILDTXTDOC])
1489f46a6179Smrg
149083e5f723SmrgAC_MSG_CHECKING([whether to build PDF documentation])
149183e5f723Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
14925fac8b10Smrg   test x$BUILD_PDFDOC != xno; then
14935fac8b10Smrg	BUILDPDFDOC=yes
14945fac8b10Smrgfi
14955fac8b10SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
14965fac8b10SmrgAC_MSG_RESULT([$BUILDPDFDOC])
1497f46a6179Smrg
149883e5f723SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
149983e5f723Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
15005fac8b10Smrg   test x$BUILD_PSDOC != xno; then
15015fac8b10Smrg	BUILDPSDOC=yes
15025fac8b10Smrgfi
15035fac8b10SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
15045fac8b10SmrgAC_MSG_RESULT([$BUILDPSDOC])
1505f46a6179Smrg
150683e5f723SmrgAC_MSG_CHECKING([whether to build HTML documentation])
150783e5f723Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
15085fac8b10Smrg   test x$BUILD_HTMLDOC != xno; then
15095fac8b10Smrg	BUILDHTMLDOC=yes
15105fac8b10Smrgfi
15115fac8b10SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
15125fac8b10SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1513f46a6179Smrg
15145fac8b10SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
15155fac8b10SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
15165fac8b10SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
15175fac8b10SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1518f46a6179Smrg
15195fac8b10SmrgAC_SUBST(MAKE_TEXT)
15205fac8b10SmrgAC_SUBST(MAKE_PS)
15215fac8b10SmrgAC_SUBST(MAKE_PDF)
15225fac8b10SmrgAC_SUBST(MAKE_HTML)
15235fac8b10Smrg]) # XORG_CHECK_DOCBOOK
152434345a63Smrg
152507d2e718Smrg# XORG_WITH_XMLTO([MIN-VERSION])
152683e5f723Smrg# ----------------
152783e5f723Smrg# Minimum version: 1.5.0
152883e5f723Smrg#
152983e5f723Smrg# Documentation tools are not always available on all platforms and sometimes
153083e5f723Smrg# not at the appropriate level. This macro enables a module to test for the
153183e5f723Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
153283e5f723Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
153307d2e718Smrg# as whether or not to use the xmlto package.
153483e5f723Smrg#
153583e5f723Smrg# Interface to module:
153683e5f723Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
153783e5f723Smrg# XMLTO:	returns the path of the xmlto program found
153883e5f723Smrg#		returns the path set by the user in the environment
153983e5f723Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
154083e5f723Smrg#		'no' user instructs the module not to use xmlto
154183e5f723Smrg#
154283e5f723Smrg# Added in version 1.10.0
154383e5f723Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
154483e5f723Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
154583e5f723Smrg#
154683e5f723Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
154783e5f723Smrg#
154883e5f723SmrgAC_DEFUN([XORG_WITH_XMLTO],[
154983e5f723SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
155083e5f723SmrgAC_ARG_WITH(xmlto,
155183e5f723Smrg	AS_HELP_STRING([--with-xmlto],
155207d2e718Smrg	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
155307d2e718Smrg	   [use_xmlto=$withval], [use_xmlto=auto])
155483e5f723Smrg
155583e5f723Smrgif test "x$use_xmlto" = x"auto"; then
155683e5f723Smrg   AC_PATH_PROG([XMLTO], [xmlto])
155783e5f723Smrg   if test "x$XMLTO" = "x"; then
155883e5f723Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
155983e5f723Smrg	have_xmlto=no
156083e5f723Smrg   else
156183e5f723Smrg        have_xmlto=yes
156283e5f723Smrg   fi
156383e5f723Smrgelif test "x$use_xmlto" = x"yes" ; then
156483e5f723Smrg   AC_PATH_PROG([XMLTO], [xmlto])
156583e5f723Smrg   if test "x$XMLTO" = "x"; then
156683e5f723Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
156783e5f723Smrg   fi
156883e5f723Smrg   have_xmlto=yes
156983e5f723Smrgelif test "x$use_xmlto" = x"no" ; then
157083e5f723Smrg   if test "x$XMLTO" != "x"; then
157183e5f723Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
157283e5f723Smrg   fi
157383e5f723Smrg   have_xmlto=no
157483e5f723Smrgelse
157583e5f723Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
157683e5f723Smrgfi
157783e5f723Smrg
157883e5f723Smrg# Test for a minimum version of xmlto, if provided.
157983e5f723Smrgm4_ifval([$1],
158083e5f723Smrg[if test "$have_xmlto" = yes; then
158183e5f723Smrg    # scrape the xmlto version
158283e5f723Smrg    AC_MSG_CHECKING([the xmlto version])
158383e5f723Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
158483e5f723Smrg    AC_MSG_RESULT([$xmlto_version])
158583e5f723Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
158683e5f723Smrg        [if test "x$use_xmlto" = xauto; then
158783e5f723Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
158883e5f723Smrg            have_xmlto=no
158983e5f723Smrg        else
159083e5f723Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
159183e5f723Smrg        fi])
159283e5f723Smrgfi])
159383e5f723Smrg
159483e5f723Smrg# Test for the ability of xmlto to generate a text target
159583e5f723Smrghave_xmlto_text=no
159683e5f723Smrgcat > conftest.xml << "EOF"
159783e5f723SmrgEOF
159883e5f723SmrgAS_IF([test "$have_xmlto" = yes],
159983e5f723Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
160083e5f723Smrg             [have_xmlto_text=yes],
160183e5f723Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
160283e5f723Smrgrm -f conftest.xml
160383e5f723SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
160483e5f723SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
160583e5f723Smrg]) # XORG_WITH_XMLTO
160683e5f723Smrg
160707d2e718Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION])
160883e5f723Smrg# ----------------
160983e5f723Smrg# Minimum version: 1.5.0
161083e5f723Smrg#
161183e5f723Smrg# Documentation tools are not always available on all platforms and sometimes
161283e5f723Smrg# not at the appropriate level. This macro enables a module to test for the
161383e5f723Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
161483e5f723Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
161507d2e718Smrg# as whether or not to use the asciidoc package.
161683e5f723Smrg#
161783e5f723Smrg# Interface to module:
161883e5f723Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
161983e5f723Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
162083e5f723Smrg#		 returns the path set by the user in the environment
162183e5f723Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
162283e5f723Smrg#		  'no' user instructs the module not to use asciidoc
162383e5f723Smrg#
162483e5f723Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
162583e5f723Smrg#
162683e5f723SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
162783e5f723SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
162883e5f723SmrgAC_ARG_WITH(asciidoc,
162983e5f723Smrg	AS_HELP_STRING([--with-asciidoc],
163007d2e718Smrg	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
163107d2e718Smrg	   [use_asciidoc=$withval], [use_asciidoc=auto])
163283e5f723Smrg
163383e5f723Smrgif test "x$use_asciidoc" = x"auto"; then
163483e5f723Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
163583e5f723Smrg   if test "x$ASCIIDOC" = "x"; then
163683e5f723Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
163783e5f723Smrg	have_asciidoc=no
163883e5f723Smrg   else
163983e5f723Smrg        have_asciidoc=yes
164083e5f723Smrg   fi
164183e5f723Smrgelif test "x$use_asciidoc" = x"yes" ; then
164283e5f723Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
164383e5f723Smrg   if test "x$ASCIIDOC" = "x"; then
164483e5f723Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
164583e5f723Smrg   fi
164683e5f723Smrg   have_asciidoc=yes
164783e5f723Smrgelif test "x$use_asciidoc" = x"no" ; then
164883e5f723Smrg   if test "x$ASCIIDOC" != "x"; then
164983e5f723Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
165083e5f723Smrg   fi
165183e5f723Smrg   have_asciidoc=no
165283e5f723Smrgelse
165383e5f723Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
165483e5f723Smrgfi
165583e5f723Smrgm4_ifval([$1],
165683e5f723Smrg[if test "$have_asciidoc" = yes; then
165783e5f723Smrg    # scrape the asciidoc version
165883e5f723Smrg    AC_MSG_CHECKING([the asciidoc version])
165983e5f723Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
166083e5f723Smrg    AC_MSG_RESULT([$asciidoc_version])
166183e5f723Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
166283e5f723Smrg        [if test "x$use_asciidoc" = xauto; then
166383e5f723Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
166483e5f723Smrg            have_asciidoc=no
166583e5f723Smrg        else
166683e5f723Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
166783e5f723Smrg        fi])
166883e5f723Smrgfi])
166983e5f723SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
167083e5f723Smrg]) # XORG_WITH_ASCIIDOC
167183e5f723Smrg
167207d2e718Smrg# XORG_WITH_DOXYGEN([MIN-VERSION])
167383e5f723Smrg# --------------------------------
167483e5f723Smrg# Minimum version: 1.5.0
167583e5f723Smrg#
167683e5f723Smrg# Documentation tools are not always available on all platforms and sometimes
167783e5f723Smrg# not at the appropriate level. This macro enables a module to test for the
167883e5f723Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
167983e5f723Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
168007d2e718Smrg# as whether or not to use the doxygen package.
168183e5f723Smrg#
168283e5f723Smrg# Interface to module:
168383e5f723Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
168483e5f723Smrg# DOXYGEN:	 returns the path of the doxygen program found
168583e5f723Smrg#		 returns the path set by the user in the environment
168683e5f723Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
168783e5f723Smrg#		  'no' user instructs the module not to use doxygen
168883e5f723Smrg#
168983e5f723Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
169083e5f723Smrg#
169183e5f723SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
169283e5f723SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
169383e5f723SmrgAC_ARG_WITH(doxygen,
169483e5f723Smrg	AS_HELP_STRING([--with-doxygen],
169507d2e718Smrg	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
169607d2e718Smrg	   [use_doxygen=$withval], [use_doxygen=auto])
169783e5f723Smrg
169883e5f723Smrgif test "x$use_doxygen" = x"auto"; then
169983e5f723Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
170083e5f723Smrg   if test "x$DOXYGEN" = "x"; then
170183e5f723Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
170283e5f723Smrg	have_doxygen=no
170383e5f723Smrg   else
170483e5f723Smrg        have_doxygen=yes
170583e5f723Smrg   fi
170683e5f723Smrgelif test "x$use_doxygen" = x"yes" ; then
170783e5f723Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
170883e5f723Smrg   if test "x$DOXYGEN" = "x"; then
170983e5f723Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
171083e5f723Smrg   fi
171183e5f723Smrg   have_doxygen=yes
171283e5f723Smrgelif test "x$use_doxygen" = x"no" ; then
171383e5f723Smrg   if test "x$DOXYGEN" != "x"; then
171483e5f723Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
171583e5f723Smrg   fi
171683e5f723Smrg   have_doxygen=no
171783e5f723Smrgelse
171883e5f723Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
171983e5f723Smrgfi
172083e5f723Smrgm4_ifval([$1],
172183e5f723Smrg[if test "$have_doxygen" = yes; then
172283e5f723Smrg    # scrape the doxygen version
172383e5f723Smrg    AC_MSG_CHECKING([the doxygen version])
172483e5f723Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
172583e5f723Smrg    AC_MSG_RESULT([$doxygen_version])
172683e5f723Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
172783e5f723Smrg        [if test "x$use_doxygen" = xauto; then
172883e5f723Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
172983e5f723Smrg            have_doxygen=no
173083e5f723Smrg        else
173183e5f723Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
173283e5f723Smrg        fi])
173383e5f723Smrgfi])
173483e5f723SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
173583e5f723Smrg]) # XORG_WITH_DOXYGEN
173683e5f723Smrg
173707d2e718Smrg# XORG_WITH_GROFF
173883e5f723Smrg# ----------------
173983e5f723Smrg# Minimum version: 1.6.0
174083e5f723Smrg#
174183e5f723Smrg# Documentation tools are not always available on all platforms and sometimes
174283e5f723Smrg# not at the appropriate level. This macro enables a module to test for the
174383e5f723Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
174483e5f723Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
174507d2e718Smrg# as whether or not to use the groff package.
174683e5f723Smrg#
174783e5f723Smrg# Interface to module:
174883e5f723Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
174983e5f723Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
175083e5f723Smrg# HAVE_GROFF_MS: the -ms macros package
175183e5f723Smrg# GROFF:	 returns the path of the groff program found
175283e5f723Smrg#		 returns the path set by the user in the environment
175383e5f723Smrg# --with-groff:	 'yes' user instructs the module to use groff
175483e5f723Smrg#		 'no' user instructs the module not to use groff
175583e5f723Smrg#
175683e5f723Smrg# Added in version 1.9.0:
175783e5f723Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
175883e5f723Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
175983e5f723Smrg#		   psselect from the psutils package.
176083e5f723Smrg#		   the ghostcript package. Refer to the grohtml man pages
176183e5f723Smrg#
176283e5f723Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
176383e5f723Smrg#
176483e5f723Smrg# OS and distros often splits groff in a basic and full package, the former
176583e5f723Smrg# having the groff program and the later having devices, fonts and macros
176683e5f723Smrg# Checking for the groff executable is not enough.
176783e5f723Smrg#
176883e5f723Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
176983e5f723Smrg# unset HAVE_GROFF or GROFF env variables.
177083e5f723Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
177183e5f723Smrg#
177283e5f723SmrgAC_DEFUN([XORG_WITH_GROFF],[
177383e5f723SmrgAC_ARG_VAR([GROFF], [Path to groff command])
177483e5f723SmrgAC_ARG_WITH(groff,
177583e5f723Smrg	AS_HELP_STRING([--with-groff],
177607d2e718Smrg	   [Use groff to regenerate documentation (default: yes, if installed)]),
177707d2e718Smrg	   [use_groff=$withval], [use_groff=auto])
177883e5f723Smrg
177983e5f723Smrgif test "x$use_groff" = x"auto"; then
178083e5f723Smrg   AC_PATH_PROG([GROFF], [groff])
178183e5f723Smrg   if test "x$GROFF" = "x"; then
178283e5f723Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
178383e5f723Smrg	have_groff=no
178483e5f723Smrg   else
178583e5f723Smrg        have_groff=yes
178683e5f723Smrg   fi
178783e5f723Smrgelif test "x$use_groff" = x"yes" ; then
178883e5f723Smrg   AC_PATH_PROG([GROFF], [groff])
178983e5f723Smrg   if test "x$GROFF" = "x"; then
179083e5f723Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
179183e5f723Smrg   fi
179283e5f723Smrg   have_groff=yes
179383e5f723Smrgelif test "x$use_groff" = x"no" ; then
179483e5f723Smrg   if test "x$GROFF" != "x"; then
179583e5f723Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
179683e5f723Smrg   fi
179783e5f723Smrg   have_groff=no
179883e5f723Smrgelse
179983e5f723Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
180083e5f723Smrgfi
180183e5f723Smrg
180283e5f723Smrg# We have groff, test for the presence of the macro packages
180383e5f723Smrgif test "x$have_groff" = x"yes"; then
180483e5f723Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
180583e5f723Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
180683e5f723Smrg        groff_ms_works=yes
180783e5f723Smrg    else
180883e5f723Smrg        groff_ms_works=no
180983e5f723Smrg    fi
181083e5f723Smrg    AC_MSG_RESULT([$groff_ms_works])
181183e5f723Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
181283e5f723Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
181383e5f723Smrg        groff_mm_works=yes
181483e5f723Smrg    else
181583e5f723Smrg        groff_mm_works=no
181683e5f723Smrg    fi
181783e5f723Smrg    AC_MSG_RESULT([$groff_mm_works])
181883e5f723Smrgfi
181983e5f723Smrg
182083e5f723Smrg# We have groff, test for HTML dependencies, one command per package
182183e5f723Smrgif test "x$have_groff" = x"yes"; then
182283e5f723Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
182383e5f723Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
182483e5f723Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
182583e5f723Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
182683e5f723Smrg      have_groff_html=yes
182783e5f723Smrg   else
182883e5f723Smrg      have_groff_html=no
182983e5f723Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
183083e5f723Smrg   fi
183183e5f723Smrgfi
183283e5f723Smrg
183383e5f723Smrg# Set Automake conditionals for Makefiles
183483e5f723SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
183583e5f723SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
183683e5f723SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
183783e5f723SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
183883e5f723Smrg]) # XORG_WITH_GROFF
183983e5f723Smrg
184007d2e718Smrg# XORG_WITH_FOP
184183e5f723Smrg# ----------------
184283e5f723Smrg# Minimum version: 1.6.0
184383e5f723Smrg#
184483e5f723Smrg# Documentation tools are not always available on all platforms and sometimes
184583e5f723Smrg# not at the appropriate level. This macro enables a module to test for the
184683e5f723Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
184783e5f723Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
184807d2e718Smrg# as whether or not to use the fop package.
184983e5f723Smrg#
185083e5f723Smrg# Interface to module:
185183e5f723Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
185283e5f723Smrg# FOP:	 	returns the path of the fop program found
185383e5f723Smrg#		returns the path set by the user in the environment
185483e5f723Smrg# --with-fop: 	'yes' user instructs the module to use fop
185583e5f723Smrg#		'no' user instructs the module not to use fop
185683e5f723Smrg#
185783e5f723Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
185883e5f723Smrg#
185983e5f723SmrgAC_DEFUN([XORG_WITH_FOP],[
186083e5f723SmrgAC_ARG_VAR([FOP], [Path to fop command])
186183e5f723SmrgAC_ARG_WITH(fop,
186283e5f723Smrg	AS_HELP_STRING([--with-fop],
186307d2e718Smrg	   [Use fop to regenerate documentation (default: yes, if installed)]),
186407d2e718Smrg	   [use_fop=$withval], [use_fop=auto])
186583e5f723Smrg
186683e5f723Smrgif test "x$use_fop" = x"auto"; then
186783e5f723Smrg   AC_PATH_PROG([FOP], [fop])
186883e5f723Smrg   if test "x$FOP" = "x"; then
186983e5f723Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
187083e5f723Smrg	have_fop=no
187183e5f723Smrg   else
187283e5f723Smrg        have_fop=yes
187383e5f723Smrg   fi
187483e5f723Smrgelif test "x$use_fop" = x"yes" ; then
187583e5f723Smrg   AC_PATH_PROG([FOP], [fop])
187683e5f723Smrg   if test "x$FOP" = "x"; then
187783e5f723Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
187883e5f723Smrg   fi
187983e5f723Smrg   have_fop=yes
188083e5f723Smrgelif test "x$use_fop" = x"no" ; then
188183e5f723Smrg   if test "x$FOP" != "x"; then
188283e5f723Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
188383e5f723Smrg   fi
188483e5f723Smrg   have_fop=no
188583e5f723Smrgelse
188683e5f723Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
188783e5f723Smrgfi
188883e5f723SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
188983e5f723Smrg]) # XORG_WITH_FOP
189083e5f723Smrg
189107d2e718Smrg# XORG_WITH_PS2PDF
189283e5f723Smrg# ----------------
189383e5f723Smrg# Minimum version: 1.6.0
189483e5f723Smrg#
189583e5f723Smrg# Documentation tools are not always available on all platforms and sometimes
189683e5f723Smrg# not at the appropriate level. This macro enables a module to test for the
189783e5f723Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
189883e5f723Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
189907d2e718Smrg# as whether or not to use the ps2pdf package.
190083e5f723Smrg#
190183e5f723Smrg# Interface to module:
190283e5f723Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
190383e5f723Smrg# PS2PDF:	returns the path of the ps2pdf program found
190483e5f723Smrg#		returns the path set by the user in the environment
190583e5f723Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
190683e5f723Smrg#		 'no' user instructs the module not to use ps2pdf
190783e5f723Smrg#
190883e5f723Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
190983e5f723Smrg#
191083e5f723SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
191183e5f723SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
191283e5f723SmrgAC_ARG_WITH(ps2pdf,
191383e5f723Smrg	AS_HELP_STRING([--with-ps2pdf],
191407d2e718Smrg	   [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
191507d2e718Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=auto])
191683e5f723Smrg
191783e5f723Smrgif test "x$use_ps2pdf" = x"auto"; then
191883e5f723Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
191983e5f723Smrg   if test "x$PS2PDF" = "x"; then
192083e5f723Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
192183e5f723Smrg	have_ps2pdf=no
192283e5f723Smrg   else
192383e5f723Smrg        have_ps2pdf=yes
192483e5f723Smrg   fi
192583e5f723Smrgelif test "x$use_ps2pdf" = x"yes" ; then
192683e5f723Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
192783e5f723Smrg   if test "x$PS2PDF" = "x"; then
192883e5f723Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
192983e5f723Smrg   fi
193083e5f723Smrg   have_ps2pdf=yes
193183e5f723Smrgelif test "x$use_ps2pdf" = x"no" ; then
193283e5f723Smrg   if test "x$PS2PDF" != "x"; then
193383e5f723Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
193483e5f723Smrg   fi
193583e5f723Smrg   have_ps2pdf=no
193683e5f723Smrgelse
193783e5f723Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
193883e5f723Smrgfi
193983e5f723SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
194083e5f723Smrg]) # XORG_WITH_PS2PDF
194183e5f723Smrg
194283e5f723Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
194383e5f723Smrg# ----------------
194483e5f723Smrg# Minimum version: 1.6.0
194583e5f723Smrg#
194683e5f723Smrg# Documentation tools are not always available on all platforms and sometimes
194783e5f723Smrg# not at the appropriate level. This macro enables a builder to skip all
194883e5f723Smrg# documentation targets except traditional man pages.
194983e5f723Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
195083e5f723Smrg# maximum flexibilty in controlling documentation building.
195183e5f723Smrg# Refer to:
195283e5f723Smrg# XORG_WITH_XMLTO         --with-xmlto
195383e5f723Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
195483e5f723Smrg# XORG_WITH_DOXYGEN       --with-doxygen
195583e5f723Smrg# XORG_WITH_FOP           --with-fop
195683e5f723Smrg# XORG_WITH_GROFF         --with-groff
195783e5f723Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
195883e5f723Smrg#
195983e5f723Smrg# Interface to module:
196083e5f723Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
196183e5f723Smrg# --enable-docs: 'yes' user instructs the module to generate docs
196283e5f723Smrg#		 'no' user instructs the module not to generate docs
196383e5f723Smrg# parm1:	specify the default value, yes or no.
196483e5f723Smrg#
196583e5f723SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
196607d2e718Smrgdefault=$1
196707d2e718Smrgif test "x$default" = x ; then
196807d2e718Smrg  default="yes"
196907d2e718Smrgfi
197083e5f723SmrgAC_ARG_ENABLE(docs,
197183e5f723Smrg	AS_HELP_STRING([--enable-docs],
197207d2e718Smrg	   [Enable building the documentation (default: yes)]),
197307d2e718Smrg	   [build_docs=$enableval], [build_docs=$default])
197483e5f723SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
197583e5f723SmrgAC_MSG_CHECKING([whether to build documentation])
197683e5f723SmrgAC_MSG_RESULT([$build_docs])
197783e5f723Smrg]) # XORG_ENABLE_DOCS
197883e5f723Smrg
197983e5f723Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
198083e5f723Smrg# ----------------
198183e5f723Smrg# Minimum version: 1.6.0
198283e5f723Smrg#
198383e5f723Smrg# This macro enables a builder to skip all developer documentation.
198483e5f723Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
198583e5f723Smrg# maximum flexibilty in controlling documentation building.
198683e5f723Smrg# Refer to:
198783e5f723Smrg# XORG_WITH_XMLTO         --with-xmlto
198883e5f723Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
198983e5f723Smrg# XORG_WITH_DOXYGEN       --with-doxygen
199083e5f723Smrg# XORG_WITH_FOP           --with-fop
199183e5f723Smrg# XORG_WITH_GROFF         --with-groff
199283e5f723Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
199383e5f723Smrg#
199483e5f723Smrg# Interface to module:
199583e5f723Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
199683e5f723Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
199783e5f723Smrg#			'no' user instructs the module not to generate developer docs
199883e5f723Smrg# parm1:		specify the default value, yes or no.
199983e5f723Smrg#
200083e5f723SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
200107d2e718Smrgdevel_default=$1
200207d2e718Smrgif test "x$devel_default" = x ; then
200307d2e718Smrg  devel_default="yes"
200407d2e718Smrgfi
200583e5f723SmrgAC_ARG_ENABLE(devel-docs,
200683e5f723Smrg	AS_HELP_STRING([--enable-devel-docs],
200707d2e718Smrg	   [Enable building the developer documentation (default: yes)]),
200807d2e718Smrg	   [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
200983e5f723SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
201083e5f723SmrgAC_MSG_CHECKING([whether to build developer documentation])
201183e5f723SmrgAC_MSG_RESULT([$build_devel_docs])
201283e5f723Smrg]) # XORG_ENABLE_DEVEL_DOCS
201383e5f723Smrg
201483e5f723Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
201583e5f723Smrg# ----------------
201683e5f723Smrg# Minimum version: 1.6.0
201783e5f723Smrg#
201883e5f723Smrg# This macro enables a builder to skip all functional specification targets.
201983e5f723Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
202083e5f723Smrg# maximum flexibilty in controlling documentation building.
202183e5f723Smrg# Refer to:
202283e5f723Smrg# XORG_WITH_XMLTO         --with-xmlto
202383e5f723Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
202483e5f723Smrg# XORG_WITH_DOXYGEN       --with-doxygen
202583e5f723Smrg# XORG_WITH_FOP           --with-fop
202683e5f723Smrg# XORG_WITH_GROFF         --with-groff
202783e5f723Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
202883e5f723Smrg#
202983e5f723Smrg# Interface to module:
203083e5f723Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
203183e5f723Smrg# --enable-specs:	'yes' user instructs the module to generate specs
203283e5f723Smrg#			'no' user instructs the module not to generate specs
203383e5f723Smrg# parm1:		specify the default value, yes or no.
203483e5f723Smrg#
203583e5f723SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
203607d2e718Smrgspec_default=$1
203707d2e718Smrgif test "x$spec_default" = x ; then
203807d2e718Smrg  spec_default="yes"
203907d2e718Smrgfi
204083e5f723SmrgAC_ARG_ENABLE(specs,
204183e5f723Smrg	AS_HELP_STRING([--enable-specs],
204207d2e718Smrg	   [Enable building the specs (default: yes)]),
204307d2e718Smrg	   [build_specs=$enableval], [build_specs=$spec_default])
204483e5f723SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
204583e5f723SmrgAC_MSG_CHECKING([whether to build functional specifications])
204683e5f723SmrgAC_MSG_RESULT([$build_specs])
204783e5f723Smrg]) # XORG_ENABLE_SPECS
204883e5f723Smrg
20495fac8b10Smrg# XORG_CHECK_MALLOC_ZERO
20505fac8b10Smrg# ----------------------
20515fac8b10Smrg# Minimum version: 1.0.0
20525fac8b10Smrg#
20535fac8b10Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
20545fac8b10Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
20555fac8b10Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
20565fac8b10SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
20575fac8b10SmrgAC_ARG_ENABLE(malloc0returnsnull,
20585fac8b10Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
20595fac8b10Smrg		       [malloc(0) returns NULL (default: auto)]),
20605fac8b10Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
20615fac8b10Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
2062f46a6179Smrg
20635fac8b10SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
20645fac8b10Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
20655fac8b10Smrg	AC_RUN_IFELSE([
20665fac8b10Smrgchar *malloc();
20675fac8b10Smrgchar *realloc();
20685fac8b10Smrgchar *calloc();
20695fac8b10Smrgmain() {
20705fac8b10Smrg    char *m0, *r0, *c0, *p;
20715fac8b10Smrg    m0 = malloc(0);
20725fac8b10Smrg    p = malloc(10);
20735fac8b10Smrg    r0 = realloc(p,0);
20745fac8b10Smrg    c0 = calloc(0);
20755fac8b10Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
20765fac8b10Smrg}],
20775fac8b10Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
207883e5f723Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
207983e5f723Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
20805fac8b10Smrgfi
20815fac8b10SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
2082f46a6179Smrg
20835fac8b10Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
20845fac8b10Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
20855fac8b10Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
20865fac8b10Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
2087f46a6179Smrgelse
20885fac8b10Smrg	MALLOC_ZERO_CFLAGS=""
20895fac8b10Smrg	XMALLOC_ZERO_CFLAGS=""
20905fac8b10Smrg	XTMALLOC_ZERO_CFLAGS=""
2091f46a6179Smrgfi
2092f46a6179Smrg
20935fac8b10SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
20945fac8b10SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
20955fac8b10SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
20965fac8b10Smrg]) # XORG_CHECK_MALLOC_ZERO
20975fac8b10Smrg
20985fac8b10Smrg# XORG_WITH_LINT()
20995fac8b10Smrg# ----------------
21005fac8b10Smrg# Minimum version: 1.1.0
2101f46a6179Smrg#
210283e5f723Smrg# This macro enables the use of a tool that flags some suspicious and
210383e5f723Smrg# non-portable constructs (likely to be bugs) in C language source code.
210483e5f723Smrg# It will attempt to locate the tool and use appropriate options.
210583e5f723Smrg# There are various lint type tools on different platforms.
210683e5f723Smrg#
210783e5f723Smrg# Interface to module:
210883e5f723Smrg# LINT:		returns the path to the tool found on the platform
210983e5f723Smrg#		or the value set to LINT on the configure cmd line
211083e5f723Smrg#		also an Automake conditional
211183e5f723Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
211283e5f723Smrg#
211383e5f723Smrg# --with-lint:	'yes' user instructs the module to use lint
211483e5f723Smrg#		'no' user instructs the module not to use lint (default)
211583e5f723Smrg#
211683e5f723Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
211783e5f723Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
21185fac8b10Smrg#
21195fac8b10SmrgAC_DEFUN([XORG_WITH_LINT],[
2120f46a6179Smrg
212183e5f723SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
212283e5f723SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
21235fac8b10SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
21245fac8b10Smrg		[Use a lint-style source code checker (default: disabled)])],
21255fac8b10Smrg		[use_lint=$withval], [use_lint=no])
212683e5f723Smrg
212783e5f723Smrg# Obtain platform specific info like program name and options
212883e5f723Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
212983e5f723Smrgcase $host_os in
213083e5f723Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
213183e5f723Smrg	lint_name=splint
213283e5f723Smrg	lint_options="-badflag"
213383e5f723Smrg	;;
213483e5f723Smrg  *freebsd* | *netbsd*)
213583e5f723Smrg	lint_name=lint
213683e5f723Smrg	lint_options="-u -b"
213783e5f723Smrg	;;
213883e5f723Smrg  *solaris*)
213983e5f723Smrg	lint_name=lint
214083e5f723Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
214183e5f723Smrg	;;
214283e5f723Smrgesac
214383e5f723Smrg
214483e5f723Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
214583e5f723Smrgif test "x$use_lint" = x"yes" ; then
214683e5f723Smrg   AC_PATH_PROG([LINT], [$lint_name])
214783e5f723Smrg   if test "x$LINT" = "x"; then
214883e5f723Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
214983e5f723Smrg   fi
215083e5f723Smrgelif test "x$use_lint" = x"no" ; then
215183e5f723Smrg   if test "x$LINT" != "x"; then
215283e5f723Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
215383e5f723Smrg   fi
21545fac8b10Smrgelse
215583e5f723Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
21565fac8b10Smrgfi
215783e5f723Smrg
215883e5f723Smrg# User supplied flags override default flags
215983e5f723Smrgif test "x$LINT_FLAGS" != "x"; then
216083e5f723Smrg   lint_options=$LINT_FLAGS
2161f46a6179Smrgfi
2162f46a6179Smrg
216383e5f723SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
216483e5f723SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
2165f46a6179Smrg
21665fac8b10Smrg]) # XORG_WITH_LINT
216734345a63Smrg
21685fac8b10Smrg# XORG_LINT_LIBRARY(LIBNAME)
21695fac8b10Smrg# --------------------------
21705fac8b10Smrg# Minimum version: 1.1.0
21715fac8b10Smrg#
21725fac8b10Smrg# Sets up flags for building lint libraries for checking programs that call
21735fac8b10Smrg# functions in the library.
21745fac8b10Smrg#
217583e5f723Smrg# Interface to module:
217683e5f723Smrg# LINTLIB		- Automake variable with the name of lint library file to make
217783e5f723Smrg# MAKE_LINT_LIB		- Automake conditional
217883e5f723Smrg#
217983e5f723Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
218083e5f723Smrg#			  - 'no' user instructs the module not to create a lint library (default)
2181f46a6179Smrg
21825fac8b10SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
21835fac8b10SmrgAC_REQUIRE([XORG_WITH_LINT])
21845fac8b10SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
21855fac8b10Smrg	[Create lint library (default: disabled)])],
21865fac8b10Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
218783e5f723Smrg
218883e5f723Smrgif test "x$make_lint_lib" = x"yes" ; then
218983e5f723Smrg   LINTLIB=llib-l$1.ln
219083e5f723Smrg   if test "x$LINT" = "x"; then
219183e5f723Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
219283e5f723Smrg   fi
219383e5f723Smrgelif test "x$make_lint_lib" != x"no" ; then
219483e5f723Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
21955fac8b10Smrgfi
219683e5f723Smrg
21975fac8b10SmrgAC_SUBST(LINTLIB)
21985fac8b10SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
219934345a63Smrg
22005fac8b10Smrg]) # XORG_LINT_LIBRARY
2201f46a6179Smrg
22025fac8b10Smrg# XORG_CWARNFLAGS
22035fac8b10Smrg# ---------------
22045fac8b10Smrg# Minimum version: 1.2.0
2205f46a6179Smrg#
22065fac8b10Smrg# Defines CWARNFLAGS to enable C compiler warnings.
22075fac8b10Smrg#
22085fac8b10SmrgAC_DEFUN([XORG_CWARNFLAGS], [
220983e5f723SmrgAC_REQUIRE([AC_PROG_CC_C99])
22105fac8b10Smrgif  test "x$GCC" = xyes ; then
22115fac8b10Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
22125fac8b10Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
221383e5f723Smrg-Wbad-function-cast -Wformat=2"
22145fac8b10Smrg    case `$CC -dumpversion` in
22155fac8b10Smrg    3.4.* | 4.*)
22165fac8b10Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
22175fac8b10Smrg	;;
22185fac8b10Smrg    esac
22195fac8b10Smrgelse
22205fac8b10Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
22215fac8b10Smrg    if test "x$SUNCC" = "xyes"; then
22225fac8b10Smrg	CWARNFLAGS="-v"
22235fac8b10Smrg    fi
22245fac8b10Smrgfi
22255fac8b10SmrgAC_SUBST(CWARNFLAGS)
22265fac8b10Smrg]) # XORG_CWARNFLAGS
2227f46a6179Smrg
22285fac8b10Smrg# XORG_STRICT_OPTION
22295fac8b10Smrg# -----------------------
22305fac8b10Smrg# Minimum version: 1.3.0
22315fac8b10Smrg#
22325fac8b10Smrg# Add configure option to enable strict compilation
22335fac8b10SmrgAC_DEFUN([XORG_STRICT_OPTION], [
223483e5f723Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
22355fac8b10SmrgAC_REQUIRE([AC_PROG_CC_C99])
22365fac8b10SmrgAC_REQUIRE([XORG_CWARNFLAGS])
22375fac8b10Smrg
22385fac8b10SmrgAC_ARG_ENABLE(strict-compilation,
22395fac8b10Smrg			  AS_HELP_STRING([--enable-strict-compilation],
22405fac8b10Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
22415fac8b10Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
22425fac8b10Smrgif test "x$STRICT_COMPILE" = "xyes"; then
22435fac8b10Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
22445fac8b10Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
22455fac8b10Smrg	if test "x$GCC" = xyes ; then
22465fac8b10Smrg		STRICT_CFLAGS="-pedantic -Werror"
22475fac8b10Smrg	elif test "x$SUNCC" = "xyes"; then
22485fac8b10Smrg		STRICT_CFLAGS="-errwarn"
22495fac8b10Smrg    elif test "x$INTELCC" = "xyes"; then
22505fac8b10Smrg		STRICT_CFLAGS="-Werror"
22515fac8b10Smrg	fi
22525fac8b10Smrgfi
22535fac8b10SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
22545fac8b10SmrgAC_SUBST([CWARNFLAGS])
22555fac8b10Smrg]) # XORG_STRICT_OPTION
2256f46a6179Smrg
22575fac8b10Smrg# XORG_DEFAULT_OPTIONS
2258f46a6179Smrg# --------------------
22595fac8b10Smrg# Minimum version: 1.3.0
2260f46a6179Smrg#
22615fac8b10Smrg# Defines default options for X.Org modules.
2262f46a6179Smrg#
22635fac8b10SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
226483e5f723SmrgAC_REQUIRE([AC_PROG_INSTALL])
22655fac8b10SmrgXORG_CWARNFLAGS
22665fac8b10SmrgXORG_STRICT_OPTION
22675fac8b10SmrgXORG_RELEASE_VERSION
22685fac8b10SmrgXORG_CHANGELOG
226983e5f723SmrgXORG_INSTALL
22705fac8b10SmrgXORG_MANPAGE_SECTIONS
227183e5f723Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
227283e5f723Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
22735fac8b10Smrg]) # XORG_DEFAULT_OPTIONS
227483e5f723Smrg
227583e5f723Smrg# XORG_INSTALL()
227683e5f723Smrg# ----------------
227783e5f723Smrg# Minimum version: 1.4.0
227883e5f723Smrg#
227983e5f723Smrg# Defines the variable INSTALL_CMD as the command to copy
228083e5f723Smrg# INSTALL from $prefix/share/util-macros.
228183e5f723Smrg#
228283e5f723SmrgAC_DEFUN([XORG_INSTALL], [
228383e5f723SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
228483e5f723Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
228583e5f723SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
228683e5f723Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
228783e5f723Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
228883e5f723Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
228983e5f723SmrgAC_SUBST([INSTALL_CMD])
229083e5f723Smrg]) # XORG_INSTALL
22915fac8b10Smrgdnl Copyright 2005 Red Hat, Inc
22925fac8b10Smrgdnl
22935fac8b10Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
22945fac8b10Smrgdnl documentation for any purpose is hereby granted without fee, provided that
22955fac8b10Smrgdnl the above copyright notice appear in all copies and that both that
22965fac8b10Smrgdnl copyright notice and this permission notice appear in supporting
22975fac8b10Smrgdnl documentation.
22985fac8b10Smrgdnl
22995fac8b10Smrgdnl The above copyright notice and this permission notice shall be included
23005fac8b10Smrgdnl in all copies or substantial portions of the Software.
23015fac8b10Smrgdnl
23025fac8b10Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23035fac8b10Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23045fac8b10Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23055fac8b10Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
23065fac8b10Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23075fac8b10Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23085fac8b10Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
23095fac8b10Smrgdnl
23105fac8b10Smrgdnl Except as contained in this notice, the name of the copyright holders shall
23115fac8b10Smrgdnl not be used in advertising or otherwise to promote the sale, use or
23125fac8b10Smrgdnl other dealings in this Software without prior written authorization
23135fac8b10Smrgdnl from the copyright holders.
23145fac8b10Smrgdnl
2315f46a6179Smrg
23165fac8b10Smrg# XORG_RELEASE_VERSION
23175fac8b10Smrg# --------------------
231883e5f723Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
23195fac8b10Smrg 
23205fac8b10SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
23215fac8b10Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
23225fac8b10Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
23235fac8b10Smrg		[Major version of this package])
23245fac8b10Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
23255fac8b10Smrg	if test "x$PVM" = "x"; then
23265fac8b10Smrg		PVM="0"
23275fac8b10Smrg	fi
23285fac8b10Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
23295fac8b10Smrg		[$PVM],
23305fac8b10Smrg		[Minor version of this package])
23315fac8b10Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
23325fac8b10Smrg	if test "x$PVP" = "x"; then
23335fac8b10Smrg		PVP="0"
23345fac8b10Smrg	fi
23355fac8b10Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
23365fac8b10Smrg		[$PVP],
23375fac8b10Smrg		[Patch version of this package])
23385fac8b10Smrg])
2339f46a6179Smrg
23405fac8b10Smrg# XORG_CHANGELOG()
23415fac8b10Smrg# ----------------
23425fac8b10Smrg# Minimum version: 1.2.0
23435fac8b10Smrg#
23445fac8b10Smrg# Defines the variable CHANGELOG_CMD as the command to generate
23455fac8b10Smrg# ChangeLog from git.
23465fac8b10Smrg#
23475fac8b10Smrg#
23485fac8b10SmrgAC_DEFUN([XORG_CHANGELOG], [
234983e5f723SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
235083e5f723Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
235183e5f723Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
23525fac8b10Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
23535fac8b10SmrgAC_SUBST([CHANGELOG_CMD])
23545fac8b10Smrg]) # XORG_CHANGELOG
2355f46a6179Smrg
2356