aclocal.m4 revision dbe7da2e
14a49301eSmrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
24a49301eSmrg
3af69d88dSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
44a49301eSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
54a49301eSmrg# This file is free software; the Free Software Foundation
64a49301eSmrg# gives unlimited permission to copy and/or distribute it,
74a49301eSmrg# with or without modifications, as long as this notice is preserved.
84a49301eSmrg
94a49301eSmrg# This program is distributed in the hope that it will be useful,
104a49301eSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
114a49301eSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
124a49301eSmrg# PARTICULAR PURPOSE.
134a49301eSmrg
144a49301eSmrgm4_ifndef([AC_AUTOCONF_VERSION],
154a49301eSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
164a49301eSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
174a49301eSmrg[m4_warning([this file was generated for autoconf 2.65.
184a49301eSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
194a49301eSmrgIf you have problems, you may need to regenerate the build system entirely.
204a49301eSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21af69d88dSmrg
224a49301eSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
234a49301eSmrg# 
244a49301eSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
254a49301eSmrg#
264a49301eSmrg# This program is free software; you can redistribute it and/or modify
274a49301eSmrg# it under the terms of the GNU General Public License as published by
284a49301eSmrg# the Free Software Foundation; either version 2 of the License, or
294a49301eSmrg# (at your option) any later version.
30af69d88dSmrg#
314a49301eSmrg# This program is distributed in the hope that it will be useful, but
324a49301eSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
334a49301eSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
344a49301eSmrg# General Public License for more details.
354a49301eSmrg#
363464ebd5Sriastradh# You should have received a copy of the GNU General Public License
373464ebd5Sriastradh# along with this program; if not, write to the Free Software
384a49301eSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
394a49301eSmrg#
404a49301eSmrg# As a special exception to the GNU General Public License, if you
414a49301eSmrg# distribute this file as part of a program that contains a
424a49301eSmrg# configuration script generated by Autoconf, you may include it under
434a49301eSmrg# the same distribution terms that you use for the rest of that program.
44af69d88dSmrg
45af69d88dSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
46af69d88dSmrg# ----------------------------------
474a49301eSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
484a49301eSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
494a49301eSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
504a49301eSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
514a49301eSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
524a49301eSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
534a49301eSmrgfi
544a49301eSmrgif test -n "$PKG_CONFIG"; then
55af69d88dSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
56af69d88dSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
57af69d88dSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
58af69d88dSmrg		AC_MSG_RESULT([yes])
59af69d88dSmrg	else
60af69d88dSmrg		AC_MSG_RESULT([no])
61af69d88dSmrg		PKG_CONFIG=""
62af69d88dSmrg	fi
634a49301eSmrg		
644a49301eSmrgfi[]dnl
654a49301eSmrg])# PKG_PROG_PKG_CONFIG
664a49301eSmrg
674a49301eSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
684a49301eSmrg#
694a49301eSmrg# Check to see whether a particular set of modules exists.  Similar
704a49301eSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
714a49301eSmrg#
724a49301eSmrg#
734a49301eSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
744a49301eSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
754a49301eSmrg# PKG_CHECK_EXISTS manually
764a49301eSmrg# --------------------------------------------------------------
774a49301eSmrgAC_DEFUN([PKG_CHECK_EXISTS],
784a49301eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
794a49301eSmrgif test -n "$PKG_CONFIG" && \
804a49301eSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
814a49301eSmrg  m4_ifval([$2], [$2], [:])
824a49301eSmrgm4_ifvaln([$3], [else
834a49301eSmrg  $3])dnl
844a49301eSmrgfi])
854a49301eSmrg
864a49301eSmrg
874a49301eSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
884a49301eSmrg# ---------------------------------------------
894a49301eSmrgm4_define([_PKG_CONFIG],
904a49301eSmrg[if test -n "$PKG_CONFIG"; then
914a49301eSmrg    if test -n "$$1"; then
924a49301eSmrg        pkg_cv_[]$1="$$1"
934a49301eSmrg    else
944a49301eSmrg        PKG_CHECK_EXISTS([$3],
954a49301eSmrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
964a49301eSmrg			 [pkg_failed=yes])
974a49301eSmrg    fi
984a49301eSmrgelse
994a49301eSmrg	pkg_failed=untried
1004a49301eSmrgfi[]dnl
1014a49301eSmrg])# _PKG_CONFIG
102cdc920a0Smrg
1033464ebd5Sriastradh# _PKG_SHORT_ERRORS_SUPPORTED
1044a49301eSmrg# -----------------------------
1054a49301eSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
106cdc920a0Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1074a49301eSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1084a49301eSmrg        _pkg_short_errors_supported=yes
1094a49301eSmrgelse
1104a49301eSmrg        _pkg_short_errors_supported=no
1114a49301eSmrgfi[]dnl
1124a49301eSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
1134a49301eSmrg
1144a49301eSmrg
1154a49301eSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1164a49301eSmrg# [ACTION-IF-NOT-FOUND])
1174a49301eSmrg#
1184a49301eSmrg#
1194a49301eSmrg# Note that if there is a possibility the first call to
1204a49301eSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
1214a49301eSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
122af69d88dSmrg#
1234a49301eSmrg#
1244a49301eSmrg# --------------------------------------------------------------
1254a49301eSmrgAC_DEFUN([PKG_CHECK_MODULES],
1264a49301eSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1274a49301eSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1284a49301eSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1294a49301eSmrg
1304a49301eSmrgpkg_failed=no
1314a49301eSmrgAC_MSG_CHECKING([for $1])
1324a49301eSmrg
133af69d88dSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1344a49301eSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1354a49301eSmrg
136cdc920a0Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
137cdc920a0Smrgand $1[]_LIBS to avoid the need to call pkg-config.
138cdc920a0SmrgSee the pkg-config man page for more details.])
1394a49301eSmrg
1404a49301eSmrgif test $pkg_failed = yes; then
141cdc920a0Smrg        _PKG_SHORT_ERRORS_SUPPORTED
1424a49301eSmrg        if test $_pkg_short_errors_supported = yes; then
1434a49301eSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
1444a49301eSmrg        else 
1454a49301eSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1464a49301eSmrg        fi
1474a49301eSmrg	# Put the nasty error message in config.log where it belongs
1483464ebd5Sriastradh	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1494a49301eSmrg
1504a49301eSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
1514a49301eSmrg[Package requirements ($2) were not met:
152cdc920a0Smrg
1534a49301eSmrg$$1_PKG_ERRORS
1544a49301eSmrg
1554a49301eSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
1564a49301eSmrginstalled software in a non-standard prefix.
1574a49301eSmrg
1584a49301eSmrg_PKG_TEXT
159af69d88dSmrg])],
1604a49301eSmrg		[AC_MSG_RESULT([no])
1614a49301eSmrg                $4])
1624a49301eSmrgelif test $pkg_failed = untried; then
1634a49301eSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
164[The pkg-config script could not be found or is too old.  Make sure it
165is in your PATH or set the PKG_CONFIG environment variable to the full
166path to pkg-config.
167
168_PKG_TEXT
169
170To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
171		[$4])
172else
173	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
174	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
175        AC_MSG_RESULT([yes])
176	ifelse([$3], , :, [$3])
177fi[]dnl
178])# PKG_CHECK_MODULES
179
180dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
181dnl
182dnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
183dnl 
184dnl Permission is hereby granted, free of charge, to any person obtaining a
185dnl copy of this software and associated documentation files (the "Software"),
186dnl to deal in the Software without restriction, including without limitation
187dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
188dnl and/or sell copies of the Software, and to permit persons to whom the
189dnl Software is furnished to do so, subject to the following conditions:
190dnl
191dnl The above copyright notice and this permission notice (including the next
192dnl paragraph) shall be included in all copies or substantial portions of the
193dnl Software.
194dnl
195dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
196dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
197dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
198dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
199dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
200dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
201dnl DEALINGS IN THE SOFTWARE.
202
203# XORG_MACROS_VERSION(required-version)
204# -------------------------------------
205# Minimum version: 1.1.0
206#
207# If you're using a macro added in Version 1.1 or newer, include this in
208# your configure.ac with the minimum required version, such as:
209# XORG_MACROS_VERSION(1.1)
210#
211# To ensure that this macro is defined, also add:
212# m4_ifndef([XORG_MACROS_VERSION],
213#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
214#
215#
216# See the "minimum version" comment for each macro you use to see what 
217# version you require.
218m4_defun([XORG_MACROS_VERSION],[
219m4_define([vers_have], [1.5.0])
220m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
221m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
222m4_if(m4_cmp(maj_have, maj_needed), 0,,
223    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
224m4_if(m4_version_compare(vers_have, [$1]), -1,
225    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
226m4_undefine([vers_have])
227m4_undefine([maj_have])
228m4_undefine([maj_needed])
229]) # XORG_MACROS_VERSION
230
231# XORG_PROG_RAWCPP()
232# ------------------
233# Minimum version: 1.0.0
234#
235# Find cpp program and necessary flags for use in pre-processing text files
236# such as man pages and config files
237AC_DEFUN([XORG_PROG_RAWCPP],[
238AC_REQUIRE([AC_PROG_CPP])
239AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
240   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
241
242# Check for flag to avoid builtin definitions - assumes unix is predefined,
243# which is not the best choice for supporting other OS'es, but covers most
244# of the ones we need for now.
245AC_MSG_CHECKING([if $RAWCPP requires -undef])
246AC_LANG_CONFTEST([Does cpp redefine unix ?])
247if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
248	AC_MSG_RESULT([no])
249else
250	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
251		RAWCPPFLAGS=-undef
252		AC_MSG_RESULT([yes])
253	# under Cygwin unix is still defined even with -undef
254	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
255		RAWCPPFLAGS="-undef -ansi"
256		AC_MSG_RESULT([yes, with -ansi])
257	else
258		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
259	fi
260fi
261rm -f conftest.$ac_ext
262
263AC_MSG_CHECKING([if $RAWCPP requires -traditional])
264AC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
265if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
266	AC_MSG_RESULT([no])
267else
268	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
269		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
270		AC_MSG_RESULT([yes])
271	else
272		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
273	fi
274fi
275rm -f conftest.$ac_ext
276AC_SUBST(RAWCPPFLAGS)
277]) # XORG_PROG_RAWCPP
278
279# XORG_MANPAGE_SECTIONS()
280# -----------------------
281# Minimum version: 1.0.0
282#
283# Determine which sections man pages go in for the different man page types
284# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
285# Not sure if there's any better way than just hardcoding by OS name.
286# Override default settings by setting environment variables
287
288AC_DEFUN([XORG_MANPAGE_SECTIONS],[
289AC_REQUIRE([AC_CANONICAL_HOST])
290
291if test x$APP_MAN_SUFFIX = x    ; then
292    APP_MAN_SUFFIX=1
293fi
294if test x$APP_MAN_DIR = x    ; then
295    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
296fi
297
298if test x$LIB_MAN_SUFFIX = x    ; then
299    LIB_MAN_SUFFIX=3
300fi
301if test x$LIB_MAN_DIR = x    ; then
302    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
303fi
304
305if test x$FILE_MAN_SUFFIX = x    ; then
306    case $host_os in
307	solaris*)	FILE_MAN_SUFFIX=4  ;;
308	*)		FILE_MAN_SUFFIX=5  ;;
309    esac
310fi
311if test x$FILE_MAN_DIR = x    ; then
312    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
313fi
314
315if test x$MISC_MAN_SUFFIX = x    ; then
316    case $host_os in
317	solaris*)	MISC_MAN_SUFFIX=5  ;;
318	*)		MISC_MAN_SUFFIX=7  ;;
319    esac
320fi
321if test x$MISC_MAN_DIR = x    ; then
322    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
323fi
324
325if test x$DRIVER_MAN_SUFFIX = x    ; then
326    case $host_os in
327	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
328	*)		DRIVER_MAN_SUFFIX=4  ;;
329    esac
330fi
331if test x$DRIVER_MAN_DIR = x    ; then
332    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
333fi
334
335if test x$ADMIN_MAN_SUFFIX = x    ; then
336    case $host_os in
337	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
338	*)		ADMIN_MAN_SUFFIX=8  ;;
339    esac
340fi
341if test x$ADMIN_MAN_DIR = x    ; then
342    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
343fi
344
345
346AC_SUBST([APP_MAN_SUFFIX])
347AC_SUBST([LIB_MAN_SUFFIX])
348AC_SUBST([FILE_MAN_SUFFIX])
349AC_SUBST([MISC_MAN_SUFFIX])
350AC_SUBST([DRIVER_MAN_SUFFIX])
351AC_SUBST([ADMIN_MAN_SUFFIX])
352AC_SUBST([APP_MAN_DIR])
353AC_SUBST([LIB_MAN_DIR])
354AC_SUBST([FILE_MAN_DIR])
355AC_SUBST([MISC_MAN_DIR])
356AC_SUBST([DRIVER_MAN_DIR])
357AC_SUBST([ADMIN_MAN_DIR])
358]) # XORG_MANPAGE_SECTIONS
359
360# XORG_CHECK_LINUXDOC
361# -------------------
362# Minimum version: 1.0.0
363#
364# Defines the variable MAKE_TEXT if the necessary tools and
365# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
366# Whether or not the necessary tools and files are found can be checked
367# with the AM_CONDITIONAL "BUILD_LINUXDOC"
368AC_DEFUN([XORG_CHECK_LINUXDOC],[
369if test x$XORG_SGML_PATH = x ; then
370    XORG_SGML_PATH=$prefix/share/sgml
371fi
372HAVE_DEFS_ENT=
373
374if test x"$cross_compiling" = x"yes" ; then
375  HAVE_DEFS_ENT=no
376else
377  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
378fi
379
380AC_PATH_PROG(LINUXDOC, linuxdoc)
381AC_PATH_PROG(PS2PDF, ps2pdf)
382
383AC_MSG_CHECKING([Whether to build documentation])
384
385if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
386   BUILDDOC=yes
387else
388   BUILDDOC=no
389fi
390
391AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
392
393AC_MSG_RESULT([$BUILDDOC])
394
395AC_MSG_CHECKING([Whether to build pdf documentation])
396
397if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
398   BUILDPDFDOC=yes
399else
400   BUILDPDFDOC=no
401fi
402
403AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
404
405AC_MSG_RESULT([$BUILDPDFDOC])
406
407MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
408MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
409MAKE_PDF="$PS2PDF"
410MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
411
412AC_SUBST(MAKE_TEXT)
413AC_SUBST(MAKE_PS)
414AC_SUBST(MAKE_PDF)
415AC_SUBST(MAKE_HTML)
416]) # XORG_CHECK_LINUXDOC
417
418# XORG_CHECK_DOCBOOK
419# -------------------
420# Minimum version: 1.0.0
421#
422# Checks for the ability to build output formats from SGML DocBook source.
423# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
424# indicates whether the necessary tools and files are found and, if set,
425# $(MAKE_XXX) blah.sgml will produce blah.xxx.
426AC_DEFUN([XORG_CHECK_DOCBOOK],[
427if test x$XORG_SGML_PATH = x ; then
428    XORG_SGML_PATH=$prefix/share/sgml
429fi
430HAVE_DEFS_ENT=
431BUILDTXTDOC=no
432BUILDPDFDOC=no
433BUILDPSDOC=no
434BUILDHTMLDOC=no
435
436AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
437
438AC_PATH_PROG(DOCBOOKPS, docbook2ps)
439AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
440AC_PATH_PROG(DOCBOOKHTML, docbook2html)
441AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
442
443AC_MSG_CHECKING([Whether to build text documentation])
444if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
445   test x$BUILD_TXTDOC != xno; then
446	BUILDTXTDOC=yes
447fi
448AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
449AC_MSG_RESULT([$BUILDTXTDOC])
450
451AC_MSG_CHECKING([Whether to build PDF documentation])
452if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
453   test x$BUILD_PDFDOC != xno; then
454	BUILDPDFDOC=yes
455fi
456AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
457AC_MSG_RESULT([$BUILDPDFDOC])
458
459AC_MSG_CHECKING([Whether to build PostScript documentation])
460if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
461   test x$BUILD_PSDOC != xno; then
462	BUILDPSDOC=yes
463fi
464AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
465AC_MSG_RESULT([$BUILDPSDOC])
466
467AC_MSG_CHECKING([Whether to build HTML documentation])
468if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
469   test x$BUILD_HTMLDOC != xno; then
470	BUILDHTMLDOC=yes
471fi
472AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
473AC_MSG_RESULT([$BUILDHTMLDOC])
474
475MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
476MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
477MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
478MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
479
480AC_SUBST(MAKE_TEXT)
481AC_SUBST(MAKE_PS)
482AC_SUBST(MAKE_PDF)
483AC_SUBST(MAKE_HTML)
484]) # XORG_CHECK_DOCBOOK
485
486# XORG_WITH_XMLTO
487# ----------------
488# Minimum version: 1.5.0
489#
490# Documentation tools are not always available on all platforms and sometimes
491# not at the appropriate level. This macro enables a module to test for the
492# presence of the tool and obtain it's path in separate variables. Coupled with
493# the --with-xmlto option, it allows maximum flexibilty in making decisions
494# as whether or not to use the xmlto package.
495#
496# Interface to module:
497# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
498# XMLTO:	returns the path of the xmlto program found
499#		returns the path set by the user in the environment
500# --with-xmlto:	'yes' user instructs the module to use xmlto
501#		'no' user instructs the module not to use xmlto
502#
503# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
504#
505AC_DEFUN([XORG_WITH_XMLTO],[
506AC_ARG_VAR([XMLTO], [Path to xmlto command])
507AC_ARG_WITH(xmlto,
508	AS_HELP_STRING([--with-xmlto],
509	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
510	   [use_xmlto=$withval], [use_xmlto=auto])
511
512if test "x$use_xmlto" = x"auto"; then
513   AC_PATH_PROG([XMLTO], [xmlto])
514   if test "x$XMLTO" = "x"; then
515        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
516	have_xmlto=no
517   else
518        have_xmlto=yes
519   fi
520elif test "x$use_xmlto" = x"yes" ; then
521   AC_PATH_PROG([XMLTO], [xmlto])
522   if test "x$XMLTO" = "x"; then
523        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
524   fi
525   have_xmlto=yes
526elif test "x$use_xmlto" = x"no" ; then
527   if test "x$XMLTO" != "x"; then
528      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
529   fi
530   have_xmlto=no
531else
532   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
533fi
534AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
535]) # XORG_CHECK_XMLTO
536
537# XORG_WITH_ASCIIDOC
538# ----------------
539# Minimum version: 1.5.0
540#
541# Documentation tools are not always available on all platforms and sometimes
542# not at the appropriate level. This macro enables a module to test for the
543# presence of the tool and obtain it's path in separate variables. Coupled with
544# the --with-asciidoc option, it allows maximum flexibilty in making decisions
545# as whether or not to use the asciidoc package.
546#
547# Interface to module:
548# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
549# ASCIIDOC:	 returns the path of the asciidoc program found
550#		 returns the path set by the user in the environment
551# --with-asciidoc: 'yes' user instructs the module to use asciidoc
552#		  'no' user instructs the module not to use asciidoc
553#
554# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
555#
556AC_DEFUN([XORG_WITH_ASCIIDOC],[
557AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
558AC_ARG_WITH(asciidoc,
559	AS_HELP_STRING([--with-asciidoc],
560	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
561	   [use_asciidoc=$withval], [use_asciidoc=auto])
562
563if test "x$use_asciidoc" = x"auto"; then
564   AC_PATH_PROG([ASCIIDOC], [asciidoc])
565   if test "x$ASCIIDOC" = "x"; then
566        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
567	have_asciidoc=no
568   else
569        have_asciidoc=yes
570   fi
571elif test "x$use_asciidoc" = x"yes" ; then
572   AC_PATH_PROG([ASCIIDOC], [asciidoc])
573   if test "x$ASCIIDOC" = "x"; then
574        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
575   fi
576   have_asciidoc=yes
577elif test "x$use_asciidoc" = x"no" ; then
578   if test "x$ASCIIDOC" != "x"; then
579      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
580   fi
581   have_asciidoc=no
582else
583   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
584fi
585AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
586]) # XORG_CHECK_ASCIIDOC
587
588# XORG_WITH_DOXYGEN
589# ----------------
590# Minimum version: 1.5.0
591#
592# Documentation tools are not always available on all platforms and sometimes
593# not at the appropriate level. This macro enables a module to test for the
594# presence of the tool and obtain it's path in separate variables. Coupled with
595# the --with-doxygen option, it allows maximum flexibilty in making decisions
596# as whether or not to use the doxygen package.
597#
598# Interface to module:
599# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
600# DOXYGEN:	 returns the path of the doxygen program found
601#		 returns the path set by the user in the environment
602# --with-doxygen: 'yes' user instructs the module to use doxygen
603#		  'no' user instructs the module not to use doxygen
604#
605# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
606#
607AC_DEFUN([XORG_WITH_DOXYGEN],[
608AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
609AC_ARG_WITH(doxygen,
610	AS_HELP_STRING([--with-doxygen],
611	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
612	   [use_doxygen=$withval], [use_doxygen=auto])
613
614if test "x$use_doxygen" = x"auto"; then
615   AC_PATH_PROG([DOXYGEN], [doxygen])
616   if test "x$DOXYGEN" = "x"; then
617        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
618	have_doxygen=no
619   else
620        have_doxygen=yes
621   fi
622elif test "x$use_doxygen" = x"yes" ; then
623   AC_PATH_PROG([DOXYGEN], [doxygen])
624   if test "x$DOXYGEN" = "x"; then
625        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
626   fi
627   have_doxygen=yes
628elif test "x$use_doxygen" = x"no" ; then
629   if test "x$DOXYGEN" != "x"; then
630      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
631   fi
632   have_doxygen=no
633else
634   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
635fi
636AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
637]) # XORG_CHECK_DOXYGEN
638
639# XORG_CHECK_MALLOC_ZERO
640# ----------------------
641# Minimum version: 1.0.0
642#
643# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
644# malloc(0) returns NULL.  Packages should add one of these cflags to
645# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
646AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
647AC_ARG_ENABLE(malloc0returnsnull,
648	AS_HELP_STRING([--enable-malloc0returnsnull],
649		       [malloc(0) returns NULL (default: auto)]),
650	[MALLOC_ZERO_RETURNS_NULL=$enableval],
651	[MALLOC_ZERO_RETURNS_NULL=auto])
652
653AC_MSG_CHECKING([whether malloc(0) returns NULL])
654if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
655	AC_RUN_IFELSE([
656char *malloc();
657char *realloc();
658char *calloc();
659main() {
660    char *m0, *r0, *c0, *p;
661    m0 = malloc(0);
662    p = malloc(10);
663    r0 = realloc(p,0);
664    c0 = calloc(0);
665    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
666}],
667		[MALLOC_ZERO_RETURNS_NULL=yes],
668		[MALLOC_ZERO_RETURNS_NULL=no],
669		[MALLOC_ZERO_RETURNS_NULL=yes])
670fi
671AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
672
673if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
674	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
675	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
676	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
677else
678	MALLOC_ZERO_CFLAGS=""
679	XMALLOC_ZERO_CFLAGS=""
680	XTMALLOC_ZERO_CFLAGS=""
681fi
682
683AC_SUBST([MALLOC_ZERO_CFLAGS])
684AC_SUBST([XMALLOC_ZERO_CFLAGS])
685AC_SUBST([XTMALLOC_ZERO_CFLAGS])
686]) # XORG_CHECK_MALLOC_ZERO
687
688# XORG_WITH_LINT()
689# ----------------
690# Minimum version: 1.1.0
691#
692# Sets up flags for source checkers such as lint and sparse if --with-lint
693# is specified.   (Use --with-lint=sparse for sparse.)
694# Sets $LINT to name of source checker passed with --with-lint (default: lint)
695# Sets $LINT_FLAGS to flags to pass to source checker
696# Sets LINT automake conditional if enabled (default: disabled)
697#
698AC_DEFUN([XORG_WITH_LINT],[
699
700# Allow checking code with lint, sparse, etc.
701AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
702		[Use a lint-style source code checker (default: disabled)])],
703		[use_lint=$withval], [use_lint=no])
704if test "x$use_lint" = "xyes" ; then
705	LINT="lint"
706else
707	LINT="$use_lint"
708fi
709if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
710    case $LINT in
711	lint|*/lint)
712	    case $host_os in
713		solaris*)
714			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
715			;;
716	    esac
717	    ;;
718    esac
719fi
720
721AC_SUBST(LINT)
722AC_SUBST(LINT_FLAGS)
723AM_CONDITIONAL(LINT, [test x$LINT != xno])
724
725]) # XORG_WITH_LINT
726
727# XORG_LINT_LIBRARY(LIBNAME)
728# --------------------------
729# Minimum version: 1.1.0
730#
731# Sets up flags for building lint libraries for checking programs that call
732# functions in the library.
733# Disabled by default, enable with --enable-lint-library
734# Sets: 
735#	@LINTLIB@		- name of lint library file to make
736#	MAKE_LINT_LIB		- automake conditional
737#
738
739AC_DEFUN([XORG_LINT_LIBRARY],[
740AC_REQUIRE([XORG_WITH_LINT])
741# Build lint "library" for more indepth checks of programs calling this library
742AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
743	[Create lint library (default: disabled)])],
744	[make_lint_lib=$enableval], [make_lint_lib=no])
745if test "x$make_lint_lib" != "xno" ; then
746	if test "x$LINT" = "xno" ; then
747		AC_MSG_ERROR([Cannot make lint library without --with-lint])
748	fi
749	if test "x$make_lint_lib" = "xyes" ; then
750		LINTLIB=llib-l$1.ln
751	else
752		LINTLIB=$make_lint_lib
753	fi
754fi
755AC_SUBST(LINTLIB)
756AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
757
758]) # XORG_LINT_LIBRARY
759
760# XORG_CWARNFLAGS
761# ---------------
762# Minimum version: 1.2.0
763#
764# Defines CWARNFLAGS to enable C compiler warnings.
765#
766AC_DEFUN([XORG_CWARNFLAGS], [
767AC_REQUIRE([AC_PROG_CC])
768if  test "x$GCC" = xyes ; then
769    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
770-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
771-Wbad-function-cast"
772    case `$CC -dumpversion` in
773    3.4.* | 4.*)
774	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
775	;;
776    esac
777else
778    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
779    if test "x$SUNCC" = "xyes"; then
780	CWARNFLAGS="-v"
781    fi
782fi
783AC_SUBST(CWARNFLAGS)
784m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
785]) # XORG_CWARNFLAGS
786
787# XORG_STRICT_OPTION
788# -----------------------
789# Minimum version: 1.3.0
790#
791# Add configure option to enable strict compilation
792AC_DEFUN([XORG_STRICT_OPTION], [
793AC_REQUIRE([AC_PROG_CC])
794AC_REQUIRE([AC_PROG_CC_C99])
795AC_REQUIRE([XORG_CWARNFLAGS])
796
797AC_ARG_ENABLE(strict-compilation,
798			  AS_HELP_STRING([--enable-strict-compilation],
799			  [Enable all warnings from compiler and make them errors (default: disabled)]),
800			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
801if test "x$STRICT_COMPILE" = "xyes"; then
802	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
803	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
804	if test "x$GCC" = xyes ; then
805		STRICT_CFLAGS="-pedantic -Werror"
806	elif test "x$SUNCC" = "xyes"; then
807		STRICT_CFLAGS="-errwarn"
808    elif test "x$INTELCC" = "xyes"; then
809		STRICT_CFLAGS="-Werror"
810	fi
811fi
812CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
813AC_SUBST([CWARNFLAGS])
814]) # XORG_STRICT_OPTION
815
816# XORG_DEFAULT_OPTIONS
817# --------------------
818# Minimum version: 1.3.0
819#
820# Defines default options for X.Org modules.
821#
822AC_DEFUN([XORG_DEFAULT_OPTIONS], [
823XORG_CWARNFLAGS
824XORG_STRICT_OPTION
825XORG_RELEASE_VERSION
826XORG_CHANGELOG
827XORG_INSTALL
828XORG_MANPAGE_SECTIONS
829]) # XORG_DEFAULT_OPTIONS
830
831# XORG_INSTALL()
832# ----------------
833# Minimum version: 1.4.0
834#
835# Defines the variable INSTALL_CMD as the command to copy
836# INSTALL from $prefix/share/util-macros.
837#
838AC_DEFUN([XORG_INSTALL], [
839AC_REQUIRE([PKG_PROG_PKG_CONFIG])
840macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
841INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
842mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
843|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
844echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
845AC_SUBST([INSTALL_CMD])
846]) # XORG_INSTALL
847dnl Copyright 2005 Red Hat, Inc
848dnl
849dnl Permission to use, copy, modify, distribute, and sell this software and its
850dnl documentation for any purpose is hereby granted without fee, provided that
851dnl the above copyright notice appear in all copies and that both that
852dnl copyright notice and this permission notice appear in supporting
853dnl documentation.
854dnl
855dnl The above copyright notice and this permission notice shall be included
856dnl in all copies or substantial portions of the Software.
857dnl
858dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
859dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
860dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
861dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
862dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
863dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
864dnl OTHER DEALINGS IN THE SOFTWARE.
865dnl
866dnl Except as contained in this notice, the name of the copyright holders shall
867dnl not be used in advertising or otherwise to promote the sale, use or
868dnl other dealings in this Software without prior written authorization
869dnl from the copyright holders.
870dnl
871
872# XORG_RELEASE_VERSION
873# --------------------
874# Adds --with/without-release-string and changes the PACKAGE and
875# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
876# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
877# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
878 
879AC_DEFUN([XORG_RELEASE_VERSION],[
880	AC_ARG_WITH(release-version,
881			AS_HELP_STRING([--with-release-version=STRING],
882				[Use release version string in package name]),
883			[RELEASE_VERSION="$withval"],
884			[RELEASE_VERSION=""])
885	if test "x$RELEASE_VERSION" != "x"; then
886		PACKAGE="$PACKAGE-$RELEASE_VERSION"
887		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
888		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
889	fi
890	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
891		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
892		[Major version of this package])
893	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
894	if test "x$PVM" = "x"; then
895		PVM="0"
896	fi
897	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
898		[$PVM],
899		[Minor version of this package])
900	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
901	if test "x$PVP" = "x"; then
902		PVP="0"
903	fi
904	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
905		[$PVP],
906		[Patch version of this package])
907])
908
909# XORG_CHANGELOG()
910# ----------------
911# Minimum version: 1.2.0
912#
913# Defines the variable CHANGELOG_CMD as the command to generate
914# ChangeLog from git.
915#
916#
917AC_DEFUN([XORG_CHANGELOG], [
918CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
919mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
920|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
921echo 'git directory not found: installing possibly empty changelog.' >&2)"
922AC_SUBST([CHANGELOG_CMD])
923]) # XORG_CHANGELOG
924
925# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
926#
927# This file is free software; the Free Software Foundation
928# gives unlimited permission to copy and/or distribute it,
929# with or without modifications, as long as this notice is preserved.
930
931# AM_AUTOMAKE_VERSION(VERSION)
932# ----------------------------
933# Automake X.Y traces this macro to ensure aclocal.m4 has been
934# generated from the m4 files accompanying Automake X.Y.
935# (This private macro should not be called outside this file.)
936AC_DEFUN([AM_AUTOMAKE_VERSION],
937[am__api_version='1.11'
938dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
939dnl require some minimum version.  Point them to the right macro.
940m4_if([$1], [1.11.1], [],
941      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
942])
943
944# _AM_AUTOCONF_VERSION(VERSION)
945# -----------------------------
946# aclocal traces this macro to find the Autoconf version.
947# This is a private macro too.  Using m4_define simplifies
948# the logic in aclocal, which can simply ignore this definition.
949m4_define([_AM_AUTOCONF_VERSION], [])
950
951# AM_SET_CURRENT_AUTOMAKE_VERSION
952# -------------------------------
953# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
954# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
955AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
956[AM_AUTOMAKE_VERSION([1.11.1])dnl
957m4_ifndef([AC_AUTOCONF_VERSION],
958  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
959_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
960
961# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
962
963# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
964#
965# This file is free software; the Free Software Foundation
966# gives unlimited permission to copy and/or distribute it,
967# with or without modifications, as long as this notice is preserved.
968
969# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
970# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
971# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
972#
973# Of course, Automake must honor this variable whenever it calls a
974# tool from the auxiliary directory.  The problem is that $srcdir (and
975# therefore $ac_aux_dir as well) can be either absolute or relative,
976# depending on how configure is run.  This is pretty annoying, since
977# it makes $ac_aux_dir quite unusable in subdirectories: in the top
978# source directory, any form will work fine, but in subdirectories a
979# relative path needs to be adjusted first.
980#
981# $ac_aux_dir/missing
982#    fails when called from a subdirectory if $ac_aux_dir is relative
983# $top_srcdir/$ac_aux_dir/missing
984#    fails if $ac_aux_dir is absolute,
985#    fails when called from a subdirectory in a VPATH build with
986#          a relative $ac_aux_dir
987#
988# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
989# are both prefixed by $srcdir.  In an in-source build this is usually
990# harmless because $srcdir is `.', but things will broke when you
991# start a VPATH build or use an absolute $srcdir.
992#
993# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
994# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
995#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
996# and then we would define $MISSING as
997#   MISSING="\${SHELL} $am_aux_dir/missing"
998# This will work as long as MISSING is not called from configure, because
999# unfortunately $(top_srcdir) has no meaning in configure.
1000# However there are other variables, like CC, which are often used in
1001# configure, and could therefore not use this "fixed" $ac_aux_dir.
1002#
1003# Another solution, used here, is to always expand $ac_aux_dir to an
1004# absolute PATH.  The drawback is that using absolute paths prevent a
1005# configured tree to be moved without reconfiguration.
1006
1007AC_DEFUN([AM_AUX_DIR_EXPAND],
1008[dnl Rely on autoconf to set up CDPATH properly.
1009AC_PREREQ([2.50])dnl
1010# expand $ac_aux_dir to an absolute path
1011am_aux_dir=`cd $ac_aux_dir && pwd`
1012])
1013
1014# AM_CONDITIONAL                                            -*- Autoconf -*-
1015
1016# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1017# Free Software Foundation, Inc.
1018#
1019# This file is free software; the Free Software Foundation
1020# gives unlimited permission to copy and/or distribute it,
1021# with or without modifications, as long as this notice is preserved.
1022
1023# serial 9
1024
1025# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1026# -------------------------------------
1027# Define a conditional.
1028AC_DEFUN([AM_CONDITIONAL],
1029[AC_PREREQ(2.52)dnl
1030 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1031	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1032AC_SUBST([$1_TRUE])dnl
1033AC_SUBST([$1_FALSE])dnl
1034_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1035_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1036m4_define([_AM_COND_VALUE_$1], [$2])dnl
1037if $2; then
1038  $1_TRUE=
1039  $1_FALSE='#'
1040else
1041  $1_TRUE='#'
1042  $1_FALSE=
1043fi
1044AC_CONFIG_COMMANDS_PRE(
1045[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1046  AC_MSG_ERROR([[conditional "$1" was never defined.
1047Usually this means the macro was only invoked conditionally.]])
1048fi])])
1049
1050# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1051# Free Software Foundation, Inc.
1052#
1053# This file is free software; the Free Software Foundation
1054# gives unlimited permission to copy and/or distribute it,
1055# with or without modifications, as long as this notice is preserved.
1056
1057# serial 10
1058
1059# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1060# written in clear, in which case automake, when reading aclocal.m4,
1061# will think it sees a *use*, and therefore will trigger all it's
1062# C support machinery.  Also note that it means that autoscan, seeing
1063# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1064
1065
1066# _AM_DEPENDENCIES(NAME)
1067# ----------------------
1068# See how the compiler implements dependency checking.
1069# NAME is "CC", "CXX", "GCJ", or "OBJC".
1070# We try a few techniques and use that to set a single cache variable.
1071#
1072# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1073# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1074# dependency, and given that the user is not expected to run this macro,
1075# just rely on AC_PROG_CC.
1076AC_DEFUN([_AM_DEPENDENCIES],
1077[AC_REQUIRE([AM_SET_DEPDIR])dnl
1078AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1079AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1080AC_REQUIRE([AM_DEP_TRACK])dnl
1081
1082ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1083       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1084       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1085       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1086       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1087                   [depcc="$$1"   am_compiler_list=])
1088
1089AC_CACHE_CHECK([dependency style of $depcc],
1090               [am_cv_$1_dependencies_compiler_type],
1091[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1092  # We make a subdir and do the tests there.  Otherwise we can end up
1093  # making bogus files that we don't know about and never remove.  For
1094  # instance it was reported that on HP-UX the gcc test will end up
1095  # making a dummy file named `D' -- because `-MD' means `put the output
1096  # in D'.
1097  mkdir conftest.dir
1098  # Copy depcomp to subdir because otherwise we won't find it if we're
1099  # using a relative directory.
1100  cp "$am_depcomp" conftest.dir
1101  cd conftest.dir
1102  # We will build objects and dependencies in a subdirectory because
1103  # it helps to detect inapplicable dependency modes.  For instance
1104  # both Tru64's cc and ICC support -MD to output dependencies as a
1105  # side effect of compilation, but ICC will put the dependencies in
1106  # the current directory while Tru64 will put them in the object
1107  # directory.
1108  mkdir sub
1109
1110  am_cv_$1_dependencies_compiler_type=none
1111  if test "$am_compiler_list" = ""; then
1112     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1113  fi
1114  am__universal=false
1115  m4_case([$1], [CC],
1116    [case " $depcc " in #(
1117     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1118     esac],
1119    [CXX],
1120    [case " $depcc " in #(
1121     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1122     esac])
1123
1124  for depmode in $am_compiler_list; do
1125    # Setup a source with many dependencies, because some compilers
1126    # like to wrap large dependency lists on column 80 (with \), and
1127    # we should not choose a depcomp mode which is confused by this.
1128    #
1129    # We need to recreate these files for each test, as the compiler may
1130    # overwrite some of them when testing with obscure command lines.
1131    # This happens at least with the AIX C compiler.
1132    : > sub/conftest.c
1133    for i in 1 2 3 4 5 6; do
1134      echo '#include "conftst'$i'.h"' >> sub/conftest.c
1135      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1136      # Solaris 8's {/usr,}/bin/sh.
1137      touch sub/conftst$i.h
1138    done
1139    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1140
1141    # We check with `-c' and `-o' for the sake of the "dashmstdout"
1142    # mode.  It turns out that the SunPro C++ compiler does not properly
1143    # handle `-M -o', and we need to detect this.  Also, some Intel
1144    # versions had trouble with output in subdirs
1145    am__obj=sub/conftest.${OBJEXT-o}
1146    am__minus_obj="-o $am__obj"
1147    case $depmode in
1148    gcc)
1149      # This depmode causes a compiler race in universal mode.
1150      test "$am__universal" = false || continue
1151      ;;
1152    nosideeffect)
1153      # after this tag, mechanisms are not by side-effect, so they'll
1154      # only be used when explicitly requested
1155      if test "x$enable_dependency_tracking" = xyes; then
1156	continue
1157      else
1158	break
1159      fi
1160      ;;
1161    msvisualcpp | msvcmsys)
1162      # This compiler won't grok `-c -o', but also, the minuso test has
1163      # not run yet.  These depmodes are late enough in the game, and
1164      # so weak that their functioning should not be impacted.
1165      am__obj=conftest.${OBJEXT-o}
1166      am__minus_obj=
1167      ;;
1168    none) break ;;
1169    esac
1170    if depmode=$depmode \
1171       source=sub/conftest.c object=$am__obj \
1172       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1173       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1174         >/dev/null 2>conftest.err &&
1175       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1176       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1177       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1178       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1179      # icc doesn't choke on unknown options, it will just issue warnings
1180      # or remarks (even with -Werror).  So we grep stderr for any message
1181      # that says an option was ignored or not supported.
1182      # When given -MP, icc 7.0 and 7.1 complain thusly:
1183      #   icc: Command line warning: ignoring option '-M'; no argument required
1184      # The diagnosis changed in icc 8.0:
1185      #   icc: Command line remark: option '-MP' not supported
1186      if (grep 'ignoring option' conftest.err ||
1187          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1188        am_cv_$1_dependencies_compiler_type=$depmode
1189        break
1190      fi
1191    fi
1192  done
1193
1194  cd ..
1195  rm -rf conftest.dir
1196else
1197  am_cv_$1_dependencies_compiler_type=none
1198fi
1199])
1200AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1201AM_CONDITIONAL([am__fastdep$1], [
1202  test "x$enable_dependency_tracking" != xno \
1203  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1204])
1205
1206
1207# AM_SET_DEPDIR
1208# -------------
1209# Choose a directory name for dependency files.
1210# This macro is AC_REQUIREd in _AM_DEPENDENCIES
1211AC_DEFUN([AM_SET_DEPDIR],
1212[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1213AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1214])
1215
1216
1217# AM_DEP_TRACK
1218# ------------
1219AC_DEFUN([AM_DEP_TRACK],
1220[AC_ARG_ENABLE(dependency-tracking,
1221[  --disable-dependency-tracking  speeds up one-time build
1222  --enable-dependency-tracking   do not reject slow dependency extractors])
1223if test "x$enable_dependency_tracking" != xno; then
1224  am_depcomp="$ac_aux_dir/depcomp"
1225  AMDEPBACKSLASH='\'
1226fi
1227AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1228AC_SUBST([AMDEPBACKSLASH])dnl
1229_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1230])
1231
1232# Generate code to set up dependency tracking.              -*- Autoconf -*-
1233
1234# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1235# Free Software Foundation, Inc.
1236#
1237# This file is free software; the Free Software Foundation
1238# gives unlimited permission to copy and/or distribute it,
1239# with or without modifications, as long as this notice is preserved.
1240
1241#serial 5
1242
1243# _AM_OUTPUT_DEPENDENCY_COMMANDS
1244# ------------------------------
1245AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1246[{
1247  # Autoconf 2.62 quotes --file arguments for eval, but not when files
1248  # are listed without --file.  Let's play safe and only enable the eval
1249  # if we detect the quoting.
1250  case $CONFIG_FILES in
1251  *\'*) eval set x "$CONFIG_FILES" ;;
1252  *)   set x $CONFIG_FILES ;;
1253  esac
1254  shift
1255  for mf
1256  do
1257    # Strip MF so we end up with the name of the file.
1258    mf=`echo "$mf" | sed -e 's/:.*$//'`
1259    # Check whether this is an Automake generated Makefile or not.
1260    # We used to match only the files named `Makefile.in', but
1261    # some people rename them; so instead we look at the file content.
1262    # Grep'ing the first line is not enough: some people post-process
1263    # each Makefile.in and add a new line on top of each file to say so.
1264    # Grep'ing the whole file is not good either: AIX grep has a line
1265    # limit of 2048, but all sed's we know have understand at least 4000.
1266    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1267      dirpart=`AS_DIRNAME("$mf")`
1268    else
1269      continue
1270    fi
1271    # Extract the definition of DEPDIR, am__include, and am__quote
1272    # from the Makefile without running `make'.
1273    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1274    test -z "$DEPDIR" && continue
1275    am__include=`sed -n 's/^am__include = //p' < "$mf"`
1276    test -z "am__include" && continue
1277    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1278    # When using ansi2knr, U may be empty or an underscore; expand it
1279    U=`sed -n 's/^U = //p' < "$mf"`
1280    # Find all dependency output files, they are included files with
1281    # $(DEPDIR) in their names.  We invoke sed twice because it is the
1282    # simplest approach to changing $(DEPDIR) to its actual value in the
1283    # expansion.
1284    for file in `sed -n "
1285      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1286	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1287      # Make sure the directory exists.
1288      test -f "$dirpart/$file" && continue
1289      fdir=`AS_DIRNAME(["$file"])`
1290      AS_MKDIR_P([$dirpart/$fdir])
1291      # echo "creating $dirpart/$file"
1292      echo '# dummy' > "$dirpart/$file"
1293    done
1294  done
1295}
1296])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1297
1298
1299# AM_OUTPUT_DEPENDENCY_COMMANDS
1300# -----------------------------
1301# This macro should only be invoked once -- use via AC_REQUIRE.
1302#
1303# This code is only required when automatic dependency tracking
1304# is enabled.  FIXME.  This creates each `.P' file that we will
1305# need in order to bootstrap the dependency handling code.
1306AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1307[AC_CONFIG_COMMANDS([depfiles],
1308     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1309     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1310])
1311
1312# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1313# Free Software Foundation, Inc.
1314#
1315# This file is free software; the Free Software Foundation
1316# gives unlimited permission to copy and/or distribute it,
1317# with or without modifications, as long as this notice is preserved.
1318
1319# serial 8
1320
1321# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
1322AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1323
1324# Do all the work for Automake.                             -*- Autoconf -*-
1325
1326# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1327# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1328#
1329# This file is free software; the Free Software Foundation
1330# gives unlimited permission to copy and/or distribute it,
1331# with or without modifications, as long as this notice is preserved.
1332
1333# serial 16
1334
1335# This macro actually does too much.  Some checks are only needed if
1336# your package does certain things.  But this isn't really a big deal.
1337
1338# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1339# AM_INIT_AUTOMAKE([OPTIONS])
1340# -----------------------------------------------
1341# The call with PACKAGE and VERSION arguments is the old style
1342# call (pre autoconf-2.50), which is being phased out.  PACKAGE
1343# and VERSION should now be passed to AC_INIT and removed from
1344# the call to AM_INIT_AUTOMAKE.
1345# We support both call styles for the transition.  After
1346# the next Automake release, Autoconf can make the AC_INIT
1347# arguments mandatory, and then we can depend on a new Autoconf
1348# release and drop the old call support.
1349AC_DEFUN([AM_INIT_AUTOMAKE],
1350[AC_PREREQ([2.62])dnl
1351dnl Autoconf wants to disallow AM_ names.  We explicitly allow
1352dnl the ones we care about.
1353m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1354AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1355AC_REQUIRE([AC_PROG_INSTALL])dnl
1356if test "`cd $srcdir && pwd`" != "`pwd`"; then
1357  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1358  # is not polluted with repeated "-I."
1359  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1360  # test to see if srcdir already configured
1361  if test -f $srcdir/config.status; then
1362    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1363  fi
1364fi
1365
1366# test whether we have cygpath
1367if test -z "$CYGPATH_W"; then
1368  if (cygpath --version) >/dev/null 2>/dev/null; then
1369    CYGPATH_W='cygpath -w'
1370  else
1371    CYGPATH_W=echo
1372  fi
1373fi
1374AC_SUBST([CYGPATH_W])
1375
1376# Define the identity of the package.
1377dnl Distinguish between old-style and new-style calls.
1378m4_ifval([$2],
1379[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1380 AC_SUBST([PACKAGE], [$1])dnl
1381 AC_SUBST([VERSION], [$2])],
1382[_AM_SET_OPTIONS([$1])dnl
1383dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1384m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1385  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1386 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1387 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1388
1389_AM_IF_OPTION([no-define],,
1390[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1391 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1392
1393# Some tools Automake needs.
1394AC_REQUIRE([AM_SANITY_CHECK])dnl
1395AC_REQUIRE([AC_ARG_PROGRAM])dnl
1396AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1397AM_MISSING_PROG(AUTOCONF, autoconf)
1398AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1399AM_MISSING_PROG(AUTOHEADER, autoheader)
1400AM_MISSING_PROG(MAKEINFO, makeinfo)
1401AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1402AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1403AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1404# We need awk for the "check" target.  The system "awk" is bad on
1405# some platforms.
1406AC_REQUIRE([AC_PROG_AWK])dnl
1407AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1408AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1409_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1410	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1411			     [_AM_PROG_TAR([v7])])])
1412_AM_IF_OPTION([no-dependencies],,
1413[AC_PROVIDE_IFELSE([AC_PROG_CC],
1414		  [_AM_DEPENDENCIES(CC)],
1415		  [define([AC_PROG_CC],
1416			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1417AC_PROVIDE_IFELSE([AC_PROG_CXX],
1418		  [_AM_DEPENDENCIES(CXX)],
1419		  [define([AC_PROG_CXX],
1420			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1421AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1422		  [_AM_DEPENDENCIES(OBJC)],
1423		  [define([AC_PROG_OBJC],
1424			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1425])
1426_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1427dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
1428dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
1429dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
1430AC_CONFIG_COMMANDS_PRE(dnl
1431[m4_provide_if([_AM_COMPILER_EXEEXT],
1432  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1433])
1434
1435dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
1436dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1437dnl mangled by Autoconf and run in a shell conditional statement.
1438m4_define([_AC_COMPILER_EXEEXT],
1439m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1440
1441
1442# When config.status generates a header, we must update the stamp-h file.
1443# This file resides in the same directory as the config header
1444# that is generated.  The stamp files are numbered to have different names.
1445
1446# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1447# loop where config.status creates the headers, so we can generate
1448# our stamp files there.
1449AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1450[# Compute $1's index in $config_headers.
1451_am_arg=$1
1452_am_stamp_count=1
1453for _am_header in $config_headers :; do
1454  case $_am_header in
1455    $_am_arg | $_am_arg:* )
1456      break ;;
1457    * )
1458      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1459  esac
1460done
1461echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1462
1463# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
1464#
1465# This file is free software; the Free Software Foundation
1466# gives unlimited permission to copy and/or distribute it,
1467# with or without modifications, as long as this notice is preserved.
1468
1469# AM_PROG_INSTALL_SH
1470# ------------------
1471# Define $install_sh.
1472AC_DEFUN([AM_PROG_INSTALL_SH],
1473[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1474if test x"${install_sh}" != xset; then
1475  case $am_aux_dir in
1476  *\ * | *\	*)
1477    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1478  *)
1479    install_sh="\${SHELL} $am_aux_dir/install-sh"
1480  esac
1481fi
1482AC_SUBST(install_sh)])
1483
1484# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1485#
1486# This file is free software; the Free Software Foundation
1487# gives unlimited permission to copy and/or distribute it,
1488# with or without modifications, as long as this notice is preserved.
1489
1490# serial 2
1491
1492# Check whether the underlying file-system supports filenames
1493# with a leading dot.  For instance MS-DOS doesn't.
1494AC_DEFUN([AM_SET_LEADING_DOT],
1495[rm -rf .tst 2>/dev/null
1496mkdir .tst 2>/dev/null
1497if test -d .tst; then
1498  am__leading_dot=.
1499else
1500  am__leading_dot=_
1501fi
1502rmdir .tst 2>/dev/null
1503AC_SUBST([am__leading_dot])])
1504
1505# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
1506# From Jim Meyering
1507
1508# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1509# Free Software Foundation, Inc.
1510#
1511# This file is free software; the Free Software Foundation
1512# gives unlimited permission to copy and/or distribute it,
1513# with or without modifications, as long as this notice is preserved.
1514
1515# serial 5
1516
1517# AM_MAINTAINER_MODE([DEFAULT-MODE])
1518# ----------------------------------
1519# Control maintainer-specific portions of Makefiles.
1520# Default is to disable them, unless `enable' is passed literally.
1521# For symmetry, `disable' may be passed as well.  Anyway, the user
1522# can override the default with the --enable/--disable switch.
1523AC_DEFUN([AM_MAINTAINER_MODE],
1524[m4_case(m4_default([$1], [disable]),
1525       [enable], [m4_define([am_maintainer_other], [disable])],
1526       [disable], [m4_define([am_maintainer_other], [enable])],
1527       [m4_define([am_maintainer_other], [enable])
1528        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
1529AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
1530  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
1531  AC_ARG_ENABLE([maintainer-mode],
1532[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
1533			  (and sometimes confusing) to the casual installer],
1534      [USE_MAINTAINER_MODE=$enableval],
1535      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
1536  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1537  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
1538  MAINT=$MAINTAINER_MODE_TRUE
1539  AC_SUBST([MAINT])dnl
1540]
1541)
1542
1543AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
1544
1545# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1546
1547# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
1548#
1549# This file is free software; the Free Software Foundation
1550# gives unlimited permission to copy and/or distribute it,
1551# with or without modifications, as long as this notice is preserved.
1552
1553# serial 4
1554
1555# AM_MAKE_INCLUDE()
1556# -----------------
1557# Check to see how make treats includes.
1558AC_DEFUN([AM_MAKE_INCLUDE],
1559[am_make=${MAKE-make}
1560cat > confinc << 'END'
1561am__doit:
1562	@echo this is the am__doit target
1563.PHONY: am__doit
1564END
1565# If we don't find an include directive, just comment out the code.
1566AC_MSG_CHECKING([for style of include used by $am_make])
1567am__include="#"
1568am__quote=
1569_am_result=none
1570# First try GNU make style include.
1571echo "include confinc" > confmf
1572# Ignore all kinds of additional output from `make'.
1573case `$am_make -s -f confmf 2> /dev/null` in #(
1574*the\ am__doit\ target*)
1575  am__include=include
1576  am__quote=
1577  _am_result=GNU
1578  ;;
1579esac
1580# Now try BSD make style include.
1581if test "$am__include" = "#"; then
1582   echo '.include "confinc"' > confmf
1583   case `$am_make -s -f confmf 2> /dev/null` in #(
1584   *the\ am__doit\ target*)
1585     am__include=.include
1586     am__quote="\""
1587     _am_result=BSD
1588     ;;
1589   esac
1590fi
1591AC_SUBST([am__include])
1592AC_SUBST([am__quote])
1593AC_MSG_RESULT([$_am_result])
1594rm -f confinc confmf
1595])
1596
1597# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1598
1599# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
1600# Free Software Foundation, Inc.
1601#
1602# This file is free software; the Free Software Foundation
1603# gives unlimited permission to copy and/or distribute it,
1604# with or without modifications, as long as this notice is preserved.
1605
1606# serial 6
1607
1608# AM_MISSING_PROG(NAME, PROGRAM)
1609# ------------------------------
1610AC_DEFUN([AM_MISSING_PROG],
1611[AC_REQUIRE([AM_MISSING_HAS_RUN])
1612$1=${$1-"${am_missing_run}$2"}
1613AC_SUBST($1)])
1614
1615
1616# AM_MISSING_HAS_RUN
1617# ------------------
1618# Define MISSING if not defined so far and test if it supports --run.
1619# If it does, set am_missing_run to use it, otherwise, to nothing.
1620AC_DEFUN([AM_MISSING_HAS_RUN],
1621[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1622AC_REQUIRE_AUX_FILE([missing])dnl
1623if test x"${MISSING+set}" != xset; then
1624  case $am_aux_dir in
1625  *\ * | *\	*)
1626    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1627  *)
1628    MISSING="\${SHELL} $am_aux_dir/missing" ;;
1629  esac
1630fi
1631# Use eval to expand $SHELL
1632if eval "$MISSING --run true"; then
1633  am_missing_run="$MISSING --run "
1634else
1635  am_missing_run=
1636  AC_MSG_WARN([`missing' script is too old or missing])
1637fi
1638])
1639
1640# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
1641#
1642# This file is free software; the Free Software Foundation
1643# gives unlimited permission to copy and/or distribute it,
1644# with or without modifications, as long as this notice is preserved.
1645
1646# AM_PROG_MKDIR_P
1647# ---------------
1648# Check for `mkdir -p'.
1649AC_DEFUN([AM_PROG_MKDIR_P],
1650[AC_PREREQ([2.60])dnl
1651AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1652dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1653dnl while keeping a definition of mkdir_p for backward compatibility.
1654dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1655dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1656dnl Makefile.ins that do not define MKDIR_P, so we do our own
1657dnl adjustment using top_builddir (which is defined more often than
1658dnl MKDIR_P).
1659AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1660case $mkdir_p in
1661  [[\\/$]]* | ?:[[\\/]]*) ;;
1662  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1663esac
1664])
1665
1666# Helper functions for option handling.                     -*- Autoconf -*-
1667
1668# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
1669#
1670# This file is free software; the Free Software Foundation
1671# gives unlimited permission to copy and/or distribute it,
1672# with or without modifications, as long as this notice is preserved.
1673
1674# serial 4
1675
1676# _AM_MANGLE_OPTION(NAME)
1677# -----------------------
1678AC_DEFUN([_AM_MANGLE_OPTION],
1679[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1680
1681# _AM_SET_OPTION(NAME)
1682# ------------------------------
1683# Set option NAME.  Presently that only means defining a flag for this option.
1684AC_DEFUN([_AM_SET_OPTION],
1685[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1686
1687# _AM_SET_OPTIONS(OPTIONS)
1688# ----------------------------------
1689# OPTIONS is a space-separated list of Automake options.
1690AC_DEFUN([_AM_SET_OPTIONS],
1691[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1692
1693# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1694# -------------------------------------------
1695# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1696AC_DEFUN([_AM_IF_OPTION],
1697[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1698
1699# Check to make sure that the build environment is sane.    -*- Autoconf -*-
1700
1701# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
1702# Free Software Foundation, Inc.
1703#
1704# This file is free software; the Free Software Foundation
1705# gives unlimited permission to copy and/or distribute it,
1706# with or without modifications, as long as this notice is preserved.
1707
1708# serial 5
1709
1710# AM_SANITY_CHECK
1711# ---------------
1712AC_DEFUN([AM_SANITY_CHECK],
1713[AC_MSG_CHECKING([whether build environment is sane])
1714# Just in case
1715sleep 1
1716echo timestamp > conftest.file
1717# Reject unsafe characters in $srcdir or the absolute working directory
1718# name.  Accept space and tab only in the latter.
1719am_lf='
1720'
1721case `pwd` in
1722  *[[\\\"\#\$\&\'\`$am_lf]]*)
1723    AC_MSG_ERROR([unsafe absolute working directory name]);;
1724esac
1725case $srcdir in
1726  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
1727    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
1728esac
1729
1730# Do `set' in a subshell so we don't clobber the current shell's
1731# arguments.  Must try -L first in case configure is actually a
1732# symlink; some systems play weird games with the mod time of symlinks
1733# (eg FreeBSD returns the mod time of the symlink's containing
1734# directory).
1735if (
1736   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1737   if test "$[*]" = "X"; then
1738      # -L didn't work.
1739      set X `ls -t "$srcdir/configure" conftest.file`
1740   fi
1741   rm -f conftest.file
1742   if test "$[*]" != "X $srcdir/configure conftest.file" \
1743      && test "$[*]" != "X conftest.file $srcdir/configure"; then
1744
1745      # If neither matched, then we have a broken ls.  This can happen
1746      # if, for instance, CONFIG_SHELL is bash and it inherits a
1747      # broken ls alias from the environment.  This has actually
1748      # happened.  Such a system could not be considered "sane".
1749      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1750alias in your environment])
1751   fi
1752
1753   test "$[2]" = conftest.file
1754   )
1755then
1756   # Ok.
1757   :
1758else
1759   AC_MSG_ERROR([newly created file is older than distributed files!
1760Check your system clock])
1761fi
1762AC_MSG_RESULT(yes)])
1763
1764# Copyright (C) 2009  Free Software Foundation, Inc.
1765#
1766# This file is free software; the Free Software Foundation
1767# gives unlimited permission to copy and/or distribute it,
1768# with or without modifications, as long as this notice is preserved.
1769
1770# serial 1
1771
1772# AM_SILENT_RULES([DEFAULT])
1773# --------------------------
1774# Enable less verbose build rules; with the default set to DEFAULT
1775# (`yes' being less verbose, `no' or empty being verbose).
1776AC_DEFUN([AM_SILENT_RULES],
1777[AC_ARG_ENABLE([silent-rules],
1778[  --enable-silent-rules          less verbose build output (undo: `make V=1')
1779  --disable-silent-rules         verbose build output (undo: `make V=0')])
1780case $enable_silent_rules in
1781yes) AM_DEFAULT_VERBOSITY=0;;
1782no)  AM_DEFAULT_VERBOSITY=1;;
1783*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1784esac
1785AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1786AM_BACKSLASH='\'
1787AC_SUBST([AM_BACKSLASH])dnl
1788_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1789])
1790
1791# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1792#
1793# This file is free software; the Free Software Foundation
1794# gives unlimited permission to copy and/or distribute it,
1795# with or without modifications, as long as this notice is preserved.
1796
1797# AM_PROG_INSTALL_STRIP
1798# ---------------------
1799# One issue with vendor `install' (even GNU) is that you can't
1800# specify the program used to strip binaries.  This is especially
1801# annoying in cross-compiling environments, where the build's strip
1802# is unlikely to handle the host's binaries.
1803# Fortunately install-sh will honor a STRIPPROG variable, so we
1804# always use install-sh in `make install-strip', and initialize
1805# STRIPPROG with the value of the STRIP variable (set by the user).
1806AC_DEFUN([AM_PROG_INSTALL_STRIP],
1807[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1808# Installed binaries are usually stripped using `strip' when the user
1809# run `make install-strip'.  However `strip' might not be the right
1810# tool to use in cross-compilation environments, therefore Automake
1811# will honor the `STRIP' environment variable to overrule this program.
1812dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1813if test "$cross_compiling" != no; then
1814  AC_CHECK_TOOL([STRIP], [strip], :)
1815fi
1816INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1817AC_SUBST([INSTALL_STRIP_PROGRAM])])
1818
1819# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
1820#
1821# This file is free software; the Free Software Foundation
1822# gives unlimited permission to copy and/or distribute it,
1823# with or without modifications, as long as this notice is preserved.
1824
1825# serial 2
1826
1827# _AM_SUBST_NOTMAKE(VARIABLE)
1828# ---------------------------
1829# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1830# This macro is traced by Automake.
1831AC_DEFUN([_AM_SUBST_NOTMAKE])
1832
1833# AM_SUBST_NOTMAKE(VARIABLE)
1834# ---------------------------
1835# Public sister of _AM_SUBST_NOTMAKE.
1836AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1837
1838# Check how to create a tarball.                            -*- Autoconf -*-
1839
1840# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1841#
1842# This file is free software; the Free Software Foundation
1843# gives unlimited permission to copy and/or distribute it,
1844# with or without modifications, as long as this notice is preserved.
1845
1846# serial 2
1847
1848# _AM_PROG_TAR(FORMAT)
1849# --------------------
1850# Check how to create a tarball in format FORMAT.
1851# FORMAT should be one of `v7', `ustar', or `pax'.
1852#
1853# Substitute a variable $(am__tar) that is a command
1854# writing to stdout a FORMAT-tarball containing the directory
1855# $tardir.
1856#     tardir=directory && $(am__tar) > result.tar
1857#
1858# Substitute a variable $(am__untar) that extract such
1859# a tarball read from stdin.
1860#     $(am__untar) < result.tar
1861AC_DEFUN([_AM_PROG_TAR],
1862[# Always define AMTAR for backward compatibility.
1863AM_MISSING_PROG([AMTAR], [tar])
1864m4_if([$1], [v7],
1865     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1866     [m4_case([$1], [ustar],, [pax],,
1867              [m4_fatal([Unknown tar format])])
1868AC_MSG_CHECKING([how to create a $1 tar archive])
1869# Loop over all known methods to create a tar archive until one works.
1870_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1871_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1872# Do not fold the above two line into one, because Tru64 sh and
1873# Solaris sh will not grok spaces in the rhs of `-'.
1874for _am_tool in $_am_tools
1875do
1876  case $_am_tool in
1877  gnutar)
1878    for _am_tar in tar gnutar gtar;
1879    do
1880      AM_RUN_LOG([$_am_tar --version]) && break
1881    done
1882    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1883    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1884    am__untar="$_am_tar -xf -"
1885    ;;
1886  plaintar)
1887    # Must skip GNU tar: if it does not support --format= it doesn't create
1888    # ustar tarball either.
1889    (tar --version) >/dev/null 2>&1 && continue
1890    am__tar='tar chf - "$$tardir"'
1891    am__tar_='tar chf - "$tardir"'
1892    am__untar='tar xf -'
1893    ;;
1894  pax)
1895    am__tar='pax -L -x $1 -w "$$tardir"'
1896    am__tar_='pax -L -x $1 -w "$tardir"'
1897    am__untar='pax -r'
1898    ;;
1899  cpio)
1900    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1901    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1902    am__untar='cpio -i -H $1 -d'
1903    ;;
1904  none)
1905    am__tar=false
1906    am__tar_=false
1907    am__untar=false
1908    ;;
1909  esac
1910
1911  # If the value was cached, stop now.  We just wanted to have am__tar
1912  # and am__untar set.
1913  test -n "${am_cv_prog_tar_$1}" && break
1914
1915  # tar/untar a dummy directory, and stop if the command works
1916  rm -rf conftest.dir
1917  mkdir conftest.dir
1918  echo GrepMe > conftest.dir/file
1919  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1920  rm -rf conftest.dir
1921  if test -s conftest.tar; then
1922    AM_RUN_LOG([$am__untar <conftest.tar])
1923    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1924  fi
1925done
1926rm -rf conftest.dir
1927
1928AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1929AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1930AC_SUBST([am__tar])
1931AC_SUBST([am__untar])
1932]) # _AM_PROG_TAR
1933
1934