1 # generated automatically by aclocal 1.15 -*- Autoconf -*-
3 # Copyright (C) 1996-2014 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_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15 m4_ifndef([AC_AUTOCONF_VERSION],
16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18 [m4_warning([this file was generated for autoconf 2.69.
19 You have another version of autoconf. It may work, but is not guaranteed to.
20 If you have problems, you may need to regenerate the build system entirely.
21 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
23 dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
24 dnl serial 11 (pkg-config-0.29)
26 dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
27 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
29 dnl This program is free software; you can redistribute it and/or modify
30 dnl it under the terms of the GNU General Public License as published by
31 dnl the Free Software Foundation; either version 2 of the License, or
32 dnl (at your option) any later version.
34 dnl This program is distributed in the hope that it will be useful, but
35 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
36 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37 dnl General Public License for more details.
39 dnl You should have received a copy of the GNU General Public License
40 dnl along with this program; if not, write to the Free Software
41 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
44 dnl As a special exception to the GNU General Public License, if you
45 dnl distribute this file as part of a program that contains a
46 dnl configuration script generated by Autoconf, you may include it under
47 dnl the same distribution terms that you use for the rest of that
50 dnl PKG_PREREQ(MIN-VERSION)
51 dnl -----------------------
54 dnl Verify that the version of the pkg-config macros are at least
55 dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
56 dnl installed version of pkg-config, this checks the developer's version
57 dnl of pkg.m4 when generating configure.
59 dnl To ensure that this macro is defined, also add:
60 dnl m4_ifndef([PKG_PREREQ],
61 dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
63 dnl See the "Since" comment for each macro you use to see what version
64 dnl of the macros you require.
65 m4_defun([PKG_PREREQ],
66 [m4_define([PKG_MACROS_VERSION], [0.29])
67 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
68 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
71 dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
72 dnl ----------------------------------
75 dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
76 dnl first found in the path. Checks that the version of pkg-config found
77 dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
78 dnl used since that's the first version where most current features of
79 dnl pkg-config existed.
80 AC_DEFUN([PKG_PROG_PKG_CONFIG],
81 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
82 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
83 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
84 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
85 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
86 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
88 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
89 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
91 if test -n "$PKG_CONFIG"; then
92 _pkg_min_version=m4_default([$1], [0.9.0])
93 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
94 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
101 ])dnl PKG_PROG_PKG_CONFIG
103 dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
104 dnl -------------------------------------------------------------------
107 dnl Check to see whether a particular set of modules exists. Similar to
108 dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
110 dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
111 dnl only at the first occurence in configure.ac, so if the first place
112 dnl it's called might be skipped (such as if it is within an "if", you
113 dnl have to call PKG_CHECK_EXISTS manually
114 AC_DEFUN([PKG_CHECK_EXISTS],
115 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
116 if test -n "$PKG_CONFIG" && \
117 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
118 m4_default([$2], [:])
119 m4_ifvaln([$3], [else
123 dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
124 dnl ---------------------------------------------
125 dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
126 dnl pkg_failed based on the result.
127 m4_define([_PKG_CONFIG],
128 [if test -n "$$1"; then
130 elif test -n "$PKG_CONFIG"; then
131 PKG_CHECK_EXISTS([$3],
132 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
133 test "x$?" != "x0" && pkg_failed=yes ],
140 dnl _PKG_SHORT_ERRORS_SUPPORTED
141 dnl ---------------------------
142 dnl Internal check to see if pkg-config supports short errors.
143 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
144 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
145 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
146 _pkg_short_errors_supported=yes
148 _pkg_short_errors_supported=no
150 ])dnl _PKG_SHORT_ERRORS_SUPPORTED
153 dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
154 dnl [ACTION-IF-NOT-FOUND])
155 dnl --------------------------------------------------------------
158 dnl Note that if there is a possibility the first call to
159 dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
160 dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
161 AC_DEFUN([PKG_CHECK_MODULES],
162 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
163 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
164 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
167 AC_MSG_CHECKING([for $1])
169 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
170 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
172 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
173 and $1[]_LIBS to avoid the need to call pkg-config.
174 See the pkg-config man page for more details.])
176 if test $pkg_failed = yes; then
178 _PKG_SHORT_ERRORS_SUPPORTED
179 if test $_pkg_short_errors_supported = yes; then
180 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
182 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
184 # Put the nasty error message in config.log where it belongs
185 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
187 m4_default([$4], [AC_MSG_ERROR(
188 [Package requirements ($2) were not met:
192 Consider adjusting the PKG_CONFIG_PATH environment variable if you
193 installed software in a non-standard prefix.
197 elif test $pkg_failed = untried; then
199 m4_default([$4], [AC_MSG_FAILURE(
200 [The pkg-config script could not be found or is too old. Make sure it
201 is in your PATH or set the PKG_CONFIG environment variable to the full
206 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
209 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
210 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
214 ])dnl PKG_CHECK_MODULES
217 dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
218 dnl [ACTION-IF-NOT-FOUND])
219 dnl ---------------------------------------------------------------------
222 dnl Checks for existence of MODULES and gathers its build flags with
223 dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
224 dnl and VARIABLE-PREFIX_LIBS from --libs.
226 dnl Note that if there is a possibility the first call to
227 dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
228 dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
230 AC_DEFUN([PKG_CHECK_MODULES_STATIC],
231 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
232 _save_PKG_CONFIG=$PKG_CONFIG
233 PKG_CONFIG="$PKG_CONFIG --static"
234 PKG_CHECK_MODULES($@)
235 PKG_CONFIG=$_save_PKG_CONFIG[]dnl
236 ])dnl PKG_CHECK_MODULES_STATIC
239 dnl PKG_INSTALLDIR([DIRECTORY])
240 dnl -------------------------
243 dnl Substitutes the variable pkgconfigdir as the location where a module
244 dnl should install pkg-config .pc files. By default the directory is
245 dnl $libdir/pkgconfig, but the default can be changed by passing
246 dnl DIRECTORY. The user can override through the --with-pkgconfigdir
248 AC_DEFUN([PKG_INSTALLDIR],
249 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
250 m4_pushdef([pkg_description],
251 [pkg-config installation directory @<:@]pkg_default[@:>@])
252 AC_ARG_WITH([pkgconfigdir],
253 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
254 [with_pkgconfigdir=]pkg_default)
255 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
256 m4_popdef([pkg_default])
257 m4_popdef([pkg_description])
261 dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
262 dnl --------------------------------
265 dnl Substitutes the variable noarch_pkgconfigdir as the location where a
266 dnl module should install arch-independent pkg-config .pc files. By
267 dnl default the directory is $datadir/pkgconfig, but the default can be
268 dnl changed by passing DIRECTORY. The user can override through the
269 dnl --with-noarch-pkgconfigdir parameter.
270 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
271 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
272 m4_pushdef([pkg_description],
273 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
274 AC_ARG_WITH([noarch-pkgconfigdir],
275 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
276 [with_noarch_pkgconfigdir=]pkg_default)
277 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
278 m4_popdef([pkg_default])
279 m4_popdef([pkg_description])
280 ])dnl PKG_NOARCH_INSTALLDIR
283 dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
284 dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
285 dnl -------------------------------------------
288 dnl Retrieves the value of the pkg-config variable for the given module.
289 AC_DEFUN([PKG_CHECK_VAR],
290 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
291 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
293 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
294 AS_VAR_COPY([$1], [pkg_cv_][$1])
296 AS_VAR_IF([$1], [""], [$5], [$4])dnl
299 dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
301 dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
303 dnl Permission is hereby granted, free of charge, to any person obtaining a
304 dnl copy of this software and associated documentation files (the "Software"),
305 dnl to deal in the Software without restriction, including without limitation
306 dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
307 dnl and/or sell copies of the Software, and to permit persons to whom the
308 dnl Software is furnished to do so, subject to the following conditions:
310 dnl The above copyright notice and this permission notice (including the next
311 dnl paragraph) shall be included in all copies or substantial portions of the
314 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
315 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
316 dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
317 dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
318 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
319 dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
320 dnl DEALINGS IN THE SOFTWARE.
322 # XORG_MACROS_VERSION(required-version)
323 # -------------------------------------
324 # Minimum version: 1.1.0
326 # If you're using a macro added in Version 1.1 or newer, include this in
327 # your configure.ac with the minimum required version, such as:
328 # XORG_MACROS_VERSION(1.1)
330 # To ensure that this macro is defined, also add:
331 # m4_ifndef([XORG_MACROS_VERSION],
332 # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
335 # See the "minimum version" comment for each macro you use to see what
336 # version you require.
337 m4_defun([XORG_MACROS_VERSION],[
338 m4_define([vers_have], [1.19.0])
339 m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
340 m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
341 m4_if(m4_cmp(maj_have, maj_needed), 0,,
342 [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
343 m4_if(m4_version_compare(vers_have, [$1]), -1,
344 [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
345 m4_undefine([vers_have])
346 m4_undefine([maj_have])
347 m4_undefine([maj_needed])
348 ]) # XORG_MACROS_VERSION
352 # Minimum version: 1.0.0
354 # Find cpp program and necessary flags for use in pre-processing text files
355 # such as man pages and config files
356 AC_DEFUN([XORG_PROG_RAWCPP],[
357 AC_REQUIRE([AC_PROG_CPP])
358 AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
359 [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
361 # Check for flag to avoid builtin definitions - assumes unix is predefined,
362 # which is not the best choice for supporting other OS'es, but covers most
363 # of the ones we need for now.
364 AC_MSG_CHECKING([if $RAWCPP requires -undef])
365 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
366 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
369 if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
372 # under Cygwin unix is still defined even with -undef
373 elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
374 RAWCPPFLAGS="-undef -ansi"
375 AC_MSG_RESULT([yes, with -ansi])
377 AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
380 rm -f conftest.$ac_ext
382 AC_MSG_CHECKING([if $RAWCPP requires -traditional])
383 AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
384 if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
387 if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
388 TRADITIONALCPPFLAGS="-traditional"
389 RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
392 AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
395 rm -f conftest.$ac_ext
396 AC_SUBST(RAWCPPFLAGS)
397 AC_SUBST(TRADITIONALCPPFLAGS)
398 ]) # XORG_PROG_RAWCPP
400 # XORG_MANPAGE_SECTIONS()
401 # -----------------------
402 # Minimum version: 1.0.0
404 # Determine which sections man pages go in for the different man page types
405 # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
406 # Not sure if there's any better way than just hardcoding by OS name.
407 # Override default settings by setting environment variables
408 # Added MAN_SUBSTS in version 1.8
409 # Added AC_PROG_SED in version 1.8
411 AC_DEFUN([XORG_MANPAGE_SECTIONS],[
412 AC_REQUIRE([AC_CANONICAL_HOST])
413 AC_REQUIRE([AC_PROG_SED])
415 if test x$APP_MAN_SUFFIX = x ; then
418 if test x$APP_MAN_DIR = x ; then
419 APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
422 if test x$LIB_MAN_SUFFIX = x ; then
425 if test x$LIB_MAN_DIR = x ; then
426 LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
429 if test x$FILE_MAN_SUFFIX = x ; then
431 solaris*) FILE_MAN_SUFFIX=4 ;;
432 *) FILE_MAN_SUFFIX=5 ;;
435 if test x$FILE_MAN_DIR = x ; then
436 FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
439 if test x$MISC_MAN_SUFFIX = x ; then
441 solaris*) MISC_MAN_SUFFIX=5 ;;
442 *) MISC_MAN_SUFFIX=7 ;;
445 if test x$MISC_MAN_DIR = x ; then
446 MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
449 if test x$DRIVER_MAN_SUFFIX = x ; then
451 solaris*) DRIVER_MAN_SUFFIX=7 ;;
452 *) DRIVER_MAN_SUFFIX=4 ;;
455 if test x$DRIVER_MAN_DIR = x ; then
456 DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
459 if test x$ADMIN_MAN_SUFFIX = x ; then
461 solaris*) ADMIN_MAN_SUFFIX=1m ;;
462 *) ADMIN_MAN_SUFFIX=8 ;;
465 if test x$ADMIN_MAN_DIR = x ; then
466 ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
470 AC_SUBST([APP_MAN_SUFFIX])
471 AC_SUBST([LIB_MAN_SUFFIX])
472 AC_SUBST([FILE_MAN_SUFFIX])
473 AC_SUBST([MISC_MAN_SUFFIX])
474 AC_SUBST([DRIVER_MAN_SUFFIX])
475 AC_SUBST([ADMIN_MAN_SUFFIX])
476 AC_SUBST([APP_MAN_DIR])
477 AC_SUBST([LIB_MAN_DIR])
478 AC_SUBST([FILE_MAN_DIR])
479 AC_SUBST([MISC_MAN_DIR])
480 AC_SUBST([DRIVER_MAN_DIR])
481 AC_SUBST([ADMIN_MAN_DIR])
483 XORG_MAN_PAGE="X Version 11"
484 AC_SUBST([XORG_MAN_PAGE])
486 -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
487 -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
488 -e 's|__xservername__|Xorg|g' \
489 -e 's|__xconfigfile__|xorg.conf|g' \
490 -e 's|__projectroot__|\$(prefix)|g' \
491 -e 's|__apploaddir__|\$(appdefaultdir)|g' \
492 -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
493 -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
494 -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
495 -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
496 -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
497 -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
498 AC_SUBST([MAN_SUBSTS])
500 ]) # XORG_MANPAGE_SECTIONS
502 # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
503 # ------------------------
504 # Minimum version: 1.7.0
506 # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
507 # provided by xorg-sgml-doctools, if installed.
508 AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
509 AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
511 PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
512 [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
514 [if test x"$cross_compiling" != x"yes" ; then
515 AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
516 [XORG_SGML_PATH=$prefix/share/sgml])
520 # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
521 # the path and the name of the doc stylesheet
522 if test "x$XORG_SGML_PATH" != "x" ; then
523 AC_MSG_RESULT([$XORG_SGML_PATH])
524 STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
525 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
530 AC_SUBST(XORG_SGML_PATH)
531 AC_SUBST(STYLESHEET_SRCDIR)
532 AC_SUBST(XSL_STYLESHEET)
533 AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
534 ]) # XORG_CHECK_SGML_DOCTOOLS
536 # XORG_CHECK_LINUXDOC
537 # -------------------
538 # Minimum version: 1.0.0
540 # Defines the variable MAKE_TEXT if the necessary tools and
541 # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
542 # Whether or not the necessary tools and files are found can be checked
543 # with the AM_CONDITIONAL "BUILD_LINUXDOC"
544 AC_DEFUN([XORG_CHECK_LINUXDOC],[
545 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
546 AC_REQUIRE([XORG_WITH_PS2PDF])
548 AC_PATH_PROG(LINUXDOC, linuxdoc)
550 AC_MSG_CHECKING([whether to build documentation])
552 if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
558 AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
560 AC_MSG_RESULT([$BUILDDOC])
562 AC_MSG_CHECKING([whether to build pdf documentation])
564 if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
570 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
572 AC_MSG_RESULT([$BUILDPDFDOC])
574 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
575 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
577 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
583 ]) # XORG_CHECK_LINUXDOC
586 # -------------------
587 # Minimum version: 1.0.0
589 # Checks for the ability to build output formats from SGML DocBook source.
590 # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
591 # indicates whether the necessary tools and files are found and, if set,
592 # $(MAKE_XXX) blah.sgml will produce blah.xxx.
593 AC_DEFUN([XORG_CHECK_DOCBOOK],[
594 AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
601 AC_PATH_PROG(DOCBOOKPS, docbook2ps)
602 AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
603 AC_PATH_PROG(DOCBOOKHTML, docbook2html)
604 AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
606 AC_MSG_CHECKING([whether to build text documentation])
607 if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
608 test x$BUILD_TXTDOC != xno; then
611 AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
612 AC_MSG_RESULT([$BUILDTXTDOC])
614 AC_MSG_CHECKING([whether to build PDF documentation])
615 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
616 test x$BUILD_PDFDOC != xno; then
619 AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
620 AC_MSG_RESULT([$BUILDPDFDOC])
622 AC_MSG_CHECKING([whether to build PostScript documentation])
623 if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
624 test x$BUILD_PSDOC != xno; then
627 AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
628 AC_MSG_RESULT([$BUILDPSDOC])
630 AC_MSG_CHECKING([whether to build HTML documentation])
631 if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
632 test x$BUILD_HTMLDOC != xno; then
635 AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
636 AC_MSG_RESULT([$BUILDHTMLDOC])
638 MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
639 MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
640 MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
641 MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
647 ]) # XORG_CHECK_DOCBOOK
649 # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
651 # Minimum version: 1.5.0
652 # Minimum version for optional DEFAULT argument: 1.11.0
654 # Documentation tools are not always available on all platforms and sometimes
655 # not at the appropriate level. This macro enables a module to test for the
656 # presence of the tool and obtain it's path in separate variables. Coupled with
657 # the --with-xmlto option, it allows maximum flexibilty in making decisions
658 # as whether or not to use the xmlto package. When DEFAULT is not specified,
659 # --with-xmlto assumes 'auto'.
661 # Interface to module:
662 # HAVE_XMLTO: used in makefiles to conditionally generate documentation
663 # XMLTO: returns the path of the xmlto program found
664 # returns the path set by the user in the environment
665 # --with-xmlto: 'yes' user instructs the module to use xmlto
666 # 'no' user instructs the module not to use xmlto
668 # Added in version 1.10.0
669 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
670 # xmlto for text output requires either lynx, links, or w3m browsers
672 # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
674 AC_DEFUN([XORG_WITH_XMLTO],[
675 AC_ARG_VAR([XMLTO], [Path to xmlto command])
676 m4_define([_defopt], m4_default([$2], [auto]))
678 AS_HELP_STRING([--with-xmlto],
679 [Use xmlto to regenerate documentation (default: ]_defopt[)]),
680 [use_xmlto=$withval], [use_xmlto=]_defopt)
681 m4_undefine([_defopt])
683 if test "x$use_xmlto" = x"auto"; then
684 AC_PATH_PROG([XMLTO], [xmlto])
685 if test "x$XMLTO" = "x"; then
686 AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
691 elif test "x$use_xmlto" = x"yes" ; then
692 AC_PATH_PROG([XMLTO], [xmlto])
693 if test "x$XMLTO" = "x"; then
694 AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
697 elif test "x$use_xmlto" = x"no" ; then
698 if test "x$XMLTO" != "x"; then
699 AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
703 AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
706 # Test for a minimum version of xmlto, if provided.
708 [if test "$have_xmlto" = yes; then
709 # scrape the xmlto version
710 AC_MSG_CHECKING([the xmlto version])
711 xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
712 AC_MSG_RESULT([$xmlto_version])
713 AS_VERSION_COMPARE([$xmlto_version], [$1],
714 [if test "x$use_xmlto" = xauto; then
715 AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
718 AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
722 # Test for the ability of xmlto to generate a text target
724 # NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
725 # following test for empty XML docbook files.
726 # For compatibility reasons use the following empty XML docbook file and if
727 # it fails try it again with a non-empty XML file.
729 cat > conftest.xml << "EOF"
731 AS_IF([test "$have_xmlto" = yes],
732 [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
733 [have_xmlto_text=yes],
734 [# Try it again with a non-empty XML file.
735 cat > conftest.xml << "EOF"
738 AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
739 [have_xmlto_text=yes],
740 [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
742 AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
743 AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
746 # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
747 # --------------------------------------------
748 # Minimum version: 1.12.0
749 # Minimum version for optional DEFAULT argument: 1.12.0
751 # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
752 # XML-based language used for the transformation of XML documents.
753 # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
754 # It is used under the cover by xmlto to generate html files from DocBook/XML.
755 # The XSLT processor is often used as a standalone tool for transformations.
756 # It should not be assumed that this tool is used only to work with documnetation.
757 # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
759 # Interface to module:
760 # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
761 # XSLTPROC: returns the path of the xsltproc program found
762 # returns the path set by the user in the environment
763 # --with-xsltproc: 'yes' user instructs the module to use xsltproc
764 # 'no' user instructs the module not to use xsltproc
765 # have_xsltproc: returns yes if xsltproc found in PATH or no
767 # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
769 AC_DEFUN([XORG_WITH_XSLTPROC],[
770 AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
771 # Preserves the interface, should it be implemented later
772 m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
773 m4_define([_defopt], m4_default([$2], [auto]))
774 AC_ARG_WITH(xsltproc,
775 AS_HELP_STRING([--with-xsltproc],
776 [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
777 [use_xsltproc=$withval], [use_xsltproc=]_defopt)
778 m4_undefine([_defopt])
780 if test "x$use_xsltproc" = x"auto"; then
781 AC_PATH_PROG([XSLTPROC], [xsltproc])
782 if test "x$XSLTPROC" = "x"; then
783 AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
788 elif test "x$use_xsltproc" = x"yes" ; then
789 AC_PATH_PROG([XSLTPROC], [xsltproc])
790 if test "x$XSLTPROC" = "x"; then
791 AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
794 elif test "x$use_xsltproc" = x"no" ; then
795 if test "x$XSLTPROC" != "x"; then
796 AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
800 AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
803 AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
804 ]) # XORG_WITH_XSLTPROC
806 # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
807 # ----------------------------------------
808 # Minimum version: 1.15.0
810 # PERL (Practical Extraction and Report Language) is a language optimized for
811 # scanning arbitrary text files, extracting information from those text files,
812 # and printing reports based on that information.
814 # When DEFAULT is not specified, --with-perl assumes 'auto'.
816 # Interface to module:
817 # HAVE_PERL: used in makefiles to conditionally scan text files
818 # PERL: returns the path of the perl program found
819 # returns the path set by the user in the environment
820 # --with-perl: 'yes' user instructs the module to use perl
821 # 'no' user instructs the module not to use perl
822 # have_perl: returns yes if perl found in PATH or no
824 # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
826 AC_DEFUN([XORG_WITH_PERL],[
827 AC_ARG_VAR([PERL], [Path to perl command])
828 # Preserves the interface, should it be implemented later
829 m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
830 m4_define([_defopt], m4_default([$2], [auto]))
832 AS_HELP_STRING([--with-perl],
833 [Use perl for extracting information from files (default: ]_defopt[)]),
834 [use_perl=$withval], [use_perl=]_defopt)
835 m4_undefine([_defopt])
837 if test "x$use_perl" = x"auto"; then
838 AC_PATH_PROG([PERL], [perl])
839 if test "x$PERL" = "x"; then
840 AC_MSG_WARN([perl not found - cannot extract information and report])
845 elif test "x$use_perl" = x"yes" ; then
846 AC_PATH_PROG([PERL], [perl])
847 if test "x$PERL" = "x"; then
848 AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
851 elif test "x$use_perl" = x"no" ; then
852 if test "x$PERL" != "x"; then
853 AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
857 AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
860 AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
863 # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
865 # Minimum version: 1.5.0
866 # Minimum version for optional DEFAULT argument: 1.11.0
868 # Documentation tools are not always available on all platforms and sometimes
869 # not at the appropriate level. This macro enables a module to test for the
870 # presence of the tool and obtain it's path in separate variables. Coupled with
871 # the --with-asciidoc option, it allows maximum flexibilty in making decisions
872 # as whether or not to use the asciidoc package. When DEFAULT is not specified,
873 # --with-asciidoc assumes 'auto'.
875 # Interface to module:
876 # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
877 # ASCIIDOC: returns the path of the asciidoc program found
878 # returns the path set by the user in the environment
879 # --with-asciidoc: 'yes' user instructs the module to use asciidoc
880 # 'no' user instructs the module not to use asciidoc
882 # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
884 AC_DEFUN([XORG_WITH_ASCIIDOC],[
885 AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
886 m4_define([_defopt], m4_default([$2], [auto]))
887 AC_ARG_WITH(asciidoc,
888 AS_HELP_STRING([--with-asciidoc],
889 [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
890 [use_asciidoc=$withval], [use_asciidoc=]_defopt)
891 m4_undefine([_defopt])
893 if test "x$use_asciidoc" = x"auto"; then
894 AC_PATH_PROG([ASCIIDOC], [asciidoc])
895 if test "x$ASCIIDOC" = "x"; then
896 AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
901 elif test "x$use_asciidoc" = x"yes" ; then
902 AC_PATH_PROG([ASCIIDOC], [asciidoc])
903 if test "x$ASCIIDOC" = "x"; then
904 AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
907 elif test "x$use_asciidoc" = x"no" ; then
908 if test "x$ASCIIDOC" != "x"; then
909 AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
913 AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
916 [if test "$have_asciidoc" = yes; then
917 # scrape the asciidoc version
918 AC_MSG_CHECKING([the asciidoc version])
919 asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
920 AC_MSG_RESULT([$asciidoc_version])
921 AS_VERSION_COMPARE([$asciidoc_version], [$1],
922 [if test "x$use_asciidoc" = xauto; then
923 AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
926 AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
929 AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
930 ]) # XORG_WITH_ASCIIDOC
932 # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
933 # -------------------------------------------
934 # Minimum version: 1.5.0
935 # Minimum version for optional DEFAULT argument: 1.11.0
936 # Minimum version for optional DOT checking: 1.18.0
938 # Documentation tools are not always available on all platforms and sometimes
939 # not at the appropriate level. This macro enables a module to test for the
940 # presence of the tool and obtain it's path in separate variables. Coupled with
941 # the --with-doxygen option, it allows maximum flexibilty in making decisions
942 # as whether or not to use the doxygen package. When DEFAULT is not specified,
943 # --with-doxygen assumes 'auto'.
945 # Interface to module:
946 # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
947 # DOXYGEN: returns the path of the doxygen program found
948 # returns the path set by the user in the environment
949 # --with-doxygen: 'yes' user instructs the module to use doxygen
950 # 'no' user instructs the module not to use doxygen
952 # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
954 AC_DEFUN([XORG_WITH_DOXYGEN],[
955 AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
956 AC_ARG_VAR([DOT], [Path to the dot graphics utility])
957 m4_define([_defopt], m4_default([$2], [auto]))
959 AS_HELP_STRING([--with-doxygen],
960 [Use doxygen to regenerate documentation (default: ]_defopt[)]),
961 [use_doxygen=$withval], [use_doxygen=]_defopt)
962 m4_undefine([_defopt])
964 if test "x$use_doxygen" = x"auto"; then
965 AC_PATH_PROG([DOXYGEN], [doxygen])
966 if test "x$DOXYGEN" = "x"; then
967 AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
972 elif test "x$use_doxygen" = x"yes" ; then
973 AC_PATH_PROG([DOXYGEN], [doxygen])
974 if test "x$DOXYGEN" = "x"; then
975 AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
978 elif test "x$use_doxygen" = x"no" ; then
979 if test "x$DOXYGEN" != "x"; then
980 AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
984 AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
987 [if test "$have_doxygen" = yes; then
988 # scrape the doxygen version
989 AC_MSG_CHECKING([the doxygen version])
990 doxygen_version=`$DOXYGEN --version 2>/dev/null`
991 AC_MSG_RESULT([$doxygen_version])
992 AS_VERSION_COMPARE([$doxygen_version], [$1],
993 [if test "x$use_doxygen" = xauto; then
994 AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
997 AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1001 dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
1002 dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
1003 dnl HAVE_DOT = @HAVE_DOT@
1005 if test "x$have_doxygen" = "xyes"; then
1006 AC_PATH_PROG([DOT], [dot])
1007 if test "x$DOT" != "x"; then
1012 AC_SUBST([HAVE_DOT])
1013 AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
1014 AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1015 ]) # XORG_WITH_DOXYGEN
1017 # XORG_WITH_GROFF([DEFAULT])
1019 # Minimum version: 1.6.0
1020 # Minimum version for optional DEFAULT argument: 1.11.0
1022 # Documentation tools are not always available on all platforms and sometimes
1023 # not at the appropriate level. This macro enables a module to test for the
1024 # presence of the tool and obtain it's path in separate variables. Coupled with
1025 # the --with-groff option, it allows maximum flexibilty in making decisions
1026 # as whether or not to use the groff package. When DEFAULT is not specified,
1027 # --with-groff assumes 'auto'.
1029 # Interface to module:
1030 # HAVE_GROFF: used in makefiles to conditionally generate documentation
1031 # HAVE_GROFF_MM: the memorandum macros (-mm) package
1032 # HAVE_GROFF_MS: the -ms macros package
1033 # GROFF: returns the path of the groff program found
1034 # returns the path set by the user in the environment
1035 # --with-groff: 'yes' user instructs the module to use groff
1036 # 'no' user instructs the module not to use groff
1038 # Added in version 1.9.0:
1039 # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1040 # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1041 # psselect from the psutils package.
1042 # the ghostcript package. Refer to the grohtml man pages
1044 # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1046 # OS and distros often splits groff in a basic and full package, the former
1047 # having the groff program and the later having devices, fonts and macros
1048 # Checking for the groff executable is not enough.
1050 # If macros are missing, we cannot assume that groff is useless, so we don't
1051 # unset HAVE_GROFF or GROFF env variables.
1052 # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1054 AC_DEFUN([XORG_WITH_GROFF],[
1055 AC_ARG_VAR([GROFF], [Path to groff command])
1056 m4_define([_defopt], m4_default([$1], [auto]))
1058 AS_HELP_STRING([--with-groff],
1059 [Use groff to regenerate documentation (default: ]_defopt[)]),
1060 [use_groff=$withval], [use_groff=]_defopt)
1061 m4_undefine([_defopt])
1063 if test "x$use_groff" = x"auto"; then
1064 AC_PATH_PROG([GROFF], [groff])
1065 if test "x$GROFF" = "x"; then
1066 AC_MSG_WARN([groff not found - documentation targets will be skipped])
1071 elif test "x$use_groff" = x"yes" ; then
1072 AC_PATH_PROG([GROFF], [groff])
1073 if test "x$GROFF" = "x"; then
1074 AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1077 elif test "x$use_groff" = x"no" ; then
1078 if test "x$GROFF" != "x"; then
1079 AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1083 AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1086 # We have groff, test for the presence of the macro packages
1087 if test "x$have_groff" = x"yes"; then
1088 AC_MSG_CHECKING([for ${GROFF} -ms macros])
1089 if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1094 AC_MSG_RESULT([$groff_ms_works])
1095 AC_MSG_CHECKING([for ${GROFF} -mm macros])
1096 if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1101 AC_MSG_RESULT([$groff_mm_works])
1104 # We have groff, test for HTML dependencies, one command per package
1105 if test "x$have_groff" = x"yes"; then
1106 AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1107 AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1108 AC_PATH_PROG(PSSELECT_PATH, [psselect])
1109 if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1113 AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1117 # Set Automake conditionals for Makefiles
1118 AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1119 AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1120 AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1121 AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1122 ]) # XORG_WITH_GROFF
1124 # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1125 # ---------------------------------------
1126 # Minimum version: 1.6.0
1127 # Minimum version for optional DEFAULT argument: 1.11.0
1128 # Minimum version for optional MIN-VERSION argument: 1.15.0
1130 # Documentation tools are not always available on all platforms and sometimes
1131 # not at the appropriate level. This macro enables a module to test for the
1132 # presence of the tool and obtain it's path in separate variables. Coupled with
1133 # the --with-fop option, it allows maximum flexibilty in making decisions
1134 # as whether or not to use the fop package. When DEFAULT is not specified,
1135 # --with-fop assumes 'auto'.
1137 # Interface to module:
1138 # HAVE_FOP: used in makefiles to conditionally generate documentation
1139 # FOP: returns the path of the fop program found
1140 # returns the path set by the user in the environment
1141 # --with-fop: 'yes' user instructs the module to use fop
1142 # 'no' user instructs the module not to use fop
1144 # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1146 AC_DEFUN([XORG_WITH_FOP],[
1147 AC_ARG_VAR([FOP], [Path to fop command])
1148 m4_define([_defopt], m4_default([$2], [auto]))
1150 AS_HELP_STRING([--with-fop],
1151 [Use fop to regenerate documentation (default: ]_defopt[)]),
1152 [use_fop=$withval], [use_fop=]_defopt)
1153 m4_undefine([_defopt])
1155 if test "x$use_fop" = x"auto"; then
1156 AC_PATH_PROG([FOP], [fop])
1157 if test "x$FOP" = "x"; then
1158 AC_MSG_WARN([fop not found - documentation targets will be skipped])
1163 elif test "x$use_fop" = x"yes" ; then
1164 AC_PATH_PROG([FOP], [fop])
1165 if test "x$FOP" = "x"; then
1166 AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1169 elif test "x$use_fop" = x"no" ; then
1170 if test "x$FOP" != "x"; then
1171 AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1175 AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1178 # Test for a minimum version of fop, if provided.
1180 [if test "$have_fop" = yes; then
1181 # scrape the fop version
1182 AC_MSG_CHECKING([for fop minimum version])
1183 fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1184 AC_MSG_RESULT([$fop_version])
1185 AS_VERSION_COMPARE([$fop_version], [$1],
1186 [if test "x$use_fop" = xauto; then
1187 AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1190 AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1193 AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1196 # XORG_WITH_M4([MIN-VERSION])
1197 # ---------------------------
1198 # Minimum version: 1.19.0
1200 # This macro attempts to locate an m4 macro processor which supports
1201 # -I option and is only useful for modules relying on M4 in order to
1202 # expand macros in source code files.
1204 # Interface to module:
1205 # M4: returns the path of the m4 program found
1206 # returns the path set by the user in the environment
1208 AC_DEFUN([XORG_WITH_M4], [
1209 AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
1210 [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
1211 [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
1212 ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
1213 [AC_MSG_ERROR([could not find m4 that supports -I option])],
1214 [$PATH:/usr/gnu/bin])])
1216 AC_SUBST([M4], [$ac_cv_path_M4])
1219 # XORG_WITH_PS2PDF([DEFAULT])
1221 # Minimum version: 1.6.0
1222 # Minimum version for optional DEFAULT argument: 1.11.0
1224 # Documentation tools are not always available on all platforms and sometimes
1225 # not at the appropriate level. This macro enables a module to test for the
1226 # presence of the tool and obtain it's path in separate variables. Coupled with
1227 # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1228 # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1229 # --with-ps2pdf assumes 'auto'.
1231 # Interface to module:
1232 # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
1233 # PS2PDF: returns the path of the ps2pdf program found
1234 # returns the path set by the user in the environment
1235 # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1236 # 'no' user instructs the module not to use ps2pdf
1238 # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1240 AC_DEFUN([XORG_WITH_PS2PDF],[
1241 AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1242 m4_define([_defopt], m4_default([$1], [auto]))
1244 AS_HELP_STRING([--with-ps2pdf],
1245 [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1246 [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1247 m4_undefine([_defopt])
1249 if test "x$use_ps2pdf" = x"auto"; then
1250 AC_PATH_PROG([PS2PDF], [ps2pdf])
1251 if test "x$PS2PDF" = "x"; then
1252 AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1257 elif test "x$use_ps2pdf" = x"yes" ; then
1258 AC_PATH_PROG([PS2PDF], [ps2pdf])
1259 if test "x$PS2PDF" = "x"; then
1260 AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1263 elif test "x$use_ps2pdf" = x"no" ; then
1264 if test "x$PS2PDF" != "x"; then
1265 AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1269 AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1271 AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1272 ]) # XORG_WITH_PS2PDF
1274 # XORG_ENABLE_DOCS (enable_docs=yes)
1276 # Minimum version: 1.6.0
1278 # Documentation tools are not always available on all platforms and sometimes
1279 # not at the appropriate level. This macro enables a builder to skip all
1280 # documentation targets except traditional man pages.
1281 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1282 # maximum flexibilty in controlling documentation building.
1284 # XORG_WITH_XMLTO --with-xmlto
1285 # XORG_WITH_ASCIIDOC --with-asciidoc
1286 # XORG_WITH_DOXYGEN --with-doxygen
1287 # XORG_WITH_FOP --with-fop
1288 # XORG_WITH_GROFF --with-groff
1289 # XORG_WITH_PS2PDF --with-ps2pdf
1291 # Interface to module:
1292 # ENABLE_DOCS: used in makefiles to conditionally generate documentation
1293 # --enable-docs: 'yes' user instructs the module to generate docs
1294 # 'no' user instructs the module not to generate docs
1295 # parm1: specify the default value, yes or no.
1297 AC_DEFUN([XORG_ENABLE_DOCS],[
1298 m4_define([docs_default], m4_default([$1], [yes]))
1300 AS_HELP_STRING([--enable-docs],
1301 [Enable building the documentation (default: ]docs_default[)]),
1302 [build_docs=$enableval], [build_docs=]docs_default)
1303 m4_undefine([docs_default])
1304 AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1305 AC_MSG_CHECKING([whether to build documentation])
1306 AC_MSG_RESULT([$build_docs])
1307 ]) # XORG_ENABLE_DOCS
1309 # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1311 # Minimum version: 1.6.0
1313 # This macro enables a builder to skip all developer documentation.
1314 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1315 # maximum flexibilty in controlling documentation building.
1317 # XORG_WITH_XMLTO --with-xmlto
1318 # XORG_WITH_ASCIIDOC --with-asciidoc
1319 # XORG_WITH_DOXYGEN --with-doxygen
1320 # XORG_WITH_FOP --with-fop
1321 # XORG_WITH_GROFF --with-groff
1322 # XORG_WITH_PS2PDF --with-ps2pdf
1324 # Interface to module:
1325 # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
1326 # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
1327 # 'no' user instructs the module not to generate developer docs
1328 # parm1: specify the default value, yes or no.
1330 AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1331 m4_define([devel_default], m4_default([$1], [yes]))
1332 AC_ARG_ENABLE(devel-docs,
1333 AS_HELP_STRING([--enable-devel-docs],
1334 [Enable building the developer documentation (default: ]devel_default[)]),
1335 [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1336 m4_undefine([devel_default])
1337 AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1338 AC_MSG_CHECKING([whether to build developer documentation])
1339 AC_MSG_RESULT([$build_devel_docs])
1340 ]) # XORG_ENABLE_DEVEL_DOCS
1342 # XORG_ENABLE_SPECS (enable_specs=yes)
1344 # Minimum version: 1.6.0
1346 # This macro enables a builder to skip all functional specification targets.
1347 # Combined with the specific tool checking macros XORG_WITH_*, it provides
1348 # maximum flexibilty in controlling documentation building.
1350 # XORG_WITH_XMLTO --with-xmlto
1351 # XORG_WITH_ASCIIDOC --with-asciidoc
1352 # XORG_WITH_DOXYGEN --with-doxygen
1353 # XORG_WITH_FOP --with-fop
1354 # XORG_WITH_GROFF --with-groff
1355 # XORG_WITH_PS2PDF --with-ps2pdf
1357 # Interface to module:
1358 # ENABLE_SPECS: used in makefiles to conditionally generate specs
1359 # --enable-specs: 'yes' user instructs the module to generate specs
1360 # 'no' user instructs the module not to generate specs
1361 # parm1: specify the default value, yes or no.
1363 AC_DEFUN([XORG_ENABLE_SPECS],[
1364 m4_define([spec_default], m4_default([$1], [yes]))
1365 AC_ARG_ENABLE(specs,
1366 AS_HELP_STRING([--enable-specs],
1367 [Enable building the specs (default: ]spec_default[)]),
1368 [build_specs=$enableval], [build_specs=]spec_default)
1369 m4_undefine([spec_default])
1370 AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1371 AC_MSG_CHECKING([whether to build functional specifications])
1372 AC_MSG_RESULT([$build_specs])
1373 ]) # XORG_ENABLE_SPECS
1375 # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
1376 # ----------------------------------------------
1377 # Minimum version: 1.13.0
1379 # This macro enables a builder to enable/disable unit testing
1380 # It makes no assumption about the test cases implementation
1381 # Test cases may or may not use Automake "Support for test suites"
1382 # They may or may not use the software utility library GLib
1384 # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
1385 # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
1386 # The variable enable_unit_tests is used by other macros in this file.
1388 # Interface to module:
1389 # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
1390 # enable_unit_tests: used in configure.ac for additional configuration
1391 # --enable-unit-tests: 'yes' user instructs the module to build tests
1392 # 'no' user instructs the module not to build tests
1393 # parm1: specify the default value, yes or no.
1395 AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
1396 AC_BEFORE([$0], [XORG_WITH_GLIB])
1397 AC_BEFORE([$0], [XORG_LD_WRAP])
1398 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1399 m4_define([_defopt], m4_default([$1], [auto]))
1400 AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
1401 [Enable building unit test cases (default: ]_defopt[)]),
1402 [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
1403 m4_undefine([_defopt])
1404 AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
1405 AC_MSG_CHECKING([whether to build unit test cases])
1406 AC_MSG_RESULT([$enable_unit_tests])
1407 ]) # XORG_ENABLE_UNIT_TESTS
1409 # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
1410 # ------------------------------------------------------
1411 # Minimum version: 1.17.0
1413 # This macro enables a builder to enable/disable integration testing
1414 # It makes no assumption about the test cases' implementation
1415 # Test cases may or may not use Automake "Support for test suites"
1417 # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
1418 # usually requires less dependencies and may be built and run under less
1419 # stringent environments than integration tests.
1421 # Interface to module:
1422 # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests
1423 # enable_integration_tests: used in configure.ac for additional configuration
1424 # --enable-integration-tests: 'yes' user instructs the module to build tests
1425 # 'no' user instructs the module not to build tests
1426 # parm1: specify the default value, yes or no.
1428 AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
1429 AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1430 m4_define([_defopt], m4_default([$1], [auto]))
1431 AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
1432 [Enable building integration test cases (default: ]_defopt[)]),
1433 [enable_integration_tests=$enableval],
1434 [enable_integration_tests=]_defopt)
1435 m4_undefine([_defopt])
1436 AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
1437 [test "x$enable_integration_tests" != xno])
1438 AC_MSG_CHECKING([whether to build unit test cases])
1439 AC_MSG_RESULT([$enable_integration_tests])
1440 ]) # XORG_ENABLE_INTEGRATION_TESTS
1442 # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
1443 # ----------------------------------------
1444 # Minimum version: 1.13.0
1446 # GLib is a library which provides advanced data structures and functions.
1447 # This macro enables a module to test for the presence of Glib.
1449 # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
1450 # Otherwise the value of $enable_unit_tests is blank.
1452 # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
1453 # test support usually requires less dependencies and may be built and run under
1454 # less stringent environments than integration tests.
1456 # Interface to module:
1457 # HAVE_GLIB: used in makefiles to conditionally build targets
1458 # with_glib: used in configure.ac to know if GLib has been found
1459 # --with-glib: 'yes' user instructs the module to use glib
1460 # 'no' user instructs the module not to use glib
1462 AC_DEFUN([XORG_WITH_GLIB],[
1463 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1464 m4_define([_defopt], m4_default([$2], [auto]))
1465 AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
1466 [Use GLib library for unit testing (default: ]_defopt[)]),
1467 [with_glib=$withval], [with_glib=]_defopt)
1468 m4_undefine([_defopt])
1471 # Do not probe GLib if user explicitly disabled unit testing
1472 if test "x$enable_unit_tests" != x"no"; then
1473 # Do not probe GLib if user explicitly disabled it
1474 if test "x$with_glib" != x"no"; then
1477 [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1478 [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1483 # Not having GLib when unit testing has been explicitly requested is an error
1484 if test "x$enable_unit_tests" = x"yes"; then
1485 if test "x$have_glib" = x"no"; then
1486 AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1490 # Having unit testing disabled when GLib has been explicitly requested is an error
1491 if test "x$enable_unit_tests" = x"no"; then
1492 if test "x$with_glib" = x"yes"; then
1493 AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1497 # Not having GLib when it has been explicitly requested is an error
1498 if test "x$with_glib" = x"yes"; then
1499 if test "x$have_glib" = x"no"; then
1500 AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1504 AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1507 # XORG_LD_WRAP([required|optional])
1508 # ---------------------------------
1509 # Minimum version: 1.13.0
1511 # Check if linker supports -wrap, passed via compiler flags
1513 # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1514 # Otherwise the value of $enable_unit_tests is blank.
1516 # Argument added in 1.16.0 - default is "required", to match existing behavior
1517 # of returning an error if enable_unit_tests is yes, and ld -wrap is not
1518 # available, an argument of "optional" allows use when some unit tests require
1519 # ld -wrap and others do not.
1521 AC_DEFUN([XORG_LD_WRAP],[
1522 XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
1523 [AC_LANG_PROGRAM([#include <stdlib.h>
1524 void __wrap_exit(int status) { return; }],
1526 # Not having ld wrap when unit testing has been explicitly requested is an error
1527 if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
1528 if test "x$have_ld_wrap" = x"no"; then
1529 AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1532 AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1536 # XORG_CHECK_LINKER_FLAGS
1537 # -----------------------
1540 # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1544 # Check whether the given linker FLAGS work with the current language's
1545 # linker, or whether they give an error.
1547 # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1550 # PROGRAM-SOURCE is the program source to link with, if needed
1552 # NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1556 # Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1557 # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1558 # Copyright (c) 2009 Matteo Frigo
1560 # This program is free software: you can redistribute it and/or modify it
1561 # under the terms of the GNU General Public License as published by the
1562 # Free Software Foundation, either version 3 of the License, or (at your
1563 # option) any later version.
1565 # This program is distributed in the hope that it will be useful, but
1566 # WITHOUT ANY WARRANTY; without even the implied warranty of
1567 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1568 # Public License for more details.
1570 # You should have received a copy of the GNU General Public License along
1571 # with this program. If not, see <http://www.gnu.org/licenses/>.
1573 # As a special exception, the respective Autoconf Macro's copyright owner
1574 # gives unlimited permission to copy, distribute and modify the configure
1575 # scripts that are the output of Autoconf when processing the Macro. You
1576 # need not follow the terms of the GNU General Public License when using
1577 # or distributing such scripts, even though portions of the text of the
1578 # Macro appear in them. The GNU General Public License (GPL) does govern
1579 # all other use of the material that constitutes the Autoconf Macro.
1581 # This special exception to the GPL applies to versions of the Autoconf
1582 # Macro released by the Autoconf Archive. When you make and distribute a
1583 # modified version of the Autoconf Macro, you may extend this special
1584 # exception to the GPL to apply to your modified version as well.#
1585 AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1586 [AC_MSG_CHECKING([whether the linker accepts $1])
1587 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1589 [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1590 ax_save_FLAGS=$LDFLAGS
1592 AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1593 AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1594 AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1595 LDFLAGS=$ax_save_FLAGS])],
1596 [ax_save_FLAGS=$LDFLAGS
1598 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1599 eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1600 eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1601 LDFLAGS=$ax_save_FLAGS])
1602 eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1603 AC_MSG_RESULT($xorg_check_linker_flags)
1604 if test "x$xorg_check_linker_flags" = xyes; then
1609 ]) # XORG_CHECK_LINKER_FLAGS
1611 # XORG_MEMORY_CHECK_FLAGS
1612 # -----------------------
1613 # Minimum version: 1.16.0
1615 # This macro attempts to find appropriate memory checking functionality
1616 # for various platforms which unit testing code may use to catch various
1617 # forms of memory allocation and access errors in testing.
1619 # Interface to module:
1620 # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1621 # Usually added to TESTS_ENVIRONMENT in Makefile.am
1623 # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1625 AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
1627 AC_REQUIRE([AC_CANONICAL_HOST])
1628 AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1629 [Environment variables to enable memory checking in tests])
1631 # Check for different types of support on different platforms
1634 AC_CHECK_LIB([umem], [umem_alloc],
1635 [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1637 *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1638 # both directly and inverted, so should not be 0 or 255.
1639 malloc_debug_env='MALLOC_PERTURB_=15'
1642 malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1645 malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1649 # User supplied flags override default flags
1650 if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1651 malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
1654 AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1657 # XORG_CHECK_MALLOC_ZERO
1658 # ----------------------
1659 # Minimum version: 1.0.0
1661 # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1662 # malloc(0) returns NULL. Packages should add one of these cflags to
1663 # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1664 AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1665 AC_ARG_ENABLE(malloc0returnsnull,
1666 AS_HELP_STRING([--enable-malloc0returnsnull],
1667 [malloc(0) returns NULL (default: auto)]),
1668 [MALLOC_ZERO_RETURNS_NULL=$enableval],
1669 [MALLOC_ZERO_RETURNS_NULL=auto])
1671 AC_MSG_CHECKING([whether malloc(0) returns NULL])
1672 if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1673 AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
1674 [AC_RUN_IFELSE([AC_LANG_PROGRAM([
1677 char *m0, *r0, *c0, *p;
1682 exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1684 [xorg_cv_malloc0_returns_null=yes],
1685 [xorg_cv_malloc0_returns_null=no])])
1686 MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
1688 AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1690 if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1691 MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1692 XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1693 XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1695 MALLOC_ZERO_CFLAGS=""
1696 XMALLOC_ZERO_CFLAGS=""
1697 XTMALLOC_ZERO_CFLAGS=""
1700 AC_SUBST([MALLOC_ZERO_CFLAGS])
1701 AC_SUBST([XMALLOC_ZERO_CFLAGS])
1702 AC_SUBST([XTMALLOC_ZERO_CFLAGS])
1703 ]) # XORG_CHECK_MALLOC_ZERO
1707 # Minimum version: 1.1.0
1709 # This macro enables the use of a tool that flags some suspicious and
1710 # non-portable constructs (likely to be bugs) in C language source code.
1711 # It will attempt to locate the tool and use appropriate options.
1712 # There are various lint type tools on different platforms.
1714 # Interface to module:
1715 # LINT: returns the path to the tool found on the platform
1716 # or the value set to LINT on the configure cmd line
1717 # also an Automake conditional
1718 # LINT_FLAGS: an Automake variable with appropriate flags
1720 # --with-lint: 'yes' user instructs the module to use lint
1721 # 'no' user instructs the module not to use lint (default)
1723 # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1724 # If the user sets the value of LINT_FLAGS, they are used verbatim.
1726 AC_DEFUN([XORG_WITH_LINT],[
1728 AC_ARG_VAR([LINT], [Path to a lint-style command])
1729 AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1730 AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1731 [Use a lint-style source code checker (default: disabled)])],
1732 [use_lint=$withval], [use_lint=no])
1734 # Obtain platform specific info like program name and options
1735 # The lint program on FreeBSD and NetBSD is different from the one on Solaris
1737 *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1739 lint_options="-badflag"
1741 *freebsd* | *netbsd*)
1743 lint_options="-u -b"
1747 lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1751 # Test for the presence of the program (either guessed by the code or spelled out by the user)
1752 if test "x$use_lint" = x"yes" ; then
1753 AC_PATH_PROG([LINT], [$lint_name])
1754 if test "x$LINT" = "x"; then
1755 AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1757 elif test "x$use_lint" = x"no" ; then
1758 if test "x$LINT" != "x"; then
1759 AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1762 AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1765 # User supplied flags override default flags
1766 if test "x$LINT_FLAGS" != "x"; then
1767 lint_options=$LINT_FLAGS
1770 AC_SUBST([LINT_FLAGS],[$lint_options])
1771 AM_CONDITIONAL(LINT, [test "x$LINT" != x])
1775 # XORG_LINT_LIBRARY(LIBNAME)
1776 # --------------------------
1777 # Minimum version: 1.1.0
1779 # Sets up flags for building lint libraries for checking programs that call
1780 # functions in the library.
1782 # Interface to module:
1783 # LINTLIB - Automake variable with the name of lint library file to make
1784 # MAKE_LINT_LIB - Automake conditional
1786 # --enable-lint-library: - 'yes' user instructs the module to created a lint library
1787 # - 'no' user instructs the module not to create a lint library (default)
1789 AC_DEFUN([XORG_LINT_LIBRARY],[
1790 AC_REQUIRE([XORG_WITH_LINT])
1791 AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1792 [Create lint library (default: disabled)])],
1793 [make_lint_lib=$enableval], [make_lint_lib=no])
1795 if test "x$make_lint_lib" = x"yes" ; then
1797 if test "x$LINT" = "x"; then
1798 AC_MSG_ERROR([Cannot make lint library without --with-lint])
1800 elif test "x$make_lint_lib" != x"no" ; then
1801 AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1805 AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1807 ]) # XORG_LINT_LIBRARY
1809 # XORG_COMPILER_BRAND
1810 # -------------------
1811 # Minimum version: 1.14.0
1813 # Checks for various brands of compilers and sets flags as appropriate:
1814 # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1815 # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1816 # clang compiler - sets CLANGCC to "yes"
1817 # Intel compiler - sets INTELCC to "yes"
1818 # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1820 AC_DEFUN([XORG_COMPILER_BRAND], [
1823 AC_REQUIRE([AC_PROG_CC_C99])
1826 AC_REQUIRE([AC_PROG_CXX])
1829 AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1830 AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1831 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1832 ]) # XORG_COMPILER_BRAND
1834 # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1836 # Minimum version: 1.16.0
1838 # Test if the compiler works when passed the given flag as a command line argument.
1839 # If it succeeds, the flag is appeneded to the given variable. If not, it tries the
1840 # next flag in the list until there are no more options.
1842 # Note that this does not guarantee that the compiler supports the flag as some
1843 # compilers will simply ignore arguments that they do not understand, but we do
1844 # attempt to weed out false positives by using -Werror=unknown-warning-option and
1845 # -Werror=unused-command-line-argument
1847 AC_DEFUN([XORG_TESTSET_CFLAG], [
1848 m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1849 m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1851 AC_LANG_COMPILER_REQUIRE
1855 AC_REQUIRE([AC_PROG_CC_C99])
1856 define([PREFIX], [C])
1857 define([CACHE_PREFIX], [cc])
1858 define([COMPILER], [$CC])
1861 define([PREFIX], [CXX])
1862 define([CACHE_PREFIX], [cxx])
1863 define([COMPILER], [$CXX])
1867 [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1869 if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1870 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1871 AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1872 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1873 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1874 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1875 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1876 [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1877 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1880 if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1881 if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1882 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1884 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1885 AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1886 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1887 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1888 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1889 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1890 [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1891 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1895 m4_foreach([flag], m4_cdr($@), [
1896 if test $found = "no" ; then
1897 if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
1898 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1901 if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
1902 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1905 PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
1907 dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1908 AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
1909 cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1910 AC_CACHE_VAL($cacheid,
1911 [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1912 [eval $cacheid=yes],
1913 [eval $cacheid=no])])
1915 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1917 eval supported=\$$cacheid
1918 AC_MSG_RESULT([$supported])
1919 if test "$supported" = "yes" ; then
1925 ]) # XORG_TESTSET_CFLAG
1927 # XORG_COMPILER_FLAGS
1929 # Minimum version: 1.16.0
1931 # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
1932 # arguments supported by the selected compiler which do NOT alter the generated
1933 # code. These arguments will cause the compiler to print various warnings
1934 # during compilation AND turn a conservative set of warnings into errors.
1936 # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
1937 # future versions of util-macros as options are added to new compilers.
1939 AC_DEFUN([XORG_COMPILER_FLAGS], [
1940 AC_REQUIRE([XORG_COMPILER_BRAND])
1942 AC_ARG_ENABLE(selective-werror,
1943 AS_HELP_STRING([--disable-selective-werror],
1944 [Turn off selective compiler errors. (default: enabled)]),
1945 [SELECTIVE_WERROR=$enableval],
1946 [SELECTIVE_WERROR=yes])
1950 define([PREFIX], [C])
1953 define([PREFIX], [CXX])
1956 # -v is too short to test reliably with XORG_TESTSET_CFLAG
1957 if test "x$SUNCC" = "xyes"; then
1958 [BASE_]PREFIX[FLAGS]="-v"
1960 [BASE_]PREFIX[FLAGS]=""
1963 # This chunk of warnings were those that existed in the legacy CWARNFLAGS
1964 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
1965 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
1966 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
1967 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
1971 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
1972 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
1973 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
1974 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
1975 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
1976 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
1980 # This chunk adds additional warnings that could catch undesired effects.
1981 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
1982 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
1983 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
1984 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
1985 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
1986 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1987 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
1989 # These are currently disabled because they are noisy. They will be enabled
1990 # in the future once the codebase is sufficiently modernized to silence
1991 # them. For now, I don't want them to drown out the other warnings.
1992 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
1993 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1994 # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
1996 # Turn some warnings into errors, so we don't accidently get successful builds
1997 # when there are problems that should be fixed.
1999 if test "x$SELECTIVE_WERROR" = "xyes" ; then
2000 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
2001 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
2002 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
2003 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
2004 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
2005 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
2006 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
2007 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
2008 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
2009 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
2010 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
2011 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
2012 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
2014 AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
2015 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
2016 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
2017 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
2018 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
2019 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
2020 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
2021 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
2022 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
2023 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
2024 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
2025 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
2026 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
2027 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
2030 AC_SUBST([BASE_]PREFIX[FLAGS])
2031 ]) # XORG_COMPILER_FLAGS
2035 # Minimum version: 1.2.0
2036 # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
2038 # Defines CWARNFLAGS to enable C compiler warnings.
2040 # This function is deprecated because it defines -fno-strict-aliasing
2041 # which alters the code generated by the compiler. If -fno-strict-aliasing
2042 # is needed, then it should be added explicitly in the module when
2043 # it is updated to use BASE_CFLAGS.
2045 AC_DEFUN([XORG_CWARNFLAGS], [
2046 AC_REQUIRE([XORG_COMPILER_FLAGS])
2047 AC_REQUIRE([XORG_COMPILER_BRAND])
2050 CWARNFLAGS="$BASE_CFLAGS"
2051 if test "x$GCC" = xyes ; then
2052 CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
2054 AC_SUBST(CWARNFLAGS)
2057 ]) # XORG_CWARNFLAGS
2059 # XORG_STRICT_OPTION
2060 # -----------------------
2061 # Minimum version: 1.3.0
2063 # Add configure option to enable strict compilation flags, such as treating
2064 # warnings as fatal errors.
2065 # If --enable-strict-compilation is passed to configure, adds strict flags to
2066 # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
2068 # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
2069 # when strict compilation is unconditionally desired.
2070 AC_DEFUN([XORG_STRICT_OPTION], [
2071 AC_REQUIRE([XORG_CWARNFLAGS])
2072 AC_REQUIRE([XORG_COMPILER_FLAGS])
2074 AC_ARG_ENABLE(strict-compilation,
2075 AS_HELP_STRING([--enable-strict-compilation],
2076 [Enable all warnings from compiler and make them errors (default: disabled)]),
2077 [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
2081 define([PREFIX], [C])
2084 define([PREFIX], [CXX])
2088 [STRICT_]PREFIX[FLAGS]=""
2089 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
2090 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
2092 # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
2093 # activate it with -Werror, so we add it here explicitly.
2094 XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
2096 if test "x$STRICT_COMPILE" = "xyes"; then
2097 [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
2098 AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
2100 AC_SUBST([STRICT_]PREFIX[FLAGS])
2101 AC_SUBST([BASE_]PREFIX[FLAGS])
2102 AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
2103 ]) # XORG_STRICT_OPTION
2105 # XORG_DEFAULT_OPTIONS
2106 # --------------------
2107 # Minimum version: 1.3.0
2109 # Defines default options for X.Org modules.
2111 AC_DEFUN([XORG_DEFAULT_OPTIONS], [
2112 AC_REQUIRE([AC_PROG_INSTALL])
2116 XORG_RELEASE_VERSION
2119 XORG_MANPAGE_SECTIONS
2120 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
2121 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
2122 ]) # XORG_DEFAULT_OPTIONS
2126 # Minimum version: 1.4.0
2128 # Defines the variable INSTALL_CMD as the command to copy
2129 # INSTALL from $prefix/share/util-macros.
2131 AC_DEFUN([XORG_INSTALL], [
2132 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
2133 macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
2134 INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
2135 mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
2136 || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
2137 echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
2138 AC_SUBST([INSTALL_CMD])
2140 dnl Copyright 2005 Red Hat, Inc
2142 dnl Permission to use, copy, modify, distribute, and sell this software and its
2143 dnl documentation for any purpose is hereby granted without fee, provided that
2144 dnl the above copyright notice appear in all copies and that both that
2145 dnl copyright notice and this permission notice appear in supporting
2148 dnl The above copyright notice and this permission notice shall be included
2149 dnl in all copies or substantial portions of the Software.
2151 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2152 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2153 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
2154 dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
2155 dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2156 dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2157 dnl OTHER DEALINGS IN THE SOFTWARE.
2159 dnl Except as contained in this notice, the name of the copyright holders shall
2160 dnl not be used in advertising or otherwise to promote the sale, use or
2161 dnl other dealings in this Software without prior written authorization
2162 dnl from the copyright holders.
2165 # XORG_RELEASE_VERSION
2166 # --------------------
2167 # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
2169 AC_DEFUN([XORG_RELEASE_VERSION],[
2170 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
2171 [`echo $PACKAGE_VERSION | cut -d . -f 1`],
2172 [Major version of this package])
2173 PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
2174 if test "x$PVM" = "x"; then
2177 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
2179 [Minor version of this package])
2180 PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
2181 if test "x$PVP" = "x"; then
2184 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
2186 [Patch version of this package])
2191 # Minimum version: 1.2.0
2193 # Defines the variable CHANGELOG_CMD as the command to generate
2194 # ChangeLog from git.
2197 AC_DEFUN([XORG_CHANGELOG], [
2198 CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
2199 mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
2200 || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
2201 echo 'git directory not found: installing possibly empty changelog.' >&2)"
2202 AC_SUBST([CHANGELOG_CMD])
2205 # Copyright (C) 2002-2014 Free Software Foundation, Inc.
2207 # This file is free software; the Free Software Foundation
2208 # gives unlimited permission to copy and/or distribute it,
2209 # with or without modifications, as long as this notice is preserved.
2211 # AM_AUTOMAKE_VERSION(VERSION)
2212 # ----------------------------
2213 # Automake X.Y traces this macro to ensure aclocal.m4 has been
2214 # generated from the m4 files accompanying Automake X.Y.
2215 # (This private macro should not be called outside this file.)
2216 AC_DEFUN([AM_AUTOMAKE_VERSION],
2217 [am__api_version='1.15'
2218 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
2219 dnl require some minimum version. Point them to the right macro.
2220 m4_if([$1], [1.15], [],
2221 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
2224 # _AM_AUTOCONF_VERSION(VERSION)
2225 # -----------------------------
2226 # aclocal traces this macro to find the Autoconf version.
2227 # This is a private macro too. Using m4_define simplifies
2228 # the logic in aclocal, which can simply ignore this definition.
2229 m4_define([_AM_AUTOCONF_VERSION], [])
2231 # AM_SET_CURRENT_AUTOMAKE_VERSION
2232 # -------------------------------
2233 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
2234 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
2235 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
2236 [AM_AUTOMAKE_VERSION([1.15])dnl
2237 m4_ifndef([AC_AUTOCONF_VERSION],
2238 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
2239 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
2241 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
2243 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
2245 # This file is free software; the Free Software Foundation
2246 # gives unlimited permission to copy and/or distribute it,
2247 # with or without modifications, as long as this notice is preserved.
2249 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
2250 # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
2251 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
2253 # Of course, Automake must honor this variable whenever it calls a
2254 # tool from the auxiliary directory. The problem is that $srcdir (and
2255 # therefore $ac_aux_dir as well) can be either absolute or relative,
2256 # depending on how configure is run. This is pretty annoying, since
2257 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
2258 # source directory, any form will work fine, but in subdirectories a
2259 # relative path needs to be adjusted first.
2261 # $ac_aux_dir/missing
2262 # fails when called from a subdirectory if $ac_aux_dir is relative
2263 # $top_srcdir/$ac_aux_dir/missing
2264 # fails if $ac_aux_dir is absolute,
2265 # fails when called from a subdirectory in a VPATH build with
2266 # a relative $ac_aux_dir
2268 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
2269 # are both prefixed by $srcdir. In an in-source build this is usually
2270 # harmless because $srcdir is '.', but things will broke when you
2271 # start a VPATH build or use an absolute $srcdir.
2273 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
2274 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
2275 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
2276 # and then we would define $MISSING as
2277 # MISSING="\${SHELL} $am_aux_dir/missing"
2278 # This will work as long as MISSING is not called from configure, because
2279 # unfortunately $(top_srcdir) has no meaning in configure.
2280 # However there are other variables, like CC, which are often used in
2281 # configure, and could therefore not use this "fixed" $ac_aux_dir.
2283 # Another solution, used here, is to always expand $ac_aux_dir to an
2284 # absolute PATH. The drawback is that using absolute paths prevent a
2285 # configured tree to be moved without reconfiguration.
2287 AC_DEFUN([AM_AUX_DIR_EXPAND],
2288 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
2289 # Expand $ac_aux_dir to an absolute path.
2290 am_aux_dir=`cd "$ac_aux_dir" && pwd`
2293 # AM_CONDITIONAL -*- Autoconf -*-
2295 # Copyright (C) 1997-2014 Free Software Foundation, Inc.
2297 # This file is free software; the Free Software Foundation
2298 # gives unlimited permission to copy and/or distribute it,
2299 # with or without modifications, as long as this notice is preserved.
2301 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
2302 # -------------------------------------
2303 # Define a conditional.
2304 AC_DEFUN([AM_CONDITIONAL],
2305 [AC_PREREQ([2.52])dnl
2306 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
2307 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
2308 AC_SUBST([$1_TRUE])dnl
2309 AC_SUBST([$1_FALSE])dnl
2310 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
2311 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
2312 m4_define([_AM_COND_VALUE_$1], [$2])dnl
2320 AC_CONFIG_COMMANDS_PRE(
2321 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
2322 AC_MSG_ERROR([[conditional "$1" was never defined.
2323 Usually this means the macro was only invoked conditionally.]])
2326 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
2328 # This file is free software; the Free Software Foundation
2329 # gives unlimited permission to copy and/or distribute it,
2330 # with or without modifications, as long as this notice is preserved.
2333 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
2334 # written in clear, in which case automake, when reading aclocal.m4,
2335 # will think it sees a *use*, and therefore will trigger all it's
2336 # C support machinery. Also note that it means that autoscan, seeing
2337 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
2340 # _AM_DEPENDENCIES(NAME)
2341 # ----------------------
2342 # See how the compiler implements dependency checking.
2343 # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
2344 # We try a few techniques and use that to set a single cache variable.
2346 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
2347 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
2348 # dependency, and given that the user is not expected to run this macro,
2349 # just rely on AC_PROG_CC.
2350 AC_DEFUN([_AM_DEPENDENCIES],
2351 [AC_REQUIRE([AM_SET_DEPDIR])dnl
2352 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
2353 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
2354 AC_REQUIRE([AM_DEP_TRACK])dnl
2356 m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
2357 [$1], [CXX], [depcc="$CXX" am_compiler_list=],
2358 [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
2359 [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
2360 [$1], [UPC], [depcc="$UPC" am_compiler_list=],
2361 [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
2362 [depcc="$$1" am_compiler_list=])
2364 AC_CACHE_CHECK([dependency style of $depcc],
2365 [am_cv_$1_dependencies_compiler_type],
2366 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
2367 # We make a subdir and do the tests there. Otherwise we can end up
2368 # making bogus files that we don't know about and never remove. For
2369 # instance it was reported that on HP-UX the gcc test will end up
2370 # making a dummy file named 'D' -- because '-MD' means "put the output
2374 # Copy depcomp to subdir because otherwise we won't find it if we're
2375 # using a relative directory.
2376 cp "$am_depcomp" conftest.dir
2378 # We will build objects and dependencies in a subdirectory because
2379 # it helps to detect inapplicable dependency modes. For instance
2380 # both Tru64's cc and ICC support -MD to output dependencies as a
2381 # side effect of compilation, but ICC will put the dependencies in
2382 # the current directory while Tru64 will put them in the object
2386 am_cv_$1_dependencies_compiler_type=none
2387 if test "$am_compiler_list" = ""; then
2388 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2392 [case " $depcc " in #(
2393 *\ -arch\ *\ -arch\ *) am__universal=true ;;
2396 [case " $depcc " in #(
2397 *\ -arch\ *\ -arch\ *) am__universal=true ;;
2400 for depmode in $am_compiler_list; do
2401 # Setup a source with many dependencies, because some compilers
2402 # like to wrap large dependency lists on column 80 (with \), and
2403 # we should not choose a depcomp mode which is confused by this.
2405 # We need to recreate these files for each test, as the compiler may
2406 # overwrite some of them when testing with obscure command lines.
2407 # This happens at least with the AIX C compiler.
2409 for i in 1 2 3 4 5 6; do
2410 echo '#include "conftst'$i'.h"' >> sub/conftest.c
2411 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
2412 # Solaris 10 /bin/sh.
2413 echo '/* dummy */' > sub/conftst$i.h
2415 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2417 # We check with '-c' and '-o' for the sake of the "dashmstdout"
2418 # mode. It turns out that the SunPro C++ compiler does not properly
2419 # handle '-M -o', and we need to detect this. Also, some Intel
2420 # versions had trouble with output in subdirs.
2421 am__obj=sub/conftest.${OBJEXT-o}
2422 am__minus_obj="-o $am__obj"
2425 # This depmode causes a compiler race in universal mode.
2426 test "$am__universal" = false || continue
2429 # After this tag, mechanisms are not by side-effect, so they'll
2430 # only be used when explicitly requested.
2431 if test "x$enable_dependency_tracking" = xyes; then
2437 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
2438 # This compiler won't grok '-c -o', but also, the minuso test has
2439 # not run yet. These depmodes are late enough in the game, and
2440 # so weak that their functioning should not be impacted.
2441 am__obj=conftest.${OBJEXT-o}
2446 if depmode=$depmode \
2447 source=sub/conftest.c object=$am__obj \
2448 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2449 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2450 >/dev/null 2>conftest.err &&
2451 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2452 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2453 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2454 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2455 # icc doesn't choke on unknown options, it will just issue warnings
2456 # or remarks (even with -Werror). So we grep stderr for any message
2457 # that says an option was ignored or not supported.
2458 # When given -MP, icc 7.0 and 7.1 complain thusly:
2459 # icc: Command line warning: ignoring option '-M'; no argument required
2460 # The diagnosis changed in icc 8.0:
2461 # icc: Command line remark: option '-MP' not supported
2462 if (grep 'ignoring option' conftest.err ||
2463 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2464 am_cv_$1_dependencies_compiler_type=$depmode
2473 am_cv_$1_dependencies_compiler_type=none
2476 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2477 AM_CONDITIONAL([am__fastdep$1], [
2478 test "x$enable_dependency_tracking" != xno \
2479 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2485 # Choose a directory name for dependency files.
2486 # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
2487 AC_DEFUN([AM_SET_DEPDIR],
2488 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2489 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2495 AC_DEFUN([AM_DEP_TRACK],
2496 [AC_ARG_ENABLE([dependency-tracking], [dnl
2498 [--enable-dependency-tracking],
2499 [do not reject slow dependency extractors])
2501 [--disable-dependency-tracking],
2502 [speeds up one-time build])])
2503 if test "x$enable_dependency_tracking" != xno; then
2504 am_depcomp="$ac_aux_dir/depcomp"
2508 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2509 AC_SUBST([AMDEPBACKSLASH])dnl
2510 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
2511 AC_SUBST([am__nodep])dnl
2512 _AM_SUBST_NOTMAKE([am__nodep])dnl
2515 # Generate code to set up dependency tracking. -*- Autoconf -*-
2517 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
2519 # This file is free software; the Free Software Foundation
2520 # gives unlimited permission to copy and/or distribute it,
2521 # with or without modifications, as long as this notice is preserved.
2524 # _AM_OUTPUT_DEPENDENCY_COMMANDS
2525 # ------------------------------
2526 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
2528 # Older Autoconf quotes --file arguments for eval, but not when files
2529 # are listed without --file. Let's play safe and only enable the eval
2530 # if we detect the quoting.
2531 case $CONFIG_FILES in
2532 *\'*) eval set x "$CONFIG_FILES" ;;
2533 *) set x $CONFIG_FILES ;;
2538 # Strip MF so we end up with the name of the file.
2539 mf=`echo "$mf" | sed -e 's/:.*$//'`
2540 # Check whether this is an Automake generated Makefile or not.
2541 # We used to match only the files named 'Makefile.in', but
2542 # some people rename them; so instead we look at the file content.
2543 # Grep'ing the first line is not enough: some people post-process
2544 # each Makefile.in and add a new line on top of each file to say so.
2545 # Grep'ing the whole file is not good either: AIX grep has a line
2546 # limit of 2048, but all sed's we know have understand at least 4000.
2547 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
2548 dirpart=`AS_DIRNAME("$mf")`
2552 # Extract the definition of DEPDIR, am__include, and am__quote
2553 # from the Makefile without running 'make'.
2554 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
2555 test -z "$DEPDIR" && continue
2556 am__include=`sed -n 's/^am__include = //p' < "$mf"`
2557 test -z "$am__include" && continue
2558 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
2559 # Find all dependency output files, they are included files with
2560 # $(DEPDIR) in their names. We invoke sed twice because it is the
2561 # simplest approach to changing $(DEPDIR) to its actual value in the
2563 for file in `sed -n "
2564 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
2565 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
2566 # Make sure the directory exists.
2567 test -f "$dirpart/$file" && continue
2568 fdir=`AS_DIRNAME(["$file"])`
2569 AS_MKDIR_P([$dirpart/$fdir])
2570 # echo "creating $dirpart/$file"
2571 echo '# dummy' > "$dirpart/$file"
2575 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2578 # AM_OUTPUT_DEPENDENCY_COMMANDS
2579 # -----------------------------
2580 # This macro should only be invoked once -- use via AC_REQUIRE.
2582 # This code is only required when automatic dependency tracking
2583 # is enabled. FIXME. This creates each '.P' file that we will
2584 # need in order to bootstrap the dependency handling code.
2585 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
2586 [AC_CONFIG_COMMANDS([depfiles],
2587 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2588 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2591 # Do all the work for Automake. -*- Autoconf -*-
2593 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
2595 # This file is free software; the Free Software Foundation
2596 # gives unlimited permission to copy and/or distribute it,
2597 # with or without modifications, as long as this notice is preserved.
2599 # This macro actually does too much. Some checks are only needed if
2600 # your package does certain things. But this isn't really a big deal.
2602 dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
2603 m4_define([AC_PROG_CC],
2604 m4_defn([AC_PROG_CC])
2608 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
2609 # AM_INIT_AUTOMAKE([OPTIONS])
2610 # -----------------------------------------------
2611 # The call with PACKAGE and VERSION arguments is the old style
2612 # call (pre autoconf-2.50), which is being phased out. PACKAGE
2613 # and VERSION should now be passed to AC_INIT and removed from
2614 # the call to AM_INIT_AUTOMAKE.
2615 # We support both call styles for the transition. After
2616 # the next Automake release, Autoconf can make the AC_INIT
2617 # arguments mandatory, and then we can depend on a new Autoconf
2618 # release and drop the old call support.
2619 AC_DEFUN([AM_INIT_AUTOMAKE],
2620 [AC_PREREQ([2.65])dnl
2621 dnl Autoconf wants to disallow AM_ names. We explicitly allow
2622 dnl the ones we care about.
2623 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
2624 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2625 AC_REQUIRE([AC_PROG_INSTALL])dnl
2626 if test "`cd $srcdir && pwd`" != "`pwd`"; then
2627 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2628 # is not polluted with repeated "-I."
2629 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
2630 # test to see if srcdir already configured
2631 if test -f $srcdir/config.status; then
2632 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2636 # test whether we have cygpath
2637 if test -z "$CYGPATH_W"; then
2638 if (cygpath --version) >/dev/null 2>/dev/null; then
2639 CYGPATH_W='cygpath -w'
2644 AC_SUBST([CYGPATH_W])
2646 # Define the identity of the package.
2647 dnl Distinguish between old-style and new-style calls.
2649 [AC_DIAGNOSE([obsolete],
2650 [$0: two- and three-arguments forms are deprecated.])
2651 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
2652 AC_SUBST([PACKAGE], [$1])dnl
2653 AC_SUBST([VERSION], [$2])],
2654 [_AM_SET_OPTIONS([$1])dnl
2655 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
2657 m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
2659 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
2660 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
2661 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
2663 _AM_IF_OPTION([no-define],,
2664 [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
2665 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
2667 # Some tools Automake needs.
2668 AC_REQUIRE([AM_SANITY_CHECK])dnl
2669 AC_REQUIRE([AC_ARG_PROGRAM])dnl
2670 AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
2671 AM_MISSING_PROG([AUTOCONF], [autoconf])
2672 AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
2673 AM_MISSING_PROG([AUTOHEADER], [autoheader])
2674 AM_MISSING_PROG([MAKEINFO], [makeinfo])
2675 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2676 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
2677 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
2678 # For better backward compatibility. To be removed once Automake 1.9.x
2679 # dies out for good. For more background, see:
2680 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2681 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
2682 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
2683 # We need awk for the "check" target (and possibly the TAP driver). The
2684 # system "awk" is bad on some platforms.
2685 AC_REQUIRE([AC_PROG_AWK])dnl
2686 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2687 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2688 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
2689 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
2690 [_AM_PROG_TAR([v7])])])
2691 _AM_IF_OPTION([no-dependencies],,
2692 [AC_PROVIDE_IFELSE([AC_PROG_CC],
2693 [_AM_DEPENDENCIES([CC])],
2694 [m4_define([AC_PROG_CC],
2695 m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
2696 AC_PROVIDE_IFELSE([AC_PROG_CXX],
2697 [_AM_DEPENDENCIES([CXX])],
2698 [m4_define([AC_PROG_CXX],
2699 m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
2700 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
2701 [_AM_DEPENDENCIES([OBJC])],
2702 [m4_define([AC_PROG_OBJC],
2703 m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
2704 AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
2705 [_AM_DEPENDENCIES([OBJCXX])],
2706 [m4_define([AC_PROG_OBJCXX],
2707 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
2709 AC_REQUIRE([AM_SILENT_RULES])dnl
2710 dnl The testsuite driver may need to know about EXEEXT, so add the
2711 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
2712 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
2713 AC_CONFIG_COMMANDS_PRE(dnl
2714 [m4_provide_if([_AM_COMPILER_EXEEXT],
2715 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
2717 # POSIX will say in a future version that running "rm -f" with no argument
2718 # is OK; and we want to be able to make that assumption in our Makefile
2719 # recipes. So use an aggressive probe to check that the usage we want is
2720 # actually supported "in the wild" to an acceptable degree.
2721 # See automake bug#10828.
2722 # To make any issue more visible, cause the running configure to be aborted
2723 # by default if the 'rm' program in use doesn't match our expectations; the
2724 # user can still override this though.
2725 if rm -f && rm -fr && rm -rf; then : OK; else
2729 Your 'rm' program seems unable to run without file operands specified
2730 on the command line, even when the '-f' option is present. This is contrary
2731 to the behaviour of most rm programs out there, and not conforming with
2732 the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
2734 Please tell bug-automake@gnu.org about your system, including the value
2735 of your $PATH and any error possibly output before this message. This
2736 can help us improve future automake versions.
2739 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
2740 echo 'Configuration will proceed anyway, since you have set the' >&2
2741 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
2745 Aborting the configuration process, to ensure you take notice of the issue.
2747 You can download and install GNU coreutils to get an 'rm' implementation
2748 that behaves properly: <http://www.gnu.org/software/coreutils/>.
2750 If you want to complete the configuration process using your problematic
2751 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
2752 to "yes", and re-run configure.
2755 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
2758 dnl The trailing newline in this macro's definition is deliberate, for
2759 dnl backward compatibility and to allow trailing 'dnl'-style comments
2760 dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
2763 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
2764 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
2765 dnl mangled by Autoconf and run in a shell conditional statement.
2766 m4_define([_AC_COMPILER_EXEEXT],
2767 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
2769 # When config.status generates a header, we must update the stamp-h file.
2770 # This file resides in the same directory as the config header
2771 # that is generated. The stamp files are numbered to have different names.
2773 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
2774 # loop where config.status creates the headers, so we can generate
2775 # our stamp files there.
2776 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
2777 [# Compute $1's index in $config_headers.
2780 for _am_header in $config_headers :; do
2782 $_am_arg | $_am_arg:* )
2785 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2788 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
2790 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
2792 # This file is free software; the Free Software Foundation
2793 # gives unlimited permission to copy and/or distribute it,
2794 # with or without modifications, as long as this notice is preserved.
2796 # AM_PROG_INSTALL_SH
2797 # ------------------
2798 # Define $install_sh.
2799 AC_DEFUN([AM_PROG_INSTALL_SH],
2800 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2801 if test x"${install_sh+set}" != xset; then
2804 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2806 install_sh="\${SHELL} $am_aux_dir/install-sh"
2809 AC_SUBST([install_sh])])
2811 # Copyright (C) 2003-2014 Free Software Foundation, Inc.
2813 # This file is free software; the Free Software Foundation
2814 # gives unlimited permission to copy and/or distribute it,
2815 # with or without modifications, as long as this notice is preserved.
2817 # Check whether the underlying file-system supports filenames
2818 # with a leading dot. For instance MS-DOS doesn't.
2819 AC_DEFUN([AM_SET_LEADING_DOT],
2820 [rm -rf .tst 2>/dev/null
2821 mkdir .tst 2>/dev/null
2822 if test -d .tst; then
2827 rmdir .tst 2>/dev/null
2828 AC_SUBST([am__leading_dot])])
2830 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
2833 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
2835 # This file is free software; the Free Software Foundation
2836 # gives unlimited permission to copy and/or distribute it,
2837 # with or without modifications, as long as this notice is preserved.
2839 # AM_MAINTAINER_MODE([DEFAULT-MODE])
2840 # ----------------------------------
2841 # Control maintainer-specific portions of Makefiles.
2842 # Default is to disable them, unless 'enable' is passed literally.
2843 # For symmetry, 'disable' may be passed as well. Anyway, the user
2844 # can override the default with the --enable/--disable switch.
2845 AC_DEFUN([AM_MAINTAINER_MODE],
2846 [m4_case(m4_default([$1], [disable]),
2847 [enable], [m4_define([am_maintainer_other], [disable])],
2848 [disable], [m4_define([am_maintainer_other], [enable])],
2849 [m4_define([am_maintainer_other], [enable])
2850 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
2851 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
2852 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
2853 AC_ARG_ENABLE([maintainer-mode],
2854 [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
2855 am_maintainer_other[ make rules and dependencies not useful
2856 (and sometimes confusing) to the casual installer])],
2857 [USE_MAINTAINER_MODE=$enableval],
2858 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
2859 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
2860 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
2861 MAINT=$MAINTAINER_MODE_TRUE
2862 AC_SUBST([MAINT])dnl
2866 # Check to see how 'make' treats includes. -*- Autoconf -*-
2868 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
2870 # This file is free software; the Free Software Foundation
2871 # gives unlimited permission to copy and/or distribute it,
2872 # with or without modifications, as long as this notice is preserved.
2876 # Check to see how make treats includes.
2877 AC_DEFUN([AM_MAKE_INCLUDE],
2878 [am_make=${MAKE-make}
2879 cat > confinc << 'END'
2881 @echo this is the am__doit target
2884 # If we don't find an include directive, just comment out the code.
2885 AC_MSG_CHECKING([for style of include used by $am_make])
2889 # First try GNU make style include.
2890 echo "include confinc" > confmf
2891 # Ignore all kinds of additional output from 'make'.
2892 case `$am_make -s -f confmf 2> /dev/null` in #(
2893 *the\ am__doit\ target*)
2899 # Now try BSD make style include.
2900 if test "$am__include" = "#"; then
2901 echo '.include "confinc"' > confmf
2902 case `$am_make -s -f confmf 2> /dev/null` in #(
2903 *the\ am__doit\ target*)
2904 am__include=.include
2910 AC_SUBST([am__include])
2911 AC_SUBST([am__quote])
2912 AC_MSG_RESULT([$_am_result])
2913 rm -f confinc confmf
2916 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
2918 # Copyright (C) 1997-2014 Free Software Foundation, Inc.
2920 # This file is free software; the Free Software Foundation
2921 # gives unlimited permission to copy and/or distribute it,
2922 # with or without modifications, as long as this notice is preserved.
2924 # AM_MISSING_PROG(NAME, PROGRAM)
2925 # ------------------------------
2926 AC_DEFUN([AM_MISSING_PROG],
2927 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2928 $1=${$1-"${am_missing_run}$2"}
2931 # AM_MISSING_HAS_RUN
2932 # ------------------
2933 # Define MISSING if not defined so far and test if it is modern enough.
2934 # If it is, set am_missing_run to use it, otherwise, to nothing.
2935 AC_DEFUN([AM_MISSING_HAS_RUN],
2936 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2937 AC_REQUIRE_AUX_FILE([missing])dnl
2938 if test x"${MISSING+set}" != xset; then
2941 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2943 MISSING="\${SHELL} $am_aux_dir/missing" ;;
2946 # Use eval to expand $SHELL
2947 if eval "$MISSING --is-lightweight"; then
2948 am_missing_run="$MISSING "
2951 AC_MSG_WARN(['missing' script is too old or missing])
2955 # Helper functions for option handling. -*- Autoconf -*-
2957 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
2959 # This file is free software; the Free Software Foundation
2960 # gives unlimited permission to copy and/or distribute it,
2961 # with or without modifications, as long as this notice is preserved.
2963 # _AM_MANGLE_OPTION(NAME)
2964 # -----------------------
2965 AC_DEFUN([_AM_MANGLE_OPTION],
2966 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2968 # _AM_SET_OPTION(NAME)
2969 # --------------------
2970 # Set option NAME. Presently that only means defining a flag for this option.
2971 AC_DEFUN([_AM_SET_OPTION],
2972 [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
2974 # _AM_SET_OPTIONS(OPTIONS)
2975 # ------------------------
2976 # OPTIONS is a space-separated list of Automake options.
2977 AC_DEFUN([_AM_SET_OPTIONS],
2978 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2980 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2981 # -------------------------------------------
2982 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2983 AC_DEFUN([_AM_IF_OPTION],
2984 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2986 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
2988 # This file is free software; the Free Software Foundation
2989 # gives unlimited permission to copy and/or distribute it,
2990 # with or without modifications, as long as this notice is preserved.
2994 # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
2995 # to automatically call this.
2996 AC_DEFUN([_AM_PROG_CC_C_O],
2997 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2998 AC_REQUIRE_AUX_FILE([compile])dnl
2999 AC_LANG_PUSH([C])dnl
3001 [whether $CC understands -c and -o together],
3002 [am_cv_prog_cc_c_o],
3003 [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
3004 # Make sure it works both with $CC and with simple cc.
3005 # Following AC_PROG_CC_C_O, we do the test twice because some
3006 # compilers refuse to overwrite an existing .o file with -o,
3007 # though they will create one.
3008 am_cv_prog_cc_c_o=yes
3010 if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
3011 && test -f conftest2.$ac_objext; then
3014 am_cv_prog_cc_c_o=no
3018 rm -f core conftest*
3020 if test "$am_cv_prog_cc_c_o" != yes; then
3021 # Losing compiler, so override with the script.
3022 # FIXME: It is wrong to rewrite CC.
3023 # But if we don't then we get into trouble of one sort or another.
3024 # A longer-term fix would be to have automake use am__CC in this case,
3025 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
3026 CC="$am_aux_dir/compile $CC"
3030 # For backward compatibility.
3031 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
3033 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
3035 # This file is free software; the Free Software Foundation
3036 # gives unlimited permission to copy and/or distribute it,
3037 # with or without modifications, as long as this notice is preserved.
3039 # AM_RUN_LOG(COMMAND)
3040 # -------------------
3041 # Run COMMAND, save the exit status in ac_status, and log it.
3042 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
3043 AC_DEFUN([AM_RUN_LOG],
3044 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
3045 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
3047 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
3048 (exit $ac_status); }])
3050 # Check to make sure that the build environment is sane. -*- Autoconf -*-
3052 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
3054 # This file is free software; the Free Software Foundation
3055 # gives unlimited permission to copy and/or distribute it,
3056 # with or without modifications, as long as this notice is preserved.
3060 AC_DEFUN([AM_SANITY_CHECK],
3061 [AC_MSG_CHECKING([whether build environment is sane])
3062 # Reject unsafe characters in $srcdir or the absolute working directory
3063 # name. Accept space and tab only in the latter.
3067 *[[\\\"\#\$\&\'\`$am_lf]]*)
3068 AC_MSG_ERROR([unsafe absolute working directory name]);;
3071 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
3072 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
3075 # Do 'set' in a subshell so we don't clobber the current shell's
3076 # arguments. Must try -L first in case configure is actually a
3077 # symlink; some systems play weird games with the mod time of symlinks
3078 # (eg FreeBSD returns the mod time of the symlink's containing
3082 for am_try in 1 2; do
3083 echo "timestamp, slept: $am_has_slept" > conftest.file
3084 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
3085 if test "$[*]" = "X"; then
3087 set X `ls -t "$srcdir/configure" conftest.file`
3089 if test "$[*]" != "X $srcdir/configure conftest.file" \
3090 && test "$[*]" != "X conftest.file $srcdir/configure"; then
3092 # If neither matched, then we have a broken ls. This can happen
3093 # if, for instance, CONFIG_SHELL is bash and it inherits a
3094 # broken ls alias from the environment. This has actually
3095 # happened. Such a system could not be considered "sane".
3096 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
3097 alias in your environment])
3099 if test "$[2]" = conftest.file || test $am_try -eq 2; then
3106 test "$[2]" = conftest.file
3112 AC_MSG_ERROR([newly created file is older than distributed files!
3113 Check your system clock])
3115 AC_MSG_RESULT([yes])
3116 # If we didn't sleep, we still need to ensure time stamps of config.status and
3117 # generated files are strictly newer.
3119 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
3123 AC_CONFIG_COMMANDS_PRE(
3124 [AC_MSG_CHECKING([that generated files are newer than configure])
3125 if test -n "$am_sleep_pid"; then
3126 # Hide warnings about reused PIDs.
3127 wait $am_sleep_pid 2>/dev/null
3129 AC_MSG_RESULT([done])])
3133 # Copyright (C) 2009-2014 Free Software Foundation, Inc.
3135 # This file is free software; the Free Software Foundation
3136 # gives unlimited permission to copy and/or distribute it,
3137 # with or without modifications, as long as this notice is preserved.
3139 # AM_SILENT_RULES([DEFAULT])
3140 # --------------------------
3141 # Enable less verbose build rules; with the default set to DEFAULT
3142 # ("yes" being less verbose, "no" or empty being verbose).
3143 AC_DEFUN([AM_SILENT_RULES],
3144 [AC_ARG_ENABLE([silent-rules], [dnl
3146 [--enable-silent-rules],
3147 [less verbose build output (undo: "make V=1")])
3149 [--disable-silent-rules],
3150 [verbose build output (undo: "make V=0")])dnl
3152 case $enable_silent_rules in @%:@ (((
3153 yes) AM_DEFAULT_VERBOSITY=0;;
3154 no) AM_DEFAULT_VERBOSITY=1;;
3155 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
3158 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
3159 dnl do not support nested variable expansions.
3160 dnl See automake bug#9928 and bug#10237.
3161 am_make=${MAKE-make}
3162 AC_CACHE_CHECK([whether $am_make supports nested variables],
3163 [am_cv_make_support_nested_variables],
3164 [if AS_ECHO([['TRUE=$(BAR$(V))
3170 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
3171 am_cv_make_support_nested_variables=yes
3173 am_cv_make_support_nested_variables=no
3175 if test $am_cv_make_support_nested_variables = yes; then
3176 dnl Using '$V' instead of '$(V)' breaks IRIX make.
3178 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
3180 AM_V=$AM_DEFAULT_VERBOSITY
3181 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
3184 AM_SUBST_NOTMAKE([AM_V])dnl
3185 AC_SUBST([AM_DEFAULT_V])dnl
3186 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
3187 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
3189 AC_SUBST([AM_BACKSLASH])dnl
3190 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
3193 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
3195 # This file is free software; the Free Software Foundation
3196 # gives unlimited permission to copy and/or distribute it,
3197 # with or without modifications, as long as this notice is preserved.
3199 # AM_PROG_INSTALL_STRIP
3200 # ---------------------
3201 # One issue with vendor 'install' (even GNU) is that you can't
3202 # specify the program used to strip binaries. This is especially
3203 # annoying in cross-compiling environments, where the build's strip
3204 # is unlikely to handle the host's binaries.
3205 # Fortunately install-sh will honor a STRIPPROG variable, so we
3206 # always use install-sh in "make install-strip", and initialize
3207 # STRIPPROG with the value of the STRIP variable (set by the user).
3208 AC_DEFUN([AM_PROG_INSTALL_STRIP],
3209 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
3210 # Installed binaries are usually stripped using 'strip' when the user
3211 # run "make install-strip". However 'strip' might not be the right
3212 # tool to use in cross-compilation environments, therefore Automake
3213 # will honor the 'STRIP' environment variable to overrule this program.
3214 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
3215 if test "$cross_compiling" != no; then
3216 AC_CHECK_TOOL([STRIP], [strip], :)
3218 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
3219 AC_SUBST([INSTALL_STRIP_PROGRAM])])
3221 # Copyright (C) 2006-2014 Free Software Foundation, Inc.
3223 # This file is free software; the Free Software Foundation
3224 # gives unlimited permission to copy and/or distribute it,
3225 # with or without modifications, as long as this notice is preserved.
3227 # _AM_SUBST_NOTMAKE(VARIABLE)
3228 # ---------------------------
3229 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
3230 # This macro is traced by Automake.
3231 AC_DEFUN([_AM_SUBST_NOTMAKE])
3233 # AM_SUBST_NOTMAKE(VARIABLE)
3234 # --------------------------
3235 # Public sister of _AM_SUBST_NOTMAKE.
3236 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
3238 # Check how to create a tarball. -*- Autoconf -*-
3240 # Copyright (C) 2004-2014 Free Software Foundation, Inc.
3242 # This file is free software; the Free Software Foundation
3243 # gives unlimited permission to copy and/or distribute it,
3244 # with or without modifications, as long as this notice is preserved.
3246 # _AM_PROG_TAR(FORMAT)
3247 # --------------------
3248 # Check how to create a tarball in format FORMAT.
3249 # FORMAT should be one of 'v7', 'ustar', or 'pax'.
3251 # Substitute a variable $(am__tar) that is a command
3252 # writing to stdout a FORMAT-tarball containing the directory
3254 # tardir=directory && $(am__tar) > result.tar
3256 # Substitute a variable $(am__untar) that extract such
3257 # a tarball read from stdin.
3258 # $(am__untar) < result.tar
3260 AC_DEFUN([_AM_PROG_TAR],
3261 [# Always define AMTAR for backward compatibility. Yes, it's still used
3262 # in the wild :-( We should find a proper way to deprecate it ...
3263 AC_SUBST([AMTAR], ['$${TAR-tar}'])
3265 # We'll loop over all known methods to create a tar archive until one works.
3266 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
3269 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
3273 [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
3274 # There is notably a 21 bits limit for the UID and the GID. In fact,
3275 # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
3277 am_max_uid=2097151 # 2^21 - 1
3278 am_max_gid=$am_max_uid
3279 # The $UID and $GID variables are not portable, so we need to resort
3280 # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
3281 # below are definitely unexpected, so allow the users to see them
3282 # (that is, avoid stderr redirection).
3283 am_uid=`id -u || echo unknown`
3284 am_gid=`id -g || echo unknown`
3285 AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
3286 if test $am_uid -le $am_max_uid; then
3287 AC_MSG_RESULT([yes])
3292 AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
3293 if test $am_gid -le $am_max_gid; then
3294 AC_MSG_RESULT([yes])
3303 [m4_fatal([Unknown tar format])])
3305 AC_MSG_CHECKING([how to create a $1 tar archive])
3307 # Go ahead even if we have the value already cached. We do so because we
3308 # need to set the values for the 'am__tar' and 'am__untar' variables.
3309 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
3311 for _am_tool in $_am_tools; do
3314 for _am_tar in tar gnutar gtar; do
3315 AM_RUN_LOG([$_am_tar --version]) && break
3317 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
3318 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
3319 am__untar="$_am_tar -xf -"
3322 # Must skip GNU tar: if it does not support --format= it doesn't create
3323 # ustar tarball either.
3324 (tar --version) >/dev/null 2>&1 && continue
3325 am__tar='tar chf - "$$tardir"'
3326 am__tar_='tar chf - "$tardir"'
3327 am__untar='tar xf -'
3330 am__tar='pax -L -x $1 -w "$$tardir"'
3331 am__tar_='pax -L -x $1 -w "$tardir"'
3335 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
3336 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
3337 am__untar='cpio -i -H $1 -d'
3346 # If the value was cached, stop now. We just wanted to have am__tar
3347 # and am__untar set.
3348 test -n "${am_cv_prog_tar_$1}" && break
3350 # tar/untar a dummy directory, and stop if the command works.
3353 echo GrepMe > conftest.dir/file
3354 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
3356 if test -s conftest.tar; then
3357 AM_RUN_LOG([$am__untar <conftest.tar])
3358 AM_RUN_LOG([cat conftest.dir/file])
3359 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
3364 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
3365 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
3368 AC_SUBST([am__untar])
3371 m4_include([m4/libtool.m4])
3372 m4_include([m4/ltoptions.m4])
3373 m4_include([m4/ltsugar.m4])
3374 m4_include([m4/ltversion.m4])
3375 m4_include([m4/lt~obsolete.m4])