aclocal.m4 revision 04007eba
104007ebaSmrg# generated automatically by aclocal 1.14 -*- Autoconf -*-
2f29dbc25Smrg
304007ebaSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4f29dbc25Smrg
504007ebaSmrg# This file is free software; the Free Software Foundation
604007ebaSmrg# gives unlimited permission to copy and/or distribute it,
704007ebaSmrg# with or without modifications, as long as this notice is preserved.
8f29dbc25Smrg
904007ebaSmrg# This program is distributed in the hope that it will be useful,
1004007ebaSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1104007ebaSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1204007ebaSmrg# PARTICULAR PURPOSE.
13f29dbc25Smrg
1404007ebaSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
1504007ebaSmrgm4_ifndef([AC_AUTOCONF_VERSION],
1604007ebaSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1704007ebaSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
1804007ebaSmrg[m4_warning([this file was generated for autoconf 2.69.
1904007ebaSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
2004007ebaSmrgIf you have problems, you may need to regenerate the build system entirely.
2104007ebaSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22f29dbc25Smrg
23f29dbc25Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
24170d5fdcSmrg# serial 1 (pkg-config-0.24)
25f29dbc25Smrg# 
26f29dbc25Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
27f29dbc25Smrg#
28f29dbc25Smrg# This program is free software; you can redistribute it and/or modify
29f29dbc25Smrg# it under the terms of the GNU General Public License as published by
30f29dbc25Smrg# the Free Software Foundation; either version 2 of the License, or
31f29dbc25Smrg# (at your option) any later version.
32f29dbc25Smrg#
33f29dbc25Smrg# This program is distributed in the hope that it will be useful, but
34f29dbc25Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
35f29dbc25Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
36f29dbc25Smrg# General Public License for more details.
37f29dbc25Smrg#
38f29dbc25Smrg# You should have received a copy of the GNU General Public License
39f29dbc25Smrg# along with this program; if not, write to the Free Software
40f29dbc25Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
41f29dbc25Smrg#
42f29dbc25Smrg# As a special exception to the GNU General Public License, if you
43f29dbc25Smrg# distribute this file as part of a program that contains a
44f29dbc25Smrg# configuration script generated by Autoconf, you may include it under
45f29dbc25Smrg# the same distribution terms that you use for the rest of that program.
46f29dbc25Smrg
47f29dbc25Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
48f29dbc25Smrg# ----------------------------------
49f29dbc25SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
50f29dbc25Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
5104007ebaSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
5204007ebaSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
53170d5fdcSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
54170d5fdcSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
55170d5fdcSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
56170d5fdcSmrg
57f29dbc25Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
58f29dbc25Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
59f29dbc25Smrgfi
60f29dbc25Smrgif test -n "$PKG_CONFIG"; then
61f29dbc25Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
62f29dbc25Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
63f29dbc25Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
64f29dbc25Smrg		AC_MSG_RESULT([yes])
65f29dbc25Smrg	else
66f29dbc25Smrg		AC_MSG_RESULT([no])
67f29dbc25Smrg		PKG_CONFIG=""
68f29dbc25Smrg	fi
69f29dbc25Smrgfi[]dnl
70f29dbc25Smrg])# PKG_PROG_PKG_CONFIG
71f29dbc25Smrg
72f29dbc25Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
73f29dbc25Smrg#
74f29dbc25Smrg# Check to see whether a particular set of modules exists.  Similar
75f29dbc25Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
76f29dbc25Smrg#
77170d5fdcSmrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
78170d5fdcSmrg# only at the first occurence in configure.ac, so if the first place
79170d5fdcSmrg# it's called might be skipped (such as if it is within an "if", you
80170d5fdcSmrg# have to call PKG_CHECK_EXISTS manually
81f29dbc25Smrg# --------------------------------------------------------------
82f29dbc25SmrgAC_DEFUN([PKG_CHECK_EXISTS],
83f29dbc25Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
84f29dbc25Smrgif test -n "$PKG_CONFIG" && \
85f29dbc25Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
86170d5fdcSmrg  m4_default([$2], [:])
87f29dbc25Smrgm4_ifvaln([$3], [else
88f29dbc25Smrg  $3])dnl
89f29dbc25Smrgfi])
90f29dbc25Smrg
91f29dbc25Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
92f29dbc25Smrg# ---------------------------------------------
93f29dbc25Smrgm4_define([_PKG_CONFIG],
94170d5fdcSmrg[if test -n "$$1"; then
95170d5fdcSmrg    pkg_cv_[]$1="$$1"
96170d5fdcSmrg elif test -n "$PKG_CONFIG"; then
97170d5fdcSmrg    PKG_CHECK_EXISTS([$3],
9804007ebaSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
9904007ebaSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
100170d5fdcSmrg		     [pkg_failed=yes])
101170d5fdcSmrg else
102170d5fdcSmrg    pkg_failed=untried
103f29dbc25Smrgfi[]dnl
104f29dbc25Smrg])# _PKG_CONFIG
105f29dbc25Smrg
106f29dbc25Smrg# _PKG_SHORT_ERRORS_SUPPORTED
107f29dbc25Smrg# -----------------------------
108f29dbc25SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
109f29dbc25Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
110f29dbc25Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
111f29dbc25Smrg        _pkg_short_errors_supported=yes
112f29dbc25Smrgelse
113f29dbc25Smrg        _pkg_short_errors_supported=no
114f29dbc25Smrgfi[]dnl
115f29dbc25Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
116f29dbc25Smrg
117f29dbc25Smrg
118f29dbc25Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
119f29dbc25Smrg# [ACTION-IF-NOT-FOUND])
120f29dbc25Smrg#
121f29dbc25Smrg#
122f29dbc25Smrg# Note that if there is a possibility the first call to
123f29dbc25Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
124f29dbc25Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
125f29dbc25Smrg#
126f29dbc25Smrg#
127f29dbc25Smrg# --------------------------------------------------------------
128f29dbc25SmrgAC_DEFUN([PKG_CHECK_MODULES],
129f29dbc25Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
130f29dbc25SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
131f29dbc25SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
132f29dbc25Smrg
133f29dbc25Smrgpkg_failed=no
134f29dbc25SmrgAC_MSG_CHECKING([for $1])
135f29dbc25Smrg
136f29dbc25Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
137f29dbc25Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
138f29dbc25Smrg
139f29dbc25Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
140f29dbc25Smrgand $1[]_LIBS to avoid the need to call pkg-config.
141f29dbc25SmrgSee the pkg-config man page for more details.])
142f29dbc25Smrg
143f29dbc25Smrgif test $pkg_failed = yes; then
144170d5fdcSmrg   	AC_MSG_RESULT([no])
145f29dbc25Smrg        _PKG_SHORT_ERRORS_SUPPORTED
146f29dbc25Smrg        if test $_pkg_short_errors_supported = yes; then
14704007ebaSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
148f29dbc25Smrg        else 
14904007ebaSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
150f29dbc25Smrg        fi
151f29dbc25Smrg	# Put the nasty error message in config.log where it belongs
152f29dbc25Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
153f29dbc25Smrg
154170d5fdcSmrg	m4_default([$4], [AC_MSG_ERROR(
155f29dbc25Smrg[Package requirements ($2) were not met:
156f29dbc25Smrg
157f29dbc25Smrg$$1_PKG_ERRORS
158f29dbc25Smrg
159f29dbc25SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
160f29dbc25Smrginstalled software in a non-standard prefix.
161f29dbc25Smrg
162170d5fdcSmrg_PKG_TEXT])[]dnl
163170d5fdcSmrg        ])
164f29dbc25Smrgelif test $pkg_failed = untried; then
165170d5fdcSmrg     	AC_MSG_RESULT([no])
166170d5fdcSmrg	m4_default([$4], [AC_MSG_FAILURE(
167f29dbc25Smrg[The pkg-config script could not be found or is too old.  Make sure it
168f29dbc25Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
169f29dbc25Smrgpath to pkg-config.
170f29dbc25Smrg
171f29dbc25Smrg_PKG_TEXT
172f29dbc25Smrg
173170d5fdcSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
174170d5fdcSmrg        ])
175f29dbc25Smrgelse
176f29dbc25Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
177f29dbc25Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
178f29dbc25Smrg        AC_MSG_RESULT([yes])
179170d5fdcSmrg	$3
180f29dbc25Smrgfi[]dnl
181f29dbc25Smrg])# PKG_CHECK_MODULES
182f29dbc25Smrg
183f29dbc25Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
184f29dbc25Smrgdnl
185170d5fdcSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
18604007ebaSmrgdnl
187f29dbc25Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
188f29dbc25Smrgdnl copy of this software and associated documentation files (the "Software"),
189f29dbc25Smrgdnl to deal in the Software without restriction, including without limitation
190f29dbc25Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
191f29dbc25Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
192f29dbc25Smrgdnl Software is furnished to do so, subject to the following conditions:
193f29dbc25Smrgdnl
194f29dbc25Smrgdnl The above copyright notice and this permission notice (including the next
195f29dbc25Smrgdnl paragraph) shall be included in all copies or substantial portions of the
196f29dbc25Smrgdnl Software.
197f29dbc25Smrgdnl
198f29dbc25Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
199f29dbc25Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
200f29dbc25Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
201f29dbc25Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
202f29dbc25Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
203f29dbc25Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
204f29dbc25Smrgdnl DEALINGS IN THE SOFTWARE.
205f29dbc25Smrg
206f29dbc25Smrg# XORG_MACROS_VERSION(required-version)
207f29dbc25Smrg# -------------------------------------
208f29dbc25Smrg# Minimum version: 1.1.0
209f29dbc25Smrg#
210f29dbc25Smrg# If you're using a macro added in Version 1.1 or newer, include this in
211f29dbc25Smrg# your configure.ac with the minimum required version, such as:
212f29dbc25Smrg# XORG_MACROS_VERSION(1.1)
213f29dbc25Smrg#
214f29dbc25Smrg# To ensure that this macro is defined, also add:
215f29dbc25Smrg# m4_ifndef([XORG_MACROS_VERSION],
216f29dbc25Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
217f29dbc25Smrg#
218f29dbc25Smrg#
21904007ebaSmrg# See the "minimum version" comment for each macro you use to see what
220f29dbc25Smrg# version you require.
221f29dbc25Smrgm4_defun([XORG_MACROS_VERSION],[
22204007ebaSmrgm4_define([vers_have], [1.17.1])
223f29dbc25Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
224f29dbc25Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
225f29dbc25Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
226f29dbc25Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
227f29dbc25Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
228f29dbc25Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
229f29dbc25Smrgm4_undefine([vers_have])
230f29dbc25Smrgm4_undefine([maj_have])
231f29dbc25Smrgm4_undefine([maj_needed])
232f29dbc25Smrg]) # XORG_MACROS_VERSION
233f29dbc25Smrg
234f29dbc25Smrg# XORG_PROG_RAWCPP()
235f29dbc25Smrg# ------------------
236f29dbc25Smrg# Minimum version: 1.0.0
237f29dbc25Smrg#
238f29dbc25Smrg# Find cpp program and necessary flags for use in pre-processing text files
239f29dbc25Smrg# such as man pages and config files
240f29dbc25SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
241f29dbc25SmrgAC_REQUIRE([AC_PROG_CPP])
24204007ebaSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
243f29dbc25Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
244f29dbc25Smrg
245f29dbc25Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
246f29dbc25Smrg# which is not the best choice for supporting other OS'es, but covers most
247f29dbc25Smrg# of the ones we need for now.
248f29dbc25SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
24904007ebaSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
250f29dbc25Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
251f29dbc25Smrg	AC_MSG_RESULT([no])
252f29dbc25Smrgelse
253f29dbc25Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
254f29dbc25Smrg		RAWCPPFLAGS=-undef
255f29dbc25Smrg		AC_MSG_RESULT([yes])
256f29dbc25Smrg	# under Cygwin unix is still defined even with -undef
257f29dbc25Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
258f29dbc25Smrg		RAWCPPFLAGS="-undef -ansi"
259f29dbc25Smrg		AC_MSG_RESULT([yes, with -ansi])
260f29dbc25Smrg	else
261f29dbc25Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
262f29dbc25Smrg	fi
263f29dbc25Smrgfi
264f29dbc25Smrgrm -f conftest.$ac_ext
265f29dbc25Smrg
266f29dbc25SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
26704007ebaSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
268f29dbc25Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
269f29dbc25Smrg	AC_MSG_RESULT([no])
270f29dbc25Smrgelse
271f29dbc25Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
272f29dbc25Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
273f29dbc25Smrg		AC_MSG_RESULT([yes])
274f29dbc25Smrg	else
275f29dbc25Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
276f29dbc25Smrg	fi
277f29dbc25Smrgfi
278f29dbc25Smrgrm -f conftest.$ac_ext
279f29dbc25SmrgAC_SUBST(RAWCPPFLAGS)
280f29dbc25Smrg]) # XORG_PROG_RAWCPP
281f29dbc25Smrg
282f29dbc25Smrg# XORG_MANPAGE_SECTIONS()
283f29dbc25Smrg# -----------------------
284f29dbc25Smrg# Minimum version: 1.0.0
285f29dbc25Smrg#
286f29dbc25Smrg# Determine which sections man pages go in for the different man page types
287f29dbc25Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
288f29dbc25Smrg# Not sure if there's any better way than just hardcoding by OS name.
289f29dbc25Smrg# Override default settings by setting environment variables
290170d5fdcSmrg# Added MAN_SUBSTS in version 1.8
291170d5fdcSmrg# Added AC_PROG_SED in version 1.8
292f29dbc25Smrg
293f29dbc25SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
294f29dbc25SmrgAC_REQUIRE([AC_CANONICAL_HOST])
295170d5fdcSmrgAC_REQUIRE([AC_PROG_SED])
296f29dbc25Smrg
297f29dbc25Smrgif test x$APP_MAN_SUFFIX = x    ; then
298f29dbc25Smrg    APP_MAN_SUFFIX=1
299f29dbc25Smrgfi
300f29dbc25Smrgif test x$APP_MAN_DIR = x    ; then
301f29dbc25Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
302f29dbc25Smrgfi
303f29dbc25Smrg
304f29dbc25Smrgif test x$LIB_MAN_SUFFIX = x    ; then
305f29dbc25Smrg    LIB_MAN_SUFFIX=3
306f29dbc25Smrgfi
307f29dbc25Smrgif test x$LIB_MAN_DIR = x    ; then
308f29dbc25Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
309f29dbc25Smrgfi
310f29dbc25Smrg
311f29dbc25Smrgif test x$FILE_MAN_SUFFIX = x    ; then
312f29dbc25Smrg    case $host_os in
313f29dbc25Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
314f29dbc25Smrg	*)		FILE_MAN_SUFFIX=5  ;;
315f29dbc25Smrg    esac
316f29dbc25Smrgfi
317f29dbc25Smrgif test x$FILE_MAN_DIR = x    ; then
318f29dbc25Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
319f29dbc25Smrgfi
320f29dbc25Smrg
321f29dbc25Smrgif test x$MISC_MAN_SUFFIX = x    ; then
322f29dbc25Smrg    case $host_os in
323f29dbc25Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
324f29dbc25Smrg	*)		MISC_MAN_SUFFIX=7  ;;
325f29dbc25Smrg    esac
326f29dbc25Smrgfi
327f29dbc25Smrgif test x$MISC_MAN_DIR = x    ; then
328f29dbc25Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
329f29dbc25Smrgfi
330f29dbc25Smrg
331f29dbc25Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
332f29dbc25Smrg    case $host_os in
333f29dbc25Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
334f29dbc25Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
335f29dbc25Smrg    esac
336f29dbc25Smrgfi
337f29dbc25Smrgif test x$DRIVER_MAN_DIR = x    ; then
338f29dbc25Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
339f29dbc25Smrgfi
340f29dbc25Smrg
341f29dbc25Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
342f29dbc25Smrg    case $host_os in
343f29dbc25Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
344f29dbc25Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
345f29dbc25Smrg    esac
346f29dbc25Smrgfi
347f29dbc25Smrgif test x$ADMIN_MAN_DIR = x    ; then
348f29dbc25Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
349f29dbc25Smrgfi
350f29dbc25Smrg
351f29dbc25Smrg
352f29dbc25SmrgAC_SUBST([APP_MAN_SUFFIX])
353f29dbc25SmrgAC_SUBST([LIB_MAN_SUFFIX])
354f29dbc25SmrgAC_SUBST([FILE_MAN_SUFFIX])
355f29dbc25SmrgAC_SUBST([MISC_MAN_SUFFIX])
356f29dbc25SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
357f29dbc25SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
358f29dbc25SmrgAC_SUBST([APP_MAN_DIR])
359f29dbc25SmrgAC_SUBST([LIB_MAN_DIR])
360f29dbc25SmrgAC_SUBST([FILE_MAN_DIR])
361f29dbc25SmrgAC_SUBST([MISC_MAN_DIR])
362f29dbc25SmrgAC_SUBST([DRIVER_MAN_DIR])
363f29dbc25SmrgAC_SUBST([ADMIN_MAN_DIR])
364170d5fdcSmrg
365170d5fdcSmrgXORG_MAN_PAGE="X Version 11"
366170d5fdcSmrgAC_SUBST([XORG_MAN_PAGE])
367170d5fdcSmrgMAN_SUBSTS="\
368170d5fdcSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
369170d5fdcSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
370170d5fdcSmrg	-e 's|__xservername__|Xorg|g' \
371170d5fdcSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
372170d5fdcSmrg	-e 's|__projectroot__|\$(prefix)|g' \
373170d5fdcSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
374170d5fdcSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
375170d5fdcSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
376170d5fdcSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
377170d5fdcSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
378170d5fdcSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
379170d5fdcSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
380170d5fdcSmrgAC_SUBST([MAN_SUBSTS])
381170d5fdcSmrg
382f29dbc25Smrg]) # XORG_MANPAGE_SECTIONS
383f29dbc25Smrg
384170d5fdcSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
385170d5fdcSmrg# ------------------------
386170d5fdcSmrg# Minimum version: 1.7.0
387170d5fdcSmrg#
388170d5fdcSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
389170d5fdcSmrg# provided by xorg-sgml-doctools, if installed.
390170d5fdcSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
391170d5fdcSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
392170d5fdcSmrgXORG_SGML_PATH=
393170d5fdcSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
394170d5fdcSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
395170d5fdcSmrg    [m4_ifval([$1],[:],
396170d5fdcSmrg        [if test x"$cross_compiling" != x"yes" ; then
397170d5fdcSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
398170d5fdcSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
399170d5fdcSmrg         fi])
400170d5fdcSmrg    ])
401170d5fdcSmrg
402170d5fdcSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
403170d5fdcSmrg# the path and the name of the doc stylesheet
404170d5fdcSmrgif test "x$XORG_SGML_PATH" != "x" ; then
405170d5fdcSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
406170d5fdcSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
407170d5fdcSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
408170d5fdcSmrgelse
409170d5fdcSmrg   AC_MSG_RESULT([no])
410170d5fdcSmrgfi
411170d5fdcSmrg
412170d5fdcSmrgAC_SUBST(XORG_SGML_PATH)
413170d5fdcSmrgAC_SUBST(STYLESHEET_SRCDIR)
414170d5fdcSmrgAC_SUBST(XSL_STYLESHEET)
415170d5fdcSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
416170d5fdcSmrg]) # XORG_CHECK_SGML_DOCTOOLS
417170d5fdcSmrg
418f29dbc25Smrg# XORG_CHECK_LINUXDOC
419f29dbc25Smrg# -------------------
420f29dbc25Smrg# Minimum version: 1.0.0
421f29dbc25Smrg#
422f29dbc25Smrg# Defines the variable MAKE_TEXT if the necessary tools and
423f29dbc25Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
424f29dbc25Smrg# Whether or not the necessary tools and files are found can be checked
425f29dbc25Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
426f29dbc25SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
427170d5fdcSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
428170d5fdcSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
429f29dbc25Smrg
430f29dbc25SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
431f29dbc25Smrg
432170d5fdcSmrgAC_MSG_CHECKING([whether to build documentation])
433f29dbc25Smrg
434170d5fdcSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
435f29dbc25Smrg   BUILDDOC=yes
436f29dbc25Smrgelse
437f29dbc25Smrg   BUILDDOC=no
438f29dbc25Smrgfi
439f29dbc25Smrg
440f29dbc25SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
441f29dbc25Smrg
442f29dbc25SmrgAC_MSG_RESULT([$BUILDDOC])
443f29dbc25Smrg
444170d5fdcSmrgAC_MSG_CHECKING([whether to build pdf documentation])
445f29dbc25Smrg
446170d5fdcSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
447f29dbc25Smrg   BUILDPDFDOC=yes
448f29dbc25Smrgelse
449f29dbc25Smrg   BUILDPDFDOC=no
450f29dbc25Smrgfi
451f29dbc25Smrg
452f29dbc25SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
453f29dbc25Smrg
454f29dbc25SmrgAC_MSG_RESULT([$BUILDPDFDOC])
455f29dbc25Smrg
456170d5fdcSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
457f29dbc25SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
458f29dbc25SmrgMAKE_PDF="$PS2PDF"
459f29dbc25SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
460f29dbc25Smrg
461f29dbc25SmrgAC_SUBST(MAKE_TEXT)
462f29dbc25SmrgAC_SUBST(MAKE_PS)
463f29dbc25SmrgAC_SUBST(MAKE_PDF)
464f29dbc25SmrgAC_SUBST(MAKE_HTML)
465f29dbc25Smrg]) # XORG_CHECK_LINUXDOC
466f29dbc25Smrg
467f29dbc25Smrg# XORG_CHECK_DOCBOOK
468f29dbc25Smrg# -------------------
469f29dbc25Smrg# Minimum version: 1.0.0
470f29dbc25Smrg#
471f29dbc25Smrg# Checks for the ability to build output formats from SGML DocBook source.
472f29dbc25Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
473f29dbc25Smrg# indicates whether the necessary tools and files are found and, if set,
474f29dbc25Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
475f29dbc25SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
476170d5fdcSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
477170d5fdcSmrg
478f29dbc25SmrgBUILDTXTDOC=no
479f29dbc25SmrgBUILDPDFDOC=no
480f29dbc25SmrgBUILDPSDOC=no
481f29dbc25SmrgBUILDHTMLDOC=no
482f29dbc25Smrg
483f29dbc25SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
484f29dbc25SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
485f29dbc25SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
486f29dbc25SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
487f29dbc25Smrg
488170d5fdcSmrgAC_MSG_CHECKING([whether to build text documentation])
489170d5fdcSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
490f29dbc25Smrg   test x$BUILD_TXTDOC != xno; then
491f29dbc25Smrg	BUILDTXTDOC=yes
492f29dbc25Smrgfi
493f29dbc25SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
494f29dbc25SmrgAC_MSG_RESULT([$BUILDTXTDOC])
495f29dbc25Smrg
496170d5fdcSmrgAC_MSG_CHECKING([whether to build PDF documentation])
497170d5fdcSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
498f29dbc25Smrg   test x$BUILD_PDFDOC != xno; then
499f29dbc25Smrg	BUILDPDFDOC=yes
500f29dbc25Smrgfi
501f29dbc25SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
502f29dbc25SmrgAC_MSG_RESULT([$BUILDPDFDOC])
503f29dbc25Smrg
504170d5fdcSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
505170d5fdcSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
506f29dbc25Smrg   test x$BUILD_PSDOC != xno; then
507f29dbc25Smrg	BUILDPSDOC=yes
508f29dbc25Smrgfi
509f29dbc25SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
510f29dbc25SmrgAC_MSG_RESULT([$BUILDPSDOC])
511f29dbc25Smrg
512170d5fdcSmrgAC_MSG_CHECKING([whether to build HTML documentation])
513170d5fdcSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
514f29dbc25Smrg   test x$BUILD_HTMLDOC != xno; then
515f29dbc25Smrg	BUILDHTMLDOC=yes
516f29dbc25Smrgfi
517f29dbc25SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
518f29dbc25SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
519f29dbc25Smrg
520f29dbc25SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
521f29dbc25SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
522f29dbc25SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
523f29dbc25SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
524f29dbc25Smrg
525f29dbc25SmrgAC_SUBST(MAKE_TEXT)
526f29dbc25SmrgAC_SUBST(MAKE_PS)
527f29dbc25SmrgAC_SUBST(MAKE_PDF)
528f29dbc25SmrgAC_SUBST(MAKE_HTML)
529f29dbc25Smrg]) # XORG_CHECK_DOCBOOK
530f29dbc25Smrg
531170d5fdcSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
532f29dbc25Smrg# ----------------
533f29dbc25Smrg# Minimum version: 1.5.0
534170d5fdcSmrg# Minimum version for optional DEFAULT argument: 1.11.0
535f29dbc25Smrg#
536f29dbc25Smrg# Documentation tools are not always available on all platforms and sometimes
537f29dbc25Smrg# not at the appropriate level. This macro enables a module to test for the
538f29dbc25Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
539f29dbc25Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
540170d5fdcSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
541170d5fdcSmrg# --with-xmlto assumes 'auto'.
542f29dbc25Smrg#
543f29dbc25Smrg# Interface to module:
544f29dbc25Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
545f29dbc25Smrg# XMLTO:	returns the path of the xmlto program found
546f29dbc25Smrg#		returns the path set by the user in the environment
547f29dbc25Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
548f29dbc25Smrg#		'no' user instructs the module not to use xmlto
549f29dbc25Smrg#
550170d5fdcSmrg# Added in version 1.10.0
551170d5fdcSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
552170d5fdcSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
553170d5fdcSmrg#
554f29dbc25Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
555f29dbc25Smrg#
556f29dbc25SmrgAC_DEFUN([XORG_WITH_XMLTO],[
557f29dbc25SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
558170d5fdcSmrgm4_define([_defopt], m4_default([$2], [auto]))
559f29dbc25SmrgAC_ARG_WITH(xmlto,
560f29dbc25Smrg	AS_HELP_STRING([--with-xmlto],
561170d5fdcSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
562170d5fdcSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
563170d5fdcSmrgm4_undefine([_defopt])
564f29dbc25Smrg
565f29dbc25Smrgif test "x$use_xmlto" = x"auto"; then
566f29dbc25Smrg   AC_PATH_PROG([XMLTO], [xmlto])
567f29dbc25Smrg   if test "x$XMLTO" = "x"; then
568f29dbc25Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
569f29dbc25Smrg	have_xmlto=no
570f29dbc25Smrg   else
571f29dbc25Smrg        have_xmlto=yes
572f29dbc25Smrg   fi
573f29dbc25Smrgelif test "x$use_xmlto" = x"yes" ; then
574f29dbc25Smrg   AC_PATH_PROG([XMLTO], [xmlto])
575f29dbc25Smrg   if test "x$XMLTO" = "x"; then
576f29dbc25Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
577f29dbc25Smrg   fi
578f29dbc25Smrg   have_xmlto=yes
579f29dbc25Smrgelif test "x$use_xmlto" = x"no" ; then
580f29dbc25Smrg   if test "x$XMLTO" != "x"; then
581f29dbc25Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
582f29dbc25Smrg   fi
583f29dbc25Smrg   have_xmlto=no
584f29dbc25Smrgelse
585f29dbc25Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
586f29dbc25Smrgfi
587170d5fdcSmrg
588170d5fdcSmrg# Test for a minimum version of xmlto, if provided.
589170d5fdcSmrgm4_ifval([$1],
590170d5fdcSmrg[if test "$have_xmlto" = yes; then
591170d5fdcSmrg    # scrape the xmlto version
592170d5fdcSmrg    AC_MSG_CHECKING([the xmlto version])
593170d5fdcSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
594170d5fdcSmrg    AC_MSG_RESULT([$xmlto_version])
595170d5fdcSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
596170d5fdcSmrg        [if test "x$use_xmlto" = xauto; then
597170d5fdcSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
598170d5fdcSmrg            have_xmlto=no
599170d5fdcSmrg        else
600170d5fdcSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
601170d5fdcSmrg        fi])
602170d5fdcSmrgfi])
603170d5fdcSmrg
60404007ebaSmrg# Test for the ability of xmlto to generate a text target
60504007ebaSmrghave_xmlto_text=no
60604007ebaSmrgcat > conftest.xml << "EOF"
60704007ebaSmrgEOF
60804007ebaSmrgAS_IF([test "$have_xmlto" = yes],
60904007ebaSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
61004007ebaSmrg             [have_xmlto_text=yes],
61104007ebaSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
61204007ebaSmrgrm -f conftest.xml
61304007ebaSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
61404007ebaSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
61504007ebaSmrg]) # XORG_WITH_XMLTO
61604007ebaSmrg
61704007ebaSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
61804007ebaSmrg# --------------------------------------------
61904007ebaSmrg# Minimum version: 1.12.0
62004007ebaSmrg# Minimum version for optional DEFAULT argument: 1.12.0
62104007ebaSmrg#
62204007ebaSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
62304007ebaSmrg# XML-based language used for the transformation of XML documents.
62404007ebaSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
62504007ebaSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
62604007ebaSmrg# The XSLT processor is often used as a standalone tool for transformations.
62704007ebaSmrg# It should not be assumed that this tool is used only to work with documnetation.
62804007ebaSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
62904007ebaSmrg#
63004007ebaSmrg# Interface to module:
63104007ebaSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
63204007ebaSmrg# XSLTPROC:	 returns the path of the xsltproc program found
63304007ebaSmrg#		 returns the path set by the user in the environment
63404007ebaSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
63504007ebaSmrg#		  'no' user instructs the module not to use xsltproc
63604007ebaSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
63704007ebaSmrg#
63804007ebaSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
63904007ebaSmrg#
64004007ebaSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
64104007ebaSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
64204007ebaSmrg# Preserves the interface, should it be implemented later
64304007ebaSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
64404007ebaSmrgm4_define([_defopt], m4_default([$2], [auto]))
64504007ebaSmrgAC_ARG_WITH(xsltproc,
64604007ebaSmrg	AS_HELP_STRING([--with-xsltproc],
64704007ebaSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
64804007ebaSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
64904007ebaSmrgm4_undefine([_defopt])
65004007ebaSmrg
65104007ebaSmrgif test "x$use_xsltproc" = x"auto"; then
65204007ebaSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
65304007ebaSmrg   if test "x$XSLTPROC" = "x"; then
65404007ebaSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
65504007ebaSmrg	have_xsltproc=no
65604007ebaSmrg   else
65704007ebaSmrg        have_xsltproc=yes
65804007ebaSmrg   fi
65904007ebaSmrgelif test "x$use_xsltproc" = x"yes" ; then
66004007ebaSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
66104007ebaSmrg   if test "x$XSLTPROC" = "x"; then
66204007ebaSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
66304007ebaSmrg   fi
66404007ebaSmrg   have_xsltproc=yes
66504007ebaSmrgelif test "x$use_xsltproc" = x"no" ; then
66604007ebaSmrg   if test "x$XSLTPROC" != "x"; then
66704007ebaSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
66804007ebaSmrg   fi
66904007ebaSmrg   have_xsltproc=no
67004007ebaSmrgelse
67104007ebaSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
67204007ebaSmrgfi
67304007ebaSmrg
67404007ebaSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
67504007ebaSmrg]) # XORG_WITH_XSLTPROC
67604007ebaSmrg
67704007ebaSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
67804007ebaSmrg# ----------------------------------------
67904007ebaSmrg# Minimum version: 1.15.0
68004007ebaSmrg#
68104007ebaSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
68204007ebaSmrg# scanning arbitrary text files, extracting information from those text files,
68304007ebaSmrg# and printing reports based on that information.
68404007ebaSmrg#
68504007ebaSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
68604007ebaSmrg#
68704007ebaSmrg# Interface to module:
68804007ebaSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
68904007ebaSmrg# PERL:	     returns the path of the perl program found
69004007ebaSmrg#	     returns the path set by the user in the environment
69104007ebaSmrg# --with-perl: 'yes' user instructs the module to use perl
69204007ebaSmrg#	       'no' user instructs the module not to use perl
69304007ebaSmrg# have_perl: returns yes if perl found in PATH or no
69404007ebaSmrg#
69504007ebaSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
69604007ebaSmrg#
69704007ebaSmrgAC_DEFUN([XORG_WITH_PERL],[
69804007ebaSmrgAC_ARG_VAR([PERL], [Path to perl command])
69904007ebaSmrg# Preserves the interface, should it be implemented later
70004007ebaSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
70104007ebaSmrgm4_define([_defopt], m4_default([$2], [auto]))
70204007ebaSmrgAC_ARG_WITH(perl,
70304007ebaSmrg	AS_HELP_STRING([--with-perl],
70404007ebaSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
70504007ebaSmrg	   [use_perl=$withval], [use_perl=]_defopt)
70604007ebaSmrgm4_undefine([_defopt])
70704007ebaSmrg
70804007ebaSmrgif test "x$use_perl" = x"auto"; then
70904007ebaSmrg   AC_PATH_PROG([PERL], [perl])
71004007ebaSmrg   if test "x$PERL" = "x"; then
71104007ebaSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
71204007ebaSmrg	have_perl=no
71304007ebaSmrg   else
71404007ebaSmrg        have_perl=yes
71504007ebaSmrg   fi
71604007ebaSmrgelif test "x$use_perl" = x"yes" ; then
71704007ebaSmrg   AC_PATH_PROG([PERL], [perl])
71804007ebaSmrg   if test "x$PERL" = "x"; then
71904007ebaSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
72004007ebaSmrg   fi
72104007ebaSmrg   have_perl=yes
72204007ebaSmrgelif test "x$use_perl" = x"no" ; then
72304007ebaSmrg   if test "x$PERL" != "x"; then
72404007ebaSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
72504007ebaSmrg   fi
72604007ebaSmrg   have_perl=no
72704007ebaSmrgelse
72804007ebaSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
72904007ebaSmrgfi
73004007ebaSmrg
73104007ebaSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
73204007ebaSmrg]) # XORG_WITH_PERL
733f29dbc25Smrg
734170d5fdcSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
735f29dbc25Smrg# ----------------
736f29dbc25Smrg# Minimum version: 1.5.0
737170d5fdcSmrg# Minimum version for optional DEFAULT argument: 1.11.0
738f29dbc25Smrg#
739f29dbc25Smrg# Documentation tools are not always available on all platforms and sometimes
740f29dbc25Smrg# not at the appropriate level. This macro enables a module to test for the
741f29dbc25Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
742f29dbc25Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
743170d5fdcSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
744170d5fdcSmrg# --with-asciidoc assumes 'auto'.
745f29dbc25Smrg#
746f29dbc25Smrg# Interface to module:
747f29dbc25Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
748f29dbc25Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
749f29dbc25Smrg#		 returns the path set by the user in the environment
750f29dbc25Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
751f29dbc25Smrg#		  'no' user instructs the module not to use asciidoc
752f29dbc25Smrg#
753f29dbc25Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
754f29dbc25Smrg#
755f29dbc25SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
756f29dbc25SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
757170d5fdcSmrgm4_define([_defopt], m4_default([$2], [auto]))
758f29dbc25SmrgAC_ARG_WITH(asciidoc,
759f29dbc25Smrg	AS_HELP_STRING([--with-asciidoc],
760170d5fdcSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
761170d5fdcSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
762170d5fdcSmrgm4_undefine([_defopt])
763f29dbc25Smrg
764f29dbc25Smrgif test "x$use_asciidoc" = x"auto"; then
765f29dbc25Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
766f29dbc25Smrg   if test "x$ASCIIDOC" = "x"; then
767f29dbc25Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
768f29dbc25Smrg	have_asciidoc=no
769f29dbc25Smrg   else
770f29dbc25Smrg        have_asciidoc=yes
771f29dbc25Smrg   fi
772f29dbc25Smrgelif test "x$use_asciidoc" = x"yes" ; then
773f29dbc25Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
774f29dbc25Smrg   if test "x$ASCIIDOC" = "x"; then
775f29dbc25Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
776f29dbc25Smrg   fi
777f29dbc25Smrg   have_asciidoc=yes
778f29dbc25Smrgelif test "x$use_asciidoc" = x"no" ; then
779f29dbc25Smrg   if test "x$ASCIIDOC" != "x"; then
780f29dbc25Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
781f29dbc25Smrg   fi
782f29dbc25Smrg   have_asciidoc=no
783f29dbc25Smrgelse
784f29dbc25Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
785f29dbc25Smrgfi
786170d5fdcSmrgm4_ifval([$1],
787170d5fdcSmrg[if test "$have_asciidoc" = yes; then
788170d5fdcSmrg    # scrape the asciidoc version
789170d5fdcSmrg    AC_MSG_CHECKING([the asciidoc version])
790170d5fdcSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
791170d5fdcSmrg    AC_MSG_RESULT([$asciidoc_version])
792170d5fdcSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
793170d5fdcSmrg        [if test "x$use_asciidoc" = xauto; then
794170d5fdcSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
795170d5fdcSmrg            have_asciidoc=no
796170d5fdcSmrg        else
797170d5fdcSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
798170d5fdcSmrg        fi])
799170d5fdcSmrgfi])
800f29dbc25SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
801170d5fdcSmrg]) # XORG_WITH_ASCIIDOC
802f29dbc25Smrg
803170d5fdcSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
804170d5fdcSmrg# --------------------------------
805f29dbc25Smrg# Minimum version: 1.5.0
806170d5fdcSmrg# Minimum version for optional DEFAULT argument: 1.11.0
807f29dbc25Smrg#
808f29dbc25Smrg# Documentation tools are not always available on all platforms and sometimes
809f29dbc25Smrg# not at the appropriate level. This macro enables a module to test for the
810f29dbc25Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
811f29dbc25Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
812170d5fdcSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
813170d5fdcSmrg# --with-doxygen assumes 'auto'.
814f29dbc25Smrg#
815f29dbc25Smrg# Interface to module:
816f29dbc25Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
817f29dbc25Smrg# DOXYGEN:	 returns the path of the doxygen program found
818f29dbc25Smrg#		 returns the path set by the user in the environment
819f29dbc25Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
820f29dbc25Smrg#		  'no' user instructs the module not to use doxygen
821f29dbc25Smrg#
822f29dbc25Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
823f29dbc25Smrg#
824f29dbc25SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
825f29dbc25SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
826170d5fdcSmrgm4_define([_defopt], m4_default([$2], [auto]))
827f29dbc25SmrgAC_ARG_WITH(doxygen,
828f29dbc25Smrg	AS_HELP_STRING([--with-doxygen],
829170d5fdcSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
830170d5fdcSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
831170d5fdcSmrgm4_undefine([_defopt])
832f29dbc25Smrg
833f29dbc25Smrgif test "x$use_doxygen" = x"auto"; then
834f29dbc25Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
835f29dbc25Smrg   if test "x$DOXYGEN" = "x"; then
836f29dbc25Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
837f29dbc25Smrg	have_doxygen=no
838f29dbc25Smrg   else
839f29dbc25Smrg        have_doxygen=yes
840f29dbc25Smrg   fi
841f29dbc25Smrgelif test "x$use_doxygen" = x"yes" ; then
842f29dbc25Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
843f29dbc25Smrg   if test "x$DOXYGEN" = "x"; then
844f29dbc25Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
845f29dbc25Smrg   fi
846f29dbc25Smrg   have_doxygen=yes
847f29dbc25Smrgelif test "x$use_doxygen" = x"no" ; then
848f29dbc25Smrg   if test "x$DOXYGEN" != "x"; then
849f29dbc25Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
850f29dbc25Smrg   fi
851f29dbc25Smrg   have_doxygen=no
852f29dbc25Smrgelse
853f29dbc25Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
854f29dbc25Smrgfi
855170d5fdcSmrgm4_ifval([$1],
856170d5fdcSmrg[if test "$have_doxygen" = yes; then
857170d5fdcSmrg    # scrape the doxygen version
858170d5fdcSmrg    AC_MSG_CHECKING([the doxygen version])
859170d5fdcSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
860170d5fdcSmrg    AC_MSG_RESULT([$doxygen_version])
861170d5fdcSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
862170d5fdcSmrg        [if test "x$use_doxygen" = xauto; then
863170d5fdcSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
864170d5fdcSmrg            have_doxygen=no
865170d5fdcSmrg        else
866170d5fdcSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
867170d5fdcSmrg        fi])
868170d5fdcSmrgfi])
869f29dbc25SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
870170d5fdcSmrg]) # XORG_WITH_DOXYGEN
871170d5fdcSmrg
872170d5fdcSmrg# XORG_WITH_GROFF([DEFAULT])
873170d5fdcSmrg# ----------------
874170d5fdcSmrg# Minimum version: 1.6.0
875170d5fdcSmrg# Minimum version for optional DEFAULT argument: 1.11.0
876170d5fdcSmrg#
877170d5fdcSmrg# Documentation tools are not always available on all platforms and sometimes
878170d5fdcSmrg# not at the appropriate level. This macro enables a module to test for the
879170d5fdcSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
880170d5fdcSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
881170d5fdcSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
882170d5fdcSmrg# --with-groff assumes 'auto'.
883170d5fdcSmrg#
884170d5fdcSmrg# Interface to module:
885170d5fdcSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
886170d5fdcSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
887170d5fdcSmrg# HAVE_GROFF_MS: the -ms macros package
888170d5fdcSmrg# GROFF:	 returns the path of the groff program found
889170d5fdcSmrg#		 returns the path set by the user in the environment
890170d5fdcSmrg# --with-groff:	 'yes' user instructs the module to use groff
891170d5fdcSmrg#		 'no' user instructs the module not to use groff
892170d5fdcSmrg#
893170d5fdcSmrg# Added in version 1.9.0:
894170d5fdcSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
895170d5fdcSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
896170d5fdcSmrg#		   psselect from the psutils package.
897170d5fdcSmrg#		   the ghostcript package. Refer to the grohtml man pages
898170d5fdcSmrg#
899170d5fdcSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
900170d5fdcSmrg#
901170d5fdcSmrg# OS and distros often splits groff in a basic and full package, the former
902170d5fdcSmrg# having the groff program and the later having devices, fonts and macros
903170d5fdcSmrg# Checking for the groff executable is not enough.
904170d5fdcSmrg#
905170d5fdcSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
906170d5fdcSmrg# unset HAVE_GROFF or GROFF env variables.
907170d5fdcSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
908170d5fdcSmrg#
909170d5fdcSmrgAC_DEFUN([XORG_WITH_GROFF],[
910170d5fdcSmrgAC_ARG_VAR([GROFF], [Path to groff command])
911170d5fdcSmrgm4_define([_defopt], m4_default([$1], [auto]))
912170d5fdcSmrgAC_ARG_WITH(groff,
913170d5fdcSmrg	AS_HELP_STRING([--with-groff],
914170d5fdcSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
915170d5fdcSmrg	   [use_groff=$withval], [use_groff=]_defopt)
916170d5fdcSmrgm4_undefine([_defopt])
917170d5fdcSmrg
918170d5fdcSmrgif test "x$use_groff" = x"auto"; then
919170d5fdcSmrg   AC_PATH_PROG([GROFF], [groff])
920170d5fdcSmrg   if test "x$GROFF" = "x"; then
921170d5fdcSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
922170d5fdcSmrg	have_groff=no
923170d5fdcSmrg   else
924170d5fdcSmrg        have_groff=yes
925170d5fdcSmrg   fi
926170d5fdcSmrgelif test "x$use_groff" = x"yes" ; then
927170d5fdcSmrg   AC_PATH_PROG([GROFF], [groff])
928170d5fdcSmrg   if test "x$GROFF" = "x"; then
929170d5fdcSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
930170d5fdcSmrg   fi
931170d5fdcSmrg   have_groff=yes
932170d5fdcSmrgelif test "x$use_groff" = x"no" ; then
933170d5fdcSmrg   if test "x$GROFF" != "x"; then
934170d5fdcSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
935170d5fdcSmrg   fi
936170d5fdcSmrg   have_groff=no
937170d5fdcSmrgelse
938170d5fdcSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
939170d5fdcSmrgfi
940170d5fdcSmrg
941170d5fdcSmrg# We have groff, test for the presence of the macro packages
942170d5fdcSmrgif test "x$have_groff" = x"yes"; then
943170d5fdcSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
944170d5fdcSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
945170d5fdcSmrg        groff_ms_works=yes
946170d5fdcSmrg    else
947170d5fdcSmrg        groff_ms_works=no
948170d5fdcSmrg    fi
949170d5fdcSmrg    AC_MSG_RESULT([$groff_ms_works])
950170d5fdcSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
951170d5fdcSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
952170d5fdcSmrg        groff_mm_works=yes
953170d5fdcSmrg    else
954170d5fdcSmrg        groff_mm_works=no
955170d5fdcSmrg    fi
956170d5fdcSmrg    AC_MSG_RESULT([$groff_mm_works])
957170d5fdcSmrgfi
958170d5fdcSmrg
959170d5fdcSmrg# We have groff, test for HTML dependencies, one command per package
960170d5fdcSmrgif test "x$have_groff" = x"yes"; then
961170d5fdcSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
962170d5fdcSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
963170d5fdcSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
964170d5fdcSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
965170d5fdcSmrg      have_groff_html=yes
966170d5fdcSmrg   else
967170d5fdcSmrg      have_groff_html=no
968170d5fdcSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
969170d5fdcSmrg   fi
970170d5fdcSmrgfi
971170d5fdcSmrg
972170d5fdcSmrg# Set Automake conditionals for Makefiles
973170d5fdcSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
974170d5fdcSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
975170d5fdcSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
976170d5fdcSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
977170d5fdcSmrg]) # XORG_WITH_GROFF
978170d5fdcSmrg
97904007ebaSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
98004007ebaSmrg# ---------------------------------------
981170d5fdcSmrg# Minimum version: 1.6.0
982170d5fdcSmrg# Minimum version for optional DEFAULT argument: 1.11.0
98304007ebaSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
984170d5fdcSmrg#
985170d5fdcSmrg# Documentation tools are not always available on all platforms and sometimes
986170d5fdcSmrg# not at the appropriate level. This macro enables a module to test for the
987170d5fdcSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
988170d5fdcSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
989170d5fdcSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
990170d5fdcSmrg# --with-fop assumes 'auto'.
991170d5fdcSmrg#
992170d5fdcSmrg# Interface to module:
993170d5fdcSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
994170d5fdcSmrg# FOP:	 	returns the path of the fop program found
995170d5fdcSmrg#		returns the path set by the user in the environment
996170d5fdcSmrg# --with-fop: 	'yes' user instructs the module to use fop
997170d5fdcSmrg#		'no' user instructs the module not to use fop
998170d5fdcSmrg#
999170d5fdcSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1000170d5fdcSmrg#
1001170d5fdcSmrgAC_DEFUN([XORG_WITH_FOP],[
1002170d5fdcSmrgAC_ARG_VAR([FOP], [Path to fop command])
100304007ebaSmrgm4_define([_defopt], m4_default([$2], [auto]))
1004170d5fdcSmrgAC_ARG_WITH(fop,
1005170d5fdcSmrg	AS_HELP_STRING([--with-fop],
1006170d5fdcSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1007170d5fdcSmrg	   [use_fop=$withval], [use_fop=]_defopt)
1008170d5fdcSmrgm4_undefine([_defopt])
1009170d5fdcSmrg
1010170d5fdcSmrgif test "x$use_fop" = x"auto"; then
1011170d5fdcSmrg   AC_PATH_PROG([FOP], [fop])
1012170d5fdcSmrg   if test "x$FOP" = "x"; then
1013170d5fdcSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1014170d5fdcSmrg	have_fop=no
1015170d5fdcSmrg   else
1016170d5fdcSmrg        have_fop=yes
1017170d5fdcSmrg   fi
1018170d5fdcSmrgelif test "x$use_fop" = x"yes" ; then
1019170d5fdcSmrg   AC_PATH_PROG([FOP], [fop])
1020170d5fdcSmrg   if test "x$FOP" = "x"; then
1021170d5fdcSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1022170d5fdcSmrg   fi
1023170d5fdcSmrg   have_fop=yes
1024170d5fdcSmrgelif test "x$use_fop" = x"no" ; then
1025170d5fdcSmrg   if test "x$FOP" != "x"; then
1026170d5fdcSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1027170d5fdcSmrg   fi
1028170d5fdcSmrg   have_fop=no
1029170d5fdcSmrgelse
1030170d5fdcSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1031170d5fdcSmrgfi
103204007ebaSmrg
103304007ebaSmrg# Test for a minimum version of fop, if provided.
103404007ebaSmrgm4_ifval([$1],
103504007ebaSmrg[if test "$have_fop" = yes; then
103604007ebaSmrg    # scrape the fop version
103704007ebaSmrg    AC_MSG_CHECKING([for fop minimum version])
103804007ebaSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
103904007ebaSmrg    AC_MSG_RESULT([$fop_version])
104004007ebaSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
104104007ebaSmrg        [if test "x$use_fop" = xauto; then
104204007ebaSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
104304007ebaSmrg            have_fop=no
104404007ebaSmrg        else
104504007ebaSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
104604007ebaSmrg        fi])
104704007ebaSmrgfi])
1048170d5fdcSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1049170d5fdcSmrg]) # XORG_WITH_FOP
1050170d5fdcSmrg
1051170d5fdcSmrg# XORG_WITH_PS2PDF([DEFAULT])
1052170d5fdcSmrg# ----------------
1053170d5fdcSmrg# Minimum version: 1.6.0
1054170d5fdcSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1055170d5fdcSmrg#
1056170d5fdcSmrg# Documentation tools are not always available on all platforms and sometimes
1057170d5fdcSmrg# not at the appropriate level. This macro enables a module to test for the
1058170d5fdcSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1059170d5fdcSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1060170d5fdcSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1061170d5fdcSmrg# --with-ps2pdf assumes 'auto'.
1062170d5fdcSmrg#
1063170d5fdcSmrg# Interface to module:
1064170d5fdcSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1065170d5fdcSmrg# PS2PDF:	returns the path of the ps2pdf program found
1066170d5fdcSmrg#		returns the path set by the user in the environment
1067170d5fdcSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1068170d5fdcSmrg#		 'no' user instructs the module not to use ps2pdf
1069170d5fdcSmrg#
1070170d5fdcSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1071170d5fdcSmrg#
1072170d5fdcSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1073170d5fdcSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1074170d5fdcSmrgm4_define([_defopt], m4_default([$1], [auto]))
1075170d5fdcSmrgAC_ARG_WITH(ps2pdf,
1076170d5fdcSmrg	AS_HELP_STRING([--with-ps2pdf],
1077170d5fdcSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1078170d5fdcSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1079170d5fdcSmrgm4_undefine([_defopt])
1080170d5fdcSmrg
1081170d5fdcSmrgif test "x$use_ps2pdf" = x"auto"; then
1082170d5fdcSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1083170d5fdcSmrg   if test "x$PS2PDF" = "x"; then
1084170d5fdcSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1085170d5fdcSmrg	have_ps2pdf=no
1086170d5fdcSmrg   else
1087170d5fdcSmrg        have_ps2pdf=yes
1088170d5fdcSmrg   fi
1089170d5fdcSmrgelif test "x$use_ps2pdf" = x"yes" ; then
1090170d5fdcSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1091170d5fdcSmrg   if test "x$PS2PDF" = "x"; then
1092170d5fdcSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1093170d5fdcSmrg   fi
1094170d5fdcSmrg   have_ps2pdf=yes
1095170d5fdcSmrgelif test "x$use_ps2pdf" = x"no" ; then
1096170d5fdcSmrg   if test "x$PS2PDF" != "x"; then
1097170d5fdcSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1098170d5fdcSmrg   fi
1099170d5fdcSmrg   have_ps2pdf=no
1100170d5fdcSmrgelse
1101170d5fdcSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1102170d5fdcSmrgfi
1103170d5fdcSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1104170d5fdcSmrg]) # XORG_WITH_PS2PDF
1105170d5fdcSmrg
1106170d5fdcSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
1107170d5fdcSmrg# ----------------
1108170d5fdcSmrg# Minimum version: 1.6.0
1109170d5fdcSmrg#
1110170d5fdcSmrg# Documentation tools are not always available on all platforms and sometimes
1111170d5fdcSmrg# not at the appropriate level. This macro enables a builder to skip all
1112170d5fdcSmrg# documentation targets except traditional man pages.
1113170d5fdcSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1114170d5fdcSmrg# maximum flexibilty in controlling documentation building.
1115170d5fdcSmrg# Refer to:
1116170d5fdcSmrg# XORG_WITH_XMLTO         --with-xmlto
1117170d5fdcSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1118170d5fdcSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1119170d5fdcSmrg# XORG_WITH_FOP           --with-fop
1120170d5fdcSmrg# XORG_WITH_GROFF         --with-groff
1121170d5fdcSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1122170d5fdcSmrg#
1123170d5fdcSmrg# Interface to module:
1124170d5fdcSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1125170d5fdcSmrg# --enable-docs: 'yes' user instructs the module to generate docs
1126170d5fdcSmrg#		 'no' user instructs the module not to generate docs
1127170d5fdcSmrg# parm1:	specify the default value, yes or no.
1128170d5fdcSmrg#
1129170d5fdcSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
113004007ebaSmrgm4_define([docs_default], m4_default([$1], [yes]))
1131170d5fdcSmrgAC_ARG_ENABLE(docs,
1132170d5fdcSmrg	AS_HELP_STRING([--enable-docs],
113304007ebaSmrg	   [Enable building the documentation (default: ]docs_default[)]),
113404007ebaSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
113504007ebaSmrgm4_undefine([docs_default])
1136170d5fdcSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1137170d5fdcSmrgAC_MSG_CHECKING([whether to build documentation])
1138170d5fdcSmrgAC_MSG_RESULT([$build_docs])
1139170d5fdcSmrg]) # XORG_ENABLE_DOCS
1140170d5fdcSmrg
1141170d5fdcSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1142170d5fdcSmrg# ----------------
1143170d5fdcSmrg# Minimum version: 1.6.0
1144170d5fdcSmrg#
1145170d5fdcSmrg# This macro enables a builder to skip all developer documentation.
1146170d5fdcSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1147170d5fdcSmrg# maximum flexibilty in controlling documentation building.
1148170d5fdcSmrg# Refer to:
1149170d5fdcSmrg# XORG_WITH_XMLTO         --with-xmlto
1150170d5fdcSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1151170d5fdcSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1152170d5fdcSmrg# XORG_WITH_FOP           --with-fop
1153170d5fdcSmrg# XORG_WITH_GROFF         --with-groff
1154170d5fdcSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1155170d5fdcSmrg#
1156170d5fdcSmrg# Interface to module:
1157170d5fdcSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1158170d5fdcSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1159170d5fdcSmrg#			'no' user instructs the module not to generate developer docs
1160170d5fdcSmrg# parm1:		specify the default value, yes or no.
1161170d5fdcSmrg#
1162170d5fdcSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1163170d5fdcSmrgm4_define([devel_default], m4_default([$1], [yes]))
1164170d5fdcSmrgAC_ARG_ENABLE(devel-docs,
1165170d5fdcSmrg	AS_HELP_STRING([--enable-devel-docs],
1166170d5fdcSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1167170d5fdcSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1168170d5fdcSmrgm4_undefine([devel_default])
1169170d5fdcSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1170170d5fdcSmrgAC_MSG_CHECKING([whether to build developer documentation])
1171170d5fdcSmrgAC_MSG_RESULT([$build_devel_docs])
1172170d5fdcSmrg]) # XORG_ENABLE_DEVEL_DOCS
1173170d5fdcSmrg
1174170d5fdcSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
1175170d5fdcSmrg# ----------------
1176170d5fdcSmrg# Minimum version: 1.6.0
1177170d5fdcSmrg#
1178170d5fdcSmrg# This macro enables a builder to skip all functional specification targets.
1179170d5fdcSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1180170d5fdcSmrg# maximum flexibilty in controlling documentation building.
1181170d5fdcSmrg# Refer to:
1182170d5fdcSmrg# XORG_WITH_XMLTO         --with-xmlto
1183170d5fdcSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1184170d5fdcSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1185170d5fdcSmrg# XORG_WITH_FOP           --with-fop
1186170d5fdcSmrg# XORG_WITH_GROFF         --with-groff
1187170d5fdcSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1188170d5fdcSmrg#
1189170d5fdcSmrg# Interface to module:
1190170d5fdcSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1191170d5fdcSmrg# --enable-specs:	'yes' user instructs the module to generate specs
1192170d5fdcSmrg#			'no' user instructs the module not to generate specs
1193170d5fdcSmrg# parm1:		specify the default value, yes or no.
1194170d5fdcSmrg#
1195170d5fdcSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1196170d5fdcSmrgm4_define([spec_default], m4_default([$1], [yes]))
1197170d5fdcSmrgAC_ARG_ENABLE(specs,
1198170d5fdcSmrg	AS_HELP_STRING([--enable-specs],
1199170d5fdcSmrg	   [Enable building the specs (default: ]spec_default[)]),
1200170d5fdcSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
1201170d5fdcSmrgm4_undefine([spec_default])
1202170d5fdcSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1203170d5fdcSmrgAC_MSG_CHECKING([whether to build functional specifications])
1204170d5fdcSmrgAC_MSG_RESULT([$build_specs])
1205170d5fdcSmrg]) # XORG_ENABLE_SPECS
1206f29dbc25Smrg
120704007ebaSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
120804007ebaSmrg# ----------------------------------------------
120904007ebaSmrg# Minimum version: 1.13.0
121004007ebaSmrg#
121104007ebaSmrg# This macro enables a builder to enable/disable unit testing
121204007ebaSmrg# It makes no assumption about the test cases implementation
121304007ebaSmrg# Test cases may or may not use Automake "Support for test suites"
121404007ebaSmrg# They may or may not use the software utility library GLib
121504007ebaSmrg#
121604007ebaSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
121704007ebaSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
121804007ebaSmrg# The variable enable_unit_tests is used by other macros in this file.
121904007ebaSmrg#
122004007ebaSmrg# Interface to module:
122104007ebaSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
122204007ebaSmrg# enable_unit_tests:    used in configure.ac for additional configuration
122304007ebaSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
122404007ebaSmrg#			'no' user instructs the module not to build tests
122504007ebaSmrg# parm1:		specify the default value, yes or no.
122604007ebaSmrg#
122704007ebaSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
122804007ebaSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
122904007ebaSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
123004007ebaSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
123104007ebaSmrgm4_define([_defopt], m4_default([$1], [auto]))
123204007ebaSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
123304007ebaSmrg	[Enable building unit test cases (default: ]_defopt[)]),
123404007ebaSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
123504007ebaSmrgm4_undefine([_defopt])
123604007ebaSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
123704007ebaSmrgAC_MSG_CHECKING([whether to build unit test cases])
123804007ebaSmrgAC_MSG_RESULT([$enable_unit_tests])
123904007ebaSmrg]) # XORG_ENABLE_UNIT_TESTS
124004007ebaSmrg
124104007ebaSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
124204007ebaSmrg# ------------------------------------------------------
124304007ebaSmrg# Minimum version: 1.17.0
124404007ebaSmrg#
124504007ebaSmrg# This macro enables a builder to enable/disable integration testing
124604007ebaSmrg# It makes no assumption about the test cases' implementation
124704007ebaSmrg# Test cases may or may not use Automake "Support for test suites"
124804007ebaSmrg#
124904007ebaSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
125004007ebaSmrg# usually requires less dependencies and may be built and run under less
125104007ebaSmrg# stringent environments than integration tests.
125204007ebaSmrg#
125304007ebaSmrg# Interface to module:
125404007ebaSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
125504007ebaSmrg# enable_integration_tests:   used in configure.ac for additional configuration
125604007ebaSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
125704007ebaSmrg#                             'no' user instructs the module not to build tests
125804007ebaSmrg# parm1:                      specify the default value, yes or no.
125904007ebaSmrg#
126004007ebaSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
126104007ebaSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
126204007ebaSmrgm4_define([_defopt], m4_default([$1], [auto]))
126304007ebaSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
126404007ebaSmrg	[Enable building integration test cases (default: ]_defopt[)]),
126504007ebaSmrg	[enable_integration_tests=$enableval],
126604007ebaSmrg	[enable_integration_tests=]_defopt)
126704007ebaSmrgm4_undefine([_defopt])
126804007ebaSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
126904007ebaSmrg	[test "x$enable_integration_tests" != xno])
127004007ebaSmrgAC_MSG_CHECKING([whether to build unit test cases])
127104007ebaSmrgAC_MSG_RESULT([$enable_integration_tests])
127204007ebaSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
127304007ebaSmrg
127404007ebaSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
127504007ebaSmrg# ----------------------------------------
127604007ebaSmrg# Minimum version: 1.13.0
127704007ebaSmrg#
127804007ebaSmrg# GLib is a library which provides advanced data structures and functions.
127904007ebaSmrg# This macro enables a module to test for the presence of Glib.
128004007ebaSmrg#
128104007ebaSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
128204007ebaSmrg# Otherwise the value of $enable_unit_tests is blank.
128304007ebaSmrg#
128404007ebaSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
128504007ebaSmrg# test support usually requires less dependencies and may be built and run under
128604007ebaSmrg# less stringent environments than integration tests.
128704007ebaSmrg#
128804007ebaSmrg# Interface to module:
128904007ebaSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
129004007ebaSmrg# with_glib: used in configure.ac to know if GLib has been found
129104007ebaSmrg# --with-glib:	'yes' user instructs the module to use glib
129204007ebaSmrg#		'no' user instructs the module not to use glib
129304007ebaSmrg#
129404007ebaSmrgAC_DEFUN([XORG_WITH_GLIB],[
129504007ebaSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
129604007ebaSmrgm4_define([_defopt], m4_default([$2], [auto]))
129704007ebaSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
129804007ebaSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
129904007ebaSmrg	[with_glib=$withval], [with_glib=]_defopt)
130004007ebaSmrgm4_undefine([_defopt])
130104007ebaSmrg
130204007ebaSmrghave_glib=no
130304007ebaSmrg# Do not probe GLib if user explicitly disabled unit testing
130404007ebaSmrgif test "x$enable_unit_tests" != x"no"; then
130504007ebaSmrg  # Do not probe GLib if user explicitly disabled it
130604007ebaSmrg  if test "x$with_glib" != x"no"; then
130704007ebaSmrg    m4_ifval(
130804007ebaSmrg      [$1],
130904007ebaSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
131004007ebaSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
131104007ebaSmrg    )
131204007ebaSmrg  fi
131304007ebaSmrgfi
131404007ebaSmrg
131504007ebaSmrg# Not having GLib when unit testing has been explicitly requested is an error
131604007ebaSmrgif test "x$enable_unit_tests" = x"yes"; then
131704007ebaSmrg  if test "x$have_glib" = x"no"; then
131804007ebaSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
131904007ebaSmrg  fi
132004007ebaSmrgfi
132104007ebaSmrg
132204007ebaSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
132304007ebaSmrgif test "x$enable_unit_tests" = x"no"; then
132404007ebaSmrg  if test "x$with_glib" = x"yes"; then
132504007ebaSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
132604007ebaSmrg  fi
132704007ebaSmrgfi
132804007ebaSmrg
132904007ebaSmrg# Not having GLib when it has been explicitly requested is an error
133004007ebaSmrgif test "x$with_glib" = x"yes"; then
133104007ebaSmrg  if test "x$have_glib" = x"no"; then
133204007ebaSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
133304007ebaSmrg  fi
133404007ebaSmrgfi
133504007ebaSmrg
133604007ebaSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
133704007ebaSmrg]) # XORG_WITH_GLIB
133804007ebaSmrg
133904007ebaSmrg# XORG_LD_WRAP([required|optional])
134004007ebaSmrg# ---------------------------------
134104007ebaSmrg# Minimum version: 1.13.0
134204007ebaSmrg#
134304007ebaSmrg# Check if linker supports -wrap, passed via compiler flags
134404007ebaSmrg#
134504007ebaSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
134604007ebaSmrg# Otherwise the value of $enable_unit_tests is blank.
134704007ebaSmrg#
134804007ebaSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
134904007ebaSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
135004007ebaSmrg# available, an argument of "optional" allows use when some unit tests require
135104007ebaSmrg# ld -wrap and others do not.
135204007ebaSmrg#
135304007ebaSmrgAC_DEFUN([XORG_LD_WRAP],[
135404007ebaSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
135504007ebaSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
135604007ebaSmrg                      void __wrap_exit(int status) { return; }],
135704007ebaSmrg                     [exit(0);])])
135804007ebaSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
135904007ebaSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
136004007ebaSmrg  if test "x$have_ld_wrap" = x"no"; then
136104007ebaSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
136204007ebaSmrg  fi
136304007ebaSmrgfi
136404007ebaSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
136504007ebaSmrg#
136604007ebaSmrg]) # XORG_LD_WRAP
136704007ebaSmrg
136804007ebaSmrg# XORG_CHECK_LINKER_FLAGS
136904007ebaSmrg# -----------------------
137004007ebaSmrg# SYNOPSIS
137104007ebaSmrg#
137204007ebaSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
137304007ebaSmrg#
137404007ebaSmrg# DESCRIPTION
137504007ebaSmrg#
137604007ebaSmrg#   Check whether the given linker FLAGS work with the current language's
137704007ebaSmrg#   linker, or whether they give an error.
137804007ebaSmrg#
137904007ebaSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
138004007ebaSmrg#   success/failure.
138104007ebaSmrg#
138204007ebaSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
138304007ebaSmrg#
138404007ebaSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
138504007ebaSmrg#
138604007ebaSmrg# LICENSE
138704007ebaSmrg#
138804007ebaSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
138904007ebaSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
139004007ebaSmrg#   Copyright (c) 2009 Matteo Frigo
139104007ebaSmrg#
139204007ebaSmrg#   This program is free software: you can redistribute it and/or modify it
139304007ebaSmrg#   under the terms of the GNU General Public License as published by the
139404007ebaSmrg#   Free Software Foundation, either version 3 of the License, or (at your
139504007ebaSmrg#   option) any later version.
139604007ebaSmrg#
139704007ebaSmrg#   This program is distributed in the hope that it will be useful, but
139804007ebaSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
139904007ebaSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
140004007ebaSmrg#   Public License for more details.
140104007ebaSmrg#
140204007ebaSmrg#   You should have received a copy of the GNU General Public License along
140304007ebaSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
140404007ebaSmrg#
140504007ebaSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
140604007ebaSmrg#   gives unlimited permission to copy, distribute and modify the configure
140704007ebaSmrg#   scripts that are the output of Autoconf when processing the Macro. You
140804007ebaSmrg#   need not follow the terms of the GNU General Public License when using
140904007ebaSmrg#   or distributing such scripts, even though portions of the text of the
141004007ebaSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
141104007ebaSmrg#   all other use of the material that constitutes the Autoconf Macro.
141204007ebaSmrg#
141304007ebaSmrg#   This special exception to the GPL applies to versions of the Autoconf
141404007ebaSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
141504007ebaSmrg#   modified version of the Autoconf Macro, you may extend this special
141604007ebaSmrg#   exception to the GPL to apply to your modified version as well.#
141704007ebaSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
141804007ebaSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
141904007ebaSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
142004007ebaSmrgAS_LITERAL_IF([$1],
142104007ebaSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
142204007ebaSmrg      ax_save_FLAGS=$LDFLAGS
142304007ebaSmrg      LDFLAGS="$1"
142404007ebaSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
142504007ebaSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
142604007ebaSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
142704007ebaSmrg      LDFLAGS=$ax_save_FLAGS])],
142804007ebaSmrg  [ax_save_FLAGS=$LDFLAGS
142904007ebaSmrg   LDFLAGS="$1"
143004007ebaSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
143104007ebaSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
143204007ebaSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
143304007ebaSmrg   LDFLAGS=$ax_save_FLAGS])
143404007ebaSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
143504007ebaSmrgAC_MSG_RESULT($xorg_check_linker_flags)
143604007ebaSmrgif test "x$xorg_check_linker_flags" = xyes; then
143704007ebaSmrg	m4_default([$2], :)
143804007ebaSmrgelse
143904007ebaSmrg	m4_default([$3], :)
144004007ebaSmrgfi
144104007ebaSmrg]) # XORG_CHECK_LINKER_FLAGS
144204007ebaSmrg
144304007ebaSmrg# XORG_MEMORY_CHECK_FLAGS
144404007ebaSmrg# -----------------------
144504007ebaSmrg# Minimum version: 1.16.0
144604007ebaSmrg#
144704007ebaSmrg# This macro attempts to find appropriate memory checking functionality
144804007ebaSmrg# for various platforms which unit testing code may use to catch various
144904007ebaSmrg# forms of memory allocation and access errors in testing.
145004007ebaSmrg#
145104007ebaSmrg# Interface to module:
145204007ebaSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
145304007ebaSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
145404007ebaSmrg#
145504007ebaSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
145604007ebaSmrg#
145704007ebaSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
145804007ebaSmrg
145904007ebaSmrgAC_REQUIRE([AC_CANONICAL_HOST])
146004007ebaSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
146104007ebaSmrg           [Environment variables to enable memory checking in tests])
146204007ebaSmrg
146304007ebaSmrg# Check for different types of support on different platforms
146404007ebaSmrgcase $host_os in
146504007ebaSmrg    solaris*)
146604007ebaSmrg        AC_CHECK_LIB([umem], [umem_alloc],
146704007ebaSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
146804007ebaSmrg        ;;
146904007ebaSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
147004007ebaSmrg        # both directly and inverted, so should not be 0 or 255.
147104007ebaSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
147204007ebaSmrg        ;;
147304007ebaSmrg    darwin*)
147404007ebaSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
147504007ebaSmrg        ;;
147604007ebaSmrg    *bsd*)
147704007ebaSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
147804007ebaSmrg        ;;
147904007ebaSmrgesac
148004007ebaSmrg
148104007ebaSmrg# User supplied flags override default flags
148204007ebaSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
148304007ebaSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
148404007ebaSmrgfi
148504007ebaSmrg
148604007ebaSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
148704007ebaSmrg]) # XORG_WITH_LINT
148804007ebaSmrg
1489f29dbc25Smrg# XORG_CHECK_MALLOC_ZERO
1490f29dbc25Smrg# ----------------------
1491f29dbc25Smrg# Minimum version: 1.0.0
1492f29dbc25Smrg#
1493f29dbc25Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1494f29dbc25Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1495f29dbc25Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1496f29dbc25SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1497f29dbc25SmrgAC_ARG_ENABLE(malloc0returnsnull,
1498f29dbc25Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1499f29dbc25Smrg		       [malloc(0) returns NULL (default: auto)]),
1500f29dbc25Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1501f29dbc25Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1502f29dbc25Smrg
1503f29dbc25SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1504f29dbc25Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
150504007ebaSmrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
150604007ebaSmrg#include <stdlib.h>
150704007ebaSmrg],[
1508f29dbc25Smrg    char *m0, *r0, *c0, *p;
1509f29dbc25Smrg    m0 = malloc(0);
1510f29dbc25Smrg    p = malloc(10);
1511f29dbc25Smrg    r0 = realloc(p,0);
151204007ebaSmrg    c0 = calloc(0,10);
151304007ebaSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
151404007ebaSmrg])],
1515f29dbc25Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1516f29dbc25Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
1517f29dbc25Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1518f29dbc25Smrgfi
1519f29dbc25SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1520f29dbc25Smrg
1521f29dbc25Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1522f29dbc25Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1523f29dbc25Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1524f29dbc25Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1525f29dbc25Smrgelse
1526f29dbc25Smrg	MALLOC_ZERO_CFLAGS=""
1527f29dbc25Smrg	XMALLOC_ZERO_CFLAGS=""
1528f29dbc25Smrg	XTMALLOC_ZERO_CFLAGS=""
1529f29dbc25Smrgfi
1530f29dbc25Smrg
1531f29dbc25SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1532f29dbc25SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1533f29dbc25SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1534f29dbc25Smrg]) # XORG_CHECK_MALLOC_ZERO
1535f29dbc25Smrg
1536f29dbc25Smrg# XORG_WITH_LINT()
1537f29dbc25Smrg# ----------------
1538f29dbc25Smrg# Minimum version: 1.1.0
1539f29dbc25Smrg#
1540170d5fdcSmrg# This macro enables the use of a tool that flags some suspicious and
1541170d5fdcSmrg# non-portable constructs (likely to be bugs) in C language source code.
1542170d5fdcSmrg# It will attempt to locate the tool and use appropriate options.
1543170d5fdcSmrg# There are various lint type tools on different platforms.
1544170d5fdcSmrg#
1545170d5fdcSmrg# Interface to module:
1546170d5fdcSmrg# LINT:		returns the path to the tool found on the platform
1547170d5fdcSmrg#		or the value set to LINT on the configure cmd line
1548170d5fdcSmrg#		also an Automake conditional
1549170d5fdcSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
1550170d5fdcSmrg#
1551170d5fdcSmrg# --with-lint:	'yes' user instructs the module to use lint
1552170d5fdcSmrg#		'no' user instructs the module not to use lint (default)
1553170d5fdcSmrg#
1554170d5fdcSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1555170d5fdcSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1556f29dbc25Smrg#
1557f29dbc25SmrgAC_DEFUN([XORG_WITH_LINT],[
1558f29dbc25Smrg
1559170d5fdcSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1560170d5fdcSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1561f29dbc25SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1562f29dbc25Smrg		[Use a lint-style source code checker (default: disabled)])],
1563f29dbc25Smrg		[use_lint=$withval], [use_lint=no])
1564170d5fdcSmrg
1565170d5fdcSmrg# Obtain platform specific info like program name and options
1566170d5fdcSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1567170d5fdcSmrgcase $host_os in
1568170d5fdcSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1569170d5fdcSmrg	lint_name=splint
1570170d5fdcSmrg	lint_options="-badflag"
1571170d5fdcSmrg	;;
1572170d5fdcSmrg  *freebsd* | *netbsd*)
1573170d5fdcSmrg	lint_name=lint
1574170d5fdcSmrg	lint_options="-u -b"
1575170d5fdcSmrg	;;
1576170d5fdcSmrg  *solaris*)
1577170d5fdcSmrg	lint_name=lint
1578170d5fdcSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1579170d5fdcSmrg	;;
1580170d5fdcSmrgesac
1581170d5fdcSmrg
1582170d5fdcSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1583170d5fdcSmrgif test "x$use_lint" = x"yes" ; then
1584170d5fdcSmrg   AC_PATH_PROG([LINT], [$lint_name])
1585170d5fdcSmrg   if test "x$LINT" = "x"; then
1586170d5fdcSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1587170d5fdcSmrg   fi
1588170d5fdcSmrgelif test "x$use_lint" = x"no" ; then
1589170d5fdcSmrg   if test "x$LINT" != "x"; then
1590170d5fdcSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1591170d5fdcSmrg   fi
1592f29dbc25Smrgelse
1593170d5fdcSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1594f29dbc25Smrgfi
1595170d5fdcSmrg
1596170d5fdcSmrg# User supplied flags override default flags
1597170d5fdcSmrgif test "x$LINT_FLAGS" != "x"; then
1598170d5fdcSmrg   lint_options=$LINT_FLAGS
1599f29dbc25Smrgfi
1600f29dbc25Smrg
1601170d5fdcSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1602170d5fdcSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1603f29dbc25Smrg
1604f29dbc25Smrg]) # XORG_WITH_LINT
1605f29dbc25Smrg
1606f29dbc25Smrg# XORG_LINT_LIBRARY(LIBNAME)
1607f29dbc25Smrg# --------------------------
1608f29dbc25Smrg# Minimum version: 1.1.0
1609f29dbc25Smrg#
1610f29dbc25Smrg# Sets up flags for building lint libraries for checking programs that call
1611f29dbc25Smrg# functions in the library.
1612f29dbc25Smrg#
1613170d5fdcSmrg# Interface to module:
1614170d5fdcSmrg# LINTLIB		- Automake variable with the name of lint library file to make
1615170d5fdcSmrg# MAKE_LINT_LIB		- Automake conditional
1616170d5fdcSmrg#
1617170d5fdcSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1618170d5fdcSmrg#			  - 'no' user instructs the module not to create a lint library (default)
1619f29dbc25Smrg
1620f29dbc25SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1621f29dbc25SmrgAC_REQUIRE([XORG_WITH_LINT])
1622f29dbc25SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1623f29dbc25Smrg	[Create lint library (default: disabled)])],
1624f29dbc25Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1625170d5fdcSmrg
1626170d5fdcSmrgif test "x$make_lint_lib" = x"yes" ; then
1627170d5fdcSmrg   LINTLIB=llib-l$1.ln
1628170d5fdcSmrg   if test "x$LINT" = "x"; then
1629170d5fdcSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1630170d5fdcSmrg   fi
1631170d5fdcSmrgelif test "x$make_lint_lib" != x"no" ; then
1632170d5fdcSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1633f29dbc25Smrgfi
1634170d5fdcSmrg
1635f29dbc25SmrgAC_SUBST(LINTLIB)
1636f29dbc25SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1637f29dbc25Smrg
1638f29dbc25Smrg]) # XORG_LINT_LIBRARY
1639f29dbc25Smrg
164004007ebaSmrg# XORG_COMPILER_BRAND
164104007ebaSmrg# -------------------
164204007ebaSmrg# Minimum version: 1.14.0
164304007ebaSmrg#
164404007ebaSmrg# Checks for various brands of compilers and sets flags as appropriate:
164504007ebaSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
164604007ebaSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
164704007ebaSmrg#   clang compiler - sets CLANGCC to "yes"
164804007ebaSmrg#   Intel compiler - sets INTELCC to "yes"
164904007ebaSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
165004007ebaSmrg#
165104007ebaSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
165204007ebaSmrgAC_LANG_CASE(
165304007ebaSmrg	[C], [
165404007ebaSmrg		AC_REQUIRE([AC_PROG_CC_C99])
165504007ebaSmrg	],
165604007ebaSmrg	[C++], [
165704007ebaSmrg		AC_REQUIRE([AC_PROG_CXX])
165804007ebaSmrg	]
165904007ebaSmrg)
166004007ebaSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
166104007ebaSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
166204007ebaSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
166304007ebaSmrg]) # XORG_COMPILER_BRAND
166404007ebaSmrg
166504007ebaSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
166604007ebaSmrg# ---------------
166704007ebaSmrg# Minimum version: 1.16.0
166804007ebaSmrg#
166904007ebaSmrg# Test if the compiler works when passed the given flag as a command line argument.
167004007ebaSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
167104007ebaSmrg# next flag in the list until there are no more options.
167204007ebaSmrg#
167304007ebaSmrg# Note that this does not guarantee that the compiler supports the flag as some
167404007ebaSmrg# compilers will simply ignore arguments that they do not understand, but we do
167504007ebaSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
167604007ebaSmrg# -Werror=unused-command-line-argument
167704007ebaSmrg#
167804007ebaSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
167904007ebaSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
168004007ebaSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
168104007ebaSmrg
168204007ebaSmrgAC_LANG_COMPILER_REQUIRE
168304007ebaSmrg
168404007ebaSmrgAC_LANG_CASE(
168504007ebaSmrg	[C], [
168604007ebaSmrg		AC_REQUIRE([AC_PROG_CC_C99])
168704007ebaSmrg		define([PREFIX], [C])
168804007ebaSmrg		define([CACHE_PREFIX], [cc])
168904007ebaSmrg		define([COMPILER], [$CC])
169004007ebaSmrg	],
169104007ebaSmrg	[C++], [
169204007ebaSmrg		define([PREFIX], [CXX])
169304007ebaSmrg		define([CACHE_PREFIX], [cxx])
169404007ebaSmrg		define([COMPILER], [$CXX])
169504007ebaSmrg	]
169604007ebaSmrg)
169704007ebaSmrg
169804007ebaSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
169904007ebaSmrg
170004007ebaSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
170104007ebaSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
170204007ebaSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
170304007ebaSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
170404007ebaSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
170504007ebaSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
170604007ebaSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
170704007ebaSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
170804007ebaSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
170904007ebaSmrgfi
171004007ebaSmrg
171104007ebaSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
171204007ebaSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
171304007ebaSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
171404007ebaSmrg	fi
171504007ebaSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
171604007ebaSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
171704007ebaSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
171804007ebaSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
171904007ebaSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
172004007ebaSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
172104007ebaSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
172204007ebaSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
172304007ebaSmrgfi
172404007ebaSmrg
172504007ebaSmrgfound="no"
172604007ebaSmrgm4_foreach([flag], m4_cdr($@), [
172704007ebaSmrg	if test $found = "no" ; then
172804007ebaSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
172904007ebaSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
173004007ebaSmrg		fi
173104007ebaSmrg
173204007ebaSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
173304007ebaSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
173404007ebaSmrg		fi
173504007ebaSmrg
173604007ebaSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
173704007ebaSmrg
173804007ebaSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
173904007ebaSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
174004007ebaSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
174104007ebaSmrg		AC_CACHE_VAL($cacheid,
174204007ebaSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
174304007ebaSmrg					     [eval $cacheid=yes],
174404007ebaSmrg					     [eval $cacheid=no])])
174504007ebaSmrg
174604007ebaSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
174704007ebaSmrg
174804007ebaSmrg		eval supported=\$$cacheid
174904007ebaSmrg		AC_MSG_RESULT([$supported])
175004007ebaSmrg		if test "$supported" = "yes" ; then
175104007ebaSmrg			$1="$$1 ]flag["
175204007ebaSmrg			found="yes"
175304007ebaSmrg		fi
175404007ebaSmrg	fi
175504007ebaSmrg])
175604007ebaSmrg]) # XORG_TESTSET_CFLAG
175704007ebaSmrg
175804007ebaSmrg# XORG_COMPILER_FLAGS
175904007ebaSmrg# ---------------
176004007ebaSmrg# Minimum version: 1.16.0
176104007ebaSmrg#
176204007ebaSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
176304007ebaSmrg# arguments supported by the selected compiler which do NOT alter the generated
176404007ebaSmrg# code.  These arguments will cause the compiler to print various warnings
176504007ebaSmrg# during compilation AND turn a conservative set of warnings into errors.
176604007ebaSmrg#
176704007ebaSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
176804007ebaSmrg# future versions of util-macros as options are added to new compilers.
176904007ebaSmrg#
177004007ebaSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
177104007ebaSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
177204007ebaSmrg
177304007ebaSmrgAC_ARG_ENABLE(selective-werror,
177404007ebaSmrg              AS_HELP_STRING([--disable-selective-werror],
177504007ebaSmrg                             [Turn off selective compiler errors. (default: enabled)]),
177604007ebaSmrg              [SELECTIVE_WERROR=$enableval],
177704007ebaSmrg              [SELECTIVE_WERROR=yes])
177804007ebaSmrg
177904007ebaSmrgAC_LANG_CASE(
178004007ebaSmrg        [C], [
178104007ebaSmrg                define([PREFIX], [C])
178204007ebaSmrg        ],
178304007ebaSmrg        [C++], [
178404007ebaSmrg                define([PREFIX], [CXX])
178504007ebaSmrg        ]
178604007ebaSmrg)
178704007ebaSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
178804007ebaSmrgif test "x$SUNCC" = "xyes"; then
178904007ebaSmrg    [BASE_]PREFIX[FLAGS]="-v"
179004007ebaSmrgelse
179104007ebaSmrg    [BASE_]PREFIX[FLAGS]=""
179204007ebaSmrgfi
179304007ebaSmrg
179404007ebaSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
179504007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
179604007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
179704007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
179804007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
179904007ebaSmrg
180004007ebaSmrgAC_LANG_CASE(
180104007ebaSmrg	[C], [
180204007ebaSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
180304007ebaSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
180404007ebaSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
180504007ebaSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
180604007ebaSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
180704007ebaSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
180804007ebaSmrg	]
180904007ebaSmrg)
181004007ebaSmrg
181104007ebaSmrg# This chunk adds additional warnings that could catch undesired effects.
181204007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
181304007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
181404007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
181504007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
181604007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
181704007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
181804007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
181904007ebaSmrg
182004007ebaSmrg# These are currently disabled because they are noisy.  They will be enabled
182104007ebaSmrg# in the future once the codebase is sufficiently modernized to silence
182204007ebaSmrg# them.  For now, I don't want them to drown out the other warnings.
182304007ebaSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
182404007ebaSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
182504007ebaSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
182604007ebaSmrg
182704007ebaSmrg# Turn some warnings into errors, so we don't accidently get successful builds
182804007ebaSmrg# when there are problems that should be fixed.
182904007ebaSmrg
183004007ebaSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
183104007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
183204007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
183304007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
183404007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
183504007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
183604007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
183704007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
183804007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
183904007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
184004007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
184104007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
184204007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
184304007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
184404007ebaSmrgelse
184504007ebaSmrgAC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
184604007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
184704007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
184804007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
184904007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
185004007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
185104007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
185204007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
185304007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
185404007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
185504007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
185604007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
185704007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
185804007ebaSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
185904007ebaSmrgfi
186004007ebaSmrg
186104007ebaSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
186204007ebaSmrg]) # XORG_COMPILER_FLAGS
186304007ebaSmrg
1864f29dbc25Smrg# XORG_CWARNFLAGS
1865f29dbc25Smrg# ---------------
1866f29dbc25Smrg# Minimum version: 1.2.0
186704007ebaSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
1868f29dbc25Smrg#
1869f29dbc25Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1870f29dbc25Smrg#
187104007ebaSmrg# This function is deprecated because it defines -fno-strict-aliasing
187204007ebaSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
187304007ebaSmrg# is needed, then it should be added explicitly in the module when
187404007ebaSmrg# it is updated to use BASE_CFLAGS.
187504007ebaSmrg#
1876f29dbc25SmrgAC_DEFUN([XORG_CWARNFLAGS], [
187704007ebaSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
187804007ebaSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
187904007ebaSmrgAC_LANG_CASE(
188004007ebaSmrg	[C], [
188104007ebaSmrg		CWARNFLAGS="$BASE_CFLAGS"
188204007ebaSmrg		if  test "x$GCC" = xyes ; then
188304007ebaSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
188404007ebaSmrg		fi
188504007ebaSmrg		AC_SUBST(CWARNFLAGS)
188604007ebaSmrg	]
188704007ebaSmrg)
1888f29dbc25Smrg]) # XORG_CWARNFLAGS
1889f29dbc25Smrg
1890f29dbc25Smrg# XORG_STRICT_OPTION
1891f29dbc25Smrg# -----------------------
1892f29dbc25Smrg# Minimum version: 1.3.0
1893f29dbc25Smrg#
189404007ebaSmrg# Add configure option to enable strict compilation flags, such as treating
189504007ebaSmrg# warnings as fatal errors.
189604007ebaSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
189704007ebaSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
189804007ebaSmrg#
189904007ebaSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
190004007ebaSmrg# when strict compilation is unconditionally desired.
1901f29dbc25SmrgAC_DEFUN([XORG_STRICT_OPTION], [
1902f29dbc25SmrgAC_REQUIRE([XORG_CWARNFLAGS])
190304007ebaSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1904f29dbc25Smrg
1905f29dbc25SmrgAC_ARG_ENABLE(strict-compilation,
1906f29dbc25Smrg			  AS_HELP_STRING([--enable-strict-compilation],
1907f29dbc25Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1908f29dbc25Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
190904007ebaSmrg
191004007ebaSmrgAC_LANG_CASE(
191104007ebaSmrg        [C], [
191204007ebaSmrg                define([PREFIX], [C])
191304007ebaSmrg        ],
191404007ebaSmrg        [C++], [
191504007ebaSmrg                define([PREFIX], [CXX])
191604007ebaSmrg        ]
191704007ebaSmrg)
191804007ebaSmrg
191904007ebaSmrg[STRICT_]PREFIX[FLAGS]=""
192004007ebaSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
192104007ebaSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
192204007ebaSmrg
192304007ebaSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
192404007ebaSmrg# activate it with -Werror, so we add it here explicitly.
192504007ebaSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
192604007ebaSmrg
1927f29dbc25Smrgif test "x$STRICT_COMPILE" = "xyes"; then
192804007ebaSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
192904007ebaSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1930f29dbc25Smrgfi
193104007ebaSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
193204007ebaSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
193304007ebaSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
1934f29dbc25Smrg]) # XORG_STRICT_OPTION
1935f29dbc25Smrg
1936f29dbc25Smrg# XORG_DEFAULT_OPTIONS
1937f29dbc25Smrg# --------------------
1938f29dbc25Smrg# Minimum version: 1.3.0
1939f29dbc25Smrg#
1940f29dbc25Smrg# Defines default options for X.Org modules.
1941f29dbc25Smrg#
1942f29dbc25SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1943170d5fdcSmrgAC_REQUIRE([AC_PROG_INSTALL])
194404007ebaSmrgXORG_COMPILER_FLAGS
1945f29dbc25SmrgXORG_CWARNFLAGS
1946f29dbc25SmrgXORG_STRICT_OPTION
1947f29dbc25SmrgXORG_RELEASE_VERSION
1948f29dbc25SmrgXORG_CHANGELOG
1949f29dbc25SmrgXORG_INSTALL
1950f29dbc25SmrgXORG_MANPAGE_SECTIONS
1951170d5fdcSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1952170d5fdcSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1953f29dbc25Smrg]) # XORG_DEFAULT_OPTIONS
1954f29dbc25Smrg
1955f29dbc25Smrg# XORG_INSTALL()
1956f29dbc25Smrg# ----------------
1957f29dbc25Smrg# Minimum version: 1.4.0
1958f29dbc25Smrg#
1959f29dbc25Smrg# Defines the variable INSTALL_CMD as the command to copy
1960f29dbc25Smrg# INSTALL from $prefix/share/util-macros.
1961f29dbc25Smrg#
1962f29dbc25SmrgAC_DEFUN([XORG_INSTALL], [
1963f29dbc25SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1964f29dbc25Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1965f29dbc25SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1966f29dbc25Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1967f29dbc25Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1968f29dbc25Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1969f29dbc25SmrgAC_SUBST([INSTALL_CMD])
1970f29dbc25Smrg]) # XORG_INSTALL
1971f29dbc25Smrgdnl Copyright 2005 Red Hat, Inc
1972f29dbc25Smrgdnl
1973f29dbc25Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1974f29dbc25Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1975f29dbc25Smrgdnl the above copyright notice appear in all copies and that both that
1976f29dbc25Smrgdnl copyright notice and this permission notice appear in supporting
1977f29dbc25Smrgdnl documentation.
1978f29dbc25Smrgdnl
1979f29dbc25Smrgdnl The above copyright notice and this permission notice shall be included
1980f29dbc25Smrgdnl in all copies or substantial portions of the Software.
1981f29dbc25Smrgdnl
1982f29dbc25Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1983f29dbc25Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1984f29dbc25Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1985f29dbc25Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1986f29dbc25Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1987f29dbc25Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1988f29dbc25Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1989f29dbc25Smrgdnl
1990f29dbc25Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1991f29dbc25Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1992f29dbc25Smrgdnl other dealings in this Software without prior written authorization
1993f29dbc25Smrgdnl from the copyright holders.
1994f29dbc25Smrgdnl
1995f29dbc25Smrg
1996f29dbc25Smrg# XORG_RELEASE_VERSION
1997f29dbc25Smrg# --------------------
1998170d5fdcSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
199904007ebaSmrg
2000f29dbc25SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
2001f29dbc25Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2002f29dbc25Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
2003f29dbc25Smrg		[Major version of this package])
2004f29dbc25Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2005f29dbc25Smrg	if test "x$PVM" = "x"; then
2006f29dbc25Smrg		PVM="0"
2007f29dbc25Smrg	fi
2008f29dbc25Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2009f29dbc25Smrg		[$PVM],
2010f29dbc25Smrg		[Minor version of this package])
2011f29dbc25Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2012f29dbc25Smrg	if test "x$PVP" = "x"; then
2013f29dbc25Smrg		PVP="0"
2014f29dbc25Smrg	fi
2015f29dbc25Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2016f29dbc25Smrg		[$PVP],
2017f29dbc25Smrg		[Patch version of this package])
2018f29dbc25Smrg])
2019f29dbc25Smrg
2020f29dbc25Smrg# XORG_CHANGELOG()
2021f29dbc25Smrg# ----------------
2022f29dbc25Smrg# Minimum version: 1.2.0
2023f29dbc25Smrg#
2024f29dbc25Smrg# Defines the variable CHANGELOG_CMD as the command to generate
2025f29dbc25Smrg# ChangeLog from git.
2026f29dbc25Smrg#
2027f29dbc25Smrg#
2028f29dbc25SmrgAC_DEFUN([XORG_CHANGELOG], [
2029f29dbc25SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
2030f29dbc25Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2031f29dbc25Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2032f29dbc25Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
2033f29dbc25SmrgAC_SUBST([CHANGELOG_CMD])
2034f29dbc25Smrg]) # XORG_CHANGELOG
2035f29dbc25Smrg
2036f29dbc25Smrgdnl Copyright 2005 Red Hat, Inc
2037f29dbc25Smrgdnl 
2038f29dbc25Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
2039f29dbc25Smrgdnl documentation for any purpose is hereby granted without fee, provided that
2040f29dbc25Smrgdnl the above copyright notice appear in all copies and that both that
2041f29dbc25Smrgdnl copyright notice and this permission notice appear in supporting
2042f29dbc25Smrgdnl documentation.
2043f29dbc25Smrgdnl 
2044f29dbc25Smrgdnl The above copyright notice and this permission notice shall be included
2045f29dbc25Smrgdnl in all copies or substantial portions of the Software.
2046f29dbc25Smrgdnl 
2047f29dbc25Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2048f29dbc25Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2049f29dbc25Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2050f29dbc25Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2051f29dbc25Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2052f29dbc25Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2053f29dbc25Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
2054f29dbc25Smrgdnl 
2055f29dbc25Smrgdnl Except as contained in this notice, the name of the copyright holders shall
2056f29dbc25Smrgdnl not be used in advertising or otherwise to promote the sale, use or
2057f29dbc25Smrgdnl other dealings in this Software without prior written authorization
2058f29dbc25Smrgdnl from the copyright holders.
2059f29dbc25Smrgdnl 
2060f29dbc25Smrg
206104007ebaSmrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
2062f29dbc25Smrg# --------------------------
206304007ebaSmrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
206404007ebaSmrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
2065f29dbc25Smrg
2066f29dbc25SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
2067f29dbc25Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2068f29dbc25Smrg	SAVE_CFLAGS="$CFLAGS"
2069f29dbc25Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
2070f29dbc25Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2071f29dbc25Smrg#include "xorg-server.h"
2072f29dbc25Smrg#if !defined $1
2073f29dbc25Smrg#error $1 not defined
2074f29dbc25Smrg#endif
2075f29dbc25Smrg		]])],
2076f29dbc25Smrg		[_EXT_CHECK=yes],
2077f29dbc25Smrg		[_EXT_CHECK=no])
2078f29dbc25Smrg	CFLAGS="$SAVE_CFLAGS"
2079f29dbc25Smrg	AC_MSG_CHECKING([if $1 is defined])
2080f29dbc25Smrg	AC_MSG_RESULT([$_EXT_CHECK])
2081f29dbc25Smrg	if test "$_EXT_CHECK" != no; then
2082f29dbc25Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
2083f29dbc25Smrg	fi
2084f29dbc25Smrg])
2085f29dbc25Smrg
208604007ebaSmrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
2087f29dbc25Smrg#
2088f29dbc25Smrg# This file is free software; the Free Software Foundation
2089f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2090f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2091f29dbc25Smrg
2092f29dbc25Smrg# AM_AUTOMAKE_VERSION(VERSION)
2093f29dbc25Smrg# ----------------------------
2094f29dbc25Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
2095f29dbc25Smrg# generated from the m4 files accompanying Automake X.Y.
2096f29dbc25Smrg# (This private macro should not be called outside this file.)
2097f29dbc25SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
209804007ebaSmrg[am__api_version='1.14'
2099f29dbc25Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
2100f29dbc25Smrgdnl require some minimum version.  Point them to the right macro.
210104007ebaSmrgm4_if([$1], [1.14], [],
2102f29dbc25Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
2103f29dbc25Smrg])
2104f29dbc25Smrg
2105f29dbc25Smrg# _AM_AUTOCONF_VERSION(VERSION)
2106f29dbc25Smrg# -----------------------------
2107f29dbc25Smrg# aclocal traces this macro to find the Autoconf version.
2108f29dbc25Smrg# This is a private macro too.  Using m4_define simplifies
2109f29dbc25Smrg# the logic in aclocal, which can simply ignore this definition.
2110f29dbc25Smrgm4_define([_AM_AUTOCONF_VERSION], [])
2111f29dbc25Smrg
2112f29dbc25Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
2113f29dbc25Smrg# -------------------------------
2114f29dbc25Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
2115f29dbc25Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
2116f29dbc25SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
211704007ebaSmrg[AM_AUTOMAKE_VERSION([1.14])dnl
2118f29dbc25Smrgm4_ifndef([AC_AUTOCONF_VERSION],
2119f29dbc25Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
2120f29dbc25Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
2121f29dbc25Smrg
2122f29dbc25Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
2123f29dbc25Smrg
212404007ebaSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
2125f29dbc25Smrg#
2126f29dbc25Smrg# This file is free software; the Free Software Foundation
2127f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2128f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2129f29dbc25Smrg
2130f29dbc25Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
213104007ebaSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
213204007ebaSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
2133f29dbc25Smrg#
2134f29dbc25Smrg# Of course, Automake must honor this variable whenever it calls a
2135f29dbc25Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
2136f29dbc25Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
2137f29dbc25Smrg# depending on how configure is run.  This is pretty annoying, since
2138f29dbc25Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
2139f29dbc25Smrg# source directory, any form will work fine, but in subdirectories a
2140f29dbc25Smrg# relative path needs to be adjusted first.
2141f29dbc25Smrg#
2142f29dbc25Smrg# $ac_aux_dir/missing
2143f29dbc25Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
2144f29dbc25Smrg# $top_srcdir/$ac_aux_dir/missing
2145f29dbc25Smrg#    fails if $ac_aux_dir is absolute,
2146f29dbc25Smrg#    fails when called from a subdirectory in a VPATH build with
2147f29dbc25Smrg#          a relative $ac_aux_dir
2148f29dbc25Smrg#
2149f29dbc25Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
2150f29dbc25Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
215104007ebaSmrg# harmless because $srcdir is '.', but things will broke when you
2152f29dbc25Smrg# start a VPATH build or use an absolute $srcdir.
2153f29dbc25Smrg#
2154f29dbc25Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
2155f29dbc25Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
2156f29dbc25Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
2157f29dbc25Smrg# and then we would define $MISSING as
2158f29dbc25Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
2159f29dbc25Smrg# This will work as long as MISSING is not called from configure, because
2160f29dbc25Smrg# unfortunately $(top_srcdir) has no meaning in configure.
2161f29dbc25Smrg# However there are other variables, like CC, which are often used in
2162f29dbc25Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
2163f29dbc25Smrg#
2164f29dbc25Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
2165f29dbc25Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
2166f29dbc25Smrg# configured tree to be moved without reconfiguration.
2167f29dbc25Smrg
2168f29dbc25SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
2169f29dbc25Smrg[dnl Rely on autoconf to set up CDPATH properly.
2170f29dbc25SmrgAC_PREREQ([2.50])dnl
2171f29dbc25Smrg# expand $ac_aux_dir to an absolute path
2172f29dbc25Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
2173f29dbc25Smrg])
2174f29dbc25Smrg
2175f29dbc25Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
2176f29dbc25Smrg
217704007ebaSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
2178f29dbc25Smrg#
2179f29dbc25Smrg# This file is free software; the Free Software Foundation
2180f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2181f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2182f29dbc25Smrg
2183f29dbc25Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
2184f29dbc25Smrg# -------------------------------------
2185f29dbc25Smrg# Define a conditional.
2186f29dbc25SmrgAC_DEFUN([AM_CONDITIONAL],
218704007ebaSmrg[AC_PREREQ([2.52])dnl
218804007ebaSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
218904007ebaSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
2190f29dbc25SmrgAC_SUBST([$1_TRUE])dnl
2191f29dbc25SmrgAC_SUBST([$1_FALSE])dnl
2192f29dbc25Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
2193f29dbc25Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
2194f29dbc25Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
2195f29dbc25Smrgif $2; then
2196f29dbc25Smrg  $1_TRUE=
2197f29dbc25Smrg  $1_FALSE='#'
2198f29dbc25Smrgelse
2199f29dbc25Smrg  $1_TRUE='#'
2200f29dbc25Smrg  $1_FALSE=
2201f29dbc25Smrgfi
2202f29dbc25SmrgAC_CONFIG_COMMANDS_PRE(
2203f29dbc25Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
2204f29dbc25Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
2205f29dbc25SmrgUsually this means the macro was only invoked conditionally.]])
2206f29dbc25Smrgfi])])
2207f29dbc25Smrg
220804007ebaSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
2209f29dbc25Smrg#
2210f29dbc25Smrg# This file is free software; the Free Software Foundation
2211f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2212f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2213f29dbc25Smrg
2214f29dbc25Smrg
221504007ebaSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
2216f29dbc25Smrg# written in clear, in which case automake, when reading aclocal.m4,
2217f29dbc25Smrg# will think it sees a *use*, and therefore will trigger all it's
2218f29dbc25Smrg# C support machinery.  Also note that it means that autoscan, seeing
2219f29dbc25Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
2220f29dbc25Smrg
2221f29dbc25Smrg
2222f29dbc25Smrg# _AM_DEPENDENCIES(NAME)
2223f29dbc25Smrg# ----------------------
2224f29dbc25Smrg# See how the compiler implements dependency checking.
222504007ebaSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
2226f29dbc25Smrg# We try a few techniques and use that to set a single cache variable.
2227f29dbc25Smrg#
2228f29dbc25Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
2229f29dbc25Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
2230f29dbc25Smrg# dependency, and given that the user is not expected to run this macro,
2231f29dbc25Smrg# just rely on AC_PROG_CC.
2232f29dbc25SmrgAC_DEFUN([_AM_DEPENDENCIES],
2233f29dbc25Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
2234f29dbc25SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
2235f29dbc25SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
2236f29dbc25SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
2237f29dbc25Smrg
223804007ebaSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
223904007ebaSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
224004007ebaSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
224104007ebaSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
224204007ebaSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
224304007ebaSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
224404007ebaSmrg                    [depcc="$$1"   am_compiler_list=])
2245f29dbc25Smrg
2246f29dbc25SmrgAC_CACHE_CHECK([dependency style of $depcc],
2247f29dbc25Smrg               [am_cv_$1_dependencies_compiler_type],
2248f29dbc25Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
2249f29dbc25Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
2250f29dbc25Smrg  # making bogus files that we don't know about and never remove.  For
2251f29dbc25Smrg  # instance it was reported that on HP-UX the gcc test will end up
225204007ebaSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
225304007ebaSmrg  # in D".
225404007ebaSmrg  rm -rf conftest.dir
2255f29dbc25Smrg  mkdir conftest.dir
2256f29dbc25Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
2257f29dbc25Smrg  # using a relative directory.
2258f29dbc25Smrg  cp "$am_depcomp" conftest.dir
2259f29dbc25Smrg  cd conftest.dir
2260f29dbc25Smrg  # We will build objects and dependencies in a subdirectory because
2261f29dbc25Smrg  # it helps to detect inapplicable dependency modes.  For instance
2262f29dbc25Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2263f29dbc25Smrg  # side effect of compilation, but ICC will put the dependencies in
2264f29dbc25Smrg  # the current directory while Tru64 will put them in the object
2265f29dbc25Smrg  # directory.
2266f29dbc25Smrg  mkdir sub
2267f29dbc25Smrg
2268f29dbc25Smrg  am_cv_$1_dependencies_compiler_type=none
2269f29dbc25Smrg  if test "$am_compiler_list" = ""; then
2270f29dbc25Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2271f29dbc25Smrg  fi
2272f29dbc25Smrg  am__universal=false
2273f29dbc25Smrg  m4_case([$1], [CC],
2274f29dbc25Smrg    [case " $depcc " in #(
2275f29dbc25Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2276f29dbc25Smrg     esac],
2277f29dbc25Smrg    [CXX],
2278f29dbc25Smrg    [case " $depcc " in #(
2279f29dbc25Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2280f29dbc25Smrg     esac])
2281f29dbc25Smrg
2282f29dbc25Smrg  for depmode in $am_compiler_list; do
2283f29dbc25Smrg    # Setup a source with many dependencies, because some compilers
2284f29dbc25Smrg    # like to wrap large dependency lists on column 80 (with \), and
2285f29dbc25Smrg    # we should not choose a depcomp mode which is confused by this.
2286f29dbc25Smrg    #
2287f29dbc25Smrg    # We need to recreate these files for each test, as the compiler may
2288f29dbc25Smrg    # overwrite some of them when testing with obscure command lines.
2289f29dbc25Smrg    # This happens at least with the AIX C compiler.
2290f29dbc25Smrg    : > sub/conftest.c
2291f29dbc25Smrg    for i in 1 2 3 4 5 6; do
2292f29dbc25Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
229304007ebaSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
229404007ebaSmrg      # Solaris 10 /bin/sh.
229504007ebaSmrg      echo '/* dummy */' > sub/conftst$i.h
2296f29dbc25Smrg    done
2297f29dbc25Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2298f29dbc25Smrg
229904007ebaSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
2300f29dbc25Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
230104007ebaSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
230204007ebaSmrg    # versions had trouble with output in subdirs.
2303f29dbc25Smrg    am__obj=sub/conftest.${OBJEXT-o}
2304f29dbc25Smrg    am__minus_obj="-o $am__obj"
2305f29dbc25Smrg    case $depmode in
2306f29dbc25Smrg    gcc)
2307f29dbc25Smrg      # This depmode causes a compiler race in universal mode.
2308f29dbc25Smrg      test "$am__universal" = false || continue
2309f29dbc25Smrg      ;;
2310f29dbc25Smrg    nosideeffect)
231104007ebaSmrg      # After this tag, mechanisms are not by side-effect, so they'll
231204007ebaSmrg      # only be used when explicitly requested.
2313f29dbc25Smrg      if test "x$enable_dependency_tracking" = xyes; then
2314f29dbc25Smrg	continue
2315f29dbc25Smrg      else
2316f29dbc25Smrg	break
2317f29dbc25Smrg      fi
2318f29dbc25Smrg      ;;
231904007ebaSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
232004007ebaSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
2321f29dbc25Smrg      # not run yet.  These depmodes are late enough in the game, and
2322f29dbc25Smrg      # so weak that their functioning should not be impacted.
2323f29dbc25Smrg      am__obj=conftest.${OBJEXT-o}
2324f29dbc25Smrg      am__minus_obj=
2325f29dbc25Smrg      ;;
2326f29dbc25Smrg    none) break ;;
2327f29dbc25Smrg    esac
2328f29dbc25Smrg    if depmode=$depmode \
2329f29dbc25Smrg       source=sub/conftest.c object=$am__obj \
2330f29dbc25Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2331f29dbc25Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2332f29dbc25Smrg         >/dev/null 2>conftest.err &&
2333f29dbc25Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2334f29dbc25Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2335f29dbc25Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2336f29dbc25Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2337f29dbc25Smrg      # icc doesn't choke on unknown options, it will just issue warnings
2338f29dbc25Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
2339f29dbc25Smrg      # that says an option was ignored or not supported.
2340f29dbc25Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2341f29dbc25Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2342f29dbc25Smrg      # The diagnosis changed in icc 8.0:
2343f29dbc25Smrg      #   icc: Command line remark: option '-MP' not supported
2344f29dbc25Smrg      if (grep 'ignoring option' conftest.err ||
2345f29dbc25Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2346f29dbc25Smrg        am_cv_$1_dependencies_compiler_type=$depmode
2347f29dbc25Smrg        break
2348f29dbc25Smrg      fi
2349f29dbc25Smrg    fi
2350f29dbc25Smrg  done
2351f29dbc25Smrg
2352f29dbc25Smrg  cd ..
2353f29dbc25Smrg  rm -rf conftest.dir
2354f29dbc25Smrgelse
2355f29dbc25Smrg  am_cv_$1_dependencies_compiler_type=none
2356f29dbc25Smrgfi
2357f29dbc25Smrg])
2358f29dbc25SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2359f29dbc25SmrgAM_CONDITIONAL([am__fastdep$1], [
2360f29dbc25Smrg  test "x$enable_dependency_tracking" != xno \
2361f29dbc25Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2362f29dbc25Smrg])
2363f29dbc25Smrg
2364f29dbc25Smrg
2365f29dbc25Smrg# AM_SET_DEPDIR
2366f29dbc25Smrg# -------------
2367f29dbc25Smrg# Choose a directory name for dependency files.
236804007ebaSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
2369f29dbc25SmrgAC_DEFUN([AM_SET_DEPDIR],
2370f29dbc25Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2371f29dbc25SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2372f29dbc25Smrg])
2373f29dbc25Smrg
2374f29dbc25Smrg
2375f29dbc25Smrg# AM_DEP_TRACK
2376f29dbc25Smrg# ------------
2377f29dbc25SmrgAC_DEFUN([AM_DEP_TRACK],
237804007ebaSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
237904007ebaSmrgAS_HELP_STRING(
238004007ebaSmrg  [--enable-dependency-tracking],
238104007ebaSmrg  [do not reject slow dependency extractors])
238204007ebaSmrgAS_HELP_STRING(
238304007ebaSmrg  [--disable-dependency-tracking],
238404007ebaSmrg  [speeds up one-time build])])
2385f29dbc25Smrgif test "x$enable_dependency_tracking" != xno; then
2386f29dbc25Smrg  am_depcomp="$ac_aux_dir/depcomp"
2387f29dbc25Smrg  AMDEPBACKSLASH='\'
238804007ebaSmrg  am__nodep='_no'
2389f29dbc25Smrgfi
2390f29dbc25SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2391f29dbc25SmrgAC_SUBST([AMDEPBACKSLASH])dnl
2392f29dbc25Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
239304007ebaSmrgAC_SUBST([am__nodep])dnl
239404007ebaSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
2395f29dbc25Smrg])
2396f29dbc25Smrg
2397f29dbc25Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
2398f29dbc25Smrg
239904007ebaSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
2400f29dbc25Smrg#
2401f29dbc25Smrg# This file is free software; the Free Software Foundation
2402f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2403f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2404f29dbc25Smrg
2405f29dbc25Smrg
2406f29dbc25Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
2407f29dbc25Smrg# ------------------------------
2408f29dbc25SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
2409f29dbc25Smrg[{
241004007ebaSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
2411f29dbc25Smrg  # are listed without --file.  Let's play safe and only enable the eval
2412f29dbc25Smrg  # if we detect the quoting.
2413f29dbc25Smrg  case $CONFIG_FILES in
2414f29dbc25Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
2415f29dbc25Smrg  *)   set x $CONFIG_FILES ;;
2416f29dbc25Smrg  esac
2417f29dbc25Smrg  shift
2418f29dbc25Smrg  for mf
2419f29dbc25Smrg  do
2420f29dbc25Smrg    # Strip MF so we end up with the name of the file.
2421f29dbc25Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
2422f29dbc25Smrg    # Check whether this is an Automake generated Makefile or not.
242304007ebaSmrg    # We used to match only the files named 'Makefile.in', but
2424f29dbc25Smrg    # some people rename them; so instead we look at the file content.
2425f29dbc25Smrg    # Grep'ing the first line is not enough: some people post-process
2426f29dbc25Smrg    # each Makefile.in and add a new line on top of each file to say so.
2427f29dbc25Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
2428f29dbc25Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
2429f29dbc25Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
2430f29dbc25Smrg      dirpart=`AS_DIRNAME("$mf")`
2431f29dbc25Smrg    else
2432f29dbc25Smrg      continue
2433f29dbc25Smrg    fi
2434f29dbc25Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
243504007ebaSmrg    # from the Makefile without running 'make'.
2436f29dbc25Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
2437f29dbc25Smrg    test -z "$DEPDIR" && continue
2438f29dbc25Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
243904007ebaSmrg    test -z "$am__include" && continue
2440f29dbc25Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
2441f29dbc25Smrg    # Find all dependency output files, they are included files with
2442f29dbc25Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
2443f29dbc25Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
2444f29dbc25Smrg    # expansion.
2445f29dbc25Smrg    for file in `sed -n "
2446f29dbc25Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
244704007ebaSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
2448f29dbc25Smrg      # Make sure the directory exists.
2449f29dbc25Smrg      test -f "$dirpart/$file" && continue
2450f29dbc25Smrg      fdir=`AS_DIRNAME(["$file"])`
2451f29dbc25Smrg      AS_MKDIR_P([$dirpart/$fdir])
2452f29dbc25Smrg      # echo "creating $dirpart/$file"
2453f29dbc25Smrg      echo '# dummy' > "$dirpart/$file"
2454f29dbc25Smrg    done
2455f29dbc25Smrg  done
2456f29dbc25Smrg}
2457f29dbc25Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2458f29dbc25Smrg
2459f29dbc25Smrg
2460f29dbc25Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
2461f29dbc25Smrg# -----------------------------
2462f29dbc25Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
2463f29dbc25Smrg#
2464f29dbc25Smrg# This code is only required when automatic dependency tracking
246504007ebaSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
2466f29dbc25Smrg# need in order to bootstrap the dependency handling code.
2467f29dbc25SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
2468f29dbc25Smrg[AC_CONFIG_COMMANDS([depfiles],
2469f29dbc25Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2470f29dbc25Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2471f29dbc25Smrg])
2472f29dbc25Smrg
2473f29dbc25Smrg# Do all the work for Automake.                             -*- Autoconf -*-
2474f29dbc25Smrg
247504007ebaSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
2476f29dbc25Smrg#
2477f29dbc25Smrg# This file is free software; the Free Software Foundation
2478f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2479f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2480f29dbc25Smrg
2481f29dbc25Smrg# This macro actually does too much.  Some checks are only needed if
2482f29dbc25Smrg# your package does certain things.  But this isn't really a big deal.
2483f29dbc25Smrg
248404007ebaSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
248504007ebaSmrgm4_define([AC_PROG_CC],
248604007ebaSmrgm4_defn([AC_PROG_CC])
248704007ebaSmrg[_AM_PROG_CC_C_O
248804007ebaSmrg])
248904007ebaSmrg
2490f29dbc25Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
2491f29dbc25Smrg# AM_INIT_AUTOMAKE([OPTIONS])
2492f29dbc25Smrg# -----------------------------------------------
2493f29dbc25Smrg# The call with PACKAGE and VERSION arguments is the old style
2494f29dbc25Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
2495f29dbc25Smrg# and VERSION should now be passed to AC_INIT and removed from
2496f29dbc25Smrg# the call to AM_INIT_AUTOMAKE.
2497f29dbc25Smrg# We support both call styles for the transition.  After
2498f29dbc25Smrg# the next Automake release, Autoconf can make the AC_INIT
2499f29dbc25Smrg# arguments mandatory, and then we can depend on a new Autoconf
2500f29dbc25Smrg# release and drop the old call support.
2501f29dbc25SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
250204007ebaSmrg[AC_PREREQ([2.65])dnl
2503f29dbc25Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
2504f29dbc25Smrgdnl the ones we care about.
2505f29dbc25Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
2506f29dbc25SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2507f29dbc25SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
2508f29dbc25Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
2509f29dbc25Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2510f29dbc25Smrg  # is not polluted with repeated "-I."
2511f29dbc25Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
2512f29dbc25Smrg  # test to see if srcdir already configured
2513f29dbc25Smrg  if test -f $srcdir/config.status; then
2514f29dbc25Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2515f29dbc25Smrg  fi
2516f29dbc25Smrgfi
2517f29dbc25Smrg
2518f29dbc25Smrg# test whether we have cygpath
2519f29dbc25Smrgif test -z "$CYGPATH_W"; then
2520f29dbc25Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
2521f29dbc25Smrg    CYGPATH_W='cygpath -w'
2522f29dbc25Smrg  else
2523f29dbc25Smrg    CYGPATH_W=echo
2524f29dbc25Smrg  fi
2525f29dbc25Smrgfi
2526f29dbc25SmrgAC_SUBST([CYGPATH_W])
2527f29dbc25Smrg
2528f29dbc25Smrg# Define the identity of the package.
2529f29dbc25Smrgdnl Distinguish between old-style and new-style calls.
2530f29dbc25Smrgm4_ifval([$2],
253104007ebaSmrg[AC_DIAGNOSE([obsolete],
253204007ebaSmrg             [$0: two- and three-arguments forms are deprecated.])
253304007ebaSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
2534f29dbc25Smrg AC_SUBST([PACKAGE], [$1])dnl
2535f29dbc25Smrg AC_SUBST([VERSION], [$2])],
2536f29dbc25Smrg[_AM_SET_OPTIONS([$1])dnl
2537f29dbc25Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
253804007ebaSmrgm4_if(
253904007ebaSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
254004007ebaSmrg  [ok:ok],,
2541f29dbc25Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
2542f29dbc25Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
2543f29dbc25Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
2544f29dbc25Smrg
2545f29dbc25Smrg_AM_IF_OPTION([no-define],,
254604007ebaSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
254704007ebaSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
2548f29dbc25Smrg
2549f29dbc25Smrg# Some tools Automake needs.
2550f29dbc25SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
2551f29dbc25SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
255204007ebaSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
255304007ebaSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
255404007ebaSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
255504007ebaSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
255604007ebaSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
2557f29dbc25SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2558f29dbc25SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
255904007ebaSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
256004007ebaSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
256104007ebaSmrg# dies out for good.  For more background, see:
256204007ebaSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
256304007ebaSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
256404007ebaSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
2565f29dbc25Smrg# We need awk for the "check" target.  The system "awk" is bad on
2566f29dbc25Smrg# some platforms.
2567f29dbc25SmrgAC_REQUIRE([AC_PROG_AWK])dnl
2568f29dbc25SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
2569f29dbc25SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
2570f29dbc25Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
2571f29dbc25Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
2572f29dbc25Smrg			     [_AM_PROG_TAR([v7])])])
2573f29dbc25Smrg_AM_IF_OPTION([no-dependencies],,
2574f29dbc25Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
257504007ebaSmrg		  [_AM_DEPENDENCIES([CC])],
257604007ebaSmrg		  [m4_define([AC_PROG_CC],
257704007ebaSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
2578f29dbc25SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
257904007ebaSmrg		  [_AM_DEPENDENCIES([CXX])],
258004007ebaSmrg		  [m4_define([AC_PROG_CXX],
258104007ebaSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
2582f29dbc25SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
258304007ebaSmrg		  [_AM_DEPENDENCIES([OBJC])],
258404007ebaSmrg		  [m4_define([AC_PROG_OBJC],
258504007ebaSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
258604007ebaSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
258704007ebaSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
258804007ebaSmrg		  [m4_define([AC_PROG_OBJCXX],
258904007ebaSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
2590f29dbc25Smrg])
259104007ebaSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
259204007ebaSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
259304007ebaSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
259404007ebaSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
2595f29dbc25SmrgAC_CONFIG_COMMANDS_PRE(dnl
2596f29dbc25Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
2597f29dbc25Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
2598f29dbc25Smrg
259904007ebaSmrg# POSIX will say in a future version that running "rm -f" with no argument
260004007ebaSmrg# is OK; and we want to be able to make that assumption in our Makefile
260104007ebaSmrg# recipes.  So use an aggressive probe to check that the usage we want is
260204007ebaSmrg# actually supported "in the wild" to an acceptable degree.
260304007ebaSmrg# See automake bug#10828.
260404007ebaSmrg# To make any issue more visible, cause the running configure to be aborted
260504007ebaSmrg# by default if the 'rm' program in use doesn't match our expectations; the
260604007ebaSmrg# user can still override this though.
260704007ebaSmrgif rm -f && rm -fr && rm -rf; then : OK; else
260804007ebaSmrg  cat >&2 <<'END'
260904007ebaSmrgOops!
261004007ebaSmrg
261104007ebaSmrgYour 'rm' program seems unable to run without file operands specified
261204007ebaSmrgon the command line, even when the '-f' option is present.  This is contrary
261304007ebaSmrgto the behaviour of most rm programs out there, and not conforming with
261404007ebaSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
261504007ebaSmrg
261604007ebaSmrgPlease tell bug-automake@gnu.org about your system, including the value
261704007ebaSmrgof your $PATH and any error possibly output before this message.  This
261804007ebaSmrgcan help us improve future automake versions.
261904007ebaSmrg
262004007ebaSmrgEND
262104007ebaSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
262204007ebaSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
262304007ebaSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
262404007ebaSmrg    echo >&2
262504007ebaSmrg  else
262604007ebaSmrg    cat >&2 <<'END'
262704007ebaSmrgAborting the configuration process, to ensure you take notice of the issue.
262804007ebaSmrg
262904007ebaSmrgYou can download and install GNU coreutils to get an 'rm' implementation
263004007ebaSmrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
263104007ebaSmrg
263204007ebaSmrgIf you want to complete the configuration process using your problematic
263304007ebaSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
263404007ebaSmrgto "yes", and re-run configure.
263504007ebaSmrg
263604007ebaSmrgEND
263704007ebaSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
263804007ebaSmrg  fi
263904007ebaSmrgfi])
264004007ebaSmrg
264104007ebaSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
2642f29dbc25Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
2643f29dbc25Smrgdnl mangled by Autoconf and run in a shell conditional statement.
2644f29dbc25Smrgm4_define([_AC_COMPILER_EXEEXT],
2645f29dbc25Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
2646f29dbc25Smrg
2647f29dbc25Smrg# When config.status generates a header, we must update the stamp-h file.
2648f29dbc25Smrg# This file resides in the same directory as the config header
2649f29dbc25Smrg# that is generated.  The stamp files are numbered to have different names.
2650f29dbc25Smrg
2651f29dbc25Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
2652f29dbc25Smrg# loop where config.status creates the headers, so we can generate
2653f29dbc25Smrg# our stamp files there.
2654f29dbc25SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
2655f29dbc25Smrg[# Compute $1's index in $config_headers.
2656f29dbc25Smrg_am_arg=$1
2657f29dbc25Smrg_am_stamp_count=1
2658f29dbc25Smrgfor _am_header in $config_headers :; do
2659f29dbc25Smrg  case $_am_header in
2660f29dbc25Smrg    $_am_arg | $_am_arg:* )
2661f29dbc25Smrg      break ;;
2662f29dbc25Smrg    * )
2663f29dbc25Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2664f29dbc25Smrg  esac
2665f29dbc25Smrgdone
2666f29dbc25Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
2667f29dbc25Smrg
266804007ebaSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
2669f29dbc25Smrg#
2670f29dbc25Smrg# This file is free software; the Free Software Foundation
2671f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2672f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2673f29dbc25Smrg
2674f29dbc25Smrg# AM_PROG_INSTALL_SH
2675f29dbc25Smrg# ------------------
2676f29dbc25Smrg# Define $install_sh.
2677f29dbc25SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
2678f29dbc25Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2679f29dbc25Smrgif test x"${install_sh}" != xset; then
2680f29dbc25Smrg  case $am_aux_dir in
2681f29dbc25Smrg  *\ * | *\	*)
2682f29dbc25Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2683f29dbc25Smrg  *)
2684f29dbc25Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
2685f29dbc25Smrg  esac
2686f29dbc25Smrgfi
268704007ebaSmrgAC_SUBST([install_sh])])
2688f29dbc25Smrg
268904007ebaSmrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
2690f29dbc25Smrg#
2691f29dbc25Smrg# This file is free software; the Free Software Foundation
2692f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2693f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2694f29dbc25Smrg
2695f29dbc25Smrg# Check whether the underlying file-system supports filenames
2696f29dbc25Smrg# with a leading dot.  For instance MS-DOS doesn't.
2697f29dbc25SmrgAC_DEFUN([AM_SET_LEADING_DOT],
2698f29dbc25Smrg[rm -rf .tst 2>/dev/null
2699f29dbc25Smrgmkdir .tst 2>/dev/null
2700f29dbc25Smrgif test -d .tst; then
2701f29dbc25Smrg  am__leading_dot=.
2702f29dbc25Smrgelse
2703f29dbc25Smrg  am__leading_dot=_
2704f29dbc25Smrgfi
2705f29dbc25Smrgrmdir .tst 2>/dev/null
2706f29dbc25SmrgAC_SUBST([am__leading_dot])])
2707f29dbc25Smrg
2708f29dbc25Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
2709f29dbc25Smrg# From Jim Meyering
2710f29dbc25Smrg
271104007ebaSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
2712f29dbc25Smrg#
2713f29dbc25Smrg# This file is free software; the Free Software Foundation
2714f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2715f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2716f29dbc25Smrg
2717f29dbc25Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
2718f29dbc25Smrg# ----------------------------------
2719f29dbc25Smrg# Control maintainer-specific portions of Makefiles.
272004007ebaSmrg# Default is to disable them, unless 'enable' is passed literally.
272104007ebaSmrg# For symmetry, 'disable' may be passed as well.  Anyway, the user
2722f29dbc25Smrg# can override the default with the --enable/--disable switch.
2723f29dbc25SmrgAC_DEFUN([AM_MAINTAINER_MODE],
2724f29dbc25Smrg[m4_case(m4_default([$1], [disable]),
2725f29dbc25Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
2726f29dbc25Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
2727f29dbc25Smrg       [m4_define([am_maintainer_other], [enable])
2728f29dbc25Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
272904007ebaSmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
2730f29dbc25Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
2731f29dbc25Smrg  AC_ARG_ENABLE([maintainer-mode],
273204007ebaSmrg    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
273304007ebaSmrg      am_maintainer_other[ make rules and dependencies not useful
273404007ebaSmrg      (and sometimes confusing) to the casual installer])],
273504007ebaSmrg    [USE_MAINTAINER_MODE=$enableval],
273604007ebaSmrg    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
2737f29dbc25Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
2738f29dbc25Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
2739f29dbc25Smrg  MAINT=$MAINTAINER_MODE_TRUE
2740f29dbc25Smrg  AC_SUBST([MAINT])dnl
2741f29dbc25Smrg]
2742f29dbc25Smrg)
2743f29dbc25Smrg
2744f29dbc25Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
2745f29dbc25Smrg
274604007ebaSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
2747f29dbc25Smrg#
2748f29dbc25Smrg# This file is free software; the Free Software Foundation
2749f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2750f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2751f29dbc25Smrg
2752f29dbc25Smrg# AM_MAKE_INCLUDE()
2753f29dbc25Smrg# -----------------
2754f29dbc25Smrg# Check to see how make treats includes.
2755f29dbc25SmrgAC_DEFUN([AM_MAKE_INCLUDE],
2756f29dbc25Smrg[am_make=${MAKE-make}
2757f29dbc25Smrgcat > confinc << 'END'
2758f29dbc25Smrgam__doit:
2759f29dbc25Smrg	@echo this is the am__doit target
2760f29dbc25Smrg.PHONY: am__doit
2761f29dbc25SmrgEND
2762f29dbc25Smrg# If we don't find an include directive, just comment out the code.
2763f29dbc25SmrgAC_MSG_CHECKING([for style of include used by $am_make])
2764f29dbc25Smrgam__include="#"
2765f29dbc25Smrgam__quote=
2766f29dbc25Smrg_am_result=none
2767f29dbc25Smrg# First try GNU make style include.
2768f29dbc25Smrgecho "include confinc" > confmf
276904007ebaSmrg# Ignore all kinds of additional output from 'make'.
2770f29dbc25Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
2771f29dbc25Smrg*the\ am__doit\ target*)
2772f29dbc25Smrg  am__include=include
2773f29dbc25Smrg  am__quote=
2774f29dbc25Smrg  _am_result=GNU
2775f29dbc25Smrg  ;;
2776f29dbc25Smrgesac
2777f29dbc25Smrg# Now try BSD make style include.
2778f29dbc25Smrgif test "$am__include" = "#"; then
2779f29dbc25Smrg   echo '.include "confinc"' > confmf
2780f29dbc25Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
2781f29dbc25Smrg   *the\ am__doit\ target*)
2782f29dbc25Smrg     am__include=.include
2783f29dbc25Smrg     am__quote="\""
2784f29dbc25Smrg     _am_result=BSD
2785f29dbc25Smrg     ;;
2786f29dbc25Smrg   esac
2787f29dbc25Smrgfi
2788f29dbc25SmrgAC_SUBST([am__include])
2789f29dbc25SmrgAC_SUBST([am__quote])
2790f29dbc25SmrgAC_MSG_RESULT([$_am_result])
2791f29dbc25Smrgrm -f confinc confmf
2792f29dbc25Smrg])
2793f29dbc25Smrg
2794f29dbc25Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2795f29dbc25Smrg
279604007ebaSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
2797f29dbc25Smrg#
2798f29dbc25Smrg# This file is free software; the Free Software Foundation
2799f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2800f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2801f29dbc25Smrg
2802f29dbc25Smrg# AM_MISSING_PROG(NAME, PROGRAM)
2803f29dbc25Smrg# ------------------------------
2804f29dbc25SmrgAC_DEFUN([AM_MISSING_PROG],
2805f29dbc25Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
2806f29dbc25Smrg$1=${$1-"${am_missing_run}$2"}
2807f29dbc25SmrgAC_SUBST($1)])
2808f29dbc25Smrg
2809f29dbc25Smrg# AM_MISSING_HAS_RUN
2810f29dbc25Smrg# ------------------
281104007ebaSmrg# Define MISSING if not defined so far and test if it is modern enough.
281204007ebaSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
2813f29dbc25SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
2814f29dbc25Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2815f29dbc25SmrgAC_REQUIRE_AUX_FILE([missing])dnl
2816f29dbc25Smrgif test x"${MISSING+set}" != xset; then
2817f29dbc25Smrg  case $am_aux_dir in
2818f29dbc25Smrg  *\ * | *\	*)
2819f29dbc25Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2820f29dbc25Smrg  *)
2821f29dbc25Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
2822f29dbc25Smrg  esac
2823f29dbc25Smrgfi
2824f29dbc25Smrg# Use eval to expand $SHELL
282504007ebaSmrgif eval "$MISSING --is-lightweight"; then
282604007ebaSmrg  am_missing_run="$MISSING "
2827f29dbc25Smrgelse
2828f29dbc25Smrg  am_missing_run=
282904007ebaSmrg  AC_MSG_WARN(['missing' script is too old or missing])
2830f29dbc25Smrgfi
2831f29dbc25Smrg])
2832f29dbc25Smrg
2833f29dbc25Smrg# Helper functions for option handling.                     -*- Autoconf -*-
2834f29dbc25Smrg
283504007ebaSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
2836f29dbc25Smrg#
2837f29dbc25Smrg# This file is free software; the Free Software Foundation
2838f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2839f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2840f29dbc25Smrg
2841f29dbc25Smrg# _AM_MANGLE_OPTION(NAME)
2842f29dbc25Smrg# -----------------------
2843f29dbc25SmrgAC_DEFUN([_AM_MANGLE_OPTION],
2844f29dbc25Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2845f29dbc25Smrg
2846f29dbc25Smrg# _AM_SET_OPTION(NAME)
284704007ebaSmrg# --------------------
2848f29dbc25Smrg# Set option NAME.  Presently that only means defining a flag for this option.
2849f29dbc25SmrgAC_DEFUN([_AM_SET_OPTION],
285004007ebaSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
2851f29dbc25Smrg
2852f29dbc25Smrg# _AM_SET_OPTIONS(OPTIONS)
285304007ebaSmrg# ------------------------
2854f29dbc25Smrg# OPTIONS is a space-separated list of Automake options.
2855f29dbc25SmrgAC_DEFUN([_AM_SET_OPTIONS],
2856f29dbc25Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2857f29dbc25Smrg
2858f29dbc25Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2859f29dbc25Smrg# -------------------------------------------
2860f29dbc25Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2861f29dbc25SmrgAC_DEFUN([_AM_IF_OPTION],
2862f29dbc25Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2863f29dbc25Smrg
286404007ebaSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
286504007ebaSmrg#
286604007ebaSmrg# This file is free software; the Free Software Foundation
286704007ebaSmrg# gives unlimited permission to copy and/or distribute it,
286804007ebaSmrg# with or without modifications, as long as this notice is preserved.
2869f29dbc25Smrg
287004007ebaSmrg# _AM_PROG_CC_C_O
287104007ebaSmrg# ---------------
287204007ebaSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
287304007ebaSmrg# to automatically call this.
287404007ebaSmrgAC_DEFUN([_AM_PROG_CC_C_O],
287504007ebaSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
287604007ebaSmrgAC_REQUIRE_AUX_FILE([compile])dnl
287704007ebaSmrgAC_LANG_PUSH([C])dnl
287804007ebaSmrgAC_CACHE_CHECK(
287904007ebaSmrg  [whether $CC understands -c and -o together],
288004007ebaSmrg  [am_cv_prog_cc_c_o],
288104007ebaSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
288204007ebaSmrg  # Make sure it works both with $CC and with simple cc.
288304007ebaSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
288404007ebaSmrg  # compilers refuse to overwrite an existing .o file with -o,
288504007ebaSmrg  # though they will create one.
288604007ebaSmrg  am_cv_prog_cc_c_o=yes
288704007ebaSmrg  for am_i in 1 2; do
288804007ebaSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
288904007ebaSmrg         && test -f conftest2.$ac_objext; then
289004007ebaSmrg      : OK
289104007ebaSmrg    else
289204007ebaSmrg      am_cv_prog_cc_c_o=no
289304007ebaSmrg      break
289404007ebaSmrg    fi
289504007ebaSmrg  done
289604007ebaSmrg  rm -f core conftest*
289704007ebaSmrg  unset am_i])
289804007ebaSmrgif test "$am_cv_prog_cc_c_o" != yes; then
289904007ebaSmrg   # Losing compiler, so override with the script.
290004007ebaSmrg   # FIXME: It is wrong to rewrite CC.
290104007ebaSmrg   # But if we don't then we get into trouble of one sort or another.
290204007ebaSmrg   # A longer-term fix would be to have automake use am__CC in this case,
290304007ebaSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
290404007ebaSmrg   CC="$am_aux_dir/compile $CC"
290504007ebaSmrgfi
290604007ebaSmrgAC_LANG_POP([C])])
290704007ebaSmrg
290804007ebaSmrg# For backward compatibility.
290904007ebaSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
291004007ebaSmrg
291104007ebaSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
2912f29dbc25Smrg#
2913f29dbc25Smrg# This file is free software; the Free Software Foundation
2914f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
2915f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
2916f29dbc25Smrg
291704007ebaSmrg# AM_RUN_LOG(COMMAND)
291804007ebaSmrg# -------------------
291904007ebaSmrg# Run COMMAND, save the exit status in ac_status, and log it.
292004007ebaSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
292104007ebaSmrgAC_DEFUN([AM_RUN_LOG],
292204007ebaSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
292304007ebaSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
292404007ebaSmrg   ac_status=$?
292504007ebaSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
292604007ebaSmrg   (exit $ac_status); }])
292704007ebaSmrg
292804007ebaSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
292904007ebaSmrg
293004007ebaSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
293104007ebaSmrg#
293204007ebaSmrg# This file is free software; the Free Software Foundation
293304007ebaSmrg# gives unlimited permission to copy and/or distribute it,
293404007ebaSmrg# with or without modifications, as long as this notice is preserved.
2935f29dbc25Smrg
2936f29dbc25Smrg# AM_SANITY_CHECK
2937f29dbc25Smrg# ---------------
2938f29dbc25SmrgAC_DEFUN([AM_SANITY_CHECK],
2939f29dbc25Smrg[AC_MSG_CHECKING([whether build environment is sane])
2940f29dbc25Smrg# Reject unsafe characters in $srcdir or the absolute working directory
2941f29dbc25Smrg# name.  Accept space and tab only in the latter.
2942f29dbc25Smrgam_lf='
2943f29dbc25Smrg'
2944f29dbc25Smrgcase `pwd` in
2945f29dbc25Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
2946f29dbc25Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
2947f29dbc25Smrgesac
2948f29dbc25Smrgcase $srcdir in
2949f29dbc25Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
295004007ebaSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
2951f29dbc25Smrgesac
2952f29dbc25Smrg
295304007ebaSmrg# Do 'set' in a subshell so we don't clobber the current shell's
2954f29dbc25Smrg# arguments.  Must try -L first in case configure is actually a
2955f29dbc25Smrg# symlink; some systems play weird games with the mod time of symlinks
2956f29dbc25Smrg# (eg FreeBSD returns the mod time of the symlink's containing
2957f29dbc25Smrg# directory).
2958f29dbc25Smrgif (
295904007ebaSmrg   am_has_slept=no
296004007ebaSmrg   for am_try in 1 2; do
296104007ebaSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
296204007ebaSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
296304007ebaSmrg     if test "$[*]" = "X"; then
296404007ebaSmrg	# -L didn't work.
296504007ebaSmrg	set X `ls -t "$srcdir/configure" conftest.file`
296604007ebaSmrg     fi
296704007ebaSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
296804007ebaSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
296904007ebaSmrg
297004007ebaSmrg	# If neither matched, then we have a broken ls.  This can happen
297104007ebaSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
297204007ebaSmrg	# broken ls alias from the environment.  This has actually
297304007ebaSmrg	# happened.  Such a system could not be considered "sane".
297404007ebaSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
297504007ebaSmrg  alias in your environment])
297604007ebaSmrg     fi
297704007ebaSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
297804007ebaSmrg       break
297904007ebaSmrg     fi
298004007ebaSmrg     # Just in case.
298104007ebaSmrg     sleep 1
298204007ebaSmrg     am_has_slept=yes
298304007ebaSmrg   done
2984f29dbc25Smrg   test "$[2]" = conftest.file
2985f29dbc25Smrg   )
2986f29dbc25Smrgthen
2987f29dbc25Smrg   # Ok.
2988f29dbc25Smrg   :
2989f29dbc25Smrgelse
2990f29dbc25Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
2991f29dbc25SmrgCheck your system clock])
2992f29dbc25Smrgfi
299304007ebaSmrgAC_MSG_RESULT([yes])
299404007ebaSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
299504007ebaSmrg# generated files are strictly newer.
299604007ebaSmrgam_sleep_pid=
299704007ebaSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
299804007ebaSmrg  ( sleep 1 ) &
299904007ebaSmrg  am_sleep_pid=$!
300004007ebaSmrgfi
300104007ebaSmrgAC_CONFIG_COMMANDS_PRE(
300204007ebaSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
300304007ebaSmrg   if test -n "$am_sleep_pid"; then
300404007ebaSmrg     # Hide warnings about reused PIDs.
300504007ebaSmrg     wait $am_sleep_pid 2>/dev/null
300604007ebaSmrg   fi
300704007ebaSmrg   AC_MSG_RESULT([done])])
300804007ebaSmrgrm -f conftest.file
300904007ebaSmrg])
3010f29dbc25Smrg
301104007ebaSmrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
3012f29dbc25Smrg#
3013f29dbc25Smrg# This file is free software; the Free Software Foundation
3014f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
3015f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
3016f29dbc25Smrg
3017f29dbc25Smrg# AM_SILENT_RULES([DEFAULT])
3018f29dbc25Smrg# --------------------------
3019f29dbc25Smrg# Enable less verbose build rules; with the default set to DEFAULT
302004007ebaSmrg# ("yes" being less verbose, "no" or empty being verbose).
3021f29dbc25SmrgAC_DEFUN([AM_SILENT_RULES],
302204007ebaSmrg[AC_ARG_ENABLE([silent-rules], [dnl
302304007ebaSmrgAS_HELP_STRING(
302404007ebaSmrg  [--enable-silent-rules],
302504007ebaSmrg  [less verbose build output (undo: "make V=1")])
302604007ebaSmrgAS_HELP_STRING(
302704007ebaSmrg  [--disable-silent-rules],
302804007ebaSmrg  [verbose build output (undo: "make V=0")])dnl
302904007ebaSmrg])
303004007ebaSmrgcase $enable_silent_rules in @%:@ (((
303104007ebaSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
303204007ebaSmrg   no) AM_DEFAULT_VERBOSITY=1;;
303304007ebaSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
3034f29dbc25Smrgesac
303504007ebaSmrgdnl
303604007ebaSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
303704007ebaSmrgdnl do not support nested variable expansions.
303804007ebaSmrgdnl See automake bug#9928 and bug#10237.
303904007ebaSmrgam_make=${MAKE-make}
304004007ebaSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
304104007ebaSmrg   [am_cv_make_support_nested_variables],
304204007ebaSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
304304007ebaSmrgBAR0=false
304404007ebaSmrgBAR1=true
304504007ebaSmrgV=1
304604007ebaSmrgam__doit:
304704007ebaSmrg	@$(TRUE)
304804007ebaSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
304904007ebaSmrg  am_cv_make_support_nested_variables=yes
305004007ebaSmrgelse
305104007ebaSmrg  am_cv_make_support_nested_variables=no
305204007ebaSmrgfi])
305304007ebaSmrgif test $am_cv_make_support_nested_variables = yes; then
305404007ebaSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
305504007ebaSmrg  AM_V='$(V)'
305604007ebaSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
305704007ebaSmrgelse
305804007ebaSmrg  AM_V=$AM_DEFAULT_VERBOSITY
305904007ebaSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
306004007ebaSmrgfi
306104007ebaSmrgAC_SUBST([AM_V])dnl
306204007ebaSmrgAM_SUBST_NOTMAKE([AM_V])dnl
306304007ebaSmrgAC_SUBST([AM_DEFAULT_V])dnl
306404007ebaSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
3065f29dbc25SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
3066f29dbc25SmrgAM_BACKSLASH='\'
3067f29dbc25SmrgAC_SUBST([AM_BACKSLASH])dnl
3068f29dbc25Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
3069f29dbc25Smrg])
3070f29dbc25Smrg
307104007ebaSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
3072f29dbc25Smrg#
3073f29dbc25Smrg# This file is free software; the Free Software Foundation
3074f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
3075f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
3076f29dbc25Smrg
3077f29dbc25Smrg# AM_PROG_INSTALL_STRIP
3078f29dbc25Smrg# ---------------------
307904007ebaSmrg# One issue with vendor 'install' (even GNU) is that you can't
3080f29dbc25Smrg# specify the program used to strip binaries.  This is especially
3081f29dbc25Smrg# annoying in cross-compiling environments, where the build's strip
3082f29dbc25Smrg# is unlikely to handle the host's binaries.
3083f29dbc25Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
308404007ebaSmrg# always use install-sh in "make install-strip", and initialize
3085f29dbc25Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
3086f29dbc25SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
3087f29dbc25Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
308804007ebaSmrg# Installed binaries are usually stripped using 'strip' when the user
308904007ebaSmrg# run "make install-strip".  However 'strip' might not be the right
3090f29dbc25Smrg# tool to use in cross-compilation environments, therefore Automake
309104007ebaSmrg# will honor the 'STRIP' environment variable to overrule this program.
309204007ebaSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
3093f29dbc25Smrgif test "$cross_compiling" != no; then
3094f29dbc25Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
3095f29dbc25Smrgfi
3096f29dbc25SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
3097f29dbc25SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
3098f29dbc25Smrg
309904007ebaSmrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
3100f29dbc25Smrg#
3101f29dbc25Smrg# This file is free software; the Free Software Foundation
3102f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
3103f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
3104f29dbc25Smrg
3105f29dbc25Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
3106f29dbc25Smrg# ---------------------------
3107f29dbc25Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
3108f29dbc25Smrg# This macro is traced by Automake.
3109f29dbc25SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
3110f29dbc25Smrg
3111f29dbc25Smrg# AM_SUBST_NOTMAKE(VARIABLE)
311204007ebaSmrg# --------------------------
3113f29dbc25Smrg# Public sister of _AM_SUBST_NOTMAKE.
3114f29dbc25SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
3115f29dbc25Smrg
3116f29dbc25Smrg# Check how to create a tarball.                            -*- Autoconf -*-
3117f29dbc25Smrg
311804007ebaSmrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
3119f29dbc25Smrg#
3120f29dbc25Smrg# This file is free software; the Free Software Foundation
3121f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
3122f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
3123f29dbc25Smrg
3124f29dbc25Smrg# _AM_PROG_TAR(FORMAT)
3125f29dbc25Smrg# --------------------
3126f29dbc25Smrg# Check how to create a tarball in format FORMAT.
312704007ebaSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
3128f29dbc25Smrg#
3129f29dbc25Smrg# Substitute a variable $(am__tar) that is a command
3130f29dbc25Smrg# writing to stdout a FORMAT-tarball containing the directory
3131f29dbc25Smrg# $tardir.
3132f29dbc25Smrg#     tardir=directory && $(am__tar) > result.tar
3133f29dbc25Smrg#
3134f29dbc25Smrg# Substitute a variable $(am__untar) that extract such
3135f29dbc25Smrg# a tarball read from stdin.
3136f29dbc25Smrg#     $(am__untar) < result.tar
313704007ebaSmrg#
3138f29dbc25SmrgAC_DEFUN([_AM_PROG_TAR],
313904007ebaSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
314004007ebaSmrg# in the wild :-(  We should find a proper way to deprecate it ...
314104007ebaSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
314204007ebaSmrg
314304007ebaSmrg# We'll loop over all known methods to create a tar archive until one works.
3144f29dbc25Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
3145f29dbc25Smrg
314604007ebaSmrgm4_if([$1], [v7],
314704007ebaSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
314804007ebaSmrg
314904007ebaSmrg  [m4_case([$1],
315004007ebaSmrg    [ustar],
315104007ebaSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
315204007ebaSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
315304007ebaSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
315404007ebaSmrg      # and bug#13588).
315504007ebaSmrg      am_max_uid=2097151 # 2^21 - 1
315604007ebaSmrg      am_max_gid=$am_max_uid
315704007ebaSmrg      # The $UID and $GID variables are not portable, so we need to resort
315804007ebaSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
315904007ebaSmrg      # below are definitely unexpected, so allow the users to see them
316004007ebaSmrg      # (that is, avoid stderr redirection).
316104007ebaSmrg      am_uid=`id -u || echo unknown`
316204007ebaSmrg      am_gid=`id -g || echo unknown`
316304007ebaSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
316404007ebaSmrg      if test $am_uid -le $am_max_uid; then
316504007ebaSmrg         AC_MSG_RESULT([yes])
316604007ebaSmrg      else
316704007ebaSmrg         AC_MSG_RESULT([no])
316804007ebaSmrg         _am_tools=none
316904007ebaSmrg      fi
317004007ebaSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
317104007ebaSmrg      if test $am_gid -le $am_max_gid; then
317204007ebaSmrg         AC_MSG_RESULT([yes])
317304007ebaSmrg      else
317404007ebaSmrg        AC_MSG_RESULT([no])
317504007ebaSmrg        _am_tools=none
317604007ebaSmrg      fi],
317704007ebaSmrg
317804007ebaSmrg  [pax],
317904007ebaSmrg    [],
3180f29dbc25Smrg
318104007ebaSmrg  [m4_fatal([Unknown tar format])])
318204007ebaSmrg
318304007ebaSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
318404007ebaSmrg
318504007ebaSmrg  # Go ahead even if we have the value already cached.  We do so because we
318604007ebaSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
318704007ebaSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
318804007ebaSmrg
318904007ebaSmrg  for _am_tool in $_am_tools; do
319004007ebaSmrg    case $_am_tool in
319104007ebaSmrg    gnutar)
319204007ebaSmrg      for _am_tar in tar gnutar gtar; do
319304007ebaSmrg        AM_RUN_LOG([$_am_tar --version]) && break
319404007ebaSmrg      done
319504007ebaSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
319604007ebaSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
319704007ebaSmrg      am__untar="$_am_tar -xf -"
319804007ebaSmrg      ;;
319904007ebaSmrg    plaintar)
320004007ebaSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
320104007ebaSmrg      # ustar tarball either.
320204007ebaSmrg      (tar --version) >/dev/null 2>&1 && continue
320304007ebaSmrg      am__tar='tar chf - "$$tardir"'
320404007ebaSmrg      am__tar_='tar chf - "$tardir"'
320504007ebaSmrg      am__untar='tar xf -'
320604007ebaSmrg      ;;
320704007ebaSmrg    pax)
320804007ebaSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
320904007ebaSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
321004007ebaSmrg      am__untar='pax -r'
321104007ebaSmrg      ;;
321204007ebaSmrg    cpio)
321304007ebaSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
321404007ebaSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
321504007ebaSmrg      am__untar='cpio -i -H $1 -d'
321604007ebaSmrg      ;;
321704007ebaSmrg    none)
321804007ebaSmrg      am__tar=false
321904007ebaSmrg      am__tar_=false
322004007ebaSmrg      am__untar=false
322104007ebaSmrg      ;;
322204007ebaSmrg    esac
322304007ebaSmrg
322404007ebaSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
322504007ebaSmrg    # and am__untar set.
322604007ebaSmrg    test -n "${am_cv_prog_tar_$1}" && break
322704007ebaSmrg
322804007ebaSmrg    # tar/untar a dummy directory, and stop if the command works.
322904007ebaSmrg    rm -rf conftest.dir
323004007ebaSmrg    mkdir conftest.dir
323104007ebaSmrg    echo GrepMe > conftest.dir/file
323204007ebaSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
323304007ebaSmrg    rm -rf conftest.dir
323404007ebaSmrg    if test -s conftest.tar; then
323504007ebaSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
323604007ebaSmrg      AM_RUN_LOG([cat conftest.dir/file])
323704007ebaSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
323804007ebaSmrg    fi
323904007ebaSmrg  done
3240f29dbc25Smrg  rm -rf conftest.dir
3241f29dbc25Smrg
324204007ebaSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
324304007ebaSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
324404007ebaSmrg
3245f29dbc25SmrgAC_SUBST([am__tar])
3246f29dbc25SmrgAC_SUBST([am__untar])
3247f29dbc25Smrg]) # _AM_PROG_TAR
3248f29dbc25Smrg
324904007ebaSmrgm4_include([m4/libtool.m4])
325004007ebaSmrgm4_include([m4/ltoptions.m4])
325104007ebaSmrgm4_include([m4/ltsugar.m4])
325204007ebaSmrgm4_include([m4/ltversion.m4])
325304007ebaSmrgm4_include([m4/lt~obsolete.m4])
3254