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.65],,
17 [m4_warning([this file was generated for autoconf 2.65.
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 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.7.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
288 AC_DEFUN([XORG_MANPAGE_SECTIONS],[
289 AC_REQUIRE([AC_CANONICAL_HOST])
291 if test x$APP_MAN_SUFFIX = x ; then
294 if test x$APP_MAN_DIR = x ; then
295 APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
298 if test x$LIB_MAN_SUFFIX = x ; then
301 if test x$LIB_MAN_DIR = x ; then
302 LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
305 if test x$FILE_MAN_SUFFIX = x ; then
307 solaris*) FILE_MAN_SUFFIX=4 ;;
308 *) FILE_MAN_SUFFIX=5 ;;
311 if test x$FILE_MAN_DIR = x ; then
312 FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
315 if test x$MISC_MAN_SUFFIX = x ; then
317 solaris*) MISC_MAN_SUFFIX=5 ;;
318 *) MISC_MAN_SUFFIX=7 ;;
321 if test x$MISC_MAN_DIR = x ; then
322 MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
325 if test x$DRIVER_MAN_SUFFIX = x ; then
327 solaris*) DRIVER_MAN_SUFFIX=7 ;;
328 *) DRIVER_MAN_SUFFIX=4 ;;
331 if test x$DRIVER_MAN_DIR = x ; then
332 DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
335 if test x$ADMIN_MAN_SUFFIX = x ; then
337 solaris*) ADMIN_MAN_SUFFIX=1m ;;
338 *) ADMIN_MAN_SUFFIX=8 ;;
341 if test x$ADMIN_MAN_DIR = x ; then
342 ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
346 AC_SUBST([APP_MAN_SUFFIX])
347 AC_SUBST([LIB_MAN_SUFFIX])
348 AC_SUBST([FILE_MAN_SUFFIX])
349 AC_SUBST([MISC_MAN_SUFFIX])
350 AC_SUBST([DRIVER_MAN_SUFFIX])
351 AC_SUBST([ADMIN_MAN_SUFFIX])
352 AC_SUBST([APP_MAN_DIR])
353 AC_SUBST([LIB_MAN_DIR])
354 AC_SUBST([FILE_MAN_DIR])
355 AC_SUBST([MISC_MAN_DIR])
356 AC_SUBST([DRIVER_MAN_DIR])
357 AC_SUBST([ADMIN_MAN_DIR])
358 ]) # XORG_MANPAGE_SECTIONS
360 # XORG_CHECK_SGML_DOCTOOLS
361 # ------------------------
362 # Minimum version: 1.7.0
364 # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
365 # provided by xorg-sgml-doctools, if installed.
366 AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
367 AC_MSG_CHECKING([for X.Org SGML entities])
369 PKG_CHECK_EXISTS([xorg-sgml-doctools],
370 [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
371 [if test x"$cross_compiling" != x"yes" ; then
372 AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
373 [XORG_SGML_PATH=$prefix/share/sgml])
376 if test "x$XORG_SGML_PATH" != "x" ; then
377 AC_MSG_RESULT([$XORG_SGML_PATH])
382 AC_SUBST(XORG_SGML_PATH)
383 ]) # XORG_CHECK_SGML_DOCTOOLS
385 # XORG_CHECK_LINUXDOC
386 # -------------------
387 # Minimum version: 1.0.0
389 # Defines the variable MAKE_TEXT if the necessary tools and
390 # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
391 # Whether or not the necessary tools and files are found can be checked
392 # with the AM_CONDITIONAL "BUILD_LINUXDOC"
393 AC_DEFUN([XORG_CHECK_LINUXDOC],[
394 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
396 AC_PATH_PROG(LINUXDOC, linuxdoc)
397 AC_PATH_PROG(PS2PDF, ps2pdf)
399 AC_MSG_CHECKING([whether to build documentation])
401 if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
407 AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
409 AC_MSG_RESULT([$BUILDDOC])
411 AC_MSG_CHECKING([whether to build pdf documentation])
413 if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
419 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
421 AC_MSG_RESULT([$BUILDPDFDOC])
423 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
424 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
426 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
432 ]) # XORG_CHECK_LINUXDOC
435 # -------------------
436 # Minimum version: 1.0.0
438 # Checks for the ability to build output formats from SGML DocBook source.
439 # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
440 # indicates whether the necessary tools and files are found and, if set,
441 # $(MAKE_XXX) blah.sgml will produce blah.xxx.
442 AC_DEFUN([XORG_CHECK_DOCBOOK],[
443 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
450 AC_PATH_PROG(DOCBOOKPS, docbook2ps)
451 AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
452 AC_PATH_PROG(DOCBOOKHTML, docbook2html)
453 AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
455 AC_MSG_CHECKING([whether to build text documentation])
456 if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
457 test x$BUILD_TXTDOC != xno; then
460 AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
461 AC_MSG_RESULT([$BUILDTXTDOC])
463 AC_MSG_CHECKING([whether to build PDF documentation])
464 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
465 test x$BUILD_PDFDOC != xno; then
468 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
469 AC_MSG_RESULT([$BUILDPDFDOC])
471 AC_MSG_CHECKING([whether to build PostScript documentation])
472 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
473 test x$BUILD_PSDOC != xno; then
476 AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
477 AC_MSG_RESULT([$BUILDPSDOC])
479 AC_MSG_CHECKING([whether to build HTML documentation])
480 if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
481 test x$BUILD_HTMLDOC != xno; then
484 AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
485 AC_MSG_RESULT([$BUILDHTMLDOC])
487 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
488 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
489 MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
490 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
496 ]) # XORG_CHECK_DOCBOOK
498 # XORG_WITH_XMLTO([MIN-VERSION])
500 # Minimum version: 1.5.0
502 # Documentation tools are not always available on all platforms and sometimes
503 # not at the appropriate level. This macro enables a module to test for the
504 # presence of the tool and obtain it's path in separate variables. Coupled with
505 # the --with-xmlto option, it allows maximum flexibilty in making decisions
506 # as whether or not to use the xmlto package.
508 # Interface to module:
509 # HAVE_XMLTO: used in makefiles to conditionally generate documentation
510 # XMLTO: returns the path of the xmlto program found
511 # returns the path set by the user in the environment
512 # --with-xmlto: 'yes' user instructs the module to use xmlto
513 # 'no' user instructs the module not to use xmlto
515 # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
517 AC_DEFUN([XORG_WITH_XMLTO],[
518 AC_ARG_VAR([XMLTO], [Path to xmlto command])
520 AS_HELP_STRING([--with-xmlto],
521 [Use xmlto to regenerate documentation (default: yes, if installed)]),
522 [use_xmlto=$withval], [use_xmlto=auto])
524 if test "x$use_xmlto" = x"auto"; then
525 AC_PATH_PROG([XMLTO], [xmlto])
526 if test "x$XMLTO" = "x"; then
527 AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
532 elif test "x$use_xmlto" = x"yes" ; then
533 AC_PATH_PROG([XMLTO], [xmlto])
534 if test "x$XMLTO" = "x"; then
535 AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
538 elif test "x$use_xmlto" = x"no" ; then
539 if test "x$XMLTO" != "x"; then
540 AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
544 AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
547 [if test "$have_xmlto" = yes; then
548 # scrape the xmlto version
549 AC_MSG_CHECKING([the xmlto version])
550 xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
551 AC_MSG_RESULT([$xmlto_version])
552 AS_VERSION_COMPARE([$xmlto_version], [$1],
553 [if test "x$use_xmlto" = xauto; then
554 AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
557 AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
560 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
563 # XORG_WITH_ASCIIDOC([MIN-VERSION])
565 # Minimum version: 1.5.0
567 # Documentation tools are not always available on all platforms and sometimes
568 # not at the appropriate level. This macro enables a module to test for the
569 # presence of the tool and obtain it's path in separate variables. Coupled with
570 # the --with-asciidoc option, it allows maximum flexibilty in making decisions
571 # as whether or not to use the asciidoc package.
573 # Interface to module:
574 # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
575 # ASCIIDOC: returns the path of the asciidoc program found
576 # returns the path set by the user in the environment
577 # --with-asciidoc: 'yes' user instructs the module to use asciidoc
578 # 'no' user instructs the module not to use asciidoc
580 # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
582 AC_DEFUN([XORG_WITH_ASCIIDOC],[
583 AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
584 AC_ARG_WITH(asciidoc,
585 AS_HELP_STRING([--with-asciidoc],
586 [Use asciidoc to regenerate documentation (default: yes, if installed)]),
587 [use_asciidoc=$withval], [use_asciidoc=auto])
589 if test "x$use_asciidoc" = x"auto"; then
590 AC_PATH_PROG([ASCIIDOC], [asciidoc])
591 if test "x$ASCIIDOC" = "x"; then
592 AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
597 elif test "x$use_asciidoc" = x"yes" ; then
598 AC_PATH_PROG([ASCIIDOC], [asciidoc])
599 if test "x$ASCIIDOC" = "x"; then
600 AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
603 elif test "x$use_asciidoc" = x"no" ; then
604 if test "x$ASCIIDOC" != "x"; then
605 AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
609 AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
612 [if test "$have_asciidoc" = yes; then
613 # scrape the asciidoc version
614 AC_MSG_CHECKING([the asciidoc version])
615 asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
616 AC_MSG_RESULT([$asciidoc_version])
617 AS_VERSION_COMPARE([$asciidoc_version], [$1],
618 [if test "x$use_asciidoc" = xauto; then
619 AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
622 AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
625 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
626 ]) # XORG_WITH_ASCIIDOC
628 # XORG_WITH_DOXYGEN([MIN-VERSION])
629 # --------------------------------
630 # Minimum version: 1.5.0
632 # Documentation tools are not always available on all platforms and sometimes
633 # not at the appropriate level. This macro enables a module to test for the
634 # presence of the tool and obtain it's path in separate variables. Coupled with
635 # the --with-doxygen option, it allows maximum flexibilty in making decisions
636 # as whether or not to use the doxygen package.
638 # Interface to module:
639 # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
640 # DOXYGEN: returns the path of the doxygen program found
641 # returns the path set by the user in the environment
642 # --with-doxygen: 'yes' user instructs the module to use doxygen
643 # 'no' user instructs the module not to use doxygen
645 # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
647 AC_DEFUN([XORG_WITH_DOXYGEN],[
648 AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
650 AS_HELP_STRING([--with-doxygen],
651 [Use doxygen to regenerate documentation (default: yes, if installed)]),
652 [use_doxygen=$withval], [use_doxygen=auto])
654 if test "x$use_doxygen" = x"auto"; then
655 AC_PATH_PROG([DOXYGEN], [doxygen])
656 if test "x$DOXYGEN" = "x"; then
657 AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
662 elif test "x$use_doxygen" = x"yes" ; then
663 AC_PATH_PROG([DOXYGEN], [doxygen])
664 if test "x$DOXYGEN" = "x"; then
665 AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
668 elif test "x$use_doxygen" = x"no" ; then
669 if test "x$DOXYGEN" != "x"; then
670 AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
674 AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
677 [if test "$have_doxygen" = yes; then
678 # scrape the doxygen version
679 AC_MSG_CHECKING([the doxygen version])
680 doxygen_version=`$DOXYGEN --version 2>/dev/null`
681 AC_MSG_RESULT([$doxygen_version])
682 AS_VERSION_COMPARE([$doxygen_version], [$1],
683 [if test "x$use_doxygen" = xauto; then
684 AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
687 AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
690 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
691 ]) # XORG_WITH_DOXYGEN
695 # Minimum version: 1.6.0
697 # Documentation tools are not always available on all platforms and sometimes
698 # not at the appropriate level. This macro enables a module to test for the
699 # presence of the tool and obtain it's path in separate variables. Coupled with
700 # the --with-groff option, it allows maximum flexibilty in making decisions
701 # as whether or not to use the groff package.
703 # Interface to module:
704 # HAVE_GROFF: used in makefiles to conditionally generate documentation
705 # HAVE_GROFF_MM: the memorandum macros (-mm) package
706 # HAVE_GROFF_MS: the -ms macros package
707 # GROFF: returns the path of the groff program found
708 # returns the path set by the user in the environment
709 # --with-groff: 'yes' user instructs the module to use groff
710 # 'no' user instructs the module not to use groff
712 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
714 # OS and distros often splits groff in a basic and full package, the former
715 # having the groff program and the later having devices, fonts and macros
716 # Checking for the groff executable is not enough.
718 # If macros are missing, we cannot assume that groff is useless, so we don't
719 # unset HAVE_GROFF or GROFF env variables.
720 # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
722 AC_DEFUN([XORG_WITH_GROFF],[
723 AC_ARG_VAR([GROFF], [Path to groff command])
725 AS_HELP_STRING([--with-groff],
726 [Use groff to regenerate documentation (default: yes, if installed)]),
727 [use_groff=$withval], [use_groff=auto])
729 if test "x$use_groff" = x"auto"; then
730 AC_PATH_PROG([GROFF], [groff])
731 if test "x$GROFF" = "x"; then
732 AC_MSG_WARN([groff not found - documentation targets will be skipped])
737 elif test "x$use_groff" = x"yes" ; then
738 AC_PATH_PROG([GROFF], [groff])
739 if test "x$GROFF" = "x"; then
740 AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
743 elif test "x$use_groff" = x"no" ; then
744 if test "x$GROFF" != "x"; then
745 AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
749 AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
751 # We have groff, test for the presence of the macro packages
752 if test "x$have_groff" = x"yes"; then
753 AC_MSG_CHECKING([for ${GROFF} -ms macros])
754 if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
759 AC_MSG_RESULT([$groff_ms_works])
760 AC_MSG_CHECKING([for ${GROFF} -mm macros])
761 if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
766 AC_MSG_RESULT([$groff_mm_works])
768 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
769 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
770 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
775 # Minimum version: 1.6.0
777 # Documentation tools are not always available on all platforms and sometimes
778 # not at the appropriate level. This macro enables a module to test for the
779 # presence of the tool and obtain it's path in separate variables. Coupled with
780 # the --with-fop option, it allows maximum flexibilty in making decisions
781 # as whether or not to use the fop package.
783 # Interface to module:
784 # HAVE_FOP: used in makefiles to conditionally generate documentation
785 # FOP: returns the path of the fop program found
786 # returns the path set by the user in the environment
787 # --with-fop: 'yes' user instructs the module to use fop
788 # 'no' user instructs the module not to use fop
790 # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
792 AC_DEFUN([XORG_WITH_FOP],[
793 AC_ARG_VAR([FOP], [Path to fop command])
795 AS_HELP_STRING([--with-fop],
796 [Use fop to regenerate documentation (default: yes, if installed)]),
797 [use_fop=$withval], [use_fop=auto])
799 if test "x$use_fop" = x"auto"; then
800 AC_PATH_PROG([FOP], [fop])
801 if test "x$FOP" = "x"; then
802 AC_MSG_WARN([fop not found - documentation targets will be skipped])
807 elif test "x$use_fop" = x"yes" ; then
808 AC_PATH_PROG([FOP], [fop])
809 if test "x$FOP" = "x"; then
810 AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
813 elif test "x$use_fop" = x"no" ; then
814 if test "x$FOP" != "x"; then
815 AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
819 AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
821 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
826 # Minimum version: 1.6.0
828 # Documentation tools are not always available on all platforms and sometimes
829 # not at the appropriate level. This macro enables a module to test for the
830 # presence of the tool and obtain it's path in separate variables. Coupled with
831 # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
832 # as whether or not to use the ps2pdf package.
834 # Interface to module:
835 # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
836 # PS2PDF: returns the path of the ps2pdf program found
837 # returns the path set by the user in the environment
838 # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
839 # 'no' user instructs the module not to use ps2pdf
841 # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
843 AC_DEFUN([XORG_WITH_PS2PDF],[
844 AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
846 AS_HELP_STRING([--with-ps2pdf],
847 [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
848 [use_ps2pdf=$withval], [use_ps2pdf=auto])
850 if test "x$use_ps2pdf" = x"auto"; then
851 AC_PATH_PROG([PS2PDF], [ps2pdf])
852 if test "x$PS2PDF" = "x"; then
853 AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
858 elif test "x$use_ps2pdf" = x"yes" ; then
859 AC_PATH_PROG([PS2PDF], [ps2pdf])
860 if test "x$PS2PDF" = "x"; then
861 AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
864 elif test "x$use_ps2pdf" = x"no" ; then
865 if test "x$PS2PDF" != "x"; then
866 AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
870 AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
872 AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
873 ]) # XORG_WITH_PS2PDF
875 # XORG_ENABLE_DOCS (enable_docs=yes)
877 # Minimum version: 1.6.0
879 # Documentation tools are not always available on all platforms and sometimes
880 # not at the appropriate level. This macro enables a builder to skip all
881 # documentation targets except traditional man pages.
882 # Combined with the specific tool checking macros XORG_WITH_*, it provides
883 # maximum flexibilty in controlling documentation building.
885 # XORG_WITH_XMLTO --with-xmlto
886 # XORG_WITH_ASCIIDOC --with-asciidoc
887 # XORG_WITH_DOXYGEN --with-doxygen
888 # XORG_WITH_FOP --with-fop
889 # XORG_WITH_GROFF --with-groff
890 # XORG_WITH_PS2PDF --with-ps2pdf
892 # Interface to module:
893 # ENABLE_DOCS: used in makefiles to conditionally generate documentation
894 # --enable-docs: 'yes' user instructs the module to generate docs
895 # 'no' user instructs the module not to generate docs
896 # parm1: specify the default value, yes or no.
898 AC_DEFUN([XORG_ENABLE_DOCS],[
900 if test "x$default" = x ; then
904 AS_HELP_STRING([--enable-docs],
905 [Enable building the documentation (default: yes)]),
906 [build_docs=$enableval], [build_docs=$default])
907 AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
908 AC_MSG_CHECKING([whether to build documentation])
909 AC_MSG_RESULT([$build_docs])
910 ]) # XORG_ENABLE_DOCS
912 # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
914 # Minimum version: 1.6.0
916 # This macro enables a builder to skip all developer documentation.
917 # Combined with the specific tool checking macros XORG_WITH_*, it provides
918 # maximum flexibilty in controlling documentation building.
920 # XORG_WITH_XMLTO --with-xmlto
921 # XORG_WITH_ASCIIDOC --with-asciidoc
922 # XORG_WITH_DOXYGEN --with-doxygen
923 # XORG_WITH_FOP --with-fop
924 # XORG_WITH_GROFF --with-groff
925 # XORG_WITH_PS2PDF --with-ps2pdf
927 # Interface to module:
928 # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
929 # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
930 # 'no' user instructs the module not to generate developer docs
931 # parm1: specify the default value, yes or no.
933 AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
935 if test "x$devel_default" = x ; then
938 AC_ARG_ENABLE(devel-docs,
939 AS_HELP_STRING([--enable-devel-docs],
940 [Enable building the developer documentation (default: yes)]),
941 [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
942 AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
943 AC_MSG_CHECKING([whether to build developer documentation])
944 AC_MSG_RESULT([$build_devel_docs])
945 ]) # XORG_ENABLE_DEVEL_DOCS
947 # XORG_ENABLE_SPECS (enable_specs=yes)
949 # Minimum version: 1.6.0
951 # This macro enables a builder to skip all functional specification targets.
952 # Combined with the specific tool checking macros XORG_WITH_*, it provides
953 # maximum flexibilty in controlling documentation building.
955 # XORG_WITH_XMLTO --with-xmlto
956 # XORG_WITH_ASCIIDOC --with-asciidoc
957 # XORG_WITH_DOXYGEN --with-doxygen
958 # XORG_WITH_FOP --with-fop
959 # XORG_WITH_GROFF --with-groff
960 # XORG_WITH_PS2PDF --with-ps2pdf
962 # Interface to module:
963 # ENABLE_SPECS: used in makefiles to conditionally generate specs
964 # --enable-specs: 'yes' user instructs the module to generate specs
965 # 'no' user instructs the module not to generate specs
966 # parm1: specify the default value, yes or no.
968 AC_DEFUN([XORG_ENABLE_SPECS],[
970 if test "x$spec_default" = x ; then
974 AS_HELP_STRING([--enable-specs],
975 [Enable building the specs (default: yes)]),
976 [build_specs=$enableval], [build_specs=$spec_default])
977 AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
978 AC_MSG_CHECKING([whether to build functional specifications])
979 AC_MSG_RESULT([$build_specs])
980 ]) # XORG_ENABLE_SPECS
982 # XORG_CHECK_MALLOC_ZERO
983 # ----------------------
984 # Minimum version: 1.0.0
986 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
987 # malloc(0) returns NULL. Packages should add one of these cflags to
988 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
989 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
990 AC_ARG_ENABLE(malloc0returnsnull,
991 AS_HELP_STRING([--enable-malloc0returnsnull],
992 [malloc(0) returns NULL (default: auto)]),
993 [MALLOC_ZERO_RETURNS_NULL=$enableval],
994 [MALLOC_ZERO_RETURNS_NULL=auto])
996 AC_MSG_CHECKING([whether malloc(0) returns NULL])
997 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1003 char *m0, *r0, *c0, *p;
1008 exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
1010 [MALLOC_ZERO_RETURNS_NULL=yes],
1011 [MALLOC_ZERO_RETURNS_NULL=no],
1012 [MALLOC_ZERO_RETURNS_NULL=yes])
1014 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1016 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1017 MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1018 XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1019 XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1021 MALLOC_ZERO_CFLAGS=""
1022 XMALLOC_ZERO_CFLAGS=""
1023 XTMALLOC_ZERO_CFLAGS=""
1026 AC_SUBST([MALLOC_ZERO_CFLAGS])
1027 AC_SUBST([XMALLOC_ZERO_CFLAGS])
1028 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1029 ]) # XORG_CHECK_MALLOC_ZERO
1033 # Minimum version: 1.1.0
1035 # Sets up flags for source checkers such as lint and sparse if --with-lint
1036 # is specified. (Use --with-lint=sparse for sparse.)
1037 # Sets $LINT to name of source checker passed with --with-lint (default: lint)
1038 # Sets $LINT_FLAGS to flags to pass to source checker
1039 # Sets LINT automake conditional if enabled (default: disabled)
1041 AC_DEFUN([XORG_WITH_LINT],[
1043 # Allow checking code with lint, sparse, etc.
1044 AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1045 [Use a lint-style source code checker (default: disabled)])],
1046 [use_lint=$withval], [use_lint=no])
1047 if test "x$use_lint" = "xyes" ; then
1052 if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
1057 LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1065 AC_SUBST(LINT_FLAGS)
1066 AM_CONDITIONAL(LINT, [test x$LINT != xno])
1070 # XORG_LINT_LIBRARY(LIBNAME)
1071 # --------------------------
1072 # Minimum version: 1.1.0
1074 # Sets up flags for building lint libraries for checking programs that call
1075 # functions in the library.
1076 # Disabled by default, enable with --enable-lint-library
1078 # @LINTLIB@ - name of lint library file to make
1079 # MAKE_LINT_LIB - automake conditional
1082 AC_DEFUN([XORG_LINT_LIBRARY],[
1083 AC_REQUIRE([XORG_WITH_LINT])
1084 # Build lint "library" for more indepth checks of programs calling this library
1085 AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1086 [Create lint library (default: disabled)])],
1087 [make_lint_lib=$enableval], [make_lint_lib=no])
1088 if test "x$make_lint_lib" != "xno" ; then
1089 if test "x$LINT" = "xno" ; then
1090 AC_MSG_ERROR([Cannot make lint library without --with-lint])
1092 if test "x$make_lint_lib" = "xyes" ; then
1095 LINTLIB=$make_lint_lib
1099 AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1101 ]) # XORG_LINT_LIBRARY
1105 # Minimum version: 1.2.0
1107 # Defines CWARNFLAGS to enable C compiler warnings.
1109 AC_DEFUN([XORG_CWARNFLAGS], [
1110 AC_REQUIRE([AC_PROG_CC])
1111 if test "x$GCC" = xyes ; then
1112 CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
1113 -Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
1114 -Wbad-function-cast -Wformat=2"
1115 case `$CC -dumpversion` in
1117 CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
1121 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1122 if test "x$SUNCC" = "xyes"; then
1126 AC_SUBST(CWARNFLAGS)
1127 ]) # XORG_CWARNFLAGS
1129 # XORG_STRICT_OPTION
1130 # -----------------------
1131 # Minimum version: 1.3.0
1133 # Add configure option to enable strict compilation
1134 AC_DEFUN([XORG_STRICT_OPTION], [
1135 AC_REQUIRE([AC_PROG_CC])
1136 AC_REQUIRE([AC_PROG_CC_C99])
1137 AC_REQUIRE([XORG_CWARNFLAGS])
1139 AC_ARG_ENABLE(strict-compilation,
1140 AS_HELP_STRING([--enable-strict-compilation],
1141 [Enable all warnings from compiler and make them errors (default: disabled)]),
1142 [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1143 if test "x$STRICT_COMPILE" = "xyes"; then
1144 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1145 AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1146 if test "x$GCC" = xyes ; then
1147 STRICT_CFLAGS="-pedantic -Werror"
1148 elif test "x$SUNCC" = "xyes"; then
1149 STRICT_CFLAGS="-errwarn"
1150 elif test "x$INTELCC" = "xyes"; then
1151 STRICT_CFLAGS="-Werror"
1154 CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
1155 AC_SUBST([CWARNFLAGS])
1156 ]) # XORG_STRICT_OPTION
1158 # XORG_DEFAULT_OPTIONS
1159 # --------------------
1160 # Minimum version: 1.3.0
1162 # Defines default options for X.Org modules.
1164 AC_DEFUN([XORG_DEFAULT_OPTIONS], [
1167 XORG_RELEASE_VERSION
1170 XORG_MANPAGE_SECTIONS
1171 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1172 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1173 ]) # XORG_DEFAULT_OPTIONS
1177 # Minimum version: 1.4.0
1179 # Defines the variable INSTALL_CMD as the command to copy
1180 # INSTALL from $prefix/share/util-macros.
1182 AC_DEFUN([XORG_INSTALL], [
1183 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1184 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1185 INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1186 mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1187 || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1188 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1189 AC_SUBST([INSTALL_CMD])
1191 dnl Copyright 2005 Red Hat, Inc
1193 dnl Permission to use, copy, modify, distribute, and sell this software and its
1194 dnl documentation for any purpose is hereby granted without fee, provided that
1195 dnl the above copyright notice appear in all copies and that both that
1196 dnl copyright notice and this permission notice appear in supporting
1199 dnl The above copyright notice and this permission notice shall be included
1200 dnl in all copies or substantial portions of the Software.
1202 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1203 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1204 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1205 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1206 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1207 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1208 dnl OTHER DEALINGS IN THE SOFTWARE.
1210 dnl Except as contained in this notice, the name of the copyright holders shall
1211 dnl not be used in advertising or otherwise to promote the sale, use or
1212 dnl other dealings in this Software without prior written authorization
1213 dnl from the copyright holders.
1216 # XORG_RELEASE_VERSION
1217 # --------------------
1218 # Adds --with/without-release-string and changes the PACKAGE and
1219 # PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If
1220 # no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also
1221 # defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1223 AC_DEFUN([XORG_RELEASE_VERSION],[
1224 AC_ARG_WITH(release-version,
1225 AS_HELP_STRING([--with-release-version=STRING],
1226 [Use release version string in package name]),
1227 [RELEASE_VERSION="$withval"],
1228 [RELEASE_VERSION=""])
1229 if test "x$RELEASE_VERSION" != "x"; then
1230 PACKAGE="$PACKAGE-$RELEASE_VERSION"
1231 PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
1232 AC_MSG_NOTICE([Building with package name set to $PACKAGE])
1234 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1235 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
1236 [Major version of this package])
1237 PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1238 if test "x$PVM" = "x"; then
1241 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1243 [Minor version of this package])
1244 PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1245 if test "x$PVP" = "x"; then
1248 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1250 [Patch version of this package])
1255 # Minimum version: 1.2.0
1257 # Defines the variable CHANGELOG_CMD as the command to generate
1258 # ChangeLog from git.
1261 AC_DEFUN([XORG_CHANGELOG], [
1262 CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1263 mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1264 || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1265 echo 'git directory not found: installing possibly empty changelog.' >&2)"
1266 AC_SUBST([CHANGELOG_CMD])
1269 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
1271 # This file is free software; the Free Software Foundation
1272 # gives unlimited permission to copy and/or distribute it,
1273 # with or without modifications, as long as this notice is preserved.
1275 # AM_AUTOMAKE_VERSION(VERSION)
1276 # ----------------------------
1277 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1278 # generated from the m4 files accompanying Automake X.Y.
1279 # (This private macro should not be called outside this file.)
1280 AC_DEFUN([AM_AUTOMAKE_VERSION],
1281 [am__api_version='1.11'
1282 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1283 dnl require some minimum version. Point them to the right macro.
1284 m4_if([$1], [1.11.1], [],
1285 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1288 # _AM_AUTOCONF_VERSION(VERSION)
1289 # -----------------------------
1290 # aclocal traces this macro to find the Autoconf version.
1291 # This is a private macro too. Using m4_define simplifies
1292 # the logic in aclocal, which can simply ignore this definition.
1293 m4_define([_AM_AUTOCONF_VERSION], [])
1295 # AM_SET_CURRENT_AUTOMAKE_VERSION
1296 # -------------------------------
1297 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1298 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1299 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1300 [AM_AUTOMAKE_VERSION([1.11.1])dnl
1301 m4_ifndef([AC_AUTOCONF_VERSION],
1302 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1303 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1305 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
1307 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
1309 # This file is free software; the Free Software Foundation
1310 # gives unlimited permission to copy and/or distribute it,
1311 # with or without modifications, as long as this notice is preserved.
1313 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1314 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
1315 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1317 # Of course, Automake must honor this variable whenever it calls a
1318 # tool from the auxiliary directory. The problem is that $srcdir (and
1319 # therefore $ac_aux_dir as well) can be either absolute or relative,
1320 # depending on how configure is run. This is pretty annoying, since
1321 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
1322 # source directory, any form will work fine, but in subdirectories a
1323 # relative path needs to be adjusted first.
1325 # $ac_aux_dir/missing
1326 # fails when called from a subdirectory if $ac_aux_dir is relative
1327 # $top_srcdir/$ac_aux_dir/missing
1328 # fails if $ac_aux_dir is absolute,
1329 # fails when called from a subdirectory in a VPATH build with
1330 # a relative $ac_aux_dir
1332 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1333 # are both prefixed by $srcdir. In an in-source build this is usually
1334 # harmless because $srcdir is `.', but things will broke when you
1335 # start a VPATH build or use an absolute $srcdir.
1337 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1338 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
1339 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1340 # and then we would define $MISSING as
1341 # MISSING="\${SHELL} $am_aux_dir/missing"
1342 # This will work as long as MISSING is not called from configure, because
1343 # unfortunately $(top_srcdir) has no meaning in configure.
1344 # However there are other variables, like CC, which are often used in
1345 # configure, and could therefore not use this "fixed" $ac_aux_dir.
1347 # Another solution, used here, is to always expand $ac_aux_dir to an
1348 # absolute PATH. The drawback is that using absolute paths prevent a
1349 # configured tree to be moved without reconfiguration.
1351 AC_DEFUN([AM_AUX_DIR_EXPAND],
1352 [dnl Rely on autoconf to set up CDPATH properly.
1353 AC_PREREQ([2.50])dnl
1354 # expand $ac_aux_dir to an absolute path
1355 am_aux_dir=`cd $ac_aux_dir && pwd`
1358 # AM_CONDITIONAL -*- Autoconf -*-
1360 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1361 # Free Software Foundation, Inc.
1363 # This file is free software; the Free Software Foundation
1364 # gives unlimited permission to copy and/or distribute it,
1365 # with or without modifications, as long as this notice is preserved.
1369 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1370 # -------------------------------------
1371 # Define a conditional.
1372 AC_DEFUN([AM_CONDITIONAL],
1374 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
1375 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1376 AC_SUBST([$1_TRUE])dnl
1377 AC_SUBST([$1_FALSE])dnl
1378 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
1379 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
1380 m4_define([_AM_COND_VALUE_$1], [$2])dnl
1388 AC_CONFIG_COMMANDS_PRE(
1389 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1390 AC_MSG_ERROR([[conditional "$1" was never defined.
1391 Usually this means the macro was only invoked conditionally.]])
1394 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1395 # Free Software Foundation, Inc.
1397 # This file is free software; the Free Software Foundation
1398 # gives unlimited permission to copy and/or distribute it,
1399 # with or without modifications, as long as this notice is preserved.
1403 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1404 # written in clear, in which case automake, when reading aclocal.m4,
1405 # will think it sees a *use*, and therefore will trigger all it's
1406 # C support machinery. Also note that it means that autoscan, seeing
1407 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1410 # _AM_DEPENDENCIES(NAME)
1411 # ----------------------
1412 # See how the compiler implements dependency checking.
1413 # NAME is "CC", "CXX", "GCJ", or "OBJC".
1414 # We try a few techniques and use that to set a single cache variable.
1416 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1417 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1418 # dependency, and given that the user is not expected to run this macro,
1419 # just rely on AC_PROG_CC.
1420 AC_DEFUN([_AM_DEPENDENCIES],
1421 [AC_REQUIRE([AM_SET_DEPDIR])dnl
1422 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1423 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1424 AC_REQUIRE([AM_DEP_TRACK])dnl
1426 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
1427 [$1], CXX, [depcc="$CXX" am_compiler_list=],
1428 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1429 [$1], UPC, [depcc="$UPC" am_compiler_list=],
1430 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
1431 [depcc="$$1" am_compiler_list=])
1433 AC_CACHE_CHECK([dependency style of $depcc],
1434 [am_cv_$1_dependencies_compiler_type],
1435 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1436 # We make a subdir and do the tests there. Otherwise we can end up
1437 # making bogus files that we don't know about and never remove. For
1438 # instance it was reported that on HP-UX the gcc test will end up
1439 # making a dummy file named `D' -- because `-MD' means `put the output
1442 # Copy depcomp to subdir because otherwise we won't find it if we're
1443 # using a relative directory.
1444 cp "$am_depcomp" conftest.dir
1446 # We will build objects and dependencies in a subdirectory because
1447 # it helps to detect inapplicable dependency modes. For instance
1448 # both Tru64's cc and ICC support -MD to output dependencies as a
1449 # side effect of compilation, but ICC will put the dependencies in
1450 # the current directory while Tru64 will put them in the object
1454 am_cv_$1_dependencies_compiler_type=none
1455 if test "$am_compiler_list" = ""; then
1456 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1460 [case " $depcc " in #(
1461 *\ -arch\ *\ -arch\ *) am__universal=true ;;
1464 [case " $depcc " in #(
1465 *\ -arch\ *\ -arch\ *) am__universal=true ;;
1468 for depmode in $am_compiler_list; do
1469 # Setup a source with many dependencies, because some compilers
1470 # like to wrap large dependency lists on column 80 (with \), and
1471 # we should not choose a depcomp mode which is confused by this.
1473 # We need to recreate these files for each test, as the compiler may
1474 # overwrite some of them when testing with obscure command lines.
1475 # This happens at least with the AIX C compiler.
1477 for i in 1 2 3 4 5 6; do
1478 echo '#include "conftst'$i'.h"' >> sub/conftest.c
1479 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1480 # Solaris 8's {/usr,}/bin/sh.
1481 touch sub/conftst$i.h
1483 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1485 # We check with `-c' and `-o' for the sake of the "dashmstdout"
1486 # mode. It turns out that the SunPro C++ compiler does not properly
1487 # handle `-M -o', and we need to detect this. Also, some Intel
1488 # versions had trouble with output in subdirs
1489 am__obj=sub/conftest.${OBJEXT-o}
1490 am__minus_obj="-o $am__obj"
1493 # This depmode causes a compiler race in universal mode.
1494 test "$am__universal" = false || continue
1497 # after this tag, mechanisms are not by side-effect, so they'll
1498 # only be used when explicitly requested
1499 if test "x$enable_dependency_tracking" = xyes; then
1505 msvisualcpp | msvcmsys)
1506 # This compiler won't grok `-c -o', but also, the minuso test has
1507 # not run yet. These depmodes are late enough in the game, and
1508 # so weak that their functioning should not be impacted.
1509 am__obj=conftest.${OBJEXT-o}
1514 if depmode=$depmode \
1515 source=sub/conftest.c object=$am__obj \
1516 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1517 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1518 >/dev/null 2>conftest.err &&
1519 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1520 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1521 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1522 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1523 # icc doesn't choke on unknown options, it will just issue warnings
1524 # or remarks (even with -Werror). So we grep stderr for any message
1525 # that says an option was ignored or not supported.
1526 # When given -MP, icc 7.0 and 7.1 complain thusly:
1527 # icc: Command line warning: ignoring option '-M'; no argument required
1528 # The diagnosis changed in icc 8.0:
1529 # icc: Command line remark: option '-MP' not supported
1530 if (grep 'ignoring option' conftest.err ||
1531 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1532 am_cv_$1_dependencies_compiler_type=$depmode
1541 am_cv_$1_dependencies_compiler_type=none
1544 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1545 AM_CONDITIONAL([am__fastdep$1], [
1546 test "x$enable_dependency_tracking" != xno \
1547 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1553 # Choose a directory name for dependency files.
1554 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1555 AC_DEFUN([AM_SET_DEPDIR],
1556 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1557 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1563 AC_DEFUN([AM_DEP_TRACK],
1564 [AC_ARG_ENABLE(dependency-tracking,
1565 [ --disable-dependency-tracking speeds up one-time build
1566 --enable-dependency-tracking do not reject slow dependency extractors])
1567 if test "x$enable_dependency_tracking" != xno; then
1568 am_depcomp="$ac_aux_dir/depcomp"
1571 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1572 AC_SUBST([AMDEPBACKSLASH])dnl
1573 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1576 # Generate code to set up dependency tracking. -*- Autoconf -*-
1578 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1579 # Free Software Foundation, Inc.
1581 # This file is free software; the Free Software Foundation
1582 # gives unlimited permission to copy and/or distribute it,
1583 # with or without modifications, as long as this notice is preserved.
1587 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1588 # ------------------------------
1589 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1591 # Autoconf 2.62 quotes --file arguments for eval, but not when files
1592 # are listed without --file. Let's play safe and only enable the eval
1593 # if we detect the quoting.
1594 case $CONFIG_FILES in
1595 *\'*) eval set x "$CONFIG_FILES" ;;
1596 *) set x $CONFIG_FILES ;;
1601 # Strip MF so we end up with the name of the file.
1602 mf=`echo "$mf" | sed -e 's/:.*$//'`
1603 # Check whether this is an Automake generated Makefile or not.
1604 # We used to match only the files named `Makefile.in', but
1605 # some people rename them; so instead we look at the file content.
1606 # Grep'ing the first line is not enough: some people post-process
1607 # each Makefile.in and add a new line on top of each file to say so.
1608 # Grep'ing the whole file is not good either: AIX grep has a line
1609 # limit of 2048, but all sed's we know have understand at least 4000.
1610 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1611 dirpart=`AS_DIRNAME("$mf")`
1615 # Extract the definition of DEPDIR, am__include, and am__quote
1616 # from the Makefile without running `make'.
1617 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1618 test -z "$DEPDIR" && continue
1619 am__include=`sed -n 's/^am__include = //p' < "$mf"`
1620 test -z "am__include" && continue
1621 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1622 # When using ansi2knr, U may be empty or an underscore; expand it
1623 U=`sed -n 's/^U = //p' < "$mf"`
1624 # Find all dependency output files, they are included files with
1625 # $(DEPDIR) in their names. We invoke sed twice because it is the
1626 # simplest approach to changing $(DEPDIR) to its actual value in the
1628 for file in `sed -n "
1629 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1630 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1631 # Make sure the directory exists.
1632 test -f "$dirpart/$file" && continue
1633 fdir=`AS_DIRNAME(["$file"])`
1634 AS_MKDIR_P([$dirpart/$fdir])
1635 # echo "creating $dirpart/$file"
1636 echo '# dummy' > "$dirpart/$file"
1640 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1643 # AM_OUTPUT_DEPENDENCY_COMMANDS
1644 # -----------------------------
1645 # This macro should only be invoked once -- use via AC_REQUIRE.
1647 # This code is only required when automatic dependency tracking
1648 # is enabled. FIXME. This creates each `.P' file that we will
1649 # need in order to bootstrap the dependency handling code.
1650 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1651 [AC_CONFIG_COMMANDS([depfiles],
1652 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1653 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1656 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1657 # Free Software Foundation, Inc.
1659 # This file is free software; the Free Software Foundation
1660 # gives unlimited permission to copy and/or distribute it,
1661 # with or without modifications, as long as this notice is preserved.
1665 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
1666 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1668 # Do all the work for Automake. -*- Autoconf -*-
1670 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1671 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1673 # This file is free software; the Free Software Foundation
1674 # gives unlimited permission to copy and/or distribute it,
1675 # with or without modifications, as long as this notice is preserved.
1679 # This macro actually does too much. Some checks are only needed if
1680 # your package does certain things. But this isn't really a big deal.
1682 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1683 # AM_INIT_AUTOMAKE([OPTIONS])
1684 # -----------------------------------------------
1685 # The call with PACKAGE and VERSION arguments is the old style
1686 # call (pre autoconf-2.50), which is being phased out. PACKAGE
1687 # and VERSION should now be passed to AC_INIT and removed from
1688 # the call to AM_INIT_AUTOMAKE.
1689 # We support both call styles for the transition. After
1690 # the next Automake release, Autoconf can make the AC_INIT
1691 # arguments mandatory, and then we can depend on a new Autoconf
1692 # release and drop the old call support.
1693 AC_DEFUN([AM_INIT_AUTOMAKE],
1694 [AC_PREREQ([2.62])dnl
1695 dnl Autoconf wants to disallow AM_ names. We explicitly allow
1696 dnl the ones we care about.
1697 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1698 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1699 AC_REQUIRE([AC_PROG_INSTALL])dnl
1700 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1701 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1702 # is not polluted with repeated "-I."
1703 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1704 # test to see if srcdir already configured
1705 if test -f $srcdir/config.status; then
1706 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1710 # test whether we have cygpath
1711 if test -z "$CYGPATH_W"; then
1712 if (cygpath --version) >/dev/null 2>/dev/null; then
1713 CYGPATH_W='cygpath -w'
1718 AC_SUBST([CYGPATH_W])
1720 # Define the identity of the package.
1721 dnl Distinguish between old-style and new-style calls.
1723 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1724 AC_SUBST([PACKAGE], [$1])dnl
1725 AC_SUBST([VERSION], [$2])],
1726 [_AM_SET_OPTIONS([$1])dnl
1727 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1728 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1729 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1730 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1731 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1733 _AM_IF_OPTION([no-define],,
1734 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1735 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1737 # Some tools Automake needs.
1738 AC_REQUIRE([AM_SANITY_CHECK])dnl
1739 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1740 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1741 AM_MISSING_PROG(AUTOCONF, autoconf)
1742 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1743 AM_MISSING_PROG(AUTOHEADER, autoheader)
1744 AM_MISSING_PROG(MAKEINFO, makeinfo)
1745 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1746 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1747 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1748 # We need awk for the "check" target. The system "awk" is bad on
1750 AC_REQUIRE([AC_PROG_AWK])dnl
1751 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1752 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1753 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1754 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1755 [_AM_PROG_TAR([v7])])])
1756 _AM_IF_OPTION([no-dependencies],,
1757 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1758 [_AM_DEPENDENCIES(CC)],
1759 [define([AC_PROG_CC],
1760 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1761 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1762 [_AM_DEPENDENCIES(CXX)],
1763 [define([AC_PROG_CXX],
1764 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1765 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1766 [_AM_DEPENDENCIES(OBJC)],
1767 [define([AC_PROG_OBJC],
1768 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1770 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1771 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
1772 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
1773 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
1774 AC_CONFIG_COMMANDS_PRE(dnl
1775 [m4_provide_if([_AM_COMPILER_EXEEXT],
1776 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1779 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
1780 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1781 dnl mangled by Autoconf and run in a shell conditional statement.
1782 m4_define([_AC_COMPILER_EXEEXT],
1783 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1786 # When config.status generates a header, we must update the stamp-h file.
1787 # This file resides in the same directory as the config header
1788 # that is generated. The stamp files are numbered to have different names.
1790 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1791 # loop where config.status creates the headers, so we can generate
1792 # our stamp files there.
1793 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1794 [# Compute $1's index in $config_headers.
1797 for _am_header in $config_headers :; do
1799 $_am_arg | $_am_arg:* )
1802 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1805 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1807 # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
1809 # This file is free software; the Free Software Foundation
1810 # gives unlimited permission to copy and/or distribute it,
1811 # with or without modifications, as long as this notice is preserved.
1813 # AM_PROG_INSTALL_SH
1814 # ------------------
1815 # Define $install_sh.
1816 AC_DEFUN([AM_PROG_INSTALL_SH],
1817 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1818 if test x"${install_sh}" != xset; then
1821 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1823 install_sh="\${SHELL} $am_aux_dir/install-sh"
1826 AC_SUBST(install_sh)])
1828 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
1830 # This file is free software; the Free Software Foundation
1831 # gives unlimited permission to copy and/or distribute it,
1832 # with or without modifications, as long as this notice is preserved.
1836 # Check whether the underlying file-system supports filenames
1837 # with a leading dot. For instance MS-DOS doesn't.
1838 AC_DEFUN([AM_SET_LEADING_DOT],
1839 [rm -rf .tst 2>/dev/null
1840 mkdir .tst 2>/dev/null
1841 if test -d .tst; then
1846 rmdir .tst 2>/dev/null
1847 AC_SUBST([am__leading_dot])])
1849 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
1852 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1853 # Free Software Foundation, Inc.
1855 # This file is free software; the Free Software Foundation
1856 # gives unlimited permission to copy and/or distribute it,
1857 # with or without modifications, as long as this notice is preserved.
1861 # AM_MAINTAINER_MODE([DEFAULT-MODE])
1862 # ----------------------------------
1863 # Control maintainer-specific portions of Makefiles.
1864 # Default is to disable them, unless `enable' is passed literally.
1865 # For symmetry, `disable' may be passed as well. Anyway, the user
1866 # can override the default with the --enable/--disable switch.
1867 AC_DEFUN([AM_MAINTAINER_MODE],
1868 [m4_case(m4_default([$1], [disable]),
1869 [enable], [m4_define([am_maintainer_other], [disable])],
1870 [disable], [m4_define([am_maintainer_other], [enable])],
1871 [m4_define([am_maintainer_other], [enable])
1872 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
1873 AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
1874 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
1875 AC_ARG_ENABLE([maintainer-mode],
1876 [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
1877 (and sometimes confusing) to the casual installer],
1878 [USE_MAINTAINER_MODE=$enableval],
1879 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
1880 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
1881 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
1882 MAINT=$MAINTAINER_MODE_TRUE
1883 AC_SUBST([MAINT])dnl
1887 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
1889 # Check to see how 'make' treats includes. -*- Autoconf -*-
1891 # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
1893 # This file is free software; the Free Software Foundation
1894 # gives unlimited permission to copy and/or distribute it,
1895 # with or without modifications, as long as this notice is preserved.
1901 # Check to see how make treats includes.
1902 AC_DEFUN([AM_MAKE_INCLUDE],
1903 [am_make=${MAKE-make}
1904 cat > confinc << 'END'
1906 @echo this is the am__doit target
1909 # If we don't find an include directive, just comment out the code.
1910 AC_MSG_CHECKING([for style of include used by $am_make])
1914 # First try GNU make style include.
1915 echo "include confinc" > confmf
1916 # Ignore all kinds of additional output from `make'.
1917 case `$am_make -s -f confmf 2> /dev/null` in #(
1918 *the\ am__doit\ target*)
1924 # Now try BSD make style include.
1925 if test "$am__include" = "#"; then
1926 echo '.include "confinc"' > confmf
1927 case `$am_make -s -f confmf 2> /dev/null` in #(
1928 *the\ am__doit\ target*)
1929 am__include=.include
1935 AC_SUBST([am__include])
1936 AC_SUBST([am__quote])
1937 AC_MSG_RESULT([$_am_result])
1938 rm -f confinc confmf
1941 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
1943 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
1944 # Free Software Foundation, Inc.
1946 # This file is free software; the Free Software Foundation
1947 # gives unlimited permission to copy and/or distribute it,
1948 # with or without modifications, as long as this notice is preserved.
1952 # AM_MISSING_PROG(NAME, PROGRAM)
1953 # ------------------------------
1954 AC_DEFUN([AM_MISSING_PROG],
1955 [AC_REQUIRE([AM_MISSING_HAS_RUN])
1956 $1=${$1-"${am_missing_run}$2"}
1960 # AM_MISSING_HAS_RUN
1961 # ------------------
1962 # Define MISSING if not defined so far and test if it supports --run.
1963 # If it does, set am_missing_run to use it, otherwise, to nothing.
1964 AC_DEFUN([AM_MISSING_HAS_RUN],
1965 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1966 AC_REQUIRE_AUX_FILE([missing])dnl
1967 if test x"${MISSING+set}" != xset; then
1970 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1972 MISSING="\${SHELL} $am_aux_dir/missing" ;;
1975 # Use eval to expand $SHELL
1976 if eval "$MISSING --run true"; then
1977 am_missing_run="$MISSING --run "
1980 AC_MSG_WARN([`missing' script is too old or missing])
1984 # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
1986 # This file is free software; the Free Software Foundation
1987 # gives unlimited permission to copy and/or distribute it,
1988 # with or without modifications, as long as this notice is preserved.
1992 # Check for `mkdir -p'.
1993 AC_DEFUN([AM_PROG_MKDIR_P],
1994 [AC_PREREQ([2.60])dnl
1995 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1996 dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
1997 dnl while keeping a definition of mkdir_p for backward compatibility.
1998 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1999 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
2000 dnl Makefile.ins that do not define MKDIR_P, so we do our own
2001 dnl adjustment using top_builddir (which is defined more often than
2003 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
2005 [[\\/$]]* | ?:[[\\/]]*) ;;
2006 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2010 # Helper functions for option handling. -*- Autoconf -*-
2012 # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
2014 # This file is free software; the Free Software Foundation
2015 # gives unlimited permission to copy and/or distribute it,
2016 # with or without modifications, as long as this notice is preserved.
2020 # _AM_MANGLE_OPTION(NAME)
2021 # -----------------------
2022 AC_DEFUN([_AM_MANGLE_OPTION],
2023 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2025 # _AM_SET_OPTION(NAME)
2026 # ------------------------------
2027 # Set option NAME. Presently that only means defining a flag for this option.
2028 AC_DEFUN([_AM_SET_OPTION],
2029 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2031 # _AM_SET_OPTIONS(OPTIONS)
2032 # ----------------------------------
2033 # OPTIONS is a space-separated list of Automake options.
2034 AC_DEFUN([_AM_SET_OPTIONS],
2035 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2037 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2038 # -------------------------------------------
2039 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2040 AC_DEFUN([_AM_IF_OPTION],
2041 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2043 # Check to make sure that the build environment is sane. -*- Autoconf -*-
2045 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
2046 # Free Software Foundation, Inc.
2048 # This file is free software; the Free Software Foundation
2049 # gives unlimited permission to copy and/or distribute it,
2050 # with or without modifications, as long as this notice is preserved.
2056 AC_DEFUN([AM_SANITY_CHECK],
2057 [AC_MSG_CHECKING([whether build environment is sane])
2060 echo timestamp > conftest.file
2061 # Reject unsafe characters in $srcdir or the absolute working directory
2062 # name. Accept space and tab only in the latter.
2066 *[[\\\"\#\$\&\'\`$am_lf]]*)
2067 AC_MSG_ERROR([unsafe absolute working directory name]);;
2070 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
2071 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
2074 # Do `set' in a subshell so we don't clobber the current shell's
2075 # arguments. Must try -L first in case configure is actually a
2076 # symlink; some systems play weird games with the mod time of symlinks
2077 # (eg FreeBSD returns the mod time of the symlink's containing
2080 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2081 if test "$[*]" = "X"; then
2083 set X `ls -t "$srcdir/configure" conftest.file`
2086 if test "$[*]" != "X $srcdir/configure conftest.file" \
2087 && test "$[*]" != "X conftest.file $srcdir/configure"; then
2089 # If neither matched, then we have a broken ls. This can happen
2090 # if, for instance, CONFIG_SHELL is bash and it inherits a
2091 # broken ls alias from the environment. This has actually
2092 # happened. Such a system could not be considered "sane".
2093 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
2094 alias in your environment])
2097 test "$[2]" = conftest.file
2103 AC_MSG_ERROR([newly created file is older than distributed files!
2104 Check your system clock])
2106 AC_MSG_RESULT(yes)])
2108 # Copyright (C) 2009 Free Software Foundation, Inc.
2110 # This file is free software; the Free Software Foundation
2111 # gives unlimited permission to copy and/or distribute it,
2112 # with or without modifications, as long as this notice is preserved.
2116 # AM_SILENT_RULES([DEFAULT])
2117 # --------------------------
2118 # Enable less verbose build rules; with the default set to DEFAULT
2119 # (`yes' being less verbose, `no' or empty being verbose).
2120 AC_DEFUN([AM_SILENT_RULES],
2121 [AC_ARG_ENABLE([silent-rules],
2122 [ --enable-silent-rules less verbose build output (undo: `make V=1')
2123 --disable-silent-rules verbose build output (undo: `make V=0')])
2124 case $enable_silent_rules in
2125 yes) AM_DEFAULT_VERBOSITY=0;;
2126 no) AM_DEFAULT_VERBOSITY=1;;
2127 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
2129 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
2131 AC_SUBST([AM_BACKSLASH])dnl
2132 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
2135 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
2137 # This file is free software; the Free Software Foundation
2138 # gives unlimited permission to copy and/or distribute it,
2139 # with or without modifications, as long as this notice is preserved.
2141 # AM_PROG_INSTALL_STRIP
2142 # ---------------------
2143 # One issue with vendor `install' (even GNU) is that you can't
2144 # specify the program used to strip binaries. This is especially
2145 # annoying in cross-compiling environments, where the build's strip
2146 # is unlikely to handle the host's binaries.
2147 # Fortunately install-sh will honor a STRIPPROG variable, so we
2148 # always use install-sh in `make install-strip', and initialize
2149 # STRIPPROG with the value of the STRIP variable (set by the user).
2150 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2151 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2152 # Installed binaries are usually stripped using `strip' when the user
2153 # run `make install-strip'. However `strip' might not be the right
2154 # tool to use in cross-compilation environments, therefore Automake
2155 # will honor the `STRIP' environment variable to overrule this program.
2156 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2157 if test "$cross_compiling" != no; then
2158 AC_CHECK_TOOL([STRIP], [strip], :)
2160 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2161 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2163 # Copyright (C) 2006, 2008 Free Software Foundation, Inc.
2165 # This file is free software; the Free Software Foundation
2166 # gives unlimited permission to copy and/or distribute it,
2167 # with or without modifications, as long as this notice is preserved.
2171 # _AM_SUBST_NOTMAKE(VARIABLE)
2172 # ---------------------------
2173 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2174 # This macro is traced by Automake.
2175 AC_DEFUN([_AM_SUBST_NOTMAKE])
2177 # AM_SUBST_NOTMAKE(VARIABLE)
2178 # ---------------------------
2179 # Public sister of _AM_SUBST_NOTMAKE.
2180 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2182 # Check how to create a tarball. -*- Autoconf -*-
2184 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
2186 # This file is free software; the Free Software Foundation
2187 # gives unlimited permission to copy and/or distribute it,
2188 # with or without modifications, as long as this notice is preserved.
2192 # _AM_PROG_TAR(FORMAT)
2193 # --------------------
2194 # Check how to create a tarball in format FORMAT.
2195 # FORMAT should be one of `v7', `ustar', or `pax'.
2197 # Substitute a variable $(am__tar) that is a command
2198 # writing to stdout a FORMAT-tarball containing the directory
2200 # tardir=directory && $(am__tar) > result.tar
2202 # Substitute a variable $(am__untar) that extract such
2203 # a tarball read from stdin.
2204 # $(am__untar) < result.tar
2205 AC_DEFUN([_AM_PROG_TAR],
2206 [# Always define AMTAR for backward compatibility.
2207 AM_MISSING_PROG([AMTAR], [tar])
2209 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
2210 [m4_case([$1], [ustar],, [pax],,
2211 [m4_fatal([Unknown tar format])])
2212 AC_MSG_CHECKING([how to create a $1 tar archive])
2213 # Loop over all known methods to create a tar archive until one works.
2214 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2215 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2216 # Do not fold the above two line into one, because Tru64 sh and
2217 # Solaris sh will not grok spaces in the rhs of `-'.
2218 for _am_tool in $_am_tools
2222 for _am_tar in tar gnutar gtar;
2224 AM_RUN_LOG([$_am_tar --version]) && break
2226 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2227 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2228 am__untar="$_am_tar -xf -"
2231 # Must skip GNU tar: if it does not support --format= it doesn't create
2232 # ustar tarball either.
2233 (tar --version) >/dev/null 2>&1 && continue
2234 am__tar='tar chf - "$$tardir"'
2235 am__tar_='tar chf - "$tardir"'
2236 am__untar='tar xf -'
2239 am__tar='pax -L -x $1 -w "$$tardir"'
2240 am__tar_='pax -L -x $1 -w "$tardir"'
2244 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2245 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2246 am__untar='cpio -i -H $1 -d'
2255 # If the value was cached, stop now. We just wanted to have am__tar
2256 # and am__untar set.
2257 test -n "${am_cv_prog_tar_$1}" && break
2259 # tar/untar a dummy directory, and stop if the command works
2262 echo GrepMe > conftest.dir/file
2263 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2265 if test -s conftest.tar; then
2266 AM_RUN_LOG([$am__untar <conftest.tar])
2267 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2272 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2273 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2275 AC_SUBST([am__untar])