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.66],,
17 [m4_warning([this file was generated for autoconf 2.66.
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/>.])
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 2005-2006 Sun Microsystems, Inc. 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.10.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|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
371 -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
372 -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
373 -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
374 -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
375 -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
376 AC_SUBST([MAN_SUBSTS])
378 ]) # XORG_MANPAGE_SECTIONS
380 # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
381 # ------------------------
382 # Minimum version: 1.7.0
384 # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
385 # provided by xorg-sgml-doctools, if installed.
386 AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
387 AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
389 PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
390 [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
392 [if test x"$cross_compiling" != x"yes" ; then
393 AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
394 [XORG_SGML_PATH=$prefix/share/sgml])
398 # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
399 # the path and the name of the doc stylesheet
400 if test "x$XORG_SGML_PATH" != "x" ; then
401 AC_MSG_RESULT([$XORG_SGML_PATH])
402 STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
403 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
408 AC_SUBST(XORG_SGML_PATH)
409 AC_SUBST(STYLESHEET_SRCDIR)
410 AC_SUBST(XSL_STYLESHEET)
411 AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
412 ]) # XORG_CHECK_SGML_DOCTOOLS
414 # XORG_CHECK_LINUXDOC
415 # -------------------
416 # Minimum version: 1.0.0
418 # Defines the variable MAKE_TEXT if the necessary tools and
419 # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
420 # Whether or not the necessary tools and files are found can be checked
421 # with the AM_CONDITIONAL "BUILD_LINUXDOC"
422 AC_DEFUN([XORG_CHECK_LINUXDOC],[
423 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
424 AC_REQUIRE([XORG_WITH_PS2PDF])
426 AC_PATH_PROG(LINUXDOC, linuxdoc)
428 AC_MSG_CHECKING([whether to build documentation])
430 if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
436 AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
438 AC_MSG_RESULT([$BUILDDOC])
440 AC_MSG_CHECKING([whether to build pdf documentation])
442 if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
448 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
450 AC_MSG_RESULT([$BUILDPDFDOC])
452 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
453 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
455 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
461 ]) # XORG_CHECK_LINUXDOC
464 # -------------------
465 # Minimum version: 1.0.0
467 # Checks for the ability to build output formats from SGML DocBook source.
468 # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
469 # indicates whether the necessary tools and files are found and, if set,
470 # $(MAKE_XXX) blah.sgml will produce blah.xxx.
471 AC_DEFUN([XORG_CHECK_DOCBOOK],[
472 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
479 AC_PATH_PROG(DOCBOOKPS, docbook2ps)
480 AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
481 AC_PATH_PROG(DOCBOOKHTML, docbook2html)
482 AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
484 AC_MSG_CHECKING([whether to build text documentation])
485 if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
486 test x$BUILD_TXTDOC != xno; then
489 AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
490 AC_MSG_RESULT([$BUILDTXTDOC])
492 AC_MSG_CHECKING([whether to build PDF documentation])
493 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
494 test x$BUILD_PDFDOC != xno; then
497 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
498 AC_MSG_RESULT([$BUILDPDFDOC])
500 AC_MSG_CHECKING([whether to build PostScript documentation])
501 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
502 test x$BUILD_PSDOC != xno; then
505 AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
506 AC_MSG_RESULT([$BUILDPSDOC])
508 AC_MSG_CHECKING([whether to build HTML documentation])
509 if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
510 test x$BUILD_HTMLDOC != xno; then
513 AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
514 AC_MSG_RESULT([$BUILDHTMLDOC])
516 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
517 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
518 MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
519 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
525 ]) # XORG_CHECK_DOCBOOK
527 # XORG_WITH_XMLTO([MIN-VERSION])
529 # Minimum version: 1.5.0
531 # Documentation tools are not always available on all platforms and sometimes
532 # not at the appropriate level. This macro enables a module to test for the
533 # presence of the tool and obtain it's path in separate variables. Coupled with
534 # the --with-xmlto option, it allows maximum flexibilty in making decisions
535 # as whether or not to use the xmlto package.
537 # Interface to module:
538 # HAVE_XMLTO: used in makefiles to conditionally generate documentation
539 # XMLTO: returns the path of the xmlto program found
540 # returns the path set by the user in the environment
541 # --with-xmlto: 'yes' user instructs the module to use xmlto
542 # 'no' user instructs the module not to use xmlto
544 # Added in version 1.10.0
545 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
546 # xmlto for text output requires either lynx, links, or w3m browsers
548 # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
550 AC_DEFUN([XORG_WITH_XMLTO],[
551 AC_ARG_VAR([XMLTO], [Path to xmlto command])
553 AS_HELP_STRING([--with-xmlto],
554 [Use xmlto to regenerate documentation (default: yes, if installed)]),
555 [use_xmlto=$withval], [use_xmlto=auto])
557 if test "x$use_xmlto" = x"auto"; then
558 AC_PATH_PROG([XMLTO], [xmlto])
559 if test "x$XMLTO" = "x"; then
560 AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
565 elif test "x$use_xmlto" = x"yes" ; then
566 AC_PATH_PROG([XMLTO], [xmlto])
567 if test "x$XMLTO" = "x"; then
568 AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
571 elif test "x$use_xmlto" = x"no" ; then
572 if test "x$XMLTO" != "x"; then
573 AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
577 AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
580 # Test for a minimum version of xmlto, if provided.
582 [if test "$have_xmlto" = yes; then
583 # scrape the xmlto version
584 AC_MSG_CHECKING([the xmlto version])
585 xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
586 AC_MSG_RESULT([$xmlto_version])
587 AS_VERSION_COMPARE([$xmlto_version], [$1],
588 [if test "x$use_xmlto" = xauto; then
589 AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
592 AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
596 # Test for the ability of xmlto to generate a text target
598 cat > conftest.xml << "EOF"
600 AS_IF([test "$have_xmlto" = yes],
601 [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
602 [have_xmlto_text=yes],
603 [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
605 AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
606 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
609 # XORG_WITH_ASCIIDOC([MIN-VERSION])
611 # Minimum version: 1.5.0
613 # Documentation tools are not always available on all platforms and sometimes
614 # not at the appropriate level. This macro enables a module to test for the
615 # presence of the tool and obtain it's path in separate variables. Coupled with
616 # the --with-asciidoc option, it allows maximum flexibilty in making decisions
617 # as whether or not to use the asciidoc package.
619 # Interface to module:
620 # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
621 # ASCIIDOC: returns the path of the asciidoc program found
622 # returns the path set by the user in the environment
623 # --with-asciidoc: 'yes' user instructs the module to use asciidoc
624 # 'no' user instructs the module not to use asciidoc
626 # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
628 AC_DEFUN([XORG_WITH_ASCIIDOC],[
629 AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
630 AC_ARG_WITH(asciidoc,
631 AS_HELP_STRING([--with-asciidoc],
632 [Use asciidoc to regenerate documentation (default: yes, if installed)]),
633 [use_asciidoc=$withval], [use_asciidoc=auto])
635 if test "x$use_asciidoc" = x"auto"; then
636 AC_PATH_PROG([ASCIIDOC], [asciidoc])
637 if test "x$ASCIIDOC" = "x"; then
638 AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
643 elif test "x$use_asciidoc" = x"yes" ; then
644 AC_PATH_PROG([ASCIIDOC], [asciidoc])
645 if test "x$ASCIIDOC" = "x"; then
646 AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
649 elif test "x$use_asciidoc" = x"no" ; then
650 if test "x$ASCIIDOC" != "x"; then
651 AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
655 AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
658 [if test "$have_asciidoc" = yes; then
659 # scrape the asciidoc version
660 AC_MSG_CHECKING([the asciidoc version])
661 asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
662 AC_MSG_RESULT([$asciidoc_version])
663 AS_VERSION_COMPARE([$asciidoc_version], [$1],
664 [if test "x$use_asciidoc" = xauto; then
665 AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
668 AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
671 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
672 ]) # XORG_WITH_ASCIIDOC
674 # XORG_WITH_DOXYGEN([MIN-VERSION])
675 # --------------------------------
676 # Minimum version: 1.5.0
678 # Documentation tools are not always available on all platforms and sometimes
679 # not at the appropriate level. This macro enables a module to test for the
680 # presence of the tool and obtain it's path in separate variables. Coupled with
681 # the --with-doxygen option, it allows maximum flexibilty in making decisions
682 # as whether or not to use the doxygen package.
684 # Interface to module:
685 # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
686 # DOXYGEN: returns the path of the doxygen program found
687 # returns the path set by the user in the environment
688 # --with-doxygen: 'yes' user instructs the module to use doxygen
689 # 'no' user instructs the module not to use doxygen
691 # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
693 AC_DEFUN([XORG_WITH_DOXYGEN],[
694 AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
696 AS_HELP_STRING([--with-doxygen],
697 [Use doxygen to regenerate documentation (default: yes, if installed)]),
698 [use_doxygen=$withval], [use_doxygen=auto])
700 if test "x$use_doxygen" = x"auto"; then
701 AC_PATH_PROG([DOXYGEN], [doxygen])
702 if test "x$DOXYGEN" = "x"; then
703 AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
708 elif test "x$use_doxygen" = x"yes" ; then
709 AC_PATH_PROG([DOXYGEN], [doxygen])
710 if test "x$DOXYGEN" = "x"; then
711 AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
714 elif test "x$use_doxygen" = x"no" ; then
715 if test "x$DOXYGEN" != "x"; then
716 AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
720 AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
723 [if test "$have_doxygen" = yes; then
724 # scrape the doxygen version
725 AC_MSG_CHECKING([the doxygen version])
726 doxygen_version=`$DOXYGEN --version 2>/dev/null`
727 AC_MSG_RESULT([$doxygen_version])
728 AS_VERSION_COMPARE([$doxygen_version], [$1],
729 [if test "x$use_doxygen" = xauto; then
730 AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
733 AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
736 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
737 ]) # XORG_WITH_DOXYGEN
741 # Minimum version: 1.6.0
743 # Documentation tools are not always available on all platforms and sometimes
744 # not at the appropriate level. This macro enables a module to test for the
745 # presence of the tool and obtain it's path in separate variables. Coupled with
746 # the --with-groff option, it allows maximum flexibilty in making decisions
747 # as whether or not to use the groff package.
749 # Interface to module:
750 # HAVE_GROFF: used in makefiles to conditionally generate documentation
751 # HAVE_GROFF_MM: the memorandum macros (-mm) package
752 # HAVE_GROFF_MS: the -ms macros package
753 # GROFF: returns the path of the groff program found
754 # returns the path set by the user in the environment
755 # --with-groff: 'yes' user instructs the module to use groff
756 # 'no' user instructs the module not to use groff
758 # Added in version 1.9.0:
759 # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
760 # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
761 # psselect from the psutils package.
762 # the ghostcript package. Refer to the grohtml man pages
764 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
766 # OS and distros often splits groff in a basic and full package, the former
767 # having the groff program and the later having devices, fonts and macros
768 # Checking for the groff executable is not enough.
770 # If macros are missing, we cannot assume that groff is useless, so we don't
771 # unset HAVE_GROFF or GROFF env variables.
772 # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
774 AC_DEFUN([XORG_WITH_GROFF],[
775 AC_ARG_VAR([GROFF], [Path to groff command])
777 AS_HELP_STRING([--with-groff],
778 [Use groff to regenerate documentation (default: yes, if installed)]),
779 [use_groff=$withval], [use_groff=auto])
781 if test "x$use_groff" = x"auto"; then
782 AC_PATH_PROG([GROFF], [groff])
783 if test "x$GROFF" = "x"; then
784 AC_MSG_WARN([groff not found - documentation targets will be skipped])
789 elif test "x$use_groff" = x"yes" ; then
790 AC_PATH_PROG([GROFF], [groff])
791 if test "x$GROFF" = "x"; then
792 AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
795 elif test "x$use_groff" = x"no" ; then
796 if test "x$GROFF" != "x"; then
797 AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
801 AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
804 # We have groff, test for the presence of the macro packages
805 if test "x$have_groff" = x"yes"; then
806 AC_MSG_CHECKING([for ${GROFF} -ms macros])
807 if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
812 AC_MSG_RESULT([$groff_ms_works])
813 AC_MSG_CHECKING([for ${GROFF} -mm macros])
814 if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
819 AC_MSG_RESULT([$groff_mm_works])
822 # We have groff, test for HTML dependencies, one command per package
823 if test "x$have_groff" = x"yes"; then
824 AC_PATH_PROGS(GS_PATH, [gs gswin32c])
825 AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
826 AC_PATH_PROG(PSSELECT_PATH, [psselect])
827 if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
831 AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
835 # Set Automake conditionals for Makefiles
836 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
837 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
838 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
839 AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
844 # Minimum version: 1.6.0
846 # Documentation tools are not always available on all platforms and sometimes
847 # not at the appropriate level. This macro enables a module to test for the
848 # presence of the tool and obtain it's path in separate variables. Coupled with
849 # the --with-fop option, it allows maximum flexibilty in making decisions
850 # as whether or not to use the fop package.
852 # Interface to module:
853 # HAVE_FOP: used in makefiles to conditionally generate documentation
854 # FOP: returns the path of the fop program found
855 # returns the path set by the user in the environment
856 # --with-fop: 'yes' user instructs the module to use fop
857 # 'no' user instructs the module not to use fop
859 # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
861 AC_DEFUN([XORG_WITH_FOP],[
862 AC_ARG_VAR([FOP], [Path to fop command])
864 AS_HELP_STRING([--with-fop],
865 [Use fop to regenerate documentation (default: yes, if installed)]),
866 [use_fop=$withval], [use_fop=auto])
868 if test "x$use_fop" = x"auto"; then
869 AC_PATH_PROG([FOP], [fop])
870 if test "x$FOP" = "x"; then
871 AC_MSG_WARN([fop not found - documentation targets will be skipped])
876 elif test "x$use_fop" = x"yes" ; then
877 AC_PATH_PROG([FOP], [fop])
878 if test "x$FOP" = "x"; then
879 AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
882 elif test "x$use_fop" = x"no" ; then
883 if test "x$FOP" != "x"; then
884 AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
888 AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
890 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
895 # Minimum version: 1.6.0
897 # Documentation tools are not always available on all platforms and sometimes
898 # not at the appropriate level. This macro enables a module to test for the
899 # presence of the tool and obtain it's path in separate variables. Coupled with
900 # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
901 # as whether or not to use the ps2pdf package.
903 # Interface to module:
904 # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
905 # PS2PDF: returns the path of the ps2pdf program found
906 # returns the path set by the user in the environment
907 # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
908 # 'no' user instructs the module not to use ps2pdf
910 # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
912 AC_DEFUN([XORG_WITH_PS2PDF],[
913 AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
915 AS_HELP_STRING([--with-ps2pdf],
916 [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
917 [use_ps2pdf=$withval], [use_ps2pdf=auto])
919 if test "x$use_ps2pdf" = x"auto"; then
920 AC_PATH_PROG([PS2PDF], [ps2pdf])
921 if test "x$PS2PDF" = "x"; then
922 AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
927 elif test "x$use_ps2pdf" = x"yes" ; then
928 AC_PATH_PROG([PS2PDF], [ps2pdf])
929 if test "x$PS2PDF" = "x"; then
930 AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
933 elif test "x$use_ps2pdf" = x"no" ; then
934 if test "x$PS2PDF" != "x"; then
935 AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
939 AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
941 AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
942 ]) # XORG_WITH_PS2PDF
944 # XORG_ENABLE_DOCS (enable_docs=yes)
946 # Minimum version: 1.6.0
948 # Documentation tools are not always available on all platforms and sometimes
949 # not at the appropriate level. This macro enables a builder to skip all
950 # documentation targets except traditional man pages.
951 # Combined with the specific tool checking macros XORG_WITH_*, it provides
952 # maximum flexibilty in controlling documentation building.
954 # XORG_WITH_XMLTO --with-xmlto
955 # XORG_WITH_ASCIIDOC --with-asciidoc
956 # XORG_WITH_DOXYGEN --with-doxygen
957 # XORG_WITH_FOP --with-fop
958 # XORG_WITH_GROFF --with-groff
959 # XORG_WITH_PS2PDF --with-ps2pdf
961 # Interface to module:
962 # ENABLE_DOCS: used in makefiles to conditionally generate documentation
963 # --enable-docs: 'yes' user instructs the module to generate docs
964 # 'no' user instructs the module not to generate docs
965 # parm1: specify the default value, yes or no.
967 AC_DEFUN([XORG_ENABLE_DOCS],[
969 if test "x$default" = x ; then
973 AS_HELP_STRING([--enable-docs],
974 [Enable building the documentation (default: yes)]),
975 [build_docs=$enableval], [build_docs=$default])
976 AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
977 AC_MSG_CHECKING([whether to build documentation])
978 AC_MSG_RESULT([$build_docs])
979 ]) # XORG_ENABLE_DOCS
981 # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
983 # Minimum version: 1.6.0
985 # This macro enables a builder to skip all developer documentation.
986 # Combined with the specific tool checking macros XORG_WITH_*, it provides
987 # maximum flexibilty in controlling documentation building.
989 # XORG_WITH_XMLTO --with-xmlto
990 # XORG_WITH_ASCIIDOC --with-asciidoc
991 # XORG_WITH_DOXYGEN --with-doxygen
992 # XORG_WITH_FOP --with-fop
993 # XORG_WITH_GROFF --with-groff
994 # XORG_WITH_PS2PDF --with-ps2pdf
996 # Interface to module:
997 # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
998 # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
999 # 'no' user instructs the module not to generate developer docs
1000 # parm1: specify the default value, yes or no.
1002 AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1004 if test "x$devel_default" = x ; then
1007 AC_ARG_ENABLE(devel-docs,
1008 AS_HELP_STRING([--enable-devel-docs],
1009 [Enable building the developer documentation (default: yes)]),
1010 [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
1011 AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1012 AC_MSG_CHECKING([whether to build developer documentation])
1013 AC_MSG_RESULT([$build_devel_docs])
1014 ]) # XORG_ENABLE_DEVEL_DOCS
1016 # XORG_ENABLE_SPECS (enable_specs=yes)
1018 # Minimum version: 1.6.0
1020 # This macro enables a builder to skip all functional specification targets.
1021 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1022 # maximum flexibilty in controlling documentation building.
1024 # XORG_WITH_XMLTO --with-xmlto
1025 # XORG_WITH_ASCIIDOC --with-asciidoc
1026 # XORG_WITH_DOXYGEN --with-doxygen
1027 # XORG_WITH_FOP --with-fop
1028 # XORG_WITH_GROFF --with-groff
1029 # XORG_WITH_PS2PDF --with-ps2pdf
1031 # Interface to module:
1032 # ENABLE_SPECS: used in makefiles to conditionally generate specs
1033 # --enable-specs: 'yes' user instructs the module to generate specs
1034 # 'no' user instructs the module not to generate specs
1035 # parm1: specify the default value, yes or no.
1037 AC_DEFUN([XORG_ENABLE_SPECS],[
1039 if test "x$spec_default" = x ; then
1042 AC_ARG_ENABLE(specs,
1043 AS_HELP_STRING([--enable-specs],
1044 [Enable building the specs (default: yes)]),
1045 [build_specs=$enableval], [build_specs=$spec_default])
1046 AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1047 AC_MSG_CHECKING([whether to build functional specifications])
1048 AC_MSG_RESULT([$build_specs])
1049 ]) # XORG_ENABLE_SPECS
1051 # XORG_CHECK_MALLOC_ZERO
1052 # ----------------------
1053 # Minimum version: 1.0.0
1055 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1056 # malloc(0) returns NULL. Packages should add one of these cflags to
1057 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1058 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1059 AC_ARG_ENABLE(malloc0returnsnull,
1060 AS_HELP_STRING([--enable-malloc0returnsnull],
1061 [malloc(0) returns NULL (default: auto)]),
1062 [MALLOC_ZERO_RETURNS_NULL=$enableval],
1063 [MALLOC_ZERO_RETURNS_NULL=auto])
1065 AC_MSG_CHECKING([whether malloc(0) returns NULL])
1066 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1072 char *m0, *r0, *c0, *p;
1077 exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1079 [MALLOC_ZERO_RETURNS_NULL=yes],
1080 [MALLOC_ZERO_RETURNS_NULL=no],
1081 [MALLOC_ZERO_RETURNS_NULL=yes])
1083 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1085 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1086 MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1087 XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1088 XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1090 MALLOC_ZERO_CFLAGS=""
1091 XMALLOC_ZERO_CFLAGS=""
1092 XTMALLOC_ZERO_CFLAGS=""
1095 AC_SUBST([MALLOC_ZERO_CFLAGS])
1096 AC_SUBST([XMALLOC_ZERO_CFLAGS])
1097 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1098 ]) # XORG_CHECK_MALLOC_ZERO
1102 # Minimum version: 1.1.0
1104 # This macro enables the use of a tool that flags some suspicious and
1105 # non-portable constructs (likely to be bugs) in C language source code.
1106 # It will attempt to locate the tool and use appropriate options.
1107 # There are various lint type tools on different platforms.
1109 # Interface to module:
1110 # LINT: returns the path to the tool found on the platform
1111 # or the value set to LINT on the configure cmd line
1112 # also an Automake conditional
1113 # LINT_FLAGS: an Automake variable with appropriate flags
1115 # --with-lint: 'yes' user instructs the module to use lint
1116 # 'no' user instructs the module not to use lint (default)
1118 # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1119 # If the user sets the value of LINT_FLAGS, they are used verbatim.
1121 AC_DEFUN([XORG_WITH_LINT],[
1123 AC_ARG_VAR([LINT], [Path to a lint-style command])
1124 AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1125 AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1126 [Use a lint-style source code checker (default: disabled)])],
1127 [use_lint=$withval], [use_lint=no])
1129 # Obtain platform specific info like program name and options
1130 # The lint program on FreeBSD and NetBSD is different from the one on Solaris
1132 *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1134 lint_options="-badflag"
1136 *freebsd* | *netbsd*)
1138 lint_options="-u -b"
1142 lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1146 # Test for the presence of the program (either guessed by the code or spelled out by the user)
1147 if test "x$use_lint" = x"yes" ; then
1148 AC_PATH_PROG([LINT], [$lint_name])
1149 if test "x$LINT" = "x"; then
1150 AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1152 elif test "x$use_lint" = x"no" ; then
1153 if test "x$LINT" != "x"; then
1154 AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1157 AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1160 # User supplied flags override default flags
1161 if test "x$LINT_FLAGS" != "x"; then
1162 lint_options=$LINT_FLAGS
1165 AC_SUBST([LINT_FLAGS],[$lint_options])
1166 AM_CONDITIONAL(LINT, [test "x$LINT" != x])
1170 # XORG_LINT_LIBRARY(LIBNAME)
1171 # --------------------------
1172 # Minimum version: 1.1.0
1174 # Sets up flags for building lint libraries for checking programs that call
1175 # functions in the library.
1177 # Interface to module:
1178 # LINTLIB - Automake variable with the name of lint library file to make
1179 # MAKE_LINT_LIB - Automake conditional
1181 # --enable-lint-library: - 'yes' user instructs the module to created a lint library
1182 # - 'no' user instructs the module not to create a lint library (default)
1184 AC_DEFUN([XORG_LINT_LIBRARY],[
1185 AC_REQUIRE([XORG_WITH_LINT])
1186 AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1187 [Create lint library (default: disabled)])],
1188 [make_lint_lib=$enableval], [make_lint_lib=no])
1190 if test "x$make_lint_lib" = x"yes" ; then
1192 if test "x$LINT" = "x"; then
1193 AC_MSG_ERROR([Cannot make lint library without --with-lint])
1195 elif test "x$make_lint_lib" != x"no" ; then
1196 AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1200 AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1202 ]) # XORG_LINT_LIBRARY
1206 # Minimum version: 1.2.0
1208 # Defines CWARNFLAGS to enable C compiler warnings.
1210 AC_DEFUN([XORG_CWARNFLAGS], [
1211 AC_REQUIRE([AC_PROG_CC_C99])
1212 if test "x$GCC" = xyes ; then
1213 CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1214 -Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1215 -Wbad-function-cast -Wformat=2"
1216 case `$CC -dumpversion` in
1218 CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1222 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1223 if test "x$SUNCC" = "xyes"; then
1227 AC_SUBST(CWARNFLAGS)
1228 ]) # XORG_CWARNFLAGS
1230 # XORG_STRICT_OPTION
1231 # -----------------------
1232 # Minimum version: 1.3.0
1234 # Add configure option to enable strict compilation
1235 AC_DEFUN([XORG_STRICT_OPTION], [
1236 # If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
1237 AC_REQUIRE([AC_PROG_CC_C99])
1238 AC_REQUIRE([XORG_CWARNFLAGS])
1240 AC_ARG_ENABLE(strict-compilation,
1241 AS_HELP_STRING([--enable-strict-compilation],
1242 [Enable all warnings from compiler and make them errors (default: disabled)]),
1243 [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1244 if test "x$STRICT_COMPILE" = "xyes"; then
1245 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1246 AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1247 if test "x$GCC" = xyes ; then
1248 STRICT_CFLAGS="-pedantic -Werror"
1249 elif test "x$SUNCC" = "xyes"; then
1250 STRICT_CFLAGS="-errwarn"
1251 elif test "x$INTELCC" = "xyes"; then
1252 STRICT_CFLAGS="-Werror"
1255 CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1256 AC_SUBST([CWARNFLAGS])
1257 ]) # XORG_STRICT_OPTION
1259 # XORG_DEFAULT_OPTIONS
1260 # --------------------
1261 # Minimum version: 1.3.0
1263 # Defines default options for X.Org modules.
1265 AC_DEFUN([XORG_DEFAULT_OPTIONS], [
1266 AC_REQUIRE([AC_PROG_INSTALL])
1269 XORG_RELEASE_VERSION
1272 XORG_MANPAGE_SECTIONS
1273 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1274 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1275 ]) # XORG_DEFAULT_OPTIONS
1279 # Minimum version: 1.4.0
1281 # Defines the variable INSTALL_CMD as the command to copy
1282 # INSTALL from $prefix/share/util-macros.
1284 AC_DEFUN([XORG_INSTALL], [
1285 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1286 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1287 INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1288 mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1289 || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1290 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1291 AC_SUBST([INSTALL_CMD])
1293 dnl Copyright 2005 Red Hat, Inc
1295 dnl Permission to use, copy, modify, distribute, and sell this software and its
1296 dnl documentation for any purpose is hereby granted without fee, provided that
1297 dnl the above copyright notice appear in all copies and that both that
1298 dnl copyright notice and this permission notice appear in supporting
1301 dnl The above copyright notice and this permission notice shall be included
1302 dnl in all copies or substantial portions of the Software.
1304 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1305 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1306 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1307 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1308 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1309 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1310 dnl OTHER DEALINGS IN THE SOFTWARE.
1312 dnl Except as contained in this notice, the name of the copyright holders shall
1313 dnl not be used in advertising or otherwise to promote the sale, use or
1314 dnl other dealings in this Software without prior written authorization
1315 dnl from the copyright holders.
1318 # XORG_RELEASE_VERSION
1319 # --------------------
1320 # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1322 AC_DEFUN([XORG_RELEASE_VERSION],[
1323 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1324 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
1325 [Major version of this package])
1326 PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1327 if test "x$PVM" = "x"; then
1330 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1332 [Minor version of this package])
1333 PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1334 if test "x$PVP" = "x"; then
1337 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1339 [Patch version of this package])
1344 # Minimum version: 1.2.0
1346 # Defines the variable CHANGELOG_CMD as the command to generate
1347 # ChangeLog from git.
1350 AC_DEFUN([XORG_CHANGELOG], [
1351 CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1352 mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1353 || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1354 echo 'git directory not found: installing possibly empty changelog.' >&2)"
1355 AC_SUBST([CHANGELOG_CMD])
1358 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
1360 # This file is free software; the Free Software Foundation
1361 # gives unlimited permission to copy and/or distribute it,
1362 # with or without modifications, as long as this notice is preserved.
1364 # AM_AUTOMAKE_VERSION(VERSION)
1365 # ----------------------------
1366 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1367 # generated from the m4 files accompanying Automake X.Y.
1368 # (This private macro should not be called outside this file.)
1369 AC_DEFUN([AM_AUTOMAKE_VERSION],
1370 [am__api_version='1.11'
1371 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1372 dnl require some minimum version. Point them to the right macro.
1373 m4_if([$1], [1.11.1], [],
1374 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1377 # _AM_AUTOCONF_VERSION(VERSION)
1378 # -----------------------------
1379 # aclocal traces this macro to find the Autoconf version.
1380 # This is a private macro too. Using m4_define simplifies
1381 # the logic in aclocal, which can simply ignore this definition.
1382 m4_define([_AM_AUTOCONF_VERSION], [])
1384 # AM_SET_CURRENT_AUTOMAKE_VERSION
1385 # -------------------------------
1386 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1387 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1388 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1389 [AM_AUTOMAKE_VERSION([1.11.1])dnl
1390 m4_ifndef([AC_AUTOCONF_VERSION],
1391 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1392 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1394 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
1396 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
1398 # This file is free software; the Free Software Foundation
1399 # gives unlimited permission to copy and/or distribute it,
1400 # with or without modifications, as long as this notice is preserved.
1402 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1403 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
1404 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1406 # Of course, Automake must honor this variable whenever it calls a
1407 # tool from the auxiliary directory. The problem is that $srcdir (and
1408 # therefore $ac_aux_dir as well) can be either absolute or relative,
1409 # depending on how configure is run. This is pretty annoying, since
1410 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
1411 # source directory, any form will work fine, but in subdirectories a
1412 # relative path needs to be adjusted first.
1414 # $ac_aux_dir/missing
1415 # fails when called from a subdirectory if $ac_aux_dir is relative
1416 # $top_srcdir/$ac_aux_dir/missing
1417 # fails if $ac_aux_dir is absolute,
1418 # fails when called from a subdirectory in a VPATH build with
1419 # a relative $ac_aux_dir
1421 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1422 # are both prefixed by $srcdir. In an in-source build this is usually
1423 # harmless because $srcdir is `.', but things will broke when you
1424 # start a VPATH build or use an absolute $srcdir.
1426 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1427 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
1428 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1429 # and then we would define $MISSING as
1430 # MISSING="\${SHELL} $am_aux_dir/missing"
1431 # This will work as long as MISSING is not called from configure, because
1432 # unfortunately $(top_srcdir) has no meaning in configure.
1433 # However there are other variables, like CC, which are often used in
1434 # configure, and could therefore not use this "fixed" $ac_aux_dir.
1436 # Another solution, used here, is to always expand $ac_aux_dir to an
1437 # absolute PATH. The drawback is that using absolute paths prevent a
1438 # configured tree to be moved without reconfiguration.
1440 AC_DEFUN([AM_AUX_DIR_EXPAND],
1441 [dnl Rely on autoconf to set up CDPATH properly.
1442 AC_PREREQ([2.50])dnl
1443 # expand $ac_aux_dir to an absolute path
1444 am_aux_dir=`cd $ac_aux_dir && pwd`
1447 # AM_CONDITIONAL -*- Autoconf -*-
1449 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1450 # Free Software Foundation, Inc.
1452 # This file is free software; the Free Software Foundation
1453 # gives unlimited permission to copy and/or distribute it,
1454 # with or without modifications, as long as this notice is preserved.
1458 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1459 # -------------------------------------
1460 # Define a conditional.
1461 AC_DEFUN([AM_CONDITIONAL],
1463 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
1464 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1465 AC_SUBST([$1_TRUE])dnl
1466 AC_SUBST([$1_FALSE])dnl
1467 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
1468 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
1469 m4_define([_AM_COND_VALUE_$1], [$2])dnl
1477 AC_CONFIG_COMMANDS_PRE(
1478 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1479 AC_MSG_ERROR([[conditional "$1" was never defined.
1480 Usually this means the macro was only invoked conditionally.]])
1483 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1484 # Free Software Foundation, Inc.
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.
1492 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1493 # written in clear, in which case automake, when reading aclocal.m4,
1494 # will think it sees a *use*, and therefore will trigger all it's
1495 # C support machinery. Also note that it means that autoscan, seeing
1496 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1499 # _AM_DEPENDENCIES(NAME)
1500 # ----------------------
1501 # See how the compiler implements dependency checking.
1502 # NAME is "CC", "CXX", "GCJ", or "OBJC".
1503 # We try a few techniques and use that to set a single cache variable.
1505 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1506 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1507 # dependency, and given that the user is not expected to run this macro,
1508 # just rely on AC_PROG_CC.
1509 AC_DEFUN([_AM_DEPENDENCIES],
1510 [AC_REQUIRE([AM_SET_DEPDIR])dnl
1511 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1512 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1513 AC_REQUIRE([AM_DEP_TRACK])dnl
1515 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
1516 [$1], CXX, [depcc="$CXX" am_compiler_list=],
1517 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1518 [$1], UPC, [depcc="$UPC" am_compiler_list=],
1519 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
1520 [depcc="$$1" am_compiler_list=])
1522 AC_CACHE_CHECK([dependency style of $depcc],
1523 [am_cv_$1_dependencies_compiler_type],
1524 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1525 # We make a subdir and do the tests there. Otherwise we can end up
1526 # making bogus files that we don't know about and never remove. For
1527 # instance it was reported that on HP-UX the gcc test will end up
1528 # making a dummy file named `D' -- because `-MD' means `put the output
1531 # Copy depcomp to subdir because otherwise we won't find it if we're
1532 # using a relative directory.
1533 cp "$am_depcomp" conftest.dir
1535 # We will build objects and dependencies in a subdirectory because
1536 # it helps to detect inapplicable dependency modes. For instance
1537 # both Tru64's cc and ICC support -MD to output dependencies as a
1538 # side effect of compilation, but ICC will put the dependencies in
1539 # the current directory while Tru64 will put them in the object
1543 am_cv_$1_dependencies_compiler_type=none
1544 if test "$am_compiler_list" = ""; then
1545 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1549 [case " $depcc " in #(
1550 *\ -arch\ *\ -arch\ *) am__universal=true ;;
1553 [case " $depcc " in #(
1554 *\ -arch\ *\ -arch\ *) am__universal=true ;;
1557 for depmode in $am_compiler_list; do
1558 # Setup a source with many dependencies, because some compilers
1559 # like to wrap large dependency lists on column 80 (with \), and
1560 # we should not choose a depcomp mode which is confused by this.
1562 # We need to recreate these files for each test, as the compiler may
1563 # overwrite some of them when testing with obscure command lines.
1564 # This happens at least with the AIX C compiler.
1566 for i in 1 2 3 4 5 6; do
1567 echo '#include "conftst'$i'.h"' >> sub/conftest.c
1568 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1569 # Solaris 8's {/usr,}/bin/sh.
1570 touch sub/conftst$i.h
1572 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1574 # We check with `-c' and `-o' for the sake of the "dashmstdout"
1575 # mode. It turns out that the SunPro C++ compiler does not properly
1576 # handle `-M -o', and we need to detect this. Also, some Intel
1577 # versions had trouble with output in subdirs
1578 am__obj=sub/conftest.${OBJEXT-o}
1579 am__minus_obj="-o $am__obj"
1582 # This depmode causes a compiler race in universal mode.
1583 test "$am__universal" = false || continue
1586 # after this tag, mechanisms are not by side-effect, so they'll
1587 # only be used when explicitly requested
1588 if test "x$enable_dependency_tracking" = xyes; then
1594 msvisualcpp | msvcmsys)
1595 # This compiler won't grok `-c -o', but also, the minuso test has
1596 # not run yet. These depmodes are late enough in the game, and
1597 # so weak that their functioning should not be impacted.
1598 am__obj=conftest.${OBJEXT-o}
1603 if depmode=$depmode \
1604 source=sub/conftest.c object=$am__obj \
1605 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1606 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1607 >/dev/null 2>conftest.err &&
1608 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1609 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1610 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1611 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1612 # icc doesn't choke on unknown options, it will just issue warnings
1613 # or remarks (even with -Werror). So we grep stderr for any message
1614 # that says an option was ignored or not supported.
1615 # When given -MP, icc 7.0 and 7.1 complain thusly:
1616 # icc: Command line warning: ignoring option '-M'; no argument required
1617 # The diagnosis changed in icc 8.0:
1618 # icc: Command line remark: option '-MP' not supported
1619 if (grep 'ignoring option' conftest.err ||
1620 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1621 am_cv_$1_dependencies_compiler_type=$depmode
1630 am_cv_$1_dependencies_compiler_type=none
1633 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1634 AM_CONDITIONAL([am__fastdep$1], [
1635 test "x$enable_dependency_tracking" != xno \
1636 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1642 # Choose a directory name for dependency files.
1643 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1644 AC_DEFUN([AM_SET_DEPDIR],
1645 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1646 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1652 AC_DEFUN([AM_DEP_TRACK],
1653 [AC_ARG_ENABLE(dependency-tracking,
1654 [ --disable-dependency-tracking speeds up one-time build
1655 --enable-dependency-tracking do not reject slow dependency extractors])
1656 if test "x$enable_dependency_tracking" != xno; then
1657 am_depcomp="$ac_aux_dir/depcomp"
1660 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1661 AC_SUBST([AMDEPBACKSLASH])dnl
1662 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1665 # Generate code to set up dependency tracking. -*- Autoconf -*-
1667 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1668 # Free Software Foundation, Inc.
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.
1676 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1677 # ------------------------------
1678 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1680 # Autoconf 2.62 quotes --file arguments for eval, but not when files
1681 # are listed without --file. Let's play safe and only enable the eval
1682 # if we detect the quoting.
1683 case $CONFIG_FILES in
1684 *\'*) eval set x "$CONFIG_FILES" ;;
1685 *) set x $CONFIG_FILES ;;
1690 # Strip MF so we end up with the name of the file.
1691 mf=`echo "$mf" | sed -e 's/:.*$//'`
1692 # Check whether this is an Automake generated Makefile or not.
1693 # We used to match only the files named `Makefile.in', but
1694 # some people rename them; so instead we look at the file content.
1695 # Grep'ing the first line is not enough: some people post-process
1696 # each Makefile.in and add a new line on top of each file to say so.
1697 # Grep'ing the whole file is not good either: AIX grep has a line
1698 # limit of 2048, but all sed's we know have understand at least 4000.
1699 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1700 dirpart=`AS_DIRNAME("$mf")`
1704 # Extract the definition of DEPDIR, am__include, and am__quote
1705 # from the Makefile without running `make'.
1706 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1707 test -z "$DEPDIR" && continue
1708 am__include=`sed -n 's/^am__include = //p' < "$mf"`
1709 test -z "am__include" && continue
1710 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1711 # When using ansi2knr, U may be empty or an underscore; expand it
1712 U=`sed -n 's/^U = //p' < "$mf"`
1713 # Find all dependency output files, they are included files with
1714 # $(DEPDIR) in their names. We invoke sed twice because it is the
1715 # simplest approach to changing $(DEPDIR) to its actual value in the
1717 for file in `sed -n "
1718 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1719 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1720 # Make sure the directory exists.
1721 test -f "$dirpart/$file" && continue
1722 fdir=`AS_DIRNAME(["$file"])`
1723 AS_MKDIR_P([$dirpart/$fdir])
1724 # echo "creating $dirpart/$file"
1725 echo '# dummy' > "$dirpart/$file"
1729 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1732 # AM_OUTPUT_DEPENDENCY_COMMANDS
1733 # -----------------------------
1734 # This macro should only be invoked once -- use via AC_REQUIRE.
1736 # This code is only required when automatic dependency tracking
1737 # is enabled. FIXME. This creates each `.P' file that we will
1738 # need in order to bootstrap the dependency handling code.
1739 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1740 [AC_CONFIG_COMMANDS([depfiles],
1741 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1742 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1745 # Do all the work for Automake. -*- Autoconf -*-
1747 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1748 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1750 # This file is free software; the Free Software Foundation
1751 # gives unlimited permission to copy and/or distribute it,
1752 # with or without modifications, as long as this notice is preserved.
1756 # This macro actually does too much. Some checks are only needed if
1757 # your package does certain things. But this isn't really a big deal.
1759 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1760 # AM_INIT_AUTOMAKE([OPTIONS])
1761 # -----------------------------------------------
1762 # The call with PACKAGE and VERSION arguments is the old style
1763 # call (pre autoconf-2.50), which is being phased out. PACKAGE
1764 # and VERSION should now be passed to AC_INIT and removed from
1765 # the call to AM_INIT_AUTOMAKE.
1766 # We support both call styles for the transition. After
1767 # the next Automake release, Autoconf can make the AC_INIT
1768 # arguments mandatory, and then we can depend on a new Autoconf
1769 # release and drop the old call support.
1770 AC_DEFUN([AM_INIT_AUTOMAKE],
1771 [AC_PREREQ([2.62])dnl
1772 dnl Autoconf wants to disallow AM_ names. We explicitly allow
1773 dnl the ones we care about.
1774 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1775 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1776 AC_REQUIRE([AC_PROG_INSTALL])dnl
1777 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1778 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1779 # is not polluted with repeated "-I."
1780 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1781 # test to see if srcdir already configured
1782 if test -f $srcdir/config.status; then
1783 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1787 # test whether we have cygpath
1788 if test -z "$CYGPATH_W"; then
1789 if (cygpath --version) >/dev/null 2>/dev/null; then
1790 CYGPATH_W='cygpath -w'
1795 AC_SUBST([CYGPATH_W])
1797 # Define the identity of the package.
1798 dnl Distinguish between old-style and new-style calls.
1800 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1801 AC_SUBST([PACKAGE], [$1])dnl
1802 AC_SUBST([VERSION], [$2])],
1803 [_AM_SET_OPTIONS([$1])dnl
1804 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1805 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1806 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1807 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1808 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1810 _AM_IF_OPTION([no-define],,
1811 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1812 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1814 # Some tools Automake needs.
1815 AC_REQUIRE([AM_SANITY_CHECK])dnl
1816 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1817 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1818 AM_MISSING_PROG(AUTOCONF, autoconf)
1819 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1820 AM_MISSING_PROG(AUTOHEADER, autoheader)
1821 AM_MISSING_PROG(MAKEINFO, makeinfo)
1822 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1823 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1824 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1825 # We need awk for the "check" target. The system "awk" is bad on
1827 AC_REQUIRE([AC_PROG_AWK])dnl
1828 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1829 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1830 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1831 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1832 [_AM_PROG_TAR([v7])])])
1833 _AM_IF_OPTION([no-dependencies],,
1834 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1835 [_AM_DEPENDENCIES(CC)],
1836 [define([AC_PROG_CC],
1837 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1838 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1839 [_AM_DEPENDENCIES(CXX)],
1840 [define([AC_PROG_CXX],
1841 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1842 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1843 [_AM_DEPENDENCIES(OBJC)],
1844 [define([AC_PROG_OBJC],
1845 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1847 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1848 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
1849 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
1850 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
1851 AC_CONFIG_COMMANDS_PRE(dnl
1852 [m4_provide_if([_AM_COMPILER_EXEEXT],
1853 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1856 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
1857 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1858 dnl mangled by Autoconf and run in a shell conditional statement.
1859 m4_define([_AC_COMPILER_EXEEXT],
1860 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1863 # When config.status generates a header, we must update the stamp-h file.
1864 # This file resides in the same directory as the config header
1865 # that is generated. The stamp files are numbered to have different names.
1867 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1868 # loop where config.status creates the headers, so we can generate
1869 # our stamp files there.
1870 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1871 [# Compute $1's index in $config_headers.
1874 for _am_header in $config_headers :; do
1876 $_am_arg | $_am_arg:* )
1879 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1882 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1884 # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
1886 # This file is free software; the Free Software Foundation
1887 # gives unlimited permission to copy and/or distribute it,
1888 # with or without modifications, as long as this notice is preserved.
1890 # AM_PROG_INSTALL_SH
1891 # ------------------
1892 # Define $install_sh.
1893 AC_DEFUN([AM_PROG_INSTALL_SH],
1894 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1895 if test x"${install_sh}" != xset; then
1898 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1900 install_sh="\${SHELL} $am_aux_dir/install-sh"
1903 AC_SUBST(install_sh)])
1905 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
1907 # This file is free software; the Free Software Foundation
1908 # gives unlimited permission to copy and/or distribute it,
1909 # with or without modifications, as long as this notice is preserved.
1913 # Check whether the underlying file-system supports filenames
1914 # with a leading dot. For instance MS-DOS doesn't.
1915 AC_DEFUN([AM_SET_LEADING_DOT],
1916 [rm -rf .tst 2>/dev/null
1917 mkdir .tst 2>/dev/null
1918 if test -d .tst; then
1923 rmdir .tst 2>/dev/null
1924 AC_SUBST([am__leading_dot])])
1926 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
1929 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1930 # Free Software Foundation, Inc.
1932 # This file is free software; the Free Software Foundation
1933 # gives unlimited permission to copy and/or distribute it,
1934 # with or without modifications, as long as this notice is preserved.
1938 # AM_MAINTAINER_MODE([DEFAULT-MODE])
1939 # ----------------------------------
1940 # Control maintainer-specific portions of Makefiles.
1941 # Default is to disable them, unless `enable' is passed literally.
1942 # For symmetry, `disable' may be passed as well. Anyway, the user
1943 # can override the default with the --enable/--disable switch.
1944 AC_DEFUN([AM_MAINTAINER_MODE],
1945 [m4_case(m4_default([$1], [disable]),
1946 [enable], [m4_define([am_maintainer_other], [disable])],
1947 [disable], [m4_define([am_maintainer_other], [enable])],
1948 [m4_define([am_maintainer_other], [enable])
1949 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
1950 AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
1951 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
1952 AC_ARG_ENABLE([maintainer-mode],
1953 [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
1954 (and sometimes confusing) to the casual installer],
1955 [USE_MAINTAINER_MODE=$enableval],
1956 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
1957 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1958 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
1959 MAINT=$MAINTAINER_MODE_TRUE
1960 AC_SUBST([MAINT])dnl
1964 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
1966 # Check to see how 'make' treats includes. -*- Autoconf -*-
1968 # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
1970 # This file is free software; the Free Software Foundation
1971 # gives unlimited permission to copy and/or distribute it,
1972 # with or without modifications, as long as this notice is preserved.
1978 # Check to see how make treats includes.
1979 AC_DEFUN([AM_MAKE_INCLUDE],
1980 [am_make=${MAKE-make}
1981 cat > confinc << 'END'
1983 @echo this is the am__doit target
1986 # If we don't find an include directive, just comment out the code.
1987 AC_MSG_CHECKING([for style of include used by $am_make])
1991 # First try GNU make style include.
1992 echo "include confinc" > confmf
1993 # Ignore all kinds of additional output from `make'.
1994 case `$am_make -s -f confmf 2> /dev/null` in #(
1995 *the\ am__doit\ target*)
2001 # Now try BSD make style include.
2002 if test "$am__include" = "#"; then
2003 echo '.include "confinc"' > confmf
2004 case `$am_make -s -f confmf 2> /dev/null` in #(
2005 *the\ am__doit\ target*)
2006 am__include=.include
2012 AC_SUBST([am__include])
2013 AC_SUBST([am__quote])
2014 AC_MSG_RESULT([$_am_result])
2015 rm -f confinc confmf
2018 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
2020 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
2021 # Free Software Foundation, Inc.
2023 # This file is free software; the Free Software Foundation
2024 # gives unlimited permission to copy and/or distribute it,
2025 # with or without modifications, as long as this notice is preserved.
2029 # AM_MISSING_PROG(NAME, PROGRAM)
2030 # ------------------------------
2031 AC_DEFUN([AM_MISSING_PROG],
2032 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2033 $1=${$1-"${am_missing_run}$2"}
2037 # AM_MISSING_HAS_RUN
2038 # ------------------
2039 # Define MISSING if not defined so far and test if it supports --run.
2040 # If it does, set am_missing_run to use it, otherwise, to nothing.
2041 AC_DEFUN([AM_MISSING_HAS_RUN],
2042 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2043 AC_REQUIRE_AUX_FILE([missing])dnl
2044 if test x"${MISSING+set}" != xset; then
2047 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2049 MISSING="\${SHELL} $am_aux_dir/missing" ;;
2052 # Use eval to expand $SHELL
2053 if eval "$MISSING --run true"; then
2054 am_missing_run="$MISSING --run "
2057 AC_MSG_WARN([`missing' script is too old or missing])
2061 # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
2063 # This file is free software; the Free Software Foundation
2064 # gives unlimited permission to copy and/or distribute it,
2065 # with or without modifications, as long as this notice is preserved.
2069 # Check for `mkdir -p'.
2070 AC_DEFUN([AM_PROG_MKDIR_P],
2071 [AC_PREREQ([2.60])dnl
2072 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
2073 dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
2074 dnl while keeping a definition of mkdir_p for backward compatibility.
2075 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
2076 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
2077 dnl Makefile.ins that do not define MKDIR_P, so we do our own
2078 dnl adjustment using top_builddir (which is defined more often than
2080 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
2082 [[\\/$]]* | ?:[[\\/]]*) ;;
2083 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2087 # Helper functions for option handling. -*- Autoconf -*-
2089 # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
2091 # This file is free software; the Free Software Foundation
2092 # gives unlimited permission to copy and/or distribute it,
2093 # with or without modifications, as long as this notice is preserved.
2097 # _AM_MANGLE_OPTION(NAME)
2098 # -----------------------
2099 AC_DEFUN([_AM_MANGLE_OPTION],
2100 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2102 # _AM_SET_OPTION(NAME)
2103 # ------------------------------
2104 # Set option NAME. Presently that only means defining a flag for this option.
2105 AC_DEFUN([_AM_SET_OPTION],
2106 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2108 # _AM_SET_OPTIONS(OPTIONS)
2109 # ----------------------------------
2110 # OPTIONS is a space-separated list of Automake options.
2111 AC_DEFUN([_AM_SET_OPTIONS],
2112 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2114 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2115 # -------------------------------------------
2116 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2117 AC_DEFUN([_AM_IF_OPTION],
2118 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2120 # Check to make sure that the build environment is sane. -*- Autoconf -*-
2122 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
2123 # Free Software Foundation, Inc.
2125 # This file is free software; the Free Software Foundation
2126 # gives unlimited permission to copy and/or distribute it,
2127 # with or without modifications, as long as this notice is preserved.
2133 AC_DEFUN([AM_SANITY_CHECK],
2134 [AC_MSG_CHECKING([whether build environment is sane])
2137 echo timestamp > conftest.file
2138 # Reject unsafe characters in $srcdir or the absolute working directory
2139 # name. Accept space and tab only in the latter.
2143 *[[\\\"\#\$\&\'\`$am_lf]]*)
2144 AC_MSG_ERROR([unsafe absolute working directory name]);;
2147 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
2148 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
2151 # Do `set' in a subshell so we don't clobber the current shell's
2152 # arguments. Must try -L first in case configure is actually a
2153 # symlink; some systems play weird games with the mod time of symlinks
2154 # (eg FreeBSD returns the mod time of the symlink's containing
2157 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2158 if test "$[*]" = "X"; then
2160 set X `ls -t "$srcdir/configure" conftest.file`
2163 if test "$[*]" != "X $srcdir/configure conftest.file" \
2164 && test "$[*]" != "X conftest.file $srcdir/configure"; then
2166 # If neither matched, then we have a broken ls. This can happen
2167 # if, for instance, CONFIG_SHELL is bash and it inherits a
2168 # broken ls alias from the environment. This has actually
2169 # happened. Such a system could not be considered "sane".
2170 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2171 alias in your environment])
2174 test "$[2]" = conftest.file
2180 AC_MSG_ERROR([newly created file is older than distributed files!
2181 Check your system clock])
2183 AC_MSG_RESULT(yes)])
2185 # Copyright (C) 2009 Free Software Foundation, Inc.
2187 # This file is free software; the Free Software Foundation
2188 # gives unlimited permission to copy and/or distribute it,
2189 # with or without modifications, as long as this notice is preserved.
2193 # AM_SILENT_RULES([DEFAULT])
2194 # --------------------------
2195 # Enable less verbose build rules; with the default set to DEFAULT
2196 # (`yes' being less verbose, `no' or empty being verbose).
2197 AC_DEFUN([AM_SILENT_RULES],
2198 [AC_ARG_ENABLE([silent-rules],
2199 [ --enable-silent-rules less verbose build output (undo: `make V=1')
2200 --disable-silent-rules verbose build output (undo: `make V=0')])
2201 case $enable_silent_rules in
2202 yes) AM_DEFAULT_VERBOSITY=0;;
2203 no) AM_DEFAULT_VERBOSITY=1;;
2204 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
2206 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
2208 AC_SUBST([AM_BACKSLASH])dnl
2209 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
2212 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
2214 # This file is free software; the Free Software Foundation
2215 # gives unlimited permission to copy and/or distribute it,
2216 # with or without modifications, as long as this notice is preserved.
2218 # AM_PROG_INSTALL_STRIP
2219 # ---------------------
2220 # One issue with vendor `install' (even GNU) is that you can't
2221 # specify the program used to strip binaries. This is especially
2222 # annoying in cross-compiling environments, where the build's strip
2223 # is unlikely to handle the host's binaries.
2224 # Fortunately install-sh will honor a STRIPPROG variable, so we
2225 # always use install-sh in `make install-strip', and initialize
2226 # STRIPPROG with the value of the STRIP variable (set by the user).
2227 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2228 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2229 # Installed binaries are usually stripped using `strip' when the user
2230 # run `make install-strip'. However `strip' might not be the right
2231 # tool to use in cross-compilation environments, therefore Automake
2232 # will honor the `STRIP' environment variable to overrule this program.
2233 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2234 if test "$cross_compiling" != no; then
2235 AC_CHECK_TOOL([STRIP], [strip], :)
2237 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2238 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2240 # Copyright (C) 2006, 2008 Free Software Foundation, Inc.
2242 # This file is free software; the Free Software Foundation
2243 # gives unlimited permission to copy and/or distribute it,
2244 # with or without modifications, as long as this notice is preserved.
2248 # _AM_SUBST_NOTMAKE(VARIABLE)
2249 # ---------------------------
2250 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2251 # This macro is traced by Automake.
2252 AC_DEFUN([_AM_SUBST_NOTMAKE])
2254 # AM_SUBST_NOTMAKE(VARIABLE)
2255 # ---------------------------
2256 # Public sister of _AM_SUBST_NOTMAKE.
2257 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2259 # Check how to create a tarball. -*- Autoconf -*-
2261 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
2263 # This file is free software; the Free Software Foundation
2264 # gives unlimited permission to copy and/or distribute it,
2265 # with or without modifications, as long as this notice is preserved.
2269 # _AM_PROG_TAR(FORMAT)
2270 # --------------------
2271 # Check how to create a tarball in format FORMAT.
2272 # FORMAT should be one of `v7', `ustar', or `pax'.
2274 # Substitute a variable $(am__tar) that is a command
2275 # writing to stdout a FORMAT-tarball containing the directory
2277 # tardir=directory && $(am__tar) > result.tar
2279 # Substitute a variable $(am__untar) that extract such
2280 # a tarball read from stdin.
2281 # $(am__untar) < result.tar
2282 AC_DEFUN([_AM_PROG_TAR],
2283 [# Always define AMTAR for backward compatibility.
2284 AM_MISSING_PROG([AMTAR], [tar])
2286 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
2287 [m4_case([$1], [ustar],, [pax],,
2288 [m4_fatal([Unknown tar format])])
2289 AC_MSG_CHECKING([how to create a $1 tar archive])
2290 # Loop over all known methods to create a tar archive until one works.
2291 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2292 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2293 # Do not fold the above two line into one, because Tru64 sh and
2294 # Solaris sh will not grok spaces in the rhs of `-'.
2295 for _am_tool in $_am_tools
2299 for _am_tar in tar gnutar gtar;
2301 AM_RUN_LOG([$_am_tar --version]) && break
2303 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2304 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2305 am__untar="$_am_tar -xf -"
2308 # Must skip GNU tar: if it does not support --format= it doesn't create
2309 # ustar tarball either.
2310 (tar --version) >/dev/null 2>&1 && continue
2311 am__tar='tar chf - "$$tardir"'
2312 am__tar_='tar chf - "$tardir"'
2313 am__untar='tar xf -'
2316 am__tar='pax -L -x $1 -w "$$tardir"'
2317 am__tar_='pax -L -x $1 -w "$tardir"'
2321 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2322 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2323 am__untar='cpio -i -H $1 -d'
2332 # If the value was cached, stop now. We just wanted to have am__tar
2333 # and am__untar set.
2334 test -n "${am_cv_prog_tar_$1}" && break
2336 # tar/untar a dummy directory, and stop if the command works
2339 echo GrepMe > conftest.dir/file
2340 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2342 if test -s conftest.tar; then
2343 AM_RUN_LOG([$am__untar <conftest.tar])
2344 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2349 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2350 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2352 AC_SUBST([am__untar])