1 # generated automatically by aclocal 1.11.1 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 m4_ifndef([AC_AUTOCONF_VERSION],
15 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
17 [m4_warning([this file was generated for autoconf 2.67.
18 You have another version of autoconf. It may work, but is not guaranteed to.
19 If you have problems, you may need to regenerate the build system entirely.
20 To do so, use the procedure documented by the package, typically `autoreconf'.])])
22 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
23 # serial 1 (pkg-config-0.24)
25 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
27 # This program is free software; you can redistribute it and/or modify
28 # it under the terms of the GNU General Public License as published by
29 # the Free Software Foundation; either version 2 of the License, or
30 # (at your option) any later version.
32 # This program is distributed in the hope that it will be useful, but
33 # WITHOUT ANY WARRANTY; without even the implied warranty of
34 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
35 # General Public License for more details.
37 # You should have received a copy of the GNU General Public License
38 # along with this program; if not, write to the Free Software
39 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
41 # As a special exception to the GNU General Public License, if you
42 # distribute this file as part of a program that contains a
43 # configuration script generated by Autoconf, you may include it under
44 # the same distribution terms that you use for the rest of that program.
46 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
47 # ----------------------------------
48 AC_DEFUN([PKG_PROG_PKG_CONFIG],
49 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
50 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
51 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
52 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
53 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
55 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
56 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
58 if test -n "$PKG_CONFIG"; then
59 _pkg_min_version=m4_default([$1], [0.9.0])
60 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
61 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
68 ])# PKG_PROG_PKG_CONFIG
70 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
72 # Check to see whether a particular set of modules exists. Similar
73 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
75 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
76 # only at the first occurence in configure.ac, so if the first place
77 # it's called might be skipped (such as if it is within an "if", you
78 # have to call PKG_CHECK_EXISTS manually
79 # --------------------------------------------------------------
80 AC_DEFUN([PKG_CHECK_EXISTS],
81 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
82 if test -n "$PKG_CONFIG" && \
83 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
89 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
90 # ---------------------------------------------
91 m4_define([_PKG_CONFIG],
92 [if test -n "$$1"; then
94 elif test -n "$PKG_CONFIG"; then
95 PKG_CHECK_EXISTS([$3],
96 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
103 # _PKG_SHORT_ERRORS_SUPPORTED
104 # -----------------------------
105 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
106 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
107 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
108 _pkg_short_errors_supported=yes
110 _pkg_short_errors_supported=no
112 ])# _PKG_SHORT_ERRORS_SUPPORTED
115 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
116 # [ACTION-IF-NOT-FOUND])
119 # Note that if there is a possibility the first call to
120 # PKG_CHECK_MODULES might not happen, you should be sure to include an
121 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
124 # --------------------------------------------------------------
125 AC_DEFUN([PKG_CHECK_MODULES],
126 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
127 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
128 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
131 AC_MSG_CHECKING([for $1])
133 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
134 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
136 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
137 and $1[]_LIBS to avoid the need to call pkg-config.
138 See the pkg-config man page for more details.])
140 if test $pkg_failed = yes; then
142 _PKG_SHORT_ERRORS_SUPPORTED
143 if test $_pkg_short_errors_supported = yes; then
144 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
146 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
148 # Put the nasty error message in config.log where it belongs
149 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
151 m4_default([$4], [AC_MSG_ERROR(
152 [Package requirements ($2) were not met:
156 Consider adjusting the PKG_CONFIG_PATH environment variable if you
157 installed software in a non-standard prefix.
161 elif test $pkg_failed = untried; then
163 m4_default([$4], [AC_MSG_FAILURE(
164 [The pkg-config script could not be found or is too old. Make sure it
165 is in your PATH or set the PKG_CONFIG environment variable to the full
170 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
173 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
174 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
178 ])# PKG_CHECK_MODULES
180 dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
182 dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
184 dnl Permission is hereby granted, free of charge, to any person obtaining a
185 dnl copy of this software and associated documentation files (the "Software"),
186 dnl to deal in the Software without restriction, including without limitation
187 dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
188 dnl and/or sell copies of the Software, and to permit persons to whom the
189 dnl Software is furnished to do so, subject to the following conditions:
191 dnl The above copyright notice and this permission notice (including the next
192 dnl paragraph) shall be included in all copies or substantial portions of the
195 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
196 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
197 dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
198 dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
199 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
200 dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
201 dnl DEALINGS IN THE SOFTWARE.
203 # XORG_MACROS_VERSION(required-version)
204 # -------------------------------------
205 # Minimum version: 1.1.0
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)
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])])
216 # See the "minimum version" comment for each macro you use to see what
217 # version you require.
218 m4_defun([XORG_MACROS_VERSION],[
219 m4_define([vers_have], [1.12.0])
220 m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
221 m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
222 m4_if(m4_cmp(maj_have, maj_needed), 0,,
223 [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
224 m4_if(m4_version_compare(vers_have, [$1]), -1,
225 [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
226 m4_undefine([vers_have])
227 m4_undefine([maj_have])
228 m4_undefine([maj_needed])
229 ]) # XORG_MACROS_VERSION
233 # Minimum version: 1.0.0
235 # Find cpp program and necessary flags for use in pre-processing text files
236 # such as man pages and config files
237 AC_DEFUN([XORG_PROG_RAWCPP],[
238 AC_REQUIRE([AC_PROG_CPP])
239 AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
240 [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
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.
245 AC_MSG_CHECKING([if $RAWCPP requires -undef])
246 AC_LANG_CONFTEST([Does cpp redefine unix ?])
247 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
250 if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
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])
258 AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
261 rm -f conftest.$ac_ext
263 AC_MSG_CHECKING([if $RAWCPP requires -traditional])
264 AC_LANG_CONFTEST([Does cpp preserve "whitespace"?])
265 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
268 if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
269 RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
272 AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
275 rm -f conftest.$ac_ext
276 AC_SUBST(RAWCPPFLAGS)
277 ]) # XORG_PROG_RAWCPP
279 # XORG_MANPAGE_SECTIONS()
280 # -----------------------
281 # Minimum version: 1.0.0
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 # Added MAN_SUBSTS in version 1.8
288 # Added AC_PROG_SED in version 1.8
290 AC_DEFUN([XORG_MANPAGE_SECTIONS],[
291 AC_REQUIRE([AC_CANONICAL_HOST])
292 AC_REQUIRE([AC_PROG_SED])
294 if test x$APP_MAN_SUFFIX = x ; then
297 if test x$APP_MAN_DIR = x ; then
298 APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
301 if test x$LIB_MAN_SUFFIX = x ; then
304 if test x$LIB_MAN_DIR = x ; then
305 LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
308 if test x$FILE_MAN_SUFFIX = x ; then
310 solaris*) FILE_MAN_SUFFIX=4 ;;
311 *) FILE_MAN_SUFFIX=5 ;;
314 if test x$FILE_MAN_DIR = x ; then
315 FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
318 if test x$MISC_MAN_SUFFIX = x ; then
320 solaris*) MISC_MAN_SUFFIX=5 ;;
321 *) MISC_MAN_SUFFIX=7 ;;
324 if test x$MISC_MAN_DIR = x ; then
325 MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
328 if test x$DRIVER_MAN_SUFFIX = x ; then
330 solaris*) DRIVER_MAN_SUFFIX=7 ;;
331 *) DRIVER_MAN_SUFFIX=4 ;;
334 if test x$DRIVER_MAN_DIR = x ; then
335 DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
338 if test x$ADMIN_MAN_SUFFIX = x ; then
340 solaris*) ADMIN_MAN_SUFFIX=1m ;;
341 *) ADMIN_MAN_SUFFIX=8 ;;
344 if test x$ADMIN_MAN_DIR = x ; then
345 ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
349 AC_SUBST([APP_MAN_SUFFIX])
350 AC_SUBST([LIB_MAN_SUFFIX])
351 AC_SUBST([FILE_MAN_SUFFIX])
352 AC_SUBST([MISC_MAN_SUFFIX])
353 AC_SUBST([DRIVER_MAN_SUFFIX])
354 AC_SUBST([ADMIN_MAN_SUFFIX])
355 AC_SUBST([APP_MAN_DIR])
356 AC_SUBST([LIB_MAN_DIR])
357 AC_SUBST([FILE_MAN_DIR])
358 AC_SUBST([MISC_MAN_DIR])
359 AC_SUBST([DRIVER_MAN_DIR])
360 AC_SUBST([ADMIN_MAN_DIR])
362 XORG_MAN_PAGE="X Version 11"
363 AC_SUBST([XORG_MAN_PAGE])
365 -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
366 -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
367 -e 's|__xservername__|Xorg|g' \
368 -e 's|__xconfigfile__|xorg.conf|g' \
369 -e 's|__projectroot__|\$(prefix)|g' \
370 -e 's|__apploaddir__|\$(appdefaultdir)|g' \
371 -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
372 -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
373 -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
374 -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
375 -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
376 -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
377 AC_SUBST([MAN_SUBSTS])
379 ]) # XORG_MANPAGE_SECTIONS
381 # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
382 # ------------------------
383 # Minimum version: 1.7.0
385 # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
386 # provided by xorg-sgml-doctools, if installed.
387 AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
388 AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
390 PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
391 [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
393 [if test x"$cross_compiling" != x"yes" ; then
394 AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
395 [XORG_SGML_PATH=$prefix/share/sgml])
399 # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
400 # the path and the name of the doc stylesheet
401 if test "x$XORG_SGML_PATH" != "x" ; then
402 AC_MSG_RESULT([$XORG_SGML_PATH])
403 STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
404 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
409 AC_SUBST(XORG_SGML_PATH)
410 AC_SUBST(STYLESHEET_SRCDIR)
411 AC_SUBST(XSL_STYLESHEET)
412 AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
413 ]) # XORG_CHECK_SGML_DOCTOOLS
415 # XORG_CHECK_LINUXDOC
416 # -------------------
417 # Minimum version: 1.0.0
419 # Defines the variable MAKE_TEXT if the necessary tools and
420 # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
421 # Whether or not the necessary tools and files are found can be checked
422 # with the AM_CONDITIONAL "BUILD_LINUXDOC"
423 AC_DEFUN([XORG_CHECK_LINUXDOC],[
424 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
425 AC_REQUIRE([XORG_WITH_PS2PDF])
427 AC_PATH_PROG(LINUXDOC, linuxdoc)
429 AC_MSG_CHECKING([whether to build documentation])
431 if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
437 AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
439 AC_MSG_RESULT([$BUILDDOC])
441 AC_MSG_CHECKING([whether to build pdf documentation])
443 if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
449 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
451 AC_MSG_RESULT([$BUILDPDFDOC])
453 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
454 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
456 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
462 ]) # XORG_CHECK_LINUXDOC
465 # -------------------
466 # Minimum version: 1.0.0
468 # Checks for the ability to build output formats from SGML DocBook source.
469 # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
470 # indicates whether the necessary tools and files are found and, if set,
471 # $(MAKE_XXX) blah.sgml will produce blah.xxx.
472 AC_DEFUN([XORG_CHECK_DOCBOOK],[
473 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
480 AC_PATH_PROG(DOCBOOKPS, docbook2ps)
481 AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
482 AC_PATH_PROG(DOCBOOKHTML, docbook2html)
483 AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
485 AC_MSG_CHECKING([whether to build text documentation])
486 if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
487 test x$BUILD_TXTDOC != xno; then
490 AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
491 AC_MSG_RESULT([$BUILDTXTDOC])
493 AC_MSG_CHECKING([whether to build PDF documentation])
494 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
495 test x$BUILD_PDFDOC != xno; then
498 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
499 AC_MSG_RESULT([$BUILDPDFDOC])
501 AC_MSG_CHECKING([whether to build PostScript documentation])
502 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
503 test x$BUILD_PSDOC != xno; then
506 AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
507 AC_MSG_RESULT([$BUILDPSDOC])
509 AC_MSG_CHECKING([whether to build HTML documentation])
510 if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
511 test x$BUILD_HTMLDOC != xno; then
514 AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
515 AC_MSG_RESULT([$BUILDHTMLDOC])
517 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
518 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
519 MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
520 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
526 ]) # XORG_CHECK_DOCBOOK
528 # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
530 # Minimum version: 1.5.0
531 # Minimum version for optional DEFAULT argument: 1.11.0
533 # Documentation tools are not always available on all platforms and sometimes
534 # not at the appropriate level. This macro enables a module to test for the
535 # presence of the tool and obtain it's path in separate variables. Coupled with
536 # the --with-xmlto option, it allows maximum flexibilty in making decisions
537 # as whether or not to use the xmlto package. When DEFAULT is not specified,
538 # --with-xmlto assumes 'auto'.
540 # Interface to module:
541 # HAVE_XMLTO: used in makefiles to conditionally generate documentation
542 # XMLTO: returns the path of the xmlto program found
543 # returns the path set by the user in the environment
544 # --with-xmlto: 'yes' user instructs the module to use xmlto
545 # 'no' user instructs the module not to use xmlto
547 # Added in version 1.10.0
548 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
549 # xmlto for text output requires either lynx, links, or w3m browsers
551 # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
553 AC_DEFUN([XORG_WITH_XMLTO],[
554 AC_ARG_VAR([XMLTO], [Path to xmlto command])
555 m4_define([_defopt], m4_default([$2], [auto]))
557 AS_HELP_STRING([--with-xmlto],
558 [Use xmlto to regenerate documentation (default: ]_defopt[)]),
559 [use_xmlto=$withval], [use_xmlto=]_defopt)
560 m4_undefine([_defopt])
562 if test "x$use_xmlto" = x"auto"; then
563 AC_PATH_PROG([XMLTO], [xmlto])
564 if test "x$XMLTO" = "x"; then
565 AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
570 elif test "x$use_xmlto" = x"yes" ; then
571 AC_PATH_PROG([XMLTO], [xmlto])
572 if test "x$XMLTO" = "x"; then
573 AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
576 elif test "x$use_xmlto" = x"no" ; then
577 if test "x$XMLTO" != "x"; then
578 AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
582 AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
585 # Test for a minimum version of xmlto, if provided.
587 [if test "$have_xmlto" = yes; then
588 # scrape the xmlto version
589 AC_MSG_CHECKING([the xmlto version])
590 xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
591 AC_MSG_RESULT([$xmlto_version])
592 AS_VERSION_COMPARE([$xmlto_version], [$1],
593 [if test "x$use_xmlto" = xauto; then
594 AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
597 AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
601 # Test for the ability of xmlto to generate a text target
603 cat > conftest.xml << "EOF"
605 AS_IF([test "$have_xmlto" = yes],
606 [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
607 [have_xmlto_text=yes],
608 [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
610 AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
611 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
614 # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
615 # --------------------------------------------
616 # Minimum version: 1.12.0
617 # Minimum version for optional DEFAULT argument: 1.12.0
619 # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
620 # XML-based language used for the transformation of XML documents.
621 # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
622 # It is used under the cover by xmlto to generate html files from DocBook/XML.
623 # The XSLT processor is often used as a standalone tool for transformations.
624 # It should not be assumed that this tool is used only to work with documnetation.
625 # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
627 # Interface to module:
628 # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
629 # XSLTPROC: returns the path of the xsltproc program found
630 # returns the path set by the user in the environment
631 # --with-xsltproc: 'yes' user instructs the module to use xsltproc
632 # 'no' user instructs the module not to use xsltproc
633 # have_xsltproc: returns yes if xsltproc found in PATH or no
635 # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
637 AC_DEFUN([XORG_WITH_XSLTPROC],[
638 AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
639 m4_define([_defopt], m4_default([$2], [auto]))
640 AC_ARG_WITH(xsltproc,
641 AS_HELP_STRING([--with-xsltproc],
642 [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
643 [use_xsltproc=$withval], [use_xsltproc=]_defopt)
644 m4_undefine([_defopt])
646 if test "x$use_xsltproc" = x"auto"; then
647 AC_PATH_PROG([XSLTPROC], [xsltproc])
648 if test "x$XSLTPROC" = "x"; then
649 AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
654 elif test "x$use_xsltproc" = x"yes" ; then
655 AC_PATH_PROG([XSLTPROC], [xsltproc])
656 if test "x$XSLTPROC" = "x"; then
657 AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
660 elif test "x$use_xsltproc" = x"no" ; then
661 if test "x$XSLTPROC" != "x"; then
662 AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
666 AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
669 # Checking for minimum version is not implemented
670 # but we want to keep the interface consistent with other commands
671 m4_ifval([$1],[AC_MSG_WARN(Checking for MIN-VERSION is not implemented.)])
673 AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
674 ]) # XORG_WITH_XSLTPROC
677 # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
679 # Minimum version: 1.5.0
680 # Minimum version for optional DEFAULT argument: 1.11.0
682 # Documentation tools are not always available on all platforms and sometimes
683 # not at the appropriate level. This macro enables a module to test for the
684 # presence of the tool and obtain it's path in separate variables. Coupled with
685 # the --with-asciidoc option, it allows maximum flexibilty in making decisions
686 # as whether or not to use the asciidoc package. When DEFAULT is not specified,
687 # --with-asciidoc assumes 'auto'.
689 # Interface to module:
690 # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
691 # ASCIIDOC: returns the path of the asciidoc program found
692 # returns the path set by the user in the environment
693 # --with-asciidoc: 'yes' user instructs the module to use asciidoc
694 # 'no' user instructs the module not to use asciidoc
696 # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
698 AC_DEFUN([XORG_WITH_ASCIIDOC],[
699 AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
700 m4_define([_defopt], m4_default([$2], [auto]))
701 AC_ARG_WITH(asciidoc,
702 AS_HELP_STRING([--with-asciidoc],
703 [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
704 [use_asciidoc=$withval], [use_asciidoc=]_defopt)
705 m4_undefine([_defopt])
707 if test "x$use_asciidoc" = x"auto"; then
708 AC_PATH_PROG([ASCIIDOC], [asciidoc])
709 if test "x$ASCIIDOC" = "x"; then
710 AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
715 elif test "x$use_asciidoc" = x"yes" ; then
716 AC_PATH_PROG([ASCIIDOC], [asciidoc])
717 if test "x$ASCIIDOC" = "x"; then
718 AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
721 elif test "x$use_asciidoc" = x"no" ; then
722 if test "x$ASCIIDOC" != "x"; then
723 AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
727 AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
730 [if test "$have_asciidoc" = yes; then
731 # scrape the asciidoc version
732 AC_MSG_CHECKING([the asciidoc version])
733 asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
734 AC_MSG_RESULT([$asciidoc_version])
735 AS_VERSION_COMPARE([$asciidoc_version], [$1],
736 [if test "x$use_asciidoc" = xauto; then
737 AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
740 AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
743 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
744 ]) # XORG_WITH_ASCIIDOC
746 # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
747 # --------------------------------
748 # Minimum version: 1.5.0
749 # Minimum version for optional DEFAULT argument: 1.11.0
751 # Documentation tools are not always available on all platforms and sometimes
752 # not at the appropriate level. This macro enables a module to test for the
753 # presence of the tool and obtain it's path in separate variables. Coupled with
754 # the --with-doxygen option, it allows maximum flexibilty in making decisions
755 # as whether or not to use the doxygen package. When DEFAULT is not specified,
756 # --with-doxygen assumes 'auto'.
758 # Interface to module:
759 # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
760 # DOXYGEN: returns the path of the doxygen program found
761 # returns the path set by the user in the environment
762 # --with-doxygen: 'yes' user instructs the module to use doxygen
763 # 'no' user instructs the module not to use doxygen
765 # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
767 AC_DEFUN([XORG_WITH_DOXYGEN],[
768 AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
769 m4_define([_defopt], m4_default([$2], [auto]))
771 AS_HELP_STRING([--with-doxygen],
772 [Use doxygen to regenerate documentation (default: ]_defopt[)]),
773 [use_doxygen=$withval], [use_doxygen=]_defopt)
774 m4_undefine([_defopt])
776 if test "x$use_doxygen" = x"auto"; then
777 AC_PATH_PROG([DOXYGEN], [doxygen])
778 if test "x$DOXYGEN" = "x"; then
779 AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
784 elif test "x$use_doxygen" = x"yes" ; then
785 AC_PATH_PROG([DOXYGEN], [doxygen])
786 if test "x$DOXYGEN" = "x"; then
787 AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
790 elif test "x$use_doxygen" = x"no" ; then
791 if test "x$DOXYGEN" != "x"; then
792 AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
796 AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
799 [if test "$have_doxygen" = yes; then
800 # scrape the doxygen version
801 AC_MSG_CHECKING([the doxygen version])
802 doxygen_version=`$DOXYGEN --version 2>/dev/null`
803 AC_MSG_RESULT([$doxygen_version])
804 AS_VERSION_COMPARE([$doxygen_version], [$1],
805 [if test "x$use_doxygen" = xauto; then
806 AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
809 AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
812 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
813 ]) # XORG_WITH_DOXYGEN
815 # XORG_WITH_GROFF([DEFAULT])
817 # Minimum version: 1.6.0
818 # Minimum version for optional DEFAULT argument: 1.11.0
820 # Documentation tools are not always available on all platforms and sometimes
821 # not at the appropriate level. This macro enables a module to test for the
822 # presence of the tool and obtain it's path in separate variables. Coupled with
823 # the --with-groff option, it allows maximum flexibilty in making decisions
824 # as whether or not to use the groff package. When DEFAULT is not specified,
825 # --with-groff assumes 'auto'.
827 # Interface to module:
828 # HAVE_GROFF: used in makefiles to conditionally generate documentation
829 # HAVE_GROFF_MM: the memorandum macros (-mm) package
830 # HAVE_GROFF_MS: the -ms macros package
831 # GROFF: returns the path of the groff program found
832 # returns the path set by the user in the environment
833 # --with-groff: 'yes' user instructs the module to use groff
834 # 'no' user instructs the module not to use groff
836 # Added in version 1.9.0:
837 # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
838 # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
839 # psselect from the psutils package.
840 # the ghostcript package. Refer to the grohtml man pages
842 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
844 # OS and distros often splits groff in a basic and full package, the former
845 # having the groff program and the later having devices, fonts and macros
846 # Checking for the groff executable is not enough.
848 # If macros are missing, we cannot assume that groff is useless, so we don't
849 # unset HAVE_GROFF or GROFF env variables.
850 # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
852 AC_DEFUN([XORG_WITH_GROFF],[
853 AC_ARG_VAR([GROFF], [Path to groff command])
854 m4_define([_defopt], m4_default([$1], [auto]))
856 AS_HELP_STRING([--with-groff],
857 [Use groff to regenerate documentation (default: ]_defopt[)]),
858 [use_groff=$withval], [use_groff=]_defopt)
859 m4_undefine([_defopt])
861 if test "x$use_groff" = x"auto"; then
862 AC_PATH_PROG([GROFF], [groff])
863 if test "x$GROFF" = "x"; then
864 AC_MSG_WARN([groff not found - documentation targets will be skipped])
869 elif test "x$use_groff" = x"yes" ; then
870 AC_PATH_PROG([GROFF], [groff])
871 if test "x$GROFF" = "x"; then
872 AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
875 elif test "x$use_groff" = x"no" ; then
876 if test "x$GROFF" != "x"; then
877 AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
881 AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
884 # We have groff, test for the presence of the macro packages
885 if test "x$have_groff" = x"yes"; then
886 AC_MSG_CHECKING([for ${GROFF} -ms macros])
887 if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
892 AC_MSG_RESULT([$groff_ms_works])
893 AC_MSG_CHECKING([for ${GROFF} -mm macros])
894 if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
899 AC_MSG_RESULT([$groff_mm_works])
902 # We have groff, test for HTML dependencies, one command per package
903 if test "x$have_groff" = x"yes"; then
904 AC_PATH_PROGS(GS_PATH, [gs gswin32c])
905 AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
906 AC_PATH_PROG(PSSELECT_PATH, [psselect])
907 if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
911 AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
915 # Set Automake conditionals for Makefiles
916 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
917 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
918 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
919 AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
922 # XORG_WITH_FOP([DEFAULT])
924 # Minimum version: 1.6.0
925 # Minimum version for optional DEFAULT argument: 1.11.0
927 # Documentation tools are not always available on all platforms and sometimes
928 # not at the appropriate level. This macro enables a module to test for the
929 # presence of the tool and obtain it's path in separate variables. Coupled with
930 # the --with-fop option, it allows maximum flexibilty in making decisions
931 # as whether or not to use the fop package. When DEFAULT is not specified,
932 # --with-fop assumes 'auto'.
934 # Interface to module:
935 # HAVE_FOP: used in makefiles to conditionally generate documentation
936 # FOP: returns the path of the fop program found
937 # returns the path set by the user in the environment
938 # --with-fop: 'yes' user instructs the module to use fop
939 # 'no' user instructs the module not to use fop
941 # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
943 AC_DEFUN([XORG_WITH_FOP],[
944 AC_ARG_VAR([FOP], [Path to fop command])
945 m4_define([_defopt], m4_default([$1], [auto]))
947 AS_HELP_STRING([--with-fop],
948 [Use fop to regenerate documentation (default: ]_defopt[)]),
949 [use_fop=$withval], [use_fop=]_defopt)
950 m4_undefine([_defopt])
952 if test "x$use_fop" = x"auto"; then
953 AC_PATH_PROG([FOP], [fop])
954 if test "x$FOP" = "x"; then
955 AC_MSG_WARN([fop not found - documentation targets will be skipped])
960 elif test "x$use_fop" = x"yes" ; then
961 AC_PATH_PROG([FOP], [fop])
962 if test "x$FOP" = "x"; then
963 AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
966 elif test "x$use_fop" = x"no" ; then
967 if test "x$FOP" != "x"; then
968 AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
972 AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
974 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
977 # XORG_WITH_PS2PDF([DEFAULT])
979 # Minimum version: 1.6.0
980 # Minimum version for optional DEFAULT argument: 1.11.0
982 # Documentation tools are not always available on all platforms and sometimes
983 # not at the appropriate level. This macro enables a module to test for the
984 # presence of the tool and obtain it's path in separate variables. Coupled with
985 # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
986 # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
987 # --with-ps2pdf assumes 'auto'.
989 # Interface to module:
990 # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
991 # PS2PDF: returns the path of the ps2pdf program found
992 # returns the path set by the user in the environment
993 # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
994 # 'no' user instructs the module not to use ps2pdf
996 # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
998 AC_DEFUN([XORG_WITH_PS2PDF],[
999 AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1000 m4_define([_defopt], m4_default([$1], [auto]))
1002 AS_HELP_STRING([--with-ps2pdf],
1003 [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1004 [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1005 m4_undefine([_defopt])
1007 if test "x$use_ps2pdf" = x"auto"; then
1008 AC_PATH_PROG([PS2PDF], [ps2pdf])
1009 if test "x$PS2PDF" = "x"; then
1010 AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1015 elif test "x$use_ps2pdf" = x"yes" ; then
1016 AC_PATH_PROG([PS2PDF], [ps2pdf])
1017 if test "x$PS2PDF" = "x"; then
1018 AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1021 elif test "x$use_ps2pdf" = x"no" ; then
1022 if test "x$PS2PDF" != "x"; then
1023 AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1027 AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1029 AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1030 ]) # XORG_WITH_PS2PDF
1032 # XORG_ENABLE_DOCS (enable_docs=yes)
1034 # Minimum version: 1.6.0
1036 # Documentation tools are not always available on all platforms and sometimes
1037 # not at the appropriate level. This macro enables a builder to skip all
1038 # documentation targets except traditional man pages.
1039 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1040 # maximum flexibilty in controlling documentation building.
1042 # XORG_WITH_XMLTO --with-xmlto
1043 # XORG_WITH_ASCIIDOC --with-asciidoc
1044 # XORG_WITH_DOXYGEN --with-doxygen
1045 # XORG_WITH_FOP --with-fop
1046 # XORG_WITH_GROFF --with-groff
1047 # XORG_WITH_PS2PDF --with-ps2pdf
1049 # Interface to module:
1050 # ENABLE_DOCS: used in makefiles to conditionally generate documentation
1051 # --enable-docs: 'yes' user instructs the module to generate docs
1052 # 'no' user instructs the module not to generate docs
1053 # parm1: specify the default value, yes or no.
1055 AC_DEFUN([XORG_ENABLE_DOCS],[
1056 m4_define([docs_default], m4_default([$1], [yes]))
1058 AS_HELP_STRING([--enable-docs],
1059 [Enable building the documentation (default: ]docs_default[)]),
1060 [build_docs=$enableval], [build_docs=]docs_default)
1061 m4_undefine([docs_default])
1062 AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1063 AC_MSG_CHECKING([whether to build documentation])
1064 AC_MSG_RESULT([$build_docs])
1065 ]) # XORG_ENABLE_DOCS
1067 # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1069 # Minimum version: 1.6.0
1071 # This macro enables a builder to skip all developer documentation.
1072 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1073 # maximum flexibilty in controlling documentation building.
1075 # XORG_WITH_XMLTO --with-xmlto
1076 # XORG_WITH_ASCIIDOC --with-asciidoc
1077 # XORG_WITH_DOXYGEN --with-doxygen
1078 # XORG_WITH_FOP --with-fop
1079 # XORG_WITH_GROFF --with-groff
1080 # XORG_WITH_PS2PDF --with-ps2pdf
1082 # Interface to module:
1083 # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
1084 # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
1085 # 'no' user instructs the module not to generate developer docs
1086 # parm1: specify the default value, yes or no.
1088 AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1089 m4_define([devel_default], m4_default([$1], [yes]))
1090 AC_ARG_ENABLE(devel-docs,
1091 AS_HELP_STRING([--enable-devel-docs],
1092 [Enable building the developer documentation (default: ]devel_default[)]),
1093 [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1094 m4_undefine([devel_default])
1095 AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1096 AC_MSG_CHECKING([whether to build developer documentation])
1097 AC_MSG_RESULT([$build_devel_docs])
1098 ]) # XORG_ENABLE_DEVEL_DOCS
1100 # XORG_ENABLE_SPECS (enable_specs=yes)
1102 # Minimum version: 1.6.0
1104 # This macro enables a builder to skip all functional specification targets.
1105 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1106 # maximum flexibilty in controlling documentation building.
1108 # XORG_WITH_XMLTO --with-xmlto
1109 # XORG_WITH_ASCIIDOC --with-asciidoc
1110 # XORG_WITH_DOXYGEN --with-doxygen
1111 # XORG_WITH_FOP --with-fop
1112 # XORG_WITH_GROFF --with-groff
1113 # XORG_WITH_PS2PDF --with-ps2pdf
1115 # Interface to module:
1116 # ENABLE_SPECS: used in makefiles to conditionally generate specs
1117 # --enable-specs: 'yes' user instructs the module to generate specs
1118 # 'no' user instructs the module not to generate specs
1119 # parm1: specify the default value, yes or no.
1121 AC_DEFUN([XORG_ENABLE_SPECS],[
1122 m4_define([spec_default], m4_default([$1], [yes]))
1123 AC_ARG_ENABLE(specs,
1124 AS_HELP_STRING([--enable-specs],
1125 [Enable building the specs (default: ]spec_default[)]),
1126 [build_specs=$enableval], [build_specs=]spec_default)
1127 m4_undefine([spec_default])
1128 AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1129 AC_MSG_CHECKING([whether to build functional specifications])
1130 AC_MSG_RESULT([$build_specs])
1131 ]) # XORG_ENABLE_SPECS
1133 # XORG_CHECK_MALLOC_ZERO
1134 # ----------------------
1135 # Minimum version: 1.0.0
1137 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1138 # malloc(0) returns NULL. Packages should add one of these cflags to
1139 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1140 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1141 AC_ARG_ENABLE(malloc0returnsnull,
1142 AS_HELP_STRING([--enable-malloc0returnsnull],
1143 [malloc(0) returns NULL (default: auto)]),
1144 [MALLOC_ZERO_RETURNS_NULL=$enableval],
1145 [MALLOC_ZERO_RETURNS_NULL=auto])
1147 AC_MSG_CHECKING([whether malloc(0) returns NULL])
1148 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1149 AC_RUN_IFELSE([AC_LANG_PROGRAM([
1152 char *m0, *r0, *c0, *p;
1157 exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1159 [MALLOC_ZERO_RETURNS_NULL=yes],
1160 [MALLOC_ZERO_RETURNS_NULL=no],
1161 [MALLOC_ZERO_RETURNS_NULL=yes])
1163 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1165 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1166 MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1167 XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1168 XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1170 MALLOC_ZERO_CFLAGS=""
1171 XMALLOC_ZERO_CFLAGS=""
1172 XTMALLOC_ZERO_CFLAGS=""
1175 AC_SUBST([MALLOC_ZERO_CFLAGS])
1176 AC_SUBST([XMALLOC_ZERO_CFLAGS])
1177 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1178 ]) # XORG_CHECK_MALLOC_ZERO
1182 # Minimum version: 1.1.0
1184 # This macro enables the use of a tool that flags some suspicious and
1185 # non-portable constructs (likely to be bugs) in C language source code.
1186 # It will attempt to locate the tool and use appropriate options.
1187 # There are various lint type tools on different platforms.
1189 # Interface to module:
1190 # LINT: returns the path to the tool found on the platform
1191 # or the value set to LINT on the configure cmd line
1192 # also an Automake conditional
1193 # LINT_FLAGS: an Automake variable with appropriate flags
1195 # --with-lint: 'yes' user instructs the module to use lint
1196 # 'no' user instructs the module not to use lint (default)
1198 # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1199 # If the user sets the value of LINT_FLAGS, they are used verbatim.
1201 AC_DEFUN([XORG_WITH_LINT],[
1203 AC_ARG_VAR([LINT], [Path to a lint-style command])
1204 AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1205 AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1206 [Use a lint-style source code checker (default: disabled)])],
1207 [use_lint=$withval], [use_lint=no])
1209 # Obtain platform specific info like program name and options
1210 # The lint program on FreeBSD and NetBSD is different from the one on Solaris
1212 *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1214 lint_options="-badflag"
1216 *freebsd* | *netbsd*)
1218 lint_options="-u -b"
1222 lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1226 # Test for the presence of the program (either guessed by the code or spelled out by the user)
1227 if test "x$use_lint" = x"yes" ; then
1228 AC_PATH_PROG([LINT], [$lint_name])
1229 if test "x$LINT" = "x"; then
1230 AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1232 elif test "x$use_lint" = x"no" ; then
1233 if test "x$LINT" != "x"; then
1234 AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1237 AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1240 # User supplied flags override default flags
1241 if test "x$LINT_FLAGS" != "x"; then
1242 lint_options=$LINT_FLAGS
1245 AC_SUBST([LINT_FLAGS],[$lint_options])
1246 AM_CONDITIONAL(LINT, [test "x$LINT" != x])
1250 # XORG_LINT_LIBRARY(LIBNAME)
1251 # --------------------------
1252 # Minimum version: 1.1.0
1254 # Sets up flags for building lint libraries for checking programs that call
1255 # functions in the library.
1257 # Interface to module:
1258 # LINTLIB - Automake variable with the name of lint library file to make
1259 # MAKE_LINT_LIB - Automake conditional
1261 # --enable-lint-library: - 'yes' user instructs the module to created a lint library
1262 # - 'no' user instructs the module not to create a lint library (default)
1264 AC_DEFUN([XORG_LINT_LIBRARY],[
1265 AC_REQUIRE([XORG_WITH_LINT])
1266 AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1267 [Create lint library (default: disabled)])],
1268 [make_lint_lib=$enableval], [make_lint_lib=no])
1270 if test "x$make_lint_lib" = x"yes" ; then
1272 if test "x$LINT" = "x"; then
1273 AC_MSG_ERROR([Cannot make lint library without --with-lint])
1275 elif test "x$make_lint_lib" != x"no" ; then
1276 AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1280 AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1282 ]) # XORG_LINT_LIBRARY
1286 # Minimum version: 1.2.0
1288 # Defines CWARNFLAGS to enable C compiler warnings.
1290 AC_DEFUN([XORG_CWARNFLAGS], [
1291 AC_REQUIRE([AC_PROG_CC_C99])
1292 if test "x$GCC" = xyes ; then
1293 CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1294 -Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1295 -Wbad-function-cast -Wformat=2"
1296 case `$CC -dumpversion` in
1298 CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1302 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1303 if test "x$SUNCC" = "xyes"; then
1307 AC_SUBST(CWARNFLAGS)
1308 ]) # XORG_CWARNFLAGS
1310 # XORG_STRICT_OPTION
1311 # -----------------------
1312 # Minimum version: 1.3.0
1314 # Add configure option to enable strict compilation
1315 AC_DEFUN([XORG_STRICT_OPTION], [
1316 # If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
1317 AC_REQUIRE([AC_PROG_CC_C99])
1318 AC_REQUIRE([XORG_CWARNFLAGS])
1320 AC_ARG_ENABLE(strict-compilation,
1321 AS_HELP_STRING([--enable-strict-compilation],
1322 [Enable all warnings from compiler and make them errors (default: disabled)]),
1323 [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1324 if test "x$STRICT_COMPILE" = "xyes"; then
1325 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1326 AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1327 if test "x$GCC" = xyes ; then
1328 STRICT_CFLAGS="-pedantic -Werror"
1329 elif test "x$SUNCC" = "xyes"; then
1330 STRICT_CFLAGS="-errwarn"
1331 elif test "x$INTELCC" = "xyes"; then
1332 STRICT_CFLAGS="-Werror"
1335 CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1336 AC_SUBST([CWARNFLAGS])
1337 ]) # XORG_STRICT_OPTION
1339 # XORG_DEFAULT_OPTIONS
1340 # --------------------
1341 # Minimum version: 1.3.0
1343 # Defines default options for X.Org modules.
1345 AC_DEFUN([XORG_DEFAULT_OPTIONS], [
1346 AC_REQUIRE([AC_PROG_INSTALL])
1349 XORG_RELEASE_VERSION
1352 XORG_MANPAGE_SECTIONS
1353 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1354 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1355 ]) # XORG_DEFAULT_OPTIONS
1359 # Minimum version: 1.4.0
1361 # Defines the variable INSTALL_CMD as the command to copy
1362 # INSTALL from $prefix/share/util-macros.
1364 AC_DEFUN([XORG_INSTALL], [
1365 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1366 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1367 INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1368 mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1369 || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1370 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1371 AC_SUBST([INSTALL_CMD])
1373 dnl Copyright 2005 Red Hat, Inc
1375 dnl Permission to use, copy, modify, distribute, and sell this software and its
1376 dnl documentation for any purpose is hereby granted without fee, provided that
1377 dnl the above copyright notice appear in all copies and that both that
1378 dnl copyright notice and this permission notice appear in supporting
1381 dnl The above copyright notice and this permission notice shall be included
1382 dnl in all copies or substantial portions of the Software.
1384 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1385 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1386 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1387 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1388 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1389 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1390 dnl OTHER DEALINGS IN THE SOFTWARE.
1392 dnl Except as contained in this notice, the name of the copyright holders shall
1393 dnl not be used in advertising or otherwise to promote the sale, use or
1394 dnl other dealings in this Software without prior written authorization
1395 dnl from the copyright holders.
1398 # XORG_RELEASE_VERSION
1399 # --------------------
1400 # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1402 AC_DEFUN([XORG_RELEASE_VERSION],[
1403 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1404 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
1405 [Major version of this package])
1406 PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1407 if test "x$PVM" = "x"; then
1410 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1412 [Minor version of this package])
1413 PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1414 if test "x$PVP" = "x"; then
1417 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1419 [Patch version of this package])
1424 # Minimum version: 1.2.0
1426 # Defines the variable CHANGELOG_CMD as the command to generate
1427 # ChangeLog from git.
1430 AC_DEFUN([XORG_CHANGELOG], [
1431 CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1432 mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1433 || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1434 echo 'git directory not found: installing possibly empty changelog.' >&2)"
1435 AC_SUBST([CHANGELOG_CMD])
1438 dnl Copyright 2005 Red Hat, Inc
1440 dnl Permission to use, copy, modify, distribute, and sell this software and its
1441 dnl documentation for any purpose is hereby granted without fee, provided that
1442 dnl the above copyright notice appear in all copies and that both that
1443 dnl copyright notice and this permission notice appear in supporting
1446 dnl The above copyright notice and this permission notice shall be included
1447 dnl in all copies or substantial portions of the Software.
1449 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1450 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1451 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1452 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1453 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1454 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1455 dnl OTHER DEALINGS IN THE SOFTWARE.
1457 dnl Except as contained in this notice, the name of the copyright holders shall
1458 dnl not be used in advertising or otherwise to promote the sale, use or
1459 dnl other dealings in this Software without prior written authorization
1460 dnl from the copyright holders.
1463 # XORG_DRIVER_CHECK_EXT()
1464 # --------------------------
1465 # Checks for the $1 define in xorg-server.h (from the sdk). If it
1466 # is defined, then add $1 to $REQUIRED_MODULES.
1468 AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
1469 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1470 SAVE_CFLAGS="$CFLAGS"
1471 CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
1472 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1473 #include "xorg-server.h"
1475 #error $1 not defined
1480 CFLAGS="$SAVE_CFLAGS"
1481 AC_MSG_CHECKING([if $1 is defined])
1482 AC_MSG_RESULT([$_EXT_CHECK])
1483 if test "$_EXT_CHECK" != no; then
1484 REQUIRED_MODULES="$REQUIRED_MODULES $2"
1488 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
1490 # This file is free software; the Free Software Foundation
1491 # gives unlimited permission to copy and/or distribute it,
1492 # with or without modifications, as long as this notice is preserved.
1494 # AM_AUTOMAKE_VERSION(VERSION)
1495 # ----------------------------
1496 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1497 # generated from the m4 files accompanying Automake X.Y.
1498 # (This private macro should not be called outside this file.)
1499 AC_DEFUN([AM_AUTOMAKE_VERSION],
1500 [am__api_version='1.11'
1501 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1502 dnl require some minimum version. Point them to the right macro.
1503 m4_if([$1], [1.11.1], [],
1504 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1507 # _AM_AUTOCONF_VERSION(VERSION)
1508 # -----------------------------
1509 # aclocal traces this macro to find the Autoconf version.
1510 # This is a private macro too. Using m4_define simplifies
1511 # the logic in aclocal, which can simply ignore this definition.
1512 m4_define([_AM_AUTOCONF_VERSION], [])
1514 # AM_SET_CURRENT_AUTOMAKE_VERSION
1515 # -------------------------------
1516 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1517 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1518 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1519 [AM_AUTOMAKE_VERSION([1.11.1])dnl
1520 m4_ifndef([AC_AUTOCONF_VERSION],
1521 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1522 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1524 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
1526 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
1528 # This file is free software; the Free Software Foundation
1529 # gives unlimited permission to copy and/or distribute it,
1530 # with or without modifications, as long as this notice is preserved.
1532 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1533 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
1534 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1536 # Of course, Automake must honor this variable whenever it calls a
1537 # tool from the auxiliary directory. The problem is that $srcdir (and
1538 # therefore $ac_aux_dir as well) can be either absolute or relative,
1539 # depending on how configure is run. This is pretty annoying, since
1540 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
1541 # source directory, any form will work fine, but in subdirectories a
1542 # relative path needs to be adjusted first.
1544 # $ac_aux_dir/missing
1545 # fails when called from a subdirectory if $ac_aux_dir is relative
1546 # $top_srcdir/$ac_aux_dir/missing
1547 # fails if $ac_aux_dir is absolute,
1548 # fails when called from a subdirectory in a VPATH build with
1549 # a relative $ac_aux_dir
1551 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1552 # are both prefixed by $srcdir. In an in-source build this is usually
1553 # harmless because $srcdir is `.', but things will broke when you
1554 # start a VPATH build or use an absolute $srcdir.
1556 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1557 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
1558 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1559 # and then we would define $MISSING as
1560 # MISSING="\${SHELL} $am_aux_dir/missing"
1561 # This will work as long as MISSING is not called from configure, because
1562 # unfortunately $(top_srcdir) has no meaning in configure.
1563 # However there are other variables, like CC, which are often used in
1564 # configure, and could therefore not use this "fixed" $ac_aux_dir.
1566 # Another solution, used here, is to always expand $ac_aux_dir to an
1567 # absolute PATH. The drawback is that using absolute paths prevent a
1568 # configured tree to be moved without reconfiguration.
1570 AC_DEFUN([AM_AUX_DIR_EXPAND],
1571 [dnl Rely on autoconf to set up CDPATH properly.
1572 AC_PREREQ([2.50])dnl
1573 # expand $ac_aux_dir to an absolute path
1574 am_aux_dir=`cd $ac_aux_dir && pwd`
1577 # AM_CONDITIONAL -*- Autoconf -*-
1579 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1580 # Free Software Foundation, Inc.
1582 # This file is free software; the Free Software Foundation
1583 # gives unlimited permission to copy and/or distribute it,
1584 # with or without modifications, as long as this notice is preserved.
1588 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1589 # -------------------------------------
1590 # Define a conditional.
1591 AC_DEFUN([AM_CONDITIONAL],
1593 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
1594 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1595 AC_SUBST([$1_TRUE])dnl
1596 AC_SUBST([$1_FALSE])dnl
1597 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
1598 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
1599 m4_define([_AM_COND_VALUE_$1], [$2])dnl
1607 AC_CONFIG_COMMANDS_PRE(
1608 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1609 AC_MSG_ERROR([[conditional "$1" was never defined.
1610 Usually this means the macro was only invoked conditionally.]])
1613 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1614 # Free Software Foundation, Inc.
1616 # This file is free software; the Free Software Foundation
1617 # gives unlimited permission to copy and/or distribute it,
1618 # with or without modifications, as long as this notice is preserved.
1622 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1623 # written in clear, in which case automake, when reading aclocal.m4,
1624 # will think it sees a *use*, and therefore will trigger all it's
1625 # C support machinery. Also note that it means that autoscan, seeing
1626 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1629 # _AM_DEPENDENCIES(NAME)
1630 # ----------------------
1631 # See how the compiler implements dependency checking.
1632 # NAME is "CC", "CXX", "GCJ", or "OBJC".
1633 # We try a few techniques and use that to set a single cache variable.
1635 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1636 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1637 # dependency, and given that the user is not expected to run this macro,
1638 # just rely on AC_PROG_CC.
1639 AC_DEFUN([_AM_DEPENDENCIES],
1640 [AC_REQUIRE([AM_SET_DEPDIR])dnl
1641 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1642 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1643 AC_REQUIRE([AM_DEP_TRACK])dnl
1645 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
1646 [$1], CXX, [depcc="$CXX" am_compiler_list=],
1647 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1648 [$1], UPC, [depcc="$UPC" am_compiler_list=],
1649 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
1650 [depcc="$$1" am_compiler_list=])
1652 AC_CACHE_CHECK([dependency style of $depcc],
1653 [am_cv_$1_dependencies_compiler_type],
1654 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1655 # We make a subdir and do the tests there. Otherwise we can end up
1656 # making bogus files that we don't know about and never remove. For
1657 # instance it was reported that on HP-UX the gcc test will end up
1658 # making a dummy file named `D' -- because `-MD' means `put the output
1661 # Copy depcomp to subdir because otherwise we won't find it if we're
1662 # using a relative directory.
1663 cp "$am_depcomp" conftest.dir
1665 # We will build objects and dependencies in a subdirectory because
1666 # it helps to detect inapplicable dependency modes. For instance
1667 # both Tru64's cc and ICC support -MD to output dependencies as a
1668 # side effect of compilation, but ICC will put the dependencies in
1669 # the current directory while Tru64 will put them in the object
1673 am_cv_$1_dependencies_compiler_type=none
1674 if test "$am_compiler_list" = ""; then
1675 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1679 [case " $depcc " in #(
1680 *\ -arch\ *\ -arch\ *) am__universal=true ;;
1683 [case " $depcc " in #(
1684 *\ -arch\ *\ -arch\ *) am__universal=true ;;
1687 for depmode in $am_compiler_list; do
1688 # Setup a source with many dependencies, because some compilers
1689 # like to wrap large dependency lists on column 80 (with \), and
1690 # we should not choose a depcomp mode which is confused by this.
1692 # We need to recreate these files for each test, as the compiler may
1693 # overwrite some of them when testing with obscure command lines.
1694 # This happens at least with the AIX C compiler.
1696 for i in 1 2 3 4 5 6; do
1697 echo '#include "conftst'$i'.h"' >> sub/conftest.c
1698 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1699 # Solaris 8's {/usr,}/bin/sh.
1700 touch sub/conftst$i.h
1702 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1704 # We check with `-c' and `-o' for the sake of the "dashmstdout"
1705 # mode. It turns out that the SunPro C++ compiler does not properly
1706 # handle `-M -o', and we need to detect this. Also, some Intel
1707 # versions had trouble with output in subdirs
1708 am__obj=sub/conftest.${OBJEXT-o}
1709 am__minus_obj="-o $am__obj"
1712 # This depmode causes a compiler race in universal mode.
1713 test "$am__universal" = false || continue
1716 # after this tag, mechanisms are not by side-effect, so they'll
1717 # only be used when explicitly requested
1718 if test "x$enable_dependency_tracking" = xyes; then
1724 msvisualcpp | msvcmsys)
1725 # This compiler won't grok `-c -o', but also, the minuso test has
1726 # not run yet. These depmodes are late enough in the game, and
1727 # so weak that their functioning should not be impacted.
1728 am__obj=conftest.${OBJEXT-o}
1733 if depmode=$depmode \
1734 source=sub/conftest.c object=$am__obj \
1735 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1736 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1737 >/dev/null 2>conftest.err &&
1738 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1739 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1740 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1741 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1742 # icc doesn't choke on unknown options, it will just issue warnings
1743 # or remarks (even with -Werror). So we grep stderr for any message
1744 # that says an option was ignored or not supported.
1745 # When given -MP, icc 7.0 and 7.1 complain thusly:
1746 # icc: Command line warning: ignoring option '-M'; no argument required
1747 # The diagnosis changed in icc 8.0:
1748 # icc: Command line remark: option '-MP' not supported
1749 if (grep 'ignoring option' conftest.err ||
1750 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1751 am_cv_$1_dependencies_compiler_type=$depmode
1760 am_cv_$1_dependencies_compiler_type=none
1763 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1764 AM_CONDITIONAL([am__fastdep$1], [
1765 test "x$enable_dependency_tracking" != xno \
1766 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1772 # Choose a directory name for dependency files.
1773 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1774 AC_DEFUN([AM_SET_DEPDIR],
1775 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1776 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1782 AC_DEFUN([AM_DEP_TRACK],
1783 [AC_ARG_ENABLE(dependency-tracking,
1784 [ --disable-dependency-tracking speeds up one-time build
1785 --enable-dependency-tracking do not reject slow dependency extractors])
1786 if test "x$enable_dependency_tracking" != xno; then
1787 am_depcomp="$ac_aux_dir/depcomp"
1790 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1791 AC_SUBST([AMDEPBACKSLASH])dnl
1792 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1795 # Generate code to set up dependency tracking. -*- Autoconf -*-
1797 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1798 # Free Software Foundation, Inc.
1800 # This file is free software; the Free Software Foundation
1801 # gives unlimited permission to copy and/or distribute it,
1802 # with or without modifications, as long as this notice is preserved.
1806 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1807 # ------------------------------
1808 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1810 # Autoconf 2.62 quotes --file arguments for eval, but not when files
1811 # are listed without --file. Let's play safe and only enable the eval
1812 # if we detect the quoting.
1813 case $CONFIG_FILES in
1814 *\'*) eval set x "$CONFIG_FILES" ;;
1815 *) set x $CONFIG_FILES ;;
1820 # Strip MF so we end up with the name of the file.
1821 mf=`echo "$mf" | sed -e 's/:.*$//'`
1822 # Check whether this is an Automake generated Makefile or not.
1823 # We used to match only the files named `Makefile.in', but
1824 # some people rename them; so instead we look at the file content.
1825 # Grep'ing the first line is not enough: some people post-process
1826 # each Makefile.in and add a new line on top of each file to say so.
1827 # Grep'ing the whole file is not good either: AIX grep has a line
1828 # limit of 2048, but all sed's we know have understand at least 4000.
1829 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1830 dirpart=`AS_DIRNAME("$mf")`
1834 # Extract the definition of DEPDIR, am__include, and am__quote
1835 # from the Makefile without running `make'.
1836 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1837 test -z "$DEPDIR" && continue
1838 am__include=`sed -n 's/^am__include = //p' < "$mf"`
1839 test -z "am__include" && continue
1840 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1841 # When using ansi2knr, U may be empty or an underscore; expand it
1842 U=`sed -n 's/^U = //p' < "$mf"`
1843 # Find all dependency output files, they are included files with
1844 # $(DEPDIR) in their names. We invoke sed twice because it is the
1845 # simplest approach to changing $(DEPDIR) to its actual value in the
1847 for file in `sed -n "
1848 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1849 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1850 # Make sure the directory exists.
1851 test -f "$dirpart/$file" && continue
1852 fdir=`AS_DIRNAME(["$file"])`
1853 AS_MKDIR_P([$dirpart/$fdir])
1854 # echo "creating $dirpart/$file"
1855 echo '# dummy' > "$dirpart/$file"
1859 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1862 # AM_OUTPUT_DEPENDENCY_COMMANDS
1863 # -----------------------------
1864 # This macro should only be invoked once -- use via AC_REQUIRE.
1866 # This code is only required when automatic dependency tracking
1867 # is enabled. FIXME. This creates each `.P' file that we will
1868 # need in order to bootstrap the dependency handling code.
1869 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1870 [AC_CONFIG_COMMANDS([depfiles],
1871 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1872 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1875 # Do all the work for Automake. -*- Autoconf -*-
1877 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1878 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1880 # This file is free software; the Free Software Foundation
1881 # gives unlimited permission to copy and/or distribute it,
1882 # with or without modifications, as long as this notice is preserved.
1886 # This macro actually does too much. Some checks are only needed if
1887 # your package does certain things. But this isn't really a big deal.
1889 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1890 # AM_INIT_AUTOMAKE([OPTIONS])
1891 # -----------------------------------------------
1892 # The call with PACKAGE and VERSION arguments is the old style
1893 # call (pre autoconf-2.50), which is being phased out. PACKAGE
1894 # and VERSION should now be passed to AC_INIT and removed from
1895 # the call to AM_INIT_AUTOMAKE.
1896 # We support both call styles for the transition. After
1897 # the next Automake release, Autoconf can make the AC_INIT
1898 # arguments mandatory, and then we can depend on a new Autoconf
1899 # release and drop the old call support.
1900 AC_DEFUN([AM_INIT_AUTOMAKE],
1901 [AC_PREREQ([2.62])dnl
1902 dnl Autoconf wants to disallow AM_ names. We explicitly allow
1903 dnl the ones we care about.
1904 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1905 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1906 AC_REQUIRE([AC_PROG_INSTALL])dnl
1907 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1908 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1909 # is not polluted with repeated "-I."
1910 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1911 # test to see if srcdir already configured
1912 if test -f $srcdir/config.status; then
1913 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1917 # test whether we have cygpath
1918 if test -z "$CYGPATH_W"; then
1919 if (cygpath --version) >/dev/null 2>/dev/null; then
1920 CYGPATH_W='cygpath -w'
1925 AC_SUBST([CYGPATH_W])
1927 # Define the identity of the package.
1928 dnl Distinguish between old-style and new-style calls.
1930 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1931 AC_SUBST([PACKAGE], [$1])dnl
1932 AC_SUBST([VERSION], [$2])],
1933 [_AM_SET_OPTIONS([$1])dnl
1934 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1935 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1936 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1937 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1938 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1940 _AM_IF_OPTION([no-define],,
1941 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1942 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1944 # Some tools Automake needs.
1945 AC_REQUIRE([AM_SANITY_CHECK])dnl
1946 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1947 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1948 AM_MISSING_PROG(AUTOCONF, autoconf)
1949 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1950 AM_MISSING_PROG(AUTOHEADER, autoheader)
1951 AM_MISSING_PROG(MAKEINFO, makeinfo)
1952 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1953 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1954 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1955 # We need awk for the "check" target. The system "awk" is bad on
1957 AC_REQUIRE([AC_PROG_AWK])dnl
1958 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1959 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1960 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1961 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1962 [_AM_PROG_TAR([v7])])])
1963 _AM_IF_OPTION([no-dependencies],,
1964 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1965 [_AM_DEPENDENCIES(CC)],
1966 [define([AC_PROG_CC],
1967 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1968 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1969 [_AM_DEPENDENCIES(CXX)],
1970 [define([AC_PROG_CXX],
1971 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1972 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1973 [_AM_DEPENDENCIES(OBJC)],
1974 [define([AC_PROG_OBJC],
1975 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1977 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1978 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
1979 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
1980 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
1981 AC_CONFIG_COMMANDS_PRE(dnl
1982 [m4_provide_if([_AM_COMPILER_EXEEXT],
1983 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1986 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
1987 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1988 dnl mangled by Autoconf and run in a shell conditional statement.
1989 m4_define([_AC_COMPILER_EXEEXT],
1990 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1993 # When config.status generates a header, we must update the stamp-h file.
1994 # This file resides in the same directory as the config header
1995 # that is generated. The stamp files are numbered to have different names.
1997 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1998 # loop where config.status creates the headers, so we can generate
1999 # our stamp files there.
2000 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
2001 [# Compute $1's index in $config_headers.
2004 for _am_header in $config_headers :; do
2006 $_am_arg | $_am_arg:* )
2009 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2012 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
2014 # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
2016 # This file is free software; the Free Software Foundation
2017 # gives unlimited permission to copy and/or distribute it,
2018 # with or without modifications, as long as this notice is preserved.
2020 # AM_PROG_INSTALL_SH
2021 # ------------------
2022 # Define $install_sh.
2023 AC_DEFUN([AM_PROG_INSTALL_SH],
2024 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2025 if test x"${install_sh}" != xset; then
2028 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2030 install_sh="\${SHELL} $am_aux_dir/install-sh"
2033 AC_SUBST(install_sh)])
2035 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
2037 # This file is free software; the Free Software Foundation
2038 # gives unlimited permission to copy and/or distribute it,
2039 # with or without modifications, as long as this notice is preserved.
2043 # Check whether the underlying file-system supports filenames
2044 # with a leading dot. For instance MS-DOS doesn't.
2045 AC_DEFUN([AM_SET_LEADING_DOT],
2046 [rm -rf .tst 2>/dev/null
2047 mkdir .tst 2>/dev/null
2048 if test -d .tst; then
2053 rmdir .tst 2>/dev/null
2054 AC_SUBST([am__leading_dot])])
2056 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
2059 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
2060 # Free Software Foundation, Inc.
2062 # This file is free software; the Free Software Foundation
2063 # gives unlimited permission to copy and/or distribute it,
2064 # with or without modifications, as long as this notice is preserved.
2068 # AM_MAINTAINER_MODE([DEFAULT-MODE])
2069 # ----------------------------------
2070 # Control maintainer-specific portions of Makefiles.
2071 # Default is to disable them, unless `enable' is passed literally.
2072 # For symmetry, `disable' may be passed as well. Anyway, the user
2073 # can override the default with the --enable/--disable switch.
2074 AC_DEFUN([AM_MAINTAINER_MODE],
2075 [m4_case(m4_default([$1], [disable]),
2076 [enable], [m4_define([am_maintainer_other], [disable])],
2077 [disable], [m4_define([am_maintainer_other], [enable])],
2078 [m4_define([am_maintainer_other], [enable])
2079 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
2080 AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
2081 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
2082 AC_ARG_ENABLE([maintainer-mode],
2083 [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
2084 (and sometimes confusing) to the casual installer],
2085 [USE_MAINTAINER_MODE=$enableval],
2086 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
2087 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
2088 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
2089 MAINT=$MAINTAINER_MODE_TRUE
2090 AC_SUBST([MAINT])dnl
2094 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
2096 # Check to see how 'make' treats includes. -*- Autoconf -*-
2098 # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
2100 # This file is free software; the Free Software Foundation
2101 # gives unlimited permission to copy and/or distribute it,
2102 # with or without modifications, as long as this notice is preserved.
2108 # Check to see how make treats includes.
2109 AC_DEFUN([AM_MAKE_INCLUDE],
2110 [am_make=${MAKE-make}
2111 cat > confinc << 'END'
2113 @echo this is the am__doit target
2116 # If we don't find an include directive, just comment out the code.
2117 AC_MSG_CHECKING([for style of include used by $am_make])
2121 # First try GNU make style include.
2122 echo "include confinc" > confmf
2123 # Ignore all kinds of additional output from `make'.
2124 case `$am_make -s -f confmf 2> /dev/null` in #(
2125 *the\ am__doit\ target*)
2131 # Now try BSD make style include.
2132 if test "$am__include" = "#"; then
2133 echo '.include "confinc"' > confmf
2134 case `$am_make -s -f confmf 2> /dev/null` in #(
2135 *the\ am__doit\ target*)
2136 am__include=.include
2142 AC_SUBST([am__include])
2143 AC_SUBST([am__quote])
2144 AC_MSG_RESULT([$_am_result])
2145 rm -f confinc confmf
2148 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
2150 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
2151 # Free Software Foundation, Inc.
2153 # This file is free software; the Free Software Foundation
2154 # gives unlimited permission to copy and/or distribute it,
2155 # with or without modifications, as long as this notice is preserved.
2159 # AM_MISSING_PROG(NAME, PROGRAM)
2160 # ------------------------------
2161 AC_DEFUN([AM_MISSING_PROG],
2162 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2163 $1=${$1-"${am_missing_run}$2"}
2167 # AM_MISSING_HAS_RUN
2168 # ------------------
2169 # Define MISSING if not defined so far and test if it supports --run.
2170 # If it does, set am_missing_run to use it, otherwise, to nothing.
2171 AC_DEFUN([AM_MISSING_HAS_RUN],
2172 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2173 AC_REQUIRE_AUX_FILE([missing])dnl
2174 if test x"${MISSING+set}" != xset; then
2177 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2179 MISSING="\${SHELL} $am_aux_dir/missing" ;;
2182 # Use eval to expand $SHELL
2183 if eval "$MISSING --run true"; then
2184 am_missing_run="$MISSING --run "
2187 AC_MSG_WARN([`missing' script is too old or missing])
2191 # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
2193 # This file is free software; the Free Software Foundation
2194 # gives unlimited permission to copy and/or distribute it,
2195 # with or without modifications, as long as this notice is preserved.
2199 # Check for `mkdir -p'.
2200 AC_DEFUN([AM_PROG_MKDIR_P],
2201 [AC_PREREQ([2.60])dnl
2202 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
2203 dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
2204 dnl while keeping a definition of mkdir_p for backward compatibility.
2205 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
2206 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
2207 dnl Makefile.ins that do not define MKDIR_P, so we do our own
2208 dnl adjustment using top_builddir (which is defined more often than
2210 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
2212 [[\\/$]]* | ?:[[\\/]]*) ;;
2213 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2217 # Helper functions for option handling. -*- Autoconf -*-
2219 # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
2221 # This file is free software; the Free Software Foundation
2222 # gives unlimited permission to copy and/or distribute it,
2223 # with or without modifications, as long as this notice is preserved.
2227 # _AM_MANGLE_OPTION(NAME)
2228 # -----------------------
2229 AC_DEFUN([_AM_MANGLE_OPTION],
2230 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2232 # _AM_SET_OPTION(NAME)
2233 # ------------------------------
2234 # Set option NAME. Presently that only means defining a flag for this option.
2235 AC_DEFUN([_AM_SET_OPTION],
2236 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2238 # _AM_SET_OPTIONS(OPTIONS)
2239 # ----------------------------------
2240 # OPTIONS is a space-separated list of Automake options.
2241 AC_DEFUN([_AM_SET_OPTIONS],
2242 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2244 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2245 # -------------------------------------------
2246 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2247 AC_DEFUN([_AM_IF_OPTION],
2248 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2250 # Check to make sure that the build environment is sane. -*- Autoconf -*-
2252 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
2253 # Free Software Foundation, Inc.
2255 # This file is free software; the Free Software Foundation
2256 # gives unlimited permission to copy and/or distribute it,
2257 # with or without modifications, as long as this notice is preserved.
2263 AC_DEFUN([AM_SANITY_CHECK],
2264 [AC_MSG_CHECKING([whether build environment is sane])
2267 echo timestamp > conftest.file
2268 # Reject unsafe characters in $srcdir or the absolute working directory
2269 # name. Accept space and tab only in the latter.
2273 *[[\\\"\#\$\&\'\`$am_lf]]*)
2274 AC_MSG_ERROR([unsafe absolute working directory name]);;
2277 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
2278 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
2281 # Do `set' in a subshell so we don't clobber the current shell's
2282 # arguments. Must try -L first in case configure is actually a
2283 # symlink; some systems play weird games with the mod time of symlinks
2284 # (eg FreeBSD returns the mod time of the symlink's containing
2287 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2288 if test "$[*]" = "X"; then
2290 set X `ls -t "$srcdir/configure" conftest.file`
2293 if test "$[*]" != "X $srcdir/configure conftest.file" \
2294 && test "$[*]" != "X conftest.file $srcdir/configure"; then
2296 # If neither matched, then we have a broken ls. This can happen
2297 # if, for instance, CONFIG_SHELL is bash and it inherits a
2298 # broken ls alias from the environment. This has actually
2299 # happened. Such a system could not be considered "sane".
2300 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2301 alias in your environment])
2304 test "$[2]" = conftest.file
2310 AC_MSG_ERROR([newly created file is older than distributed files!
2311 Check your system clock])
2313 AC_MSG_RESULT(yes)])
2315 # Copyright (C) 2009 Free Software Foundation, Inc.
2317 # This file is free software; the Free Software Foundation
2318 # gives unlimited permission to copy and/or distribute it,
2319 # with or without modifications, as long as this notice is preserved.
2323 # AM_SILENT_RULES([DEFAULT])
2324 # --------------------------
2325 # Enable less verbose build rules; with the default set to DEFAULT
2326 # (`yes' being less verbose, `no' or empty being verbose).
2327 AC_DEFUN([AM_SILENT_RULES],
2328 [AC_ARG_ENABLE([silent-rules],
2329 [ --enable-silent-rules less verbose build output (undo: `make V=1')
2330 --disable-silent-rules verbose build output (undo: `make V=0')])
2331 case $enable_silent_rules in
2332 yes) AM_DEFAULT_VERBOSITY=0;;
2333 no) AM_DEFAULT_VERBOSITY=1;;
2334 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
2336 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
2338 AC_SUBST([AM_BACKSLASH])dnl
2339 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
2342 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
2344 # This file is free software; the Free Software Foundation
2345 # gives unlimited permission to copy and/or distribute it,
2346 # with or without modifications, as long as this notice is preserved.
2348 # AM_PROG_INSTALL_STRIP
2349 # ---------------------
2350 # One issue with vendor `install' (even GNU) is that you can't
2351 # specify the program used to strip binaries. This is especially
2352 # annoying in cross-compiling environments, where the build's strip
2353 # is unlikely to handle the host's binaries.
2354 # Fortunately install-sh will honor a STRIPPROG variable, so we
2355 # always use install-sh in `make install-strip', and initialize
2356 # STRIPPROG with the value of the STRIP variable (set by the user).
2357 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2358 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2359 # Installed binaries are usually stripped using `strip' when the user
2360 # run `make install-strip'. However `strip' might not be the right
2361 # tool to use in cross-compilation environments, therefore Automake
2362 # will honor the `STRIP' environment variable to overrule this program.
2363 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2364 if test "$cross_compiling" != no; then
2365 AC_CHECK_TOOL([STRIP], [strip], :)
2367 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2368 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2370 # Copyright (C) 2006, 2008 Free Software Foundation, Inc.
2372 # This file is free software; the Free Software Foundation
2373 # gives unlimited permission to copy and/or distribute it,
2374 # with or without modifications, as long as this notice is preserved.
2378 # _AM_SUBST_NOTMAKE(VARIABLE)
2379 # ---------------------------
2380 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2381 # This macro is traced by Automake.
2382 AC_DEFUN([_AM_SUBST_NOTMAKE])
2384 # AM_SUBST_NOTMAKE(VARIABLE)
2385 # ---------------------------
2386 # Public sister of _AM_SUBST_NOTMAKE.
2387 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2389 # Check how to create a tarball. -*- Autoconf -*-
2391 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
2393 # This file is free software; the Free Software Foundation
2394 # gives unlimited permission to copy and/or distribute it,
2395 # with or without modifications, as long as this notice is preserved.
2399 # _AM_PROG_TAR(FORMAT)
2400 # --------------------
2401 # Check how to create a tarball in format FORMAT.
2402 # FORMAT should be one of `v7', `ustar', or `pax'.
2404 # Substitute a variable $(am__tar) that is a command
2405 # writing to stdout a FORMAT-tarball containing the directory
2407 # tardir=directory && $(am__tar) > result.tar
2409 # Substitute a variable $(am__untar) that extract such
2410 # a tarball read from stdin.
2411 # $(am__untar) < result.tar
2412 AC_DEFUN([_AM_PROG_TAR],
2413 [# Always define AMTAR for backward compatibility.
2414 AM_MISSING_PROG([AMTAR], [tar])
2416 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
2417 [m4_case([$1], [ustar],, [pax],,
2418 [m4_fatal([Unknown tar format])])
2419 AC_MSG_CHECKING([how to create a $1 tar archive])
2420 # Loop over all known methods to create a tar archive until one works.
2421 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2422 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2423 # Do not fold the above two line into one, because Tru64 sh and
2424 # Solaris sh will not grok spaces in the rhs of `-'.
2425 for _am_tool in $_am_tools
2429 for _am_tar in tar gnutar gtar;
2431 AM_RUN_LOG([$_am_tar --version]) && break
2433 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2434 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2435 am__untar="$_am_tar -xf -"
2438 # Must skip GNU tar: if it does not support --format= it doesn't create
2439 # ustar tarball either.
2440 (tar --version) >/dev/null 2>&1 && continue
2441 am__tar='tar chf - "$$tardir"'
2442 am__tar_='tar chf - "$tardir"'
2443 am__untar='tar xf -'
2446 am__tar='pax -L -x $1 -w "$$tardir"'
2447 am__tar_='pax -L -x $1 -w "$tardir"'
2451 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2452 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2453 am__untar='cpio -i -H $1 -d'
2462 # If the value was cached, stop now. We just wanted to have am__tar
2463 # and am__untar set.
2464 test -n "${am_cv_prog_tar_$1}" && break
2466 # tar/untar a dummy directory, and stop if the command works
2469 echo GrepMe > conftest.dir/file
2470 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2472 if test -s conftest.tar; then
2473 AM_RUN_LOG([$am__untar <conftest.tar])
2474 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2479 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2480 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2482 AC_SUBST([am__untar])
2485 m4_include([m4/libtool.m4])
2486 m4_include([m4/ltoptions.m4])
2487 m4_include([m4/ltsugar.m4])
2488 m4_include([m4/ltversion.m4])
2489 m4_include([m4/lt~obsolete.m4])