aclocal.m4 revision 690143cc
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
16690143ccSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17690143ccSmrg[m4_warning([this file was generated for autoconf 2.68.
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_]+$])
50690143ccSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
51690143ccSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
5207d2e718SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
5307d2e718SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
5407d2e718SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
5507d2e718Smrg
5607d2e718Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
5707d2e718Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
5807d2e718Smrgfi
5907d2e718Smrgif test -n "$PKG_CONFIG"; then
6007d2e718Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
6107d2e718Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
6207d2e718Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
6307d2e718Smrg		AC_MSG_RESULT([yes])
6407d2e718Smrg	else
6507d2e718Smrg		AC_MSG_RESULT([no])
6607d2e718Smrg		PKG_CONFIG=""
6707d2e718Smrg	fi
6807d2e718Smrgfi[]dnl
6907d2e718Smrg])# PKG_PROG_PKG_CONFIG
7007d2e718Smrg
7107d2e718Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
7207d2e718Smrg#
7307d2e718Smrg# Check to see whether a particular set of modules exists.  Similar
7407d2e718Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
7507d2e718Smrg#
7607d2e718Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
7707d2e718Smrg# only at the first occurence in configure.ac, so if the first place
7807d2e718Smrg# it's called might be skipped (such as if it is within an "if", you
7907d2e718Smrg# have to call PKG_CHECK_EXISTS manually
8007d2e718Smrg# --------------------------------------------------------------
8107d2e718SmrgAC_DEFUN([PKG_CHECK_EXISTS],
8207d2e718Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8307d2e718Smrgif test -n "$PKG_CONFIG" && \
8407d2e718Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8507d2e718Smrg  m4_default([$2], [:])
8607d2e718Smrgm4_ifvaln([$3], [else
8707d2e718Smrg  $3])dnl
8807d2e718Smrgfi])
8907d2e718Smrg
9007d2e718Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9107d2e718Smrg# ---------------------------------------------
9207d2e718Smrgm4_define([_PKG_CONFIG],
9307d2e718Smrg[if test -n "$$1"; then
9407d2e718Smrg    pkg_cv_[]$1="$$1"
9507d2e718Smrg elif test -n "$PKG_CONFIG"; then
9607d2e718Smrg    PKG_CHECK_EXISTS([$3],
97690143ccSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
98690143ccSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
9907d2e718Smrg		     [pkg_failed=yes])
10007d2e718Smrg else
10107d2e718Smrg    pkg_failed=untried
10207d2e718Smrgfi[]dnl
10307d2e718Smrg])# _PKG_CONFIG
10407d2e718Smrg
10507d2e718Smrg# _PKG_SHORT_ERRORS_SUPPORTED
10607d2e718Smrg# -----------------------------
10707d2e718SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
10807d2e718Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10907d2e718Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
11007d2e718Smrg        _pkg_short_errors_supported=yes
11107d2e718Smrgelse
11207d2e718Smrg        _pkg_short_errors_supported=no
11307d2e718Smrgfi[]dnl
11407d2e718Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
11507d2e718Smrg
11607d2e718Smrg
11707d2e718Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
11807d2e718Smrg# [ACTION-IF-NOT-FOUND])
11907d2e718Smrg#
12007d2e718Smrg#
12107d2e718Smrg# Note that if there is a possibility the first call to
12207d2e718Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
12307d2e718Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
12407d2e718Smrg#
12507d2e718Smrg#
12607d2e718Smrg# --------------------------------------------------------------
12707d2e718SmrgAC_DEFUN([PKG_CHECK_MODULES],
12807d2e718Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
12907d2e718SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
13007d2e718SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
13107d2e718Smrg
13207d2e718Smrgpkg_failed=no
13307d2e718SmrgAC_MSG_CHECKING([for $1])
13407d2e718Smrg
13507d2e718Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
13607d2e718Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
13707d2e718Smrg
13807d2e718Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
13907d2e718Smrgand $1[]_LIBS to avoid the need to call pkg-config.
14007d2e718SmrgSee the pkg-config man page for more details.])
14107d2e718Smrg
14207d2e718Smrgif test $pkg_failed = yes; then
14307d2e718Smrg   	AC_MSG_RESULT([no])
14407d2e718Smrg        _PKG_SHORT_ERRORS_SUPPORTED
14507d2e718Smrg        if test $_pkg_short_errors_supported = yes; then
146690143ccSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
14707d2e718Smrg        else 
148690143ccSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
14907d2e718Smrg        fi
15007d2e718Smrg	# Put the nasty error message in config.log where it belongs
15107d2e718Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
15207d2e718Smrg
15307d2e718Smrg	m4_default([$4], [AC_MSG_ERROR(
15407d2e718Smrg[Package requirements ($2) were not met:
15507d2e718Smrg
15607d2e718Smrg$$1_PKG_ERRORS
15707d2e718Smrg
15807d2e718SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
15907d2e718Smrginstalled software in a non-standard prefix.
16007d2e718Smrg
161690143ccSmrg_PKG_TEXT])[]dnl
16207d2e718Smrg        ])
16307d2e718Smrgelif test $pkg_failed = untried; then
16407d2e718Smrg     	AC_MSG_RESULT([no])
16507d2e718Smrg	m4_default([$4], [AC_MSG_FAILURE(
16607d2e718Smrg[The pkg-config script could not be found or is too old.  Make sure it
16707d2e718Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
16807d2e718Smrgpath to pkg-config.
16907d2e718Smrg
17007d2e718Smrg_PKG_TEXT
17107d2e718Smrg
172690143ccSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
17307d2e718Smrg        ])
17407d2e718Smrgelse
17507d2e718Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
17607d2e718Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
17707d2e718Smrg        AC_MSG_RESULT([yes])
17807d2e718Smrg	$3
17907d2e718Smrgfi[]dnl
18007d2e718Smrg])# PKG_CHECK_MODULES
18107d2e718Smrg
182690143ccSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
183690143ccSmrgdnl
184690143ccSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
185690143ccSmrgdnl 
186690143ccSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
187690143ccSmrgdnl copy of this software and associated documentation files (the "Software"),
188690143ccSmrgdnl to deal in the Software without restriction, including without limitation
189690143ccSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
190690143ccSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
191690143ccSmrgdnl Software is furnished to do so, subject to the following conditions:
192690143ccSmrgdnl
193690143ccSmrgdnl The above copyright notice and this permission notice (including the next
194690143ccSmrgdnl paragraph) shall be included in all copies or substantial portions of the
195690143ccSmrgdnl Software.
196690143ccSmrgdnl
197690143ccSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
198690143ccSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
199690143ccSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
200690143ccSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
201690143ccSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
202690143ccSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
203690143ccSmrgdnl DEALINGS IN THE SOFTWARE.
2045fac8b10Smrg
205690143ccSmrg# XORG_MACROS_VERSION(required-version)
206690143ccSmrg# -------------------------------------
207690143ccSmrg# Minimum version: 1.1.0
208f46a6179Smrg#
209690143ccSmrg# If you're using a macro added in Version 1.1 or newer, include this in
210690143ccSmrg# your configure.ac with the minimum required version, such as:
211690143ccSmrg# XORG_MACROS_VERSION(1.1)
212f46a6179Smrg#
213690143ccSmrg# To ensure that this macro is defined, also add:
214690143ccSmrg# m4_ifndef([XORG_MACROS_VERSION],
215690143ccSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
216f46a6179Smrg#
2175fac8b10Smrg#
218690143ccSmrg# See the "minimum version" comment for each macro you use to see what 
219690143ccSmrg# version you require.
220690143ccSmrgm4_defun([XORG_MACROS_VERSION],[
221690143ccSmrgm4_define([vers_have], [1.14.0])
222690143ccSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
223690143ccSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
224690143ccSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
225690143ccSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
226690143ccSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
227690143ccSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
228690143ccSmrgm4_undefine([vers_have])
229690143ccSmrgm4_undefine([maj_have])
230690143ccSmrgm4_undefine([maj_needed])
231690143ccSmrg]) # XORG_MACROS_VERSION
232f46a6179Smrg
233690143ccSmrg# XORG_PROG_RAWCPP()
234690143ccSmrg# ------------------
235690143ccSmrg# Minimum version: 1.0.0
236f46a6179Smrg#
237690143ccSmrg# Find cpp program and necessary flags for use in pre-processing text files
238690143ccSmrg# such as man pages and config files
239690143ccSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
240690143ccSmrgAC_REQUIRE([AC_PROG_CPP])
241690143ccSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
242690143ccSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
243f46a6179Smrg
244690143ccSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
245690143ccSmrg# which is not the best choice for supporting other OS'es, but covers most
246690143ccSmrg# of the ones we need for now.
247690143ccSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
248690143ccSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
249690143ccSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
250690143ccSmrg	AC_MSG_RESULT([no])
251690143ccSmrgelse
252690143ccSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
253690143ccSmrg		RAWCPPFLAGS=-undef
254690143ccSmrg		AC_MSG_RESULT([yes])
255690143ccSmrg	# under Cygwin unix is still defined even with -undef
256690143ccSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
257690143ccSmrg		RAWCPPFLAGS="-undef -ansi"
258690143ccSmrg		AC_MSG_RESULT([yes, with -ansi])
259690143ccSmrg	else
260690143ccSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
261690143ccSmrg	fi
262690143ccSmrgfi
263690143ccSmrgrm -f conftest.$ac_ext
264f46a6179Smrg
265690143ccSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
266690143ccSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
267690143ccSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
268690143ccSmrg	AC_MSG_RESULT([no])
2695fac8b10Smrgelse
270690143ccSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
271690143ccSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
272690143ccSmrg		AC_MSG_RESULT([yes])
273690143ccSmrg	else
274690143ccSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
275690143ccSmrg	fi
276f46a6179Smrgfi
277690143ccSmrgrm -f conftest.$ac_ext
278690143ccSmrgAC_SUBST(RAWCPPFLAGS)
279690143ccSmrg]) # XORG_PROG_RAWCPP
280f46a6179Smrg
281690143ccSmrg# XORG_MANPAGE_SECTIONS()
282690143ccSmrg# -----------------------
283690143ccSmrg# Minimum version: 1.0.0
2845fac8b10Smrg#
285690143ccSmrg# Determine which sections man pages go in for the different man page types
286690143ccSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
287690143ccSmrg# Not sure if there's any better way than just hardcoding by OS name.
288690143ccSmrg# Override default settings by setting environment variables
289690143ccSmrg# Added MAN_SUBSTS in version 1.8
290690143ccSmrg# Added AC_PROG_SED in version 1.8
291f46a6179Smrg
292690143ccSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
293690143ccSmrgAC_REQUIRE([AC_CANONICAL_HOST])
294690143ccSmrgAC_REQUIRE([AC_PROG_SED])
295f46a6179Smrg
296690143ccSmrgif test x$APP_MAN_SUFFIX = x    ; then
297690143ccSmrg    APP_MAN_SUFFIX=1
298690143ccSmrgfi
299690143ccSmrgif test x$APP_MAN_DIR = x    ; then
300690143ccSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
301690143ccSmrgfi
302f46a6179Smrg
303690143ccSmrgif test x$LIB_MAN_SUFFIX = x    ; then
304690143ccSmrg    LIB_MAN_SUFFIX=3
305690143ccSmrgfi
306690143ccSmrgif test x$LIB_MAN_DIR = x    ; then
307690143ccSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
308690143ccSmrgfi
309f46a6179Smrg
310690143ccSmrgif test x$FILE_MAN_SUFFIX = x    ; then
311690143ccSmrg    case $host_os in
312690143ccSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
313690143ccSmrg	*)		FILE_MAN_SUFFIX=5  ;;
314690143ccSmrg    esac
315690143ccSmrgfi
316690143ccSmrgif test x$FILE_MAN_DIR = x    ; then
317690143ccSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
318690143ccSmrgfi
319f46a6179Smrg
320690143ccSmrgif test x$MISC_MAN_SUFFIX = x    ; then
321690143ccSmrg    case $host_os in
322690143ccSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
323690143ccSmrg	*)		MISC_MAN_SUFFIX=7  ;;
324690143ccSmrg    esac
325690143ccSmrgfi
326690143ccSmrgif test x$MISC_MAN_DIR = x    ; then
327690143ccSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
328690143ccSmrgfi
329f46a6179Smrg
330690143ccSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
331690143ccSmrg    case $host_os in
332690143ccSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
333690143ccSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
334690143ccSmrg    esac
335690143ccSmrgfi
336690143ccSmrgif test x$DRIVER_MAN_DIR = x    ; then
337690143ccSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
338690143ccSmrgfi
339f46a6179Smrg
340690143ccSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
341690143ccSmrg    case $host_os in
342690143ccSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
343690143ccSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
344690143ccSmrg    esac
345690143ccSmrgfi
346690143ccSmrgif test x$ADMIN_MAN_DIR = x    ; then
347690143ccSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
348690143ccSmrgfi
349f46a6179Smrg
350f46a6179Smrg
351690143ccSmrgAC_SUBST([APP_MAN_SUFFIX])
352690143ccSmrgAC_SUBST([LIB_MAN_SUFFIX])
353690143ccSmrgAC_SUBST([FILE_MAN_SUFFIX])
354690143ccSmrgAC_SUBST([MISC_MAN_SUFFIX])
355690143ccSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
356690143ccSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
357690143ccSmrgAC_SUBST([APP_MAN_DIR])
358690143ccSmrgAC_SUBST([LIB_MAN_DIR])
359690143ccSmrgAC_SUBST([FILE_MAN_DIR])
360690143ccSmrgAC_SUBST([MISC_MAN_DIR])
361690143ccSmrgAC_SUBST([DRIVER_MAN_DIR])
362690143ccSmrgAC_SUBST([ADMIN_MAN_DIR])
363f46a6179Smrg
364690143ccSmrgXORG_MAN_PAGE="X Version 11"
365690143ccSmrgAC_SUBST([XORG_MAN_PAGE])
366690143ccSmrgMAN_SUBSTS="\
367690143ccSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
368690143ccSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
369690143ccSmrg	-e 's|__xservername__|Xorg|g' \
370690143ccSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
371690143ccSmrg	-e 's|__projectroot__|\$(prefix)|g' \
372690143ccSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
373690143ccSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
374690143ccSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
375690143ccSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
376690143ccSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
377690143ccSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
378690143ccSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
379690143ccSmrgAC_SUBST([MAN_SUBSTS])
380690143ccSmrg
381690143ccSmrg]) # XORG_MANPAGE_SECTIONS
382690143ccSmrg
383690143ccSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
384690143ccSmrg# ------------------------
385690143ccSmrg# Minimum version: 1.7.0
386690143ccSmrg#
387690143ccSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
388690143ccSmrg# provided by xorg-sgml-doctools, if installed.
389690143ccSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
390690143ccSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
391690143ccSmrgXORG_SGML_PATH=
392690143ccSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
393690143ccSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
394690143ccSmrg    [m4_ifval([$1],[:],
395690143ccSmrg        [if test x"$cross_compiling" != x"yes" ; then
396690143ccSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
397690143ccSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
398690143ccSmrg         fi])
399690143ccSmrg    ])
400690143ccSmrg
401690143ccSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
402690143ccSmrg# the path and the name of the doc stylesheet
403690143ccSmrgif test "x$XORG_SGML_PATH" != "x" ; then
404690143ccSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
405690143ccSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
406690143ccSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
407f46a6179Smrgelse
408690143ccSmrg   AC_MSG_RESULT([no])
409f46a6179Smrgfi
410f46a6179Smrg
411690143ccSmrgAC_SUBST(XORG_SGML_PATH)
412690143ccSmrgAC_SUBST(STYLESHEET_SRCDIR)
413690143ccSmrgAC_SUBST(XSL_STYLESHEET)
414690143ccSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
415690143ccSmrg]) # XORG_CHECK_SGML_DOCTOOLS
416f46a6179Smrg
417690143ccSmrg# XORG_CHECK_LINUXDOC
418690143ccSmrg# -------------------
419690143ccSmrg# Minimum version: 1.0.0
420690143ccSmrg#
421690143ccSmrg# Defines the variable MAKE_TEXT if the necessary tools and
422690143ccSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
423690143ccSmrg# Whether or not the necessary tools and files are found can be checked
424690143ccSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
425690143ccSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
426690143ccSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
427690143ccSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
428690143ccSmrg
429690143ccSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
430f46a6179Smrg
431690143ccSmrgAC_MSG_CHECKING([whether to build documentation])
432f46a6179Smrg
433690143ccSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
434690143ccSmrg   BUILDDOC=yes
435690143ccSmrgelse
436690143ccSmrg   BUILDDOC=no
43734345a63Smrgfi
438f46a6179Smrg
439690143ccSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
440f46a6179Smrg
441690143ccSmrgAC_MSG_RESULT([$BUILDDOC])
442f46a6179Smrg
443690143ccSmrgAC_MSG_CHECKING([whether to build pdf documentation])
444f46a6179Smrg
445690143ccSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
446690143ccSmrg   BUILDPDFDOC=yes
447690143ccSmrgelse
448690143ccSmrg   BUILDPDFDOC=no
449690143ccSmrgfi
450f46a6179Smrg
451690143ccSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
452f46a6179Smrg
453690143ccSmrgAC_MSG_RESULT([$BUILDPDFDOC])
454f46a6179Smrg
455690143ccSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
456690143ccSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
457690143ccSmrgMAKE_PDF="$PS2PDF"
458690143ccSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
459f46a6179Smrg
460690143ccSmrgAC_SUBST(MAKE_TEXT)
461690143ccSmrgAC_SUBST(MAKE_PS)
462690143ccSmrgAC_SUBST(MAKE_PDF)
463690143ccSmrgAC_SUBST(MAKE_HTML)
464690143ccSmrg]) # XORG_CHECK_LINUXDOC
465690143ccSmrg
466690143ccSmrg# XORG_CHECK_DOCBOOK
467690143ccSmrg# -------------------
468690143ccSmrg# Minimum version: 1.0.0
469f46a6179Smrg#
470690143ccSmrg# Checks for the ability to build output formats from SGML DocBook source.
471690143ccSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
472690143ccSmrg# indicates whether the necessary tools and files are found and, if set,
473690143ccSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
474690143ccSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
475690143ccSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
476f46a6179Smrg
477690143ccSmrgBUILDTXTDOC=no
478690143ccSmrgBUILDPDFDOC=no
479690143ccSmrgBUILDPSDOC=no
480690143ccSmrgBUILDHTMLDOC=no
481f46a6179Smrg
482690143ccSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
483690143ccSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
484690143ccSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
485690143ccSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
486f46a6179Smrg
487690143ccSmrgAC_MSG_CHECKING([whether to build text documentation])
488690143ccSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
489690143ccSmrg   test x$BUILD_TXTDOC != xno; then
490690143ccSmrg	BUILDTXTDOC=yes
491f46a6179Smrgfi
492690143ccSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
493690143ccSmrgAC_MSG_RESULT([$BUILDTXTDOC])
494f46a6179Smrg
495690143ccSmrgAC_MSG_CHECKING([whether to build PDF documentation])
496690143ccSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
497690143ccSmrg   test x$BUILD_PDFDOC != xno; then
498690143ccSmrg	BUILDPDFDOC=yes
4995fac8b10Smrgfi
500690143ccSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
501690143ccSmrgAC_MSG_RESULT([$BUILDPDFDOC])
5025fac8b10Smrg
503690143ccSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
504690143ccSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
505690143ccSmrg   test x$BUILD_PSDOC != xno; then
506690143ccSmrg	BUILDPSDOC=yes
507690143ccSmrgfi
508690143ccSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
509690143ccSmrgAC_MSG_RESULT([$BUILDPSDOC])
510f46a6179Smrg
511690143ccSmrgAC_MSG_CHECKING([whether to build HTML documentation])
512690143ccSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
513690143ccSmrg   test x$BUILD_HTMLDOC != xno; then
514690143ccSmrg	BUILDHTMLDOC=yes
515690143ccSmrgfi
516690143ccSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
517690143ccSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
51834345a63Smrg
519690143ccSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
520690143ccSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
521690143ccSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
522690143ccSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
5235fac8b10Smrg
524690143ccSmrgAC_SUBST(MAKE_TEXT)
525690143ccSmrgAC_SUBST(MAKE_PS)
526690143ccSmrgAC_SUBST(MAKE_PDF)
527690143ccSmrgAC_SUBST(MAKE_HTML)
528690143ccSmrg]) # XORG_CHECK_DOCBOOK
5295fac8b10Smrg
530690143ccSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
531690143ccSmrg# ----------------
532690143ccSmrg# Minimum version: 1.5.0
533690143ccSmrg# Minimum version for optional DEFAULT argument: 1.11.0
534f46a6179Smrg#
535690143ccSmrg# Documentation tools are not always available on all platforms and sometimes
536690143ccSmrg# not at the appropriate level. This macro enables a module to test for the
537690143ccSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
538690143ccSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
539690143ccSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
540690143ccSmrg# --with-xmlto assumes 'auto'.
541690143ccSmrg#
542690143ccSmrg# Interface to module:
543690143ccSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
544690143ccSmrg# XMLTO:	returns the path of the xmlto program found
545690143ccSmrg#		returns the path set by the user in the environment
546690143ccSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
547690143ccSmrg#		'no' user instructs the module not to use xmlto
548690143ccSmrg#
549690143ccSmrg# Added in version 1.10.0
550690143ccSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
551690143ccSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
552690143ccSmrg#
553690143ccSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
554690143ccSmrg#
555690143ccSmrgAC_DEFUN([XORG_WITH_XMLTO],[
556690143ccSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
557690143ccSmrgm4_define([_defopt], m4_default([$2], [auto]))
558690143ccSmrgAC_ARG_WITH(xmlto,
559690143ccSmrg	AS_HELP_STRING([--with-xmlto],
560690143ccSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
561690143ccSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
562690143ccSmrgm4_undefine([_defopt])
563f46a6179Smrg
564690143ccSmrgif test "x$use_xmlto" = x"auto"; then
565690143ccSmrg   AC_PATH_PROG([XMLTO], [xmlto])
566690143ccSmrg   if test "x$XMLTO" = "x"; then
567690143ccSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
568690143ccSmrg	have_xmlto=no
569690143ccSmrg   else
570690143ccSmrg        have_xmlto=yes
571690143ccSmrg   fi
572690143ccSmrgelif test "x$use_xmlto" = x"yes" ; then
573690143ccSmrg   AC_PATH_PROG([XMLTO], [xmlto])
574690143ccSmrg   if test "x$XMLTO" = "x"; then
575690143ccSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
576690143ccSmrg   fi
577690143ccSmrg   have_xmlto=yes
578690143ccSmrgelif test "x$use_xmlto" = x"no" ; then
579690143ccSmrg   if test "x$XMLTO" != "x"; then
580690143ccSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
581690143ccSmrg   fi
582690143ccSmrg   have_xmlto=no
583690143ccSmrgelse
584690143ccSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
5855fac8b10Smrgfi
586f46a6179Smrg
587690143ccSmrg# Test for a minimum version of xmlto, if provided.
588690143ccSmrgm4_ifval([$1],
589690143ccSmrg[if test "$have_xmlto" = yes; then
590690143ccSmrg    # scrape the xmlto version
591690143ccSmrg    AC_MSG_CHECKING([the xmlto version])
592690143ccSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
593690143ccSmrg    AC_MSG_RESULT([$xmlto_version])
594690143ccSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
595690143ccSmrg        [if test "x$use_xmlto" = xauto; then
596690143ccSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
597690143ccSmrg            have_xmlto=no
598690143ccSmrg        else
599690143ccSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
600690143ccSmrg        fi])
601690143ccSmrgfi])
602f46a6179Smrg
603690143ccSmrg# Test for the ability of xmlto to generate a text target
604690143ccSmrghave_xmlto_text=no
605690143ccSmrgcat > conftest.xml << "EOF"
606690143ccSmrgEOF
607690143ccSmrgAS_IF([test "$have_xmlto" = yes],
608690143ccSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
609690143ccSmrg             [have_xmlto_text=yes],
610690143ccSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
611690143ccSmrgrm -f conftest.xml
612690143ccSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
613690143ccSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
614690143ccSmrg]) # XORG_WITH_XMLTO
615f46a6179Smrg
616690143ccSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
617690143ccSmrg# --------------------------------------------
618690143ccSmrg# Minimum version: 1.12.0
619690143ccSmrg# Minimum version for optional DEFAULT argument: 1.12.0
620690143ccSmrg#
621690143ccSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
622690143ccSmrg# XML-based language used for the transformation of XML documents.
623690143ccSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
624690143ccSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
625690143ccSmrg# The XSLT processor is often used as a standalone tool for transformations.
626690143ccSmrg# It should not be assumed that this tool is used only to work with documnetation.
627690143ccSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
628690143ccSmrg#
629690143ccSmrg# Interface to module:
630690143ccSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
631690143ccSmrg# XSLTPROC:	 returns the path of the xsltproc program found
632690143ccSmrg#		 returns the path set by the user in the environment
633690143ccSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
634690143ccSmrg#		  'no' user instructs the module not to use xsltproc
635690143ccSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
636690143ccSmrg#
637690143ccSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
638690143ccSmrg#
639690143ccSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
640690143ccSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
641690143ccSmrgm4_define([_defopt], m4_default([$2], [auto]))
642690143ccSmrgAC_ARG_WITH(xsltproc,
643690143ccSmrg	AS_HELP_STRING([--with-xsltproc],
644690143ccSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
645690143ccSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
646690143ccSmrgm4_undefine([_defopt])
647690143ccSmrg
648690143ccSmrgif test "x$use_xsltproc" = x"auto"; then
649690143ccSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
650690143ccSmrg   if test "x$XSLTPROC" = "x"; then
651690143ccSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
652690143ccSmrg	have_xsltproc=no
653690143ccSmrg   else
654690143ccSmrg        have_xsltproc=yes
655690143ccSmrg   fi
656690143ccSmrgelif test "x$use_xsltproc" = x"yes" ; then
657690143ccSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
658690143ccSmrg   if test "x$XSLTPROC" = "x"; then
659690143ccSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
660690143ccSmrg   fi
661690143ccSmrg   have_xsltproc=yes
662690143ccSmrgelif test "x$use_xsltproc" = x"no" ; then
663690143ccSmrg   if test "x$XSLTPROC" != "x"; then
664690143ccSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
665690143ccSmrg   fi
666690143ccSmrg   have_xsltproc=no
6675fac8b10Smrgelse
668690143ccSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
6695fac8b10Smrgfi
670f46a6179Smrg
671690143ccSmrg# Checking for minimum version is not implemented
672690143ccSmrg# but we want to keep the interface consistent with other commands
673690143ccSmrgm4_ifval([$1],[AC_MSG_WARN(Checking for MIN-VERSION is not implemented.)])
674f46a6179Smrg
675690143ccSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
676690143ccSmrg]) # XORG_WITH_XSLTPROC
6775fac8b10Smrg
6785fac8b10Smrg
679690143ccSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
680690143ccSmrg# ----------------
681690143ccSmrg# Minimum version: 1.5.0
682690143ccSmrg# Minimum version for optional DEFAULT argument: 1.11.0
683690143ccSmrg#
684690143ccSmrg# Documentation tools are not always available on all platforms and sometimes
685690143ccSmrg# not at the appropriate level. This macro enables a module to test for the
686690143ccSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
687690143ccSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
688690143ccSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
689690143ccSmrg# --with-asciidoc assumes 'auto'.
690690143ccSmrg#
691690143ccSmrg# Interface to module:
692690143ccSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
693690143ccSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
694690143ccSmrg#		 returns the path set by the user in the environment
695690143ccSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
696690143ccSmrg#		  'no' user instructs the module not to use asciidoc
697690143ccSmrg#
698690143ccSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
699690143ccSmrg#
700690143ccSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
701690143ccSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
702690143ccSmrgm4_define([_defopt], m4_default([$2], [auto]))
703690143ccSmrgAC_ARG_WITH(asciidoc,
704690143ccSmrg	AS_HELP_STRING([--with-asciidoc],
705690143ccSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
706690143ccSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
707690143ccSmrgm4_undefine([_defopt])
7085fac8b10Smrg
709690143ccSmrgif test "x$use_asciidoc" = x"auto"; then
710690143ccSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
711690143ccSmrg   if test "x$ASCIIDOC" = "x"; then
712690143ccSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
713690143ccSmrg	have_asciidoc=no
714690143ccSmrg   else
715690143ccSmrg        have_asciidoc=yes
716690143ccSmrg   fi
717690143ccSmrgelif test "x$use_asciidoc" = x"yes" ; then
718690143ccSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
719690143ccSmrg   if test "x$ASCIIDOC" = "x"; then
720690143ccSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
721690143ccSmrg   fi
722690143ccSmrg   have_asciidoc=yes
723690143ccSmrgelif test "x$use_asciidoc" = x"no" ; then
724690143ccSmrg   if test "x$ASCIIDOC" != "x"; then
725690143ccSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
726690143ccSmrg   fi
727690143ccSmrg   have_asciidoc=no
728690143ccSmrgelse
729690143ccSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
730690143ccSmrgfi
731690143ccSmrgm4_ifval([$1],
732690143ccSmrg[if test "$have_asciidoc" = yes; then
733690143ccSmrg    # scrape the asciidoc version
734690143ccSmrg    AC_MSG_CHECKING([the asciidoc version])
735690143ccSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
736690143ccSmrg    AC_MSG_RESULT([$asciidoc_version])
737690143ccSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
738690143ccSmrg        [if test "x$use_asciidoc" = xauto; then
739690143ccSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
740690143ccSmrg            have_asciidoc=no
741690143ccSmrg        else
742690143ccSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
743690143ccSmrg        fi])
744690143ccSmrgfi])
745690143ccSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
746690143ccSmrg]) # XORG_WITH_ASCIIDOC
7475fac8b10Smrg
748690143ccSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
749690143ccSmrg# --------------------------------
750690143ccSmrg# Minimum version: 1.5.0
751690143ccSmrg# Minimum version for optional DEFAULT argument: 1.11.0
752f46a6179Smrg#
753690143ccSmrg# Documentation tools are not always available on all platforms and sometimes
754690143ccSmrg# not at the appropriate level. This macro enables a module to test for the
755690143ccSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
756690143ccSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
757690143ccSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
758690143ccSmrg# --with-doxygen assumes 'auto'.
759690143ccSmrg#
760690143ccSmrg# Interface to module:
761690143ccSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
762690143ccSmrg# DOXYGEN:	 returns the path of the doxygen program found
763690143ccSmrg#		 returns the path set by the user in the environment
764690143ccSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
765690143ccSmrg#		  'no' user instructs the module not to use doxygen
766690143ccSmrg#
767690143ccSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
768690143ccSmrg#
769690143ccSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
770690143ccSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
771690143ccSmrgm4_define([_defopt], m4_default([$2], [auto]))
772690143ccSmrgAC_ARG_WITH(doxygen,
773690143ccSmrg	AS_HELP_STRING([--with-doxygen],
774690143ccSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
775690143ccSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
776690143ccSmrgm4_undefine([_defopt])
7775fac8b10Smrg
778690143ccSmrgif test "x$use_doxygen" = x"auto"; then
779690143ccSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
780690143ccSmrg   if test "x$DOXYGEN" = "x"; then
781690143ccSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
782690143ccSmrg	have_doxygen=no
783690143ccSmrg   else
784690143ccSmrg        have_doxygen=yes
785690143ccSmrg   fi
786690143ccSmrgelif test "x$use_doxygen" = x"yes" ; then
787690143ccSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
788690143ccSmrg   if test "x$DOXYGEN" = "x"; then
789690143ccSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
790690143ccSmrg   fi
791690143ccSmrg   have_doxygen=yes
792690143ccSmrgelif test "x$use_doxygen" = x"no" ; then
793690143ccSmrg   if test "x$DOXYGEN" != "x"; then
794690143ccSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
795690143ccSmrg   fi
796690143ccSmrg   have_doxygen=no
797690143ccSmrgelse
798690143ccSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
7995fac8b10Smrgfi
800690143ccSmrgm4_ifval([$1],
801690143ccSmrg[if test "$have_doxygen" = yes; then
802690143ccSmrg    # scrape the doxygen version
803690143ccSmrg    AC_MSG_CHECKING([the doxygen version])
804690143ccSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
805690143ccSmrg    AC_MSG_RESULT([$doxygen_version])
806690143ccSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
807690143ccSmrg        [if test "x$use_doxygen" = xauto; then
808690143ccSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
809690143ccSmrg            have_doxygen=no
810690143ccSmrg        else
811690143ccSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
812690143ccSmrg        fi])
813690143ccSmrgfi])
814690143ccSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
815690143ccSmrg]) # XORG_WITH_DOXYGEN
816f46a6179Smrg
817690143ccSmrg# XORG_WITH_GROFF([DEFAULT])
818690143ccSmrg# ----------------
819690143ccSmrg# Minimum version: 1.6.0
820690143ccSmrg# Minimum version for optional DEFAULT argument: 1.11.0
821f46a6179Smrg#
822690143ccSmrg# Documentation tools are not always available on all platforms and sometimes
823690143ccSmrg# not at the appropriate level. This macro enables a module to test for the
824690143ccSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
825690143ccSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
826690143ccSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
827690143ccSmrg# --with-groff assumes 'auto'.
828690143ccSmrg#
829690143ccSmrg# Interface to module:
830690143ccSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
831690143ccSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
832690143ccSmrg# HAVE_GROFF_MS: the -ms macros package
833690143ccSmrg# GROFF:	 returns the path of the groff program found
834690143ccSmrg#		 returns the path set by the user in the environment
835690143ccSmrg# --with-groff:	 'yes' user instructs the module to use groff
836690143ccSmrg#		 'no' user instructs the module not to use groff
837690143ccSmrg#
838690143ccSmrg# Added in version 1.9.0:
839690143ccSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
840690143ccSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
841690143ccSmrg#		   psselect from the psutils package.
842690143ccSmrg#		   the ghostcript package. Refer to the grohtml man pages
843690143ccSmrg#
844690143ccSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
845690143ccSmrg#
846690143ccSmrg# OS and distros often splits groff in a basic and full package, the former
847690143ccSmrg# having the groff program and the later having devices, fonts and macros
848690143ccSmrg# Checking for the groff executable is not enough.
849690143ccSmrg#
850690143ccSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
851690143ccSmrg# unset HAVE_GROFF or GROFF env variables.
852690143ccSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
853690143ccSmrg#
854690143ccSmrgAC_DEFUN([XORG_WITH_GROFF],[
855690143ccSmrgAC_ARG_VAR([GROFF], [Path to groff command])
856690143ccSmrgm4_define([_defopt], m4_default([$1], [auto]))
857690143ccSmrgAC_ARG_WITH(groff,
858690143ccSmrg	AS_HELP_STRING([--with-groff],
859690143ccSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
860690143ccSmrg	   [use_groff=$withval], [use_groff=]_defopt)
861690143ccSmrgm4_undefine([_defopt])
8625fac8b10Smrg
863690143ccSmrgif test "x$use_groff" = x"auto"; then
864690143ccSmrg   AC_PATH_PROG([GROFF], [groff])
865690143ccSmrg   if test "x$GROFF" = "x"; then
866690143ccSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
867690143ccSmrg	have_groff=no
868690143ccSmrg   else
869690143ccSmrg        have_groff=yes
870690143ccSmrg   fi
871690143ccSmrgelif test "x$use_groff" = x"yes" ; then
872690143ccSmrg   AC_PATH_PROG([GROFF], [groff])
873690143ccSmrg   if test "x$GROFF" = "x"; then
874690143ccSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
875690143ccSmrg   fi
876690143ccSmrg   have_groff=yes
877690143ccSmrgelif test "x$use_groff" = x"no" ; then
878690143ccSmrg   if test "x$GROFF" != "x"; then
879690143ccSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
880690143ccSmrg   fi
881690143ccSmrg   have_groff=no
882f46a6179Smrgelse
883690143ccSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
884f46a6179Smrgfi
885f46a6179Smrg
886690143ccSmrg# We have groff, test for the presence of the macro packages
887690143ccSmrgif test "x$have_groff" = x"yes"; then
888690143ccSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
889690143ccSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
890690143ccSmrg        groff_ms_works=yes
891690143ccSmrg    else
892690143ccSmrg        groff_ms_works=no
893690143ccSmrg    fi
894690143ccSmrg    AC_MSG_RESULT([$groff_ms_works])
895690143ccSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
896690143ccSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
897690143ccSmrg        groff_mm_works=yes
898690143ccSmrg    else
899690143ccSmrg        groff_mm_works=no
900690143ccSmrg    fi
901690143ccSmrg    AC_MSG_RESULT([$groff_mm_works])
902690143ccSmrgfi
903f46a6179Smrg
904690143ccSmrg# We have groff, test for HTML dependencies, one command per package
905690143ccSmrgif test "x$have_groff" = x"yes"; then
906690143ccSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
907690143ccSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
908690143ccSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
909690143ccSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
910690143ccSmrg      have_groff_html=yes
911690143ccSmrg   else
912690143ccSmrg      have_groff_html=no
913690143ccSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
914690143ccSmrg   fi
915690143ccSmrgfi
916f46a6179Smrg
917690143ccSmrg# Set Automake conditionals for Makefiles
918690143ccSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
919690143ccSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
920690143ccSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
921690143ccSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
922690143ccSmrg]) # XORG_WITH_GROFF
923f46a6179Smrg
924690143ccSmrg# XORG_WITH_FOP([DEFAULT])
925690143ccSmrg# ----------------
926690143ccSmrg# Minimum version: 1.6.0
927690143ccSmrg# Minimum version for optional DEFAULT argument: 1.11.0
928f46a6179Smrg#
929690143ccSmrg# Documentation tools are not always available on all platforms and sometimes
930690143ccSmrg# not at the appropriate level. This macro enables a module to test for the
931690143ccSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
932690143ccSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
933690143ccSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
934690143ccSmrg# --with-fop assumes 'auto'.
9355fac8b10Smrg#
936690143ccSmrg# Interface to module:
937690143ccSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
938690143ccSmrg# FOP:	 	returns the path of the fop program found
939690143ccSmrg#		returns the path set by the user in the environment
940690143ccSmrg# --with-fop: 	'yes' user instructs the module to use fop
941690143ccSmrg#		'no' user instructs the module not to use fop
942690143ccSmrg#
943690143ccSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
944690143ccSmrg#
945690143ccSmrgAC_DEFUN([XORG_WITH_FOP],[
946690143ccSmrgAC_ARG_VAR([FOP], [Path to fop command])
947690143ccSmrgm4_define([_defopt], m4_default([$1], [auto]))
948690143ccSmrgAC_ARG_WITH(fop,
949690143ccSmrg	AS_HELP_STRING([--with-fop],
950690143ccSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
951690143ccSmrg	   [use_fop=$withval], [use_fop=]_defopt)
952690143ccSmrgm4_undefine([_defopt])
953f46a6179Smrg
954690143ccSmrgif test "x$use_fop" = x"auto"; then
955690143ccSmrg   AC_PATH_PROG([FOP], [fop])
956690143ccSmrg   if test "x$FOP" = "x"; then
957690143ccSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
958690143ccSmrg	have_fop=no
959690143ccSmrg   else
960690143ccSmrg        have_fop=yes
9615fac8b10Smrg   fi
962690143ccSmrgelif test "x$use_fop" = x"yes" ; then
963690143ccSmrg   AC_PATH_PROG([FOP], [fop])
964690143ccSmrg   if test "x$FOP" = "x"; then
965690143ccSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
9665fac8b10Smrg   fi
967690143ccSmrg   have_fop=yes
968690143ccSmrgelif test "x$use_fop" = x"no" ; then
969690143ccSmrg   if test "x$FOP" != "x"; then
970690143ccSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
971690143ccSmrg   fi
972690143ccSmrg   have_fop=no
9735fac8b10Smrgelse
974690143ccSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
9755fac8b10Smrgfi
976690143ccSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
977690143ccSmrg]) # XORG_WITH_FOP
978f46a6179Smrg
979690143ccSmrg# XORG_WITH_PS2PDF([DEFAULT])
980690143ccSmrg# ----------------
981690143ccSmrg# Minimum version: 1.6.0
982690143ccSmrg# Minimum version for optional DEFAULT argument: 1.11.0
983f46a6179Smrg#
984690143ccSmrg# Documentation tools are not always available on all platforms and sometimes
985690143ccSmrg# not at the appropriate level. This macro enables a module to test for the
986690143ccSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
987690143ccSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
988690143ccSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
989690143ccSmrg# --with-ps2pdf assumes 'auto'.
990f46a6179Smrg#
991690143ccSmrg# Interface to module:
992690143ccSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
993690143ccSmrg# PS2PDF:	returns the path of the ps2pdf program found
994690143ccSmrg#		returns the path set by the user in the environment
995690143ccSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
996690143ccSmrg#		 'no' user instructs the module not to use ps2pdf
997690143ccSmrg#
998690143ccSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
999690143ccSmrg#
1000690143ccSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1001690143ccSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1002690143ccSmrgm4_define([_defopt], m4_default([$1], [auto]))
1003690143ccSmrgAC_ARG_WITH(ps2pdf,
1004690143ccSmrg	AS_HELP_STRING([--with-ps2pdf],
1005690143ccSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1006690143ccSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1007690143ccSmrgm4_undefine([_defopt])
1008f46a6179Smrg
1009690143ccSmrgif test "x$use_ps2pdf" = x"auto"; then
1010690143ccSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1011690143ccSmrg   if test "x$PS2PDF" = "x"; then
1012690143ccSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1013690143ccSmrg	have_ps2pdf=no
1014690143ccSmrg   else
1015690143ccSmrg        have_ps2pdf=yes
1016690143ccSmrg   fi
1017690143ccSmrgelif test "x$use_ps2pdf" = x"yes" ; then
1018690143ccSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1019690143ccSmrg   if test "x$PS2PDF" = "x"; then
1020690143ccSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1021690143ccSmrg   fi
1022690143ccSmrg   have_ps2pdf=yes
1023690143ccSmrgelif test "x$use_ps2pdf" = x"no" ; then
1024690143ccSmrg   if test "x$PS2PDF" != "x"; then
1025690143ccSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1026690143ccSmrg   fi
1027690143ccSmrg   have_ps2pdf=no
1028690143ccSmrgelse
1029690143ccSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10305fac8b10Smrgfi
1031690143ccSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1032690143ccSmrg]) # XORG_WITH_PS2PDF
1033f46a6179Smrg
1034690143ccSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
1035690143ccSmrg# ----------------
1036690143ccSmrg# Minimum version: 1.6.0
1037f46a6179Smrg#
1038690143ccSmrg# Documentation tools are not always available on all platforms and sometimes
1039690143ccSmrg# not at the appropriate level. This macro enables a builder to skip all
1040690143ccSmrg# documentation targets except traditional man pages.
1041690143ccSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1042690143ccSmrg# maximum flexibilty in controlling documentation building.
1043690143ccSmrg# Refer to:
1044690143ccSmrg# XORG_WITH_XMLTO         --with-xmlto
1045690143ccSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1046690143ccSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1047690143ccSmrg# XORG_WITH_FOP           --with-fop
1048690143ccSmrg# XORG_WITH_GROFF         --with-groff
1049690143ccSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10505fac8b10Smrg#
1051690143ccSmrg# Interface to module:
1052690143ccSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1053690143ccSmrg# --enable-docs: 'yes' user instructs the module to generate docs
1054690143ccSmrg#		 'no' user instructs the module not to generate docs
1055690143ccSmrg# parm1:	specify the default value, yes or no.
1056690143ccSmrg#
1057690143ccSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1058690143ccSmrgm4_define([docs_default], m4_default([$1], [yes]))
1059690143ccSmrgAC_ARG_ENABLE(docs,
1060690143ccSmrg	AS_HELP_STRING([--enable-docs],
1061690143ccSmrg	   [Enable building the documentation (default: ]docs_default[)]),
1062690143ccSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
1063690143ccSmrgm4_undefine([docs_default])
1064690143ccSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1065690143ccSmrgAC_MSG_CHECKING([whether to build documentation])
1066690143ccSmrgAC_MSG_RESULT([$build_docs])
1067690143ccSmrg]) # XORG_ENABLE_DOCS
1068f46a6179Smrg
1069690143ccSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1070690143ccSmrg# ----------------
1071690143ccSmrg# Minimum version: 1.6.0
10725fac8b10Smrg#
1073690143ccSmrg# This macro enables a builder to skip all developer documentation.
1074690143ccSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1075690143ccSmrg# maximum flexibilty in controlling documentation building.
1076690143ccSmrg# Refer to:
1077690143ccSmrg# XORG_WITH_XMLTO         --with-xmlto
1078690143ccSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1079690143ccSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1080690143ccSmrg# XORG_WITH_FOP           --with-fop
1081690143ccSmrg# XORG_WITH_GROFF         --with-groff
1082690143ccSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10835fac8b10Smrg#
1084690143ccSmrg# Interface to module:
1085690143ccSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1086690143ccSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1087690143ccSmrg#			'no' user instructs the module not to generate developer docs
1088690143ccSmrg# parm1:		specify the default value, yes or no.
1089690143ccSmrg#
1090690143ccSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1091690143ccSmrgm4_define([devel_default], m4_default([$1], [yes]))
1092690143ccSmrgAC_ARG_ENABLE(devel-docs,
1093690143ccSmrg	AS_HELP_STRING([--enable-devel-docs],
1094690143ccSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1095690143ccSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1096690143ccSmrgm4_undefine([devel_default])
1097690143ccSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1098690143ccSmrgAC_MSG_CHECKING([whether to build developer documentation])
1099690143ccSmrgAC_MSG_RESULT([$build_devel_docs])
1100690143ccSmrg]) # XORG_ENABLE_DEVEL_DOCS
1101f46a6179Smrg
1102690143ccSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
1103690143ccSmrg# ----------------
1104690143ccSmrg# Minimum version: 1.6.0
1105690143ccSmrg#
1106690143ccSmrg# This macro enables a builder to skip all functional specification targets.
1107690143ccSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1108690143ccSmrg# maximum flexibilty in controlling documentation building.
1109690143ccSmrg# Refer to:
1110690143ccSmrg# XORG_WITH_XMLTO         --with-xmlto
1111690143ccSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1112690143ccSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1113690143ccSmrg# XORG_WITH_FOP           --with-fop
1114690143ccSmrg# XORG_WITH_GROFF         --with-groff
1115690143ccSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1116690143ccSmrg#
1117690143ccSmrg# Interface to module:
1118690143ccSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1119690143ccSmrg# --enable-specs:	'yes' user instructs the module to generate specs
1120690143ccSmrg#			'no' user instructs the module not to generate specs
1121690143ccSmrg# parm1:		specify the default value, yes or no.
1122690143ccSmrg#
1123690143ccSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1124690143ccSmrgm4_define([spec_default], m4_default([$1], [yes]))
1125690143ccSmrgAC_ARG_ENABLE(specs,
1126690143ccSmrg	AS_HELP_STRING([--enable-specs],
1127690143ccSmrg	   [Enable building the specs (default: ]spec_default[)]),
1128690143ccSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
1129690143ccSmrgm4_undefine([spec_default])
1130690143ccSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1131690143ccSmrgAC_MSG_CHECKING([whether to build functional specifications])
1132690143ccSmrgAC_MSG_RESULT([$build_specs])
1133690143ccSmrg]) # XORG_ENABLE_SPECS
113434345a63Smrg
1135690143ccSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
1136690143ccSmrg# ----------------------------------------------
1137690143ccSmrg# Minimum version: 1.13.0
1138690143ccSmrg#
1139690143ccSmrg# This macro enables a builder to enable/disable unit testing
1140690143ccSmrg# It makes no assumption about the test cases implementation
1141690143ccSmrg# Test cases may or may not use Automake "Support for test suites"
1142690143ccSmrg# They may or may not use the software utility library GLib
1143690143ccSmrg#
1144690143ccSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
1145690143ccSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
1146690143ccSmrg# The variable enable_unit_tests is used by other macros in this file.
1147690143ccSmrg#
1148690143ccSmrg# Interface to module:
1149690143ccSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
1150690143ccSmrg# enable_unit_tests:    used in configure.ac for additional configuration
1151690143ccSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
1152690143ccSmrg#			'no' user instructs the module not to build tests
1153690143ccSmrg# parm1:		specify the default value, yes or no.
1154690143ccSmrg#
1155690143ccSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
1156690143ccSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
1157690143ccSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
1158690143ccSmrgm4_define([_defopt], m4_default([$1], [auto]))
1159690143ccSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
1160690143ccSmrg	[Enable building unit test cases (default: ]_defopt[)]),
1161690143ccSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
1162690143ccSmrgm4_undefine([_defopt])
1163690143ccSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
1164690143ccSmrgAC_MSG_CHECKING([whether to build unit test cases])
1165690143ccSmrgAC_MSG_RESULT([$enable_unit_tests])
1166690143ccSmrg]) # XORG_ENABLE_UNIT_TESTS
1167690143ccSmrg
1168690143ccSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
1169690143ccSmrg# ----------------------------------------
1170690143ccSmrg# Minimum version: 1.13.0
1171690143ccSmrg#
1172690143ccSmrg# GLib is a library which provides advanced data structures and functions.
1173690143ccSmrg# This macro enables a module to test for the presence of Glib.
1174690143ccSmrg#
1175690143ccSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
1176690143ccSmrg# Otherwise the value of $enable_unit_tests is blank.
1177690143ccSmrg#
1178690143ccSmrg# Interface to module:
1179690143ccSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
1180690143ccSmrg# with_glib: used in configure.ac to know if GLib has been found
1181690143ccSmrg# --with-glib:	'yes' user instructs the module to use glib
1182690143ccSmrg#		'no' user instructs the module not to use glib
1183690143ccSmrg#
1184690143ccSmrgAC_DEFUN([XORG_WITH_GLIB],[
1185690143ccSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1186690143ccSmrgm4_define([_defopt], m4_default([$2], [auto]))
1187690143ccSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
1188690143ccSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
1189690143ccSmrg	[with_glib=$withval], [with_glib=]_defopt)
1190690143ccSmrgm4_undefine([_defopt])
1191690143ccSmrg
1192690143ccSmrghave_glib=no
1193690143ccSmrg# Do not probe GLib if user explicitly disabled unit testing
1194690143ccSmrgif test "x$enable_unit_tests" != x"no"; then
1195690143ccSmrg  # Do not probe GLib if user explicitly disabled it
1196690143ccSmrg  if test "x$with_glib" != x"no"; then
1197690143ccSmrg    m4_ifval(
1198690143ccSmrg      [$1],
1199690143ccSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1200690143ccSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1201690143ccSmrg    )
12025fac8b10Smrg  fi
1203690143ccSmrgfi
1204f46a6179Smrg
1205690143ccSmrg# Not having GLib when unit testing has been explicitly requested is an error
1206690143ccSmrgif test "x$enable_unit_tests" = x"yes"; then
1207690143ccSmrg  if test "x$have_glib" = x"no"; then
1208690143ccSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1209690143ccSmrg  fi
1210690143ccSmrgfi
1211f46a6179Smrg
1212690143ccSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
1213690143ccSmrgif test "x$enable_unit_tests" = x"no"; then
1214690143ccSmrg  if test "x$with_glib" = x"yes"; then
1215690143ccSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1216690143ccSmrg  fi
1217690143ccSmrgfi
1218f46a6179Smrg
1219690143ccSmrg# Not having GLib when it has been explicitly requested is an error
1220690143ccSmrgif test "x$with_glib" = x"yes"; then
1221690143ccSmrg  if test "x$have_glib" = x"no"; then
1222690143ccSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1223690143ccSmrg  fi
1224690143ccSmrgfi
1225690143ccSmrg
1226690143ccSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1227690143ccSmrg]) # XORG_WITH_GLIB
1228690143ccSmrg
1229690143ccSmrg# XORG_LD_WRAP
1230690143ccSmrg# ------------
1231690143ccSmrg# Minimum version: 1.13.0
1232f46a6179Smrg#
1233690143ccSmrg# Check if linker supports -wrap, passed via compiler flags
12345fac8b10Smrg#
1235690143ccSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1236690143ccSmrg# Otherwise the value of $enable_unit_tests is blank.
12375fac8b10Smrg#
1238690143ccSmrgAC_DEFUN([XORG_LD_WRAP],[
1239690143ccSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no])
1240690143ccSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
1241690143ccSmrgif test "x$enable_unit_tests" = x"yes"; then
1242690143ccSmrg  if test "x$have_ld_wrap" = x"no"; then
1243690143ccSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1244690143ccSmrg  fi
1245690143ccSmrgfi
1246690143ccSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
12475fac8b10Smrg#
1248690143ccSmrg]) # XORG_LD_WRAP
12495fac8b10Smrg
1250690143ccSmrg# XORG_CHECK_LINKER_FLAGS
1251690143ccSmrg# -----------------------
1252690143ccSmrg# SYNOPSIS
1253690143ccSmrg#
1254690143ccSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
1255690143ccSmrg#
1256690143ccSmrg# DESCRIPTION
1257690143ccSmrg#
1258690143ccSmrg#   Check whether the given linker FLAGS work with the current language's
1259690143ccSmrg#   linker, or whether they give an error.
1260690143ccSmrg#
1261690143ccSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1262690143ccSmrg#   success/failure.
1263690143ccSmrg#
1264690143ccSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1265690143ccSmrg#
1266690143ccSmrg# LICENSE
1267690143ccSmrg#
1268690143ccSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1269690143ccSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1270690143ccSmrg#   Copyright (c) 2009 Matteo Frigo
1271690143ccSmrg#
1272690143ccSmrg#   This program is free software: you can redistribute it and/or modify it
1273690143ccSmrg#   under the terms of the GNU General Public License as published by the
1274690143ccSmrg#   Free Software Foundation, either version 3 of the License, or (at your
1275690143ccSmrg#   option) any later version.
1276690143ccSmrg#
1277690143ccSmrg#   This program is distributed in the hope that it will be useful, but
1278690143ccSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
1279690143ccSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1280690143ccSmrg#   Public License for more details.
1281690143ccSmrg#
1282690143ccSmrg#   You should have received a copy of the GNU General Public License along
1283690143ccSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
1284690143ccSmrg#
1285690143ccSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
1286690143ccSmrg#   gives unlimited permission to copy, distribute and modify the configure
1287690143ccSmrg#   scripts that are the output of Autoconf when processing the Macro. You
1288690143ccSmrg#   need not follow the terms of the GNU General Public License when using
1289690143ccSmrg#   or distributing such scripts, even though portions of the text of the
1290690143ccSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
1291690143ccSmrg#   all other use of the material that constitutes the Autoconf Macro.
1292690143ccSmrg#
1293690143ccSmrg#   This special exception to the GPL applies to versions of the Autoconf
1294690143ccSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
1295690143ccSmrg#   modified version of the Autoconf Macro, you may extend this special
1296690143ccSmrg#   exception to the GPL to apply to your modified version as well.#
1297690143ccSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1298690143ccSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
1299690143ccSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1300690143ccSmrgAS_LITERAL_IF([$1],
1301690143ccSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1302690143ccSmrg      ax_save_FLAGS=$LDFLAGS
1303690143ccSmrg      LDFLAGS="$1"
1304690143ccSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1305690143ccSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1306690143ccSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1307690143ccSmrg      LDFLAGS=$ax_save_FLAGS])],
1308690143ccSmrg  [ax_save_FLAGS=$LDFLAGS
1309690143ccSmrg   LDFLAGS="$1"
1310690143ccSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1311690143ccSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1312690143ccSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1313690143ccSmrg   LDFLAGS=$ax_save_FLAGS])
1314690143ccSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1315690143ccSmrgAC_MSG_RESULT($xorg_check_linker_flags)
1316690143ccSmrgif test "x$xorg_check_linker_flags" = xyes; then
1317690143ccSmrg	m4_default([$2], :)
1318690143ccSmrgelse
1319690143ccSmrg	m4_default([$3], :)
1320690143ccSmrgfi
1321690143ccSmrg]) # XORG_CHECK_LINKER_FLAGS
1322690143ccSmrg
1323690143ccSmrg# XORG_CHECK_MALLOC_ZERO
1324690143ccSmrg# ----------------------
13255fac8b10Smrg# Minimum version: 1.0.0
13265fac8b10Smrg#
1327690143ccSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1328690143ccSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1329690143ccSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1330690143ccSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1331690143ccSmrgAC_ARG_ENABLE(malloc0returnsnull,
1332690143ccSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1333690143ccSmrg		       [malloc(0) returns NULL (default: auto)]),
1334690143ccSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1335690143ccSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
13365fac8b10Smrg
1337690143ccSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1338690143ccSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1339690143ccSmrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
1340690143ccSmrg#include <stdlib.h>
1341690143ccSmrg],[
1342690143ccSmrg    char *m0, *r0, *c0, *p;
1343690143ccSmrg    m0 = malloc(0);
1344690143ccSmrg    p = malloc(10);
1345690143ccSmrg    r0 = realloc(p,0);
1346690143ccSmrg    c0 = calloc(0,10);
1347690143ccSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1348690143ccSmrg])],
1349690143ccSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1350690143ccSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
1351690143ccSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
13525fac8b10Smrgfi
1353690143ccSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1354f46a6179Smrg
1355690143ccSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1356690143ccSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1357690143ccSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1358690143ccSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
13595fac8b10Smrgelse
1360690143ccSmrg	MALLOC_ZERO_CFLAGS=""
1361690143ccSmrg	XMALLOC_ZERO_CFLAGS=""
1362690143ccSmrg	XTMALLOC_ZERO_CFLAGS=""
136334345a63Smrgfi
1364f46a6179Smrg
1365690143ccSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1366690143ccSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1367690143ccSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1368690143ccSmrg]) # XORG_CHECK_MALLOC_ZERO
1369690143ccSmrg
1370690143ccSmrg# XORG_WITH_LINT()
1371690143ccSmrg# ----------------
1372690143ccSmrg# Minimum version: 1.1.0
1373f46a6179Smrg#
1374690143ccSmrg# This macro enables the use of a tool that flags some suspicious and
1375690143ccSmrg# non-portable constructs (likely to be bugs) in C language source code.
1376690143ccSmrg# It will attempt to locate the tool and use appropriate options.
1377690143ccSmrg# There are various lint type tools on different platforms.
1378690143ccSmrg#
1379690143ccSmrg# Interface to module:
1380690143ccSmrg# LINT:		returns the path to the tool found on the platform
1381690143ccSmrg#		or the value set to LINT on the configure cmd line
1382690143ccSmrg#		also an Automake conditional
1383690143ccSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
1384690143ccSmrg#
1385690143ccSmrg# --with-lint:	'yes' user instructs the module to use lint
1386690143ccSmrg#		'no' user instructs the module not to use lint (default)
1387690143ccSmrg#
1388690143ccSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1389690143ccSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1390690143ccSmrg#
1391690143ccSmrgAC_DEFUN([XORG_WITH_LINT],[
1392f46a6179Smrg
1393690143ccSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1394690143ccSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1395690143ccSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1396690143ccSmrg		[Use a lint-style source code checker (default: disabled)])],
1397690143ccSmrg		[use_lint=$withval], [use_lint=no])
1398f46a6179Smrg
1399690143ccSmrg# Obtain platform specific info like program name and options
1400690143ccSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1401690143ccSmrgcase $host_os in
1402690143ccSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1403690143ccSmrg	lint_name=splint
1404690143ccSmrg	lint_options="-badflag"
1405690143ccSmrg	;;
1406690143ccSmrg  *freebsd* | *netbsd*)
1407690143ccSmrg	lint_name=lint
1408690143ccSmrg	lint_options="-u -b"
1409690143ccSmrg	;;
1410690143ccSmrg  *solaris*)
1411690143ccSmrg	lint_name=lint
1412690143ccSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1413690143ccSmrg	;;
1414690143ccSmrgesac
1415f46a6179Smrg
1416690143ccSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1417690143ccSmrgif test "x$use_lint" = x"yes" ; then
1418690143ccSmrg   AC_PATH_PROG([LINT], [$lint_name])
1419690143ccSmrg   if test "x$LINT" = "x"; then
1420690143ccSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1421690143ccSmrg   fi
1422690143ccSmrgelif test "x$use_lint" = x"no" ; then
1423690143ccSmrg   if test "x$LINT" != "x"; then
1424690143ccSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1425690143ccSmrg   fi
1426690143ccSmrgelse
1427690143ccSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
14285fac8b10Smrgfi
1429f46a6179Smrg
1430690143ccSmrg# User supplied flags override default flags
1431690143ccSmrgif test "x$LINT_FLAGS" != "x"; then
1432690143ccSmrg   lint_options=$LINT_FLAGS
14335fac8b10Smrgfi
1434f46a6179Smrg
1435690143ccSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1436690143ccSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1437f46a6179Smrg
1438690143ccSmrg]) # XORG_WITH_LINT
1439f46a6179Smrg
1440690143ccSmrg# XORG_LINT_LIBRARY(LIBNAME)
1441690143ccSmrg# --------------------------
1442690143ccSmrg# Minimum version: 1.1.0
1443690143ccSmrg#
1444690143ccSmrg# Sets up flags for building lint libraries for checking programs that call
1445690143ccSmrg# functions in the library.
1446690143ccSmrg#
1447690143ccSmrg# Interface to module:
1448690143ccSmrg# LINTLIB		- Automake variable with the name of lint library file to make
1449690143ccSmrg# MAKE_LINT_LIB		- Automake conditional
1450690143ccSmrg#
1451690143ccSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1452690143ccSmrg#			  - 'no' user instructs the module not to create a lint library (default)
1453f46a6179Smrg
1454690143ccSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1455690143ccSmrgAC_REQUIRE([XORG_WITH_LINT])
1456690143ccSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1457690143ccSmrg	[Create lint library (default: disabled)])],
1458690143ccSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1459f46a6179Smrg
1460690143ccSmrgif test "x$make_lint_lib" = x"yes" ; then
1461690143ccSmrg   LINTLIB=llib-l$1.ln
1462690143ccSmrg   if test "x$LINT" = "x"; then
1463690143ccSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1464690143ccSmrg   fi
1465690143ccSmrgelif test "x$make_lint_lib" != x"no" ; then
1466690143ccSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1467690143ccSmrgfi
146883e5f723Smrg
1469690143ccSmrgAC_SUBST(LINTLIB)
1470690143ccSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
147183e5f723Smrg
1472690143ccSmrg]) # XORG_LINT_LIBRARY
1473f46a6179Smrg
1474690143ccSmrg# XORG_COMPILER_BRAND
1475690143ccSmrg# -------------------
1476690143ccSmrg# Minimum version: 1.14.0
147783e5f723Smrg#
1478690143ccSmrg# Checks for various brands of compilers and sets flags as appropriate:
1479690143ccSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1480690143ccSmrg#   clang compiler - sets CLANGCC to "yes"
1481690143ccSmrg#   Intel compiler - sets INTELCC to "yes"
1482690143ccSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1483690143ccSmrg#
1484690143ccSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
1485690143ccSmrgAC_REQUIRE([AC_PROG_CC_C99])
1486690143ccSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1487690143ccSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1488690143ccSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1489690143ccSmrg]) # XORG_COMPILER_BRAND
149083e5f723Smrg
1491690143ccSmrg# XORG_CWARNFLAGS
1492690143ccSmrg# ---------------
1493690143ccSmrg# Minimum version: 1.2.0
1494690143ccSmrg#
1495690143ccSmrg# Defines CWARNFLAGS to enable C compiler warnings.
1496690143ccSmrg#
1497690143ccSmrgAC_DEFUN([XORG_CWARNFLAGS], [
1498690143ccSmrgAC_REQUIRE([AC_PROG_CC_C99])
1499690143ccSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1500690143ccSmrgif  test "x$GCC" = xyes ; then
1501690143ccSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1502690143ccSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1503690143ccSmrg-Wbad-function-cast -Wformat=2"
1504690143ccSmrg    case `$CC -dumpversion` in
1505690143ccSmrg    3.4.* | 4.*)
1506690143ccSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1507690143ccSmrg	;;
1508690143ccSmrg    esac
150983e5f723Smrgelse
1510690143ccSmrg    if test "x$SUNCC" = "xyes"; then
1511690143ccSmrg	CWARNFLAGS="-v"
1512690143ccSmrg    fi
151383e5f723Smrgfi
1514690143ccSmrgAC_SUBST(CWARNFLAGS)
1515690143ccSmrg]) # XORG_CWARNFLAGS
151683e5f723Smrg
1517690143ccSmrg# XORG_STRICT_OPTION
1518690143ccSmrg# -----------------------
1519690143ccSmrg# Minimum version: 1.3.0
15205fac8b10Smrg#
1521690143ccSmrg# Add configure option to enable strict compilation flags, such as treating
1522690143ccSmrg# warnings as fatal errors.
1523690143ccSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
1524690143ccSmrg# $CWARNFLAGS.
1525690143ccSmrg#
1526690143ccSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
1527690143ccSmrg# when strict compilation is unconditionally desired.
1528690143ccSmrgAC_DEFUN([XORG_STRICT_OPTION], [
1529690143ccSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
1530690143ccSmrgAC_REQUIRE([AC_PROG_CC_C99])
1531690143ccSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1532690143ccSmrgAC_REQUIRE([XORG_CWARNFLAGS])
1533f46a6179Smrg
1534690143ccSmrgAC_ARG_ENABLE(strict-compilation,
1535690143ccSmrg			  AS_HELP_STRING([--enable-strict-compilation],
1536690143ccSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1537690143ccSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1538690143ccSmrgif test "x$GCC" = xyes ; then
1539690143ccSmrg    STRICT_CFLAGS="-pedantic -Werror"
1540690143ccSmrg    # Add -Werror=attributes if supported (gcc 4.2 & later)
1541690143ccSmrg    AC_MSG_CHECKING([if $CC supports -Werror=attributes])
1542690143ccSmrg    save_CFLAGS="$CFLAGS"
1543690143ccSmrg    CFLAGS="$CFLAGS $STRICT_CFLAGS -Werror=attributes"
1544690143ccSmrg    AC_COMPILE_IFELSE([AC_LANG_SOURCE([return 0;])],
1545690143ccSmrg		      [STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
1546690143ccSmrg		       AC_MSG_RESULT([yes])],
1547690143ccSmrg		      [AC_MSG_RESULT([no])])
1548690143ccSmrg    CFLAGS="$save_CFLAGS"
1549690143ccSmrgelif test "x$SUNCC" = "xyes"; then
1550690143ccSmrg    STRICT_CFLAGS="-errwarn"
1551690143ccSmrgelif test "x$INTELCC" = "xyes"; then
1552690143ccSmrg    STRICT_CFLAGS="-Werror"
15535fac8b10Smrgfi
1554690143ccSmrgif test "x$STRICT_COMPILE" = "xyes"; then
1555690143ccSmrg    CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1556690143ccSmrgfi
1557690143ccSmrgAC_SUBST([STRICT_CFLAGS])
1558690143ccSmrgAC_SUBST([CWARNFLAGS])
1559690143ccSmrg]) # XORG_STRICT_OPTION
1560f46a6179Smrg
1561690143ccSmrg# XORG_DEFAULT_OPTIONS
1562690143ccSmrg# --------------------
1563690143ccSmrg# Minimum version: 1.3.0
15645fac8b10Smrg#
1565690143ccSmrg# Defines default options for X.Org modules.
1566690143ccSmrg#
1567690143ccSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1568690143ccSmrgAC_REQUIRE([AC_PROG_INSTALL])
1569690143ccSmrgXORG_CWARNFLAGS
1570690143ccSmrgXORG_STRICT_OPTION
1571690143ccSmrgXORG_RELEASE_VERSION
1572690143ccSmrgXORG_CHANGELOG
1573690143ccSmrgXORG_INSTALL
1574690143ccSmrgXORG_MANPAGE_SECTIONS
1575690143ccSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1576690143ccSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1577690143ccSmrg]) # XORG_DEFAULT_OPTIONS
157883e5f723Smrg
1579690143ccSmrg# XORG_INSTALL()
1580690143ccSmrg# ----------------
1581690143ccSmrg# Minimum version: 1.4.0
1582690143ccSmrg#
1583690143ccSmrg# Defines the variable INSTALL_CMD as the command to copy
1584690143ccSmrg# INSTALL from $prefix/share/util-macros.
1585690143ccSmrg#
1586690143ccSmrgAC_DEFUN([XORG_INSTALL], [
1587690143ccSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1588690143ccSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1589690143ccSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1590690143ccSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1591690143ccSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1592690143ccSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1593690143ccSmrgAC_SUBST([INSTALL_CMD])
1594690143ccSmrg]) # XORG_INSTALL
1595690143ccSmrgdnl Copyright 2005 Red Hat, Inc
1596690143ccSmrgdnl
1597690143ccSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1598690143ccSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1599690143ccSmrgdnl the above copyright notice appear in all copies and that both that
1600690143ccSmrgdnl copyright notice and this permission notice appear in supporting
1601690143ccSmrgdnl documentation.
1602690143ccSmrgdnl
1603690143ccSmrgdnl The above copyright notice and this permission notice shall be included
1604690143ccSmrgdnl in all copies or substantial portions of the Software.
1605690143ccSmrgdnl
1606690143ccSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1607690143ccSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1608690143ccSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1609690143ccSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1610690143ccSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1611690143ccSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1612690143ccSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1613690143ccSmrgdnl
1614690143ccSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1615690143ccSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1616690143ccSmrgdnl other dealings in this Software without prior written authorization
1617690143ccSmrgdnl from the copyright holders.
1618690143ccSmrgdnl
1619f46a6179Smrg
1620690143ccSmrg# XORG_RELEASE_VERSION
1621690143ccSmrg# --------------------
1622690143ccSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1623690143ccSmrg 
1624690143ccSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1625690143ccSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1626690143ccSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1627690143ccSmrg		[Major version of this package])
1628690143ccSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1629690143ccSmrg	if test "x$PVM" = "x"; then
1630690143ccSmrg		PVM="0"
1631690143ccSmrg	fi
1632690143ccSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1633690143ccSmrg		[$PVM],
1634690143ccSmrg		[Minor version of this package])
1635690143ccSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1636690143ccSmrg	if test "x$PVP" = "x"; then
1637690143ccSmrg		PVP="0"
1638690143ccSmrg	fi
1639690143ccSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1640690143ccSmrg		[$PVP],
1641690143ccSmrg		[Patch version of this package])
1642690143ccSmrg])
1643f46a6179Smrg
1644690143ccSmrg# XORG_CHANGELOG()
1645690143ccSmrg# ----------------
1646690143ccSmrg# Minimum version: 1.2.0
1647690143ccSmrg#
1648690143ccSmrg# Defines the variable CHANGELOG_CMD as the command to generate
1649690143ccSmrg# ChangeLog from git.
1650690143ccSmrg#
1651690143ccSmrg#
1652690143ccSmrgAC_DEFUN([XORG_CHANGELOG], [
1653690143ccSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1654690143ccSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1655690143ccSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1656690143ccSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1657690143ccSmrgAC_SUBST([CHANGELOG_CMD])
1658690143ccSmrg]) # XORG_CHANGELOG
1659f46a6179Smrg
1660690143ccSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
1661690143ccSmrg#
1662690143ccSmrg# This file is free software; the Free Software Foundation
1663690143ccSmrg# gives unlimited permission to copy and/or distribute it,
1664690143ccSmrg# with or without modifications, as long as this notice is preserved.
1665f46a6179Smrg
1666690143ccSmrg# AM_AUTOMAKE_VERSION(VERSION)
1667690143ccSmrg# ----------------------------
1668690143ccSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
1669690143ccSmrg# generated from the m4 files accompanying Automake X.Y.
1670690143ccSmrg# (This private macro should not be called outside this file.)
1671690143ccSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
1672690143ccSmrg[am__api_version='1.11'
1673690143ccSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1674690143ccSmrgdnl require some minimum version.  Point them to the right macro.
1675690143ccSmrgm4_if([$1], [1.11.1], [],
1676690143ccSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1677690143ccSmrg])
1678f46a6179Smrg
1679690143ccSmrg# _AM_AUTOCONF_VERSION(VERSION)
1680690143ccSmrg# -----------------------------
1681690143ccSmrg# aclocal traces this macro to find the Autoconf version.
1682690143ccSmrg# This is a private macro too.  Using m4_define simplifies
1683690143ccSmrg# the logic in aclocal, which can simply ignore this definition.
1684690143ccSmrgm4_define([_AM_AUTOCONF_VERSION], [])
1685f46a6179Smrg
1686690143ccSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
1687690143ccSmrg# -------------------------------
1688690143ccSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1689690143ccSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1690690143ccSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1691690143ccSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
1692690143ccSmrgm4_ifndef([AC_AUTOCONF_VERSION],
1693690143ccSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1694690143ccSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1695f46a6179Smrg
1696690143ccSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
169734345a63Smrg
1698690143ccSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
169983e5f723Smrg#
1700690143ccSmrg# This file is free software; the Free Software Foundation
1701690143ccSmrg# gives unlimited permission to copy and/or distribute it,
1702690143ccSmrg# with or without modifications, as long as this notice is preserved.
1703690143ccSmrg
1704690143ccSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1705690143ccSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
1706690143ccSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
170783e5f723Smrg#
1708690143ccSmrg# Of course, Automake must honor this variable whenever it calls a
1709690143ccSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
1710690143ccSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
1711690143ccSmrg# depending on how configure is run.  This is pretty annoying, since
1712690143ccSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
1713690143ccSmrg# source directory, any form will work fine, but in subdirectories a
1714690143ccSmrg# relative path needs to be adjusted first.
171583e5f723Smrg#
1716690143ccSmrg# $ac_aux_dir/missing
1717690143ccSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
1718690143ccSmrg# $top_srcdir/$ac_aux_dir/missing
1719690143ccSmrg#    fails if $ac_aux_dir is absolute,
1720690143ccSmrg#    fails when called from a subdirectory in a VPATH build with
1721690143ccSmrg#          a relative $ac_aux_dir
172283e5f723Smrg#
1723690143ccSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1724690143ccSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
1725690143ccSmrg# harmless because $srcdir is `.', but things will broke when you
1726690143ccSmrg# start a VPATH build or use an absolute $srcdir.
172783e5f723Smrg#
1728690143ccSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1729690143ccSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1730690143ccSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1731690143ccSmrg# and then we would define $MISSING as
1732690143ccSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
1733690143ccSmrg# This will work as long as MISSING is not called from configure, because
1734690143ccSmrg# unfortunately $(top_srcdir) has no meaning in configure.
1735690143ccSmrg# However there are other variables, like CC, which are often used in
1736690143ccSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1737690143ccSmrg#
1738690143ccSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
1739690143ccSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
1740690143ccSmrg# configured tree to be moved without reconfiguration.
1741690143ccSmrg
1742690143ccSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1743690143ccSmrg[dnl Rely on autoconf to set up CDPATH properly.
1744690143ccSmrgAC_PREREQ([2.50])dnl
1745690143ccSmrg# expand $ac_aux_dir to an absolute path
1746690143ccSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
1747690143ccSmrg])
1748690143ccSmrg
1749690143ccSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1750690143ccSmrg
1751690143ccSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1752690143ccSmrg# Free Software Foundation, Inc.
1753690143ccSmrg#
1754690143ccSmrg# This file is free software; the Free Software Foundation
1755690143ccSmrg# gives unlimited permission to copy and/or distribute it,
1756690143ccSmrg# with or without modifications, as long as this notice is preserved.
1757690143ccSmrg
1758690143ccSmrg# serial 9
1759690143ccSmrg
1760690143ccSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1761690143ccSmrg# -------------------------------------
1762690143ccSmrg# Define a conditional.
1763690143ccSmrgAC_DEFUN([AM_CONDITIONAL],
1764690143ccSmrg[AC_PREREQ(2.52)dnl
1765690143ccSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1766690143ccSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1767690143ccSmrgAC_SUBST([$1_TRUE])dnl
1768690143ccSmrgAC_SUBST([$1_FALSE])dnl
1769690143ccSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1770690143ccSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1771690143ccSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1772690143ccSmrgif $2; then
1773690143ccSmrg  $1_TRUE=
1774690143ccSmrg  $1_FALSE='#'
177583e5f723Smrgelse
1776690143ccSmrg  $1_TRUE='#'
1777690143ccSmrg  $1_FALSE=
177883e5f723Smrgfi
1779690143ccSmrgAC_CONFIG_COMMANDS_PRE(
1780690143ccSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1781690143ccSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1782690143ccSmrgUsually this means the macro was only invoked conditionally.]])
1783690143ccSmrgfi])])
178483e5f723Smrg
1785690143ccSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1786690143ccSmrg# Free Software Foundation, Inc.
1787690143ccSmrg#
1788690143ccSmrg# This file is free software; the Free Software Foundation
1789690143ccSmrg# gives unlimited permission to copy and/or distribute it,
1790690143ccSmrg# with or without modifications, as long as this notice is preserved.
179183e5f723Smrg
1792690143ccSmrg# serial 10
179383e5f723Smrg
1794690143ccSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1795690143ccSmrg# written in clear, in which case automake, when reading aclocal.m4,
1796690143ccSmrg# will think it sees a *use*, and therefore will trigger all it's
1797690143ccSmrg# C support machinery.  Also note that it means that autoscan, seeing
1798690143ccSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1799690143ccSmrg
1800690143ccSmrg
1801690143ccSmrg# _AM_DEPENDENCIES(NAME)
1802690143ccSmrg# ----------------------
1803690143ccSmrg# See how the compiler implements dependency checking.
1804690143ccSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
1805690143ccSmrg# We try a few techniques and use that to set a single cache variable.
180683e5f723Smrg#
1807690143ccSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1808690143ccSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1809690143ccSmrg# dependency, and given that the user is not expected to run this macro,
1810690143ccSmrg# just rely on AC_PROG_CC.
1811690143ccSmrgAC_DEFUN([_AM_DEPENDENCIES],
1812690143ccSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1813690143ccSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1814690143ccSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1815690143ccSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1816690143ccSmrg
1817690143ccSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1818690143ccSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1819690143ccSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1820690143ccSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1821690143ccSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1822690143ccSmrg                   [depcc="$$1"   am_compiler_list=])
1823690143ccSmrg
1824690143ccSmrgAC_CACHE_CHECK([dependency style of $depcc],
1825690143ccSmrg               [am_cv_$1_dependencies_compiler_type],
1826690143ccSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1827690143ccSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1828690143ccSmrg  # making bogus files that we don't know about and never remove.  For
1829690143ccSmrg  # instance it was reported that on HP-UX the gcc test will end up
1830690143ccSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
1831690143ccSmrg  # in D'.
1832690143ccSmrg  mkdir conftest.dir
1833690143ccSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1834690143ccSmrg  # using a relative directory.
1835690143ccSmrg  cp "$am_depcomp" conftest.dir
1836690143ccSmrg  cd conftest.dir
1837690143ccSmrg  # We will build objects and dependencies in a subdirectory because
1838690143ccSmrg  # it helps to detect inapplicable dependency modes.  For instance
1839690143ccSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1840690143ccSmrg  # side effect of compilation, but ICC will put the dependencies in
1841690143ccSmrg  # the current directory while Tru64 will put them in the object
1842690143ccSmrg  # directory.
1843690143ccSmrg  mkdir sub
1844690143ccSmrg
1845690143ccSmrg  am_cv_$1_dependencies_compiler_type=none
1846690143ccSmrg  if test "$am_compiler_list" = ""; then
1847690143ccSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1848690143ccSmrg  fi
1849690143ccSmrg  am__universal=false
1850690143ccSmrg  m4_case([$1], [CC],
1851690143ccSmrg    [case " $depcc " in #(
1852690143ccSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1853690143ccSmrg     esac],
1854690143ccSmrg    [CXX],
1855690143ccSmrg    [case " $depcc " in #(
1856690143ccSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1857690143ccSmrg     esac])
1858690143ccSmrg
1859690143ccSmrg  for depmode in $am_compiler_list; do
1860690143ccSmrg    # Setup a source with many dependencies, because some compilers
1861690143ccSmrg    # like to wrap large dependency lists on column 80 (with \), and
1862690143ccSmrg    # we should not choose a depcomp mode which is confused by this.
1863690143ccSmrg    #
1864690143ccSmrg    # We need to recreate these files for each test, as the compiler may
1865690143ccSmrg    # overwrite some of them when testing with obscure command lines.
1866690143ccSmrg    # This happens at least with the AIX C compiler.
1867690143ccSmrg    : > sub/conftest.c
1868690143ccSmrg    for i in 1 2 3 4 5 6; do
1869690143ccSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
1870690143ccSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1871690143ccSmrg      # Solaris 8's {/usr,}/bin/sh.
1872690143ccSmrg      touch sub/conftst$i.h
1873690143ccSmrg    done
1874690143ccSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1875690143ccSmrg
1876690143ccSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
1877690143ccSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
1878690143ccSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
1879690143ccSmrg    # versions had trouble with output in subdirs
1880690143ccSmrg    am__obj=sub/conftest.${OBJEXT-o}
1881690143ccSmrg    am__minus_obj="-o $am__obj"
1882690143ccSmrg    case $depmode in
1883690143ccSmrg    gcc)
1884690143ccSmrg      # This depmode causes a compiler race in universal mode.
1885690143ccSmrg      test "$am__universal" = false || continue
1886690143ccSmrg      ;;
1887690143ccSmrg    nosideeffect)
1888690143ccSmrg      # after this tag, mechanisms are not by side-effect, so they'll
1889690143ccSmrg      # only be used when explicitly requested
1890690143ccSmrg      if test "x$enable_dependency_tracking" = xyes; then
1891690143ccSmrg	continue
1892690143ccSmrg      else
1893690143ccSmrg	break
1894690143ccSmrg      fi
1895690143ccSmrg      ;;
1896690143ccSmrg    msvisualcpp | msvcmsys)
1897690143ccSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
1898690143ccSmrg      # not run yet.  These depmodes are late enough in the game, and
1899690143ccSmrg      # so weak that their functioning should not be impacted.
1900690143ccSmrg      am__obj=conftest.${OBJEXT-o}
1901690143ccSmrg      am__minus_obj=
1902690143ccSmrg      ;;
1903690143ccSmrg    none) break ;;
1904690143ccSmrg    esac
1905690143ccSmrg    if depmode=$depmode \
1906690143ccSmrg       source=sub/conftest.c object=$am__obj \
1907690143ccSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1908690143ccSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1909690143ccSmrg         >/dev/null 2>conftest.err &&
1910690143ccSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1911690143ccSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1912690143ccSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1913690143ccSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1914690143ccSmrg      # icc doesn't choke on unknown options, it will just issue warnings
1915690143ccSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
1916690143ccSmrg      # that says an option was ignored or not supported.
1917690143ccSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
1918690143ccSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
1919690143ccSmrg      # The diagnosis changed in icc 8.0:
1920690143ccSmrg      #   icc: Command line remark: option '-MP' not supported
1921690143ccSmrg      if (grep 'ignoring option' conftest.err ||
1922690143ccSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1923690143ccSmrg        am_cv_$1_dependencies_compiler_type=$depmode
1924690143ccSmrg        break
1925690143ccSmrg      fi
1926690143ccSmrg    fi
1927690143ccSmrg  done
1928690143ccSmrg
1929690143ccSmrg  cd ..
1930690143ccSmrg  rm -rf conftest.dir
1931690143ccSmrgelse
1932690143ccSmrg  am_cv_$1_dependencies_compiler_type=none
1933690143ccSmrgfi
1934690143ccSmrg])
1935690143ccSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1936690143ccSmrgAM_CONDITIONAL([am__fastdep$1], [
1937690143ccSmrg  test "x$enable_dependency_tracking" != xno \
1938690143ccSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1939690143ccSmrg])
1940690143ccSmrg
1941690143ccSmrg
1942690143ccSmrg# AM_SET_DEPDIR
1943690143ccSmrg# -------------
1944690143ccSmrg# Choose a directory name for dependency files.
1945690143ccSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
1946690143ccSmrgAC_DEFUN([AM_SET_DEPDIR],
1947690143ccSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1948690143ccSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1949690143ccSmrg])
1950690143ccSmrg
1951690143ccSmrg
1952690143ccSmrg# AM_DEP_TRACK
1953690143ccSmrg# ------------
1954690143ccSmrgAC_DEFUN([AM_DEP_TRACK],
1955690143ccSmrg[AC_ARG_ENABLE(dependency-tracking,
1956690143ccSmrg[  --disable-dependency-tracking  speeds up one-time build
1957690143ccSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
1958690143ccSmrgif test "x$enable_dependency_tracking" != xno; then
1959690143ccSmrg  am_depcomp="$ac_aux_dir/depcomp"
1960690143ccSmrg  AMDEPBACKSLASH='\'
1961690143ccSmrgfi
1962690143ccSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1963690143ccSmrgAC_SUBST([AMDEPBACKSLASH])dnl
1964690143ccSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1965690143ccSmrg])
1966690143ccSmrg
1967690143ccSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
1968690143ccSmrg
1969690143ccSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1970690143ccSmrg# Free Software Foundation, Inc.
197183e5f723Smrg#
1972690143ccSmrg# This file is free software; the Free Software Foundation
1973690143ccSmrg# gives unlimited permission to copy and/or distribute it,
1974690143ccSmrg# with or without modifications, as long as this notice is preserved.
1975690143ccSmrg
1976690143ccSmrg#serial 5
1977690143ccSmrg
1978690143ccSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
1979690143ccSmrg# ------------------------------
1980690143ccSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1981690143ccSmrg[{
1982690143ccSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
1983690143ccSmrg  # are listed without --file.  Let's play safe and only enable the eval
1984690143ccSmrg  # if we detect the quoting.
1985690143ccSmrg  case $CONFIG_FILES in
1986690143ccSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
1987690143ccSmrg  *)   set x $CONFIG_FILES ;;
1988690143ccSmrg  esac
1989690143ccSmrg  shift
1990690143ccSmrg  for mf
1991690143ccSmrg  do
1992690143ccSmrg    # Strip MF so we end up with the name of the file.
1993690143ccSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
1994690143ccSmrg    # Check whether this is an Automake generated Makefile or not.
1995690143ccSmrg    # We used to match only the files named `Makefile.in', but
1996690143ccSmrg    # some people rename them; so instead we look at the file content.
1997690143ccSmrg    # Grep'ing the first line is not enough: some people post-process
1998690143ccSmrg    # each Makefile.in and add a new line on top of each file to say so.
1999690143ccSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
2000690143ccSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
2001690143ccSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
2002690143ccSmrg      dirpart=`AS_DIRNAME("$mf")`
2003690143ccSmrg    else
2004690143ccSmrg      continue
2005690143ccSmrg    fi
2006690143ccSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
2007690143ccSmrg    # from the Makefile without running `make'.
2008690143ccSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
2009690143ccSmrg    test -z "$DEPDIR" && continue
2010690143ccSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
2011690143ccSmrg    test -z "am__include" && continue
2012690143ccSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
2013690143ccSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
2014690143ccSmrg    U=`sed -n 's/^U = //p' < "$mf"`
2015690143ccSmrg    # Find all dependency output files, they are included files with
2016690143ccSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
2017690143ccSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
2018690143ccSmrg    # expansion.
2019690143ccSmrg    for file in `sed -n "
2020690143ccSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
2021690143ccSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
2022690143ccSmrg      # Make sure the directory exists.
2023690143ccSmrg      test -f "$dirpart/$file" && continue
2024690143ccSmrg      fdir=`AS_DIRNAME(["$file"])`
2025690143ccSmrg      AS_MKDIR_P([$dirpart/$fdir])
2026690143ccSmrg      # echo "creating $dirpart/$file"
2027690143ccSmrg      echo '# dummy' > "$dirpart/$file"
2028690143ccSmrg    done
2029690143ccSmrg  done
2030690143ccSmrg}
2031690143ccSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2032690143ccSmrg
2033690143ccSmrg
2034690143ccSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
2035690143ccSmrg# -----------------------------
2036690143ccSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
203783e5f723Smrg#
2038690143ccSmrg# This code is only required when automatic dependency tracking
2039690143ccSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
2040690143ccSmrg# need in order to bootstrap the dependency handling code.
2041690143ccSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
2042690143ccSmrg[AC_CONFIG_COMMANDS([depfiles],
2043690143ccSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2044690143ccSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2045690143ccSmrg])
2046690143ccSmrg
2047690143ccSmrg# Do all the work for Automake.                             -*- Autoconf -*-
2048690143ccSmrg
2049690143ccSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2050690143ccSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
205183e5f723Smrg#
2052690143ccSmrg# This file is free software; the Free Software Foundation
2053690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2054690143ccSmrg# with or without modifications, as long as this notice is preserved.
205583e5f723Smrg
2056690143ccSmrg# serial 16
2057690143ccSmrg
2058690143ccSmrg# This macro actually does too much.  Some checks are only needed if
2059690143ccSmrg# your package does certain things.  But this isn't really a big deal.
2060690143ccSmrg
2061690143ccSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
2062690143ccSmrg# AM_INIT_AUTOMAKE([OPTIONS])
2063690143ccSmrg# -----------------------------------------------
2064690143ccSmrg# The call with PACKAGE and VERSION arguments is the old style
2065690143ccSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
2066690143ccSmrg# and VERSION should now be passed to AC_INIT and removed from
2067690143ccSmrg# the call to AM_INIT_AUTOMAKE.
2068690143ccSmrg# We support both call styles for the transition.  After
2069690143ccSmrg# the next Automake release, Autoconf can make the AC_INIT
2070690143ccSmrg# arguments mandatory, and then we can depend on a new Autoconf
2071690143ccSmrg# release and drop the old call support.
2072690143ccSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
2073690143ccSmrg[AC_PREREQ([2.62])dnl
2074690143ccSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
2075690143ccSmrgdnl the ones we care about.
2076690143ccSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
2077690143ccSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2078690143ccSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
2079690143ccSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
2080690143ccSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2081690143ccSmrg  # is not polluted with repeated "-I."
2082690143ccSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
2083690143ccSmrg  # test to see if srcdir already configured
2084690143ccSmrg  if test -f $srcdir/config.status; then
2085690143ccSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2086690143ccSmrg  fi
208783e5f723Smrgfi
208883e5f723Smrg
2089690143ccSmrg# test whether we have cygpath
2090690143ccSmrgif test -z "$CYGPATH_W"; then
2091690143ccSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
2092690143ccSmrg    CYGPATH_W='cygpath -w'
2093690143ccSmrg  else
2094690143ccSmrg    CYGPATH_W=echo
2095690143ccSmrg  fi
2096690143ccSmrgfi
2097690143ccSmrgAC_SUBST([CYGPATH_W])
2098690143ccSmrg
2099690143ccSmrg# Define the identity of the package.
2100690143ccSmrgdnl Distinguish between old-style and new-style calls.
2101690143ccSmrgm4_ifval([$2],
2102690143ccSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
2103690143ccSmrg AC_SUBST([PACKAGE], [$1])dnl
2104690143ccSmrg AC_SUBST([VERSION], [$2])],
2105690143ccSmrg[_AM_SET_OPTIONS([$1])dnl
2106690143ccSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
2107690143ccSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
2108690143ccSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
2109690143ccSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
2110690143ccSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
2111690143ccSmrg
2112690143ccSmrg_AM_IF_OPTION([no-define],,
2113690143ccSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2114690143ccSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
2115690143ccSmrg
2116690143ccSmrg# Some tools Automake needs.
2117690143ccSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
2118690143ccSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
2119690143ccSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
2120690143ccSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
2121690143ccSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
2122690143ccSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
2123690143ccSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
2124690143ccSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2125690143ccSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
2126690143ccSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
2127690143ccSmrg# We need awk for the "check" target.  The system "awk" is bad on
2128690143ccSmrg# some platforms.
2129690143ccSmrgAC_REQUIRE([AC_PROG_AWK])dnl
2130690143ccSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
2131690143ccSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
2132690143ccSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
2133690143ccSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
2134690143ccSmrg			     [_AM_PROG_TAR([v7])])])
2135690143ccSmrg_AM_IF_OPTION([no-dependencies],,
2136690143ccSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
2137690143ccSmrg		  [_AM_DEPENDENCIES(CC)],
2138690143ccSmrg		  [define([AC_PROG_CC],
2139690143ccSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
2140690143ccSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
2141690143ccSmrg		  [_AM_DEPENDENCIES(CXX)],
2142690143ccSmrg		  [define([AC_PROG_CXX],
2143690143ccSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
2144690143ccSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
2145690143ccSmrg		  [_AM_DEPENDENCIES(OBJC)],
2146690143ccSmrg		  [define([AC_PROG_OBJC],
2147690143ccSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
2148690143ccSmrg])
2149690143ccSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
2150690143ccSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
2151690143ccSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
2152690143ccSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
2153690143ccSmrgAC_CONFIG_COMMANDS_PRE(dnl
2154690143ccSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
2155690143ccSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
2156690143ccSmrg])
2157690143ccSmrg
2158690143ccSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
2159690143ccSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
2160690143ccSmrgdnl mangled by Autoconf and run in a shell conditional statement.
2161690143ccSmrgm4_define([_AC_COMPILER_EXEEXT],
2162690143ccSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
2163690143ccSmrg
2164690143ccSmrg
2165690143ccSmrg# When config.status generates a header, we must update the stamp-h file.
2166690143ccSmrg# This file resides in the same directory as the config header
2167690143ccSmrg# that is generated.  The stamp files are numbered to have different names.
2168690143ccSmrg
2169690143ccSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
2170690143ccSmrg# loop where config.status creates the headers, so we can generate
2171690143ccSmrg# our stamp files there.
2172690143ccSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
2173690143ccSmrg[# Compute $1's index in $config_headers.
2174690143ccSmrg_am_arg=$1
2175690143ccSmrg_am_stamp_count=1
2176690143ccSmrgfor _am_header in $config_headers :; do
2177690143ccSmrg  case $_am_header in
2178690143ccSmrg    $_am_arg | $_am_arg:* )
2179690143ccSmrg      break ;;
2180690143ccSmrg    * )
2181690143ccSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2182690143ccSmrg  esac
2183690143ccSmrgdone
2184690143ccSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
2185690143ccSmrg
2186690143ccSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
218783e5f723Smrg#
2188690143ccSmrg# This file is free software; the Free Software Foundation
2189690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2190690143ccSmrg# with or without modifications, as long as this notice is preserved.
219183e5f723Smrg
2192690143ccSmrg# AM_PROG_INSTALL_SH
2193690143ccSmrg# ------------------
2194690143ccSmrg# Define $install_sh.
2195690143ccSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
2196690143ccSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2197690143ccSmrgif test x"${install_sh}" != xset; then
2198690143ccSmrg  case $am_aux_dir in
2199690143ccSmrg  *\ * | *\	*)
2200690143ccSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2201690143ccSmrg  *)
2202690143ccSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
2203690143ccSmrg  esac
220483e5f723Smrgfi
2205690143ccSmrgAC_SUBST(install_sh)])
220683e5f723Smrg
2207690143ccSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
220883e5f723Smrg#
2209690143ccSmrg# This file is free software; the Free Software Foundation
2210690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2211690143ccSmrg# with or without modifications, as long as this notice is preserved.
221283e5f723Smrg
2213690143ccSmrg# serial 2
2214690143ccSmrg
2215690143ccSmrg# Check whether the underlying file-system supports filenames
2216690143ccSmrg# with a leading dot.  For instance MS-DOS doesn't.
2217690143ccSmrgAC_DEFUN([AM_SET_LEADING_DOT],
2218690143ccSmrg[rm -rf .tst 2>/dev/null
2219690143ccSmrgmkdir .tst 2>/dev/null
2220690143ccSmrgif test -d .tst; then
2221690143ccSmrg  am__leading_dot=.
222283e5f723Smrgelse
2223690143ccSmrg  am__leading_dot=_
222483e5f723Smrgfi
2225690143ccSmrgrmdir .tst 2>/dev/null
2226690143ccSmrgAC_SUBST([am__leading_dot])])
222783e5f723Smrg
2228690143ccSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
2229690143ccSmrg# From Jim Meyering
223083e5f723Smrg
2231690143ccSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
2232690143ccSmrg# Free Software Foundation, Inc.
2233690143ccSmrg#
2234690143ccSmrg# This file is free software; the Free Software Foundation
2235690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2236690143ccSmrg# with or without modifications, as long as this notice is preserved.
223783e5f723Smrg
2238690143ccSmrg# serial 5
2239690143ccSmrg
2240690143ccSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
2241690143ccSmrg# ----------------------------------
2242690143ccSmrg# Control maintainer-specific portions of Makefiles.
2243690143ccSmrg# Default is to disable them, unless `enable' is passed literally.
2244690143ccSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
2245690143ccSmrg# can override the default with the --enable/--disable switch.
2246690143ccSmrgAC_DEFUN([AM_MAINTAINER_MODE],
2247690143ccSmrg[m4_case(m4_default([$1], [disable]),
2248690143ccSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
2249690143ccSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
2250690143ccSmrg       [m4_define([am_maintainer_other], [enable])
2251690143ccSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
2252690143ccSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
2253690143ccSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
2254690143ccSmrg  AC_ARG_ENABLE([maintainer-mode],
2255690143ccSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
2256690143ccSmrg			  (and sometimes confusing) to the casual installer],
2257690143ccSmrg      [USE_MAINTAINER_MODE=$enableval],
2258690143ccSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
2259690143ccSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
2260690143ccSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
2261690143ccSmrg  MAINT=$MAINTAINER_MODE_TRUE
2262690143ccSmrg  AC_SUBST([MAINT])dnl
2263690143ccSmrg]
2264690143ccSmrg)
2265690143ccSmrg
2266690143ccSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
226783e5f723Smrg
2268690143ccSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
2269690143ccSmrg
2270690143ccSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
227183e5f723Smrg#
2272690143ccSmrg# This file is free software; the Free Software Foundation
2273690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2274690143ccSmrg# with or without modifications, as long as this notice is preserved.
227583e5f723Smrg
2276690143ccSmrg# serial 4
2277690143ccSmrg
2278690143ccSmrg# AM_MAKE_INCLUDE()
2279690143ccSmrg# -----------------
2280690143ccSmrg# Check to see how make treats includes.
2281690143ccSmrgAC_DEFUN([AM_MAKE_INCLUDE],
2282690143ccSmrg[am_make=${MAKE-make}
2283690143ccSmrgcat > confinc << 'END'
2284690143ccSmrgam__doit:
2285690143ccSmrg	@echo this is the am__doit target
2286690143ccSmrg.PHONY: am__doit
2287690143ccSmrgEND
2288690143ccSmrg# If we don't find an include directive, just comment out the code.
2289690143ccSmrgAC_MSG_CHECKING([for style of include used by $am_make])
2290690143ccSmrgam__include="#"
2291690143ccSmrgam__quote=
2292690143ccSmrg_am_result=none
2293690143ccSmrg# First try GNU make style include.
2294690143ccSmrgecho "include confinc" > confmf
2295690143ccSmrg# Ignore all kinds of additional output from `make'.
2296690143ccSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
2297690143ccSmrg*the\ am__doit\ target*)
2298690143ccSmrg  am__include=include
2299690143ccSmrg  am__quote=
2300690143ccSmrg  _am_result=GNU
2301690143ccSmrg  ;;
2302690143ccSmrgesac
2303690143ccSmrg# Now try BSD make style include.
2304690143ccSmrgif test "$am__include" = "#"; then
2305690143ccSmrg   echo '.include "confinc"' > confmf
2306690143ccSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
2307690143ccSmrg   *the\ am__doit\ target*)
2308690143ccSmrg     am__include=.include
2309690143ccSmrg     am__quote="\""
2310690143ccSmrg     _am_result=BSD
2311690143ccSmrg     ;;
2312690143ccSmrg   esac
231383e5f723Smrgfi
2314690143ccSmrgAC_SUBST([am__include])
2315690143ccSmrgAC_SUBST([am__quote])
2316690143ccSmrgAC_MSG_RESULT([$_am_result])
2317690143ccSmrgrm -f confinc confmf
2318690143ccSmrg])
231983e5f723Smrg
2320690143ccSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2321690143ccSmrg
2322690143ccSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
2323690143ccSmrg# Free Software Foundation, Inc.
232483e5f723Smrg#
2325690143ccSmrg# This file is free software; the Free Software Foundation
2326690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2327690143ccSmrg# with or without modifications, as long as this notice is preserved.
232883e5f723Smrg
2329690143ccSmrg# serial 6
2330690143ccSmrg
2331690143ccSmrg# AM_MISSING_PROG(NAME, PROGRAM)
2332690143ccSmrg# ------------------------------
2333690143ccSmrgAC_DEFUN([AM_MISSING_PROG],
2334690143ccSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
2335690143ccSmrg$1=${$1-"${am_missing_run}$2"}
2336690143ccSmrgAC_SUBST($1)])
2337690143ccSmrg
2338690143ccSmrg
2339690143ccSmrg# AM_MISSING_HAS_RUN
2340690143ccSmrg# ------------------
2341690143ccSmrg# Define MISSING if not defined so far and test if it supports --run.
2342690143ccSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
2343690143ccSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
2344690143ccSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2345690143ccSmrgAC_REQUIRE_AUX_FILE([missing])dnl
2346690143ccSmrgif test x"${MISSING+set}" != xset; then
2347690143ccSmrg  case $am_aux_dir in
2348690143ccSmrg  *\ * | *\	*)
2349690143ccSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2350690143ccSmrg  *)
2351690143ccSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
2352690143ccSmrg  esac
2353690143ccSmrgfi
2354690143ccSmrg# Use eval to expand $SHELL
2355690143ccSmrgif eval "$MISSING --run true"; then
2356690143ccSmrg  am_missing_run="$MISSING --run "
235783e5f723Smrgelse
2358690143ccSmrg  am_missing_run=
2359690143ccSmrg  AC_MSG_WARN([`missing' script is too old or missing])
236083e5f723Smrgfi
2361690143ccSmrg])
236283e5f723Smrg
2363690143ccSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
236483e5f723Smrg#
2365690143ccSmrg# This file is free software; the Free Software Foundation
2366690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2367690143ccSmrg# with or without modifications, as long as this notice is preserved.
236883e5f723Smrg
2369690143ccSmrg# AM_PROG_MKDIR_P
2370690143ccSmrg# ---------------
2371690143ccSmrg# Check for `mkdir -p'.
2372690143ccSmrgAC_DEFUN([AM_PROG_MKDIR_P],
2373690143ccSmrg[AC_PREREQ([2.60])dnl
2374690143ccSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
2375690143ccSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
2376690143ccSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
2377690143ccSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
2378690143ccSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
2379690143ccSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
2380690143ccSmrgdnl adjustment using top_builddir (which is defined more often than
2381690143ccSmrgdnl MKDIR_P).
2382690143ccSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
2383690143ccSmrgcase $mkdir_p in
2384690143ccSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
2385690143ccSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2386690143ccSmrgesac
2387690143ccSmrg])
2388690143ccSmrg
2389690143ccSmrg# Helper functions for option handling.                     -*- Autoconf -*-
239083e5f723Smrg
2391690143ccSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
239283e5f723Smrg#
2393690143ccSmrg# This file is free software; the Free Software Foundation
2394690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2395690143ccSmrg# with or without modifications, as long as this notice is preserved.
239683e5f723Smrg
2397690143ccSmrg# serial 4
2398f46a6179Smrg
2399690143ccSmrg# _AM_MANGLE_OPTION(NAME)
2400690143ccSmrg# -----------------------
2401690143ccSmrgAC_DEFUN([_AM_MANGLE_OPTION],
2402690143ccSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2403f46a6179Smrg
2404690143ccSmrg# _AM_SET_OPTION(NAME)
2405690143ccSmrg# ------------------------------
2406690143ccSmrg# Set option NAME.  Presently that only means defining a flag for this option.
2407690143ccSmrgAC_DEFUN([_AM_SET_OPTION],
2408690143ccSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2409f46a6179Smrg
2410690143ccSmrg# _AM_SET_OPTIONS(OPTIONS)
2411690143ccSmrg# ----------------------------------
2412690143ccSmrg# OPTIONS is a space-separated list of Automake options.
2413690143ccSmrgAC_DEFUN([_AM_SET_OPTIONS],
2414690143ccSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
24155fac8b10Smrg
2416690143ccSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2417690143ccSmrg# -------------------------------------------
2418690143ccSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2419690143ccSmrgAC_DEFUN([_AM_IF_OPTION],
2420690143ccSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2421690143ccSmrg
2422690143ccSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
2423690143ccSmrg
2424690143ccSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
2425690143ccSmrg# Free Software Foundation, Inc.
24265fac8b10Smrg#
2427690143ccSmrg# This file is free software; the Free Software Foundation
2428690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2429690143ccSmrg# with or without modifications, as long as this notice is preserved.
2430f46a6179Smrg
2431690143ccSmrg# serial 5
243283e5f723Smrg
2433690143ccSmrg# AM_SANITY_CHECK
2434690143ccSmrg# ---------------
2435690143ccSmrgAC_DEFUN([AM_SANITY_CHECK],
2436690143ccSmrg[AC_MSG_CHECKING([whether build environment is sane])
2437690143ccSmrg# Just in case
2438690143ccSmrgsleep 1
2439690143ccSmrgecho timestamp > conftest.file
2440690143ccSmrg# Reject unsafe characters in $srcdir or the absolute working directory
2441690143ccSmrg# name.  Accept space and tab only in the latter.
2442690143ccSmrgam_lf='
2443690143ccSmrg'
2444690143ccSmrgcase `pwd` in
2445690143ccSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
2446690143ccSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
2447690143ccSmrgesac
2448690143ccSmrgcase $srcdir in
2449690143ccSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
2450690143ccSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
245183e5f723Smrgesac
245283e5f723Smrg
2453690143ccSmrg# Do `set' in a subshell so we don't clobber the current shell's
2454690143ccSmrg# arguments.  Must try -L first in case configure is actually a
2455690143ccSmrg# symlink; some systems play weird games with the mod time of symlinks
2456690143ccSmrg# (eg FreeBSD returns the mod time of the symlink's containing
2457690143ccSmrg# directory).
2458690143ccSmrgif (
2459690143ccSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2460690143ccSmrg   if test "$[*]" = "X"; then
2461690143ccSmrg      # -L didn't work.
2462690143ccSmrg      set X `ls -t "$srcdir/configure" conftest.file`
246383e5f723Smrg   fi
2464690143ccSmrg   rm -f conftest.file
2465690143ccSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
2466690143ccSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
2467690143ccSmrg
2468690143ccSmrg      # If neither matched, then we have a broken ls.  This can happen
2469690143ccSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
2470690143ccSmrg      # broken ls alias from the environment.  This has actually
2471690143ccSmrg      # happened.  Such a system could not be considered "sane".
2472690143ccSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
2473690143ccSmrgalias in your environment])
247483e5f723Smrg   fi
247583e5f723Smrg
2476690143ccSmrg   test "$[2]" = conftest.file
2477690143ccSmrg   )
2478690143ccSmrgthen
2479690143ccSmrg   # Ok.
2480690143ccSmrg   :
2481690143ccSmrgelse
2482690143ccSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
2483690143ccSmrgCheck your system clock])
2484f46a6179Smrgfi
2485690143ccSmrgAC_MSG_RESULT(yes)])
2486f46a6179Smrg
2487690143ccSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
2488690143ccSmrg#
2489690143ccSmrg# This file is free software; the Free Software Foundation
2490690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2491690143ccSmrg# with or without modifications, as long as this notice is preserved.
2492f46a6179Smrg
2493690143ccSmrg# serial 1
249434345a63Smrg
2495690143ccSmrg# AM_SILENT_RULES([DEFAULT])
24965fac8b10Smrg# --------------------------
2497690143ccSmrg# Enable less verbose build rules; with the default set to DEFAULT
2498690143ccSmrg# (`yes' being less verbose, `no' or empty being verbose).
2499690143ccSmrgAC_DEFUN([AM_SILENT_RULES],
2500690143ccSmrg[AC_ARG_ENABLE([silent-rules],
2501690143ccSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
2502690143ccSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
2503690143ccSmrgcase $enable_silent_rules in
2504690143ccSmrgyes) AM_DEFAULT_VERBOSITY=0;;
2505690143ccSmrgno)  AM_DEFAULT_VERBOSITY=1;;
2506690143ccSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
2507690143ccSmrgesac
2508690143ccSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
2509690143ccSmrgAM_BACKSLASH='\'
2510690143ccSmrgAC_SUBST([AM_BACKSLASH])dnl
2511690143ccSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
2512690143ccSmrg])
2513690143ccSmrg
2514690143ccSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
251583e5f723Smrg#
2516690143ccSmrg# This file is free software; the Free Software Foundation
2517690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2518690143ccSmrg# with or without modifications, as long as this notice is preserved.
2519690143ccSmrg
2520690143ccSmrg# AM_PROG_INSTALL_STRIP
2521690143ccSmrg# ---------------------
2522690143ccSmrg# One issue with vendor `install' (even GNU) is that you can't
2523690143ccSmrg# specify the program used to strip binaries.  This is especially
2524690143ccSmrg# annoying in cross-compiling environments, where the build's strip
2525690143ccSmrg# is unlikely to handle the host's binaries.
2526690143ccSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
2527690143ccSmrg# always use install-sh in `make install-strip', and initialize
2528690143ccSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
2529690143ccSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
2530690143ccSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2531690143ccSmrg# Installed binaries are usually stripped using `strip' when the user
2532690143ccSmrg# run `make install-strip'.  However `strip' might not be the right
2533690143ccSmrg# tool to use in cross-compilation environments, therefore Automake
2534690143ccSmrg# will honor the `STRIP' environment variable to overrule this program.
2535690143ccSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2536690143ccSmrgif test "$cross_compiling" != no; then
2537690143ccSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
2538690143ccSmrgfi
2539690143ccSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2540690143ccSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
2541f46a6179Smrg
2542690143ccSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
2543690143ccSmrg#
2544690143ccSmrg# This file is free software; the Free Software Foundation
2545690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2546690143ccSmrg# with or without modifications, as long as this notice is preserved.
254783e5f723Smrg
2548690143ccSmrg# serial 2
254983e5f723Smrg
2550690143ccSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
2551690143ccSmrg# ---------------------------
2552690143ccSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2553690143ccSmrg# This macro is traced by Automake.
2554690143ccSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
255534345a63Smrg
2556690143ccSmrg# AM_SUBST_NOTMAKE(VARIABLE)
2557690143ccSmrg# ---------------------------
2558690143ccSmrg# Public sister of _AM_SUBST_NOTMAKE.
2559690143ccSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2560f46a6179Smrg
2561690143ccSmrg# Check how to create a tarball.                            -*- Autoconf -*-
2562f46a6179Smrg
2563690143ccSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
25645fac8b10Smrg#
2565690143ccSmrg# This file is free software; the Free Software Foundation
2566690143ccSmrg# gives unlimited permission to copy and/or distribute it,
2567690143ccSmrg# with or without modifications, as long as this notice is preserved.
25685fac8b10Smrg
2569690143ccSmrg# serial 2
2570f46a6179Smrg
2571690143ccSmrg# _AM_PROG_TAR(FORMAT)
2572f46a6179Smrg# --------------------
2573690143ccSmrg# Check how to create a tarball in format FORMAT.
2574690143ccSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
2575f46a6179Smrg#
2576690143ccSmrg# Substitute a variable $(am__tar) that is a command
2577690143ccSmrg# writing to stdout a FORMAT-tarball containing the directory
2578690143ccSmrg# $tardir.
2579690143ccSmrg#     tardir=directory && $(am__tar) > result.tar
2580f46a6179Smrg#
2581690143ccSmrg# Substitute a variable $(am__untar) that extract such
2582690143ccSmrg# a tarball read from stdin.
2583690143ccSmrg#     $(am__untar) < result.tar
2584690143ccSmrgAC_DEFUN([_AM_PROG_TAR],
2585690143ccSmrg[# Always define AMTAR for backward compatibility.
2586690143ccSmrgAM_MISSING_PROG([AMTAR], [tar])
2587690143ccSmrgm4_if([$1], [v7],
2588690143ccSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
2589690143ccSmrg     [m4_case([$1], [ustar],, [pax],,
2590690143ccSmrg              [m4_fatal([Unknown tar format])])
2591690143ccSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
2592690143ccSmrg# Loop over all known methods to create a tar archive until one works.
2593690143ccSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2594690143ccSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
2595690143ccSmrg# Do not fold the above two line into one, because Tru64 sh and
2596690143ccSmrg# Solaris sh will not grok spaces in the rhs of `-'.
2597690143ccSmrgfor _am_tool in $_am_tools
2598690143ccSmrgdo
2599690143ccSmrg  case $_am_tool in
2600690143ccSmrg  gnutar)
2601690143ccSmrg    for _am_tar in tar gnutar gtar;
2602690143ccSmrg    do
2603690143ccSmrg      AM_RUN_LOG([$_am_tar --version]) && break
2604690143ccSmrg    done
2605690143ccSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2606690143ccSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2607690143ccSmrg    am__untar="$_am_tar -xf -"
2608690143ccSmrg    ;;
2609690143ccSmrg  plaintar)
2610690143ccSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
2611690143ccSmrg    # ustar tarball either.
2612690143ccSmrg    (tar --version) >/dev/null 2>&1 && continue
2613690143ccSmrg    am__tar='tar chf - "$$tardir"'
2614690143ccSmrg    am__tar_='tar chf - "$tardir"'
2615690143ccSmrg    am__untar='tar xf -'
2616690143ccSmrg    ;;
2617690143ccSmrg  pax)
2618690143ccSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
2619690143ccSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
2620690143ccSmrg    am__untar='pax -r'
2621690143ccSmrg    ;;
2622690143ccSmrg  cpio)
2623690143ccSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2624690143ccSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2625690143ccSmrg    am__untar='cpio -i -H $1 -d'
2626690143ccSmrg    ;;
2627690143ccSmrg  none)
2628690143ccSmrg    am__tar=false
2629690143ccSmrg    am__tar_=false
2630690143ccSmrg    am__untar=false
2631690143ccSmrg    ;;
2632690143ccSmrg  esac
263383e5f723Smrg
2634690143ccSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
2635690143ccSmrg  # and am__untar set.
2636690143ccSmrg  test -n "${am_cv_prog_tar_$1}" && break
2637f46a6179Smrg
2638690143ccSmrg  # tar/untar a dummy directory, and stop if the command works
2639690143ccSmrg  rm -rf conftest.dir
2640690143ccSmrg  mkdir conftest.dir
2641690143ccSmrg  echo GrepMe > conftest.dir/file
2642690143ccSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2643690143ccSmrg  rm -rf conftest.dir
2644690143ccSmrg  if test -s conftest.tar; then
2645690143ccSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
2646690143ccSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2647690143ccSmrg  fi
2648690143ccSmrgdone
2649690143ccSmrgrm -rf conftest.dir
2650f46a6179Smrg
2651690143ccSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2652690143ccSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
2653690143ccSmrgAC_SUBST([am__tar])
2654690143ccSmrgAC_SUBST([am__untar])
2655690143ccSmrg]) # _AM_PROG_TAR
2656f46a6179Smrg
2657